Wednesday, May 22, 2019

How to implement Command Design Pattern in Java with Example

Hello guys, it's been a long since I have shared a Java design pattern tutorial. I did share some courses to learn design patterns but haven't really talked about a particular design pattern in depth. So, today, we'll learn one of the important design pattern, which is often overlooked by Java developers. Yes, I am talking about the Command Pattern which can help you write flexible, loosely coupled code for implementing actions and events in your application. In simple words, the command design pattern is used to separate a request for an action from the object which actually performs the action. This decoupling between Invoker and Receiver object provides a uniform way to perform different types of actions. This decoupling is achieved using a Command object, which is usually an interface with methods like execute()

Tuesday, May 21, 2019

How to find all Checked checkboxes in jQuery? Example Tutorial

Hello guys, suppose you have multiple checkboxes in your HTML page and you want to retrieve all checkboxes which are checked? How will you do that in jQuery? Well, you can use the pseudo selector like :checked to get all checked checkboxes. This selector checks for the checked property of checkbox and returns only those checkboxes which have this property. For example, following jQuery selector will return all the checkboxes which are checked:


In this, we are first selecting all input elements where type is a checkbox and then adding: checked to filter only those which are checked.

10 Example of find command in UNIX and Linux

The find command is one of the most versatile commands in UNIX and Linux and I used it a lot in my day to day work. I believe having a good knowledge of find command in UNIX and understanding of its different options and usage will increase your productivity a lot in UNIX based operating system e.g. Redhat Linux or Solaris. If you are a QA, support personnel, and your works involve lots of searching text on Linux machine or if you are a Java or C++ programmer and your code resides in UNIX, find command can greatly help you to look for any word inside your source file in the absence of an IDE. It is the alternative way of searching things in UNIX, grep is another Linux command which provides similar functionality like find but in my opinion later is much more powerful than grep in UNIX.

Monday, May 20, 2019

10 Unit Testing and Automation Tools and Libraries Java Programmers Should Learn

In last a couple of weeks, I have written some articles about what Java developer should learn in 2019 e.g. programming languages, libraries, and frameworks, but if you have just one thing to improve or learn then that must be your automation testing skills. Testing is one of the disciplines which separates professional developers with amateur ones. It's not about following TDD, BDD, or whatever testing methodologies but at the very minimum level, you must write code to test your code automatically. Many Java developers write unit tests and integration tests which automatically run during build time, mostly by using continuous integration tools like Jenkins or TeamCity.

Top 10 ConcurrentHashMap Questions from Java Interviews

The ConcurrentHashMap class part of concurrent collections package added on JDK 1.5 which contains utility classes like BlockingQueue, CopyOnWriteArrayList, CopyOnWriteArraySet etc. It is a replacement of synchronized hash-based map implementations e.g. Hashtable and synchronized HashMap. It implements Map and ConcurrentMap (a sub-interface of Map) interface which allows you to store key-value pairs. The class is similar to HashMap or Hashtable but it's more scalable and the right fit for concurrent Java application. Unlike Hashtable which achieves its thread-safety by compromising the scalability, ConcurrentHashMap uses advanced techniques e.g. dividing the map into segments to remain thread-safe and scalable at the same time.

Sunday, May 19, 2019

Top 5 Advanced SQL Books for Experienced Programmers - Best of lot, Must read

If you an experienced programmer and know how to write SQL queries and database fundamentals but want to take your SQL and database skills to the next level then you have a come to the right place. In this blog, I have shared a lot of free SQL books and courses you can use to start your SQL journey. This is also the second article about SQL books, In the first part, I have shared some of the best SQL books which are essential to learning SQL queries and fundamentals of database e.g. normalization, indexing, and other design stuff, if you haven't read it yet, I suggest to do it now. You will find some amazing book to start learning SQL. In this article, I am going to share some of the best books to learn advanced SQL programming, which can help you to write better SQL queries and understand how database process those queries.