Monday, March 14, 2005

Last month I posted an entry in which I identified my musical preferences while writing code.  I happened to browse some referrers today and noticed an interesting link.  Apparently if you enter the terms weird and programmers into Google, my blog (that post in particular) is #1 on the list.  While I don't entirely disagree with the results,  I thought it was pretty funny.

...the things people search for while surfing ;)

Monday, March 14, 2005 12:11:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

This one might cause an interesting discussion, but I thought I'd throw it out there anyway.

Over the past several months I've toyed (without yet purchasing) a few 'productivity tools', namely ReSharper by JetBrains and CodeRush by DevExpress.  Honestly I was extremely pleased with both tools.  Each tool seamlessly integrates with Visual Studio .NET as an add-in.  Each provides mechanisms to quickly refactor code, perform syntax checking, efficiently navigate around the code base, and much more.

I found CodeRush to be extremely powerful.  Its feature set is so extensive, exhaustive, and customizable that it's bind-moggling.  I absolutely love its powerful code templates.  In just a few minutes I had created a template called singleton that upon typing the text 'singleton' it would automatically expand to provide me with code properly formatted, structured, and named (according to the template).  CodeRush has some pretty innovate and stylish features.  I very much like how it highlights code blocks, identifies method and switch exit points with the smooth animations, template usages with the semi-transparent arrows, and much more.  CodeRush has a lot going on.

I feel, however, that the sheer extensiveness of CodeRush's capabilities is overwhelming.  I feel, also, that it's just a little too helpful in an invasive way.  Maybe it's just me and how I enter my code, but I'm constantly having to go back and correct times when it would insert templated text erroneously.  In fact, I spent about 3-4 hrs (I might be low-balling that estimate) tweaking it and adjusting each of the templates to a) my coding standards and conventions and b) run at the appropriate times and not unexpectedly.  Even then I wasn't able to fully fix the issues.  All in all, I am very impressed with CodeRush, but for me it gets in the way too much and I end up spending too much time undoing its helpfulness.  (I'd be interested to see how people compare/contrast CodeRush's helpfulness to Microsoft Word's same inclination...I know people that curse products that do this (especially if they come out of Redmond) whereas they don't hold the same opinions for other products...interesting ;))

ReSharper, on the other hand, is a much simpler tool (not nearly the # of gizmos, shortcuts, and templates) but indeed powerful.  ReSharper provides its own intellisense that I really liked (it can pick up changes in other projects in a multi-project solution, for example).  Also, ReSharper has some very nice inline enhancements; for example it will identify unused using statements, insert using clauses as necessary, et al.  ReSharper also enhances the IDE by providing some functionality that will be present in Whidbey such as 'Close all' and 'Close all except...' context menu options.

It wasn't without its idiosyncrasies, however.  I frequently utilize conditional compilation directives in my code and it has a hard time understanding variables and types declares within directive blocks (e.g. #if DEBUG...).  I'm not sure if this (lacking) capability has been fixed in 1.5 or slated for 2.0+.  Also, sharing ReSharper settings among developers on a team is a bit cumbersome (involving copying a directory containing settings).

At the end of the day I would personally recommend ReSharper (I plan on purchasing it here shortly) as it is much less invasive, allowing me to code to my personal style and taste while still providing me with advanced (and time-saving) enhancements.  I was noticing today that JetBrains is (for a limited time) providing a free upgrade to 2.0 when it becomes available with a purchase of ReSharper for $99....sounds like a deal to me!

Monday, March 14, 2005 6:42:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Thursday, March 10, 2005

We had our monthly .NET User Group meeting tonight and it was great!  We had a good turnout as well which is always exciting.  This month's meeting was sponsored by DRIVE Development out of Ogden, Utah.

  • Scott Golightly won the coding contest, receiving a copy of Infragistics NetAdvantage Volume 2003 w/Subscription
  • Justin Long was nominated and elected our new User Group secretary.
  • Clint Lord (I don't know if Clint has a blog) gave a great presentation on O/R Mapping.

All in all, a great event!  Thanks all for coming.

Thursday, March 10, 2005 3:03:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

Now that I'm back home and semi-settled in (I arrived home last night after an 11-day trip) I finally had the chance to get my new rating control (ver 1.0.1.0) up on my blog.  What was reassuring was that it went in seamlessly...not a single hitch.  I simply ran the db script against the server, copied in the new .dll and updated the web.config and just like that it was up and running (in total, it took about 3 minutes).  I also took the time to put the 'Top Rated Posts' control on the home page.  Because I have so few rated articles I set the minimum # of votes to 1, but over time, I'd like to have to increase that number.

Don't forget, the control is free and available for use on your .Text blog site.

Thursday, March 10, 2005 2:55:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, March 08, 2005

This isn't something I would normally blog about, but in this case I can't really make an exception.

Tonight we went out to eat and had what was perhaps the best meal that I've ever had...period.  We went to a small Italian restaurant called Buon Appetito on India Street in San Diego.  I had the cheese and spinach ravioli and the house salad.  Bar none both were fantastic!  I have never had such delicious ravioli in my life and the salad was perfect (love the dressing).

The next time I'm in San Diego I will undoubtedly make the stop again.

Tuesday, March 08, 2005 4:28:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, March 05, 2005
Well, here we are at the Microsoft Partner Briefing Convergence 2005 conference.  It's pretty exciting.  Last year we debuted our product offering at the Microsoft Partner Briefing in Toronto, Canada and it was a blast.  It was so very exciting to see the energy behind CRM.  We've had TONS of excitement behind our product offering since and we're expect the same or more from this conference in San Diego.  In you're in town attending the conference don't forget to stop by booth #717!
Saturday, March 05, 2005 9:34:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, March 03, 2005

Getting back in the groove...

I've been out of town for a week now (one more to go :)) so I haven't had much of a chance to get on and blog - though I've had a ton of thoughts and things I've wanted to blog about...but that's for another time.

This time, however, I wanted to get online and present an update to my .Text Blog Rating control.  As readers may already know, several weeks ago version 1.0.0.0 of the rating control was made available for the general populace.  I've (finally) taken the time to update it to version 1.0.1.0 and add several capabilities to it (I'll be getting it up on my blog momentarily - as soon as I get a chance!).

Of the new features these are the most notable:

1.  A 'Top Rated Posts' control that presents up to the top 20 highest-rated posts on the site.  This control behaves like an ASP.NET Repeater (in fact, it derives from it), so you can designate header, item, footer, etc templates.  The properties you can bind to include Id, AvgRating, DateAdded, NumRatings, Title, and Url.  Simply use the standard <%# DataBinder.Eval(Container.DataItem, “propertyname“) %> syntax and you're set...there are, of course, alternatives to this approach.  The TopRatedPosts control has a property called MinVotes that allows you to filter the list based on posts that have received a certain # of votes.  For example:

<devstone:TopRatedPosts runat=server minvotes=2>
   <headertemplate>
      <div class=listtitle>Top Rated Posts</div><ul class=list>
   </headertemplate>
   <itemtemplate>
      <li class=listitem>
         <%# DataBinder.Eval(Container.DataItem, "AvgRating", "{0:0.00}")%> - <a class=listitem href=<%# DataBinder.Eval(Container.DataItem, "Url")%>><%# DataBinder.Eval(Container.DataItem, "Title")%></a>
      </li>
   </itemtemplate>
   <footertemplate>
      </ul></div>
   </footertemplate>
</devstone:TopRatedPosts>

2.  A 'View Comments' link on rated controls.  This will popup a small window (akin to the rating window) with a bar graph illustrating the rating distribution and comments associated with the ratings.  Once aspect of the rating control that is somewhat unique is that it provides a mechanism for users to rate other users' comments and trackbacks.  However, until this release you could not see those comments - that's now been remedied.

3.  Miscellaneous enhancements.

There are some tweaks to the database and they are included in the database script.  These changes alter a few stored procedures and create a few new ones.

The web.config file will also need to undergo a small change in the <HandlerConfiguration/HttpHandlers /> section.  Those changes are also documented within the download.

Therefore, I present to you version 1.0.1.0.  Feel free to provide feedback and input as I'd love to make this product better in any way.

Have fun!

Thursday, March 03, 2005 6:11:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Thursday, February 24, 2005

Ok, I'm kind of a sucker for these kinds of tests - it's always interesting how people compare and, with a little introspection, see how accurate or off-base the results are.  In my case, I'd say it's pretty close, at least after one take.

Cattell's 16 Factor Test Results
Warmth |||||||||||||||||||||||| 74%
Intellect |||||||||||||||||||||||||||| 86%
Emotional Stability |||||||||||||||||| 54%
Aggressiveness ||||||||||||||||||||| 66%
Liveliness ||||||||||||||| 50%
Dutifulness |||||||||||||||||||||||||||| 86%
Social Assertiveness |||||||||||||||||||||||| 78%
Sensitivity ||||||||| 30%
Paranoia ||||||||||||||| 50%
Abstractness ||||||||||||||| 50%
Introversion |||||||||||||||||| 54%
Anxiety ||||||||||||||||||||| 62%
Openmindedness ||||||||||||||||||||| 66%
Independence ||||||||||||||||||||| 70%
Perfectionism ||||||||||||||||||||| 70%
Tension |||||||||||| 34%
Take Cattell 16 Factor Test (similar to 16pf)
personality tests by similarminds.com
Thursday, February 24, 2005 5:10:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, February 23, 2005

Maybe it's late or I'm just giddy...this struck me as hilarious.  I almost fell out of my chair.

Maybe I'm due a nice, smooth, refreshing cup of Nescafe Granulated FoodService Blend myself...then again, maybe not ;)

Wednesday, February 23, 2005 4:10:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, February 22, 2005

I am inspired by a post by Bill (William?) Ryan.  I responded to his post with a quick comment, but since submitting my response I have been somewhat introspective into the types of music I listen to and how productive I am.  Some music really grates on me while I'm working, whereas when not coding it's perfectly acceptable.  I have about 13 GB of WMA files on my media server (all ripped from CDs that I legitimately own) and it's quite a mix of songs.  While I have playlists and such, I'll often stream down songs randomly.  It gets weird sometimes to listen to one song with a pretty heavy beat to suddenly switch to Julie Andrews singing a song from Camelot and switch over to some dance beat and then a Latin ballad.  I love all the music, but I find that I'm substantially more productive if I a) don't listen to anything so I can focus on the code or b) listen to a certain genre of music or c) I forget, I'm listening to music right now and I'm distracted.

Anyhow, here's a sampling of some of my favorite music to code to.  I'd be interested in your comments and what kind of music gets you going during a code-jam session.

Favorites (preferred highlighted):
   Alanis Morrissette
   ABBA
   Alicia Keys
   Alison Krauss
   Avril Lavigne
   Barry Manilow
   Bon Jovi (especially from the 'Slippery When Wet' era)
   Cesaria Evora (enchanting voice)
   Depeche Mode
   Enigma
   Enya
   Eurythmics
   Faith Hill
   John Denver
   Josh Groban
   Julie Andrews
   Laura Pausini
   Lucero
   Luis Miguel
   Mana
   Maroon 5
   Norah Jones
   Peter Gabriel
   Ricardo Montaner
   Rick Wakeman
   Sarah Brightman
   Sheryl Crow
   Tears for Fears
   The Carpenters
   The Doors
   They Might Be Giants
   U2
   Weird Al Yankovic

There's a wide range of music I'm not mentioning here (such as classical music, Broadway (e.g. Les Miserables, Jekyll & Hyde, etc), and showtunes) because the list it too long and kinda all falls into the category of 'I love to listen to it anytime' anyway.

What music do you do your best work to?

Tuesday, February 22, 2005 2:59:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback

Ok, this may be old hat and I'm the last on the planet to discover this, but I'm pretty excited!

Since my induction into the .NET world (which was graceful and without incident) I have had a beef with one aspect of it - Type visibility.  If I create a Class Library (aka DLL) and create public types, I really can't designate who can use those classes. - they're open to the world.  Ok, ok, there are ways to enforce this such as by applying the StrongNameIdentityPermissionAttribute to the type.

The StrongNameIdentityPermissionAttribute (SNIPA, affectionately) is a pretty slick attribute that you can apply to a variety of things: assemblies, classes, structs, constructors, and methods.  This attribute effectively marks the item as useable only by a client with a given strong name.

Demonstration of how to use the StrongNameIdentityPermissionAttribute:

1.  Create your strong name (e.g: sn -k KeyFile.snk) for your client application.

2.  Sign your client assembly with the strong name (e.g: [assembly: AssemblyKeyFile(@”..\..\KeyFile.snk”)])

3.  Set a reference to the DLL (class library) in the client (note, it will have to also have a strong name so follow steps 1 and 2 for the DLL, possibly reusing the .snk file if you want)

4.  Identify the class / method / etc that you only want to be callable by the client application.  This is the item to which you will apply the SNIPA.  A simple way to identify the strong name for the calling client is to retrieve it's public key.  This is done against the compiled client .exe/.dll (e.g:  secutil -hex -s ClientApp.exe or sn -Tp ClientApp.exe) [Updated 02/23/2005 - Didn't want to forget the sn.exe utility].  This will output the public key in hex format.  Copy and paste it into your code:

using System.Security.Permissions;

namespace ClassLibrary1 {

   [StrongNameIdentityPermission(SecurityAction.Demand, PublicKey=”......”)]
   public sealed class Class1 { ... }

}

There really isn't much more to it than that.  Only clients signed with the specified strong name will be able to create instances of the designated type and call its methods.  Pretty slick stuff.

There are a few caveats and restrictions, however, with using the SNIPA.

1.  Firstly, SNIPA applies only to one type.  That is, if you have multiple types that you want to share with a designated strong-name-signed application, you must mark each and every type individually, otherwise they're public to the world.

2.  Secondly, the items flagged with the SNIPA must be public.  They cannot be internal types.

3.  You can designate only one SNIPA per element; you cannot identify two different strong names.  You have one friend and that's it.

Today, I made a great discovery that I thought worth sharing, and this brings me back to the original purpose of the post in the first place.  In the Whidbey timeframe you will be able to designate friend assemblies with a fantastic attribute called InternalsVisibleToAttribute.  This attribute can be applied to your assembly thus:  [assembly: InternalsVisibleTo(”...”)].  One nice and enabling characteristic of this attribute is you can apply it multiple times to your assembly to designate multiple 'friends' unlike the SNIPA with which you can only designate a single category of friends: those with a given strong name.

The coolness behind this is you can create types that are internal to your application, and now internal can actually extend beyond the scope of your DLL and into your 'family of products' without exposing unnecessary objects and types to the public world.  I am SO excited for this feature as I was wanting to take advantage of such functionality since the beginning.

Way to go .NET team!

Tuesday, February 22, 2005 2:13:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [4]  |  Trackback