10 most useful command in VI Editor in Unix

1) finding form up "/" for ClOrdID , use n and shift n for navigation.
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

PluralSight is one of the best website to learn new technologies, particularly on Computer Science and Information Technology e.g. Programming langague, Framework, Library, Testing etc. I am a huge Pluralsight fan and have gone through a lot of courses there. here are some of my fav courses :

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

Hello guys, you may know that Machine Learning and Artificial Intelligence have become more and more important in this increasingly digital world. They are now providing a competitive edge to businesses like NetFlix's Movie recommendations. If you have just started in this field and are looking for what to learn, then I will share 5 essential Machine learning algorithms you can learn as a beginner.  These necessary algorithms form the basis of most common Machine learning projects. Knowing them well will help you understand the project and model quickly and change them as per your need.

Difference between Random, ThreadLocalRandom and SecureRandom

There were used to be days when Math.random() method was the only way to generate random numbers in Java, but with the evolution of Java API, as of JDK 7, we now have 3 classes to generate Random numbers i.e. java.util.RandomThreadLocalRandom, and SecureRandom. In this article, we will compare these three classes and learn some key differences between Random, ThreadLocalRandom, and SecureRandom in Java.

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)?

Yes, you can take the training after passing the OCMJEA exam. Even though the training is a must to obtain the certification, You do not have to complete it before you give an exam. It is just listed as the first step to prepare well for your exam. If you have decent experience in core Java and enterprise Java, you can always complete the training when you are comfortable about it, but you must complete it to become an Oracle Certified Java Architect. In the last step of the exam, you need to submit a form containing the training detail to obtain credits for training.

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

The ASP.NET Core Developer Roadmap is a comprehensive illustration of the skills, concepts, and technologies that are essential for ASP.NET Core development. It provides a clear path for developers to follow, starting from the fundamentals of ASP.NET Core and progressing towards more advanced topics. By following this roadmap, developers can systematically acquire the knowledge and skills necessary to excel in ASP.NET Core development.

Key Milestones in the ASP.NET Core Developer Roadmap


Fundamentals of ASP.NET Core
The journey begins with a solid foundation in ASP.NET Core. Developers should start by mastering the basics of the framework, including understanding the MVC (Model-View-Controller) pattern, working with controllers, views, and models, and handling routing and URL patterns. It's crucial to grasp concepts like dependency injection and middleware, which are fundamental to ASP.NET Core development.




Entity Framework Core
Entity Framework Core is an essential component of ASP.NET Core for data access and ORM (Object-Relational Mapping). Developers should focus on learning Entity Framework Core, including creating database models, performing CRUD operations, and working with migrations. Understanding LINQ (Language-Integrated Query) is crucial for querying and manipulating data.

Web APIs
In the age of web services, building robust and scalable Web APIs is a vital skill for ASP.NET Core developers. Developers should explore topics such as RESTful API design principles, handling HTTP verbs, implementing authentication and authorization, and versioning APIs. Understanding serialization formats like JSON and XML is essential for building interoperable APIs.

Authentication and Authorization
Securing web applications is a top priority. Developers should delve into authentication and authorization mechanisms in ASP.NET Core. This includes understanding concepts like JWT (JSON Web Tokens), OAuth, and role-based authorization. Exploring frameworks like Identity Server and OpenID Connect can provide more advanced capabilities for authentication and single sign-on (SSO).

Front-end Development
To build modern and engaging user interfaces, developers should have a strong grasp of front-end development in ASP.NET Core. This includes working with HTML, CSS, and JavaScript, integrating client-side frameworks like Angular, React, or Vue.js, and handling AJAX requests. Understanding client-side bundling, minification, and optimization techniques will enhance the performance of ASP.NET Core applications.

Testing and Quality Assurance
Ensuring the reliability and stability of ASP.NET Core applications requires a strong testing and quality assurance strategy. Developers should explore unit testing frameworks like xUnit or NUnit, perform integration testing, and adopt practices such as test-driven development (TDD) and behavior-driven development (BDD). Understanding tools like Selenium or Cypress for automated UI testing is beneficial.

Deployment and DevOps
Deploying and managing ASP.NET Core applications efficiently is crucial. Developers should explore deployment options such as Azure App Service, Docker containers, and serverless architectures. Knowledge of DevOps practices, continuous integration and deployment (CI/CD), and infrastructure-as-code tools like Azure DevOps or GitHub Actions will streamline the development-to-production pipeline.




Real-time Communication
Real-time communication is an integral part of many modern web applications. Developers should explore real-time communication technologies in ASP.NET Core, such as SignalR. SignalR allows developers to build real-time, bi-directional communication between the server and the client. Understanding concepts like hubs, groups, and connection management will enable developers to implement real-time features like chat applications, notifications, and live updates in their ASP.NET Core projects.

Caching and Performance Optimization
To enhance the performance and scalability of ASP.NET Core applications, developers should explore caching techniques. ASP.NET Core provides various caching mechanisms, such as in-memory caching, distributed caching using Redis, or response caching. Understanding when and how to leverage caching can significantly improve the application's response times and reduce the load on the server. Developers should also explore performance profiling tools to identify performance bottlenecks and optimize critical sections of the code.

Microservices and API Gateway
As applications grow in complexity, developers should explore the concept of microservices and how to build scalable architectures using ASP.NET Core. Understanding the principles of microservices, including service decomposition, communication patterns, and containerization with technologies like Docker and Kubernetes, will allow developers to create modular and scalable systems. Additionally, exploring the concept of an API Gateway, such as Ocelot or Azure API Management, can help in centralizing and managing multiple microservices.

Security Best Practices
Building secure web applications is paramount in today's digital landscape. Developers should familiarize themselves with security best practices in ASP.NET Core. This includes implementing measures such as input validation, protection against common attacks (e.g., cross-site scripting (XSS), SQL injection), and secure handling of sensitive data. Keeping up with security updates, using secure authentication mechanisms, and employing HTTPS for secure communication are essential aspects of building secure ASP.NET Core applications.




Continuous Learning and Community Engagement
To excel as an ASP.NET Core developer, continuous learning and community engagement are vital. Developers should stay up-to-date with the latest advancements in ASP.NET Core, explore new features introduced in each release, and embrace emerging trends in web development. Engaging with the ASP.NET Core community through forums, user groups, and online discussions enables knowledge sharing, collaboration, and access to valuable resources. Additionally, contributing to open-source projects and attending conferences or meetups provides opportunities to learn from industry experts and expand professional networks.

Conclusion

The ASP.NET Core Developer Roadmap serves as a valuable guide for developers aspiring to become proficient in ASP.NET Core development. By following the roadmap and progressing through the outlined milestones, developers gain the necessary skills and knowledge to build robust, scalable, and secure web applications using ASP.NET Core. From mastering the fundamentals to exploring advanced concepts such as real-time communication, microservices, and security best practices, developers can leverage ASP.NET Core's capabilities to create cutting-edge web solutions.

Embrace the ASP.NET Core Developer Roadmap, utilize the reference image as a visual guide, and embark on your journey to becoming a skilled ASP.NET Core developer. With dedication, continuous learning, and active community engagement, you can stay at the forefront of ASP.NET Core development and contribute to the ever-evolving world of web development. Let the roadmap be your compass as you navigate the path to success in ASP.NET Core development.

java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver

This error comes when you try to connect to Microsoft SQL Server using Microsoft's official JDBC driver bundled in sqljdbc4.jar, but the driver class is not available in Classpath. In order to make a JDBC connection, the first step is to load the class which implements JDBC Driver interface, com.microsoft.sqlserver.jdbc.SQLServerDriver is the class which does that for MSSQL. This class is bundled in sqljdbc4.jar and if this JAR is not present in Classpath then ClassLoader is not able to locate it and throws "java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver" error.  How do you fix this error? just add sqljdbc4.jar or sqljdbc4.jar

Here is an example program which can cause this error

Difference between Data Science and Machine Learning

Hello guys, if you are wondering What is difference between Data Science and Machine LEarning then you are not alone, There are lot of people who think they are same but they are not. Data Science and Machine Learning, two buzzwords that seem to be thrown around a lot these days. But what do they actually mean? And more importantly, what's the difference between the two? If you're feeling a little confused, don't worry, you're not alone. In this article, we'll break down the differences between Data Science and Machine Learning in a way that's easy to understand, and most importantly, entertaining! So, sit back, relax, and let's dive into the world of 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

Hello Guys, I wanted to post this article a couple of days before but just couldn't manage to do it. Cyber Monday is almost over but there are still a couple of great deals for programmers who are running, particularly from PluaralSight and Udemy, two of the best online learning places.  If you want to invest some money in your learning and upgrade this is the best time to do so because prices have come down drastically.

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. 

10 Example of String in Java



1. String IndexOf Example
2. String SubString Example
3. String Matches Example
4. String Length Example
5. String Empty Check Example

How to replace characters in String

How to remove whitespace from String in Java

How to find length of String in Java

How to check if String is Empty in Java

How to create SubString from String in Java

How to Split String in Java

How to check if String contais a word

How to

arraylist string example in java

java object string example

java string split example

java string to inputstream example

java string to int example

java string length example

java string to double example

java switch string example


10 points about synchronized in Java



1. Synchronized can only be applied to methods and code block, you can not make a variable, a class or an interface synchronized in Java.

2. When a thread enters a synchronized block or method, it acquire lock on the object method has been called. Similarly when thread exits the block, both normally or abruptly due to any error, it relinquish the lock.

3. Synchronized keyword not only provide mutual exclusion, but also provides visibility guarantee. Memory barriers are updated when thread enter or exits synchronized block or method. 

10 points about Exception in Java



1. There are two kinds of exception in Java, checked and unchecked exception. Any exception, which is subclass of java.lang.Exception but not inherited from java.lang.RuntimeException is known as checked Exception. On the other hand those inherited from RuntimeException are called unchecked exception.

2. Checked exceptions follow special symanatic rules in Java, they are literally checked by compiler during compile time.

3. All Exception are inherited from Throwable class.

4. Though Error are not inherited from RuntimeException they are also unchecked.

Why Constructor Injection is better than Setter Injection

There is no doubt that dependency injection is good, and offer several benefits. When it comes to inject dependency, there are two main ways, by using constructor and by using setter methods.


Constructor injection makes dependencies obvious
enforces order of initialization
makes wiring easy
supports testable code
more readable
enforce completeness


CreditCardProcessor ccp = new CreditCardProcessor();

OfflineQueue oq = new OfflineQueue()


Database db = new Database();

IS-A vs HAS-A Relationship Example in Java


IS-A means two classes are part of same inheritance hierarchy, while HAS-A means two classes are not part of same inheritance hierarchy but class A is composed using class B and uses it to provide certain functionality. 

Java Interface and Abstract class Interview Questions


---------------------------------------
What is Abstract class?
What is interface?
Difference between Abstract class and inteface?
Can we make a class abstract without abstract method?
Can we make a class final and abstract?
Can we declare constructor in abstract class in Java?
Can an interface extend more than one interface in Java?
Can a class extend more than one class in Java?

Can we have non abstract method inside interface?
What is default method of Java 8?

Difference between SOAP and REST Style Web Service in Java

SOAP and REST are two ways to create web services in Java world, here are couple of key differences between REST and SOAP in Java




Top 50 Core Java Interview Questions with Answers


1)  How Java achieves platform independence? (answer)



2)  What is ClassLoader in Java? (answer)



3)  Write a Java program to check if a number is Even or Odd? (answer)



4)  Difference between ArrayList and HashSet in Java? (answer)



5)  What is double checked locking in Singleton? (answer)



6)  How do you create thread-safe Singleton in Java? (answer)



7)  When to use volatile variable in Java? (answer)



8)  When to use a transient variable in Java? (answer)



9)  Difference between transient and volatile variable in Java? (answer)



10) Difference between Serializable and Externalizable in Java? (answer)



11) Can we override a private method in Java? (answer)



12) Difference between Hashtable and HashMap in Java? (answer)



13) Difference between List and Set in Java? (answer)



14) Difference between ArrayList and Vector in Java



15) Difference between Hashtable and ConcurrentHashMap in Java? (answer)



16) How does ConcurrentHashMap achieve scalability? (answer)



17) Which two methods you will override for an Object to be used as Key in HashMap? (answer)



18) Difference between wait and sleep in Java? (answer)



19) Difference between notify and notifyAll in Java? (answer)



20) Why you override hashcode, along with equals() in Java? (answer)



21) What is load factor of HashMap means? (answer)



22) Difference between ArrayList and LinkedList in Java? (answer)



23) Difference between CountDownLatch and CyclicBarrier in Java? (answer)



24) When do you use Runnable vs Thread in Java? (answer)



25) What is the meaning of Enum being type-safe in Java? (answer)



26) How does Autoboxing of Integer work in Java? (answer)



27) Difference between PATH and Classpath in Java? (answer)



28) Difference between method overloading and overriding in Java? (answer)



29) How do you prevent a class from being sub-classed in Java? (answer)



30) How do you restrict your class from being used by your client? (answer)



31) Difference between StringBuilder and StringBuffer in Java? (answer)



32) Difference between Polymorphism and Inheritance in Java? (answer)



33) Can we override static method in Java? (answer)



34) Can we access private method in Java? (answer)



35) Difference between interface and abstract class in Java? (answer)



36) Difference between DOM and SAX parser in Java? (answer)



37) Difference between throw and throws keyword in Java? (answer)



38) Difference between fail-safe and fail-fast iterators in Java? (answer)



39) Difference between Iterator and Enumeration in Java? (answer)



40) What is identity HashMap in Java? (answer)



41) What is String pool in Java? (answer)



42) Can a Serializable class contain a non serializable field in Java? (answer)



43) Difference between this and super in Java? (answer)



44) Difference between Comparator and Comparable in Java? (answer)



45) Difference between java.util.Date and java.sql.Date in Java? (answer)



46) Why wait and notify method are declared in Object class in Java? (answer)



47) Why Java doesn't support multiple inheritances? (answer)



48) Difference between checked and unchecked Exception in Java? (answer)



49) Difference between Error and Exception in Java? (answer)



50) Difference between race condition and deadlock in Java? (answer)