Archive for the ‘Programming Articles’ Category

Recursively deleting symbolic link and what it points to

Recently I looked for a solution to this little problem. how do you, programmatically, delete a symbolic link and a file that it points to?
One problem that you should take care of when tackling this problem, is that symbolic link can point to a symbolic link. Then symbolic link should also point to symbolic link. [...]

Direct IO in Python

Doing file I/O of any kind in Python is really easy. You can start with plain open() and friends, working with Python’s file objects. by the way, Python’s open() resembles C’s fopen() so closely that I can’t stop thinking that open() may be based on fopen().
When its not enough, you can always upgrade to open() [...]

MSI-X – the right way to spread interrupt load

When considering ways to spread interrupts from one device among multiple cores, I can’t not to mention MSI-X. The thing is that MSI-X is actually the right way to do the job.
Interrupt affinity, which I discussed here and here, has a fundamental problem. That is inevitable CPU cache misses. To emphasise this, think about what [...]

Bazaar for subversion users, part 1 – the basics

Table of contents
Introduction to the series
Introduction to the article
Way of working with Bazaar
Demo setup description
Directory and user configuration
The basics
Creating a project
Checking-out the project
Adding files to the project
Committing files
Few words about revision numbers in Bazaar
Local commits or offline commits
Committing local commits to remote branch
Multi-user environment
Making modifications to files and viewing differences
Committing non-up-to-date file
Merging with the latest [...]

C/C++ reference counting with atomic variables and gcc

Table of contents
Introduction to the series
Introduction to the article
Way of working with Bazaar
Demo setup description
Directory and user configuration
The basics
Creating a project
Checking-out the project
Adding files to the project
Committing files
Few words about revision numbers in Bazaar
Local commits or offline commits
Committing local commits to remote branch
Multi-user environment
Making modifications to files and viewing differences
Committing non-up-to-date file
Merging with the latest [...]

pthread mutex vs pthread spinlock

Update 06/16/2009: On several occasions, commentators to this article pointed out that this post is somewhat incomplete. Therefore, before I continue, I would like to make some things clear.
Before considering the code below, please note that spinlocks are totally useless on uni-processor computers. This is due to a nature of spinlocks, which I will describe [...]

A new kind of virtualization

There are plenty of virtualization technologies. There are organizations like VMware, VirtualBox and XEN, whose virtualization allows one to run several virtual computers using one physical computer.
I worked at a company called ScaleMP. ScaleMP’s technology, vSMP, turns multiple physical computers into one large computer.
Today I was looking for something different. I was looking for technology [...]

Python’s optparse for human beings

In this article I cover in depth Python’s optparse module. It presents most useful recipes and is a good handbook when parsing command line options in a Python program.

Signal handling in Linux

This article introduces signals in Linux to the reader. It explains the nature of signals, how to use them and gives few small use examples.

How to send SMS message with Python

I can’t beleive all the things that you can do with Python. Obviously, whatever you can do with Python, you can do with a whole bunch of programming languages out there. What I am really impressed with, is the ease.
Few weeks ago I was looking for a way to programatically send myself SMS on certain [...]