Archive for the Programming Category

Creating Voxel Volumes Quicky in Python

Posted in Development, How To, Programming with tags , , , on 2011/06/09 by Adam Griffiths

Creating large chunks of memory is quite tricky in Python because of a number of overheads. I’ve been attempting this myself and have found a fast method to do this which combines a few handy optimisations we would need later on for a Voxel Engine anyway.

Please be aware that the code evolves along the way, so don’t blindly copy and paste the first examples =).

Also, the WordPress theme is cutting of some text. If you copy and paste it, it is still there.

This post is continued in Position Aware RLE, RLE and Part 2.

Continue reading

Pinning Eclipse to the Windows 7 “start bar”

Posted in How To, Programming with tags , , , , on 2011/05/26 by Adam Griffiths

Eclipse and Windows 7 have a bit of a feud. There is no option to pin Eclipse to the start bar. If you create a shortcut you can pin the shortcut, but when the app is run it creates a second item.

Found a post that fixes this annoying issue.

Be aware that you’ll need to edit the file as Admin if you installed Eclipse into a system location. Best way is to go Start > “WordPad” > Right Click > Run as Administrator, and then open the file from inside the application.

Building PyBullet on Windows

Posted in How To, Programming with tags , , , on 2011/05/24 by Adam Griffiths

PyBullet is a wrapper around the popular Bullet C++ physics library.

Once you’ve build the C++ Bullet library you can then build PyBullet.

The PyBullet documentation states to use the –include-dirs directive to add the Bullet include path, but it also requires the numpy include directory which didn’t resolve automatically for me. Unfortunately you can’t just append it to the –include-dirs flag.

I resolved it with the following:

cd path\to\PyBullet

set INCLUDE=%INCLUDE%;c:\path\to\python\site-packages\numpy\core\include

python setup.py build_ext –include-dirs c:\path\to\bullet\src –library-dirs c:\path\to\bullet\msvc\2008\lib\Release

Obviously you replace the \msvc\2008 directory with the appropriate one if you didn’t build the vanilla target.

After this, copy the file PyBullet\build\lib.win32-2.6\bullet\bullet.pyd to PyBullet\bullet.

Include the PyBullet\bullet directory in your Python project and import.

You should now be able to do the following:

import bullet.bullet as bullet

print help(bullet)

Make sucks

Posted in Programming, Rant, Uncategorized with tags , , , , , on 2011/04/03 by Adam Griffiths

I used Make extensively at my last job. You know what? Make sucks!

I’ve talked about this on Reddit and the only response I ever got was fan boi’s who have memorised the manual saying “You just need to read the manual! It’s fine!”.

Arbeit GNU Macht frei

Python Multiprocessing with ZeroMQ

Posted in Programming with tags , on 2011/02/22 by Adam Griffiths

Good example of ZMQ with Python and multiple processes.

Also found an issue with the example code which I have fixed below (and included a comment on the original blog post).

Continue reading

%d bloggers like this: