While Link can move a single pixel at a time, in any direction, the
longer he continously moves in any direction the more he gravitates
toward aligning himself with the underlying grid of the screen. The
tile grid for LoZ is 16 tiles wide by 14 tiles high (including 3 tiles
for the status display at the top of the screen). Each tile is 16×16
pixels. Link operates on a half-tile grid, though (32×28 tiles, 8×8
pixels each). As Link moves, if he’s not currently aligned with the
half-tile grid, he is adjusted, one pixel at a time, toward the
closest correction. As a result, if Link is 4 pixels off alignment
he’ll line back up with the grid after moving 4 pixels.
* Checking minimum space in /tmp... [ OK ] * Configuring network interfaces... [ OK ] * Starting system log daemon... [ OK ] * Starting kernel log daemon... [ OK ] * Starting OpenBSD Secure Shell server sshd [ OK ] * Running local boot scripts (/etc/rc.local) [ OK ] Ubuntu 8.04 japherchunk hvc0 japherchunk login: Out of memory: kill process 1415 (klogd) score 178 or a child Killed process 1415 (klogd) Out of memory: kill process 1392 (syslogd) score 153 or a child Killed process 1392 (syslogd) Out of memory: kill process 19233 (getty) score 25 or a child Killed process 19233 (getty) Out of memory: kill process 1354 (getty) score 8 or a child Killed process 1354 (getty) Out of memory: kill process 1459 (getty) score 8 or a child Killed process 1459 (getty) Kernel panic - not syncing: Out of memory and no killable processes...
courtesy of @charleshooper, the genius behind subversity.net
#!/usr/bin/env pythonimport tornado.httpserverimport tornado.ioloopimport tornado.webimport tornado.authfrom sqlite3 import connectimport settingsdef list_databases(): """List all databases""" from os import listdir return listdir(settings.data_path)def list_tables(database): """List all tables""" from os import path # TODO: Sanitize 'database' var for directory traversal conn = connect(path.join(settings.data_path,database)) cursor = conn.cursor() cursor.execute("""SELECT name FROM sqlite_master WHERE type='table' ORDER BY name""") tables = [table for table in cursor] cursor.close() conn.close() return tablesdef dump_data(database,table): """Dump all records in a table""" from os import path conn = connect(path.join(settings.data_path,database)) cursor = conn.cursor() # TODO: santize 'table' for SQL injection cursor.execute("SELECT * FROM `%s`" % table) data = [row for row in cursor] cursor.close() conn.close() return dataclass MainHandler(tornado.web.RequestHandler): """Main Handler... list all databases""" def get(self): self.write(repr(list_databases()))class ListTableHandler(tornado.web.RequestHandler): """List tables in specified database""" def get(self,database): self.write(repr(list_tables(database)))class DataHandler(tornado.web.RequestHandler): """Dump all records from a table""" def get(self,database,table): self.write(repr(dump_data(database,table)))application = tornado.web.Application([ (r"/", MainHandler), (r"/([\w]+)/", ListTableHandler), (r"/([\w]+)/([\w]+)/", DataHandler),], cookie_secret=settings.cookie_secret,)if __name__ == "__main__": http_server = tornado.httpserver.HTTPServer(application) http_server.listen(settings.port) tornado.ioloop.IOLoop.instance().start()
Also see his codepad posting
weird weird bug with turbogears. My main controller has two methods, index() and vote() . Recently we added a sort of homebrew session thing that works by passing POST parameters around instead of cookies ( this is all going through facebook, so there are hoops). the gist of it being, first we get a userid from facebook, we salt and hash it and use those values to make sure people are POSTing at us from fb, and also to know if they are a new user or not.
Yes, this is sort of vulnerable to man in the middle attacks; that's not the point, and the dang app doesn't properly work yet.def nada(meth): def donothing(self, **kw): return meth(self,**kw) return donothing
wtf?
i throw a pdb.set_trace() in the first line of chkhash(), it gets called twice every time i hit http://localhost:8080/
my abort(500, msg) displays a traceback sort of page, unlike the abort(500,msg) from other code in this module.
so I change @chkhash to be named @choookhash, no dice ( maybe chkash is a tg keyword?)
def chkhash( meth, **kw): #import pdb;pdb.set_trace() if not 'wm_user' in kw or not 'wm_hash' in kw: msg = 'Missing required user and hash params' log.error( '%s params: %s' % (msg, request.params)) abort(500, msg) if kw['wm_hash'] != mkhash( kw['wm_user']): return '0' def valid_meth(self, **kw): return meth(self, kw['wm_user'], wm_hash=wm_hash, **kw) return valid_meth
if not 'wm_user' in kw or not 'wm_hash' in kw: msg = 'Missing required user and hash params' log.error( '%s params: %s' % (msg, request.params)) #abort(500, msg) kw['wm_user'] = 'me' kw['wm_hash'] = mkhash( kw['wm_user'])
what the fuuuuuck, turbogears?! why does that line make you call the wrong method on my controller ?!
def chkhash( meth, **kw): def fail(self, **kw): return '0' if not 'wm_user' in kw or not 'wm_hash' in kw: msg = 'Missing required user and hash params' log.error( '%s params: %s' % (msg, request.params)) return fail if kw['wm_hash'] != mkhash( kw['wm_user']): return fail def valid_meth(self, **kw): return meth(self, kw['wm_user'], wm_hash=wm_hash, **kw) return valid_meth
oh. and now turbogears calls the right controller method.. ohkaaay.
Moral of the story: sometimes bugs make shit fail in weird ways.
Uninstall report:
542749 you gave me a awful headache.I'm 73 years old, legally blind,Iwhaa?
wear two hearing aids, that don't wotk. You teased me about giving
$50k to cure my credit card bills. My life is ruined because you
killed my dreams.I hope you don't hurt anymore people like you hurt
me.