An Hour Being Flexible

 

You never know where you’ll end up discussing Silverlight…

TheFlexShow

I recently had the extraordinary opportunity to spend an hour talking about Silverlight with Jeffry Houser and John Wilker on The Flex Show (my part starts 4 1/2 minutes into the show, which you can listen to here).  It was great fun, and they couldn’t have been more welcoming.


This work is licensed under a Creative Commons Attribution By license.
Posted in z Silverlight Archives | Comments Off on An Hour Being Flexible

Sparkling Client Podcast on The Bubble Chart

SparklingClientLogo

I’m very pleased to provide this link to a brief discussion with Erik Mork about the Bubble Chart from the Silverlight Toolkit, which I believe ties in nicely with this post from late December.

 

BubbleChart 
[Bubble chart from the most recent samples, slightly modified]

                [ Previous Podcast on the Silverlight Toolkit ]

      Previous: 1 Chart – Three Axes         Next: Podcast


This work is licensed under a Creative Commons Attribution By license.
Posted in z Silverlight Archives | Comments Off on Sparkling Client Podcast on The Bubble Chart

Tiny Laptops

 

 

Wind The latest craze among us geeks are the ill-named Nettops; – ill named because they’ve quickly exceeded the implicit assumption that they are best used for surfing the net and not much else. 

These micro-laptops are now typically under 3 pounds, have keyboards that are around 80-85% the size of a full keyboard and screens in the 8.5 – 11" range. They also cost a pittance.

The first one I saw was the Dell Mini 9. Boy was it sweet. Scott Hanselman fell in love with his, and wrote this great review

He’s very convincing. In fact, I bought my MSI WIND about 18 seconds after reading his post. 

— A digression —

I’ve mentioned before that at Citibank[1] I worked for a guy named Larry Weiss, who used to describe consumers of electronics as falling into quintiles [5 reactions of technology, though not groups of equal size].  He’d often draw a pyramid like this:

Pyramid

The first quintile is, well,  most of you, and certainly me. Is it new? Interesting? Geeky? I’ll buy it. Hock my kid if I have to.  We’re buying Nettops now. And adding extra RAM.

2nd quintile will buy it if there is a clear benefit and some experience that shows it works.  Actually, 2nd quintile may be buying now too, things are speeding up since Larry formulated this in the 80’s.

Third quintile buys when the technology meets a "felt-need" – they are the bulk of your target audience when you are making mass-market technology (at the time we were talking ATMs and home banking). 

Fourth quintile needs to see a huge benefit, lots of experience, and feel very warm and fuzzy. Those folks are thinking about high speed internet about now.

Fifth quintile: forget it. Pull the trigger, kill me, I’m not using it.

</digression>

Admitting that I’m in the first Quintile and thus bought this before I knew it made perfect sense, I will say that I had some justification: even my small laptop doesn’t really fit on the try on jets these days (seats are getting smaller and I’m getting bigger), batteries on most laptops give up too fast to get much work done, and I just signed up to do two books: the reincarnation of the Silverlight book that wasn’t (more on that soon) and a book I’ve wanted to write for a very long time.

The Yowza! effect

But here’s what I’ve discovered, this is another in a line of what I call "Yowza!" devices.  A Yowza! device (and the exclamation mark is part of the term, though if you’re in the first quintile, you know that mark by the name "bang") is a device that you buy thinking "I’m a first quintile compulsive person who can’t help but buy this and I sure hope it does something useful" and then, somewhat to your surprise, you discover that it is not only useful, but it is essential. Within an amazingly short time,  not only can’t you live without it, but you feel a  sacred and moral obligation to tell everyone you know about it.

Here are some Yowza! devices:

  • The VCR
  • Cordless Telephones
  • The Cell Phone
  • The DVR
  • The GPS

Commodity Pricing

While I know that Scott gets great usage out of his Dell 9, the progress in the past few months has been staggering. Here are the basic specs on the computer I bought. But before you read the specs, keep in mind that I spent,  delivered the next day to my door, $400.92.

AmazonInvoice

  • Intel Atom 1.6 GHz Processor
  • 512 KB L2 Cache
  • 1GB RAM + (for $12) a second GB [2]
  • 160 GB 5400 SATA Drive, Windows XP installed
  • 6 Cell Battery
  • 1.3 MP Web Cam
  • Wireless card with 11 b/g/n
  • 10/100 Ethernet
  • Bluetooth
  • Mic, Speakers, Soundblaster
  • 4 in 1 card-reader
  • Weight with battery: 2.8 lbs
  •  

    This is a serious laptop. And, there are lots of others as good (and some would say better). And more are coming every day. 

    (I’m told that Windows 7, Silverlight and the rest of Microsoft’s software runs like a top on these machines, and that is good news indeed).

    If I Were Apple, I’d Be Very Worried

      My daughter is incredibly lucky that we bought her Macbook when we did, because I’d be hard pressed to justify spending over three times as much. Her computer is aMacBook2 lot better, but I’m not convinced it’s $1,000 better.

    Much more important, and more dangerous for Apple, a lot of parents and a lot of school districts will be asking themselves the same question. Especially if they’re buying them by the classroom. Especially when you consider that there is very little software you can’t run on XP SP3 with 2 gig of RAM and 160 MB of drive.

    Generally speaking, I’ll be putting product reviews on my Reviews page, but this was too relevant to our world to hide in the back. 

    I’m reasonably convinced that these tiny computers are not just a passing phase or an interesting side show, but the harbinger of a trend that will be fed by the confluence of diminished economics and increased bandwidth.

    More soon.

     

    ———————

    1 This was back when Citibank was the biggest bank in the world, and solvent, and innovative. After I left, things seemed to….

    2 In the late 1980s I worked for PBS and the cost of RAM was $1,000 / megabyte. Thus, 1 gigabyte would have been $1,280,000.00. It is now $12. That is a savings of 5 orders of magnitude in about 20 years. Amazing.


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | Comments Off on Tiny Laptops

    Moo cards

    You’ll have noticed that some of our biz cards seem to have shrunk. This is the "moo card" phenomenon….

    MooDrop Moo is a very hip, very friendly site that will print almost anything for you, but what has clearly caught on is their "mini-cards" which cost only $20USD/100, are full color on one side (with up to six lines of print on the other); come in a very nice box and let you choose what goes on the front from any number of photo sources (your computer, Flikr, Etsy, bebo, Facebook, etc. ) You can have 100 different mages, 100 of the same image, 50 of two images, or whatever combination you want.

    Customer service is top notch and with a little work, even a total non-designer (like me) can make a decent card.

    [Update 1pm GMT-5 Good grief, there was a typo. Here is the fixed card]

     

    moo4a

     moo4b  

     

    Interestingly, ad hoc surveys find people hold on to these more than full size cards, though no one can quite prove that.  In any case, they make great bookmarks.

     

    Mix09Smallest Got these just in time for Mix. You are going, yes?  See you there.

     

    jessesigbg


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | Comments Off on Moo cards

    Using statistics well

    I recently wrote a rant about the use (and overuse) of statistics, and pointed to the Twitter Influence Calculator (now Twitalyzer) as a working example of statistics of questionable value.

    I should have paused.

    It turns out that (a) they are quite thoughtful about the metrics they are using and (b) more important those metrics can in fact teach someone (me for example) how to use Twitter more effectively.

    Twitter is a funny thing, and suggesting it can be used effectively may strike some as risible; but the truth is that in my job, making frequent high:signal contact with the community is valuable, and, it turns out, Twitalyzer zeros in on some of the more interesting aspects of that contact.

    There is the obvious, such as  Influence which they define (in more detail than I will here) as “number of followers, number of times you are retweeted, your generosity (see below), times you are referenced by others and number of updates you publish in a week.  One can argue for different metrics, but it would be hard to make the case that these are absurd.

    Mr. Rogers  In addition to giving you your “score,” they go on to tell you your change, which is helpful, and then if you like, how you might improve that score (e.g., you need more followers and friends…. Won’t you be my neighbor?)Signal

    The second number they provide is Signal, and they use it exactly in the same way I do when I write “More Signal/ Less Noise” – that is do your tweets contain useful information. They define useful information in this case as any of the following: references to other people, links to urls, hashtags and retweets (given that they must do this by machine and semantics are hard to interpret, this seems reasonable). They even break these out for you in TwitPie a handy pie chart and another chart showing change over time.

    The third value is Generosity, defines as the number of retweets you provide. I was skeptical about the importance of retweeting (in fact, I worried it was just noise) but asked about it on Twitter and received many amazing, thoughtful (brief) responses. Best of the lot was from Bob Martin (@uncleBob) whom I’ve admired for many years, who wrote “twitter is a loose network of tight clusters. RT is the means for communicating beyond your cluster”  Not only do I find that compelling, it is almost a haiku.

    The penultimate measure on Twitalyzer is Velocity, defined as  the rate at which you tweet. Velocity + signal/noise gives you a good sense of your contribution.

    Finally, Twitalyzer measures your Clout: that is, the number of references to you divided by the total number of possible references (that latter number is a bit fuzzy to me, but I think there is an upper limit set by the Twitter API). In any case, the more folks reference you the more clout you have.

    Charts, Tables and Analysis, Oh My

    Once you’ve absorbed all that there are endless charts and analysis, but many are targeted at helping you increase your effectiveness, which makes this exercise worthwhile  For example, one analysis offered to me was to compare my average values for number of follwers, retweeting,e tc. with the “11,343 people we’re tracking who have about 25% more influence (on average) than you…”)  Nice.  What stands out in the chart, right away, is that on average, those folks have more friends than I do (story of my life). Where is Mr. Rogers when I need him?

    All in all, more information than you can shake a virtual stick at, and much of it useful. And a wonderful distraction when you should be working.

    It will be interesting to see (a) how the metrics are refined over time and (b) to what degree the very act of measuring influences that which is measured (The “Liberty’s Group Behavior Uncertainty Principle – measuring the activity of a group causes the members of the group to change their activity” (I’m certain I’m not the first to say it.)

    A police officer pulls Werner Heisenberg over for speeding. “Do you know how fast you were going, Herr Doktor?” asks the trooper.  “No,” replies the physicist, “but I know exactly where I was.”

    Related Resources

    Some Twitter Social Network Analysis
    My Experiences with Twitter Part 1
    Scott Hanselman on How To Use Twitter
    Perl Script for Twitter Analysis

    Previous We Love to Measure Everything


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | Comments Off on Using statistics well

    Dispatcher, Cross-Thread Property Setting & Lambda Expressions

    I am finishing up my tutorial on Hyper-video and in the more advanced section I discuss the idea of displaying a button when the video’s marker is hit, and then removing the button after a short time has passed.

    To make this work, I instantiate an object of type Timer and pass in the name of the (static) callback method, the button that was pressed, the length of time I want the button to be visible (in milliseconds) and the time between invocations – in this case the value Timout.Infinite to indicate that I do not want the timer to restart after it calls the callback.

     

    Timer t = new Timer(
       EndShowMore,       // call back
       ShowMore,          // state
       2000,              // dueTime
       System.Threading.Timeout.Infinite   // period
       );

     

    When the timer dueTime (2 seconds) passes  the callback method (EndShowMore)is invoked.

    As noted, EndShowMore must be static. Its job is to make the button invisible and disabled. But the static method and the button are in different threads and so the method cannot set these properties directly.

    What is needed is a dispatcher in the same thread as the controls. Fortunately, the button (ShowMore) is provided as an argument to the callback (you passed it in as the second parameter to the Timer constructor.)

    Once we cast that state object back to type Button we can grab its Dispatcher and use that to call BeginInvoke which will execute a method asynchronously through a delegate.

    iStock_connectTwoWiresXSmall

    You can write the EndShowMore call back as follows,

    private static void EndShowMore( object state )
    {
      Button btn = (Button) state;
      btn.Dispatcher.BeginInvoke(
         delegate() { btn.IsEnabled = false; } );
      btn.Dispatcher.BeginInvoke(
         delegate() { btn.Visibility = Visibility.Collapsed; } );
    }

    That will certainly work but the syntax is a bit cumbersome. I find the use of a Lambda expression makes the intent clearer and the code a bit simpler,

    private static void EndShowMore( object state )
    {
       Button btn = (Button) state;
       btn.Dispatcher.BeginInvoke( () => btn.IsEnabled = false );
       btn.Dispatcher.BeginInvoke( 
    () => btn.Visibility = Visibility.Collapsed ); }
    
    

    More On Hyper-Video

    For more on the subject of Hypervideo see the thread of blog posts that starts here or these How Do I videos: Part 1, Part 2,  Part 3. The tutorials (in C# and VB) on Hypervideo should be posted before Mix.


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | 1 Comment

    Hypervideo put to work


     

    Eric Mork (of Sparkling Client) SilverBayhas created a site with videos using Joel Neubeck & Tim Heuer’s video player that makes terrific use of Hypervideo.

    Eric creates short teaching videos, and embeds markers in each.  When the video hits each marker, the table of contents is updated in a separate but related window,  and the code associated with what Eric is teaching is shown in a third window. The integration is a work of art.

    MorkHyperVideo 

    For more on Hypervideo check out these resources:


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | 2 Comments

    Better Navigation

    I was pretty happy with the threading navigation I had introduced…

    OldNav

     

    Just to double check, I asked my buddy David Platt, author of the absolutely essential Why Software Sucks, to take a look. He was quite gentle in ripping my guts out.

    He pointed out that the juxtaposition of the word More with a left pointing arrow is so jarring it just forces you to stop and think (Don’t Make Me Think!"). He also noted that putting one link at the top of the article, and the other at the bottom was odd (not clear you want a link to another article before you start reading) fights the standard used throughout the industry. 

    PrevNext2

    Once he pointed it out, it was painfully obvious… as was the fix.

     

    NewNav

    Navigation all at the bottom, and no ambiguity. Much nicer.  Thank you David. I owe you yet another one.


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | Comments Off on Better Navigation

    We love to measure everything

    I just received a note from a colleague about the “Twitter Influence Calculator.”  Not being able to resist, I immediately put in my name and out popped more statistics than you can shake a stick at…

    influence

    I chopped out the actual numbers because they are beside the point (and tiny).

    Is this a good thing?

    There are so many ways to respond (I’m of two minds about my ambivalence).

    Is this site and others like it, a reflection of our endless self-absorption or is this another useful tool for measuring our interaction and effectiveness with the developer community? 

    More generally, do sites provide these numbers because they are meaningful or because they can?  Are they meaningful?  I’m not enough of a statistician to know whether the values make sense, though the person who created this site clearly has a great deal of expertise

    But we do this a lot.  There is also Twitter Grader which happily assures me that although my overall rank is 17,705, that is out of 1.4 million Twitter users, giving me a rank of 98.8 which they pleasantly round up to 99. 99 is good. I like Twitter Grader better, cause I have better numbers there.

    Side note: my one good number on the Influence calculator is the Twitter Ratio, where I scored 11.3.  The explanation you receive when you click on the term (see the last line in the figure above) is quite detailed but it includes this: “A …ratio of 10 or higher indicates that you’re either a Rock Star in your field or you are an elitist… You like to hear yourself talk. Luckily others like to hear you talk, too. You may be an ass.”

    Take that!

    Figures Lie and Liars Figure

    Microsoft is big on numbers, we spend a lot of time measuring influence and customer happiness (remember to fill out your eval forms after each talk) and I think that is great, because what you measure you’ll get more of, but sometimes we split things a little fine.

    salt shakerWe measure everything, and then we set our pay and rewards based on those decimals and infinitesimals. Overall, who can argue? It makes for a highly motivated group, and weeds out the dead weight, but one does worry a bit about how stochastic some of the results are. 

    Qualitative != Quantitative

    At another company I worked for, we used to hold focus groups with 20 people, ask their opinions, and then come back and say “83.7% of the people we talked to said…”  It made my head hurt.  When n = 20 (or 50!) you really don’t want to be using quantitative values finer than, “some” or a lot” – and even then with a shaker of salt.

    Sour Grapes

    Don’t mind me, I’m just jealous that Scott Hanselman and I set out to Twitter around the same time and a week or so later he has, according to  the Twitter Influence Calculator, over 8 thousand followers with a visibility that they characterize as “Astonishingly High.” What can I say? He’s a rock star. I’m a roadie.  Life is good.

     Next: Using Statistics Well


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | Comments Off on We love to measure everything

    And now for something completely different

    I’m not sure it is useful,  but it is one of the more creative approaches to searching I’ve seen. Amaztype takes an entirely different approach to finding things on Amazon.  They start by presenting you with a sparse (beta?) window

    amazTypeSearch

     

     

    I’ve put the word Silverlight into the title. I then click Start Search and it begins beeping and fizzing as it gathers data.

     

     

     

     

     

     

     

     

     

     

     

     

    Books begin to appear;  small, sparse at first…

    AmazType1

    If you move the browser, it starts over with a "boop"  Soon small piles form

    AmazType2

    Then larger piles, one on top of another…

    Books

     

    Click for Details

    If you click on a book, you zoom to that pile and a second click gets you quick box with essential info (author, price, etc.)

    AmazType3

    Another click takes you to the web page.

     

    But if you are patient….

     

    If you hold back, and just let it cook for a while, something interesting happens with the piles of books….

     

    AmazType4

     

    ( Yes, it’s flash, not silverlight, but it’s RIA and an interesting approach. )


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | Comments Off on And now for something completely different

    More About the Layout System

    I recently posted about the Silverlight Layout System (and now have posted videos on the subject here and here). But this can get quite confusing and a reader posted this question:

    You mention PreArrange() and it is called but you are not clear on which of the functions should be used in it.  I am also not clear on where “item” and “center” are defined.

    This gives me an opportunity to do a better job explaining how the location of each object as it moves around the carousel, is determined.

    Please be sure to read the two blog postings before reading this response. The best bet would be to download the complete source (which is available with the video), but let’s tackle your specific questions.

    Also, please note, in the code associated with the video, PreArrange is called DoArrange – these are the same method.

    Answering your three questions, first.

    PreArrange() is not part of the Silverlight Layout System, it is a method that I wrote (or, more accurately, “borrowed” from the original author of the code I based my approach on).

    I’m not quite sure what you mean when you write “you are not clear on which of the functions should be used in it,” but the goal of this method is explained in the second article under the heading PreArrange.

    Center and Item

    Both center and item are defined within the DoArrange method as local variables.

    Item is defined in the for loop (about four lines into the method) to hold each member of the Children collection of the panel, and is defined to be of type UIElement,

    UIElement item = Children;

    Essentially, what this method does is to distribute the objects at the appropriate distance from the center of your panel.

    To do that, it needs a working definition of “center” and by center we mean half the width and half the height, but we want to center the item and so must allow for the width and height of the item as well.

    Picture, for example, that we are working in a panel that is 500 x 300,

    CarouselRect

    The center of this rect could be found as follows

    Point center = new Point( 
       this.Width / 2, 
       this.Height / 2;

    As you can see, center is defined to be of type Point. A Point’s constructor takes two doubles, as shown in the Silverlight documentation

    PointConstructor

    In this case, we find the X coordinate by taking the width of the panel (this) and dividing it in half. We do the same for the y coordinate.

    MidPointApproach1

    Centering an Object

    If we had an object that was 60 x 40 and wanted to place it dead center, you might think that we would set its coordinates to 250,150, but the coordinate for an object is upper left hand corner of the bounding rectangle of the object, and we’d end up with something like this:

    OffCenterObject

    You will remember that we decided earlier to set all our objects to the same size, so we have two ways of fixing this problem. We can offset each object’s center by 1/2 its width and 1/2 its height, or we can offset the center by 1/2 the width and height of the ItemSize, which is what we do:

    Point center = 
       new Point( ( this.Width - ItemSize ) / 2, 
          ( this.Height - ItemSize ) / 2 );

    In the original computation, the X coordinate of the center was 1/2 of the width (or 500 /2 or 250). In this formula it is (500 – 60) /2 or 440 /2 = 220. Similarly the Y coordinate is now (300-40)/2 = 130. Thus the center moves from 250,150 to 220,130. When we place the object at 220,130 we center the object perfectly!

    ObjectCentered

    Finding The Distance from the Center

    To place each object, we need to know the coordinates for that object, and we need to know it in terms of distance from the center and then we need to translate that into distance from the (0,0) coordinates of the upper left hand corner.

    To accomplish this, we start with the mathematics of a triangle to find the distance along the x axis  and the distance along the y axis,  given the two facts we know: the radius and the angle.

    The distance from the center on the X axis is equal to the radius times the cosine of the angle.

    The distance from the center on the Y axis is equal to the radius times the sine of the angle

    How Do We Find the Radius?

    Let’s assume that we redraw our rectangle to be a square, 150 pixels on a side as shown in the figure. If we draw our carousel as a circle within the square, and drawing lines through the center, make our circle tangential to the square at the X and Y axis, we can then take advantage of the fact that the width of the square will be equal to the diameter of the circle (or 1/2 the width will be equal to the radius).

    AngleToPositionComplete

    If we then stretch our square to a rectangle, the circle will stretch to an ellipse, but the principle will hold, so long as we differentiate between the X and Y “radius”

    This is why we you see this in the code:

    double radiusX = center.X;
    double radiusY = center.Y;

    You can read this as “the variable radiusX  is set equal to the distance on the X axis from the edge to the center, which serves as the radius of a circle circumscribed within the rectangle, if that radius is drawn on the x axis. and the variable radiusY….”

    How Do We Find the Angle?

    The angle was stored in the angle property of the CarouselPanel, in the ArrangeOverride method. It was set by iterating through the children, and for each child multiplying that child’s fractional part of the total number of children by 2 pi  (the number of radians equal to 360 degrees, or the number of radians in a full circle).

    for ( int i = 0; i < Children.Count; i++ )
    {
       Children[ i ].SetValue( CarouselPanel.AngleProperty,  
            Math.PI * 2  * i / Children.Count );
    }

    Computing the X, Y Coordinate

    We are now ready to compute the x,y coordinate of the object. We know that the radius is the same as the distance to the center. We know that the AngleProperty is a representation of the angle in radians. We know the formula.

     for ( int i = 0; i < Children.Count; i++ )
     {
        UIElement item = Children[ i ];
        double radians = (double) item.GetValue( 
                 CarouselPanel.AngleProperty );
    
        Point p = new Point(
            ( Math.Cos( radians ) * radiusX ) + center.X,
            ( Math.Sin( radians ) * radiusY ) + center.Y
        );

    Why Do we add center.X and Center.Y?

    While the formula tells us the distance the object should be located from the center, our coordinate system doesn’t have (0,0) at the center. Instead (0,0) is at the upper left corner, counting up on the X axis as you move to the right, and up on the y axis as you move down. To compensate, we must move to the center by adding back the distance from (0,0) to the center, which is to say we must move center.X on the X axis and center.Y on the Y axis. 

    This might be slightly clearer if we were to reverse the order of the operations:

    Point p = new Point(
         center.X + ( Math.Cos( radians ) * radiusX ),
         center.Y + ( Math.Sin( radians ) * radiusY )
                       );

    Thus, you would read this: “move to the center, and then move the computed distance.”

    Previous: Putting the Silverlight Layout System To Work


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | Comments Off on More About the Layout System

    Tech Ed Connect

    Interesting social / community approach at tech ed. You fill out your community quick card (here’s mine):

    TechEdConnect

    and you then fill in a quick survey of your interests and the types of folks (designer, developer, etc.) you are interested in meeting at Tech Ed.  Click on PeopleMap and hey! presto! a map with you at the center and others positioned so that proximity = closeness of match in interest. Mouse over tells you more, click on the individual to see their profile.

    PeopleMap

    Neat way to make contact with folks.


    This work is licensed under a Creative Commons Attribution By license.
    Posted in z Silverlight Archives | Comments Off on Tech Ed Connect