Skip to content

Instantly share code, notes, and snippets.

View kazupon's full-sized avatar
🦋
Focusing vue-i18n and Intlify

kazuya kawaguchi kazupon

🦋
Focusing vue-i18n and Intlify
View GitHub Profile
@kazupon
kazupon / a.lua
Created September 25, 2012 06:41
local debug = require('debug')
p('a:', __file__, __path__)
p(debug.getinfo(1, "Slf"))
local b = require('./b')
p('add:', b.add(1, 1))
lev.exit()
@kazupon
kazupon / gist:3768604
Created September 23, 2012 02:32
lev: MessagePack test segmentation fault
? lev.mpack: custom data: 130/130 within 105.822 ms
? lev.mpack: pack,unpack: integer negative fixnum: 64/64 within 0.129 ms
Program received signal SIGSEGV, Segmentation fault.
0x0000000000419f06 in lev_slab_decRef (block=0xe82760) at src/lev_slab.c:119
119 return block->refcount;
(gdb) bt
#0 0x0000000000419f06 in lev_slab_decRef (block=0xe82760) at src/lev_slab.c:119
#1 0x0000000000418a84 in buffer__gc (L=0x40000378) at src/lev_new_buffer.c:797
#2 0x00000000004796a6 in lj_BC_FUNCC ()
@kazupon
kazupon / bencmark_results.mdown
Created September 15, 2012 13:20
tokyo node gakuen 7 periods benchmark

requests per second

ab -n 2000 -c 1

Node

average: 1641.932

  • 1683.85
  • 1641.67
  • 1604.76
@kazupon
kazupon / gist:3716168
Created September 13, 2012 17:49
print_all_handles segfult ...
*lev core started: 37763
✔ udp_set_multicast_ttl: 257/257 within 0.291 ms
✔ udp_set_ttl: 257/257 within 0.167 ms
✔ udp_bind6: 1/1 within 0.021 ms
✔ udp_set_broadcast: 3/3 within 0.016 ms
✔ udp_bind_error: 2/2 within 0.016 ms
✔ udp_getsockname: 4/4 within 0.030 ms
✔ udp_set_multicast_loop: 3/3 within 0.016 ms
✔ udp_set_multicast_membership: 7/7 within 0.919 ms
✔ udp_ping_pong_test: 15/15 within 0.217 ms
@kazupon
kazupon / gist:3715938
Created September 13, 2012 17:18
core_print_all_handles segfault ...
✔ fs_link: 5/5 within 0.428 ms
✔ fs_fsync: 7/7 within 0.233 ms
✔ test core now: 2/2 within 0.007 ms
✔ test core get_process_title: 1/1 within 0.006 ms
[R--] timer 0x100330918
[---] <unknown> 0x4ddb0
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x000000010004022e in uv__print_handles (loop=0x1003306c0, only_active=0) at uv-common.c:348
for (var i = 0; i < 1e6; i++) {
b = new Buffer('hello world');
b[0] = 2;
}
# Machine spec
TODO:
# lev
* version: maglev branch (commit:b03a16d)
# luvit
* version: 0.5.0
@kazupon
kazupon / gist:3594902
Created September 2, 2012 04:52
lev gyp build error ...
RetinaMBP:lev kazupon$ ./configure --arch=x64
configure options: {'debug': None, 'without_ssl': None, 'prefix': '/usr/local', 'arch': 'x64', 'skinny': None}
creating ./options.gypi
Generating build system with GYP...
['/Users/kazupon/Projects/opensource/lev/all.gyp', '-I', '/Users/kazupon/Projects/opensource/lev/common.gypi', '-I', '/Users/kazupon/Projects/opensource/lev/options.gypi', '--depth=.', '-f', 'make', '-f', 'xcode', '--generator-output', '/Users/kazupon/Projects/opensource/lev/out', '-Goutput_dir=/Users/kazupon/Projects/opensource/lev/out', '-Dcomponent=static_library', '-Dlibrary=static_library']
Done!
Now run `make -C out` to build!
-- global variables
kt = __kyototycoon__
db = kt.db
function toboolean (v)
return (type(v) == 'string' and v == 'true') or (type(v) == 'number' and v ~= 0) or (type(v) == 'boolean' and v)
end
function usage (outmap)
@kazupon
kazupon / play_script.js
Created March 18, 2012 05:31
play_script sample
var KyotoTycoon = require('kyoto-tycoon').KyotoTycoon;
var kt = new KyotoTycoon();
kt.play_script('echo', { key: 'value' }, function (err, data) {
if (err) { // error
// Somthing todo ...
return;
}
// success