Mathematics, philosophy, code, travel and everything in between. More about me…

I write about

My blog

Hong Kong II

January 13, MMXVI — Travel, China, Photoblog.

Hong Kong I

January 12, MMXVI — Travel, China, Photoblog.

How to deal with a compiler crash when building pandas

When installing the Python package pandas on a small server you might encounter a cryptic gcc error in the middle of the compilation: internal compiler error: Killed (program cc1). Most likely this is a memory problem and can be fixed easily.

October 1, MMXIV — Python, Linux.

The difference between bytearray and bytes in Python

Python 3 has two classes representing raw data: bytes and bytearray. At a cursory glance they seem very similar. However, there is a difference that becomes crucial in certain applications.

September 29, MMXIV — Python.

Faster date parsing in Python

I’ve been optimizing a complex real-time trading application written in Python. One of the many lessons learned was just how slow date/time parsing can be. strptime is a great universal function, but its versatility comes at a cost. Fortunately, there is another way.

September 20, MMXIV — Python, Finance.

Speeding up Python’s Enum by 35%

I’ve been profiling a high-performance Python application and was surprised to see Python 3.4’s Enum spending nontrivial time on attribute lookups (expressions like MyEnum.SOME_MEMBER). It turns out these lookups can be sped up by 35% by removing two lines of code.

September 15, MMXIV — Python.

3 quick tips for reducing distractions

Ironically, you could spend hours reading all about focused work and blocking distractions. It’s a very trendy blog topic these days. This article is not like that. The following tips are extremely simple and will take you 1 minute to read and 3 minutes to implement.

September 6, MMXIV — Life lessons.

How to be a great freelancer

There is one thing I get praised for by every client I work for. The lack of the same thing frustrates me most when other freelancers work for me. One simple thing.

April 27, MMXIV — Life lessons, Programming.

How to use Google App Engine with virtualenv

Google App Engine is a pretty interesting PaaS offering. However, its Python environment leaves a lot to be desired. The biggest pain point is its seeming incompatibility with virtualenv – a tool that is almost indispensable in Python development. Luckily, there is a workaround.

February 10, MMXIV — Python, Programming.

Seeking balance

I recently read an interesting article titled How a Math Genius Hacked OkCupid to Find True Love. It tells the story of a PhD researcher who, tired of being ignored on a dating site, applied contemporary machine learning algorithms to find his optimal target groups of women and the optimal profiles to attract them. I was amused and horrified at the same time.

January 29, MMXIV — Life lessons, Mathematics.