History page 6 - Dave's Blog

Search
My timeline on Mastodon

A Reporter at Large: Atomic John: Reporting and Essays: The New Yorker

2008 Dec 29, 2:20"But the most accurate account of the bomb's inner workings-an unnervingly detailed reconstruction, based on old photographs and documents-has been written by a sixty-one-year-old truck driver from Waukesha, Wisconsin, named John Coster-Mullen, who was once a commercial photographer, and has never received a college degree."PermalinkCommentsvia:swannman bomb atom-bomb atomic-bomb history goverment nuclear physics security research science

The (Mostly) True Story of Helvetica and the New York City Subway: Voice: AIGA Journal of Design: Writing: AIGA

2008 Nov 22, 6:01"There is a commonly held belief that Helvetica is the signage typeface of the New York City subway system, a belief reinforced by Helvetica, Gary Hustwit's popular 2007 documentary about the typeface. But it is not true - or rather, it is only somewhat true"PermalinkCommentsvia:swannman nyc subway history font typography sign helvetica

Best Esquire Magazine Stories - Top Articles in History of Journalism - Esquire

2008 Nov 22, 5:59"Five years ago, we named 'Frank Sinatra Has a Cold,' by Gay Talese, the greatest story Esquire ever published. Here, as we close out our 75th anniversary celebration, are the top seven, with several republished online in their entirety for the first time ever."PermalinkCommentsvia:swannman esquire article essay humor

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

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

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

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

Tom Ricks's Inbox - washingtonpost.com

2008 Oct 13, 2:40Watch out for too good to be true washing services (or free network traffic anonymization): "The laundry would then send out "color coded" special discount tickets, to the effect of "get two loads for the price of one," etc. The color coding was matched to specific streets and thus when someone brought in their laundry, it was easy to determine the general location from which a city map was coded. While the laundry was indeed being washed, pressed and dry cleaned, it had one additional cycle -- every garment, sheet, glove, pair of pants, was first sent through an analyzer, located in the basement, that checked for bomb-making residue." From the comment section of Schneier on Security on this topic: "Yet another example of how inexpensive, reliable home washers and dryers help terrorists. When will we learn?"PermalinkCommentssecurity history laundromat ira terrorism bomb

FORTRAN Coloring Book

2008 Oct 9, 11:50An old coloring book that teaches you FORTRAN.PermalinkCommentsprogramming humor book history fortran coloring-book education

YouTube - KEATING ECONOMICS: John McCain & The Making of a Financial Crisis

2008 Oct 7, 4:52"KEATING ECONOMICS: John McCain & The Making of a Financial Crisis", Obama campaign's faux-documentary on McCain's involvement in the 80's Keating financial crisis.PermalinkCommentseconomics politics obama mccain video youtube history documentary

The diskette that blew Trixters mind - Oldskooler Ramblings

2008 Sep 29, 1:45"So the manual is correct, and this truly is a mixed-format, mixed-architecture, mixed-sided diskette. This diskette has officially blown my mind."PermalinkCommentshack disk hardware history game computer

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

petacentres - a set on Flickr

2008 Sep 9, 8:31Cory Doctorow's Flickr set of photos from various data centers (like CERN's LHC data center).PermalinkCommentsphotos flickr data storage history internet cory-doctorow cern internet-archive lhc

Big data: Welcome to the petacentre : Nature News

2008 Sep 9, 8:29Article on the data centers that backup the Internet Archive and handle CERN's LHC's data. "CERN embodies borderlessness. The Swiss-French border is a drainage ditch running to one side of the cafeteria; it was shifted a few metres to allow that excellent establishment to trade the finicky French health codes for the more laissez-fair Swiss jurisdiction. And in the data sphere it is utterly global."PermalinkCommentslhc history internet cory-doctorow nature physics network hardware library science cern internet-archive

WebAIM: Blog - History of the browser user-agent string

2008 Sep 8, 7:00A brief history of user agent strings in web browsers, culminating in: "And thus Chrome used WebKit, and pretended to be Safari, and WebKit pretended to be KHTML, and KHTML pretended to be Gecko, and all browsers pretended to be Mozilla, and Chrome called itself Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13, and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded."PermalinkCommentshumor internet browser mozilla google chrome user-agent ie

Our Local Correspondents: Up and Then Down: Reporting & Essays: The New Yorker

2008 Sep 8, 11:40"Up and Then Down: The lives of elevators. by Nick Paumgarten". A story on elevators, the people behind them, elevator mishaps, etc. Interesting article.PermalinkCommentsarticle elevator history design newyorker

INTOURIST Soviet Union Russia Labels - a set on Flickr

2008 Aug 29, 10:44Cool 30's Soviet Union tourist brochure logos and designs. "Intourist was renowned as the official state travel agency of the Soviet Union. It was founded in 1929 by Joseph Stalin and was responsible for managing the great majority of foreigners' access to, and travel within, the Soviet Union. It grew into one of the largest tourism organizations in the world, with a network embracing banks, hotels, and money exchanges. Some of the best Intourist labels and brochures produced during the 1930's were designed by A. Selensky. Some of the labels in this set are signed by him, including a rare constructivist style travel brochure I have included as well."PermalinkCommentsflickr photo propaganda graphic russia history design

IE8 Beta2 Shipped

2008 Aug 27, 11:36

Internet Explorer 8 Beta 2 is now available! Some of the new features from this release that I really enjoy are Tab Grouping, the new address-bar, and InPrivate Subscriptions.

Tab Grouping groups tabs that are opened from the same page. For example, on a Google search results page if you open the first two links the two new tabs will be grouped with the Google search results page. If you close one of the tabs in that group focus goes to another tab in that group. Its small, but I really enjoy this feature and without knowing exactly what I wanted while using IE7 and FF2 I knew I wanted something like this. Plus the colors for the tab groups are pretty!

The new address bar and search box makes life much easier by searching through my browsing history for whatever I'm typing in. Other things are searched besides history but since I ignore favorites and use Delicious I mostly care about history. At any rate its one of the things that makes it impossible for me to go machines running IE7.

InPrivate Subscriptions allows you to subscribe to a feed of URLs from which IE should not download content. This is intended for avoiding sites that track you across websites and could sell or share your personal information, but this feature could be used for anything where the goal is to avoid a set of URLs. For example, phishing, malware sites, ad blocking, etc. etc. I think there's some interesting uses for this feature that we have yet to see.

Anyway, we're another release closer to the final IE8 and I can relax a little more.

PermalinkCommentsmicrosoft browser technical ie8 ie

Flickr: Seattle Municipal Archives

2008 Aug 25, 11:39"The Seattle Municipal Archives documents the history, development, and activities of the agencies and elected officials of the City of Seattle. Strengths of the records include those documenting engineering, parks, urban planning, the legislative process and elected officials. Holdings include over 6,000 cubic feet of textual records; 3,000 maps and drawings, 3,000 audiotapes; hundreds of hours of motion picture film; and over 1.5 million photographic images of City projects and personnel."PermalinkCommentsvia:swannman photo flickr seattle history public-domain

Early Creative Commons history, my version (Lessig Blog)

2008 Aug 14, 2:23Lawrence Lessig's video presentation on history of Creative Commons.PermalinkCommentslawrence-lessig lessig video legal law cc history copyright
Older EntriesNewer Entries Creative Commons License Some rights reserved.