Jay McGavren's Journal

How a Head First author spends his days off

View on GitHub
2008-10-07

Arrrggghhh… I want an Android phone, or an iPod with Wi-Fi, or something where I can rate songs while I drive and then sync ratings at home. Jotting myself is definitely not the most efficient way…

Reminder, rate Brent Dennen Desert Sunrise at five stars. Reminder Ritz. I am in wine(?) sunset seems forgotten. I have five stars Reminder. Ray(?), Iron and wine each coming night at Tarsars(?). Computer reminder, rate tab pure essence this feeling at Five Stars. Computer reminder. Rate(?) Kuresons(?) standing in your shadow at fire(?) for surs(?). Reminder, Ray(?) Pereason(?) is walking data(?) five(?) size(?). Reminder, rate Ray Hare coming again at four starts. Reminder research the [broken audio], computer reminder rate the blues tones, the fountain head at five stars. Computer reminder. Re-quantic(?) lighter than the sky at four stars. Computer reminder, rate quantic sweet calling at 4 thirds. Grand(?) ____ nine(?) lazy nine grazing maze at four stars(?). [unclear speech, please listen] Computer reminder, rate(?) 9(?) laser(?) 9(?) coarser(?) at 4(?) size(?).

Read more...
2008-10-06

In praise of dogfooding...

Historically, languages designed for other people to use have been bad: Cobol, PL/I, Pascal, Ada, C++. The good languages have been those that were designed for their own creators: C, Perl, Smalltalk, Lisp.

–Paul Graham

Read more...
2008-09-30

$ fortune ruby

More often than I’d like, I have to open the Pickaxe to look up a core class or module that I can’t quite remember the methods on. I wanted to put some reminders in a place I could review them daily, yet was unobtrusive.

Enter the Phosphor screensaver for X-Windows; it scrolls text from a file or command by the screen. I pulled the classes and modules I wanted from the “ri” utility, made them into a “fortune cookie file” (run “man fortune” for details on fortune), and then piped fortune’s output through the screensaver.

I’ve attached the files I made. Unzip and drop them in /usr/share/games/fortune (or wherever fortune cookie files go on your system) and you’ll be able to type “fortune ruby” at a command prompt. Only core classes are included, but I’ll make a separate one for Rails on request. You can set up Phosphor (or other text-display screensavers like StarWars) from the xscreensaver control panel.

RubyFortuneCookies

Edit: On systems using gnome-screensaver, save this in your screensaver config folder, probably as /usr/share/applications/screensavers/xscreensaver-phosphor-ruby.desktop:

[Desktop Entry]
Encoding=UTF-8
Name=Phosphor - Ruby ri
Comment=(Shortened in 2021 so Google doesn't kill my page rank)
TryExec=phosphor
Exec=phosphor -root -scale 2 -ticks 5 -program 'fortune ruby'
StartupNotify=false
Type=Application
Categories=GNOME;Screensaver;

…then select “Phosphor - Ruby ri” in your Screensaver Preferences. This should also scale back the text so you can see the whole ri screen.

Read more...
2008-09-30

$ fortune eric-raymond

Here’s a separate file with rules of the “Unix philosophy”, extracted from The Art of Unix Programming by Eric S. Raymond. You can randomly select between these and the Ruby class descriptions with:

$ fortune eric-raymond ruby

EricRaymondFortune

Read more...
2008-09-29

$ itunes –find “Prefuse 73 Preparations” –print-info “%t - %n - %r stars”

1 - From the East (intro) - 0 stars
2 - Beaten Thursdays - 4 stars
3 - Aborted Hugs - 3 stars
4 - Class of 73 Bells (feat. School of Seven Bells) - 3 stars
5 - Girlfriend Boyfriend - 4 stars
6 - Smoking Red (feat. John Stanier) - 3 stars
7 - Prog Version Slowly Crushed - 4 stars
8 - Noreaster Cheer - 4 stars
9 - Let It Ring - 4 stars
10 - 17 Seconds Interlude (feat. Tobias Lilja) - 0 stars
11 - I Knew You Were Gonna Go - 4 stars
12 - Pomade Suite Version One - 4 stars
13 - Spaced + Dissonant - 5 stars
14 - Preparation (outro version) - 3 stars

Sigh… Only one 5-star (at least, based on my initial listen)… Lot better than Security Screenings, though.

Read more...
2008-09-26

Picasa Web Albums facial recognition - edge cases...

Finally! Picasa Web Albums rolled out its facial recognition feature. No equivalent for the desktop Picasa (yet), sadly.

It’s fast, and accurate. Some interesting bits:

-Most of the time, it has no trouble distinguishing between my pre-beard and post-beard face. -It thinks my wife and my-wife-with-sunglasses are two separate people. -It thinks my-wife-with-sunglasses and my-son-with-sunglasses are the same person. :) -Pictures of a rapidly-growing kid (age 3-5) seem to make it uncertain, though its “most likely” match is usually correct. -Based on only one picture of my brother at age 26, it just picked out a picture of him at age 11! (It wasn’t certain, but he was the most-likely match.) -A fake sneer or frown tripped it up (though again, the most-likely match was correct). -A subject losing (or gaining) a considerable amount of weight makes it uncertain. -The lighting on a face has to be REALLY poor to trip it up. -Most-likely match was right even on a face that was ~20% blocked. -Good guess on a face viewed through smoke (from a yellow smoke bomb). -Two different women with similar makeup, facial expression and pose were sorted next to each other. (And the second was mis-identified as the first, probably because she usually wears glasses and wasn’t in this shot.) -The best guess is usually of the same sex, but when it’s tripped up, members of the opposite sex may outrank the actual subject for second- and third-best guesses. -Subjects of the same (or similar) ethnicity tend to get grouped together. -Sticking your tongue out is a good way to trip it up. -Odd angles (like up from the floor) confuse it (badly). Profile-views aren’t as bad, though. -(Obviously) cartoon faces occasionally find their way into the list. -A short-lived goatee only throws it off once; after that the best guess is correct for further goatee pictures. -Bangs partially covering the eyes throw it off.

I know some of these are “duh” items, but this has just made me appreciate what a hard problem facial recognition is. Especially in the area of photos, where you’re dealing with changes in age, weight, hair, expression, poor lighting, sensor noise, and a host of other problems.

Now, how can I sort the photos back on my hard drive, since Google and I have done all this work?

Read more...
2008-09-26

Aquarium development with Alice...

Learned about Alice last night; it’s Carnegie-Mellon’s 3D cousin to MIT’s Scratch development environment. Alice is aimed at older students, and a bit more flexible.

I showed off the built-in library of objects to Diana, and the moment she saw the ocean-themed section, to my surprise, she all but elbowed me away from the keyboard. (She’s not a developer, but she is a fish nut.) Thirty minutes later, and with only occasional guidance from me, she had a school of fish robotically spinning, rolling, and moving about an ocean floor.

Drag-and-drop is definitely a good way for novices to get started programming. It’s all too easy for a beginner to give up when all they get is a blank screen due to a well-hidden typo. Mistake-resistant constructs you can scramble around and get instant feedback on keep a student moving forward.

Read more...
2008-09-26

Android 1.0 API impressions...

What they’re describing here might be applicable not just to mobile apps, but maybe applications in general. Could this become the basis of an OS for a set-top box, game console, or desktop?

An Activity is a unit of action a user can initiate. Though an Activity can be used as an application, it isn’t the same concept; an Activity could be accessed from the menu of another Activity, for example.

The lifecycle of an activity is:

onCreate()
onRestart()
Called here after an application is stopped, not during its initial startup.
onStart()
Activity is becoming visible to user.
onResume()
Activity can interact with user.
onPause()
System is about to switch to another activity.
onStop()
Activity is no longer visible to user. May be followed by onRestart() or onDestroy().
onDestroy()
During this method, if isFinishing() returns true, user requested finish. Otherwise, system did.

This model is cool because it requires that an app be ready to save its state for later reloading at any time. An app that follows this setup properly will be ready for the user to switch activities, to reflect changes to the global config, or for the phone’s battery to run low.

Notifications: I’m imagining this to be like Growl or Enso notifications. Hope I’m right, but I haven’t read far enough to know yet.

Background processes!!! The inability of third-party apps to do this is my number one complaint about the iPhone. I want a daemon that can initiate different processes when I walk into work, home, or school, and I think it simply isn’t possible on iPhone.

Read more...
2008-09-24

Facebook is asking me, on behalf of Diana:

Do you think undefined undefined?

…Sometimes, yes.

Read more...
2008-09-22

Think our world is all SOA and web-service-enabled?

Think again. I just got an e-mail from a major travel industry vendor (one you’ve probably heard of), detailing changes to the procedure for manually downloading and unzipping the monthly data file they send us. This is the third vendor in the past year to pull something like this. (Actually the biggest one can’t seem to send us the same format month to month.)

“The future is already here - it is just unevenly distributed.” –William Gibson

Read more...
Copyright © Jay McGavren.