Categories
- Blog (104)
- Lua (13)
- Miscellaneous (48)
- Photos (6)
- Programming (33)
- Python (15)
- Sample (3)
- Web Design (3)
- Writing (2)
- Portfolio (40)
- Snippets (28)
- Blog (104)
Category Archives: Python
Pydev: The Best Python IDE
While I don’t usually advertise, I love eclipse for all of its feature rich implementations of language specific IDE’s. Among those is Pydev, a complete first class IDE for Python.
Recently, Pydev just hit version 1.6.0 (Congratulations!) with the…
Posted in Programming, Python
Tagged eclipse, editor, ide, Programming, pydev, Python
Leave a comment
Linked Lists via ctypes in Python
from ctypes import *
class linknode(Structure):
pass
linknode._fields_ = [
("nextNode", POINTER(linknode)),
("intData", c_int),
]
class linked_list():
head_node = None
def add(self, int_data):
node_to_add = linknode(intData = c_int(int_data))
if (self.head_node == None):
self.head_node = node_to_add
else:
traverse_node
…
Posted in Programming, Python, Snippets
Tagged ctypes, linked list, pointers, Python, structure
Leave a comment
Best Hello World App Ever :D
Written in Python
See http://failboat.me/2009/cute-functions-creating-pseudo-operators-in-python/ for more details.
#Hello World
class Operator(object):
def __init__(self, func, count=2):
self._func_ = func
self._args_ = []
self._count_ = count
def __ror__(self, first_arg):
self._args_.append(first_arg)
…
Gettings the most out of your bits
The following will produce the bit representation of an ord(byte) in python
def bit(chr, i=0, str=''):
if i > 7: return str
coef = (2**(8-i-1))
if chr >= coef: return bit(chr-coef, i+1, str+'1')
return bit(chr, i+1, str+'0')
…
Posted in Blog, Programming, Python, Snippets
Leave a comment
Primitive Collision Detection – Circular objects
Consider the following –
If you are designing a game, and have the players shaped as circles, how would you detect bullet collisions with the players?
Well, the problem with bullet collision detection is that you can’t just use…
Posted in Blog, Programming, Python, Snippets
Leave a comment