All posts by programmingashish

TCS Links

iEvolve

https://ievolve.ultimatix.net/iEvolve/

TCS Gems

https://utilapp.ultimatix.net/tcsgems/xhtml/modules/home/home.xhtml

TCS IPMS

https://beyondipms.ultimatix.net/beyondipms/bridge.jsf

softMart

https://softmart.ultimatix.net/softmart/

BGC

https://knowmax.ultimatix.net/sites/morgan_stanley-reln/l_blogs/Lists/Morgan%20Stnaley%20BGC/AllItems.aspx

PRM

https://prm.ultimatix.net/PRM/index.html?cd=1445354550140#/home

GESS

https://gess.ultimatix.net/gess

IDEAMAX

http://office-ap.ms.com/sites/tcs/Ideamax/default.aspx

KNOWMAX

https://knowmax.ultimatix.net/Pages/default.aspx

Software Installations

http://office-ap.ms.com/it/tcs-is-portal/Shared%20Documents/Install%20a%20software.aspx
Or type tcs-is-portal in your Interner Explorer

Safari Books Online

http://techbus.safaribooksonline.com/sso/tcs

KNOME

https://knome.ultimatix.net/

Allocation & Utilization

https://anudetails.ultimatix.net/anudetails/pages/myAnUDetailsHome.jsf?null

My Documents

https://cnbletters.ultimatix.net/cnbletters/index.html

TCS Timesheets

 

Global Helpdesk IT

https://tcs-helpdesk.ultimatix.net/pilotglobalhelpdesk/wfindex.aspx

Global Helpdesk for Ultimatix Services (Finance & Other Services)

https://ghd.ultimatix.net/ehelp/wfindex.aspx

I9 Form for US Associates

https://formi9.ultimatix.net/I9FORM/

Impact Link:

https://impact.ultimatix.net/ImpAct/SMLogin.jsp

Enterprise Search Homepage

https://enterprisesearch.ultimatix.net/enterprisesearch

GSPEED : Appraisal

https://gspeedperformancemgmt.ultimatix.net/performancemgmt

GSPEED : Career Hub

https://gspeedcareerhub.ultimatix.net/careerhub/pages/speedHome.jsf
OR
https://gspeedcareerhub.ultimatix.net/careerhub/

Visa Tracker

https://vts.ultimatix.net/VTS/VTSPages/associateHome.jsf

Conference Room Booking

https://conference1.tcs.com

iTalent

https://hrms.ultimatix.net/Hrms/Login/bridge

Ultimatix Recommends

https://enterprisesearch.ultimatix.net/recommends

Mediassist Links (HIS Claims)

Global Recruitment System

https://auth.ultimatix.net/utxLogin/login?TYPE=33554432&REALMOID=06-122c158b-e4a8-4200-80c6-40650a4316b7&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-5n46JVZfwwB5JFBY5UhXT0whEUfK5C%2b6MKH6pGONCPDfnz4SekNSZjooO2j9qdCp&TARGET=-SM-https%3a%2f%2fgrs%2eultimatix%2enet%2fGRS%2fpages%2frefHomeReferrer%2ejsf

Recruitment Dashboard

https://ibegin.ultimatix.net/iBegin/index.html?cd=1448354818458#/recDashboard

TQAS

https://uniapp.ultimatix.net/ProLit/loginProLitAct.action or https://uniapp.ultimatix.net/ProLit/homePage.action?bpvID=260

TCS MS Relationship Sharepoint link:

https://knowmax.ultimatix.net/sites/bfs3-isu/group3/BM%20Team/BM%20Team%20Presentations/Forms/AllItems.aspx

BFS Demand Tracker

https://knowmax.ultimatix.net/sites/bfs3-isu/group3/Lists/BFS%2033%20Demand/AllItems.aspx?ShowInGrid=True&View=%7BFBBE4F10%2DD06C%2D4E08%2D9858%2D5DCA384BE593%7D

Profile Tracker :

https://knowmax.ultimatix.net/sites/bfs3-isu/group3/Lists/BA%20tracking%20process/RMG%20view.aspx

Allocation Tracker:

https://knowmax.ultimatix.net/sites/bfs3-isu/group3/Resourcing%20Portal/Lists/BFS%2033%20Allocation%20Tracker/Default%20View.aspx

Global Procurement System Link :

https://gps.ultimatix.net/gps/pages/myRequestDetailsHome.jsf

TCS-WebEx:

(1) https://tcs.webex.com (2) https://tcs2.webex.com

TCS Corporate Learning / Talent Development

https://knowmax.ultimatix.net/sites/learning-corpfn/default.aspx

TCS Project Workbench

https://pwb.ultimatix.net/pwb/projectWorkbenchHome

TCS Mindworks

https://mindworks.ultimatix.net

TCS iON Learning Exchange

https://www.tcsion.com/pvc2

MS Password Reset for New joiners

6218250 (Mumbai Help line)

TCS GBAMs –

https://auth.ultimatix.net/utxLogin/login?TYPE=33554432&REALMOID=06-6d7834fb-11f0-4f39-8c69-3aae80c1dc35&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=89OZWhfZIXYvJ0D8aXtYwTCiIw9ItwiqaFQNyRpfUwL4u3xwBoxQUyD1X8he9iBP&TARGET=-SM-https%3a%2f%2fgbams%2eultimatix%2enet%2fgbams%2fGBaMSpages%2fGBaMSHome%2ejsf

Enterprise Reporting – PMR Report Link

https://mis.ultimatix.net/newmis/pages/new_mis_bl_home.jsp

Shift Rostering:

https://rostering.ultimatix.net/rostering/xhtml/modules/myCalendar/myCalendar.xhtml

eTMS:

https://gtms.ultimatix.net/gTMSProcess/SMLogin.jsp

IWMS(For raising RGS IDs):

https://iwms.ultimatix.net/iwms

TCS IRC

https://irccatalogue.ultimatix.net/cgi-bin/koha/opac-main.pl

Enterprise Analytics Portal

https://eaportal.ultimatix.net/ea_portal/index.html

Workforce Management

https://gbams.ultimatix.net/gbams/GBaMSpages/evaluateCandidateHome.jsf

Learning and Collaboration – Lynda

https://gbams.ultimatix.net/gbams/GBaMSpages/lynda.jsf
https://www.lynda.com

Sort Map By Object Value

package javaCollectionsAndMaps;

import java.util.*;
import java.util.Map.Entry;

// Person Class
class Person {
private int id;
private String name;

public Person(int id, String name) {
this.id = id;
this.name = name;
}

public int getId() {
return id;
}

public String getName() {
return name;
}

}

/* Sorting was performed in non-ascending order on “name” of person class */
public class SortByValueObjectMap {
public static void main(String[] args) {

// Filling the map
Map<Integer, Person> map = new HashMap<Integer, Person>();
map.put(1, new Person(21, “ashish”));
map.put(2, new Person(42, “aman”));
map.put(3, new Person(03, “vishal”));
map.put(4, new Person(19, “pradeep”));

// Creating a list of Map.entry
List<Map.Entry<Integer, Person>> l = new ArrayList<Map.Entry<Integer, Person>>(map.entrySet());

// printing map entry before sorting
for (Map.Entry<Integer, Person> entry : l) {
System.out.println(“No: ” + entry.getKey() + ” Person’s Id: ” + entry.getValue().getId() + ” Person’s Name:”
+ entry.getValue().getName());
}

// Implementing sorting code
Collections.sort(l, new Comparator<Map.Entry<Integer, Person>>() {
public int compare(Map.Entry<Integer, Person> o1, Map.Entry<Integer, Person> o2) {
return ((String) o2.getValue().getName()).compareTo((String) o1.getValue().getName());
}
});

System.out.println(“==============================================================”);
// printing map after sorting
for (Map.Entry<Integer, Person> entry : l) {
System.out.println(“No: ” + entry.getKey() + ” Person’s Id: ” + entry.getValue().getId() + ” Person’s Name:”
+ entry.getValue().getName());
}
}
}

Sort Map By Value(Integer)

package javaCollectionsAndMaps;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;

public class OrderByValue {

public static void main(String a[]){
Map<String, Integer> map = new HashMap<String, Integer>();
map.put(“java”, 20);
map.put(“C++”, 45);
map.put(“Java2Novice”, 2);
map.put(“Unix”, 67);
map.put(“MAC”, 26);
map.put(“Why this kolavari”, 93);
/*Set<Entry<String, Integer>> set = map.entrySet();
List<Entry<String, Integer>> list = new ArrayList<Entry<String, Integer>>(set);
Collections.sort( list, new Comparator<Map.Entry<String, Integer>>()
{
public int compare( Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2 )
{
return (o2.getValue()).compareTo( o1.getValue() );
}
} );
for(Map.Entry<String, Integer> entry:list){
System.out.println(entry.getKey()+” ==== “+entry.getValue());
}*/
Set<Entry<String, Integer>> s=map.entrySet();
List<Entry<String,Integer>> l=new ArrayList<Entry<String,Integer>>(s);
Collections.sort(l,new Comparator<Map.Entry<String,Integer>>() {
public int compare(Map.Entry<String,Integer>o1,Map.Entry<String,Integer>o2){
return (o2.getValue()).compareTo(o1.getValue());
}
});
for(Map.Entry<String,Integer> entry:l){
System.out.println(entry.getKey()+” “+entry.getValue());
}
}
}

 

 

maps of object

package javaCollectionsAndMaps;package javaCollectionsAndMaps;import java.util.*;
/* Provide input: 2 10 4 4 2 2 2 2 0 0 0 0149 9 0 0 2 2 2 2 4 4 4 5 5 6*/public class SortByFrequency { public static void main(String[] args) { Scanner scan = new Scanner(System.in);
// no. of test Cases int T = scan.nextInt(); // System.out.println(“before Sorting:”); // for (int i = 0; i < a.length; i++) { // System.out.print(a[i]+” “); // } while (T– > 0) { int a[] = inputArray(scan); // Sorting the array as per frequency sortByFreq(a); System.out.println(“After Sorting:”); for (int i = 0; i < a.length; i++) { System.out.print(a[i] + ” “); } } }
static int[] inputArray(Scanner scan) { // No of elements in the array int n = scan.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = scan.nextInt(); } return a; }
static <T> void sortByFreq(int[] a) { Map<Integer, Integer> map = new TreeMap<Integer, Integer>(); for (int i = 0; i < a.length; i++) { if (map.get(a[i]) == null) { map.put(a[i], 1); } else { Integer frequency = map.get(a[i]); map.put(a[i], frequency + 1); } }
List<Map.Entry<Integer, Integer>> l = new LinkedList<Map.Entry<Integer, Integer>>(map.entrySet()); Collections.sort(l, new Comparator<Map.Entry<Integer, Integer>>() {
@Override public int compare(Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2) { return (o1.getValue()).compareTo(o2.getValue()); }
});
int count = 0; for (Iterator it = l.iterator(); it.hasNext();) { Map.Entry<Integer, Integer> me = (Map.Entry<Integer, Integer>) it.next(); int key = me.getKey(); int value = me.getValue(); for (int i = 0; i < value; i++) { a[count] = key; count++; } } /* * for(Map.Entry<Integer,Integer> entry:map.entrySet()){ * System.out.println(“key: “+entry.getKey()+”value: “+entry.getValue()) * ; } */ }}

maps array ex

package javaCollectionsAndMaps;package javaCollectionsAndMaps;import java.util.*;
/* Provide input: 2 10 4 4 2 2 2 2 0 0 0 0149 9 0 0 2 2 2 2 4 4 4 5 5 6*/public class SortByFrequency { public static void main(String[] args) { Scanner scan = new Scanner(System.in);
// no. of test Cases int T = scan.nextInt(); // System.out.println(“before Sorting:”); // for (int i = 0; i < a.length; i++) { // System.out.print(a[i]+” “); // } while (T– > 0) { int a[] = inputArray(scan); // Sorting the array as per frequency sortByFreq(a); System.out.println(“After Sorting:”); for (int i = 0; i < a.length; i++) { System.out.print(a[i] + ” “); } } }
static int[] inputArray(Scanner scan) { // No of elements in the array int n = scan.nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = scan.nextInt(); } return a; }
static <T> void sortByFreq(int[] a) { Map<Integer, Integer> map = new TreeMap<Integer, Integer>(); for (int i = 0; i < a.length; i++) { if (map.get(a[i]) == null) { map.put(a[i], 1); } else { Integer frequency = map.get(a[i]); map.put(a[i], frequency + 1); } }
List<Map.Entry<Integer, Integer>> l = new LinkedList<Map.Entry<Integer, Integer>>(map.entrySet()); Collections.sort(l, new Comparator<Map.Entry<Integer, Integer>>() {
@Override public int compare(Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2) { return (o1.getValue()).compareTo(o2.getValue()); }
});
int count = 0; for (Iterator it = l.iterator(); it.hasNext();) { Map.Entry<Integer, Integer> me = (Map.Entry<Integer, Integer>) it.next(); int key = me.getKey(); int value = me.getValue(); for (int i = 0; i < value; i++) { a[count] = key; count++; } } /* * for(Map.Entry<Integer,Integer> entry:map.entrySet()){ * System.out.println(“key: “+entry.getKey()+”value: “+entry.getValue()) * ; } */ }}

Equals and hashcode

  • original equals check equality by this==obj. So it checks by using the reference. 
  • hashcode just implements a logic that returns hashcode as per the hashcode contract.
  • if we use hash based collection, then it checks the equality comparing  hashcode value, if values are equal then it checks using  original equals method (this==obj) by reference. If we have also overridden equals method then it will check using our own overridden method.
  • if we override just hashcode using default eclipse way(it will generate same hashcode for those object who have same value like (0,”ashish”) and (0,”ashish”). The hashcode will be same but,  since we are not overriding original equals, the objects reference will be considered different and it will store both object.
  • If we also override equals as per eclipse. It doesnt check equality using this==obj or using reference . Both the objects with same values will be considered equal.
  • if we just override equals then since we are using original hashcode method, equal will be true but since hashcode is different only one object will get stored.
  • WRAPPER CLASSES: in wrapper class, autoboxing convert int to Integer and vice versa. also when we check wrapper object:

Integer i1=new Integer(10);
Integer i2=new Integer(10);
System.out.println(i1.equals(i2));

System.out.println(i1==i2);

It will return true for both.

Sorting custom object List in java

package SortingEx;

import java.util.*;

class Person {
private int id;
private String name;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Person(int id, String name) {
super();
this.id = id;
this.name = name;
}

}

class reverseComparator implements Comparator {

@Override
public int compare(Object p1, Object p2) {
Integer i1 = ((Person) p1).getId();
Integer i2 = ((Person) p2).getId();
return i2.compareTo(i1);

}
}

class reverseValueComparator implements Comparator {

@Override
public int compare(Object p1, Object p2) {
String i1 = ((Person) p1).getName();
String i2 = ((Person) p2).getName();
return i2.compareTo(i1);

}
}

class checkComparator implements Comparator {

@Override
public int compare(Object p1, Object p2) {
String i1 = ((Person) p1).getName();
String i2 = ((Person) p2).getName();
if (i2.compareTo(i1)==0){
return new reverseComparator().compare(p1, p2);
};
return i2.compareTo(i1);
}
}
public class ListSortEx {
public static void main(String[] args) {
List<Person> l = new ArrayList();
Person p1 = new Person(1, “k”);
Person p2 = new Person(2, “p”);
Person p3 = new Person(3, “p”);
Person p4 = new Person(4, “b”);
System.out.println(p1);
System.out.println(p2);
l.add(p1);
l.add(p2);
l.add(p3);
l.add(p4);
Collections.sort(l, new checkComparator());
ListIterator itr = l.listIterator();
while (itr.hasNext()) {
Person p = (Person) itr.next();
System.out.println(p.getId()+” “+p.getName());
}
}
}

Maven configuration

PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/java/jdk1.8.0_121/jre/bin:/opt/apache-maven-3.3.9/bin”
JAVA_HOME=”/usr/java/jdk1.8.0_121″
M2_HOME=”/opt/apache-maven-3.3.9″
M2=”/opt/apache-maven-3.3.9/bin”

Questions on Spring MVC/REST

Spring MVC

  1. Spring MVC flow
  2. Configuring dispatcher servlet/web.xml, using xml and java config both
  3. What is AbstractAnnotationConfigDispatcherServletInitializer,SpringServletContainerInitializer and its use.
  4. defining multiple beans using ContextLoaderListener(
    org.springframework.web.context.ContextLoaderListener

    ) in xml.

  5. enable support for annotation-based controllers. using RequestMappingHandlerMapping and RequestMappingHandlerAdapter. How to use less xml using <mvc:annotation-driven>
    @EnableWebMvc
  6. use and purpose of
    @RequestMapping(value = "/welcome", method=RequestMethod.GET)
  7. How to use constructor autowiring and using that in web MVC.
  8. What will happen if there is no return from controller:
    @RequestMapping(method = RequestMethod.GET)
        public void setupForm() {
        }
  9. How to take request parameter as input using @RequestParam(“name”) String name declaration
  10. Defining Model model in method and using
    model.addAttribute("reservations", reservations);
  11. Configuring InternalResourceViewResolver bean.
  12. creating jsp/jstl views and how model to view works.
  13. Deploying application
  14. using
    @ComponentScan
  15. What is bydefault value of method attribut in @RequestMapping
  16. how to user
    redirect:
  17. Different ways of using @RequestMapping, like (“add”),(value={remove,delete}),(“display/user”)
  18. why we dont use .jsp and .html kind of URI.
  19. Define interceptors using HandleInterceptor interface and HandleInterceptorAdapter class.
  20. How to resolve user’s locale.
  21. Using Locale sensitive texts
  22. Different types of view resolvers
  23. What is ContentNegotiatingViewResolver , how is it used for content negotiation
  24. Why ContentNegotiatingViewResolver has highest priority.
  25. handling exceptions and using HandlerExceptionResolver and @ExceptionHandler and @ControllerAdvice.

Java definetions

  • Inheritance can be defined as the process where one class acquires the properties (methods and fields) of another. With the use of inheritance the information is made manageable in a hierarchical order.The class which inherits the properties of other is known as subclass (derived class, child class) and the class whose properties are inherited is known as superclass (base class, parent class).
  • The benefit of overriding is: ability to define a behavior that’s specific to the subclass type, which means a subclass can implement a parent class method based on its requirement.In object-oriented terms, overriding means to override the functionality of an existing method.
  • Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.Any Java object that can pass more than one IS-A test is considered to be polymorphic. In Java, all Java objects are polymorphic since any object will pass the IS-A test for their own type and for the class Object.It is important to know that the only possible way to access an object is through a reference variable. A reference variable can be of only one type. Once declared, the type of a reference variable cannot be changed.The reference variable can be reassigned to other objects provided that it is not declared final. The type of the reference variable would determine the methods that it can invoke on the object.A reference variable can refer to any object of its declared type or any subtype of its declared type. A reference variable can be declared as a class or interface type.
  • As per dictionary, abstraction is the quality of dealing with ideas rather than events. For example, when you consider the case of e-mail, complex details such as what happens as soon as you send an e-mail, the protocol your e-mail server uses are hidden from the user. Therefore, to send an e-mail you just need to type the content, mention the address of the receiver, and click send.Likewise in Object-oriented programming, abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words, the user will have the information on what the object does instead of how it does it.In Java, abstraction is achieved using Abstract classes and interfaces.
  • Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction.Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class. Therefore, it is also known as data hiding.To achieve encapsulation in Java −
    • Declare the variables of a class as private.
    • Provide public setter and getter methods to modify and view the variables values.