March 22, 2013

What is the difference utf8_unicode_ci and utf8_general_ci?

From the MySQL manual: For any Unicode character set, operations performed using the xxx_general_ci collation are faster than those for the xxx_unicode_ci collation. For example, comparisons for the utf8_general_ci collation are faster, but slightly less correct, than comparisons for utf8_unicode_ci. They have a amusing “examples of the effect of collation” set on “sorting German umlauts,” [...]

March 3, 2013

Canon + iOS tethering solutions

There’s magic that happens inside the camera. Yes, magic. Most cameras expose the controls to that magic via some knobs and buttons and a small LCD screen. The knobs and other physical controls we like, but the screen pales in comparison to those on our iPhones. And that’s the thing, the hundreds of apps on [...]

February 15, 2013

Testing apply_filters() times

Testing how long it takes to assign a variable versus assigning through WordPress’ apply_filters(). Filters are core to WordPress, but I haven’t yet looked at the total number of apply_filters() calls used throughout the code. The answer to this question is that calling a non-existing filter before assignment is about 21 times more costly than [...]

February 10, 2013

Clarity from a distance

ISS001-E-5508

The sky looks big from earth, but it’s rather different the other way around. I’m not saying it’s not quite an experience, but inspecting the metadata on this photo of New York and surroundings taken on Christmas day, 2000, during the first International Space Station mission surprised me. To wit: it’s only a 180mm lens. [...]

February 7, 2013

3rd party JS libraries cause downtime

Facebook Connect went down hard tonight. HuffPo reports that their site was redirecting to a Facebook error page, even when people weren’t attempting to log in. Yep. Busted third-party JavaScript brings portions of the Internet to its knees: huffingtonpost.com/2013/02/07/fac… — Kent Brewster (@kentbrew) February 8, 2013 It makes me more comfortable with our decision to strip [...]

February 2, 2013

Camera frustrations and other first world problems

Camera frustrations and other first world problems

I’m not a camera pro. I have some photos on Flickr, but it’s just for fun, so I don’t really need a new camera. But I do want one. Thing is, there a lot of cameras out there, but none of them has the Goldilocks factor. None has the right mix of features, size, and [...]

January 31, 2013

Testing file include times for a file that may or may not exist

Question: Should you check for a file before attempting to include it, or just suppress errors? Calling file_exists requires stating it twice if the file does exist, so that could take longer. Answer: the file_exists pattern is more than five times faster than the @include pattern for a file that doesn’t exist, and not substantially [...]

January 20, 2013

An American iPhone in Europe

By way of update on my earlier post after researching options for AT&T iPhone users in Europe (with an unlocked phone), I ended up not bothering with local SIM cards in either The Netherlands or France. A savvy user should be able to find a local pay as you go SIM plan that’s less expensive [...]

January 19, 2013

SVN or git?

@film_firl poked @WordPressVIP to ask @wordpressvip @mjangda @viper007bond MOOOOVE TO GIT!!! she half-kids. No really, please? — Christina Warren (@film_girl) January 18, 2013 @nacin piled on with @viper007bond @film_girl @mjangda VIP aside, it’s fairly crazy that WordPress.com hasn’t migrated. SVN != tenable dev environment. — Andrew Nacin (@nacin) January 18, 2013 @Viper007Bond tried to defend the team, and [...]

December 17, 2012

Where did all the votes go?

What happens to voting data after the election is over? What happens to all those certified results by polling place? How is it that there’s so much coverage leading up to and on the night of the election, but this guy seems to be one of the few sources of historical voting data? Amusingly, I [...]

December 13, 2012

On wp_enqueue_scripts and admin_enqueue_scripts

On wp_enqueue_scripts and admin_enqueue_scripts

An argument has erupted over the WordPress actions wp_enqueue_scripts and admin_enqueue_scripts vs. init. One of the points was about specificity, and how wp_enqueue_scripts and admin_enqueue_scripts can reduce ambiguity. I didn’t realize I had strong opinions on it until the issue was pressed, but it turns out I think wp_enqueue_scripts and admin_enqueue_scripts are unnecessary and unfortunate additions [...]

December 4, 2012

@Adam: I’d seen `git log –find-copies` and its friends, but my frustration is that I have to know to look for copies to find them, whereas the svn approach made that history very obvious. @Casey: the issue is that I want to split one file that’s grown too large into two and preserve the history in both. In short, I want to be able to do the equivalent of `svn log filename` that will tell me the full history of the file, including the file it was copied from and its history too.

featured comment
November 23, 2012

Confirming that object references in arrays are preserved while cloning the arrays

A short test to confirm references are preserved in cloned arrays. The result is: Now let’s mess with one piece of that to check if the object was passed by reference or got cloned: Confirmed, the object is passed by reference, even though the array that contained it was cloned:

November 21, 2012

Ignoring noise in svn diffs

svn diff -x “-bw –ignore-eol-style” is your friend when somebody decides to change the end of line style and strip all trailing whitespace from the files in your repo.

November 21, 2012

Is Perl the best solution to write code that needs setuid?

A bunch of searching the web for things related to setuid and shell scripts lead me to this answer in Stack Exchange: Perl explicitly supports setuid scripts in a secure way.

November 18, 2012

There’s no ‘git cp filename’?

Does git really not have a way to copy files with history?