This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <w> | |
int main(int argc, char const *argv[]) | |
{ | |
w::App app { argc, argv }; | |
app.get("/hello", [](w::Request&) { return w::render_text("Hello world"); }); | |
return app.run(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/mman.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define PAGESIZE 4096 | |
typedef unsigned char byte; | |
int main (int argc, char const *argv[]) | |
{ | |
byte* a = (byte*)malloc(PAGESIZE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.instance_prototype.detect: [block] { | |
cc: Kernel.cc | |
.each { cc.return(it) if block(it) } | |
false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
real 0m0.506s | |
user 0m0.498s | |
sys 0m0.003s | |
real 0m0.503s | |
user 0m0.495s | |
sys 0m0.003s | |
real 0m0.510s | |
user 0m0.499s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
real 0m0.687s | |
user 0m0.677s | |
sys 0m0.004s | |
real 0m0.683s | |
user 0m0.674s | |
sys 0m0.004s | |
real 0m0.673s | |
user 0m0.663s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int n = 0; | |
int make(int t) { return t; } | |
void foo_a() { ++n; } | |
void foo_b() { ++n; } | |
void foo_c() { ++n; } | |
void foo_d() { ++n; } | |
int foo(int t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int n = 0; | |
class A { | |
public: | |
virtual void foo() { | |
++n; | |
} | |
}; | |
class B : public A { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj.set_instance_var(:@foo, 123) | |
@foo = 456 | |
obj.instance_eval { | |
puts @foo #=> 123 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a: 123 | |
foo: { | |
a: 456 | |
} | |
foo() | |
puts(a) // 123 eller 456? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo: [a, b, *rest] { | |
bar: [*args] { | |
baz(*rest, *args) | |
local a, b: *args | |
} | |
} |
NewerOlder