All posts by Jim Geurts

How to remove URL, date, and title from web print outs

Interested in printing something from the web, but not having it look like it came from the web?  Do this…

Firefox:

  1. Open up Firefox (Available from here)
  2. Click File->Page Setup…
  3. Click Margins & Header/Footer tab
  4. Set all dropdown menus under the Headers & Footers section to “–blank–”
  5. Click Ok

Internet Explorer:

  1. Open up Internet Explorer
  2. Click File->Page Setup…
  3. Clear both text boxes under the Headers and Footers section
  4. Click Ok

 

From a Property Center forum post

Life…

My life has taken an unusual turn for the moment.  I’ve had quite a bit on my mind the last two days and this is the first time I’ve had a chance to access the internet and let you all know about it…

My mom went in for a cardiac catheterization procedure on Friday and we were lead to believe that it was going to be an outpatient procedure.  The cath procedure was a result of a recent stress test that she had done.  They were going to go in and possibly perform an angioplasty or insert a stent, if the cath procedure determined it necessary.  Well, they found a blockage on one of the three main arteries on the heart and the doctor determined that the best solution was to perform surgery to bypass the blockage.

So she went in for triple bypass surgery at 7:00am this morning.  My sister, brother, and his wife were able to get to Green Bay by about 3:00am, so everyone was able to see her before the procedure.  As of this point, she is out of surgery and hanging out in the intensive care unit.  She’ll remain in the ICU until tomorrow, where she’ll be transfered to a normal room in the hospital.   Amazingly enough, they’ll get her walking as soon as possible (tomorrow) and they basically try to get the heart patients active to prevent clotting and other problems. 

So it looks as though the worst is over and it’s rehab from here on.  I do have to admit that I feel very happy that the work I do allows me to be as productive from remote locations as from my home office.  It will really help to be there for my mom as she recovers, while continuing to work on my work projects.

Migrating .net application to iis7

When you initially try to run a web application with IIS7, it’ll bitch at you and tell you to either migrate the application or run it in a classic app pool.  I decided I would migrate my application since I’m sure I’ll have little choice in the future.  The error page is fairly convenient and tells you which command to run to migrate the website:

%systemroot%system32inetsrvAPPCMD.EXE migrate config “Default Web Site/YourApp”

This is great and all, but when I tried to run the command, I received the following error:

ERROR ( message:Configuration error
Filename: \?C:Windowssystem32inetsrvconfigapplicationHost.config
Line Number: 0
Description: Cannot read configuration file
. )

Now, first let me congratulate Microsoft on their extremely informative error message.  Not to mention the creativity used for formatting the error message. Way to go!  After staring at the monitor for a while, I figured that I would try running the cmd.exe as an administrator.  This solved the issue, and everything is happy.

One way to run the cmd.exe as administrator is by going through the start menu, right click Command Prompt and select Run As Administrator.  Executing the migration command in the administrator command prompt will successfully migrate your website.
 

Run msi with elevated privileges in Vista

I installed an “older” msi (QuickCode.net for vs.net 2005) on my vista box, tonight, and it apparently runs a custom action to register an assembly that Vista doesn’t like so much.  That custom action requires elevated priviledges and the install will bomb if you try to run it under a typical user account.  So… I created a batch file that calls msiexec.  You can run the batch file as an administrator and everything installs as it should.  I copied the msi to a temp directory (C:temp) and created the batch file as follows:

msiexec /i c:tempQuickCodeSetup2005.msi

Then all you have to do is right-click the batch file and select “Run as administrator”

 

Ubuntu and Beryl

My outlook on linux is changing as time goes on.  It might be that I’m playing with Linux this time, rather than racing to get a server running.  I had a pretty pleasant experience tonight with Ubuntu.  Apparently I originally installed the Dapper release (v6.06) yesterday… A click or two with the Synaptic Package Manager and around 20 minutes later, I’m now running Ubuntu Edgy (v6.10).  That amazes me… no compiling the kernel manually, no lengthy command-line statements just to install/upgrade certain parts of the OS.  It is how it should be.  Nice and easy…

After updating the OS to the latest version, I wanted to see if Linux could actually outperform Vista.  A couple clicks later (I had to add the specific Beryl repository information to Synaptic) and after following some good instructions I’m running Beryl on top of Gnome…

Beryl is a desktop/window manager based on OpenGL.  So it provides cool window movements, transitions, themes, etc.  It puts Vista’s Aero desktop to shame

There are no hardware ratings here.  Nope… Everything just works…  Opacities, transitions, effects… and the theme choices available for Beryl are amazing.  You can modify anything and everything related to windows.  One minor thing to note is that I’m using AIGLX rather than XGL.. it seems like the KDE/Gnome war all over again to me, but whatever… I’m just using the one that worked the easiest on my laptop.

As far as performance goes, I’m not noticing any degraded performance… granted I’m not playing games on the laptop, I’m just using it for surfing and development type activities.  It’s easy enough to turn off Beryl if I do find that I need to run a graphics intensive app.

Perhaps I’ll install the Kiba dock or gnome-dock at some point in the future… I haven’t fully decided yet, though. 

My experience with Vista and Ubuntu

I got a new Dell Inspiron 1300 today… I wasn’t looking for a desktop replacement, but rather just a laptop that can run various applications and works while I’m away from my office. 

After I watched the FedEx truck drive by my house & then see the status change online to “customer not home,” I sat around for a few hours until I could pick up the boxes from the local office.  Thanks FedEx…way to go the extra mile…

Anyway… so now I have my computer and the first thing I did was throw away all the shit that Dell gives you.  5 cds of worthless crap… AOL offers, Roxio crap, and all other crapware offers they bundle… A suggestion to Dell… provide an option at checkout time to not include all of that crap.

So before I could dive into their install of XP, I threw in a Vista dvd and started installing it. 

Vista

MS finally got rid of their ancient DOS based installer and replaced it with a more modern GUI.  One extremely nice feature is that you can now provide drivers via disk drives, cd/dvds or usb drives.  They also provide a relatively simple disk utility to partition/format disks.  Overall the experience is pleasant.

The install process seemed to be quicker than installing XP.  A tip of the hat goes to MS as the install only needs to reboot 2 times.  Who knows… maybe with VistaXL Ultimate Kickass v2.1 they’ll figure out how to install it with 0 or 1 reboot.  Anyway, the install finished before the end of an hour long show about the history of ecstasy; it took about a 1/2 hour.  Apparently the PC scores a 1.0 on the Vista experience scale… This automatically disables the annoying transparent title bars, thankfully.  Apparently after talking with someone who knows more about Vista scores than I do, I have a pretty crappy box.  Basically it’s at the bottom of the scale.  sweet…

This link is useful for how to get rid of the gay “Favorites” addition to Windows Explorer

Man… talk about locking down the OS… I got 4 confirmation dialogs when I tried to create a folder.  This should be a real joy to work with daily…

Total Install Time: ~1/2 hour 

Ubuntu

Well.. Ubuntu trumps MS with it’s installer… not only is it a Gui, it goes a step further and sets up a live cd.  So basically it gives you Ubuntu loaded directly off the cd.  Very cool… it allows you to surf the internet (using Firefox) among accessing all other applications and utils that you would come to expect from a linux distro.  Note, this analysis of the live cd is coming from a relative Linux retard, so take what I just wrote with a grain of salt.

Total Install Time: ~15 Minutes

 

After a few joyous outbursts, I realized that grub (the linux boot loader) was not detecting my Vista install properly.  Thanks to this thread, adding the following to /boot/grub/menu.lst did the charm… The main point to mention is that it reads rootnoverify, rather than just root.  If you’re reading this for an answer to the same thing, make sure you have the correct disk and partition specified for where your Vista install is located. 

title                Windows Vista
rootnoverify (hd0,1)
savedefault
chainloader +1

 

A generic api modification

In an attempt to become more comfortable with generics, I’m trying to find reasonable places to use them other than just for collections, etc.  This is one example:

I had a helper method that returns an object from nHibernate based on the supplied id:

public object GetObjectById(Type type, int id)

{

    if (this._activeSession != null)

    {

        return this._activeSession.Load(type, id);

    }

    else

    {

        throw new NullReferenceException(“The repository doesn’t have an active session”);

    }

}

Which I replaced with:

public T GetObjectById<T>(int id)

{

    if (this._activeSession != null)

    {

        return (T)this._activeSession.Load(typeof(T), id);

    }

    else

    {

        throw new NullReferenceException(“The repository doesn’t have an active session”);

    }

}

While it doesn’t really change anything for how the object is retrieved, it does simplify how I call the method.  Instead of having to write something like: 

Property property = MyHelperClass.GetObjectById(typeof(Property), id) as Property;

I instead write the following:

Property property = MyHelperClass.GetObjectById<Property>(id);

So in the future when I upgrade to nHibernate 1.2+, this should make the transition smoother.  nHibernate 1.2 supports generics among other things.

[Update] – I upgraded to nHibernate 1.2.  So my helper function looks like:

public T GetObjectById<T>(int id)

{

    if (this._activeSession != null)

    {

        return this._activeSession.Load<T>(id);

    }

    else

    {

        throw new NullReferenceException(“The repository doesn’t have an active session”);

    }

}