Meiosis - Wikipedia, the free encyclopedia
it was first discovered in sea urchin eggs. who would have guessed.
May 11th, 2008 / 0 Comments / Trackbackit was first discovered in sea urchin eggs. who would have guessed.
May 11th, 2008 / 0 Comments / TrackbackI first saw it a while ago in in this rails ActiveRecord tutorial – as the guy plays with the object relational mapper in one terminal window, all the SQL it’s running comes out in another terminal window. I saw that he had typed tail -f logs/development.log in the second window, so I investigated: tail displays the “tail” end of a specified file; -f keeps it going, spitting out new changes as the file is modified. In the case of the video, the file was a log file that rails writes all the SQL it runs to.
So I did this with braindump. Now if you set log_queries to true in app/config.php, the system saves every SQL query it runs to a log file at core/query-log.txt. So now I can type tail -f query-log.txt in the terminal, and the next time I go to a page on braindump, it spits out the requested URL and then all of the SQL that was run in the course of creating that page, like so:
tail -f core/query-log.txt # go to a page, and viola: /pages/index SELECT * FROM pages ORDER BY name DESC
It’s very useful for debugging, to see what’s going on behind the scenes. It’s also just cool to browse around and watch the terminal spit out SQL. It’s as if my program, braindump, is in the space between the browser window and the terminal window—you can see the cycle from HTTP request to SQL query and all the way back to HTML output.
It’s also cool to have the BQL console running in one terminal window and the SQL tail running in another. I type a BQL query into the console like so:
python xmlrpc_console.py braindump> get creator of braindump
and immediately the other window spits out the SQL queries that my BQL parser needed to get the answer:
SELECT id FROM pages WHERE name = 'creator' SELECT id FROM pages WHERE name = 'braindump' SELECT object_id FROM triples WHERE predicate_id = 1 AND subject_id = 2 SELECT name FROM pages WHERE id = 3
and then the answer comes back to the first window:
python xmlrpc_console.py braindump> get creator of braindump pedro
Anyway, yeah. If you didn’t follow that, oh well. This is a show-off post, not an informative one :)
May 11th, 2008 / 0 Comments / TrackbackI just implemented it last night. The idea is to create an english-like language á la SQL to simplify reading and writing information about entities in braindump. Right now there are four commands:
'set color of apple to red' => true'get color of apple' => 'red''list where color is red' => ['apple']'unset apple' => trueIt still needs some work, but that’s the gist of it. It’s mostly used internally now, but I also wrote a simple console program in python which lets you run BQL queries on a braindump server over XML-RPC. More about this later.
May 10th, 2008 / 0 Comments / TrackbackThe title was originally “Running”. but you win four oscars with “Chariots of Fire,” not “Running”. kinda funny.
May 10th, 2008 / 0 Comments / Trackbackthis guy was a keyboardist in a rock band before he was a über smart physicist. My life seems kind of boring right now.
May 10th, 2008 / 0 Comments / Trackback