Author Archives: lorg

Two bugs don’t make a right

While working on my new startup, we are doing a little bit of reasoning using implications. One of the more curious forms of implications is the negative form: consider the following exaggerated example: a place being kid-friendly implies that it … Continue reading

Posted in Programming | Tagged , , , , , , | 1 Comment

Optimizing Django ORM / Postgres queries using left join

For the latest project I’m working on, we’re using Django with Postgres. I was writing some code that had to find a list of objects that weren’t processed yet. The way they were stored in the DB is like so: … Continue reading

Posted in Databases, Optimization | Tagged , , , , , | 1 Comment

Collision: the story of the random bug

So here I was, trying to write some Django server-side code, when every once in a while, some test would fail. Now, it is important to know that we are using any_model, a cute little library that allows you to … Continue reading

Posted in Python | Tagged , , , , , | 2 Comments

Cheap language detection using NLTK

Some months ago, I was facing a problem of having to deal with large amounts of textual data from an external source. One of the problems was that I wanted only the english elements, but was getting tons of non-english … Continue reading

Posted in Python | Tagged , , , , | 3 Comments

Wikipedia Images

A few days ago a friend (x) of a friend (y) showed me and my friend (y) a small app he was developing, that had photos from flickr and picasa. We suggested adding photos from Wikipedia as well, but he … Continue reading

Posted in Programming | Tagged , , , | 3 Comments

Python Module Usage Stats – Feb 2011

Here are the top 30 “base modules”, ordered by number of PyPI projects importing them. These results are based on 11,204 packages download from PyPI. Explanations, full results and code to generate them are available below. Continue reading

Posted in Python | Tagged , , , | 9 Comments

10 Awesome Theorems & Results

When I look back at various mathematical courses I took, most have at least one theorem that I really liked. Usually I like it because the proof has a surprising trick, sometimes it’s because of the unexpected conclusion, or maybe … Continue reading

Posted in Cryptography, Math | Tagged , | 12 Comments

Beautiful Code

A few days ago, @edensh mentioned in Facebook beautiful code, and many people gave examples of assembly, while I was thinking of Python. That got me thinking: what is beautiful code for me? So here are my criteria for beautiful … Continue reading

Posted in Programming Philosophy | Tagged , , , , | 2 Comments

Small programming challenge No. 6 – nblocks

I came up with this challenge when I had to write a function to divide a sequence to percentiles. I needed this to calculate some statistics over trips for plnnr.com. “This sounds trivial” I thought, and reached for my simple … Continue reading

Posted in Challenges, Programming, Python, Statistics | Tagged , , , , | 21 Comments

Moving to a new server

I moved the blog to a new server, and a new wordpress install. It will take me some time to get everything back in order, but once I finish it, I’m going to get back to writing regularly. Stay tuned!

Posted in Miscellaneous | Leave a comment