How Machine Learning Helps Analytics Be More Proactive

"Many organizations claim that their business decisions are data-driven. But they often use the term "data-driven" to mean reporting key performance metrics based on historical data — and using analysis of these metrics to support and justify business decisions that will, hopefully, lead to desired business outcomes. While this is a good start, it is no longer enough".

The traditional role of data and analytics has always been in supporting decision-making. Now, they are applied where they have never been before. Today data and analytics are not only used for describing, diagnosing, predicting, or even recommending the best actions but also triggering those actions automatically. The motivation behind this new area of application is the goal of many businesses to reduce task performance time and the volume of human labor.

10 Commandments of Microservice Decomposition

While we are talking about microservices, we talk a lot about Domain-Driven Design, Event-Driven Architecture, Core Domain, Subdomain, Bounded Context, Anti-corruption Layer, etc.

Whether you are working in a Brownfield project or a Greenfield project, if your organization wants to adopt microservices, (assuming your organization has a compelling reason for adopting microservices, as it is not a free lunch), then you need to understand the above terms in detail to properly decompose your business domain logic (Business Space) and map it with microservices architecture (Code Space), so you can gain the benefits of microservice traits.

Split Testing With Netlify

Split testing is a feature you aren’t using enough. It’s a great way to test changes with your visitors without minimizing risk. In this tutorial, we’ll learn what split testing is, why you need it, and how to set it up with Netlify.

What is Split Testing?

Split testing is the idea of creating another copy of your website that you can send users to, so you can test new features. Let’s say you have a new design you want to try out. Rather than push that new design to production where everyone can see it, you can test it with a few people.

SKP’s Algorithms and Data Structures #9: Java Problem: Monkeys in the Garden

[Question/Problem Statement is the Property of Techgig] 

Monkeys in the Garden [www.techgig.com]

In a garden, trees are arranged in a circular fashion with an equal distance between two adjacent trees. The height of trees may vary. Two monkeys live in that garden and they were very close to each other. One day they quarreled due to some misunderstanding. None of them were ready to leave the garden. But each one of them wants that if the other wants to meet him, it should take maximum possible time to reach him, given that they both live in the same garden.

SKP’s Algorithms and Data Structures #8: Java Problem: Simple Inheritance (OOPs)

[Question/Problem Statement is the Property of Techgig]
 
Java Inheritance / Simple OOPs [www.techgig.com]
Create Two Classes:

BaseClass
The Rectangle class should have two data fields-width and height of int types. The class should have display() method, to print the width and height of the rectangle separated by space.

DerivedClass
The RectangleArea class is Derived from Rectangle class, i.e., it is the Sub-Class of Rectangle class. The class should have read_input() method, to Read the Values of width and height of the Rectangle. The RectangleArea class should also Overload the display() Method to Print the Area (width*height) of the Rectangle.

Input Format
The First and Only Line of Input contains two space-separated Integers denoting the width and height of the Rectangle.

Constraints
1 <= width,height <= 10^3

Output Format
The Output Should Consist of Exactly Two Lines.
In the First Line, Print the Width and Height of the Rectangle Separated by Space.
In the Second Line, Print the Area of the Rectangle.


[Explanation of the Solution]
This is the Simplest of all OOPs Questions! Demonstration of Inheritance and Overriding (Very Loosely, Liskov Substitution of SOLID).


[Source Code, Sumith Puri (c) 2021 — Free to Use and Distribute]
Java
 




x
67


1
 /*    
2
  * Techgig Core Java Basics Problem - Get Simple OOPs Right!  
3
  * Author: Sumith Puri [I Bleed Java!]; GitHub: @sumithpuri;  
4
  */   
5
     
6
  import java.io.*;   
7
  import java.util.*;   
8
   
9
   
10
  class Rectangle {  
11
   
12
    private int width;  
13
    private int height;  
14
   
15
    public void display() {  
16
   
17
      System.out.println(width + " " + height);  
18
    }  
19
   
20
    public int getWidth() {  
21
   
22
      return width;  
23
    }  
24
   
25
    public void setWidth(int width) {  
26
   
27
      this.width=width;  
28
    }  
29
   
30
    public int getHeight() {  
31
   
32
      return height;  
33
    }  
34
   
35
    public void setHeight(int height) {  
36
   
37
      this.height=height;  
38
    }  
39
  }  
40
   
41
  class RectangleArea extends Rectangle {  
42
   
43
    public void read_input() {  
44
   
45
     Scanner scanner = new Scanner (System.in);   
46
       
47
     setWidth(scanner.nextInt());   
48
     setHeight(scanner.nextInt());  
49
    }  
50
   
51
    public void display() {  
52
   
53
      super.display();  
54
      System.out.println(getWidth()*getHeight());  
55
    }  
56
  }  
57
     
58
  public class CandidateCode {   
59
     
60
   public static void main(String args[] ) throws Exception {   
61
     
62
     RectangleArea rectangleArea = new RectangleArea();  
63
     rectangleArea.read_input();  
64
   
65
     rectangleArea.display();  
66
   }   
67
 } 



SKP’s Algorithms and Data Structures #7: Functional Programming and Java Lambdas

[Question/Problem Statement is the Property of Techgig]

Java Advanced — Lambda Expressions [www.techgig.com] 
Write the Following Methods that Return a Lambda Expression Performing a Specified Action: Perform Operation isOdd(): The Lambda Expression must return if a Number is Odd or  If it is Even. Perform Operation isPrime(): The lambda expression must return if a number is prime or if it is composite. PerformOperation isPalindrome(): The Lambda Expression must return if a number is a Palindrome or if it is not.

Input Format
Input is as Show in the Format Below
Input
3
1 3
2 7
3 7777

Constraints
NA

Output Format
Output is as Show in the Format Below
Output
ODD
PRIME
PALINDROME


[Explanation of the Solution]
This is a Good Question to Refresh Java 8 Lambdas. In my Solution, I Implemented the Functional Interfaces within my main() Method and assigned it to Local Reference Variables.


SKP’s Algorithms and Data Structures #6: Java Problem: Active Traders

[Question/Problem Statement is the Property of HackerRank]

Algorithms/Data Structures — [Problem Solving] 
An Institutional Broker wants to Review their Book of Customers to see which are Most Active. Given a List of Trades By "Customer Name, Determine which Customers Account for At Least 5% of the Total Number of Trades. Order the List Alphabetically Ascending By Name."


Example
n = 23
"customers = {"Bigcorp", "Bigcorp", "Acme", "Bigcorp", "Zork", "Zork", "Abe", "Bigcorp", "Acme", "Bigcorp", "Bigcorp", "Zork", "Bigcorp", "Zork", "Zork", "Bigcorp", "Acme", "Bigcorp", "Acme", "Bigcorp", "Acme", "Littlecorp", "Nadircorp"}."

"Bigcorp had 10 Trades out of 23, which is 43.48% of the Total Trades."
"Both Acme and Zork had 5 trades, which is 21.74% of the Total Trades."
"The Littlecorp, Nadircorp, and Abe had 1 Trade Each, which is 4.35%..."

"So the Answer is ["Acme","Bigcorp","Zork"] (In Alphabetical Order) Because only These Three Companies Placed at least 5% of the Trades.


Function Description

Complete the Function mostActive in the Editor Below.

mostActive
has the following parameter:
String customers[n]: An Array Customer Names
(Actual Question Says String Array, But Signature is List of Strings)

SKP’s Algorithms and Data Structures #5: Java Problem: Changes in Usernames

[Question/Problem Statement is the Adapted from HackerRank]

Algorithms/Data Structures — [Problem Solving] 
There is a Specific Need for Changes in a List of Usernames. In a given List of Usernames — For Each Username — If the Username can be Modified and Moved Ahead in a Dictionary. The Allowed Modification is that Alphabets can change Positions in the Given Username.

Example
usernames[] = {"Aba", "Cat"}
 
"Aba" can be Changed to only "Baa" — Hence, It can Never Find a Place Ahead in the Dictionary. Hence, Output will be "NO". "Cat" can be Changed to "Act", "Atc", "Tca", "Tac", "Cta" and Definitely "Act" will Find a Place Before "Cat" in the Dictionary. Hence, Output will be "YES".

[Function Description]
Complete the function possibleChanges in the Editor Below.
 
possibleChanges has the Following Parameters:
String usernames[n]: An Array of User Names
 
Returns String[n]: An Array with "YES" or "NO" Based on Feasibility
(Actual Question Says String Array, But Signature is List of Strings)


Constraints
• [No Special Constraints Exist, But Cannot Recall Exactly]


Input Format 
"The First Line Contains an Integer, n, the Number of Elements in Usernames.",
"Each Line of the n Subsequent Lines (where 0 < i < n) contains a String usernames[i]."        

[Sample Case 0 — Sample Input For Custom Testing]         
5
Aba
Cat
Boby
Buba
Bapg
Sungi
Lapg
Acba
       
Sample Output (Each Should Be on a Separate Line) 
NO YES NO YES YES YES YES YES
   

 
[Explanation of the Solution]
This is again a Good Question from Hacker Rank to Test Your Logic / Problem Solving Abilities. The Core Point to Handle is that For Each Combination of 2 Alphabets that Exists in the Username String > We Need to Check if the Latter Occurring Character (ASCII) is Less than the Former Occurring Character (ASCII). For Example in the String "Bapg" — For a Selection of "Ba" from "Bapg" — We have "a" Occurring Before "B" in the English Alphabet. We can Have Two Loops (One Nested) to Decide for a Combination of Each Two Alphabets. The Time Complexity of this Solution is O(n^2).
 


[Source Code, Sumith Puri (c) 2021 — Free to Use and Distribute]

SKP’s Java/Java EE Gotchas: BCEL Issue on JiBX 1.2.5 (java.lang.CharSequence)

So, I spent some time on resolving this issue with a combination of the following:

1. JiBX 1.2.5 / JiBX 1.2.6
2. JDK 1.8

During the jibx-maven-plugin:bind phase of the Maven Build, you may get an error when you upgrade from JDK 1.x to JDK 1.8; The issue will manifest in the following most common form/error:
 
Failed to execute goal org.jibx:jibx-maven-plugin:1.2.5:bind (bind-compile) on project common: Error loading class java.lang.CharSequence: Error reading path java/lang/CharSequence.class for class java.lang.CharSequence
 

You can modify your pom.xml, to make these changes to fix this error.

1. Include the Repository for BCEL 6.0
Include the Repository for BCEL 6.0



2. Check the version of JiBX [Choose any of 1.2.5 or 1.2.6]
Check the version of JiBX [Choose any of 1.2.5 or 1.2.6]


3. Exclude default 'BCEL' from the Build
Exclude default 'BCEL' from the Build


4. See the modifications for the plugin 'jibx-maven-plugin'
See the modifications for the plugin 'jibx-maven-plugin'


5. Voila!
Build Success!

SKP’s Java/Java EE Gotchas: Clustered Nodes Issue Using Apache Lucene 5.4.y

So, We just spent about 28+ days — using Stack Overflow and Hibernate Search Forums as also various other resources to 'FIX' the strangest of issues using Hibernate Search and Apache Lucene. The right help or pointer came from the 'Hibernate Search Committers/Creators' (Official Forums). Thanks a lot to 'sanne.grinovero'.

Issue Description: In a (non-replicated) clustered environment, if the Indexing by Lucene or Hibernate Search is done from the Same Database (Instance) using the Same Data the Results obtained are Different on Different Nodes. In other words, the Same Data from the Same Database Instance Indexed using the Same Code Yields a Different Result Set for the Same Search Term (Index Contents are Different on Different Machines).


Issue Resolution / Root Cause: The point to note is that, if you open a 'Hibernate Session' that you use for your 'Apache Lucene or Hibernate Search Indexing' and if a 'Runtime/Exception' occurs before you 'Close' the session, the results that are obtained across different machines, when queried using the same search term. Though this occurred after the 'console logs' reported that the Index is '100% Successfully Completed' — It has led to an inconsistent index across machine. My analysis is that 'session.close()' below may be leading to some 'flushing or committing to the indexing', which leads to the inconsistency when a runtime exception occurs — even after indexing is reported complete by the Hibernate/Hibernate Search on the 'Console Logs'.

Suggestion: Make sure that there are no Runtime Exceptions (or Errors) before Closing the Session. Even if you find that the Indexing is 100% Complete and there is an Exception right at the End — Please do not Ignore/Keep/Park it (Considering it a Minor or Unrelated Error) for a fix at the 'End of Dev Cycle' as it may Impact Results. This is true for any seemingly unrelated exception that may occur before calling 'session.close()'.

I am pasting the statement here from Hibernate Search Forums (Committer), which may be useful for all of you and helped us to finally resolve this error:  If a batch of documents failed, you might have a block of documents missing in one of the indexes (and this could happen several times). By default errors are logged, you might want to hook up an ErrorHandler to raise a more serious notification to your admins — if logs are ignored.



The culprit line of code, pointed out in red. [CULPRIT LINE OF CODE - WHERE RUNTIME EXCEPTION OCCURS - POINTED OUT USING ARROW]

Benefits of Social Media Marketing for Businesses

We have seen a lot of developments in the field of marketing in the last decade. These days, there is fierce competition as big brands are spending enormous amounts of money on their marketing campaigns to increase their brand awareness. Today, marketing is not just for these big brands with huge budgets. Even smaller firms with less substantial budgets spend too much money on marketing tactics. Also, many new methods of marketing have evolved that make use of the latest technologies. One of these methods involves the use of social media. Most people think that sites like Facebook and Twitter are just to share your good moments with friends. But actually, the same sites can be used to take your product or service to many different corners of the world. Recently, TikTok has also become very popular among business owners and marketers. Before you step into this unfamiliar, and sometimes confusing, territory, you should read the benefits of social media marketing given below.

Get Started for Free

One of the best reasons to use social media is that you can start for free. There is absolutely no fee for creating a page on any or all of these sites. All you need to do is click on a few buttons, type the name of your business, add a short description, and you are done. It hardly takes 15 minutes for the complete process. You can upload a logo, set a background image, and add as much info as you can to attract more people. The more effort you put in, the more results you will get — but you will not have to spend even a dime! You can easily do all this on your own. However, because it is so easy and low-cost, everyone creates a page on social networking sites. This gives you a lot of competition, so you will have to learn how to use TikTok for business to get any significant results.

Extra Micrometer Practices With Quarkus

Metrics emitted from applications might contain parameters (i.e., tags or labels) for which a specific metric is measured. Micrometer provides a facade over the instrumentation clients for many widespread monitoring systems like Atlas, Datadog, Graphite, Ganglia, Influx, JMX, and Prometheus. This article's scope explores some extra practices when combining Micrometer and Quarkus to tailor those metrics or give you some ideas of what you could extra measure.

For simplicity and given Prometheus popularity, the Micrometer Prometheus registry will be used as an example to demonstrate most of the use cases.

Realizing the Full Potential of Automation Leveraging BPM + RPA

The lifespan of so-called ERP (Enterprise Resource Planning) systems has continuously been evolving and taking different dimensions. In the late 90s and early 2000s, there were close to a dozen ERP products ruling the business world. It catered many industries with their specific modules, such as Human Resource Management (HRM), Financial and Accounting Management, Supply Chain Management (SCM), Sales and Distribution Management (SDM), Manufacturing & Warehouse Management, Customer Relationship Management (CRM), and many more.

ERP and BPM Streamlining the Business Processes

The period 2000-2010, witnessed large acquisitions and mergers of ERP vendors and at the end of 2010, only a few ERP product companies existed in the market. JD Edwards, known for its strong Manufacturing modules (Plan-To-Build), was acquired by PeopleSoft, known for its HRMS (Hire-To-Retire) and Campus management solutions. Right after this acquisition, Oracle, which was known for its Oracle Financials and Budgets (Record-To-Receipt), acquired PeopleSoft and Siebel, known for its CRM (Acquire-To-Retain) capabilities. It finally became a strong ERP product, with a combination of Financials, Human Resources, Manufacturing, and Customer Relationship Management (CRM) besides its strong Database capabilities. The other big player has been SAP, still.

The Next TCP/IP Moment in Identity

Loved reading the book Ask Your Developer: How to Harness the Power of Software Developers and Win in the 21st Century by Jeff Lawson.

Jeff says in the book that every company is on a journey to becoming a software company and everyone is starting to see the world through the lens of software. He defines the term software person. A software person is not necessarily a developer; it’s anybody who, when faced with a problem, asks the question, How can software solve this problem?

HTTP gRPC With spring-web

When we have done HTTP to gRPC transcoding with help of envoy gRPC-JSON transcoder, then we must have gone through the following steps:

  1. Use google.api.http to annotate gRPC services
  2. Configure protoc to generate proto descriptor set
  3. Configure envoy proxy filter_chains on another port

To facilitate this procedure, some automation scripts are needed. Not trivial considering processing generated code and descriptors, packaging and distributing them differently, and configurations. When we provide gRPC services with grpc-java anyway and use spring-web to knit components together, we can tremendously simplify the work required to transcode HTTP to gRPC, namely:

7 APIs for Surveys

Have you been asked to take a survey lately? Your answer is likely, yes. A business or organization may want to survey people to conduct broad market research, drill down specifics about a customer, or spot trends. And in recent years, a digital transformation has changed the way surveys are conducted.