- Scott Chacon on the Interwebs(リンク切れ)
- Scott Chacon on the Interwebs
- GitHub Flow - The best way to use Git and GitHub
31 Aug 2011
| # パスの一覧を取得する…結果はコスト、辺のリスト、係数のリスト | |
| def getAllPath(edges, visited, f, t, r, c, e, a): | |
| if f == t: | |
| r.append((c,e,a)) | |
| for k in neighbor[f].keys(): | |
| if k not in visited: | |
| getAllPath(edges, visited + [f], k, t, r, c + neighbor[f][k][2], e + [neighbor[f][k][1]], a + [neighbor[f][k][0]]) | |
| # パスに対して「今そのパスが取れる最大の値」を返す | |
| def getMaximalFlow(world, (c,e,a)): |
| func migrateUserDefaultsToAppGroups() { | |
| // User Defaults - Old | |
| let userDefaults = NSUserDefaults.standardUserDefaults() | |
| // App Groups Default - New | |
| let groupDefaults = NSUserDefaults(suiteName: "group.myGroup") | |
| // Key to track if we migrated | |
| let didMigrateToAppGroups = "DidMigrateToAppGroups" |
| package main | |
| import ( | |
| "code.google.com/p/go-tour/tree" | |
| "fmt" | |
| ) | |
| // Walk walks the tree t sending all values | |
| // from the tree to the channel ch. | |
| func Walk(t *tree.Tree, ch chan int) { |
| #!/usr/bin/env ruby | |
| # 1. Install hunspell | |
| # $ brew install hunspell | |
| # 2. Download a dictionary and install it in a path listed by `hunspell -D` | |
| # $ open http://wiki.services.openoffice.org/wiki/Dictionaries | |
| # 3. Move this file into your repository | |
| # $ mv commit-msg /path/to/repo/.git/hooks |
| ''' | |
| This python script listens for distributed notifications from iTunes of new songs playing, | |
| works alot better then constantly polling. | |
| ''' | |
| import Foundation | |
| from AppKit import * | |
| from PyObjCTools import AppHelper | |
| class GetSongs(NSObject): | |
| def getMySongs_(self, song): |