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
Show hidden characters
// put this in ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User | |
{ | |
"cmd": ["make"], | |
"selector": "source.jsx", | |
"path": "/usr/local/bin:$PATH", | |
"working_dir": "${project_path:${folder:${file_path}}}", | |
"file_regex": "^\\[(.*\\.jsx):([0-9]+):().*\\] (.*)" | |
} |
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://blog.niw.at/post/46781091124 | |
% vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Box 'precise32' could not be found. Attempting to find and install... | |
default: Box Provider: virtualbox | |
default: Box Version: >= 0 | |
==> default: Adding box 'precise32' (v0) for provider: virtualbox | |
default: Downloading: http://files.vagrantup.com/precise32.box | |
==> default: Successfully added box 'precise32' (v0) for 'virtualbox'! |
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
- (void) imageReceived:(NSNotification *)notification { | |
NSLog(@"imageReceived"); | |
dispatch_async(dispatch_get_global_queue(0, 0), ^() { | |
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(64, 64, 200, 200)]; | |
label.text = @"label should be added"; | |
[self.view addSubview:label]; | |
[self.view setNeedsDisplay]; | |
[self.view setNeedsLayout]; | |
}); |
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
Director::drawScene | |
Scene(Node)::visit | |
matrix transform | |
push & set model_view matrix to it | |
sort all children | |
for child in children whose zOrder < 0: | |
child.visit |
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
# | |
# exercise of backtracking algorithm. | |
# 2008.07.26 | |
# | |
require 'pp' | |
# (x, y) のマスに置けるか | |
def test(x, y, board) | |
x.times do |i| | |
# 左 |
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
var fs = require('fs') | |
, http = require('http') | |
, Mecab = require('mecab-async') | |
, mecab = new Mecab() | |
; | |
function toNouns(text, callback) { | |
mecab.parse(text.toString(), function(err, result) { | |
if (err) callback(err, null); | |
var nouns = result.map(function(elm) { |
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 'natto' | |
require 'webrick' | |
require 'json' | |
def to_nouns(text) | |
nm = Natto::MeCab.new | |
results = [] | |
nm.parse(text) do |n| | |
type = n.feature.split(/,/).first | |
next unless type == '名詞' |
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 'classifier' | |
require 'stemmer' | |
require 'webrick' | |
require 'json' | |
# load the previous state if exists | |
bayes = nil | |
fh = open('classifier.dump') | |
if fh | |
puts 'load' |
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 | |
# | |
# knapsack problem solution by DP | |
# | |
# from: | |
# Cプログラマのためのアルゴリズムとデータ構造 | |
# ISBN:4797304952 | |
# pp. 349 | |
# | |
# author: |
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 | |
# | |
# knapsack problem solution by backtracking. | |
# | |
# from: | |
# Cプログラマのためのアルゴリズムとデータ構造 | |
# ISBN:4797304952 | |
# pp. 348 | |
# | |
# author: |
OlderNewer