Scott Hanselman

Where's the Platform? Where do YOU think the Platform is?

March 13, '03 Comments [3] Posted in Web Services | XML
Sponsored By

A little confusion around marketing terms today.  As a developer, as devs are wont to do, I usually try to speak the truth, the clear truth, the common sense (from a dev's POV) truth.  But as a Zen-minded fellow, I can see the thinking...or can I?

The term ".NET", and ActiveX before it, is fast becoming the most overloaded operator in Microsoft's marketing message. 

In the beginning, all was .NET.  It was the sun, the moon, the sky.  .NET was a modifer for all the product things....NET myServices, .NET Server Family, .NET Framework, Visual Studio.NET

Then, .NET became more broad and touchy feeling...".NET is software that connects people, systems, and devices."  This is inline with the recent IBM commercials that have transformed the image of Big Blue in peoples' minds from old and stogy to the nimble competitor of Microsoft.  Microsoft countered with "1° of separation" adds that sell the idea of .NET software.

Then, pundits broke it down to the basics...".NET is Microsoft's implementation of Web Services"

So, at this point, it sounds like .NET is a platform, right?  Well, no, not according to Microsoft.  The Windows .NET Framework is a core part of Windows, as core as the Win32 API.  .NET is NOT a Platform - Windows is the Platform.  .NET provides the runtime.  Windows provices the services. 

So using this new information I decided to attempt to use ".NET" in a sentence.

".NET and Visual Studio is how you create WS-I Compliant XML Web Services on the Windows Platform."

This makes me very happy, since learning how to use a new word in a sentence marks the beginnings of fluency.


.NET Zen Koan
"People think it is hard to see the .NET, but in reality it is neither difficult nor easy.  It is a matter of responding to C# and VB.NET while remaining detached from C# and VB.NET, living in the midst of passions yet being detached from passions, seeing without seeing, hearing without hearing, acting without acting, seeking without seeking. "


Unsafe Zen Koan
"Scott showed out his unsafe code and said, "If you call this unsafe code, you oppose its reality. If you do not call it unsafe code, you ignore the fact. Now what do you wish to call this?"


 Languages Zen Koan
"One day Fred was working with .NET. He overheard a programmer say to his superior, "Give me the best programming language you have." "Every language in .NET is the best," replied the butcher. "You can not find any language in .NET that is not the best." At these words, Fred was enlightened. "


 Managed Zen Koan
"One day as Sam was writing Managed C++, the Buddha called to him, "Sam, Sam, why do you not enter the runtime and write in C#?" Sam replied, "I do not see myself as outside. Why enter?"

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Exploring IsNumeric for C#

March 11, '03 Comments [1] Posted in Web Services
Sponsored By

Some bits of code:.
C# version of IsNumeric( ) :
public static bool IsNumeric(object value){
   try    {
      int i = Convert.ToInt32(value.ToString());
      return true;
   }
      catch (FormatException)    {
      return false;
   }
}
[via The Wagner Blog]

Actually, this doesn't really do what IsNumeric does, as IsNumeric should also return true for floating point numbers.  This is really more of an "IsInt".
 
Also, why write your own?  You can just reference Microsoft.VisualBasic.dll, then do the following:
if (Microsoft.VisualBasic.Information.IsNumeric("5"))
{
 
//Do Something
}
The VB one actually performs better, as it doesn't throw an exception for every failed conversion.
[Sean 'Early' Campbell & Scott 'Adopter' Swigart's Radio Weblog]

What's REALLY interesting is what's going on in the Source Code (disassembled) for the VisualBasic.Information.IsNumeric (as I am trepidacious to include this dependancy (dunno why) in my code). 

Looks like it's pretty much the checking the Type of the object via iConvertable or the alternate TryParse...:

public static bool Isumeric (object Expression)
{
bool f;
ufloat64 a;
long l;

IConvertible iConvertible = null;
if ( ((Expression is IConvertible)))
{
   iConvertible = (IConvertible) Expression;
}

if (iConvertible == null)
{
   if ( ((Expression is char[])))
   {
       Expression = new String ((char[]) Expression);
       goto IL_002d; 'hopefully inserted by optimizer
   }
   return 0;
}
IL_002d:
TypeCode typeCode = iConvertible.GetTypeCode ();
if ((typeCode == 18) || (typeCode == 4))
{
    string str = iConvertible.ToString (null);
   try
   {
        if ( (StringType.IsHexOrOctValue (str, l)))
   {
        f = true;
        return f;
   }
}
catch (Exception )
{
    f = false;
    return f;
};
return DoubleType.TryParse (str, a);
}
return Utils.IsNumericTypeCode (typeCode);
}

internal static bool IsNumericType (Type typ)
{
bool f;
TypeCode typeCode;
if ( (typ.IsArray))
{
    return 0;
}
switch (Type.GetTypeCode (typ))
{
case 3:
case 6:
case 7:
case 9:
case 11:
case 13:
case 14:
case 15:
   return 1;
};
return 0;
}

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

The New Lifescan OneTouch UltraSmart

March 11, '03 Comments [1] Posted in Diabetes | Reviews | Movies
Sponsored By

It came out and I ran to Fred Meyer to pick one up for myself.  I'm talking about the new Blood Glucose Meter from Lifescan, the OneTouch UltraSmart.  (Diabetics who are also geeks MUST have all the new toys)

If you wanted a review, here it is: The UltraSmart is the BEST meter I've ever used.  Full Stop.  I love it.

If you want more, read on.  It combines everything that is good about the original One Touch Ultra with a very complete logbook.  Also, thank goodness, it finally includes a backlight.  I can't tell you how many times I've needed to check my blood sugar in the movies and have struggled with the non-backlit Ultra.

Here's all you need to know:

  • Uses the same Ultra test strips you use now
  • Results in 5 seconds
  • Huge temperature range
  • Blue "Indiglo" Backlight
  • Graphs and trending data
  • Logging of Exercise, Carbos, Hypos, etc
  • Connects to OneTouch Software

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

The New Look for DiabeticBooks.com

March 11, '03 Comments [0] Posted in Diabetes | XML
Sponsored By

In a rit of fealous jage and the inspiration of XML and CSS I updated my Diabetes Superstore http://www.diabeticbooks.com.  It's got a sexy new look and is dynamically updated by XML and XSLT taking the latest Amazon.com data and adding my review and comments of the latest books and information on Diabetes.  I've added new categories, I'm adding new books all the time.  If there's any desire for an RSS feed, let me know.  Enjoy!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Ok, fine, so I took the damn red pill...InfoPath in Action (and ruminations on Trumpet WinSock)

March 11, '03 Comments [0] Posted in Web Services
Sponsored By

Chris Brooks, my CTO, and I finally sat down to spend what we thought would be some serious time with Microsoft Office 2003's InfoPath and Chris Anderson's BlogX (Chris and some managers run BlogX internal blogs). 

We started up InfoPath, selected "New from Data Source" and pointed it at Chris's Internal Blog's WSDL.  We hooked up the CreateEntry Document to the CreateEntry Operation, and were presented with the Design View.  Rather than dragging one simple element at a time, we guessed and drug the whole CreateEntry and *poof* the form was sitting there.  We stared...exchanged "Oh, that was sweet" and continued.  We added name and password, a submit button and saved. 

We started up the Data Entry view, filled out the form, and nothing bad happened.  Suspicious thoughts filled the air, but we supressed them and visited Chris's blog...and dammit if the thing wasn't updated with our new entry.

As we sat and stared, I thought about the stacks of protocol layers and specificiations that we sat atop.  The false starts, the iterations, the consortiums, the presentations.  I thought of the day I first installed Trumpet Winsock on my Windows 3.1 machine and telneted to cdconnection.com, content to send my credit card number screaming in plaintext across the open Internet. 

The view from here is lovely.  I look forward to the things I can build with the things that have been built for me.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.