isp page 3 - Dave's Blog

Search
My timeline on Mastodon

Using Progress Indicators in Windows PowerShell

2011 Jul 27, 10:33The write-progress command in powershell allows scripts to express their progress in terms of percent or time left and powershell displays this in a friendly manner at the top of my window. Surprisingly, not hooked up to the Shell's TaskbarItemInfo's progress.PermalinkCommentstechnical powershell progress coding shell

Telex

2011 Jul 18, 2:38Neat idea: "When the user wants to visit a blacklisted site, the client establishes an encrypted HTTPS connection to a non-blacklisted web server outside the censor’s network, which could be a normal site that the user regularly visits... The client secretly marks the connection as a Telex request by inserting a cryptographic tag into the headers. We construct this tag using a mechanism called public-key steganography... As the connection travels over the Internet en route to the non-blacklisted site, it passes through routers at various ISPs in the core of the network. We envision that some of these ISPs would deploy equipment we call Telex stations."PermalinkCommentsinternet security tools censorship technical

Augmented-reality mood-detection goggles: "a primer in the law of unintended consequences" - Boing Boing

2011 Jul 9, 1:49Glasses that whisper in your ear the mood of the person with whom you're speaking and a jerk-o-meter you wear around your neck that tells you when you're being a jerk. Social devices.PermalinkCommentssocial science tool augmented-reality

Hidden device distorts news on wireless networks, brews beer, is time machine - Hack a Day

2011 May 30, 3:13"We covered the Newstweek, a wall-wart sized box that injects fake news stories over public WiFi connections last February, but now there’s a great walk through and it seems our doubts about this project were disproved."PermalinkCommentssecurity journalism wifi hack technical

JavaScript & .NET interop via WebBrowser Control

2011 Apr 5, 10:00

For my GeolocMock weekend project I intended to use the Bing Maps API to display a map in a WebBrowser control and allow the user to interact with that to select a location to be consumed by my application. Getting my .NET code to talk to the JavaScript in the WebBrowser control was surprisingly easy.

To have .NET execute JavaScript code you can use the InvokeScript method passing the name of the JavaScript function to execute and an object array of parameters to pass:

this.webBrowser2.Document.InvokeScript("onLocationStateChanged",
new object[] {
latitudeTextBoxText,
longitudeTextBoxText,
altitudeTextBoxText,
uncertaintyTextBoxText
});

The other direction, having JavaScript call into .NET is slightly more complicated but still pretty easy as far as language interop goes. The first step is to mark your assembly as ComVisible so that it can interact with JavaScript via COM. VS had already added a ComVisible declaration to my project I just had to change the value to true.

[assembly: ComVisible(true)]

Next set ObjectForScripting attribute to the object you want to expose to JavaScript.

this.webBrowser2.ObjectForScripting = this.locationState;

Now that object is exposed as window.external in JavaScript and you can call methods on it.

window.external.Set(lat, long, alt, gUncert);

However you don't seem to be able to test for the existence of methods off of it. For example the following JavaScript generates an exception for me even though I have a Set method:

if (window.external && window.external.Set) {
PermalinkCommentsjavascript webbrowser .net technical csharp

Schneier on Security: Alerting Users that Applications are Using Cameras, Microphones, Etc.

2010 May 24, 6:26"What You See is What They Get: Protecting users from unwanted use of microphones, cameras, and other sensors," by Jon Howell and Stuart Schechter.

"We introduce the sensor-access widget, a graphical user interface element that resides within an application's display. The widget provides an animated representation of the personal data being collected by its corresponding sensor, calling attention to the application's attempt to collect the data."

Not sure how well that scales...PermalinkCommentstechnical security privacy research

Buzz by Mark Pilgrim from Buzz

2010 Mar 11, 3:33"The headers and captions on http://diveintohtml5.org/ use an open source font called "Essays 1743." The creator of that font was looking for a tutorial on HTML5, came across my site, and was pleasantly surprised to see his own work on prominent display. He now wants to update his font to include stylistically appropriate Unicode arrows, which I will then use with my captions.

The internet is awesome. It's so wonderfully intertwingled."PermalinkCommentshtml html5 mark-pilgrim font technical

NASA - Ohio Astronauts

2010 Feb 22, 10:18Ohio is home to a disproportionate number of US astronauts. Something like 24 out of 190 (12%). Compare that to the population of Ohio around 11 million out of the 312 million US population (3%).PermalinkCommentsastronomy ohio astronaut

View PDFs on Android

2010 Jan 10, 4:07

Irritatingly, my G1 won't show me PDFs so I've made the Google Docs PDF viewer which will load PDFs on the web up in Google Docs. Google Docs has the useful ability to display PDFs in web browsers without any Adobe software and works (mostly) on Android.

This was very easy to put together as an Android activity. First its necessary to register the application as handling PDFs from the web. This is done via the intent-filter declaration in the manifest:

   intent-filter
      action android:name="android.intent.action.VIEW"/
      data android:scheme="http" android:mimeType="application/pdf"/
      category android:name="android.intent.category.DEFAULT"/
      category android:name="android.intent.category.BROWSABLE"/
   /intent-filter
The action part says my activity will view PDFs, the data part says it accepts data with the PDF mime-type and with a URL that has an HTTP scheme. The browsable category is necessary to allow links from a browser to open this activity.

Second, the activity opens up the browser to Google Docs pointing to the PDF.

   Intent intent = new Intent();
   intent.setAction(getIntent().getAction());
   intent.setData(Uri.parse(
    "http://docs.google.com/gview?embedded=true&url=" + 
    percentEncodeForQuery(getIntent().getData().toString())));

   startActivity(intent);
This is very simple code to invoke a new intent browsing to a newly constructed URL for the PDF in Google Docs. That was easy.PermalinkCommentsgoogle docs technical g1 code activity programming android google pdf

Android eBook Reader And Makers

2009 Dec 13, 1:27

I was reading Makers, Cory Doctorow's latest novel, as it was serialized on Tor's website but with no ability to save my place within a page I set out to find a book reading app for my G1 Android phone. I stopped looking once I found Aldiko. Its got bookmarks within chapters, configurable fonts, you can look-up words in a dictionary, and has an easy method to download public domain and creative common books. I was able to take advantage of Aldiko's in-app book download system to get Makers onto my phone so I didn't have to bother with any conversion programs etc, and I didn't have to worry about spacing or layout, the book had the correct cover art, and chapter delimiters. I'm very happy with this app and finished reading Makers on it.

Makers is set in the near future and features teams of inventors, networked 3d printers, IP contention, body modifications, and Disney -- just the sort of thing you'd expect from a Cory Doctorow novel. The tale seems to be an allegory for the Internet including displacing existing businesses and the conflict between the existing big entertainment IP owners and the plethora of fans and minor content producers. The story is engaging and the characters filled out and believable. I recommend Makers and as always its Creative Commons so go take a look right now.

PermalinkCommentstor aldiko cory doctorow g1 makers ebook android book

How to be the world's greatest ISP

2009 Dec 9, 1:32"We're not always aware of it here in the USA, but there are many ISPs out there in the world who do things quite differently than what we're used to. Some of these ISPs ideas are even really good. Ars surveys the global ISP landscape and paints a picture of what a dream ISP might look like."PermalinkCommentstechnical internet isp web article

Official Google Blog: Automatic captions in YouTube

2009 Nov 20, 2:31YouTube now does automatic captioning in some cases and automatic timing in all cases. Automatic timing lets you upload a transcript with a video and YouTube will do speech to text and figure out when the various parts of the transcript need to be displayed.PermalinkCommentsyoutube video caption accessibility audio subtitles technical

The Answer Factory: Fast, Disposable, and Profitable as Hell | Magazine

2009 Oct 22, 12:33"When asked for the most valuable topic in Demand’s arsenal, he replies instantly: “‘Where can I donate a car in Dallas?’"PermalinkCommentsvia:kris.kowal wired internet video howto automation business media marketing economics advertising

Grocery Shopper Data Use

2009 Oct 13, 11:15

Photo of Hostess Pride chicken display from the Library of VirginaQFC, the grocery store closest to me, has those irritating shoppers cards. They try to motivate me to use it with discounts, but that just makes me want to use a card, I don't care whose card and I don't care if the data is accurate. They should let me have my data or make it useful to me so that I actually care.

I can imagine several useful tools based on this: automatic grocery lists, recipes using the food you purchased, cheaper alternatives to your purchases, other things you might like based on what you purchased, or integration with dieting websites or software. At any rate, right now all I care about is getting the discount from using a card, but if they made the data available to me then the grocery store could align our interests and I'd want to ensure the data's accuracy.

PermalinkCommentsidea boring data grocery store

Joho the Blog » Broadband. Trust them.

2009 Sep 25, 5:18"The closest the organization comes to stating its actual intent is in the wording of the print ad they’re running. Hmm. On the open medium of the Internet the organization hides its purpose, but in the controlled medium of print, they come close to stating it. How unexpected!"PermalinkCommentsnet-neutrality network-neutrality network internet broadband isp cable humor

How to Google Maps on Vimeo

2009 Aug 31, 4:53From Ira as part of The Balloon Project "... took the lo-fi diy map making essentials (portable helium tank, party balloons, and a disposable video camera) to Paris, France, where they launched a video camera into the sky not knowing where it would go, and created some very unique aerial cartography of the Place de la Concorde.' I'd love to see this run through photo stitching software like Photosynth and then layered on Google Maps.PermalinkCommentsmap balloon art ira-mowen france paris

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

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

A Brief History of Microsoft's Live Search's New Domain Bing

2009 Jun 1, 11:07
Logo for bing! from 2003 via The Wayback MachineLogo for BING* from 2006 via The Wayback MachineKimberly Saia's flickr photo of the Microsoft bing search logo.
When I heard that Live Search is now Bing one of my initial thoughts was how'd they get that domain name given the unavailability of pronouncable four letter .COM domain names. Well, the names been used in the past. Here now, via the Wayback Machine is a brief, somewhat speculative, and ultimately anticlimactic history of bing.com:

The new name reminds me of the show Friends. Also, I hope they get a new favicon - I don't enjoy the stretched 'b' nor its color scheme.

PermalinkCommentsmicrosoft technical domain history search archive dns bing

Dispatches from the Island: Went to a Castle

2009 May 22, 6:37Famous people are just like me! That is, Jorge Garcia (Hurley from Lost) also has a blog on which he writes about and posts pictures of his visit to the Neuschhwanstein Castle in Munich (the basis of the Disney castle). But apparently unlike me he didn't take the Bus of the Year 2005 to get to the castle.PermalinkCommentsvia:kottke hurley lost tv blog germany for:hellosarah
Older EntriesNewer Entries Creative Commons License Some rights reserved.