Category Archives: Essay

Mac Pro 2008 Not Turning On: Power Supply Problems

Apple Mac Pro 2008

Just an aside, my trusty Mac Pro 2008 tower started behaving erratically a few weeks ago. Basically it wouldn’t power on, instead it would emit two faint relay type clicks a few seconds after pressing the power button. Leaving it unplugged overnight would occasionally result in it being boot-able the next morning.

Now I’ve been through a few spare parts on this particular computer – in particular graphics cards (it’s on its third). The overnight powerdown fix pointed me towards SMC problems, but replacing the motherboard battery didn’t resolve anything. Which lead me to the PSU. I tried using compressed air to blow the dust out of it in case it was some kind of thermal issue to no avail.

Continue reading

PySmaz a Pure Python Small-String Compression Library Ported from SMAZ

PySmaz is a pure python port of the SMAZ small string compression library originally developed by Salvatore Sanfilippo. I thought I’d just jot down a few notes about the experience of porting the library from C to Python. In particular the challenges around optimizing both the absolute compression ratio of the algorithm, ensuring throughput is acceptable for its intended use, while preventing the code from descending into an unreadable mess.

Continue reading

Python: Pulling Apart IEEE Floats for Decimal conversion

While attempting to convert floats precisely to Decimals the other day I was caught out by the fact that Python 2.6’s print function defers to whatever the underlying C compiler’s printf function does. This meant that on Linux I got one result when I asked for ‘%.31f’ % math.pi, and on Windows – something completely different. This lack of portability is a pain, and I had to work around it.

Continue reading