Monday, May 27, 2013

This is NUTs

I have a couple of double-conversion UPSs (i.e. the good kind) powering up two racks on my experiment. These are sophisticated instruments, with inbuilt battery checks and reporting of lots of power quality parameters. The trouble is to read them out into a computer and control them with serial commands, since the serial command set appears to be proprietary.

Enter the NUT project ! It includes drivers for a huge number of UPS systems, and there's a Python wrapper around it all called PyNUT. Code coming soon ...

Wednesday, May 22, 2013

Prime number density

Prime numbers are almost 'physical'. Spooky.



Listing primes

Naive prime testing compared to the Sieve of Eratosthenes.
cProfile says (for N = 100 000):
  naive testing =  7.912 CPU seconds
  sieve method = 0.064 CPU seconds

Sieving is fast !