age page 33 - Dave's Blog

Search
My timeline on Mastodon

Internet probe can track you down to within 690 metres - tech - 05 April 2011 - New Scientist

2011 Apr 8, 2:07"On average their method gets to within 690 metres of the target and can be as close as 100 metres – good enough to identify the target computer's location to within a few streets.", "When a landmark machine and the target computer have shared a router, the researchers can compare how long a packet takes to reach each machine from the router; converted into an estimate of distance, this time difference narrows the search down further."PermalinkCommentstechnical internet privacy geo geolocation security

HTTP/1.1, part 1: URIs, Connections, and Message Parsing

2011 Apr 5, 3:29PermalinkCommentshttp uri url technical https

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

Using client-side storage, today. ✩ Mozilla Hacks – the Web developer blog

2011 Apr 5, 5:14A JS wrapper script that lets you use storage in IE6/7 via userData or localStorage every where else.PermalinkCommentsjavascript html web webbrowser storage technical userdata localstorage

1996 HULU

2011 Apr 3, 11:32Hulu's would-be homepage from 1996 April 1st. Includes X-Files slow loading 256 color gifs!PermalinkCommentsaprilfools humor hulu video technology history web

Oregon Trail: How three Minnesotans forged its path - Page 1 - News - Minneapolis - City Pages

2011 Mar 18, 6:17The history of Oregon TrailPermalinkCommentshistory education programming game

JavaScript Garden

2011 Mar 14, 1:33A great intro to the details of JavaScript for developers familiar with other languages but only a passing knowledge of JavaScript.PermalinkCommentsjavascript tutorial programming reference technical

Fire lane sign in snow

2011 Feb 24, 8:10

PermalinkCommentssnow sign firelane flickrmanager windowsphone7

[whatwg] Proposal for IsSearchProviderInstalled / AddSearchProvider

2011 Feb 23, 2:17Proposal to standardize on the function to add search providers in user agents.PermalinkCommentstechnical search-provider browser webbrowser web whatwg

Never annoy a Surrealist. - Comically Vintage : We place vintage comics out of context. Hilarity ensues!

2011 Feb 19, 1:33
PermalinkCommentshumor comic fish

Reviewing the winners of the Design Julian Assange's Next Hairstyle competition. - Boing Boing

2011 Jan 19, 7:44Lol at Team Rocket Julian Assange.
PermalinkCommentsjulian-assange humor image photo photoshop

WP_000013

2010 Dec 31, 4:51

PermalinkCommentsflickrmanager windowsphone7

WP_000021

2010 Dec 31, 4:09

PermalinkCommentsflickrmanager windowsphone7

WP_000020

2010 Dec 31, 4:02

PermalinkCommentsflickrmanager windowsphone7

Snow road

2010 Dec 29, 5:12

PermalinkCommentsroad snow redmond wa flickrmanager windowsphone7

Bidi in URLs - Macchiato

2010 Dec 20, 3:15PermalinkCommentsbidi url uri language blog idn technical

Word Lens augmented reality app instantly translates whatever you point it at -- Engadget

2010 Dec 17, 6:17
PermalinkCommentsiphone app translation video language phone mobile augmented-reality

http://elsloganero.wordpress.com/

2010 Dec 1, 7:19PermalinkCommentsdesign image humor

epic bunneh - Lolcats 'n' Funny Pictures of Cats - I Can Has Cheezburger?

2010 Dec 1, 4:59
PermalinkCommentshumor bunny image photo

Geek Optimism

2010 Nov 3, 7:07
PermalinkCommentshumor geek image glass water
Older EntriesNewer Entries Creative Commons License Some rights reserved.