11/25/2006

More Windows Vista: The Saga Continues...

"Linux sucks twice as fast and 10 times more reliably, and since you have
the source, it's your fault."
-- from Google Codebase Search


I have Vista Ultimate running on two PC's now, my notebook, and my "Main machine" where it resides on one hard drive, dual booting with Windows Server 2003 Enterprise x64 Edition on the other drive.

I'm getting to like Vista so much that I've even changed the Outlook default .Pst file to the one from the x64 OS so that I'll have the same Outlook data whether I boot into Vista or Windows Server.

At this point, I have everything pretty much set up the way I want, and I've gotten past a few of Vista's quirks with security and such to the point where I feel happy with the OS.

There are some plus items I've noticed about Vista, and also a few minuses:

Plus:

1) It boots FAST. Much faster than Windows Server.
2) You can put it to Sleep (like "Hibernate"). Your Computer's power light goes out, it "looks like" its off. But, when you press CTRL-ALT-DEL it comes to life in just seconds and all your stuff is still there. A big convenience feature.
3) It appears to be pretty good with memory and CPU management, especially with more than one program going.
4) Speech Recognition. They have made SUBSTANTIAL improvements. You can sit there with a headset mike and literally do anything you want, hands free. All it takes is a little study. "What can I say?"
5) the Copy folders/files dialog has been enhanced with conflict resolution and similar useful features.
6) For Developers, IIS 7 provides a number of enhancements, more programmatic API control, and improved stability, diagnostics, and throughput.

Minus:
1) The sidebar is still buggy and its a real memory hog. However, I'll give it the benefit of the doubt for now, since I probably will be developing a few freebie Sidebar Gadgets soon!
2) The Windows Mobile Device thing that replaces ActiveSync doesn't support Bluetooth. Apparently, corporate customers bitched to Microsoft, and they took it out. That's the pits, and you can't even install ActiveSync anymore.
3) The Copy folder/files dialog, because of the enhancements and computations of estimated time, etc. is now considerably SLOWER than in Windows Server 2003/ Windows XP.
4) The Microsoft Marketing Machine ("MMM") has completely failed me in describing whether Vista "Ultimate" is really the highest-end server-type product, or whether there will actually be a Longhorn Server that is still to appear. I strongly suspect that I am not the only person who is confused about Microsoft's proclivity for tinkering with the nomenclature, to the total and utter confusion of the end user.

Anyway, there will be more, I just wanted to get this started, and it'll be updated over the long weekend and beyond.

N.B. -- My first Sidebar Gadget: "Feed Search".

Linux What?


As if that weren't enough, have you ever searched Google Codebase? There are some pretty funny results. You can search for "Windows Sucks", but you can also search for "Linux Sucks" and get 5 pages worth of results!

11/22/2006

The Evolution of a Programmer

Usually around major holidays I become a bit more reflective and I "Reflected" recently on my kinda / sorta "evolution as a programmer".

I started programming seriously on an Apple IIe (and a bit on Commodore 64's) - at the time I was a broker with Merrill Lynch in Orlando, and I was fascinated by the Technical Analysis Department up in New York. These guys, like Bob Farrell and Phil Rettew, who've become legendary, would post their daily market calculations on the Quotron screens (for those who aren't old enough to know, the Quotron system was a hard-wired network with small monitors and keyboards for the brokers. The monitor had a screen with one glorious color - "puke green").

I started out copying down the TRIN, put/call and other indicators onto graph paper with colored pencils. It was fascinating (so fascinating that I eventually left the business when I realized I was more interested in technical analysis than sales!). While other brokers in the office would get excited about having some Muni bonds they could get a full point commission on, I was ranting about the put/call ratio making a new high.

There was an older broker in the office who had a Trash 80 with a printer. He wasn't much of a programmer, but he would let me write BASIC code that would actually print out these indicators as rudimentary graphs on perforated dot-matrix printer paper, and man - was I ever hooked! D00d, you wouldn't want to short GOOG at $500 without these graphs!

So I saved up and got my Apple IIe with the two floppies and the big cables and a dot-matrix printer. 64K of RAM! Anyway, I was fortunate because one of my customers was an engineer at what was then Martin Marietta in Orlando (now Lockheed) and he would help me with learning BASIC. I almost got divorced 'cause the Significant Other could not understand what I was doing up at 3 AM writing code...

So my first real entry into the programming world was driven by a need - to be able to analyze, manipulate via mathematical computations, and graph stock market data (this eventually led to a Ph.D. in economics).

Spaghetti Code



My first programs were what I now refer to as Linear Buitoni. Everything was "inline"- from front to back. Then I learned you could isolate code blocks into what were called Subroutines - that could be called from anywhere in your code. This was nice because if you had 10,000 points of daily data and you need to compute a slow stochastic index on it, you could pass in each day's data to your subroutine and have it do the computation, and return you the result of that day's worth of data.

Oh, and let's not forget the glorious "GOTO" statement. That REALLY made things fun! My Grandmother always said "The way to understand recursion is to understand recursion." Bless her heart - she managed to recurse her way up to 100 years old before she finally threw a stack overflow.

It wasn't until much later, working with FoxPro 2.6 and writing much more organized code for real business applications that I began to think in terms of "Structured Programming" concepts. Try writing an Australian Binary MLM commission program in Foxpro and you will learn what "structured" means, really fast.

And, although I dabbled in JAVA and C++ in the 90's, I never really got the concept of OOP (Object Oriented Programming) until .NET came out in 2000. That's when things changed. One of the biggest problems with programmers who started out or are coming from the Visual Basic "space" is to UNLEARN all the "bad habits" and crutches you have come to rely on. For many, this takes a continued, concerted effort, and for some, they never get out of the bad programming habits and thinking. This is particularly unfortunate for VB.NET programmers because Microsoft decided to bring forward a huge amount of "backwards compatibility" and "crutches" in the VB.NET programming language. If Option Strict and Option Explicit are left off by default, how many VB programmers do you think are going to "explicitly" learn why they should both be turned "on"?

Being largely self-taught as a programmer is not for everyone. You have to be really, really motivated to begin with. There are a couple of other skills I've acquired and carefully honed along the way that have helped me:

1) Learn to search on the web (google, Live.com, whatever). The web is your personal "RTFM". The better a searcher you are, the less frustrated you will be.

2) Learn how to ask questions - whether it's a post on a newsgroup, or a verbal question to a peer, you must be able to express yourself clearly and concisely, stating the exact problem and what information you need. When I look at some of these newsgroup posts (e.g., "Urgent-Please Help me") - posts that ask for nebulous things and have no sample code - I often wonder how anybody could even bother to respond.

So anyway, I thought I would share this tidbit of history. Happy Thanksgiving (or whatever your favorite hoiliday is). And, thanks for reading!

11/21/2006

Yahoo, Google and Microsoft Team Up on Sitemaps

Yahoo, Google, and Microsoft have all announced that they’ve agreed to set a standard for sitemaps.

DiggSpeak Translation: "Amazing! Top Ten Reasons to use Sitemaps"

Sitemaps are those XML files that list all the pages on your Web site. Search engines like to have all the listings in one place so that a site can be indexed without anything being missed.

The protocol has now been released under Creative Commons, so any search engine can pick up on it if they like.

Most webmasters / developers and web site owners use sitemaps, and there is plenty of sample code to generate these dynamically.

We use sitemaps on our Eggheadcafe.com site, and I believe they result in much better indexing. Plus, you can specify how often the bots should crawl, and what the priority is of each item. For more complex sites, you can have a SiteMapIndex file in your website root, which has entries that point to any number of other individual sitemap files. So for example, you might have a messageboard or Forum section and create a separate sitemap for that out of your database daily. Then, you might have another sitemap for your "regular" content such as articles, that gets updated weekly. Your index file would point to both of these, and the bots will happily crawl them.

Sitemap files can also be GZipped, which cuts down on bandwidth and the bots can load them faster. With .NET, just use the System.IO.Compression namespace.

The nice thing about sitemaps is this - Bots only know how to do one thing: follow links. They can't follow Javascript; they can't follow images, and they can't follow dropdownlists of links either. It has to be an anchor "A" tag, with an "href" attribute to make the spiders happy. Yep, they are just "reallyreallydumb".

If you have content in your site that's not linked to from another page, or which only comes up because of a database search, it's not likely to get indexed at all. But if you put the url into a sitemap file, the bots will find it, crawl, and index it. Think about it - you may have content that is dynamically generated out of a database, and doesn't sit on the filesystem at all. With the correct sitemap element, that content, which ordinarily would be invisible to the spiders, will be successfully crawled and indexed by the major search engines. That means more hits, and more revenue if you serve advertising.

Sitemaps are your friend. Now, with Yahoo and Microsoft on the bandwagon, they'll be more important than ever.

Yahoo is expected to begin using your sitemap(s) on Thursday, with Microsoft picking them up early next year.

11/17/2006

VISTA RTM: "Windows could not update the computer's boot configuration." - And BCDEDIT For Dummies


Vista RTM is out for MSDN subscribers, so I figured it would be as good a time as any this morning to install it on my second drive (the one where I had an x64 version of Windows XP that I hardly ever use.)



So I booted off the DVD and asked Vista to install itself "new" (not an upgrade) on this drive. I've already had some experience with this in the betas and I figured it would be cleared up by RTM, but no joy. About 85% through the expanding files phase you get a dialog that says "Windows could not update the computer's boot configuration." and that's the end of that.

Now there have been a number of so-called "Fixes" for this that involve a missing registry key, that go something like the following:

"This bug happens when partition manager is missing as upper filter for
disk. The following steps will fix this:

1. Open
HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E 967-E325-11CE-BFC1-08002BE10318} using regedit.
2. Confirm that UpperFilters is empty and UpperFilters.bak is present.
3. Rename UpperFilters.bak to UpperFilters.
4. Reboot and re-attempt the upgrade"

However, in my case, this would not apply, since the Registry never comes into play - I am doing a clean install, not an upgrade.

So far, it's still very early in the "game" and the Windows Vista MS newsgroups have no information of any value on this (not for it happening on a clean install).

I suppose I could move my various folders and "Stuff" to the main drive temporarily, format the little booger, and try it that way, but that's an inconvenience I'd like to avoid.

Anyway, if you are finding this same issue comment here and we'll try to pin it down.

(P.S.) "Your upgrade may take several hours to complete." -- Jesus H. Christ! They aren't kidding, man! Go get a big spaghetti dinner and some wine!

N.B. - And the solution, as indicated above, was to copy my folders of "stuff" (music, videos, backups and other junque) to the main drive. Then, I booted off the Vista DVD, selected my second drive, allowed it to FORMAT the booger, and everything went fine from that point on. Moral of the story? Even with a clean install (not an upgrade) if your selected hard drive has folders and "stuff" on it that Vista doesn't like, it may not install until you clean it off and or format the drive.

HINT: Windows Server 2003 x64 can copy entire folders of files from one drive to another a lot faster than Windows Vista x86 can....

Now the only issue left is how to configure BCDEdit on the Vista hard drive to allow for booting into the legacy OS. Here's my post on the Windows Vista newsgroup, if anybody wants to follow the saga. Maybe, "BCDEDIT For Dummies"?

And the answer:


Within a couple of hours, John Barnes posted this:

"Download and install a copy of VistaBootPro or BCDEdit in Vista and with the
Vista drive first, set up a legacy os. After that if it doesn't load, on my
system I have always had to copy the ntldr, ntdetect.com and boot.ini files
from the other drive to the root of the Vista boot drive and adjust the
boot.ini as necessary to point to the NT based drive."


I had already "done that", but as I tried again, I realized that if you change the Hard Drive boot sequence in your BIOS, the entry in boot.ini (on the Vista Drive) would need to be changed. Here's what fixed it (the old , and then the "new"):

# THE OLD:
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003 Enterprise
x64 Edition" /fastdetect /NoExecute=OptIn
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons



# THE NEW:
[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Windows Server 2003 Enterprise
x64 Edition" /fastdetect /NoExecute=OptIn
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons

With rdisk(1) in the new, we are good to go! And of course, we can use VistaBootPro in Vista to make either one be the "default".

One other pointer: If you do an upgrade with Vista, it's going to leave nasty temporary folders filled with multi-megabytes of useless leftover junque on your hard drive. If you run the Disk Cleanup wizard, and select all the checkboxes, that will do a fine job of cleaning you up.

Disabling Those Nasty Security Dialogs


This is, of course, not recommended, so you should consider the implications carefully. In my case, I'm behind a firewall (my router's, not "Windows Firewall", which I do not need) , nobody else uses the computer, and I've got Windows Defender and AntiVirus running on the machine.

As users have come to know, Windows Vista runs with User Account security checks on everything, and frankly, although it certainly makes sense, it can get a little ridiculous IMHO. So, to disable these nasty, scary dialogs:


(WARNING!! This will disable most of Windows Vista’s new security features):

Go to Control Panel.
Click Admin Tools.
Click System Config.
Click Tools.
"Disable UAC" - requires a reboot.

Bye, bye, fellas. This may also fix a whole slew of minor security - related issues with Access Denied messages on wwwroot folder and subfolders, and debugging with Visual Studio 2005 in ASP.NET 2.0 with IIS 7.0.

And, don't forget, you Vista Ultimate folks - IIS 7 will now offer you the ability to do what you'd expect on a "real web server" (which it is) - have multiple web sites. Just add some Class C (192.168.0.XXX) IP addresses to your stack, make a new Website in IIS, and give it an IP address. You can put the friendly name (e.g. "mysite2") into the hosts file so you can now do "http://mysite2/"

Now, you don't need to put up with that stupid restriction from Windows XP that only lets you have "one" real web site on the machine (not to mention the 10 connection limit, which you'll be pleased to note is also history).



The Final Analysis


When all the dust is settled, I just have one thing to say: Windows Vista is a solid, really awesome operating system. I like it. In fact, I kind of feel sorry for all those Anti-Microsoft, bash Windows Penguinistas - they will never have an OS as robust, easy to use, and powerful as Windows Vista. Actually, they are secretly doing what "Fred" did in the image above - although they'll never admit it, because they are total dweebs! I have nothing against Linux - I use it, primarily to do "MONO" .NET development. But when you want to compare based on speed, ease of use, ease of configuration and a whole host of other features, there is simply no comparison - Windows Vista is a clear winner. And when you start getting into this TCO - "Total Cost of Ownership" deal, the Penguinistas are gonna be left in the dust on this one. An AK-47 is no comparision with an M-16.


Einstein's Greatest Blunder Not a Boo-Boo?



In other news, the Hubble Space Telescope has shown that a mysterious form of energy first conceived by Albert Einstein, then rejected by the famous physicist as his "greatest blunder," appears to have been fueling the expansion of the universe for most of its history. Experts say the upcoming Hubble repair mission could extend our view up to 11 - 12 Billion years back, which is getting pretty close to the "beginning"? Dark matter.

11/15/2006

What's Happening in the Browser Space?

"We need to stop problems when they are small"
-- Benjamin Netanyahu, referring to the Iranian nuclear effort


I thought it would be interesting to post some stats from google analytics on current browser usage. This info comes from our eggheadcafe.com site, which tends to attract a larger percentage of Microsoft devotees, so your mileage may vary.

First, a chart of major browser usage:



As can be seen above, Internet Explorer holds 74.06% of our visitor market, with Firefox at 23.05%. The version breakdown:

IE 6.0 - 76.84%
IE 7.0 - 22.68%


Firefox 2.0 - 46%
Firefox 1.508 - 31.65%
Firefox 1.507 - 13%

According to OneStat, the November 6 statistics:

The most popular browsers on the web are:



November 2006
1. Microsoft IE 85.24%
2. Mozilla Firefox 12.15%
3. Apple Safari 1.61%
4. Opera 0.69%
5. Netscape 0.11%

One of the things that irks me is that your typical Penguinista Anti-Microsoft Firefart afficionados are always pointing out that IE is full of security holes. Well, the Bugzilla database for Firefox developers currently has over 200 open entries, some of them marked "critical". If you were a hacker, would you go after the guys with 12 percent of the market, or the guys with 85%?

I think it will be interesting to see what happens as IE7 takes hold, as well as what happens when Vista gets into circulation.

There's one bright cloud on this horizon: If I code for IE and Firefox, I can be confident of reaching about 99% of our visitor market. Less is more!

11/14/2006

Why I like Web Application Projects vs. WebSite Projects in Visual Studio 2005

Like myself, many developers found migrating Visual Studio .NET 2003 applications to the new Web site model in Visual Studio 2005 impractical, especially because precompiling (publishing) a Visual Studio 2005 Web site creates multiple assemblies. Lots of other complaints surfaced; they are too numerous to mention, but the good news is that "Mr. ASP.NET" (Scott Guthrie) and his team responded with the new Web Application Project add-in and it's vastly improved, even over the original VS.NET 2003 model. This was all in response to developer feedback (or screams of bloody murder, if you prefer) and the final came out about May of this year, just months after the initial release of Visual Studio 2005.

However, I see from forum and newsgroup posts that a significant number of developers have obviously either not yet found the Web Application Project add-in, or they aren't yet convinced of its benefits.

The new Web Application Project model is uniquely suitable when:


  • You need to migrate large Visual Studio .NET 2003 applications
  • You need to control names of output assemblies
  • You need stand-alone classes to reference page and user control classes
  • You need to build a Web application using multiple Web projects
  • You need to add pre-build and post-build steps during compilation
  • You, like me, just decided you don't particularly like the WebSite app!


Only files that are referenced in the project file are part of the project, are displayed in Solution Explorer, and are compiled during a build. Because there is a project file, some scenarios are more easily enabled:


  • You can subdivide one ASP.NET application into multiple Visual Studio projects.
    Omar Khan has put together some really good material on this in a three part "blogathon" which is, in my opinion, first-rate.
  • You can easily exclude files from the project and from source code-control.
  • You get more flexibility and control over what happens when you use the Publish option from Visual Studio.


The compilation model for Web application projects is very similar to that in Visual Studio .NET 2003:

All code-behind class files and stand-alone class files in the project are compiled into a single assembly, which is placed in the Bin folder. Because this is a single assembly, you can specify attributes such as assembly name and version, as well as the location of the output assembly.

Certain other applications scenarios are better enabled, such as the Model-View-Controller (MVC) pattern, because they allow stand-alone classes in the project to reference page and user control classes. This is one of the biggest complaints of developers with the WebSite project model - not being able to "find" their UserControls, because of the unique build and environment semantics of the APP_CODE folder.

To run and debug pages, you must build the entire Web project. However, building the entire Web application project is usually very fast, because Visual Studio employs an incremental build model that builds only the files that have changed. I've seen large projects that took upwards of a minute or more under the WebSite model compile in as little as two to three seconds under the new Web Application Project model, so having to recompile whenever you change code should rarely be an issue.

Edit and Continue only works with the built-in development server, but I rarely use it except for quick "demo" projects, so that's of no particular consequence to me.

Because all class files are compiled into a single assembly, only that assembly needs to be deployed, along with the .aspx and .ascx files and other static content files.

In this model, .aspx files are not compiled until they are run in the browser. However, when used with Web Deployment Projects (a downloadable add-in to Visual Studio 2005), the .aspx files can also be compiled and included in a single assembly for deployment.

Each time you deploy the single assembly produced in this model, you replace the code for all pages in the project. This is not only helpful to me, as I've experienced situations where all the precompiled and dynamically compiled assemblies and pages in a WebSite project can get "discombobulated" - causing some real problems, but also, you can drop a "script only" page into your app and it will work just as it did with ASP.NET 1.1 - something you cannot do with a WebSite project -- at least not one that's precompiled - and I don't know about you, but I never could get comfortable with having my "*.cs" files out there on the web server.

I've already converted most of my "stuff" to the Web Application Project model, and in my opinion (YMMV) it's made my work a lot easier - especially site maintenance.

For ASP.NET 2.0 developers who have some trepidation about migrating WebSite model projects, I would encourage you to look at the excellent set of tutorials and information that Guthrie and his team have put together.

There are also some known issues that developers should review. None of them have been problematic for me, but then again, everyone's enterprise environment is different, so it would be wise to review the list. The Web Application Project and templates are included in the Visual Studio 2005 SP1 (Service Pack) which is still in beta, but I use it.

As with most other good things in life, taking some time to RTFM will help you to avoid unnecessary questions later. After all, if somebody drives up with a new Bentley Turbo and hands you the keys, you probably want to sit up in bed and read the owner's manual, right?

11/12/2006

Usability Studies, My Butt -- and Office 2007 Installation Woes

If you have worked with Microsoft products to any degree (I have, I was actually a beta tester for Microsoft's BASIC COMPILER back in 1985 - before some current script kiddies were even born) - then you know that Microsoft (and, to be fair, many other vendors) has developed a finely - honed penchant for buzzwords and name-changing. A big ingredient of this seems to be the year (hopefully) that the software was introduced.

I think "Windows 95" was the first one, but I could be mistaken. Followed of course, by Windows 98, Windows 2000, Windows Server 2003, Office 97, Office 2000, Office 2003, and now - (gasp!) - Office 2007. Frankly, with all the issues in the last few years, I wish they'd just learn to drop the year off the names and come out with it WHEN IT'S READY.

I speak with great trepidation, since the RTM is downloading from my MSDN Subscription as I write this. It's taken a long time to get used to some of the nice features of say, Excel 2003 - features that went horribly awry in Office 2007. For example, if I wanted to chart some data, the chart icon was right there, up at the top. All I had to do is select the columns of data (holding down the CTRL key to select multiple columns), hit the chart icon, choose a chart type and bingo! Nice chart. Where is it on Office 2007? Well, I actually did find it recently - you have to choose "Insert" and then it shows up in the choices. Of course, the icon is completely different, turning what used to be a pleasure into a real learning curve and a chore. It's taken me weeks to find the drawing tools so that I can draw crummy support / resistance lines on my stock charts.

How about if you just wanted to undo something? I used to be able to just hit ALT-E-U (Alt -Edit -Undo). Dang! It's not there now. In fact, I haven't been able to find it yet, and I'm probably gonna start using this puppy tonight. All I get is this weirdo semi-transparent popup saying something like "Office Alt-Key combination started - press correct key to continue". Well of course I started an alt-key combination! What the HELL did you do to it? I want it BACK!

Soon, I'll be switching to Windows Vista. I shudder to think about it, because I know they've got new "stuff" in there and some of the "Classic" options that I probably would want simply aren't provided anymore.

This is what "usability studies" do to perfectly good software, folks. So, here's the deal. Can I send you a bill for my loss of productivity while I am re-learning what you've supposedly "improved", moving me from the familiar into the unknown? How about my psychiatrist's bill (he only speaks Portugese)?

Heh. Don't hold your breath.

N.B. Uh Oh! It installed fine on my notebook, which only had Office 2003. The upgrade was flawless. On my "main box", which had Office 2007 Beta, I got a dialog:

"Setup is unable to proceed due to the following error(s):
The 2007 Microsoft Office system does not support upgrading from a prereleased version of the 2007 Microsoft Office system.
You must first uninstall any prerelease versions.
Correct the issue(s) listed above and re-run setup."


This is after I unistalled everything from the Beta, and even used the latest version of the MSICUU.EXE utility to "cleanup" traces, and rebooted.

Here is "one" answer:

http://office.microsoft.com/en-us/products/FX101633871033.aspx

If you have Office Web Components installed (even Office 2003) you need to uninstall that first!

Well! I tried that, and I tried using the MSICUU "cleanup" utility to remove all traces of anything with "12" in its name, and it all STILL DOESN'T WORK.

And the Final Score:


Well, the last and final "culprit" was Microsoft Expression Web Designer Beta. Apparently, this uses some "Office 12 Stuff" and had to be removed. Removal wasn't easy, though - there was no Add/Remove Item for it in Control Panel. I had to stumble through the lovely MSI's in Windows\Installer by most recent date order, mousing over each until I found the 2 offenders with the right metadata descriptions.

Then, a right-click and "Uninstall" (or, MSIEXEC /x pathtopackage) and they were gone, and Office 2007 ("12") presented me with a nice "enter your product Id" dialog.
Peter, 1, Betas - ZERO! Yay. It's us against them, man, and we are gonna win!

N.B. Mark Dawson was kind enough to post a comment with a link to Jensen Harris' UI blog about the "helper" links from Office 2007. The comment system blew away the long link, so I'm adding it here:

http://blogs.msdn.com/jensenh/archive/2006/05/30/610907.aspx

11/08/2006

It Works on My Machine!


How many times have you heard this one? Or it might have been stated "It works in my Browser". It doesn't matter.


Wannabe Code Monkeys do this all the time. When you are developing code on your machine, you have certain settings and an environment that may have certain attributes or settings that will not always be the same in the target environment - the user's machine, or a webserver.

One of the newest offenses is where developers create web sites using the WebSite project model in Visual Studio 2005, using the built-in Development Web Server. There are minor inconsistencies in behavior between this ASP.NET webserver and the real IIS. In fact, if you develop on IIS in Windows XP, I bet you use an IIS application ( a VRoot that is below the actual root of the site - since Windows XP IIS only offers "one" web site), even though you are developing a full site that will usually be at the web root of an IP address on the target production server. Again, the behavior will not always be the same. You have session, cookies, settings, relative paths and more, some of which may not match up or behave exactly the same way they did on your developer machine setup. You could have a web.config file in a higher folder with HttpModule settings that cause your application to blow up because you didn't think the settings would be inherited.

One of the marks of the professional developer is to keep this in mind and perform sufficient testing - including enlisting friends or co-workers to help - in order to determine without doubt that your creation will indeed work the way you intended it to work -- in production.


I remember the first time I uploaded a web page that had image tags in it. When I looked at the page from the webserver, no images. Silly me - I had FILE:/// references in there. Of course it worked "on my machine!". Fortunately, I was still around to fix it - I hadn't left for home yet. Problem? The only place I had ever tested it from was my development machine, where all the image tags seemed to work just fine!

My point: Never "assume" that because everything works fine on your machine, that it will in deployment; test thoroughly to be sure. If it's a web application, test it from other people's machines and with different browsers / versions. And do a "Smoke Test". A smoke test is a set of steps that a user must go through which ensure that all the major functions and features of an application are working as designed. Where I come from, nothing is in "production" and "done" until it has passed a comprehensive smoke test. Above all: Stay tuned to station WDTA. When you are going to make a change to an application, always stop and ask yourself first: "What Does This Affect?".

"In Production" is the worst possible place to have to test software or web sites. Unfortunately, a significant percentage of outfits do just that. They don't have a "test" environment, they don't have a QA department, and they don't have a testing regimen. They don't know what a "smoke test" is. Contractors come and go, they push untested stuff into production, and there's nobody in control to ensure quality. This results in embarrassments and a lot of extra lost time that costs money. And if you own the company, shame on you, because you just threw some of your profits down the toilet, and you may have lost credibility with your customer(s).

Testing your "stuff" in production means that it will be your users and clients who find the boo-boo's for you. At best, that's extremely unprofessional.

Are you sure that's what you want? Test your stuff. Test it well. Sleep better.

11/07/2006

Open Source Software and the CPL

I love the concept of open source software. I've contributed to it, I use it, everybody is getting hip to it, even big folks like Microsoft, IBM, Novell, are helping.

But the one thing that gets my goat is those licenses. Good God! For something that's supposed to be free, have you ever seen so much legalese in your life? Not only that, but it seems every Joe Developer and his brother have to come up with a new one - "Common" this, GPL that.

Here's my take: The CPL (Cool Public License):


Cool Public License


This software is yours. Do whatever you want with it, call it whatever you want, use it anyway you want.
I/we have no blame for anything that happens, and you can't sue me/us. Thanks you, and G'Bye!

Now, isn't that refreshing?

11/06/2006

JLCA 3.0 - "Java Language What?"

This probably should come under the Third Base: "I dunno" category. Recently I've been playing with various kinds of content "generators" and Wikipedia came into the crosshairs. Wikipedia has a policy that you can reproduce their content, and a substantial portion of their content is actually very very good and well-researched. There are over 130 listed sites that reproduce Wikipedia content in one form or another, some giving proper attribution, and many not even bothering. Answers.com is one of the biggest, and they do a nice job of it.

The problem is, if you do a Wikipedia title search and get the results back as xml (which they offer) it has a content node filled with that God-awful Mediawiki markup. At that point you have to find a way to convert it to displayable HTML, or it's not going to look very pretty. To the best of my knowledge, nobody has written a "Wiki2HTML" parser in C#.

So, in keeping with my smart developer philosophy of "don't reinvent the wheel", I looked around for some conversion apps - any language, thank you! There are a few very good ones; in fact about the best one is actually written in client-side Javascript. Another good one in JAVA. Some in Ruby, PHP, Python, Perl. Boo, anyone? Halloween is over. But, no C#.

Now, JScript.Net is no easy task for a C# developer. Once you have script that starts using prototype and function JScript has no idea what to do with it - at least not "out of the box". So, you'd need to be a real Javascript expert - I mean GURU level expert (and I am not) to convert it.

The next thing we tried is the JAVA .java class files. Did you know that the Microsoft JAVA Language Conversion Assistant 3.0, which is built into Visual Studio 2005, will load an entire folder full of these babies and happily convert them to C#?

Yes, it will. It even does JSP. Nevermind that it makes a struct with static readonly fields as constants instead of an enum - that kind of stuff you can fix. But when you get into some of these wild-ass Visitor patterns, well --. Let me just say this: It's one thing to get the code to compile. It's a whole other ballgame to get it to WORK! And, I don't think it's so much the differences in the languages, which aren't that great. It's those dang Patterns those JAVA D00ds use! The poor conversion assistant starts recursing and ends up with it's head stuck up its butt!

I think I'll just stick with the client-side javascript and attach the output to a div tag for now!

11/04/2006

Web Application Project Issues 101: "Could Not Load Type..."

One *Extremely* common newsgroup and forum post I've seen recently revolves around "double compilation" of stuff that was left in the APP_CODE folder when a project is migrated from WebSite mode to Web Application Project. For starters, I'll quote directly from "Mr. ASP.NET" Scott Guthrie's blog tutorial:

"VERY, VERY IMPORTANT: Because ASP.NET 2.0 tries to dynamically compile any classes it finds under the /App_Code directory of an application at runtime, you explictly *DO NOT* want to store classes that you compile as part of your VS 2005 Web Application Project under an "app_code" folder. If you do this, then the class will get compiled twice -- once as part of the VS 2005 Web Application Project assembly, and then again at runtime by ASP.NET. The result will most likely be a "could not load type" runtime exception -- caused because you have duplicate type names in your application. Instead, you should store your class files in any other directory of your project other than one named "app_code". This will be handled automatically by the "Convert to Web Application" command. This command will rename the folder Old_App_Code."

This should be very clear, but apparently (as one would expect) a lot of developers don't take the time to read the tutorials that kind Mr. Guthrie has literally toiled over for your benefit! I should mention as a footnote that you need to choose the context menu item "Convert to Web Application Project" at the PROJECT level in your Solution Explorer node in order for this to occur.

There's another little "gotcha" that I bet you have run into, and there's a fix for that too, if you just take the time to "RTFM":

VS 2005 Web Application Projects don't automatically support generating a strongly-typed Profile class proxy. However, you can use this free download to automatically keep your own proxy class in sync with the profile configuration. Now, I'll be the first to admit that this little guy can be very tricky in getting "Profile.Common" to come alive, but once you understand what it is doing, you'll have taken the first step to "Conversion"!

Moral of the story: Not to sound like a broken MP3, but "Read the Manual" (in this case, the nice tutorials!). Or, phrased another way: There are two kinds of professional developers in the world: Those that take the time to read the manual, -- and those that take the time to read the manual.


There is no other way. More later.

11/02/2006

More "Patent Parking" Extortion Slimeballs

Back in 1994, Richard Snyder, chairman and CEO of Forgent, said, "Forgent is committed to developing all of its assets and technologies to maximize shareholder value. We believe we will prevail in this litigation, as the '672 Patent is valid, enforceable and infringed."

In 2001, Forgent retained Jenkens & Gilchrist, a national law firm, to assist Forgent in protecting its intellectual property from infringement through licensing and, if necessary, litigation, including those claimed in U.S. Patent No. 4,698,672 (the '672 Patent). On October 27, 2004 Forgent formally terminated its relationship with Jenkens & Gilchrest and retained Godwin Gruber to advise it in connection with the patent licensing program.

Essentially what this company did was to embark on a professional extortion program with it's various patents, attempting to get revenues that way, since nothing else they
were doing was making any money for the shareholders.

The defendants identified in the Forgent lawsuit read like a Who's Who in Technology. Named defendants include Adobe Systems, Agfa, Apple Computer, Axis Communications, Canon USA, Concord Camera, Creative Labs, Dell, Eastman Kodak, Fuji Photo Film, Fujitsu Computer, Gateway, Hewlett-Packard (NYSE: HPQ) , IBM (NYSE: IBM) , JASC Software, JVC, Kyocera, Macromedia, Matsushita, PalmOne, Panasonic, Ricoh, Broderbund, Savin, Thomson S.A., Toshiba and Xerox.

The claim to the JPEG standard has long been a bone of contention with the Joint Photographic Experts Group committee, which has worked to create standards related to the JPEG file format since it was devised in 1986.

When Forgent first staked its claim to JPEG compression technology, the JPEG committee denounced attempts to derive fees from the standard and expressed disappointment at Forgent's attempts to do so.

Today Forgent said it will receive $8 million to settle lawsuits against Microsoft and two dozen other companies over claims its patent covered the main technology for digital-image compression on computers. For patent parking, that's small change. Eolas won something like $500 million for its little extortion scheme, forciing Microsoft and others to jump through hoops to make browsers comply, and making a lot of consumers (including me) very, very mad.

The company's ability to get more money from the patent is "substantially concluded," Forgent said in a regulatory filing Monday.

In June, U.S. District Judge Jeremy Fogel in San Jose, Calif., sided with computer companies in ruling Forgent's patent covers only video compression, not the still-data compression standard known as JPEG. The company had collected more than $100 million in settlements before Fogel's ruling, making up almost all of its revenue for the past five years.

Thankfully, it looks like they are now out of the extortion business for a while.

I've written about this abominable practice of what I call "Patent Parking" before -- companies who sit on various patents, never developing any products with them, only using them as legal fodder to extort huge sums from other organizations that do. These slime are no better than the small-time Mafioso who extorted payola from the shopkeepers in Brooklyn so that "nothin' bad will happen to yer store". The only difference is that these scum are doing it with public shareholder money in the public arena, taking advantage of a Patent & Trademark Office that doesn't have the resources to supervise correctly in the marketplace.

N.B. I recently noticed that good friend (and developer extraordinaire) Brent Ashley had his original "JSRS" (Javascript Remote Scripting) technique, which I consider to be the "true father" of AJAX Remote Scripting, "lifted" by some outfit that essentially immorally stole his open-source code and proceeded to obtain a patent on it. Will the horrors never end? Brent, I'd be pissed too. They have no couth. Don't kid yourself. This "Patent extortion" scheme is becoming big business, and its a reality. (my other post about this)


FTC Nails Spyware Vendors

In other news, the FTC nailed 180 Solutions and came out with the first real definition of "Express Consent" for downloading on the part of the consumer:

“Express consent” shall mean that, prior to downloading or installing any software program or application to consumers’ computers: (a) Respondents clearly and prominently disclose the material terms of such software program or application prior to the display of, and separate from, any final End User License Agreement; and (b) consumers indicate assent to download or install such software program or application by clicking on a button that is labeled to convey that it will activate the download or installation, or by taking a substantially similar action.

This is probably the most important part of the CONSENT decree, since it sends a very clear message to the rest of the spyware slimeballs what standards the FTC intends to use. Good Riddance, WebTards!