Tampilkan postingan dengan label in. Tampilkan semua postingan
Tampilkan postingan dengan label in. Tampilkan semua postingan

RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE

Selasa, 22 Juli 2014


RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE



RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE is one of the bestseller product in the market today. People arround United Kingdom is looking for RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE with low prices from Internet. If youre lucky you can get a special discount from Amazon, only in this month. Well, good product that comes with low prices is everyone choices.

On sale now at cheap price, special discounts and fast shipping. Im very pleased with their features and highly recommend it to everyone searching for a high quality item with the useful specifications at an cheap. You can read testimony from customers to find out more through their experience. RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE has worked beneficial for me and I believe it will do wonders on you too. Why then waste any more time? Have Fun, you understand where to shop the best ones.

Some of the customer reviews speak that the RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE are splendid luggage. Also, It Is a pretty well product for the price. It’s great for colony on a tight budget. We’ve found pros and cons on this type of product. But overall, It’s a supreme product and we are well recommend it! When you however want to know more details on this product, so read the reports of those who have already used it.




RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE is a good choice with brand new features that will make you amaze. But if you still want to have another information about RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE, you can read more detail information, spesification, and reviews from people that bought RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE below.

RECHARGEABLE NEUTRAL PORTABLE BUILT IN SUITABLE Detail Information :



This Page is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.co.uk
CERTAIN CONTENT THAT APPEARS ON THIS SITE COMES FROM AMAZON SERVICES LLC. THIS CONTENT IS PROVIDED "AS IS" AND IS SUBJECT TO CHANGE OR REMOVAL AT ANY TIME.

Read More..

photoshop tutorial Colorcast correction in Photoshop CS6

Minggu, 20 Juli 2014

Color casts can be a headache. But it sometimes happens. This can be corrected with Photoshop. That too in a few basic steps.
 This is an image with a yellowish cast.
The yellowish cast has been removed.
This is an image with a reddish cast.
The color cast is removed.
The tutorial is here
Other photoshop tutorials are here



Read More..

RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION

Sabtu, 05 Juli 2014


RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION



RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION is one of the bestseller product in the market today. People arround United Kingdom is looking for RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION with low prices from Internet. If youre lucky you can get a special discount from Amazon, only in this month. Well, good product that comes with low prices is everyone choices.

For sale now at cheap price, special discounts and easy shipping. I am really happy with its features and highly recommend it to everyone needing for a quality product with the useful features at an affordable. You can read review from customers to find out more from their experience. RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION has worked wonders for me and I believe it would do wonders on you too. So why waste any more time? Enjoy yourself, you know where to shop the best ones.

Some of the customer reviews speak that the RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION are splendid luggage. Also, It Is a pretty well product for the price. It’s great for colony on a tight budget. We’ve found pros and cons on this type of product. But overall, It’s a supreme product and we are well recommend it! When you however want to know more details on this product, so read the reports of those who have already used it.




RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION is a good choice with brand new features that will make you amaze. But if you still want to have another information about RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION, you can read more detail information, spesification, and reviews from people that bought RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION below.

RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION Detail Information :



This Page is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.co.uk
CERTAIN CONTENT THAT APPEARS ON THIS SITE COMES FROM AMAZON SERVICES LLC. THIS CONTENT IS PROVIDED "AS IS" AND IS SUBJECT TO CHANGE OR REMOVAL AT ANY TIME.

Read More..

Finding A Specialist In Iphone Repair

Sabtu, 14 Juni 2014

By Serena Price


Nowadays, communication through mobile phones has become an essential part of human life that is unimaginable to live without the devices. An iphone is one of the phones that has greatly improved people lives. Its importance goes beyond communication. It has some applications that are useful in doing others things such as determining direction. However, just like other electronic devices, it is also prone to damages. When your iphone gets spoilt, it does not imply that it is the end of it. Instead, it means that you have to look for a specialist in iphone repair.

Finding a reliable repairer is not an easy job but there are some few methods you can try and find effective. The easiest way out when you are in these kind of problems is seeking assistance from friends. You would even get more help from friends who have the same type of device as yours. Ask them if they have had a similar problem before and if so, how they handled it. You better be careful though when asking for help from your friends.

When it comes to business, friends favor each other a lot. In this scenario, you may be directed to a certain repairer not because he is good at what he does but because he is a friend to your friends. So when these kinds of jobs come up, they feel like they owe him a favor of getting customers to him. As a safe rule, do not allow your buddies to hire the technician for you. Their only purpose is to direct you to him and after that you are the only one who can give him the job based on your assessment.

Another way of finding a repairer is by using the internet. You may come across online directories, personal websites and review websites. If you will see any review site, make sure to check it first because they are more helpful than the other sources. They list technicians according to their performances and greatly rely on people who have taken their iphones to these technicians for repairs to do so. They carry out online surveys on these clients and use their responses to do the ranking.

The websites also have platforms that allow people to chat and share a thing or two. You should be prepared to take note of such chats. The conversations may help you know the different personalities of the different repairers and determine the one that suits you most.

Online directories contain address and contact information. Some sites though provide an option of searching for experts using area codes. If you know your code, the only work you will be required to do is to type it in the search box of the site. Note though that some sites may require you to sign up in order to view the information.

Personal websites may also assist you in locating the right technician. They have details concerned with addresses, charges and contacts. Not all technicians have personal websites so you should not assume that all the websites you will see represent all the repairers in your residence.

Another option you can find useful in locating a specialist in iphone repair is the yellow pages. They contain same details as online directories. In case you find many contacts, you do not need to note all of them down. Select a few at random since they are not listed according to the performances of the repairers.




About the Author:



Read More..

Buffalo Introduces 4TB TeraStation in America

Senin, 09 Juni 2014

TerraStation WSSCES was home to a ton of new tech this year including the 4TB TerraStation WSS. Buffalo Technology, who has been a global leader in the development, design and manufacturing of wireless and wired networking, network and direct attached storage solutions, unveiled at CES 2010 the TerraStation WSS which utilizes Windows Storage Server.

The TerraStation incorporates a new x86 hardware platform. This allows the TerraStation to feature four quick-swap SATA hard drives as well as redundant RAID technology and a heavy-duty power supply which provides a dependable and cost effective storage solution. The TerraStation also utilizes Windows NTFS file system providing excellent file security for the SMB as well as really granular folder and file permissions. If you add this to the native Active Directory support then you get a new and really-cost effective solution to the SMB.

According to Ralph Sagnola, Vice President if Sales for Buffalo Technology, "Buffalo technology has been a leader in the SMB storage space and incorporating Windows Storage Server is just the next step. The latest TerraStation WSS is Buffalo delivering on its ongoing commitment of producing high quality, robust storage solutions to the SMB market that are not only cost effective but are also able to meet the high demands of todays business needs."

The TerraStation features Windows Storage Server 2003 R2 Express Edition. This helps businesses store and protect all of their digital assets. Setup for the TerraStation is easy is easy and it is also easy to manage plus it gives you all the power of a Windows server operating system to provide feature-rich file sharing. The TerraStation has support for protocols like SMB, AppleTalk, NFS and Netware and the TerraStation WSS also allows data to be shared along different platforms. Native integration with the Active Directory service provides a simplified management for customers operating in a Windows domain environment.

The TerraStation WSS is backed by a three-year warranty which includes 24/7 technical support. Two different models will be available, a 2TB (WS-Q2.0TL/R5) for $1,599.99 and the 4TB (WS-Q4.0TL/R5) for $1,999.99.


Looking for Computer / PC Rental information? Visit the www.rentacomputer.com PC Rental page for your short term business PC needs. Or see this link for a complete line of Personal Computer Rentals.
Read More..

Technical Blogging Tips 1 million page views and lessons learned in technical blogging

Sabtu, 07 Juni 2014




Firstly, thanks to all my followers and readers for your support in reaching this milestone of 1 million page views.



Here are a few technical blogging tips based on my experience.

1. You need to be patient and keep at it

It took me around 9 months to go from 100 to 4000 daily page views. It was a gradual and slow process, and  I promoted my site via publishing articles at www.javalobby.com and helping out fellow professionals via industry specific forums like www.javaranch.com. Paid attention to Google key words that are not highly competitive and ensured that my contents had the key words to come up on google search for key words like "Java interview questions". The Google analytics revealed the following growth.






2. Sign-up to Google, and get the right tools 


  
-- track your progress and gather metrics (e.g. Google analytics) 
-- Sign up for Google adsense  to earn a small passive income.
-- Feedburner to enable your readers to subscribe to your bog feeds.
-- Google+ to network with your followers.



3. Pay attention to "repeated visitors" and "bounce rate" in Google analytics

Google analytics is a great tool to monitor how well your blog is doing. Two of the key metrics that I constantly look at are

The number of returning or repeated visitors. The slow and steady increase in this number indicates that you are getting some loyal readers who like reading your blog posts.

Jan 2012: 2,825 
Feb 2012: 4,007 
March 2012: 7,131 
April 2012: 10, 321
May 2012: 14,304 
June 2012: 19,122
July 2012: 22, 327 
Aug 2012: 24, 390 
Sep 2012: 25, 994

The "bounce rate" needs to be kept around  70% or less

You cant please everyone who comes to your site. Make sure that the landing page is interesting and informative enough to keep the bounce rate below 70%. If the bounce rate is high, then the problems may include irrelevant information, poor design or that your campaign is targeting unqualified visitors, too many advertisements putting people off, the content is not unique enough and freely available in many other sites, etc. You need to come up with an idea that will differentiate both your site and your content from others in the same niche. Not easy, but possible. For example, there are so many matured sites on "Java Tutorials" and very hard to compete on. The small number of tutorials provided in this blog are mainly to provide some familiarity with the sought-after technologies and frameworks.The real differentiating factor for this site is proving quality Java job interview questions with concise and easy to grasp answers.


4. Use the social media like "Facebook" and "Google+" to network and stay in touch with your readers.

It is vital to network and stay in touch with your readers and fellow professionals to open more doors. Help others and ask for feedback as to how you can improve the quality of your blog posts. Learn the problems faced by your followers and provide solution. Nothing beats the "word by mouth" marketing.


5. Sign up for "google adsense" and "infolinks" advertisements to earn a small pocket money

Dont place any advertisements until you get around 5000+ repeated visitors. Once you get enough repeated visitors you can sign up for "google adsense" and "infolinks" advertisements to be placed. Dont over do it as too many advertisements can annoy your readers. Generally, vertical and horizontal banners perform better. Set up custom adsense channels to see which advertisements are doing better. Dont expect too much from these advertisements, but can be a good passive pocket money in the order of $6.0 to $20.0 per 4000 page views.

6. The main reason for blogging is to open more doors in other areas


As an independent contractor, my blog helps me capture my experience and stay relevant.

Q. Why capture myexperience?
A.

  • Firstly, it will serve as handy notes for my future references.
  • Secondly, I can refresh or jog my memory prior to job interviews to provide a more convincing answers to open-ended questions like -- tell me about yourself? what are your strengths? give me an example where you applied your problem solving skills? what are your recent accomplishments?
  • Finally, my blog contents can potentially become an inspiration to self-publish my own book. Publishing my own book has never been easier with the advent of POD (Print On Demand) publishers like createspace.com, lulu.com, etc. 

It also gives me an opportunity to network. Some of my past and current employers have read my blog posts, and it has certainly helped me win new contracts. Also, it has improved my researching and written skills. In future, if you have a reasonable size followers, you could promote other products and services. You can increase your understanding of the fundamentals from relevant questions and intelligent doubts raised by your readers.


7. People dont have whole day to read your blog posts

So, it needs to be short and sweet. The headings need to be catchy and informative. For example, I have come across some catchy titles like "How I taught my dog polymorphism", "I quit my job today, and so should you", etc.  It needs to be laid out well enough to navigate between topics. Add diagrams and code snippets where applicable.  Consult the "google  key words tool" to optimize your blog titles for SEO.

8. You need to consistently post blog entries, and cant afford to be complacent.

The times that I had been a bit slack in posting new blog posts, my google search rank had dropped. Currently, I have about 135 blog entries. Post about 2 to 4 per week. Dont post multiple entries the same day. One entry per day. The way the SEO works for the blog posts, it not only looks at the backlinks and the key word concentration, but also the reader involvement in terms of the number of comments posted, site popularity with repeated visits, etc.
Read More..

2 Ports VGA Switch Selector Box 2 In 1 Out 2 PC to 1 Monitor

Selasa, 08 April 2014

2 Ports VGA Switch Selector Box (2 In 1 Out, 2 PC to 1 Monitor) Review




2 Ports VGA Switch Selector Box (2 In 1 Out, 2 PC to 1 Monitor)



2 Ports VGA Switch Selector Box (2 In 1 Out, 2 PC to 1 Monitor) Feature


  • 3 Standard 15 pin VGA connectors, 2 in 1 out
  • Enable two computers to share one monitor or projector and two DVDs with VGA port to share one monitor, LCD or Plasma TV Set
  • Manual button control to switch
  • No additional software and power supply needed
  • Resolution: 1600 x 1280; Dimension: 4.7 x 3.3 x 1.1 inch (119 x 84 x 29 mm)




"Buy 2 Ports VGA Switch Selector Box (2 In 1 Out, 2 PC to 1 Monitor)" Overview


This is 2 in 1 out VGA sharing switch, which enable two computers to share monitor or projector. You can also use it to make two DVDs with VGA port share one monitor, LCD or Plasma TV Set. Easy to install and operate, just press the button for swtich.You will not be disappointed with 2 Ports VGA Switch Selector Box (2 In 1 Out, 2 PC to 1 Monitor)






Related Products




For more INFORMATION


....Check price...Product Rating..Customer Reviews











Read More..

I cant belive I found this in a CAD file!

Rabu, 26 Maret 2014

While working on a file today I came across a bit of text that must have been pasted into the file by accident:






It seems that somebody was watching HULU at work one day, found the link to an episode of "Greys Anatomy" and pasted it into this DWG file instead of their browser!  OOPS!!!  I guess they just got busted for goofing off at work!
Read More..

RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION

Selasa, 25 Maret 2014


RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION



RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION is one of the bestseller product in the market today. People arround United Kingdom is looking for RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION with low prices from Internet. If youre lucky you can get a special discount from Amazon, only in this month. Well, good product that comes with low prices is everyone choices.

For sale now at cheap price, special discounts and easy shipping. Im extremely satisfied with their qualities and recommend it to anyone hunting for a top quality item with the latest specifications at an reasonable. You can read review from buyers to find out more through their experience. RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION has worked wonders for me and I believe it will do wonders on you too. So why waste much more time? Enjoy it, you understand where you can shop the best ones.

Most of the customer reviews speak that the RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION are splendid luggage. Also, It Is a pretty well product for the price. It’s great for colony on a tight budget. We’ve found pros and cons on this type of product. But overall, It’s a supreme product and we are well recommend it! When you however want to know more details on this product, so read the reports of those who have already used it.




RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION is a good choice with brand new features that will make you amaze. But if you still want to have another information about RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION, you can read more detail information, spesification, and reviews from people that bought RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION below.

RECHARGEABLE PORTABLE BUILT IN EEARPHONE FUNCTION Detail Information :



This Page is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.co.uk
CERTAIN CONTENT THAT APPEARS ON THIS SITE COMES FROM AMAZON SERVICES LLC. THIS CONTENT IS PROVIDED "AS IS" AND IS SUBJECT TO CHANGE OR REMOVAL AT ANY TIME.

Read More..

Best Practices to write JUnit test cases in Java

Sabtu, 15 Maret 2014

JUnit best practices in Java
No doubt writing good JUnit test cases is a rare skill just like writing good Code. A good, well thought and well written JUnit test can prevent several production issues during initial development or later maintenance in Java application. Though one can only be perfect in writing JUnit test by practice and a level of business knowledge which is important to envision different scenarios on which a method gets called, some best practices or experience of other developer may help to guide other programmers. In this Java article I am sharing some JUnit tips and Junit best practices which I have learned and follow while writing unit tests using JUnit for Java programs. One of the book which helped me a lot is Pragmatic Unit Testing in Java with JUnit by Andrew Hunt and Dave Thomas,  This book shares lot of JUnit best practices which is worth reading and learning if you are serious about Unit testing using JUnit. Never undermine importance of automated testing and test cases written by Developer who writes the code and that's the reason many company are asking programmer to design, code and provide unit tests during there Java interviews. These JUnit best practices not just apply to JUnit but to any other testing framework as well like TestNG, they are more on testing and writing test cases which is more important skill than tool like JUnit or TestNG.
Read more »
Read More..

Why use PreparedStatement in Java JDBC – Example Tutorial

Rabu, 05 Maret 2014

PreparedStatement in Java is one of several ways to execute SQL queries using JDBC API. Java provides Statement,
PreparedStatement and CallableStatement for executing queries. Out of these three, Statement is used for general purpose queries, PreparedStatement is used for executing parametric query and CallableStatement is used for executing Stored Procedures. PreparedStatement is also a popular topic in java interviews. Questions like Difference between Statement and PreparedStatement in Java and How to prevent SQL Injection attacks in Java are popular java interview questions. In this Java JDBC tutorial we will see why should you use use PreparedStatement in Java, What are the major advantages of using PreparedStatement in Java and how PreparedStatement prevents SQL Injection attacks in Java.

This article is in continuation of my earlier post on database and java like 4 tips to improve performance of Java application with database and Difference between truncate and delete in SQL.If you haven’t read  them already you may found  those tutorial useful and interesting.
Read more »
Read More..

Convert String to integer int in Java

Senin, 03 Maret 2014

Java Code Online will discuss the Java Code to convert a String to an int. There is a feature provided in Java, which helps to perform this operation. The conversion is done with the help of a method called parseInt().

Actually any String which could be converted to a primitive can be converted to it, by using the parseXxx() method, where Xxx will replace the type in which it is to be converted, like int, float, etc.

I have provided a sample Java Code which asks the user to enter a number, which is taken as a String by the application. Later it is converted to an integer by using the parseInt() method. Go through the code for a clear understanding on how it is to be used.

  package developer;

  import java.util.Scanner;

  public class StringToInt {

  public static void main(String[] args) {

        System.out.println("Enter a number which would be taken as a String by the application");
        Scanner scanStr = new Scanner(System.in);
        String numStore = null;
        int numConvert = 0;

        // Takes the input as a String
        if (scanStr.hasNext()) {
            numStore = scanStr.next();
        }

        // Convert the String to int by using the Integer.parseInt() method
        numConvert = Integer.parseInt(numStore);

        System.out.println("The number entered by you is: " + numConvert);

     }
  }

The output is something like as shown below.


  Enter a number which would be taken as a String by the application
  22
  The number entered by you is: 22


Some observation points are:-
The String which is to be converted to a number must be a number in the String format. This is required so that the Java parser can parse the String successfully into an int.

If the value entered is not a number, suppose that you entered a String in words in place of a number in String format, then the output is shown below:-

 Enter a number which would be taken as a String by the application
 Conversion from String to int
 Exception in thread "main" java.lang.NumberFormatException: For input string: "Conversion"
     at java.lang.NumberFormatException.forInputString(Unknown Source)
     at java.lang.Integer.parseInt(Unknown Source)
     at java.lang.Integer.parseInt(Unknown Source)
     at developer.StringToInt .main(StringToInt .java:20)

So we see that if a String is entered to be parsed as an int, then the Java Compiler gives a big fat "NumberFormatException".

I hope the Java Code provide to convert an a String to an int was helpful. Do leave a comment if you liked the article. Java Code Online will soon be back with another interesting Java article.

Related Java Codes:-
Convert int to String in Java
Convert int to String in Java using Wrapper Classes
Read More..

How to Configure HTTPS SSL in Tomcat 6 and 7 Java Web Server

Jumat, 28 Februari 2014

Setting SSL (Secure Socket Layer) in Tomcat is often a requirement, especially while developing  secure web application, which requires access over https protocol. Since Tomcat web server doesn't provide SSL settings by default, you need to know how to configure SSL in tomcat, and even worse it varies between different tomcat versions. for Example SSL setup which works on tomcat 6, doesn't work as it is in tomcat 7. In this article we will see, how to configure tomcat for https in both tomcat 6 and 7. For those programmers who are not very familiar with SSL and https here is a quick overview of SSL, certificates and https, and I suggest reading that article to get better understanding of How SSL works and How websites are accessed security over internet.
Read more »
Read More..

Inter Thread Communication in Java using Wait Notify Example

Selasa, 25 Februari 2014

Wait and notify methods in Java are used for inter-thread communication i.e. if one thread wants to tell something to another thread, it uses notify() and notifyAll() method of java.lang.Object. Classical example of wait and notify method is Producer Consumer design pattern, where One thread produce and put something on shared bucket, and then tell other thread that there is an item for your interest in shared object, consumer thread than pick than item and do his job, without wait() and notify(), consumer thread needs to be busy checking, even if there is no change in state of shared object. This brings an interesting point on using wait and notify mechanism, a call to notify() happens, when thread changed state of shared object i.e. in this case producer change bucket from empty to not empty, and consumer change state from non empty to empty. Also wait and notify method must be called from synchronized context, wondering why, read this link for some reasons which makes sense. Another important thing to keep in mind while calling them is, using loop to check conditions instead of if block. This is really tricky for beginners, which often don't understand difference and wonders why wait and notify get called form loops. Joshua Bloch has a very informative item on his book Effective Java, I strongly suggest reading that. In short, a waiting thread may woke up, without any change in it's waiting condition due to spurious wake up. For example, if a consumer thread, which is waiting because shared queue is empty, gets wake up due to a false alarm and try to get something from queue without further checking whether queue is empty or not than unexpected result is possible. Here is standard idiom for calling wait, notify and notifyAll methods in Java :

How to call wait method in Java :
Read more »
Read More..

Difference between ArrayList and Vector in Java

Senin, 24 Februari 2014

ArrayList and Vector are two of most used class on java collection package and difference between Vector and ArrayList is one of the most frequently asked java interview question on first round or phone interview. Though it’s quite a simple question in my opinion but knowledge of when to use Vector over ArrayList or does matter if you are working on a project. In this article we will some point based difference between Vector and ArrayList in Java and trying to understand the concept behind those differences. Ultimate goal is to familiarize yourself with distinguish property of ArrayList and Vector. By the way Java 5 adds another implementation of List interface which is similar to Vector and ArrayList but provides better concurrency access than Vector, its called CopyOnWriteArrayList. By the way this is the third article on discussing about Collection interview question,  Difference between LinkedList and ArrayList  and   List vs Set are other popular interview questions based upon collection framework in Java.

Read more »
Read More..

How to fix java io NotSerializableException org apache log4j Logger Error in Java

Jumat, 21 Februari 2014

java.io.NotSerializableException: org.apache.log4j.Logger error says that instance of org.apache.lo4j.Logger is not Serializable. This error comes when we use log4j for logging in Java and create Logger in a Serializable class e.g. any domain class or POJO which we want to store in HttpSession or want to serialize it. As we know from 10 Java Serialization interview question that, if you have a non serializable class as member in a Serializable class, it will throw java.io.NotSerializableException Exception.

Look at the below code :

public class Customer implements Serializable{

private Logger logger =  Logger.getLogger(Customer.class)

......

}

If instance of Customer will be stored in HttpSession or Serialized externally it will throw "java.io.NotSerializableException: org.apache.log4j.Logger" because here logger instance is neither staticor transientand it doesnt implement Serializable or Externalzable interface.

How to solve java.io.NotSerializableException: org.apache.log4j.Logger

How to fix java.io.NotSerializableException: org.apache.log4j.Logger Error in JavaSolving java.io.NotSerializableException: org.apache.log4j.Logger  is simple, you have to prevent logger instance from default serializabtion process, either make it transient or static. Making it static final is preferred option due to many reason because if you make it transient than after deserialization logger instance will be null and any logger.debug() call will result in NullPointerException in Java because neither constructornot instance initializer block is called during deserialization. By making it static and final you ensure that its thread-safeand all instance of Customer class can share same logger instance, By the way this error is also one of the reason Why Logger should be declared static and finalin Java program. Just make following code change to fix java.io.NotSerializableException: org.apache.log4j.Logger in Java.

public class Customer implements Serializable{

private static final Logger logger =  Logger.getLogger(Customer.class)

......

}

Thats all on how to fix java.io.NotSerializableException: org.apache.log4j.Logger in Java. We have seen what cause java.io.NotSerializableException: org.apache.log4j.Logger, its because Logger class is not Serializable but we also learned that there is no point serializing Logger instance and better to make Logger static and final.

Other Serialization and troubleshooting articles from Javarevisited Blog
Read More..

Why use SLF4J over Log4J for logging in Java

Rabu, 19 Februari 2014

Every Java programmers knows that logging is critical for any Java application, especially server side application, and many of them are already familiar with various logging libraries e.g. java.util.logging, Apache log4j, logback, but if you don't know about SLF4J, Simple logging facade for Java,  then it's time to learn and use SLF4J in your project. In this Java article, we will learn why using SLF4J is better than using log4j or java.util.logging. It’s been long time, since I wrote 10 logging tips for Java programmer,I don’t remember anything I have writing about logging. Anyway, let’s get back to topic, on contrary to all those logging libraries, there is a major difference between them and SLF4J. SLF4J or Simple logging Facade for Java is not really a logging implementation, instead it's an abstraction layer, which allows you to use any logging library in back-end. If you are writing API or utility library, which can be used internally or externally, then you really don't want that any client, which uses your library, should also stick with your choice of logging library. Suppose if a project is already using log4j, and you included a library say Apache Active MQ, which has dependency on logback, another logging library, then you need to include them as well, but if Apache Active MQ uses SL4J, you can continue with your logging library, without pain of adding and maintaining new logging framework. In short SLF4J make your code independent of any particular logging API, which is good think for public API developers. Though idea of abstracting logging library is not new and Apache commons logging is already using it, but now SLF4J is quickly becoming an standard for logging in Java world. Let's see couple of more reason to use SLF4J over log4j, logback or java.util.logging.
Read more »
Read More..

Difference between Singleton Pattern vs Static Class in Java

Kamis, 13 Februari 2014

Singleton pattern  vs  Static Class (a class, having all static methods) is another interesting questions, which I missed while blogging about Interview questions on Singleton pattern in Java. Since both Singleton pattern and static class provides good accessibility, and they share some similarities e.g. both can be used without creating object and both provide only one instance, at very high level it looks that they both are intended for same task. Because of high level similarities, interviewer normally ask questions like, Why you use Singleton instead of Static Methods, or Can you replace Singleton with static class, and  what are differences between Singleton pattern and static in Java. In order to answer these question, it’s important to remember fundamental difference between Singleton pattern and static class, former gives you an Object, while later just provide static methods. Since an object is always much more capable than a method, it can guide you when to use Singleton pattern vs static methods.
Read more »
Read More..

How to escape String literal in Java using Eclipse IDE

Selasa, 11 Februari 2014

Whenever you paste String in Eclipse which contains escape characters,  to store in a String variable or just as String literal it will ask to manually escape special characters like single quotes, double quotes, forward slash etc. This problem is more prominent when you are pasting large chunk of data which contains escape characters like a whole HTML or XML file,  which contains lots of single quotes e.g. ‘’ and double quotes “” along with forward slash on closing tags. It’s very hard to manually escape all those characters and its pretty annoying as well. While writing JUnit test for XML documents, parsing and processing I prefer to have whole XML file as String in Unit test, which pointed me to look for that feature in Eclipse. As I said earlier in my post Top 30 Eclipse keyboard shortcuts, I always look to find new shortcut and settings in Eclipse which help to automate repetitive task. Thankfully Eclipse has one setting which automatically escapes text as soon as you paste it. This is even more useful if you prefer to copy file path and just paste it, Since windows uses forward slash it automatically escape that instead of you going manually and escaping them. By default this setting is disabled in Eclipse IDE and you need to enable it.
Read more »
Read More..

How to configure Log4j in Java program without XML or Properties File

Senin, 10 Februari 2014

Sometime configuring Log4j using XML or properties file looks annoying, especially if your program not able to find them because of some classpath issues, wouldn't it be nice if you can configure and use Log4j without using any configuration file e.g. XML or properties. Well, Log4j people has thought about it and they provide a BasicConfigurator class to configure log4j programmatically, thought this is not as rich as there XML and properties file version is, but it's really handy for quickly incorporating Log4j in your Java program. One of the reason programmer prefer to use System.out.println() over Log4j, of-course for testing purpose, because it doesn't require any configuration, you can just use it, without bothering about XML or properties file configuration, but most programmer will agree that, they would prefer to use Log4j over println statements, even for test programs if it's easy to set them up. By the way, for production use prefer SLF4J over Log4J.  In this Java tutorial, we will see a nice little tip to use Log4j right away by configuring in couple of lines. In fact you can configure Log4J in just one line, if you intend to use there basic configuration which set's the log level as DEBUG.
Read more »
Read More..