-
wget / untar
-
rbenv global system
-
./configure --prefix=/usr/local/ --enable-rubyinterp --enable-pythoninterp --with-features=huge LDFLAGS=-lresolv
-
make && make install
-
sudo mv /usr/bin/vim /usr/bin/vim.old
-
sudo ln -s /usr/local/bin/vim /usr/bin/vim
-
rbenv back to normal!
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
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
type Triangle struct { | |
h int | |
w int |
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
package main | |
import "tour/tree" | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
func Walk(t *tree.Tree, ch chan int) | |
// Same determines whether the trees | |
// t1 and t2 contain the same values. |
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://hexawe.net/mess/200.Drum.Machines/drums.zip | |
http://hexawe.net/mess/samples/dr.dre%20kit.zip | |
http://hexawe.net/mess/samples/monowave.wav | |
http://machines.hyperreal.org/manufacturers/Moog/Rogue/samples/rogue2.zip | |
http://www.milkcrate.com.au/ub/casio_SK1.zip | |
http://www.milkcrate.com.au/ub/casio_vl-1.zip | |
http://machines.hyperreal.org/manufacturers/Roland/TR-505/samples/tr505.zip | |
http://machines.hyperreal.org/manufacturers/Akai/MPC/samples/drumulator.zip | |
http://machines.hyperreal.org/manufacturers/Akai/MPC/samples/jrsoundkit.zip | |
http://machines.hyperreal.org/manufacturers/Moog/Rogue/samples/rogue1.zip |
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
class Yo: | |
def __init__(self): | |
self.s = "" | |
def extend(self,str): | |
self.s = self.s+str | |
return self |
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
>>> def foo(): | |
... foo.x = 0 | |
... foo.total = lambda: foo.x | |
... def add(x): | |
... foo.x = foo.x + x | |
... return foo | |
... foo.add = add | |
... | |
>>> foo() | |
>>> foo.total() |
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
package main | |
import "fmt" | |
func walkAsync(ch chan string, tree *Tree) { | |
if len(tree.children) == 0 { | |
ch <- tree.data | |
return | |
} else { | |
for _, c := range tree.children { |
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
Question: Convert following into the latter data structure in less than 30 lines: | |
List: | |
A, B, C | |
A, C, E | |
E, F, D | |
D, A, J | |
E, D, J | |
List |
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
var numText = "zero one two three four five six seven eight nine ten" | |
var numRoman = "- I II III IV V VI VII IX X" | |
var aText = strings.Split(numText, " ", 0) | |
var aRoman = strings.Split(numRoman, " ", 0) | |
type TextNumber int | |
type RomanNumber int | |
func (n TextNumber) String() string { | |
return aText[n]; |
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
package main | |
import "fmt" | |
import "encoding/json" | |
type Test struct { | |
Test1 string | |
Test2 string `json:"special_json_name"` | |
test3 string | |
} |