Scott Hanselman

.Common - beat poetry

August 7, '03 Comments [3] Posted in Musings
Sponsored By

I performed my new beat poem ". <dot> Common" at the LuvJonz last night around 10:30pm to a smoke filled room of very supportive and jazzy people at Ohm

(By the way, The Ohm is now the new home of Johnny Ray's Grill.  I spoke with Johnny Ray briefly, and it's he's got some fantastic beef brisket for like $2.  He'll be open 24 hours on the weekends, so you just gotta get down there and get some grub.)

Anyway, it was a blast, and I hope to be down there more often.  It's a different vibe than Standup, and very different vibe than C# and PowerPoint. (although, not that different if you've ever seen one of my presentations! )

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

I will be there with Managed Bells on...

August 7, '03 Comments [0] Posted in Web Services | TechEd | Speaking | PDC
Sponsored By

I shall be there.  I'm really looking forward to this one.  TechEd is fun, but PDC is the social and technical event of any season.

A picture named PDC2003.gif

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

More interesting code from my buddy Sairama - How to create an object with a private constructor

August 7, '03 Comments [3] Posted in Web Services
Sponsored By

using System;
namespace Corillian.Testing
{
 
     class PrivateClass
      {
            public string Name;
            public int    Age;
            private PrivateClass() 
            { 
                  Name = "not initialized";
                  Age = 0;
            }
      } 

      class Test
      {
            static void Main(string[] args)
            {
                  /// The following statement will not work as the constructor is private
                  /// PrivateClass newpTest = new PrivateClass();
                  /// But you can create the object through Serialization 
                  PrivateClass ptest = (PrivateClass)System.Runtime.Serialization.FormatterServices.GetUninitializedObject( typeof(PrivateClass) );
                  ptest.Name = "Scott";
                  ptest.Age = 0x1D;

                  Console.WriteLine( String.Format("{0} {1}",ptest.Name,ptest.Age );
            }
      }
}

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

Converting to a DateTime from time_t

August 5, '03 Comments [0] Posted in
Sponsored By

Oo! Good stuff…I need a copy for myself…

This code just went by an internal alias and I thought I’d record it here.

public static DateTime Time_T2DateTime(uint time_t)
{
    long win32FileTime = 10000000*(long)time_t + 116444736000000000;
    return DateTime.FromFileTimeUtc(win32FileTime);
}

[Brad Abrams]

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

How many ways to Beep and Make Noise in .NET and C#

August 1, '03 Comments [0] Posted in Web Services | XML
Sponsored By

At the PADNUG meeting last night the question (Lord knows why this always comes up :) on how to make the system "beep" was asked.  Here's two kinds of beeps, and links to some source.

The "PC Beep," including frequency and duration:

using System.Runtime.InteropServices;
class MainClass
{
[DllImport("kernel32.dll")]
public static extern bool Beep(int freq,int duration);

 public
static void Main(string
[] args)
 {
 
Beep(1000,1000);
  Beep(2000,500);
 }
}

The considerably more interesting "MessageBeep" (via BradA) that uses the Wav files that are configured in the Sounds Control Panel.

public enum MessageBeepType
{
    Default = -1,
    Ok = 0x00000000,
    Error = 0x00000010,
    Question = 0x00000020,
    Warning = 0x00000030,
    Information = 0x00000040,
}

[DllImport("user32.dll", SetLastError=true)]
public static extern bool MessageBeep(
    MessageBeepType type
);

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.