Click here to Skip to main content

Don Kackman - Professional Profile

Summary

39,342
Author
586
Authority
443
Debator
246
Editor
14
Enquirer
569
Organiser
1,409
Participant
The first computer program I ever wrote was in BASIC on a TRS-80 Model I and it looked something like:
10 PRINT "Don is cool"
20 GOTO 10
It only went downhill from there.
 
Hey look, I've got a blog
Member since Wednesday, December 11, 2002 (10 years, 5 months)

Contributions

Articles 18 (Legend)
Tech Blogs 8
Messages 308 (Poster)
Q&A Questions 1
Q&A Answers 0
Tips/Tricks 0
Comments 0

Links

Groups

Below is the list of groups in which the member is participating


CodeProject Beta Testers
United States United States
Member
Collaborative Group
members

No Biography provided

Reputation

For more information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege, and the given member types also gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilverAdmin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your biographybronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an Articlesilversilversilversilver
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

Actions with a green tick can be performed by this member.


 
You must Sign In to use this message board.
Search this forum  
GeneralNormalizing the contents of a dictionary Pin
Saturday, January 9, 2010 8:14 AM by Don Kackman
Querying some data where each item may or may not have the same set of fields really throws off the WPF DataGrid. As it binds each row it throws and catches an exception every time it can't find a field entry. This is SLOOOOOOOW for a sparsley normal (if that's a term) data set.
 
Normalizing the data get's around all these possible exceptions at the expensive of determining the union of all fields and iterating over all of the data filling in the gaps.
public static IEnumerable<IDictionary<TKey, TValue>> Normalize<TKey, TValue>(
   this IEnumerable<IDictionary<TKey, TValue>> rows)
{
    return rows.Normalize<TKey, TValue>(EqualityComparer<TKey>.Default);
}
 
public static IEnumerable<IDictionary<TKey, TValue>> Normalize<TKey, TValue>(
   this IEnumerable<IDictionary<TKey, TValue>> rows, 
   IEqualityComparer<TKey> comparer)
{
    Debug.Assert(rows != null);
 
    IEnumerable<TKey> columns = rows.SelectMany(d => d.Keys).Distinct(comparer);
 
    List<IDictionary<TKey, TValue>> list = new List<IDictionary<TKey, TValue>>();
    foreach (IDictionary<TKey, TValue> row in rows)
    {
        foreach (TKey column in columns.Where(column => row.ContainsKey(column) == false))
            row.Add(column, default(TValue));
 
        list.Add(row);
    }
 
    return list;
}

 
10 PRINT Software is hard. - D Knuth
20 GOTO 10

 
GeneralMemories of VARIANT Pin
Thursday, December 31, 2009 12:29 PM by Don Kackman
Writing this little extension method brought back some memories of VARIANT and IDispatch(Ex)...
public static void SetValue(this object o, PropertyInfo property, object value)
{
    Debug.Assert(o != null);
    if (property != null)
        property.SetValue(o, Convert.ChangeType(value, property.PropertyType), null);
}
Sure is easier to be duck typed nowadays in Microsoft-land.
 
10 PRINT Software is hard. - D Knuth
20 GOTO 10

 
GeneralI like Lazy&lt;T&gt; Pin
Tuesday, November 24, 2009 12:43 PM by Don Kackman
Here's a nice little addition to .NET 4.0: formalization of the lazy loader pattern. A simple looking generic that takes a lamba function in its constructor that will get called on the first access to the Value property.
 
Take this code:
 
private CommandCollectionViewModel _menuCommands;
 
public CommandCollectionViewModel MenuCommands
{
      get
      {
          if(_menuCommands == null)
               _menuCommands = CreateCommands();
 
          return _menuCommands;
      }
}
and replace it with this
private Lazy<CommandCollectionViewModel> _menuCommands;
 
public MainWindowViewModel()
{
      _menuCommands = new Lazy<CommandCollectionViewModel>(() => CreateCommands());
]
 
public CommandCollectionViewModel MenuCommands
{
      get
      {
          return _menuCommands.Value;
      }
}
Cleans up the getters and puts member initialization in the constructor; which is a pattern I prefer.
 
10 PRINT Software is hard. - D Knuth
20 GOTO 10
modified on Monday, November 30, 2009 5:30 PM

 
GeneralHiking up the WPF Learning Curve Pin
Friday, November 20, 2009 3:05 PM by Don Kackman
In my ongoing quest of not becoming totally useless as a software engineering manager I'm finally starting up the WPF hill.
 
Dang that sucker's steep. OMG | :OMG: Can't I just have my win32 back? Poke tongue | ;-P
 
10 PRINT Software is hard. - D Knuth
20 GOTO 10

 
GeneralCoalescing an enumerable list of nullable types Pin
Wednesday, November 18, 2009 8:28 AM by Don Kackman
Here's a handy method if you're dealing with a lot of Nullable types.
 
public static IEnumerable<T> Coalesce<T>(this IEnumerable<T?> source) where T : struct
{
     Debug.Assert(source != null);
     return source.Where(x => x.HasValue).Select(x => (T)x);
}
 
(I looked around for some built in Linq method to do this but didn't find one.)
 
10 PRINT Software is hard. - D Knuth
20 GOTO 10
modified on Wednesday, November 18, 2009 2:51 PM

 
GeneralExtension Methods Pin
Tuesday, December 30, 2008 10:24 AM by Don Kackman
At first I thought extension methods were kind of silly. Nothing but static methods and compiler tricks.
 
And while extension methods are indeed nothing but smoke and mirrors around static methods, I have grown to like them.
 
In the modern world of "Intellisense driven development" they help a ton. Cause I will say this much: without Intellisense I wouldn't have had a chance in heck of figuring Linq out.
 
10 PRINT Software is hard. - D Knuth
20 GOTO 10
modified on Saturday, January 30, 2010 9:31 AM

 
NewsiPhoneUI Pin
Sunday, December 28, 2008 5:04 AM by Don Kackman
The iPhone-like shell for WindowsMobile is really starting to come together.
 
Starting from Bertoneri Luigi's code (posted here on CodeProject: http://www.codeproject.com/KB/mobile/IPhoneUI.aspx[^]) it's now got a bunch of new stuff:
 
Per Pixel alpha blending, integration with WindowsModbile SystemState changes (for notification of things like missed calls etc), integration with Windows Mobile Start menu links, plus some other little bells and whistles.
 
What's been the most fun is making a declarative framework so that most of the UI gets stitched together with XML. Next I think I'm going to see if all of that can be done or redone in SilverLight Mobile.
 
If you're curious or would like to help with some coding check it out at:
http://www.codeplex.com/iPhoneUI[^]
 
10 PRINT Software is hard. - D Knuth
20 GOTO 10

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130513.1 | Last Updated 14 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid