Monthly Archives: October 2011

Python: how to share a local directory on the web

Tweet A simple way to share a local directory on internet (temporarily) can be performed with Python. First, go to the directory you want to share and then type:

Now the entire directory could be accessed on the network … Continue reading

Posted in Python | Tagged | Leave a comment

Malloc and Casting

Tweet In C, the malloc function is used to allocate memory. Its prototype is:

It returns a void pointer (void *), which indicates that it is a pointer to a region of unknown data type therefore it is a … Continue reading

Posted in Computer Science | Tagged , | 2 Comments

vim: replace tabs by spaces

Tweet In the vim editor, the default behaviour of the tab key is to print a tab … not surprising. When coding, you may prefer tab to be replaced by spaces (because this is your coding style for instance). This … Continue reading

Posted in Linux | Tagged | Leave a comment

Allocation 2D arrays in C (and freeing memory)

Tweet By convention, when dealing with 2D array, the first dimension refer to the rows, and the second to the columns. To create a 2D array (double pointer) in C, you first create a 1D array of pointers (rows), and … Continue reading

Posted in Uncategorized | Tagged | Leave a comment