Stockholm, Sweden
Yesterday, before our concert at Ekebyholmsskolan, we got to tour Stockholm. We arrived there from Finland via a Viking Line ferry named Isabella. Two other chaperones and I spent virtually the entire time touring the older parts of Stockholm, including a number of churches. Of the cities we’ve visited so far on the concert tour, Stockholm is the most beautiful. I really like the architecture. Bicycles get their own lanes. It’s a city that’s very easy to tour on foot. The fact that it’s on the water is also a big plus in my book.
We’re getting on our tour bus in another 15 minutes for the drive to Oslo, Norway.
Scandinavia Tour
I’m writing this from a school dorm at Toivonlinna, a Seventh-day Adventist school in Finland. I’m one of a number of chaperones for a high school choir giving concerts in Scandinavia. We gave a concert at the school this morning (and I really do mean “we”, since the chaperones got drafted to sing also). Our concert yesterday in Turku went well enough that the choir went back up to sing an encore. Iceland was our first stop, and despite its name, it was warmer than Finland is now. Even as I type, it is snowing.
The next stop on our tour is Sweden. We’ll be taking an overnight ferry there from Finland (assuming the weather cooperates) after lunch, a cathedral tour, and some shopping.
A More Perfect Union
Barack Obama spoke at length yesterday on the issue of race in general and his former pastor in particular. If you haven’t already seen and heard the speech, or read the transcript, I encourage you to do so. There is no soundbite that can do justice to the importance and brilliance of his message. If there was ever a politician who could legitimately argue that he’s a uniter and not a divider, it is Barack Obama. I only hope it helps him win in Pennsylvania.
$1.67
That’s how much one (1) euro cost me yesterday when I was converting currency with Chevy Chase Bank for an upcoming trip. You know things are bad when even the branch manager is surprised by the rate of exchange. The exchange rate is probably even worse today. Even if I took out the fees they charged, the exchange rate is probably 20-30 cents worse than it was when I first went to Europe in 2005.
It reminded me of economics classes in business school, and what we learned about what countries do to defend their currency. The Fed is doing the opposite of those things right now, so between that and deficits our government runs, I expect the dollar to be worth less and less in the near term.
The truth about usability
I came across this via Daring Fireball today. There’s a lot more than a grain of truth to what it suggests about how what most user interfaces look like.
Time to buy an iPhone?
I went to the barbershop on Friday. During my haircut, I ask my barber how he likes the iPhone. He doesn’t just like it, he loves it. I got quite a sales pitch from him. Then the guy getting his haircut next to me chimes in. He just got an iPhone as well. He actually said he’d been thinking about getting a laptop, but found the iPhone did what he needed.Of all the iPhone owners I’ve talked to since it came out (friends, fellow conference attendees, even a guy waiting for the bus in Seattle), I have yet to hear any complaints.I haven’t caved in and bought one (yet), for a few reasons:
- I’ve been kind of annoyed with AT&T Wireless lately over dropped calls
- Don’t really like the idea of a $70/month cellphone bill
- I’m kinda waiting for the next version of the iPhone (new hardware anyway)
Refactoring
Last night, I went to a presentation on refactoring by Jonathan Cogley. My notes are below:
refactor - improve the design of existing code incrementally
Code must:
- do the job
- be maintainable/extensible
- communicate its intent
Refactorings
- rename
- extract method
- inline method
- introduce explaining variable
- move method
- inline temp
I found a much better definition for technical debt. It makes a nice argument in favor of refactoring (though not as good as it would be with some way to quantify and measure it).
code smell - indication that something could be wrong with the code
Code Smells
- duplicated code
- long methods
- large classes
- Too many private/protected methods
- Empty catch clause (FxCop flags these by default)
- Too many static methods
- Variables with large scope
- Poorly-named variables
- Comments
- Switch statements
- Unnecessary complexity
When to refactor:
- before a change
- after all current tests are green
reduce scope - bring variable closer to where it’s used
Be sure your unit tests don’t re implement what the tested code is doing.
Eliminate double assignments (a = b = 0) for clarity.
Each method should have only one operation/concept.
If you must use code comments, they should explain the “why”. The code should be clear enough to explain the “what”.
Favor virtual instance methods where possible in your code.
Avoid using the debugger. Write unit tests instead.
Performance improvements tend to make code harder to understand. Don’t use refactoring to address application performance.
Recommended reading:
Wireless Mighty Mouse
I saw one of these as a clearance item at MicroCenter yesterday, so I picked one up to try it out. In the tiny bit of time I’ve used it so far, the only annoyance (and a minor one at that) is turning the mouse on and off. I find it challenging to move the slider on the bottom of the mouse without clicking the mouse body a few times. I like the little trackball on the top for 360 degree scrolling (though I don’t find myself scrolling sideways much with a 24" monitor). I haven’t played with the configuration tool much yet, but it appears to give you a wide variety of ways to customize the mouse’s behavior. We’ll see how the battery life is.
Taxes
For the first time in a number of years, I had a professional do my taxes. I’d been a TurboTax Online user for the past 6 years, but got a referral from a friend and figured I’d try them out. The parking situation wasn’t ideal, and the wait to be seen was long (over 3 hours for me), but the size of the refund I got back made it worthwhile. If you don’t mind a wait (or the fact that they’re cash-only), visit Newby Tax Service at 6315 Windsor Mill Rd, Gwynn Oak, MD 21207.
Rates are $150 for single filers, $300 for businesses. The charge for e-filing is an additional $80.
Null Coalescing Operator
I didn’t know about this C# 2.0 operator (??) until ReSharper suggested it as a replacement for a particular use of arithmetic if (?:) that I’d added to some code recently. I already prefer C# to VB.NET because of its terse syntax and stricter compiler, so this discovery tipped the scales just that much more.
The most recent blog post Google coughed up for this operator is this one, from Aaron Zupancic. Aaron links to another post that demonstrate its use for viewstate.
Fixing Computer Science
I’ve been reading a lot of complaints about the current state of computer science education lately. This post makes a reasonable attempt at summarizing the different ideas around what sort of graduates these programs should produce. I’ve been in industry long enough that my CS program hadn’t switched to using Java as the initial language when I started. I agree with Brian Hurt and Chris Cummer about the value of a computer science degree.
The right courses in a CS degree amount to a toolbox of concepts that you can use to solve whatever real-world problem you’re facing. The most recent example of this happened on the job. We had an issue where some text files being downloaded for storage in a database kept causing failures in a process. Because of how the process was implemented, there was no way to pin the cause of a failure on a particular line of the file. The files in question are regularly more than a gigabyte in size, so manual inspection wasn’t an option. The minimal understanding I have of how compilers work enabled me to direct my staff to build a parser, so we could validate the input file before running the process against it. Without a CS background, it’s highly likely that I don’t come up with a solution at all (or a really bad implementation of a parser).
If I had it to do over again, I would have spent more time in my CS program getting better depth in compilers, operating systems, and other areas.
Computer science isn’t perfect, but it’s relatively young as a field compared to disciplines like law or medicine. There are probably things that should be changed, but I think the fundamentals are good.
TeamCity 3.0
Now there’s a freeware version of it that supports up to 20 users and build configurations. We were looking at setting up CruiseControl.NET again for continuous integration at work, but this will be much easier.
Apple Stuff
iPod nano
The iPod I mentioned yesterday is the 4th (!) one I’ve owned. Each of the previous ones was sold to help fund the upgrade to the next one. I love this one even more than all the previous ones because it handles video. The video is watchable, even at that size. The nano makes great use of the screen when it isn’t playing video too. The earbuds that came with this one are better than the previous ones, but I’m still going to buy a better set.
Thoughts on MacWorld
The most important product announced there isn’t MacBook Air–it’s Time Capsule. I think far more people will find a use for wireless drive backup than they will for a really thin laptop. Because Time Capsule also works as a router and can share a USB device (or devices if you plug in USB hub), you could conceivably share even more hard drive space and a printer to every machine on your wireless network. As far as I can tell, Time Capsule provides more capabilities than Mirra Personal Server (a comparable backup/Internet access product) at a lower price ($300 for the 500GB version) in a much smaller form factor. After a copy of Leopard, I think a Time Capsule will be my next purchase from Apple.
Birthday
I turned 34 today. I suppose I’m officially in my “mid-30s” instead of my early 30s now. Other than that, it doesn’t seem different at all from any of my other post-30 birthdays.
I did pick up a new toy for my birthday–an 8GB iPod nano.
The trouble with using strongly-typed datasets
Apparently, if your database-driven website is under heavy concurrent user load, the Adapter.Fill method in the .NET Framework (called by code generated by the XSD in Visual Studio) begins to fail because it doesn’t close connections properly.
The next time I need a data access layer for anything of substance, strongly-typed datasets are off the list.
Welcome to 2008
If a single word could define my 2007, it would be “travel”. I suspect it’s the biggest reason I enjoyed the year. The places I had the chance to visit include:
- San Jose, CA
- San Francisco, CA
- Portland, OR
- Seattle, WA
- Vancouver, BC (Canada)
- Orlando, FL
- Dallas, TX
Looking back at the five things I wanted to accomplish this year, I finished two: taking two full weeks off, and forming an LLC. The latter should play a large part in what 2008 will be like for me. The three things I didn’t accomplish last year go back on the list for this year:
- Learn a new programming language/product. I ended doing nothing at all with Eiffel last year. This year, particularly with the LLC, I've been thinking about specializing in a product. When I worked for Lockheed-Martin, I specialized in the customization of Community Server. I'll either go back to that, or look at a technology from Microsoft (BizTalk, SharePoint, etc). If I learn another programming language, it will probably be something like Python.
- Re-learn the piano. I hardly played at all last year. I'm glad my ability to read music hasn't disappeared. I'm not sure what it will take to get me practicing regularly again, but I'll figure something out.
- Study the Bible more regularly. I've started using online devotionals and religious podcasts to jump-start this.
Digital Cameras, and another Adobe Lightroom Plug
This time, from a much higher-profile blogger than me–Tim Bray. The bulk of the post is actually about digital SLRs (DSLRs), more specifically, Bray’s follow-on commentary to this post by Dave Sifry. The starter kit looks decent, but the estimate of how many RAW files a 4GB Compact Flash (CF) card will hold makes me wonder if Canon’s RAW files are bigger than Nikon’s. I have a D70s I’ve been shooting with for about two years, and a 2 GB CF holds over 350 RAW files.
The only place where I might differ with Bray’s additional points is the first one on camera brands. Canon and Nikon between them own the vast majority of the film and digital camera markets. This is important because it means you’re far more likely to find used equipment of good quality in those brands than with Pentax, Sony, etc. In my own case, the reason I got the D70s was that my friend Sandro found a refurbished one for $600 at Penn Camera. Maybe 6 months before that, the same camera cost $1200 new. New lenses get pretty expensive once you get faster than about f/4, so good used ones also keep things affordable.
Lightroom: Day 24
My earlier plan of a longer series of posts on the ins-and-outs of Lightroom was devoured by work, holiday stuff, etc. In this post, I’ll talk briefly about Navigator, collections, and the Slideshow portion of the workflow.
Navigator
This feature, available in the Library and Develop portions of the workflow lets you look at various areas of a selected photo. You can zoom in as far as an 11:1 ratio. It’s quite useful in Develop, since at least some of the edits you can make (red eye reduction, spot removal) are most successful when you get in really close. I haven’t used this feature a ton, but I certainly haven’t found anything like it in iPhoto.
Collections
Collections are the mechanism for organizing groups of photos in Lightroom. They appear to be equivalent to iPhoto albums. In Lightroom, photos have to be in a collection before they can be sorted. Unlike iPhoto, Lightroom allows you to sort photos both in the filmstrip and the grid view. The number of photos displayed per row in the grid view also adjusts automatically based on how large you make the application window (it’s a manual adjustment in iPhoto).
Slideshow
In this amount of time using Lightroom, I only have one complaint: when you play a slideshow directly from the software, it starts reverting to earlier slides after you’ve displayed around 50. At least, that was my experience when I used to help a friend present photos from his trips to various Seventh-day Adventist churches. I’m hoping it’s some sort of trialware restriction, because that would be a pretty major bug otherwise.
Slideshows export as PDFs, with one slide per page. There are five default templates, and the software lets you create your own. You can change slide backdrops, text overlays, and layouts in a number of interesting ways. If I get some time before the trial runs out, I’ll make some sample outputs available in a subsequent post.
In retrospect, I should have used the Preview app in slideshow mode to present the slides, since there weren’t transitions, music, or anything else requiring Lightroom to run it.
Import
If Lightroom is on when you connect a camera or memory card to your Mac, a dialog pops up that lets you decide how to import the pictures. It didn’t interfere with iPhoto when I used it.
Sight and Sound Theatre
My sister and I spent the weekend with my parents and an aunt to watch the Christmas shows at Sight and Sound Theatre, in Strasburg, Pennsylvania. We were fortunate enough to see both Miracle of Christmas and Voices of Christmas. Both shows are Christian-themed musicals with live animals and very impressive set design. The Millenium Theatre, where Miracle of Christmas was staged, is large enough to have front and side stages. There was plenty of action to both sides, and the show also used the center aisles to move people and animals in and out. They even had the actors playing angels on wires, flying them around at heights of what must have been at least 30 feet for some scenes. I really enjoyed both shows.