Jay McGavren's Journal

How a Head First author spends his days off

View on GitHub
2007-06-22

The MOO mini-cards came last night; they’re gorgeous. They were no effort at all to create, too. Kinda made me forget that I was dropping $20 plus $5 shipping on something I have no practical way to display or carry in my wallet. They don’t make frames for something that’s half the size of a business card.

They’ll probably wind up sitting in their box on the end-table, waiting for guests to flip through them and take one. They point to mcgavren.com on the back, so once I actually have a page up there, they’ll be able to see all the rest of our photos.

.

Read more...
2007-06-20

Extract local variable...

Eclipse just saved me a couple hours’ work… Thanks to a series of admittedly bad decisions, I had a unit test chock full of call chains like this:

assertEquals("West", hc.getAreaInfo().getAttractions().getAttraction().get(3).getRefPoints().getRefPoint().get(0).getDirection());
assertEquals("Name", hc.getAreaInfo().getAttractions().getAttraction().get(3).getRefPoints().getRefPoint().get(0).getName());
assertEquals("20",   hc.getAreaInfo().getAttractions().getAttraction().get(3).getRefPoints().getRefPoint().get(0).getTransportations().getTransportation().get(0).getTransportationCode());
//...etc

….too embarrassing to let a colleague see. So I was resigned to spending a very boring midday importing the appropriate classes and assigning those values to local variables, when it occurred to me to check Eclipse’s Refactor menu…

And there I found “Extract local variable”. What a godsend. All I had to do was highlight the section of the call chain I wanted, and it (intelligently) chose a variable name, replaced all occurrences with the variable, and even imported the classes I needed. In just a few minutes the above code and everything like it was changed to this:

com.mycompany.ota.generated.AreaInfoType.Attractions.Attraction attraction = hc.getAreaInfo().getAttractions().getAttraction().get(3);
RefPoint refPoint = attraction.getRefPoints().getRefPoint().get(0);
assertEquals("West", refPoint.getDirection());
assertEquals("Name", refPoint.getName());
assertEquals("20",   refPoint.getTransportations().getTransportation().get(0).getTransportationCode());
//...etc

Java is a very bad language, and Eclipse is what was created to cope with it. Fortunately, its creators exhibit boundless ingenuity.

Read more...
2007-06-20

Awwwww...

Lenny: When I’m grown up, I’m gonna work where you work. Me: You mean you want to work for my company? Lenny: No, I’m gonna work where you work. Me: Oh, you want to work together with me? Lenny: Yeah. Me: You want me to teach you how to do my job? Lenny: Sure.

Well, come to think of it, I was only a year older than he is when I wrote my first simple program. I need to get his PC running, and test out one of those new languages targeted at kids for him. (Oh, yeah, and teach him how to write, though he’s making rapid progress in that area already.)

.

Read more...
2007-06-20

This is my first (and probably last, cause I hate soft keyboards) post from my newly-working DS browser. Yay!

All my Reader feeds are in my bookmarks (public HTML, DS Opera doesn’t like the AJAX), which is all I need from it for now.

Read more...
2007-06-19

I’m flailing. I have a change where I’d have to write twice as much unit test code as actual code, so I skipped the unit test, and now I’m flailing: ordering my son’s birthday cake, catching up on my RSS feeds, posting to my journal, anything but actually writing the code. It’s like taking twice as long to cross a bridge because there’s no handrail.

Lesson: always write the unit test first, even if it’s ugly and inefficient. You’ll save yourself time later. .

Read more...
2007-06-19

Damn, Parallels is only $80. Being able to switch live between OSX, Windows and Linux would solve a lot of problems for me. (Of course, it might also create new ones; I’m already stretched pretty thin maintaining my work, desktop and laptop configs.)

Was waiting for WWDC to see if they announced Mac mini upgrades. Instead they announced Time Machine, which looks like the backup/versioning solution I’ve really been waiting for. (Subversion works, but it ain’t transparent.) .

Read more...
2007-06-18

Our last calendar update made it such that reminders are off by default. I turned mine on, but when someone else schedules the meeting I can be pretty much assured it’s off. No reminder means I won’t be at the meeting, which means embarassment in front of my boss. Not acceptable.

Fortunately, Ruby’s OLE bindings made a workaround easy. I pass the output of this script to my “alert” program and set the whole thing up as a scheduled task. If there are future meetings with no reminder, I’ll have a warning sitting on my desktop as soon as I log in.

Read more...
2007-06-13

Purty colors...

TrailsView I was having problems over the weekend with my more-modular GTK view, but I got things figured out. A little more tweaking got me color and even trail widths.

Now all that remains is movement logic, which doesn’t even need to be part of the main libraries. (API users will pass control Procs in when they create their game objects.)

Read more...
2007-06-13

Another blog-by-email attempt...

I really want this blog-by-mail feature working, but multiple others have the same problem and it still hasn’t been address. So I’m implementing the suggestion here:http://wordpress.org/support/topic/83483….And hopefully this post will have a body.Edit: Yay, it works!  (Except for that annoying period at the end.  I’ll have to look for a real fix.)

Read more...
2007-06-11

My Last.fm history, visualized...

Generated via pcmadman’s script.

nephariuz.png

Read more...
Copyright © Jay McGavren.