An Idea to Change Driving Habits (or “Hardware we will never see”)
I had an idea. Some cars come with a feature that allows the user to see the current MPG (or KPL if you’re across the pond). I think this hardware should be enhanced, so that when you put gas in your tank, you also put let the car know how much you just paid per gallon (or Liter). Rather than showing you how many miles you get per gallon, it would show you how much money per mile your current driving habits are costing you.
I bet people wouldn’t slam the gas pedal down when the light turns green if they had something telling them that it was costing them $2.00/mile to drive like that.
Contents May Settle During Shipping (or “Why Apple Updates are Different Sizes on Different Computers”)
Updating a MacBook and a Mac Mini to 10.5.3. One is downloading over 400MB, the other is about 198MB. So I was obviously wondering why the difference. Apple has an article about it. Apparently the smaller one is just a patch, the larger is the full thing. What’s curious is that the MacBook has next to nothing on it, and the Mac Mini is loaded with stuff. Seems to me that the Mini should have downloaded the large one, not the path, and the MacBook should have downloaded the patch. So there you have it.
Hebrew in PHP (or “Unexpected What?”)
One of the guys here just got an interesting PHP error:
Parse error: syntax error, unexpected ‘)’, expecting T_PAAMAYIM_NEKUDOTAYIM in C:\wamp\index.php on line 201
Apparently it’s hebrew for “double colon”.
You learn something new every day.
Proximity (or “So Close, But So Far Away”)
I recently had a problem with my Mac. A sector on the hard drive went bad, and killed one of the files for Salling Clicker. It’s a great program that allows you to run scripts when you go away from your computer and return, using bluetooth to determine if you’re in rance of your computer. It also allows you to control applications on your computer via your mobile phone. Quite a cool app, but the only part I used was the proximity part.
So after reinstalling OSX (which seemed to be my only recourse to get the abd sector problem resolved), I decided to look and see if there is something like Salling Clicker that only does the proximity part (which is all that I used). I found the aptly named Proximity and it perfectly fits the bill.
Unfortunately the Proximity website doesn’t have any applescripts for you to use, so I had to write my own, and I thought I’d write them down here for you lovely readers to use. I found some part of these at the Technocrat blog.
In Range Script:
-- iTunes
--
tell application "iTunes"
play
end tell
-- Adium
--
tell application "Adium"
go available with message ""
end tell
-- Sync the phone (if not synced in the last 60 minutes)
--
tell application "iSync"
if last sync is less than ((current date) - 3600) then synchronize
end if
end tell
tell application "System Events" to set visible of process "iSync" to false
Out of Range Script:
-- iTunes
--tell application “iTunes”
if player state is playing then
pause
end if
end tell– Adium
–
tell application “Adium”
go away with message “I’m not near my computer”
end tell
Firefox 3 Smart Bookmarks (or “Find Your Place”)
Firefox 3 includes an interesting concept called places. The idea is that all history and bookmarks are stored in a SQLite database, and the browser exposes an API to interact with the data. You’ll see it in action in the “Smart Bookmarks” button in the Bookmarks Toolbar — these are dynamic queries against the database to find places you have visited the most, visited recently, etc.
I became interested in this because I started to write an extension for Firefox 2 to display all of the websites I work on that are in development — the overhead was far too much for the return, so I stopped working on it.
Luckily, with Firefox 3, the places infrastructure allows me to do this very easily. For instance this bookmark will list out all of the items in your history, sorted recently visited first, that contain the text ’staging’. Quite handy.
I’m sure there is a better way to do this. I tried the uri parameter, but it kept crashing Firefox. In any case, it’s a nice addition, and another testament to SQLite’s applicability to many areas of web and application development.
