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
#!/usr/bin/env perl | |
use strict; | |
use AE;use EV; | |
use Guard; | |
use Time::HiRes; | |
use POSIX 'strftime'; | |
sub ae_loop(&&$$); |
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
#!/usr/bin/env perl | |
use strict; | |
use 5.010; | |
use AnyEvent; | |
use Time::HiRes 'time'; | |
sub async (&) { | |
my $code = shift; | |
my $t;$t = AE::timer 0,0,sub { undef $t;$code->(); } |
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
#!/usr/bin/env perl | |
use strict; | |
use 5.010; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
use Time::HiRes 'time'; | |
my $records = [ (1)x4e3 ]; | |
my $i = 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
#include <ev.h> | |
#include <ares.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
#include <stdarg.h> |
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
--- LAPHLibs/MD5.lua 2013-09-14 17:35:11.195354277 +0400 | |
+++ MD5.lua 2013-09-14 18:00:48.844139663 +0400 | |
@@ -9,6 +9,8 @@ | |
local lshift = bit.lshift | |
-require "memutils" | |
-require "stringzutils" | |
+dofile("memutils.lua") | |
+dofile("stringzutils.lua") | |
+--require "memutils" |
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
$job = sub { | |
tcp_connect …, sub { | |
my $fh = shift or warn "failed: $!"; | |
my $h = AnyEvent::Handle->new( | |
fh => $fh, | |
on_error => sub { ... }, | |
); | |
my $id = int(rand(0xffffffff)); | |
my $body = ...; | |
$h->push_write( pack('VVV',1,length $body, $id) ); |
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
if avd == nil then | |
avd = { version = 1.0 }; | |
else | |
avd.version = 1.0 | |
end | |
-- work with sessions user | |
function avd.session () | |
box.fiber.detach() | |
box.fiber.name("avd.session") |
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
if gr == nil then | |
gr = { version = 1.0 }; | |
else | |
gr.version = 1.0 | |
end | |
-- gr['defschema'] = '1s30s 1s7d 1m3M' | |
gr['defschema'] = '1s30s' | |
gr['defagg'] = 'avg' | |
gr.port = 22003 |
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
0020 # SPACE | |
0021 ! # EXCLAMATION MARK | |
0022 " # QUOTATION MARK | |
0023 # # NUMBER SIGN | |
0024 $ # DOLLAR SIGN | |
0025 % # PERCENT SIGN | |
0026 & # AMPERSAND | |
0027 ' # APOSTROPHE | |
0028 ( # LEFT PARENTHESIS | |
0029 ) # RIGHT PARENTHESIS |
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
/* | |
* Usage: | |
my $x = XSTesting::makecb("my arg for x"); | |
my $y = XSTesting::makecb("my arg for y"); | |
say $x->(); | |
say $y->(); | |
*/ |