Sunday May 01, 2016

Talk on Project Vahalla, Completable Future and Many more - Join Us.

Bangalore Java User Group in the month of May going to talk about (Details :  :-

Project Valhalla (Beyond JDK9)

- Value Types

- Specialized Generics

- Var Handles

Talk by :- Srikanth A 

Completable Future and Micro Services

- A deep look at micro services architectures 

- A view of Java Completable Future.

- Design of low latencymicro-services using Completable Future.

Talk by :- Srinivasan R 

Locale infrastructure in Java

- Understanding the basics of Locale

- Locale Sensitive classes

- Locale Data Provider sources.

- By Rachna G 

Bangalore Java User Group (JUG)- Meeting in April 2016

Presentations can be downloaded from :- 

We have done the following sessions :-

Session Details :-

1. Name: Dinesh Bhatt

Org. : Syncogni Consulting

Talking about : RxJava.

Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM. 

2. Name: Rajesh Thandapani 

Org: Oracle, IOT team

Talking about: JDK Device IO API.

The DIO API is very important for IoT apllications developed using Java SE embedded/Java ME technologies. It is a device independent API that enable Java developes to work with various sensors/devices I2C/SPI/GPIO/UART etc. I think since IoT applications are getting popular, there may be interest among java developers to understand/use this API. 

3. Name: Ranganath S 

Talking about: Java Microservices ,

Advantages of Microservices Architecture, Approaches to implement Microservice Architecture.

Tuesday Oct 13, 2015

Oct. Sessions in Java User Group, Bangalore

 Oct. Sessions in Java User Group, Bangalore. Do join !!

Session Details


Nashorn - Javascript engine in java.

by Sundarajan - He is the writer of Nashorn and want to deliver this talk over video conference. 

1 hrs around.

2. JDWP Protocol and Java debugging

by T. Rajesh Kumar,  Oracle India

45 minutes.

3. Introducing Oracle NoSQL Database

by Anand Chandak and Ashutosh

45 minutes

Friday Jul 31, 2015

Presentations on JUG

Presentations on Concurrency GC and Completable Future done in last JUG:

Happy reading !! 

Saturday Jul 25, 2015

Bangalore Java User Group (JUG)- July Meet-up

Today, we had very interesting sessions on Concurrent Garbage Collector and Completable Future by Deepak and Srinivasan.

Deepak, while taking about the Azul Garbage Collector covers: 

- The basics of GC

- How we can proceed for a concurrent GC

- What are the challenges to achieve a concurrency in GC

Srinivasan while talking about the Completable Future covers: 

- How the new Completable Future of JDK 8 is better than the old calls

- How the real life applications like Banking, Online booking systems can use this feature.

- What were the old bottleneck which got addressed.

If you are also interesting in joining Bangalore Java User Group, follow us on:

Our meetup page -

Our Facebook page -

 Soon, I will provide the links for the presentation. 

Tuesday Dec 15, 2009

Lightweight and Heavyweight components - Mess it !

So, if you are a Swing Developer, you have heard many stories where someone messed Lightweight component with Heavyweight component. In one line " A heavyweight component is one that is associated with its own  native screen resource (commonly known as a peer). A lightweight component is one that "borrows" the screen resource of an ancestor  (which means it has no native resource of its own -- so it's "lighter")."

 Now many times you have heard "Don't mix lightweight and heavyweight". What will happen ? Alright, here is a small code : ............

[Read More]

Saturday Sep 13, 2008

Last week.. a competition code !

Last week, IEC celebrates OpenSource Mela. In code war, we got a programming contest in which the problem statement is :

5 \* 4 / 2 - 5 + 2 = 7 (evaluated from left to right). So, input format is:

5 4 2 5 2 7

and output is to put into a valid expression format(all possible format). So, if its 2 2 4, then 2+2=4 and 2\*2=4 is possible. I have written some code for this, which goes here :

package problemstatement1;

import java.util.List;

public class Main {

    String input = "2 0 2";
    String output = new String();  // 5 \* 4 / 2 - 5 + 2 = 7
    int resultVal = 0;
    String operatorseq = new String();
    int result = 0;
    int totalcounter = 0;
    boolean flag = true;
    // converting input into easy format
    String[] inputtoken = input.split(" ");
    int[] numberseq = new int[inputtoken.length - 1];
    int totaloperator = numberseq.length - 1;
    public void isValid() {
        if (inputtoken.length < 3) {
            System.out.println("Usages ... Input Parameter should be three or more ");

    public void processInput() {
        try {
        resultVal = Integer.parseInt(inputtoken[inputtoken.length - 1]);
        } catch(NumberFormatException e) {
            System.out.println("Parsing error" + "  " + e);
        for (int i = 0; i < numberseq.length; i++) {
            try {
            numberseq[i] = Integer.parseInt(inputtoken[i]);
            } catch(NumberFormatException e) {
                System.out.println("Parsing error" + "  " + e);

    public void showInput() {
        for (int i = 0; i < numberseq.length; i++) {
            // System.out.println(numberseq[i]);

    public void getPermutation() {
        GenerateOperators gen = new GenerateOperators("+-\*/", totaloperator);
        List<String> v = gen.getVariations();
        System.out.println("Possible Solutions");
        for (int i = 0; i < v.size(); i++) {
            operatorseq = v.get(i);

    public void manupulate() {
        result = 0;
        for (int i = 0; i < operatorseq.length(); i++) {
            if (i == 0) {
                if ((operatorseq.charAt(i)) == '+') {
                    result = result + (numberseq[i] + numberseq[i + 1]);
                if ((operatorseq.charAt(i)) == '-') {
                    result = result + (numberseq[i] - numberseq[i + 1]);
                if ((operatorseq.charAt(i)) == '\*') {
                    result = result + (numberseq[i] \* numberseq[i + 1]);
                if ((operatorseq.charAt(i)) == '/') {
                    try {
                    result = result + (numberseq[i] / numberseq[i + 1]);
                    } catch(Exception e) {
                        flag = false;
                        // don't do anything
            } else {
                if ((operatorseq.charAt(i)) == '+') {
                    result = result + numberseq[i + 1];
                if ((operatorseq.charAt(i)) == '-') {
                    result = result - numberseq[i + 1];
                if ((operatorseq.charAt(i)) == '\*') {
                    result = result \* numberseq[i + 1];
                if ((operatorseq.charAt(i)) == '/') {
                    try {
                        result = result / numberseq[i + 1];
                    } catch(Exception e) {
                        flag = false;
                        // don't do anything
        if (result == resultVal && flag == true) {
            for (int i = 0; i < numberseq.length - 1; i++) {
                System.out.print(numberseq[i] + "" + operatorseq.charAt(i));
            System.out.print(numberseq[numberseq.length - 1]);
            System.out.print("= " + result);

    public void count() {
        if(totalcounter == 0 ) {
            System.out.println("NO EXPRESSION POSSIBLE");
        else {
            System.out.println("Total Possible Solution :" + totalcounter);
    public static void main(String[] args) {
        Main main = new Main();

and one more file which is : 

package problemstatement1;

import java.util.List;
import java.util.ArrayList;

public class GenerateOperators {

   private String a;
   private int n;

   public GenerateOperators(String a, int n) {
       this.a = a;
       this.n = n;

   public List<String> getVariations() {
       int l = a.length();
       int permutations = (int) Math.pow(l, n);
       char[][] storeCombination = new char[permutations][n];
       for (int x = 0; x < n; x++) {
           int temp = (int) Math.pow(l, x);
           for (int p1 = 0; p1 < permutations;) {
               for (int al = 0; al < l; al++) {
                   for (int p2 = 0; p2 < temp; p2++) {
                       storeCombination[p1][x] = a.charAt(al);

       List<String> result = new ArrayList<String>();
       for (char[] permutation : storeCombination) {
           result.add(new String(permutation));
       return result;


   public static void main(String[] args) {
       GenerateOperators gen = new GenerateOperators("AAAMMBR", 7);
       List<String> v = gen.getVariations();
             for (int i=0;i<v.size();i++) {
           String s1 = v.get(i);


Feel free to use this code :-).

Saturday Jun 14, 2008

Add JRE/ Run Old JRE - 6u10 :)

Yesterday, I have started making a presentation on J2SE 6u10. And I will be like delighted again seeing the new features of Plug-in which we called Next Generation Plug-in. Some of the common problems I used to face while doing my job :

Installation and Un-Installation of JRE's - This was a region of major concern. Most of the time I never install JDK or JRE, I love to untar or unzip it, so that it will not play with my registry. But the problem with those when I run Applet. Untar JDK/JRE not used to be a suitable candidate for applet because it takes only the installed JRE. But now, we can point our applet to the untared/unziped JRE and it will all work. Uncheck all the other JRE's which is not required, run the applet. It will all rock :)

I have clicked on the Find button and added the JRE 1.7. Now, I unchecked all the other JRE and ran my applet. It will run on JRE 1.7 (Remember IE6+ and FF3 or + only)

Here is the snap shot of old Java Control Panel:

And now we will also get rid of running applet on older installed JDK/JRE. Initially it used to be if I have to check one applet on 2 different JRE, I have to install and uninstall it again. But now it all work with one checkBox option :)

Monday Apr 28, 2008

Multi-threading in Java !

Today I finished my presentation of Multi-threading in Java. This presentation not speaks anything in great detail. I tried to make it as basic as I can. I have tried to cover the common problems of locking and synchronization. Also, some of the aspects of JDK1.5.

Here is the presentation. Your comments are most welcome :-) 


Friday Apr 25, 2008

Online Java Output !

Again one idea, implementation of which I am not able to find on internet. Most of the time for testing purpose we need to run small piece of codes basically the non-UI code. And we do it a lot when we prepare for certification exams like SCJP or SCJA. Some small tricky questions ! Not only this most of the time JDK version matters because one can't run generics code with JDK 1.4 backwards.

Why not to make a small web based tool, which takes the java file as an input from user and give option to user to select which JDK version is required probably by radio button(radio button is a nice name, its like radio in which you can select only one station at a time, I wonder why not television button :-) ) and we show the output of that java file on a JSP page or we can also write it somewhere on a file, as user demand, after all user is God :-).  For UI code, it will simple return a message like its a UI code and cant be displayed.

So, implementation is little like JFileChooser for selecting input file and for writing output file. Radio buttons for selection of JDK and thats it ! Rest my web server will take load of all JDK version and it will be the duty of code to run the java file on the appropriate JDK version.

Please give your useful comment on idea and also if there is anything exist like this. I would love to use it rather than writing :-).

Thursday Nov 29, 2007



Sun is ready for the big event FOSS.IN going to happen in Bangalore, India. Our J2SE team is going to give two demo. One is about OpenJDK and other is all about JavaFX, the new cutting edge technology. Both underwent through the dry run before the actual event occurs. We are ready with OpenJDK build on Win32 and off course Solaris. Without too much of the change Solaris scripts files can be mapped on Linux as well. If anyone of the blog reader(s) are interested in making build of OpenJDK, the please leave a comment or just drop me a mail. Thanks for Igor Nekrestyanov and Sandeep Konchady to provide lot of help.

We have made the build from command line and from Netbeans 6 both. Still lot of things to do :-)

Sunday Jul 01, 2007


Today I was looking some options in jdk/bin and suddenly I came across
a file name xjc.exe in JDK6. Quickly I checked the existence of this file in JDK 5.0 and JDK
1.4.2. File was not present. Goggling didn't provided too much of help
and I tried with myself :)

I just copied an XSD file from somewhere:

FileName: unknowntest.xsd

<xs:element name="country">
    <xs:element name="name" type="xs:string"/>
    <xs:element name="pop" type="xs:decimal"/>

 and passed this XSD file into xjc option:
Usage: xjc [-options ...] ... [-b ] ...

> xjc unknowntest.xsd

parsing a schema...
compiling a schema...

Ah I got 2 Java files - and
Look at these 2 files ( I am removing the documentation part of it, to make it small)

package generated;

import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlType(name = "", propOrder = {
@XmlRootElement(name = "country")
public class Country {

@XmlElement(required = true)
protected String name;
@XmlElement(required = true)
protected BigDecimal pop;

\* Gets the value of the name property.
\* @return
\* possible object is
\* {@link String }
public String getName() {
return name;

\* Sets the value of the name property.
\* @param value
\* allowed object is
\* {@link String }
public void setName(String value) { = value;

\* Gets the value of the pop property.
\* @return
\* possible object is
\* {@link BigDecimal }
public BigDecimal getPop() {
return pop;

\* Sets the value of the pop property.
\* @param value
\* allowed object is
\* {@link BigDecimal }
public void setPop(BigDecimal value) {
this.pop = value;


objectFactory don't have too much in it. Just creating a Country class
instance. Oh so it is something cool, its making all the getter and
setter method for me, what else I need :).

Remember, such type
of methods are too much in demand when you are writing any jsp page.
So, if you are clear with the data type, just make an xsd file and xjc
will convert in into java code.

I still doubt what xjc refers for ... may be xml to java converter :)



Vaibhav Hi, I am Vaibhav Choudhary working in Oracle with JDK team. This blog is all about simple concept of Java, JVM and JavaFX.


« May 2016