Monthly Archives: September 2011

RPy2 substitute function does not work

Tweet I’m using rpy2 to call R package from Python, which works pretty well most of the time. Yet, I’ve encountered an issue with the R function called substitute that do not behave as expected when called from rpy2. Consider … Continue reading

Posted in Computer Science | Tagged , | Leave a comment

Set the default printer under linux

Tweet If you want to set the default printer, you can use the command line interface and type:

If you want to set the default printer permanently, and if your shell is bash (most common by default), you should … Continue reading

Posted in Linux | Tagged , | Leave a comment

super() function in Python raises a TypeError

Tweet Playing with class inheritance, I came across an unexpected behavior of super() function, which is used in the inheritance process. Consider this simple example of a class MyGraph thah inherits from a DiGraph class from networkx:

Then, you … Continue reading

Posted in Python | Tagged , | 3 Comments

a2ps usage

Tweet a2ps is a unix tool that ease the formatting of text files before printing.

Print code that span over more than 80 columns. You will need to decrease the font size (-f 7), use only one columns, in … Continue reading

Posted in Linux | Tagged | Leave a comment

How to generate a PDF reference of an R package

Tweet If you have the Rd files in a man directory, then in a shell command, you can use this command:

Posted in Computer Science | Tagged , | Leave a comment

HTML password protected

Tweet Password protecting a website (or a sub directory within a website) can be done easily thanks to two special files called .htaccess and .htpasswd First, in the directory that you want to be protected, copy and paste the following … Continue reading

Posted in Internet related | Tagged | Leave a comment

pdf2ps font issues

Tweet Sometimes, when converting a PDF file to a PS file using ps2pdf, some fuzzy fonts may appear. A solution is to provide the fonts within the documents by using:

Posted in Linux | Tagged , | 2 Comments

scp does not work: wrong bashrc

Tweet When I tried to use scp to copy a file on a distant machine:

it looked as if the SCP command works but the file is not copied. The interactive option (-v) does not provide any hints. The … Continue reading

Posted in Linux | Tagged , , | 3 Comments

How to resize images with awk and convert

Tweet If photos in a directory are too large, you may want to use a script to automatically convert all the files into another format. AWK and convert tools can help you. The following command should convert all the files … Continue reading

Posted in Linux, photos | Tagged , | Leave a comment

matplotlib: latex strings are not interpreted

Tweet If the LaTeX strings are not intepreted in matplotlib (e.g., in the xlabel), check your configuration file ( see previous post for matplotlib configuration file). You can either do it for one session :

or permanently within the … Continue reading

Posted in Python | Tagged , | Leave a comment