jQuery allows you to modify multiples elements in one go, you can modify attributes, text, or color of multiple HTML elements by executing just one line of jQuery code. In this jQuery tutorial, I will show you how to modify multiple <li> elements in one go. In our example, we have a couple of <li> tags to display sub-headings, now we will change them in one go using jQuery. If you look at our HTML, we have an ordered list <ol> to display the top 10 programming languages, each of them is an <li> item. We also have one button, "Click Me", which will when clicked, change all <li> item's text to "jQuery is the new Boss". Here is the jQuery code, which does that.
Thursday, March 2, 2023
7 jQuery Selectors Examples for Beginners - Tutorial
jQuery selectors are like CSS Selectors, which allow you to find or select an element from the DOM tree. When HTML pages loaded in a browser like Chrome, Firefox, or Internet Explorer, the browser creates a tree-like structure is known as Document Object Model or DOM. JavaScript and jQuery allow you to play with this DOM i.e. selecting elements from DOM, traversing through DOM, going from one element to another, selecting a list of elements from DOM, adding or removing elements from DOM, etc.
Labels:
HTML and JavaScript
,
JQuery
,
programming
Top 16 Lambda Expressions + Stream Interview Questions Answers for Experienced Java Programmers
For a long time my readers were asking about some Java 8 interview
questions, particularly on lambda expression, streams and around language
changes e.g. default methods, method reference and functional interface.
Finally, I am able to put some
common Java 8 interview questions
on lambda expression and Stream API and essential functional programming concepts like map, flatmap, and reduce together, which I going to share with you in this
article, but before that, let's talk a little bit about impact of Java 8 in
Java Developers interviews and why it's imperative for Java programmers to learn Java 8, particularly Lambda and Stream API.
Labels:
interview questions
,
Lambda expression
,
Stream API examples
How to find all unchecked checkboxes from a page using jQuery? Example Tutorial
Hello guys, In the last tutorial, you have learned how to get all the checked checkboxes from a page using jQuery, but sometimes you also need all the checkboxes which are not selected. In this tutorial, you will learn that. If you remember, we have used the:checked pseudo selector to get all checked checkboxes, but, unfortunately, there is nothing like the :unchecked selector in jQuery, so using that will result in the syntax error. Even the!:checked or :!checked will not work, instead, you need to use not() jQuery selector, which does the negation job.
Labels:
HTML and JavaScript
,
JQuery
,
web development
How to find a Good Programmers on Tech Interviews?
When it comes to interview, goal is to find the most suitable developer for job to get done but its very difficult to judge someone's caliber, experience and expertise in short duration of Interview. There is always a process starting from phone interview, written tests to face-to-face interview, but its still difficult to hire the right programmer. Process can help you to filter candidates but eventually it will come down to your experience and gut feeling. As you take more and more interviews, you will know what to ask and what not and like many other interviewers in the world, you will develop some of your own tips. Similarly, I have developed couple of tips from my experience which has helped me to differentiate an average programmer with a good programmer in past.
Labels:
programmers
,
programming
Wednesday, March 1, 2023
How to Fix 'javac' is not recognized as an internal or external command in Windows and Linux? Example
Hello guys, if you are trying to compile your Java source file and getting "'javac' is not recognized as an internal or external command" in Windows or Linux machine like Windows 10 or Redhat 8 but not sure what to do then you have come to the right place. This is a common Java related error and can occur to an operating system like Windows, Mac or Linux if java is not installed properly like only JRE is installed and JDK is not installed or javac is not added on PATH environment variable. In this article, I will explain what this error is and how you can fix it by following step by step guide I share, but if you still cannot solve this problem on your own then just ask for help in comments. But don't forget to check your PATH environment variable because that's where JDK/bin directory needs to be present, which contains all Java related commands including "javac" and "java" which are used to compile and run Java applications.
Labels:
core java
,
debugging
,
error and exception
,
programming
Sunday, February 26, 2023
How to Learn Python Programming and Development in 2024?
If you want to learn Python Programming language online in a week on your own and looking for the best online Python resources then you have come to the right place. In the past, I have shared the best Python courses, books, Python developer RoadMap, and tutorials, and today, I am going to share with you the exact step-by-step plan to learn Python programming from scratch in 7 days by joining the best Python courses on Udemy, one of my favorite and most affordable website for online learning. After thorough research, combined with my own experience, I have chosen two of the best Python Bootcamp courses which can be used to learn Python from scratch in a week's time.
Labels:
best of javarevisited
,
programming
,
python
Thursday, February 23, 2023
How to fix java.lang.OutOfMemoryError: unable to create new native thread in Java [Solution]
It's been a long time since I shared any Java Error or Exception troubleshooting tutorial so here we are. In this post, we will take a look at the "java.lang.OutOfMemoryError: unable to create new native thread" error which is a rate but quite possible in multithreading Java applications. This is another Java OutOfMemoryError that comes when JVM hits the native thread limitation allowed to be open by one process and not able to create any more new threads. Since each Java thread is associated with the OS thread, when OS refuses to provide a new thread, JVM throws OutOfMemoryError. It's rarely you will see common Java applications throwing this error but it's common when multiple application is using the same Java process e.g. Web Server Tomcat and a significant number of threads are allocated due to high load.
Labels:
error and exception
,
OutOfMemoryError
,
troubleshooting
How to display full command a Running Process in Linux and Solaris? Example
One of the problems with ps command, which is a popular tool to find any processes along with the grep command in the Solaris operating system is that it doesn't show full command-line argument of process. This means if you are doing grep on any text which appears at the tail end of the long command line, you will likely not able to capture that process by using ps and grep. This is dangerous because it may lead you to assume that certain process is not running and you may restart it again, despite its being running and only because you didn't find the process.
Labels:
debugging
,
linux
,
troubleshooting
,
unix
Thursday, February 16, 2023
How to use var keyword to declare local variables in Java? Example Tutorial
Hello guys, In this series of new features of Java 10 articles, today, I am going to talk about probably the most popular and most useful, the introduction of var keyword (well, it's not really a keyword but I'll you later about it) in Java. If I am not wrong, this feature was supposed to come on Java 9 but dropped later. Finally, Java also has a var keyword to declare local variables which allows you to declare a variable without their type like instead of doing String str = "Java" you can now just say var str = "Java". This may not sound much gain when declaring String or an int variable but consider complex types with generics, this will surely save a lot of typing and also improves the readability of code.
How to Sort a List in Reverse Order in Java? ArrayList Example
Java Collection Framework provides a convenient reverse comparator, to
sort a List of objects in reverse order. You can obtain reverse Comparator, by
calling Collections.reverseOrder(), which by
default sort List of Integer in reverse
numeric order and List of String in reverse alphabetic order. It
actually reverses the natural ordering of objects imposed by the Comparable interface. Apart from this method, Collections class also
provides an overloaded method Collections.reverseOrder(Comparator
cmp) , which takes a Comparator,
and sorts List on reverse order of that Comparator.
Labels:
core java
,
java collection tutorial
,
programming
What is the real use of Method overloading in Java and Object Oriented Programming? Example
Many programmers, including Java and C++ developer, knows about the object oriented programming concepts like method overloading or function overloading, but if you ask them why you should overload a method? Many of them become clueless. This is a common problem of half learning i.e. you know the concept but you don't know the application. If you neither know what problem it solves nor what benefit it provides, then just knowing the concept is not enough. You won't be able to reap all benefits if you just know the concept and never use that in practice. If you are wondering what is the real use of method overloading then don't worry, I will share the answer in this article. Btw, this is also one of the popular object oriented programming interview question and its good to know about it.
Labels:
core java
,
object oriented programming
Friday, February 10, 2023
How to get Id of an HTML and DOM object in jQuery? Example Tutorial
As a page author, the id of an HTML element is something you should know. Still, there are scenarios when the page is automatically generated, or maybe some form elements are generated by using frameworks like JSF. In that case, what do you do if you want to find an id attribute of some elements in the page programmatically? How do you find those ids using jQuery? There are several ways to solve this problem, a couple of them in this article itself. The jQuery API provides many methods to get any attribute or property, including the id of an HTML element programmatically.
Labels:
JavaScript
,
JQuery
Saturday, February 4, 2023
How to use State Design Pattern in Java? Vending Machine Example
The State design pattern is a behavioral pattern, first introduced by GOF in their class is book design patterns. State pattern looks similar to Strategy pattern but it helps in managing object state and thus enabling them to behave differently in a different state. In this example, we will take a famous object-oriented design interview question, implementing Vending Machine in Java. In the past, we have solved this problem without using any design pattern, but here we will use state design patterns to create a vending machine with different states. This example will not just help you to understand how to implement State Design Pattern in Java but also gives you experience about when to use State Pattern on your application.
Labels:
core java
,
design patterns
,
interview questions
Wednesday, February 1, 2023
Difference between Statement vs PreparedStatement vs CallableStatement in Java JDBC
Hello Java programmers, if you are looking to find out the difference between Statement, PreparedStatement, and CallableStatement in Java then you have come to the right place. Earlier, I have shared common JDBC Interview Questions and in this article, I am going to explain what is the real difference between these Statement types in Java and when to use Statement, PreparedStatement, and CallableStatement in Java programs. JDBC API provides several classes and interfaces for various things, but three of the most important types of Statement classes are Statement, PreparedStatment, and CallableStatement. They are designed to execute different types of SQL queries.
Labels:
core java interview question
,
JDBC
Subscribe to:
Posts
(
Atom
)