urn page 11 - Dave's Blog

Search
My timeline on Mastodon

SequelGuy's Burnout Paradise Profile

2008 Feb 18, 12:38My profile for Burnout Paradise.PermalinkCommentsproldfile game xbox ea me

Learning America Smarter: Northern European Geography 101 (Diesel Sweeties Newsblog - Blog Archive)

2008 Feb 8, 11:21FTA: "I was quite troubled to realize today that I couldn't list ten major differences between Sweden and Norway. All my best Livejournal pals lent a hand and we came up with this not-entirely-comprehensive list."PermalinkCommentsmap humor via:boingboing norway sweden europe geography information visualization

HEMA - online winkelen

2008 Feb 6, 11:15A flash animated advertisement that starts as a regular website but turns into a kind of Rube Goldberg. I especially appreciate the automated scrolling.PermalinkCommentsadvertising animation art flash browser

Make3D --- convert your image into 3d

2008 Jan 30, 1:15Turns photos into 3D environments.PermalinkCommentsvia:swannman 3d photo tool standford

Crossing Four Way Stops Fast and Searching Closed Caption MCE Videos: More Stolen Thoughts

2008 Jan 22, 9:56

More ideas stolen from me in the same vein as my stolen OpenID thoughts.

Fast Pedestrian Crossing on Four Way Stops. In college I didn't have a car and every weekend I had weekly poker with friends who lived nearby so I would end up waiting to cross from one corner of a traffic lit four way stop to the opposite corner. Waiting there in the cold gave me plenty of time to consider the fastest method of getting to the opposite corner of a four-way stop. My plan was to hit the pedestrian crossing button for both directions and travel on the first one available. This only seems like a bad choice if the pedestrian crossing signal travels clockwise or counter clockwise around the four way stop. In those two cases its better to take the later of the two pedestrian signal crossings, but I have yet to see those two patterns on a real life traffic stop. I decided recently to see if my plan was actually sound and looked up info on traffic signals. But the info didn't say much other than "its complicated" and "it depends" (I'm paraphrasing). Then I found some guy's analysis of this problem. So I'm done with this and I'll continue pressing both buttons and crossing on the first pedestrian signal. Incidentally on one such night when I was waiting to cross this intersection I heard a loud multi-click sound and realized that the woman in the SUV waiting to cross the intersection next to me had just locked her doors. I guess my thinking-about-crossing-the-street face is intimidating.

Windows Searching Windows Media Center Recorded TV's Closed Captions. An Ars-Technica article on a fancy DVR described one of the DVRs features: full text search over the subtitles of the recorded TV shows. I thought implementing this for Windows Media Center recorded TV shows and Windows Search would be an interesting project to learn about video files, and extending Windows Search. As it turns out though some guy, Stephen Toub implemented Windows Search over MCE closed captions already. Stephen Toub's article is very long and describes some other very interesting related projects including 'summarizing video files' which you may want to read.

PermalinkCommentsstolen-thoughts windows search mce windows traffic closed captions four-way-stop windows-media-center

HIMAGELIST Stream Size

2008 Jan 12, 2:26If you're like me you need to serialize an object that contains an HIMAGELIST via IMarshal for COM's marshalling. I could use ImageList_Write to actually write the HIMAGELIST to a stream for IMarshal::MarshalInterface, but I needed to know the size of the data that I was going to write for IMarshal::GetMarshalSizeMax. I thought I'd use HIMAGELIST_QueryInterface to get an IPersistStream pointer which works, but alas its implementation of IPersistStream::GetMaxSize just returns E_NOTIMPL. Ultimately I called ImageList_Write on a special stream that ignores the data passed to it and just records how much data is written to it. In this fashion I could get the size the HIMAGELIST would require when written to a stream.PermalinkCommentstechnical himagelist boring serialize imarshal com

IPv6 Roundup: Address Syntax on Windows

2008 Jan 9, 11:34

IPv6 address syntax consists of 8 groupings of colon delimited 16-bit hex values making up the 128-bit address. An optional double colon can replace any consecutive sequence of 0 valued hex values. For example the following is a valid IPv6 address: fe80::2c02:db79

Some IPv6 addresses aren't global and in those cases need a scope ID to describe their context. These get a '%' followed by the scope ID. For example the previous example with a scope ID of '8' would be: fe80::2c02:db79%8

IPv6 addresses in URIs may appear in the host section of a URI as long as they're enclosed by square brackets. For example: http://[fe80::2c02:db79]/. The RFC explicitly notes that there isn't a way to add a scope ID to the IPv6 address in a URI. However a draft document describes adding scope IDs to IPv6 addresses in URIs. The draft document uses the IPvFuture production from the URI RFC with a 'v1' to add a new hostname syntax and a '+' instead of a '%' for delimiting the scope id. For example: http://[v1.fe80::2c02:db79+8]/. However, this is still a draft document, not a final standard, and I don't know of any system that works this way.

In Windows XPSP2 the IPv6 stack is available but disabled by default. To enable the IPv6 stack, at a command prompt run 'netsh interface ipv6 install'. In Vista IPv6 is the on by default and cannot be turned off, while the IPv4 stack is optional and may be turned off by a command similar to the previous.

Once you have IPv6 on in your OS you can turn on IPv6 for IIS6 or just use IIS7. The address ::1 refers to the local machine.

In some places in Windows like UNC paths, IPv6 addresses aren't allowed. In those cases you can use a Vista DNS IPv6 hack that lives in the OS name resolution stack that transforms particularly crafted names into IPv6 addresses. Take your IPv6 address, replace the ':'s with '-'s and the '%' with an 's' and then append '.ipv6-literal.net' to the end. For example: fe80--2c02-db79s8.ipv6-literal.net. That name will resolve to the same example I've been using in Vista. This transformation occurs inside the system's local name resolution stack so no DNS servers are involved, although Microsoft does own the ipv6-literal.net domain name.

MSDN describes IPv6 addresses in URIs in Windows and I've described IPv6 addresses in URIs in IE7. File URIs in IE7 don't support IPv6 addresses. If you want to put a scope ID in a URI in IE7 you use a '%25' to delimit the scope ID and due to a bug you must have at least two digits in your scope ID. So, to take the previous example: http://[fe80::2c02:db79%2508]/. Note that its 08 rather than just 8.

PermalinkCommentsroundup ip windows ipv6 technical microsoft boring syntax

Windows Media Center and Zune Integration Hack

2007 Nov 28, 1:23One of the new Zune features that had me the most excited was the claimed improved Windows Media Center integration which unfortunately turned out to simply mean support for the Win MCE video format (with an exception for HD). I wanted to be able to pick shows recorded by my Win MCE and have the Zune automatically sync up the latest episodes. However, with the improved podcast support in the Zune software one can easily create a ridiculous hack to accomplish this.

The new Zune software has podcast support which does everything I'd want to do with a Win MCE recorded TV series so the goal is to shoehorn a TV series into a Zune podcast. An overview of the steps: Create an XSLT that converts Win MCE data to a podcast, run the XSLT as a scheduled task every few hours per TV series, setup a Web server pointed at the resulting podcasts and the Win MCE Recorded TV directory, and subscribe to the resulting podcasts in the Zune software.
  1. Reading through the Win MCE data stored as an XML file in "C:\ProgramData\Microsoft\eHome\Recording\Recordings.xml" and the spec for podcasts I created an XSLT to convert a series from Win MCE data to a podcast.
  2. I added a new task to the Scheduled Tasks to run my XSLT using my xsltproc.js script. The task runs a handful of commands that look something like the following:

    C:\windows\system32\wscript.exe C:\users\dave\bin\xsltproc.js C:\Users\Dave\Documents\trunk\development\mce-zune\mce-to-podcast.xslt C:\ProgramData\Microsoft\eHome\Recording\Recordings.xml --param title "The Daily Show With Jon Stewart" --param max 4 --param baseURI "http://groucho/" --param thisRelURI "tds.xml" -o "D:\recorded tv\tds.xml"

    For each TV series I run a command like the above and that outputs a podcast for that series into my "D:\Recorded TV\" directory.
  3. Zune only allows http URIs for its podcasts so I installed a web server on my Win MCE server. I'm running Vista Ultimate so it was quick and easy for me to install IIS7 but any Web server will do. Then I pointed it at "D:\Recorded TV\".
  4. Once all the above was done I just subscribed to the resulting podcasts via my Web server and viola! Since I'm forced to use a Web server I can even run the Zune software on a machine other than my Win MCE server. You can see a screen-shot above of my Zune software showing my Colbert Report podcast.
PermalinkCommentstechnical xml mce hack windows media center zune windows xslt podcast

Angie and Kane Went Away

2007 Nov 19, 12:35Angie and Kane Go Away PartyTwo weekends ago I went down to California for Angie and Kane's going away party. It was fun despite going to a country western club. It was a very large place with plenty of space for line dancing, a dentist chair turned into a make-margaritas-in-your-mouth chair, and of course a mechanical bull. Surprisingly, I did not fit in.

Jon's Go Away PartyThis past weekend Sarah and I went to the EMP and SciFi Museum. The last time I was there was for the Star Trek convention (I'm cool) and Sarah hadn't been before. We also ate in the attached diner which was acceptable.PermalinkCommentsemp seattle nontechnical

Annoyances.org - Comment about 'Turn Off the PC-Speaker' (Windows XP Discussion Forum)

2007 Nov 12, 1:15How to turn off the PC speaker in Windows.PermalinkCommentsaudio tips howto pc-speaker sound windows beep setupnewcomputer

Bad Science

2007 Oct 29, 1:48FTA: "Ben Goldacre is a medical doctor who writes the Bad Science column in the Guardian, examining the claims of scaremongering journalists, quack remedy peddlers, pseudoscientific cosmetics adverts, and evil multinational pharmaceutical corporations. ThPermalinkCommentsmonthly blog science politics religion media news healthy research humor

Brief Miscellany

2007 Oct 29, 7:07Two brief updates to previous posts:

  1. I noted that I had a new entry on the IE blog. Some comments on the IE blog have recently been rude in their request for information on future versions of IE. For example see the first two comments responding to my post. Feeling bad about that I looked at my posts entry on delicious and saw the following:

    "This is the first blog from the IE team that I have found rigorous and informative. I skipped to the bottom to find it was written by one of the TA's from my first class at Cal Poly."

    That made me feel a bit better and I was able to catch up with someone from college. Thanks Kris!

  2. I previously had my GPS set with an Australian accent. When it encountered 'WA', as in the abbreviation for Washington in freeway exits, it pronounced it 'Western Australia'. Now I've got it with a British accent and WA is just 'W.A.' but when I tell it to drive to 'MS', the name of my saved location for work, it pronounces it 'Manuscript'.
PermalinkCommentsmicrosoft blog gps personal nontechnical

Portal is fun; the cake is a lie!

2007 Oct 22, 4:47I purchased the Orange Box off of Steam a bit ago and like others before me who have discussed elsewhere, I already owned two of the five games that come from the Orange Box. However, the combined price of HL2E2 and Portal, the two games I actually wanted was supposedly equivalent to the price of the Orange Box bundle. Incidentally, if anyone would like HL2 or HL2E1 I can gift them to you.

HL2E2 was excellent of course but the big surprise for me was Portal. (Mild spoilers follow) It has a sort of zen simplicity: there are a few simple game-play mechanics, a handful of textures and objects, and a deceptively simple story all used well and tied together to produce an entertaining and polished game. It seems a bit short but its probably better to end with the gamer demanding more. The humor and the sort of play within a play aspect of the game is what really sold me though. It has the funniest ending theme I've heard (also blogged by the creator). The voices of the automated turrets are so adorable I would feel compelled to hug them if they weren't always trying to kill me. Additionally the weighted companion cube seems like an experiment in understanding gamers' attachment to NPCs. In this case the NPC is a box and yet I still felt awful incinerating it. The whole time I was vaguely reminded of Solitary the reality show that sticks contestants alone in small rooms forcing them to endure various tests all the while being watched by a humorous computer with a female voice. Someone should sue...

RPS has articles on Portal including a Portal review, a page suggesting Portal is a tale of lesbianism, and others.PermalinkCommentshl2e2 game hl2 solitary valve portal nontechnical

FoaF on my Homepage

2007 Oct 14, 3:12I've updated my homepage by moving stuff about me onto a separate About page. Creating the About page was the perfect opportunity to get FoaF, a machine readable way of describing yourself and your friends, off my to do list. I have a base FoaF file to which I add friends, projects, and accounts from delicious using an XSLT. This produces the FoaF XML resource on which I use another XSLT to convert into HTML and produce the About page.

I should also mention a few FoaF pages I found useful in doing this: PermalinkCommentstechnical xml foaf personal xslt xsl homepage

XSL Identity Transfom

2007 Oct 12, 4:08As noted in the XSL Transformations spec you can create the identity transform using the xsl:copy element. With the MSXML implementation of xsl:copy the example the spec gives produces slightly ugly elements. For instance given it produces . In order to ensure empty elements turn out pretty I've modified the example as follows:
    
        
            
                
                    
                
            
            
                
                    
                
            
        
    

This got me thinking about inverting XSLTs. Clearly in general an XSLT isn't invertible since an XSLT can completely ignore the input XML and produce something else entirely but then the above is an example of an XSLT that is invertible. So there is a subset of XSLTs that are invertible, how might you produce the inverse of an XSLT, and would this ever be useful?PermalinkCommentsxml msxml inverse xlst xsl

Why I Feel Old

2007 Oct 12, 3:20And now to fit in better with the rest of the emo kids on LJ, in no particular order here are some reasons why I feel old: PermalinkCommentspersonal nontechnical

FoaF Explorer

2007 Oct 9, 4:43A FOAF browser. It turns FOAF descriptions into HTML with links to those things described in the FOAF including links to other FOAF descriptions transformed in the same fashion.PermalinkCommentsbrowser community social foaf rdf semanticweb

Singularity IV: Return of the UI

2007 Oct 8, 3:15Microsoft Research is working on Singularity, a new managed microkernel OS.PermalinkCommentsmsdn microsoft channel9 video singularity os research csharp

XSL Transforms in JavaScript

2007 Oct 7, 4:12In a previous post I mentioned an xsltproc like js file I made. As noted in that post, on Windows you can write console script files in JavaScript, name them foo.js, and execute them from the command prompt. I later found that MSDN has an XSLT javascript sample which looks similar to mine, but I like mine better for the XSLT parameter support and having a non-ridiculous way of interpreting filenames. The code for my xsltproc.js follows. The script is very simple and demonstrates the ease with which you can manipulate these system objects and all it takes is opening up notepad.
var createNewXMLObj = function() {
   var result = new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
   result.validateOnParse = false;
   result.async = false;
   return result;
}

var args = WScript.arguments;
var ofs = WScript.CreateObject("Scripting.FileSystemObject");

var xslParams = [];
var xmlStyle = null;
var xmlInput = null;
var inputFile = null;
var outputFile = null;
var error = false;

for (var idx = 0; idx < args.length && !error; ++idx)
   if (args.item(idx) == "-o") {
      if (idx + 1 < args.length) {
         outputFile = ofs.GetAbsolutePathName(args.item(idx + 1));
         ++idx;
      }
      else
         error = true;
   }
   else if (args.item(idx) == "--param" || args.item(idx) == "-param") {
      if (idx + 2 < args.length) {
         xslParams[args.item(idx + 1)] = args.item(idx + 2);
         idx += 2;
      }
      else
         error = true;
   }
   else if (xmlStyle == null) {
      xmlStyle = createNewXMLObj();
      xmlStyle.load(ofs.GetAbsolutePathName(args.item(idx)));
   }
   else if (xmlInput == null) {
      inputFile = ofs.GetAbsolutePathName(args.item(idx));
      xmlInput = createNewXMLObj();
      xmlInput.load(inputFile);
   }

if (xmlStyle == null || xmlInput == null || error) {
   WScript.Echo('Usage:\n\t"xsltproc" xsl-stylesheet input-file\n\t\t["-o" output-file] *["--param" name value]');
}
else {
   var xslt = new ActiveXObject("MSXML2.XSLTemplate.3.0");
   xslt.stylesheet = xmlStyle;
   var xslProc = xslt.createProcessor();
   xslProc.input = xmlInput;

   for (var keyVar in xslParams)
      xslProc.addParameter(keyVar, xslParams[keyVar]);

   xslProc.transform();

   if (outputFile == null)
      WScript.Echo(xslProc.output);
   else {
      var xmlOutput = createNewXMLObj();
      xmlOutput.loadXML(xslProc.output);
      xmlOutput.save(outputFile);
   }
}
PermalinkCommentsjs xml jscript windows xslt technical xsltproc wscript xsl javascript

Date Time Formats

2007 Sep 27, 2:17Starting on a new simple project I wanted to get the history of my Delicious links. Delicious has an export tool available via the settings section so I thought I'd try that. However, the links aren't exported in XML not even in XHTML but rather in HTML. Shocking. An example:
"Don't Tase Me, Bro!" (UF Student Tasered Remix)
Remix of the 'Don't tase me, bro!' guy getting tasered.At this point I'm already not going to use this file because its in HTML but I'm even more disgusted by those date time values. Raymond Chen of the Old New Thing posted about recognizing timestamps and timestamp sentinel values. From the first blog post and with the use of a calculator for base conversion one can tell that those are UNIX style timestamps counting the number of seconds since 1970.

It reminds me of my hatred for the MIME date time format I developed working on my webpage's server side parsing of atom and RSS. Atom is of course my favorite as Atom uses the Internet date time format described in the following documents. Here's an example of one 2007-09-27T020:50:00.000-08:00 On the other hand the evil and villainous RSS uses the MIME date time format now described in the more recent IETF MIME standard. Here's an example Thu, 27 Sep 2007 20:50:00 -0800
The Internet date time format has the advantage of being so easy to sort. An alphabetic sort with normal C-style collation rules of strings containing Internet date times will also sort them chronologically. This is not the case for the MIME date time due to the preceding day of the week and the spelled out month name. This also means that when producing these you have to figure out the day of the week and when parsing them you have to match month names rather than just parsing out numbers. Anyway now days if I see mention of a date time in a new proposed standard or spec I be sure to point out the numerous advantages of the Internet date time format.
PermalinkCommentsdate xml html feed time technical date-time code atom rss
Older EntriesNewer Entries Creative Commons License Some rights reserved.