Thursday, July 24, 2008

Be Back Later

Well folks... I'm off to the west coast for a little while.  Blogging will be intermittent at best.  Stay well, and leave the light on for me.

#    10:19 PM by Nick | No Comments |
 Monday, July 21, 2008

Computer Bugs According to Sesame Street

I'm waiting for someone at work to blame aliens...

#    9:09 PM by Nick | No Comments |
 Friday, July 11, 2008

Useful, to a Point

Scott Hanselman is working on a new project for parents out there called Baby Smash:

As babies smash on the keyboard, colored shapes, letters and numbers appear on the screen. Baby Smash will lock out the Windows Key, as well as Ctrl-Esc and Alt-Tab so your baby can't get out of the application. Pressing ALT-F4 will exit the application and Shift-Ctrl-Alt-O brings up the options dialog.

Its written with WPF, and looks pretty cool, as well as pretty useful.  I don't have kids, but a coworker of mine just recently had his second child, and his first is 2 and pretty rambunctious from what I understand.  So I sent him a link to the program.  Here was his response:

Does he have any programs that will prevent my kid from drawing on the walls? :)

Hey... computers can't do everything you know.

#    5:25 PM by Nick | 1 Comment |
 Wednesday, July 09, 2008

New Code Monkey Cover

Jonathan Coulton pointed out this great cover of his song Code Monkey (no relation to my blog) which was done by The Grammar Club.  Take a listen:

#    4:29 PM by Nick | No Comments |

How Much JavaScript is Too Much?

One of the things I try to do on my blogs (especially my other blog) is to get as much of the processing to be done server side, with as few outside dependencies as possible.  There are a few reasons for this.  One is that I can better control any problems that may occur because the source is more easily known.  Second, it allows for more server side caching.  Third is that it is a pendulum reaction to when I used to host on Blogger and everything I wanted extra had to be provided through a third party via JavaScript.  My old Blogger blogs got to be really slow as I tried to add more and more features.

I like to think that I keep a nice balance of server side and client side processing for all my sites.  One of the political blogs that I keep tabs on is Wigderson Library & Pub.  James is a big fan of advertising, and JavaScript.  Luckily I only read his site through his RSS feed... because if I actually had to go to his site to check his content, it would drive me nuts.  For fun, I decided to "battle" Jim using Webslug, which measures comparative load time performance between two sites.  Here are the results:

NickVsWiggy

 

You're reading that right... 192 seconds, or over 3 minutes for the page to finish loading.  Now then... it's not as bad as it seems, since the positioning of the JavaScript allows the page to render the majority of its content before that.  But still... at what point do you declare that you have too much JavaScript?  And for folks like Jim, who still use third party applications like Blogger for all his content, what are the alternatives to speed load time?

#    9:30 AM by Nick | 2 Comments |
 Thursday, July 03, 2008

How Did I Get Started In Software Development?

Derik didn't tag me, but I found his responses so similar to mine, that I thought I'd jump into the meme...

How old were you when you started programming?  Like Derik, I was a relative late bloomer into programming.  I had a IBM PC XT at home, and I had a knack for writing nice and tidy batch scripts, but I didn't really get into real programming until I took an programming class in high school.  The normal class conflicted with the AP Calculus class that I was taking, so I took it with a friend independent study.  We would get our assignments for the week on Monday morning, finish them all by the end of that day, and then tutor people in Calculus in the library.

What was your first language?  Technically I guess it was True BASIC... though I also did a lot with QBasic.  I also did a little bit with Pascal back then... oh those were the days. Aside from the basic learning programs in class, the biggest program I wrote back then was an analog clock with real time display and a second hand.

What was the first real program you wrote?  I guess the first real program that I ever wrote was a web application (at least that's what we call it know) in Perl for a company to do online dispute resolution.  It actually was a pretty major endeavor, and aside from some patent issues, was pretty innovative.  To date, that is the one and only project I've ever written in Perl.  *shudder*

If you knew then what you know now, would you have started programming?  Duh... of course.  I also would have started sooner, not that I ever felt that behind... it's just I would have enjoyed it just as much even earlier I think.  I've never had a bad experience programming (aside from some normal bad jobs that any profession can have), that has made me regret being a programmer.

If there is one thing you learned along the way that you can tell new developers, what would it be?  Document!  Save emails!  I don't know how many times a decision was made by someone which led to a major architectural decision, only to be undone later by the same person, claiming he had no knowledge of the earlier decision.  If someone tells you something important verbally, send them a confirmation email and keep a record of it.

What was the most fun you've ever had... programming?  I'd say the last few jobs I've had with a small group of guys from my consulting company have been the best.  It's a great group, who knows what they're doing, just does the work, and we drink afterwards.  Really... how much better can it get?

Who am I calling out?

I'm not going to call out anyone in particular, but if you do decide to add to the fun, just leave a comment so I know!

#    2:54 PM by Nick | No Comments |
 Thursday, June 12, 2008

Must Have Productivity Software?

Last night I headed down to Chicago for the monthly Alt.NET meeting, which was at the ThoughtWorks office.  Just briefly, that looks like a great place to work... they have a gorgeous office.

The meeting was mostly a smack down between ReSharper and CodeRush.  I seemed to stand out early on because they first asked which people in the audience used which one.  I think I was the only one in the audience that used neither... I am a Visual Studio purest.  For one, I was never willing to fork out > $100 for a productivity package like that.  For another... I like writing that much code by hand because I genuinely believe that it makes me think about my code and my architecture more.

Afterwards, I won a license to my choice of ReSharper, CodeRush or SqlPrompt.  Based on the smack down (which was done Horse style thanks to my suggestion), I had to say that CodeRush looked much cooler, and from a usability standpoint, seemed to be the better choice.  Hopefully I'll have my license in hand soon so I can test it out, and report on whether I think its worth the money, or whether it helps or hinders my code writing.

Out of the tools they gave away, the one they only showed briefly was SqlPrompt.  From the brief demo, all I can say is wow.  Intellisense in SQL Management Studio, or even Notepad?  Are you kidding me?  I'd love to get my hands on a copy of that... but once again... not sure I can justify the cost to myself.

#    11:20 AM by Nick | No Comments |
 Monday, June 09, 2008

LINQ and Stored Procedures Not Always Magic

I had an interesting experience while trying to import a stored procedure into a LINQ to SQL Classes Designer surface today.  Normally this is a pretty straightforward process.  First you open Server Explorer, then go to one of your connections, find the stored procedure, and then drag and drop it onto the designer surface.  Boom, it's suddenly available from your DataContext as a method. 

That's exactly what I did today, except when I created a var for the stored procedure result set, and then added a foreach to loop through the rows in the result set... nothing showed in my Intellisense.  Huh?  A little hover magic and I saw that my generated method was returning an int.

After some investigation, I found that the designer has a hard time handling stored procedures that use temporary tables in them, as it throws off the procedure meta data.  As it turns out, there are two possible solutions.  First, you can use a table variable instead:

DECLARE @tempTable TABLE ( ... )

Your second option is to continue to use a temporary table, but hand modify your dbml file using an XML editor.  Simply right click on the file in Solution Explorer and choose Open With and then choose your favorite XML editor.  Mine is Notepad2.  Search through the file for your stored procedure, which for a procedure named "storedProcedureName" might look like this:

<Function Name="dbo.storedProcedureName" Method="storedProcedureName">
  <Parameter Name="Parameter1" Parameter="Parameter1" Type="System.Int32" DbType="Int" />
  <Return Type="System.Int32" />
</Function>

Then remove the <Return ... /> element and replace it with an <ElementType> node which may look like this:

<Function Name="dbo.storedProcedureName" Method="storedProcedureName">
  <Parameter Name="Parameter1" Parameter="Parameter1" Type="System.Int32" DbType="Int" />
  <ElementType Name="storedProcedureNameResult">
    <Column Name="Result1" Type="System.Int32" DbType="int NOT NULL" CanBeNull="false" />
    <Column Name="Result2" Type="System.String" DbType="varchar(10) NOT NULL" CanBeNull="false" />
    <!-- ... -->
  </ElementType>
</Function>
This second method is the one that I used since my temporary table will hold thousands of rows, which is too inefficient for a table variable.
#    3:45 PM by Nick | No Comments |

How to Get a Geeky Guy

For all those ladies interested in catching a geeky guy... or keeping one once you've snagged him, here is a funny guide for you.  Via @larryclarkin.

#    8:31 AM by Nick | No Comments |
 Friday, June 06, 2008

Looking For Some Cool Free Software?

#    11:27 AM by Nick | No Comments |