Skip to content

Instantly share code, notes, and snippets.

View ufobat's full-sized avatar

Martin Barth ufobat

  • Nürnberg, Germany
View GitHub Profile
martin@thetis ~/.workspace/p6/Creator
% cat CreatorOfHuman.pm6
use v6;
use Human;
role CreatorOfHuman {
method create_human(Str $name) {
return Human.new(:$name);
}
class F {
method bla (Str:D $foo, Int $a) {
say "xx $foo $a";
}
method curry(Str:D $method, *@a) {
return self.^method_table{$method}.assuming(self, |@a);
}
}
multi sub b($scalar) { say "scalar" };
multi sub b(Str :$t!, *@p) { say "t" };
b(t => '2', 'foo');
#martin@thetis ~/.workspace/p6 % perl6 singature.p6
#Unexpected named parameter 't' passed
# in sub b at singature.p6 line 1
class Strange {
has $.env is rw;
method reset($env) {
$.env = $env ;
}
}
class Context {
has $!env;
has $.strange = Strange.new;
$promise.then({
try {
my (Int() $status, List() $headers, Supply() $body) := $promise.result;
self.handle-inner($status, $headers, $body, $conn, :$ready, :$header-done, :$body-done);
# consume and discard the bytes in the iput stream, just in case the app
# didn't read from it.
%env<p6w.input>.tap if %env<p6w.input> ~~ Supply:D;
CATCH {
default {
my $supplier = Supplier.new;
my $supply = $supplier.Supply;
my $buff;
$supply.tap(-> $v {say "recv: $v"; $buff ~= $v}, done => sub {"supply done"});
$supplier.emit(1);
$supplier.emit(2);
$supplier.emit(3);
martin@thetis ~/.workspace/p6 % perl6 -Ip6-HTTP-Server-P6W/lib -IHTTP-Supply/lib -IBailador/lib -IVoteImproved/lib VoteImproved/bin/VoteImproved.p6
Entering the development dance floor: http://0.0.0.0:3000
invoking app with env:
{:HTTP_ACCEPT("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"), :HTTP_ACCEPT_ENCODING("gzip, deflate, sdch"), :HTTP_ACCEPT_LANGUAGE("de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4"), :HTTP_CONNECTION("keep-alive"), :HTTP_COOKIE("bailador=46b4cdd812633dda9f700f8b74d04f33--9eba0c200c25f657c69d423abb75e5dd"), :HTTP_HOST("localhost:3000"), :HTTP_UPGRADE_INSECURE-REQUESTS("1"), :HTTP_USER_AGENT("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.26 Safari/537.36"), :REQUEST_METHOD("GET"), :REQUEST_URI("/"), :SERVER_PROTOCOL("HTTP/1.1"), "p6w.input" => Supply.new}
Session ID HMAC mismatch - someone trying to guess session IDs
martin@thetis ~/.workspace/p6 % echo $?
141
martin@thetis ~/.workspace/p6 % perl6 -v
This is Rakudo version 201
martin@psyche:~$ rakudobrew build zef
Ihr Branch ist auf dem selben Stand wie 'origin/master'.
Failed running /home/martin/.rakudobrew/bin/../moar-nom/install/bin/perl6 -Ilib bin/zef -v install . at /home/martin/.rakudobrew/bin/rakudobrew line 58.
main::run("/home/martin/.rakudobrew/bin/../moar-nom/install/bin/perl6 -I"...) called at /home/martin/.rakudobrew/bin/rakudobrew line 548
main::build_zef() called at /home/martin/.rakudobrew/bin/rakudobrew line 355
main::build_impl("zef", undef, "") called at /home/martin/.rakudobrew/bin/rakudobrew line 116
martin@psyche:~$ cd .rakudobrew/
.git/ bin/ git_reference/ moar-nom/
martin@psyche:~$ cd .rakudobrew/moar-nom/zef/
martin@psyche:~/.workspace/p6/zef$ perl6-gdb-m -Ilib bin/zef install .
================================================================================================
This is Rakudo Perl 6 running in the GNU debugger, which often allows the user to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.
This Rakudo version is 2016.09 built on MoarVM version 2016.09,
running on ubuntu (16.04.1.LTS.Xenial.Xerus) / linux (4.4.0.43.generic)
Type `bt full` to generate a backtrace if applicable, type `q` to quite or `help` for help.
------------------------------------------------------------------------------------------------
use v6.c;
unit class Dancr;
use Bailador;
use DBIish;
use LWP::Simple;
my %settings;