Thursday, July 21, 2022

How to get current URL, parameters and Hash tag using jQuery and JavaScript? Example

While dealing with the current URL, many times you want to know what is the current URL path, What are the parameters, and what is the hashtag on the URL. The hashtag is pretty important if you are implementing a tab structure using HTML and JQuery. To avoid confusion, let's take an example of a URL: http://javarevisited.blogspot.com/2013/01/top-5-java-programming-books-best-good.html#ixzz2PGmDFlPd, in this example ixzz2PGmDFlPd, is a hashtag. Now, both JavaScript and JQuery provide a convenient way to retrieve the current URL in the form of window.location object. You can use various properties of the window.location JavaScript object like the window.location.href to get complete URL, window.location.pathname to get the current path, and window.location.hash to get a hashtag from current URL.

Monday, July 18, 2022

How to format/parse dates with LocalDateTime in Java 8 - Example Tutorial

One of the common tasks in a Java project is formatting or parsing data to String and vice-versa. Parsing date means you have a String that represents a date like "2017-08-3" and you want to convert it into an object which represents the date in Java, like java.util.Date in pre-Java 8 world and LocalDate or LocalDatetime in Java 8 world. Similarly, formatting a date means converting a date instance into a String, for example, you have a Date object or LocalDatetime object and you want a String in dd-MM-yyyy format. Java 8 API provides good support for formatting and parsing dates.

Difference between Period and Duration class in Java 8? [Example]

What is the difference between Period and Duration class in Java is one of the popular Java 8 interview questions and has been asked too many of my readers recently. If you were also wondering the difference between Period vs Duration and when to use Period over Duration and vice-versa then you have come to the right place. Java 8 has two classes to represent differences in time like Duration and Period. The main difference between Period and Duration is that they represent the difference in different units, A Duration is used to calculate time difference using time-based values (seconds, millisecond, or hours) but Period is used to measure the amount of time in date-based values like days, months and year.

Friday, July 15, 2022

What is Double Brace Initialization in Java? Example Initializing HashMap and List with values in Java

Double brace initialization is a Java idiom to initialize a Collection like a list, set, and map at the time of declaration. At times, you need a list of fixed elements e.g. supported products, supported currencies, or some other config, and on-the-spot initialization reduces the line of code and improves readability. Double brace initialization idiom becomes popular because there is no standard way to create and initialize Collection at the same time in Java. Unfortunately, unlike other JVM languages like Scala and Groovy, Java doesn't support collection literals yet. 

Saturday, July 9, 2022

3 ways to Learn Redux Framework in depth in 2024 - Best of Lot

The state is a very important part of React development. In simple words, state is a plain JavaScript object that controls the behavior of a React component. If you want to become a professional React developer, then you must understand how to use the state efficiently. React provides inbuilt support for managing state but when the application grows, managing state becomes difficult. So the global state is created for an entire application and to manage such a global state, third-party state management libraries are used.

Thursday, July 7, 2022

Top 7 Pluralsight Courses for Data Scientists to Learn in 2024 - Best of Lot

Hello guys, if you are learning Data Science in 2024 and looking for best online courses to learn Data Science and Machine Learning or got a Pluralsight membership but are not sure which Pluralsight courses to join to better your Python, Data Science, Data Visualization, and other data-related skills then you have come to the right place. Earlier, I have shared the best Pluralsight courses to learn Java, Python, React.js, and JavaScript and today, I am going to share the best Pluralsight courses for Data Science and Data Scientists. These are my favorite Pluralsight courses on the topic as well and even if you are just starting with Data Science you can join these courses to learn a lot. 

Top 10 LinkedIn Learning Courses for Java and Web Developers in 2024 - Best of Lot

Hello guys, if you want to learn Java and Spring Framework in 2024 and are looking for the best LinkedIn learning online courses, you have come to the right place. Earlier, I shared the best Java and Spring Framework courses from Udemy, Coursera, and Pluralsight. This article will find the best Java, Spring, Spring Boot, and Microservices courses for Java developers.  LinkedIn Learning is an educational website by popular social networking site LinkedIn, where I think every Java developer should have their account. It has a lot of practical courses to learn essential skills and technology, and today, I will share the best LinkedIn Learning courses for Java and Spring Boot developers.

Right way to Close InputStream and OutputStream in Java - Example

For some unknown reasons many Java programmers are not very comfortable with IO package. I don't know why, but I have found them much more comfortable with java.lang and java.util than java.io. One possible reason of this could be that, writing IO code require a bit of C++ like programming, which involves doing clean-up, releasing resources once done etc. Since Java made coding a lot easier by taking care of memory management, unknowingly it also introduced bad practice of not releasing resource after use like database connections, socket connection, files, directory, printers, scanners or any other scarce resource.

Saturday, July 2, 2022

How to Learn Python Programming in 2024?

Hello guys, if you want to learn Python Programming language in 2024, one of the most popular programming language of this time but are not sure where to start then you have come to the right place. In the past, I have shared many Python resources like best Python Books, Courses, Projects, interview questions, and even best places to learn Python and  In this article, I am going to share with you the 3 best ways to learn Python programming from scratch. These are my tried and tested way to master any programming language or Framework and I have used this to learn Java, Python, JavaScript and many other technology. 

Top 10 Python Courses on Pluralsight for Beginners and Experienced Developers - Best of Lot

Hello guys, if you want to learn Python Programming language in 2022 and looking for the best Python online courses on Pluralsight then you have come to the right place. Earlier, I have shared the best Python books, Python 3 courses, and Python websites to learn Python programming and in this article, I am going to share the best Python courses from Pluralsight. If you don't know Pluralsight is a leading online learning platform where you get a chance to learn from expert trainers. They are known for their high-quality courses and they have more than 7500+ courses. They also have many projects and hands-on exercises and you can get access to them with just one Pluralsight membership. 

Top 5 Platforms to learn NFT (Non Fungible Tokens) in 2024 - Best of Lot

Hello guys, if you want to learn Non Fungible tokens or NFT in 2024 and looking for best resources then you have come to the right place. Earlier, I have shared best paid NFT courses and best free NFT courses and in this article, I am going to share best places to learn NFT in 2024. To be honest, It's hard to find good NFT training courses and certifications on sea of resources on internet this article tells best platforms to learn NFT and become a NFT professionals in 2024. The constantly rising fame of non-fungible tokens has induced waves of transformation across various sectors. More and more people are interested in learning more about NFTs and exploring their potential.

Top 10 Courses to Learn Metaverse online in 2024 - Best of Lot

Hello guys, if you want to learn about Metaverse and looking for best online courses then you have come to the right place. Metaverse, Web3, and NFT are three buzz words and latest tech which is dominating  internet at the moment. Earlier, I have shared best NFT online courses and in this article I am going to share best Metaverse online courses for beginners to learn in 2024.  But, before we get to the 10 best courses that you can use to learn everything you need to know about Metaverse, let me tell you what it really is.

101 Blockchains Review - Is Enterprise Blockchain Professional Certification worth it? [CEBP]

Hello guys, last year, I was looking for a comprehensive Blockchain Certification when I stumble upon Certified Enterprise Blockchain Professional (CEBP) by 101 Blockchins.com, a site dedicate to teach you Blockchain, NFT, Metaverse, and Web3 skills. This was the Blockchain course I was looking from start as the most of the courses I found are either too shallow or too much technical that you will start feeling sleepy from first lecture. This Blockchain course was just right. It not only covers everything you need to know about Blockchain technology but also cover them in engaging and detailed way. When I first mention this course on my list of best Blockchain certifications and courses, a lot of you asked me to publish a detailed review of this course and here we are. 

Wednesday, June 29, 2022

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 action from the object which actually performs the action. This decoupling between Invoker and Receiver objects 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(). 

Monday, June 27, 2022

Can a Non Static Method Access a Static Variable/Method in Java?

"Can a non-static method access a static variable or call a static method" is one of the frequently asked questions on the static modifier in Java, the answer is, Yes, a non-static method can access a static variable or call a static method in Java. There is no problem with that because of static members i.e. both static variable and static methods belong to a class and can be called from anywhere, depending upon their access modifier. For example, if a static variable is private then it can only be accessed from the class itself, but you can access a public static variable from anywhere.