A pedant that hangs out in the dark corner-cases of the web.

Tuesday, November 17, 2009

What's in your (Windows) path?

perl -le "@x=split/;/,$ENV{PATHEXT};for(split/;/,$ENV{PATH}){print;next unless chdir$_;print qq'\t'.join(qq'\n\t',map{<*$_>}@x)}"

This one-liner will list all executables currently in your path, so you can decide if maybe you want to trim that path a bit, maybe by transferring a few things to doskey macros.

If you add doskey macros, be sure to add a new string value to HKEY_CURRENT_USER\Software\Microsoft\Command Processor called Autorun with the data C:\WINDOWS\system32\doskey.exe /macrofile=macrofile.

Friday, November 06, 2009

Netflix Vista Media Center Plugin Broken. Again.

I wonder if the plugin now only supports the brand-new Windows 7, or if this is just buggy, buggy code. Was this broken by one of the near-daily patches Vista has been insisting on lately? Should I start second-guessing Microsoft patches, in case they downgrade functionality, similar to the way iTunes does?

Without Netflix in VMC, I have to decide whether to go back to Mythbuntu (auto commercial skip and better music playlists) or not. It's a shame after all those reinstalls it took to get the 'mature' Vista OS working. But then again, it'd be nice to be able to print again—my print server, which works fine under Linux, is no longer supported under Vista, so I'm supposed to replace it, even though it works fine. Not to mention that not one of my dozen or so gaming controllers works under Vista (or 7, for that matter).

Thursday, September 10, 2009

My current media center

So I have been forced, against my will, to install Windows on my television PC in order to see the Netflix online content I pay for.

I've fought countless Windows bluescreens in the process of setting this up (more on those in a later post), been frustrated by Windows Update failing and leaving my system in an un-update-able state, and been puzzled by Windows' consistent inability to recognize my network devices on any home computer I've set up in the last decade (I always end up booting into Linux to get the network drivers to spoon-feed to Windows). I even found out that switching the Media Center theme to "high visibility" irrevocably breaks the "Internet TV beta".

I have, however, come up with a decent list of software if you must put Windows on your TV:

  • Windows Media Center (it probably came with your Windows edition)
  • the Netflix plugin for WMC (the logo should be in WMC already, and will link to the download site)
  • Boxee alpha, a neat open-source media center with scores of plug-ins full of content (it's cross-platform if you don't have to use Windows)
  • hulu Desktop, another media center, just for hulu content (hulu hates Boxee for some reason, and must not have signed a multi-million dollar deal to become a Microsoft parner to show up in Media Center by default)
  • Steam, the iTunes of computer games
  • Google Earth just looks very cool on a big TV

Tuesday, August 18, 2009

Highlighting Text or Fields in Windows

How does Windows always incorrectly guess whether I want a field (such as a browser address bar) fully selected when I click it? It must use a similar algorithm to how it incorrectly judges when to suddenly highlight entire words when that is not my intention.

This is what I get for not using the keyboard exclusively, I guess.

Tuesday, August 11, 2009

Why are people still using IE6?

Dean Hachamovitch has an article, IEBlog : Engineering POV: IE6, on the IEBlog, about IE6's continued use. Basically, many IE6 users think it works fine for them, and don't see a reason to upgrade (note to malware authors: these people and IT departments should be easy exploits for some time yet).

Yes, keep "users in control of their PCs" (I assume this means Microsoft will allow me to uninstall their DRM layer in Windows 7?).

This does not mean people should have the expectation that the entire Internet should support Netscape 1.0, Lynx, WebTV 1.0, or MSIE 6. The Internet evolves (as do the security threats). If users want a static environment, they should go pick up a CD-ROM encyclopedia from 1992.

Sure, if a company wants to cater to the IE6 audience, they should spend the time, but I'd bet that someone unwilling or unable to upgrade to a secure web browser isn't as likely to be profitable enough to justify all of the extra work that requires.

I do have to observe that since Microsoft has lived by inertia, the reason IE usage grew for so long, and the reason Windows has utterly dominated for so many years, that it's refreshing to see them cursed by inertia, having to support Windows XP and IE6 for years to come.

Microsoft won't be able to kill XP/IE6 any more than the financial industry has been able to completely kill COBOL.

Tuesday, July 28, 2009

Internet Explorer User Agent Spam

Update: No more! IEBlog : Introducing IE9’s User Agent String

  • Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
  • Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; Embedded Web Browser from: http://bsalsa.com/; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30618; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)
  • Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; IEMB3; Windows-Media-Player/; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; eMusic DLM/3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; WWTClient2; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; IEMB3; AskTB5.3)
  • Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; MSN Optimized;US; .NET CLR 3.0.04506.648; Zune 3.0; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSN Optimized;US; AskTB5.4)
  • Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Comcast Install 1.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; Media Center PC 3.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)

Why are the .NET CLR details cluttering up the user agent string? I can't figure out how the information is relevant in the web environment.

We've got user agent strings pushing past FOUR HUNDRED CHARACTERS in length.

If Microsoft is trying to communicate browser capabilities, there's a header for that: HTTP Accept.

The same goes for Zune, MSN Optimized, Media Center PC, InfoPath, OfficeLiveConnector, OfficeLivePatch, and MSN Optimized, and probably dozens of others.

Microsoft is filling up our logs, and congesting the tubes with what can only be considered SPAM.

My web logs are not the place for Microsoft advertising!

Also: It's past time to get rid of the "Mozilla/4.0 (compatible;" nonsense.

I propose a protest: include the three longest MSIE user agent strings from your server logs at the top of all comments and communications to Microsoft.

Tuesday, July 07, 2009

Web-based UML diagramming apps

If you need to quickly create a UML diagram, I've found a couple of sites provide a simple way to convert simple text representations into nice, attractive UML diagrams.


This site is great for creating UML sequence diagrams.

Alice->Bob: Authentication Request
note right of Bob: Bob thinks about it.
Bob-->Alice: Authentication Response
WebSequenceDiagrams.com example


yUML.me easily creates both class and use case UML diagrams.

[Order]++1-items >*[LineItem]
yUML class diagram example
yUML use case diagram example

For more, see my diagram bookmarks.

Wednesday, July 01, 2009

Best Registry Hack Ever: MaximizeApps

This registry hack maximizes windows by default when they open! For years, I've been using a superfluous freeware program for this. I wish I'd known about this much sooner, or that Microsoft had provided some UI for this option (at least in the old TweakUI).

Windows Registry Editor Version 5.00


Update: Here's how to set it in PowerShell ( ` is the line-continuation character):

New-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer `
-Name MaximizeApps -Value 1 -PropertyType DWORD

Wednesday, June 10, 2009

Easy XML serialization of complex objects with C# 3.0

C# 3.0 Update! If you've got complex, XML-serializable objects you'd like to trace easily, such as SOAP objects, here's a handy way to dump their contents to an XML string:

using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

public class XmlExporter
  /// <summary>
  /// Serialize an object as an XML string.
  /// </summary>
  /// <param name="o">The object to serialize.</param>
  /// <param name="defaultNamespace">The default XML namespace of the object (to supress noisy namspaces).</param>
  /// <returns>The object, serialized as an XML string.</returns>
  public static string ToString(object o, string defaultNamespace)
    if (o == null) return "<NULL />";
    var utf8 = new UTF8Encoding(false);
    using (var ms = new MemoryStream())
    using (var x = new XmlTextWriter(ms, utf8) {Formatting = Formatting.Indented})
      var xs = String.IsNullOrEmpty(defaultNamespace)
        ? new XmlSerializer(o.GetType())
        : new XmlSerializer(o.GetType(), defaultNamespace);
      xs.Serialize(x, o);
      return utf8.GetString(ms.GetBuffer(), 0, (int) ms.Length);

Tuesday, June 09, 2009

Lye Service: A SOAP service that uses XML strings rather than objects

I've decided on a name for SOAP services that use XML strings for input and output rather than objects: Lye Services.

These services completely miss the point of the SOAP overhead, which is to hide the obnoxious XML string manipulation in the SOAP layer, to avoid the tedious and error-prone process of building XML strings manually via concatenation or templates. This means you get all of the drawbacks of SOAP (high network overhead, heavy library dependence, XML serialization load) without any of the benefit (a complete service description; straightforward updating; working with objects and not worrying about XML strings, serialization, de-serialization, and validation).

The result is a service definition that is not complete: the schema and documentation for the XML to input is elsewhere, usually out-of-band, that does not automatically update when the service is updated.

Worse still, these POX-y services often omit a schema for the input XML that could be used to generate or validate the XML before sending it to the service, making the process much more error-prone. Sometimes the service is so poorly specified or documented that the developer is forced into tedious trial and error to figure out the appropriate input.

Thus, "Lye", an archaic and harsh soap that homophonetically implies an untrue implementation.

When encountering a Lye Service, it's worth asking whether a more structured approach (objects, rather than XML strings) could be used. If not, REST may be a better fit than SOAP.

Monday, June 01, 2009

Remembering IE databinding

I was recently thinking about Internet Explorer 4's HTML data binding support, and it occurs to me that it is similar, at least superficially, to ASP.NET AJAX 4.0 declarative data controls. Where they differ tells a story about the difference between Microsoft 1997 and Microsoft 2009.

MSAJAX doesn't demand IE loyalty, or pretend that other web browsers do not exist.
Generalized framework
Rather than play whack-a-mole with very specific features built in at the browser level, MSAJAX is extensible by ordinary web developers.
Databinding had some issues it could never really overcome, in that it was essentially sending SQL straight from the client to the database server. MSAJAX naturally shows a great deal of maturity in anticipating security problems.
Microsoft, in recent years, clearly values standards more than it did back in the days of browser-war HTML-extensions, using normal XML/HTML/CSS2.1/REST to continue to advance the web platform.

Friday, March 27, 2009

IE8 has a find bar

IE8 finally has a find bar like everyone else.

No CSS border-radius support, though. :(

Monday, March 23, 2009

Mean Date Measures

  • 365.2425 mean days per Gregorian year
  • 30.436875 mean days per month
  • 52.1775 mean weeks per year
  • 4.348125 mean weeks per month
  • 260.8875 mean weekdays per year
  • 21.740625 mean weekdays per month
  • 250.8875 mean US workdays per year (mean weekdays minus ten federal holidays)
  • 20.90729166 mean US workdays per month

Thursday, March 19, 2009

IE8 Accelerators

Is it just me, or are IE8's Accelerators very similar to IE6's Smart Tags or context menu extensions? I guess it isn't just me.


IE8 has...
  • an awesome bar, like Firefox
  • native, automatic color-coded tabs, like the Firefox extension
  • Chrome-style tab process isolation
  • CSS 2.1 support (full?)
  • "Accelerators"
  • Web Slices
  • images in search box suggestions ("Visual Search")
All of the sudden, Microsoft is talking a lot of smack about CSS 2.1 support in those other browsers.

VS2010 Web.config transforms

Oh great, another XML transform language. Hopefully, everyone will make one suited to their niche, so knowledge won't be too portable. The reason? It's smaller. So I guess Microsoft will be switching all of their development efforts to APL or Perl, then?

Wednesday, March 18, 2009

T24F The Microsoft Web Sandbox

  • first gen: Facebook JS (FBJS), AdSafe
  • second gen: Caja, FBJS2
  • ECMA TC-39 Security Working Group
  • provides W3C standard DOM support for even IE browsers
  • provides isolation for 3rd party scripts (3JS)
  • provides QoS checking for 3JS (only the embedded [div] portion fails or times out)
  • allows integration into rest of page (not absolute isolation)
  • JSVM script, 3JS transform service converts 3HTML or 3JS into a JSON closure that intercepts all DOM namespace lookups
  • virtual title and status bar for the hosting element
  • Apache License
  • well-formed HTML only
  • no document.write()
  • no eval()
  • no JS with statement
  • debug complexity
  • performance penalty

MIX09 Keynote: Scott Guthrie

  • ASP.NET MVC 1.0
  • ASP.NET 4.0
  • VS 2010: parallel web.config files (Web.Test.config, Web.Release.config)
  • Microsoft Web Platform Installer
  • Windows Web App Installer/Gallery
  • Azure Services Platform
  • Silverlight 3: people are totally using it! (NetFlix, NBC Olympics), GPU hardware support, codec support (H.264, AAC, MPEG-4)
  • Expression Web 3
  • Expression Blend 3: SketchFlow, Photoshop/Illustrator import, source control
  • Eclipse support for Silverlight
Several guests, including Joel and Jeff from StackOverflow.com.

MIX09 Keynote: Bill Buxton

  • "return on experience"
  • it's not the product, it's the experience"
  • the industrial designers from the 1920s are analogous to modern UX designers
  • Post-Its® for sequence design (like Dmitri Martin)
  • transitions are the most important part of state transition diagrams

Tuesday, March 17, 2009

StackOverflow podcast live at MIX09

Joel and Jeff (left to right) discussing (in what should show up as SO podcast #46) data formats, the importance and peril of understanding technical historical context for programmers, and chopping off the ends of the meatloaf.

MIX09 at the Venetian

Pardon the horrible quality of the photos. My "camera" is just barely a phone, much less a camera.

Yep, they dyed the "Grand Canal" at the Venetian green for St. Patrick's Day.

MIX09 swag (initial)

Not pictured: a fairly innocuous black tote bag (a welcome change from the white-tarp-purses from last year), and a black T-shirt. No berets this year (yet).

Will Microsoft release IE8 at MIX09? | Hubdub

Tuesday, March 03, 2009

A warm, moist USB coccoon

Mummify yourself with USB warmers:

Plus, there seem to be a huge amount of USB mug warmers:

It's almost as if sticking a heating element on a 5V power supply isn't all that difficult.

Also, there must be quite a few cold offices out there.

Friday, February 27, 2009

New MCE Remote: nmediapc HTPCKB

My new 2.4GHz RF Wireless Keyboard with Track Ball & Remote Combo Set is intended for a Windows MCE system, but my intent is to get it working with my MythTV setup. So far, only a few buttons on the remote work with Mythbuntu (the keyboard is just a wireless USB keyboard), but here are the details I've gathered so far:

Button showkey showkey -s xev
☒ Close 56+62 38 36 B8 BE (closes xev)
Power 142 E0 5F E0 DF
My Music
My Picture [sic]
My Video
Live TV
Recorded TV
Guide 362
DVD Memu [sic]
MCE Button 56,125,28 38 B8 E0 5B E0 DB 1C 9C Alt_L,Super_L,Return
Volume + 115 E0 30 E0 B0
Volume - 114 E0 2E E0 AE
Channel + 104 E0 49 E0 C9 Prior
Channel - 109 E0 51 E0 D1 Next
OK / Enter 28 1C 9C Return
← Back / Clear 14 0E 8E BackSpace
i Info 130 E0 06 E0 86 SunProps
103 E0 48 E0 C8 Up
106 E0 4D E0 CD Right
108 E0 50 E0 D0 Down
105 E0 4B E0 CB Left
○ Record 29+19 1D 13 9D 93 Control_L+p
■ Stop 166 E0 24 E0 A4
▶/▮▮ Play/Pause 164 E0 22 E0 A2
◄◄ Rewind 168 E0 18 E0 98 XF86AudioRewind
►► Fast Forward 208 E0 34 E0 B4 XF86Forward
|◂ Previous 29+48 1D 30 9D B0 Control_L+x
▸| Next 163 E0 19 E0 99
Mute 113 E0 20 E0 A0
1 79 4F CF KP_End
2 80 50 D0 KP_Down
3 81 51 D1 KP_Next
4 75 4B CB KP_Left
5 76 4C CC KP_Begin
6 77 4D CD KP_Right
7 71 47 C7 KP_Home
8 72 48 C8 KP_Up
9 73 49 C9 KP_Prior
* 55 37 B7 *
0 82 52 D2 KP_Insert
# 42+4 2A 04 AA 84 #
Num Lock 69 45 C5 Num_Lock
Clear / ← Back 14 0E 8E BackSpace
Enter / OK 28 1C 9C Return

The keyboard and mouse are a step up from my previous setup, since they are both RF rather than IR, and the remote is considered a keyboard, so no lirc configuration is needed. Best of all, there is a trackball in the remote, so I don't need to drag out the keyboard to watch web TV.

Wednesday, February 04, 2009

Show your Google Calendar in your sidebar (without a separate file)

Update: I guess it would just be easier to simply bookmark the URL in the src attribute after step 2, and mark that to load in the sidebar.

Inspired by the Lifehacker article Step By Step: Display Your GCal Agenda in Firefox's Sidebar, I've improved the process by using a data: URL instead of an external file.

  1. In Google Calendar, go to Settings for your calendar, then click the "Customize the color, size, and other options" link to enter the calendar customization tool.
  2. Choose "Agenda" View, and otherwise configure the calendar however you wish. Just leave the height and width at the default values.
    Configure the embedded calendar
  3. Copy the HTML code.
  4. Head over to The data: URI kitchen and paste in the HTML code.
  5. Make the following changes:
    • Check the "base 64" checkbox.
    • Change src="// to src="http://
    • Paste the following just after scrolling="no" and just before ></iframe>:
      onload="var c=this;c.style.height=window.innerHeight-16;c.style.width=window.innerWidth-16;c.onload=null;window.onresize=function(){c.style.height=window.innerHeight-16;c.style.width=window.innerWidth-16;}"
  6. Click the Generate button.
  7. Your calendar should appear, filling the page. Bookmark it.
  8. In the Properties for this bookmark, check the "Load this bookmark in the sidebar" checkbox.

Now, you can just click the bookmark to open the Google Calendar in your sidebar!