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
# *sh command shortcuts | |
alias c='clear' | |
alias batt='pmset -g batt' | |
alias sand='cd ~/code/sandbox' | |
# specific program shortcuts | |
alias gl='git log --graph --pretty=oneline' |
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
import os, io | |
def main(): | |
f = open('pyramid.txt', 'r') | |
root = {} | |
for l in f.readlines() | |
l = l.split() | |
if not root: | |
l |
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
75 | |
95 64 | |
17 47 82 | |
18 35 87 10 | |
20 04 82 47 65 | |
19 01 23 75 03 34 | |
88 02 77 73 07 63 67 | |
99 65 04 28 06 16 70 92 | |
41 41 26 56 83 40 80 70 33 | |
41 48 72 33 47 32 37 16 94 29 |
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
alias daynote="vim ~/code/hsnotes/$( date '+%d-%m_' )notes.md" |
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
# yuri's solution | |
def sort_last(tuples): | |
return sorted(tuples, key=lambda t: t[-1]) | |
# my dumb solution | |
def sort_lastt(tuples): | |
# +++your code here+++ | |
diction = {} |
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
import pdb | |
import lxml.html | |
import time | |
from urllib2 import urlopen | |
import os | |
class Cell: | |
def __init__(self, value): | |
self.value = int(value) | |
self.possibilities = set([x for x in range(1,10)]) |
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 fetch_new_puzzle(difficulty): | |
"""Get a new puzzle from the online source. | |
Difficulties are from 1 to 5 maybe? Integers. | |
Boards are indexed x and y, where x is the row | |
number and y is the column number. | |
""" | |
page_text = urlopen("http://www.free-sudoku.com/sudoku.php?mode=%s" % | |
difficulty ).read() | |
tree = html.fromstring(page_text) |
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
adjsfioadjsi |
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
(ns enclojure.equal) | |
(defn lower [note] | |
(if (< note 20.0) | |
note | |
(lower (/ note 2)))) | |
(defn equaltemp [a acc] | |
(if (> a 20000.0) | |
acc |
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 'pry' | |
g = [[1, 2], | |
[1, 4], | |
[2, 1], | |
[2, 3], | |
[2, 5], | |
[3, 2], | |
[3, 11], | |
[4, 1], | |
[4, 5], |
OlderNewer