You are currently browsing the archives for the Programming category.
5. July 2008 by Ben.
From Douglas Crockford’s JavaScript class:
When the compiler sees an error, it attempts to replace a nearby linefeed with a semicolon and try again.
This should alarm you.
Posted in Links, Programming | No Comments »
22. June 2008 by Ben.
I maintain an application whose data gets updated once a year from a FileMaker Pro file that’s edited throughout the year on local computers. This admittedly makes very little sense, but it is nonetheless so.
Every year the import process produces new and unexpected strangeness. This year, attempting to open the file produces this error:
Microsoft Office is not able to run FileMaker Pro at this time. Verify that FileMaker Pro has been installed correctly on this machine.
First of all, FileMaker Pro is correctly installed, as evidenced by the fact that I used it last year successfully. Moreover, though, why exactly is it necessary for Microsoft Office to run the application for me? Is Microsoft Office running my other applications, like an elevator attendant who adopts the laborious task of pressing buttons for passengers? If so, could Microsoft Office kindly let my other applications run themselves?
Posted in Programming | No Comments »
20. June 2008 by Ben.
Found in the previous version of an application I recently replaced:
if ($print_year > 2005) {$print_year–;}
I can’t get out of my head the scene in State and Main where Joseph Turner White (Philip Seymour Hoffman) is studying a banner in the school gymnasium reading “Waterford Huskies, Division Champions 1971 1972 1973 1974 1976 1977.” He asks, “What happened in 1975?”
Posted in Programming | No Comments »
4. June 2008 by Ben.
In ~/.emacs
(setq make-backup-files nil)
(setq backup-inhibited t)
At the prompt:
[bobbojones@desktop html]$ ls -l contact-public.html*
-rw-rw-rw- 1 5 bjones 1432 Jun 4 09:05 contact-public.html
-rw-rw-rw- 1 5 bjones 1432 May 6 13:46 contact-public.html.~1.1.1.1.~
That’s right, emacs is making backup files despite me explicitly asking it not to. What really bothers me, though, is that it’s only doing it for files that were checked out of CVS. They’re in CVS! The sole purpose of CVS is to make sure I can get copies of the old files if I need to!
What possible purpose can emacs have for overriding every known “stop with the smegging backups” directive when in CVS mode? Does it really think it’s being in any way helpful?
Update: The trick is to (setq vc-cvs-stay-local nil)
Posted in Programming | 1 Comment »
28. April 2008 by Ben.
[bobbojones@test parking] > select count(1) from mbta_passes; +----------+ | count(1) | +----------+ | 179399 | +----------+ 1 row in set (27.65 sec)
That’s just not cool. It took 27.65 seconds to count the number of rows? Using a small subset of test data? On a test server that nobody else was using at the time of that query? That is just not cool.
Posted in Programming | 3 Comments »
20. March 2008 by Ben.
“There was an error verifying your session. Please make sure you have enabled the cookies!”
Somehow the combination of the definite article, the exclamation point, and the fact that I’m pretty tired right now have made that a very funny error message.
Posted in Programming | 1 Comment »
18. March 2008 by Ben.
It’s fixed! It’s fixed! Thank God almighty, it’s fixed at last!
Sorry, I may have gotten carried away there. Leopard’s Spaces (about which you’ve heard me gripe ad nauseam) is finally fixed in 10.5.2 after changing a setting in a .plist file. This is done by:
defaults write com.apple.Dock workspaces-auto-swoosh -bool NO
killall Dock
My world is complete. I can now upgrade to Leopard. I’m the only Mac-user one in my office who hasn’t already.
Thanks to Lifehacker, Secrets (a new application to tweak many settings in Leopard), and ultimately Mac OS X Hints.
Posted in Programming | No Comments »
10. March 2008 by Ben.
I’ve just installed Windows ME on a computer.
I feel like I need to take a shower. And then destroy the hard drive.
Posted in Programming | No Comments »
6. March 2008 by Ben.
[bobbojones@horcrux lib]$ edit
emacs: `getcwd' failed: Permission denied
Posted in Programming | No Comments »
27. February 2008 by Ben.
[bobbojones@PRODUCTION calendar] > select * from nodes limit 1;
+----+-----------+-----------------------------+
| id | name | description |
+----+-----------+-----------------------------+
| 35 | Snausages | Usually served in a blanket |
+----+-----------+-----------------------------+
1 row in set (0.00 sec)
I’m not sure I want to know.
Posted in Programming, Quips | 1 Comment »