duplicates = multiple editions
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
#!/usr/bin/env python2.6 | |
""" | |
Python script to pull all reviews a user has commented on | |
Works with Review Board 2.0.18 | |
""" | |
import site | |
site.addsitedir('/usr/local/linkedin/lib/python2.6/site-packages') |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
(325 (10 15) (6 17) (1 18)) ;; 325 = 10^2 + 15^ = 6^2 + 17^2 = 1^2 + 18^2 | |
(425 (13 16) (8 19) (5 20)) | |
(650 (17 19) (11 23) (5 25)) | |
;; ... | |
;; ... | |
;; ... | |
(5050 (45 55) (17 69) (3 71)) | |
(5125 (47 54) (34 63) (30 65)) |
(use '[clojure.contrib.duck-streams :only (reader read-lines)]) | |
(defn build-sum-mtx [triangle] | |
(let [len (count triangle)] | |
(loop [mtx [] i 0] | |
(cond | |
(= i len) mtx | |
:else (let [row (get mtx (dec i)) | |
sum (fn [n j] | |
(let [a (or (get row (dec j)) 0) |
(define image (line 0 0 'white)) | |
(define (draw-line v1 v2) | |
(set! image | |
(add-line image | |
(xcor-vect v1) ; x-coordinate ...etc | |
(ycor-vect v1) | |
(xcor-vect v2) | |
(ycor-vect v2) | |
'black))) |
(define (segments->painter segment-list) | |
(lambda (frame) | |
(for-each | |
(lambda (segment) | |
(draw-line | |
((frame-coord-map frame) (start-segment segment)) | |
((frame-coord-map frame) (end-segment segment)))) | |
segment-list))) |
(use '[clojure.contrib.duck-streams :only (reader read-lines)]) | |
(def letter->index | |
{\A 1 | |
\B 2 | |
\C 3 | |
\D 4 | |
\E 5 | |
\F 6 | |
\G 7 |
(def number->wrd-cnt | |
{1 (count "one") | |
2 (count "two") | |
3 (count "three") | |
4 (count "four") | |
5 (count "five") | |
6 (count "six") | |
7 (count "seven") | |
8 (count "eight") | |
9 (count "nine") |
(defn amicable? [a] | |
(if (@amicable-nos a) true | |
(let [b (d a) | |
db (d b)] | |
(if (and (not= a b) (= a db)) | |
(do (swap! amicable-nos assoc b true) true) | |
false)))) |