Friday, May 26, 2006

Ever have to do manual serialization of data in a DataSet?  The challenge is being able to call BitConverter.GetBytes on the data element when at compile time you have no idea what it's type is, and GetBytes doesn't accept an Object (though I'd argue maybe it should and attempt to convert the underlying type if it's resolvable).

Here's my solution:

byte[] elementBytes = (byte[])typeof(BitConverter).GetMethod(
   
"GetBytes", new Type[] { dataRow[columnNumber].GetType() }).Invoke(
    null, new object[] { dataRow[columnNumber] });

5/26/2006 1:09:56 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]  | 
 Tuesday, May 16, 2006

Well actually it's not a first look.  You might recall the .netcpu development kits that shipped over a year ago that I wrote a little bit on.  Well the TinyCLR went back into the Microsoft oven to bake a while more and samples were pulled out at MEDC 2006 for attendees to try.

What is the Micro Framework (.NET MF)?
It's a very scaled down CLR and BCL that is capable of running on 32-bit architecture processors without any underlying OS.  Basically the MF has its own bootloader and OAL.  Developers write managed code (C# is the only thing supported in the community preview) that runs directly against the MF.  The MF code can directly catch interrupt vectors and set hardware pin states (how cool is that?).  The working size of the MF is ~250k. Yes 250k.

Where can I get the MF?
The MF is still in very early stages and isn't quite ready for a broad release.  MEDC provided a somewhat controllable release area where immediate feedback could be gotten from users and the hardware was a specific known set.

What exactly did MEDC attendees get?
They got a SumoRobot kit that was based on the Parallax SumoBOT.  It was not just a Parallax bot.  It had a custom PCB running a non-commercial ARM processor.  That means that even if you get the SDK, you cannot just go get a Parallax bot and use it (I've been asked a few times about this now - sorry for not being clear on it at the conference).  The attendees also got a early SDK that allowed for development against the bot.  The lucky 40 or so who actually got hardware got to take it home.

On Tuesday I held a lab where I walked through development and how to test the hardware, plus provided a little sample code.  On Wednesday night those with SumoRobots got to test them in a competitioon against one another.

I'm jealous.  Where can I get MF hardware?
There isn't anything available today, but the beta MF will be out in a few months and there are some hardware vendors working hard to have development kits ready to ship when that happens.  To keep up to date sign up at the MF web site.

Will OpenNETCF be doing stuff with the Micro Framework?
Silly question.  We already are.  We wrote the documentation for the SumoRobot and the lab and are working hard to make sure we can provide the value and platform extension work that you've come to expect from us.

5/16/2006 11:12:39 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [2]  | 
 Thursday, May 11, 2006

For those who attended any of my sessions at MEDC, below are links to the downloads.

SumoRobot Lab Manual
SumoRobot Sample Code
HeapTest RPM Test App
CF RPM provisioning file for WM 5.0

5/11/2006 6:38:12 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [1]  | 
 Tuesday, May 09, 2006

In one of the hands-on labs here at MEDC a developer asked how to pass a managed funtion to a native DLL as a callback function.  I promised him a sample, so here's a simple one that shows how to call EnumWindows:

 

public delegate int EnumWindowsProc(IntPtr hwnd, IntPtr lParam);

public partial class Form1 : Form
{
    EnumWindowsProc callbackDelegate;
    IntPtr callbackDelegatePointer;

    [DllImport("coredll.dll", SetLastError = true)]
    public static extern bool EnumWindows(IntPtr lpEnumFunc, uint lParam);

    public Form1()
    {
        InitializeComponent();

        callbackDelegate = new EnumWindowsProc(EnumWindowsCallbackProc);
        callbackDelegatePointer = Marshal.GetFunctionPointerForDelegate(callbackDelegate);

        EnumWindows(callbackDelegatePointer, 0);
    }

    public int EnumWindowsCallbackProc(IntPtr hwnd, IntPtr lParam)
    {
        System.Diagnostics.Debug.WriteLine("Window: " + hwnd.ToString());

        return 1;
    }
}

5/9/2006 8:44:10 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [1]  | 
 Saturday, April 29, 2006

So OpenNETCF Consulting is growing and as such I decided to get a business number and fax line through Vonage.  We get and send very, very few faxes (maybe 1 a month if we're busy) but the line was free, and when you need it send or receive a contract, NDA or whatever, you just have to have it. 

Well we had been using the eFax service but since the fax line was free I figured there was no point in spending the $12 a month for the service we didn't need.  Mind you I never had a problem with them.  Service was fine, the product met our needs when we needed it, it just has become unnecessary.  So I decided last night I'd cancel it.  This is where the journey began...

Step 1 - Log in.  Well I don't use the service often, so I had to find my PIN.  Of course I recently changed jobs, so my PIn was in an email that was in a PST archive saved off from another PC.  Search through boxes to find the righ CD, then search through the CD for the PST, then search through the PST for efails from eFax, then search through those for a PIN.  I've now burned an hour.

Step 2 - Cancel service online. Scoured their site - every logical (and even not so logical pages) to find something that allows me to stop the service.  Found ways to alter my billing info, pay yearly instead of monthly, change my PIN to somethign I might remember (would've been useful a while ago), but nothing for stopping service. Another 30 minutes or so down the drain.

Step 3 - Email customer service.  Searched the site for an email for customer service.  Nothing.  Sent an email to their sales staff becasue it was the only email I could find.

Step 4 - Call customer service. I hate calling when an email or online form will do, but a call is what it must be.  Sorry, it's after their business hours, please call later.

Step 5 - Call customer service again.  Waited til the next day (got the feeling Saturday won't be too helpful, but I'm wishful).  Actually listened to automated menu this time and found that you cannot cancel service over the phone.  You must do it online (nice eh?).  Fortunately the message gives the URL: www.efax.com/cancel. There is absolutely no link on their site to this (believe me, I went back and looked) - it's an orphan page.

Step 6 - Cancel service online.  To cancel service you must chat with a live representative. Why can't I just click a damned button?  Now I'm getting irritated.  The representative needs my eFax number and PIN - fortunately I dug through the boxes yesterday to get it.

Step 7 - Chat with representative and try to simply cancel service.  Rep obviously is eitehr cut and pasting or has an app that posts responses or they have Clark Kent on the help desk.  Green are comments, not chat text.

Welcome to chat.
The session has been accepted.
 
{eFax Rep} Hello, Chris. Welcome to j2 Global online support. I am <rep name>, your online live Support Representative. How are you doing today? 
(at least he's friendly)
{ctacke} fine 
{ctacke} I have an account that I'd like to cancel 
{eFax Rep} I'm sorry to hear that you wish to cancel. Could you please provide me your Fax number and the PIN for verification purposes? 
{ctacke} the number is <number> 
{ctacke} pin is <pin> 
{eFax Rep} Thank you for the information. Please give me a moment while I quickly check your account. In the meanwhile, may I ask why you wish to cancel your fax account? 
(understandable.  always good to know why someone is leaving)
{ctacke} We installed a land line for faxes 
{ctacke} Basically we've grown and now have a permanent office 
{eFax Rep} Chris,I have just checked your account. Our records indicate that you have been a long time customer. We value your business and relationship with us. I would like to mention to you an exclusive offer.
(here comes the soft sell - now I know why I can't just bush a button)
{eFax Rep} Chris, It is always good to have a alternative faxing service as you may not know when the need for faxing may arise.
In the current scenario, as a special consideration and gesture of goodwill.Your eFax account will be credited with $25.90 so that you may utilize our services without being billed our monthly fee for the next two billing cycles. 
{eFax Rep} Hence, you will be able to use our service to its fullest capabilities and re-evaluate it for your faxing needs. During this credit period, you will not be charged any monthly fees. 
{eFax Rep} If however, you still feel that you do not have any use for our services by the end of the two months credit period, then you can always contact us back anytime. 
{ctacke} No thanks. I'd like to just cancel it. 
{eFax Rep} During this two months credit period, you can keep this service active and if you use it once in these two months we will be more than happy that we were able to serve you. Trust me there are no hidden traits and you will not be charged any monthly fees for this account during this period. 
(What part of "cancel it" does he not get?)
{eFax Rep} As a good will gesture to continue our association we will offer you an additional gift balance of $10 along with the monthly credit which will enable to send up to 100 additional fax pages free of cost anywhere in USA & Canada. 
{eFax Rep} Chris, all you need to do is contact us once before the two months credit period ends if you do not wish to continue with the service. There is certainly no obligation to stay back after the two months credit period ends. You can contact us anytime. We are available 24 x 7.
(24x7 if you know the magic way to get here maybe)
{ctacke} Yes, I understand that, but as it is I forget things. For example, I installed my land line almost 2 months ago and kept eFax just in case we had issues. We haven't, so I'm comfortable with just keeping the land line. 
(really, I'm forgetful and the last thing I want is to get another charge in 3 months because I forgot to find my PIN, come to this magic page and get this same sales pitch again)
{ctacke} So I would like to cancel my eFax account. Thanks. 
{eFax Rep} All right, I will cancel the account for you now. 

So what's going on here?  It's just like many other companies.  They count on you being forgetful or not closely monitoring your bank account.  I obviously don't need a second fax line, but if they can get me to keep the service, even for free for a few months (zero cost to them to do that) then maybe after that period I'll forget to cancel and they can charge me at least once before I can cancel again.  Sure, it's only $12, but it adds up.

4/29/2006 11:35:57 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [1]  | 

If you're familiar with OpenNETCF, you know that we started as just a group of developers who wanted to improve the development experience for the community working with the .NET Compact Framework.  We created the Smart Device Framework and have answered innuerable questions in public arenas like the public newsgroups, the MSDN Forums as well as our own forums.

All of this work has always been for free, and on the side as we all had day jobs that we had to do to pay the bills.  Well that's changed a bit (and is still changing), and it occured to me that I really hadn't made the fact public.  Sure, we started OpenNETCF Consulting as an avenue to allow people to get professional support and services from us a year or so ago, but because we all had day jobs, it made taking on most larger scale projects was out of the question.

A few months ago Mark Arteaga became our first "full time employee."  I put that in quotes because technically he's not a full time employee, but he is working full time on OpenNETCF services and products.

About 2 months ago, I quit my regular job at Applied Data Systems.  It was a scary move, but ever since I've been insanely busy so it seems to be working out well.

And now yesterday was Neil's last day with Conchango.  So that means OpenNETCF Consulting has 3 full-time developers on staff and ready to work on your mobile projects, and we have plans to add more when we have the work to support it.

This also means we'll be releasing commercial products in the near future.  Stay tuned.

 

4/29/2006 11:09:38 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]  |