rest page 7 - Dave's Blog

Search
My timeline on Mastodon

Noisy Decent Graphics: All the ephemera that's fit to print *

2009 Jan 15, 9:41"Russell and I thought it would be interesting to take some stuff from the internet and print it in a newspaper format. Words as well as pictures. Like a Daily Me, but slower. When we discovered that most newspaper printers will let you do a short run on their press (this was exactly the same spec as the News Of The World) we decided to have some fun."PermalinkCommentsblog internet design art newspaper typography print publishing via:mattb

Barbie's finger nail painter makes gaming writers beautiful

2009 Jan 10, 1:00We may not have 3D printers yet but this is certainly a step in the correct direction. "A second later, you remove your finger from the terrifyingly feminine gom jabbar, and you have your nail all done and ready to go. A brief cover of clear fingernail polish for protection, and you're ready to go out and enjoy the rest of CES while awkwardly not explaining why you have a heart on your finger."PermalinkCommentsbarbie humor nail ces arstechnica video technology

Etre Touchy - Welcome - Gloves for your iPhone, iPod Touch, Nintendo DS, Blackberry, PDA and more...

2009 Jan 8, 5:49Gloves with the ends of the index finger and thumb missing for using phones and the like while keeping the rest of your hands warm. Good idea!PermalinkCommentsglove design shopping wishlist phone cellphone clothing gloves

20x200: Our Story

2008 Dec 29, 2:26Some interesting work in here: "On a Sunday night back in January, Jen came up with a formula: (limited editions x low prices) + the internet = art for everyone"PermalinkCommentsart gift purchase wishlist gallery online photo shop via:thefangmonster

Marienplatz and the Deutsches Museum

2008 Dec 19, 12:18

Church Tower in MarienplatzOn Monday in Germany we went to Marienplatz and wandered around the Christmas Market, some of the stores, had drinks in a little pub, visited the Toy Museum, and checked out an impressive looking church. We accidentally drew in some other tourists as we stood gaping at the Glockenspiel tower waiting for the little show to begin at the wrong hour. That night Megan and Oliver came by our hotel and took us out to a traditional Bavarian restaurant and brewery that had been brewing beer there for hundreds of years. It was fun although we may have kept Megan and Oliver out too late on a weeknight.

Deutsches MuseumThe next day we went to the Deutsches Museum the largest science and technology museum in the world. And indeed it is very large, six floors on a large grounds. I needed to better pace myself: I spent too much energy being interested in the engineering sections with steam engines, mining, aerospace etc. I was completely worn out by the time we got to physics, chemistry, etc. etc. and we didn't even look in the natural sciences section. Anyway, its very large. That night we ate with Jon at an Italian restaurant. During the meal two period dressed children came in and began singing then tried to shake down their captive audience in the restaurant asking for money. The man at the table next to us asked one of the children what charity the money was going towards, the child said they kept the money, and the man said never mind then and sent the child away.

PermalinkCommentsgermany personal vacation nontechnical

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

del.icio.us Whuffie Bookmarklet: Noah Sussman

2008 Nov 16, 10:24Noah Sussman describes the 'via:' delicious tag with references including a bookmarklet to ensure the via: tags are added automatically. The bookmarklet would only be useful to me if it worked on the 'Save a new bookmark' page, but the history and references are interesting. Reminds me of my past idea for a project that shows who influences who in your Delicious network based on duplicate links among friends with the influencer who saves it first.PermalinkCommentsvia:ethan_t_hein delicious meta bookmarklet script whuffie noah-sussman

Code: Flickr Developer Blog

2008 Nov 16, 9:48Flickr's Developer Blog has some interesting posts including various folks personal projects that use Flickr.PermalinkCommentsdevelopment flickr monthly blog web

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

Microsoft takes touchscreens to the next dimension - Short Sharp Science - New Scientist

2008 Oct 29, 3:09Video showing some more interesting touch screen ideas from Microsoft Research. A touch sensitive sphere that can accomodate multiple users and a table which projects one image onto itself and another image onto objects beyond itself: "But hold another piece of a translucent glass in the air above the table, and it catches a second ghostly image. This trick is in the tabletop glass, which electronically flickers between translucent and transparent 60 times per second, faster than the eye can notice."PermalinkCommentsresearch microsoft video touchscreen table

Computer-table knows when it's time for a refill - Short Sharp Science - New Scientist

2008 Oct 23, 1:58"The table can sense the level of liquid inside a glass, making it possible to tip off a waiter that it's time for a refill."PermalinkCommentsmicrosoft surface research restaurant refill

PSFK - Trends, Ideas & Inspiration

2008 Oct 15, 2:53Stylish blog that looks like it has interesting cultural and business related articles and links (not just weird/humorous).PermalinkCommentsblog web advertising monthly design culture business

Apollo 7 mission taught lessons about crew conflict - Short Sharp Science - New Scientist

2008 Oct 14, 11:45A bit of interesting history on Apollo 7 on the 40year anniversary of its launch: "More surprising yet, this was the first US spaceflight in which there was major friction between the crew and Mission Control."PermalinkCommentshistory space nasa apollo apollo7 article

Weekend Dinners: Old friends, Old library

2008 Oct 7, 12:21

Last Thursday I saw a bunch of college friends that I hadn't seen in a while, despite all of us working at Microsoft, and Saul and Ciera who were visiting. We had dinner at Typhoon! which I haven't been to in quite a while. Daniil and Val brought their cute child. I got to see Charlie and Matt who I'm not sure I've seen since my 25th birthday. There was much nerdiness. I need to remember to organize such a night myself sometime in near future so I don't have to wait another year to see them.

Carnegie's Public Library in Ballard Seattle is now a restaurant.On the weekend Sarah and I went out to dinner at Carnegie's, a former public library in Ballard, Seattle that's now a restaurant. I saw the restaurant's website in Matt's delicious links and thought it looked interesting. The exterior and entryway look like a public library, but just inside its redone as a sort of modern version of french classical with a bar and two dining rooms. No pictures since my replacement camera only arrived today, but there are photos available. They serve french cuisine which was good and not as expensive as I would have expected. An interesting place, although its a bit of a drive and I'm not sure if we'll be going back soon.

PermalinkCommentscarnegies personal restaurant weekend nontechnical

The WHATWG Blog

2008 Oct 1, 1:08A weekly summary of the going-ons in the WHATWG usually on the topic of squabbles in HTML5 esp. what to do about the alt attribute in the img tag. Interesting stuff on charsets.PermalinkCommentsdevelopment software whatwg html5 html specification feed rss user-agent w3c

Debugging Toolbox

2008 Sep 30, 11:14Tools and hints for debugging esp. WinDbg. Some interesting things in here. "...When I'm not debugging applications with Windbg, I'm working on tools (utility software) like those presented in this blog. My tools should help you during your debugging or troubleshooting session. "PermalinkCommentsblog windows debug windbg powershell tool programming

Carnegie's Restaurant

2008 Sep 23, 10:58Matt says this is a good restaurant. It certainly looks interesting.PermalinkCommentsvia:swannman seattle food restaurant

Party Movies Recommended by Netflix

2008 Sep 18, 10:31
Poster for 24 Hour Party PeoplePoster for Human TrafficPoster for The Boys and Girls Guide to Getting Down

Netflix has recommended three party movies over my time with Netflix and if you're OK with movies featuring sex, drugs, rock&roll (or techno) as almost the main character then I can recommend at least The Boys and Girls Guide to Getting Down.

24 Hour Party People is based on the true story of Tony Wilson, journalist, band manager, and club owner (not all at once) around the rise of punk and new wave in England. Like many true-story based movies it starts off strong and very interesting but gets very slow at the end like the writers got bored and just started copying the actual events. Unless you have some interest in the history of music in the 80s in Manchester I don't recommend this movie.

Human Traffic is fun and funny following a group of friends going out for a night of clubbing and partying. I had to get over seeing John Simm as not The Master from Doctor Who but rather as a partying youth. It felt like it was geared towards viewers who were on something like the totally odd techno musical interludes with the characters dancing for no apparent reason. Otherwise the movie was good.

The Boys and Girls Guide to Getting Down is done in the style of an old educational movie on the topic of clubbing and partying. It sounds like a premise that would get old but they do a good job. While demonstrating drinking and driving they have scientists push a mouse around in a toy convertible. Enough said. It was funny and I recommend it.

PermalinkCommentsparty movie netflix
Older EntriesNewer Entries Creative Commons License Some rights reserved.