My high school, homeless

Last week, my high school, the University of Toronto Schools (UTS), sent out an e-mail concerning the University of Toronto’s rejection of its site redevelopment proposal, effectively thanking UTS for all the fish. Though not entirely surprising, what was surprising was finding an article in the Globe and Mail about it this morning, prompting this off-cycle blog post. Not being half as eloquent as my academic siblings, I will try to keep it brief.

Continue reading “My high school, homeless”

Like Paper Mario, Paper Inflo

At the request of jp, I have created a version of Inflo that’s more napkin-like. It’s fully compatible with the regular version of Inflo (it has a few known quirks because a) this is a hack and b) we’ll see how popular it is). However, it’s not yet linked in to the regular Inflo, yet. To use it, for any Inflo URL, replace http://inflo.cs.toronto.edu:8888/ with http://inflo.cs.toronto.edu:8888/paper.html. For example, to view one of apsmith‘s graphs in paper form, visit http://inflo.cs.toronto.edu:8888/paper.html?nodeId=215330785548783400729978002751085462383&nodeVersion=1302663272.770201&action=loadView (note the extra “paper.html”); you’ll need to scroll to the top left after the page has loaded.

Inflo macros

Last week, I added support for client-side macros to Inflo. While I had previously reengineered the custom autocomplete widget (used for entering content) in anticipation of additions such as this, I hadn’t really thought about how the macros would actually work. In the end, I was surprised at how simple it was to add, although some of my previous changes were helpful (most notably the parser I had written the day before); it took just under one hundred lines of new/changed code. Also nice is how everything is falls back when a macro hasn’t been defined.

register_macro(
    "stopping time", // Name of the macro
    "stopping time ( <i>velocity</i> , <i>deceleration</i> )", // Autocomplete help
    // The function itself; its parameters come in directly from Inflo and one needn't worry about nodes;
    // they're automatically converted to their values.
    function (v1, decel) {
       /* Assumes velocity in m/s and deceleration is in m/s^2 */
       return (v1 / decel).toString() + " s";
    });

The macros behave exactly like a built-in Inflo function, except they’re all currently prefix notation, don’t support sub-expressions in their arguments, need to be user-loaded when viewing the graph (easy with Creammonkey and Greasemonkey), and, for simplicity, ignore units coming into the macro. Anyone that knows some Javascript can write an Inflo macro!

Populating Inflo with data

One can fairly simply write a module to dump data into Inflo.  The first thing I populated the database with was with some population data and then surface area data.  I’m currently thinking of adding GDP data.  Any ideas as to what other easily mineable data I ought to include?

Atomic conditional inserts with complex conditions

I was going to blog about the software I’m currently writing, but that’s not happening, yet (although it’s been beta-test-ready for about a week and, given that I’ve made just under 100 subversion larger-than-ideal check-ins in the last seven days, it’s been getting refinements literally almost by the hour).  Instead, I’m going to share a little trick I came up with to do atomic conditional insertions into a database without using triggers or conflicts.  Indeed, I’m using little old sqlite3, so there’s nothing fancy going on in this database at all.  Sure, the software I’m currently working on is probably going to be open sourced at some point, but this would just get buried in there.

Continue reading “Atomic conditional inserts with complex conditions”

Jam-packed week

Yes, it’s that crazy week again.  Pi Day, Dead Caesar Day, and St. Patrick’s Day.  But that’s not why this week’s blog post is so short…  I’m trying to cook up a storm (having likely discovered one unrelated HTML5 bug in each of Safari and Firefox), so we’ll see what happens next week.  Hopefully there will be less RFC reading next week.

Fault tolerant… public transit

I was going to write a proper blog post today, but I got stuck in a good old fashioned TTC delay for about forty minutes this morning (this also means I haven’t proofread this post nor thought too much about the topic). Some poor folks that left later than I may have been held up by multiple delays. Indeed, a single delay on the TTC seems to invite further delays. I.e., though long delays aren’t (that) frequent, once there is one delay, multiple long delays seem to crop up. If the TTC has statistics on the number of chains of delays that appear within half an hour of each other, I’d love to see if I’m just experiencing a memory bias (also likely). However, I’m not here to rant today, but to put some thoughts down I had during my bonus (cramped) quiet time today.
Continue reading “Fault tolerant… public transit”