Skip to content

Instantly share code, notes, and snippets.

View tadzik's full-sized avatar
🐴

Tadeusz Sośnierz tadzik

🐴
View GitHub Profile
@tadzik
tadzik / 1.md
Last active March 15, 2019 12:43

1

Zwykliśmy się zastanawiać, co jest straszniejsze: świadomość, że nie jesteśmy sami we wszechświecie, czy też idea mówiąca, że jesteśmy. Osobiście dodałbym do tego zestawu trzecią opcję: co jeśli umrzemy nie poznając odpowiedzi?

Jasnoczerwone światło. Ten charakterystyczny szum, gdy zdaję się słyszeć całą „maszynerię” wewnątrz swojego organizmu. Dopiero później docierają do mnie dźwięki otoczenia, charakterystyczne piski i buczenie urządzeń medycznych. Ostrożnie otwieram oczy.

#!/usr/bin/env perl6
use lib 'lib';
use Module::Toolkit;
my $mt = Module::Toolkit.new;
multi MAIN('is-installed', $what) {
say $mt.is-installed: $what;
}
use NativeCall;
sub strlen(Str) is native returns Int { * }
my $start = pir::time__N();
for 1..50000 {
strlen("");
}
say "Tests took {pir::time__N() - $start}";
--- ff.pl.orig 2014-01-22 18:40:35.873613777 +0100
+++ ff.pl 2014-01-22 18:41:50.677612299 +0100
@@ -5,7 +5,7 @@
my @show = (' ', '木', RED ~ '木' ~ CLEAR);
class Forest {
- has Cell-State @!grid;
+ has @!grid;
has @!neighbors;
has Int $.height;
diff --git a/src/core/IO.pm b/src/core/IO.pm
index 41178d1..a5be639 100644
--- a/src/core/IO.pm
+++ b/src/core/IO.pm
@@ -505,6 +505,7 @@ my class IO::Path is Cool does IO::FileTestable {
$elem := $elem.substr($*CWD.chars + 1) if self.is-relative;
#?endif
#?if moar
+ next unless $elem ~~ $test;
$elem := $.SPEC.catfile($!path, $elem) if self.is-relative && self ne '.';
┌─[tadzik@yavin]─[~/src/github.com/tadzik/File-Find] (master)*
└─[%]─> rakudobrew switch moar
Switching to moar-HEAD
Updating shims
┌─[tadzik@yavin]─[~/src/github.com/tadzik/File-Find] (master)*
└─[%]─> perl6 -e 'say dir("t/dir1/").perl'
(IO::Path.new(path => "another_dir"), IO::Path.new(path => "file.foo"), IO::Path.new(path => "file.bar"), IO::Path.new(path => "foodir")).list
┌─[tadzik@yavin]─[~/src/github.com/tadzik/File-Find] (master)*
└─[%]─> rakudobrew switch parrot
Switching to parrot-HEAD
┌─[tadzik@yavin]─[~/src/github.com/tadzik/File-Find] (master)
└─[%]─> perl6 -Ilib t/01-file-find.t
here
here
here
1..10
Type check failed in bind; expected Str but got Failure
in any bind_error at src/vm/moar/Perl6/Ops.nqp:229
in block at src/gen/m-CORE.setting:13459
in sub at src/gen/m-CORE.setting:7475
#include <SDL.h>
#include <stdlib.h>
struct Game {
SDL_Surface *screen;
int key_states[SDLK_LAST];
int running;
};
int timer_cb(int interval)
(bla bla bla)
[pid 19581] open("/home/tadzik/src/github.com/tadzik/asteroids/sdlwrapper.so", O_RDONLY|O_CLOEXEC) = 3
[pid 19581] read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\t\0\0\0\0\0\0"..., 832) = 832
[pid 19581] fstat(3, {st_mode=S_IFREG|0775, st_size=18851, ...}) = 0
[pid 19581] mmap(NULL, 2101384, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ffb1a4f6000
[pid 19581] mprotect(0x7ffb1a4f7000, 2093056, PROT_NONE) = 0
[pid 19581] mmap(0x7ffb1a6f6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7ffb1a6f6000
[pid 19581] close(3) = 0
int load_texture(const char *file, int w, int h)
{
GLuint id;
glGenTextures(1, &id);
struct pixel px[w * h];
FILE *fh = fopen(file, "rb");
fseek(fh, 54L, SEEK_SET);
fread(&px, 3, w * h, fh);
fclose(fh);