Logo

Kuchh hasratein dil ki...

over 4 years ago | Sukhpal Bhatti: life

Ek kaali raatEk akeli mulaqaat,Na khatm honay wala intezaarAur wo dil ko tabah karne wali baat,Bas yahi kuchh hasratein hain is dil kiChahta hai ghadiyaan jo mushkil kiEk subah jiska din na hoEk raat jiski subah na ho,Wo khushi jismeinYe aankhein beh jayein ro ro,Bas yahi kuchh hasratein hain is dil kiChahta hai ghadiyaan jo mushkil kiWo saanson ko dubate khwabWo tan ko jalati barsaat,Dhadkan jo

Yoon to wo sabse khaas na thi...

over 4 years ago | Sukhpal Bhatti: life

Yoon to wo sabse khaas na thiWo mere paas hotay huye bhi paas na thi,Par uske na honay se lagta haiZindagi kabhi itni udaas na thi,Tanhaiyon mein doobay rehna to kismat rahi hai mere dil kiPar tanhaiyon ka ye sannata naya hai,Shaant to hamesha se thi tanhayiPar us shaanti mein bhi ik awaaz thi,Wo awaaz gum haiAur ye saaz sunn hai,Jaane kahan se ye khayal aa rahe hainUske hotey huye to koi aas na

Migrate with care!

over 4 years ago | Karthik Ramachandra : Concrete Abstractions

Its the second time now! We found another production issue in our rails app which was because we screwed up our migrations :(
If only we had taken enough more care while writing our migrations....

Indeed, migrations are very powerful ..but needless to say, quite dangerous too if not used the right way.

Recursive or iterative?

over 4 years ago | Karthik Ramachandra : Concrete Abstractions

"In contrasting iteration and recursion, we must be careful not to confuse the notion of a recursive process with the notion of a recursive procedure. When we describe a procedure as recursive, we are referring to the syntactic fact that the procedure definition refers (either directly or indirectly) to the procedure itself. But when we describe a process as following a pattern that is, say, linearly recursive, we are speaking about how the process evolves, not about the syntax of how a procedure is written."

- SICP

Recursive Procedure for the recursive process:


(define (factorial n)
(if (= n 1)
1
(* n (factorial (- n 1)))))


Recursive Procedure for the iterative process:

define (factorial n)
(fact-iter 1 1 n))

(define (fact-iter product counter max-count)
(if (> counter max-count)
product
(fact-iter (* counter product)
(+ counter 1)
max-count)))