Scott Hanselman

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

.DOT COMMON - A Beat Poem by Scott Hanselman

July 31, '03 Comments [0] Posted in Gaming
Sponsored By

I woke up at 3am last night and wrote this Poem.  I will probably perform it at the LuvJonz at Ohm on Weds the 6th.


.DOT COMMON

We watch UPN's Fake life via a one way transmission
Oh, Those wacky girlfriends
But you are more than my friend, girl
You are my life, my wife, My only source of strife 

man and wife We fight

 But we make up, and that make-up is a wake up
Calling me to appreciate MY fate, MY life, MY wife
But Fake life calls again, this time it's a two way transmission 

UPN makes way for TCP/IP, U see I see the calls of the green screen and the..chat
You've got mail.
Maybe he's got mail, you don't.  Your male, yo' man, is on-line, on yo' time. 

The internet being a means to facilitate data transmission and exchange
At this rate he/I may be your ex ... change
Is not always for the better

slash slash, I want my HTTP-Stolen-time-back

But this Internet, this new network, isn't about you and me,
It's about me and everyone...but you' 

Xbox Live isn't Livin'
But I am Finding my Solace in the Start Menu
I'm aLive in Windows 95
The C drive affects our sex drive
Letters take my attention
Creates dissention increases contention 

Compete, take a back seat, you retreat in defeat
My computer has become my suitor
The internet my friend
We don't conjugate conjugally
We procreate minimally

And you, my mate, translate to a different state, that of
Roommate - correspondingly lightweight

Bringing together of gentle rank and file
attachments in this Global community

I'm closer to my DOT-PenPal's locale
Than friends
Shall Speak now or forever hold their peace
I'd never risk
This marriage
This earnest Endeavour
With who-so-what-ever
Till Death do us part ways
Death - The time when something ends
Our DOT com-mon law marriage

- Scott Hanselman ©2003

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

Portland Area .NET Users Group (PADNUG) - The After Party

July 31, '03 Comments [1] Posted in Musings
Sponsored By

Had a blast at the PADNUG meeting tonight.  The pizza delivery failed so we all went over to the Buffalo Gap, and enjoyed a buffet on the house.  Hung out with Rory Blyth, who is clever in person as well as in the blogosphere.  I mentioned I'd sold three Commodore 64s today (+Drives, Monitors, and a Koala Pad) and we talked about BBSes.  He also was a big BBS'er back in the day and I was completely shocked to hear that he'd heard of my little BBS...I noticed it's listed in the definitive source of BBS info, the PDX BBS List.  Either way, a bloody fine time.

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

Ridiculous MSN Messenger 6.0 Bug - anyone want to pass this on to the team?

July 31, '03 Comments [4] Posted in Web Services | Bugs
Sponsored By

Here's a particularly special bug, because this represents my FIRST experience with MSN Messenger 6.0, which I installed and my friend Adam's urging.  :)   That's Adam in the upper right corner.  What's that in the lower right corner you ask?  Well, that's not me, but a reverse image of my USB TV Tuner.  Apparently Messenger doesn't feel like enumerating the more than one video sources available on my system.  Be aware!

A picture named msn60camerabug.JPG

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.