Skip to content

Instantly share code, notes, and snippets.

View hryk's full-sized avatar
🏠
Working from home

Hiroyuki Nakamura hryk

🏠
Working from home
View GitHub Profile
@hryk
hryk / KVS 090220
Created February 20, 2009 17:27
key-value storage勉強会メモ
---
senna:
- Groonga
- sennaの後継
- memcached binary protocol互換のストレージ
- 柔軟かつ高速
- DB的な感じにもできる
- DB APIでテーブル定義とかできる。言語バインドは今schemeだけど書けるらしい。
- http://groonga.org/
luxIO:
#!/usr/local/bin/perl
use strict;
use warnings;
use Math::GSL::Statistics qw/:all/;
# gsl113.pdf p315
# 20.9 中央値と百分位数
#
# gsl_stats_quantile_from_sorted_data($sorted_data, $stride, $n, $f)
#
@hryk
hryk / fastping_sample.pl
Created December 23, 2009 08:29
ping sample with AnyEvent::FastPing
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent;
use AnyEvent::FastPing;
use Data::Dumper;
my $done = AnyEvent->condvar;
#!/usr/bin/perl
use strict;
use warnings;
use Digest::SHA1 qw/sha1_hex/;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use Data::Dumper;
my @ascii = map {pack 'C', $_} ord('a')..ord('z');
push @ascii, ('-', '_');
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Array::Utils qw/:all/;
sub print_machi {
my @hai = @_;
my $machi = pop @hai;
for my $ans (@hai) {
@hryk
hryk / nise_permutate.pl
Created April 13, 2010 08:56
順列 perl
#!/usr/bin/perl
use strict;
use warnings;
my $main = sub {
my $h = shift;
print $h."\n";
};
var nise_permutate = function(list, subref, length) {
nestf = function(arg, arg1) {
nestfor(list, arg, arg1);
};
for (var i=0;i<length;i++) {
subref = gen(subref);
}
nestf(subref, '');
};
@hryk
hryk / permutation2.js
Created April 13, 2010 16:15
順列 javascript
var Permutate = function(list, length){
this.set = list;
if (typeof(length) == "number") {
this.len = length - 1;
}
else if (typeof(length) == "object") {
this.len = length; /* in case of Array */
}
}
Permutate.prototype = {
development:
adapter: master_slave
master:
adapter: mysql
database: master
host: master_server
slave:
adapter: mysql
database: slave
host: localhost
javascript:(function(){document.body.appendChild(document.createElement('script')).setAttribute('src','http://www.mendeley.com/min.php/bookmarklet');})();