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
"dbg" " => 29" " 29" #<StringWriter => 29 | |
> | |
"dbg" " => Invalid operand: foo" " Invalid operand: foo" #<StringWriter => Invalid operand: foo | |
> | |
"dbg" " => Invalid command: foo" " Invalid command: foo" #<StringWriter => Invalid command: foo | |
> | |
"dbg" " => 2" " 2" #<StringWriter => 2 | |
=> 4 | |
> | |
FAIL at (test_calculatrix.clj:54) |
FAIL at (test_calculatrix.clj:62) | |
Expected: "84" | |
Actual: java.lang.ArrayIndexOutOfBoundsException | |
week2.test_calculatrix$test_main$get_output__2884.invoke(test_calculatrix.clj:17) | |
week2.test_calculatrix$test_main.invoke(test_calculatrix.clj:26) | |
week2.test_calculatrix$eval2941$fn__2944.invoke(test_calculatrix.clj:62) | |
week2.test_calculatrix$eval2941.invoke(test_calculatrix.clj:60) |
(use 'criterium.core) | |
(defn randoms [seed a-count] | |
(let [r (Random. seed)] | |
(loop [vec [] | |
cnt a-count] | |
(if (zero? cnt) | |
vec | |
(recur (conj vec (.nextInt r)) (dec cnt)))))) |
// from http://kriszyp.name/2010/01/16/imperative-functional-and-declarative-programming/ | |
// imperative | |
function bestPrices(inputArray){ | |
var outputArray = []; | |
for(var i = 0; i < inputArray.length; i++){ | |
if(inputArray[i].price<10){ | |
outputArray.push(inputArray[i]); | |
} | |
} |
class User < ActiveRecord::Base | |
belongs_to :user_email | |
end | |
class UserEmail < ActiveRecord::Base | |
has_one :user | |
end | |
# nyt tuohon emailiin voitaisiin sitten viitata seuraavasti |
mogrify -format pdf *bmp | gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf *pdf |
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
Video: 101: Welcome to Titanium