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.technicalpowershellprogresscodingshell
2011 Jul 6, 7:28"Over this past Fourth Of July weekend, we neglected to note that it was the 15th anniversary of Roland Emmerich’s 1996 blockbuster Independence Day. New York comedian Sean Kleier remembered, and
decided to make his own tribute, going to various locations around New York City—Times Square, the Brooklyn Bridge, the subway, and inside a Victoria’s Secret—reciting Bill Pullman’s rousing speech
before the movie's final battle sequence, megaphone and all." humorvideobill-pullmanindependence-daynew-york
2011 Jul 1, 10:17"A method for obscuring location information is described. Both static and changing location information can be obscured. A single distance measure is input to the process; this parameter controls
the precision of location information that can be extracted by a recipient."geolocgeolocationtechnicalrfcstandardreference
2011 Jul 1, 10:15"This specification defines the canonical link relation -- an element which designates the preferred version of content/URI from a set of duplicate or near duplicate pages."linkuriurlhtmlreltechnicalstandardrfccanonical
2011 Jul 1, 10:12" Historically, protocol designers and implementers distinguished
between "standard" and "non-standard" parameters by prefixing the
latter with the string "X-". On balance, this "X-" convention has
more costs than benefits, although it can be appropriate in certain
circumstances."prefixtechnicalstandradrfcuriurlx-
2011 Jun 21, 1:22"This document defines the concept of an "origin", which is often used
as the scope of authority or privilege by user agents. Typically,
user agents isolate content retrieved from different origins to
prevent malicious web site operators from interfering with the
operation of benign web sites. In addition to outlining the
principles that underly the origin concept, this document defines how
to determine the origin of a URI, how to serialize an origin into a
string, and an HTTP header, named "Origin", that indicates which
origins are associated with an HTTP request."ietfreferencetechnicalwebbrowseruser-agentwebbrowserorigin
2011 May 26, 1:28This was on my todo list. I'll scratch it off knowing far more funded folks are doing this: "A startup called BlueStacks has developed an Android runtime environment for the Windows operating system.
It will enable users to run Android applications alongside conventional Windows software on Microsoft's operating system." "One example would be a convertible netbook tablet that normally runs
Windows but switches to an Android interface for greater touch-friendliness when the screen is flipped.
Such a product would offer the full power and multitasking capabilities of Windows but also benefit from having access to Android's broad touch-enabled software ecosystem."windowsprogrammingandroidjavatechnical
2011 May 22, 10:38One step closer to completely deprecating the original URI spec by pulling out the ftp URI scheme specification into its own new updated spec!uriurlftpuri-schemeietfrfcreferencetechnical
2011 May 10, 10:49Interesting standards disagreements showing up in specs: "Some implementers feel a same-origin restriction should be the default for all new resource types while others feel strongly that an opt-in
strategy usuable for all resource types would be a better mechanism and that the default should always be to allow cross-origin linking for consistency with existing resource types (e.g. script,
images). As such, this section should be considered at risk for removal if the consensus is to use an alternative mechanism."referencewebdevelopmentfontspecificationw3ccss3
2011 May 2, 7:33I recalled that the order of function/method parameter evaluation was not specified by C++ standard, but I didn't know the more general rule and the associated implications for the double check
locking construct. Interesting.technicalc++programming
2011 Apr 27, 3:12Prescriptive spec on URI parsing. "This document contains a precise specification of how browsers process URLs. The behavior specified in this document might or might not match any particular
browser, but browsers might be well-served by adopting the behavior defined herein."technicalrfcreferenceuri
2011 Apr 20, 2:27"JSON (JavaScript Object Notation) Patch defines the media type "application/patch+json", a JSON-based document structure for specifying partial modifications to apply to a JSON document."jsonreferencepatchmimemimetypetechnical
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."technicalinternetprivacygeogeolocationsecurity
2011 Apr 6, 3:52Humorous quote from the doc: "While we readily agree that the naming of IPv6 address parts is not the most pressing concern the Internet is facing today, a common nomenclature is important for
efficient communication."humortechnicalipv6namedocumentationietfrfc
I used FiddlerCore in GeolocMock to edit HTTPS responses and ran into two stumbling
blocks that I'll document here. The first is that I didn't check if the Fiddler root cert existed or was installed, which of course is necessary to edit HTTPS traffic. The following is my code
where I check for the certs.
if (!Fiddler.CertMaker.rootCertExists()) { if (!Fiddler.CertMaker.createRootCert()) { throw new Exception("Unable to create cert for FiddlerCore."); } }
if (!Fiddler.CertMaker.rootCertIsTrusted()) { if (!Fiddler.CertMaker.trustRootCert()) { throw new Exception("Unable to install FiddlerCore's cert."); } }
The second problem I had (which would have been solved had I read all the sample code first) was that my changes weren't being applied. In my app I only need the BeforeResponse but in order to
modify the response I must also sign up for the BeforeRequest event and mark the bBufferResponse flag on the session before the response comes back. For example:
Fiddler.FiddlerApplication.BeforeRequest += new SessionStateHandler(FiddlerApplication_BeforeRequest); Fiddler.FiddlerApplication.BeforeResponse += new SessionStateHandler(FiddlerApplication_BeforeResponse); ... private void FiddlerApplication_BeforeRequest(Session oSession) { if (IsInterestingSession(oSession)) { oSession.bBufferResponse = true; } }
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.
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:
Working on GeolocMock it took me a bit to realize why my HTML could use the W3C Geolocation API in IE9 but not in my WebBrowser control in
my .NET application. Eventually I realized that I was getting the wrong IE doc mode. Reading this old More IE8 Extensibility Improvements IE blog post from the IE blog I found the issue is that for app
compat the WebOC picks older doc modes but an app hosting the WebOC can set a regkey to get different doc modes. The IE9 mode isn't listed in that article but I took a guess based on the values
there and the decimal value 9999 gets my app IE9 mode. The following is the code I run in my application to set its regkey so that my app can get the IE9 doc mode and use the geolocation API.