Bejegyzések

Bejegyzések megjelenítése ebből a hónapból: július, 2012

Bash script that cannot be run more than once at the same time

People dealing with cron, and bash scripts that might take a bit longer than they're supposed to often encounter the following behaviour. Suppose that you launch something from cron in say every hour. The stuff usually completes in 10 minutes, but sometimes, when the load peaks, or network clogs, the process is running much slower. After an hour an other one is launched, further hogging the resources of the machine and possibly messing up data. The solution for this is to pay attention not to run twice of course (and also to fix the underlying problem that causing the slowdowns).

How NOT to write SLOW programs with python and numpy

How to write fast programs with numpy and python At first, I wanted to write a post about "how to write fast programs with python and numpy". After writing a few test cases it quickly turned out that the fast, numpy versions of tests are not only fast because of numpy, but because they use numpy "the right way". Let's see what does it mean.