Been busy with the play and work. We switched to a 4 day, 9 hour work week. So that leaves me with about 2 hours each day for non-theater, non-work related stuff. Not counting the day off, I guess.
Anyway, check this out. I have been tasked with writing a SQL Server database module for Drupal 6. This is not fun. It’s slow, Drupal is written poorly for abstraction, and there are odd idiosyncracies one has to deal with. But that’s not what I want to tell you about.
This is the vargrind output between a semi-working mssql installation and a working mysql installation. That 400 number is the number of queries the MSSQL module needs to do to render the ‘My Account’ page. For comparison, MySQL only requires about 40.
This is a sort of code analysis and something I discovered with :include usage in Rails. (This is in rails 1.1.6, so YMMV. I believe the latest Rails opts to use inner SELECTs rather than JOIN statements.
Also, this is kind of long.)
So, this pleases me enough to post it.
Needed to quickly add a notice to every page on a client’s site where there was a single include, but not single-included layout pages (teachers, *sigh*).
I’ve never messed with output buffer stuff before, so this was just sort of surprising to me. It’s insanely useful.
Only took about a minute to code, and two to deploy.
Thought this was a little silly, but it generated a lot of discussion about precedence, short-circuiting of conditionals, and the value of syntactic sugar.
Also, there’s an awesome feature in the WP DB object such that if one requeries the same table on the same page, apparently pagination offset is lost. This means that the main index page listing posts cannot also have a recent posts list — because you either will have recent posts starting with whatever the main list offset is, or you will only ever have as many posts on the index page as the recent posts query returns.
Finally got around to learning how to define keyboard shortucts in vim. It’s easy!
map <desiredkey> <targetaction>
So, for example, I split windows vertically and want to navigate via ctrl+pagedown or pageup.
Here’s what I did (include < and > when defining)
map <c-pageup> <c-w>h
map <c-pagedown> <c-w>l
Found via a vim wiki search
[ad#Google Adsense small leaderboard]