Skip to content

Instantly share code, notes, and snippets.

View erszcz's full-sized avatar

Radek Szymczyszyn erszcz

View GitHub Profile
@erszcz
erszcz / TestHashTableArtificial.hs
Created April 18, 2012 07:15
Map-like structure benchmarks
module TestHashTableArtificial where
import Control.Monad (forM_)
import qualified Data.HashTable as HashTable
-- ByteString IO
import Data.ByteString (ByteString)
import qualified Data.ByteString as ByteString
import qualified Data.ByteString.UTF8 as UTF8
@erszcz
erszcz / HMTTest.hs
Created June 5, 2012 18:17
Populating map from text data
module HMTTest where
--{ imports
import Control.Monad (forM_)
import qualified Data.HashMap.Strict as HM
import Data.Hashable (Hashable)
import Data.Hashable
@erszcz
erszcz / dbg trace log
Created June 22, 2012 13:43
Erlang zlib issue
(<0.455.0>) call zlib:open()
(<0.455.0>) returned from zlib:open/0 -> #Port<0.2787>
(<0.455.0>) call zlib:open()
(<0.455.0>) returned from zlib:open/0 -> #Port<0.2788>
(<0.455.0>) call zlib:inflateInit(#Port<0.2787>)
(<0.455.0>) returned from zlib:inflateInit/1 -> ok
(<0.455.0>) call zlib:deflateInit(#Port<0.2788>)
(<0.455.0>) returned from zlib:deflateInit/1 -> ok
(<0.453.0>) call zlib:module_info()
(<0.453.0>) call zlib:deflate(#Port<0.2788>,["<",<<"stream:stream">>,
@erszcz
erszcz / ejabberd-invalid-post.log
Created March 17, 2013 10:23
Log of an invalid POST request sent from a dynamic webapp bundled using PhoneGap and ran on Android 2.3. The first file is a log of `ejabberd` `mod_bosh` receiving an invalid POST request. The `Content-Length` header specifies body length of 269 (`{<<"content-length">>,<<"269">>}`), but trying to extract the body from the request fails with erro…
(ejabberd@localhost)8> dbg:tracer().
{ok,<0.786.0>}
(ejabberd@localhost)9> dbg:tpl().
** exception error: undefined function dbg:tpl/0
(ejabberd@localhost)10> dbg:p(all, call).
{ok,[{matched,ejabberd@localhost,399}]}
(ejabberd@localhost)11> dbg:tpl(mod_bosh, info, 3, x).
{ok,[{matched,ejabberd@localhost,1},{saved,x}]}
(ejabberd@localhost)12> dbg:tpl(cowboy_req, body, 1, x).
{ok,[{matched,ejabberd@localhost,1},{saved,x}]}
$ sudo ngrep -W byline -d wlan0 port 5280
interface: wlan0 (192.168.1.0/255.255.255.0)
filter: (ip or ip6) and ( port 5280 )
####
T 192.168.1.11:50308 -> 192.168.1.17:5280 [AP]
POST /http-bind/ HTTP/1.1.
Host: 192.168.1.17:5280.
@erszcz
erszcz / ejabberd.log
Created March 25, 2013 17:27
cowboy_req:stream_body_recv/1 returns {error,einval}
$ bin/ejabberd live
Exec: /home/erszcz/work/esl/ejabberd/dev/ejabberd_internal_mnesia/erts-5.9/bin/erlexec -boot /home/erszcz/work/esl/ejabberd/dev/ejabberd_internal_mnesia/releases/0.1/ejabberd -embedded -config /home/erszcz/work/esl/ejabberd/dev/ejabberd_internal_mnesia/etc/app.config -args_file /home/erszcz/work/esl/ejabberd/dev/ejabberd_internal_mnesia/etc/vm.args -- live
Root: /home/erszcz/work/esl/ejabberd/dev/ejabberd_internal_mnesia
Erlang R15B (erts-5.9) [source] [64-bit] [smp:8:8] [async-threads:5] [hipe] [kernel-poll:true]
2013-03-25 18:23:40.361 [info] <0.7.0> Application lager started on node ejabberd@localhost
2013-03-25 18:23:40.381 [notice] <0.174.0> Changed loglevel of log/ejabberd.log to info
2013-03-25 18:23:40.445 [info] <0.7.0> Application mnesia exited with reason: stopped
2013-03-25 18:23:40.534 [info] <0.7.0> Application mnesia started on node ejabberd@localhost
Eshell V5.9 (abort with ^G)
@erszcz
erszcz / arachne.js
Last active December 16, 2015 01:48
Historic SNA
/*jslint vars:true*/
/*global d3, $*/
var arachne = (function () {
"use strict";
var arachne = {
version: "0.0.1",
d3version: d3.version
};
@erszcz
erszcz / pack.erl
Last active August 29, 2015 13:55
pack jids
-module(pack).
-compile([export_all]).
-define(SETS, gb_sets).
-define(DICT, dict).
-record(state, {pres_t = ?SETS:new(),
pres_f = ?SETS:new(),
pres_a = ?SETS:new(),
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
@erszcz
erszcz / fibonacci.rs
Created June 15, 2014 14:11
Lazy Fibonacci generator in Rust
use std::iter::Unfold;
fn main() {
let it = fibonacci();
// prints the sequence
//for i in it.take(10) {
// print!("{} ", i)
//}