10 November 2011

On Python, Cython and Pypy performance (with genetic algorithms)

As a part of my master's thesis I have to work on some optimization methods which are in turn operating on a heavy mathematical model -- one evaluation may take about a second or even more depending on the implementation. Currently I'm working on a genetic algorithm optimizer based on excellent PyEvolve module for Python.

21 June 2011

Frequently overlooked (and practical) PyQt4 features

To this day I have only made four or five full-fledged PyQt4 applications (all being university projects). Still I've come across a couple of interesting and rarely mentioned features. Recently I noticed them in a tiny WebKit based browser written by Roberto Alsina. It's best to provide examples so I'm going to use snippets from devicenzo (it's a goldmine) and some of my own, when appropriate.

03 June 2011

HTML5 video and DRM, part two

This is a continuation of the first part.

Let's say you (or someone else) have resolved all previously mentioned issues. You've got yourself a half-working DRM implementation for your HTML5 video player. Remember the last diagram:


28 May 2011

HTML5 video and DRM, part one

Being long interested in HTML5 (and all that other stuff) I sometimes think about it's future, especially regarding it's commercial use. Once, I've got a particular evil vision about possible (video) DRM implementation using HTML5 goodness. 
We can argue whether the whole DRM concept is a good or a bad thing. It is though inevitable for commercial content to come to the HTML5 world. Here, probably, should I rant about music/movies industry being stagnant, old-fashioned and closed-minded. I won't, there's plenty of examples in the aforementioned Wikipedia article. Folks are really vocal.
In this (and probably one future) post I'm going to loudly think about the technical side of this problem.

24 May 2011

Distributing PyQt4 applications in a single .exe file (with py2exe)

I rarely need to run my Python code on Windows -- the few cases are usually my university projects. Not long ago I had to distribute a standalone package in Windows executable format. What I mean by that, no additional dependencies were to be installed. It took many tries before I ended up with an acceptable result.
Generally the problem was the final package size reaching up to 20MiB. So my aim was to lower this number as much as I can. The following guide is not meant to be comprehensive but it can save a lot of time if you have a similar use case. I've read considerable amount of docs and written this piece so next time I don't have to do it again.

20 May 2011

Blocking anonymous calls on Nokia N900 (and possibly other Maemo phones)

[Disclaimer: since I need to somehow kick-start this blog, few next posts will contain some stashed tips I collected over time.]

I own a N900, probably the last geek-phone/tablet from Nokia. Recently I got really annoyed by all the telemarketers and (usually unpleasant) salespeople calling me passionately at various times of the day. I discovered a great and simple way to block unwanted calls: pycallblocker.
Unfortunately, the most persistent and useless offers come from anonymous (hidden) numbers. There wasn't a simple way to block these with pycallblocker, so I hacked it to suit my needs.