Category Archives: programming

Working with utf8 (like Chinese) with sqlAlchemy + Elixir

Today I’ve been playing around with sqlAlchemy and Elixir. I was having problems with how some strings (Chinese Characters) were being encoded and stored. The issue was with the metadata.bind statement (create_engine() without Elixir) before it was: metadata.bind = ‘mysql://username:password@localhost/database’ You need to select utf8 encoding manually. metadata.bind = ‘mysql://username:password@localhost/database?charset=utf8’ or, plain SQLAlchemy: db = […]

tessellating cellular automaton

I was browsing a wikipedia article on cellular automaton (CA) and ran across a very interesting animated gif a glider gun in a torus wrap-around universe (think the game asteroids): public domain from wikipedia I wondered if the animation would tessellate–and it does! The YTMND-like result is: /sandbox/glidergun.php PHP source for the @ /sandbox/glidergun.phps