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
[Hash w xmpbot.pm] ===> en { ping => asd, help => fasd} | |
|| | |
====> pl { ping => asd, pomoc => fasd } | |
|| | |
=====> de { ping => asd, hilfe => fasd } | |
pseudokod: | |
sub on_message (command, args, jid) { | |
if (lang = getlang(jid)) { |
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
[Hash w xmpbot.pm] ===> en { ping => asd, help => fasd} | |
|| | |
====> pl { ping => asd, pomoc => fasd } | |
|| | |
=====> de { ping => asd, hilfe => fasd } | |
pseudokod: | |
sub on_message (command, args, jid) { | |
if (lang = getlang(jid)) { |
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
module Digest::djb2; | |
sub hash(Buf $input) is export { | |
my Int $hash = 5381; # 5381 is one of two 'magic numbers' used in this algorithm | |
for 0..$input.elems-1 { | |
$hash = (($hash +< 5) + $hash) + $input[$_]; # 33 is second | |
} | |
return $hash; | |
} |
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
use v6; | |
sub notice (Str $what) { | |
say "\e[1m==> ", $what, "\e[0m"; | |
} | |
sub MAIN (Str $url) { | |
my $res; # for various run() calls | |
my $workdir = '.protominus.tmpdir'; | |
if $workdir.IO ~~ :e { |
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
package xmpbot::Plugin::Echo; | |
use Moose; | |
with 'xmpbot::Plugin'; | |
sub BUILD { | |
my $self = shift; | |
$self->register_command('echo'); | |
} | |
sub echo { |
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
use File::Copy; | |
use File::Find; | |
use File::Mkdir; | |
module Module::Install; | |
sub install(Str $dir = '.', Str $dest = "%*ENV<HOME>/.perl6/") is export { | |
if $*VM<config><osname> ne 'MSWin32' | |
&& "$dir/Makefile".IO ~~ :f { | |
run 'make install' and die "'make install' failed"; |
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
┌─[tadzik@yavin4]─[~/src/perl6-Module-Tools] | |
└─[%]─> PERL6LIB=lib perl6 -e 'use Module::Install; install()' | |
toying with ./lib/Module/Build.pir | |
target dir is /home/tadzik/.perl6/lib/Module | |
Starting copying, time is 1284230402 | |
Done copying, time is 1284230423 | |
toying with ./lib/Module/Install.pir | |
target dir is /home/tadzik/.perl6/lib/Module | |
Starting copying, time is 1284230423 | |
Done copying, time is 1284230432 |
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
ââ[tadzik@yavin4]â[~] | |
ââ[%]â> ck4up | |
/usr/bin/ck4up:187: [BUG] Segmentation fault | |
ruby 1.9.2p0 (2010-08-18 revision 29036) [linux] | |
-- control frame ---------- | |
c:0008 p:---- s:0033 b:0033 l:000032 d:000032 CFUNC :(null) | |
c:0007 p:---- s:0031 b:0031 l:000030 d:000030 CFUNC :digest | |
c:0006 p:---- s:0029 b:0029 l:000028 d:000028 CFUNC :hexdigest | |
c:0005 p:0137 s:0025 b:0024 l:000023 d:000023 METHOD /usr/bin/ck4up:187 |
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
my @s=<â ⣠⥠â¦>;my @r=2..10,<jack queen king ace>;my %v=:jack(10),:queen(10),:king(10),:ace(1|11);my @d=map {[$^s,$^r]},(@s X @r);@d.=pick(*);my @p=[],[];sub a(@c is rw){@c.unshift(@d.shift)};sub b(@c){my [email protected]({%v{.[1]}||.[1]}).reduce(*+*);$($v.grep({$_ <21}))||$v[0]};for @p {a($_);a($_)};for @p {say '-'x 33;loop {if b($_)>21 {say $_~' is over 21';last};say b($_);say ~$_;last if prompt('(h) hit (s) sit? ')~~'s';a($_)}};say "Winner: {[max]@p.grep({b($_) <=21})}"; |
OlderNewer