Where would you like to go, Toady? RSS 2.0
# Sunday, June 22, 2008

Good Job Plurk!  I won't be doing that again.

This is what happens when you use their built-in 'feature' to add people you already know from another service, such as Gmail. 

Have we not heard of using ssl or form submission without using querystring values?  It's really not that difficult guys...

Sunday, June 22, 2008 1:18:53 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Bookmark, Tweet, or Share

# Tuesday, June 03, 2008

The first day of Tech Ed has been exciting and full of things to be learned and explored.  Here are the sessions I attended and my thoughts/reflections on each.

Keynote with Bill Gates, S. "Soma" Somasegar, others


Pragmatic Architecture: The Role of an Architect with Ted Neward

  • Architects spend too much time defining their role
  • The building architect analogy is good, but the maestro/conductor comparison is better.
  • How do we start polishing the process of software architecture over the next 5-10 years?
  • Why is there often a negative connotation with the title "Architect"
  • Some architects really have no idea what is going on.  You must understand the big picture before you can create solutions at this level.
  • Should architects still write code?  Absolutely!


Best Practices with the Microsoft Visual C# 3.0 Language Features with Mads Torgersen (PM for C#)

 

Automatically implemented properties

public string CustomerID { get; set; }

 

Implicitly typed Local variables

 

 

var custs = new List<Customer>()

{

new Customer()

{

                        CustomerID = “MADST”;

                        CustomerName = “Mads Torgersen”;

                        City = “Redmond”;

}

}

 

Collection and Object Initializers

Code-result Isomorphism

            Shape imitates result

 

ObjectDumper

 

Extension Methods

Public static IEnumerable<Customer> GetLondoners(this IEnumerable<Customer> source)

Foreach (var c in source)

{

            If (c.City == “London”) yield return c;

}
Allows you to insert extension methods into an instance (even if static)

New functionality on existing types

Scoped by using causes

Interfaces & constructed types

 

Lambda Expressions

Public static IEnumerable<T> Filter <T>(GetLondoners(this IEnumerable<T> source, Predicate>T> p)

foreach (var c in source)

{

            If (p(c)) yield return c;

}

 

var query customers.Filter(delegate(Customer c) { return c.City == “London”; };

 

Terse syntax for anonymous methods:

var query customers.Filter(c =>{ c.City == “London”;});


*When you only have one thing left you can remove the parens

 

LINQ to Objects

var query = Customers

            .Where( c=> c.City == “London”);

            .Select ( c=> c.ContactName);

 

ObjectDumper.Write(query);

 

Monads – Look into this

 

Don’t use LINQ for *other magic* that is not a query

 

Expression Trees

Related to link

Expression(of)

Represents a lambda expression as an expression tree at runtime

 

 


ASP.NET MVC with Scott Hanselman

  • Separation of Concerns!
  • A new .NET project type
  • Designed to be very easily testable with minimal need for mocking objects compared with other patterns
  • Test with mbunit or integrated VS test system
  • Uses three new namespaces:
    • System.Web.Abstractions
    • System.Web.Mvc;
    • System.Web.Routing;
  • "Bin-deployable" These new assemblies do not have to be installed in the GAC.  Useful when you can't, or are afraid to, install them there.
  • Flexible.  Plays well with Winforms
  • Fundamental to .NET from version 3.5 forward
  • Demo of red-green TDD.  This is really quite easy with MVC because of much improved separation of concerns when used properly
  • JQuery and AJAX compatible
  • Dove into the call stack for MVC at runtime, it's quite informative for understanding what's going on "under the covers".  Have a look at the call stack of a running MVC app to get a good picture of what's going on.
  • Discussion of Routing
  • Provides for cleaner URLs and HTML
  • Phil Haack (PM for MVC) is open to suggestions from the community and will be incorporating recommendations from developers as much as possible.
  • "Strongly typed query strings"
  • Much better than average runtime errors when something goes wrong.  This is strange but true!
  • Discussed Extension Methods, Lambda queries, and LINQ
Tuesday, June 03, 2008 12:04:02 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [2] -
Bookmark, Tweet, or Share

# Wednesday, May 28, 2008

privacyLink.Text = String.Format("<a href=\"{0}\"{2}>{1}</a>", hrefLink, LinkBuilder.ExtractTextFromLink(links[0]));

This caused me a bit of grief this evening.  While I am not a fan of building strings like this, it's the way things were and I had to run with it.  In an ideal world this would be done with a text or html writer, but I'll be happy with anything short of basic string concatenation. 

While refactoring a fairly large application for a web analytics migration, I missed one small but key problem with the line of code listed above.  The error given was referencing an array index out of bounds or an undefined array index referenced.  Thus I immediately went chasing after a possible problem with the links array being empty or null.  This proved futile, and after a few minutes of tracing the flow and checking the history of changes on this file it became apparent that if there was a problem with the array reference, it had been an issue for at least six months. 

Google had a cached copy of the page, indexed before my code push, which told me it had definitely been working before I touched anything.  I decided a closer look at the String.Format() method call was necessary.  In this instance we're expecting a string formatter and an array of one or more strings as additional parameters. 

Since this uses late binding of the string parameters into the formatter, the compiler never checks that the correct number of arguments are specified.  It would have been nice if the compiler had been designed to parse the formatter and fail the compilation if one too few arguments were provided, but understandably that responsiblity falls on the developer in this case.

There were some key factors in why this bug made it into production before being caught during testing there:

  • Partially centralized link building, duplicated in many different portions of the application when a single linkbuilding class would have been ideal.  In reality, halfway OOP is often much worse than none at all.
  • Code that is not testable with out cost-prohibitive refactoring.
  • Limited content and resources with which to test in the staging environment
  • The error only occurs when a custom privacy policy link is used, >70% of the time the default is used.  Only 5 of well over 100,000 pages were throwing the error.
  • Lack of automated tests on production data.  We're working to eliminate this particular hindrance, but precious time for such "extras" is always scarce.

I was eventually able to correct the error and push the code up to staging and pre-production to validate the fix.  In the end the fix made its way to production before customers became aware of the problem, but these kind of errors are preventable by working to correct the problems listed above.

Wednesday, May 28, 2008 9:40:17 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Bookmark, Tweet, or Share

# Thursday, May 01, 2008

See you there!

http://tinyurl.com/4l4bdr

Thursday, May 01, 2008 7:16:40 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Bookmark, Tweet, or Share

# Thursday, April 10, 2008

~A Camping Trip~

April 18th to April 20th ("May" was a typo)

We are thinking of staying at or near Linville falls.  It's either there or at Price Park and drive over the the nearby falls.  Let me know if you and/or friends want to go.  The more the merrier.  We just need to know how many so we can try to reserve enough space for everyone.  If you need a tent let me know, I have a couple or three extras. 

Linville Falls Campground, located off the Blue Ridge Parkway at milepost 317, is family oriented, located next to the Linville River. It provides easy access to numerous hiking trails to some of the most beautiful scenery in the Linville Gorge area. Interpretive programs are provided on weekends during the peak recreation season. Fishing opportunities are available on the Linville River.

   

 

Julian Price Park Campground is located on the beautiful Blue Ridge Parkway near Boone and Blowing Rock NC. The campground is adjacent to Price Lake. Fishing and boating are allowed. Fishing requires a state license and no motor boats are permitted. Canoe and rowboat rental is available from Memorial Day - Labor Day, and on weekends in early May, late September and the month of October. Hiking trails and trailheads are located within the campground.

   

Please RSVP as soon as possible but at least by Wednesday April 16 if interested.

//Chris

Thursday, April 10, 2008 11:50:52 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Bookmark, Tweet, or Share
# Monday, April 07, 2008


Monday, April 07, 2008 8:11:57 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Bookmark, Tweet, or Share
# Saturday, April 05, 2008
That didn't take long... Regardless of their official reasons for closing on their site, I would venture to guess that the combination of charging $10 per ticket and using GSO as a major hub played a large role.

It's still a little disappointing to see GSO add and lose an airline so quickly
Saturday, April 05, 2008 2:10:46 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Bookmark, Tweet, or Share


Spooky!, originally uploaded by ballance5702.

This is a time lapse shot I took of some friends around a bonfire in the backyard. I'm not quite sure who the uninvited guest in the tree is.  Invader Zim or the rabbit from Donnie Darko?

Saturday, April 05, 2008 2:07:34 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] -
Bookmark, Tweet, or Share

# Wednesday, February 20, 2008

I finally got around to creating a blog, so here it is.  It could use some content, but I'll get around to it soon enough. 

I started as a full-time employee with Volvo IT North America earlier this month, where I had been working as a long-term contractor for just under three years.  Things are nearly as busy as they always were, but looks like we're finally going to have a bit of structure in place and maybe start doing things the right way.  Only time will tell how much of "doing things the right way" pans out, but I've got a good group of developers in my team who have some great ideas and the ambition to move on them.

On the homefront, Bridget and Roxy are both doing well.  My home's aquatic residents are most blissful and doing just great also.  Bridget's classes are going to keep her out pretty late in the evenings for a while, but soon she will be done with all her post-licensing classes and have her EcoBroker designation.  I'm proud of her new endeavors in the real estate market and think the career suits her well.

In entertainment news I have decided to become a rock star in my spare time, dusting off the strat and putting some effort into getting my fingers well calloused.  This evening I'm checking out Steady Elegance's hip-hop group "Ricardo Sanchez's Escort Service" at Greene Street in downtown Greensboro and Big Mike's gig at the same venue on Saturday night.

 And now....back to keeping this web server happy!

Wednesday, February 20, 2008 12:01:32 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Bookmark, Tweet, or Share
Stackoverflow.com Rep
Flickr stream
Archive
<July 2008>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Chris Ballance
Sign In
Statistics
Total Posts: 46
This Year: 12
This Month: 0
This Week: 0
Comments: 11
All Content © 2010, Chris Ballance

Valid XHTML 1.0 Transitional