Friday, November 21, 2014

2014-11-21 Friday - CERN Open Data

2014-11-21 Friday - Toshiba Qosmio X70-AST3G26 Laptop

I'm not quite yet ready to pull the trigger on buying a new laptop - but sometime in 2015 I think I will do so.

The specs for the Toshiba Qosmio X70-AST3G26 Laptop look quite appealing...something beefy enough to use as a portable development workstation...

  • Intel® Core™ i7-4700MQ Processor
  • 32GB DDR3L 1600MHz memory
  • 3GB GDDR5 NVIDIA® GTX770M with Optimus™ Technology
  • 2.75TB: 256GB Solid State Drive (mSATA, SSD) + 1.0TB (5400 RPM, Serial ATA) + 1.5TB (5400 RPM, Serial ATA)
  • Blu-ray Disc™ Rewriteable (BD-RE) and DVD SuperMulti drive
  • FHD TruBrite® TFT LED Backlit Display with Intel® Wireless Display Technology
  • Intel® Dual-Band Wireless-N 7260 2x2 AC + Bluetooth® 4.0
  • Premium Frameless LED Backlit Raised Tile Keyboard with 10-Keypad (black)
  • 10/100/1000 Ethernet LAN
  • Starting at 7.6 lbs
  • Black Widow Styling in Textured Aluminum

Tuesday, November 18, 2014

2014-11-18 Tuesday - NVIDIA SHIELD Tablet Android Lollipop

When looking for high performance technical computing tools, I often consider computing platforms that have been specifically designed for heavy duty gaming - but which would be just as fitting in an office environment.

I'm intrigued by the computing power bundled into the latest NVIDIA Shield  tablet with Android Lollipop...

NVIDIA SHIELD Tablet Android Lollipop Update Hands-On With Benchmarks

2014-11-18 Tuesday - XPerf

This posting is a placeholder for links and information regarding Windows Performance Toolkit

Two Minute Drill: Introduction to XPerf

XPERF and the Windows Performance Toolkit

Windows Performance Toolkit Technical Reference

Xperf Command-Line Reference

Monday, November 10, 2014

2014-11-10 Monday - QCon San Francisco Trip Report

Last week I attended QCon in San Francisco as a Gold Alumni (which included a free O'Reilly book)

I flew into SFO on Sunday and caught a cab (~$55) to the Hyatt Regency (I splurged for a balcony / bay view room - $295/night conference rate).  The hotel is really top shelf - and the venue was an excellent choice. The 7-11 and Starbucks across the street allowed me to refuel with moderate expenses for some additional refreshments.

The conference spanned three days (Mon-Wed) - with two days of tutorials on Thur-Fri.

Several familiar faces were speaking this year - but many/most were new.

LinkedIn and Netflix - as well as Google and Facebook - had some of the most interesting presentations.

I enjoyed meeting Bruce Schneier after his keynote:

Some of my favorite sessions included:

Jafar Husain
Asynchronous Programming at Netflix

Neha Narkhede
Samza in LinkedIn: How LinkedIn Processes Billions of Events Everyday in Real-time

NOTE: Neha is a true standout at this year's QCon - she is an established professional - with solid accomplishments - but she is still early in her arc of success - she is definitely someone that will have even bigger successes in her future. A definite rising star...

Aaron Gardner
Etsy Search: How we index and query 26 million one-of-a-kind items

Jeff Lindsay
Real-world Docker: Past, Present, and Future

Randy Shoup
Concurrency at Large-Scale: The Evolution to Reactive Microservices

I met Randy at a previous QCon some years ago - and have sat in on one of Java One presentations at Oracle World. He is a top shelf speaker - always informative, thought provoking, and entertaining. My one suggestion to anyone that ever has a chance to work for him: Immediately quit whatever else you are doing and go work with this guy. You will gain an invaluable education and the depth of your experience and knowledge will be magnified far beyond your imagination.

Sean Taylor
Putting the Magic in Data Science @ Facebook

One of the most informative sessions for me this year...

Lin Qiao
Gobblin: A Framework for Solving Big Data Ingestion Problem

Another rising star to watch for in the future...

Julien Le Dem
Efficient Data Storage for Analytics with Parquet 2.0

The hotel offered a town car service to the airport ($65) - which was a bit of an extravagance and indulgence on my part - a welcome reward for the last few years of multi-year client engagements.

Overall, it was a good trip - just the tonic I was seeking for inspiration, insight, and motivation.

Thursday, October 02, 2014

Saturday, March 15, 2014

2014-03-15 Saturday - Research: Launching Applications via Custom Protocols

This weekend I'm researching options for integrating a client's custom application so that it can be launched by users from within a browser.  These are the links to the resources that I've found to be of the most interest - hopefully this will be use some use to someone else in the future.

Microsoft Windows / IE Related Notes

Understanding Protocols

  • In most cases, the invoked URL is injected to replace the %1 parameter in the registered \Shell\Open\Command.
  • Windows 7 and later also support protocol invocation via the IExecuteCommand::DelegateExecute COM mechanism, instead of using the Shell Open Command. Some browsers do not yet properly support DelegateExecute because they first look for a Shell Open Command in the registry before passing a URL to ShellExecute.
  • Thanks to their simplicity, and to the fact that the Windows ShellExecuteEx function can easily be used to launch such protocols, all major Windows web browsers (IE, Firefox, Chrome, Safari, Opera) support Application Protocols. However, there are some important differences in behavior between browsers.
  • despite their simplicity, Application Protocols have nevertheless been the source of a large number of vulnerabilities over the years, and thus nearly all browsers (except Safari) will prompt the user before launching the specified program.
  • In Internet Explorer 7 and later on Windows Vista and later, launching an application to handle an Application Protocol URL will also consult the Protected Mode Elevation policy for the target executable. By default, this policy is that the user will be prompted for permission to launch the program at the Medium Integrity Level:
  • Another behavior to be aware of is that some callers will decode or encode URLs before passing them along to the target program. For historical reasons, Internet Explorer performs a single percent-decoding pass on the URL before calling ShellExecute; by default IE9 and IE10 still perform this decoding unless the protocol’s registry key contains a REG_DWORD named UseOriginalUrlEncoding with value 0x1. However, the Windows Shell’s Start > Run command performs no such decoding pass.
  • On Windows 8, Apps may use their manifest to register to handle Application Protocols. Protocol activation APIs are more cleanly implemented in Metro-style apps
  • The msProtocols object was removed for the IE10 release preview. Instead use the msLaunchUri api to launch a protocol,
  • Web developers often ask if there’s some way to detect whether the client has a given protocol available. Generally, the answer is no, this isn’t possible

ShellExecuteEx function


  • lpParameters: Type: LPCTSTR Optional. The address of a null-terminated string that contains the application parameters. The parameters must be separated by spaces. If the lpFile member specifies a document file, lpParameters should be NULL.
  • lpVerb: Type: LPCTSTR A string, referred to as a verb, that specifies the action to be performed. The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's shortcut menu are available verbs. This parameter can be NULL, in which case the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry. The following verbs are commonly used:

How to handle URI activation (Windows Store apps using C#/VB/C++ and XAML)

  • Windows allows an app to register to become the default handler for a certain URI scheme name. Both desktop and Windows Store apps can register to be a default handler for a URI scheme name
  • Any app or website can use your URI scheme name, including malicious ones. So any data that you get in the URI could come from an untrusted source. You should never perform a permanent action based on the parameters that you receive in a URI.
  •  If you are creating a new URI scheme name for your app, be sure to follow the guidance in RFC 4395. This ensures that your name meets the standards for URI schemes.

ProtocolActivatedEventArgs class

  • Provides data when an app is activated because it is the app associated with a URI scheme nam
  • JavaScript:  This type appears as WebUIProtocolActivatedEventArgs
    • The received URI is eventArgs.Uri.AbsoluteUri
Application.OnActivated method

How to handle file activation (Windows Store apps using C#/VB/C++ and XAML)

Association launching sample

File type and URI associations model

Guidelines for file types and URIs (Windows Store apps)

Guidelines and Registration Procedures for New URI Schemes

About URL Monikers

  • A moniker is a COM object that identifies an object and provides services to allow other components to obtain a pointer to that object. The system-provided moniker class supports asynchronous binding to a Uniform Resource Locator (URL).
  • Monikers connect to and activate objects, whether they are in the same machine or across a network. For example COM uses monikers to establish a network connection. They are also used to identify, connect to, and run OLE compound document link objects. In this case, the link source acts as the moniker provider and the container holding the link object acts as the moniker client.
  • Monikers are used as the basis for linking in OLE. After a moniker is bound to an object, the moniker's IMoniker interface can be used to locate, activate, and access the bound object without having any other specific information on where the actual object is located. The COM moniker architecture provides a convenient programming model for working with URLs. The moniker architecture supports extensible and complete name parsing, as well as printable names. Because URLs frequently refer to resources across high-latency networks, binding a moniker to a URL synchronously impacts performance. This is because the process has to wait for responses from the network before completing the binding. For this reason, the URL moniker class supports asynchronous as well as synchronous binding. For more information, see Creating and Using URL Monikers.

Creating and Using URL Monikers

  • szExtraInfo,Behavior of this field is moniker-specific. For URL monikers, this string is appended to the URL when the bind operation is started. Like other OLE strings, this value is a Unicode string that the client should allocate using CoTaskMemAlloc. The URL moniker frees the memory later.
  • szCustomVerb,BSTR specifying a protocol-specific custom action to be performed during the bind operation (only if dwBindVerb is set to BINDVERB_CUSTOM).

BINDINFO structure

Asynchronous Pluggable Protocols

About Asynchronous Pluggable Protocols

  • A URL follows the syntax described in RFC 1738, which specifies a protocol scheme followed by a scheme-specific portion (:).
  •  Uniform Resource Locators (URL)
  • Internet Explorer uses two mechanisms for registering new URL protocol handlers. The first method is to register a URL protocol and its associated application so that all attempts to navigate to a URL using that protocol launch the application (for example, registering applications to handle mailto: or news: URLs). The second method uses the Asynchronous Pluggable Protocols API, which allows you to define new protocols by mapping the protocol scheme to a class.
  • An asynchronous pluggable protocol handler is an apartment-threaded COM object that handles any calls made to the protocol scheme for which it is registered
  • When a client application makes a request, Urlmon looks up the protocol scheme in the registry and creates an instance of the protocol handler registered for that protocol scheme. If the protocol scheme was successfully mapped to the class identifier (CLSID) of a protocol handler, CoCreateInstance is called with that class asking for an IClassFactory interface. An instance of the protocol handler is obtained with IClassFactory::CreateInstance.
  • To register a custom URL protocol, add a key for the protocol scheme of the custom URL protocol to the registry under HKEY_CLASSES_ROOT\PROTOCOLS\Handler\protocol_scheme. Under that key, the string value, CLSID, must be set to the CLSID of the protocol handler.
  • The protocol handler cannot use any Windows messaging to switch back to the thread it was instantiated on, since the protocol handler must work on non-GUI threads.
  • A pluggable MIME filter is an asynchronous pluggable protocol that receives data through a stream, performs some operation on the data, and returns a data stream. The output data might be in a different format from the original stream.

Asynchronous Pluggable Protocol Overviews

Registering an Application to a URL Protocol

URL Monikers Overviews and Tutorials

Handling MIME Types in Windows Internet Explorer

MIME Type Detection in Windows Internet Explorer
- MIME type Detection Algorithm discussion

FindMimeFromData function

Auto-Launching apps using file and URI associations for Windows Phone 8

Launcher.LaunchFileAsync(IStorageFile) | launchFileAsync(IStorageFile) method

Understanding the Protected Mode Elevation Dialog

Custom URL Protocol for Invoking Application

Custom HyperLinks Using a Generic Protocol Handler

Custom Hyperlinks Using Asynchronous Pluggable Protocols

A windows 8 trick: Protocol activation of apps (and the nick app)

Using protocol handlers as a ultra thin layer of integration
- see

Firefox Related Notes

Web-based protocol handlers

Register protocol

  • Protocols are registered in the appxmanifest for the project
  • On Windows, protocol registration is done by the operating system

Linux Related Notes

[Ubuntu] Using a custom protocol handler in Firefox to run a shell script?

Make a link in the Android browser start up my app?
- DO NOT use your own custom scheme

Launch custom android application from android browser
- Per Google Engineer: Use an with a element.

Android Intents with Chrome
- ...Android lets you launch apps directly from a web page via an Android Intent.
- intent anchor and embed that into the page so the user can launch the app. Flexible approach...and the ability to pass extra information into the app via Intent Extras.

Intents and Intent Filters (see: Extras)
- Key-value pairs that carry additional information required to accomplish the requested action. Just as some actions use particular kinds of data URIs, some actions also use particular extras
- ...add extra data with various putExtra() methods, each accepting two parameters: the key name and the value...create a Bundle object with all the extra data, then insert the Bundle in the Intent with putExtras()

How to launch external applications using custom protocols (rock:// instead of http://)
- python example..
- see last line (beginning with @="\"python\") python...handler script
- also see: Registering a Protocol on Linux

Apple OS X References

Launching External Applications using Custom Protocols under OSX

How do I configure custom URL handlers on OS X?

Misc. References

6.6 System state and capabilities Custom scheme and content handlers
- Application URL is a trick so that you can launch any application on your local computer from your browser
- Both Chromium and Google Chrome do not allow the browser or it's extensions to access local files, so you cannot create an extension that would call a program already on your machine
- In order for this to work, it requires you to add a new registry key to the Windows Registry to register a new URL Protocol.

Chrome doesn’t handle custom protocols correctly - (still ?)
- see: This can be adjusted in Chrome's Local State file.
- see JavaScript example...
- servlet based approach would have security issues...