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
// http://okajima.air-nifty.com/b/2010/01/post-abc6.html | |
#include <iostream> | |
#include <vector> | |
#include <deque> | |
#include <string> | |
#include <utility> | |
#include <climits> | |
using namespace std; |
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 ruby | |
# twit_anime_icon.rb | |
# convert an animated gif file to an uploadable format for Twitter. | |
infile = ARGV[0] || "" | |
outfile = ARGV[1] || "output.gif" | |
if infile.empty? | |
puts "usage: #{$0} input.gif [output.gif]" |
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 ruby | |
def open_t_delimited_file(filename) | |
h = {} | |
open(filename) {|f| | |
f.each_line do |line| | |
a = line.split("\t") | |
h[a[0]] = a | |
end | |
} |
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
#include <string> | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
// 遺伝子発現領域データ用構造体 |
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
#include <iostream> | |
// change this parameter according to the length of your program | |
#define BOOST_MPL_LIMIT_STRING_SIZE 128 | |
#include <boost/mpl/at.hpp> | |
#include <boost/mpl/comparison.hpp> | |
#include <boost/mpl/erase.hpp> | |
#include <boost/mpl/equal.hpp> | |
#include <boost/mpl/insert.hpp> |
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
eval$s =%w' | |
b= " BAhsKwG | |
vfg A AAAAA PAAA | |
AIw AA AAA gD8AAAA4 | |
AQA AA Ph 4AAAAcAMAA | |
ICDf wA A AOAGAADA8D8 | |
AAAD wB g AAQPwfAAAA | |
eAY AA E D/AwAAA | |
DgGA AB A fwAAAAA | |
8DAAA QH 8 AAA AAf |
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
str = "str = %c%s%c; printf str, 34, str, 34"; printf str, 34, str, 34 |
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
# -*- coding: utf-8 -*- | |
i = 0 | |
ARGF.each_char do |c| | |
printf "\x1b[3#{(i += 1) % 6 + 1}m#{c}" | |
end | |
print "\x1b[39m" |
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 ruby | |
# -*- coding: utf-8 -*- | |
require "net/http" | |
require "cgi" | |
require "nkf" | |
require "json" | |
class Bitly | |
def initialize(account, api_key) |
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 ruby | |
# -*- coding: utf-8 -*- | |
require "time" | |
puts %w[datetime mon day hour min place gamma neutron wind_dir wind_speed].join("\t") | |
lines = ARGF.each_line.to_a[2..-1] | |
date = "" | |
lines.each do |line| |
OlderNewer