January 2005 - Posts

Rocket, I'm goin on a Rocket..

Lookout moooooon..

I have moved to GeeksWithBlogs.  I'll be joining many other community bloggers as well as some top technologists.  Thanks again Jeff for the space.

My new address is:
http://geekswithblogs.net/joeolsen/

My new rss feed is:
http://geekswithblogs.net/joeolsen/Rss.aspx

Please update your feeds and thanks for the continued support.

Later DNJ!  Thanks for the memories...

Wrapped User Controls in Asp.net 1.1

With asp.net 2.0 hype ramping up even more as the release date draws near, I wanted to share a quick overview of the portal/pod/gadget/portlet structure.  Everyone is working on portals now, but here is a simple, easy way to get started and add a little structure and conformity to your site.  Download the code here.  I have also put together a semi-detailed breakdown of the code here.  I tried to post the breakdown on the this blog, but for some reason it totally screwed everything up with the style sheet or something.  Anyway, now it's a word doc so download it and you'll see the post body.

"The test form is only available for requests from the local machine" - Argh!

I have had a lot of people ask me about using the test web page to invoke web service calls when your not at the local machine.  When asp.net 1.1 was released, HTTP Get, and HTTP Post are disabled out of the box.  There is a KB article with more info here.

If you're like me you are always working locally, but need to test certain web service calls across the network sometimes as well.  Maybe you've just uploaded your new site to the hosting company and want to test it as well.  Whatever the reason, here's how you fix that pesky problem of not being able to use the test page when not calling the web service from the localhost.

If you simply open the web config file and add the following, you will be able to access the test form outside of the localhost:

<configuration>
    <system.web>
    <webServices>
        <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
        </protocols>
    </webServices>
    </system.web>
</configuration>

Alternatively, according to the KB article, you can also enable the protocols for the entire box by adding the following to the machine.config file, but unless your the sole user and king puba, I wouldn't recommend it:

<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="HttpPostLocalhost"/>
      <!-- Documentation enables the documentation/test pages -->
<add name="Documentation"/>
</protocols>

ColorPicker

I have seen a lot of posts lately about ColorPicker.NET and agree that it's a pretty cool tool.  I do a LOT of design work on my sites (as everyone who knows me can contest to), and I am always looking to find a way to more easily create.  As a web guy though, I am rarely concerned with RGB or CMYK.  It's really the Hex value I am always concerned with.  Additionally, when I am coming up with color schemes or planning design, I am usually using some reference point be it a picture on the computer, website, window background, whatever.  Therefore, I have used a free tool called (coincidentally) colorpicker for years.  I keep it on my USB key so I have it with me always.  It's been a lifesaver many times and is a definite part of my everyday work flow that I could not be without.

Colorpicker is a small is a very small (100x50 pixel on screen) tool that sits on your desktop and shows you the hex value of anything your mouse pointer is over.  You can also copy the hex value displayed for pasting into Photoshop, a css file, web code, etc. I push it up into the top of my screen so that only the text box shows on the desktop.  Once planted at the top of your screen, it's barely noticeable.  I have given it out plenty of times as I have passed in and out of clients throughout the years, so I figured now would be as good as any to blog about it.

PS. Control was made by Chunting TM (no longer in business)

MSN Outlook Live!

Microsoft released Oulook Live! today, an online version of outlook built around a hotmail or MSN email account.  You get 2GB of storage and can send up to 20MB attachements.  Service is based on a yearly subscription fee of $44.95. Check it out!  I hope we can get some of these subs to give away the ug meetings.

Omaha.NET Meeting tonight!

Omaha.NET January Meeting
Thursday, January 20, 2005 at 6:00 PM
Join us for our monthly meeting with special guest speaker Ken Getz. Ken will be speaking on "Working with Data Using the Enhanced GridView and DetailsView Controls in ASP.NET 2.0". As always, pizza and pop will be provided by Microsoft, and we will have door prizes to raffle off.

The GridView control in ASP.NET 2.0 isn't your father's grid. It's similar enough to the ASP.NET 1.x DataGrid that you can get started right away, but its capabilities have been enhanced - it's far simpler to use, requires less code, and provides far more power than the DataGrid Control. We'll demonstrate how to display and edit data using the GridView control, how to work with the GridView and DetailsView together, and how to take advantage of several of the GridView controls events to achieve the behavior you need.

The meeting will be held at Creaighton University, West Omaha Campus. The campus is located at 11111 Mill Valley Road, just Northeast of 114th and Dodge.

Geek Dinner

Met last night for our “every once in a while” Midwest rock star dinner.  A couple fo the Des Moines guys made it down, so that was cool.  The place was Omaha Prime (thanks Jeff), and it was good stuff.  Even better was getting to see everyone face to face for a sit down.  The topics covered always vary from the MS technology talks to competing technology to just general crap.  A few things that stick out the next day are:

1) Javier brought up an idea of creating a local project forum for the user groups.  This would be group project for a non-profit organization that would allow UG members to gain new .NET skills and work on a complete dev cycle.  Now, I helped lead a similar effort a couple years back called Non-Profit Ways with David and Jason.  Managing the team was hell and getting things completed was even tougher, but having the local spin on things might work.  It's definitely a more plausible scenario than ours was.

2) What will Longhorn offer developers?  There was lengthy discussion around what types of things Longhorn hopes to offer developers, as developers are key decision influencers within the typical corporate organization.  With MS giving up all the goods early, what will be left for incentive?  It will definitely be interesting to see it played out.  It was agreed that Longhorn is geared more toward the consumer, and IT professionals on the business end, but the question still remains..why will we upgrade?

3) What is with media center?  I agree that media center is a great product RIGHT NOW.  What happens when every offshore hardware manufacturer can produce a Tivo for 25$?  I think the media center product is going to end up getting MS in a hardware game with the rest of the market and history tells us that is a bad idea.  In two to five years, every Walmart will be sporting 30$ Tivos and media players, complete with temporary storage readers and several ins and outs.  Why is MS pushing this.  Why are they not exploiting the XBox Live end of consumer products.  Gamers are everywhere between the ages of 5 to 50 and that's only going to increase on the tail end.  Sony tried integrating a “media center” into the Playstation and failed..in Japan!  This is a nation where Sony can make anything they want and sell millions of dollars worth of product.  It's obvious their approach was off.  People don't want integrated hardware, without the community/sharing/were all connected capabilities.  Xbox Live is a ace in hole as I see it.  It's something Sony does not have, and will have a difficult time mimicking.  If I am bill gates, I put my money in Xbox and make it my flagship consumer division. Maybe that's why I don't run Microsoft. :)  P.S.  Portable media player is a joke, check out the PSP, that is the future of handheld media.  Unless Media Center is expected to go OEM in all kinds of 3rd party “Home Media Centers“ for cheap, I don't see it..

4) One of the main issues with getting large corporations to move to a .NET environment is the cost.  Big companies are still in the thinking that if .NET is so cheap, how can it be equal.  In a world where managers will buy anything that will cushion them for another 1 1/2 years of “managing implementation“, inevitably leading to a “I managed a million dollar implementation“ bullet point on a resume, it's hard to sell them on fast, simple, solutions.  It's funny because all .NET developers share this story in some shape or form.  It's like it's funny, but sad at the same time.  It's sad that companies don't realize they are being ripped off my middle managers recommending overly complex hardware/software.  I always take the standpoint when selling .NET to clients that building a team of developers is much cheaper on the MS side of things.  Sure, a good architect is going to cost you some cash on either side of the fence, and rightly so.  But I can train a team of wet developers into a fully functional coding unit at less expense and far quicker than Java. 

5) The man show rocked when it was young.  It reminds me of other shows that started off as killer 30 minute bundles of joy and turned into crap.  It's sad really that this inevitable cycle is unavoidable.  Favorite Episode: Jimmy and Adam having women sign a petition to end Women's Suffrage.  Classic.

Anyway, that's the recap.  We also talked about HDC 2005 and are thinking much bigger this year planning on about 500 attendees.  More details to come as things shake out.

Sushi, Gaming, and Sql Server..

Tuesday rocked!  Full day of development, night full of Sushi Japan and gaming.  Working all day on an asp.net application with utterly no success could only be topped off with excessive eating and gaming.  After work, I headed out with the wife for some food and drinks.  Those of you who know me know I do not eat sushi, but I love the chicken and steak combo.  After the meal and some much needed drinks, it was off to the local game store to pick up Mercenaries, a Lucas Arts (Xbox) game that was released yesterday.  While I was there, I figured I would also jump into the 20th century an purchase a couple of Wavebirds for the GameCube (another one of the best ideas I have ever had).  Anyway, long story short, I spent the rest of the night enjoying the new Lord of the Rings: Battle for Middle Earth PC Game, Metriod Echoes on the Gamecube, and Mercenaries.  What a brilliant Tuesday night.  It was reminiscent of the days of lore when I was single and full of dead time.  I will most likely have to stay up later than normal tonight and make up for my fun, but what the hell right?

Anyway, now for the technical stuff.  I have an interesting question which I am sure will spur some sort of debate, but here goes..  Guids or Identity fields in SQL Server?  What's your poison?  Personally I am a fan of Guids when needed, which is logically most of the time.  Unfortunately we are all bound to get into positions where we are debating the solution with ex-access people who are less concerned with the correct way and the more comfortable way.  Anyway, I wanted to give some of the developers out there some ammunition, so here goes:

Joe's top 5 reasons that Guids are better identifiers than integers:

  1. You will never run out of Guids, Identity has a limit of (2,147,483,647) and if you run out the query crashes

  2. Replication is much harder to perform using Identity fields than Guids. When using a guid, you know there will not be any servers with the same value.'

  3. There is a problem on tables with identities if the db server crashes. If it crashes while writing inserts, when the server is restarted, SQL Server will reset the next identity to a very large number/ For instance, if the current Identity is 50k when the server crashes, it will go up to 100,000,000. This is most likely a design feature, as the rollback does not know how many records are about to be written, so it bumps up the next identity to something it cannot hit. Since it does not reset the next Identity back down, a few of server crashes can easily put you over the 2 billion number pretty quick.

  4. Developers can create Guids on the fly allowing them to save a server trip to the database after an insert.

  5. Guids are far more secure and allow important id's to be use din a more general sense due to the lack of protection needed.

Having said that, the only downside to Guids is that they are a bit slower than and int (usually in the milo or pico seconds), but then again so is everything else. Having the guarantee and security of Guids far outweigh the minuscule hit in performance. Identifier is merely an adaptation of Access's "auto number" feature. It's really outdated and not preferred any more. Additionally, after 100,000 rows. guids actually perform better than numeric types on modern hardware due to the indexing optimizations (cascading of the Guid blocks) that MS has implemented.

What is your implementation of choice?  Anyone out there know I am an idiot and want to tell me why.  Let me know!

ASP.NET best practices

Came accross a Rob Howard article today linked form Jeff's blog.  It's good stuff and definitely worth a read.  I have always enjoyed Rob's talks at Tech-Ed and the like.  His Tips and Tricks and Performance sessions have always been a highlight of the conferences to me.  One of the things I would like to stress from his article is the Gzip compression.  I have also tested this in implementation and found it to produce rediculous performance gains.  The code comes down garbled from the compression too, which is an additional bonus.