Friday, December 4, 2015

If you are unable to launch Appium inbuilt inspector and getting the error like failed to connect to server. Please chech that it is running. Even when your appium server is up and running. Please do the following changes in your appium Server.1. Stop your appium Server.2. Click Android Icon in appium and select application path.3. click the choose button to locate you .apk file.

While running your TestNG classes you may encounter some Exception likejava.net.SocketException: Software caused connection abort: socket write errorto avoid the SocketException in Eclipse please do the following changes.

Tuesday, October 27, 2015

Edit plus is an easy to go software when it comes to small program execution, edit plus can be configured to compile and run any java program without opening the command prompt.To configure the java compiler and JVM in edit plus please follow the below steps.1. Go to tools-->configure user toolbelow window will open.

2. Click add tool and select Program.3. In the Menu Text give the name as Javac <You can give any name as you want.>4. In the command section select the path of javac.exe file which is usually inside C:\Program Files\Java\jdk1.8.0_60\bin\javac.exe5. In the argument section select fileName.6. In initial directory section select file directory.7. Click OK.To set the Java run time environment repeat the step 1 and 2.8. In the menu text give the name as Run <You can give any name as you want.>9. In the command section select the path of java.exe file which is usually inside C:\Program Files\Java\jdk1.8.0_60\bin\java.exe10. In the argument section select File name without extension.11. In initial directory section select file directory.12. Click OK.you have successfully set up the java compiler and run time environment. To verify it just write a simple java program and compile it from tools-->Compile. To run tools-->Runyou can use the shortcut also to compile and run your program. Shortcuts are mentioned right beside tools-->the user command which you created.

Wednesday, August 26, 2015

Garbage collection in java happens automatically , which
is the biggest reason of Choosing Java over C++ or C programming languages.

Java objects are created in Heap area of Java virtual
machine. Understanding how automatic garbage collection works can help you identify
the potential performance barriers.

Java Heap space is divided into 3 sub areas.

New generation

Old generation

Perm Generation

New Generation is further divided into three categories.

EDEN SPACE

S0 Survivor 1

S1 Survivor 2

Below is the
detailed information on how garbage collection takes place in Java.

Any
new objects are allocated to the eden space. Both survivor spaces start out
empty.

When
the eden space fills up, a minor garbage collection is triggered.

Referenced
objects are moved to the first survivor space. Unreferenced objects are deleted
when the eden space is cleared.

At the
next minor GC, the same thing happens for the eden space. Unreferenced objects
are deleted and referenced objects are moved to a survivor space. However, in
this case, they are moved to the second survivor space (S1). In addition,
objects from the last minor GC on the first survivor space (S0) have their age
incremented and get moved to S1. Once all surviving objects have been moved to
S1, both S0 and eden are cleared. Notice we now have differently aged object in
the survivor space.

At the
next minor GC, the same process repeats. However this time the survivor spaces
switch. Referenced objects are moved to S0. Surviving objects are aged.Eden and S1 are cleared.

After
a minor GC, when aged objects reach a certain age threshold (8 in this example)
they are promoted from young generation to old generation.

As
minor GCs continue to occur objects will continue to be promoted to the old
generation space.

So that pretty
much covers the entire process with the young generation.

Eventually, a major
GC will be performed on the old generation which cleans up and compacts that
space.

Stop
the World Event- All minor garbage collections are
"Stop the World" events. This means that all application threads are
stopped until the operation completes. Minor garbage collections arealways Stop
the World events.

Thursday, July 16, 2015

Write a java program to validate a PAN Card number. A PAN card number is said to be valid when it starts with 5 uppercase letters 4 digits and Followed by single upper case letter. A Valid PAN have only 10 letters.For example: a pan card number AMEPJ2585B is valid where as AM525LDKF is invalid.Given below is the java program which makes use of regular expressions to validate the PAN number.ValidPan.java

Although, private methods are meant to be accessed in the same class they are declared and when we try to access it outside of the declared class it gives a compile time error. But Reflection API of java provides a way to access private method outsides of class.

Check the below code which access the rate() method of Return class in Test class.

Tuesday, February 17, 2015

The happiest people
in the world are not those who have no problems, but those who learn to live
with things that are less than perfect.

A group of graduates,
highly established in their careers, got together to visit their old
university professor.

Conversation soon
turned into complaints about stress in work and life.Offering his guests coffee, the professor went to the kitchen and
returned with a large pot of coffee and an assortment of cups – porcelain,
plastic, glass, crystal, some plain looking, some expensive, some exquisite –
telling them to help themselves to the coffee.

When all the students
had a cup of coffee, the professor said:

“If you noticed, all the nice looking expensive cups were taken up,
leaving behind the simple and cheap ones.Now consider this:

While it is normal
for you to want only the best for yourselves, that is the source of your
problems and stress.

Be assured that the cup itself adds no quality to the coffee.In most cases, it is just more expensive and in
some cases even hides what we drink.What
all of you really wanted was coffee, not the cup, but you consciously went
for the best cups… Then you began eyeing each other’s cups.

– Life is the coffee;
the jobs, money and position in society are the cups.

– They are just tools
to hold and contain Life, and the type of cup we have does not define, nor
change the quality of Life we live.

– Sometimes, by concentrating on the cup, we fail to enjoy the coffee
God has provided us. Enjoy your coffee!.”

The happiest people
don’t have the best of everything.They
just make the best of everything.

1. Live simply.

2. Love generously.

3. Care deeply.

4. Speak kindly.

5. Leave the rest to
God.

Shine a light & Enjoy the Coffee!!!You are the miracle, my friend;Your life either shines a light OR casts a shadow!