Ikanobori Weblog

April 11 2009

Language performance on the sum of a file.

Well, one of my posts caused quite a bit of attention so I am revisiting the subject. I’ll start by explaining what the idea is:

I have a text file containing numbers, a random amount of numbers per line and the numbers are of random size. Can you quickly give me a sum of all numbers? The file has to be read from stdin.

You can find the example file I used here. Read more…

April 9 2009

jQuery. Draggables, droppables. jQuery can’t recalculate the droptargets?

As an avid fan of jQuery (however, not using it too much) I’ve encountered a problem I really need to solve. I am writing this post in the hopes that some of the jQuery community will pick up on this as I think it is a problem a lot of jQuery developers will need to solve one time or another time.

I will start by describing my problem. The problem concerns a large tree which is foldable, by a large tree I am talking about about 200 main nodes with each of them ≈ 5 subnodes with each subnode an arbitrary number of pages or other subnodes. Read more…

April 8 2009

Python. Sum of file, generators vs list comprehensions.

Advanced Python users might know generators and generator comprehensions, this article is meant for people who are just getting started with Python and want to speed up some of their tasks.

Firstly I’ll start off with a little introduction of what list comprehensions are. List comprehensions are a nifty little syntactic sugar to make the creation of lists a lot easier. Read more…