Public Gists by fuba

Gravatar
Wed Sep 09 12:25:14 -0700 2009
1
perl -e 'srand(time);my@data=map{int rand(10000000)}(0..100); my @c = map {int rand(6)} @data; for my $loop (0..30) {my %avg;my %num;for my $i (0..$#data){$avg{$c[$i]} += $data[$i];$num{$c[$i]}++;} map{$avg{$_}/=$num{$_}}keys %avg;for my $i(0..$#data){my$l = 0; for my $cl(keys%avg){$l=(abs($avg{$cl}-$data[$i]) < abs($avg{$l}-$data[$i])) ? $cl : $l} $c[$i]=$l } warn join " ","loop_${loop}|",map{$_->{c}.":".$_->{d}}sort{$avg{$a->{c}}<=>$avg{$b->{c}}}map{+{d=>$data[$_], c=>$c[$_]}}(0..$#c); }'
gist: 167287 known bug: サンプル画像が無いアイテムの画像...
Gravatar
Thu Aug 13 09:36:49 -0700 2009
1
2
3
#!/usr/bin/perl
use strict;
use warnings;
Gravatar
Thu Jul 02 15:23:43 -0700 2009
1
2
3
#!/usr/bin/perl
use strict;
use warnings;
Gravatar
Thu Jul 02 15:03:27 -0700 2009
1
2
3
perl ~/bin/sift_wrap.pl ~/Dropbox/sift_test/1.pgm 4 > 1_big.yaml && perl ~/bin/sift_wrap.pl ~/Dropbox/sift_test/1.jpg 4 > 1_small.yaml && perl -MYAML -e 'my$big=YAML::LoadFile(shift);my$small=YAML::LoadFile(shift);while(my($key,$value)=each %$big){printf("%s: %.01f %.01f\n", $key, $value, $small->{$key}) if $small->{$key}}' 1_big.yaml 1_small.yaml
4494ddeb1a323184102b9cfdc5455cbe: 0.0 0.0
473465015f3f6f4f620a8c7c476788aa: 0.0 0.0
Gravatar
Thu Jul 02 09:24:26 -0700 2009
1
2
3
package Net::TwitterStreamingAPI;
use utf8;
use strict;
Gravatar
Sun May 31 05:37:34 -0700 2009
1
2
3
// ==UserScript==
// @name YetAnotherHelpMeOnoMatope
// @namespace http://fuba.moaningnerds.org/
Gravatar
Fri May 08 15:15:05 -0700 2009
1
2
3
// ==UserScript==
// @name Courteous favorite on dashboard
// @namespace http://fuba.moarningnerds.org/
gist: 64483 cgi script to generate dire...
Gravatar
Sat Feb 14 13:35:55 -0800 2009
1
2
3
#!/usr/bin/perl
use utf8;
use strict;
Gravatar
Thu Feb 05 13:25:07 -0800 2009
1
2
3
sub is_my_reply {
    my $text = shift;
    
Gravatar
Thu Feb 05 13:09:35 -0800 2009
1
2
3
sub nonreply_filter {
    my $req = shift;
    
gist: 53291 I want to use the POST meth...
Gravatar
Tue Jan 27 02:53:24 -0800 2009
1
541 my $reqtype = ( ( $method_def->{post} ) || ( (defined $args) && $args->{post} ) ) ? "POST" : "GET";
Gravatar
Wed Jan 21 23:04:53 -0800 2009
1
2
3
sub capture_thumbnails {
    my %opt = @_;
    my $file = $opt{file} or die;
gist: 49376 please fix
Gravatar
Mon Jan 19 23:09:14 -0800 2009
1
2
3
plugins:
  - module: Subscription::Config
    config:
gist: 40029 exthtml.pl extracts content...
Gravatar
Fri Dec 26 01:14:00 -0800 2008
1
2
3
#!/usr/bin/perl
use strict;
use warnings;
gist: 39847 いま自分ではつかってないのでメンテナやる人がいたらてき...
Gravatar
Wed Dec 24 19:44:20 -0800 2008
1
2
3
  - module: Filter::EntryFullText::LDRFullFeed
    config:
      force_upgrade: 1
gist: 35764 1) ignore words, 2) stringで...
Gravatar
Sun Dec 14 11:01:39 -0800 2008
1
2
3
// ==UserScript==
// @name Motsu Tabetai
// @namespace http://ikenie.com/
Gravatar
Fri Dec 12 05:44:34 -0800 2008
1
2
3
// ==UserScript==
// @name Motsu Tabetai
// @namespace http://ikenie.com/