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

I write about

Python

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.

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.

How To Focus On Writing

If you’re like most people, you’ll get easily distracted when writing a longer piece of text. So many distractions are just a click away – e-mail, Twitter, news headlines, stock market charts, or even a nice desktop wallpaper. What if you could just get rid of all visual clutter and focus on nothing else but the text itself? Enter γαλήνη, my new distraction-free text editor.

February 27, MMXII — Programming, Projects, Python.

Visualizing Linux Traffic Control Setup

In the past six months I had to deal with Linux traffic control (TC) a lot. I was literally blown away by the advanced features of the system. Of course, the versatility comes for the usual price: complexity. I definitely do not regret the time spent on understanding the principles of classes, qdiscs, filters, major and minor numbers, etc. However, I think I have found a way to work with them more easily.

April 5, MMIX — Programming, Linux, Projects, Python.