Scott Hanselman

Need a Professional Photographer?

March 14, '05 Comments [4] Posted in Musings
Sponsored By

Hanselmanscott

A lot of folks commented on the portrait(s) that appeared on my blog recently. It was certainly a lot more professional looking than the previous snapshot. The backstory is this: Recently I had an article written about me for the OIT Alumni magazine, and they hired a professional photographer. I'm pretty :) but not pretty enough to have worked with pros before, so I didn't know what to expect. Fortunately, they hired Laszlo Bencze and he made me feel pretty much at ease. During the formal portrait shoot, Laszlo chatted me up about everything from blogging to digital vs. film photography. By the time we were done chatting - I hadn't realized - but we were done, and the pictures were taken. He also watched my class as I taught it later that evening and I forgot he was in the room, until I saw the pictures in the Alumni Magazine. Take a look at his photography sites at http://www.laszlophoto.com/ and http://www.lbencze.com/ (Interestingly, he's also a hell of a weight lifter.)

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

Rory and Scott go to TechEd - A love story

March 12, '05 Comments [10] Posted in TechEd | Javascript | Speaking
Sponsored By

Rory and I and a guy with a camera filmed some videos about TechEd, conferences, architecture, technology, Don Box, underwear, whiteboarding, love, life and Exchange installs. Here's one. There may be more - watch for them! Actually, I'd love it if so many people watch this video of Rory and I in the bathroom that the server hosting it goes down! :)

Please spread it around and Trackback/Pingback it. If you can't view it below, you can download it here.

Also, if you're blogging TechEd this year, make sure to register your blog at TechEd Bloggers.NET and get your content aggregated!


play video stop video indicatorhandleamount downloaded toggle sound launch in external player
Launch the streaming media file

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

Getting a Shared Network Printer to work under DOS

March 11, '05 Comments [1] Posted in Musings
Sponsored By

I get some crazy questions emailed to me, presumably because of the blog. Most I can't answer, as I have a job and a wife, but some are too interesting not to. One fellow emailed me yesterday who's got a real world legacy system problem. So, since everyone is so concerned about VB6 support going away, I give you:

Getting a Shared Network Printer to work under DOS - A CheckList

  • DOS Hardware Drivers for your network card
  • DOS TCP/IP stack
  • Network stack for whatever protocol is sharing your printer (SAMBA, Novell, etc)
  • Printer Port Redirector for DOS that will let you point LPT1(PRN) to your networked printer

Googling found these, I'm sure there are more:

Seems that if people care deeply about legacy systems, they will make things work. Now I'm off to get email from my C64...

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

Compositing two images into one from the ASP.NET Server Side

March 11, '05 Comments [14] Posted in ASP.NET | XML | HttpHandler
Sponsored By

Today I had a system that was sending me two base64'ed images in an XML response. The images were of the front and back image of a check. However, the requirement is to show a single composite check image at the browser with the front image stacked on top of the back image.  Of course, it's got to be secure so no temp files, blah blah.

Here's the solution, done as an HttpHandler, so something like <img src="checkimage.ashx?whatever=4&something=6">

public class SomeCheckImageHandler : IHttpHandler

{

    //some stuff snipped
  

    public SomeCheckImageHandler(){}

 

    public void ProcessRequest(HttpContext context)

    {

        context.Response.ContentType = "image/jpg";   

 

        //some stuff snipped

        GetCheckImageRequest req = new GetCheckImageRequest();

        //some stuff snipped, get the params from the QueryString

        GetCheckImageResponse res = banking.GetCheckImage(req);

 

        //some stuff snipped

        if (res.ImageBack != null)

        {

            //merge them into one image

            using(MemoryStream m = new MemoryStream(res.BackImageBytes))

            using(Image backImage = System.Drawing.Image.FromStream(m))

            using(MemoryStream m2 = new MemoryStream(res.BrontImageBytes))

            using(Image frontImage = System.Drawing.Image.FromStream(m2))

            using(Bitmap compositeImage = new Bitmap(frontImage.Width,frontImage.Height+backImage.Height))

            using(Graphics compositeGraphics = Graphics.FromImage(compositeImage))

            {

                compositeGraphics.CompositingMode = CompositingMode.SourceCopy;

                compositeGraphics.DrawImageUnscaled(frontImage,0,0);

                compositeGraphics.DrawImageUnscaled(backImage,0,frontImage.Height);

                compositeImage.Save(context.Response.OutputStream, ImageFormat.Jpeg);

            }

        }

        else //just show the front, we've got no back

        {

            using(MemoryStream m = new MemoryStream(frontImageBytes))

            using(Image image = System.Drawing.Image.FromStream(m))

            {

                image.Save(context.Response.OutputStream, ImageFormat.Jpeg);

            }

        }

    }

}

I love it when .NET makes things this easy.

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

You have GOT to be kidding me

March 10, '05 Comments [11] Posted in Programming
Sponsored By

I have no words: http://classicvb.org/petition/

In other news, I demand that Leaded Gasoline be brought back to support my 1963 Ford Falcon.

Set VB6 = Nothing

'Nuff said.

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.