Red Gate Buys Reflector

I just came across the news this morning.  I used Reflector a lot when I was first learning .NET.  Lately, I’ve been using it with the Graph and DependencyStructureMatrix plug-ins to figure out where applications are too tightly coupled.  I’m glad it’s staying free to users.


Other People's E-mail

Lately, I’ve been getting e-mail at my Gmail account that are clearly intended for other people.  I thought “Scott” and “Lawrence” were fairly common names individually, but the number of people who believe that slawrence [at] gmail [dot] com belongs to them has grown to the point where it’s beginning to become inconvenient.

The e-mails that concern me the most are the ones that contain people’s travel information, passwords to certain websites, and cellphone bills.  Because they’re automatically e-mailed from these sites, I’m not sure what the best way is to contact these folks to have corrections made.

I welcome any suggestions readers (all 3 of you ;-)) might have on the best way to deal with this.


My iPhone Review

I picked up a white 16GB iPhone 3G on July 13.  After a month of use, I can add my 2 cents to the tons of reviews already out there.

Battery Life

I have to recharge the phone every two days, running with 3G and wi-fi off, except when I need them.  If I leave 3G on, I have to recharge the phone after a day.  From people I’ve talked to about other 3G phones, this amount of battery life is typical.

No Keyboard?  No Problem.

I’ve found that I can type with 2 thumbs reasonably quickly, even without the physical clicking of keys.  I can’t type as fast as I could on my old Nokia 6820, but it’s still usable.

The iPhone as a Phone

The only functionality obviously missing is support for MMS (picture mail).  It seems odd that phones AT&T gives away have a feature that the iPhone lacks, but that’s the situation.  While it isn’t a feature I want desperately to use (I barely used it on the Razr), having to surf to a website to receive MMS messages someone sent you is inconvenient.

I like everything else.  The recent call and voicemail features are particularly well-done.

The iPhone as a Web Browser

Browsing the web is where the iPhone really shines.  At this point, there’s no other device its size that enables you to surf the web so easily.  If you aren’t an AT&T wireless subscriber, this feature alone is probably one of the best reasons to buy an iPod touch.

While the iPhone doesn’t support Flash, I see this as a plus.  On my work and home machines, I use Firefox 3 with Flashblock enabled on virtually every site.  No worrying about ads, or video I don’t want, or the battery life penalty that would likely come with Flash support.

The iPhone as an iPod

Last week was the first time I used it much as an iPod (I was in Toronto).  As cool as the click wheel was on previous iPods, multi-touch crushes it.  I didn’t think navigating through a large music/video collection could get easier, but it is.  Watching videos on a screen that size isn’t bad at all.

E-mail on the iPhone

So far, I like this feature.  Occasionally, I’ll see a “This message has not been downloaded from the server” note, but that only happens with my Comcast e-mail account.

The Apps

I spent a lot of time playing JawBreaker when I was at Pearson International waiting for my flight home.  It’s an addictive little game.  Beyond that one, the apps I use most are NetNewsWire, Facebook, and Pandora.

Overall

I’m very pleased with it.  I’ve only gone traveling with it once so far (to Toronto for Agile 2008), and even though I had a laptop with me, I barely used it.  If I had it to do all over again, I would have left the laptop at home and simply synced the iPhone with my work e-mail.  It’s that capable and excellent a device.


An Alternative to NUnitForms

I first heard about Project White from someone at the Agile 2008 conference last week.  I haven’t had a chance to play with it yet, I’m very curious to see how it compares.  Since it comes from Thoughtworks, I think it’s going to be good.  If it makes testing of modal forms and dialogs easier, I’m already sold.

If anyone out there has already been using Project White successfully, it would be great to hear from you.


More frustration with Alienware

Today I come into the office to work, and find that my machine blue-screened overnight. I figured it was Vista acting up (again), so I restarted. Once the machine is back up, I log in, only to discover that I have no network access.

This is only the latest in a continuing series of problems I’ve had with Alienware’s Area 51 machines. If it wasn’t locking up for no apparent reason, the performance of virtual machines (VMware or Virtual PC) was slow. One cause of at least some of the problems turned out to be incorrect voltage settings for the memory (though I’m not sure how they got out of the factory with that wrong).

We spent about an hour uninstalling and reinstalling drivers and rebooting to see if we could solve the problem ourselves. After those efforts failed, I spent 2 hours on the phone with Alienware (1/2 of which were wasted by their tech support person walking me through things I’d already tried). The one really new thing we tried (installing a new BIOS) didn’t solve the problem either. Alienware has concluded that the motherboard has gone bad and needs replacing. This is a stunningly bad result for a PC less than 2 months old.

Two thumbs down on Alienware and Vista. If you must run some version of Windows, you’d be better off doing it on a Mac.

If you’re wondering how I posted this without a machine with Internet access, the answer is, with my iPhone.


XML Schema Gotcha

This is probably old hat to XML experts, but it’s new to me–the default values of the minOccurs and maxOccurs attributes of <xs:element>…</xs:element> in XML schemas are both 1 (one).  I had a schema definition with minOccurs=“0” and no value for maxOccurs.  In order to get the behavior I assumed was the default, maxOccurs needed to be set to “unbounded”.


My VW Passat and the Check Engine Light

I took mine in for service this week for its regular 5000-mile service, and a check engine light that has been going on and off intermittently for the past month or so. When I got the car back, I found out that the reason for the check engine light coming on was the need for a software update.

This is the first time I can remember that I’ve had to take my car to the shop to get new software. I just wonder how long it will be before car companies can beam us software updates by satellite.


Writing the contents of a string to a text file

I should have assumed this existed, based on Ed Poore’s comment on this post, but here’s the actual command:

System.IO.File.WriteAllText
There are multiple overloads for it, but the most basic one is: File.WriteAllText(filePath,contentString).

NDbUnit Revisited

I first wrote about NDbUnit back in 2006.  Unfortunately, it doesn’t appear much new has happened with the project since then.  The current version (1.2) is still a great help for unit testing when you need to put a database into a known state.  If an application you’re testing uses strongly-typed datasets as its data access layer (DAL), integrating the use of NDbUnit into your existing unit tests is even easier because it uses XSD files.

I’ve revised my previous sample project using Visual Studio 2008.  You can download the source as a zip file.  Make sure you have NUnit (I used version 2.4.7) and NDbUnit installed before you attempt to run the sample tests.


Loading text file contents into a string

While working on some XSD validation code today, I found that I needed to load a couple of text files into strings to unit test. I’d forgotten how I’d done this before, but I googled the answer with this search term:

file to string .net
The top result (at least as of today), gave me the answer I needed. I've reproduced it as the following function:

Update: Ed Poore let me know in a comment that the .NET Framework contains a method that does this already.  System.IO.File.ReadAllText(path)  does the same thing, so you can completely ignore the method above.


A couple of "old-school" CS principles

Robert Martin is a guy our CEO and architects really respect when it comes to software design and development.  Somehow, I managed to not have heard of the guy before this year, so I’ve started reading his stuff.  Here are a couple of his older columns that may prove quite useful if you find yourself building APIs in your work:

The first one explains a lot of the issues I've seen with applications in previous jobs.  In any number of applications, a simple change would have a ripple effect that touched a lot more than just one line of code.  Following the open-closed principle more strictly would haved save me many headaches.

iPhoto Archiving

When I bought my MacBook Pro a couple years ago, I didn’t get the largest hard drive available for it (in retrospect, a mistake). Between my music collection, digital photos, and Parallels PC disk image, 150 GB got close to full quite quickly. As a result, I’d been looking around for a way to archive some content (at least some music and photos) to an external drive to make more room.

I came across this old post that gives you a quick-and-dirty way to archive the photos (even if it doesn’t preserve the libraries).  What’s especially convenient about Time Machine in this case is that if I find a better way to do it, I can recover the old setup from it and then archive properly.


The Giant Pool of Money

For a great explanation of the current meltdown in mortgages, definitely check out this podcast.  The two reporters put together a narrative that covers everything from a homeowner with a sketchy loan, up to a Wall Street exec who creates collateralized debt obligations (CDOs).


Hello WordPress 2.5.1

Finally upgraded to the latest version, so I figured I’d change themes too.  The upgrade process turned out to be far easier than I expected.  If I remembered any UNIX scripting from undergrad, I’d automate it.


Strongly-typed DataSets in Subversion

Strongly-typed datasets are the default option for creating a data access layer (DAL) with the various .NET versions of Visual Studio. From the XSD file that defines a strongly-typed dataset, Visual Studio generates a [XSD].Designer.cs and [XSD].xss.  They’re regenerated every time you change the XSD, even if you just change the layout.  This can become a problem when working in teams and it’s necessary to merge changes.  If your Subversion repository is configured to version the generated files, they’ll be marked as conflicting when you update.

These are the steps I’ve taken to merge changes in the situation above:

  1. Delete [XSD].Designer.cs and [XSD].xss.
  2. Resolve conflicts in the XSD file (and mark them as resolved).  This will generate new versions of [XSD].Designer.cs and [XSD].xss.
  3. When resolving conflicts in the files generated in step 2, use the whole file that was just generated.
This will be much easier than trying to resolve conflicts in generated files.

Paintball

I spent part of my Sunday running through the woods shooting at friends and strangers.  The place: Outdoor Adventures Paintball.  The occasion was a friend’s 29th birthday.  Paintball has changed quite a bit since I first tried it as a sophomore in college.  There are college and professional leagues now (my alma mater apparently has quite a good team).  There are corporate sponsors.  They even have TV coverage on ESPN2 and the Versus network.

For novices like us, it was a great time.  We teamed up against a group of what looked like undergrads from the University of Maryland.  In three rounds of matches (3 games per match),  we won each 2 games to 1.  Usually it was by killing all of them off, but at least a couple of times we captured their flag and moved it all the way down the field.  The “center flag” variant of the game (one flag midfield that a team must capture and move forward through their opponents) was our least favorite.  We had a really long field for it in the second match, and our strategy didn’t work that well at first.  The one thing I would differently the next time is buy more ammunition.  Even though you have to pull the trigger for each shot, I ran out of ammunition before our third match was over.


Macbeth, Teller-style

I saw this production of Macbeth this afternoon with my friends Jen and Alban.  We were rewarded for our wait in the freezing cold (for standing room tickets) with actual seats for the show.  Thanks to Alban (I owe you big for this one), yours truly got a front row seat to the show.  Directed and produced in large part by Teller (of Penn & Teller), it was anything but your typical Shakespeare production (if there is such a thing).  I’m no aficionado of magic, but they pulled some incredible tricks in this show.  People appeared and disappeared before our eyes.  We saw fake blood which looked uncomfortably real.  I knew we were in for quite a ride when the show began with a Folger Shakespeare Library staffer stabbed through the back while reading us an announcement from the stage.  This doesn’t even include the excellent acting, the great fight choreography, the sound effects and percussion.


Upgraded to Leopard

I installed it last Wednesday. My first upgrade attempt failed, so I paid a visit to the Tyson’s Corner Apple Store to get some help from the Genius Bar. Apparently the DVD wasn’t clean or something (since the guy cleaned it off), because when I tried archive+install as recommended, there were no problems.  The next day, I picked up a 1TB Western Digital MyBook Home Edition at MicroCenter for $220 + tax so the Time Machine feature would have plenty of room to operate.  It’s definitely as cool as advertised.  I was impressed that when you plug in an unformatted drive, Leopard asks if you want to use for Time Machine.  I was pretty lax about my backups before, so this will be a huge help.


Changing Primary Keys from "int" to "uniqueidentifier"

I’m in the process of doing this for a project that uses Microsoft SQL Server.  One of the “gotchas” I came across was that once you’ve switched from “int” to “uniqueidentifier”, @@IDENTITY and SCOPE_IDENTITY references won’t work.  The second response in this thread pointed me in the right direction.  You have to call NEWID() in the context where you need it (and save the value) in order to be able to refer to it later.


Back to the trenches

Instead of management and code, I’ll just be writing code (at least for now). Today, I started a new job at a small consulting firm in Virginia with a software lab that wants to start putting out products.

Today consisted of the environment configuration and filling out of forms typical of a first day.  Most of the last half of the day was taken up by a boot camp.  I found it to be a very enlightening how-to on consulting, as well as an intro to the company’s culture.