Skip to content

Instantly share code, notes, and snippets.

diff --git a/config/init/hints/darwin.pm b/config/init/hints/darwin.pm
index 0c1c74d..2085be6 100644
--- a/config/init/hints/darwin.pm
+++ b/config/init/hints/darwin.pm
@@ -212,7 +212,7 @@ sub _probe_for_fink {
my %addl_flags = (
linkflags => "-L$fink_lib_dir",
ldflags => "-L$fink_lib_dir",
- ccflags => "-I$fink_include_dir",
+ ccflags => "-isystem $fink_include_dir",
@gerdr
gerdr / gist:2204236
Created March 26, 2012 09:53
GCC header lookup order

Searched by #include "foo.h"

  • current directory
  • directories addded via -iquote

Searched by both #include "foo.h" and #include <foo.h>

  • directories added via -I

Searched by both #include "foo.h" and #include and considered system headers, ie warnings will be ignored

@gerdr
gerdr / 99.pl
Created May 6, 2012 15:36
99 Bottles of Beer, lyrics from 99-bottles-of-beer.net
use v6;
my @bottles = ((99...2) X~ ' bottles'),
'1 bottle',
'no more bottles',
'99 bottles';
my @actions = 'Take one down and pass it around' xx 99,
'Go to the store and buy some more';
@gerdr
gerdr / gist:2623550
Created May 6, 2012 18:01
perl6-examples/shootout
$ time perl n-body.p5.pl 1000
real 0m0.109s
user 0m0.062s
sys 0m0.046s
$ time perl6 n-body.p6.pl 1000
real 0m20.322s
user 0m20.232s
sys 0m0.077s
@gerdr
gerdr / NOTES
Created May 7, 2012 09:07
high-level version of n-body benchmark
faster than the original low-level solution
native num instead of Num actually hurts performance
BUGS:
segfaults if $n is too large (50000000)
can't overload += and -=
+= and -= are slower than =/+ and =/- for Num variables
default BUILD can't deal with native types
+= and -= can't deal with native types
@gerdr
gerdr / rat2str.pl
Created May 11, 2012 12:59
Rat to Str
use v6;
sub rat2str(Rat $rat is copy, :$base = 10) {
my @str;
if $rat < 0 {
@str.push('-');
$rat = -$rat;
}
my ($num, $denom) = $rat.nude;
@gerdr
gerdr / gist:2689176
Created May 13, 2012 16:23
Parrot warnings on Win64
src/debug.c: In function 'PDB_disassemble_op':
src/debug.c:2661: warning: unknown conversion type character 'l' in format
src/debug.c:2661: warning: too many arguments for format
src/runcore/subprof.c: In function 'dump_profile_data':
src/runcore/subprof.c:855: warning: unknown conversion type character 'l' in format
src/runcore/subprof.c:855: warning: too many arguments for format
src/runcore/subprof.c:857: warning: unknown conversion type character 'l' in format
src/runcore/subprof.c:857: warning: too many arguments for format
src/runcore/subprof.c:857: warning: unknown conversion type character 'l' in format
src/runcore/subprof.c:857: warning: too many arguments for format
use v6;
my $input = slurp;
my $data = $input.lines.grep({ $_ !~~ /^ \>/}).join.lc;
say $_ ~ ' ' ~ +$data.comb($_) for
/agggtaaa|tttaccct/ but 'agggtaaa|tttaccct',
/<[cgt]>gggtaaa|tttaccc<[acg]>/ but '[cgt]gggtaaa|tttaccc[acg]',
/a<[act]>ggtaaa|tttacc<[agt]>t/ but 'a[act]ggtaaa|tttacc[agt]t',
/ag<[act]>gtaaa|tttac<[agt]>ct/ but 'ag[act]gtaaa|tttac[agt]ct',
@gerdr
gerdr / gist:2721537
Created May 17, 2012 20:55
Status of threads branch on Windows7/MinGW-w64 via Strawberry Perl
hangs while maxing out 1 core:
t/pmc/timer.t 1/17
t/src/threads.t 1/21
hangs while maxing out 2 cores:
t/src/threads_io.t 1/4
---
---
@gerdr
gerdr / threads.txt
Created May 18, 2012 20:10
Parrot threads Win64 debug output
Commands:
parrot t/pmc/timer.t >timer.txt 2>&1
parrot t/src/threads.t >threads.txt 2>&1
perl t/src/threads_io.t >threads_io.txt 2>&1
only t/pmc/timer.t needs to be killed (maxes out one core)