User talk:Balrog: Difference between revisions

Showing my buddy Nick how to add sample code to his discussion page
(Showing my buddy Nick how to add sample code to his discussion page)
Line 5:
if you want to check the version of GeSHi installed, edit any page, type <nowiki><lang list></nowiki>, and preview (don't save it). If it shows "1.0.8.4" then he hasn't rolled back. This list is at the bottom of the new village pump page too. --[[User:Mwn3d|Mwn3d]] 17:50, 18 June 2009 (UTC)
:Thanks. Alas, he hasn't. --[[User:Balrog|Balrog]] 23:12, 18 June 2009 (UTC)
 
 
 
 
== Like This, Nick ==
<lang clojure>
(def tables [[10 0 8500]
[15 8501 34500]
[25 34501 83600]
[28 83601 174400]
[33 174401 379150]
[35 379151 Long/MAX_VALUE]])
 
(defn tax-calc
"Takes a dollar amount value and returns your federal tax obligation based on
the table above"
[taxable-income]
(second (reduce (fn [[dec-income calc] [percentage start end]]
(if (< start taxable-income)
(let[limit (min taxable-income end)
taxable-range (- limit start)
result (float (* (/ percentage 100) taxable-range))
dec-income (- dec-income (min taxable-range dec-income))]
[dec-income (+ calc result)])
[dec-income calc])) [taxable-income 0]
tables)))
</lang>
Anonymous user