Watch TV Shows on Hulu

Not sure if everyone new about this. I would argue it is not off topic since it is an interesting thing on the web. Hulu is a great new service for watching television shows online anytime. Commercials are short and quick. It is an amazing service I expect plenty of people to start using. I've watched a few shows on there already.

Hulu-Home

I've found the interface quite easy to use and understand. Nothing seems weird or difficult. So when you go to watch a show you might get a message like this before the show starts.

Hulu-AdsQuestion

OK, cool. I can either watch one movie trailer at the beginning or I can have some commercial breaks. Not too shabby. If the movie trailer sounds interesting I will watch it, and if not I'll take the commercials. Trust me the commercials are not bad at all. There are not too many of them, and they are quite short compared to standard television commercial breaks.

Hulu-Commercials

This example I have here is a 1:26 runtime, so that is not too many commercial breaks. Plus, you can see when they are coming . This is a two hour long episode on television, so as you can imagine there are normally more and longer breaks. I've been very impressed with how quickly I can skip to any point in the show and watch. I've never had it lag on me, and it has never given me any loading screens or pinwheels that I often receive from other sites. Not sure how they got everything to stream so quickly and nicely, but you can be sure I will be watching on here a lot now.

If you have not looked at Hulu yet, you really need to. It is an amazing service, and it is free.

SQL Server Client Tools Installation

A while back I blogged about how to install sql server management studio, and it got a reasonable amount of feedback. More recently, Steve Smith posted a response to it where he highlights a better way of installing Management Studio. The method I outlined doesn't seem to work in every instance, so in his response Steve supplied a method which works more often.

The Solution: Run the SqlRun_Tools.msi file found in this folder.

{drive}\ENGLISH\SQL2005\DEVELOPER\SQL Server x86\Tools\Setup\SqlRun_Tools.msi

{drive}\ENGLISH\SQL2005\DEVELOPER\SQL Server x64\Tools\Setup\SqlRun_Tools.msi

Choose the top one for 32-bit systems and the bottom on for 64.

Lots of people keep UAC disabled on Windows, so they'll miss out on nice annoyances like the fact that this method requires you run the msi file as a local administrator. So as I am apt to do, I tried right clicking on it to choose the "Run As Administrator" context menu item. To my surprise it is not there! Below I've supplied the workaround I use in Vista for running as administrator when the context menu item is not present.

One of many ways around running a program as administrator when the context menu item is not present.

  1. In the start menu type "cmd".
  2. When the dos prompt icon is the only remaining icon right click on it and run as administrator.
  3. Copy the file location of the file you wish to run.
  4. Paste the location into the command prompt window.
  5. Click enter.
  6. Watch the program begin with administrator privileges.
  7. Celebrate and enjoy!

Update (9/9/2008): If the software claims that you have nothing to install when you run the SqlRun_Tools.msi then it means that installation has been borked. You will want to try running the Microsoft Installation Cleanup Utility. It will remove the client tools that SqlServer thinks are there, and it will then let you install them.

Windows Vista DreamScene Only Works with 1 Monitor

So I haven't had a lot of problems with Vista. There have been some slight issues including this one I blogged about recently. I think windows DreamScene is very cool, but I of course of more than one monitor attached to my computer. Okay, I can understand that they might have difficulty displaying the DreamScene video on both monitors, but not even allowing it to run because I have my desktop extended is absurd.

I would just like to be able to display it on the primary monitor or something. Perhaps let me pick a monitor and tell me only 1 monitor is allowed. instead of saying that I can't use it at all. I had to disable my second monitor to get DreamScene running.

If DreamScene and a second monitor are enabled at the same time, you'll see this nice popup from Windows.

DreamSceneErrorPopup

And when you click to see more information, it gives you this nice error message.

DreamSceneErrorMessage

Thanks guys.

How hard would it be to make DreamScene only run on 1 of the 2 monitors? Honestly here. let me choose a solid color background color even for the extra monitor(s).

One other request that gripes me a bit. I have plenty of backgrounds I like. I use a Gadget which changes my desktop background at a regular interval, but I wish this were a built in feature of windows. It really shouldn't be that hard, and it is certainly easier than DreamScene.

Have a great day!

Vista 64 Install Requires a DVD Device Driver

So I've been using Vista 32 for a while now. I've not had much trouble with it. I've not seen the horrors about which others speak. Perhaps now my eyes have opened a little bit to some of the problems. So while installing Windows Vista 64 on a machine, the installer said it needed a driver for the CD/DVD device. So at this point I am a bit confused. It makes no sense. If it could boot from the disc why can't it install from the disc. It can read the disc perfectly well. How else could it have booted from the disc?

After scouring a few forums trying to find the answer, I found a few interesting suggestions. While on 3rd party sites, I got suggestions of buying new devices or installing drivers in windows. Some suggestions of getting the drivers loaded during installation. On Microsoft forums I saw a lot of comments saying, "tell company x to write drivers for 64 bit". OK, thanks guys. It is an optical disc drive, and any OS installer should be able to boot pretty much any optical drive with minimal compatibility and install.

I eventually found one suggestion which seemed a bit crazy, "Change the IDE settings". So I figured I would try rewiring the device and see what happened. As it turned out for me if the drive was not set as the secondary slave, Vista 64 would not install. Just try and tell me that doesn't seem crazy.

The Solution that worked for me: Change the IDE settings so that the DVD Drive is the Secondary Slave.

Enjoy Windows Vista 64.

Performance with DropDownLists and ViewState

DropDownList-HornsOne problem I've noticed on a bunch of sites is a large amount of ViewState. I'm not going to sit here and explain all about ViewState. There are PLENTY of sources for information on that piece of technology. So in an extremely short description of what ViewState is I will say that, "ViewState is a way of preserving the state of the 'Viewed' elements of ASP.NET while the page is sent to the client and back to the server."

So what is the big deal? A little bit of extra information stored in a text file. That doesn't take long to download. Download speeds are really quick. WRONG! Sure, it does not take long to download a little bit of extra data, but ViewState is stored in an input control. This is how the data is able to get back to the server so it can reconstruct the previous state of things. This means clients will push the data up to the server. As many of you probably know upload speeds are much slower than download speeds.

OK, so I need to upload a little bit of extra data. How much are we talking about here? It can't be enough to matter.

I'll show you a bit of testing here. I'll create two ASP.NET pages.

Default.aspx

<form id="form1" runat="server">
    <div>
        <asp:DropDownList ID="DropDownList1" runat="server" />
        <asp:Button id="Button1" runat="server" Text="Postback" />
    </div>
</form>

Default2.aspx

<form id="form1" runat="server">
    <div>
        <asp:DropDownList ID="DropDownList1" runat="server" EnableViewState="false" />
        <asp:Button ID="Button1" runat="server" Text="Postback" />
    </div>
</form>

Default.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
    // Create my data source (this would normally be data access or something similar)
    System.Collections.Generic.List<ListItem> myData = new System.Collections.Generic.List<ListItem>();
    for (int i = 0; i < 100; i++)
    {
        myData.Add(new ListItem("Element " + i.ToString(), i.ToString()));
    }
    DropDownList1.DataSource = myData;
    DropDownList1.DataBind();
}

Default2.aspx.cs

protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    // Create my data source (this would normally be data access or something similar)
    System.Collections.Generic.List<ListItem> myData = new System.Collections.Generic.List<ListItem>();
    for (int i = 0; i < 100; i++)
    {
        myData.Add(new ListItem("Element " + i.ToString(), i.ToString()));
    }
    DropDownList1.DataSource = myData;
    DropDownList1.DataBind();
}

Note: When you disable ViewState you'll want to be binding data to the control during Init otherwise you'll run into some problems, because you'll be binding your data after ViewState has been restored.

These are the only differences between the two pages. So how much of a difference is there? The the amount of data being used for ViewState for the page with ViewState enabled on the DropDownList is 3.07 KB and for the page without ViewState enabled on the DropDownList 52 Bytes. Ok so not too big a deal right? Well imagine if you had a few of these on the page, and maybe the page posts back more than once while being used. Perhaps the hosting server is already somewhat slow. Perhaps you have users on dialup. Keep in mind that if you're setting values from the code for most controls it will end up in viewstate.

Note: Basic form controls will not be using ViewState since they post their values back anyway.

Grab a ViewState Decoder. I use the ViewStateDecoder from Pluralsight. If you use a tool to Decode the ViewState from these pages, you'll notice that the values from the dropdownlist are stored within. It will contain 3 things for each row of the dropdownlist. You'll have the Name of the list item, the value of the list item, and a bool. In total 2 strings and a bit, but since ViewState is all strings anyway this is all stored in a string format.

The spark that formed this blog post. I recently took on some pages with far too much viewstate. They had plenty of stuff on them and none of it had ViewState disabled. I took a page that had html source of 256 KB of data, and I dropped it down to 190 KB of data. It started with 74 KB of ViewState (ouch!) and now has 8 KB of ViewState (w00t!). The page is much much faster. It loads instantly now and when it does a postback it doesn't feel like the application is dying. All it took was removing ViewState from a bunch of controls.