Latest posts
C's heritage: bitwise and equality operators


The design of C made by Brian Kernighan and Dennis Ritchie has influenced the whole software and hardware industry. Sometimes you can feel the heritage of C even in modern high-level dynamic languages like Javascript.

Comments [0]
Python: checking for an empty string


There are few tricks, that may do your Python code even faster. For example, the task of finding if a string is empty or not is not trivial as it seems. Would you like to find out?

Comments [0]
Python: comparing with None


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

Comments [0]
I need a rest


It looks like I really need a rest.
I've written this code ..

1
decision = speech_count > noise_count and True or False

..and then spent 5 minutes trying to catch, what the heck was wrong with it? :)

Comments [0]
Inside Python: understanding os.listdir()


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?

Comments [0]