Posts

Showing posts from 2009

ASP.NET MVC – Do I Really Need It?

As a professional software developer, particularly of the Microsoft flavor, you get bombarded with “new stuff”. If you do not instill in yourself a certain discipline, you are sure to be brought down by the sheer complexity of tackling every “new thing” that is sent your way. I say this from personal experience; I do not mean to be negative in any way in saying this. It’s just a fact of life. There are so many “CTPs” and new technologies being thrown at you that it is easy to succumb to “Beta-itis” – the debilitating compulsion to download and play with every new thing, to the point where your productivity as a software developer begins to suffer. It’s even worse if you’re an MVP because when you go to the Summit each year, they throw a whole truckful of even more sexy new “Stuff” at you. Sometimes, its stuff that nobody else has seen before and you had to sign an NDA saying you wouldn’t talk or blog about it. Talk about getting excited! ASP.NET MVC is an example for me. About a

SQL Server 2008 Fix: SP1 Install Failure

  For quite a while I could not install SQL Server 2008 SP1, as it reported a failed shared component installation – in this case, Books Online. Problem is I could not find the source MSI to fix it. So here is how I solved the problem:  If any shared components installations result in a failed state, a Registry key is updated. SP1 reads these keys when it starts, and if the value is not “1” (in my case it was “3”) – it will stop. Seems ridiculous to me, but that’s how they do it. And doing a repair may not fix it either – because you may have installed Books Online from an interim standalone MSI installer. if you try to find the original MSI to handle the repair, it might not be the correct one. Edit this key (or the respective key for whatever your fail message says) and ensure that the value is 1: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\ConfigurationState\Sql_BooksOnline_Redist That took care of that problem! Now I have a different issue, but I’ll t

Why the Economic Stimulus Plan Doesn’t Work

When President Obama was elected, the economy was already sick and getting sicker. If nothing was done, his economic team said, the unemployment rate would keep rising, reaching 9 percent in early 2010. But if the nation embarked on a fiscal stimulus of $775 billion, mainly in the form of increased government spending, the unemployment rate was predicted to stay under 8 percent. Obama bought into a classic Keynesian solution – and so did Congress. Congress passed a huge fiscal stimulus that focused almost entirely on government spending. Yet things turned out worse than the White House expected. The unemployment rate is now in the 10 percent range — a full percentage point above what the administration economists said would occur without any stimulus ! So what should they  do now? The administration seems  determined to stay the course, although recently, the president showed interest in “increasing the dosage” – a bad prescription indeed. A better approach might be to rethink th

Don’t Break the Interface

Recently while contributing to a test suite that covers some 250 C# DAOs (Data Access Objects) I discovered a couple of issues: 1) There was an implementation of “PrimaryKey” which is defined as a nullable long (long? PrimaryKey) that returned a 0 (zero) if the nullable type had no value. Uh-Oh! 2) There was more than one implementation, e.g., this actually appeared in more than one base class, in different assemblies. Depending on which references you had set, you could get clobbered! Needless to say we’re going to fix that quickly; there are objects that are “older code” that need to be updated to reflect the change. Fortunately our test suite will show immediately which guys need to be updated,underscoring the importance of having robust unit tests. But the real question is, “How did this creep in”? The answer: Most probably, "Stinkin' Thinkin'" by developers. Nullable types are instances of the System.Nullable struct. A nullable type can represent the normal range

The big Silverlight 4 Question

You get all this honking and hoopla and what not, but nobody seems to think about the big Silverlight 4 Question: Can I install Visual Studio 2010 Beta 2, Silverlight 4 Tools, WCF RIA Services, The November 2009 SIlverlight Toolkit, and Blend 4 Trial on the same machine that I have Visual Studio 2008, Siverlight 3, SIlverlight 3 Toolkit, Blend 3 and so on – and will they co-exist peacefully on the same machine? Answer: Yes! All you may need to do is uninstall your previous RIA Services Preview. Everything else will “just work”. I just did it and tested it all out. Bart Czernicki mentions an issue that you can review here . Disclaimer: No animals were harmed in the creation of the UnBlog post. Your mileage may vary. Oh, and one final note: If you are going to install WCF RIA Services with Visual Studio 2010, you will no longer be able to use RIA services with Visual Studio 2008. They don't install "side -by-side".

Another Set of Eyes

Insanity: doing the same thing over and over again and expecting different results. --Einstein How many times, as a developer, have you found yourself mindlessly and stubbornly trying to solve a problem (some thrown exception, for example) for an hour, two hours, or even longer, without a solution? This is like the Einstein quote above: madness! What you need to do is get Another Set of Eyes to sit by you while you work your way through the issue. It doesn't even have to be a developer who is very familiar with the codebase you're working on -- the mere act of "changing the paradigm" will enable you to look at the problem more objectively and find the answer quickly. In a team environment, we have a general rule that if you're stuck on a problem for more than 20 or 30 minutes, you put your ego in your back pocket and ask another developer to come sit by you while you demonstrate the issue. Recently another developer I work with asked me over. He admitted having so

When Unit Tests aren’t Enough

Unit Testing of your work is generally accepted as the mark of a professional developer. However – have you thought about what happens when you make a boo-boo on the tests you create ? You guessed it – everything goes to hell in a handbasket. If the tests are flawed, they aren’t really telling you anything.  Sometimes it can be better (and faster)  to create an old-fashioned, Windows Forms test harness to exercise your “stuff”. Right now, I’m working on a complex project with many dozens of classes – more of them every single day. Often we are asked to make changes to many of these classes. When I do these, all I need to do is fire up my Winforms Test Harness and press one of the buttons. I can have breakpoints in the code at strategic places, and I can view the end result in a DataGridView that’s on the form. Sure, you can do that with a unit test, but then what you’re doing is “testing a test”. Unit Tests are definitely the way to go, but sometimes just being a Duct Tape Prog

Why the FED has turned the banking system into the Living Dead

Treasury Secretary Tim Geithner and Federal Reserve Chairman Ben Bernanke have denoted that the recession is over. Now that the DJIA has broken the 10,000 mark, we can expect to  have full confidence that economic growth is here to stay. But the credit markets are in a lot worse condition than some indexes  suggest. Buried within the October 3, 2008 bailout bill, which set up the Troubled Asset Relief Program (TARP), was a provision permitting the Fed to pay interest on bank reserves. Within a week, the Fed implemented this new power and  essentially converted bank reserves into more government debt. As the fed funds rate hovers around zero and existing loans in technical default continue to sit in bank portfolios, why should banks make new loans when they can make money for free with the government? They can now borrow from the Fed and  earn a huge spread by borrowing virtually unlimited amounts of money for nothing and simply lend that same money back to the Treasury.

Doomed to Repeat History?

Image
William O’Neil, in his excellent book “How to Make Money in Stocks”, has a chapter on the media, news, and market psychology. In this section he has taken the charts of the Dow Industrials from 1921 through 1942, and overlayed on this a chart of the NASDAQ Composite from February 1992 through March 2009, and indexed the data so that the charts both start at 100: What is remarkable about this chart is that the two time periods are almost exact duplicates. O’Neil used the NASDAQ for comparison with the 1929 era as it trades more volume now than the NYSE and represents more entrepreneurial companies. The reason history repeats in this amazing manner is that the markets are made up of millions of people acting almost 100% on human emotions. You can see two important history lessons from just looking at the above chart: 1. This isn’t 1929 right now in October, 2009 – its  Oct 1939. 2. The market (according to history) is not going to be very exciting for a long time – denoting a

On Less is More

Thelonius Monk once said “Wrong is Right”. I say, “Less is More”. All too often we as software developers do data collection of one sort or another, often storing results in a database table or tables, and we suffer from self-induced overkill. We collect too much data, data that we probably will not need. Or, instead of storing the same data and simply updating it’s count on a unique column value via an Insert or Update SQL statement, we end up storing hundreds of unique rows that, because of the data collection overkill we’ve engineered, take up lots of space but don’t really contribute to the “cause”. In addition (and I have certainly been guilty of this) we store our data in database tables that are not normalized, thereby exacerbating the situation. We end up with wide tables with a lot of columns that are inefficient. It is often much easier (and simpler) to start out with a minimalist approach. Less is More. If we determine at a later point that we actually do need “More”,

Acer Aspire One Netbook Restore Windows 7

Recently my Acer Aspire One Netbook with Windows 7 on it crapped out. I have no idea why, but if you’ve got a netbook, then you know that to reconstitute everything you need to do it from a bootable USB Stick, because there isn’t any “DVD” drive on these little puppies. I tried a number of solutions that I found online, but the only one that worked for me was the following:   1) insert your USB stick (4GB or higher). 2) FORMAT – NTFS 3) Copy the contents of the Windows 7 DVD onto the USB stick. 4) Set your netbook BIOS to Boot from “USB HDD” as the first option. 5) Boot off the USB, let Windows 7 setup come up, and do a new installation (the “Repair my computer” option only comes up if you run Windows setup from an existing instance of Windows 7, which I couldn’t get). 6) Install Windows 7.   NOTE: during the install, WIndows 7 needs to reboot. You need to change your BIOS settings on the netbook to now let it boot from the netbook’s hard drive, NOT the USB stick, o

Acer Aspire One Windows 7 Restore

Recently my Acer Aspire One Netbook with Windows 7 on it crapped out. I have no idea why, but if you’ve got a netbook, then you know that to reconstitute everything you need to do it from a bootable USB Stick, because there isn’t any “DVD” drive on these little puppies. I tried a number of solutions that I found online, but the only one that worked for me was the following:   1) insert your USB stick (4GB or higher). 2) FORMAT – NTFS 3) Copy the contents of the Windows 7 DVD onto the USB stick. 4) Set your netbook BIOS to Boot from “USB HDD” as the first option. 5) Boot off the USB, let Windows 7 setup come up, and do a new installation (the “Repair my computer option only comes up if you run Windows setup from an existing instance of Windows 7, which I couldn’t get). 6) Install Windows 7.   This may seem overly simplistic, but it worked for me. Of course, since you have a new windows 7, you’ll need to install all your favorite software.

Online Plagiarism and what you can do about it

Lazy, unethical people who republish RSS feeds and similar content and surround it with advertising for profit abound. In general this is an annoyance, but you probably can’t do much about it.  However where I believe this “crosses the line” is when somebody deliberately copies all of  your original content, removes all identifying links and author attribution, and then republishes this wholesale on their site or blog for expected profit. This happened to me recently. This person, Calla Degennaro , residing in Larchmont N.Y.: Calla M Degennaro 7 Rebeau Dr Larchmont, NY 10538-1337 (914) 834-0236 --  republished not one -- but two of my articles written and originally published on  eggheadcafe.com, without permission: http://tusforyou.com/fluent-nhibernate-automapping/ and http://tusforyou.com/silverlight-3-note-taker-app-with-local-storage/ You can see that this person has carefully removed all identifying traces of where the articles originated and who wrote them

Where’s Reaganomics?

Washington has attacked the current economic downturn with Keynesian economics - the theory that you fight an economic downturn by pumping money into the economy to "encourage demand" and "create jobs." The result? The longest recession since World War II — 21 months —  with no clear end in sight. The government  borrowed close to a trillion dollars out of the private economy —  yet it has done squat to increase incentives for investment and entrepreneurship. In February 2008, Bush cut a deal with congressional Democrats to pass a $152 billion Keynesian stimulus bill based on countering the recession with increased deficits. The central feature was a tax rebate of up to $600 per person.  It had no significant effect on economic incentives. In fact, looking back a year, it was a joke. Learning nothing from this, Barack Obama came back in February 2009 to support a $787 billion, purely Keynesian stimulus bill. Congress, like lemmings, followed along with barely a

DON’T FORGET

Image
  And don’t forget the meaning of the word LIBERTY. ServicePeople, Thank you for your service to our country!

Windows Keyboard / Explorer Shortcuts

  Windows system key combinations F1: Help CTRL+ESC: Open Start menu ALT+TAB: Switch between open programs ALT+F4: Quit program SHIFT+DELETE: Delete item permanently Windows Logo+L: Lock the computer (without using CTRL+ALT+DELETE)   Windows program key combinations CTRL+C: Copy CTRL+X: Cut CTRL+V: Paste CTRL+Z: Undo CTRL+B: Bold CTRL+U: Underline CTRL+I: Italic   Mouse click/keyboard modifier combinations for shell objects SHIFT+right click: Displays a shortcut menu containing alternative commands SHIFT+double click: Runs the alternate default command (the second item on the menu) ALT+double click: Displays properties SHIFT+DELETE: Deletes an item immediately without placing it in the Recycle Bin   General keyboard-only commands F1: Starts Windows Help F10: Activates menu bar options SHIFT+F10 Opens a shortcut menu for the selected item (this is the same as right-clicking an object

The Role of Government

Image
In my “Too Big to Fail?” post, I talked a little about the unprecedented  monetary expansion we have entered. Perhaps it’s time to expand on this topic. In 2007, the federal deficit was 1.2 percent of G.D.P. Two years later, more than a year into a serious  economic crisis it is 13% of GDP -- more than twice the size of the next largest deficit since World War II -– the  projected deficit is the result of a year when the federal government, at taxpayers' expense, has acquired enormous stakes in the banking, auto, mortgage, health-care and insurance industries. The average historical deficit is about 2.5% of GDP. With the ill-conceived government reactions to the financial crises, and the economic downturn that has followed, the unfunded liabilities of various federal programs -- such as Social Security, pensions, Medicare and Medicaid -- are over the $100 trillion mark. With U.S. federal tax receipts at about $2.4 trillion, this level of debt virtually  guarantees higher interes

Too Big to Fail?

Image
The argument is familiar. Just like AIG and General Motors, California says it is too big to fail. And once again, I say: LET IT FAIL . Let’s stop the bullshit, printing fake money so we can try to pump life into zombie banks, insurers, automakers, and states – all at taxpayer expense. Let’s talk about inflation for a moment. Let’s talk about letting the markets correct themselves, painful as that may seem to be. I’ve watched a few of those Zombie movies. And I know that you cannot stop the Zombies by appeasing them with money. The only way to stop them is to chop off their heads . The fiscal equivalent is to let the big insurers, banks, automakers – and even states, take bankruptcy and reorganize. It’s not the end of the world, and it isn’t the taxpayer’s mandate to shore up institutions who don’t understand basic fiscal responsibility.  Don’t we remember “The Boy Who Cried ‘Wolf’”? Inflation is seldom defined. Inflation is simply  a decline in the value of money . This

Visual Studio 2010 Beta 1 – and Install Fix

Recently Microsoft made Visual Studio 2010 available to MSDN Universal subscribers, and will shortly make it available to the general public as well. Previously this had only been available as a closed MVP limited CTP downloadable on Connect. Visual Studio 2010 provides some really attractive advances, particularly in the area of dynamic languages (F# now being a full-fledged Visual Studio language choice), Workflow (with a brand new workflow engine), Cloud computing (Azure), and – for Silverlight developers – not only is there now a full interactive drag-and-drop designer window, but you can choose whether you want to develop with Silverlight 2 – or Silverlight 3 – all from the same IDE! I’ve installed this on my primary development desktop machine alongside Visual Studio 2008, and while it hasn’t been long enough (only 2 days) to make firm determinations, so far I have not seen any “interferences” from having both products installed at all. If you are interested in a detailed

PDF – Portable Document Format, my butt!

I was trying to print out the Silverlight riaservicesoverviewpreview.pdf and, like so many other PDF files, it came out with missing letters that were blank and basically, thanks to Adobe’s bullshit marketing, I invested 116 pages worth of dead trees and printer ink to get a totally useless document . If you’re like me (and I suspect there are a lot of us) you will often print out this kind of  stuff so you can sit in bed before you go to sleep and take out your hellacious yellow highlighter and mark up a document that you are studying. Well! So much for that. Not only that, but Adobe’s latest version of Reader is bloated software that takes up a lot of resources, and they’re now using it to “Package” Adobe Air and whatever other gobbledegook they think I should have, that bears NO FYOOKIN’ RELATION to viewing and printing documents. I don’t have a choice anymore. If I refuse to accept the Air Installation, I CANNOT HAVE THE FREE ADOBE READER, unless i want to go find an older vers

A Tour Through Microsoft Silverlight 3 RIA Services

The main focus of Silverlight RIA Services is to provide an easy-to-use infrastructure for service-enabling Silverlight Applications, sharing of common entity classes, and performing bi-directional work with data in your Silverlight applications. Controls can be made “data aware”, and you can save a lot of time by not having to write a lot of code to be able to work with data from the server. RIA services also provides an easy way to hook in ASP.NET Membership, Role, and Profile providers to your Silverlight application, and to enable the UserContext on Silverlight controls. Once you grasp everything that Silverlight RIA Services offers, you will see that developing data-aware LOB applications with Silverlight has just been made an order of magnitude easier. You will be able to spend your time focusing on what you want your application to do instead of spending a lot of tedious time to put in the plumbing just to get to “first base”. Silverlight RIA Services already gives you all the

Hacking – and the Least Privileges Doctrine

Recently we had a forum moderator (which people we pay a nice monthly stipend) get into some issues with drug abuse problems. This individual had to be checked into a rehab clinic to get himself straightened out.  While I was aware of him having these issues in the past, I was not aware that this person was still having such problems. But the bigger problem is that the correct security policy was not 100% in place, and that is 100% my responsibility. Long story short, due to a lack of security enforcement on our part, my site account and all my articles and such ended up getting deleted. I had to restore them from a most recent database backup. Not a very big deal, but certainly an annoyance.  Needless to say, we now have a new Forum Moderator. The definition of Principle of Least Privilege is fairly simple and easy to comprehend. The idea is that users will be given only the privileges absolutely necessary to perform any given task. This might be configuring their computer, browsi

IIS 6.0, Compression, and Classic ASP Pages

The incompetent with nothing to do can still make a mess of it.    - Laurence J. Peter Well this one is a hoot. Enabled HTTP compression in IIS 6.0, and suddenly Classic ASP pages (yes, we still have a few) that required Integrated Authentication just wouldn’t work. With Anonymous Authentication unchecked, and Integrated checked, and ACL’s on the folder permitting only Adminstrators, you would get a Windows Login prompt as expected but when you would provide credentials, it never went through. As luck would have it, we duplicated the pages on another site where compression was turned off, and those worked fine. On a hunch, I disabled compression on the includes folder, and that fixed it! Seems for some reason that Classic ASP include files don’t like HTTP compression at all. And a thanks to Rick Strahl for reminding me that you need HTTP KeepAlives turned on to use Windows Auth with classic ASP. Compression will reduce our bandwidth to around 25% of what it has been. That’

The Twittification of Live Messenger

I’ve noticed this new “Groups” thing in the latest version of Windows Live Messenger, and it seems that the kind folks at Microsoft have really  started to “get it” about what “Social” is. If you enable the “What’s new” display at the bottom of the Live Messenger window, you will see people in your “group” (that you have started) who have joined other people’s networks. If you click on the links, you can view information about that user and their network, and you can invite them to join (or, ask to join).  It’s not that intuitive at first, but if you play around with it using people that you know, you’ll start seeing new Contacts in your contacts list – most likely people you didn’t know were using Messenger, and / or you probably never thought to invite. I’ve already made a few new friends with this – people I always wanted to be able to have on Messenger, but I either never thought of it, or I didn’t know how to invite them. When “Groups” first was started, I started a “.Net de

Some facts about Silverlight 3 and where it’s going

“Being an expert means having credibility. It doesn’t matter how much you know if people don’t trust your answers.” – Brent Ozar Silverlight 3 was first announced at the IBC 2008 show in Amsterdam on September 12, 2008. It was unveiled at MIX09 in Las Vegas on March 18, 2009. A beta version was made available for download the same day. Silverlight 3 includes an increased number of controls - including but not limited to DataGrid , TreeView , various layout panels, DataForm for forms-driven applications and DataPager for viewing paginated data . Some of these controls are from the Silverlight Toolkit . In addition, Silverlight 3 includes a navigation framework to let Silverlight applications use the hyperlinked navigation model as well as enabling deep-linking (linking directly to specific pages) within Silverlight applications. On the media front, Silverlight 3 supports AAC audio decoding as well as hardware-accelerated H.264 video decoding . The native multimedia pipeline i

You’re Fired! – Redux

I walked into the office this morning and was called “downstairs”. The official line was “Due to the economic downturn, blah blah”… You get the idea. I know better. I was working on a project that was grossly underbid as a fixed-price deal by a company - designated  “architect”  -- which consequently forced a few of us  developers into an impossible position, under extreme time pressure, on a new technology that nobody in the office had ever used before. The schedule was virtually impossible to meet. Anyone with an above room temperature IQ could easily see this, and I had been vocal about it from the beginning, so what happened to me was no surprise.  Management was in a state of denial.  One developer who was brought on decided to quit in the very beginning. Then, they scrambled to bring on two other developers from another office and another project.  The client was not very helpful, although they could not be blamed, really. This particular  project was destined for problems from