Machine Learning

What is Machine Learning

Tom Mitchell in 1998 provided a modern definition: “A computer program is said to learn from experience E with respect to some tasks T and some performance measure P, if its performance on T, as measured by P, improves with experience E”.

Remember ETP:

Learn from Experience E in doing the task T measured by improvement in performance P

Example of playing checkers

  • E: the experience of playing many games of checkers
  • T: the task of playing checkers
  • P: the probability that the program will win the next game.
Selective Focus Photography of Two Danbo and Star Wars Stormtrooper Robot Toys

OKD – what is it?

OKD is the acronym for OpenShift Kubernetes Distribution = Origin Community Distribution: (

OpenShift Origin in 2015 with the release of the OpenShift Version 3 was renamed to OKD.

NOTE: OpenShift version 4.2 is already out.


Steps for SSH key generation on Linux, macOS, or Unix.

From the terminal on your local machine, run the ssh-keygen command, and follow the directions to save the file to the .ssh directory for your profile. 

Note: the keys can be used for SSH connection to AWS, Git etc..

$ ssh-keygen

Generating public/private rsa key pair.
Enter file in which to save the key (/home/user-name/.ssh/id_rsa): Type /home/your-user-name/.ssh/ and a file name here, for example /home/your-user-name/.ssh/mykey_rsa

Enter passphrase (empty for no passphrase): <Type a passphrase, and then press Enter>
Enter same passphrase again: <Type the passphrase again, and then press Enter>

Your identification has been saved in /home/user-name/.ssh/mykey_rsa.
Your public key has been saved in /home/user-name/.ssh/
The key fingerprint is:
45:63:d5:99:0e:99:73:50:5e:d4:b3:2d:86:4a:2c:14 user-name@client-name
The key's randomart image is:
+--[ RSA 2048]----+
|        E.+.o*.++|
|        .o .=.=o.|
|       . ..  *. +|
|        ..o . +..|
|        So . . . |
|          .      |
|                 |
|                 |
|                 |
  1. This generates:
    • The mykey_rsa file, which is the private key file.
    • The file, which is the public key file.
  2. Run the following command to display the value of the public key file (
cat ~/.ssh/

Should looks similar to the following:

DgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDAS=EXAMPLE user-name@ip-192-0-2-137

Put or Post

  • GET is used to fetch the resource/content.
  • PUT is used to modify and update a resource.
  • POST is used to create a resource, or overwrite it.


  • GET/PUT for listing and updates
  • POST to insert or Overrite

Microservices Architecture

What is Microservices?

It is an architecture style in which applications are composed from loosely coupled API service with automated and independent life cycles.

  1. Behavior
  2. Reliability
  3. Control
  4. Resilience

What does design practice needs to provide

  • Behavior by
    • Single Capability Focused and
    • Encapsulation

And framework needs to provide

  • Behavior by
    • Independence
  • Reusability by
    • Consumer First
    • Infrastructure Agnostics
  • Control
    • Automation
    • Discoverable
    • Lightweight communication
  • Reliance
    • Highly Resilient and Secure
    • Highly observable

Security: Session/Timeout Management.

For a web application that provides access to highly sensitive personal financial data, how to guarantee that a session is destroyed when the browser is inactive for a maximum period.

The client application is expected to prompt a warning dialog, and automatically redirects the page to login after configurable amount of time for no response. User may have multiple tabs open across various portions of the site.


Following are the new client technology, the middle-ware, services and back-end does not need to change.


  • RxJS is a library for reactive programming using Observables, to make it easier to compose asynchronous or callback-based code. It has built in support for handling timeout exceptions, the timeout extension method allows to terminate the sequence with an provides ability to specify the period as sliding window with a time-span or an absolute time. The Timeout operator allows you to abort an Observable with an on-Error termination if that Observable fails to emit any items during a specified span of time or absolute time.


  • Library to manage state, to help keeping tap on the browser tabs.


  • Angular components have input and output properties to allow interaction with other components. For example, a component could set up its view based on configuration it receives from its parent component and then be notified to change its appearance by an event it receives from a child or sibling component.




When a login action is dispatched to middle-ware TC proxy to Siteminder, the reducer store server response and SMSESSION Cookie and applies the payload depending on the action type, and outputs the new state.

The SMSESSION cookie is used to query Siteminder for

  • The time siteminder was accessed last,
  • The time the user’s session was first established and
  • The maximum session timeout for the user.
  • The Maximum session timeout value along with

The store encompasses the whole state, the reducers return fragments of the state, to present the view actions, the user-triggered events that communicate how a given fragment of the state should change. Middleware TC is accessed on every server request to capture maximum session timeout value, which is stored and used by the timer function of RxJS library. Middleware is used for all the server interaction (the diagram above depicts only siteminder) that require asynchronous requests. The reducer takes its previous state, applies the new action to it, and returns it back.

The store is an observable, hence making the access to the application’s state reactive. An observable store also allows mix the values of several states using RxJS’s operators, which are set based on the session timeout values returned by the SiteMider.

Application Configurations:

  • Inactivity timeout for a user session can be set to 30 mins or 2 hours
    • Is set as Timeout operator to abort the Observable function in (RxJS library) to terminate user session and redirected to a timeout URL.
  • Pop up a warning to the user X seconds prior (expected X==60)
    • To popups a timeout dialog with ‘Log out’ and ‘keep Alive’ options, x seconds prior to session timeout If ‘Log Out’ is clicked, the page is redirected to a specified URL. If ‘Keep Alive’ is clicked, a keep-alive URL is requested through dispatcher. If no options is selected after another set amount of time, the page is automatically redirected to a timeout URL.


  • None


  • Need to have a phased release plan to minimize impact to the large customer as Assumption: Designed system will impact approx 60,000 concurrent application online and mobile customers.


  1. None of the following application stack , database and Ticket Server would be impacted by the proposed solution.
  • AF-Legacy Java framework
  • UAA- Spring Framework Java Stack
  • API—Data access API
  • TS(Ticket Server) – Proxy between application stack and Siteminder.