wa page 36 - Dave's Blog

Search
My timeline on Mastodon

Mariners vs Rangers, Safeco Field, Seattle

2009 Jul 11, 1:57

sequelguy posted a photo:

Mariners vs Rangers, Safeco Field, Seattle

PermalinkCommentsseattle washington baseball safecofield

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

YouTube - Louis Vuitton "SUPERFLAT MONOGRAM"

2009 Jul 9, 10:53"...but the inside of his stomach is gateway to a psychadelic wonderland." Need I quote more? The whole thing made me think of a rather upbeat and trippy episode of Lain. Also, one of the repeating noises in the soundtrack made me think I was finishing a lap in Mario Kart.PermalinkCommentsvideo art ad commercial anime animation louis-vuitton superflat Takashi-Murakami cute psychadelic

WWIII Propaganda Posters - a set on Flickr

2009 Jul 7, 6:16I'm a sucker for the WWII propaganda posters.PermalinkCommentshumor twitter google propaganda poster flickr wwii via:swannman

Software Sleuthing : Date/Time Formats and Conversions

2009 Jul 7, 6:02More on converting between different date/time formats and the effective range of the formats.PermalinkCommentsdatetime time date programming c++ c technical

YouTube - SOUR Hibi no neiro

2009 Jul 6, 3:02"This music video was shot for Sour's 'Hibi no Neiro' (Tone of everyday) from their first mini album 'Water Flavor EP'. The cast were selected from the actual Sour fan base, from many countries around the world. Each person and scene was filmed purely via webcam."PermalinkCommentsvia:waxy sour music-video music video crowdsource youtube

Hand Drawn QR Code for Marc Jacobs - PSFK.com

2009 Jul 1, 6:21"The QR code, used to store and decode small bits of data via printed symbol, received an artistic rendering by SET as part of its campaign for Marc by Marc Jacobs." I like the idea although in this case its not very subtle or different from a regular QR code IMHO. Also, I was surprised that my phone could still read the QR code in this form.PermalinkCommentsqr qrcode marketing art internet mobile technical

Common Web Server software comparison report

2009 Jul 1, 2:24Stats on HTTP servers and HTTP server response headers. "Current statistics are based on a sample of 84604 probed servers, gathered in the last 386 days."PermalinkCommentshttp statistics server internet http-header via:mnot technical

Hard Drive weight increasing?

2009 Jun 30, 5:50"Thank you for posting on Microsoft Answers Forum. If we understand your question correctly, there is no possible way that copying files or installing programs is increasing the weight of your laptop. Also, the same with your Xbox, downloading games from the Arcade will not increase the weight of your Game Console. Just to explain a little bit more..." lolz ensuePermalinkCommentshumor microsoft msdn harddrive technical

WGMX 4 - Zombocalypse on Vimeo

2009 Jun 30, 4:59"Congratulations on not being devoured and purchasing the Wagglemax Zombocalypse TM Survival Kit"PermalinkCommentshumor video commercial ad apocalypse zombie horror for:hellosarah videogame

Eat Pants - Interactive Fiction Sessions from my Server Logs

2009 Jun 29, 4:19

I've looked at my web server logs previously to see if anyone had used my Web Frotz Interpreter and until recently didn't realize that awstats (the web server log report generator) was truncating the query from my URL, so I couldn't tell that anyone was actually using it. But after grepping the logs manually I've pulled out the URLs of visitor's text adventure sessions. If you'll recall, my Web Frotz Interpreter stores the game state in the URL so its easy to see user's game states in the web server logs.

I've put some of the links up on the Web Frotz Interpreter page. Some of the interesting ones:

PermalinkCommentsserver-logs technical zork frotz pants interactive-fiction uri if

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

The Music of Erich Zann

2009 Jun 29, 1:20"The Music of Erich Zann is a short film based on the story by H.P. Lovecraft. Though conditions inside the abandoned Savoy Hotel made this a very challenging project (Sub-freezing temperatures; cramped quarters; enough dust to suffocate Cthulhu himself), I was thrilled with the opportunity to work in such a haunting location, with such a talented and dedicated group of filmmakers."PermalinkCommentschris-shelton hp-lovecraft video movie

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

Bits Up!: DNS Prefetching for Firefox

2009 Jun 22, 3:28Details on Firefox's DNS prefetching: "The Firefox implementation takes this approach one step further than just pre-resolving anchor href hostnames. It uses the prefetch logic on URLs that are being included in the current document. By this I mean that it uses the prefetch logic on things like images, css, and jscript that are being loaded right away, in addition to anchor links which might be clicked on at a slightly later time."PermalinkCommentsdns dns-prefetching html performance networking firefox mozilla technical

Michael(tm) Smith - WebKit destined to get its own content sniffer

2009 Jun 22, 3:09"Web/browser-security maven and coder Adam Barth has been working on implementing a content sniffer in WebKit, based on a content-sniffing algorithm that was originally specified in the HTML5 draft, but that's now specified as a separate IETF draft that Adam is editing and that's titled, Content-Type Processing Model."PermalinkCommentsmime mime-sniffing webkit http technical

YouTube - John Hodgman at Radio & TV Correspondents' Dinner

2009 Jun 22, 2:42"Humorist John Hodgman was the entertainment headliner at the 2009 Radio and TV Correspondents' Dinner." John Hodgman does his thing and questions the president's nerd cred.PermalinkCommentshumor video nerd obama youtube john-hodgman politics

Coding4Fun : Look at me! Windows Image Acquisition

2009 Jun 20, 9:43How to use the WIA APIs in C#. WIA is Windows API to get images from scanners and cameras. And, as I found out, if you want to use the API in PowerShell try '$deviceManager = new-object -ComObject WIA.DeviceManager'PermalinkCommentsvideo scanner api wia csharp howto programming camera image photo .net webcam technical

Free OCR software? You may already have it... - Jon Galloway

2009 Jun 20, 9:39If you have Office installed you may have an OCR library sitting on your hard drive just waiting to be used via C#...PermalinkCommentsocr microsoft office .net automation scanner camera windows technical

Schneier on Security: Fraud on eBay

2009 Jun 19, 3:27You must wonder if Bruce Schneier is having trouble selling his laptop just because he's Bruce Schneier and he announced his sale on his blog. I thought his description was funny though: "But I still want to sell the computer, and I am pissed off at what is essentially a denial-of-service attack." A scam or attack to you or me is at worst a DoS to Bruce Schneier.PermalinkCommentsbruce-schneier ebay fraud security dos
Older EntriesNewer Entries Creative Commons License Some rights reserved.