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
(Hoge->new(3), Hoge->new(2), Hoge->new(1)) 並び順のデータのソートだと、4回関数が呼ばれる | |
(Hoge->new(1), Hoge->new(2), Hoge->new(3)) だと、上記例(result.txt)のように6回関数が呼ばれる | |
なので事前にすべて計算をしておいてその値でソートをするか、いわゆるmemo化のように関数内でキャッシュを作成しておかないとダメかもしれない |
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
#!/bin/env ruby | |
# encoding: utf-8 | |
require 'mechanize' | |
def syouhyou_yomi(*keywords) | |
keywords.flatten! | |
wait_time = 0.2 | |
agent = Mechanize.new | |
agent.user_agent_alias = 'Mac Mozilla' |
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
#!/bin/env ruby | |
# encoding: utf-8 | |
require 'net/http' | |
require 'nokogiri' | |
uri = URI("http://www.fashion-press.net/brands/en") | |
doc = Nokogiri::HTML(Net::HTTP.get(uri)) | |
results = [] |
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
class Elasticsearch14 < Formula | |
homepage "https://www.elastic.co/products/elasticsearch" | |
url "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz" | |
sha256 "a3158d474e68520664debaea304be22327fc7ee1f410e0bfd940747b413e8586" | |
bottle do | |
cellar :any | |
sha256 "d2a1df0938267bcff1cfae6341392ec2d4869809e7adf868e8b3d54eb0908481" => :yosemite | |
sha256 "1d18d3bf86a1b6e17a9612d0178e12f70a68fffd0eddd0c956964226d48ef3b0" => :mavericks | |
sha256 "f3bb1bfc49b1a56ddfa485c8c032d3b39beb70cf0ed9df20c69d3dbff8a2abd2" => :mountain_lion |
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
class Elasticsearch14 < Formula | |
homepage "https://www.elastic.co/products/elasticsearch" | |
url "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz" | |
sha256 "a3158d474e68520664debaea304be22327fc7ee1f410e0bfd940747b413e8586" | |
bottle do | |
cellar :any | |
sha256 "d2a1df0938267bcff1cfae6341392ec2d4869809e7adf868e8b3d54eb0908481" => :yosemite | |
sha256 "1d18d3bf86a1b6e17a9612d0178e12f70a68fffd0eddd0c956964226d48ef3b0" => :mavericks | |
sha256 "f3bb1bfc49b1a56ddfa485c8c032d3b39beb70cf0ed9df20c69d3dbff8a2abd2" => :mountain_lion |
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
#!/bin/env ruby | |
# encoding: utf-8 | |
require 'nokogiri' | |
require 'net/http' | |
MEMBER_KEY="メンバー" | |
DAY_KEY="日付" | |
def crawl(url) | |
doc = Nokogiri::HTML(Net::HTTP.get(URI(url))) |
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
require 'moji' | |
def normalize_neologd(norm) | |
norm.tr!("0-9A-Za-z", "0-9A-Za-z") | |
norm = Moji.han_to_zen(norm, Moji::HAN_KATA) | |
hypon_reg = /(?:˗|֊|‐|‑|‒|–|⁃|⁻|₋|−)/ | |
norm.gsub!(hypon_reg, "-") | |
choon_reg = /(?:﹣|-|ー|—|―|─|━)/ | |
norm.gsub!(choon_reg, "ー") | |
chil_reg = /(?:~|∼|∾|〜|〰|~)/ |
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
/* | |
* How to use: | |
* gcc ./find_focusyarou.m -framework AppKit | |
* ./a.out | |
*/ | |
#import <Cocoa/Cocoa.h> | |
int main(){ | |
while(1){ | |
NSString *appName = [[[NSWorkspace sharedWorkspace] activeApplication] objectForKey:@"NSApplicationName"]; |
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
概要 | |
・Apache/mod_cacheで、初回リクエストがHTTP Rangeリクエストだったときにコンテンツ断片をキャッシュしてしまう問題 | |
発生条件 | |
・Apacheが対象バージョンであること | |
・proxy先のコンテンツがHTTP Range Request (Partial Content)に対応している | |
・proxy先のコンテンツがcache-controlとexpiresヘッダーを出力しない | |
・mod_cache + mod_rewrite + mod_proxy使ってること | |
対象バージョン |
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
#base robot_giant.pop | |
#base robot_standard.pop | |
#base sundown_templates.pop | |
WaveSchedule | |
{ | |
StartingCurrency 600 | |
RespawnWaveTime 5 | |
CanBotsAttackWhileInSpawnRoom no |
NewerOlder