Editing XML and XSL

May 15, 2007

Editing XML/XSL is easy. For simple documents, anyway. But what about ginormous XML files with wild and crazy structures?

Try the latest incarnation of Microsoft’s XML notepad, available for download completely free: Download XML Notepad 2007. XML Notepad provides handy-dandy tree view editing of XML documents (even big ‘uns), with built-in XSL preview so you can see what everything looks like after an XSL transform.

But alas, the XSL preview doesn’t automatically reload the XSL document for you. Which is a real pain if you like to switch back and forth between edit and preview mode to see what the output looks like after each subtle change.

It turns out there is an easy way to view previews. Just stick an xml-stylesheet node at the top of your XML document, like so…

<?xml-stylesheet type="text/xsl" href="Stylesheet.xsl"?>

…and load the XML file in IE. Then you can hit F5 all day long, and IE will appropriately refresh the XSL output.


Rapid Wrapper

May 14, 2007

Every now and then you need to create a wrapper object to keep things nice ‘n’ tidy in your code. For example, you might want to wrap the sealed SqlDataReader class with your own class, maybe called SafeDataReader (as in Rockford Lhotka’s most excellent CSLA.Net architecture), to handle null values gracefully so you don’t have to include checks for null values throughout your code.

Since SqlDataReader is a sealed class, you can’t inherit from it. Bummer. And creating a wrapper is a ton of work because of all the members exposed by SqlDataReader.

This is where CodeToaster can save you a ton of work by generating a fully functional wrapper class in less than 15 seconds!

To use the template, you will need CodeToaster (just updated today with a slew of bug fixes and enhancements).

Create a new template project and copy the wrapper template into it: get the wrapper template here.

Now, compile the project, and set the template’s properties thusly (depending on the class you want to wrap):

Now run the template, and you should end up with a bee-youtiful wrapper class that you didn’t spend a billion years coding.

[Disclaimer: I put this template together in about 30 minutes, so there may still be a few bugs. But this is a good example of what CodeToaster (and code generation in general) can do.]


The Google Phone

May 14, 2007

Rumors disspelled here.

OK, not quite. But I have done a fair amount of reading on the subject, and this article seems to put the most realistic spin on the fabled Google Phone (GPhone), rumored to be released by Christmas, 2007.

So here’s the gist:

  • The GPhone won’t be an iPhone clone – it will probably be a software product using someone else’s hardware.
  • It will probably be very cheap, maybe even free, paid for by advertisements. This would make it very appealing to billions of cell phone customers.
  • The phone’s strong point (and a very strong point it seems to be) will be providing location aware search results. So for example, if you’re getting off a plane at Chicago Midway and search your GPhone for “taxi”, you’ll get a list of taxis that service Midway.
  • Given that your phone can let Google know where you are, the possibilities are endless. Google Maps, for instance, could provide you with nearby restaurants, gas stations, and hotels at a button click.

The iPhone is targeted towards the type of people who need, and can afford, a $5 latte every morning. I think the GPhone, on the other hand, will quickly be picked up at your local retail store by… well, everyone else.

(I still think the iPhone is mondo cool.)


Liar, Liar

May 4, 2007

Wow, looks like even the Dean of MIT can’t tell the truth on her resume (she lied about which schools she earned degrees from).

We’re interviewing again for another .Net developer position, and as I’ve said many times before, I don’t even look at resumes anymore. It doesn’t matter…

  • what school you went to
  • which degrees you have
  • what certifications you’ve completed

…you can still be a complete moron, a lazy developer that never cracks a book, or a host of other disqualifiers.

But back to the topic at hand: lying seems to be quite rampant. Or maybe, people just don’t understand when they’re lying. A resume landed on my desk just the other day (which HR had already screened, incidentally) that listed MCSD as one of the candidate’s credentials. Next to MCSD was the abbreviation (TBD). Which meant the candidate hadn’t quite completed his MCSD certification. Huh.

So, why was it on his resume to begin with? I could care less if he’s trying to get his MCSD. That’s like saying “I’m trying to get admitted to Harvard”, or “I’m trying to learn programming.”

In the infamous words of Yoda, “Do, or do not. There is no try.”

Or if I could rephrase, “Don’t be puttin’ stuff on your resume that ain’t right.”


Microsoft Touch Desk

May 4, 2007

Wow. You have to watch this video. This is a research project, and likely something that won’t be in production for a loong time, but still very cool…