All the Small Things - The Car

29 02 2008

Sometimes people ask me how I stay up to date with all the “goings-on” of the development world.

I have a simple trick to stay on top of the deluge of information coming from the community: use the small, inefficient parts of your day to catch up.stopSign

I have found a few different times to inject with some learning: driving, mowing the lawn, exercising and, as much as I’d like not to bring it up, using the restroom.

Today I will focus on how I maximize my time in the car.

Basically I burn a few CD’s every weekend of the podcasts I like to listen to and listen to them as I drive.  (I really wish my car had an auxiliary port - but that’s another topic.)  I’m in my car a good hour a day just driving to and from work and running the miscellaneous errands I have.  Listening to the podcasts actually makes traffic less of a pain.

If you’re unsure what podcasts are good, here’s my developer oriented recommendations:

  1. zune Dot Net Rocks (Pwop Productions) - Obviously this podcast covers .Net and Microsoft related technologies.  It has the best production value I’ve heard out of a podcast and they record two shows a week!
  2. HanselMinutes (Pwop Productions) - Microsoft employee Scott Hanselman is a beast!  This man just oozes information.  He covers all different topics and his employer does not affect his opinion.  This is my “if you only listen to one” podcast.
  3. Run As Radio (Pwop Productions) - At my work I am constantly surrounded by IT Pros.  This show helps me keep up to date with what’s new in their world and helps me understand how to make their lives easier.  Sometimes it even gives me an edge over them!
  4. Security Now (TWIT Network) - Security guru Steve Gibson and ex Screen Savers host Leo Laporte discuss what’s new in the world of computer security.  Very interestingipod stuff!
  5. Windows Weekly (TWIT Network) - Leo Laporte again discussing the world of Windows and Microsoft with Paul Thurrot.  There is also a version of this show for the Apple faithful - Mac Break Weekly.
  6. Diggnation (Revision3) - This is the Wayne’s World of the internet.  Two guys on their couch talking about what hot on the web.  They are very funny, but can be NSFW sometimes.
  7. The GigaOm Show (Revision3) - Om Malik interviews the luminaries of Silicon Valley.   It’s neat to hear what is going on in that space.

I’ve found that the easiest way to manage my CD burning is to use FeedDemon.  It will automatically download any podcast you add to it, and once the podcast has finished downloading it will add it to a playlist of your choice.  (Windows Media Player and ITunes are both supported.)

This works out really well for me because I have a playlist of all my new podcasts in WMP, which I drag to the burn pane and away it goes!  No mess, no fuss.

Stay tuned to this blog for more info on how I maximize my time in the restroom!





Actively refused connections

25 02 2008

Recently I was using the System.Net.Mail namespace to send out email messages from a simple .net application.  I was receiving an error which boiled down to “the server is actively refusing the connection.”

This message is not particularly helpful.  If you run into this issue you might want to check that your mail server will allow SMTP relays.  My server was set to allow SMTP relays - yet I was still getting the issue.

I found a Microsoft tool called SMTPDiag (for use with Exchange server) that runs through the network performing various test to find out why SMTP is not working.

I ended up failing on one of the final steps - connecting to the exchange server.

I ran

netstat -n -a

on the server and found that port 25 was open and listening.

Then on my client machine I tried to create the simplest connection I could to the server:

telnet [mailServer] 25

This refused to connect as well. 

I checked the firewall to see if port 25 was blocked in some way and it was not.

I was basically flabbergasted and about to give up when my anti-virus program popped up to do an update.  A light bulb went off in my head.

CHECK YOUR ANTI-VIRUS SETTINGS WHEN HAVING CONNECTION PROBLEMS!

McAffee ANtiVirus was blocking all outgoing traffic over port 25 on my machine.  I didn’t even think about anti-virus blocking ports, but it is quite common, especially with mail ports.  I felt like an idiot, but I decided to share my experience to help others out there.

PS - SMTPDiag is quite useful, and Marc Grote has a good tutorial on it.





Giving Back

19 02 2008

This year one of my new years resolutions was to give something back to the development community.  I plan on releasing more code samples and open sourcing any useful utilities that I write.  I also plan to try to contribute to some of the great open source libraries out there that I find myself using everyday.

Well an opportunity quickly arose the first week of the year when I found a small bug in the Quartz.net code base. 

For those of you who have not taken a look at Quartz.net - I highly recommend you do so!  Marko Lahma has done a great job of porting this Java scheduling engine.  It’s highly flexible and reliable, and even though the “1.0″ release hasn’t come out yet, it really is production quality.TortoiseSVN's righ click context menu

I’m actually quite surprised that this functionality isn’t baked-in to the framework.  It seems to be highly necessary for a large number of applications.  So necessary in fact that SQL Server has a scheduler built into it, as does SharePoint and Windows too!  I’d like to see a standard implementation of this functionality - just like we have a standard implementation of workflow.

Anyway’s, once I found the bug I fixed it locally and used TortoiseSVN’s “Create patch”  command to generate a patch.  I attached that patch to a bug report I filed on the Quartz.net website on January 7th.  Marko applied the patch to the trunk by day’s end.  It was quite a simple process.

Then on January 20th Quartz.net 0.9.1 was released.  In the release notes there was mention that BUG # 84 - my bug - had been fixed. 

That did it!  I’ve officially contributed code to an open source project, it was accepted and released and is out there to download.  Once you get involved in an open source project you really understand the amazing fortune we have to have access to such great software!

I recommend everyone commit something - even something small.  This must be the feeling Earl has when he crosses something off his list





Debugging WSS

15 02 2008

Last time I covered how to show full debugging information in WSS by editing the web.config.  That’s a great tip to easily peer into WSS, but it’s no step debugging.

To get step debugging there are a few simple things that you need to do.

1. Attach to the proper process:

Depending on what you are trying to debug - you need to attach Visual Studio to the proper process.  For WSS development, most of the time you will want to attach to w3wp.exe.  Its the IIS worker process and will allow you to debug web parts, feature receivers, etc.

Attaching to w3wp.exe is easy in Visual Studio: Select Debug > Attach to Process find w3wp.exe in the list and press Attach.

You may notice more than one instance of w3wp.exe running - which is normal since each IIS Application Pool runs in its own worker process.  To figure out which process you need to attach to you can run iisapp from the command line.

The first time you run iisapp you will see an alert box that says “This script does not work with WScript.“:

iisapp1

Just press OK and then Yes to the next prompt.

 iisapp2

This will give you the success message “Successfully registered CScript” at which point you are good to run iisapp.

iisapp3

To be sure you connected to the proper process you can press  Ctrl + D, M to bring up the Modules window.  This is a list of all assemblies that Visual Studio is monitoring.  Make sure the assembly you want to debug is in this list.

Side Note:
To debug SPJobDefinition’s as they run, you must attach to the owstimer.exe process.

To make all this attaching even easier, Andrew Connell has a nice little macro that will automatically attach to these processes for you.

2. Load Symbols

Visual Studio needs access to .PDB files to give you the best debugging experience.  The problem is that most of the time when you are working with WSS you have your assembly loaded in the GAC and aren’t too sure where the .PDB file is, or where it should go.

The best way around this problem is to use a symbol server.

A symbol server is nothing more than a folder on your machine that has all the .PDB files you need in it.  I recommend that you make a shared folder on your build server specifically for this purpose - so that when you do a build, you can easily automate putting PDB’s in their proper place.

Once you have created a folder where you plan to store your PDB files you need to populate it using a program named symstore.exe which comes with the Debugging tools for Windows.

Once you have installed the tools simply run:

symstore add /f “Path/To/*.PDB” /r /s “Path/To/Shared/Folder” /t “Product Name

and your .PDB’s are now on the Symbol Server!

Note:
I’ve added the path to symstore.exe to my PATH environment variable.

I’ve added that command to my post-build script in Visual Studio so that the newest version of the .PDB’s are always available to me as I debug.  (Although it’s probably better to have your build server do this part.)

To make it a little simpler to manage your symbol server be sure to check out PowerShell Symbol Store - a nice GUI for managing symbol servers plus PowerShell scripts to help you along.

Finally once you have your Symbol Server setup you have to tell Visual Studio where it is.  Select Tools > Options > Debugging > Symbols and add the path.

Now attach to the proper process, browse around your SharePoint site and anytime you execute code with a breakpoint on it Visual Studio will begin to flash and you will be debugging!





WSS 3.0 Debugging

14 02 2008

This is a rehash of info that’s already all over the web - but for me to find quickly I’ll repeat:

To enable debugging in WSS 3.0 update C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config so that these attributes are set as seen below.

<configuration>
	<SharePoint>
		<SafeMode CallStack="true">
	</SharePoint>
	<system.web>
		<customErrors mode="Off" />
		<compilation batch="true" debug="true">
	</system.web>
</configuration>

DO NOT REPLACE YOUR WEB.CONFIG WITH THE ABOVE FILE.  Simply change the attributes in your file to match the ones listed above.





Small Changes

14 02 2008

I’ve noticed recently that Chevron (a gas station in the southeast) has changedchevronLogo their logo.

The new logo is VERY similar to the old one - yet slightly stylized - with some new dimension.  It looks really good light up on the sign; as if they specifically designed it for that purpose.

upsLogo

I love when companies make small subtle changes to their logos to show that they are still current and relevant.  I always thought that UPS did a remarkable job at this as well.

Last week the blog Neatorama put together a nice collection of logo evolutions.  They focused on only tech company logos, and to be honest with you I’d like to see most of those companies update their logos again.

Wired one-upped Neatorama by interviewing Ruth Kedar about her process when designing the Google logo.  The resulting article shows a bunch of logos that could have been.

And finally, speaking of Google’s logo.  Be sure to check out their Doodle 4 Google contest where school aged kids can design a temporary replacement logo for Google centered on the theme “What If..?”.  That’s way more exposure than the coloring contest at your local supermarket!  You can see all of Google’s past doodle logos for an idea of what they might be looking for.





SqlSaturday - This weekend in Tampa!

12 02 2008

Well here we go again - more great free developer events in central Florida.

This time it’s SqlSaturday in Tampa.  There is a great lineup of sessions.  I’ve decided to attend these:

  1. Introduction to SQL Server Integration Services by Brian Knight
  2. TBA by Joe Celko
  3. Introduction to SQL Server Integration Services by Xidan Zhou
  4. 20 Things You Need to Know About Analysis Services by Mark Landry

As you can see I’m specifically targeting session covering business intelligence.  I also have to indulge and check out Joe Celko. 

If you haven’t heard of him I HIGHLY recommend you read his book: SQL for Smarties.

On a side note - someone is keeping a blog of things that Celko says out and about on forums.  It’s the next best thing to the man keeping a blog himself!