- first
- second
- third!
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/bash | |
rm -rf dist | |
rm -rf build | |
rm -rf *.egg-info | |
python setup.py install |
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 Node(object): | |
"""A node to be used for a linked list""" | |
def __init__(self, data): | |
"""Create a new Node instance | |
>>> head = Node(4) | |
>>> print(head.next) | |
None | |
>>> head.data |
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
(function(module, $) { | |
module.thingy = function () {}; | |
}(window.module = window.module || {}, jQuery)); |
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
func GenerateAllPics() { | |
// Set the number of processors Go can use | |
runtime.GOMAXPROCS(runtime.NumCPU()) | |
// Make all the channels we need | |
rows := make(chan []string) | |
throttle := make(chan struct{}, 10) | |
doneChan := make(chan int) | |
// Start reading the CSV | |
go MustReadRowAtATime("data/training.csv", rows) | |
// Populate the throttle so that the workers can start working |
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
def lat_sign(dec) | |
dec >= 0 ? 'N' : 'S' | |
end | |
def lon_sign(dec) | |
dec >= 0 ? 'E' : 'W' | |
end | |
def lat_to_dms(dec) | |
"#{dec_to_dms dec} #{lat_sign dec}" | |
end |
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
int f = 0; | |
int g = 1; | |
for (int i = 0; i <= 15; i++) | |
{ | |
StdOut.println(f); | |
f = f + g; | |
g = f - g; | |
} |
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
All commands can be run with -h (or --help) for more information. | |
[cha@2518 ar2 (twitter-instagram)]$ rails s | |
=> Booting WEBrick | |
=> Rails 4.1.9 application starting in development on http://0.0.0.0:3000 | |
=> Run `rails server -h` for more startup options | |
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) | |
=> Ctrl-C to shutdown server | |
Exiting | |
/Users/cha/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- instagram (LoadError) | |
from /Users/cha/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.1.9/lib/active_support/dependencies.rb:247:in `block in require' |
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
[cha@2518 ~]$ python collatz.py | |
Traceback (most recent call last): | |
File "collatz.py", line 25, in <module> | |
num_terations = collatz(i, 0) | |
File "collatz.py", line 16, in collatz | |
return collatz(lookup[start], iteration + 1) | |
File "collatz.py", line 12, in collatz | |
return collatz(lookup[start], iteration + 1) | |
File "collatz.py", line 12, in collatz | |
return collatz(lookup[start], iteration + 1) |
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
lookup = {} | |
def collatz(start, iteration): | |
if start == 1: | |
return iteration + 1 | |
if start in lookup: | |
return collatz(lookup[start], iteration + 1) | |
if start % 2 == 0: | |
lookup[start] = start / 2 | |
return collatz(lookup[start], iteration + 1) | |
else: |