Oracle Will Charge for Java from Jan 2019

Current Scenario:

The current version of Java – Java SE 9 as well as Java SE 8 – is free and available for redistribution for general purpose computing.

Future: Public updates for Oracle Java SE 8 released after January 2019 will not be available for business, commercial or production use without a commercial license.

Oracle Java SE 8 Release Updates

End of Public Updates

Oracle will make available to Commercial Users and Personal Users updates to publicly available versions of Oracle Java SE . Once a Java SE version reaches “End of Public Updates”, any further updates will be available only to Customers and accessible through My Oracle Support and via corporate auto update where applicable (Visit My.Oracle Support Note 1439822.1 – All Java SE Downloads on MOS – Requires Support Login).

 

Java SE Public Updates
Release GA Date End of Public Updates
Notification
Commercial User End of Public Updates Personal User End of Public Updates
7 July 2011 March 2014 April 2015
8 March 2014 September 2017 January 2019**** December 2020****
9 (non‑LTS) September 2017 September 2017 March 2018
10 (18.3^)
(non‑LTS)
March 2018 March 2018 September 2018
11 and later No longer Applicable

Oracle Java Usage Tracker : Can be used to find all the systems and applications using the   java run time environments.

Java Usage Tracker requires a commercial license for use in production

Microservices

Abstract:

Microservices has become a new application paradigm. It basically brings in the concept of developing application functionality as self-contained services. By adapting to microservices architecture pattern, the application becomes independently deployable services, organized around Business Capabilities, decentralized governance, decentralized data management. This document talks about how to apply microservices to oracle commerce platform.

Today’s scenario:

Enterprise applications are large monolithic packaged applications, that are combination of software deployed on-premises, and heavily customized.

For example

N-Tire E-Commerce application

ntire

Typical commerce application—large monolithic applications tightly coupled with legacy back-end systems of record (ERP,CRM, etc.)
To break it down further we have the in the oracle e-commerce application we have.

design

The various advantages and disadvantages of monolithic design are:

Advantages:

  • Simple to understand
  • Consistency
  • Easy to debug

Disadvantages:

  • Partial deployment is not possible as the application is a single ear.
  • Tight coupling of the systems.
  • Single point of failure.

In the real ecommerce world omnichannel is the future.

omniChannel.PNG

In the monolithic architecture it’s not possible to make or add new services to one channel or update catalog for channel, without impacting the whole application. To deploy the change the big ear file needs to be created which bring down the availability of the complete application.

To overcome the issue with monolithic architecture design and to meet the growing business needs to deliver faster, microservices has emerged as a credible alternative to building applications.

microservices.PNG

Each of the business functionality can now be exposed as REST service API.

ecommServices.PNG

The business capabilities of an online store include:

  • Product catalog management
  • Inventory management
  • Order management
  • Delivery management
  • Search service

The corresponding microservice architecture would have services corresponding to each of these capabilities

The approach to achieve this is:

API

Using swagger for naming and documenting the REST API.

Swagger is a specification for documenting REST API. It specifies the format (URL, method, and representation) to describe REST web services. Swagger is meant to enable the service producer to update the service documentation in real time so that client and documentation systems are moving at the same pace as the server. The methods, parameters, and models description are tightly integrated into the server code, thereby maintaining the synchronization in APIs and its documentation.

 

 

 

 

Calculating edit distance for search suggestions.

Edit distance is a way of quantifying how dissimilar two strings are to one another by counting the minimum number of operations required to transform one string into the other. Edit distances find applications in natural language processing, where automatic spelling correction can determine candidate corrections for a misspelled word by selecting words from a dictionary that have a low distance to the word in question.   (source: wiki )

 

How to calculate edit distance:

To calculate the edit distance or cost to convert string “Sunday” to “Saturday“.

——-> Traverse horizontally

 

  0(EMPTY) S U N D A Y
0(EMPTY) 0 1 2 3 4 5 6
S 1 0 1 2 3 4 5
A 2 1 1 2 3 3 4
T 3 2 2 2 3 4 4
U 4 3 2 3 3 4 5
R 5 4 3 3 4 4 5
D 6 5 4 4 3 4 5
A 7 6 5 5 4 3 4
Y 8 7 6 6 5 4 3
Edit distance of converting sunday to saturday is 3.
Edit r in saturday to n in sunday 
Delete in saturday  t
Delete in saturday a

To convert :

Considering the 1st row in the above table

S -> S the cost is 0 (highlighted in green)

S U – > S  the cost is 1 (U- deleted)

S U N -> S the cost is 2 ( U N – deleted)

S U N D -> S The cost is 3 (U N D  deleted)

S U N D A – >S The cost is 4 (UNDA needs to be deleted)

SUNDAY -> S The cost is 5 ( highlighted in green .UNDAY needs to be deleted)

 

S –> SA cost is 1

SU –> SA the cost is 1

SUN – SA the cost is 2.

Note : (If the char in the row and  column dont match Ex : in the iteration SUN ->SA (N doesn’t match A) then least cost from the upper cell,left cell and the diagonally upper cell +1 to calculate the cost)

So, in the iteration

Scenario 1:

S U N — > S A  the cost 2 can be simply calculated by considering the nearby least cell value +1. (In the above table the least cell value highlighted in red and adding 1. least value of the 3 cells is “1”,so adding 1 to it gets us 2 ,which is the cost for replacing SUN – SA ).

Scenario 2 :

SUNDA –>SA   Since the last char in the source string (SUNDA) is “A” and is same as the last char in the destination string, the cost is taken from the previous step SUND — >S (highlighted in pink) as there is no cost in replacing A -> A. Hence the cost for SUND –>S and SUNDA –> SA are same as 3.

 

Pseudo Code:

if(str1[i][j]==str2[i][j])

costMatrix[i][j]=costMatrix[i-1][j-1]

else

costMatrix[i][j] = min(costMatrix[i-1][j],costMatrix[i-1][j-1],costMatrix[i][j-1]) +1

 

Stack Implementation using array

Stack is a logical data structure ,which follows the last in first out (LIFO) or  First in Last Out (FILO) condition.

The main operations supported by stack are :

  1. push :  Adds an  item to the stack, if full throws a stack overflow error.
  2. pop : Removes an item from the stack, if empty throws a stack underflow error.
  3. top : Returns the item at the top of the stack.
  4. isEmpty : Checks the empty condition of the stack.
stack
Stack 

The push ,pop and top are performed with  the time complexity at the order of O(1) time.

 

 

import java.util.Scanner;

/**
* The Class StackImpl.
*
* @param <T> the generic type
*/
/*
* Stack implementation using array
*/
public class StackImpl<T> {

/** The stack. */
private T[] stack;

/** The top. */
private int top;

/** The size. */
private int size;

/**
* Instantiates a new stack impl.
*
* @param size the size
*/
@SuppressWarnings("unchecked")
public StackImpl(int size) {
this.stack = (T[]) new Object[size];
// this.stack = (T[])Array.newInstance(obj);
this.top = -1;
this.size = size;
}

/**
* Checks if is full.
*
* @return true, if is full
*/
// check if stack is full
public boolean isFull() {
return top == (stack.length - 1);

}

/**
* Checks if is empty.
*
* @return true, if is empty
*/
// check if stack is empty
public boolean isEmpty() {
return top == -1;

}

/**
* Push.
*
* @param data the data
*/
// add data to stack
public void push(T data) {
if (!isFull()) {
stack[++top] = data;
}

}

/**
* Pop.
*
* @return the t
*/
// remove data from stack
public T pop() {
if (!isEmpty()) {
return stack[top--];
}
return null;
}

/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[");
for (int i = 0; i < stack.length; i++) {
sb.append(stack[i] + " ");
}
sb.append("]");
return sb.toString();
}

/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
StackImpl stack = null;
int length = 0;
System.out.println("Enter the size of the array");
Scanner scan = new Scanner(System.in);
if (scan.hasNext()) {
length = Integer.parseInt(scan.next());
stack = new StackImpl(length);
}

else
stack = new StackImpl(5);
System.out.println("Enter the elements in the stack");
for (int i = 0; i < length; i++) {
System.out.println("Push the " + i + "st element to stack");
System.out.println();
scan = new Scanner(System.in);
stack.push(scan.next());
}

System.out.println(stack.toString());
System.out.println(stack.top);
System.out.println(stack.pop());
System.out.println(stack.top);

}

}

 

 

Language translator in python

The python textblob module can be used to perform language translation.This module can be used to save the input string and the translated text in a database.

 

from textblob import TextBlob
def trans(sentence):
    blob = TextBlob(sentence);
    print("input language : " + blob.detect_language())
    return blob.translate(to="fr");
user_input=input ("User input: ")
transVal = trans(user_input)
print("Translation in French: %s" % transVal)

output:

User input: hello world
input language : en
Translation in French: Bonjour le monde

Design a site like this with WordPress.com
Get started