pub page 5 - Dave's Blog

Search
My timeline on Mastodon

Time lapse: Public helps build massive Lego light bulb | Boing Boing Gadgets

2009 Aug 4, 7:34PermalinkCommentsvideo time-lapse lego light-bulb

Linus Torvalds: "Microsoft hatred is a disease" - Ars Technica

2009 Jul 28, 3:39Linus Torvalds: "I'm a big believer in "technology over politics"...I may make jokes about Microsoft at times, but at the same time, I think the Microsoft hatred is a disease." This goes well with his previous quote calling Slashdot a "big public wanking session".PermalinkCommentslinux linus-torvalds microsoft politics technical

Code Rush - Mozilla documentary (PCR | Click Movement)

2009 Jul 10, 7:37"Code Rush aired nationally on PBS in March 2000. It documents the Mozilla team as they struggle to publish the first open source release of the Netscape Browser."PermalinkCommentsvideo mozilla browser browser-war internet opensource documentary free download web technical

You may use your class notes and Feynman (Bill Ward - All - Humor - Story)

2009 Jun 29, 1:23"'You have 3 hours. You may use your class notes and Feynman.' "Feynman" of course referred the Feynman physics lecture notes which are published in three volumes. On reading these instructions one particularly alert student grabbed his exam and ..."PermalinkCommentshumor richard-feynman physics education

PowerShell Scanning Script

2009 Jun 27, 3:42

I've hooked up the printer/scanner to the Media Center PC since I leave that on all the time anyway so we can have a networked printer. I wanted to hook up the scanner in a somewhat similar fashion but I didn't want to install HP's software (other than the drivers of course). So I've written my own script for scanning in PowerShell that does the following:

  1. Scans using the Windows Image Acquisition APIs via COM
  2. Runs OCR on the image using Microsoft Office Document Imaging via COM (which may already be on your PC if you have Office installed)
  3. Converts the image to JPEG using .NET Image APIs
  4. Stores the OCR text into the EXIF comment field using .NET Image APIs (which means Windows Search can index the image by the text in the image)
  5. Moves the image to the public share

Here's the actual code from my scan.ps1 file:

param([Switch] $ShowProgress, [switch] $OpenCompletedResult)

$filePathTemplate = "C:\users\public\pictures\scanned\scan {0} {1}.{2}";
$time = get-date -uformat "%Y-%m-%d";

[void]([reflection.assembly]::loadfile( "C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll"))

$deviceManager = new-object -ComObject WIA.DeviceManager
$device = $deviceManager.DeviceInfos.Item(1).Connect();

foreach ($item in $device.Items) {
        $fileIdx = 0;
        while (test-path ($filePathTemplate -f $time,$fileIdx,"*")) {
                [void](++$fileIdx);
        }

        if ($ShowProgress) { "Scanning..." }

        $image = $item.Transfer();
        $fileName = ($filePathTemplate -f $time,$fileIdx,$image.FileExtension);
        $image.SaveFile($fileName);
        clear-variable image

        if ($ShowProgress) { "Running OCR..." }

        $modiDocument = new-object -comobject modi.document;
        $modiDocument.Create($fileName);
        $modiDocument.OCR();
        if ($modiDocument.Images.Count -gt 0) {
                $ocrText = $modiDocument.Images.Item(0).Layout.Text.ToString().Trim();
                $modiDocument.Close();
                clear-variable modiDocument

                if (!($ocrText.Equals(""))) {
                        $fileAsImage = New-Object -TypeName system.drawing.bitmap -ArgumentList $fileName
                        if (!($fileName.EndsWith(".jpg") -or $fileName.EndsWith(".jpeg"))) {
                                if ($ShowProgress) { "Converting to JPEG..." }

                                $newFileName = ($filePathTemplate -f $time,$fileIdx,"jpg");
                                $fileAsImage.Save($newFileName, [System.Drawing.Imaging.ImageFormat]::Jpeg);
                                $fileAsImage.Dispose();
                                del $fileName;

                                $fileAsImage = New-Object -TypeName system.drawing.bitmap -ArgumentList $newFileName 
                                $fileName = $newFileName
                        }

                        if ($ShowProgress) { "Saving OCR Text..." }

                        $property = $fileAsImage.PropertyItems[0];
                        $property.Id = 40092;
                        $property.Type = 1;
                        $property.Value = [system.text.encoding]::Unicode.GetBytes($ocrText);
                        $property.Len = $property.Value.Count;
                        $fileAsImage.SetPropertyItem($property);
                        $fileAsImage.Save(($fileName + ".new"));
                        $fileAsImage.Dispose();
                        del $fileName;
                        ren ($fileName + ".new") $fileName
                }
        }
        else {
                $modiDocument.Close();
                clear-variable modiDocument
        }

        if ($ShowProgress) { "Done." }

        if ($OpenCompletedResult) {
                . $fileName;
        }
        else {
                $result = dir $fileName;
                $result | add-member -membertype noteproperty -name OCRText -value $ocrText
                $result
        }
}

I ran into a few issues:

PermalinkCommentstechnical scanner ocr .net modi powershell office wia

Why we link: A brief rundown of the reasons your news organization needs to tie the Web together - Publishing 2.0

2009 Jun 12, 9:02"Because linking to sources and resources is the key gesture to being a citizen of the Web and not just a product on the Web...If, on the other hand, you want to embrace the traits that make blogs, Twitter, and so many other online communication tools a vital part of the daily life of your readers, your news site shouldn't feel like an endpoint in the conversation. It should feel like the beginning."PermalinkCommentsvia:sambrook journalism news internet web article link

Using BitTorrent to Retrieve Objects Stored in Amazon S3

2009 May 29, 12:12"Any object in Amazon S3 that can be read anonymously can also be downloaded via BitTorrent. ... Retrieving a .torrent file for any publicly available object is easy. Simply add a "?torrent" query string parameter at the end of the REST GET request for the object." Yes, this is awesome!PermalinkCommentstorrent amazon s3 bittorrent p2p via:pskomoroch

Joho the Blog - [berkman] Kenneth Crews on academic copyright

2009 May 13, 10:17"Harvard's Office for Scholarly Communication has brought Kenneth Crews of Columbia Law School to talk about "Protecting Your Scholarship: Copyrights, Publication Agreements, and Open Access.""PermalinkCommentsharvard kenneth-crews berkman david-weinberger blog copyright talk live-blog

A Bulbdial Clock - Evil Mad Scientist Laboratories

2009 Apr 9, 8:56Someone implemented the Ironic Sans artificial sundial clock concept! "Last year David Friedman published on his blog Ironic Sans an interesting design concept for something that he called The Bulbdial Clock. That's like a sundial, but with better resolution-- not just an hour hand, but a minute and second hand as well, each given as a shadow from moving artificial light sources (bulbs). We've recently put together a working bulbdial clock, with an implementation somewhat different from that of the original concept."PermalinkCommentshowto diy clock led sundial via:swannman

Kal Penn [spoiler redacted] for White House | TV | A.V. Club

2009 Apr 7, 5:26"According to an exclusive interview Penn gave to Entertainment Weekly's Michael Ausiello, he's been asked to serve in the Obama administration as as the associate director of the office of public liaison." Spoilers in the link.PermalinkCommentskal-penn house tv politics

Twitter switch for Guardian, after 188 years of ink | Media | The Guardian

2009 Apr 1, 9:20"Consolidating its position at the cutting edge of new media technology, the Guardian today announces that it will become the first newspaper in the world to be published exclusively via Twitter"PermalinkCommentshumor news twitter journalism newspaper

The Old New Thing : How does Raymond decide what to post on any particular day?

2009 Feb 27, 11:00Raymond Chen has a years worth of blog content written and scheduled! "To give you an idea of how far in advance I write my blog entries, I wrote this particular entry on February 13, 2008. ... this particular entry ended up on February 27, 2009 because that was the next available open day. ... Now, with a buffer of over a year, I do have quite a bit of leeway in choosing when any particular article is published." Humorous commentor John writes in response: "If you were to disappear off the face of the Earth, how long would it be before we knew?"PermalinkCommentsblog raymond-chen writing humor

Meteorology Law of the People's Republic of China -- china.org.cn

2009 Feb 4, 4:16From Sorting it all Out wrt the weather gadget in Vista's sidebar, this link to China's laws on weather forecast: "Article 22 The State applies a unified system for the issue of public meteorological forecast and severe weather warning... No other organizations or individuals may issue to the community such forecast or warning." "Article 25 When the media, including radio, television, newspaper and telecommunication, issue to the community public meteorological forecast or severe weather warning, they shall use the latest meteorological information provided by a meteorological office... Part of the revenues from the distribution of meteorological information shall be drawn to support the development of meteorological service." Whether an application is legally allowed to provide a weather forecast is not an attribute I would have imagined necessary for a localization API.PermalinkCommentsvia:michael-kaplan china law legal politics weather forecast localization

The WHATWG Blog - Blog Archive - This Week in HTML 5 - Episode 20

2009 Feb 3, 11:15"r2719 specifies that browsers should not allow scripts to set document.domain to anything on the Public Suffix List, such as "com" or "co.jp". Essential background reading on why this is dangerous: Untraceable XSS Attacks. Most browsers already block this attack, e.g. Firefox since 3.0. [Background: Re: Setting document.domain]"PermalinkCommentshtml5 tld publicsuffix dns security html internet web reference w3c

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

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

Google LatLong: New ways to get around with the Transit Layer

2009 Jan 14, 2:03Google Maps now has a public transit route finder. Would have been useful in Munich and certainly will be useful here at home since they cover the Seattle area including the east-side. "I'm pleased to announce the launch of the Transit Layer on Google Maps in more than 50 cities around the world making it easier for citizens and tourists around the globe to access public transportation line information in their cities."PermalinkCommentsgoogle map travel bus traffic seattle redmond munich transportation maps public-transportation transit

makezine.tv: MAKE: technology on your time

2008 Dec 30, 1:03"Introducing Make: television, Coming in January 2009: A new national series from MAKE magazine, Twin Cities Public Television, and American Public Television"PermalinkCommentspbs tv make diy community hack via:boingboing

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

Back From Germany

2008 Dec 14, 4:59

View from Jon'sSarah and I are back from Munich, Germany as of Thursday and I've just about recovered. The trip there via Air France we watched many movies and it was much better than the trip back in which the entertainment system failed and I had a cold. When we arrived, Jon met us at the airport, helped us with the subway system, we played Guitar Hero, ate at a Bavarian pub, and then later at an Australian bar.

Neuschwanstein CastleThe following day we met up with Jon and three of his friends, one of whom was visiting from England and we all took a train to Neuschwanstein Castle. Apparently its the 'Disney' castle in that Disney's castle's are based upon it. The castle is filled with images and statues of swans in homage to the Swan Knight. We ate in the town at a cafe with traditional Bavarian food before taking the train back and getting all you can eat fajitas for dinner.

PermalinkCommentsgermany personal vacation nontechnical
Older EntriesNewer Entries Creative Commons License Some rights reserved.