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(matrix). | |
-compile(export_all). | |
random(Size, MaxValue) -> | |
random(0, 0, Size, MaxValue, [], []). | |
-define(VALUE(X, Y), value(X, Y, MaxValue)). | |
value(X, X, _MaxValue) -> |
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 python | |
import hashlib | |
for i in xrange(1, 1000000): | |
m = hashlib.sha1() | |
m.update("test") | |
m.digest() |
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 python | |
import hashlib | |
for i in xrange(1, 1000000): | |
m = hashlib.sha1() | |
m.update("test") | |
m.digest() |
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
while true; do | |
avahi-publish -s test@b _http._tcp 7778 & | |
sleep 3s | |
killall avahi-publish | |
sleep 1s | |
killall avahi-publish | |
done |
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
websocket_handle_incoming_data(Data, #state{ws = WsState = #websocket_state{module = Mod, parser_state = WsParserState}, socket=Socket} = State) -> | |
WsCallback = fun handle_stream/2, | |
case Mod:handle_data(Data, WsParserState, {Socket, http}, State, WsCallback) of | |
{State2, websocket_close} -> | |
{stop, normal, State2}; | |
{State2, websocket_close, CloseData} -> | |
State3 = websocket_send(CloseData, State2), | |
{stop, normal, State3}; | |
{State2, continue, WsParsesState2} -> | |
inet:setopts(Socket, [{packet, raw}, {active, once}]), |
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
[ 5471.899] [mi] EQ overflowing. The server is probably stuck in an infinite loop. | |
[ 5471.899] | |
Backtrace: | |
[ 5471.951] 0: /usr/bin/X (xorg_backtrace+0x37) [0x80a66f7] | |
[ 5471.951] 1: /usr/bin/X (mieqEnqueue+0x1d1) [0x80a06b1] | |
[ 5471.951] 2: /usr/bin/X (xf86PostMotionEventM+0xb0) [0x80c7e60] | |
[ 5471.951] 3: /usr/lib/xorg/modules/input/evdev_drv.so (0xb6d33000+0x35ed) [0xb6d365ed] | |
[ 5471.951] 4: /usr/lib/xorg/modules/input/evdev_drv.so (0xb6d33000+0x531d) [0xb6d3831d] | |
[ 5471.951] 5: /usr/lib/xorg/modules/input/evdev_drv.so (0xb6d33000+0x5b85) [0xb6d38b85] | |
[ 5471.951] 6: /usr/bin/X (0x8048000+0x6cb81) [0x80b4b81] |
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
gleber@first:~/code/opensource$ git clone [email protected]:gleber/exat.git exat | |
Cloning into exat... | |
remote: Counting objects: 240, done. | |
remote: Compressing objects: 100% (148/148), done. | |
remote: Total 240 (delta 125), reused 202 (delta 87) | |
Receiving objects: 100% (240/240), 705.27 KiB | 172 KiB/s, done. | |
Resolving deltas: 100% (125/125), done. | |
gleber@first:~/code/opensource$ cd exat | |
gleber@first:~/code/opensource/exat$ make deps all | |
./rebar get-deps |
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
%% Analysis results: | |
{ analysis_options, | |
[{callers, false}, | |
{sort, own}, | |
{totals, true}, | |
{details, false}]}. | |
% CNT ACC OWN | |
[{ totals, 6985519,124011.127,1236847.232}]. %%% |
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
# -*- mode: Makefile; fill-column: 80; comment-column: 75; -*- | |
ERL = $(shell which erl) | |
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin | |
REBAR=$(shell which rebar) | |
ifeq ($(REBAR),) | |
$(error "Rebar not available on this system") |
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
1> F1 = future:new(fun() -> timer:sleep(3000), 10 end). | |
{future,<0.36.0>,#Ref<0.0.0.1660>,undefined} | |
2> F2 = future:new(fun() -> timer:sleep(3000), 5 end). | |
{future,<0.39.0>,#Ref<0.0.0.2014>,undefined} | |
3> F2:get() * F1:get(). | |
50 |
OlderNewer