Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    Python performance: set vs list

    15th August 2011

    Sometimes there is a need to be sure that no identifier is processed twice – for example, when parsing a file into a database, with file potentially containing duplicate records. An obvious solution is to properly wrap the DB insertion code into try…except block, and process duplicate primary ID exceptions. Another, sometimes more desired solution is to maintain a set/list of processed IDs internally, and check against that list prior to attempting the insertion of anything. So is it a set or a list?

    There are already quite a few internet resources discussing “python set vs list”, but probably the simplest while elegant way to test that is below.
    Read the rest of this entry »

    Share

    Posted in Notepad, Programming, Python | 1 Comment »

    Intel i915 integrated graphics under Debian: how to get rid of sluggish 2D performance

    2nd March 2009

    I assume you already have configured and working desktop environment, but want to improve performance.

    First of all, sudo aptitude install mesa-utils. Then run in a Terminal/Konsole glxgears, and wait for ~15 seconds; if your FPS is ~400 or less, then you do have sluggish video performance (usually manifesting itself as slow scrolling in Firefox/Iceweasel, slow window switching/minimziing/maximizing etc).

    After reading through several forums and bug reports and blog posts, I’ve ended with the following modifications to my /etc/X11/xorg.conf:
    Read the rest of this entry »

    Share

    Posted in *nix, Hardware, how-to | 5 Comments »

    How to improve MySQL application performance

    6th March 2008

    Juicy presentation, even for seasoned MySQL developers.

    SlideShare | View

    Read the rest of this entry »

    Share

    Posted in Links, Programming, Web | No Comments »