Friday, November 19, 2010

igraph plot error message

I was using igraph to plot a lot of graphs to files when I got this error message:
AttributeError: 'Plot' object has no attribute '_surface'

The function call I was using to do the plotting was

ig.plot(g, outf_name, **visual_style)

It turns out that the cause of this error is using an outf_name that doesn't end in a known extension.

Thursday, February 11, 2010

C++ doesn't guarantee the order in which function arguments will be evaluated...

... so, in particular, if you find yourself doing something like this:


something = make_pair(read_bytes_as(in), read_bytes_as(in));


you might find yourself reading the unsigned and the float in the wrong order.