# Tuesday, October 11, 2016

Microsoft Cognitive Services provides a number of APIs to take advantage of Machine Learning. One of the simplest APIs to use is Sentiment Analysis.

Sentiment Analysis examines one or more text entries and determines whether each text reflects a positive or negative sentiment. It returns a number between 0 and 1: A higher number indicates a more positive sentiment, while a lower number indicates a more negative sentiment.

To use this service, POST a JSON message to the following URL: https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment

Unlike some web Cognitive Service URLs, this one takes no querystring parameters.

In the HTTP header, pass the following information: Content-Type and the Ocp-Apim-Subscription-Key.

The API is a simple REST web service located at https://api.projectoxford.ai/emotion/v1.0/recognize. POST to this service with a header that includes:

where xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is your key.

In the Content-Type, pass "application/json".

For the Ocp-Apim-Subscription-Key, include the the Text Analytics key. You can find your key at https://www.projectoxford.ai/Subscription?popup=True

In the body, pass a JSON object that contains an array of documents. Each document contains 3 properties:

language - the Language of the text you want to analyze. Valid values are "English", "Spanish", "French", and "Portuguese".

id - A string that uniquely identifies this document. Used to match the return value to the corresponding text.

text - the text to analyze

Below is a sample JSON body:

"documents": [
"language": "English",
"id": "text01",
"text": "This is a great day."

After you POST this to the URL, you should expect a response that includes JSON. If all goes well, you will receive an HTTP 200 response and the returned JSON will include an array of documents (the same number that you passed in the Request body). Each Response document will contain

id - matching the id of the document in the Request document.

score - A value between 0 and 1. The higher the score, the more positive the sentiment of the text; The lower the score, the more negative the text sentiment.

You may also receive an array of errors. Each error contains the following properties:

id - matching the id of the document in the Request document.

message - a detailed error message.

Below is an sample response JSON body

"documents": [
"score": 0.95412,
"id": "text01"

Here is a bit of code to call this API from JavaScript. I am using jQuery's Ajax method and displaying output in a div, like the following:

<div id="OutputDiv"></div> 

var subscriptionKey = "566375db01ad43dc8f62dcc8dc3e5c1f";
var textToAnalyze = "Life is beautiful";

var webSvcUrl = "https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment";

var outputDiv = $("#OutputDiv");

type: "POST",
url: webSvcUrl,
headers: { "Ocp-Apim-Subscription-Key": subscriptionKey },
contentType: "application/json",
data: '{"documents": [ { "language": "en", "id": "text01", "text": "'+ textToAnalyze + '" }]}'
}).done(function (data) {
if (data.errors.length > 0) {
outputDiv.html("Error: " + data.errors[0]);
else if (data.documents.length > 0) {
var score = data.documents[0].score;
if (score > 0.5){
outputText = "That is a Positive thing to say!";
outputText = "That is a Negative thing to say!";
else {
outputDiv.text("No text to analyze.");

}).fail(function (err) {
$("#OutputDiv").text("ERROR! " + err.responseText);

Tuesday, October 11, 2016 6:48:00 AM (GMT Daylight Time, UTC+01:00)
# Monday, October 10, 2016
Monday, October 10, 2016 5:38:20 AM (GMT Daylight Time, UTC+01:00)
# Thursday, October 6, 2016

Lately, I've been using Visual Studio Code to create TypeScript projects.

When working with TypeScript, I always create a file with ".ts" extension and allow the TypeScript Compiler to create a ".js" and a ".map" file. It's rare that I ever open the js or map files, let alone modify them. In fact, it's a fool's errand to modify these files because they will be overwritten the next time the ".js" file changes.

So it is generally easier to work with a TypeScript project if I don't even see these files.

Visual Studio Code allows me to hide files in a project. To do so, select File | Preferences | Workplace Settings.

This creates a ".vscode" folder in the root of my project and adds a file named "settings.json" to this folder. In settings.json, add the following code:

"files.exclude": {
"**/*.js": true,
"**/*.map": true

Of course, you can add any file mask to this "files.exclude" extension to hide specific files or folders.

File matching patterns are described in this Help topic.

Save this file and the specified files will remain on disc but will not clutter the left pane of Visual Studio Code.

Thursday, October 6, 2016 5:32:33 AM (GMT Daylight Time, UTC+01:00)
# Wednesday, October 5, 2016

This was not the book I was expecting.

Joe Jackson's recording career has spanned decades - from the late 1970s until the present. But this memoir ends where that recording career began - with the release of his excellent debut album Look Sharp.

"A Cure For Gravity: A Musical Pilgrimage" details Jackson's education and the evolution of his musical style before he secured a recording contract.

Jackson was an outsider in the working class town of Portsmouth, England. He was sickly and introspective and no good at sports, which made him unpopular with his classmates. And he was obsessed with music, which made him odd.

But he loved music enough to pursue it - almost single-mindedly - for his entire youth. He attended the Royal Academy of Music during the Day, while performing at small pubs nights and weekends with rock & roll or punk bands. He was the musical director of a cabaret in order to save money to record an album of his own material.

Through Jackson's education and his musical experience, he encountered many characters and many different styles of music and he was influenced by them all. This helps to explain why his recorded music crosses so many different genres - from jazz to rock to reggae to new wave to classical. "When people ask who has influenced me", he writes, "I always sense that they're expecting to hear certain names: John Lennon, David Bowie, Graham Parker.  The truth is that I'm influenced by everything, but especially by the people I've worked with closely, people no one else has heard of."

Jackson's style is often clever and frequently self-effacing. He acknowledges his youthful awkwardness and his lack of success with women. And he tells stories of driving for hours and waiting all day outside a pub, then changing in a small restroom to perform for a small, audience that didn't want to hear a band or didn't like the music they played.  He speaks freely of his musical frustrations and his inability to find his voice. But his love of music kept him going.

Jackson was driven to succeed in music, never considering any other career. "I had to succeed in music," he insists. "I was no good at anything else."

Although Joe Jackson had a hit album at age 22, "A Cure for Gravity" chronicles what it took him to get there. The book gave me new insights into an artist I have loved since my high school days when I first heard his music on an A&M sampler LP and (a few months later) when I saw his concert at the Punch and Judy Theater in Grosse Pointe, MI. "A Cure for Gravity" is a delightful story that this lifetime Joe Jackson fan enjoyed immensely.

Joe Jackson in concert, 1979
(photo by D Giard)

Wednesday, October 5, 2016 10:59:00 AM (GMT Daylight Time, UTC+01:00)
# Tuesday, October 4, 2016

In the beginning,there was CodeMash - a small Tech Conference at the Kalahari Resort in Sandusky, OH. CodeMash was a developer conference run by volunteers, but it had a twist. The Kalahari features an indoor water park, so attendees could slip away to enjoy the water slides or bring their families, who would enjoy the water park while they attended sessions.

CodeMash was successful enough that some folks in Illinois and Wisconsin created a similar conference - That Conference - at the Kalahari in Wisconsin Dells, WI.

Last year, a Kalahari opened in Pocono Manor, PA, so naturally someone had to create a tech conference and host it there.

The inaugural TechBash took place September 28-30 at the Pocono Manor Kalahari and I was honored to be a part of it. I delivered 2 presentations: "Adding Image and Voice Intelligence to Your Apps with Microsoft Cognitive Services" and "Building Powerful Applications with AngularJS and TypeScript". The classroom was completely full for the latter talk.

The 3-day conference featured 2 keynotes: Pete Brown opened the event by showing off some of his favourite maker projects; and Glenn Block opened the final day of the conference talking about some of his favourite open source projects.

Speakers came from all over the US and one - Iris Classon - traveled from Sweden to present.

With a limited budget, the organizers did not have a lot of frills at this conference. Meals were simple and after-hours events were limited. There was no bacon bar or giant-size Settlers of Catan game, as we've seen at the other - more established - Kalahari conferences. But the content was excellent and I heard positive feedback from many both attendees and speakers.

Many attendees and speakers brought their families to enjoy the water park - either during the conference or on the weekend following the conference.

At 170 registrants, TechBash is about the size CodeMash was in its first year. The organizers announced their plans to host TechBash 2017 and plan to grow it in attendance and scope.


Tuesday, October 4, 2016 11:11:00 AM (GMT Daylight Time, UTC+01:00)
# Monday, October 3, 2016
Monday, October 3, 2016 11:49:00 AM (GMT Daylight Time, UTC+01:00)
# Sunday, October 2, 2016

Today I am grateful for dinner with Emilija last night.

Today I am grateful for:
-The organizers and volunteers of the inaugural TechBash for all their hard work that paid off in a very good conference.
-Stephen showing me how to connect to my company's VPN.
-Making it home last night, despite a flight being delayed, then canceled.

Today I am grateful for dinner last night with Kendall, Joel, Ondrej, and Glenn.

Today I am grateful for dinner last night with James, Glenn, and Justin

Today I am grateful for fact-checkers.

Today I am grateful for a photo walk around the South Loop to capture all the local artwork.

Today I am grateful for a productive week.

Today I am grateful for coffee yesterday with Lwin, Min, and Tierney.

Today I am grateful for coffee with Pete yesterday.

Today I am grateful for
-dinner and drinks last night with Tierney, Jason, and Claire
-my first (awful) taste of Jeppson's Malort

Today I am grateful for a weekend with Tim.

Today I am grateful to watch the Spartans defeat the Irish at Notre Dame Stadium yesterday - my first game there since 1989.

Today I am grateful that my son is in town this weekend.

Today I am grateful for a week in the Seattle area.

Today I am grateful to attend an offsite event with teammates I don't see often enough.

Today I am grateful for a boat cruise last night around Lake Washington and Lake Union.

Today I am grateful to see many of my teammates from across the country yesterday.

Today I am grateful for:
-My first Seahawks game at Century Link Field yesterday;
-Dinner with Ted and Charlotte and friends last night.

Today I am grateful for lunch with Kelly yesterday.

Today I am grateful for an infinite selection of online music.

Today I am grateful that my son played for a Hall of Fame basketball coach.

Today I am grateful for my first time guest-lecturing at the University of Illinois.

Today I am grateful I had a chance to spend time yesterday with Matthew after he arrived in Chicago and before I left town.

Today I am grateful for finally finding the motivation to clean my bathroom.

Today I am grateful for a short vacation to Milwaukee, including my first visit to the Milwaukee Art Museum.

Sunday, October 2, 2016 6:28:27 PM (GMT Daylight Time, UTC+01:00)
# Saturday, October 1, 2016

Thousands of years ago, society began to collapse on the the planet Arbre. The intellectuals of the time retreated into concents - monasteries in which the occupants are sealed off from the rest of the world - sometimes for centuries at a time.

Although the concents were founded to preserve the knowledge of Arbre, most of the occupants (known as avouts) are kept ignorant and even forbidden from learning many things about the world around them.

Erasmas - an avout of the Concent of Saunt Edhar - has his world turned upside down when his friend and mentor Orolo discovers an alien spacecraft orbiting Arbre. Orolo is thrown out of the Concent for daring to use forbidden technology that allowed him to observe the spacecraft. Shortly afterward, Erasmus and his friends are also exiled and pursue Orolo to discover what he has learned.

The novel climaxes in a battle between the Arbrelings and one faction of the aliens.

It takes a while to get there as it explores the concept of how alternate versions of the same reality can manifest themselves in multiple cosmos and what happens when people move between these alternate realities.

Anathem satirizes the idea of those who try to preserve knowledge, but restrict access to new information and discovery. The novel succeeds brilliantly with its social satire and its attention to detail. For some, it may fall short with its slow pacing and lack of action.

If you prefer your science fiction more cerebral than swashbuckling, Anathem is for you.

Saturday, October 1, 2016 8:34:00 AM (GMT Daylight Time, UTC+01:00)
# Monday, September 26, 2016
Monday, September 26, 2016 11:41:00 AM (GMT Daylight Time, UTC+01:00)
# Sunday, September 25, 2016

Yesterday, I posted a YouTube video of a recent presentation. The group that recorded the video began recording well before I went on stage, so the video contained over 10 minutes of silence and a couple minutes of announcements.

I wanted to embed the video on my blog, but I wanted it to start playing at the moment the organizer introduced me.

YouTube provides an easy way to embed a video. Click the “Share” icon (Fig. 1) below the video

Fig. 1

Then, click the “Embed” link (Fig. 2) that appears below the “Share” link.

Fig. 2

If you click the “SHOW MORE” link, you will get a few options for your video (Fig. 3) but not the option to change the default start time. By default, your video will start at the very beginning when the user starts playing it.

Fig. 3

YouTube provides HTML that you can paste into your web page to embed a video. It looks similar to the following:

<iframe width="560" height="315" 
 frameborder="0" allowfullscreen>

To set the start time, add a “start” parameter to the end of the URL in the iframe’s “src” attribute, as in the following example.

<iframe width="560" height="315" 
 frameborder="0" allowfullscreen>

The value of the “start” querystring parameter is the number of seconds from the beginning at which you want the video to start playing.

I wanted my video to start at the 12 minute, 33 second mark, so I had to do some math:


So I appended “start=753” to the src URL.

Sunday, September 25, 2016 4:19:00 PM (GMT Daylight Time, UTC+01:00)