BrianPeek.com
A Compendium of Random Uselessness

Brian Peek's Blog

This Blog

Syndication

AddThis Feed Button

My Book

Microsoft MVP - C#

My GamerCard

  • ThinkGearNET 1.1


    imageI released version 1.1 of ThinkGearNET over at CodePlex last week.  ThinkGearNET is a library that allows developers to easily use the Neurosky MindSet device with .NET.  This version now matches Neurosky’s latest SDK and supports eye blink detection.  Nothing else has changed.  If anyone has used a prior version of the library, please give the new version a try and let me know if you have any problems.  Thanks!


  • VSLive Devapalooza and Jeopardy on Coding4Fun


    imageTonight I hosted the Devapalooza event for Visual Studio Live in Redmond.  For the event, we played a Jeopardy-like game using software and hardware I created.  You can find an article on how the software was created, how to build the hardware, and full source/binary downloads over at Coding4Fun and CodePlex  This can be a fun way to host training at your office, or a way to liven up a user group.

    A huge thanks to Dan Waters and Clemens Vasters from Microsoft, VSLive speakers Rocky Lhotka, Deborah Kurata, and David Platt, and our three attendees who played the game.  I think it was a great time.  Hopefully you did too if you were in attendance.

    After playing the game tonight for real, I have a few ways to fix up the software and make it a bit easier to use, especially on the scoring side.  Also note that the code isn’t the best example of great coding.  With this being a side project and the deadline looming, I took a few dirty shortcuts.  But, it got the job done.  It looks like we might be playing this again at Visual Studio Live Orlando in November, so I should have those changes posted to Coding4Fun/CodePlex before then.

    We had a few arguments over questions and answers tonight with the ultimate argument taking place during Final Jeopardy.  The category was “.NET History” with the following clue:  Prior to being known as the Common Language Runtime, the CLR was known by this “flashy” moniker.  The two answers that were given that caused a stir were  “Universal Runtime (URT)” and “COM+”.  The official answer I wrote was “Project Lightning”.  Carl Franklin of .NET Rocks fame did an interview with Jay Roxe back in 2005 in which he explained a bit of history of .NET.  Jay, a member of the early team, says this in the interview: “I joined what is now the .NET Framework team, or the Common Language Runtime team, back in November of 1997. [This was] back when it was called Project Lightning, then it became COM+, then it became Project 42….”  Wikipedia lists all of these names, along with Common Object Runtime (COR) and Universal Runtime (URT).

    So…do I have any insiders reading the blog that were part of the original team have a timeline on the naming of the CLR?  Only Project Lightning fits the clue of “flashy” moniker, and the interview does indeed claim COM+ was a later name, but an official timeline of names would be interesting to know, especially if URT preceded Lightning.

    Tomorrow I’ll be presenting my Multi-touch Madness session and I will post slides and code by Friday.

    Update: Here’s a video of the Final Jeopardy argument, thanks to John von Rosen.

    VSLive Gameshow Final Question

  • Visual Studio Live! 2010 Redmond – Slides + Source


    http://www.brianpeek.com/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/brian.metablogapi/6545.n190107439474_5F00_2070_5F00_0E123DC8.jpgThanks to all who attended my first session today, and a thank you in advance to those attending Thursday’s session on multi-touch.  I’m going to post my slide deck for the What’s New in VS2010 Debugging session now and I will update this post on Thursday/Friday with the source and slides for the multi-touch session.  Feel free to contact me with any comments or suggestions, good or bad.

    Enjoy!


  • VSLive! Redmond 2010


    n190107439474_2070I have been selected to speak at this year’s VSLive! conference on the Microsoft Campus in Redmond.  I’m very excited about this conference for a couple of reasons.  First, it’s on campus, which will allow me to get together with my Coding4Fun/Channel 9  friends to do some planning.  Secondly, VSLive! attendees are also allowed to spend some of their own cash at the Microsoft store.  And finally, in addition to presenting two sessions at the conference, I’m also coordinating a special event on Wednesday night which we’re calling Devopalozza.  I am creating a team Jeopardy! style game-show which will pit Microsoft Speakers against VSLive! Speakers against VSLive! Attendees.  I’m currently creating both hardware and software to drive the game, which will later turn into an article on Coding4Fun for those that might want to create a game-show at home or the office.  And, I’ll even be hosting the show at the event.

    The two sessions I’m presenting are:

    TU19 What's New in Visual Studio 2010 Debugging
    Date: Tuesday, August 3, 2010
    Time:  3:45 PM - 5:00 PM
    Level: Intermediate

    Visual Studio 2010 contains a variety of new debugging features to aid developers in creating bug-free software. In this session, we will explore many of these new features including IntelliTrace (historical debugging), breakpoint enhancements, new tools for debugging multi-threaded and parallel applications, enhancements to DataTips and watch windows, and new tools to better visualize and debug WPF applications and events. With these tools in hand, bugs don't stand a chance!

    TH1 Multi-touch Madness!
    Date: Thursday, August 5, 2010
    Time: 8:30 AM - 9:45 AM
    Level: Introductory to Intermediate

    Multi-touch technology is popping up everywhere, most recently in Windows 7 and various .NET technologies. Windows 7 has been designed from the ground-up with multi-touch in mind, and the newest versions of WPF and Silverlight are multi-touch capable as well. In this session I will take you through the 4 biggest areas of Microsoft multi-touch technology: Windows 7, WPF 4, Silverlight, and Surface, including the forthcoming Surface Toolkit for Windows Touch. You will learn how to make your applications multi-touch aware and capable using each of these platforms, how to handle gestures and manipulations properly across platforms, and learn where multi-touch is heading in the future with regard to Microsoft development.

    Finally, if you register by June 30th, and use code NSZV27 you can save a pile of cash!  This code will provide you with the Speaker Discount rate of $1495 for the Best Value Package or $1195 for the 3-Day Conference Package.

      Get more information on the conference at:

    Hope to see you all there!


  • The Coding4Fun Show – Ep 5 with Josh Blake


    The fifth episode of my Coding4Fun Show, is now up on Channel 9.  In this episode of the Coding4Fun Show, I chat with Josh Blake about Natural User Interfaces and Multitouch programming with .NET.  Josh has written a multitouch PowerPoint replacement called NaturalShow, which was demonstrated during his NUI session at MIX10. Watch and learn a bit about how this application was created as well as how you can write multitouch applications with WPF.  And for even more multitouch programming goodness and more on NaturalShow, Josh is currently working on a book titled Multitouch on Windows, which can be purchased and read while he's writing it!

      You should see the video below if you have Silverlight installed, otherwise head over to the episode on Channel 9 to watch and download in a variety of formats for offline viewing.

      Get Microsoft Silverlight
      The Coding4Fun Show: Natural User Interfaces with Josh Blake

      A big thanks to Josh for the interview!


    • WiimoteLib Future


      image I’ve been working on a version 2.0 of WiimoteLib which reorganizes the library quite a bit to clean up the codebase.  It’s not quite ready for release, and I don’t have an ETA currently, but I wanted to note some of the changes and get some feedback as I finish things up.

      • I will be including a VS2010 solution for the project in addition to the original VS2008 solution
      • I’m hoping to have support for both sound and the WiiMotion Plus extension completed
      • Support for the Taiko Drum and DJ Hero turntable (testers welcome for the DJ Hero turntable)
      • Extensions have been broken out into separate classes so their code is self contained:
        • image
        • All extensions inherit from ExtensionController
        • All state objects for extensions implement the IExtensionState interface
        • Here’s an example of the new Nunchuk class.  As you can see, everything related to the Nunchuk is located in this class:
        • using System;
          using System.Drawing;
           
          namespace WiimoteLib.Extensions
          {
              public class Nunchuk : ExtensionController<NunchukState>
              {
                  internal Nunchuk(Wiimote wm) : base(wm)
                  {
                  }
           
                  internal override void Initialize()
                  {
                      byte[] buff = Wiimote.ReadData(REGISTER_EXTENSION_CALIBRATION, 16);
           
                      State.CalibrationInfo.AccelCalibration.X0 = buff[0];
                      State.CalibrationInfo.AccelCalibration.Y0 = buff[1];
                      State.CalibrationInfo.AccelCalibration.Z0 = buff[2];
                      State.CalibrationInfo.AccelCalibration.XG = buff[4];
                      State.CalibrationInfo.AccelCalibration.YG = buff[5];
                      State.CalibrationInfo.AccelCalibration.ZG = buff[6];
                      State.CalibrationInfo.MaxX = buff[8];
                      State.CalibrationInfo.MinX = buff[9];
                      State.CalibrationInfo.MidX = buff[10];
                      State.CalibrationInfo.MaxY = buff[11];
                      State.CalibrationInfo.MinY = buff[12];
                      State.CalibrationInfo.MidY = buff[13];
                  }
           
                  internal override void ParseData(byte[] buff, int offset)
                  {
                      State.RawJoystick.X = buff[offset];
                      State.RawJoystick.Y = buff[offset + 1];
                      State.AccelState.RawValues.X = buff[offset + 2];
                      State.AccelState.RawValues.Y = buff[offset + 3];
                      State.AccelState.RawValues.Z = buff[offset + 4];
           
                      State.C = (buff[offset + 5] & 0x02) == 0;
                      State.Z = (buff[offset + 5] & 0x01) == 0;
           
                      State.AccelState.Values.X = (float)((float)State.AccelState.RawValues.X - State.CalibrationInfo.AccelCalibration.X0) / 
                                                      ((float)State.CalibrationInfo.AccelCalibration.XG - State.CalibrationInfo.AccelCalibration.X0);
                      State.AccelState.Values.Y = (float)((float)State.AccelState.RawValues.Y - State.CalibrationInfo.AccelCalibration.Y0) /
                                                      ((float)State.CalibrationInfo.AccelCalibration.YG - State.CalibrationInfo.AccelCalibration.Y0);
                      State.AccelState.Values.Z = (float)((float)State.AccelState.RawValues.Z - State.CalibrationInfo.AccelCalibration.Z0) /
                                                      ((float)State.CalibrationInfo.AccelCalibration.ZG - State.CalibrationInfo.AccelCalibration.Z0);
           
                      if(State.CalibrationInfo.MaxX != 0x00)
                          State.Joystick.X = (float)((float)State.RawJoystick.X - State.CalibrationInfo.MidX) / 
                                                  ((float)State.CalibrationInfo.MaxX - State.CalibrationInfo.MinX);
           
                      if(State.CalibrationInfo.MaxY != 0x00)
                          State.Joystick.Y = (float)((float)State.RawJoystick.Y - State.CalibrationInfo.MidY) / 
                                                  ((float)State.CalibrationInfo.MaxY - State.CalibrationInfo.MinY);
                  }
           
                  public override ExtensionType ExtensionType
                  {
                      get { return ExtensionType.Nunchuk; }
                  }
              }
           
              /// <summary>
              /// Current state of the Nunchuk extension
              /// </summary>
              [Serializable]
              [DataContract]    
              public class NunchukState : IExtensionState
              {
                  /// <summary>
                  /// Calibration data for Nunchuk extension
                  /// </summary>
                  [DataMember]
                  public NunchukCalibrationInfo CalibrationInfo;
                  /// <summary>
                  /// State of accelerometers
                  /// </summary>
                  [DataMember]
                  public AccelState AccelState;
                  /// <summary>
                  /// Raw joystick position before normalization.  Values range between 0 and 255.
                  /// </summary>
                  [DataMember]
                  public Point RawJoystick;
                  /// <summary>
                  /// Normalized joystick position.  Values range between -0.5 and 0.5
                  /// </summary>
                  [DataMember]
                  public PointF Joystick;
                  /// <summary>
                  /// Digital button on Nunchuk extension
                  /// </summary>
                  [DataMember]
                  public bool C, Z;
              }
           
              /// <summary>
              /// Calibration information stored on the Nunchuk
              /// </summary>
              [Serializable]
              [DataContract]
              public struct NunchukCalibrationInfo
              {
                  /// <summary>
                  /// Accelerometer calibration data
                  /// </summary>
                  public AccelCalibrationInfo AccelCalibration;
                  /// <summary>
                  /// Joystick X-axis calibration
                  /// </summary>
                  [DataMember]
                  public byte MinX, MidX, MaxX;
                  /// <summary>
                  /// Joystick Y-axis calibration
                  /// </summary>
                  [DataMember]
                  public byte MinY, MidY, MaxY;
              }
          }
           
      • Minimal changes will need to be handled in application code, which is demonstrated in the WiimoteTest application included with the library.  The biggest change is in handling extensions.  Now, the Wiimote object itself will contain an ExtentionType property.  Use this to determine which extension is attached and cast the Wiimote.ExtensionController property to the proper object to access its state information as shown:
          switch(mWiimote.ExtensionController.ExtensionType)
          {
              case ExtensionType.Nunchuk:
                  NunchukState ns = ((Nunchuk)mWiimote.ExtensionController).State;
                  break;
          }

          I welcome any questions, comments and concerns on the direction I’m heading.  Thanks!


        • Ask the Experts at MIX10


          Mix10_SeeYou_blk_240 As I posted earlier, I’ll be attending MIX10 this year, and I will be taking part in the Ask the Experts panel on Monday evening at 5pm.  I will be at the C# table since I’m a C# MVP, so stop by and start a discussion!  Experts in a variety of subjects will be on hand so even if C# isn’t your thing, surely one of the many other topics will be.  And even if you’re an antisocial shut-in like I am, beer will be served and there will be 2 Zune HDs given away to attendees of the event.  So really, there’s something for everyone.  Hope to see you there!

          Filed under: , , ,

        • ThinkGearNET Library


          mindset I have written and posted a new library that allows .NET developers to easily connect to and use the Neurosky MindSet headset from any .NET application.  You can find the source code and a binary of the library at CodePlex.  Usage is very simple and may seem familiar to those that have used my .NET Wiimote LIbrary; set a reference to the library and you can connect to a headset as follows:

          private ThinkGearWrapper _thinkGearWrapper = new ThinkGearWrapper();
           
          private void Connect()
          {
              _thinkGearWrapper = new ThinkGearWrapper();
              
              // setup the event
              _thinkGearWrapper.ThinkGearChanged += _thinkGearWrapper_ThinkGearChanged;
              
              // connect to the device on the specified COM port at 57600 baud
              _thinkGearWrapper.Connect("COM4", 57600, true);
          }
           
          void _thinkGearWrapper_ThinkGearChanged(object sender, ThinkGearChangedEventArgs e)
          {
              // write out one of the many properties
              Debug.WriteLine("Attention: " + e.ThinkGearState.Attention;
          }

          The download includes a test application with source code that shows how to use the library in any .NET application.  You can see a more advanced usage example by taking a look at my MindBlaster article or reading through its source code.

          Links

          Questions welcome.  Enjoy!


        • MindBlaster Article Posted


          mindblaster My latest Coding4Fun article on the creation of my game MindBlaster is now available!  This is a game I wrote using XNA Game Studio 3.1 that combines a Nintendo Wiimote and a Neurosky MindSet headset to create a game you play entirely with your head.  If you were at PDC09 and stopped by the Coding4Fun area you may have seen it, or, if you’ll be at MIX10, please stop by the Coding4Fun area and see this and 3 or 4 more even better projects by Coding4Fun authors.

          Links


        • MIX10, Coding4Fun Show, and You!


          c9logo I will be at MIX10 showing off MindBlaster once again.  More on that shortly…

          But, more importantly, are you going to MIX10?  Do you have a fun or interesting project you’d like to talk about?  Let me know!  I’m looking for people to interview for the Coding4Fun Show.  I’m always interested in talking to people who want to chat about what they’re working on, even if it’s just a hobby or something that’s incomplete.  That’s what Coding4Fun is all about!  So please, if you’ll be at the MIX, have a few minutes to chat, and want to be the envy of your friends, contact me!


        1 2 3 4 5 Next > ... Last »