In Java How to find a Line with Maximum Number of Words? Using...
For any given file, Write a Java program to find a line with maximum number of words in it is a very common interview question. In other words, write a Java program to find longest line from file. In...
View ArticleIn Java how to Delete Files, Folders from Windows, Mac OS X and Linux OS?
Sometime back I’ve written an article on how to remove /tmp or unnecessary files / folder on Linux automatically via script? Now it’s time to write the same utility for Windows environment. In this...
View ArticleJava: How to Get Random Key-Value Element From HashMap
Is there a way to get the value of a HashMap randomly in Java? Of Course, below is a simple Java Code which represents the same. Also, at the end of program there is a bonus code to Shuffle complete...
View ArticleJava eNum Comparison using Equals (==) operator, Switch-Case statement and...
Sometime back I’ve written an article on Java eNum – Why and for what should I use Java eNum? What is an eNum type? It is a special data type to which we could assign predefined constants to variable....
View ArticleHow to Create Your Own Non-Blocking, Fixed Size Queue in Java? Same as...
If you don’t want to use Google Guava’s EvictingQueue external dependency in your Java Enterprise Project then you should consider creating your own non-blocking, fixed size queue. Basically we want...
View ArticleIn Java How to Perform File Search Operation using java.nio.file interface?...
Java 8 has so many new functionalities and collection of features which are hidden inside packages. In this tutorial we will go over java.nio.file.Path interface. Path is an object that may be used to...
View ArticleHave you noticed Race Condition in Java Multi-threading Concurrency Example?...
Sometime back I’ve written an article on Producer Consumer Example and how to handle read/write operation better way in Java. On the similar note, in this tutorial we will discuss something on Race...
View ArticleHow to Execute tcpdump Linux Command using Java Process Class and Capture...
Let’s take a look at a problem in which you may want to capture Tcpdump output in your Java Program. You may need TCPDump data with N number of possibilities. This is a tcpdump Tutorial and Tcpdump...
View ArticleHow to Install and Configure Elasticsearch on your Dev/Production environment?
In this tutorial we will go over steps on how to install and configure Elasticsearch for your development and production environment. What is ElasticSearch? One of the best search and analytics engine...
View ArticleHow to create executable .jar file using Linux commands and without Eclipse...
So far for me it it was so easy to right click in Eclipse IDE and create executable .jar file with few simple clicks. Last week I had to create executable .jar file manually on my Digital Ocean node...
View ArticleHow to add resources folder, properties at runtime into IntelliJ’s classpath?...
Getting NullPointerException while reading Resource .properties file in Intellij IDE? Do you have an issue loading resources files into your Intellij IDE? Having below errors? Error: Could not find or...
View ArticleHow to add custom taxonomy in custom post type permalink?
On Crunchify, we have published number of articles on WordPress Custom Post Type. One of the very popular tutorial is about How to Create WordPress Custom Post Type (CPT) and Taxonomy. In this...
View ArticleHow to Remove Duplicate Elements from CSV or any other File in Java?
Finding a duplicate lines from a file is not a hard problem. But sometime in an interview question, folks sometimes get very confused about the method they have to use. In this tutorial we will go...
View ArticleHow to add rel=”sponsored” or rel=”nofollow” to all External links in WordPress?
Google announce sometime back in September 2019 about rel="sponsored" change into rel attribute. rel=”sponsored”: Use the sponsored attribute to identify links on your site that were created as part...
View ArticleTwo or more Web modules defined in the configuration have the same context...
I’ve been developing a web app without any problem in Eclipse for several months. All of a sudden a problem has developed with Eclipse/Tomcat. The problem I have is that a 2nd web module has been...
View ArticleIn Java How to Sort a Map on the Values? The Map Interface – Java Collections
In Java How to sort a Map on Value? There are number of ways. Here we will follow below steps.public interface Map<K,V>An object that maps keys to values. A map cannot contain duplicate keys;...
View ArticleHow to use Spring Framework StopWatch() to Log ExecutionTime and ElapseTime...
Spring Framework – StopWatch() is a very handy utility for any Java developer if you have small Java application or production ready application. Most of the Java applications involve Thread pooling...
View ArticleStep by Step guide to Enable HTTPS or SSL correct way on Apache Tomcat Server...
It’s been almost 12 years I started using Apache Tomcat. I believe when I did my 1st under grade project, it was on Tomcat version 1.x. Now it’s already on version 8.0. Mostly I’ve been in touch with...
View ArticleHow to Validate WordPress Sitelinks Search Box JSON-LD Schema? Modify Search...
Google by default supports Sitelinks search box. But we need to make sure that it’s setup correct way on WordPress site. What is Sitelinks search box? As you see below, Sitelink search box is a search...
View ArticleHow to Create and Customize Genesis Theme Archive / Sitemap Page? Sample...
Genesis WordPress themes are one of the best themes out there in market right now. Used by hundreds of thousands of users there is no doubt it is also the most customizable theme. On Crunchify, we are...
View Article