Search
On this page
Archives
RSS 2.0 Categories
Blogroll
Disclaimer
Powered by: newtelligence dasBlog 2.0.7226.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
Send mail to the author(s) E-mail
Photosynth#

For those that missed the announcement last week, PhotoSynth is live and after a pretty bumpy start looks like you can at least play around with it now.  I've managed to load two of my sets of photos from a trip to the High Sierras a couple of years ago.  It definitely still has its bumps as I had to cancel and restart the synth several times as it would hang indefinitely.  I didn't get really high "synthy" scores as I wasn't taking the photos with PhotoSynth in mind at the time.  However, the PhotoSynth team has supplied a document of points to keep in mind while shooting photos if you intend to make a PhotoSynth out of them.  I can't wait to try it out when I actually shot the photos for synthing.  There are numerous really great examples on the PhotoSynth site, including some shot by the National Geographic Society photographers.  I like that you can go full screen (or full browser) as that really helps make the experience a bit more of an immersive experience.  Also, the slide show and thumbnails really help as well. 

PhotoSynth is now giving 20GB (!) for free to anyone to try PhotoSynth.  It takes a LONG time to use 20GB in JPEGS!  Give it a try. 

Since my photos didn't all relate to one another, PhotoSynth sort of creates mini-PhotoSynths inside each.  You'll want to check the thumbnails page to see the various scenes that it stitched together. 

Here are links to my first two:

High Sierras - Dana Plateau

High Sierras - Saddlebag Lake Area

Thursday, August 28, 2008 2:01:28 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
devLink Conference#

This past weekend a few of us Wintellectuals made the trek Atlanta to Murfreesboro TN to present at the annual devLink conference.  I really can't say enough about the level of professionalism and obvious preparation that went into devLinkJohn Kellar, Tommy Norman, and Leanna Baker and the entire team that made it happen are well deserving of accolades for their accomplishment.  The conference was held on the campus of Middle Tennessee State University which was also perfectly suited for the task.  All of the rooms were nice, large, and well-equipped (even though said equipment was apparently timed to shut off exactly at the 1-1/2 presentation mark).  As a vegetarian, I can't say too much for the food, but that's pretty much on par with any gathering...I've learned to carry plenty or protein bars over the years.  Bottom line, for $50 this absolutely has to be best value for your buck in training (other than Wintellect's DevScovery, of course *smile*). 

While my colleagues, Steve Porter and Keith Rome, offered four really great talks on Silverlight topics, I was there to present on all the new things available with Cascading Style Sheets (sarcasm off).  Actually, my CSS talk went really well and I received lots of good feedback which I'll continue to roll into that presentation.  All sarcasm aside, most web developers (especially those in Enterprise positions) are stuck with CSS for the foreseeable future and this presentation really aims to go through the major areas where I see developers struggling and try and cast some light on how all those pieces play together.  Thanks to all that made it to the talk (standing room only!) and for the emails that I've received since.

I've updated the slides and code with this past weekend's revisions and you can get it here:

CSS Deep Dive for the ASP.NET Developer

I believe that the other presentations will be posted on the devLink website, so keep an eye out for them.  There were a lot of good ones!

Wednesday, August 27, 2008 1:29:59 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Updated Deep Dive CSS code#

Thanks to all the folks that came to my Deep Dive CSS for the ASP.NET Developer session at this past weekend's Atlanta Code Camp.  I got some really great feedback from the evaluations and will definitely incorporate some suggestions into this presentation in the future. 

The abstract, updated code and slides are available here:

 Deep Dive CSS for the ASP.NET Developer

 

Tuesday, April 01, 2008 9:25:35 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Top-10 Application-Design Mistakes#

We saw it when the world first discovered Flash and I'm sure we've got a lot of it left to live through with Silverlight, so this is pretty timely advice from the "Godfather of Web Usability" himself, Jakob Nielsen.  This should be required for every web developer.  There are some great links within the post as well, so be sure to click around.

Top-10 Application-Design Mistakes

Wednesday, February 20, 2008 5:52:10 AM (GMT Standard Time, UTC+00:00)
  Comments [1]  | 
Painless Free Annual Credit Reports#

There is finally a (relatively) painless way to receive your Free Annual Credit Report from the Big 3 Credit Agencies.  It is a really good idea to keep your eye on your credit report these days.  The folks at AnnualCreditReport.com have integrated the registration processes for the three Credit Agencies into a seamless wizard type experience.  I was able to print all three of mine in less than 10 minutes.

Friday, January 25, 2008 6:30:24 PM (GMT Standard Time, UTC+00:00)
  Comments [1]  | 
Weather Widget now in the Silverlight.net Showcase#

The Silverlight Weather Widget made it to the Silverlight.net Showcase and is mentioned in the News section of the Home Page.  WooHooo. 

Friday, January 25, 2008 8:07:29 AM (GMT Standard Time, UTC+00:00)
  Comments [1]  | 
The New Generic Kid on the Block - HashSet<T>#

In mathematics, a Set is typically thought of as a collection of distinct objects that is usually defined by some rule that determines whether they are a member of that particular Set.  For example, a Set could be defined to contain "all the odd numbers under 100" or "every number divisible by 2" or whatever.  The main points here being that the objects in a Set are distinct (i.e. NO duplicate objects are allowed) and the objects are not ordered or sorted in any way.  (If you really feel the need to geek out on Set Theory, be my guest).

According to the MSDN Documentation for HashSet, "a set is a collection that contains no duplicate elements, and whose elements are in no particular order."  Sound familiar?  In the .NET Base Class Library, there has never been a true Set class until now with the release of .NET 3.5 and the brand-spanking-new System.Collections.Generic.HashSet<T> class. 

In the past, when we needed to implement a Set in .NET, we sort of bastardized the List<T> or other unsuspecting Collection classes into something like this:

int[] intArray = new int[]{ 1, 2, 5, 7, 4, 1, 7, 9, 8};
List<int> intList = new List<int>();
foreach(int theInt in intArray)
{
  // checking to make sure that the object is not in our List before adding
  //  so we are calling Contains() and then Add() on every time through the loop
  if (!intList.Contains(theInt))
    intList.Add(theInt);
}

What we needed was a Set that would let us just keep adding objects to it and free us from having to worry about it being there first.  A recent example of when I really needed a true Set class was while working on the Weather WidgetThe Weather Channel provides some 40+ images for use in their SDK, yet in the Weather Widget I never need more than maximum of 11 (and usually less as there is usually duplication).  So, I had the idea to dynamically zip the images that I actually needed for a given Zip Code and use that file for my image assets in Silverlight via CreateXamlFromDownloader.  Obviously, I don't want these images duplicated in the zip file.  So, I came up with this:

HashSet<string> assets = new HashSet<string>();
foreach (ForecastDay day in forecast.Days)
{
  // no Exception here if duplicate...it just doesn't add it.
  assets.Add(Server.MapPath(String.Format("~/images/{0}", day.IconDay)));
}
Utility.WriteZipFile(assets.ToArray<string>())

This just scratches the surface of what HashSet<T> is capable of.  There are member methods available for most Set operations, such as IntersectWith(), UnionWith(), IsSubsetOf(), IsSupersetOf(), RemoveWhere(), etc.   Here's a link to all of the HashSet<T> Members.

Recall that being a member of a set depends on some rule that determines this membership.  With the HashSet<T>, you can define your own rule of what it means to be in a Set.  For a good example of defining your own EqualityComparer, see Introducing HashSet<T> from Kim Hamilton on the BCL Team Blog.

So, welcome the New Kid on the Block to the Generic Collections. 

One last random link I had on the subject for those interested in LINQ:
Good side-by-side comparison of the HashSet and LINQ Set Operations

Friday, January 25, 2008 7:53:51 AM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
A Better Way to Remove a Trailing Slash from a Path#
C#

How many times have you written this to trim a trailing slash from a path:

if (myPath.EndsWith("\\"))   /* or "/" in the case of a URI  */
  myPath = myPath.Substring(0, myPath.Length-1);

Next time, try this:

myPath = myPath.TrimEnd(new char[]{'\\', '/'});

In addition to String.TrimStart() and String.TrimEnd(), there is an overload on String.Trim() that accepts a character array. There are good examples of usage in the MSDN Library.  Here are the links:  

System.String    Trim(char[])    TrimStart(char[])    TrimEnd(char[])

 

Friday, January 18, 2008 5:32:41 AM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Back from the Silverlight Tour#

I had a chance to attend the recent Atlanta stop of Wildermuth Consulting’s Silverlight Tour this past week and wanted to offer some quick comments about it here for anyone considering the class. 

Going into the class, I had about 3 weeks of heads-down knowledge of Silverlight 1.0, but I had spent no time at all with Silverlight 1.1 (now 2.0).  I had also read Silverlight 1.0 Unleashed, watched a lot of the webcasts available and I had just (mostly) completed my first Silverlight 1.0 project.   

The 3-day Silverlight Tour begins with Day 1 of mostly concepts and terminology and an introduction into the Expression Suite.  This was mostly review for me, but I still managed several “a-ha” moments during the day as the presenter, Shawn Wildermuth, explained the “why” behind a lot of the concepts and decisions that were made in regards to Silverlight.  It was a good “shoring up” of my skills in the foundations of Silverlight. 

Day 2 was all about the code.  We spent about ½ the day on Silverlight 1.0 and the other ½ on Silverlight 1.1.  We had several labs, lecture, and discussion throughout the day.  (A good mix of the three, in my opinion).  One of the strengths of the class was that when questions would come up, we had the flexibility in the schedule to actually go off on short tangents and explore different ideas as a class.  I walked away from this day with a much better understanding of how the code side of Silverlight works with the design side, as well as, a lot of anticipation for Silverlight 2.0.  

Day 3 was the main reason I had taken the class and Shawn did not disappoint.  One of the things I struggled most with while working through the Weather Widget was how to organize projects and where do I use this method from the AJAX assemblies and where do I use Silverlight, etc.  These are the types of things that just aren’t in books yet, but Shawn has been there, done that and you are getting it first-hand.  We learned about the integration points with ASP.NET Ajax and Silverlight, and even newer technologies such as ASP.NET Data Services and the Entity Framework.   Further, we talked about packaging of Silverlight controls and other ways of thinking about the generation of XAML…ways I hadn’t thought about until then.  Very cool stuff from someone that truly understands the subject matter and takes the time to explain things in such a way as to really help everyone “get it”. 

So, I walk away with a head full of knowledge about all kinds of fun things that will be filling my life over the next year (and dying to tear my entire project for the Weather Widget apart and do it with all the new Best Practices I managed to acquire over the past 3 days)!  

Friday, January 18, 2008 3:49:55 AM (GMT Standard Time, UTC+00:00)
  Comments [1]  | 
Squeeze Your ASP.NET Applications Until They Scream#

A couple of weeks ago, I had the good fortune of catching a webcast from Jeff Prosise of Wintellect entitled:  "Squeeze Your ASP.NET Applications Until They Scream".  I was really impressed with the content and with Jeff's presentation of same.  The event was sponsored by Compuware and they have given me permission to post a link to the presentation. 

Squeeze Your ASP.NET Applications Until They Scream

Friday, January 11, 2008 4:50:52 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
My First Look at the (Silver)Light#

Over the holidays, I was finally able to catch up on some reading and take some time to play with Silverlight 1.0.  The two books that I spent the most time with are ASP.NET Ajax in Action and Silverlight 1.0 Unleashed.  Both of these, I HIGHLY recommend! 

My first project is a Silverlight 1.0 application that I call Weather Widget (for lack of a more exciting moniker).  The Weather Widget will accept a 5-digit US Zip Code and return a 5-day forecast from The Weather Channel.   You can see it in action here:  Weather Widget.  (Note:  This will require the Silverlight 1.0 plug-in).

I also took the time in this project to use (experiment) with a lot of new toys such as: 

·         LINQ to XML (and the XDocument/XElement classes)

·         New C# language enhancements including Automatic Properties, Object Initializers, Implicitly typed variables, etc. 

·         Javascript key events – some hard-learned (and forgotten and now painfully re-learned) lessons to share here

·         Integration of ASP.NET Ajax and Silverlight – my implementation here is rudimentary right now as I’m still sorting through the most efficient blending of these two technologies

·         Integration of DOM Elements with Silverlight (good post from Keith on that topic here)

·         Expression Studio (mostly Blend) -  I have much to say about this (some of which you can read in this discussion in Shawn’s comments here).  Overall, I really like a lot of things about Blend.  I am finding myself there more these days though I miss a lot of things about working in Macromedia (now Adobe) Fireworks (which I have used for MANY years for all of my design work).  One upcoming post I’m working on here is “Top 10 Things I miss from Fireworks while working in Blend”. 

·         Using JSON – I had never used it so now I have

Guess that about covers it.  I’ll link back to the above points as I blog about each. 

I have several things I’m planning to add (and am open to suggestions), but wanted to get it out there in its current state.  Once I am happy with it, I’ll post it to the gallery on the Silverlight.net site. 

Let me know if the Widget blows up…at this point, I’ve tested only on IE7 and Firefox on my laptop (Windows Vista64). 

 

Monday, January 07, 2008 5:25:20 AM (GMT Standard Time, UTC+00:00)
  Comments [8]  | 
Expression Blend December Preview is out#

This page has a list of changes, as well as, a link to get the bits:

http://www.microsoft.com/expression/products/download.aspx?key=blend2preview

 

 

Saturday, December 08, 2007 3:50:31 AM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Sharing Folders in Remote Desktop#

Today, I was struggling with getting some code deployed to a client's test server and called him to double-check FTP credentials and such.   He casually mentions having the ability to share your hard drive (and other devices) with a Remote Desktop session.  How many times would that have come in handy?!?!   Anyway, I dug into it further and it works! 

Check out Dan Mork's blog posting on the topic as he does a great job of walking you through the process.  (Make sure and check the comments as there is another really good tip there about saving your Remote Desktop connection with your configuration). 

Wednesday, October 17, 2007 7:52:28 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Deep Dive: CSS for the ASP.NET Developer#

Thanks everyone for the comments and tips offered after I gave this presentation at Alabama Code Camp, as well as, at the Atlanta Cutting Edge .NET group last week.  I received several "so that's how it works" comments and that was exactly the point of this talk.

Here is the abstract of the presentation:

This will be a thorough discussion of all that is CSS.  Whether you know it as the necessary evil or the great enabler (that just hasn’t quite clicked for you yet), you should walk away with something valuable from this discussion.  I will begin with the basic box model and travel all the way to the holiest of grails (the no tables here, two and three column ASP.NET Master Page layout…yours to take home for free!).  Along the way, we’ll touch on some CSS Best Practices and gotchas in ASP.NET and take a look at the new CSS tools in Visual Studio 2008 (Orcas).

Get the download here.

Note:  The solution file provided is from Visual Studio 2008 (Orcas) Beta 2.  There is nothing .NET 3.5 specific (as most of it is HTML anyway).   

Update 04/01/08:  Updated the download to compile under Visual Studio 2008 RTM

Monday, October 08, 2007 6:38:05 PM (GMT Standard Time, UTC+00:00)
  Comments [2]  | 
Time for T : An Introduction to .NET Generics#

Finally able to grab a minute to post my code and slides from the Introduction to Generics presentation that I did this past weekend at the Alabama Code Camp at the University of Alabama. 

This is the abstract from the presentation:

With the release of the 2.0 version of the .NET Framework, Generics became first class citizens

in the Common Language Runtime.  Yet, many still shy away from using them because of perceived difficulty or other misconceptions.   This presentation will seek to dispel a few of these myths and offer a gentle introduction into using Generics on a daily basis.  Along the way, I’ll also demonstrate language enhancements in the .NET 3.5 runtime that lend themselves nicely to working with Generics. 

 

Get the download here.  

Note:  The code is compiled on Visual Studio 2008 (Orcas) Beta 2.  The only project in the solution that uses .NET 3.5 specific code is the Collections project.  This uses C# 3.5 Automatic Properties and Property Initializers. 

Monday, October 08, 2007 6:24:56 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Visual Studio 2008 (Orcas) CSS tools#

I just returned from speaking at the Alabama Code Camp 5.0 in Birmingham.  One of my presentations was Deep Dive CSS for the ASP.NET Developer and I had hoped to spend some time on the tools in Orcas for working with Cascading Style Sheets.  Unfortunately, I did not get a chance to do that due to the time constraints, so I wanted to post some of my better links on that subject...

How to: Use the Apply Styles and Manage Styles Windows
http://msdn2.microsoft.com/en-us/library/bb398979(VS.90).aspx

            How to: Use the CSS Properties Window
           
http://msdn2.microsoft.com/en-us/library/bb398902(VS.90).aspx

How to: Use the Direct Style Application Toolbar
http://msdn2.microsoft.com/en-us/library/bb398977(VS.90).aspx

 

Monday, October 08, 2007 5:45:59 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Generic Methods: Find Controls by Type#

Although this was originally part of my recent Generics presentation, I have received several requests to publish it separately. 

 

The reason that I created this originally was that I found myself often-times wanting a strongly-typed list of all the checkboxes / buttons / etc in my code-behind/beside pages.  There is the Page.FindControl(string id), but that only allows you to get a control by id and it returns a Control.  I wanted something more specific, yet generic enough to use as a Utility.  This was screaming for Generic Methods, so below is what I came up with.

 

I use this constantly and hope that someone else gets some mileage out of it.  If you have improvements, please post them.  For example usage, download the full Generics presentation. 

 

 

using System;

using System.Collections.Generic;

using System.Text;

using System.Text.RegularExpressions;

using System.Web.UI;

using System.Web.UI.WebControls;

 

namespace r2musings.Web.UI.WebControls

{

  public static class Utility

  {

    #region FindControlsByType

   

    /// <summary>

    ///   Returns a generic list of controls of a provided type starting at a

    ///    a provided base control (works recursively)

    ///    Example Usage: 

    ///       List<Button> buttonList = Utility.FindControlsByType<Button>(testPanel);

    ///       This would return a list of all Buttons contained anywhere within testPanel

    /// </summary>

    /// <typeparam name="T">Type of control</typeparam>

    /// <param name="parentControl">Base control to start search</param>

    /// <returns></returns>

    public static List<T> FindControlsByType<T>(Control parentControl) where T: System.Web.UI.Control

    {

      // new up our return list

      List<T> returnList = new List<T>();

 

      // loop through all controls and call internal recursion to

      //   add all controls of type T to the returnList

      foreach (Control childControl in parentControl.Controls)

      {

        InternalFindControlsByType<T>(childControl, returnList);

      }

     

      // return our List<T>

      return returnList;

    }

   

    #endregion

 

    #region Recursion Method

   

    /// <summary>

    ///   Should NOT call this method directly

    ///   This is for the internal recursion of FindControlsByType() 

    /// </summary>

    /// <typeparam name="T">Type of control</typeparam>

    /// <param name="parentControl">Base control to start search</param>

    /// <param name="returnList">List to add Controls</param>

    private static void InternalFindControlsByType<T>(Control parentControl, List<T> returnList) where T: System.Web.UI.Control

    {

      if (returnList == null)

        throw new ArgumentNullException("Null List passed to InternalFindControlsByType");

 

      if (parentControl is T)

      {

        returnList.Add((T) parentControl);

      }

 

      foreach (Control childControl in parentControl.Controls)

      {

        // call this method recursively to get all child controls

        InternalFindControlsByType(childControl, returnList);

      }

    }

   

    #endregion

  }

}

Monday, October 08, 2007 3:07:05 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Google, Live, MSDN Search within Visual Studio 2008#

Since Matt Ranlett has now harassed me several times for removing the Google/MSDN macro from my blog, I decided to repost it.  I have added Live Search to the mix this time and I have tested all of the searches on Visual Studio 2008 Beta 2. 

 

The background on this was that I was spending a lot of time on Google and MSDN (aren't we all?) and was going back and forth from Visual Studio to the browser, so I decided to try and integrate my searches into Visual Studio.  The resultant experience is that you can highlight any text in Visual Studio and press your assigned keyboard shortcut and receive search results from your favorite search engines WITHIN the Visual Studio IDE.  It really comes in handy! 

 

In the code below, I have provided the URLs for searching against Google, Live, and MSDN.  It should be pretty obvious when you look at the macro what you would need to do to configure any other search engines.  Be sure to uncomment one (and only one) of the

url lines in the code when you setup each macro. 

 

For those not familiar with macros, here are the steps to add a macro in Visual Studio:

 

1)      Go to Tools | Macros | Macros IDE

2)      Once in the Macros IDE, you can create a new Module or you can just add this to the default “My Macros” module. 

3)      To add to My Macros, just right click on it in the Project Explorer and choose Add | Add New Item.  (if you don’t see the Project Explorer, try View | Project Explorer). 

4)      When the Add New Item Dialog shows up, select Code File and enter GoogleSearch and click OK.

5)      Paste the Code for GoogleSearch below into this file and save it.

     Make sure that you uncomment one of the url lines in the code. 

6)      Click Debug | Build and then close the Macros IDE.