Scott Hanselman

DeskSpace - Beryl-like 3D Cube Virtual Desktop Manager for Vista

September 18, '07 Comments [23] Posted in Reviews | Tools
Sponsored By

Oh HELL ya. My buddy James at OtakuSoftware has done it again with DeskSpace. You remember him from TopDesk fame. He's back and it's insane.

UPDATE: I talked to the author, James, and he points out (and in the comments also) that he bought Yod'm a while back. It's posted in his forums also, so it's common knowledge I missed. However, DeskSpace is NOT a repackaging of Yod'm (I can attest to that, since I've been beta testing it for weeks) but rather the Next Version. The 3D Desktop code is an enhanced version of TopDesk, only the options dialog remains of Yod'm. The shared heritage was posted on DeskSpace for a while (Google Cache). It's all clear to me now. Sorry if I misrepresented things, it was only due to my own ignorance. It is a sweet app, though.

It's a Beryl-like 3D Cube Virtual Desktop App. I can talk about it all day, but a video (captured from my own computer) is worth a thousand words. What a great tool with a pile of configurable options. I've been running it across three monitors for about two weeks and it is surprisingly useful.

Go. Get. It.

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

PNP Summit 2007 - One of these things doesn't belong

September 18, '07 Comments [43] Posted in Microsoft | Speaking
Sponsored By

This November 5-9, I'll be playing the famous Sesame Street children's game "One of These Things Is Not Like The Others" at the Patterns & Practices Summit on the Microsoft Campus.

Let's play now together, shall we?

The next patterns & practices Summit takes place November 5 - 9 in the Kodiak Room at the Microsoft Conference Center at Microsoft's main campus in Redmond, Washington.

Keynote presentations by:
Anders Hejlsberg, Steve McConnell, Scott Guthrie, Scott Hanselman, & John Lam

OK, seriously. Anders? Steve FREAKING McConnell? (He's literally changed his middle name to FREAKING just for this blog post.) Scott "My Boss's Boss" Guthrie? Family Friend and IronRuby Wonk Dr. John Lam?

SusanthesethingsIs it the head tilt that makes me odd man out? Possibly. Perhaps the "senior class photo" use of sepia tone? Maybe. The giant fore-fivehead? No comment there, lets just say I am hair-plug and hairpiece free as of the time this writing.

Perhaps the fact that I've never created a programming language? Or several. Possibly never written a genre-changing book? Or several. Possibly that I've never shipped or managed the shipping of a Microsoft Product? Or several. Or, maybe because I haven't got a PhD in biochemistry? Oh. What have I gotten myself into? The humanity!

I can only assume I was invited in the "Ze Frank" sense of invited, to provide social commentary and wit. Of course, lacking both, I need your help, Dear Reader. Which of these presentation ideas that I've been kicking around should I do?

Brainstorming Topic Ideas
  • It's Not That Scary - Remember that you do in fact know .NET 2.0 and even though 3.0 and 3.5 seem scary, we have the tools and knowledge it'll take to pick up these complementary technologies quickly.
  • MVC ASP.NET Frameworks - Why things like Monorail and the new MVC ASP.NET Framework from DevDiv should matter to Developers
  • ALT.NET - What is the ALT.NET movement and why should the average developer coding on .NET care?
  • Free VS2008 3rd Party Tools - The best of the 3rd party free utilties and tools, created by the community, that make Orcas just that much more fun to develop on.
  • LINQ in a Larger Context - How does LINQ fit into n-tier software development and OO design patterns? Does it help or hinder, pervert or promote good coding?
  • The Importance of Being IIS7 - Why IIS7 should be on the minds of developers, not just IT guys. How hard should developers push their tech leads and bosses to look at IIS7 and why will it make their lives easier?
  • Improving Your Sense of Code Smell - C# 3.0 and VB9 bring dozens of new programmatic idioms, many of which that are unfamiliar. How can we "update" our sense of code smell and know when an old familiar pattern needs a breath of fresh Anonymous Types or Explicit Conversion Operators?
  • Passion for the Craft - How does one find balance between being the best coder they can be and being the best everything else? Can everything get done at work and you still punch out at 5:01pm? What role does passion play in the life of the .NET developer?
  • The Coming Dynamic Storm (or Language Storm) - As C# 3.0 gains dynamic-like features, the DLR and no less than a dozen new dynamic language implementations from LISP to SmallTalk, Nemerle to Boo, and IronRuby to IronPython are coming into their own, not to mention F#. Is there room for 12 awesome .NET CLR-based languages? What does this mean for the C# and VB developer?
  • Mitigating the Angle Bracket Tax with LINQ to XML - Folks using XML need to take a hard look at System.Xml.Linq and their powerful bridge classes. LINQ is wonderful, we know, but the XElement and XDocument classes - independent of LINQ - provide a fresh new perspective on what working with XML should look like.
  • REST for the Rest of Us - Wait a minute? I thought WS-Security and WS-* were the future? Now WCF supports REST? Which is it and what does it mean to the developer on the front line?
  • Post RTM Tooling - What new Free Add-Ins to VS.NET 2008 will be available (around Jan/Feb) post RTM to handle interesting niche cases (like the WPF-based Visual XSD Designer) and other coolness?

At any rate, I encourage you to sign up to attend the pnpSummit. At least four of the five keynotes is likely to be quite good!

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

Launching your Web 2.0 Site with a Giant Text Box

September 18, '07 Comments [10] Posted in Musings
Sponsored By

Test1 Editing Home - Windows Internet Explorer Once again, another idea *I* didn't think of. ;) There sure are some clever people on this interweb.

Aaron Swartz has launched Jottit and the homepage is brilliant. No help, no FAQ, just a big text-box and a button.

Once you've entered, the site is a Wiki-like Web-page editor that uses Markdown rather than HTML for it's Markup. The home page is just the hook.

The site is fairly complex and even allows you to claim a subdomain. You'll start with a giant textbox, and before you realize it, you've claimed a domain, chosen colors and you've got a pretty professional looking site.

If you've got a young kid who wants to make a web page, I can't think of a better way for them to start.

Homework? As an aside for the .NET folks here, there is Milan Negovan's Markdown.NET implementation. It can be useful for applications where you want a Rich Text Experience but not a Rich Text Editor. Also, anyone can learn markup languages like Markdown...the WAF (Wife Acceptance Factor) tends to be very high. As a programming exercise, it's a simple format and I'm sure it would be a fun project for an intern to write their own Markdown->HTML or Markdown->PDF or Markdown->Word projects.

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

Google Presentations is out

September 18, '07 Comments [7] Posted in Reviews
Sponsored By

Fooling with Google Presentations - Windows Internet Explorer Google updated their Applications suite today with the addition of Google Presentation. It was added to all of docs.google.com including Google Apps For Your Domain, which is what I use for the family's docs.

It's good to know it's there if I might need it, but I'd probably just use Notepad if I needed to present in a pinch.

Cool Things

  • It initially LOOKS just like PowerPoint!
  • You can start a presentation then give folks a URL and they can join up and watch like this: View Presentation.
  • You can chat about the presentation being watched.
  • Great Revisions support - many copies are saved all the time, so you'll never lose anything.
  • Upload a PPT
  • Save as a ZIP file! They'll create a "self-contained" ZIP with a single HTML file and the assets you need to run the presentation using any browser, also Eric Meyer's S5, except with less-pretty auto-generated markup.

Meh Things

  • Can't link to pictures online, have to upload. It would be been cool to allow links to Flickr or Google Photos but that would mess up the whole "self contained" offline story.
  • No spellcheck?
  • No animations, shapes, auto-layouts, wizards, etc.
  • No line spacing? Makes bulleted lists look odd and hard to lay out.
  • Does as little as it can without actually being Notepad.exe
  • It's cool, to be clear, but it's ultra-basic. If you're interested in a PowerPoint-like experience on the web, I'd either use PowerPoint's Save As Html feature (maybe you bought a $60 copy of Office! Insane!) or take a good look at Eric Meyer's S5 XHTML Presentation System (sample).
  • JavaScript errors and other rough spots, particularly when trying to add Hyperlinks to Images.
  • You can upload PPT, but you can't Save As PPT.

It's a nice addition to Google Docs, but the flagship product is still Google Spreadsheets, in my opinion.

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

ASMX SoapExtension to Strip out Whitespace and New Lines

September 17, '07 Comments [4] Posted in ASP.NET | Web Services | XML
Sponsored By

Someone asked...

[I've got] a WebService with a WebMethod of the form.  Very Simple.

[WebMethod]
public XmlNode HelloWorld () {
                XmlDocument document = new XmlDocument();
                document.LoadXml(“<a><b><c><d>Hello World</d></c></b></a>”);
                return document;
}

What comes back is something in the response is something like

<a>
                <b>
                                <c>
                                                <d>Hello World</d>
                                </c>
                </b>
</a>

Where each level of indentation is actually only 2 characters.   I would like it to come back just like it is entered in the LoadXml call [no unneeded whitespace and no unneeded new lines.]

This is an old problem. Basically if you look at SoapServerProtocol.GetWriterForMessage, they...

return new XmlTextWriter(new StreamWriter(message.Stream, new UTF8Encoding(false), bufferSize));

...just make one. You don't get to change the settings. Of course, in WCF this is easy, but this person was using ASMX.

Enter the SoapExtension. In the web.config I'll register one.

<system.web>
    <webServices>
      <soapExtensionTypes>
        <add type="ASMXStripWhitespace.ASMXStripWhitespaceExtension, ASMXStripWhitespace"
             priority="1"
             group="High" />
      </soapExtensionTypes>
    </webServices>
...

And my class will derive from SoapExtension. There's lots of good details in this MSDN article by George Shepard a while back.

Here's my quicky implementation. Basically we're just reading in the stream of XML that was just output by the ASMX (specifically the XmlSerializer that used that XmlTextWriter we saw above) infrastructure.

using System;
using System.IO;
using System.Web.Services.Protocols;
using System.Text;
using System.Xml;

namespace ASMXStripWhitespace
{
    public class ASMXStripWhitespaceExtension : SoapExtension
    {
        // Fields
        private Stream newStream;
        private Stream oldStream;

        public MemoryStream YankIt(Stream streamToPrefix)
        {
            streamToPrefix.Position = 0L;
            XmlTextReader reader = new XmlTextReader(streamToPrefix);

            XmlWriterSettings settings = new XmlWriterSettings();
            settings.Indent = false;
            settings.NewLineChars = "";
            settings.NewLineHandling = NewLineHandling.None;
            settings.Encoding = Encoding.UTF8;
            MemoryStream outStream = new MemoryStream();
            using(XmlWriter writer = XmlWriter.Create(outStream, settings))
            {
                do
                {
                    writer.WriteNode(reader, true);
                }
                while (reader.Read());
                writer.Flush();
            }
           
            ////debug
            //outStream.Seek(0, SeekOrigin.Begin);
            ////outStream.Position = 0L;
            //StreamReader reader2 = new StreamReader(outStream);
            //string s = reader2.ReadToEnd();
            //System.Diagnostics.Debug.WriteLine(s);

            //outStream.Position = 0L;
            outStream.Seek(0, SeekOrigin.Begin);
            return outStream;
        }

        // Methods
        private void StripWhitespace()
        {
            this.newStream.Position = 0L;
            this.newStream = this.YankIt(this.newStream);
            this.Copy(this.newStream, this.oldStream);
        }

        private void Copy(Stream from, Stream to)
        {
            TextReader reader = new StreamReader(from);
            TextWriter writer = new StreamWriter(to);
            writer.WriteLine(reader.ReadToEnd());
            writer.Flush();
        }

        public override void ProcessMessage(SoapMessage message)
        {
            switch (message.Stage)
            {
                case SoapMessageStage.BeforeSerialize:
                case SoapMessageStage.AfterDeserialize:
                    return;

                case SoapMessageStage.AfterSerialize:
                    this.StripWhitespace();
                    return;
                case SoapMessageStage.BeforeDeserialize:
                    this.GetReady();
                    return;
            }
            throw new Exception("invalid stage");
        }

        public override Stream ChainStream(Stream stream)
        {
            this.oldStream = stream;
            this.newStream = new MemoryStream();
            return this.newStream;
        }

        private void GetReady()
        {
            this.Copy(this.oldStream, this.newStream);
            this.newStream.Position = 0L;
        }

        public override object GetInitializer(Type t)
        {
            return typeof(ASMXStripWhitespaceExtension);
        }

        public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)
        {
            return attribute;
        }

        public override void Initialize(object initializer)
        {
            //You'd usually get the attribute here and pull whatever you need off it.
            ASMXStripWhitespaceAttribute attr = initializer as ASMXStripWhitespaceAttribute;
        }
    }

    [AttributeUsage(AttributeTargets.Method)]
    public class ASMXStripWhitespaceAttribute : SoapExtensionAttribute
    {
        // Fields
        private int priority;

        // Properties
        public override Type ExtensionType
        {
            get { return typeof(ASMXStripWhitespaceExtension); }
        }

        public override int Priority
        {
            get { return this.priority; }
            set { this.priority = value;}
        }
    }
}

The order that things happen is important. The overridden call to ChainStream is where we get a new copy of the stream. The ProcessMessage switch is our opportunity to "get ready" and where we "strip whitespace."

If you want a method to use this, you have to add the attribute, in this case "ASMXStripWhitespace" to that method. Notice the attribute class just above. You can pass things into it if you like or override standard properties also.

public class Service1 : System.Web.Services.WebService
{
   [WebMethod]
   [ASMXStripWhitespace]
   public XmlNode HelloWorld () {
         XmlDocument document = new XmlDocument();
         document.LoadXml("<a><b><c><d>Hello World</d></c></b></a>");
         return document;
   }
}

The real work happens in YankIt where we just setup our own XmlSerializer and spin through the reader and writing out to the memory stream using the new settings of no new line chars and no indentation. Notice that the reader.Read() is a Do/While and not just a While. We don't want to lose the root node.

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.