-
Recent Posts
Recent Comments
Archives
- June 2011
- February 2011
- January 2011
- December 2010
- April 2010
- March 2010
- February 2010
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- February 2007
Categories
- Algorithms
- Assembly
- C
- Challenges
- Compilation
- computer science
- Cryptography
- CSS
- Databases
- decompilation
- Design
- Fractals
- Game Development
- Geometry
- gotchas
- Graphics
- Group Theory
- Humour
- Javascript
- Linux
- Math
- Miscellaneous
- Optimization
- Optimization
- Optimization
- Optimization
- Origami
- Personal
- Programming
- Programming Philosophy
- Projects
- Protocols
- Python
- rants
- Research
- Security
- Sound
- startup
- Statistics
- Teaching Programming
- Testing
- Uncategorized
- Utility Functions
- web-design
Category Archives: Programming
Python Gotchas No. 2: Garbage Collection Oddities
Python is a garbage collected language. The garbage collector will collect orphaned objects. These are objects that have no references. If an object has a __del__ method, it will be called when that object is collected. Note however, that there … Continue reading
PythonTurtle delivers!
A few days ago, a coworker asked me what tool he should use to teach another non-programming coworker some programming. I thought a little, and suggested PythonTurtle, and then also demonstrated the builtin turtle. I thought nothing much of it, … Continue reading
Posted in Programming, Python, Teaching Programming
Tagged Python, teach, Teaching Programming, turtle
1 Comment
Python Gotchas 1: __del__ is not the opposite of __init__
After discussing my last post with a friend and talking about a few other issues, we came to the conclusion that it would be worthwhile to discuss more gotchas. First though, what is a gotcha? Wikipedia gives a good definition: … Continue reading
GeneratorExit: another reason to upgrade to Python 2.6
Ever heard of GeneratorExit? Unless you write generators, and do some unusual stuff with them, you probably haven’t encountered it. GeneratorExit is a special exception that gets raised from within a generator when it is close()-ed. For example, consider the … Continue reading
Posted in Programming, Python
Tagged GeneratorExit, Gotcha, Python, Python 2.5, Python 2.6
Leave a comment
Fast Peak Autocorrelation
So, I was at geekcon. It was a blast. There were many interesting projects, and I didn’t get to play with them all. I did get to work a bit on the Lunar Lander from last year, and this year … Continue reading
Posted in Algorithms, Math, Programming, Projects, Python, Utility Functions
Tagged autocorellation, automatic guitar improviser, geekcon, Math, pyimprov, signal processing
Leave a comment
Preparing PyImprov for GeekCon on Friday
A long long time ago, I wrote Pytuner. It was one of the first projects I published on this website. For a long time it just sat there, doing nothing, while the library it’s based on – PyMedia, wasn’t being … Continue reading
10 Python Optimization Tips and Issues
Following my previous post on Optimizing Javascript, I thought I’d write a similar post regarding Python optimization.
Posted in computer science, Design, Optimization, Programming, Python
Tagged memory, memory usage, optimization, Programming, Python
7 Comments
Checking the ulam spiral
In the following post, the Ulam spiral is described. It’s a very simple object – write down consecutive natural numbers starting from 41 in a square spiral. Curiously, the numbers on the diagonal are primes: Reading this post, I immediately … Continue reading
Posted in Math, Programming, Python
Tagged Math, prime numbers, Programming, Python, Ulam spiral
4 Comments
Bulk INSERTs FTW
A short while ago, I had to research some API for a company I’m consulting for. This API yields very good quality data, but isn’t comfortable enough to process it for further research. The obvious solution was to dump this … Continue reading
Posted in Databases, Programming
Tagged bulk-insert, Databases, Python, sql-server, sqlalchemy, sqlite
1 Comment
A Simple Race-Condition
Lately, I’ve mostly been working on my startup. It’s a web-application, and one of the first things I’ve written was a cache mechanism for some lengthy operations. Yesterday, I found a classic race-condition in that module. I won’t present the … Continue reading
Posted in Databases, Design, Programming
Tagged Bug, Caching, Databases, Multi-Threading, Race-Condition, web applications
14 Comments