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]

SKP’s Product Dev Master Class #02: Creativity and Innovation

[Sumith Puri has 16y 04m of Experience and is at a Principal Software Level in the Software Industry. An Ex-Yahoo, Symantec, Huawei, Oracle*, OpenText*, Finastra* (*Original Product Firms Acquired by these Companies). His Deep Rooted Expertise in Product Development, Technology, Java/Java EE Architecture and Development, Programming, Software Engineering is Shared via this Series of Articles. Please Note that the Images, Videos, Artwork, and Quotes are the Sole Property  of the Copyright Owner and Used Here for Non-Commercial Demonstration Purposes]


Innovation

There are various approaches to define Innovation. Innovation can have various or different meanings to various or different people. Since there are so many definitions for Innovation — As a student, I present the top 10 along with the sources or individuals who defined them. You may find individuals and sources from all walks of life providing their own perspective or a definition of Innovation itself. The remaining for you to find from the Internet as a TODO through your own efforts.

1. Innovation is “The creation of new products and/or services.” [Investor Words]
2. Innovation “Lowers the costs and/or increases the benefits of a task.” [Yost]
3. Innovation is “A patentable solution (external verified uniqueness) with a differentiated business model that changes the basis of business for that specific industry sector.” [Ray Meads]
4. Innovation is “To dare to challenge mainstream thinking and behavior pattern.” [Lars Christensen]
5. Innovation is “The practical translation of ideas into new or improved products, services, processes, systems or social interactions.” [The University of Melbourne]
6. Innovation Tournaments: “A new match between a need and a solution.” [Christian Terwiesch and Karl T. Ulrich]
7. Innovation is then “Simply new technology, i.e. the systematic application of (new) knowledge to (new) resources to produce (new) goods or (new) services.” [Maciej Soltynski]
8. Innovation is “The successful exploitation of new ideas.” [Ber]
9. Innovation is “The creation of something that improves the way we live our lives.” [Barack Obama]

That one definition that is accepted by most: Innovation is a) something fresh (new, original, or improved) b) that creates value

It is important we also quote from Wikipedia: 

Innovation is defined simply as a "new idea, device, or method."

However, innovation is often also viewed as the application of better solutions that meet new requirements, unarticulated needs, or existing market needs. This is accomplished through more-effective products, processes, services, technologies, or business models that are readily available to markets, governments, and society. The term "Innovation" can be defined as something original and more effective and, as a consequence, new, that "breaks into" the market or society. It is related to, but not the same as, invention.

Creativity

Creativity is the process of having original ideas that have value, more often than not comes about through the interaction of different disciplinary ways of seeing things.” [Sir Ken Robinson]

Wikipedia provides the following definition:

Creativity is a Phenomenon whereby something new and somehow valuable is formed. The created item may be intangible (such as an idea, a scientific theory, a musical composition, or a joke) or a physical object (such as an invention, a literary work, or a painting).

Creativity and Innovation

It is very important that one is able to appreciate the difference between Creativity and Innovation before getting ahead with further topics. 

Value + Creativity + Execution = Innovation

Something new is not enough for the definition of innovation. There are plenty of cases where something new has no new value ( a new color of a product or a new chemical produced that does nothing). Sometimes, the value creation results because the item is simply useful to us. We can create a lot of fresh or new things that are of no use and no value. It must create value to be innovative. Also note that the “something” could be a process, product, or service and can start as small as your ideas and thoughts in your brain. In that case, it might just be innovative thinking.

This piece from Business Inside Australia is apt in putting the right thought process across in an Organizational or Corporate Context, including Software Product Companies.

[The main difference between creativity and innovation is the focus. Creativity is about unleashing the potential of the mind to conceive new ideas. Those concepts could manifest themselves in any number of ways, but most often, they become something we can see, hear, smell, touch, or taste. However, creative ideas can also be thought experiments within one person’s mind. Creativity is subjective, making it hard to measure, as our creative friends assert. Innovation, on the other hand, is completely measurable. Innovation is about introducing change into relatively stable systems. It’s also concerned with the work required to make an idea viable. By identifying an unrecognized and unmet need, an organisation can use innovation to apply its creative resources to design an appropriate solution and reap a return on its investment. Organisations often chase Creativity, but what they really need to pursue is Innovation. Theodore Levitt puts it best: “What is often lacking is not creativity in the idea-creating sense but innovation in the action-producing sense, i.e. putting ideas to work.”]


SKP’s Product Dev Master Class #01: Innovative Thinking

[Sumith Puri has 16y 04m of Experience and is at a Principal Software Level in the Software Industry. An Ex-Yahoo, Symantec, Huawei, Oracle*, OpenText*, Finastra* (*Original Product Firms Acquired by these Companies). His Deep Rooted Expertise in Product Development, Technology, Java/Java EE Architecture and Development, Programming, Software Engineering is Shared via this Series of Articles. Please Note that the Images, Videos, Artwork, and Quotes are the Sole Property  of the Copyright Owner and Used Here for Non-Commercial Demonstration Purposes]

QUOTE A:  INTERESTING AND RELATED QUOTEQUOTE A:  INTERESTING AND RELATED QUOTE

SKP’s Java/Java EE Gotchas: Clash of the Titans, C++ vs. Java!

As a Software Engineer, the mind is trained to seek optimizations in every aspect of development and ooze out every bit of available CPU Resource to deliver a performing application. This begins not only in designing the algorithm or coming out with efficient and robust architecture but right onto the choice of programming language. Most of us, as we spend years in our jobs — tend to be proficient in at least one of these.  
 
Recently, I spent some time checking on the Performance (not a very detailed study) of the various programming languages. One, by researching on the Internet; Two, by developing small programs and benchmarking. The legacy languages — be it ASM or C still rule in terms of performance. But these are definitely ruled out for enterprise applications due to the complexity in development, maintainability, need for object orientation, and interoperability. They still will win for mission-critical or real-time systems, which need performance over these parameters. There were languages I briefly read about, including other performance comparisons on the internet. These include Python, PHP, Perl, and Ruby. Considering all aspects and needs of current enterprise development, it is C++ and Java which outscore the other in terms of speed. According to other comparisons [Google for 'Performance of Programming Languages'] spread over the net, they clearly outshine others in all speed benchmarks. So much for my blog title :-) So when these titans are pit against each other in real-time, considering all aspects of memory and execution time — Java is floored. Though I have spent the last ~17 years (In 2021) of my life coding and perfecting my Java and J2EE skill — I suddenly feel... Ahem, Slow! One of the problem statements to verify this is given below (along with the associated code) and the associated execution parameters. 
 


[Disclaimer: Problem Statement given below is the property of www.codechef.com

In Byteland they have a very strange monetary system. Each Bytelandian gold coin has an integer number written on it. A coin n can be exchanged in a bank into three coins: n/2, n/3, and n/4. But these numbers are all rounded down (the banks have to make a profit). You can also sell Bytelandian coins for American dollars. The exchange rate is 1:1. But you can not buy Bytelandian coins. You have one gold coin. What is the maximum amount of American dollars you can get for it? Input The input will contain several test cases (not more than 10). Each test case is a single line with a number n, 0 <= n <= 1 000 000 000. It is the number written on your coin. 
 
JAVA SOLUTION (Will Be Uploaded Later)
C++ SOLUTION (Will Be Uploaded Later)
 
RESULTS

TIME

SKP’s Agile and Scrum Basics: Part 02/02

I have about ~16y 04m of Software Development Experience (2021) and have been working on Agile Projects since about 2006. My First Formal Introduction to Agile was through a Training by Thoughtworkers (Thoughtworks is a Leading Agile Company). This was while I was a Senior Software Engineer at Huawei, Bangalore, India. I have worked on Agile/TDD/Pair Programming (Various Variants) in multiple companies including Huawei, Symantec, Yahoo, Finastra*, Oracle*, OpenText*. Recently and Once Again, I attended a Formal Classroom Training (Company Internal) on Agile. I jotted down the most important points and now am presenting them in this Blog. I hope it helps and becomes a Ready Reckoner for Understanding/Learning the Agile Basics (Needs, Motivations, Practice, and Story of Evolution).

* [Original Product Firms were Acquired by these Current Companies]

Scrum Basics

The term Scrum was first mentioned in the 1986 Harvard Business Review Article by  Hirotaka Takeuchi and Ikujiro Nonaka. They compared High Performing Cross-Functional Teams to Scrum Formation in Rugby. Scrum is a way to Implement Agile and teams working are called Scrum Teams. The Five Values that should Drive Scrum Teams are Below:

Focus: Because we Focus on only a Few Things at a time, we work Well Together and produce Excellent Work. We deliver Valuable Items sooner. 
Courage: Because we work as a Team, we feel supported and have more resources at our Disposal. This gives us the courage to Undertake Greater Challenges.
Openness: As we Work Together, We Express How We're Doing, What's in Our Way? and Our Concerns, so they can be addressed.
Commitment: Because we have Great Control over our Own Destiny, we are more Committed to Success.
Respect: As we Work Together, Sharing Successes and Failures, We come to Respect each other and to help each other become Worthy of Respect. 



 Three Pillars of Scrum that are Fundamental to Scrum Include the Following:

Transparency: Advocates that the Significant Parts of the Process to be Visible to All.
Inspection: Scrum Artefacts Constantly Inspected as also Progress towards Milestones.
Adaptation: Deviation of any Process Aspects Outside Acceptable Limits must be Adjusted.



Scrum Roles

The real world Implementation of Agile through Scrum has Three Important Roles. 

Development Team/Member
Takes on Tasks and Delivers Chunks of Work, In Frequent Increments

Scrum Master
Protects the Scrum Process and Prevents any Distractions.

Product Owner
Determines what Needs to be Done and Sets Priorities to Deliver the Highest Value



Companies Adopting Agile

I myself have worked for Top Software Companies of the World including Yahoo (Altaba), Symantec, Huawei, Siebel (Oracle), GXS (OpenText), and Misys (Finastra). Also, I have worked for some well known IT Services/Consulting Companies like Infosys, Headstrong (Genpact) and also relatively smaller Product Brands like Persistent and Aptean. Since I started my career in 2003, I saw the move towards Agile Adoption (Variants, Loose Variants) in Various Companies throughout my Experience — It was really exciting for me as a Software Developer since the greatest crib that I ever had was Excessive Software Documentation and the Lack of Energy and ExcitementThe idea of Regular Delivery of Working Software (Demos) was inherent and natural to me as a Software Developer. It is the one that brings the Greatest Joy (Apart from Everything, as Discussed in Earlier Sections) in Software Development. I am enlisting few of the Other Companies that have Adopted Agile (or are Agile Proponents), across Business Lines.

  • Google 
  • Microsoft
  • ThoughtWorks
  • CA Technologies
  • Barclays
  • Ericsson

From my Own Experience, I can comfortably say that almost all companies in the world now use Agile/Scrum (and/or Variants) as one the Software Development Methodology of Choice. Also, Most Software Development Companies (Read Product Software) were always almost Agile, but now may be using the Formal Agile Principles as their Driving Factor to achieve Greater Efficiency. Many Companies use Variants of Agile or Mix of Agile with Other Processes for their Teams. Agile is also not restricted to Software Development — There are Industries and Functions that now use Formal Agile Methods for their Deliverables and Daily Tasks.


Popular Tools for Agile/Scrum

You will come across these Tools and Technologies that are used to Implement or Drive Agile/Scrum Methods and Practices in Organizations Worldwide. There may be many more Tools, Frameworks, Technologies — But I am only enumerating either the ones that I have come across or the Ones that are Popular. They may not be directly Agile Tools, but ones that either Accelerate Agile, Used for Agile Project Management, Agile Planning, Agile Task Management and Continuous Integration/Delivery.


Multi-Threaded Geo Web Crawler In Java

[Updates to the Article and Codebase / Code Snippets ~ 17/Feb/2021]
- Fixed Possible Con. Leaks in Network Connections
- Fixed Poor Code and Bad Programming Practices
- Improved Code Formatting, Practiced Clean Code*
- Mowglee v0.02a is Released (Previously, v0.01a')


This article provides the implementation of a web crawling system called Mowglee that uses geography as the main classifying criteria for crawling. Also, it runs in a multi-threaded mode that provides a default implementation of the robot's exclusion protocol, sitemap generation, data classifiers, data analyzers, and a general framework for application to be built of a web crawler. The implementation is in core Java. Mowglee is a multi-threaded geo web crawler in Java.

Spring — DWR — Ext JS Chat Application

[GitHub Repository for Code Samples]
https://github.com/sumithpuri/skp-code-marathon-kabootar

I was curious to explore the capabilities of Reverse Ajax. That's when I created this simple chat application using Spring/DWR/Ext JS.

From my experience, I can easily say that DWR is easy to learn and configure, especially when you are planning to integrate with Spring on the application tier. DWR has a powerful API to perform all relevant operations, right from accessing page script sessions to util classes for sending updates to the client.


I used Ext JS for creating the user interface, which renders stunning displays for elements like forms, buttons, etc. Ext JS has a very steep learning curve and each operation requires a lot of configuration and reference. Also, I found that the event handling mechanism, though complete, is very complex to use. I relied on external Javascript coding for handling events. On the upside, the documentation and support are really good for this framework. Despite this, I would instantly recommend the use of Ext JS for large-sized customer-facing web-based applications, especially for the internet. For medium-scale projects or enterprise-based projects, I would think twice.


[SKP’s Novel Concept #04] The World of Meld Advertising

There are numerous benefits of having a unified advertising mechanism for the business of an organisation. Today, most of the advertising that is done across various media is disparate and not having a unified mechanism for generation, distribution, maintenance, reporting, or collection. To bridge this gap, I conceptualized and coined the term Meld Advertising (Referred to as 'It'). Meld Advertising brings out all of these in the form of providing tools to automate most of these processes and to directly connect with all unique advertising channels. The tools help in the creation, beta, subscription, payments, real-time reporting, cost-effectiveness, and overall maintenance of the advertisements.

It helps all types of users including the end contractors who work on actually putting up advertising for diverse media. These include all tools which facilitate the entire workflow of advertising. It also recognizes that usage of effective tools, which are simple to use and create advertisements online, will lead to a faster execution of marketing campaigns. Also, ready-made templates, tie-ups with other advertising tools, and online expert help will allow for a more efficient generation of advertisements.

[SKP’s Novel Concept #03] The Idea of Mood Blogging

Mood Blogging is primarily location-based blogging that captures and enhances the spirit of blogging and also provides location determination, service feedbacks, product reviews, and product offers. It is primarily an internet concept that allows microblogging linked to the mood of that particular blog post and which also allows automatic detection of the current blog mood. It also allows blogs to be posted on other sites as well as to blog from other sites. Apart from this, it allows automatic location determination on the logged-in device and thereby allowing to temporarily subscribe to nearby blogs. This allows location-based subscriptions for temporary usage and automatically un-subscribing based on preferences. When working in a location-based mode would allow real-time feedback on services, products and also allow to obtain the latest offers and discounts. Most of all, it can be a place where people who have just joined a particular location set can look up to for live reviews and feedbacks.

It also involves automatic detection of high traffic generating blogs and gets these pages to be sponsored and customized as per the primary data and blogger profile. It allows another striking user experience feature where it allows mood icons, images, and graphics; thereby taking visual blogging to newer levels. Also, it provides an all-inclusive user interface which allows video, audio, images, files, long blogs, links, and a variety of other types of information to be blogged all in one place. Location determination allows blogs to be now more dynamic and also have location-based advertising and also advertising applied to specific location check-ins.

On the mobile continues the spirit of mood blogging on mobile by allowing to determine location (or change subscriptions) when the device is in the vicinity of another subscriber or a set of similar subscribers. The location determination is dependent on registering with exact details including the zip code and also on the features of the device itself.

The idea of Mood Blogging will be based on concepts of Intelligent Agents, Sentiment Analysis, Emotion Analysis, and Auto Location Determination.

[SKP’s Novel Concept #02] The Concept of Software Recycle

I want to put forward the idea of software recycle. Software recycle is software reuse taken to a new level, wherein the components that are outdated or written in older generation languages (of current era) are retrofitted with newer components. Multiple integration points are used to combine, create and establish collaborative functionality. In this way, we are able to take component-based development to a newer level, with greatest reuse. Apart from this, Software Recycle also combines software hosting both from open source developers and commercial and independent software vendors. It thereby acts as a software catalogue for various types of users such as students, professionals, and even organizations. 

Software Recycle takes software reuse to a newer level — wherein components that were written in older languages (of the current era), but which could be useful in certain scenarios are retrofitted with newer components or functionality and then put up on a public catalogue for use. This helps in reusing a lot of functionality without requiring to rewrite a lot of it. It will essentially then be a public catalogue of software components, promoting component-based development. The greatest advantage will be that it would include thoroughly tested, documented, and maintainable code — which could allow to save time in development. The possible users of this site include students, professionals, and organisations alike.

Spring, Hibernate, EhCache Recipe

A Simple Scenario explaining the Usage and Performance, when using EhCache (2nd Level Cache of along with Hibernate in a Spring environment. The performance results are taken using mySQL as the Database. 

Though this Example is from Spring 2.5.x and Hibernate 3.x and EhCache 1.4, MySQL 5.0 => The Concepts Demonstrated will Continue to Hold Good for any Version of any Make of Second Level Cache Product with Hibernate (Optionally, Spring) such as Infinispan, Redis, Hazelcast, ...

[Download Sample Code] Please be informed that the size is about 10MB; as i have provided all the dependencies.

In this example, I need to retrieve close to 5,000 records in a single fetch and then cache this information. As usual, setup Spring contexts in your Spring configuration file. I have just one class, which is a Hibernate DAO, HibernateDoctorDAO.java. The dependency injection hierarchy is dataSource sessionFactory hibernateTemplate. hibernateTemplate is then injected into the HibernateDoctorDAO.java at runtime by the Spring Framework.

The Implementations of Each of These Are:
dataSource > org.apache.commons.dbcp.BasicDataSource
sessionFactory > org.springframework.orm.hibernate3.LocalSessionFactoryBean
hibernateTemplate > org.springframework.orm.hibernate3.HibernateTemplate

The results clearly shows the difference in performance with EhCache enabled, even in this simple example:
 
PERFORMANCE COMPARISON (In Seconds)
==============================
QUERY FETCH TIME (INITIAL): 0.599
QUERY FETCH TIME (HIBERNATE CACHE): 0.212
QUERY FETCH TIME (2ND LEVEL CACHE): 0.091
Version Reference > Spring-2.5, Hibernate-3.0, EhCache-1.4, mySQL-5.0
 

Instructions: Unzip the file and start by creating the database. Any mySQL database that is compatible with the MySQL Connector 5.0.8 is fine for this example. You will have to create the database data_explosion (USERNAME: root, PASSWORD: architect.2012) and the table DOCTOR_TABLE. You can use the provided doctor.sql as reference. Then run the java standalone com.sumsoft.spring.orm.hibernate.dataload.JDBCDataLoader to create and load a large number of arbitary records into the DOCTOR_TABLE. You can ignore or remove every invocation that is to PATIENT_TABLE, as this is only additional for this example. Then use spring_hibernate_cache.bat to run the application. Though not tested on UNIX, you may write a script similar to the batch file to run this application.