User talk:Balrog: Difference between revisions

From Rosetta Code
Content added Content deleted
(Showing my buddy Nick how to add sample code to his discussion page)
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
:Thanks. Alas, he hasn't. --[[User:Balrog|Balrog]] 23:12, 18 June 2009 (UTC)
:Thanks. Alas, he hasn't. --[[User:Balrog|Balrog]] 23:12, 18 June 2009 (UTC)


==Complex==

You might want to consider linking your complex solution into the Go part of [[Unicode variable names]]. Thanks. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 09:55, 2 November 2014 (UTC)

:Thanks. I hadn't noticed that one. I think you mean "Groovy part" though --[[User:Balrog|Balrog]] ([[User talk:Balrog|talk]]) 04:12, 3 November 2014 (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>

Latest revision as of 04:12, 3 November 2014

You don't need to claim an example by putting the language header on before any code. It would look a little weird if someone were to access the page before you put the code on. You can just do it all at once. --Mwn3d 23:14, 6 April 2008 (MDT)

GeSHi rollback check

if you want to check the version of GeSHi installed, edit any page, type <lang list>, 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. --Mwn3d 17:50, 18 June 2009 (UTC)

Thanks. Alas, he hasn't. --Balrog 23:12, 18 June 2009 (UTC)

Complex

You might want to consider linking your complex solution into the Go part of Unicode variable names. Thanks. --Paddy3118 (talk) 09:55, 2 November 2014 (UTC)

Thanks. I hadn't noticed that one. I think you mean "Groovy part" though --Balrog (talk) 04:12, 3 November 2014 (UTC)