wa page 45 - Dave's Blog

Search
My timeline on Mastodon

STREET WITH A VIEW: a project by Robin Hewlett & Ben Kinsley

2008 Nov 22, 5:22"On May 3rd 2008, artists Robin Hewlett and Ben Kinsley invited the Google Inc. Street View team and residents of Pittsburgh's Northside to collaborate on a series of tableaux along Sampsonia Way. Neighbors, and other participants from around the city, staged scenes ranging from a parade and a marathon, to a garage band practice, a seventeenth century sword fight, a heroic rescue and much more."PermalinkCommentsgoogle map street view pittsburgh streetview internet art

Obama Looks to Axe Daylight Time -- NYT Explains Why - Green Daily

2008 Nov 21, 3:47"In order to conserve energy, President-elect Barak Obama wants to eliminate daylight saving time."PermalinkCommentsenergy politics obama dst time date datetime

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

Wallace & Gromit - Forum - Latest News - A Matter of Loaf and Death Comes to BBC One This Christmas

2008 Nov 20, 11:01Woo! "I love making films for the cinema but the production of Chicken Run and Curse of the Were-Rabbit were virtually back to back and each film took five years to complete. A Matter of Loaf and Death will be so much quicker to make. I'm delighted to be back into production and back with BBC One with Wallace and Gromit. Over the years the BBC has been incredibly supportive of Wallace and Gromit, this film feels like their homecoming."PermalinkCommentswallace gromit wallace-grommit bbc animation clay claymation via:kris.kowal humor

Broke Man Tries Paying Bill With a Picture of a Spider - Urlesque

2008 Nov 20, 10:58I, like Matt, am a bit incredulous but this is still funny. "Check, cash or money order are acceptable forms of payment when the bill collector comes knocking (or e-mailing), not a picture you doodled of a spider."PermalinkCommentsvia:swannman humor art spider money

Evil Mad Scientist Laboratories - Binary Birthday

2008 Nov 19, 4:28"A binary birthday candle. It consists of a single candle with seven wicks, where the wicks that are lit represent the birthday individual's age in binary. This single candle design works flawlessly to represent any age from 1 to 127, never requiring anyone below the age of 127 to blow out more than a mere six candles at a time."PermalinkCommentsvia:swannman birthday geek math humor howto cake birthday-cake candle binary

Text/Plain Fragment Bookmarklet

2008 Nov 19, 12:58

The text/plain fragment documented in RFC 5147 and described on Erik Wilde's blog struck my interest and, like the XML fragment, I wanted to see if I could implement this in IE. In this case there's no XSLT for me to edit so, like my plain/text word wrap bookmarklet I've implemented it as a bookmarklet. This is only a partial implementation as it doesn't implement the integrity checks.

Check out my text/plain fragment bookmarklet.

PermalinkCommentstext url boring bookmarklet uri plain-text javascript fragment

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

For a Washington Job, Be Prepared to Tell All - NYTimes.com

2008 Nov 18, 1:10"...Just in case the previous 62 questions do not ferret out any potential controversy, the 63rd is all-encompassing: 'Please provide any other information, including information about other members of your family, that could suggest a conflict of interest or be a possible source of embarrassment to you, your family, or the president-elect.' ... For those who clear all the hurdles, the reward could be the job they wanted. But first there will be more forms, for security and ethics clearances from the Federal Bureau of Investigation and the Office of Government Ethics."PermalinkCommentsgovernment obama fbi privacy

The Roots: The Roots To Be Jimmy Fallon's Band; We Are Old And Sad

2008 Nov 17, 4:20"...he said that The Roots were retiring from touring in order to become the house band for Jimmy Fallon when he takes over Conan O'Brien's late night show next year. But that video was quickly pulled, so everyone has been scrambling to find out whether this apocalyptic... thing is actually true. NBC has no official comment, but we hear that it probably is. Essaywhuman?!!!??! This is one of those things that proves you're getting old."PermalinkCommentsvia:ethan_t_hein tv the-roots music

11412 NE 128th St, Kirkland, WA 98034 - Google Maps

2008 Nov 17, 12:58Sarah was driving around in her new car while I was trying out Google Map's Street View on my new phone. I found my car on the phone but not in reality and it was a strange feeling.PermalinkCommentsme google maps car

Sonja Eddings Brown is Rather Unpleasant - The Rehabilitated Student

2008 Nov 16, 10:13"Imagine my mild surprise when I discovered that the woman who terrorized me in my final days in high school is the face of Proposition 8. Sonja Eddings Brown is everything you would expect a Proposition 8 supporter to be: someone with misplaced values and a knack for being a big bully. Yes, a middle-aged mother of three went out of her way to threaten to kick a high school senior out of her valedictory speaking position simply because the student refused to have (strange) words placed her mouth and to be used as a propagandistic advertising vehicle."PermalinkCommentspolitics education california sonja-eddings-brown high-school via:kris.kowal

The urban art of Joshua Callaghan: the man who can turn street objects invisible - Telegraph

2008 Nov 16, 10:10"Joshua Callaghan disguises utility boxes by pasting pictures onto them of the scenery behind, thereby creating the illusion of an uninterrupted view."PermalinkCommentsart streetart graffiti urban via:swannman

Keepon lite coming soon? - Short Sharp Science - New Scientist

2008 Nov 13, 10:30"There was bittersweet news for Keepon fans last month. The funky fuzzy yellow robot - pictured - is to be released commercially. But it won't come cheap - it carries a $30,000 price tag."PermalinkCommentskeepon robot dance humor video

Shoulder Surfing a Malicious PDF Author - Didier Stevens

2008 Nov 13, 10:21"Ever since I read about the incremental updates feature of the PDF file format, I've been patiently waiting for a malicious PDF document with incremental updates to come my way. Thanks to Bojan, that day has finally arrived."PermalinkCommentspdf security javascript exploit malware adobe

9NEWS.com | Colorado's Online News Leader | Three small canisters ...

2008 Nov 11, 3:57Grandpa's old films contain some surprises: "There was another reason why the Library of Congress wanted the original films. They are a treasure trove of historic video of the aftermath of D-Day."PermalinkCommentsvideo history library-of-congress

G1 Android Phone

2008 Nov 9, 11:29

T-Mobile G1 Wallpapers by romainguy
I finally replaced my old regular cell-phone which was literally being held together by a rubber band with a fancy new G1, my first Internet accessible phone.

I had to call the T-Mobile support line to get data added to my plan and the person helping me was disconcertingly friendly. She asked about my weekend plans and so I felt compelled to ask her the same. Her plans involved replacing her video card so she could get back to World of Warcraft and do I enjoy computer gaming? I couldn't tell if she was genuine or if she was signing me up for magazines.

I was with Sarah in her new car, trying out the phone's GPS functionality via Google Maps while she drove. I switched to Street View and happened to find my car. It was a weird feeling, kind of like those Google conspiracy videos.

The phone runs Google's open source OS and I really enjoy the application API. Its all in Java and URIs and mime-types are sort of basics. Rather than invoking the builtin item picker control directly you invoke an 'intent' specifying the URI of your list of items, a mime-type describing the type of items in the list, and an action 'PICK' and whatever is registered as the picker on the system pops up and lets the user pick from that list. The same goes if you want to 'EDIT' an image, or 'VIEW' an mp3.

I wanted to replace the Google search box gadget that appears on the home screen with my own search box widget that uses OpenSearch descriptors but apparently in the current API you can't make home screen gadgets without changing parts of the OS. My other desired application is something to replace this GPS photo tracker device by recording my location to a file and an additional program on my computer to apply those locations to photos.

PermalinkCommentstmobile personal api phone technical g1 android google

XSLT Meddler Script

2008 Nov 9, 11:25

I've made an XSLT Meddler script in my continued XSLT adventures. Meddler is a simple and easy web server that runs whatever JScript.NET code you give it. I wrote a script that takes an indicated XSLT on the server, downloads an indicated XML from the Internet and returns the result of running that XML through the XSLT. This is useful when you want to work with something like the Zune software or IE7's feed platform which only reads feeds over the HTTP protocol. I'll give more interesting and specific examples of how this could be useful in the future.

PermalinkCommentsmeddler technical xml script xslt

I Voted

2008 Nov 9, 11:18

I Voted 2008 - Farewell to Polls by RedRaspusThis past Tuesday I voted in my first presidential election. Of course I was eligible twice before so don't tell my social studies teacher. I read about folks who stood in line for twelve hours waiting to vote but I personally had no issues. I found the voting location around 10am and it seemed appropriately busy: There were people voting but no lines. I came in and looked confused until an elderly lady gave me a paper to bubble in. The voting booth was more like a fold out voting table at a very awkward height and in the end my back ached. It feels better to vote in person and have a back ache after. Its more like I've accomplished something.

PermalinkCommentspersonal voting

2008 Election Maps

2008 Nov 6, 6:24Comparison of various website's US presidential election maps: "Most media outlets covering the 2008 US Presidential Election used the familar red/blue map to track the progress of the race as results from the polls rolled in Tueday evening. Here are several of those maps, in some ways as similar to each other as they are varied."PermalinkCommentsmap visualization geography president election vote voting politics
Older EntriesNewer Entries Creative Commons License Some rights reserved.