Python: comparing to None

Posted on Mon 01 August 2011 in articles • Tagged with programming, Python

Python's documentation states that one has to use the is operator to compare a variable to None. What happens when you avoid that advice?


Continue reading

Inside Python: understanding os.listdir()

Posted on Sun 08 May 2011 in articles • Tagged with programming, Linux, Python, C

If you've been using python for a long time, then you surely know that os.listdir() function returns an unsorted list of file names. I didn't care much until facing a situation, in which the sorted-sequential processing of files was crucial, and I could not remember whether the previous file processing were done in sorted order. Well, luckily they were. But hey, this is a little bit annoying, isn't it? Why os.listdir() returns an unsorted list of files? Would you like to find out?


Continue reading

Assembler for beginners

Posted on Sun 08 August 2010 in articles • Tagged with programming, Assembler

About introductory book to programming using assembly language.


Continue reading

Inside Python subprocess communication

Posted on Sat 24 April 2010 in articles • Tagged with programming, Python

Sometimes, it's really hard to understand what happens inside a function or even a whole module of Python's Standard library. For example, the subprocess module contains a very tricky Popep class. I tried to use the the module to communicate with a MATLAB subprocess shell (e.g. send MATLAB commands to subprocess and read the output). Unfortunately I failed and was just able to pass a MATLAB script via command-line arguments. Yet, I learnt much about the Popen.communicate() method and I'd like to share this knowledge with you.


Continue reading

Python classes: Dynamic properties

Posted on Wed 10 March 2010 in articles • Tagged with programming, Python

Python never stops surprising me. While doing my master IT project, I was looking for a way to add dynamic properties to classes (we're speaking of new-style classes of course!). I did a little research and here are the results...


Continue reading

Beginner's guide to creating a GNOME 2 applet with Python (Part II)

Posted on Wed 19 August 2009 in articles • Tagged with programming, Python, Gnome

It's been a while since I wrote the first part of this guide. I'm happy to introduce you the second part of the tutorial. This part continues the story about applet-only techniques. Even if you're skilled in PyGTK, you are adviced to read this part.


Continue reading

Big and Little endianness quest

Posted on Sat 01 August 2009 in Articles • Tagged with programming, G.729, C, VAD

Sometimes the bugs in programs do not depend on a programmer. For example, when a programmer expects a certain result from a built-in function, that would be the last place to check for bugs. But sometimes weird stuff happens, and it also happened to me.


Continue reading

Byte-compiled ChangeLog

Posted on Fri 03 April 2009 in Articles • Tagged with programming, Emacs, Elisp, regex

My favourite all-purpose, extensible and customizable editor is Emacs. Mastering Emacs takes months, even years, and there is always a lot to discover. For example, I've just seen how Emacs tried to byte-compile a simple ChangeLog text document. How could that happen?


Continue reading

Beginner's guide to creating a GNOME 2 applet with Python (Part I)

Posted on Wed 25 February 2009 in Articles • Tagged with Gnome, programming, Python

A bootstrap guide on creating Gnome2 panel applets with Python.


Continue reading