Tag Archives: python

Yet another silly Python vs Java comparison

I’ve been hacking the mspsim (a simulator) source to add support for a couple of stuffs in its profiler. At a certain point I had a hash table mapping functions to how many times they were called, and I had to sort them by that number of times. How to do that? List<entry> list = [...]

Access violation errors with callbacks in ctypes

I’ve just spent a few hours trying to solve this bug, so I’m publishing this so maybe it will help someone with this issue… Assume that you’re working with a DLL/.so library through ctypes in Python, and this library allows you to set a callback for some other function. In my case, I was working [...]

Why I rewrote Quivi from scratch

Joel Spolsky, popular software engineering, said in this blog: (…) They [Netscape] did it by making the single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch. I agree, mostly. Many projects market that they’ve been “rewritten from scratch” as if it was something marvelous, and most [...]

Python, Phyton… Pytohn?

Essa é nova: As primeiras versões para Java e Pytohn já estão disponíveis para download a partir do serviço Google Code. Não dá para entender a inabilidade geral das pessoas de escreverem “Python” direito.

Closure gotcha (with Python)

Do you know what a closure is? Basically, it’s a function created at runtime that references variables defined in a outer scope. For example: def make_number_printer(n): def number_printer(): print n return number_printer printer = make_number_printer(5) printer() The function make_number_printer receives a number and returns a function which, when called, prints that same number. It’s not [...]