urn page 4 - Dave's Blog

Search
My timeline on Mastodon

(via The Future by The Limousines)

2012 Feb 13, 8:16


(via The Future by The Limousines)

PermalinkCommentsbttf the-limousines music music-video video

Remember when they killed off Superman?  One of the guys behind...

2012 Feb 5, 12:37


Remember when they killed off Superman?  One of the guys behind Chronicle has made this video explaining that whole thing.  Kind of like Drunk History but less drunk and more nerdy (via Death and Return of Superman)

PermalinkCommentssuperman hero comic-book humor video

JavaScript Array methods in the latest browsers

2011 Dec 3, 6:46

Cool and (relatively) new methods on the JavaScript Array object are here in the most recent versions of your favorite browser! More about them on ECMAScript5, MSDN, the IE blog, or Mozilla's documentation. Here's the list that's got me excited:

some & every
Does your callback function return true for any (some) or all (every) of the array's elements?
filter
Filters out elements for which your callback function returns false (in a new copy of the Array).
map
Each element is replaced with the result of it run through your callback function (in a new copy of the Array).
reduce & reduceRight
Your callback is called on each element in the array in sequence (from start to finish in reduce and from finish to start in reduceRight) with the result of the previous callback call passed to the next. Reduce your array to a single value aggregated in any manner you like via your callback function.
forEach
Simply calls your callback passing in each element of your array in turn. I have vague performance concerns as compared to using a normal for loop.
indexOf & lastIndexOf
Finds the first or last (respectively) element in the array that matches the provided value via strict equality operator and returns the index of that element or -1 if there is no such element. Surprisingly, no custom comparison callback method mechanism is provided.
PermalinkCommentsjavascript array technical programming

URI Empty Path Segments Matter

2011 Nov 23, 11:00

Shortly after joining the Internet Explorer team I got a bug from a PM on a popular Microsoft web server product that I'll leave unnamed (from now on UWS). The bug said that IE was handling empty path segments incorrectly by not removing them before resolving dotted path segments. For example UWS would do the following:

A.1. http://example.com/a/b//../
A.2. http://example.com/a/b/../
A.3. http://example.com/a/
In step 1 they are given a URI with dotted path segment and an empty path segment. In step 2 they remove the empty path segment, and in step 3 they resolve the dotted path segment. Whereas, given the same initial URI, IE would do the following:
B.1. http://example.com/a/b//../
B.2. http://example.com/a/b/
IE simply resolves the dotted path segment against the empty path segment and removes them both. So, how did I resolve this bug? As "By Design" of course!

The URI RFC allows path segments of zero length and does not assign them any special meaning. So generic user agents that intend to work on the web must not treat an empty path segment any different from a path segment with some text in it. In the case above IE is doing the correct thing.

That's the case for generic user agents, however servers may decide that a URI with an empty path segment returns the same resource as a the same URI without that empty path segment. Essentially they can decide to ignore empty path segments. Both IIS and Apache work this way and thus return the same resource for the following URIs:

http://exmaple.com/foo//bar///baz
http://example.com/foo/bar/baz
The issue for UWS is that it removes empty path segments before resolving dotted path segments. It must follow normal URI procedure before applying its own additional rules for empty path segments. Not doing that means they end up violating URI equivalency rules: URIs (A.1) and (B.2) are equivalent but UWS will not return the same resource for them.
PermalinkCommentsuser agent url ie uri technical web browser

Bug Spotting: Smart pointers and parameter evaluation order

2011 Oct 19, 5:58
The following code works fine. I have a ccomptr named resolvedUri and I want to update its hostname so I do the following:
        CreateIUriBuilder(resolvedUri, 0, 0, &builder);
builder->SetHost(host);
builder->CreateUri(0xFFFFFFFF, 0, 0, &resolvedUri);


But the following similar looking code has a bug:
    ResolveHost(resolvedUri, &resolvedUri);


The issue is that doing &resolvedUri gets the address of the pointer but also clears out the pointer due to the definition of my smart pointer class:
    operator T**()  
{
T *ptrValue = mPtrValue;
mPtrValue->Release();
mPtrValue = NULL;
return &ptrValue;
}


In C++ there’s no guarantee about the order in which parameters for a function or method are evaluated. In the case above, &resolvedUri clears out the ccomptr before evaluating resolvedUri.Get() and so ResolveHostAlias gets a nullptr.

An interesting and related thread on stack overflow on undefined behavior in C++.
PermalinkCommentsc++ technical bug programming smart-pointer cpp

[html5] Web Workers: Race-Condition setting onmessage handler?

2011 Sep 20, 7:17There's no race between posting to a web worker and the web worker setting up its message handler as long as the web worker sets its message handler in the first sync. block of code that runs in the web worker: "Basically, once the initial worker script returns, the worker's port is enabled and the normal message port event delivery mechanism kicks in (including dropping unhandled messages on the floor)."PermalinkCommentstechnical web-worker webbrowser programming postMessage

Why We Need the New News Environment to be Chaotic « Clay Shirky

2011 Jul 10, 5:49"The ‘analog dollars to digital dimes’ problem doesn’t actually seem to be a problem. It seems to be a feature of reality. Digital revenue per head is not replacing lost print revenue and, barring some astonishment in the advertising market, it never will."PermalinkCommentsnews media journalism clay-shirky

WPAD Server Fiddler Extension Update v1.0.1

2011 Jun 12, 3:34
As it turns out the WPAD Server Fiddler Extension I made a while back actually has a non-malicious purpose. Apparently its useful for debugging HTTP on the WP7 phone (or so I'm told). Anyway I took some requests and I've fixed a few minor bugs (start button not updating correctly), changed the dialog to be a Fiddler tab so you can use it non-modally, and the WPAD server is now always off when Fiddler starts.
PermalinkCommentsextension fiddler technical update wpad

Hidden device distorts news on wireless networks, brews beer, is time machine - Hack a Day

2011 May 30, 3:13"We covered the Newstweek, a wall-wart sized box that injects fake news stories over public WiFi connections last February, but now there’s a great walk through and it seems our doubts about this project were disproved."PermalinkCommentssecurity journalism wifi hack technical

Junkyard Jumbotron: join all your screens into one big one, no software install needed - Boing Boing

2011 Mar 14, 4:30A web service to turn multiple web browsing devices into one larger screen. Panning and zooming on one screen (for phones) changes the whole picture.
PermalinkCommentsqrcode web video ui tv

Conan 2.0 - Fortune Tech

2011 Feb 11, 4:15On the more web aspects and behind the scenes of Conan getting kicked off NBC and returning via TBS and the web.
PermalinkCommentsmarketing television conan web internet

YouTube Deal Turns Copyright Videos Into Revenue - NYTimes.com

2010 Sep 4, 7:40"In the past, Lions Gate, which owns the rights to the “Mad Men” clip, might have requested that TomR35’s version be taken down. But it has decided to leave clips like this up, and in return, YouTube runs ads with the video and splits the revenue with Lions Gate."PermalinkCommentsad advertising copyright economics google internet tv video youtube article

DVD Ripping and Viewing in Windows Media Center

2010 Aug 17, 3:05

I've just got a new media center PC connected directly to my television with lots of HD space and so I'm ripping a bunch of my DVDs to the PC so I don't have to fuss with the physical media. I'm ripping with DVD Rip, viewing the results in Windows 7's Windows Media Center after turning on the WMC DVD Library, and using a powershell script I wrote to copy over cover art and metadata.

My powershell script follows. To use it you must do the following:

  1. Run Windows Media Center with the DVD in the drive and view the disc's metadata info.
  2. Rip each DVD to its own subdirectory of a common directory.
  3. The name of the subdirectory to which the DVD is ripped must have the same name as the DVD name in the metadata. An exception to this are characters that aren't allowed in Windows paths (e.g. <, >, ?, *, etc)
  4. Run the script and pass the path to the common directory containing the DVD rips as the first parameter.
Running WMC and viewing the DVD's metadata forces WMC to copy the metadata off the Internet and cache it locally. After playing with Fiddler and reading this blog post on WMC metadata I made the following script that copies metadata and cover art from the WMC cache to the corresponding DVD rip directory.

Download copydvdinfo.ps1

PermalinkCommentspowershell wmc technical tv dvd windows-media-center

Gamers beat algorithms at finding protein structures

2010 Aug 4, 2:29Using games for good! Foldit players are solving real biochemistry problems. "Scientists have turned to games for a variety of reasons, having studied virtual epidemics and tracked online communities and behavior, or simply used games to drum up excitement for the science. But this may be the first time that the gamers played an active role in producing the results, having solved problems in protein structure through the Foldit game."PermalinkCommentsvideogame game biology science research

EpicWin app turns real-life to-do lists into a game

2010 Jul 9, 4:59"EpicWin, the app aims to merge your to-do list with an RPG, letting you gain experience points and find rare loot as you do the laundry and catch up on e-mail."PermalinkCommentshumor getting-things-done game iphone phone todo-list rpg video-game video

Porn pranksters have a field day with YouTube injection flaw

2010 Jul 5, 4:23Cross-site scripting attack on YouTube over the weekend: "That turned out to be as simple as using two script tags in a row (<script><script>fun scripting stuff goes here!), as noted by F-Secure researcher Mikko H. Hypponen on Twitter—the first of the two tags would get stripped, and the second was allowed through."PermalinkCommentstechnical youtube security cross-site-scripting javascript

The Curious History of Uniform Resource Names - IETF Journal

2010 Jul 1, 10:51"Sometimes it’s hard to judge whether an engineering effort has been successful or not. It can take years for an idea to catch on, to go from being the butt of jokes to becoming an international imperative (IPv6). Uniform Resource Names (URNs), which are part of the Uniform Resource Identifier (URI) family, are conceptually at least as old as IPv6. While not figuring in international directives for deployment, they-and the technology engineered to resolve them-are still going concerns."PermalinkCommentsietf urn uri history technical internet url

King's Quest returns in The Silver Lining | THINQ.co.uk

2010 Jun 29, 6:40A fan made Kings Quest sequel gets an official go-ahead: "After negotiations, the C&D [cease and desist] has been officially rescinded, and Phoenix Online has been granted a non-commercial license to release The Silver Lining!"PermalinkCommentsgame legal law videogame kings-quest sierra technical

Animated GIF From Wedding

2010 Jun 13, 3:47From Angie's photos of my wedding there's a sequence of four photos where everyone's holding still except me. Of course I turned this into an animated GIF using GIF Make, to produce my animated wedding GIF. I don't embed the image in the HTML because it is really irritating.PermalinkCommentswedding animated photo personal gif

Hitler tries a DMCA takedown | Brad Ideas

2010 Apr 21, 1:47So... There's Downfall a 2004 film about the final days of Hitler's life. Then folks take the most dramatic scene and parody it with new subtitles having Hitler yell about various things like his cell phone or Burning Man. It becomes a meme and meta Downfall parodies show up with Hitler yelling about the Downfall parodies. Now the studio producing the film has sent DMCA takedown notices to Youtube and many of the videos are disappearing. In response is a new Downfall parody in which Hitler issues DMCA notices to Youtube...PermalinkCommentscensorship hitler humor copyright dmca eff legal youtube video fairuse meme web internet technical
Older EntriesNewer Entries Creative Commons License Some rights reserved.