Posts

Showing posts from May, 2018

RTC java client developments Environment setup

RTC java client developments Environment setup List of jar required to setup development evn. link for documents and jars https://jazz.net/downloads/rational-team-concert/releases/6.0.5?p=allDownloads  1. Download rtc jaav client https://jazz.net/downloads/rational-team-concert/releases/6.0.5/RTC-Client-plainJavaLib-6.0.5.zip https://jazz.net/downloads/rational-team-concert/releases/6.0.5/RTC-SDK-Client-6.0.5.zip  (This jar required when any class in not present in RTC-Client-plainJavaLib) 2. Download Docs https://jazz.net/downloads/rational-team-concert/releases/6.0.5/RTC-Client-plainJavaLib-API-javadoc-6.0.5.zip  Extract the zip and keep it into a location Step to setup Evn 1. Open eclipse 2. Create a java project 3. Right click on the project go to Build path>configure build path>Libraries>Add eternal jars. 4. Go to the folder where your have extracted the RTC-client-plainJavaLib 5. Select all and click OK. Environment setup is Do...

RTC java Client api developments

1. RTC java client developments Environment setup 2. RTC java client Login to Server 3. RTC java client required services and Client classes initialization 4. RTC java client Connect to project area by project area name 5. RTC java client get all team area of project area 6. RTC java client get development line of the project area 7. RTC java client current iterations of the project area 8. RTC java client get members from team area 9. RTC java client get associated  team area from category 10. RTC java client get all category from project area 11. RTC java client get list of work item filed against category 12. RTC java client get work item attribute value by attribute id 13. RTC java client user profile information 14. RTC java client user work environment 15. RTC java client user work resource allocation 16. RTC java client get user absence 17. RTC java client get work item estimate hours 

How do you deal with StackOverflowError in java ?

Image
Problem statement: what is StackOverflowError and how do you deal with this ? Constructor of StackOverflowError class: StackOverflowError() :creates an object of  StackOverflowError  class, with no details message. StackOverflowError(String s) :creates an object of  StackOverflowError  class, with the specified detail message . Hierarchies of StackOverflowError class:   StackOverflowError  extends  VirtualMachineError : it indicates JVM is broken VirtualMachineError  extends  Error : it indicates serious problem that an application should not catch. Error  extends  Throwable  and furthermore  Throwable  extends  Object . What is StackOverflowError:   Stack overflow means exactly - a stack overflows. Usually there's a one stack in the program that contains local-scope variables and addresses where to return when execution of a programs ends. That stack tends to be a fixed memory range s...

Java VisualVM [ Heap Dump, Thread Dump, Memory Dump, CPU Dump ]?

Image
Java VisualVM is a tool that provides a visual interface for viewing detailed information about Java applications while they are running on a Java Virtual Machine (JVM), and for troubleshooting and profiling these applications.  Tools: jvisualvm   - the man/manual page for Java VisualVM for  Solaris, Linux, or Mac OS X  or  Windows . uses-> open cmd -> type ->   jvisualvm  -> enter click oracle doc for more details

Tree data structure Implementation

class Node { int data; Node left; Node right; Node(int data) { this.data = data; } } public class BaseTree { public static void main(String[] args) { Node root=new Node(1); Node a1=new Node(2); Node a2=new Node(3); Node a3=new Node(4); Node a4=new Node(5); Node a5=new Node(6); Node a6=new Node(7); root.left=a1; root.right=a2; a1.left=a3; a1.right=a4; a2.left=a5; a2.right=a6; System.out.println(height(root)-1); //preOrder(root); //inOrder(root); //postOrder(root); //System.out.println(root.left.right.data); //System.out.println(root.data); //System.out.println(root.left.data); //System.out.println(root.left.left.data); //System.out.println(root.left.right.data); //System.out.println(root.right.left.data); //System.out.println(root.right.right.data); } public static void preOrder(Node root){ if(root==null){ return; } System.out.println(root.data); preOrder(root.left);// root=root.left;root=ro...

Spring Boot with REST API implementations !!

Image
Problem statement: Implementation of Spring boot rest api web application How to create Spring Boot Project for Rest API web service own implementation Method-I:  step-1:  go to eclipse / sts ide menu bar step-2: select File --> New --> Spring Starter Project step-3:  by default pom.xml will add required spring boot dependency step-4:  create your own controller class and enjoy. Method-II: step-1:  go to eclipse / sts ide menu bar step-2:  select  File --> New --> Maven Project step-3:  add the  <spring-boot-starter-parent > step-4:  add  <spring-boot-starter-web>  dependency and enjoy Required code implementations: [1]- pom.xml: <project xmlns="http...>          <groupId>com.ishaan</groupId> <artifactId>maven_projects</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> ...

Why Microservices ?

Problem statement: What is microservices? 1. Microservices is a   method of developing software applications as a  unit of independently deployable ,  small ,  modular services  in which  each service runs a unique process  and  communicates through a well defined,   light weight mechanism  to serve a  business goal. 2. microservice gives developer the freedom to independently develop and deploy services. 3. microservices is a variant/type of Service  Oriented Architecture (SOA)  that structures an application as collection (group of individual service) of loosely coupled services. 4. Easy integration and automatic deployment (using open source continuous integration tools like Jenkins, Hudson) 5. When change is required in a certain part of the application,  only the related service can be modified and redeployed — no need to modify and redeploy the entire application 6. Better fault isolation: ...

Chocolate distribution

There are N people in a row with some count number of chocolate in there hands. You have to select range of people to distribute those chocolate equally among them. Write a program to determine Maximum number chocolate that can be placed in Box. T - Test cases N - Number of chocolate M - Box import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class MaxChocolateDistribution { public static void main(String[] args) throws NumberFormatException, IOException { // TODO Auto-generated method stub BufferedReader b=new BufferedReader(new InputStreamReader(System.in)); int T=Integer.parseInt(b.readLine()); for(int i=0;i<T;i++){ String line1[]=b.readLine().split(" "); int M=Integer.parseInt(line1[1]); String line2[]=b.readLine().split(" "); int[] sum = new int[line2.length]; int j = Integer.parseInt(line2[0]); sum[0] = j; for (int i1 = 1; i1 < line2.leng...

LinkedList high level implementation [i]

Problem statement: LinkedList high level implementation in java ! class  Node4  { Node4 next; int data; Node4(int data) { this.data = data; } } public class  LinkedListHighLevelExe1  { Node4 head; public static void main(String[] args) { LinkedListHighLevelExe1 l = new LinkedListHighLevelExe1(); l.add(3); l.add(5); l.add(8); l.add(9); l.print(l.head); } // add the element in LinkedList public void add(int data) { Node4 next = new Node4(data); if (head == null) { head = next; return; } Node4 last = head; while (last.next != null) { last = last.next; } last.next = next; } // print the LinkedList void print(Node4 next) { Node4 temp = next; while (temp != null) { System.out.print(temp.data + "-->"); temp = temp.next; } } } Output: 3-->5-->8-->9-->

LinkedList low level implementation [v]

Problem statement: LinkedList low level implementation in java ! class  Node3  { Node3 next; int data; Node3(int data) { this.data = data; } } public class  LinkedListLowLevelExe5  { public static void main(String[] args) { Node3 head = new Node3(9); Node3 h2 = new Node3(2); Node3 h3 = new Node3(4); Node3 h4 = new Node3(5); Node3 h5 = new Node3(8); Node3 h6 = new Node3(9); // linking the obj reference with the next head.next = h2; h2.next = h3; h3.next = h4; h4.next = h5; h5.next = h6; // h6.next = null; print(head); } static void print(Node3 next) { Node3 temp = next; while (temp != null) { System.out.print(temp.data + "-->"); temp = temp.next; } } } Output: 9-->2-->4-->5-->8-->9-->

LinkedList low level implementation [iv]

Problem statement: LinkedList low level implementation in java ! class Node2 { Node2 next; int data; Node2(int data) { this.data = data; } } public class LinkedListLowLevelExe4 { public static void main(String[] args) { Node2 head = new Node2(4); Node2 h2 = new Node2(5); Node2 h3 = new Node2(6); Node2 h4 = new Node2(8); head.next = h2; h2.next = h3; h3.next = h4; h4.next = null; print(head); } public static void print(Node2 next) { Node2 temp = next; while (temp != null) { System.out.print(temp.data + "-->"); temp = temp.next; } } } Output: 4-->5-->6-->8-->

LinkedList low level implementation [iii]

Problem statement: LinkedList low level implementation in java ! class Node1 { Node1 next; int data; Node1(int data) { this.data = data; } } public class LinkedListLowLevelExe3 { public static void main(String[] args) { Node1 head = new Node1(2); Node1 h2 = new Node1(5); Node1 h3 = new Node1(6); Node1 h4 = new Node1(3); Node1 h5 = new Node1(9); head.next = h2; h2.next = h3; h3.next = h4; h4.next = h5; h5.next = null; System.out.print(head.data + "-->"); System.out.print(head.next.data + "-->"); System.out.print(head.next.next.data + "-->"); System.out.print(head.next.next.next.data + "-->"); System.out.print(head.next.next.next.next.data+"-->NULL"); } } Output: 2-->5-->6-->3-->9-->NULL

LinkedList low level implementaion [ii]

Problem statement: LinkedList low level implementation in java ! class Node { Node next; int data; } public class LinkedListLowLevelExe2 { public static void main(String[] args) { Node head = new Node(); head.next = null; head.data = 1; Node h2 = new Node(); h2.next = null; h2.data = 2; Node h3 = new Node(); h3.next = null; h3.data = 5; Node h4 = new Node(); h4.next = null; h4.data = 8; Node h5 = new Node(); h5.next = null; h5.data = 9; head.next = h2; h2.next = h3; h3.next = h4; h4.next = h5; h5.next = null; System.out.print(head.data + "-->"); // head.data System.out.print(head.next.data + "-->"); // head = head.next; head.data System.out.print(head.next.next.data + "-->"); // head = head.next.next; head.data System.out.print(head.next.next.next.data+"-->"); // head = head.next.next.next; head.data System.out.print(head.next.next.next.next.data); //...

LinkedList low level implementation [i]

Problem statement: LinkedList low level implementation in java ! class A1 { A1 n; int data; } public class LinkedListLowLevelExe1 { A head; public static void main(String[] args) { A1 head = new A1(); head.data = 1; head.n = null; A1 h1 = new A1(); h1.data = 2; h1.n = null; head.n = h1; A1 h2 = new A1(); h2.data = 3; h2.n = null; h1.n = h2; A1 h3 = new A1(); h3.data = 4; h3.n = null; h2.n = h3; A1 h4 = new A1(); h4.data = 5; h4.n = null; h3.n = h4; System.out.println(head.data); // h.data; System.out.println(head.n.data); // h=h.n; h.data; System.out.println(head.n.n.data); // h=h.n.n;h.data; System.out.println(head.n.n.n.data); // h=h.n.n.n;h.data; System.out.println(head.n.n.n.n.data); // h=h.n.n.n.n;h.data; } } Output: 1 2 3 4 5

LinkedList implementation

public class MyLinkedList { public static void main(String[] args) { // TODO Auto-generated method stub LinkedList l=new LinkedList(); l.add(1); l.add(2); l.print(l.head); } } class A{ A n; int data; A(int data){ this.data=data; } } public class LinkedList { A head; /*public static void main(String[] args) { add(1); add(2); print(head); */ /* A head = new A(1); A h1 = new A(2); A h2 = new A(3); A h3 = new A(4); A h4 = new A(5); A h5 = new A(6); head.n=h1; h1.n=h2; h2.n=h3;h3.n=h4;h4.n=h5;//h5.n=null; print(head); /*A head = new A(); head.data=1; head.n=null; A h1 = new A(); h1.data=2; h1.n=null; head.n=h1; A h2 = new A(); h2.data=3; h2.n=null; h1.n=h2; A h3 = new A(); h3.data=4; h3.n=null; h2.n=h3; A h4 = new A(); h4.data=5; h4.n=null; h3.n=h4; */ /* System.out.println(head.data); h.dat...