Tag Archives: Programming

You know you need to install a new Python version when…

>>> import decimal >>> decimal.Decimal(’0.2′) <&nbsp; 0.3 False >>> This little gem took me two hours to track down. It turns out that since my code is using sqlobject, it also uses the decimal module. I had some constants set … Continue reading

Posted in Programming, Python | Tagged , , , | 4 Comments

A Python Rant

Last night I encountered yet again one of Python’s annoyances. The annoyance I’m referring to is the lack of string like functions for lists. Trivial examples include find() and rfind(). Before you mention index though, it’s important to point out … Continue reading

Posted in Programming, Python, rants | Tagged , , , , , | 6 Comments

Open Question No. 1: Persistent Predicates?

Lately I’ve been developing a website. One issue that I’ll probably need to address in the near future is “persistent predicates”. By “persistent predicates” I mean the problem of treating predicates as data. Consider the following situation: you are developing … Continue reading

Posted in Design, Programming | Tagged , , , | 6 Comments

Fractal Memory Usage and a Big Number

In a previous post I said I’d talk about 4**(4**(4**4)). First, about the number. I first saw it mentioned in a math lesson back in high-school, when the teacher wanted to demonstrate estimation abilities. He wrote it on the board, … Continue reading

Posted in Algorithms, computer science, Fractals, Math, Programming, Python | Tagged , , , | 1 Comment

My Bad Memory, High Load, and Python

About a month ago the new Ubuntu 8.04 was released and I wanted a clean install. I downloaded an image and burned it to a CD. Just before installing, I tried “check CD for defects” and found a few. Turns … Continue reading

Posted in Personal, Programming, Python, Testing | Tagged , , , , , , , | 1 Comment

PyKoan – The Logic Game

As you can probably tell, I’m back from my undeclared hiatus. I’ve got lots of stuff to talk about, and I’ll be starting with PyKoan, one small project I’ve been working on lately in my spare time. A few weeks … Continue reading

Posted in Game Development, Math, Programming, Projects, Python | Tagged , , , , , , , | Leave a comment

Singleton: my use-case for class decorators

It seems that class decorators will finally be making an appearance in Python 3 and Python 2.6. I’ve thought about using them from time to time, but the use-cases weren’t that common. However, I did find myself writing a lot … Continue reading

Posted in Programming, Python | Tagged , , , , | 2 Comments

The Case Against Floating Point ==

While working on the clipping bug, I had to do some floating point comparisons. To handle this virtual mine-field, I used simple precision comparisons. Not surprisingly, I wanted to know what’s ‘the right way’ to do this in Python. When … Continue reading

Posted in Programming, Python | Tagged , , , , | 3 Comments

Various Small Python Helpers

I’ve been working lately with arkon on various projects related to diStorm. One of these projects involved writing a solid Python API around an existing C API. This C API uses a lot of flags as arguments and return values … Continue reading

Posted in Programming, Python, Utility Functions | Tagged , , | 5 Comments

Two Mathematical Bugs

A few days ago, I discovered I had at least one, maybe two mathematical bugs. The first bug is in the line clipping algorithm. Here’s a quick reminder of what’s going on there: There are six points of interest: the … Continue reading

Posted in Algorithms, Geometry, Math, Programming, Python | Tagged , , , , | 2 Comments