Scott Hanselman

Adding PNGOUT to the Explorer Right Click Context Menu

April 11, 2007 Comment on this post [6] Posted in Musings | PowerShell | Programming
Sponsored By

I've been creating more PNGs lately on the blog. However, the default PNGs created by most tools are fat fat fat. PNGOUT to the rescue.

So, now I use PNGOUT to compress all PNGs before they are uploaded to the blog now. It's wonderful. It looks like Rick "Paint.NET Guy" Brewster is also enamored with PNGOUT and is considering integrating support directly into PAINT.NET although there might be legal issues. I'd be happy with a simple "call PNGOUT when you're done" option. Poof, we've avoided any legal trouble.

I know there's lots of Windows Apps that front PNGOUT and other PNG apps, but I like my things integrated and automatic.

Thoughts:

  • I wonder if someone could write a Windows Live Writer Plugin to run PNG out on files created by WLW before they are posted?
  • Since I'm using Kenny Kerr's Window Clippings to create the PNGs, it'd be more expedient to ask him to add the "Call PNGOUT when you're done"-feature to his tool.
  • I think I'll just integrate PNGOUT with the shell, it'll be faster...

Create PNGOUT.reg file that looks like this:

Windows Registry Editor Version 5.00 
[HKEY_CLASSES_ROOT\pngfile\shell\PNGOUT]
[HKEY_CLASSES_ROOT\pngfile\shell\PNGOUT\command]
@="\"C:\\Utils\\pngout.exe\" \"%1\""

Make sure you change your path to PNGOUT to match reality. Now you have this available in Explorer:

Optimizing all existing PNGs on my blog

Ah, but I also need to tidy up the EXISTING PNGs from my site. First I'll download all the PNGs to my local drive, then fire up PowerShell and run this command that will recurse everywhere in the current directory and below and run PNGOUT on all the PNGs, replacing them in place:

get-childitem . -include *.png -recurse | foreach ($_) { pngout "$_"}

Uploaded, and now I've taken my total PNG size (of all PNGs in all posts on the blog) from 40,004,166 bytes to 23,004,247 bytes a savings of about 42%. That'll add up in bandwidth costs.

You can also optimize the autogenerated PNG files within Windows Live Writer by running that same PowerShell command on the files in

%APPDATA%\Windows Live Writer\PostSupportingFilesWriter\PostSupportingFiles

It's a shame that most default libraries for PNG make such large PNGs, considering that this is the "picture format design for the web." Thanks PNGOUT!

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Blogging to DasBlog from Word 2007

April 11, 2007 Comment on this post [13] Posted in DasBlog | Musings
Sponsored By

If this works, I've blogged to DasBlog from Word 2007. Why would I want to do this?

Looks like it works fine except for pictures. According to Ken (a developer on the DasBlog team) the Word 2007 implementation of the metaWebLog API's "newMediaObject" method is broken. They are passing a string but calling it an int, and DasBlog is pretty strict.

I can see where I might find myself on a computer that had only Word 2007, and rather than using the Web Interface I might want to blog from Word.

There's also the comfort level - that seems to me to be the most compelling reason. Word is comfortable, and being able to post to one's blog here would be very natural for most writers who live in Word already.

I might set this up for my wife as she's already comfortable with Word and Office. We'll get the picture/media thing worked out and I'll have Mo give it a try.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Accessing Mapped Network Drives via ASP.NET in IIS 6

April 11, 2007 Comment on this post [2] Posted in ASP.NET
Sponsored By

A question came up at work today, "How do I access mapped network drives in ASP.NET under IIS 6? It worked before I got IIS 6 and Windows 2003."

IIS 6 and Windows 2003 are considerably more locked down versus previous versions. Additionally, accessing drives via mapped drive letters is frowned upon, likely the layer of redirection, as drives can be REMAPPED by evil-doers.

The preferred way to access network shares is via UNC.If you really wanna use Mapped Drives, there's KB257174.

There's also KB207671 on "How to access network files from IIS applications." This is a pretty funny KB, specifically because of it's first suggestion:

Following are ways to avoid problems when you access network resources from your IIS application:

  • Keep files on the local computer.

This is the equivalent of the classic "Doctor, it hurts when I do this." "Well, don't do that."

The most useful tip in that KB article is the one about Auditing Logons. Rather than guessing or treating IIS as a black box, turn on Login Auditing:

If you cannot determine what kind of logon is occurring on your IIS server to handle requests, you can turn on auditing for Logons and Logoffs. Follow these steps:

1. Click Start, click Settings, click Control Panel, click Administrative Tools, and then click Local Security Policy.

2. After you open Local Security Policy, in the left Tree View pane, click Security Settings, click Local Policies, and then click Audit Policy.

3. Double-click Audit Logon Event and then click Success and Failure. Event Log entries are added under the Security log. You can determine the kind of logon by looking at the event details under the Logon Type:

  2=Interactive, 3=Network, 4=Batch, 5=Service

 No matter how you choose to accomplish your goal, always be aware of the Identity of your Worker Process. That might be ASPNET_WP or W3WP and it might be NETWORKSERVICE, or IUSR_MACHINE Name. Always use the weakest possible user, and make sure the files and the share have the minimal access needed. Don't run your Worker Process as anyone with any power or Administrator to solve file access problems.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

A Call for Good Design - One Guy, an Insulin Pump, 8 PDAs and an iPod

April 11, 2007 Comment on this post [7] Posted in Diabetes
Sponsored By

Six years ago, my wife and I went on a wireless trip across the country with my new (at the time) Insulin Pump and 8 PDAs. The pictures from this Planes, Trains and Automobiles across the country are still around.

The trip was written up, lo these many years ago, at The Feature.com and is still available in their archives as "One Guy, an Insulin Pump, and 8 PDAs".

Here's a few bits of that article that I thought were significant or interesting with new emphasis mine:

Now I've got three devices in my pocket -- each with screens, batteries, and buttons, but all alone in the world. Three devices, each with a distinct purpose, provide me with a little bit of information that I give my doctor. It's quite a mess, especially when it's time to change the batteries.

Of course, each of these devices has some interface to the outside world, but each comes with an interoperability catch. The pump has infrared, but it only communicates with proprietary software. The blood sugar meter has a serial port, but it only works with a custom cable and software. My cell phone has some kind of interface on its bottom, but no standard way to hook it up to any of these devices. The PalmPilot has a serial connector and infrared, but doesn't have support from the notoriously slow-moving healthcare industry. [Scott Hanselman writing for TheFeature.com in 2001]

The trip was fun - it was my wife and my first date, and she and I were married three months later, but from a technology perspective it was a huge failure. The technology wasn't ready.

Today, Amy Tenderich has a great Open Letter to Steve Jobs (Mental Note: Write an Open Letter to Someone) up on her blog, DiabetesMine.com and TechCrunch is helping spread the good word.

Apple has sold 100 million iPods, and she points out that 20 million diabetics are using Glucose Meters and Insulin Pumps that smell of 1997.

There's a few issues here that are a problem, Amy's interested in better design and User Experience. She says:

In short, medical device manufacturers are stuck in a bygone era; they continue to design these products in an engineering-driven, physician-centered bubble. They have not yet grasped the concept that medical devices are also life devices, and therefore need to feel good and look good for the patients using them 24/7, in addition to keeping us alive.

Clearly, we need a visionary to champion this disconnect. We need an organization on the cutting edge of consumer design to get vocal about this issue. Ideally, we need a “gadget guru” like Jonathan Ive to show the medical device industry what is possible. [Amy Tenderich]

She's right on. Additionally for me, as an engineer, I want to know where's the iTunes Killer App for my Insulin Pump and Meter? Plugin and sync. Is that so far? I'm personally interested in the other side of the User Experience - getting at the data locked in these little devices. Well, we're working on it, but getting the data out of these meters is like pulling teeth.

Attention: Diabetes Device Manufacturers - Release my Data!

You can download the LifeScan OneTouch Ultra RS-232 Serial Protocol up at the LifeScan site, but the protocol for their flagship device, the UltraSmart (a now FOUR YEAR OLD meter) is hidden, encoded and proprietary. Kind of makes our ClickOnce Diabetes Downloader a little hard to implement, wouldn't you think?

It's very frustrating as we, the technical Diabetic community, try to move things forward that:

  • There's no standard XML format for Diabetes Management.
  • Most meters have a proprietary format.
    • Only the FreeStyle is truly open with all their formats. More companies are slowly following suit. Here's a news flash, meter companies - your meter protocol is not the key to your success. Let it go.
  • There's no standard interface cable.
    • The closest we can get is a headphone jack to serial with a serial to USB interface. Again, only the FreeStyle works brilliantly.

Even my brand new, this year, insulin pump uses a cobbled together cable along with proprietary RF to dump it's data. And where does it dump the data to? A proprietary java-based Applet online that I have yet to get to work.

Maybe future meters will change this, or maybe someone from LifeScan will read this and release the UltraSmart meter protocol.

In the comments on TechCrunch, a Diabetes Technologist teases us with this tantalizing tidbit:

I’m a firmware engineer on a blood glucose meter at a very large, well known company. I agree that this is a great idea. I’d be much more excited if our product wasn’t a solid 5 years behind in design for a handheld device. We do have a product coming out in a couple years and the preliminary designs could possibly be the best looking meter I’ve seen to date. Sorry, I can’t disclose anything else about it!

Here's what I was hoping, in 2001, would have happened by now:

I imagine a world of true digital convergence -- assuming that I won't be cured of diabetes by some biological means in my lifetime -- an implanted pump and glucose sensor, an advanced artificial pancreas. A closed system for diabetics that automatically senses sugar levels and delivers insulin has been the diabetics' holy grail for years. But with the advent of wireless technology and the Internet, my already optimistic vision has brightened. If I had an implanted device with wireless capabilities, it could be in constant contact with my doctor. If the pump failed, it could simultaneously alert me, my doctor, and the local emergency room, downloading my health history in preparation for my visit. If it was running low on insulin, the pump could report its status to my insurance company, and I'd have new insulin delivered to my doorstep the next day.

We're not there yet. Thanks, Amy, for helping move the ball forward and cast some light on this problem. Medical devices lack 5 to 10 years in usability. We need updated UIs and updated and open Protocol Specs.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Email Signature Etiquette with Outlook 2007 - Appropriate Flair

April 11, 2007 Comment on this post [9] Posted in Musings
Sponsored By

A while back we had a nice discussion about Email Signature Netiquette. How much flair was too much?

I talked about creating more dynamic and customized signatures in Outlook 2007...

Getting HTML (or FeedBurner) Dynamic Email Signatures in Outlook 2007

My signature is generated by FeedBurner, using their Headline Animator feature (that I love).

<a href="http://feeds.feedburner.com/ScottHanselman">
<img border="0" alt="Scott Hanselman's Blog"
src="http://feeds.feedburner.com/ScottHanselman.gif">
</a>

This works great, except in Outlook 2007, which no longer lets you edit your email signatures directly in HTML in their UI. Plus, because there's three kinds of email in Outlook, text, RTF, and HTML, they autogenerate all three formats for you and put the files deep in the bowels in:

C:\Documents and Settings\Scott\Application Data\Microsoft\Signatures\

I don't use txt or rtf-based email if I can avoid it, so I just open the named html file in that folder and edit the part in their auto generated section '<div class="Section1">' like this:

<div class=Section1>
<p class=MsoAutoSig>Scott Hanselman<o:p></o:p></p>
<p class=MsoAutoSig>Chief Architect - Corillian Corporation<o:p></o:p></p>
<p class=MsoAutoSig>
<a href="http://feeds.feedburner.com/ScottHanselman">
<img src="http://feeds.feedburner.com/ScottHanselman.gif"
style="border:0" alt="Scott Hanselman's Blog"/></a>
</p>
</div>

I'll get a nice signature every time I start a message, and I can, of course, configure Outlook to include this signature on new emails and another, smaller one, on replies.

Making it Consistent

Barry Dorrans reminded me of the old USENET Standard for Signatures:

It's interesting to note you forget the "standard" signature prefix, two hyphens, a space and a newline which the better email clients (read "Not outlook") use to strip a signature when you hit reply. And of course there's the old usenet standard of no more than 4 lines (unless you're Biff). See http://en.wikipedia.org/wiki/Signature_block for details

And this whole thing got me thinking about which kinds of Signatures I would need. I came up with three.

First Message

This is my standard signature when it's the First Message in a thread. It includes the standard double hyphen, my Name, Title and Company, and currently an animated gif with my picture and my last few blog posts. As a public-facing person at my company with a largely work-appropriate blog, this is reasonable for me.

The picture, while it might seem self-serving, in my opinion makes work and personal email more personal. Folks like those we're currently merging with know my face before they meet me. I've started to notice others doing the same thing, especially in MSN Messenger.

--
Scott Hanselman - Chief Architect - Corillian Corporation

Scott Hanselman's Blog

All Replies

For replies, the picture is removed, and the standard sig is just two lines via the USENET de-facto standard.

--
Scott Hanselman - Chief Architect - Corillian Corporation

On my Blackberry the signature looks like

--
Scott Hanselman - Chief Architect - Corillian Corporation from my BlackBerry

...so folks know I'm on a mobile device and realize that I won't be able to see some embedded rich content.

Replies including Free/Busy Information

This FreeBusy signature is one I use optionally when folks are scheduling meetings or helping schedule meetings across companies.

--
Scott Hanselman - Chief Architect - Corillian Corporation
NOTE: My Calendar is at (small private URL here)

The "small private URL" is a redirect from my site to the Microsoft Office Free/Busy Service that lets folks see my availability for meetings.

 

You can easily publish just your Free/Busy information to any WebDAV server or to Office Free/Busy. Consumers, either publicly or invited, can subscribe to your ICS calendar (see my recent podcast on this subject) or just view the calendar and schedule appropriately.

The signatures are easily interchangeable using the new Signature dropdown in the Outlook New Message Ribbon. Signatures are actually swapped out rather than appended; that's a very nice usability touch by the Office team.

All of these things combined means considerably fewer headaches for me in my everyday Outlook life.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

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