This file contains 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
grammar BraceExpansion { | |
token TOP { ( <.normalchar>+ | <alt> )* } | |
token normalchar { \\. | <-[ { , } ]> } | |
token alt { | |
'{' ~ '}' <TOP>* % \, | |
} | |
} | |
sub crosswalk($/) { | |
[X~] $0.map: -> $/ { [$<alt><TOP>».&crosswalk] or ~$/ } |
This file contains 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> | |
int main() { | |
char n = 127; | |
printf("%d\n", n); | |
n++; | |
printf("%d\n", n); | |
return 0; | |
} |
This file contains 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
336,339c336,337 | |
< if (!params->use_fractal) { | |
< alter_co(v1, &e_tmp, params, 0, &v1_tmp, &v2_tmp); | |
< alter_co(v2, &e_tmp, params, 1.0, &v1_tmp, &v2_tmp); | |
< } | |
--- | |
> alter_co(v1, &e_tmp, params, 0, &v1_tmp, &v2_tmp); | |
> alter_co(v2, &e_tmp, params, 1.0, &v1_tmp, &v2_tmp); |
This file contains 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
$ perl6-m t/spec/S32-io/IO-Socket-INET.t | |
1..41 | |
# [0s] starting tests | |
# [0s] Testing on port 1024 | |
ok 1 - [7s] echo server and client | |
ok 2 - finished in time #1 | |
ok 3 - [6s] discard server and client | |
ok 4 - finished in time #2 | |
ok 5 - [6s] received first 7 characters | |
ok 6 - finished in time #3 |
This file contains 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
function H = hologram(V, m) | |
H = zeros(m, 1); | |
for index=1:length(V) | |
disp(index); | |
rand("seed", index); | |
R = rand(m, 1); | |
H += V(index)*exp(2*pi*R*i); | |
end | |
end |
This file contains 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
class Automaton { | |
my sub B($x) { 1 +< $x } | |
has uint $.rule; | |
has uint64 $.state; | |
method gist { $!state.fmt("%064b").flip } | |
method succ { | |
loop (my uint64 $st = my $i = 0; $i < 64; $i++) { | |
if ($!rule +& B(7 +& (($!state +> ($i - 1)) +| ($!state +< (65 - $i))))) { | |
$st = $st +| B($i); | |
} |
This file contains 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> | |
int main(int argc, char *argv[]) { | |
printf( "%u%s", 1ULL, " WTF " ); | |
} |
This file contains 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
constant MAX_ITERATIONS = 50; | |
my $height = @*ARGS[0] // 31; | |
$height = $height % 2 ?? +$height !! 1+$height; | |
my $width; | |
my $re = [ -2, 1/2 ]; | |
my $im = [ 0, 5/4 ]; | |
my $dre = ($re.max - $re.min) / ($height - 1); | |
my @re = $re.min, * + $dre ... $re.max; |
This file contains 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
diff --git a/t/05-arrays.t b/t/05-arrays.t | |
index ab9797e..a11f8d3 100644 | |
--- a/t/05-arrays.t | |
+++ b/t/05-arrays.t | |
@@ -49,7 +49,7 @@ compile_test_lib('05-arrays'); | |
{ | |
class Struct is repr('CStruct') { | |
- has int $.val; | |
+ has int32 $.val; |
This file contains 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
grammar PGN; | |
rule TOP { ^ <game>+ $ } | |
rule game { <info>+ <move>+ <adjudication>? } | |
rule info { '[' ~ ']' [ <tag> <string> ] } | |
token tag { <.alpha>+ } | |
token string { '"' .+? '"' } |
OlderNewer