Latest Posts

Learning JavaScript 103 (wad-js-03)

This is session 3 in Learning to Code, JavaScript 101 for Beginners to be held on October 24, 2016. Register here.

For Learning JavaScript 101 (wad-js-01), see here.
For Learning JavaScript 102 (wad-js-02), see here.

You should have basic knowledge of HTML, a text editor like ‘sublime text’ installed, and a web browser.

  • Recap 101, 102
  • Lets code…
  • Go to and checkout step 1.
    git checkout js103-step1
  • Homework for session 4:
    • write the HTML coded articles of step 3 all in JavaScript.
    • Using JavaScript, add a Search, Login and Signup form and form validation and handling to the aside-tag.

Learning JavaScript 102 (wad-js-02)

This is lesson 2 in Learning to Code, JavaScript 101 for Beginners. For Learning JavaScript 101 (wad-js-01), see here.

You should have basic knowledge of HTML, a text editor like ‘sublime text’ installed, and a web browser.

Register here.

  1. Recap 101
  2. Data Types
    • Primitive types
      1. Number
      2. String
      3. Boolean
      4. Undefined
      5. Null
      6. Symbol (new in ES6)
    • (more…)

Creating Sentiment Line Chart for the News with Watson, Python, and D3js

You must have Python installed. Check to see if you have Python installed from the commandline:
python --version

Table of Contents:

  1. Create a Starterapp
  2. Git Clone and Setup
  3. Create Additional Folders and Files
  4. Commit and Push Changes to Repository, Build and Deploy
  5. Create an AlchemyAPI service
  6. Create a Cloudant NoSQL service
  7. Add the Basic Workflow for Request-Response
  8. Get News using AlchemyAPI
  9. Create Helper Functions
  10. Save Responses in Cloudant
  11. Parse Response for D3js
  12. Draw the Line Chart in D3js

You can import AlchemyAPI requests into Postman with this Postman collection.

The source code for the application can be viewed or cloned from Github.

1. Create a Starterapp

  1. Go to Catalog > Boilerplates
  2. Click the ‘Python Flask’ starterapp
  3. For name enter <username>-newssentiment
  4. Go to Overview
  5. Under ‘Continuous Integration’ click ‘Add GIT Repo and Pipeline’ to add a DevOps platform, select ‘Populate the repo with the starterapp packageand enable Build & Deploy pipeline’ > Click Continue > Click ‘CLOSE’.
  6. Click ‘EDIT CODE’.
  7. The very first time you login to the ‘DevOps’ environment you will need to pick a username for the ‘DevOps’ environment.
  8. In the left menu of icons, click the top folder icon, and click ‘Git URL’ to copy the Git repository url.
  9. If you prefer to edit in the online editor in Bluemix, click ‘EDIT CODE’ button and then click the second pencil icon in the left menu of icons.
  10. I will continue to work on localhost instead.


Learning JavaScript 101 (wad-js-01)



  1. Java and JavaScript?
  2. ECMAScript ES6
  3. V8 Engine
  4. The JavaScript Ecosystem
    • Browser and HTML
    • Server Side: Node.js
    • Mobile
      • Apache Cordova
      • React Native, Redux
      • (more…)

Easy Web Application Development for Beginners with Node-RED


The objective of this tutorial is to create two applications: a Node.js application that functions as a web client, and a Node-RED application that functions as the server. You will create an input form in the client that lets a user send a registration request to a server. The server will save the registration in a database and send a spoken response back to the client using IBM Watson’s Text to Speech service.


You must have access to a Bluemix account.

1. Create a Client Application with SDK for Node.js

First, I will create a Node.js web application, which will function as our client and we will create web pages to ask for user input. Technically, this client application is also running on a server, so it is perhaps confusing to call it a client, but in our scenario and architecture, this client application functions as the user interface that initiates the request to a processing server.

  1. Go to and click to ‘LOG IN’ button to log into your Bluemix account,
  2. If this is the first time you log in, Bluemix will ask to create an organization and a space. You can create multiple spaces, for instance a different space for each
  3. Click the ‘CATALOG‘ menu on the top right of the page,
  4. To create a Node.js based application with the ‘SDK for Node.js’, find the ‘SDK for Node.js’ in the ‘Runtimes’ section and click the icon,
  5. (more…)

Philip Roth, Indignation (2008)

philip_roth_indignation_2008Philip Roth, Indignation (2008), 231p

“of the terrible, the incomprehensible way one’s most banal, incidental, even comical choices achieve the most disproportionate result.”

Marcus Messner is the son of Jewish parents, a kosher butcher and his wife, in Newark, New Jersey. Messner is phonetically close to the German word for knife: ‘Messer’. The knife and cutting is a returning and central symbol in Indignation, Marcus dies by the bayonet, his father’s livelihood depends on his knife skills, Olivia Hutton has cut her wrist in an attempted suicide.

Another thread in the story is the indignation Marcus feels about having to attend mass 40 times as a requirement at Winesburg college. At Dean Caudwell’s office, he recites two full pages from Bertrand Russel’s “Why I am Not a Christian.” This theme is closed at the end of the book, with the White Panty Raid. The ‘Panty Raid‘ was a historic phenomenon that started in 1949 and lasted through the 1950s at American colleges. In 1971, a student uprising at Winesburg college resulted in the abolishment of the mass attendance requirement. Marcus Messner’s final doom is caused by this requirement and Ziegler’s proxying for him at the chapel.

‘Indignation’ is associated to ‘American Pastoral’ and ‘I married a Communist’ and has been called the ‘American Trilogy’ by Roth.

Indignation (2016)

QAVideos (3) – Extend Model and Using in Node.js

This is part 3 in a series to build a sample application called QAVideos using StrongLoop (now API Connect).

  • In part 1 ‘QAVideos (Part 1), Adding User Management to Node.js’, I added User Management to a Node.js app using StrongLoop.
  • In part 2 ‘QAVideos (Part 2), Add Custom Model and ORM in Node.js‘, I added a custom data model, i.e. a Video model, and used ORM to persist the model to a PostGres database.
  • In part 3 ‘QAVideos (Part 3), Extend Model and Using in Node.js‘, I extend the built-in User model with Member, add a Question and Answer based on a Video model, and add a Sticker, while using Open API Specification or to define and manage the application from a Swagger specification file.
  • In next parts, I will add Object Storage for video support, create an Ionic/Apache Cordova based mobile client, add an automated build, deployment and test script, add a Content Delivery Network (CDN) to the backend, containerize the application, add chat, and more.


  • Node, npm, StrongLoop and API Connect must be installed,
  • Check if the ‘slc’ tool is installed, by running ‘slc’ from the commandline. If not, follow the installation instructions, here.
  • Check if the ‘apic’ tool is installed, by running ‘apic’ from the commandline. If not, from the commandline run ‘npm install -g apiconnect’.
  • Get the source code from part 2 of this tutorial and follow the installation instructions.
  • Test if QAVideos (part 2) is running correctly by typing ‘node .’ in the root directory and browsing to ‘http://localhost:3000/explorer’ in your browser.

Open API Initiative (based on Swagger)

The OAI is based on the Swagger API specification, which is a description format for defining Restful APIs. The current Swagger API specification can be found on GitHub:

Running your own Blockchain


Hyperledger and Fabric

The fabric is a ledger of digital events, called transactions. A transaction is a request to the blockchain to execute a function on the ledger. The function is implemented by a chaincode. Chaincode is application code (aka a smart contract) stored on the ledger as part of the transaction. Chaincode runs transactions that can modify state. In a permissioned blockchain, entities register to acquire identity credentials.

Create Blockchain Service

This tutorial is a re-cap of this tutorial: learn chaincode.
First create an application on Bluemix:

  • Login to Bluemix and go to the Bluemix catalog, browse to ‘Runtimes’ and click the ‘Node.js Runtime’. Populate the application configuration fields, name the application ‘<username>-blockchain1’, and click the ‘CREATE’ button.
  • Go to the application ‘OVERVIEW’ page, and click the ‘ADD A SERVICE OR API’ link, in the catalog, browse to the ‘Network’ category or in the left menu under Services select the ‘Network’ filter, and click the ‘Blockchain’ service, accept the default settings and click ‘CREATE’, accept the ‘Restage’ popup window.
  • In the left menu of the application detail page, under ‘SERVICES’, click the new ‘Blockchain’ service, and on the service page, click the ‘LAUNCH’ button,
  • You should not see the Monitor page of the Blockchain cloud service. The web address or URL should look something like this ‘’, make sure you are on ‘v2’ or version two. The Blockchain service has its own pre-configured Blockchain network, including one Certificate Authority, and two validating peers, each has a ‘Discovery’ and an ‘API’ endpoint.
  • Click the ‘APIs’ tab to see the API documentation.


Using MQTT to publish data and send commands for IoT

MQTT is a publish-subscribe messaging pattern with a light-weight footprint, ideal for IoT devices. This tutorial will create a basic workflow via an MQTT Broker from device client to application server and back. To avoid any hardware dependencies in this tutorial I will simulate the device client and implement it as a Node.js server. The application server will also be a Node.js server.

  1. Requirements
  2. Setup an MQTT Broker
  3. Register a Device on the MQTT Broker
  4. Create an API Key on the MQTT Broker
  5. Create the IoT Device Client
  6. Create the IoT Application Server
  7. Publish Data from Client to Application via Broker
  8. Send Commands from Application to Client via Broker


Setup an MQTT Broker

The publish-subscribe messaging pattern of MQTT requires a message broker. One easy way to create one is to create an MQTT broker from a boilerplate application ‘Internet of Things Platform Starter‘ in Bluemix.

Uncanny Love

Through this dark night
Your heart is bright
Like a fair moonlight
My soul you guide

Into your loving bed
To suckle your breast
And clamp your chest
Into your womb my head

So you sooth
me like a boy
To be a man

Thus looted
By a woman coy
love uncanny

%d bloggers like this: