Skip to content

Instantly share code, notes, and snippets.

View rdsr's full-sized avatar

Ratandeep Ratti rdsr

  • LinkedIn!
  • Sunnyvale, CA
View GitHub Profile
(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)))
(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)
(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))
@rdsr
rdsr / about.md
Created August 13, 2011 09:26 — forked from anujmaurice/about.md
Programming Achievements: How to Level Up as a Developer
@rdsr
rdsr / springer-free-maths-books.md
Created December 28, 2015 12:11 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@rdsr
rdsr / user_rb_comments
Last active May 19, 2016 18:45
Python script to pull all reviews a user has commented on Works with Review Board 2.0.18
#!/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')