Python virtualenv: quick reference
Virtual environement (Photo credit: wikipedia)
To isolate python developments, I use
virtualenv. This allow me to forget
about the specific python version used for each project, avoid interferences
with the default python installation and between my projects, is relatively light,
and may have other advantages I cannot imagine with my current understanding.
The quick reference
gives all necessary commands:
I recommend using the --always-copy option when creating a virtualenv. It avoid
breaking the virtualenv when system upgrades may break symlink to old python
One tool I usually need is the add2virtualenv
to update PYTHONPATH.
One big advantage of virtualenv is the use of pip without side effects. Inside the
virtualenv use it without precaution.
R mclapply cores option
This morning, I found the default behavior of the mclapply() function not quite different from the one of the lapply(). After quick investigation, I found is was due to an option not correctly set: the number of core to use.
I must then overwrite the default mc …
R read lists from file
[caption id="" align="alignright" width="350"] Doubly-linked list (Photo credit: Wikipedia)[/caption]
This a retranscription of a post on stackoverflow.
The solution I keep is using the following command
a <- strsplit(scan("data.txt", what="", sep="n"), "t")
[caption id="" align="alignright" width="75"] Tool for language (Photo credit: Wikipedia)[/caption]
I found a study from IEEE on popularity of programming languages. I note:
- The languages I use are in the top 10 (R, C)
- C is always use in many
- scripts languages are widly used (you can …
[R R R R R R R R R R R R R R R]
[caption id="" align="alignright" width="350"] Spools of thread (Photo credit: Wikipedia)[/caption]
I wanted to use multithreading in R. I'm used to C pthread mechanism, but I want to use some R functions. This functions run independently on separate data, and treatments can take some time.
In short, what …