Archives week 36 of 2009
Sept. 7, 2009 - Sept. 13, 2009
Hack to map Vertex Buffer Objects into Numpy arrays...
Written by
on
in
Snaking.
This post from the numpy list shows you how to turn a ctypes c_void_p into a numpy array. The glMapBuffer() function maps your currently-bound array into a void * which you can access directly... combining the two:
def map_buffer( vbo, access=GL_READ_WRITE ): """Map the given buffer into a numpy array...""" func = ctypes.pythonapi.PyBuffer_FromMemory func.restype = ...
Hard-linking and disk-space... whatever...
Written by
on
in
Tuxedo.
Toying yet more with compressing rdiff-backup repositories with hard-linking. Turns out there's already someone who's done it. My script for hard-link finding is different than the (packaged) one he's using, but it seems to have the same basic idea (I use filecmp, though, rather than reading the files myself, and I don't check owner/group/mode ...