Archive for the ‘Development’ Category

Why is MySQL so slow?

Tuesday, March 16th, 2010

Ever try truncating large datasets on a Windows development box? Ugh.

This kind of explains where MySQL is stuck:

mysql> show processlist

Kind of.

Getting Flymake to work with Emacs nXhtml

Saturday, March 13th, 2010

If you develop in PHP on Emacs, then you’ve probably got a hook setup to run flymake-mode on PHP files. And if so, then you’ve also probably noticed that this doesn’t work with nXhtml, which will often return an error like “mumamo can’t find the file” (or some such), causing flymake-mode to disable itself.

The culprit is likely to be a bind like this:

(add-hook 'php-mode-hook (lambda () (flymake-mode t)))

which says, “turn on flymake-mode when php-mode is started”. (Sacha Chua has a post that recommends using this from couple of years back.) The problem, as far as I can tell, is that nXhtml tries to process the fleetingly available _flymake file rather than the original PHP script whenever it toggles into php-mode.

A better hook to use is the find-file-hook, like this:

(add-hook 'find-file-hook 'flymake-mode)

With this, Flymake will properly validate PHP chunks in nXhtml mode, as well as any other files that Flymake is smart enough to process.

Testing Regular Expressions in Emacs

Monday, October 19th, 2009

How had I missed RE-Builder all these years? I used to use Expresso for help with regex’s, but it’s so much easier to do the munging in Emacs.

Try M-x re-builder for what ails ya.

iPhone-Simulator Cropper

Saturday, July 25th, 2009

If you’re doing a lot of iPhone work then Oliver Fürniß’s Simulator Cropper can be a major time-saver.

But not as much of a time-saver as completely ignoring Apple’s style guidelines.  Which is always so tempting.

Abstract Classes versus Interfaces

Thursday, July 16th, 2009

These are two things I think about every once-in-awhile. Usually late at night. While drinking. Heavily.

Also I think about them while writing code. And typically, when I have to make a decision between one or the other, I choose the wrong one. Probably because I’ve never deeply thought about them in an IS-A versus CAN-DO relationship as outlined here.  Which, despite the broken English, is the best overview I’ve ever read on the difference between the two.

Kanji Fuda

Friday, June 26th, 2009

Well, what was supposed to be a quick weekend project back in March is finally on it’s way to the iPhone App Store; and for the second time no less.

“Kanji Fuda” is a simple Japanese kanji learning game reminiscent of ComCul’s excellent Kanji for Fun. Between work and baby management, I’ve been cobbling it together in fits and starts over the last couple of months. Even have the fancy shmancy website that seems to be prerequisite for releasing any kind of mobile app.

Now that the basic version is done and “released” — assuming that I am able to get it by the App Store gate keepers — I’m working on an advanced version specifically to help study for the year-end Japanese Language Proficiency Test (JLPT). I’ve always wanted to go after Level One, but given how little I actually use my Japanese these days, it’s going to be a stretch… hence Kanji Fuda.

Where did my older “Active SDK” settings go??

Wednesday, May 20th, 2009

Apparently Apple really really wants us to be building for only OS3. Xcode in the iPhone 3.0 beta 5 SDK goes to the trouble of actually hiding older Active SDK settings as soon as you do a build for 3.0.

To get the older settings back, hold down the Option key while choosing Project -> Set Active SDK. The original list magically reappears.

__MyCompanyName__

Wednesday, May 20th, 2009

How to change it: Xcode and MyCompanyName

It’s the little things, you know?

Shoe In

Monday, December 15th, 2008

Why don’t we all go down to Washington D.C. and throw our shoes at the White House?

curly throws a shoe at bush Shoe In

Shoes or, creme pies.

Best quote from the Huffington Post comment board:

“Did you see how well he dodged those shoes?? Decades of dodging responsibility sure paid off!”

Indeed.

SVN File Status Flags

Friday, December 12th, 2008

More SVN stuff I can never completely remember.  As seen from running svn update, svn switch, or svn merge. “G” always throws me.

U filename = item (U)pdated to repository version
G filename = item’s local changes mer(G)ed with repository
C filename = item’s local changes (C)onflicted with repository
D filename = item (D)eleted from working copy
A filename = item (A)dded to working copy

Also note that “S” seems to mean that something has gone horribly wrong with a switch and that the operation was not completed. Hopefully you’ll never see this.