iso page 6 - Dave's Blog

Search
My timeline on Mastodon

URI Fragment Info Roundup

2008 Apr 21, 11:53

['Neverending story' by Alexandre Duret-Lutz. A framed photo of books with the droste effect applied. Licensed under creative commons.]Information about URI Fragments, the portion of URIs that follow the '#' at the end and that are used to navigate within a document, is scattered throughout various documents which I usually have to hunt down. Instead I'll link to them all here.

Definitions. Fragments are defined in the URI RFC which states that they're used to identify a secondary resource that is related to the primary resource identified by the URI as a subset of the primary, a view of the primary, or some other resource described by the primary. The interpretation of a fragment is based on the mime type of the primary resource. Tim Berners-Lee notes that determining fragment meaning from mime type is a problem because a single URI may contain a single fragment, however over HTTP a single URI can result in the same logical resource represented in different mime types. So there's one fragment but multiple mime types and so multiple interpretations of the one fragment. The URI RFC says that if an author has a single resource available in multiple mime types then the author must ensure that the various representations of a single resource must all resolve fragments to the same logical secondary resource. Depending on which mime types you're dealing with this is either not easy or not possible.

HTTP. In HTTP when URIs are used, the fragment is not included. The General Syntax section of the HTTP standard says it uses the definitions of 'URI-reference' (which includes the fragment), 'absoluteURI', and 'relativeURI' (which don't include the fragment) from the URI RFC. However, the 'URI-reference' term doesn't actually appear in the BNF for the protocol. Accordingly the headers like 'Request-URI', 'Content-Location', 'Location', and 'Referer' which include URIs are defined with 'absoluteURI' or 'relativeURI' and don't include the fragment. This is in keeping with the original fragment definition which says that the fragment is used as a view of the original resource and consequently only needed for resolution on the client. Additionally, the URI RFC explicitly notes that not including the fragment is a privacy feature such that page authors won't be able to stop clients from viewing whatever fragments the client chooses. This seems like an odd claim given that if the author wanted to selectively restrict access to portions of documents there are other options for them like breaking out the parts of a single resource to which the author wishes to restrict access into separate resources.

HTML. In HTML, the HTML mime type RFC defines HTML's fragment use which consists of fragments referring to elements with a corresponding 'id' attribute or one of a particular set of elements with a corresponding 'name' attribute. The HTML spec discusses fragment use additionally noting that the names and ids must be unique in the document and that they must consist of only US-ASCII characters. The ID and NAME attributes are further restricted in section 6 to only consist of alphanumerics, the hyphen, period, colon, and underscore. This is a subset of the characters allowed in the URI fragment so no encoding is discussed since technically its not needed. However, practically speaking, browsers like FireFox and Internet Explorer allow for names and ids containing characters outside of the defined set including characters that must be percent-encoded to appear in a URI fragment. The interpretation of percent-encoded characters in fragments for HTML documents is not consistent across browsers (or in some cases within the same browser) especially for the percent-encoded percent.

Text. Text/plain recently got a fragment definition that allows fragments to refer to particular lines or characters within a text document. The scheme no longer includes regular expressions, which disappointed me at first, but in retrospect is probably good idea for increasing the adoption of this fragment scheme and for avoiding the potential for ubiquitous DoS via regex. One of the authors also notes this on his blog. I look forward to the day when this scheme is widely implemented.

XML. XML has the XPointer framework to define its fragment structure as noted by the XML mime type definition. XPointer consists of a general scheme that contains subschemes that identify a subset of an XML document. Its too bad such a thing wasn't adopted for URI fragments in general to solve the problem of a single resource with multiple mime type representations. I wrote more about XPointer when I worked on hacking XPointer into IE.

SVG and MPEG. Through the Media Fragments Working Group I found a couple more fragment scheme definitions. SVG's fragment scheme is defined in the SVG documentation and looks similar to XML's. MPEG has one defined but I could only find it as an ISO document "Text of ISO/IEC FCD 21000-17 MPEG-12 FID" and not as an RFC which is a little disturbing.

AJAX. AJAX websites have used fragments as an escape hatch for two issues that I've seen. The first is getting a unique URL for versions of a page that are produced on the client by script. The fragment may be changed by script without forcing the page to reload. This goes outside the rules of the standards by using HTML fragments in a fashion not called out by the HTML spec. but it does seem to be inline with the spirit of the fragment in that it is a subview of the original resource and interpretted client side. The other hack-ier use of the fragment in AJAX is for cross domain communication. The basic idea is that different frames or windows may not communicate in normal fashions if they have different domains but they can view each other's URLs and accordingly can change their own fragments in order to send a message out to those who know where to look. IMO this is not inline with the spirit of the fragment but is rather a cool hack.

PermalinkCommentsxml text ajax technical url boring uri fragment rfc

Fragment Identification of MPEG Resources (Text of ISO/IEC FCD 21000-17 MPEG-21 FID)

2008 Apr 16, 7:09Standard describing URI fragments identifying parts of MPEG videos. Very similar syntax to XML fragments. Having trouble finding this document as anything other than a Word doc. Looks to exist only as an ISO standard.PermalinkCommentsstandard fragment uri video mpeg reference iso

Zeno's Progress Bar - Stolen Thoughts

2008 Apr 7, 10:09

Text-less progress bar dialog. Licensed under Creative Commons by Ian HamptonMore of my thoughts have been stolen: In my previous job the customer wanted a progress bar displayed while information was copied off of proprietary hardware, during which the software didn't get any indication of progress until the copy was finished. I joked (mostly) that we could display a progress bar that continuously slows down and never quite reaches the end until we know we're done getting info from the hardware. The amount of progress would be a function of time where as time approaches infinity, progress approaches a value of at most 100 percent.

This is similar to Zeno's Paradox which says you can't cross a room because to do so first you must cross half the room, then you must cross half the remaining distance, then half the remaining again, and so on which means you must take an infinite number of steps. There's also an old joke inspired by Zeno's Paradox. The joke is the prototypical engineering vs sciences joke and is moderately humorous, but I think the fact that Wolfram has an interactive applet demonstrating the joke is funnier than the joke itself.

I recently found Lou Franco's blog post "Using Zeno's Paradox For Progress Bars" which covers the same concept as Zeno's Progress Bar but with real code. Apparently Lou wasn't making a joke and actually used this progress bar in an application. A progress bar that doesn't accurately represent progress seems dishonest. In cases like the Vista Defrag where the software can't make a reasonable guess about how long a process will take the software shouldn't display a progress bar.

Similarly a paper by Chris Harrison "Rethinking the Progress Bar" suggests that if a progress bar speeds up towards the end the user will perceive the operation as taking less time. The paper is interesting, but as in the previous case, I'd rather have progress accurately represented even if it means the user doesn't perceive the operation as being as fast.

Update: I should be clearer about Lou's post. He was actually making a practical and implementable suggestion as to how to handle the case of displaying progress when you have some idea of how long it will take but no indications of progress, whereas my suggestion is impractical and more of a joke concerning displaying progress with no indication of progress nor a general idea of how long it will take.

PermalinkCommentszenos paradox technical stolen-thoughts boring progress zeno software math

Flickr: Photos from Alabaster 2

2008 Apr 3, 1:44Photos of graffiti on train cars.PermalinkCommentsart graffiti streetart train flickr photo cultural-disobediance via:ethan_t_hein

Candy Chang - Public Art

2008 Apr 1, 12:45Candy Chang has some cool public art pieces.PermalinkCommentscandy-chang art graffiti cultural-disobediance

Wooster Collective

2008 Mar 18, 1:04"The Wooster Collective was founded in 2001. This site is dedicated to showcasing and celebrating ephemeral art placed on streets in cities around the world." More cool street art and hacksPermalinkCommentscultural-disobediance art street-art street graffiti via:boingboing blog

The life and times of America's greatest hoaxer. - By Joe Keohane - Slate Magazine

2008 Mar 3, 4:16An article on the documentary of Alan Abel hilarious hoaxer. "The idea was to write a satire about a group called "The Society for Indecency to Naked Animals," or SINA, which would call for animals to be clothed for the sake of decency."PermalinkCommentsvia:mattalyst humor article Abel-Raises-Cain dvd movie documentary Alan-Abel cultural-disobediance

Chris Harrison - Rethinking the Progress Bar

2008 Mar 3, 3:32Research paper on progress bar UI improvements counters my thoughts on progress bar demanded for case where we only know when we're done: set progress as function of time where function has asymptote at %100. Zeno's progress bar.PermalinkCommentsdesign gui hci interface paper progress progress-bar usability research

Flickr: Banksy

2008 Feb 19, 1:28Flickr group for folks photos of Banksy's work. FTA: "This group is for sharing your photos of work by Banksy"PermalinkCommentsflickr photos banksy cultural-disobediance via:picocool

TED | Talks | Howard Rheingold: Way-new collaboration (video)

2008 Feb 17, 11:25How the Internet can allow new forms of collaboration, solutions to tragedy of commons, prisoner's dilemma.PermalinkCommentsvia:felix42 cooperation collaboration howard-rheingold video ted internet

Excerpts from "Expert Judgement on Markers to Deter Inadvertent Human Intrusion into the Waste Isolation Pilot Plant"

2008 Feb 11, 7:49Thanks Itrasbiel! FTA: "The site must be marked. Aside from the legal requirement, the site will be indelibly imprinted by the human activity associated with waste disposal. We must complete the process by explaining what has been done and why. "PermalinkCommentsvia:Itrasbiel future science time art nuclear government nuclear-waste

LA Weekly - Art+Books - Murakami REVOKed - Shelley Leopold - The Essential Online Resource for Los Angeles

2008 Feb 5, 2:02From BB's article: "In December, graffiti writers AUGER and REVOK modified a billboard advertising the wonderful Takashi Murakami exhibit ... Murakami himself saw online photos of the graffitied billboard and thought it to be "so wonderful, he had to havePermalinkCommentsart graffiti cultural-disobediance murakami via:boingboing

Inhabitat - REVERSE GRAFFITI: Clean Green Street Art

2008 Jan 30, 3:00Graffiti created by cleaning your art into publicly viewable walls, signs, etc.PermalinkCommentsvia:boingboing cultural-disobediance graffiti art

Ska-toon on Yo Gabba Gabba! - Boing Boing

2008 Jan 21, 12:25The line 'pick it up' finally making some sense. FTA: "...We recently saw an episode featuring this terrific ska cartoon about picking up after yourself.... the catchy tune is performed by ska musicians GOGO13 and Hepcat's Alex Desert."PermalinkCommentshumor video ska music yo-gabba-gabba pick-it-up

decio: il blog: Commercial made real: Holy Trinit, Rome

2008 Jan 16, 3:55FTA: "A bunch of men launched a whopping half million balls down the stairs of Holy Trinit on Pincio Hill in Rome."PermalinkCommentsart video culture cultural-disobediance humor via:boingboing

California Trip

2007 Dec 23, 11:18Other Jelly FishSarah and I went down to California at the end of last month for a Thanksgiving visit with my parents. We visited the famous Monterey Bay Aquarium (fun fact: the aquarium scenes in Star Trek IV were filmed here) and saw many jelly fish. We wandered around Capitola where we visited many local shops and ate on the wharf. We shopped in Carmel and ate at the Forge in the Forest (fun fact: Clint Eastwood was the mayor of this city in the late 80s). We visited the Santa Cruz Beach Boardwalk which was very cold and closed.
Silly Party HatsMy parents took us out to dinner on the first night and the rest of the nights we ate dinner at their house. They had the Shelton's over and I got to see Chris and Alison. It was fun to talk with them and catch up since its been quite a while since I'd seen them.
Beach House LivingroomWe stayed in the lovely beach house of our family friend's the Goodwins. My parents have been helping them fix it up and decorate it and it looks great. It was quite a treat staying in a house right on the ocean. Also of note, this was the first trip on which I was old enough to rent the car and accordingly I did all of the driving. This trip was very fun and relaxing.PermalinkCommentsaquarium friends parents personal beach california vacation

Banksy

2007 Dec 23, 8:47Banksy's website.PermalinkCommentsart culture graffiti homepage streetart satire public politics banksy cultural-disobediance

Half-Life 2: Episode Two Stats

2007 Nov 28, 2:09Valve shows off their cool visualizations of stats they generated from folks playing HL2E2 including heat maps of player deaths by level.PermalinkCommentsvisualization statistics hl2 game games valve development

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

Undercover restorers fix Paris landmark's clock | Art, Architecture & Design | Guardian Unlimited Arts

2007 Nov 26, 12:32Guerrilla clockmakers fix famous Paris clock. Andrew says: "It seems a team of clockmakers broke into the Pantheon in Paris in September 2005 and spent a year fixing the historic and neglected clock, which had been abandoned by the authorities. They werePermalinkCommentsclock culture history humor paris france via:boingboing cultural-disobediance
Older EntriesNewer Entries Creative Commons License Some rights reserved.