Otherwise, on some Java virtual machine implementations, a particular thread may be stuck in the wait set for a very long time. If a notify always selects the most recent arrival from the wait set and the wait set always contains multiple threads, some threads that have been waiting the longest may never be resurrected.
Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
When to use notify() and notifyAll() in Java
Otherwise, on some Java virtual machine implementations, a particular thread may be stuck in the wait set for a very long time. If a notify always selects the most recent arrival from the wait set and the wait set always contains multiple threads, some threads that have been waiting the longest may never be resurrected.
2 Ways to test Exception in JUnit : Annotation vs try-catch
3 Best books to prepare OCAJP 7 (1Z0- 803) Exam - Java SE 7 Certification
Top 10 WebSites to Learn Java Online for FREE
-------------------------------------------
Programming Java for Beginners - The Ultimate Java Tutorial from Udemy http://codecondo.com/go/learnjava/
CodingBat - The Website for practicing Java Online http://codingbat.com/
Java Basics Tutorials from Oracle http://www.oracle.com/technetwork/topics/newtojava/overview/index.html
Introduction to Programming in Java - The book http://introcs.cs.princeton.edu/java/home/
Learn Java Online - Website to learn Java Interactive http://www.learnjavaonline.org/
Learn Java The Hard way - https://learnjavathehardway.org/
Programming By doing - http://programmingbydoing.com/
Java for Complete Beginners - The FREE Video Tutorial https://www.udemy.com/java-tutorial
Java Programming Tutorials for beginner - The newboston Video tutorial https://www.youtube.com/course?list=ECFE2CE09D83EE3E28
Object-Oriented Programming with Java - The University course http://mooc.cs.helsinki.fi/programming-part1/registration-and-how-get-started
10 Advanced Java Books for Experienced Developers
1) Effective Java
This is the first book every intermediate Java developer should read. It's not for beginners, and expert already knows most of the trick buts its absolutely critical for Java developer with a couple of years of experience. This book is your first step towards becoming an expert Java developer.
If you are working in Java for a couple of years and want to move from that advanced level, here are a couple of books to read.
-------------------------------------------
2) Java Concurrency in Practice
3) Java 9 Modularity
4) Definite guide of Java Performance by Scott Oaks
5) Head First Design Pattern
6) Test-Driven
7) Well-grounded Java Developer
8) Java NIO by
9) Java By Comparision
10) Refactoring
11) Modern Java in Action
This is the bonus book but how can you be a Java expert without knowing anything about Java 8 even after 1.5 years or its launch? So you must read this book to get a feel of new Java 8 features and motivation behind them.
Top 10 Java HashMap, Hashtable, ConcurrentHashMap Interview Question
--------------------------------------------------------------
How to synchronize HashMap in Java?
How to sort HashMap in Java on values?
What is the difference between Hashtable and HashMap?
What is the difference between HashSet and HashMap
Difference between HashMap and ArrayList in Java?
What is the difference between HashMap and LinkedHashMap?
What is the difference between ConcurrentHashMap and HashMap?
How does get() method of HashMap works internally?
What are the different ways to iterate over each entry in HashMap?
How to loop over Map in Java?
How HashSet internally works in Java?
Difference between TreeMap and TreeSet in Java
Top 5 Microsoft SQL Server Books for DBAs and Developers
SQL Server Execution Plans by Grant Fritchey
Learn the basics of capturing plans, how to interrupt
them in their various forms, graphical or XML, and then
how to use the information you find. Diagnose the most
common causes of poor query performance so you
can optimize your SQL queries and improve your
indexing strategy.
SQL Server Concurrency: Locking, Blocking
and Row Versioning
by Kalen Delaney
Your application can have world-class indexes and
queries, but they won’t help you if you can’t get your data
because another application has it locked. That’s why
every DBA and developer must understand SQL Server
concurrency, and how to troubleshoot any issues.
SQL Server Transaction Log Management
by Tony Davis and Gail Shaw
Tony Davis and Gail Shaw strive to offer just the right level
of detail so that every DBA can perform all of the most
important aspects of transaction log management.
Troubleshooting SQL Server: A Guide for the
Accidental DBA
by Jonathan Kehayias and Ted Krueger
Three SQL Server MVPs provide fascinating insight into
the most common SQL Server problems, why they occur,
and how they can be diagnosed using tools such as
Performance Monitor, Dynamic Management Views, and
server-side tracing performance, so you can optimize
your SQL queries and improve your indexing strategy.
Defensive Database Programming
by Alex Kuznetsov
The goal of defensive database programming is to
help you to produce resilient T-SQL code that robustly
and gracefully handles cases of unintended use,
and is resilient to common changes to the database
environment.
That's all about top 5 good Microsoft SQL SERVER books.
2. Complete SQL + Databases Bootcamp: Zero to Mastery (ZTM)
3. SQL for Data Science [Coursera]
4. Database Design Fundamentals for Software Engineers [Educative]
5. SQL QuickStart Guide (Book)
20 grep, egrep and fgrep command examples in UNIX/Linux
1) How to find all matching lines in a file in UNIX?
$ grep "good" dict.txt
2) How to exclude lines in a file, which matches patterns using the GREP command?
$ grep -v
2) How to count the number of matching lines in a file in Linux?
$ grep -c "good" dict.txt
3) How to perform case insensitive search for a keyword in a text file?
grep command support case insensitive search through grep -i option, where i stands for ignore case. This is quite useful if you are looking for strings like "error", "Error" and "ERROR" in a file. without case insensitive search you may not get the full picture if your developers are using different cases for the same keyword. Doing a case the insensitive search will give you the full idea.
4) How to display matched keywords as colored in grep output?
5) How to perform a recursive search using grep command in UNIX?
By using grep -R option, which performs a recursive search to sub-directories
6) How to make your grep command faster?
grep is very slow on UTF-8. Use “LANG=C grep …” to increase speed.
$ echo $LANG
en_US.UTF-8
$ time grep ‘^….’ /usr/share/dict/words >/dev/null
real 2m16.795s
user 2m10.536s
sys 0m0.087s
$ export LANG=C
$ time grep ‘^….’ /usr/share/dict/words >/dev/null
real 0m0.031s
user 0m0.028s
sys 0m0.003s
6) How to display lines above and below matching lines using grep command in Linux
grep support an option called --context
You have even option to display n number of lines after the match, or just show lines above and below of matching lines using -A and -B.
7)
How to learn more about grep command in Linux box itself, use the following commands :
man grep
info grep
8) How to search for a given string in multiple files in UNIX
how to print the name of all files which contains a particular String
9) How to use regular expression with grep command in UNIX.
You can use a basic set of regular expressions with grep command as shown below. There are two ways to use regular expression with grep command either by using grep -e option or grep --regex option
10) How to search for full words in a file in Linux using GREP
grep -w
11) How to display only the name of the files, which matches a given pattern?
Here we don't want matching lines to be printed, we only want to know the files, which contains matching lines.
grep -l option is our solution
12) How to show only the matched String
13) How to show the position of the match in the line
14) How to show numbers while display grep output
15) egrep command examples
16) fgrep command examples
That's all on this list of grep command examples in UNIX/Linux. We have learned a lot of good options of grep command, in fact, I would say Every Linux user must know these grep option to take full advantage of grep command in Linux. Let us know if you got any cool grep tips.
10 most useful command in VI Editor in Unix
2) finding form bottom "?" looking for Execution Report 35=R
3) find and replace
Vi Replace Command
One other shortcut that might be worth mentioning is that 1,$ and % both indicate all the lines in the file. Therefore,
:1,$s/search_string/replacement_string/g
and
:%s/search_string/replacement_string/g
How to remove ^M from unix files using VI editor
1) ^M is DOS line break charater which shows up in unix files when uploaded from a windows file system in ascii format.
To remove this, open your file in vi editor and type
:%s/(ctrl-v)(ctrl-m)//g
and press Enter key.
Important!! - press (Ctrl-v) (Ctrl-m) combination to enter ^M character, dont use â€Å“^†and M.
2) Your substitution command may catch more ^M then necessary. Your file may contain valid ^M in the middle of a line of code for example. Use the following command instead to remove only those at the very end of lines:
:%s/(ctrl-v)(ctrl-m)$//g
3) In some flavors of vi (e.g. RedHat), vi does it for you with:
:set fileformat=unix
4) the simplest way is to use the command dos2unix
5) If you wan to use space in file name the inclose the name in between quotes
''
4) Seeing command history in Vim
5) saving data and quiting
6) Inserting data
7) deleting data
8) cut copy past, pasting above line and below line
9) opening multiple file in VI and navigating between them
10) using ctrl+Z for suspending process
11) running bash commands from VI
12) Shortcut of keyboard also work in VI editor , like my favorite shortcut ctrl+w worked there.
Ctrl +R is act as Redo in VI editor.
VI mein agar yadi kisi directory ke name mein / hai aur wo aapko replace karna hai to usko escape kar do with \ e.g. \/ .
2.Abhijit told me how to open another rfile in VI and then navigate between that ^filename for opening the file and then :e #1 , :e #2 for navigating the file , we did this before by opening five files together while doing CST morning check and then using :n for navigating to next file.
Also for opening VI in readonly mode use the option â€Å“VI –R â€Å“ option.
In VIM we can use :help for getting help or :help fixdel for a specifc thing.
How to execute shell commands inside vi ?
!command , or select an ara using V/v and hit ! and then type the command and the selected area will lbe deleted ,fed into the command and replaced with the output of the command.
If we are doing something in VI and wanted to go shell without closing the vi then we can use command â€Å“!sh†and go to the shell finish the work, do exit and comes back to vi. ! is used to execute shell commands from shell e..g !date.
• After doing ls –l abc.txt if you want to open abc.txt you can use vi !$ (last argument)
10 most useful VI shortcut
-----------------------------
CTRL + R -- Redo
yy -- yank
dd -- delete , 5dd
p and shift+P - Paste
5. how do you get visual block in VI , you can get the visual block by pressing ctrl+V and then use yy to copy the selcted block , it can be use to copy a region from VIM into the windows clipboard without using the mousse , V(move) + y or lower case v for sections of lines or Ctrl+v for blocks.
:e for opening a new file from inside VI
VI - R for opening a file in readonly mode.
Top 10 questiosn in Thread
-------------------------------------
One of my room mate have been preparing for java interview from past few days.
1) Since start() method of Thread class eventually calls run() method ? why should we not directly call run() method ?
2) I have two separate threads running separate task but I want them to run in a specic order ? how can I acheive this ?
3) What will happen if I call start() method on a running thread ?
4) What is the difference between sleep() and wait() method ?
5) What are the ways you can stop Thread ?
6) How do you find if a thread holds a lock or not ?
7) What is deadlock and how will you fix this ?
8) What is the difference between interuppted() and isInteruppted() ?
9) How do you acheive thread intercommunication ?
10) What is volatile modifier ?
Top 10 Courses for Java Developers on PluralSight
For Java :
1)Jim Wilson's course on Java Fundamentals.Even if you are a experienced java developer ,you would love these course & find something new.
2)Richard Warburton's Java Fundamentals: Collections
2)Understanding the Java Virtual Machine series.Advance course.
3)Unit Testing In Java With JUnit
4)Design patterns : Design Patterns Library
4)Concurrency :Applying Concurrency and Multi-threading to Common Java Patterns
5) Creating Your First Spring Boot Application Dan Bunker
6)Creating an Automated Testing Framework With Selenium
7)Spring Fundamentals
8)SOLID Principles of Object Oriented Design
9)Introduction to Spring MVC 4
11)Maven Fundamentals by Bryan Hansen
That's all about some of the best courses to learn Java. The list includes Java courses for beginners as well as for exprienced Java programmers. It has basic courses to learn Java fundamentals and Spring framework but also contains some advanced courses to learn unit testing, design patterns, Spring security, Concurrency, Spring MVC, Spring Boot etc.
Top 5 Machine Learning Algorithms for Data Science and ML Interviews
Difference between Random, ThreadLocalRandom and SecureRandom
1. Java’s default Random class is expensive to initialize, but once initialized, it can be reused.
2. In multithreaded code, the ThreadLocalRandom class is preferred.
3. The SecureRandom class will show arbitrary, completely random performance. Performance tests on code using that class
must be carefully planned.
Random vs ThreadLocalRandom in Java
As the name suggests, the main difference between these two is how thread-safety is handled. The main operation is responsible for generating random number nextGaussian() of java.util.Random is synchronized. Since this method is used by all the methods which return random number, in multi-threading environment this method becomes a bottleneck.In short, if two threads use the same random instance at the same time, one will have to wait for other to complete its operation. On the other hand, ThreadLocalRandom class uses a thread-local concept, where each thread has its own random number generator.
So in a contended environment, it's better to use ThreadLocalRandom. One more performance benefit of using this class is that it reuse an expensive-to-create object.
Difference between Random, ThreadLocalRandom, and SecureRandom in Java
As opposed to synchronization difference between ThreadLocalRandom and Random, SecureRandom is algorithmic different than Random and ThreadLocalRandom. Both Random and ThreadLocalRandom (later is sub-class of former) implements a typical pseudorandom algorithm. While these algorithms are quite sophisticated.
The difference between those classes and the SecureRandom class lies in the algorithm used. The Random class (and the ThreadLocalRandom class, via inheritance) implements a typical pseudorandom algorithm. While those algorithms are quite sophisticated, they are in the end deterministic. If the initial seed is known, it is easy to determine the exact series of numbers the engine will generate. That means hackers are able to look at series of numbers from a particular generator and (eventually) figure out what the next number will be. Although good pseudorandom number generators can emit a series of numbers that look really random (and that even fit probabilistic expectations of randomness), they are not truly random.
The SecureRandom class, on the other hand, uses a system interface to obtain random data. The way that data is generated is operating-system-specific, but in general, this
source provides data based on truly random events (such as when the mouse is moved).
This is known as entropy-based randomness and is much more secure for operations
that rely on random numbers.
Can you take training after passing OCMJEA 6 Exam (1Z0-897), Assignment(1Z0-865) and Essay (1Z0-866)?
5. ASP.Net Core Developer Roadmap
ASP.NET Core is a powerful framework for building modern web applications. To become a proficient ASP.NET Core developer, it's essential to have a roadmap that outlines the key skills and technologies involved in the development process. The ASP.NET Core Developer Roadmap provides a visual guide, helping developers navigate their way through the various stages of ASP.NET Core development. In this article, we will explore the ASP.NET Core Developer Roadmap, using the reference image as a guide, and discuss the important milestones along the journey to becoming an accomplished ASP.NET Core developer.
ASP.Net Core Developer Roadmap
Understanding the ASP.NET Core Developer Roadmap
Key Milestones in the ASP.NET Core Developer Roadmap
Conclusion
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
Here is an example program which can cause this error
Difference between Data Science and Machine Learning
How to Prepare for AWS certified Security Specialty Exam
Hello guys, if you are preparing for AWS Certified Security Specialty exam then you have come to the right place. Earlier, I have shared best AWS Security specialist courses and my thoughts and courses on cracking AWS Solution architect exam and today, I will share how you can prepare for AWS Security certification in depth. The AWS Certified Security Specialty" certification is one of the most esteemed credentials in the industry. There is now an official designation for data analysts on their resumes and applications. Two of today's most hotly debated topics, cloud computing, and security, come together with the AWS Security Specialty certification. If you're in the security field, bringing your skills to the cloud is a natural next step in your career development.
How to Prepare for Google Collaboration Engineer Exam? Tips and Resources
Just before 2 months , I've cleared the Google Collaboration Engineer Exam, and now working as a cloud solutions engineer. Throughout my journey of Google Collaboration Engineer Exam preparation, the greatest challenge was the lack of materials and sources. I found it hard to find out the materials for this exam. I'm here to list out some important materials which I found helpful in clearing this Google Collaboration Engineer Exam.
Best Cyber Monday Deals for Programmers
Here are the two of such deals which I have also taken advantage to renew my subscription and add some good courses on my existing collection.
1. Save up to $150 on PluralSight
I wanted to let you know about a pretty sweet deal that PluralSight is running right now.For the first time ever, they've knocked down the price on their PluralSight Premium plan by $150.
The Premium plan includes the entire PluralSight course library, plus their new certification practice exams, interactive courses, and practice projects to help reinforce what you're learning.
This new plan adds a lot of value—and with this promotion—at a great price too.
They've also knocked $100 off their regular annual plan.
Every serious developer must have a PluralSight subscription. It's like the Netflix for Software developers.
=> Click here to save up to $150 on PluralSight
All the best with your learning
2.


