Archive for November, 2007

Assembly.GetManifestResourceStream()

Lately I have been hacking some things out with NHibernate. I ran across an interesting issue with call Assembly.GetManifestResourceStream(). For NHibernate, I have different session factory configuration files for each entity assembly. So I needed to load an embedded resource from an assembly and pass it to NHibernate.

This was my first attempt…

1
2
Assembly assembly = this.GetType().Assembly;
assembly.GetManifestResourceStream("nhibernate.cfg.xml");

…which didn’t work.

After some research, I found this article. Basically, you can’t just specify the resource name. You have to specify the entire assembly name before the resource name. Thanks .NET for another wonderfully documented feature that makes no sense.

1
2
3
Assembly assembly = this.GetType().Assembly;
assembly.GetManifestResourceStream(
    assembly.GetName().Name + ".nhibernate.cfg.xml");

The Christmas Spirit

Last night, I was unhappily surprised when my roommate decided to bring home a Christmas tree. Not that I dislike Christmas by any means, but it was a real tree. Real trees are a pain. I told him he should have bought a fake tree so that we didn’t have to worry about pine needles and fire hazards.

He proceeded to harass me, calling me Scrooge and saying not having a real tree as a child explains why I am so weird.

In an ironic twist of fate, I wake up this morning to see a figure that somewhat resembled my roommate. The only difference was his eyes were swollen shut and he was red all over. Unbeknown to him, he was allergic to pine trees.

He said he is going to Walmart today to get a fake tree.

Review of Ubuntu Gutsy

Today I figured I would upgrade my computers to Ubuntu Gutsy. It turned out to be a long day.

Start with the desktop at work…

My xorg.conf was completely destroyed. After about 40 reboots, I finally had my desktop load without going into failsafe mode. Unfortunately, Xinerama support wasn’t working. After some research I learned that Xinerama is no longer supported by the ati drivers. Instead, XRandR is. The great thing about this is it is in the early stages of development and doesn’t support multiple GPU’s, which my work computer has. Needless to say, I am not happy and may install Vista to spite Ubuntu.

Switch to my laptop…

Perfect upgrade. After about 45 minutes, Gutsy was installed and running. No problems at all were encountered.

After today, my recommendation is not to install Gutsy on any dual-monitor setups unless you know it is going to work. On that same note, don’t install Gutsy on any computer with a complex xorg.conf file. It is way too much of a pain to debug to be worth it.

Hello again NTC

It seems as though my previous post discussing the recent FCC ban on cable company monopolies was wrong. While the FCC did approve such a regulation, it doesn’t apply to NTC. The VT newspaper discusses the issue in a recent publication.

Remote Desktop on Windows Server 2003 R2 SP2

Over the past few years, I have installed Windows Server on a handful of our development machines. Every time, I follow the same steps except it didn’t work to well this time.

Somewhere in the mix of releases and service packs, a major naming change occurred that I had no idea about. In previous versions, to enable remote desktop, I would just install terminal services which would run in administrative mode by default. This allowed 2 simultaneous connections from administrators which is what I needed.

When I installed terminal services this time, it ran for 120 days and then proceeded to stop accepting connections because it required a licensing server. It was obviously not running in administrative mode. What I soon realized was, terminal services in administration mode is now called remote desktop for administration. Instead of being part of terminal services, it is now separate which means it is installed differently.

To get it up and working, just follow this simple guide.