Posts from: 2012

31 Dec 2012

Sparks “Sherlock Holmes”

The jam.

[...read the post]
30 Dec 2012

Cannabis criminalization helps law enforcement (perform unconstitutional searches)

Opponents of cannabis decriminalization often state we should keep it criminalized in order to help law enforcement catch bad guys, and indeed it serves as an important tool for justifying searches on individuals and premises. After all, these searches may turn up more harmful criminal activities or individuals with warrants. LEO’s will often admit that in

[...read the post]
4 Dec 2012

Designing a Highly Reusable HTML Component

The UF College of Education uses a header/footer template designed to be applied to any page, and we use this across several applications such as WordPress, Moodle, Elgg, and Drupal. Changes can be propagated quickly to all sites, and adding the template to new PHP apps is trivial. If you need to create an HTML component that can be

[...read the post]
20 Sep 2012

Wedding Mixes: Moose

Moose “This River Never Will Run Dry” [marry in the morning mix] In this mix: More balanced volume across the song (you can hear the intro without having to turn it down several times later). This is a simple volume envelope, so it didn’t squash the dynamics any more that they were already. Shortened outro

[...read the post]
27 Aug 2012

Decouple User and App State From the Session

When building software components, you want them to be usable in any situation, and especially inside other web apps. The user of your component should be able to inject the user ID and other app state without side effects, and similarly be able to pull that state out after use. That’s why, beyond all the standard

[...read the post]
25 Aug 2012

Elgg Plugin Tip: Make Your Display Queries Extensible With Plugin Hooks

If you’re building an Elgg plugin that executes queries to fetch entities/annotations/etc. for display, odds are someone else will one day need to alter your query, e.g. to change the LIMIT or ORDER BY clauses. Depending on where your query occurs, he/she may have to override a view, replace an action, replace a whole page

[...read the post]
17 Aug 2012

My Moodle Page, Now With 99.6% Fewer Queries

My work recently upgraded from Moodle 1.9 to 2.3, and some users were experiencing slow page loads while the site was zippy for others. Today we discovered that, for some users, the My Moodle dashboard page was requiring several thousands of DB queries. For one user, enrolled in four courses, the page required over 14,000 queries.

[...read the post]
12 Aug 2012

Bad Analogies Lead to Bad Policies

I was forwarded an e-mail that made a terrible analogy (my emphasis): Here’s another way to look at the Debt Ceiling: … You come home from work and find …  your home has sewage all the way up to your ceilings. Sewage would make a home immediately uninhabitable and actively damage the value of the

[...read the post]
23 Jul 2012

In Support of Bloated, Heavyweight IDEs

I’ve done plenty of programming in bare-bones text editors of all kinds over the years. Free/open editors were once pretty bad and a lot of capable commercial ones have been expensive. Today it’s still handy to pop a change into Github’s web editor or nano. Frankly, though, I’m unconvinced by arguments suggesting I use text editors

[...read the post]
25 Jun 2012

Dennis Busenitz: Clearly a Machine

[...read the post]
21 Apr 2012

For the 4-20 folks

Another year it still deserves saying… It’s long been clear the risks and harms of cannabis use are mild, and with that knowledge it should sicken us that people are regularly pulled into our criminal justice system because of cannabis use, sales, production, or political speech (see the example made of Marc Emery). Shame on

[...read the post]
16 Apr 2012

Define namespace constants using expressions

Since const is parsed at compile-time, you can’t use expressions in namespace constants, but you can use define as long as the name argument is the full name from the global scope (run this): namespace Foo\Bar; const CONST1 = 1; define(‘CONST2′, 1 + 1); // global define(__NAMESPACE__ . ‘\\CONST3′, 1 + 1 + 1); //

[...read the post]
15 Apr 2012

PHP RFC Preview: Dynamic Callback Expressions

I’m posting this to get some initial feedback on this idea before I officially submit an RFC. Background Even with PHP’s growing object-oriented and functional programming features, the callback remains widely-used and useful. However, forcing authors to create callbacks via strings and arrays presents difficulties: Most IDEs do not recognize callbacks as such, and so

[...read the post]
22 Jan 2012

Convert Google Maps embed HTML to Street View URL

You can use the form below to convert the HTML embed code Google Maps gives you to a usable Street View URL loading… Why do I need this? The new Google Maps layout has a chain-link icon on the left that gives you a URL to what you’re looking at. If you’re in Street View, sometimes

[...read the post]