Follow me
-
Recent Posts
calendar
December 2024 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Recent Comments
- Stan on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- Cormac on Pandas : how to compare dataframe with None
- LP on AWK: the substr command to select a substring
- jrab on python argparse issues with the help argument (TypeError: %o format: a number is required, not dict)
- How to disable SSL verification for urlretrieve? – Peter's blog on python: certificate verified failed
Archives
Categories
Meta
Author Archives: Thomas Cokelaer
Profiling Python with valgrind
1. Under Linux, install valgrind as follows (Fedora): sudo yum install valgrind kcachegrindsudo yum install valgrind kcachegrind and pyprof2calltree: pip install pyprof2calltreepip install pyprof2calltree 2. create a Python script (let us call it run.py) 3. Create the file containing the … Continue reading
svn: can’t upgrade
I’ve recently update my distribution and copied back an old SVN repo into the new distributio. This led to issues with respect to different SVN version. The old one used SVN 1.6 and the new one is 1.7 In general, … Continue reading
VIM : copy and paste reformats the text with lots of spaces
When I paste a piece of code or text from a copy (or the clipboard), lots of extra spaces are added at the start of each new line. The solution is to turn off the autoindent: :set paste:set paste After … Continue reading
Fedora 19 post installation
Another failed upgrade from Fedora… This time while upgrading from release 15 to 16. Although, I followed the instructions from Fedora web site, I ultimately end up (after a reboot) with a grub prompt. Quite dreadful. After a few hours … Continue reading
How to mount Sony NWZ walkman under Fedora
I recently bought a mp3/video SONY NWZ walkman (one of B172F or B173F). I plugged in the USB into the computer but it was not detected. It does not appear on the desktop and cannot be seen in a shell … Continue reading
canviz, jake and npm
I wanted to play with canviz (http://www.ryandesign.com/canviz/) to play around with graphviz and javascript. It’s still not clear what I’ll be able to do quickly with it but first I needed to install it. I first tried from the source … Continue reading
Python: Error: new-line character – how to open the file in universal-newline mode ?
I was playing with the CSV module from the Python standard library. Typically using a code such as: import csv import zipfile zip = zipfile.ZipFile("file.zip") zipdata = zip.open("ExistingFile.csv") data_iter = csv.reader(zipdata, delimiter=",") data_iter.next() import csv import zipfile zip = zipfile.ZipFile("file.zip") … Continue reading
SVN: how to clean up a directory from unversioned files
Here is the command to delete all the files in a SVN directory that are not in the SVN server repository. The first part (svn status) returns all files with the ? tag (meaning they don’t belong to the repository). … Continue reading
R package dependencies: difference between imports, depends, suggests, enhances
When you want to assemble R codes into a package, you will need to write a file called DESCRIPTION. This file contains some metadata and keywords to be used and some keywords are definitely confusing (at least to me). Here … Continue reading
Python: list of empty lists creates references not copy
In Python, you can create a list with an element repeated N times quite easily with the following syntax: >>> a = [1] * 5 >>> print(a) [1,1,1,1,1] >>> a = [1] * 5 >>> print(a) [1,1,1,1,1] Here we create … Continue reading