What is an index in SQL?

An index is used to speed up searching in the database. MySQL have some good documentation on the subject (which is relevant for other SQL servers as well): http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html An index can be used to efficiently find all rows matching some column in your query and then walk through only that subset of the table to … Read more

Confused by python file mode “w+”

Let’s say you’re opening the file with a with statement like you should be. Then you’d do something like this to read from your file: Note the f.seek(0) — if you forget this, the f.read() call will try to read from the end of the file, and will return an empty string.

TypeError: ‘int’ object is not callable

Somewhere else in your code you have something that looks like this: Then when you write that is interpreted as meaning a function call on the object bound to round, which is an int. And that fails. The problem is whatever code binds an int to the name round. Find that and remove it.

Set line spacing

Try the line-height property. For example, 12px font-size and 4px distant from the bottom and upper lines: Or with em units

Confused about stdin, stdout and stderr?

Standard input – this is the file handle that your process reads to get information from you. Standard output – your process writes conventional output to this file handle. Standard error – your process writes diagnostic output to this file handle. That’s about as dumbed-down as I can make it 🙂 Of course, that’s mostly by convention. There’s nothing stopping … Read more

python – how to get the data from an plt.imshow()?

a should be a matplotlib.image.AxesImage instance, in which case you can use and The array is stored as a masked array. Example There’s an official example available at http://matplotlib.org/examples/animation/dynamic_image.html. Direct access You can also use to access the array data directly, though I imagine that the getters and setters are the preferred method.

What is a PDB file?

A PDB file contains information for the debugger to work with. There’s less information in a Release build than in a Debug build anyway. But if you want it to not be generated at all, go to your project’s Build properties, select the Release configuration, click on “Advanced…” and under “Debug Info” pick “None”.