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
<?xml version='1.0' encoding='UTF-8'?> | |
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"> | |
<channel> | |
<title>首相官邸</title> | |
<link>https://www.kantei.go.jp</link> | |
<description>公式サイトからの新着情報を取得しました。</description> | |
<atom:link href="https://www.kantei.go.jp" rel="self"/> | |
<docs>http://www.rssboard.org/rss-specification</docs> | |
<generator>python-feedgen</generator> | |
<image> |
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
# 半月分の日の一覧を表示 | |
# 参考:http://qiita.com/ozamasa/items/20853d5fce6677d0f346 | |
require 'date' | |
0.upto(14).inject(Date.new(2015,2,2)){|d,i|puts (d+i).strftime("%2m月%2d日(#{%w(日 月 火 水 木 金 土)[(d+i).wday]})");d} |
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
// | |
// Zero-suppressed binary decision diagram with family algebra operations | |
// | |
// References: | |
// S. Minato (1993): | |
// Zero-suppressed BDDs for set manipulation in combinatorial problems. | |
// Proceedings of the 30st annual Design Automation Conference, pp. 272-277. | |
// S. Minato (1994): | |
// Calculation of unate cube set algebra using zero-suppressed BDDs. | |
// Proceedings of the 31st annual Design Automation Conference, pp. 420-424. |
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
ruby -e ' (1..9).to_a.permutation(9).each {|v| if (v[0]*10 + v[1])*(v[2]*10+v[3])*v[4]==v[5]*(v[6]*10+v[7])*v[8];puts v.join(" ");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
# | |
# k means clustering | |
# | |
# https://gist.github.com/kyama/5171166 | |
# | |
# Date:: 2013.03.15 | |
# | |
class Kmeans | |
def initialize seed=1234,size=100,max_value=5000,cluster_size=50 |
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
ruby -r 'digest/sha1' -e 'puts Digest::SHA1.hexdigest(File.open("<FILENAME>", "rb").read)' |
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
ruby -e 'puts (0..11).collect {|e| (300.0/11.0*e).truncate%60}.join(",")' |