mit page 5 - Dave's Blog

Search
My timeline on Mastodon

s i x t h s e n s e - a wearable gestural interface (MIT Media Lab)

2009 Apr 3, 11:40"'SixthSense' is a wearable gestural interface that augments the physical world around us with digital information and lets us use natural hand gestures to interact with that information." The page is a lot easier to read with styling turned off. Actually, skip the text just watch the TED video.PermalinkCommentsvisualization design research mit hci mobile interactive ted

Gmail: Google's approach to email

2009 Apr 1, 9:54Lol at end of final sentence: "Two Gmail accounts can happily converse with each other for up to three messages each. Beyond that, our experiments have shown a significant decline in the quality ranking of Autopilot's responses and further messages may commit you to dinner parties or baby namings in which you have no interest."PermalinkCommentshumor google gmail ai email

New Dollar Sign Proposed by Congress to Reflect Economic Conditions | Typophile

2009 Apr 1, 9:32'To help stem the downward spiral of the United States economy Congress has proposed a new dollar symbol. "Updating fonts on the world's computers and devices would be a huge economic stimulus" said one representative after a late night session of the newly formed House Subcommittee - Font Economic Stimulus Technology Relief (FESTR). "The dollar is a shadow of its former self and the new design reflects this."'PermalinkCommentsart design humor font dollar-sign typography government economics

Justin Frankel's blog

2009 Mar 10, 9:22Justin Frankel (Previously Winamp/Nullsoft guy) makes a designated graffiti box on his garage with the note: "All are welcome to express themselves in the box below. Printing within the above box is hereby expressly permitted and shall not be considered 'graffiti' in accordance with article #23 of the San Francico Municipal Code." Before graffiti: , And with graffiti:PermalinkCommentsgraffiti cultural-disobediance legal san-francisco nullsoft justin-frankel blog

Code: Flickr Developer Blog - Panda Tuesday; The History of the Panda, New APIs, Explore and You

2009 Mar 10, 5:15"We built this ... (many people wished we hadn't) ... the Rainbow Vomiting Panda of Awesomeness as an experiment (which used Ling Ling fwiw)." WTF? "It's a stream of, on average, more interesting photos then you'd generally get from polling Everyone's photos. The quality is pretty good, the best thing to do is watch The Panda for a while and figure out if a) you want to build something with a live stream of photos b) you can build something more better than a vomiting panda (which lets face it, it pretty hard to top!)."PermalinkCommentshumor panda flickr reference api photos

The 'Is It UTF-8?' Quick and Dirty Test

2009 Mar 6, 5:16

I've found while debugging networking in IE its often useful to quickly tell if a string is encoded in UTF-8. You can check for the Byte Order Mark (EF BB BF in UTF-8) but, I rarely see the BOM on UTF-8 strings. Instead I apply a quick and dirty UTF-8 test that takes advantage of the well-formed UTF-8 restrictions.

Unlike other multibyte character encoding forms (see Windows supported character sets or IANA's list of character sets), for example Big5, where sticking together any two bytes is more likely than not to give a valid byte sequence, UTF-8 is more restrictive. And unlike other multibyte character encodings, UTF-8 bytes may be taken out of context and one can still know that its a single byte character, the starting byte of a three byte sequence, etc.

The full rules for well-formed UTF-8 are a little too complicated for me to commit to memory. Instead I've got my own simpler (this is the quick part) set of rules that will be mostly correct (this is the dirty part). For as many bytes in the string as you care to examine, check the most significant digit of the byte:

F:
This is byte 1 of a 4 byte encoded codepoint and must be followed by 3 trail bytes.
E:
This is byte 1 of a 3 byte encoded codepoint and must be followed by 2 trail bytes.
C..D:
This is byte 1 of a 2 byte encoded codepoint and must be followed by 1 trail byte.
8..B:
This is a trail byte.
0..7:
This is a single byte encoded codepoint.
The simpler rules can produce false positives in some cases: that is, they'll say a string is UTF-8 when in fact it might not be. But it won't produce false negatives. The following is table from the Unicode spec. that actually describes well-formed UTF-8.
Code Points 1st Byte 2nd Byte 3rd Byte 4th Byte
U+0000..U+007F 00..7F
U+0080..U+07FF C2..DF 80..BF
U+0800..U+0FFF E0 A0..BF 80..BF
U+1000..U+CFFF E1..EC 80..BF 80..BF
U+D000..U+D7FF ED 80..9F 80..BF
U+E000..U+FFFF EE..EF 80..BF 80..BF
U+10000..U+3FFFF F0 90..BF 80..BF 80..BF
U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF
U+100000..U+10FFFF F4 80..8F 80..BF 80..BF

PermalinkCommentstest technical unicode boring charset utf8 encoding

Why the Music Industry Hates Guitar Hero

2009 Feb 26, 11:41"Aerosmith has reportedly earned more from 'Guitar Hero : Aerosmith' than from any single album in the band's history." Games are usually more expensive than albums but still impressive stat.PermalinkCommentsvia:ethan_t_hein music guitar-hero videogames copyright art media rock-band ip riaa

Google: If You Commit a Felony, Don't Google It or You'll Go to Jail

2009 Jan 20, 11:40"But, when police searched his computer, they found Google searches from a couple days after the accident like, "auto parts, auto dealers out-of-state; auto glass, Las Vegas; auto glass reporting requirements to law enforcement, auto theft," according to the prosecutor. The coup de grace? He searched for "hit-and-run," which he followed to a page about the hit-and-run he committed."PermalinkCommentsprivacy google internet crime

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

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

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

A Picture is Worth a Thousand Locksmiths

2008 Nov 3, 2:01Software that can produce the design for a key from a photo of a key. "Scenes from one of the proof-of-concept telephoto experiments using a new software program from UC San Diego that can perform key duplication without having the key. Instead, the computer scientists only need a photograph of the key."PermalinkCommentssecurity photo software research paranoia key

YouTube - McCain at the Al Smith Dinner

2008 Oct 17, 11:24"John McCain at the Al Smith dinner"PermalinkCommentshuror video politics mccain obama election

YouTube - Obama Roasts McCain at Al Smith Dinner

2008 Oct 17, 11:23"Barack Obama speaks at the Alfred E. Smith Memorial Foundation Dinner"PermalinkCommentshumor video obama mccain youtube politics election

STGC Enumeration (Windows)

2008 Oct 1, 1:49One of the values in this enum is named 'STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE'. After reading (and re-reading to make sure I word broke correctly) I'm left with the lingering impression that I've had an extensive conversation with whoever named this variable. Anyway, I thought it was a fun name.PermalinkCommentshumor software msdn microsoft reference

de-Tor-iorate Anonymity, DefCon, (Nathan Evans and Christian Grothoff)

2008 Sep 22, 1:21Nathan Evans and Christian Grothoff, de-Tor-iorate Anonymity. The presentation notes for a DefCon talk about an attack on Tor in which the attacker may discover Tor nodes used in a session.PermalinkCommentstor anonymity privacy security network defcon

Xbox Achievements for Everyday Life

2008 Sep 16, 7:54

I just upgraded to the Zune 3.0 software which includes games and purchasing music on the Zune via WiFi and once again I'm thrilled that the new firmware is available for old Zunes like mine. Rooting around looking at the new features I noticed Zune Badges for the first time. They're like Xbox Achievements, for example I have a Pixies Silver Artist Power Listener award for listening to the Pixies over 1000 times. I know its ridiculous but I like it, and now I want achievements for everything.

Achievements everywhere would require more developments in self-tracking. Self-trackers, folks who keep statistics on exactly when and what they eat, when and how much they exercise, anything one may track about one's self, were the topic of a Kevin Kelly Quantified Self blog post (also check out Cory Doctorow's SF short story The Things that Make Me Weak and Strange Get Engineered Away featuring a colony of self-trackers). For someone like me with a medium length attention span the data collection needs to be completely automatic or I will lose interest and stop collecting within a week. For instance, Nike iPod shoes that keep track of how many steps the wearer takes. I'll also need software to analyze, display, and share this data on a website like Mycrocosm. I don't want to have to spend extreme amounts of time to create something as wonderful as the Feltron Report (check out his statistic on how many daily measurements he takes for the report). Once we have the data we can give out achievements for everything!

Achievements for Everyday Life
Carnivore
Eat at least ten different kinds of animals.
Make Friends
Meet at least 10% of the residents in your home town.
Globetrotter
Visit a city in every country.
You're Old
Survive at least 80 years of life.

Of course none of the above is practical yet, but how about Delicious achievements based on the public Delicious feeds? That should be doable...

PermalinkCommentsself-tracking data achievements

Studio Walljump Announces Liight For WiiWare - WiiWare World

2008 Sep 5, 1:56This is the game from the same person I linked to previously who has a son named Link: "I'm very excited to finally announce our first game, Liight, for WiiWare! So... what is it? Liight is a puzzle solving game where the pieces are colored lights and the goal is to make cool music! Anyone can play! Just illuminate all the targets in each puzzle with light of the matching color... but it's not always so easy! You'll have to mix colors, cast shadows and make the most of your limited resources to solve these brain teasers. Solve 100 challenging puzzles! Create your own puzzles, and Share them with your friends via WiiConnect24. Host a Contest to see who can solve your puzzle the fastest. If you're ready, take on Nonstop mode, a whole new way to play where arcade-style scoring meets split-second strategy!"PermalinkCommentsliight game videogame nintendo wii wiiware

Network notary system thwarts man-in-the-middle attacks

2008 Aug 26, 10:03"A new system devised by Carnegie Mellon University researchers aims to thwart man-in-the-middle (MitM) attacks by providing a way to verify the authenticity of self-signed certificates. The system, which is called Perspectives, uses a distributed network of "notary" servers to evaluate the public key of a target destination so that its validity can be ascertained."PermalinkCommentssecurity ssl pki certificate man-in-the-middle

Facebook Profile Views Application - Failed Idea

2008 Aug 21, 11:24

I had an idea for a Facebook app the other day. I wondered who actually looked at my profile and thought I could create a Facebook app that would record this information and display it. When I talked to Vishu though he said that this wasn't something that Facebook would be too happy with. Indeed the Platform Policy explicitly disallows this in section 2.8. This explained why the app didn't already exist. Its probably for the best since everyone assumes they can anonymously view Facebook profiles and would be irritated if that weren't the case.

On the topic of assumed anonymity, check out this article on the aggregation and selling off of your cell phone data including your physical location.

PermalinkCommentstechnical facebook privacy cellphone extension
Older EntriesNewer Entries Creative Commons License Some rights reserved.