| Comments

NDA.  Non-disclosure.  Hush documents.

Not many people like them.  In the technology world they are a necessary evil.  Personally I don’t think that way.  I think NDA’s are generally a good thing.  It’s enabling legalese to let two parties participate in information exchange when they don’t want the rest of the world to know about them.  NDA is a general term, of course, and the wording in any non-disclosure agreement is subject to the two parties involved.  Heck it could say “We’re going to show you everything and you agree only to not talk about feature X…everything else is fair game.”  Usually they don’t.

Enter the iPhone SDK.  The frustrating part for iPhone developers wanting to share their knowledge, innovate on the platform, etc.  It was assumed from a lot of developers that upon the release of iPhone 2.0 software that the NDA would be lifted.  Guess what – it isn’t (as of this writing).  What does that mean?  Well, among other things, people who have the SDK are under that NDA and shouldn’t be discussing it with anyone other than Apple.  Guess what…even if your best friend is under the same NDA, technically your agreement is only with Apple, not ‘anyone else under NDA.’

My local Cocoa/iPhone user group in my area recently shut off their email list and posted this message:

“IMPORTANT NOTE: AT THE PRESENT, IN ORDER TO RESPECT THE IPHONE DEVELOPER TERMS AND CONDITIONS, WE HAVE DEFERRED MESSAGE POSTING AND OUR FIRST MEETING UNTIL OPEN DISCUSSION ON IPHONE DEVELOPMENT IS ALLOWED BY THE NDA, AND BLESSED BY APPLE. OUR GOAL IS TO PROMOTE APPLE IPHONE TECHNOLOGY ACCORDING TO PROPER GUIDELINES AND NOT PRESENT EVEN AN APPEARANCE OF IMPROPRIETY. ALL GROUP MEMBERS WILL BE NOTIFIED AS SOON AS WE ARE FREE TO OPENLY COLLABORATE.” source: Phoenix iPhone Developer Group

As frustrating as it is for passionate folks, bravo to this group to at least ensuring their channel they’ve created isn’t a faucet of information that shouldn’t be shared just yet.  There are other groups that I’ve seen hosting iPhone developer discussions and I can’t imagine how they are doing that without talking about thing that violate the agreement they have in place. 

NOTE: If you downloaded the SDK, you agreed to the NDA – sorry if you didn’t read it, but you did.

An NDA is in place to provide valuable information to those who want to agree to it.  By not honoring that you’re stealing information essentially.  Beyond the legal stuff which I don’t pretend to understand in a deep manner, it just isn’t really ethical for you as an individual, business, developer, community, whatever.  I don’t care if it is with a darling company like Apple…no matter what if you agree you should be responsible. 

Another part of the SDK is the terms.  Besides not being able to be discussed, shown, shared, the terms of the iPhone SDK might prohibit any open source project.  Which brings into question the project from Wordpress.  This is an AppStore approved app that now has source available. (which is using the GPL license).  As Nathan Willis of Linux.com points out that two terms of the SDK and AppStore deployment violate explicitly the GPL (nondisclosure and code signing).  Wordpress putting the source out there violates not only the terms of the iPhone SDK but as well isn’t in line with the GPL they have selected.  How is nobody claiming shame on them?  Just because they are open source doesn’t mean they have the right to violate agreements.

Yes, I know Microsoft isn’t open source all the way by ANY means.  I don’t believe I’ve ever made that comment and certainly not here…this isn’t about a ‘well then you should to’ but rather about honoring known agreements and terms/conditions of use.

If people get lost in a frenzy of excitement and decide just to start violating things they agree to, where does that leave organizations wanting to plan and share information?  There isn’t a lot of trust left is there?  I honestly think that Apple will rectify this soon and perhaps it is just an oversight while they are dealing with the MobileMe troubles as of late, but regardless the terms are still there, the confidentiality agreements are still in place and if you agreed to them, you should honor them.  I know that is a bit of a “duh” moment…but seeing stuff like what Wordpress is doing and user groups sprouting information makes me sad that we as professionals have disregard for these types of things.

I had an idea for an iPhone app that I wanted to do to manage the life-sucking-battery-settings and others even wrote they’d pay money for that app.  When I had the idea I immediately contacted an Apple evangelist and began starting a discussion about this.  Turns out that the settings I’d need to get to aren’t available according to this evangelist in email.  I noticed the iPhone dev team has the headers needed, but even completing the app wouldn’t give me any distribution beyond myself because the mere coding against the properties would violate the terms and wouldn’t be approved in AppStore.  I suspect an app like this will surface (perhaps in the Jailbreak world) and if it does on AppStore, I’ll be pissed that I was misinformed and missed out on an opportunity!  Where was I?  Oh yeah, anyway I went to the source (Apple), inquired, and was told it wasn’t possible per the terms.  It sucks, but I’m going to honor those terms…because I agreed to.

And if you did, so should you.  Wordpress…shame on you.

Related articles:

| Comments

If you are working with Silverlight and data you most likely are going to leverage data binding at some point and run into some needs to format the data in the XAML.  Luckily this can be done using value converters, which have been available for WPF since it’s inception as well.  Let’s explore what I’m talking about using a common formatting need: dates.

Consider this list box output binding:

   1: <ListBox x:Name="FeedList">
   2:     <ListBox.ItemTemplate>
   3:         <DataTemplate>
   4:             <StackPanel Orientation="Vertical">
   5:                 <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="Red" Text="{Binding Title.Text}" />
   6:                 <TextBlock FontFamily="Arial" Text="{Binding PublishDate}" />
   7:             </StackPanel>
   8:         </DataTemplate>
   9:     </ListBox.ItemTemplate>
  10: </ListBox>

Assume this XAML binds to SyndicationFeed.Items data coming from an RSS feed.  If we simply bind it the result would be this:

Maybe we don’t want our date to be formatted in such ‘system’ looking format and we want something like “July 16.”  Enter the IValueConverter class.  First we’ll add a class to our Silverlight application, let’s call it Formatter.  Once we add that class we need to implement the IValueConverter interface which gives us Convert and ConvertBack functions we have to implement:

   1: public class Formatter : IValueConverter
   2: {
   3:     #region IValueConverter Members
   4:  
   5:     public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
   6:     {
   7:         throw new NotImplementedException();
   8:     }
   9:  
  10:     public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  11:     {
  12:         throw new NotImplementedException();
  13:     }
  14:  
  15:     #endregion
  16: }

You can see that the Convert function gets some good information that we can use to do the conversion.  The parameter value is the formatter passed into the argument.  For example in our desire to display “July 16” we want to use the date formatter shortcut of “M” for the parameter.  Let’s start the conversion.

   1: public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
   2: {
   3:     if (parameter != null)
   4:     {
   5:         string formatterString = parameter.ToString();
   6:  
   7:         if (!string.IsNullOrEmpty(formatterString))
   8:         {
   9:             return string.Format(culture, formatterString, value);
  10:         }
  11:     }
  12:  
  13:     return value.ToString();
  14: }

What we are doing here is ensuring that a parameter is passed in and then using the String object to handle the formatting for us.  Great, now we have our Convert function (in this sample we are doing one-way binding so I’m going to leave ConvertBack alone for now).  Let’s compile our code and then move back to the XAML.  In XAML we now want to make our converter available for use.  The first step is to add the CLR namespace to our root XAML node:

   1: xmlns:converter="clr-namespace:TypeConverter_CS"

The next step is to add our converter class as a resource to our XAML control so that we can use it throughout the control later:

   1: <UserControl.Resources>
   2:     <converter:Formatter x:Key="FormatConverter" />
   3: </UserControl.Resources>

Now if we go back to our XAML where we are data binding the date we can implement this and pass in the converter parameter (format) we want to use.  The end result full XAML looks like this:

   1: <UserControl x:Class="TypeConverter_CS.Page"
   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   4:     xmlns:converter="clr-namespace:TypeConverter_CS"
   5:     Width="400" Height="300">
   6:     <UserControl.Resources>
   7:         <converter:Formatter x:Key="FormatConverter" />
   8:     </UserControl.Resources>
   9:     <Grid x:Name="LayoutRoot" Background="White">
  10:         <ListBox x:Name="FeedList">
  11:             <ListBox.ItemTemplate>
  12:                 <DataTemplate>
  13:                     <StackPanel Orientation="Vertical">
  14:                         <TextBlock FontFamily="Arial" FontWeight="Bold" Foreground="Red" Text="{Binding Title.Text}" />
  15:                         <TextBlock FontFamily="Arial" Text="{Binding PublishDate, Converter={StaticResource FormatConverter}, ConverterParameter=\{0:M\}}" />
  16:                     </StackPanel>
  17:                 </DataTemplate>
  18:             </ListBox.ItemTemplate>
  19:         </ListBox>
  20:     </Grid>
  21: </UserControl>

Notice how we made a reference to our StaticResource (using the key name we provided) and then passed in the ConverterParameter of {0:M} to format our date.  The resulting output is now:

And you’ll notice the date formatting.  Now in our converter we could have been real explicit in our Convert function and looked for a date and converted it specifically, but our converter code is generic enough that it can handle some other input types like more complex date formats or numbers.  If we used this same converter code on a number we could pass in the ConverterParameter of {0:c} for currency formatted information.

If you use Expression Blend as well, you can also use some of the user interface properties to specify the binding values that will get output as XAML…here’s a screenshot of the converter settings UI in blend:

This method is useful when you may have custom conversion needs for your data.  Hope this helps!  You can download this sample here: TypeConverter_CS.zip

| Comments

I’ve been working a lot more from my home office lately and it was getting increasingly challenging during this summer with both kids at home.  Okay, let’s be honest, my wife was probably more the distraction :-).  When we built our home 4 years ago we were both working from home and built an office specifically for the both of us.  3 dedicated power circuits to the room, hard-wired ethernet to that room x 4, wireless printing, split desks, tile floor, etc., etc. – everything I wanted in my office for convenience.

Fast-forward 4 years.  Add 2 kids.  Add wife who isn’t working anymore, but maintains a full-time job managing the local community stuff she’s involved in and of course, our family…which she does a fantastic job at I might add!  It was just getting too difficult for me.  I’ve been relegated to the basement back bedroom.  I didn’t want to work in our basement because there were no geek creature comforts and where I put the wireless wasn’t ideal for the room where I would work anyway (hindsight is 20/20 right?).  Well, I couldn’t fight it anymore.  One trip to Ikea to get a desk add-on to a piece of furniture she already had in her scrapbook/activity room and I had a desk (and a new chair).  It hasn’t been the best.  The lighting sucks and it isn’t as comfortable peripherally speaking as my designed office for me.  Recently I’ve anticipated adding more network stuff (NAS, VOIP device, etc.).  The wireless only solution wasn’t going to cut it for me.

Netgear Powerline HD KitAs such I never expected to be down there, I never wired for anything beyond the one port for the wireless access point.  I had a cabling guy stop by last night to talk with me about my options.  I didn’t like the 15-20 drywall hole option too much and said I’d think about it.  I remembered seeing something about ethernet over power lines.  I did some research and found the HomePlug Alliance which provided some good general information for me.  Enough to convince me that it wasn’t something I should just disregard as an option.  Today I went to Fry’s Electronics to peruse my options.  There were many.  From manufacturers I didn’t know to those that you recognize: Netgear, D-Link, Linksys, etc.  I didn’t really seek out any advice in the beginning on what would be best, so I fell into the marketing scheme – bigger numbers is better right?  So I bypassed the 14MBPS, skipped over the 85MBPS, and opted for the 200MPBS (I couldn’t find any higher).  I purchased the Netgear Powerline HD Network Kit.  It was on sale as well which made it more attractive (picked it up for $110).  I was skeptical but figured I had nothing to lose.  $110 or hundreds more in cabling and drywall repair jobs.  The kit comes with two adapters.  Plug one into an outlet, connect it to your router and plug the other where you need ethernet connectivity.  I did just that.

I’m happy to report I don’t notice anything different…which is to be expected.  It literally did “just work” for me.  I went to no configuration screens, installed no software, etc.  One blue light lit up on one box…a few seconds later the other blue light on the other box was blinking indicating they’ve found each other.  Happy times.  My speedtest.net rating showed the same speeds I expected to get and I don’t experience any noticeable lag between requests or anything.  I haven’t noticed anything in my home network going awry at all either.  My XBOX just died, but I think that is more of a coincidence than a side effect.  If it turns out it isn’t I’ll report back.

Anyhow, a cheap alternative to wiring.  Sure if you want fiber or gigabit connections, this isn’t going to work.  But for the average joe, the older home, etc. – so far it is turning out to be a simple alternative that works.  Simple to set up too which always is a plus.

| Comments

This week I had the privilege of attending and helping with some Silverlight in casual games presentations at the XNA Gamefest conference happening in Seattle.  I say helping because the real game experts were there.

Two Silverlight presentations were given.  One by Bill Reiss/Joel Neubeck and the other by Mike Snow.  Between the two sessions we covered concepts in Silverlight game development as well as a walk-through of starting out to create a simple game.  I consider these guys to be the foremost experts on the topic given their experience in creating games like Dr. Popper, Stack Attack, Zero Gravity, Zombomatic and Tunnel Trouble.  Mike also will be posting some game frameworks as well as demonstrating some multi-player aspects.

It was a decent turnout for those interested in learning where Silverlight plays in casual games.  We also were able to talk with the MSN Games teams that gave us an understanding of what would be needed to implement a game in Silverlight.  I was surprised to see how simple the initial process is to get a game in the pipeline for consideration of MSN Games.  So if you have some thoughts on writing a game in Silverlight and want a distribution channel…consider MSN Games!

Silverlight Game Contest!

Need some incentive?  How about a Silverlight game contest?  TeamZone Sports is sponsoring a contest…with some cash prizes.  Official rules are coming soon, but you can sign up to be notified here.  I’m excited to see what comes out of the contest!

XNA and Silverlight?

With the announcement at XNA that the XNA Community games are going to be opened up wider so that anyone can essentially write an XBOX game and have other community members consume it, I suspect people will be jumping at those opportunities!  Maybe you want a game in multiple channels: XBOX, Windows, Zune, Web.  There are going to be things you may want to know in advance.  Bill did a demonstration of a single code base that ran on Windows (XNA), Zune (XNA for Zune) and Silverlight.  It was pretty cool to see the same experience in all those different platforms.  Bill had some good advice on things to look for when developing for this goal…maybe he’ll append those to the post (hint, hint).  You can download his sample code here.

Thanks to MSN Casual Games for inviting Silverlight to the conference (and for the sweet swag).  Thanks to Bill and Joel as our MVPs in this area for representing their experiences and sharing their knowledge with us.  Thanks to Mike for sharing his expertise and be on the lookout for him to provide some source on how he accomplished some multi-player game play within Silverlight using sockets. 

| Comments

One of the things that makes Silverlight 2 great is the ability to create a very flexible framework application that others can use and can be embeddable with some dynamic properties.  This is the method used in the SL2 Video Player to provide a completely dynamic player that is portable.

How?  Using the initParams property of the plugin.  There are a few ways you can do this.  I’ve just uploaded a video demonstrating three of them:

    • Creating App Resources
    • Passing into the root visual constructor
    • Using URI query string parameters

What?  Query string params?  Yep, the HTML bridge gives us a nice object model actually to inspect those parameters too.  Take a look at the latest video on the Silverlight community site!