This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/dir.h> | |
int | |
main(int argc, char** argv) | |
{ |
This file contains hidden or 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
/* gcc -framework Foundation -framework AppKit -o file_wo_kesu file_wo_kesu.m */ | |
#import <Foundation/NSArray.h> | |
#import <Foundation/NSAutoreleasePool.h> | |
#import <Foundation/NSDictionary.h> | |
#import <Foundation/NSFileManager.h> | |
#import <Foundation/NSProcessInfo.h> | |
#import <Foundation/NSString.h> | |
#import <AppKit/NSOpenPanel.h> |
This file contains hidden or 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 Measure | |
class Unit | |
class << self | |
def unit_name | |
return nil | |
end | |
alias __inspect__ inspect | |
def inspect | |
if unit_name |
This file contains hidden or 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
require 'rubygems' | |
require 'kagemusha' | |
musha = Kagemusha.new(Time) | |
musha.defs(:now) { self.local(1984, 5, 11) } | |
musha.def(:+) {|other| other } | |
def foo | |
puts "enter foo" | |
p Time.now |
This file contains hidden or 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
--- net-irc/examples/tig.rb 2008-10-30 00:15:47.000000000 -0400 | |
+++ tig.rb 2008-11-30 08:48:29.000000000 -0500 | |
@@ -471,10 +471,16 @@ | |
post server_name, RPL_ENDOFWHO, @nick, channel | |
when @groups.key?(channel) | |
@groups[channel].each do |name| | |
- f = @friends.find {|i| i["screen_name"] == name } | |
- user = nick = f["screen_name"] | |
- host = serv = api_base.host | |
- real = f["name"] |
This file contains hidden or 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
require 'readline' | |
require 'tsort' | |
class Hash | |
include TSort | |
alias tsort_each_node each_key | |
def tsort_each_child(node, &block) | |
fetch(node).each(&block) | |
end | |
end |
This file contains hidden or 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
mp3 = false | |
input = ARGV.shift | |
while input =~ /^-/ | |
case input | |
when /^-mp3/ | |
mp3 = true | |
end | |
input = ARGV.shift | |
end |
This file contains hidden or 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/ruby -Ku | |
# To rewrite URL, the following may be written in .htaccess: | |
# | |
# RewriteEngine On | |
# RewriteBase ^/path/to | |
# RewriteRule ^([\dX]+) /path/to/?$1 [L,R] | |
def isbn10_check_digit(common) | |
d = common.split(//) | |
c = (11 - (2..10).inject(0) {|a, x| a + x*d[10-x].to_i} % 11) % 11 |
This file contains hidden or 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
def active_version_variants(x, installed) | |
/@[^+]+/.match(installed[x].keys.select{|var| installed[x][var] }[0]) | |
return [$&, $' ? $'.scan(/\+[^+]+/) : []] | |
end | |
def active_variants(x, installed) | |
return active_version_variants(x, installed)[1] | |
end | |
def active_deps(x, installed) |
This file contains hidden or 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
JSAI-MLの皆様 | |
(重複してお受け取りの際はご容赦ください) | |
高間@首都大です. | |
第14回WI2研究会の発表申込期限が明日(1/9)までとなっておりますので, | |
再度ご案内します. | |
今回,特別講演として,島根ご在住のまつもとゆきひろ氏をお招きし, | |
日本発のオブジェクト指向スクリプト言語である「Ruby」の開発に関する |
OlderNewer