List of special bash parameter used in Unix or Linux script

Meaning of bash parameter used in Unix script

Many of us use bash script for doing housekeeping and other stuff but occasionally and not much aware of special bash parameters. When I was new to bash shell and Linux and looking on some already written bash script I used to get baffled with special bash symbols like $@, $_, $1 etc. I did know that they are bash parameter and has special meaning but I don't have all meanings of special bash parameter on top of my head and I always go to Google and search endlessly for those special bash parameter, some time I got and found meaning of those special bash script parameters quickly but sometime I need spend some time to get what I am actually looking for, so I thought to document meanings and expansion of those special bash parameters or bash script parameters.

This bash script parameter tutorial is in continuation of my earlier UNIX tutorials find examples in UNIX, grep command examples in UNIX, and UNIX networking commands tutorial if you haven’t read already you may find them interesting and useful.

3 Exampls to Convert an Array to ArrayList in Java

How to convert an array to ArrayList in Java
Have you encountered any situation where you quickly wanted to convert your array to ArrayList or ArrayList to array in Java? I have faced many such situations which motivate me to write these quick Java tips about converting array to ArrayList and ArrayList to array in Java. Both array and ArrayList are quite common and every Java developer is familiar with this. Former is used to store object and primitive type while later can only hold objects. Array is part of standard Java fundamental data structure while ArrayList is part of collection framework in Java. Most of the time we store data in form of object in either Array or ArrayList or sometime we find either of them suitable for processing and we want to convert from one array to ArrayList or ArrayList to array in Java. This short array to ArrayList tutorial in Java will explain how quickly you can convert data from each other. So when you face such situation don't bother just remember this tips and you will get through it. If you compare array vs ArrayList only significant different is one is fixed size while other is not. This article is in continuation of my post Difference between Vector and ArrayList in Java and How to Sort ArrayList in Java on descending order. On related not from Java 5 onwards ArrayList class supports Generics in Java, which means you can convert an ArrayList of String into an String array or ArrayList of Integer into an Integer Array. Generics provides type safety and remove casting during runtime.

10 example of using Vim or VI editor in UNIX and Linux

Vim or VI editor tutorial in UNIX

vi editor in unixVI Editor is like notepad in UNIX but it’s extremely powerful and have sophisticated feature to work as complete IDE. No matter which version of UNIX you are working or which flavor you are using you always find either VI editor or VIM there. VI is a very large topic and I am not covering every aspect of it what I am sharing here is some examples of using VI editor in UNIX or Linux. most of the time we use only 10% of VI editor and never know 90% of it , to be frank I also don't know many of VI feature by heart but I always search for it , see people working in VI and learn from there experience as well. after working on VI editor what I found that every day we learn something new in VI editor but we  forget something equally important and there I thought lets document whatever VI commands I have learned so far and using regularly. Idea is to keep this VI Editor tutorial updated with every single useful VI commands I learn and I also ask you guys to contribute with something useful. If you see 10 peoples working in VI editor you realize that they use it differently then use some new VI commands which you are not familiar of and which could improve your productivity as well. so if you would like to know more and more about VI editor I would suggest observe people around you when they work in VIM or VI editor and learn from there experience. Don’t confuse with both VIM and VI, VIM stands for VI improved and has some more feature than VI editor. Many a times you will find that VI command is aliased to VIM to make it default editor in UNIX.

3 ways to solve java.lang.NoClassDefFoundError in Java J2EE

I know how frustrating is to see Exception in thread "main" java.lang.NoClassDefFoundError,  which is a manifestation of NoClassDefFoundError in Java. I have seen it a couple of times and spent quite a lot time initially to figure out what is wrong, which class is missing etc. The first mistake I did was mingling java.lang.ClassNotfoundException and NoClassDefFoundError, in reality they are totally different, and my second mistake was using trial and error method to solve this java.lang.NoClassDefFoundError instead of understanding why NoClassDefFoundError is coming, what is the real reason behind NoClassDefFoundError and how to resolve this. In this Java tutorial, I have tried to rectify that mistakes and uncover some secrets of NoClassDefFoundError in Java and will share my experience around it. NoClassDefFoundError is not something which cannot be resolved or hard to resolve it’s just its manifestation which puzzles most of Java developer. This is the most common error in Java development along with java.lang.OutOfMemoroyError: Java heap space and java.lang.OutOfMemoryError: PermGen space  Anyway lets’s see Why NoClassDefFoundError comes in Java and what to do to resolve NoClassDefFoundError in Java.

How to use Comparator and Comparable in Java? With example

Comparator and Comparable in Java Examples
Difference between Comparator and Comparable in Java is very popular Java interview question mostly asked in telephonic round and writing code to sort object using Comparable or Comparator is popular on  written test round of interview.The question was this “How you will sort Employee object based on his EmployeeID and his name” and this involves the use of both Comparable as well as Comparator interface in Java. This post is my revision on Java fundamentals similar to I did about equals method in Java and  some tips to override hashCode in Java. All of these methods are fundamentals in Java programming language and correct understanding is must for any Java developer. Comparators and comparable in Java are two interfaces which is used to implement sorting in Java. It’s often required to sort objects stored in any collection classes like ArrayList, HashSet or in Array and that time we need to use either  compare() or  compareTo() method defined in java.util.Comparator and java.lang.Comparable. In this Java tutorial we will see example of  Comparator and Comparable to sort object in Java and discuss some best practices around when to use Comparator interface etc. Any way before moving ahead Let’s see some important differences between Comparable and Comparator in Java.

Top 30 Programming questions asked in Interview - Java C C++ Answers

Top 30 Programming interview questions
Programming questions are integral part of any Java or C++ programmer or software analyst interview. No matter on which language you have expertise it’s expected that you are familiar with fundamental of programming and can solve problems without taking help of API. Programming questions like reversing String using recursion or How to find if Array contains duplicates are some popular examples of programming question in Java. Programming questions present lot of challenges Especially to Java developers as compared to C++ programmer and I think, One reason for this is powerful Java API; Which has method for almost every need and you rarely need to write by your own or there are lots of third party library from Apache, Spring, Google and other open source. These programming interview questions are from my personal collections and I have only chosen those which are not very difficult, can be solved easily but at same time can become too complex or confusing, present lots of follow-up questions and test fundamentals of programming, OOPS and design. I have not given answers of these programming questions but those can be found by Google and I will try to post links of answers here sometime later but at same time I will try to provide quick tips or hints on some questions. You can also take help from  Programming Interviews Exposed and 10 coding questions asked in Google with solution to prepare for any programming Job interview. Those two books has helped me a lot in the past and even today I read them whenever I need to refresh my concepts.

Anyone who is following programming questions must be familiar with these questions and also knows answer for most of these but for new guys and even for intermediate its worth refreshing it before going to any programming job interview e.g. Core Java interview.

Tibco tutorial : Reliability Parameter Explained

Reliability parameter is one of the important stat up parameter we provide to tibco rvd and incorrect setting up of this parameter can screw up things in big way. When I wrote Tibco Tutorials for beginners I thought to explain some individual concept on separate tutorials and this article is part of it. Tibco messaging is one of the most used messaging solution on Investment banks over the years and will continue for coming years.

How Volatile in Java works? Example of volatile keyword in Java

How to use Volatile keyword in Java
What is volatile variable in Java and when to use  the volatile variable in Java is a famous multi-threading interview question in Java interviews. Though many programmer knows what is a volatile variable but they fail on second part i.e. where to use volatile variable in Java as its not common to have clear understanding and hands-on on volatile in Java. In this tutorial we will address this gap by providing simple example of volatile variable in Java and discussing some when to use the volatile variable in Java. Any way  the volatile keyword in Java is used as an indicator to Java compiler and Thread that do not cache value of this variable and always read it from main memory. So if you want to share any variable in which read and write operation is atomic by implementation e.g. read and write in an int or a boolean variable than  you can declare them as volatile variable.