Thu - July 28, 2005

Mono Live CD 


I've basically lived in the .NET programming world for the past two years with one small 2 week stink doing some C++ work. I'm a very big fan of the technology. One of the cool aspects of .NET is the Mono Project, which is a open source version of .NET that is now sponsored by Novell. This project provides .NET for many platforms including Windows, Mac OSX and Linux.

Last night I ran across a cool link to Mono Live , which is a bootable CD image that gives you a fully working Linux installation preloaded with Mono, MonoDevelop and many other Mono based tools and programs. The entire thing runs completely off the CD without requiring you to install anything on your hard drive.

I was stunned at how well it worked. On my Dell Inspiron 9200 it got the video right and after entering my WEP security code the wireless network came right up as well. If you want to play with .NET on a different platform with no hassle I really recommend trying this out. 

Posted at 12:31 AM     Read More  

Sun - January 16, 2005

SQL Issues 


This past week we ran into a weird problem on the SpecialtyMatch dating sites. Certain SQL queries were taking so long to run that the web server would timeout the the page before the query had completed. What made this even weirder was the fact that I had set the timeout in the code to 1.5 minutes knowing the actual web page would timeout in 2 minutes. So technically the pages should have crashed and caught in my exception handling before the web server timed out the page. What made this an even bigger mystery was the fact that if I ran the exact same query that was timing out in Query Analyzer it would return in 14 seconds. Run the same query on the website and it would timeout.

At this point I started running lots of logging and performance monitoring on the SQL server trying to figure out this behavior. What I finally found out made total sense and at the same time shocked me. I had the SQL server configured to only allow 5 simultaneous user connections. The timeouts I was starting to see were not the queries timing out (which would have caused the exceptions I was expecting) but instead were the database connections timing out. This was masked a little bit because the connection pooling that .NET provides made the Open call to the database happen instantly even when there were no user connections left on the SQL server. The connection pool doesn't try and grab a connection from the pool until you actually run a query.

Now what is totally amazing to me is this meant that all we have been running two dating sites, forums, plus three other sites that are all database driven and they were executing perfectly for an entire year using only five connections to the database server. At some points we have had over 180 users on the dating sites. It just amazes me that all of that ran with everyone in a queue to use five connections. Just goes to show you that the connection pooling in .NET works very well . 

Posted at 11:35 AM     Read More  

Mon - December 13, 2004

.NET 


Last week I realized that almost all the programming I've done for the past 2 years has been .NET based programming. This occurred to me when I briefly had to fall back into the C++ based Win32 world to comically enough wrap up some legacy code to be called from a .NET application. My brief foray back into the Win32 world made me realize how much I hate programming in that medium. Is it a unicode string? Or maybe a multibyte string? Or just a normal string? Is it a C++ exception or a MFC exception? While Win32 is a mess it is very easy to understand how it got to the point in is today: Dos -> Win 3.1 -> Win32s -> Win32. Amazing Windows today will run applications that written in each of those technologies. This means that all the old and weird API's are carried forward into the next version. Which means you end up with an ugly mess of different APIs. Where .NET shines is taking all of that mess and wrapping it up in a very nice and clean and well organized interface. 

Posted at 12:58 AM     Read More  

Thu - September 16, 2004

Avoid ASP.NET Cookbook 


I'm a big believer in reading programming books. Even though I program everyday there are still large areas of programming that I don't use or don't use very often. And in some cases I'm in such a hurry that I'll use tunnel vision and not code something the best way because I don't have time to learn the ins and outs of an API. By reading I can be better the next time or can implement something differently in the future.

For the past two years or so I've done alot of ASP.NET programming. First as a contractor and then as a developer working on the web sites for SpecialtyMatch Networks . A year ago I picked up the most excellent C# Cookbook which is full of all kinds of very useful tidbits. I think even an advanced C# developer will find the book useful.

So when I heard that ASP.NET Cookbook was coming I got all excited at the prospect of getting the equivalent book but focused on ASP.NET instead of C#. My book arrived last week and I finally got a chance to sit down and read some of it today. This book is so bad that I'm returning it tomorrow. There is not one bit of useful information in this whole book. First off this is one of those books you open and it has tons of pages of source code. Each item has source for a web page (which takes a whole page of the book even though the ASP.NET aspect of the page is 1-5 lines). The the code behind source is listed in both VB.NET and C#. Then normally the next item in the book talks about how to do the previous item a little differently. So what do they do? Reprint the entire listings and change 1-2 lines in them. So this book comes in near to 1000 pages but 75% of the book is boring source listings.

Secondly the topics in this book are so simple that in most cases the MSDN help topics explain the same thing better. The whole first chapter is full of how to use a DataGrid, Repeater and DataList. Any experienced ASP.NET programmer can throw out the chapter. One item shows how to bind an ArrayList, the next item shows how to bind a Hashtable. Wow. This chapter could have had hope if it had gone into real topics like how to nest repeaters in repeaters, how to bind boolean fields using checkboxes in datagrids, how to use a datagrid with viewstate disabled (something they claim can't be done). The next chapter starts off even worse showing how to make the enter key select the OK button in a form automatically. They use a bunch of gibberish javascript that doesn't work on browsers other then Internet Explorer (they admit as much) when there are plenty of real world solutions to this that don't even have to use JavaScript.

In other words I highly recommend you avoid this title. I have no idea what the authors do for a living but I know they don't use ASP.NET in the real world. Or if they do, they aren't very good programmers.

I bought this title online from Barnes and Noble because Amazon was going to have it in stock later. This ends up helping me, the return policy allows me to take it back to my local store so I don't even have to worry about shipping it back, I plan on posting this review on both Barnes and Noble and Amazon to hopefully prevent others from buying this turd.  

Posted at 09:42 PM     Read More  


©