# Tortured Silence

the cars honk
the lights flash
the refuse stinks
the flies hover
the mosquitoes bite

but he does not know
for he is

where the mind is afraid
and the head must not fly

where nothing is free

where the world is fractured and broken by the glory of barriers

where words have forgotten the depth of truth

where tireless defrauding stretches its arms towards perfection

where clear streams of reason are but superfluous and do not lead anywhere

where the mind is led forward – by the overarching ‘me’ – into ever-malevolent thought and action

what a heaven of freedom, my Father, into which my country awakes

[This poem is about an addict lost in a drug-induced slumber full of nightmares. It is largely a modification – gasp – of what is arguably Rabindranath Tagore’s most famous poem. Oh, and the picture is one of my favorite Edward Gorey works.]

# A Simple Regex for Rails Email Validation

Here’s my quick-and-dirty Rails email regex:

`/^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\$/i`

Declare the regex somewhere near the beginning of your User model, like so:

`EMAIL_REGEX = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\$/i`

A lot of code is yet to be written. Onward!

Remember those neighbours who turned a 3KHz sound on? Well, they did it again yesterday.

Enter my little 2.1 setup with a not-so-little subwoofer playing the live performance of Fear of the Dark at full volume.
They won’t do it again.

# Find The First 1000-digit Fibonacci Number [Project Euler Problem 25]

We all know how the Fibonacci numbers are defined: the nth Fibonacci number is equal to the sum of the two before it, with initial conditions F1 = F2 = 1. Translated into my mathematical language, that is:

Fn = Fn – 1 + Fn – 2

This is an example of a recurrence relation.

Using the theory of generating functions we can turn this recurrence relation into a “closed-form” or explicit formula:

[This book taught me generating functions – it’s awesome! You can buy it from that link and earn me a coffee :D]

Here, that odd-looking symbol φ (shame on you) is the magical Golden Ratio (read up on it!), equal to:

Oh, another thing. The number of digits in a number is equal to the ceiling of its logarithm in base 10Here’s why.

Manipulating these leads us to an expression for the index of the first Fibonacci number with d digits:

Fn = (d − 1 + log10(5) /2) / log10(φ)

And with that, here’s the two lines of code! (Code!) (OMG code!)

```from math import log10, sqrt, ceil
print(int(ceil((999 + log10(5)/2.0) /
log10((1 + sqrt(5))/2.0))))
```

And that’s how I became the 70181st person to solve this problem!

[image credit: Wikimedia]

# Why the GIL is a Tough Nut to Crack

“A dreamer is one who can only find his way by moonlight, and his punishment is that he sees the dawn before the rest of the world.”