Promotion and Move

By Bill at March 28, 2009 20:45
Filed Under: News, Move

RaleighI’ve  been offered a promotion at the company for which I work.  I’ve been a software developer at Coleman Insights for 13 years working on various software projects as a programmer or designer.

With the promotion, my title is now Director of Technology.  In this new position I will supervise several software projects at the same time as well as manage all technology for the company.

Over the years, I’ve always worked for Coleman from home, first in Dallas, then in New York, then in Dallas again and finally in Brooklyn.  In July, we will move to Raleigh, NC so that I can work from the office.

This is a big move in many ways.  It will be our fifth move in ten years.  This will likely be the first one that Isaac remembers.  He is in the second grade now and will start the third grade this fall in North Carolina.  He will be leaving friends and teachers.

Deb is leaving her job behind and doesn’t have one lined up.  She’s going to take this opportunity to rethink her career and perhaps start a whole new one.  For the time being, she’ll stay home and put our new home together.

I’m sad to be leaving the city I love, New York, and the city I’ve grown to love, Brooklyn.  These places will always be home to me.  I’ll miss my mom and my sister and her family.  I’ll miss the neighbors I’ve come to know in our little corner of Brooklyn, Windsor Terrace. At the same time, I’m excited about all of the new opportunities this move will afford us. 

See more in the move category.

kick it on DotNetKicks.com

Bakugan Hustle

By Bill at March 24, 2009 17:45
Filed Under: Parenting, Random

Lars Lion [800x600] Bakugan are action figures and toys based on a show on Cartoon Network. 

Each of the action figures has a G power rating that is a number between 200 and 700 and is printed directly on the figure.  The higher the number, the more powerful the figure is in the Bakugan games. The more powerful the figure is, the more valuable the figure is to people who trade them. 

The Bakugan game is played with the figures and trading cards that, when played, alter the G Power of the Bakugan.  The winner is determined by which Bakugan has the most G after all cards are played.  A Bakugan that has a higher G power to start is much harder to beat. 

Side Note: I actually like the kids playing the game because it requires them to do quite a bit of math in their heads.

At Isaac’s school, Bakugan are like money among the 5 to 10 year olds.  Trades and matches are negotiated and brokered with the seriousness of Wall Street.  And, like on Wall Street there are hustlers as well. 

One of Isaac’s friends claims to have a special card that can permanently boost the G power of a Bakugan, not just in a match, but forever.  Since the card is from Japan and is written in Japanese no one can read it.  Not that anyone would have a chance otherwise; for one reason or another the boy is unable to bring the card to school to show to his friends.  At any rate, this card makes it very hard to beat his Bakugan in matches because at one time or another all of his Bakugan were permanently boosted.

Now if the story ended there with some kid cheating his way through school yard games, it wouldn’t be all that special.  However, like all of the Wall Street stories that have been coming out, it doesn’t end with just a little cheating here and there.  The latest thing is that this kid is now trading Bakugan that have had their G power magically boosted.  For example, just today he traded a Bakugan with Isaac.  The Bakugan is rated at 300G, but Isaac was led to believe that it was really a 600G Bakugan because it was boosted with the special card. 

This isn’t just cheating anymore.  More powerful Bakugan actually cost more real life money with the most powerful fetching up to $50.  Convincing kids to trade high powered Bakugan for lower powered Bakugan by misrepresenting their G power is a form of stealing.  It’s not Bernie Madoff stealing, but on a school yard scale I thought it was still a big deal.

When Isaac got home from school today, he asked me to help him change the number on his new Bakugan and explained how it had been permanently boosted.  That’s when I decided that I would have to explain this to him.  I tried, but he didn't believe me at first. He really wanted to believe that he had just scored a really powerful Bakugan.  Finally, I sent a message to Action Figure World and they helped me set him straight, but I was wondering if I should leave it at that.  Isaac was heart broken when he realized that he had been cheated.  I don’t know if it was the realization that he had lost a valuable toy or that his friend had lied to him, but he was really upset.  Should I have just let him believe?  Should I have helped him change the number?

Well, I’ve already explained it to him, so I can’t undo that, but is that it?  Do I just let him take care of it and try to get his Bakugan back, or do I take a more active role and make sure that the trade is undone?  And what about the situation in general?  Do I leave the con going or do I alert some of the other parents or teachers.  I really don’t want to make too big a deal out of it.  I was wondering if I can take the geek / web 2.0 way out and just blog about it and hope things resolve themselves.

What do you think?

kick it on DotNetKicks.com

This American Life #375: Bad Bank

By Bill at March 16, 2009 11:24
Filed Under: Politics

piggy

This American Life presents an excellent primer on the current economic crisis.  If you haven’t already listened to this episode of This American Life, listen to it right now!

 

 

From the show website:
The collapse of the banking system explained, in just 59 minutes. Our crack economics team—the guys who explained the mortgage crisis, Alex Blumberg and NPR’s Adam Davidson—are back to help all of us understand the news. For instance, when we talk about an insolvent bank, what does it actually mean, and why are we giving hundreds of billions of dollars to rich bankers who screwed up their own businesses? Also, two guys go to New Jersey to look at a toxic asset.

Link: This American Life # 375: Bad Bank

kick it on DotNetKicks.com

Presenting Detail Values as part of the Master – part 1

By Bill at March 10, 2009 02:52
Filed Under: .Net Programming

This is part one of a three part series on working with master-detail data.  In part one I will show how to present detail values as indexed values on the master using a utility I wrote called the SubAttributeAccessor.  In part two I will show how the SubAttributeAccessor works.  In part three I will introduce a descendant class of DataGridViewColumn called the SubPropertyColumn that will allow showing the detail values as part of the master data.

On more than one occasion I’ve been asked to present master-detail data with the detail data being presented as if they were actually additional fields on the master record.

One time there were literally hundreds of detail records, but only one or two of them would be shown at a time. The master data were names and each of them had a never-ending list of scores.  The names were presented in a table and the last few scores were shown as additional columns with the date of the score as the header.

DataClasses Another time, it was a list of songs where each song had the usual attributes like artist, title, album, etc.  However, each song could also have an unlimited list of “user attributes”.  For example, one user might want to add a tempo and a category to his songs.  Another user might want to add a genre, a year and a rating to his songs.

I’m going to use a simpler version of this last example in this article.  The data will be stored in two tables: a songs table and an attributes table.  The songs table will have three fields: a unique code, an artist and a title.  The attributes table will have four fields: a unique code, a song code, a field name and a value.  The song code will directly relate each attribute to exactly one song.  The field name will be used to identify the the data (e.g.: tempo or score).  The value will store binary data of no particular type.  This is where each of the attributes actually will be stored. There is no limit to the number of additional attributes a song can have.

This master-detail setup is also reflected in the objects used to represent this data in code.  There will be a class named Song and a class named Attribute.  The Song class will own an unlimited list of Attribute.  In the attached solution, I used LINQ to SQL to generate the initial classes.

   1: using System.Collections.Generic;
   2: using System.IO;
   3: using System.Runtime.Serialization.Formatters.Binary;
   4: using System.Text;
   5: namespace SubPropertyColumns {
   6:     partial class Song {
   7:  
   8:         private SubAttributeAccessor<Attribute> fProperties = null;
   9:  
  10:         /// <summary>
  11:         /// Used to access the SongPropertiesAccessor class which
  12:         /// has an indexed property to access the additional
  13:         /// properties.
  14:         /// 
  15:         /// since the Song class already has a member called Attributes,
  16:         /// we'll call this Properties
  17:         /// </summary>
  18:         public SubAttributeAccessor<Attribute> Properties {
  19:             get {
  20:  
  21:                 //the the accessor hasn't been created yet,
  22:                 //create it passing a refrerence to this Song
  23:                 if (fProperties == null) {
  24:                     fProperties = new SubAttributeAccessor<Attribute>(this, "Attributes", "FieldName", "Value");
  25:                 }
  26:  
  27:                 return fProperties;
  28:             }
  29:         }
  30:  
  31:         /// <summary>
  32:         /// This is the default indexed property
  33:         /// It is just a wrapper around the Properties property
  34:         /// that allows us to access the functionality without having
  35:         /// to use the Properties name.
  36:         /// </summary>
  37:         /// <param name="index"></param>
  38:         /// <returns></returns>
  39:         public object this[string index] {
  40:             get {
  41:                 return Properties[index];
  42:             }
  43:             set {
  44:                 Properties[index] = value;
  45:             }
  46:         }
  47:  
  48:     }
  49: }

LINQ to SQL generates the classes as partial classes which allows us to add a few properties of our own.

The first thing we add, on line 8, is a private field of type SubAttributeAccessor<T>.  The SubAttributeAccessor does all of the work accessing the list of attributes and presenting them as an indexed property.

Next, on line 18,  we add a public property to access the SubAttributeAccessor.  The property checks to see if SubAttributeAccessor is created and if it isn’t it creates it.  When creating the SubAttributeAccessor, on line 24, we need to add a few important parameters.  First, we need to include the type parameter <Attribute>.  This defines what the type of each of the attributes will be.  In our case, the type of the attribute is Attribute. We also need to add a reference to the object itself and the names of several fields.  We need the reference to the object itself so that the SubAttributeAccessor can have access to the list of attributes.  Then, we need to tell the SubAttributeAccessor the name of the property on the object that is the list of attributes.  In this case it is “Attributes”.  We also need to tell the SubAttributeAccessor the name of the property on each of the attributes that will be used as the index.  In this case it is “FieldName”.  Finally, we need to tell the SubAttributeAccessor the name of the property on each of the attributes that will be the actual value of the attribute.  In this case it is “Value”.  It is important to note that the first property name is the name of a property on the master object – it is the property that returns a list of detail objects.  In this case it is the Attributes property on the Song class itself.  The next two property names are names of properties on the detail object.  In this case, they are the FieldName and Value properties of the Attribute class.  It is also important to note that we named the SubAttributeAccessor property “Properties” because the Song class already has a property named Attributes.

Now that we have a SubAttributeAccessor hooked up to our Song class, we can already write code like:

   1: Song MySong = new Song();
   2: MySong.Properties["Tempo"] = "Medium";
   3: MySong.Properties["Rating"] = 5;

However, we can take this one step further.  On line 39, we add a default indexed property that is just a wrapper around the Properties property.  This allows us to drop the poorly named .Properties and just use the index directly on Song like so:

   1: Song MySong = new Song();
   2: MySong["Tempo"] = "Medium";
   3: MySong["Rating"] = 5;

At this point we’re able to access the detail data as indexed values of the master.  In the next part I’ll show how the SubAttributeAccessor works.  Finally, in the third part, I’ll introduce a descendant of DataGridViewColumn that will allow us to show the indexed detail data in line with the master data as additional columns.

Source Code : SubPropertyColumns.zip (485 KB)

kick it on DotNetKicks.com

Authors

  RSS Feed Bill Fugina

Bill is Director of Technology for Coleman Insights. He enjoys programming, software design, walking, reading, dining out and watching movies, most of which he enjoys even more when he doing them with his wife, Deb, and or his son, Isaac.  Bill and Isaac are working on a video game, but they haven't made very much progress yet.

  RSS Feed Debra Hill

Deb dabbled in Project Management in the Advertising industry for (too) many years. She has happily ditched that and is taking some time to decide what is next career-wise. She enjoys gardening, knitting, sewing and various other crafty things. She also enjoys vegetating on the weekends with the family.

RSS Feed Isaac Hill-Fugina

Isaac has his own blog called Isaac's Place.

Recent Comments

Comment RSS

Bill's Run.GPS Stats

Training Sessions 16
Total Distance 50.17 mi
Total Time 0.11:50:02
Calories 6961 kcal
Average Speed 4.24 mph
Min Altitude -157 ft
Max Altitude 590 ft
Total Ascent 226 ft
Total Descent 236 ft