<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>The Ranting's Of A PsychoCoder</title>
        <link>http://geekswithblogs.net/PsychoCoder/Default.aspx</link>
        <description>Inside the mind of A PsychoCoder</description>
        <language>en-US</language>
        <copyright>Richard McCutchen</copyright>
        <managingEditor>psychocoder@dreamincide.net</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>The Ranting's Of A PsychoCoder</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/PsychoCoder/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>10 Types Of Programmers</title>
            <category>General</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2008/05/04/10-types-of-programmers.aspx</link>
            <description>I seen this posted on my favorite programming community &lt;a href="http://www.dreamincode.net/forums/index.php?showtopic=51033&amp;amp;hl=" target="_blank"&gt;&amp;lt;/dream.in.code&amp;gt;&lt;/a&gt; and just had to post it here on my blog. So, which category do you fall into? I think Im a mix of a few of these: The Ninja, The Paratrooper, and the Vince Neal (minus the partying and hangovers)&lt;br /&gt;
&lt;br /&gt;
#1: Gandalf&lt;br /&gt;
&lt;br /&gt;
This programmer type looks like a short-list candidate to play Gandalf in The Lord of the Rings. He (or even she!) has a beard halfway to his knees, a goofy looking hat, and may wear a cape or a cloak in the winter. Luckily for the team, this person is just as adept at working magic as Gandalf. Unluckily for the team, they will need to endure hours of stories from Gandalf about how he or she to walk uphill both ways in the snow to drop off the punch cards at the computer room. The Gandalf type is your heaviest hitter, but you try to leave them in the rear and call them up only in times of desperation.&lt;br /&gt;
&lt;br /&gt;
#2: The Martyr&lt;br /&gt;
&lt;br /&gt;
In any other profession, The Martyr is simply a “workaholic.” But in the development field, The Martyr goes beyond that and into another dimension. Workaholics at least go home to shower and sleep. The Martyr takes pride in sleeping at the desk amidst empty pizza boxes. The problem is, no one ever asked The Martyr to work like this. And he or she tries to guilt-trip the rest of the team with phrases like, “Yeah, go home and enjoy dinner. I’ll finish up the next three week’s worth of code tonight.”&lt;br /&gt;
&lt;br /&gt;
#3: Fanboy&lt;br /&gt;
&lt;br /&gt;
Watch out for Fanboy. If he or she corners you, you’re in for a three-hour lecture about the superiority of Dragonball Z compared to Gundam Wing, or why the Playstation 3 is better than the XB 360. Fanboy’s workspace is filled with posters, action figures, and other knick-knacks related to some obsession, most likely imported from Japan. Not only are Fanboys obnoxious to deal with, they often put so much time into the obsession (both in and out of the office) that they have no clue when it comes to doing what they were hired to do.&lt;br /&gt;
#4: Vince Neil&lt;br /&gt;
&lt;br /&gt;
This 40-something is a throwback to 1984 in all of the wrong ways. Sporting big hair, ripped stonewashed jeans, and a bandana here or there, Vince sits in the office humming Bon Jovi and Def Leppard tunes throughout the workday. This would not be so bad if “Pour Some Sugar on Me” was not so darned infectious.&lt;br /&gt;
&lt;br /&gt;
Vince is generally a fun person to work with, and actually has a ton of experience, but just never grew up. But Vince becomes a hassle when he or she tries living the rock ‘n roll lifestyle to go with the hair and hi-tops. It’s fairly hard to work with someone who carries a hangover to work every day.&lt;br /&gt;
&lt;br /&gt;
#5: The Ninja&lt;br /&gt;
&lt;br /&gt;
The Ninja is your team’s MVP, and no one knows it. Like the legendary assassins, you do not know that The Ninja is even in the building or working, but you discover the evidence in the morning. You fire up the source control system and see that at 4 AM, The Ninja checked in code that addresses the problem you planned to spend all week working on, and you did not even know that The Ninja was aware of the project! See, while you were in Yet Another Meeting, The Ninja was working.&lt;br /&gt;
&lt;br /&gt;
Ninjas are so stealthy, you might not even know their name, but you know that every project they’re on seems to go much more smoothly. Tread carefully, though. The Ninja is a lone warrior; don’t try to force him or her to work with rank and file.&lt;br /&gt;
&lt;br /&gt;
#6: The Theoretician&lt;br /&gt;
&lt;br /&gt;
The Theoretician knows everything there is to know about programming. He or she can spend four hours lecturing about the history of an obscure programming language or providing a proof of how the code you wrote is less than perfectly optimal and may take an extra three nanoseconds to run. The problem is, The Theoretician does not know a thing about software development. When The Theoretician writes code, it is so “elegant” that mere mortals cannot make sense of it. His or her favorite technique is recursion, and every block of code is tweaked to the max, at the expense of timelines and readability.&lt;br /&gt;
&lt;br /&gt;
The Theoretician is also easily distracted. A simple task that should take an hour takes Theoreticians three months, since they decide that the existing tools are not sufficient and they must build new tools to build new libraries to build a whole new system that meets their high standards. The Theoretician can be turned into one of your best players, if you can get him or her to play within the boundaries of the project itself and stop spending time working on The Ultimate Sorting Algorithm.&lt;br /&gt;
&lt;br /&gt;
#7: The Code Cowboy&lt;br /&gt;
&lt;br /&gt;
The Code Cowboy is a force of nature that cannot be stopped. He or she is almost always a great programmer and can do work two or three times faster than anyone else. The problem is, at least half of that speed comes by cutting corners. The Code Cowboy feels that checking code into source control takes too long, storing configuration data outside of the code itself takes too long, communicating with anyone else takes too long… you get the idea.&lt;br /&gt;
&lt;br /&gt;
The Code Cowboy’s code is a spaghetti code mess, because he or she was working so quickly that the needed refactoring never happened. Chances are, seven pages’ worth of core functionality looks like the “don’t do this” example of a programming textbook, but it magically works. The Code Cowboy definitely does not play well with others. And if you put two Code Cowboys on the same project, it is guaranteed to fail, as they trample on each other’s changes and shoot each other in the foot.&lt;br /&gt;
&lt;br /&gt;
Put a Code Cowboy on a project where hitting the deadline is more important than doing it right, and the code will be done just before deadline every time. The Code Cowboy is really just a loud, boisterous version of The Ninja. While The Ninja executes with surgical precision, The Code Cowboy is a raging bull and will gore anything that gets in the way.&lt;br /&gt;
&lt;br /&gt;
#8: The Paratrooper&lt;br /&gt;
&lt;br /&gt;
You know those movies where a sole commando is air-dropped deep behind enemy lines and comes out with the secret battle plans? That person in a software development shop is The Paratrooper. The Paratrooper is the last resort programmer you send in to save a dying project. Paratroopers lack the patience to work on a long-term assignment, but their best asset is an uncanny ability to learn an unfamiliar codebase and work within it. Other programmers might take weeks or months to learn enough about a project to effectively work on it; The Paratrooper takes hours or days. Paratroopers might not learn enough to work on the core of the code, but the lack of ramp-up time means that they can succeed where an entire team might fail.&lt;br /&gt;
&lt;br /&gt;
#9: Mediocre Man&lt;br /&gt;
&lt;br /&gt;
“Good enough” is the best you will ever get from Mediocre Man. Don’t let the name fool you; there are female varieties of Mediocre Man too. And he or she always takes longer to produce worse code than anyone else on the team. “Slow and steady barely finishes the race” could describe Mediocre Man’s projects. But Mediocre Man is always just “good enough” to remain employed.&lt;br /&gt;
&lt;br /&gt;
When you interview this type, they can tell you a lot about the projects they’ve been involved with but not much about their actual involvement. Filtering out the Mediocre Man type is fairly easy: Ask for actual details of the work they’ve done, and they suddenly get a case of amnesia. Let them into your organization, though, and it might take years to get rid of them.&lt;br /&gt;
&lt;br /&gt;
#10: The Evangelist&lt;br /&gt;
&lt;br /&gt;
No matter what kind of environment you have, The Evangelist insists that it can be improved by throwing away all of your tools and processes and replacing them with something else. The Evangelist is actually the opposite of The Theoretician. The Evangelist is outspoken, knows an awful lot about software development, but performs very little actual programming.&lt;br /&gt;
&lt;br /&gt;
The Evangelist is secretly a project manager or department manager at heart but lacks the knowledge or experience to make the jump. So until The Evangelist is able to get into a purely managerial role, everyone else needs to put up with his or her attempts to revolutionize the workplace.&lt;br /&gt;
&lt;!--IBF.ATTACHMENT_350915--&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121894"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121894" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/121894.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2008/05/04/10-types-of-programmers.aspx</guid>
            <pubDate>Mon, 05 May 2008 04:24:49 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/121894.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2008/05/04/10-types-of-programmers.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/121894.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/121894.aspx</trackback:ping>
        </item>
        <item>
            <title>Using WMI with C#</title>
            <category>C#</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2008/01/25/using_wmi_in_csharp.aspx</link>
            <description>&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;Recently I discovered the WMI (&lt;span id="header1"&gt;&lt;span id="Article1"&gt;&lt;span class="serif"&gt;&lt;span class="heading"&gt;Windows Management Instrumentation) and was stunned at what it can do. Granted, the discovery was completely by accident, but I found it none the less. The WMI can mistify a lot of developers, especially new ones, so granted I was a little nervous and leery when I dove further into it, but what I found is that it can be an invaluable tool.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span class="serif"&gt;&lt;span class="heading"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;I jumped into learning the System.Management Namespace (which is where the WMI resides by the way) and discovered that WMI can save a developer tons of research time, clock cycles (as it is faster than other methods) and hair (from pulling it out looking for a solution). &lt;font class="smallblack"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span class="serif"&gt;&lt;span class="heading"&gt;&lt;font size="2"&gt;&lt;font class="smallblack"&gt;When developing Windows applications, developers often need information a system, either local or remote, that although commonplace, can be very tough to get. There is using the remote registry, but I myself do not allow remote registry access as do many network admins. WMI is usually wide open on networks, assuming you have the privelidges necessary to query it, just as it is with remote registry querying/editing.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;&lt;span class="serif"&gt;&lt;span class="heading"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;There is another reason WMI appeals to so many developers nowadays, its called WQL (Windows Query Language). WQL allows us a developers to query &lt;font class="smallblack"&gt;WMI providers using a SQL-like query language. If you know the provider classes and the fields available, then you can get the info very easily. Lets say, for instance, that you wanted to see the capacity, used space and free space available on a CD-ROM, you WQL query would look like:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt;&lt;em&gt;&lt;strong&gt;"select * from Win32_LogicalDisk WHERE DriveType = 5"&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt; &lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt;You can then take that query, plug it into a ManagementObjectSearcher (a member of the System.Management Namespace), then use that to retrieve that particular information. In my example I populate the returned data into a Generic Dictionary&amp;lt;string,string&amp;gt;  list, you may chose to do otherwise. But to retrieve the information I spoke about earlier, here is how you would find that information about the CD-Row:&lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt; &lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt;  &lt;/p&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;public Dictionary&amp;lt;string, string&amp;gt; GetDriveInfo()&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;{&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;   &lt;font color="#99cc00"&gt; &lt;/font&gt;&lt;font color="#339966"&gt;//dictionary object to hold the values&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;    Dictionary&amp;lt;string, string&amp;gt; driveInfo = new Dictionary&amp;lt;string, string&amp;gt;();&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;   &lt;font color="#339966"&gt; //create our WMI searcher&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;    ManagementObjectSearcher searcher = new ManagementObjectSearcher(@"select * from Win32_LogicalDisk WHERE DriveType = 5");&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;   &lt;font color="#339966"&gt; //now loop through all the item found with the query&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;    foreach (ManagementObject obj in searcher.Get())&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;    {&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;       &lt;font color="#339966"&gt; //create the used space by subtracting the size from the free space&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;        double used = (double)obj["Size"] - (double)obj["FreeSpace"];&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;      &lt;font color="#339966"&gt;  //add all the items to the collection&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;        driveInfo.Add("FreeSpace", obj["FreeSpace"].ToString());&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;        driveInfo.Add("Capacity", obj["Capacity"].ToString());&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;        driveInfo.Add("UsedSpace", used.ToString());&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;    }&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;   &lt;font color="#339966"&gt; //return the info&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;    return driveInfo;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;Notice how simple that was, and how &lt;em&gt;ordinary&lt;/em&gt; it looks, it almost looks like you're querying a Database, but in fact you're querying a computer, either the system the application is running on, or a remote machine you have access to.&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/aa394173.aspx"&gt;MSDN&lt;/a&gt; has a great writeup on WQL, what the DriveType values are you see me using in my queries, so dont let this scare you off, in the long run it will be quite the time saver when developing applications. Lets say you need to know how much free space is available on a network drive, before WMI and WQL you would have to rely on trying a remote registry query (testy at best, and it has to be open on the machine), but with WMI its a simple WQL query then a search.&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;The WQL Query for retrieving all network drives is:&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt; 
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt;&lt;strong&gt;&lt;em&gt;"select name, FreeSpace from win32_logicaldisk where drivetype=4"&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt;Notice I altered this query, unlike the first one I showed, in this one I only want to return the name of the network drive and the freespace it contains, I seen no need to return all the information if all I really wanted was 2 pieces. That would be the equivilent of "SELECT * FROM Table_Name" when all you needed was the record ID's. Once again we will plug this query into a ManagementObjectSearcher, this time using a &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/system.management.selectquery.aspx"&gt;SelectQuery&lt;/a&gt;, another member of WQL and the System.Management Namespace:&lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt; &lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt;In this example I chose to populate a HashTable with the data returned, you, as with before, may chose to do it in a different fashion:&lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt; &lt;/p&gt;
&lt;p style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri"&gt;  &lt;/p&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt; &lt;font size="2"&gt;public Hashtable ReadFreeSpaceOnNetworkDrives()&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;        {&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;            &lt;font color="#339966"&gt;//create Hashtable instance to hold our info&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;            Hashtable driveInfo = new Hashtable();&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;         &lt;font color="#339966"&gt;   //query the win32_logicaldisk for type 4 (Network drive)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;            SelectQuery query = new SelectQuery("select name, FreeSpace from win32_logicaldisk where drivetype=4");&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;           &lt;font color="#339966"&gt; //execute the query using WMI&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;            ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;           &lt;font color="#339966"&gt; //loop through each drive found&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;            foreach (ManagementObject drive in searcher.Get())&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;            {&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;               &lt;font color="#339966"&gt; //add the name &amp;amp; freespace to our hashtable&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;                driveInfo.Add("Drive", drive["name"]);&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;                driveInfo.Add("Space", drive["FreeSpace"]);&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;            }&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;            return driveInfo;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;        }&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div style="FONT-SIZE: 11pt; MARGIN: 0in"&gt;&lt;font size="2"&gt;So, as you can see the WMI can be an invaluable tool to learn, and in my opinion its worth the time to learn. WMI can save you time, it definately, as shown in the 2 methods, much simpler than trying a remote registry query, and I think as more and more developers discover and learn how to use WMI it will definately grow.&lt;/font&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118904"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118904" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/118904.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2008/01/25/using_wmi_in_csharp.aspx</guid>
            <pubDate>Fri, 25 Jan 2008 13:10:39 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/118904.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2008/01/25/using_wmi_in_csharp.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/118904.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/118904.aspx</trackback:ping>
        </item>
        <item>
            <title>Freelance sites - Good or Bad</title>
            <category>General</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2008/01/05/freelance_sites.aspx</link>
            <description>&lt;p&gt;Here is the quandary most coders face. Most of us are extremely talented, and from time to time venture out into the freelance world, especially students, most using a coding site like &lt;a target="_blank" href="http://www.kasamba.com"&gt;Kasamba&lt;/a&gt;, &lt;a href="http://www.rentacoder.com"&gt;Rent-A-Code&lt;/a&gt; and some other up and coming ones. The problem we face is there are coders on there, with little or no talent at all, offering to do entire e-commerce sites for $100. Does that not make it difficult for those of us who actually know what we're doing?&lt;/p&gt;
&lt;p&gt;now dont get me wrong, I do freelance work on &lt;a target="_blank" href="http://www.kasamba.com"&gt;Kasamba&lt;/a&gt; to suppliment my income, and most people are expecting the world for the price of a piece of bubble gum. But since it's still a fairly small site (compared to others), I have been able to let the clients I do get that they get what they pay for, and if they hire me I have my MCAD and MCSD in both C# and VB.Net and that helps sway their decision.&lt;/p&gt;
&lt;p&gt;My main question in this rant is this, do these freelancers that offer to do the world for the price of bubble gum, then turn in a bug ridden, anti-optomized, "spaghetti" filled .Net code application, does that not make clients hesitant to hire those of use that truly know what we're doing, know how to properply implement OO programming, those of use that know how to actually implement the proper coding standards and lines of code to get what we're looking for, thos of us who dont live by the rule "Throw enough code at it and it'll work".&lt;/p&gt;
&lt;p&gt;These sites have made me money, I will admit, but these wannabe coders do, at times, make it hard to get a freelance gig at even close to what its worth, am I wrong here? Am I the only one here troubled that this is happening, that these people are making it harder and harder for potential clients to know who is for real, and who only knows how to talk the talk and when it comes time to walk the walk they're on some coding forum trying to set it done for them.&lt;/p&gt;
&lt;p&gt;Freelance sites have their pros and cons. They allow the potential client to get programming work done for less than they can if they go through a large Development firm, but the high number that get burned by these &lt;em&gt;wannabe programmers&lt;/em&gt; make the clients leary about every other programmer they run across, even if they happoen to find an excellent programmer, they'll always be hesitant, and more likely to &lt;em&gt;micro-manage&lt;/em&gt; the entire project.&lt;/p&gt;
&lt;p&gt;Most freelance sites pay on time, pay what they're supposed to, but there have been times where I dont get my pay on-time, where I dont get paid what Im owed, but most are very good at fixing the problems.&lt;/p&gt;
&lt;p&gt;I like working for &lt;a target="_blank" href="http://www.kasamba.com"&gt;Kasamba&lt;/a&gt;, it helps supplement my income now that Im on medical leave (yet again), but I really believe the number of wannabe coder are making it harder and harder for experience, knowledgable coders to find extra freelance work. What is your opinion on this?&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118278"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118278" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/118278.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2008/01/05/freelance_sites.aspx</guid>
            <pubDate>Sat, 05 Jan 2008 22:53:52 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/118278.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2008/01/05/freelance_sites.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/118278.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/118278.aspx</trackback:ping>
        </item>
        <item>
            <title>Belated Happy Holidays</title>
            <category>General</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2008/01/03/belated-happy-holidays.aspx</link>
            <description>&lt;p&gt;Well this is a belated Happy Holidays to everyone. I know it's quite a bit late but I hope all had a happy and wonderful Holiday season, I know that besides all the snow I did. Where I live (Pacific Northwest) we've kind of been in a little snow storm you can see from my &lt;a target="_blank" href="http://picasaweb.google.com/PsychoCoder1968/MyWinterWonderland"&gt;Online Photo Album&lt;/a&gt; the kind of weather we've been having here in the mountains.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Anyways, for Christmas I made out like a bandit, in my opinion. I got:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Full set of reversible Craftsman Ratchet Wrenches Set &lt;/li&gt;
    &lt;li&gt;32 Piece Craftsman Screwdriver Set &lt;/li&gt;
    &lt;li&gt;16 Piece Craftsman Plier Set &lt;/li&gt;
    &lt;li&gt;Hew hunting coat &amp;amp; gloves &lt;/li&gt;
    &lt;li&gt;New Microsoft keyboard, 4000 edition &lt;/li&gt;
    &lt;li&gt;Few odds &amp;amp; end gifts &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It was a fitting end to the year, I spent most of New Years Eve writing code, which it seems is something I always seem to be doing, at least from home since Im out of work on medical leave. Last month I started having these episodes of blankness, legs stop working, arms stop working, all kinds of stuff, well I had one on the way to work I had one and drove my car off a 14 foot revene. Nice way to start your day if I do say so myself.&lt;/p&gt;
&lt;p&gt;They've ruled our back, neck &amp;amp; brain issues (no brain tumor thank God) and I go in for a neurological exam on 22JAN so they can try and see what's happening with me. Even through all that, I had such a great Holiday season, since Ive been out of work Ive been able to spend so much time with my family, somthing I couldnt do before since I would leave at around 5:45AM and I would get home after 6:30PM after work.&lt;/p&gt;
&lt;p&gt;This has been an opportunity that has been handed to me, spend time with my family, and see how far I can push C# at the same time, nice way to spend some time if you ask me. This has been a crappy year, medically speaking, for me. First I had 3 surgeries in the first 1/2 of the year (long story, Ill explain someday), now Im going through this. I sure am hoping for a better medical 2008 thats for sure &lt;img alt="" src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/tounge_smile.gif" /&gt;&lt;/p&gt;
&lt;p&gt;Well I hope everyone has an enjoyable, great 2008, see you in the blogospehere later&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118216"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118216" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/118216.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2008/01/03/belated-happy-holidays.aspx</guid>
            <pubDate>Thu, 03 Jan 2008 22:16:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/118216.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2008/01/03/belated-happy-holidays.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/118216.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/118216.aspx</trackback:ping>
        </item>
        <item>
            <title>Are newbie programmers bad for business?</title>
            <category>General</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2007/10/26/Are-newbie-programmers-bad-for-business.aspx</link>
            <description>&lt;p class="MsoNormal"&gt;Just the other day I read a post on a blog about this very same&lt;u&gt; &lt;a target="_blank" href="http://www.dreamincode.net/forums/index.php?automodule=blog&amp;amp;blogid=114&amp;amp;showentry=509"&gt;topic.&lt;/a&gt;&lt;/u&gt; , so it got me wondering and thinking. This poster has some incredibly powerful arguments, and on most of his points I would have to agree. As one who has been in this industry a very long time, I have seen programmers come and go. Some who were extremely talented and knowledgeable were eventually pushed out to pasture by newbie programmers who claimed to know what they were doing, who talked the talk real well, and since they were new and young they would work cheaper than the older more experienced programmers, but when it came time they couldn’t cut it and were let go.&lt;br /&gt;
&lt;br /&gt;
This scenario happens all too often in this industry. Granted, it happens in all industries across the board, but it seems that it's more evident in the IT world. I may feel that way because I’m in that industry so I see it often, or maybe because it's actually far more prevalent than anyone thinks. Before I go any further, let me tell you that I am in no way shape or form saying I think I’m some sort of "&lt;span style="font-style: italic;"&gt;Super programmer&lt;/span&gt;", because that is not how I think of myself. Do I think I am good at what I do, what kind of programmer would I be if the answer to that question wasn’t yes? But I am by no means saying I’m superior than the next guy, I just may have more experience than he does, but it does irk me to see an extremely talented programmer lose out to a newbie simply because the newbie will work for less.&lt;br /&gt;
&lt;br /&gt;
Am I being discriminatory towards new programmers, I don’t feel I am, I am simply pointing out the pink elephant in the room all too many are too willing to ignore. I, as an experienced programmer, have absolutely no problem helping a new programmer, in fact I encourage all older, experienced programmers to help the new ones, show them how things are supposed to be done, show them that things are indeed done differently in the real world than in a classroom setting. That is not what I have a problem with, what I have a problem with are those that want to become a programmer but aren’t willing to put in the work required to be a good one.&lt;br /&gt;
&lt;br /&gt;
You know the ones, the ones that frequent programming forums asking for code to complete an assignment, the ones who not one time ask for help, but almost demand the solution to their problems. And this section seems to be growing by leaps and bounds, especially since outsourcing has become so prevalent in the US. I even have people who find my blog here and will email me from it asking for code to complete their assignment. I get questions, actually they border on the "&lt;span style="font-style: italic;"&gt;demands&lt;/span&gt;" line, for code to do a particular process, one even asked for the complete source code for a piece of software he conned someone into hiring him to create. It is this brand of "&lt;span style="font-style: italic;"&gt;programmers&lt;/span&gt;" I feel is ruining the experienced programmer, and quite possibly this industry as a whole.&lt;br /&gt;
&lt;br /&gt;
Please don’t get me wrong, not all new programmers are in this class, but the section is growing daily, and those that are that way really sour most experienced programmers on the newbie in general, leaving some who are actually willing to put in the hours to make it in this industry hanging in the wind when it comes to finding a solution. This scenario is almost as destructive as the programmer who bluffed his way through college to get his degree taking a job from a programmer who truly knows what he's doing. This scenario will cause many, who might have ended up as really talented programmers, to leave the industry all together, which is bad also.&lt;br /&gt;
&lt;br /&gt;
I feel it our responsibility, those of us who are seasoned experienced programmers, to offer a helping hand to those who are trying to break into our industry. But I draw the line at simply handing solutions, whether it be a single line of code, or an entire application, to those who aren’t even willing to try, who aren’t willing to put in the time and effort it takes to become a talented programmer. I know when I broke into the industry back in the late '80's the seasoned veterans weren’t too helpful at all when I was looking for assistance, and trust me I wasn’t one of those who sought handouts, so I try to make things a little more friendly for the newcomers, try to make things a little more conducive to expanding our base of talented programmers. But I refuse to add to the growing number of programmers, if that’s what you want to call them, who bluffed their way through school, who took others solutions and simply put their name on it to get good marks, and I strongly urge my fellow programmers to take the same stance.&lt;br /&gt;
&lt;br /&gt;
If we don’t stop it now, one day we will be run out of our jobs by those who aren’t really qualified for the job, will be beat out of positions, or lose promotions simply because the bluffer talks a good talk, and will work for far less than we will. So, no I don’t think all new programmers are bad for business, there are a large group of new programmers who are willing to go above and beyond to learn our trade, to better themselves, and ultimately our industry. On the other hand there is a growing section who are bad for business, who get through school and life on someone else's coat tails, who made it into the industry based on the code someone else wrote, those are the ones I feel are bad for business, those are the ones we need to put a stop to.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=116376"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=116376" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/116376.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2007/10/26/Are-newbie-programmers-bad-for-business.aspx</guid>
            <pubDate>Fri, 26 Oct 2007 18:25:06 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/116376.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2007/10/26/Are-newbie-programmers-bad-for-business.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/116376.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/116376.aspx</trackback:ping>
        </item>
        <item>
            <title>Pitfalls with Merge Replication in a SQL 2000 Environment</title>
            <category>SQL Server</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/pitfalls_with_merge_replication_in_sql2000.aspx</link>
            <description>&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;br /&gt;
The following article will provide recently found issues discovered when planning a system seperation using Merge Replication using Microsoft SQL 2000 Database Server. These issues (or pitfalls) were discovered first-hand in a real world environment at the company I work for when we were  doing a monthly release of our in-house software, while getting ready for a complete System Seperation using Merge Replication. The resolutions offered in this article have been tested and are known to work.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Background&lt;/h3&gt;
&lt;br /&gt;
The company I work for made a decision that in order to keep up with the continuing growth of the company and our ever expanding customer base the best way to improve the performance of both our web presence and our in-house applications was to do a complete System Seperation by co-locating our database servers off-site, the cut down on the use of bandwidth and increase the overall performace of our websites. The decision was made to move all the web data off-site and use Merge Replication in SQL 2000 to keep the in-house data and the web data synchronized, since the in-house applications needed use of the web data as well.&lt;br /&gt;
&lt;br /&gt;
The databases, and the required objects within the database (stored procedures, tables, user-defined functions, triggers, etc) were marked for replication and all was moving ahead smoothly. When we create our database scripts, whether it be triggers, alter table scripts, or stored procedures, we employ the use of an in-house created version control header to prevent old scripts from being promoted to production. In the header template the script it searches the SysObjects System Table for a procedure with that name. If the procedure is found, it is dropped then recreated, incrementing&lt;br /&gt;
the version of the script, otherwiseit simply creates the stored procedure as normal. This is when the first pitfall was recognized. If a stored procedure has been marked for replication using Merge Replication you cannot simply drop the procedure and re-create it, you must do the search (as normal for us), if the procedure is found then the script alters the procedure, if it isn't found then it is created (a blank procedure with the parameter list) then it is altered to add the "meat" of the procedure. This was a simple enough issue and resolution, causing a minor setback, but nothing we couldn't recover from in a small amount of time.&lt;br /&gt;
&lt;br /&gt;
The next pitfall, discovered by myself during the promotion and build of a monthly release of an in-house application, wasnt quite as simple to fix, and could have caused a huge problem if it had not been discovered prior to the system seperation. Had that happened, if this situation had been encountered (we'll get to the "situation", or sequence of events momentarialy) while doing one of the monthly builds for anyone of the in-house application after the seperation it would have posed serious problems for my company&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Scenario:&lt;/h3&gt;
While making updates for my application for the next monthly release, I created and ran an alter table script because I needed to add some additional columns to a table. I created the script and ran it on the dev server, a mirror image of production, or so I thought, and it ran fine, no problems at all, so I continued with my tasks for the monthly release. It wasn't until it was time to promote the current monthly release to the QA Department that the pitfall was discovered. While running one of the Alter Table scripts I created, the following error was displayed:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="BACKGROUND-COLOR: rgb(192,192,192)"&gt;&lt;em&gt;&lt;font style="BACKGROUND-COLOR: #ffffff"&gt;&lt;font face="Arial"&gt;Version: 01.00 of: PAT dbo.*Alter_Table_Script.pat  (1 row(s) affected)  Server: Msg 4931, Level 16, State 1, &lt;br /&gt;
Line 3 Cannot add columns to table * 'Table_Name' because it is being published for merge replication. - &lt;br /&gt;
Aborting!!!&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;/em&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Well as you can imagine when I seen this I had a feeling this wasn't good news. It was 9PM at night and I knew there was nothing I could do until morning when the DBA arrive at work.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;The next morning:&lt;/h3&gt;
So 7:00 AM rolls around the next day and I am already at work with the DBA trying to find out what went wrong, &lt;br /&gt;
and what kind of impact this had on our system seperation project. After a little research he thought the system seperation was dead, unless we could upgrade to SQL 2005 and in a hurry, as the seperation was mere weeks away. There was some fierce searching going on in the office, Google was being taxed, online SQL 2000 reference sites, in-house SQL Library (which is actually quite extensive), there were 3 of us desperately looking for a resolution to our problem.&lt;br /&gt;
&lt;br /&gt;
The first solution turned out to be not so reliable. When a database is marked for replication, then s&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"&gt;ubsequent&lt;/span&gt; tables are marked, SQL creates a corresponding table for the marked table, the tables are named &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;conflict_DBName_TableName&lt;/span&gt;, so I started building a query based on that, until we realized that SQL 2000 doesn't clean up after itself, when a table is no longer marked for Merge Replication that table isnt deleted, thus offering the possibility of "false positives" when the query is ran. So of course, this solution was scrapped. That's when the thirs person rusing to find a solution found the&lt;br /&gt;
end all be all of solutions.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Solution:&lt;/h3&gt;
When a database is marked for Merge Replication SQL 2000 creates a new database, aptly named  &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;distribution&lt;/span&gt;, inside this database is a table named "MSArticles". It is in this table that all the names of all objects that have been marked for Merge Replication are stored, along with the object type.Then there is a system stored procedure names &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;sp_repladdcolumn&lt;/span&gt;  but of course this stored procedure can only be ran on tables that have been marked for replication, it will fail otherwise. This gave me what I needed, what I had to do was first check and see if the database has been marked for Merge Replication, as if its not then the search of&lt;span style="FONT-STYLE: italic"&gt;&lt;span style="FONT-WEIGHT: bold"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;distribution.dbo.MSArticles &lt;/span&gt; will cause an error, thus failing all together. Taking this all into consideration, I wrote the below script that did everything I needed it to do, tested it, then released it to the other developers on the team.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="COLOR: rgb(255,0,0)"&gt;* Denotes table name and script name changed&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Using the code&lt;/h3&gt;
The script I came up with below will have certain information missing, information that is specific to our Version Control Header, and propietary to the company I work for, I will however show the script part that actually:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
    &lt;li&gt;Checks if the database has been marked for Merge Replication &lt;/li&gt;
    &lt;li&gt;Check if the table actually exists (just a double check I like to perform, I don't like surprises) &lt;/li&gt;
    &lt;li&gt;Checks to see if the table has been marked for merge replication &lt;/li&gt;
    &lt;li&gt;Alter the table accordingly &lt;/li&gt;
&lt;/ol&gt;
&lt;font face="Arial"&gt;/&lt;em&gt;*&lt;br /&gt;
Below is the script used to check required elements so that an Alter Table script can be created and ran on a SQL 2000 database  that has been marked for Merge Replication. First check if the database has been marked for replication.&lt;br /&gt;
  If it hasnt and you search distribution.dbo.MSarticles you will an "Invalid Object Name" error&lt;br /&gt;
*/&lt;br /&gt;
IF EXISTS(SELECT * FROM master..sysdatabases WHERE name='distribution')&lt;br /&gt;
    BEGIN&lt;br /&gt;
        /* Next make sure table exists in the database*/&lt;br /&gt;
        IF EXISTS (SELECT * FROM sysobjects WHERE type = 'U' AND name = 'Table_Name')&lt;br /&gt;
            BEGIN&lt;br /&gt;
                /* Now check if the table has been marked for replication*/&lt;br /&gt;
                IF EXISTS (SELECT Name, CASE(xtype) WHEN 'U' THEN 'User table' ELSE xtype END AS ObjectType FROM sysobjects  &lt;br /&gt;
                WHERE NAME IN (SELECT source_object from distribution.dbo.MSarticles) AND Name = 'Table_Name')&lt;br /&gt;
                    BEGIN    /*Table is marked for replication*/&lt;br /&gt;
                        /*&lt;br /&gt;
                         TODO: Process for adding a new column&lt;br /&gt;
                         Repeat as necessary for all columns to be added &lt;br /&gt;
                        Exec sp_repladdcolumn @source_object = N'[dbo].[Table_Name]', @column = N'column_name', &lt;br /&gt;
                        @typetext = N'char(5) null', @publication_to_add = N'all'&lt;br /&gt;
                        */&lt;br /&gt;
                        Exec sp_repladdcolumn @source_object = N'[dbo].[Table_Name]', @column = N'column_name', &lt;br /&gt;
                        @typetext = N'TIMESTAMP NOT NULL', @publication_to_add = N'all'&lt;br /&gt;
                    END&lt;br /&gt;
                ELSE&lt;br /&gt;
                /* Table isnt marked for replication so alter as normal*/&lt;br /&gt;
                    BEGIN&lt;br /&gt;
                        ALTER TABLE&lt;br /&gt;
                            Table_Name&lt;br /&gt;
                            /* Add your columns here*/&lt;br /&gt;
                        ADD&lt;br /&gt;
                            /* Repeat as necessary for the columns you need*/&lt;br /&gt;
                            Column_Name Data_Type&lt;br /&gt;
                    END&lt;br /&gt;
            END&lt;br /&gt;
    END&lt;br /&gt;
ELSE&lt;br /&gt;
    /* The table is in a database that hasnt been marked for Merge Replication. THis check needs to be done, if you query the&lt;br /&gt;
       distribution.dbo.MSArticles table in a database that hasnt been marked for Merge Replication the whole query will fail&lt;br /&gt;
       as that database &amp;amp; table dont exist.&lt;br /&gt;
    BEGIN&lt;br /&gt;
        ALTER TABLE&lt;br /&gt;
            Table_Name&lt;br /&gt;
            /* Add your columns here*/&lt;br /&gt;
        ADD&lt;br /&gt;
            /* Repeat as necessary for the columns you need*/&lt;br /&gt;
            Column_Name Data_Type&lt;br /&gt;
    END&lt;/em&gt;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That is the script we now use for our alter table scripts since many of our database and database objects have been marked for Merge Replication. As for other object, such as Stored Procedures, the old way our script worked for to simply query &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;sysobjects&lt;/span&gt; to see if the procedure&lt;br /&gt;
existed, if it did then drop it and recreate it (and with our Version Control Header the version would increment, preventing old versions from being promoted to live, but that's a different article all together). So we as a team came up with this script for our Stored Procedures:&lt;br /&gt;
&lt;br /&gt;
&lt;font face="Arial"&gt;&lt;br /&gt;
&lt;em&gt;/* First check sysobjects to see if the procedure exists, if it doesnt exist then we need to create&lt;br /&gt;
a shell of the procedure. Use Dynamic SQL as the Create Procedure is supposed to be the first&lt;br /&gt;
line in a stored procedure, so you cant do the norm within an IF block*/&lt;br /&gt;
IF NOT EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'Stored_Procedure_Name')&lt;br /&gt;
BEGIN&lt;br /&gt;
    PRINT 'Creating Procedure Stored_Procedure_Name'&lt;br /&gt;
    DECLARE @SQL varchar(8000)&lt;br /&gt;
    SET @SQL = 'CREATE PROCEDURE Stored_Procedure_Name    /* Param List */ &lt;br /&gt;
    AS'&lt;br /&gt;
    EXEC (@SQL)&lt;br /&gt;
END&lt;br /&gt;
PRINT 'Altering Procedure Stored_Procedure_Name'&lt;br /&gt;
GO&lt;br /&gt;
/* Then ALTER the procedure like you would alter any normal stored procedure*/&lt;br /&gt;
ALTER PROCEDURE Stored_Procedure_Name&lt;br /&gt;
    /* Param List */&lt;br /&gt;
AS&lt;/em&gt;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
That's is, this is how to overcome the pitfalls discovered while doing a Merge Relication in a SQL 2000 database.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;Points of Interest&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
This scenario was corrected in SQL 2005, and I imagine in subsuquent release of the database program so if you aren't running SQL 2000 then this shouldn't be an issue. If, however, you are running SQL 2000 and are planning a Merge Replication then this information needs to be brought to the attention of your DBA. Chances are he already knows this, but if he doesn't then you will save him, and your company a ton of headaches.&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115724"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115724" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/115724.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/pitfalls_with_merge_replication_in_sql2000.aspx</guid>
            <pubDate>Sun, 30 Sep 2007 13:57:13 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/115724.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/pitfalls_with_merge_replication_in_sql2000.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/115724.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/115724.aspx</trackback:ping>
        </item>
        <item>
            <title>Are you a coding perfectionist?</title>
            <category>General</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/coding_perfectionist.aspx</link>
            <description>&lt;p&gt;When writing code I would have to classify myself as a coding perfectionist, which can be a good thing, and at the same time a bad thing. When creating a project, I have found myself writing code for an entire work day (8 hours for the most of us, sometimes longer if it's a pressing release), then I go home and research what I was working on during the day.&lt;br /&gt;
&lt;br /&gt;
During that research I find that I could have done something a little better, maybe add a little more speed to the processing, maybe use a couple less clock cycles that before, and think to myself "&lt;em&gt;Man why didn't I think of doing it that way?&lt;/em&gt;". So what do I do the next morning when I get to work, you guessed it, I rewrite as much as I have to to implement what I read the night before, trying to squeeze the last bit of performance out of my process.&lt;/p&gt;
&lt;p&gt;The good point about being a perfectionist is this, beings that I'm aways striving for perfection in my code and applications ensures that my code is always efficient, my objects are always destroyed once they're no longer needed, my processes don't cause memory leaks, its all around efficient programming. This is something all programmers should strive for, though sadly, not all do, but thats a topic for a different post.&lt;/p&gt;
&lt;p&gt;The good point of being a coding perfectionist can also turn out to be the bad point, those of you who are also coding perfectionist will relate to what I'm about to say. Imagine living your life always thinking about the code you wrote earlier that day, the day before, 2 weeks ago, a month ago, you get the picture. Imagine always running it through your head to see if you could have done something different, made a loop more efficient, moved a Global to inside a method to free up that small amount of memory. Now imagine you do this 24/7, even weekends, well thats me.&lt;/p&gt;
&lt;p&gt;Coding is such a part of me that I strive for perfection, even at the cost, some say, of my sanity, and any social life I could ever hope for. I know it's a given that all programmers should strive for efficient, perfect code, but I haven't found the happy medium between looking for that coding nirvana, that ideal loop or pointer or class, and my own mental stability. Now I'm not saying I'm mentally unstable, that was, at the time, the best word I could come up with. I have all my mental faculties, I can spell my name, hell I can even remember my address :) But sometimes I spend so much time obsessing over my code, how to make it better, how to make it faster, that I often lose track of time and place for long periods of time.&lt;/p&gt;
&lt;p&gt;In fact, this is my first blog post since my surgery because Ive spent so much time writing code, then re-writing it to make it better, then re-re-rewriting it to make it even faster, and so much time looking for better, harder things to program that I almost forgot all about this blog. Take today for instance, at the time I'm writing this post its 29SEP 8:17 AM PST, and I've been at my computer since 4AM PST, and, you guessed it, Ive been coding this entire time. Ive been rewriting code Ive written for this clients Social Network site, trying to make it cleaner, faster, better than before. I live by the "&lt;em&gt;We can re-build it, we have the technology&lt;/em&gt;" theory: If something can be coded, it can always be coded better.&lt;/p&gt;
&lt;p&gt;I have obsessed over this code so much, that quite frankly, I'm almost past my deadline date, simply because there were parts I just knew I could improve on, a loop that could be made smaller, moving functionality to a class or a Web Service, something, anything, to make it faster than before. And believe it or not, I accomplished my goal, I took away about 2.3 seconds of processing time in a couple database queries. Now I know some of you are going to say "&lt;em&gt;2.3 seconds, was it really worth all that effort for such a small improvement?"&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And my answer to you is a resounding yes. Think about it this way, if you improve a process by 2.3 seconds, now multiply that by, say 500 users at once, thats quite a few clock cycles you've saved on a little 2.3 second decrease in processing time. But also, to a coding perfectionist, improving a process by a mere 2.3 seconds is what we live for, its what drives us 24/7, that is indeed our coding nirvana. When we're able to accomplish this we feel as if we've conquered the world, and we know it's going to be a good day for us.&lt;/p&gt;
&lt;p&gt;So remember, being a coding perfectionist is a double edged sword, though it turns out great, efficient code, it also turns out exhausted, obsessed coders. There's a reason I've had the name &lt;strong&gt;PsycoCoder &lt;/strong&gt;for so many years, and that name is my personal badge of honor. Now I'm off to write some more "&lt;em&gt;perfect&lt;/em&gt;" code :)&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115723"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115723" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/115723.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/coding_perfectionist.aspx</guid>
            <pubDate>Sun, 30 Sep 2007 13:30:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/115723.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/coding_perfectionist.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/115723.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/115723.aspx</trackback:ping>
        </item>
        <item>
            <title>Introduction to Web Services in C#</title>
            <category>C#</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/intro_to_web_services.aspx</link>
            <description>&lt;p&gt;I posted a tutorial on my favorite programming forum &lt;a target="_blank" href="http://dreamincode.net"&gt;&amp;lt;/dream.in.code&amp;gt;&lt;/a&gt;, and thought Id go ahead and share it on my blog as well. One question I get all the time in programming communities, always by young, new programmers, is how to work with web Services in .Net. It was these questions that lead me to writing the tutorial I posted on Dream.In.Code. &lt;/p&gt;
&lt;p&gt;I guess before you can show someone how to create and consume a Web Service, you need to ensure they know and understand what a Web Service actually is. The following is the easiest, simplest definition I've been able to come up for "What is a web service":&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;What is a Web Service you say? Well a Web Service is very general model for building applications that can be implemented for any operating system that supports communication over the web. To some this may sound a lot like a Web Site, but that is not the case, there are many differences between the two.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Here are the main differences between a Web Service and a Web Site:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font face="Arial"&gt;Web Site has an interface - Web Service has no interface&lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font face="Arial"&gt;Web Site is designed to interact with people - Web Service is designed to interact with other applications&lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font face="Arial"&gt;Web Site is designed to work with web browser clients - Web Service is designed to work with any type of client or device&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So as you can see, a Web Service and a Web Application have almost the same role, they just go about fulfilling that role in vastly different ways. A Web Service uses &lt;a target="_blank" href="http://www.w3.org/Protocols/rfc2616/rfc2616.html"&gt;HTTP (Hypertext Transfer Protocol)&lt;/a&gt; and &lt;a target="_blank" href="http://www.w3.org/Protocols/rfc2616/rfc2616.html"&gt;SOAP (Simple Object Access Protocol)&lt;/a&gt; to transfer data to and from the clients. Data sent to and from the Web Service is rendered into XML so the Web Service can read it, then it is sent back to the slient, which then renders the returned XML into the format it was expecting.&lt;/p&gt;
&lt;p&gt;First, lets take a look at creating a simple Web Service. To do this, open Visual Studio, once it loads click &lt;strong&gt;File&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Website&lt;/strong&gt;, when the &lt;strong&gt;New Project Dialog&lt;/strong&gt; opens, select Web Service from the list of available projects, then for &lt;strong&gt;Location &lt;/strong&gt;select either HTTP or File System (your own IIS), and lastly for &lt;strong&gt;Language&lt;/strong&gt; select C#.&lt;/p&gt;
&lt;p&gt;When the project is created it creates a Service.amsx and Sercive.cs file, you can either rename these, or delete and add new ones with the name of SampleService asmx and SampleService.cs.Now double-click on SampleService.cs to open the code file, then make sure you have the following references at the top of your class:&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;using System;&lt;br /&gt;
using System.Web;&lt;br /&gt;
using System.Web.Services;&lt;br /&gt;
using System.Web.Services.Protocols;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Configuration;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;If all the references aren't there, add the ones that are missing. Next, you will notice the first 2 lines are out of the ordinary, if you've never created a Web Service these two lines are downright weird:&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;[WebService(Namespace = "http://tempuri.org/")]&lt;br /&gt;
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Heres whats going on here, line 1 declares the Web Service's &lt;strong&gt;Namespace,&lt;/strong&gt; and you might now be wondering &lt;em&gt;Well whats a namespace? &lt;/em&gt;Well luckily theres an answer to that: &lt;a target="_blank" href="http://tempuri.org"&gt;Tempuri.Org&lt;/a&gt; defines a Web Service Namespace as:&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;Each XML Web Service needs a unique namespace in order for client applications to distinguish it from other services on the Web.  By default, ASP.Net Web Services use http://tempuri.org/ for this purpose.  While this suitable for XML Web Services under development, published services should use a unique, permanent namespace.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;Your XML Web Service should be identified by a namespace that you control.  For example, you can use your company's Internet domain name as part of the namespace.  Although many namespaces look like URLs, they need not point to actual resources on the Web.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The next line of the first section of the Web Service uses the &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/system.web.services.webservicebindingattribute.aspx"&gt;WebServiceBinding Method&lt;/a&gt; to create the Web Service's version of an &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/87d83y5b(VS.71).aspx"&gt;Interface&lt;/a&gt;. After those 2 lines then you have your Initializer, which is, of course, the same as any other class. Here you can instantiate any objects you need used in each instance of the service:&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;public SampleService () &lt;br /&gt;
{&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;    //Uncomment the following line if using designed components &lt;br /&gt;
    //InitializeComponent(); &lt;br /&gt;
}&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Nothing new there, now we get to jump into the heart of a Web Service, which is, of course, to make it do something, to perform some service. When you create your methods, if you want them to be visible from the client thats consuming the service, you have to add the &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/byxd99hx(VS.80).aspx"&gt;[WebMethod()] Attribute&lt;/a&gt; to it. This tells the service that its ok to expose that method to the client which is consuming it.&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Since this is just a simple, basic Web Service it only has a single method, just to show you what can be done with a Web Service. Since this service is communicating with a Sql Database, it needs access to the &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/system.data.sqlclient(VS.71).aspx"&gt;System.Data.SqlClient Namespace&lt;/a&gt;. There are other Namespaces the service will use, we listed them above, but lets take a closer look at them:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;System Namespace&lt;/strong&gt; - Base class for all Namespace's&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/system.web.aspx"&gt;System.Web&lt;/a&gt; - Provides classes and interfaces required for server/browser communication&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/System.Web.Services.aspx"&gt;System.Web.Services&lt;/a&gt; - Provides all the functionality required to create a Web Service&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/System.Web.Services.protocols.aspx"&gt;System.Web.Services.Protocols&lt;/a&gt; - Provides all required protocols the Web Service needs to transfering data&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/System.Configuration.aspx"&gt;System.Configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since the is an example for a beginner with Web Services, our sample service has but a single method in it, &lt;strong&gt;GetAllUserInfo&lt;/strong&gt;. This method is designed to:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Query a SQL Server&lt;/li&gt;
    &lt;li&gt;Retrieve all the information for all users in the system&lt;/li&gt;
    &lt;li&gt;Populate a &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/system.data.dataset.aspx"&gt;DataSet&lt;/a&gt; using a &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.aspx"&gt;SqlDataAdapter&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Pass the DataSet back to the client.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now lets take a look at the code for this method:&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;/// &amp;lt;summary&amp;gt;&lt;br /&gt;
/// Here we're going to create a [WebMethod] that&lt;br /&gt;
/// can be called from an aspx page, then return&lt;br /&gt;
/// a populated DataSet to the calling aspx page&lt;br /&gt;
/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
/// &amp;lt;returns&amp;gt;A dataset popululated with the Members informaiopn&amp;lt;/returns&amp;gt;&lt;br /&gt;
[WebMethod]&lt;br /&gt;
public DataSet GetAllUserInfo() &lt;br /&gt;
{&lt;br /&gt;
    //Build the SqlCilent Objects we need&lt;br /&gt;
    SqlConnection conn = new SqlConnection(Utlilties.GetConnectionString("WebService_Conn"));&lt;br /&gt;
    SqlCommand cmd = new SqlCommand();&lt;br /&gt;
    ///SqlDataAdapter to populate our DataSet&lt;br /&gt;
    SqlDataAdapter adapter = new SqlDataAdapter();&lt;br /&gt;
    ///DataSet to hold the users information&lt;br /&gt;
    DataSet dsInfo = new DataSet();&lt;br /&gt;
    ///String to hold our stored procedure&lt;br /&gt;
    string query = "RetrieveUserInfo";&lt;br /&gt;
    ///try...catch block to handle any unhandeled exceptions&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
        //set our SqlCommands Objects&lt;br /&gt;
        cmd.CommandText = query;&lt;br /&gt;
        cmd.CommandType = CommandType.StoredProcedure;  //tell it its a Stored Procedure we're executing&lt;br /&gt;
        //if using inline SQL change the CommandType to Text&lt;br /&gt;
        //cmd.CommandType = CommandType.Text;&lt;br /&gt;
        //set its connection property&lt;br /&gt;
        cmd.Connection = conn;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;        //now handle the connection state &lt;br /&gt;
        ///of our SqlConnection Object&lt;br /&gt;
       /// Utlilties.HandleConnectionState(conn);&lt;br /&gt;
        //set the SelectCommand Property&lt;br /&gt;
        ///of our SqlDataAdapter Object&lt;br /&gt;
        adapter.SelectCommand = cmd;&lt;br /&gt;
        //now we fill our DataSet&lt;br /&gt;
        ///using the Fill Method of&lt;br /&gt;
        ///the SqlDataAdapter&lt;br /&gt;
        adapter.Fill(dsInfo, "Members");&lt;br /&gt;
        //return the DataSet to the calling aspx page&lt;br /&gt;
        return dsInfo;&lt;br /&gt;
    }&lt;br /&gt;
    catch (Exception ex)&lt;br /&gt;
    {&lt;br /&gt;
        System.Web.HttpContext.Current.Response.Write(ex.Message);&lt;br /&gt;
        return null;&lt;br /&gt;
    }&lt;br /&gt;
    finally&lt;br /&gt;
    {&lt;br /&gt;
        ///put everyting in the finally section&lt;br /&gt;
        ///of the try...catch block you want executed&lt;br /&gt;
        ///whether theres an exception or not, in this&lt;br /&gt;
        ///case we want to close the connection no&lt;br /&gt;
        ///matter what happens&lt;br /&gt;
        ///close the connection&lt;br /&gt;
      /// Utlilties.HandleConnectionState(conn);&lt;br /&gt;
    }      &lt;br /&gt;
}&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;This operates as explained. It opens a connection to our database, retrieves all the user information from the users table, then populates a Dataset ans returns the DataSet to the client. Notice the &lt;strong&gt;[WebMethod()]&lt;/strong&gt; attribute at the start of the method, this says that any client that consumes this Web Service will have access to that method, and the data it returns.&lt;/p&gt;
&lt;p&gt;Believe it or not, our Web Service is complete. Now with a Web Service in a production environment will have much more &lt;em&gt;meat on its bones&lt;/em&gt;, but for our demonstration, this is really all we need to show how a Web Service works. Next question people ask is "&lt;em&gt;Ok, we have this service out there on our server, how do we access it and use it?". &lt;/em&gt;Well thats a good question, to use the Web Service we just created you need a consumer, a client that will connect to the service and gather the data.&lt;/p&gt;
&lt;p&gt;In this example we will create an ASP.Net Web Application that will consume our Web Service, then display the returned data in a &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx"&gt;GridView Control&lt;/a&gt;. So, in your Solution Explorer window, right-click on the very top node, the solution name, then select &lt;strong&gt;Add&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Project.&lt;/strong&gt; Once the &lt;strong&gt;New Project Dialog&lt;/strong&gt; opens, you will this time select &lt;strong&gt;ASP.Net Web Site &lt;/strong&gt;as the project type, once again either HTTP or File System for the &lt;strong&gt;Location &lt;/strong&gt;and C# for the &lt;strong&gt;Language.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;When the project is created is automatically adds a Default.aspx, and Default.aspx.cs. It's the CS file we will be doing the programming in. You always want to keep your presentation seperate from your logic, thats why Microsoft offers both files for a single page in .Net.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Since this is just a sample, open Default.aspx in &lt;strong&gt;Design Mode&lt;/strong&gt;, add a table to the page, then a &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx]"&gt;GridView&lt;/a&gt; to the page. The &lt;strong&gt;GridView&lt;/strong&gt; is what we'll use to display the data returned from our Web Service. You are now finished designing our ASPX page for consuming our Web Service. Now open &lt;strong&gt;Default.aspx.cs&lt;/strong&gt;, and make sure you have the following references at the top of your class:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;using System;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Configuration;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Web;&lt;br /&gt;
using System.Web.Security;&lt;br /&gt;
using System.Web.UI;&lt;br /&gt;
using System.Web.UI.WebControls;&lt;br /&gt;
using System.Web.UI.WebControls.WebParts;&lt;br /&gt;
using System.Web.UI.HtmlControls;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Those are the only references you will need for this example. Now we need to add a reference to the Web Service we just created, to do this:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Right-click on the project name&lt;/li&gt;
    &lt;li&gt;Select &lt;strong&gt;Add Web Reference&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Once the dialog box opens select &lt;strong&gt;Web Services in this solution&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Once it finds your service, click on its name&lt;/li&gt;
    &lt;li&gt;Wait for it to connect to the Web Service (when this happens the TextBox in the right-hand side of the dialog will be populated with the word &lt;strong&gt;localhost&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Click the &lt;strong&gt;Add Reference&lt;/strong&gt; button&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;NOTE: &lt;/strong&gt;Before clicking the Add Reference button I renamed my from &lt;strong&gt;localhost&lt;/strong&gt; to &lt;strong&gt;Sample&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now we have a reference to our Web Service and can starting using it. In our ASPX page we have a single method, &lt;strong&gt;BindGrid(),&lt;/strong&gt; and this method will:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Create a referene to our Web Service&lt;/li&gt;
    &lt;li&gt;Create a new &lt;strong&gt;DataSet&lt;/strong&gt;&lt;/li&gt;
    &lt;li&gt;Set our DataSet to the &lt;strong&gt;GetAllUserInfo&lt;/strong&gt; method in our Web Service (remember, it returns a populated &lt;strong&gt;DataSet&lt;/strong&gt;)&lt;/li&gt;
    &lt;li&gt;Bind the returned &lt;strong&gt;DataSet&lt;/strong&gt; to our &lt;strong&gt;GridView&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The code for this method is:&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;private void BindGrid()&lt;br /&gt;
{&lt;br /&gt;
     //create our DataSet to hold the member information returned&lt;br /&gt;
     DataSet dsMembers = new DataSet();&lt;br /&gt;
     //create our WebService object&lt;br /&gt;
     WebServiceConsumer.Sample.SampleService sample = new WebServiceConsumer.Sample.SampleService();&lt;br /&gt;
     //set our DataSet to the GetAllUsers Method of our web service&lt;br /&gt;
     dsMembers = sample.GetAllUserInfo();&lt;br /&gt;
     //now we need to set some properties for our data grid&lt;br /&gt;
     gvMembers.AutoGenerateColumns = true;&lt;br /&gt;
     gvMembers.DataSource = dsMembers.Tables["Members"].DefaultView;&lt;br /&gt;
     gvMembers.DataMember = "UserID";&lt;br /&gt;
     gvMembers.DataBind();              &lt;br /&gt;
}&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Simple enough isnt it? Now to use this, we will call this method from our &lt;strong&gt;Page_Load Event&lt;/strong&gt; in our page, and that looks like this:&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;
{&lt;br /&gt;
     BindGrid();&lt;br /&gt;
}&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Believe it or not, thats it, thats all the code required to consume our Web Service and sisplay the returned data. The one difference in our BindGrid method is this: &lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;WebServiceConsumer.Sample.SampleService sample = new WebServiceConsumer.Sample.SampleService();&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;That is where we create the reference to our Web Service, then we can use &lt;em&gt;sample.WhateverMethodIsThere &lt;/em&gt;for utilizing the methods in the Web Service, instead of typing the long name out.&lt;/p&gt;
&lt;p&gt;I am also providing a links to the &lt;a target="_blank" href="http://psychocoder.net/BlogItems/SampleWebService.zip"&gt;Source Code&lt;/a&gt; for this example, all I ask is that you keep the header intact.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thank you for reading, and I hope you found this helpful &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115721"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115721" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/115721.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/intro_to_web_services.aspx</guid>
            <pubDate>Sun, 30 Sep 2007 12:43:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/115721.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2007/09/30/intro_to_web_services.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/115721.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/115721.aspx</trackback:ping>
        </item>
        <item>
            <title>Is there more to life than programming?</title>
            <category>General</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2007/07/26/Is-there-more-to-life-than-programming.aspx</link>
            <description>&lt;span style="COLOR: rgb(102,102,153); FONT-FAMILY: Verdana"&gt;This is the question I asked myself today, just to see what kind of answer I would give myself. These are the kinds of questions I've had time to ask myself wince surgery (02JUL07) to correct a hernia and a problem with my Ileostomy. It's weird, I, like millions of other people, get up every morning, drink my coffee and read my RSS feeds (Hey what can I say, I'm a geek) then head of to work. And like so many others I never stop to ask myself questions like this one, mainly because I really don't have time to ponder questions like this, I mean I have a family to support and bills to pay (just like everyone else).&lt;br /&gt;
&lt;br /&gt;
My last day of work before surgery (was a Friday luckily) was like any other, I got up at 4:00AM (Hey I live a long way from work, what can I say), had my morning coffee, read my RSS feeds and headed off to work, like any Monday through Friday. I knew my day was going to be short that day so I arrived early (well early for me, I'm always there an hour before the actual start of work) because there were some loose ends I needed to tie up for the monthly release of my application before leaving for 4-6 weeks, I also wanted to get my release functionality "pushed" out to the QA department to ensure there were no "snags" that my programming partner would have to clean up for me.&lt;br /&gt;
&lt;br /&gt;
As I sat at work writing code, testing, writing release notes and such it hit me, I'm not going to be back here for 4-6 weeks, I'm not going to be able to write code for 4-6 weeks, and it scared me to think that I couldn't think of a single thing to occupy my time if I couldn't program. People who know me know I'm a workaholic when it comes to programming, so much so that I will forgo sleep &amp;amp; food to write the "prefect" code, and my boss (great man to work for by the way) knows this so he actually disabled my Active Directory account so I couldn't even so much as check my email while I was away. So without work what am I going to do, without work who exactly am I?&lt;br /&gt;
&lt;br /&gt;
Well part of this time was easy enough to deal with, I went into the hospital Monday morning (02JUL07) for surgery and was there, in a hospital bed, until Thursday (05JUL07). Then when I was released I was in so much pain and so "medicated" (well more pain then medicated) that sitting at a computer and writing code was the last thing on my mind (shocking eh?). Then for the next 4-5 days I couldn't even be out of bed more than a couple hours at a time before the pain would get to me, and I would get tired and exhausted (having major surgery takes a lot out of you) so I would head back to bed and ultimately fall asleep.&lt;br /&gt;
&lt;br /&gt;
Okay, that takes care of 7 or 8 days and I'm thinking to myself "Hey, this isn't so bad, I can do this" and proceeded to continue my recuperation from surgery. On about day 10 or 11, I'm starting to slowly feel better, I'm able to be out of bed for like 2 or 3 (sometimes even 4) hours at a time, it was at this moment that I realized that it's only been 10 or 11 days and I have up to 4 more weeks to go, and I still can't write code. It was at this moment that I had a realization, I am addicted to writing code, I am a full blown "code junkie". I eat, sleep, breath, dream code. Coding has gone from "what I do" to "what I am (or who I am)".&lt;br /&gt;
&lt;br /&gt;
I am a programmer, for better or worse this is who and what I am. I am as much a part of the code I write as I am a member of the society I live in. This the first time in MANY years that I'm not able to write code, in some fashion or another, and I have no idea how to "entertain" myself for this long of a period. I knew many years ago what I wanted to be "when I grew up", and I'm one of the fortunate ones who gets paid to do what I truly love, to do what I actually enjoy. TO me writing code is less work and more therapy. If I'm having a bad day/week I can lose myself in my code for hours on end and forget about anything that has happened in that day or week. Programming is my passion and without it I almost feel lost, without it's almost like a part of me is missing.&lt;br /&gt;
&lt;br /&gt;
Writing code is as much a part of me as your arm is a part of you, writing code is what keeps me "sane" (well as sane as a computer geek can be that is). Yes, this has given me more time with my family, yes this has given me time to rest and re-charge my battery, yes this surgery will, in the long run, improve my quality of life, but it has also taken something from me that means A LOT to me, my code.&lt;br /&gt;
&lt;br /&gt;
So the only answer I have for the posed question is this: Yes, technically, there is more to life than programming, but for all us "code junkies" out there, what kind of life would it be without our code?&lt;/span&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114202"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114202" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/114202.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2007/07/26/Is-there-more-to-life-than-programming.aspx</guid>
            <pubDate>Thu, 26 Jul 2007 23:20:48 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/114202.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2007/07/26/Is-there-more-to-life-than-programming.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/114202.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/114202.aspx</trackback:ping>
        </item>
        <item>
            <title>Where to begin</title>
            <category>General</category>
            <link>http://geekswithblogs.net/PsychoCoder/archive/2007/07/19/Where-to-begin.aspx</link>
            <description>&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;&lt;font size="2"&gt;Well where to begin, This is my first attempt at a blog so it may be boring, almost contrite at first but in time it will get better so please bear with me. &lt;br /&gt;
&lt;br /&gt;
First a little about me (thank you for humoring me). I am 39 years old, will be 40 in March of 2008, and live way out in the country with my wife (My Angel), my son, 4 dogs, 2 cats and 2 fish. I am what some refer to out here are a "high tech redneck", I may live in the country (simply because I love the solitude and privacy) but that doesn't mean I have to live like a redneck, and lets face it as a "geek" I love my toys. I knew at a very young age that I was destined to be in the world of computers and programming, even way back when computers were, lets say they were scarce to say the least. People knew right off the bat that something was different about me, maybe because in school some of my favorite classes were math (all flavors, Calculus, Geometry, Algebra, then the natural progression into Linear Algebra, Math Theory and so on) and Critical Thinking (not until High School was I offered this little gem of a class).&lt;br /&gt;
&lt;br /&gt;
I was offered an academic scholarship to the University of Georgia and graduated high school when I was only 16. I attended UGA with a major in Computer Science and a minor in Mathematics. It was at UGA where I wrote my first true encryption algorithm (64 bit back then, but in 1986 that was quite an accomplishment). I graduated with a BS in CS when I was but 20 years old, then proceeded to jump right into programming. I worked with Basic, QBasic, Pascal and other popular languages at the time. It wasn't until later in life when I was introduced to Microsoft Technologies, as in the late 80's there were still a fairly unknown company, who knew eh?&lt;br /&gt;
&lt;br /&gt;
Shortly after graduating (roughly in 1995, ok so that was 7 years after, but who's counting) I was throw into the Visual Basic world developing small client/server (not known as that until many years later) applications for several companies. I did some small work with C/C++ back in the day and even though I loved the concepts of OOP and what could be done the companies I worked for required faster turn around times than I could deliver with C and C++ so I was back to VB (starting with VB3 I believe).&lt;br /&gt;
&lt;br /&gt;
Fast forward 12 years and here I am, still a Microsoft Developer, except now with the "creation" of the .Net Framework I can do OOP programming with the fast turn around times clients want and need. I am a Software Engineer for a publicly traded corporation located in Spokane Washington and also run a small family owned Web/Software Development company out of my home (http://www.psychocoder.net). I have few clients as of now, simply because my full-time work makes it hard to find them but I am hoping within the next couple of years to quit working "for" someone and work solely for myself and build my company to what I know it can be.&lt;br /&gt;
&lt;br /&gt;
I am a passionate programmer, thats all I do, when not at work then I'm at home either creating something for a client of developing applications simply to be creating them, to expand my knowledge, to push the envelope of my own ability. I am a die hard geek, programming is what I am it's not what I do, it's not a "job" for me it is a way of life, it is my passion and I don't see myself ever doing anything else. So there you have it, a little about myself, who I am and how I got to be where I'm at today (well at least a high level overview of who I am). Keep an eye on this blog as I will be writing about .Net programming, MS SQL and other technologies. &lt;br /&gt;
&lt;br /&gt;
Thanks for reading &lt;img alt="" src="/Providers/BlogEntryEditor/FCKeditor/editor/images/smiley/msn/tounge_smile.gif" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114072"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114072" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/PsychoCoder/aggbug/114072.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Richard McCutchen</dc:creator>
            <guid>http://geekswithblogs.net/PsychoCoder/archive/2007/07/19/Where-to-begin.aspx</guid>
            <pubDate>Fri, 20 Jul 2007 03:02:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/PsychoCoder/comments/114072.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/PsychoCoder/archive/2007/07/19/Where-to-begin.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/PsychoCoder/comments/commentRss/114072.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/PsychoCoder/services/trackbacks/114072.aspx</trackback:ping>
        </item>
    </channel>
</rss>