emp page 4 - Dave's Blog

Search
My timeline on Mastodon

Thoughts on registerProtocolHandler in HTML 5

2009 Apr 7, 9:02

I'm a big fan of the concept of registerProtocolHandler in HTML 5 and in FireFox 3, but not quite the implementation. From a high level, it allows web apps to register themselves as handlers of an URL scheme so for (the canonical) example, GMail can register for the mailto URL scheme. I like the concept:

However, the way its currently spec'ed out I don't like the following: PermalinkCommentsurl template registerprotocolhandler firefox technical url scheme protocol boring html5 uri urn

Achron - Time Travel is Coming

2009 Apr 1, 1:22Is it still a _real-time_ strategy game if you travel through time? "If another player is attempting to adversely change the past, players will sometimes keep racing back to out-undo each other. Anything that must travel back in time in order to maintain the current state of causality is denoted to the player, which helps manage paradoxes."PermalinkCommentsvideo videogame time-travel strategy rts game

Information Decoration

2009 Mar 25, 4:03"...we can look at the contemporary screen virus as a transitional phase - a growing pain, if you will, of the information age. Tiling our environment with screens is an extremely literal, and on top of that rather unimaginative, way to introduce virtuality into the physical world: simply piling it on where seamless integration was what was wanted."PermalinkCommentsvia:infosthetics visualization information architecture culture design art

Outline View Internet Explorer Extension

2009 Mar 23, 8:13

I've made another extension for IE8, Outline View, which gives you a side bar in IE that displays an outline of the current page and lets you make intrapage bookmarks.

The outline is generated based on the heading tags in the document (e.g. h1, h2, etc), kind of like what W3C's Semantic data extractor tool displays for an outline. So if the page doesn't use heading tags the way the HTML spec intended or just sticks img tags in them, then the outline doesn't look so hot. On a page that does use headings as intended though it looks really good. For instance a section from the HTML 4 spec shows up quite nicely and I find its actually useful to be able to jump around to the different sections. Actually, I've been surprised going to various blogs how well the outline view is actually working -- I thought a lot more webdevs would be abusing their heading tags.

I've also added intrapage bookmarks. When you make a text selection and clear it, that selected text is added as a temporary intrapage bookmark which shows up in the correct place in the outline. You can navigate to the bookmark or right click to make it permanent. Right now I'm storing the permanent intrapage bookmarks in IE8's new per-domain DOM storage because I wanted to avoid writing code to synchronize a cross process store of bookmarks, it allowed me to play with the DOM storage a bit, and the bookmarks will get cleared appropriately when the user clears their history via the control panel.

PermalinkCommentstechnical intrapage bookmark boring html ie8 ie extension

Paper: "moral panic" behind attempts to link games, violence

2009 Jan 22, 9:43'Behind the press reports, the academic community has been engaged in a hot debate over whether the evidence supports a connection between the violent content of games and any behavioral effects. One of the researchers who has argued forcefully that it's not is Christopher Ferguson, who has just published a paper that argues that the continued societal focus on games as a causal factor in violence is an example of what's termed a "moral panic."'PermalinkCommentsgame violence society videogames

Clips: The Kids In The Hall Think Portal Is HILARIOUS

2008 Nov 20, 11:30KITH + Portal! "We're not sure how deep into the goof juice the Kids in the Hall were when troupe funnyman Scott Thompson started sulking and playing Portal in the back of the tour bus, but something got into Kids during this sad little gaming session. Yes, the comedic stylings of Valve writer Erik Wolpaw are most amusing, as is the struggle of watching Thompson attempt to do anything more than move a cube - uncrouch already! - but something tells me there's something magical in those cups. Thanks for the tip, Sascha23!"PermalinkCommentsportal video humor valve kith scott-thompson

Tab Expansion in PowerShell

2008 Nov 18, 6:38

PowerShell gives us a real CLI for Windows based around .Net stuff. I don't like the creation of a new shell language but I suppose it makes sense given that they want something C# like but not C# exactly since that's much to verbose and strict for a CLI. One of the functions you can override is the TabExpansion function which is used when you tab complete commands. I really like this and so I've added on to the standard implementation to support replacing a variable name with its value, tab completion of available commands, previous command history, and drive names (there not restricted to just one letter in PS).

Learning the new language was a bit of a chore but MSDN helped. A couple of things to note, a statement that has a return value that you don't do anything with is implicitly the return value for the current function. That's why there's no explicit return's in my TabExpansion function. Also, if you're TabExpansion function fails or returns nothing then the builtin TabExpansion function runs which does just filenames. This is why you can see that the standard TabExpansion function doesn't handle normal filenames: it does extra stuff (like method and property completion on variables that represent .Net objects) but if there's no fancy extra stuff to be done it lets the builtin one take a crack.

Here's my TabExpansion function. Probably has bugs, so watch out!


function EscapePath([string] $path, [string] $original)
{
    if ($path.Contains(' ') -and !$original.Contains(' '))
    {
        '"'   $path   '"';
    }
    else
    {
        $path;
    }
}

function PathRelativeTo($pathDest, $pathCurrent)
{
    if ($pathDest.PSParentPath.ToString().EndsWith($pathCurrent.Path))
    {
        '.\'   $pathDest.name;
    }
    else
    {
        $pathDest.FullName;
    }
}

#  This is the default function to use for tab expansion. It handles simple
# member expansion on variables, variable name expansion and parameter completion
# on commands. It doesn't understand strings so strings containing ; | ( or { may
# cause expansion to fail.

function TabExpansion($line, $lastWord)
{
    switch -regex ($lastWord)
    {
         # Handle property and method expansion...
         '(^.*)(\$(\w|\.) )\.(\w*)$' {
             $method = [Management.Automation.PSMemberTypes] `
                 'Method,CodeMethod,ScriptMethod,ParameterizedProperty'
             $base = $matches[1]
             $expression = $matches[2]
             Invoke-Expression ('$val='   $expression)
             $pat = $matches[4]   '*'
             Get-Member -inputobject $val $pat | sort membertype,name |
                 where { $_.name -notmatch '^[gs]et_'} |
                 foreach {
                     if ($_.MemberType -band $method)
                     {
                         # Return a method...
                         $base   $expression   '.'   $_.name   '('
                     }
                     else {
                         # Return a property...
                         $base   $expression   '.'   $_.name
                     }
                 }
             break;
          }

         # Handle variable name expansion...
         '(^.*\$)([\w\:]*)$' {
             $prefix = $matches[1]
             $varName = $matches[2]
             foreach ($v in Get-Childitem ('variable:'   $varName   '*'))
             {
                 if ($v.name -eq $varName)
                 {
                     $v.value
                 }
                 else
                 {
                    $prefix   $v.name
                 }
             }
             break;
         }

         # Do completion on parameters...
         '^-([\w0-9]*)' {
             $pat = $matches[1]   '*'

             # extract the command name from the string
             # first split the string into statements and pipeline elements
             # This doesn't handle strings however.
             $cmdlet = [regex]::Split($line, '[|;]')[-1]

             #  Extract the trailing unclosed block e.g. ls | foreach { cp
             if ($cmdlet -match '\{([^\{\}]*)$')
             {
                 $cmdlet = $matches[1]
             }

             # Extract the longest unclosed parenthetical expression...
             if ($cmdlet -match '\(([^()]*)$')
             {
                 $cmdlet = $matches[1]
             }

             # take the first space separated token of the remaining string
             # as the command to look up. Trim any leading or trailing spaces
             # so you don't get leading empty elements.
             $cmdlet = $cmdlet.Trim().Split()[0]

             # now get the info object for it...
             $cmdlet = @(Get-Command -type 'cmdlet,alias' $cmdlet)[0]

             # loop resolving aliases...
             while ($cmdlet.CommandType -eq 'alias') {
                 $cmdlet = @(Get-Command -type 'cmdlet,alias' $cmdlet.Definition)[0]
             }

             # expand the parameter sets and emit the matching elements
             foreach ($n in $cmdlet.ParameterSets | Select-Object -expand parameters)
             {
                 $n = $n.name
                 if ($n -like $pat) { '-'   $n }
             }
             break;
         }

         default {
             $varNameStar = $lastWord   '*';

             foreach ($n in @(Get-Childitem $varNameStar))
             {
                 $name = PathRelativeTo ($n) ($PWD);

                 if ($n.PSIsContainer)
                 {
                     EscapePath ($name   '\') ($lastWord);
                 }
                 else
                 {
                     EscapePath ($name) ($lastWord);
                 }
             }

             if (!$varNameStar.Contains('\'))
             {
                foreach ($n in @(Get-Command $varNameStar))
                {
                    if ($n.CommandType.ToString().Equals('Application'))
                    {
                       foreach ($ext in @((cat Env:PathExt).Split(';')))
                       {
                          if ($n.Path.ToString().ToLower().EndsWith(($ext).ToString().ToLower()))
                          {
                              EscapePath($n.Path) ($lastWord);
                          }
                       }
                    }
                    else
                    {
                        EscapePath($n.Name) ($lastWord);
                    }
                }

                foreach ($n in @(Get-psdrive $varNameStar))
                {
                    EscapePath($n.name   ":") ($lastWord);
                }
             }

             foreach ($n in @(Get-History))
             {
                 if ($n.CommandLine.StartsWith($line) -and $n.CommandLine -ne $line)
                 {
                     $lastWord   $n.CommandLine.Substring($line.Length);
                 }
             }

             # Add the original string to the end of the expansion list.
             $lastWord;

             break;
         }
    }
}

PermalinkCommentscli technical tabexpansion powershell

Signs of Fall Tree

2008 Oct 28, 9:01

sequelguy posted a photo:

Signs of Fall Tree

Immediately after Sarah took this photo, a truck pulled into the empty parking spot and the driver jumped out to apologize for messing up the photo. The driver was a zombie.

PermalinkCommentsseattle tree nature gasworkspark sarahtookthisphoto

Cadbury Bunny Sneaks Mint

2008 Oct 7, 2:49
Cadbury the bunny takes a moment from hiding under the chair to eat some mint. She comes out just to grab some mint and then goes back under the chair repeatedly for two minutes.
From: David Risney
Views: 328
1 ratings
Time: 02:01 More in Pets & Animals
PermalinkCommentsvideo

Internet Explorer Makes Desperate Overture To Become Default Browser | The Onion - America's Finest News Source

2008 Sep 29, 2:28'"Internet Explorer is not currently your default browser. Would you like to make it your default browser?" the software program asked in an attempt to guilt Drewing into accepting its offer out of pure pity.'PermalinkCommentsonion humor browser ie microsoft

Anecdotes from Work

2008 Sep 23, 2:15

Diveristy in NumbersThe names in the following anecdote have been changed. Except for my name (I'm Dave).

I got a new laptop a while back. I had it in my office and Tim came in to ask me something but paused when he saw my laptop. "Oh, is this one of those new touch screen laptops?" he asked, the whole time moving his hand towards my laptop and punctuating his sentence by pressing his finger to the screen. "No" I responded.

Walking down a hallway I heard Winston, one of our managers, say, "Hey Tim!" Winston catches up to me and asks, "Are you almost done with the XYZ bug?" I realized Winston was talking to me and got my name wrong but I figured I'll ignore it and perhaps he'll realize his mistake. Winston continued "I just talked with some people who say they're blocked and waiting for Tim to finish the XYZ bug." "Dave" I said helpfully attempting to diplomatically correct Winston since he apparently hadn't realized his error. "No, it was Jeremy and Bill." Winston said naming the people he had talked to who were waiting for me to fix the XYZ bug. At this point I decided it would be easier to just answer his question and end the conversation than to get into this whole thing. As far as I know, Winston has not gotten my name wrong at any other time.

PermalinkCommentswork nontechnical

Mr. And Mrs. Vader on Flickr - Photo Sharing!

2008 Sep 18, 11:33"This was just too funny and a great idea. The hand holding just added to the humor. It is good to see Vader in a relationship finally. Maybe he won't be so grumpy and short tempered from now on."PermalinkCommentsgeek humor starwars darth-vader

mycrocosm

2008 Sep 16, 2:44Update via the web, email, or your phone, stats on day to day activities. For example send 'lunch time' to create a new time dataset named lunch and then send 'lunch' when you eat lunch and it will note all the times you ate lunch. I was tempted to use this to see a graph of when I add delicious posts but it doesn't support importing old data. Don't think I'll use it but it uses OpenID perfectly.PermalinkCommentsblog statistics openid social graph visualization tool

Tag Metadata in Feeds

2008 Aug 25, 10:13

As noted previously, my page consists of the aggregation of my various feeds and in working on that code recently it was again brought to my attention that everyone has different ways of representing tag metadata in feeds. I made up a list of how my various feed sources represent tags and list that data here so that it might help others in the future.

Tag markup from various sources
Source Feed Type Tag Markup Scheme One Tag Per Element Tag Scheme URI Human / Machine Names Example Markup
LiveJournal Atom atom:category yes no no , (source)
LiveJournal RSS 2.0 rss2:category yes no no technical
(soure)
WordPress RSS 2.0 rss2:category yes no no , (source)
Delicious RSS 1.0 dc:subject no no no photosynth photos 3d tool
(source)
Delicious RSS 2.0 rss2:category yes yes no domain="http://delicious.com/SequelGuy/">
hulu

(source)
Flickr Atom atom:category yes yes no term="seattle"
scheme="http://www.flickr.com/photos/tags/" />

(source)
Flickr RSS 2.0 media:category no yes no scheme="urn:flickr:tags">
seattle washington baseball mariners

(source)
YouTube RSS 2.0 media:category no no no label="Tags">
bunny rabbit yawn cadbury

(source)
LibraryThing RSS 2.0 No explicit tag metadata. no no no n/a, (source)
Tag markup scheme
Tag Markup Scheme Notes Example
Atom Category
atom:category
xmlns:atom="http://www.w3.org/2005/Atom"
category/@term
Required category name.
category/@scheme
Optional IRI id'ing the categorization scheme.
category/@label
Optional human readable category name.
term="catName"
scheme="tag:deletethis.net,2008:tagscheme"
label="category name in human readable format"/>
RSS 2.0 category
rss2:category
empty namespace
category/@domain
Optional string id'ing the categorization scheme.
category/text()
Required category name. The value of the element is a forward-slash-separated string that identifies a hierarchic location in the indicated taxonomy. Processors may establish conventions for the interpretation of categories.
domain="tag:deletethis.net,2008:tagscheme">
MSFT
Yahoo Media RSS Module category
media:category
xmlns:media="http://search.yahoo.com/mrss/"
category/text()
Required category name.
category/@domain
Optional string id'ing the categorization scheme.
scheme="http://dmoz.org"
label="Ace Ventura - Pet Detective">
Arts/Movies/Titles/A/Ace_Ventura_Series/Ace_Ventura_-_Pet_Detective
Dublin Core subject
dc:subject
xmlns:dc="http://purl.org/dc/elements/1.1/"
subject/text()
Required category name. Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary.
humor

Update 2009-9-14: Added WordPress to the Tag Markup table and namespaces to the Tag Markup Scheme table.

PermalinkCommentsfeed media delicious technical atom youtube yahoo rss tag

Red/Brian - redemption!

2008 Aug 12, 11:02Prerinsing dishes for the dish washer is bad! "Remember when your mom would make you wash dishes before putting them in the dish washer? Remember how backwards that sounded, remember how you just didn't see the logic, but she made you do it anyway? We were right!"PermalinkCommentsvia:kris.kowal ecology water dishwasher dishes awesome

philosecurity - Blog Archive - Guerilla Public Service

2008 Aug 11, 3:58Fellow kindly fixes spelling error on trailer mounted electronic roadway message signs. Pulls up, connects keyboard, reads password off the side of the enclosure, etc. "Not far from my house is one of those temporary trailer-mounted variable message signs, which for the past several weeks has been advising motorists that ..." I always wondered what it would take on those signs. And if all the passwords are four characters long...PermalinkCommentssecurity hack howto sign humor

Roq La Rue Gallery - Pop Surrealism and Underground Contemporary Art

2008 Jul 10, 8:22In Seattle. "We have been an integral part of the Lowbrow/Pop Surrealism art movement since opening in 1998, and continue to exhibit established artists in the genre as well as fostering emerging artists, many of whom have gone on to make strong impacts iPermalinkCommentsseattle art

New Cookie related Internet Drafts from Yngve N. Pettersen on 2006-03-20 (ietf-http-wg@w3.org from January to March 2006)

2008 Jun 30, 3:46Opera's solution to minimal security domain determination: "The drafts describe 1) Opera's current "rule of thumb" implementation that uses DNS in an attempt to confirm the validity of a domain, and 2) a proposed new HTTP based lookup service that returPermalinkCommentsopera rfc ietf cookie http internet browser dns domain

Seasteading: engineering the long tail of nations: Page 1

2008 Jun 10, 3:10Interview with guy from "the Seasteading Institute, the brainchild of two Silicon Valley software developers, aims to develop self-sufficient deep-sea platforms that would empower individuals to break free of the cozy cartel of 190-odd world governments aPermalinkCommentscommunity politics seasteading society article arstechnica

Finished Paper Mario Games

2008 May 12, 4:05
Super Paper MarioPaper Mario: The Thousand-Year DoorPaper Mario Title Screen

Sarah and I have finished playing through the games "Paper Mario", "Paper Mario: The Thousand-Year Door", and "Super Paper Mario" last week (including the various Pits of 100 Trials). We played them all on the Wii, because even though Super Paper Mario was the only one released explicitly for that platform, Wii maintains compatibility with Game Cube games such as Thousand-Year Door and Paper Mario although originally released for the Nintendo 64 is now available as a pay for download game on the Wii's Virtual Console. So, yay for Nintendo!

I think my favorite of the three is Thousand-Year Door mostly because of the RPG attack system. In Thousand-Year Door and Paper Mario when you come into contact with an enemy you go into an RPG style attack system where you take turns selecting actions. In Super Paper Mario you still have hit points and such, but you don't go into a turn based RPG style attack system, rather you do the regular Mario jumping on bad guys thing (or hitting them with a mallet etc...). Thousand-Year Door and Paper Mario are very similar in terms of game play but Thousand-Year Door looks very pretty and has made improvements to how your party-mates are handled in battle (they have HP and can fall as you would expect) and there's an audience that cheers you on during your battles.

Even if the gameplay sucked the humor throughout the series might be tempting enough. Mario's clothing and mustache are mocked throughout and standard RPG expectations are subverted. I hate to describe any of these moments for fear of ruining anything but, for instance, an optional and very difficult enemy who may only be killed after hours of work only results in one experience point, or a very intimidating enemy who you imagine you'll have to fight actually challenges you to a quiz.

Despite how I personally rank them, all the games are great and I'd recommend any of them.

PermalinkCommentsmario videogame paper mario nontechnical
Older EntriesNewer Entries Creative Commons License Some rights reserved.