Posts from: 2011

29 Dec 2011

Untitled 2011-12-29

The first two bars I used to play on the electric piano but couldn’t figure out how to make it into a (pop) song. This is more fun.

25 Dec 2011

ElggCollection Proposal

An ElggCollection entity would store an ordered set of integers optimized for filtering and/or ordering SQL queries of entities, annotations, or other tables with integer primary keys.

4 Dec 2011

Obama’s ONDCP still can’t be trusted

The Office of National Drug Control Policy under Bush, led by John Walters, was notorious for flat-out lies and evidence bending, especially regarding cannabis (it was a holy culture war for Ashcroft as well), but under Obama the office has mostly put focus on prescription drug abuse and “drugged driving”. With 2012 bringing a host [...]

30 Oct 2011

Mad Men Theme Chords

I know there’s a full R2J2 song I haven’t heard yet, but since we’re marathoning MM I had to figure out at least this part. With capo on the 4th fret it’s easier to work the melody in. x-0-2-2-1-1 C#m x-0-2-2-1-0 (x 2) x-2-3-2-x-0 D#m7-5 x-2-3-2-3-x (x 2) 0-x-3-2-3-x C#m/G# 0-x-2-2-1-x (x 2) x-x-1-2-1-x D#7-9/G [...]

28 Sep 2011

String Subtypes for Safer Web Programming

Valid HTML markup involves several different contexts and escaping rules, yet many APIs give no precise indication of which context their string return values are escaped for, or how strings should be escaped before being passed in (let’s not even get into character encoding). Most programming languages only have a single String type, so there’s [...]

15 Sep 2011

RotURL: Rot13 for URLs

RotURL is a simple substitution cipher for encoding/obscuring URLs embedded in other URLs (e.g. in a querystring). Also, common chars that need to be escaped (:/?=&%#) are mapped to infrequently used capital letters, so this generally yields shorter querystrings, too. /**  * Rot35 with URL/urlencode-friendly mappings. To avoid increasing size during * urlencode(), commonly encoded [...]

13 Sep 2011

Validate Private Page Bookmarklet

ValidatePrivatePage <– validates in current window ValidatePrivatePage <– validates in new window (your pop-up blocker may complain) If you need to validate the markup of a page that’s not public (e.g. on localhost), you can now use this bookmarklet to auto-submit the current page source to the validator (instead of viewing source, copying, opening the [...]

18 Aug 2011

NetBeans Love & Hate

For those cases where you have to work on remote code, NetBeans‘ remote project functionality seems to put it ahead of other PHP IDEs. It pulls down a tree of files and uploads files that you save. Having a local copy allows it to offer its full code comprehension, auto-complete, and great rename refactoring for “remote” [...]

18 Jul 2011

Helping Netbeans/PhpStorm with Autocomplete/Code-hinting

Where Netbeans can’t guess the type/existence of a local variable, you can tell it in a multiline comment: /* @var $varName TypeName */ After this comment (and as long as TypeName is defined in your project/project’s include path), when you start to type $varName, Netbeans will offer to autocomplete it, and will offer TypeName method/property suggestions. [...]

17 Jul 2011

A Case Against Google+

Google+ will fit some people really well, and is certainly bringing some fresh ideas to the table to keep Facebook on its toes. That said, here’s why I kinda hope it doesn’t take off, and why I’m seriously considering leaving the party early. There were compelling reasons to abandon Friendster and MySpace at their peaks; [...]

3 Jul 2011

Firefox 5 Shibboleth Issues

If you manage a Shibboleth SP and have been receiving complaints from Firefox 5 users, you may be running into an issue due to FF5′s more compliant caching of Location headers in 302 redirects. While this is a step in the right direction for front-end performance, even tiny HTTP handling changes can affect existing sites.

21 Jun 2011

Bookmarklet: Horizontally invert HTML5 videos

My demands for “reverse” glasses have gone unserved, but I made a bookmarklet that provides the same effect: “flopping” a video horizontally. Install the SwitchStance bookmarklet, for which you’ll need a modern browser that supports CSS transforms on video elements. Opt-in to YouTube’s HTML5 trial Load up any video without ads (here’s one of Matt [...]

18 Jun 2011

So, back in 2003 I got this letter.

With no name on the return address. Check it out: It gets better: Page 1 | Page 2

29 Apr 2011

ReCaptcha Broken? Here’s the fix

Sometime recently ReCaptcha decommissioned its old API hosts: api*.recaptcha.net. The new API locations are at “http(s)://www.google.com/recaptcha/api”. If you rely on Zend_Service_ReCaptcha (or its form element), you’ll need to change some constants in Zend/Service/ReCaptcha.php:

22 Apr 2011

Xdebug 2.1.1 for XAMPP OSX 1.7.3

xdebug-211-xampp-osx.tgz contains a freshly compiled xdebug 2.1.1 module for XAMPP OSX, using this tutorial as a guide. The archive contains step-by-step install instructions w/ bash commands. Happy debugging with fewer bugs.

22 Apr 2011

Bash: Resolve symlinks in your working directory

Say you have created a symlink from your home dir to another location: $ ln -s /Applications/XAMPP/xamppfiles/htdocs ~/htdocs Now you can easily change to the XAMPP htdocs: cd ~/htdocs and then get back home: cd .. But how do you get to xamppfiles? Update: Thanks to sapphirepaw, the solution is simple: cd -P htdocs/.. or [...]

17 Apr 2011

How to Modify a 3rd-party Chrome Extension

I wanted to add a little feature to the Delicious Chrome extension, but couldn’t find any reference to how to edit/clone a 3rd-party extension. It turns out—at least for making minor mods—it works how you’d think: Change some extension files. Restart Chrome. Caveat: Undoubtedly an update of the extension would wipe out these changes, and following [...]

16 Apr 2011

Shibalike: a PHP emulation of a Shibboleth environment

Update 2011-06-23: All the essential components of Shibalike are complete and the project is hosted on Github. This is currently blueprint-ware, but I’m excited about it. A co-worker and I have laid out a design for a flexible system that can emulate a working Apache/PHP Shibboleth stack, without requiring any outside resources (e.g. an IdP, [...]

13 Apr 2011

Where the murder of a thousand children is a sign of success

Only in the drug war. “It may seem contradictory, but the unfortunate level of violence is a sign of success in the fight against drugs,” — DEA head Michele Leonhart From 2009: “There will be more violence, more blood, and, yes, things will get worse before they get better. That’s the nature of the battle,” — U.S. [...]

12 Apr 2011

EA Skate started as a text game

EA’s Scott Blackwood talks about prototyping the flick-it controls for EA skate. But we really liked it on paper. We worked with our lead programmer at the time, and really, in about two or three days, he built a prototype, and it was great. We actually were up and playing the game — no rendering, [...]