12/31/2007

Windows Server 2008 x64: Could not load file or assembly Microsoft.SqlServer.BatchParser...

The best minds are not in government. If any were, business would hire them away. - Ronald Reagan

I was working with a partner on testing his MSI Installer for various operating systems, and on Windows Server 2008 x64 it was continuing to come up with this error:

Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. (Microsoft.SqlServer.ConnectionInfo)

I checked the signature of the local assembly in the installation folder against the one in the GAC, and they were identical. So, go figure, right?

It turns out that the solution is very simple: Unless you've installed the 64-bit verion of SQL Server 2005, you need to install the 64-bit version of SMO. It's not there by default.

If it is not installed ,you can download the 64 bit version from http://download.microsoft.com/download/4/4/D/44DBDE61-B385-4FC2-A67D-48053B8F9FAD/SQLServer2005_XMO_x64.msi and try again after installing it.

After the 64-bit SMO installation, the product installed perfectly.

12/28/2007

DotNetNuke: Ready for Prime Time?

"The delivery boys have been displaced by Comcast and AT&T and Google and Yahoo, and there's no way newspapers will ever reclaim that role." -- Justin Fox, Time

Our group at work needs desperately to have a CMS that is easy to work with for various clients -- especially clients that need to be able to "edit" their own corporate web sites. Basically, we needed to have a CMS with which we could just "plug in" a customizable pre-made CSS XHTML "skin" for a particular industry, and customize it to the client's desires.

So, we all went out and started researching various offerings. Sharepoint was eliminated, it is simply too "high end" and expensive for what we need to be able to do. We looked at Joomla and Drupal, both had their plusses and minuses, but mainly they're interpreted PHP and though we've got PHP people, most of us are hard - core .NET developers. We looked at Umbraco, Rainbow, MojoPortal, Cuyahoga, and others.

It ends up that we settled on -- gasp -- DotNetNuke! I looked at DotNetNuke a couple of years ago and besides my acquired aversion to anything not written in C#, it just looked like there was "too much baggage".

However, the current release (4.8) is very smooth, and I hasten to add that if you look at the project properties, Shaun Walker has Option Explicit and Option Strict both set to "on" - a very good sign. But the things we liked the most:

1) It installs very easily. Basically, if you create a SQL Server database and update the connection string settings, and run the web project, the wizard gets you up and running in no time. And you get a real site with real content that you can start playing with, no B.S. -- and no excuses! The 4.8 source release built perfectly under Visual Studio 2008 with no missing files or errors.

2) It is very extensible. There is not only a big "skin" community of free and "for pay" XHTML - compliant CSS Web site skins, it is easy to learn to create your own. I looked at the one that Lee Sykes did of Andreas Viklund's "Andreas01" and once you peruse the component files it really isn't a big deal at all to do one on your own. Moreover, with the C# Template for Modules from "BiteTheBullet", you can start authoring custom modules pretty fast. This .vsi installer also works with Visual Studio 2008, and it gives you all the possible component files you need to write any kind of module. You can also go into the zip file that gets installed in your C:\Users\<username>\Documents\Visual Studio XXX\Templates\ProjectTemplates\Visual C# folder, and modify the contents, re-zip it, and overwrite the original zip if you know what you are doing. The C# template appears as a project type in "Add New Project". A module is basically a class library with one or more ASCX user controls, along with some metadata files, that can be installed into DNN via the Host or Admin control menu, and it can pretty much provide any kind of functionality you want - RSS, forums, news, whatever.

Holy Cow, Batman! Once I saw that I could write DNN Modules in C# and would never have to type that awful keyword "Dim" again, I felt -- well, relieved!

The whole DNN infrastructure runs on a provider model and once you "get it" you can do any kind of extensibility you want. But the main thing is that once you have DNN under your belt you can use it to provide custom editable web sites for just about any kind of client. You can give them page and functionality templates to choose from, and they can add whatever they need by themselves (after a short learning curve) without having to bother you or pay you extra money. I like that, because I really hate hand-holding; I like to do development. Once something is debugged, tested and delivered -- if I've done my job right -- I shouldn't ever have to hear from the client unless they have a new project for me.

DotNetNuke has a huge developer community and sports some very nifty caching and other options that have been added in the 4.XX versions that speed it up and make it a much better performer than the old DNN that I looked at a couple of years ago. Recommended. Also, the "My Web Pages Starter Kit" mentioned by oarfish in the comments is a good (and much simpler) alternative.

12/21/2007

Getting rid of Visual Studio 2005 - And a Poll

At work, our .NET development group more or less unanimously made the decision that now that Visual Studio 2008 is RTM, it is time to think about getting everything we do upgraded to the point where we simply don't need Visual Studio 2005 any longer.

The only real issue we could find is that Compact Framework 2003 projects are no longer supported. Since we don't happen to have any, that takes care of that, doesn't it?

So we decided that any existing projects would be migrated upwards to Visual Studio 2008. Everything in Team System is getting upgraded; if it doesn't support Visual Studio 2008, we'll let VS 2008 convert it and check all the revised stuff back in.

Since 2008 solutions / projects can be set to target specific runtimes you will find that this is pretty much a no-brainer. If your stuff is .NET Framework 2.0 compliant, all you need to do is ensure that the target Framework is set and you can check your stuff in with a Visual Studio 2008 Solution file and all the project files and class files should be fine. As a "failsafe", you could always first make a copy of the VS2005 .sln file and rename it to include "2005", and check that in as well.


The Next Step

Once this is all done, the next step is to get rid of Visual Studio 2005 on your machine - along with all related installations. This isn't rocket science -- you just need to go into Control Panel / Programs And Features, and uninstall anything with "2005" in the name. Here is a sample list you can use as a guide:

  • Team Suite

  • SDK

  • Toolbox Controls Installer

  • Project Aggregator 2

  • Visual J# 2.0 Redistributable Package

  • MSDN Library for Visual Studio 2005

  • --anything with an Install Date prior to what you installed with Visual Studio 2008

Once this is done, you will most likely find that anytime you click on a .sln file that Visual Studio 2008 will come up with the "Welcome to Visual Studio .NET Conversion Wizard" wizard UI and you can convert your solution or project with no problems. You will see a dialog referring to the Framework version:

This is asking if you want to have your project upgraded to reference the .NET Framework 3.5. If you do not have 3.5 specific code in the project, it is best to chooose "No". This will make it easier if you ever have to downgrade a solution file to Visual Studio 2005. Otherwise, I have yet to see a solution / project that fails to convert and build properly.


The Bottom Line

Visual Studio 2008 is here; there is rarely a reason to keep Visual Studio 2005 around any longer. Free up the disk space and get with the program! There is only one issue and a commenter mentioned it: no direct support for classic ASP debugging any longer. Gregg Miskelly's blog explains:

http://blogs.msdn.com/greggm/archive/2006/03/15/552108.aspx

As a last note, don't look for Visual J# in Visual Studio 2008. It's gone. History, man!

Oh, and take the poll just below!



12/20/2007

Visual Studio: Difference between Build and Rebuild

Believe it or not, I was never sure about this until this morning when another dev and I were discussing it. So, I searched the web and found the answer:

Build means compile and link only the source files that have changed since the last build, while Rebuild means compile and link all source files regardless of whether they changed or not. Build is the normal thing to do and is faster. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean.

Build or Rebuild Solution builds or rebuilds all projects in the your solution, while Build or Rebuild <project name> builds or rebuilds the StartUp project. To set the StartUp project, right click on the desired project name in the Solution Explorer tab and select Set as StartUp project. The project name now appears in bold.

Compile just compiles the source file currently being edited. Useful to quickly check for errors when the rest of your source files are in an incomplete state that would prevent a successful build of the entire project. Ctrl-F7 is the shortcut key for Compile. (I just used this today with DotNetNuke - apparently the devs left out a codebehind class file on the EditAddress ASCX control for the WebStore. I simply excluded the control and it all built just fine. I'll worry about the Address thingy later [it was in C# BTW]).

  • All source files that have changed are saved when you request a build/rebuild, so you don't have to save them first.
  • When you run your executable (F5 or Ctrl-F5), Visual Studio saves all your changed source files and builds anything that changed, so you don't need to explicitly do those steps every time. This allows for quick "trial and error" debugging.

Incidentally, if you like those little Visual Studio keyboard shortcuts, you can download posters of the C# and the VB.Net ones, respectively:

C#:

http://www.microsoft.com/downloads/details.aspx?FamilyID=c15d210d-a926-46a8-a586-31f8a2e576fe&DisplayLang=en

VB.NET:

http://www.microsoft.com/downloads/details.aspx?FamilyID=6bb41456-9378-4746-b502-b4c5f7182203&DisplayLang=en

12/19/2007

Internet Explorer 8.0 to pass Acid 2 Test

With Beta 1 targeted for first half 2008, the folks at Microsoft are now saying that as of last week, IE8 reached a core milestone: IE8 in standards mode now correctly renders the “Acid2 Browser Test”. Acid2 is a test that determines how well a browser works with several different web standards. I posted about this earlier, mentioning that not even the current edition of Firefox handles the acid2 test correctly. Of course I was quickly reminded by commenters that it did a much better job than IE7, and that's true.

But the best news (besides the obvious fact that Microsoft embraces and sees the need for standards) is that they are going to do it in a way that doesn't "break" existing pages written for IE5 or IE6, or for the standards mode of other browser brands:
Modern browsers typically have two modes to render web pages, “quirks” and “standards.” MS says their experience with releasing IE7 taught them that many web sites today expect the browser to have IE6-compatible behavior. They say that with IE8 they have a "deep obligation" to interoperability and compatibility with existing web sites, and this has led them to add an additional mode to enable supporting industry standards even better.

So, developers can now write sites based on standards, insert a flag that tells IE to render in IE8 standards mode, and IE will then switch its rendering engine to use this new mode. This allows pre-existing sites to continue to work, and developers can opt-in to the new rendering engine on their own schedule. (Of course I should hasten to add that if all the players were with standards from the git-go, there wouldn't be a need for any of this BS).

For compatibility purposes IE8’s rendering engine defaults to “quirks” or “standards” mode. Site developers will need to insert a new opt-in flag to request the page to render using “IE8 standards mode.”

Overall, I'd say that this is pretty good news. I might even sign up for the beta. Now I just have one question:

When I visit a site that has embedded Flash or other video, is IE 8.0 still going to grey-screen on me and go straight down the potty, forcing me to use Firefox, or are you guys planning on fixing it?

12/10/2007

The ASP.NET 3.5 Extensions Preview --MVC, Entity Framework, ADO.NET Data Services +

"If I Dispose the Car, will my delegate references be garage collected?" -- newsgroup poster

This provides new functionality to ASP.NET 3.5 and ADO.NET in 2008. The new features target MVC, Entity Framework, ADO.NET Data Services and dynamic data Supporting Test Driven Development - including a powerful and extensible MVC framework. Creating the best server for Rich Clients - including Ajax history support and Silverlight controls for ASP.NET.

The Readme is here. The download of ASP.NET 3.5 Extensions Preview is here. I did some early work with the Entity Framework and liked what I saw.

Don't you just love those little installer messages, "The installation is taking longer than expected . . ."?

And More Cool Stuff

A couple of other items you might be interested in (at least, that I am interested in):

1) The FeedSync API. Formerly Ray Ozzie's "Simple Sharing Extensions". The easiest way to get into this is to download and play with the codeplex sample.

Applications for this? OK, how about an app or plug-in that will synchronize either all your Favorites or all your Feed subscriptions in either Internet Explorer or Firefox, from any machine you use, anywhere, so that all machines can be completely synced with each other? Somebody's already started on something similar (also on codeplex.com) although it doesn't use the FeedSync API.

2) The Microsoft Sync Framework - which is a much more sophisticated ADO.NET extension framework to do P2P sychronization of virtually anything.

There is downloadable documentation, a developer center, and even a forum group on this stuff, so don't be lazy about the old RTFM dealie. (HINT: for Sync Framework, you'll need both SyncSetup_x86.exe and SyncServicesADO_x86.msi to install the "whole banana". The BOL CHM help file isn't much use as it's prerelease and nothing is "filled in".)

Link of the Day

And now I leave you with the Stupid Filter - an idea whose time has come!

And for those who understand programming and jazz, I offer Chet Baker.


We miss you, Chet!

12/05/2007

Umm, Did you search first?

"There is no shame in stating the obvious, as it may not actually be obvious to others." -- Me

Newsgroups and forums are littered with well-intentioned but often moronic posts asking questions that could be easily answered - in a majority of cases - by simply typing the relevant search term into the Google search textbox and pressing the "SEARCH" button.

Often these same posts are cluttered with replies from equally lazy people who offer opinions, advice and such --and who have not bothered to search either!

A case in point: User posts a somewhat sarcastic item asking if there is an easy way to use Oracle for Session state, intimating that "not everybody uses SQL server". There are three replies, all of them more or less useless, because they didn't offer a real answer - which could easily have been determined with a 30 second search!

So I did the search:

http://www.google.com/search?q=ASP.NET+ORACLE+Session+provider

Not exactly rocket science! And right at the top of the list of results:

http://www.oracle.com/technology/tech/dotnet/aspnet/index.html

-- the Oracle ASP.NET providers, ready to download.

Meanwhile, our user who didn't think has probably waited hours to get an answer. I was kind enough to reply and post the link, but I also advised that he/she could easily have done the search themselves. It also helps to study the "google cheat sheet" to learn the various operators.

In my short happy life as a .NET software developer, I often will search for several hours accumulating sample code and ideas -- before I ever write a single line of code on a new project. But- you have to be a good searcher; you need to "think like a search engine".

Now, if you have searched and you've really tried, but still can't find an answer, then yes of course you should make a post and ask for help. And when you do post, include enough details in your original post so that people answering the thread don't get sent off on a wild goose chase only to find out 10 posts later that you didn't include important information in your original post! You see this all the time - people are genuinely trying to help, and then finally the O.P. (original poster) supplies some important qualifying fact that they should have stated in the very beginning -- which totally changes the playing field.

The old Chinese proverb about "teaching a man to fish" holds here. Learn to search effectively for answers to your problems. You will thank me later!

Link of the Day - Microsoft Webmaster Central

Microsoft has rolled out a beta of their version of "Google Webmaster Pages" and you can try it out here. You'll need to upload a small site verification Xml file they give you to activate it. You can also ping Live.com when your sitemap.xml file is updated:

http://webmaster.live.com/ping.aspx?siteMap=http://yourdomain.com/sitemap.xml

I am hoping - just hoping - that these new features will somehow help Microsoft to better index my sites...

Finally, if you've never seen the incredible technology behind how Google provides relevant search results so quickly, they have a page here that describes it.

12/02/2007

Google PageRank Crash of 2007 Confirmed

When a thing is funny, search it carefully for a hidden truth. -- George Bernard Shaw

Not long ago I wrote about what I call the "PageRank Crash of 2007" where legions of very big blogging-related sites and commercial ventures -- Washingtonpost.com, Forbes.com, Engadget.com and SFGate.com noticed a downgrading in their PageRank. I also proclaimed, "Now, this is big - you may not grok it right away, but it's going to change the entire complexion of the web, and pretty quick, too. Hopefully, for the better..."

Confirmation comes via posts on Google's official WebMaster blog by Matt Cutts (as well as on his personal blog):

"If, however, a webmaster chooses to buy or sell links for the purpose of manipulating search engine rankings, we reserve the right to protect the quality of our index. Buying or selling links that pass PageRank violates our webmaster guidelines."

In fact, Cutts points out that as early as Feb 2003 Google stated "Don't participate in link schemes designed to increase your site's ranking or PageRank".

In other words, they've been warning about this for the equivalent of centuries in Internet Time.

So what's the skinny?

The bottom line of all this is that you can now expect to get more relevant search results, a good thing. The other part of the equation is that, like consumers buying real estate with sub-prime 100% financing oblivious to the inevitable impending bust (which we are now in), hundreds -- probably thousands -- of "link buying" sites that promoted schemes involving the purchase of Google "link juice" and enhancement of PageRank thereby, are now effectively out of business. Come to think of it, the environment did kind of smack of an impending "bubble", didn't it?

What will happen now?

What is already happening is that -- just like the inevitable return to sanity we'll see once the real estate / credit debacle is over, we are now seeing a return to sanity on the web. That's a good thing, because bloggers and site owners are starting to realize once again that it is quality content that is Search Engine Optimized which will once again be king. Google reminds me of Paul Volker, Fed Chairman in the late 70's -- the cigar - smoking central banker who had the guts to put both feet on the brakes and keep them there until inflation wound down and the yield curve returned to normal. It was painful, yes. But it had to be done.


I wonder how long it will take until the "Web Curve" normalizes...

11/29/2007

Warning!: blockdelete.com- Protect Your Ass!

Those nasty spammers have apparently reappeared, using a private domain registration through GoDaddy.

What they do is capture your Windows Live Messenger credentials under the ruse that they will show you all your blocked contacts (which is easy enough to do yourself with libraries like DotMsn - without the security risks).

What they don't tell you is that if you do this, your account is now compromised -- and they'll send every one of your contacts a message (since it's your credentials, it appears from you, a trusted contact) that tells you to go visit their site and sucker for it too. There's only one solution if you suckered for it - you have to change your Live.com password immediately.

Just look at this:

"The longly[sic] awaited feature for MSN Messenger, completely for free[sic]!"

When you click on their Privacy page link, you get nada! What a scam. Unfortunately, from reading the newsgroup and forum posts, it appears that thousands of people are getting suckered for this social engineering scam from these total scumbags.

I'm seriously considering complaining to Google about this, because the bastards have a Google Adsense ad at the bottom of their page. Clearly a violation of Google's TOS. If enough people complain, Google will ban them and they'll have no financial incentive any longer. Incidentally, Google has recently begun actually soliciting reports of "bad" web sites. The form to do it is here. You can also visit Stop Badware, a consumer protection site sponsored by Google and other major firms.

We live in a dangerous world. Even cyberspace is dangerous. Protect Your Ass.

Getting the right client-side ID for ASP.NET Controls

This is really simple stuff, but judging by the number of forum and newsgroup posts I've seen asking the same question over and over again, it may not be very obvious to many newer developers: The ASP.NET infrastructure "mangles" control ID's based on the container hierarchy they are in. So for example if you have a Master Page and a Page that uses it, and you put a TextBox "TextBox1" on it, that's not what you'll get at the client side in the browser. So any javascript you write that is looking for "TextBox1" will fail. Here's the correct way to ensure that your script won't fail:

11/27/2007

The Top Nine Social Networking Sites

Q: Who was the pitcher to pitch the only perfect game in the World Series?
A: Don Larsen, October 8, 1956, as the New York Yankees beat the Brooklyn Dodgers, 2-0.

I've seen a few compilations on this subject, but the methodology in some cases seemed either flawed or not objective enough (surprise), so I though it would be useful to conduct my own research piece. If you take the "authority" approach on this, it makes it a lot easier to rank these various sites and eliminate the vast majority since they simply aren't strong enough to appear on the radar.

Basically I got lists of networking sites and did a Google PageRank on all of them. Everything below PageRank 7 was thrown away. That narrowed down the field to 9 sites (boy, that part was easy!). Then, I got the Quantcast.com visitor counts and the Compete.com visitor counts. Then I compiled a composite number of inlinks for each site. Finally, I got the Alexa rank for each.

What I did then was to try and come up with a "fair is fair" composite number that indicated the authority and value of each site. I added the inlinks, the Quantcast, and the Compete totals. This was then divided by the Alexa rank (divide, because the lower the Alexa number, the stronger the site). Then the computed result was multiplied by the PageRank to get a final "score".

One could certainly make the case that using Google PageRank to eliminate contenders has its flaws, but since Google drives up to 90% of search traffic, and since the SERPS (search engine results position) of what you're searching for is so much determined by PageRank, I felt it was, at the least, an educated starting point.

As can be seen in the table below, digg.com is the clear leader, with del.icio.us running a close second place. Technorati is actually a much stronger contender than I thought it would be. And, for example, while Slashdot sports a PageRank 9, its composite number just doesn't add up to make it even into the top 5.

Now, you may ask, "How can this help me"? Well, from an SEO standpoint, these top 9 sites represent the vast majority of "link juice" you can get. So if you focus on submitting and getting your "Stuff" - your articles, your site, your blog -- into these 9 and forget about the others, you are going to make your SEO optimization job one heck of a lot easier. You'll get a lot more "bang for the buck". Also, it makes it much easier to track where your referrer traffic is coming from.

In fact, I like this "short list" so much that I've put together another one of those "Social Link This" apps, a link to which you can find at the bottom left of each post on this UnBlog. There's a javascript "bookmarklet" for it that you can drag to Bookmarks or Add to Favorites. Using the page or the bookmarklet from your browser, you can submit your blog post, article or site to all nine of these top contenders in less than five minutes and get some serious link juice!

I present the sorted result for your viewing pleasure:

SITEINLINKSCOMPETEQUANTALEXAPRSCORE
digg.com11779608316964445870000098811711064
del.icio.us1715930511699128130000024885632006
Technorati.com753064373231709140000021682960672
StumbleUpon.com1905017713135866952393008561573
Bloglines.com507179483826631037118539540257
Netscape.com2158160048552328180175559441971
reddit.com4530757712264673443838527385151
Slashdot.org135550357244242698845799226156
Furl.net49595144148975575474112896890

11/25/2007

Visual Studio 2008 Solution / Project File Conversions And Tricks

"Always do sober what you said you'd do drunk. That will teach you to keep your mouth shut"
-- Ernest Hemingway

One thing I've learned to do pretty quickly with VIsual Studio 2008 is to make a backup of the original Visual Studio 2005 .soln and .csproj files and store them in a little .rar or .zip file in the Solution folder. This makes it easy to "go back to the future" as long as your work doesn't include namespaces that don't exist for VS 2005. Yes, I know you can choose to make a backup during the conversion. I'd just rather be safe.

I also learned that the conversion process when you load a 2005 Solution and go through the conversion wizard can be quite slow. Here's a neat way to speed it up. Devenv.exe has a /convert flag. So, make a little batch file that looks like this, and save it in your Solution / project folder:

"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe /convert" %1

To run this, drop into a Command prompt in your solution folder, then type convert mysolutionname.sln or convert myprojectname.csproj

This command line conversion process is humongously faster. When I say "humongously" - I mean it is WAY FASTER!

The differences between .sln files in the two Visual Studio versions are not that great. Same with project files - anything that goes wrong can usually be fixed "by hand".

Hopefully, somebody will come out with a little back-and-forth conversion utility that will retarget a converted to 2008 solution and project files back to 2005.

I'm not gonna write it, but I know somebody will - soon!

BTW, if you are having any installation issues regarding Visual Studio 2008, here is the forum to visit!

Link of the Day:

If you create code-comment documentation (and you certainly should!) then you can't live without Roland Weigelt's GhostDoc. The Visual Studio 2008 Add in is ready. Roland used some of my code (with my happy permission) in an earlier release.

Google Suggest on your Google Home Page:

Google has an experimental page that let's you set your search textbox to display Google-Suggest like matches when you type in a search. Great for SEO keyword suggestions!

11/23/2007

419 Redux: Scamming the Scammer

Recently I've noticed a significant increase in the number of 419 scam emails that land in my junk mail folder before I clean it out daily - and occasionally a few don't even get dumped into the junk mail folder - they end up directly in the inbox!   Most of us already have learned to trash this utter bullshit, but it's a numbers game. The scammers know that if they send out 50,000 of these at a time (and believe you me, that's exactly what they do) -- that some poor uninitiated soul will respond, not knowing any better. And unwitting respondees do lose real money to these scumbags. As an old commodities trader once advised me as a rookie broker - "There are only two factors that control the market - fear, and greed" - and these scammers are finely honed experts at working the greed factor.

For those who aren't totally familiar with the iterations of this scam, it operates as follows: the target receives an unsolicited fax, email, or letter often concerning Nigeria or another African nation containing either a money laundering or other illegal proposal OR you may receive a Legal and Legitimate business proposal by normal means. Common variations on the Scam include "overinvoiced" or "double invoiced" oil or other supply and service contracts where your Bad Guys want to get the overage out of Nigeria (that's the Classic 419); crude oil and other commodity deals (a form of Goods and Services 419); a "bequest" left you in a will (Will Scam 419, e.g. the bank depositor died in a horrible plane crash - complete with links to the CNN.com article); "money cleaning" where your Bad Guy has a lot of currency that needs to be "chemically cleaned" before it can be used and he needs the cost of the chemicals (Black Currency 419) ; "spoof banks" where there is supposedly money in your name already on deposit; "paying" for a purchase with a check larger than the amount required and asking for change to be advanced (cashier's check and money order 419); fake lottery 419; chat room and romance 419 (usually coupled with one of the other forms of 419); employment 419 (including secret shopper 419) ; and ordering items and commodities off "trading" and "auction" sites on the web and then cheating the seller. The variations of Advance Fee Fraud (419) are very creative and virtually endless - the above is only a brief summary of possibilities.

.NEXT Web Security Services has a flow chart of how these deals pan out. At a minimum, it should be worthwhile web browsing.

The 419eater is a vigilante group that deliberately targets and foils the scammers. Just reading about what they do will warm your heart and give you some good chuckles. They are for real; you might consider giving them a small donation if you aren't inclined to become a professional scam - baiter.

Happy Thanksgiving Weekend, and don't be a Turkey.

11/21/2007

New .NET Service Packs Available

Microsoft .NET Framework 2.0 Service Pack 1 (x86):
http://www.microsoft.com/downloads/details.aspx?FamilyID=79bc3b77-e02c-4ad3-aacf-a7633f706ba5&DisplayLang=en

Microsoft .NET Framework 2.0 Service Pack 1 (x64):
http://www.microsoft.com/downloads/details.aspx?FamilyID=029196ed-04eb-471e-8a99-3c61d19a4c5a&DisplayLang=en

Note that the 2.0 Service Pack is actually a full Framework install. If you uninstall .NET 2.0 SP1 (even if you had .NET 2.0 installed beforehand) the whole .NET Framework is removed.
It does NOT revert you back to .NET 2.0 RTM.

Microsoft .NET Framework 3.0 Service Pack 1:
http://www.microsoft.com/downloads/details.aspx?FamilyID=ec2ca85d-b255-4425-9e65-1e88a0bdb72a&DisplayLang=en

When you install the .NET Framework 3.5, these service packs are required prerequisites and are installed automatically; these are available as separate downloads for those who aren't ready to deploy .NET Framework 3.5.

If you are installing Visual Studio 2008, you don't need to worry about the above.

Incidentally, if you want to keep up with Microsoft Downloads, this search page is a good way to do it:

http://www.microsoft.com/downloads/Results.aspx?displaylang=en&startDate=10/22/2007&period=30&nr=50

Note the "startdate" and "nr" in the querystring. I haven't found an RSS feed for this but it sure would be useful.

Links of the Day:

Temporarily Block Popups in IE 7.0 for downloading:

http://www.pluralsight.com/blogs/craig/archive/2007/11/21/49253.aspx

The trick is to hold down CTRL and ALT while clicking the link.

Grasshopper enables you to produce .NET Web and server applications that run on Linux & other Java-enabled platforms using ASP.NET 2.0 controls, role-based security, and C# generics.

Quick PageRank Bookmarklet: Add this to Favorites to get quick Google PageRank of any page you are on:



Quick PR Bookmarklet

11/16/2007

Visual Studio 2008 RTM - and Holiday Chili Recipe

"The kind of pictures they're making today, I'll stick with toilet paper" -- Dick Wilson (Mr. Whipple, R.I.P.)

Well, it's Monday AM Nov 19th and the good news is that VS 2008 RTM is available for download by MSDN subscribers. The bad news is that the traffic jam has long since started, so it's not likely too many people will be able to get their copy today. (Oops - spoke too soon, just got an FTM going at 8:50 AM)!

Also available is the Visual Studio 2008 and .NET Framework 3.5 Training kit. http://go.microsoft.com/?linkid=7602397 (120MB). This includes presentations, hands-on labs and demos -- and is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including LINQ, C# 3.0, Visual Basic 9, WCF, WF, WPF, ASP.NET AJAX, VSTO, CardSpace, SilverLight, Mobile and Application Lifecycle Management.

There are some very specific instructions on what to do if you have pre-release versions of VS or any related programs:

--------------------------------------------------------------------------------------------

For best results, Visual Studio 2008 should be installed on a computer with no pre-release (Tech Preview, Beta, or CTP) versions of Visual Studio 2008/Codename Orcas, or supporting components.
If your computer has any of the pre-release (Tech Preview, Beta, or CTP) versions on it, they must be removed in the correct order BEFORE you begin installing the release version. This process is not officially supported. It is recommended that you run uninstall of the main product first (Microsoft Visual Studio 2008/Codename Orcas). In most cases this will remove majority of other optional pre-release components installed with it.
Go to the Control Panel and launch Add/Remove Programs
Remove all instances of Visual Studio 2008/Codename Orcas products
Remove any remaining supporting products in the specified order.
Remove "MSDN Library for Visual Studio 2008 Beta"
Remove "Microsoft SQL Server Compact Edition 3.5"
Remove "Microsoft SQL Server Compact Edition 3.5 Design Tools"
Remove "Microsoft SQL Server Compact Edition 3.5 for Devices"
Remove "Microsoft Visual Studio Performance Collection Tools"
Remove "Windows Mobile 5.0 SDK R2 for Pocket PC"
Remove "Windows Mobile 5.0 SDK R2 for Smartphone"
Remove "Crystal Reports 2007"
Remove "Visual Studio Asset System"
Remove "Microsoft Visual Studio Web Authoring Component / Microsoft Web Designer Tools"
Remove "Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime"
Remove "Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime Language Pack" (non-English editions only)
Remove "Microsoft Visual Studio Tools for Office Runtime 3.0"
Remove "Microsoft Document Explorer"
Remove "Microsoft Document Explorer 2005 Language Pack" (non-English editions only)
Remove "Microsoft Device Emulator 3.0"
Remove "Microsoft .NET Compact Framework 3.5"
Remove "Microsoft .NET Compact Framework 2.0 SP1"
Remove ".NET Framework 2.0 SDK"
Remove "Microsoft Visual Studio Codename Orcas Remote Debugger"
Remove "Microsoft Visual Studio 64bit Prerequisites Beta" (64-bit platforms only)
Remove "Microsoft .NET Framework 3.5"
Install the Visual Studio 2008 edition you wish to use

--------------------------------------------------------------------------------------

So, the best advice is always "RTFM". Don't complain if you didn't! You also need to "use your noodle" with these instructions- for example, one item in the above list says "Microsoft .NET Compact Framework SP1". If you have "SP2" - you still need to uninstall it!

NOTE: Visual Studio 2008 Solution (.sln) files are NOT backward-compatible with VS 2005 Solution files, but the project (e.g. .csproj) files are compatible. So if you need to be able to work on Solutions that you've migrated up to Visual Studio 2008 in Visual Studio 2005, all you should need to do is save a copy of the original Visual Studio 2005 .sln file, say as "mySolution2005.sln". You will have two Solution files, one for 2005, and one for 2008. As long as your solution doesn't use .NET 3.5 namespaces that aren't present in 2005, you should be "good to go". Jon Skeet has an excellent post that explores this in it's various iterations. His conclusions:

  • It's possible to share project files but not solution files between VS2005 and VS2008.
  • If you upgrade a solution file by mistake, it's very easy to fix it by hand.
  • If you decide to maintain different solution files, if there are big changes in one it may be easiest to just make them in one solution, then upgrade again.
  • Creating a project in VS2005 and then importing it into VS2008 is seamless; the other way round has slight issues which are fixable by hand.
  • I don't know of a way of forcing VS2008 to only use C# 2 while at the same time maintaining VS2005 compatibility.

NOTE2: During installation, some users may see dialogs that inform you to kill certain processes and a cryptic number is shown. This is the PID of the process. If you go into Task Manager and enable the PID column, you will see the PID represents "Setup.exe". You may safely ignore this and choose the option that lets you "continue" or "skip". Unfortunately, Setup halts until you make a decision on this dialog, so if you were planning to go get a nice spaghetti dinner with some wine, you'll need to bring it home to eat in front of your computer...

DO I STILL NEED 2005?: If you decide you are happy with Visual Studio 2008, there is really no need to keep Visual Studio 2005 around any longer -- 2008 can target the build runtime back to Framework 2.0. Aside from the Solution file issue addressed above, you can safely consider Visual Studio 2005 history! Users that need to maintain Visual Studio 2003 projects that target Framework 1.1 may not be as lucky - but somebody will probably come up with a simple converter app to keep solutions and project files in sync. One thing I'll say is this: there are a lot of bug fixes and performance enhancements in Visual Studio 2008 - and when I click the icon to start it, that sucker comes up ONE HELL of a lot faster than VS 2005 does!

On my system, the uninstallation of all the BETA 2 2008 "Stuff" that I had on there, and installation of Visual Studio 2008 RTM did not interfere with the operation of the existing Visual Studio 2005 installation in any way.

Finally, if you want to know where to go for help, try the Visual Studio Installation Forum on MSDN.

Now here is something fun for the holidays while you are waiting for your downloads to complete (or, er, to start):

Pete's Real Jewish Nuclear Bomb Vegetarian Chili [Beta 3 Version]

In the spirit of the Holidays, I thought it would be a nice gesture to post once again my secret family recipe for Vegetarian Chili that's been handed down over several thousand years by members of the Bromberg Tribe. This is great food for programmers, all the endorphins released into your brain by the cayenne and other pepper - type ingredients will enable you to solve virtually any programming challenge in near- record time! Wishing you a happy and productive 2008!

Pete's Real Jewish Nuclear Bomb Vegetarian Chili petechili

* Six large tomatoes, cut up in chunks
* One large can stewed tomatoes, DRAINED
* One large Onion, sliced
* Two large Green peppers, sliced
* One large Red pepper, sliced
* Two large cans black beans
* Two large cans dark red kidney beans
* Six large roasted jalapeno peppers, diced (canned is OK)
* Plenty of Mexene chili powder (you decide how much by taste)
* Fresh cilantro, chopped (about 20 stalks should be right)
* One large can tomato sauce
* One can tomato paste
* One 16 oz can beer (or about 8 oz good Vodka)
* 2 squares unsweetened Baker*s chocolate
* Three or four large cloves of fresh Elephant Garlic, diced
* Coriander seed (optional)
* Cayenne Pepper (optional)
* Cumin Powder (optional)
* A cup of raisins (optional)
* Six tablespoons extra-virgin Olive Oil

Throw a VERY BIG pot on the stove, turn up the flame, and throw in the Olive oil, the garlic, and the onions. Stir so as not to burn until the garlic and onions have started turning brown.

Throw in the green and red peppers and continue to cook until they are nice and soft. Now throw in the chopped tomatoes and cook some more.

Throw in the tomato sauce and some of the tomato paste, and the chopped jalapeno peppers. Throw in the cilantro. Stir it all up good, you don't want it to burn. Throw in the stewed tomatoes.

If it's starting to look like its getting cooked (about 20 - 30 minutes), then throw in all the beans, some of the beer, and the chocolate and as much of the Mexene chili powder as you dare (a good start would be six heaping tablespoons [I did say 'Nuclear Bomb', didn't I?] , unless you plan on using the optional cayenne, coriander and cumin).

You want to cook this so it looks like it's almost ready to boil,'(but not so high that the bottom layer burns) stirring it up good from the bottom every two minutes.' You want it to thicken up so it really looks like it has meat in it (believe me, when you tell people this is NO FAT VEGETARIAN, they won't believe you). If it's too watery you can add the rest of the tomato paste, or even throw in a whole new can of paste.'' If you've really screwed up and its still too watery, you can throw in some cornstarch. But --don't worry! It always comes out right!

If it's too thick, throw in more beer. If it's not NUCLEAR HOT, then throw in more chili powder, jalapenos, cayenne, coriander, etc.' I even put Louisiana Garlic Hot Sauce in mine, gives it a unique 'winey' taste. Don't forget to throw in your raisins last. You can even throw in some chopped nuts, gives it a nice crunch. Walnuts or Pecans are great. Now, if you aren't a beer lover, about 6 ounces of your favorite Vodka will give it a nice flavor. Don't worry about the alcohol, it all burns off during the cooking.

After this stuff has cooked about 45 minutes to an hour, turn off the heat. You are done.

Serve PETE'S NUCLEAR BOMB CHILI with some grated cheese and / or sour cream dolloped on top and bread or garlic bread on the side.' If people complain it's too hot, then serve some over rice for them. This goes down great with ice cold beer. You can eat two big bowls of this, and you'll wake up the next morning feeling like a million bucks. This stores great in a covered plastic thingy in the Fridge, and people tell me it actually tastes better on the second and third day after being reheated. Feeds six or more, its a whole meal.

RoundHouse Kick Politics Department

I see where Mike Huckabee has a campaign TV ad featuring Chuck Norris. Oh boy. I told you this Presidential Campaign may go down in history as being the most unremarkable ever. But wait! I just heard Hillary, not to be outdone, is getting one ready with Michael Moore!

11/06/2007

Pattern Madness, Anyone?

Here is an interesting newsgroup post that illustrates a common problem of programmers (usually new ones, but - not always!):

"I have just started to rewrite my application using the Presenter First Design Pattern to make sure my business logic is not in the Gui itself. I've got the general idea but I'm a bit unsure as to how I should be launching a dialogue window from my main application window.

What i have done is this in a nutshell. My main application window comprises of a Model, Presenter and a View. The Popup window also has a Model,
Presenter and View. This is the process of what happens when the button is clicked is as follows.

1. Button clicked, delegate function in presenter called from main View.
2. Method in main presenter calls a method in main model to open the window.
3. Method in main model instanciates popup view, popup model and binds with
popup presenter.
4. Method in main model calls method in popup model to open the window.
5. Method in popup model uses delegate function to call method in popup
presenter.
6. Method in popup presenter calls function in popup view to display the
window.

Can anybody tell me if what I am doing sounds right?"

-------------------------------------------------------------------------------

Not to be a downer on the MVP, but that sure sounds like having to go through a lot just to call ShowDialog! Patterns are useful, patterns are cool. But -- the question becomes "Do I really need to implement "all" of this pattern here? What's "best practices" anyway?

It's relative-- if you run FxCop against the Microsoft Enterprise Library, you'll get a list of errors that will keep you busy for hours.

I say, "it depends". Usually, if it ain't broke, then you don't need to fix it. In many cases a legitimate answer would be, "No, you don't - so don't sweat it - and you're still a Patterns Guy/Gal".

Music Education Department

I am always amazed at how many software developers are also musicians, especially in the jazz category. I myself am an ex flute and bass player, having done a stint with the Robert Hunt Trio in New York in my younger days. My flute teacher once made me transcribe Miles Davis' solo from Freddie the Freeloader (Kind of Blue) -- note for note, and be able to play it on the flute. Amazon now pays 20% on their MP3 downloads, they are DRM - free mp3s and they have a huge selection of classical and jazz. Here's an example:



Nordal is one of the most technically brilliant pianists you will ever hear. If you like top-flight piano jazz with hints of Keith Jarrett, Bill Evans, Oscar Peterson and others, yet totally unique, check out Marius Nordal.

Link of the Day: Sharepoint Blogs

11/05/2007

How to store a date in 4 bytes?

"My Karma ran over your dogma." - Unknown

This was an interesting little C# newsgroup nugget. User has a registration code with 4 unused bytes, and wants to know how to store a date in same. (Actually I believe the user was thinking of 4 extra characters in a string - not "bytes", but the exercise is still a good one).

Suggestions were made to store an integer representing the number of days from a fixed date. That would certainly do it, but it doesn't convey any context.

Here's my take:

using System;
using System.Collections.Generic;
using System.Text;

namespace _bytedate
{
class Program
{
static void Main(string[] args)
{
// this makes sorting by date on an integer value perfect,
// e.g. year+month+day, padded to make an integer
int myDate = 20071105;
byte[] b = BitConverter.GetBytes(myDate);
Console.WriteLine(b.Length.ToString() + " bytes.");
// reads "4 bytes"
// And -back again:
Console.WriteLine("Original: " +BitConverter.ToInt32(b, 0).ToString());
Console.ReadKey();

}
}
}

BitConverter has methods that can do all kinds of cool stuff like this -- both forwards, and back.

You could also write simple "conversion methods":

private static DateTime Int32ToDateTime(int myInt)
{
string s = myInt.ToString();
string yr = s.Substring(0, 4);
string mo = s.Substring(4, 2);
string dy = s.Substring(6, 2);
string theDate = string.Concat(yr, "/", mo, "/", dy);
return DateTime.Parse(theDate);
}
private static int DateTimeToInt32( DateTime dt)
{

string yr = dt.Year.ToString();
string mo = dt.Month.ToString();
if (mo.Length == 1) mo = "0" + mo;
string dy = dt.Day.ToString();
if (dy.Length == 1) dy = "0" + dy;
int myDate = int.Parse(yr + mo + dy);
return myDate;
}

Readers will of course observe that the Time component of the DateTime object needs to be conveniently left out of this exercise. Note that if a month or day component of the datetime is the equivalent of a one-character item, I prepend a zero ( 0) character into the resultant string to maintain sort capability on integer values.

11/02/2007

System.Web.Caching.Cache, HttpRuntime.Cache, and IIS Recycles

Recently I chimed in on a newsgroup thread to an OP (Original Poster) who was questioning why he was losing Cache items. This individual would load a dataset from the Cache object into a local object to use to perform processing. He had been using httpcontext.current.cache and noticed that sometimes he was not able to get the dataset out of the cache. He tried switching to HttpRuntime.Cache and it seemed to help.

The OP claimed that the application is under heavy hits, and once or twice every month he would see this error. He wanted to know why does the HttpContext.Current.Cache call work sometimes, while some other times does not.


A couple of posters replied, one of whom is a respected MVP who usually makes very astute, high-quality posts. He posted,"The cache is only valid during the life of the request. how is you[sic] code using the cache?"

Somebody else (also pretty astute, usually) responded, "Cache is valid during lifetime of application not request.....".

What's the answer?

Just to make sure, I posted some response information:

"ASP.NET applications recycle periodically, especially if there is a lot of memory pressure. When this happens, Cache goes away and is then resurrected.
While there could be other explanations, this is the most likely one. It should not matter whether you use HttpContext or HttpRuntime..."

I got a response:

"recycling doesn't effect [sic] HttpRuntime.Cache, which only exists for the request. during a recycle, currently running requests continue in the old
appdomain, so they still have this data."

That's only partially true. Yes, existing requests continue to finish up on the original AppDomain. However, that doesn't explain why the Cache item would be gone on any subsequent request, which is what the OP was really asking. So I responded in more detail:

"The System.Web.Caching.Cache class can be accessed either through the static property System.Web.HttpRuntime.Cache or through the helper instance properties System.Web.UI.Page and System.Web.HttpContext.Cache. (or HttpContext.Current.Cache) It is therefore available outside the context of a request. There is only one instance of this object throughout an entire application domain. Recycling an AppDomain (e.g. by touching web.config, or due to IIS causing the recycle due to memory pressure, etc.) will drop Application, Cache, and in-process Session information since that is stored in the AppDomain logical process. You can do this simple test:


protected void Page_Load(object sender, EventArgs e)
{
Cache["test"] = "Stuff in Cache";
System.Web.HttpRuntime.UnloadAppDomain(); // similar to an IIS AppDomain Recycle
Response.Redirect("Default2.aspx");
// Default2.aspx simply does: Response.Write((string) Cache["test"]); -- you should see nothing.
}

---"

The main point here is that if your Application is recycled either due to IIS health settings, the web tree contents being changed, or because your buggy code throws an unhandled exception, then your Session , Application, and Cache contents go "bye bye". There are no ifs, ands or buts about it. You are getting a new AppDomain, and it starts life with nothing in either Session, Application, or Cache.

The most efficient way to access the Cache is via the HttpRuntime.Cache object directly, the other methods involve extra parsing for the current HttpContext . It's a very minor optimization though. In point of fact, you can use the HttpRuntime.Cache class from Windows Forms or even a Windows Service, and it will work just fine. All you need is a reference to System.Web. It is very efficient and has neat Invalidation callbacks and other useful features that would be hard to duplicate. It's also much more lightweight than the Enterprise Library Caching framework and if you believe in traveling with "batteries included" as I do, this is the best way to go.

Politics: Her Hillarious Inner Self

Peggy Noonan, who I particularly admire, did a piece in the Wall Street Journal about Hillary Clinton revealing her "inner self". Rather than try to be a pundit, I'll just quote the pointillist paragraph:


"Giving illegal immigrants drivers licenses makes sense because it makes sense, but she may not be for it, but undocumented workers should come out of the shadows, and it makes sense. Maybe she will increase the payroll tax on Social Security beyond its current $97,500 limit, to $200,000. Maybe not. Everybody knows what the possibilities are. She may or may not back a 4% federal surcharge on singles making $150,000 a year and couples making $200,000. She suggested she backed it, said she didn't back it, she then called it a good start, or rather "I support and admire" the person proposing such a tax for his "willingness to take this on."

Noonan continues, "The problem for Mrs. Clinton is not that people sense she will raise taxes. It's that they don't think she'll raise them on the real and truly rich. The rich are her friends. They contribute to her, dine with her, have access to her. They have an army of accountants. They're protected even from her. But she can stick it to others, and in the way of modern liberalism for roughly half a century now, one suspects she'll define affluence down. That she would hike taxes on people who make $150,000 a year."

You know, I think it's too bad that this fellow Ron Paul is so extreme that he has deliberately made himself totally unelectable. He has great Libertarian ideas; it's just that you don't overtly put these into your platform and expect to become a Convention Nominee.

I think this is turning out to be one of the most unremarkable Presidential Campaigns in modern history. Really, on all three sides of the aisle.

10/31/2007

Entity Framework Goodness

I finally got around to the Entity Framework BETA 2, and I like it already. To play with this, you need these bits;

Entity Framework Beta 2:
http://www.microsoft.com/downloads/details.aspx?FamilyID=f1adc5d1-a42e-40a6-a68c-a42ee11186f7&displaylang=en

Tools, Aug 2007 CTP:
http://www.microsoft.com/downloads/details.aspx?FamilyId=09A36081-5ED1-4648-B995-6239D0B77CB5&displaylang=en

There is also a nice "Getting Started" piece on codeplex:

Getting Started:
http://www.codeplex.com/adonetsamples/Release/ProjectReleases.aspx?ReleaseId=7792

I decided to brave it and just roll a quickie on my own from the Northwind database. All you do is Add New Item / ADO.NET Entity Data Model, which gives you a wizard to choose what database objects you want modeled, and then you get a nice class diagram:

EntityDesignerDiagram

All your entity model code is built for you. So to say, get 10 products from the Products table via a nice little LINQ query:

// Get 10 products via Entity LINQ query
using (NorthwindModel.NorthwindEntities1 ent = new NorthwindEntities1())
{
Products[] prod = (NorthwindModel.Products[])
(from pr in ent.Products select pr).Take(10).ToArray();
GridView1.DataSource = prod;
GridView1.DataBind();
}


LINQ is extremely cool. As with any new technology, there is quite a learning curve, but it's really worth the effort. You can get into all kinds of complex LINQ queries and joins, the vocabulary and the syntax, especially combined with Lambda expressions, is outstanding. I've been working out of the Albaharis' book from O'Reilly, "C# 3.0 in a Nutshell", which has extensive reference-book type material on LINQ. They also have a free downloadable "LINQPAD" executable which i highly recommend.

Oh, and just for the sake of being concise: this is for Visual Studio 2008 - Orcas, NOT Visual Studio 2005.

Sweet!

10/28/2007

Google PageRank Crash of 2007: What's the Skinny?

"To the moon, Alice" -- Jackie Gleason (Ralph Kramden, The Honeymooners)

The BlogOSphere has been buzzing the last couple of days since everybody discovered that the Googly-Bear decided to update it's PageRank algorithm (there had been hints for weeks before, to be sure -e.g., Danny Sullivan, Oct. 7). Ah, "poor little me", huh?

Legions of very big blogging-related sites and commercial ventures -- Washingtonpost.com, Forbes.com, Engadget.com and SFGate.com noticed a downgrading in their PageRank. Some sites went up in PageRank. Our eggheadcafe.com site went from 5 to 6. One of my newest "playground sites", blogmetafinder.com, went from zero to a PageRank 3. This UnBlog remains unchanged, for now, at PR 5.

Most experts agree that the key determinant was the practice of "buying links" such as text link ads and the like. Apparently, Google just decided to close up this last little loophole, and they did it with ample warning too. Now, this is "big" - you may not grok it right away, but it's going to change the entire complexion of the web, and pretty quick, too. Hopefully, for the better...

As we all know, a whole industry has spawned with the goal of helping website operators obtain the highest rankings for certain keywords in search engines, and milk the most out of their AdSense accounts. Unfortunately, many of these SEO practices fall into the blue or black-hat SEO category, that's the one that got the Googly-Bear very upset.

And, you don't wanna upset the Googly-Bear, because it's a very, very big one. And when it gets mad, a whole lotta things can change overnight, yes?

Here's the "thing": If I've got a web site that's got a PageRank "7" and it's because I've got a bunch of backlinks from spammy or questionable sites that sell links, what I really have is a PageRank 7 that' s ready to go down the toilet overnight. If those spammy or questionable sites get demoted, my PageRank that's depending on them goes straight into the potty.

There will always be the crowd that doesn't want to put in legitimate effort for gain - the people that focus on how to "game the system", get DiggBoss points, manipulate PageRank, whatever.

Bottom line: Do things the old fashioned way. Don't buy or sell links. Put real content on your site or blog. Promote yourself ethically along the published Webmaster guidelines. And you won't be crying in your beer. If your venture got demoted in PageRank, better do some serious soul-searching, because it's more than likely the problem sits between your keyboard and your chair.

It will be interesting to see what happens in the next 2 to 3 weeks as lawyers start jockeying around this ambulance... Congress, of course, will need to get involved...

In Other News

Welcome to $100 oil and $4.00 gas, which I predicted a year and a half ago. If you take the time to look at the historical Oil vs. Inflation chart (which is a couple of years old) it is easy to see that inflation tracks oil prices pretty closely. Pencil in $100 oil, and you get the picture. And the Fed can't do crap about it because our economy is already in shambles and the only trick they've got is to raise the Discount Rate. With the mortgage / housing market down the crapper, there is no way they can do that. What do you get? An INFLATIONARY RECESSION. I give it about 6 months.

10/27/2007

Visual Studio 2008 (ORCAS) "Project Creation Failed"

For a list of all the ways technology has failed to improve the quality of life, please press three.
--
Alice Kahn

This is due to some assembly redirects that are added to the devenv.exe.config file by installing the GAX (Guidance Automation Extensions).

Here is the fix, and it's an easy one:

1) Navigate to: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE in Windows Explorer

2) Load devenv.exe.config in your favorite text editor.

3) Find this string: "Microsoft.VisualStudio.TemplateWizardInterface"

4) Comment out the element so it looks like this:

<dependentAssembly>
<!--assemblyIdentity name="Microsoft.VisualStudio.TemplateWizardInterface" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /-->
<bindingRedirect oldVersion="0.0.0.0-8.9.9.9" newVersion="9.0.0.0" />
</dependentAssembly>

5) Restart Visual Studio 2008. All fixed!

10/24/2007

A $15 Billion Bubble? You Decide...

With Microsoft (MSFT) buying a very minority share that values Facebook at $15 billion, it looks like "bubble or bust".

A lot depends on whether you believe Facebook is just the latest online fad—or whether the social network is building the next, great computing "Thing".

Facebook, which is closing in on 50 million members, theoretically promises to restore control to social networking—over privacy, unwanted email, and virtual contact— back to the user.

If you divide the estimated valuation ($15 Billion) by the number of users that means each Facebook user is potentially monetized at about $300. Obviously, users aren't being monetized at that level now. I'm a Facebook user, and while it was kinda cool at first, seeing people that I know who have joined, and being invited to be "a friend" of some people that I respect or like, I already find that the bloom is off the face, if you will - and I really don't visit much at all anymore.

So, how does Facebook/Microsoft make money? Advertising, obviously. When Mark Zuckerberg talks about "social ads", I have a funny feeling that I am not gonna be there to click. It might be innovative, it might be the "next big thing" - but my guess is that if many users, like me, arent' really compelled to visit regularly, guess what? There isn't gonna be anybody to look at the ads, period. Not only that, but these social networking sites are quite transient. One day, probably soon, some young innovator is going to come up with something better (they're probably coding their asses off on it as I write) and Facebook (like MySpace) will start to really become passe.

Frankly, I'm getting the idea that Facebook friends are to remind you how many friends you might actually have if you were to spend time with real people in the real world.

So whether Facebook is worth $15 billion really depends on whether it can figure out a way to spin new kinds of online ads that work a lot better than anything we’ve seen before. My bet is: don't hold your breath. There is a broader concept at work here, as alluded to by an astute commenter below.

Déjà Vu all over again, a-la 2000? At least, NASDAQ isn't at 5,000...

10/19/2007

Un-Captcha Techniques Redux

I've spent a bit of time working on alternative CAPTCHA techniques, mostly because I've found that the vast majority of CAPTCHA offerings are non-intuitive and even for people with excellent eyesight, don't always "make it" the first time around. I have pretty good vision, but I find myself constantly frustrated by stupid case-sensitive CAPTCHA requirements that I simply cannot pass the first, sometimes the second and even as many as three tries.

Webmasters and site developers are like lemmings - they seen something that somebody promotes, they copy it, they use it, but they DON'T THINK!

WTF?  All one needs to do is look at Jeff Attwood's blog and you can see that he requires the user to type in a clearly readable "ORANGE" every time - and it works perfectly! The Bots simply don't get it. It's easy to see, easy to read, and shows how UTTERLY RIDICULOUS  these various CAPTCHA images are to the user, and how they literally destroy the user experience!

One technique I pioneered was the use of an Image - to - HTML captcha that renders as HTML.


But! There could even be an easier way:

This concept is based on the fact that most spam - bots are, in a word, "dumb".

Here is the technique:

1) Add an input field to your form having some interesting name such as "url":
<input name="url" type="text" value=""/>


2) Hide the input box with a  css style element so that real (human) users cannot see it directly:
<style>
.captchaStyle {
  display: none;
}
</style>

<p class="captchaStyle"><input name="url" type="text" value=""/></p>

In your code that processes the form, check if the “url” formfield contains any value. If it does, it's a bogus post because it was a bot that  saw the field and "thought" that it was supposed  to fill it in, so you would reject it or set it up for moderation.


It works because geniune users cannot see a hidden input box on your form and therefore, they won’t fill it, while robots do  see it, assume that they need to provide a value, and fill it in.

Go figure.

The Project XXX could not be opened because the Microsoft Visual C# 2008 compiler could not be created

If you have any experience installing Microsoft Beta or CTP offerings, then uninstalling to make way for a newer version, then with Visual Studio 2008 (Orcas) the above may be somewhat familiar.

Surprisingly, the answer is to install the latest version of the Silverlight Tools here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=b52aeb39-1f10-49a6-85fc-a0a19cac99af&DisplayLang=en

That may not be the only answer, but it seems to have worked for a number of people including me.

If you are having trouble uninstalling Visual Studio ORCAS because the MSI information got clobbered somehow, or it reports not being able to find some "network location" (DOH), one of the fastest ways to clean things up is to use some of the tools out there, many of which have been provided by installation guru Aaron Stebner. Here's a post by Brad Abrams that highlights two tools you can use.

MSIInv takes an inventory of all your MSI-installed software (even stuff you cannot see in Add/Remove or Programs and Features). It provides you with the GUID so that you can just run msiexec /x {clsid of software}. This often solves the problem. You can also use MSIZap (also detailed on the post with a download link).


As well, I have been able to use the MSICUU "cleanup" utility which is even easier to use.

Have fun. It's us against them.

In other news, if you are concerned about the freedom of the Internet ("Net Neutrality"), read this about what Comcast is doing.

10/10/2007

Losing ASP.NET Sessions - Why Application Pools recycle

I've seen a more or less constant stream of questions on the asp.net newsgroup and the asp.net site forum messageboard, all of which revolve around the problem of "Why am I losing Sessions?". (BTW that is "losing" with one o, not "loosing"! Your pants might be loose, but if your Session goes away you can bet that you are losing it!).

Heres a summary of what I've learned about this; comments and additions are always welcome:

If your ASP.NET application crashes, has an unhandled exception, hangs or otherwise becomes brain-dead, it will cause the application pool to recycle. Sometimes your application pool recycles for no obvious reason. This is usually a configuration issue or it may be caused by your app performing file system operations in the application directory. Many times developers incorrectly set up SqlConnections so that they aren't properly closed and returned to the connection pool, and this can also cause your AppPool to recycle unexpectedly. When your AppPool recycles, you can kiss your InProc Sessions - and everything else -- goodbye.

Application pool settings

Looking at the properties for the application pool in IIS, you'll see the settings for "on purpose" recycling. In IIS6 these are:

  • Recycle worker processes (in minutes)
  • Recycle worker process (in requests)
  • Recycle worker processes at the following times
  • Maximum virtual memory
  • Maximum used memory

If you're running IIS5 or the IIS5 isolation mode you must look at the processModel element of machine.config. The properties you should pay attention to are:

  • memoryLimit
  • requestLimit
  • timeout

In IIS 7.o, you have Fixed Interval or Fixed # Requests, or Specific Times for recycling. Also, there are Memory -based Maximums for Virtual and Private Memory, and additional items for Configurable and Runtime recycling events including "unhealthy ISAPI".

When an application pool recycles, HTTP.SYS holds onto the client connection in kernel mode while the user mode worker process recycles. After the process recycle, HTTP.SYS transparently routes the new requests to the new worker process. Consequently, the client never "loses all connectivity" to the server; the TCP connection is not lost -- only state is lost (Application, Session, Cache, etc.).

memoryLimit

The default value of memoryLimit is 60. This value is only useful if you have a small amount memory on a 32 bit machine. "60" means 60% of total system memory. So if you have 1 GB of memory your IIS worker process will automatically restart once it hits memory usage of 600 MB.

requestLimit

This setting is "infinite" by default, but if it is set to 8000 for example, then ASP.NET will launch a new worker process once it has handled 8000 requests.

timeout

The default timeout is "infinite". This is where you set the lifetime of the worker process. Once the timeout is reached ASP.NET launches a new worker process, so setting this to "00:30:00" would recycle your application every 30 minutes.

Other properties

Another property within the processModel element that will cause your application pool to recycle is responseDeadlockInterval. If you have a deadlock then that's your main "fix" that you need to worry about -- changing the responseDeadlockInterval setting won't do much to resolve the problem. You need to deal with the deadlock itself, find out why it's happening, and change your code.

File Change Notification

ASP.NET 2.0 depends on File Change Notifications (FCN) to see if the application has been updated, and depending on the magnitude of change the application pool will recycle. If you or your application are adding and removing directories to the application folder, then you will be restarting your application pool every time.

Altering the following files also causes an immediate restart of the application pool:

  • web.config
  • machine.config
  • global.asax
  • Any file in the /bin directory or subfolders

Updating .aspx files, etc. causing a recompile eventually triggers a restart of the application pool also. There is a property of the compilation element under system.web called numRecompilesBeforeAppRestart. The default value is 20, meaning that after 20 recompiles the application pool will recycle.

Workaround for the sub-directory issue

If your application actually requires adding and removing sub-directories you can use linkd to create what's called a directory junction:

Create a directory you'd like to exclude from FCN, e.g. c:\inetpub\wwwroot\MyWebApp\MyFolder
Create a separate folder somewhere outside the wwwroot, e.g. c:\MyExcludedFolder
Use linkd to link the two: linkd c:\inetpub\wwwroot\MyWebApp\MyFolder c:\MyExcludedFolder
Now any changes made in the c:\inetpub\wwwroot\MyWebApp\MyFolder will now actually occur in c:\MyExcludedFolder so they will not be sensed by FCN.

Linkd only comes with the Windows XX Resource Kit, which is a pretty big download. But Mark Russinovitch has "junction" which could be even better:

http://www.microsoft.com/technet/sysinternals/FileAndDisk/Junction.mspx

Is recycling the application pool good or bad?

If your app is coded properly, you shouldn't have to recycle the application pool. However, if you're dealing with a memory leak in your app and you need to buy time to fix it, then recycling the application pool could be a good idea. It's important to understand, though, that's not a "Fix" - it's just a "Band-Aid" until you find out what's causing the problem and fix your code. Unlike as with ASP.NET 1.1, in ASP.NET 2.0 if your app generates an unhandled exception the AppDomain will unload causing an application pool recycle. Consequently it is extremely important to ensure that your code is "best practices" and doesn't generate unhandled exceptions except under the most extreme and unusual conditions.

Additional Resources

http://msdn2.microsoft.com/en-us/library/aa719566(VS.71).aspx

http://msdn2.microsoft.com/en-us/library/aa720473(VS.71).aspx

http://forums.asp.net/t/623320.aspx

http://www.microsoft.com/technet/technetmag/issues/2006/01/ServingTheWeb/

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/26d8cee3-ec31-4148-afab-b6e089a0300b.mspx?mfr=true

http://blogs.msdn.com/david.wang/default.aspx

10/09/2007

AJAX: Enough Already!

Is there such a thing as OverAJAXification?

ajax

From the AJAX Sucks Department...

Jeesh. Everybody and their brother is sticking AJAX into their "stuff" - whether it's appropriate or not. They just did it at Codeplex.com. The search facility was just fine. You'd click a "next" link and the page would postback and right away you would get to see the next page of results.

Now, since they've supposedly "souped it up" with AJAX, what you get is a very long (sometimes 5 seconds or more) grey screen with an "updating" in-your-face graphic to look at, and then finally you get to see your next page of search results. To me, that's a lot more annoying and disruptive to the user experience than the slight flicker of a quick postback. But often, instead, you may just as well see the above Sys.WebForms.PageRequestManager exception dialog, which does absolutely NOTHING to improve the user experience.

Oh, and while I'm ranting, here's another nasty side effect of your "OverAjaxification": I put in a search term, and page through my results, and I'm on page 7, and I click "back" to go back to page 6, right? NOPE. You guys put me back on page 1! What if I click on a result to look at the project, and then click back to get back to my page of results? Same thing - you guys are now putting me back to the first page of results, without the sort that I chose. DOH! This is like Dan Rather and the Selectrics, man! Do you have to do this dumb stuff?

This is what happens when people are hot to showcase some technology but they don't THINK first. AJAX (excuse me - Remote Scripting), like any other technology, should be used with care and especially with great forethought as to its appropriateness within the specific presentation paradigm and web traffic load.

AJAX can definitely improve the user experience when used with care and in the right situation. But frankly, if it's going to bomb out or take longer for me to see my results than a simple postback, I'll vote for the old fashioned way every time.

The key thing is "form over substance"- we should always favor doing things in a usable, correct manner over "how they look". IF you can do both, then fine -- but make it stand up to the test first.

10/08/2007

Vista Upgrade: DVD Driver Problems FIX - Roxio DLA

The gods too are fond of a joke. - Aristotle

Recently I upgraded XP Pro to Windows Vista Ultimate. It wasn't until sometime later that I found I had lost my DVD drive. The driver appeared in Device Manager but it had that familiar yellow exclamation mark indicating a problem loading the driver.

After a bit of searching, I discovered that the culprit was Roxio CD/DVD software (e.g., "DLACDBHM.SYS" et. al.) which is not Vista - compatible, and thus blocks correct loading of the built in Vista CD/DVD drivers.

The FIX:

First step, in C:\Windows\System32 you need to find the DLA folder and delete it. That's their "Stuff". If you want to get sophisticated, you can search the registry for all keys that point to any of these .sys drivers and remove the entries.

Next, run this Registry Fix script courtesy of Doug Knox:

'Restore CD-Roms and DVD's to Explorer
'xp_cd_dvd_fix.vbs
'© Doug Knox - rev 04/14/2002
'Downloaded from www.dougknox.com
'based on cdgone.reg

Option Explicit
On Error Resume Next

Dim WshShell, Message

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegDelete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}\UpperFilters"
WshShell.RegDelete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}\LowerFilters"
WshShell.RegDelete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdr4_2K\"
WshShell.RegDelete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdralw2k\"
WshShell.RegDelete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdudf\"
WshShell.RegDelete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UdfReadr\"
Set WshShell = Nothing

Message = "Your CD/DVD-Rom drives should now appear in Windows Explorer." & vbCR
Message = Message & "You may need to reboot your computer to see the change."

MsgBox Message, 4096,"Finished!"

The above script should be saved as "xp_cs_dvd_fix.vbs" and you can execute it out of Windows Explorer by double-clicking. This is a pretty old script but the most important thing it does is to remove the "UpperFilters" and "LowerFilters" entries.

Note: the above does not remove Roxio DLA - which is incompatible with Vista. Here are full instructions for that:

Note: These instructions apply specifically to Windows XP, but they work on Vista as well.
To perform a clean uninstallation of DLA.
1) Uninstall the current copy of DLAusing the "Add/Remove Programs," control panel, if available.
2) Delete the "DLA," folder from your Program Files folder. (By default this is located inside:C:\Program Files\Sonic\)
3) Edit the Registry to remove entries relating specifically to DLA. (As a precaution, please exportany registry entries before deleting them.)
a. To start the Registry Editor, click on "Start," click on to "Run," type "regedit," and click "OK."
b. Open the "HKEY_CURRENT_USER" folder. (If this folder does not exist, proceed to step f.)
c. Open the "Software" folder.
d. Open the "Sonic" folder.
e. Right-click on the "Direct Access" folder and select delete.
f. Go to HKEY_LOCAL_MACHINE\Software\Sonic.
g. Right-click on the "Direct Access" folder and select delete.
h. Go to HKEY_CLASSES_ROOT\CLSID.
i. Right-click on the "{5CA3D70E-1895-11CF-8E15-001234567890}" folder and select delete.(This data for the "Default," setting in this folder should be "DriveLetterAccess.")
j. Go to HKEY_CLASSES_ROOT\Installer\Products.
k. Right-click on the "29FE602138E2958RCABC02843CBCD76A" folder and select delete.
l. Go to HKEY_CLASSES_ROOT\
m. Right-click on the "VERITAS.DLAEventHandler" folder and select delete.
n. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID.
o. Right-click on the "{5CA3D70E-1895-11CF-8E15-001234567890}" folder and select delete.(This data for the "Default," setting in this folder should be "DriveLetterAccess.")
p. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Classes.
q. Right-click on the "VERITAS.DLAEventHandler" folder and select delete.
r. Got to HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\MSConfig\startupreg.
s. Right-click on the "dla" folder and select delete.
t. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers.
u. Right-click on "VxDlaCdOnArrival" and select delete.
v. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
w. Right-click on the "{1206EF92-2E83-4859-ACCB-2048C3CB7DA6}" folder and select delete.
4) Restart your computer.
5) Delete the "DLA," folder from the System32 folder. (This is located inside: C:\Windows\System32)

Reboot your machine, and you should now see your DVD drive, and Roxio DLA will be gone.