Convert Milliseconds into Days, Hours, Minutes, Seconds in Java

Introduction This example shows you hot to convert milliseconds into days, hours, minutes, seconds in Java. Sometimes you need to convert the milliseconds into days or hours or minutes or seconds. Typically when you want to check the exact time taken to execute a program then you may need to calculate the time. So in this case you get the…

Read last n lines from a file using Java

Introduction Here I will show you how to read last n lines from a file using Java programming language. I am using text file for this example. Last “n” lines means, last 10 lines or 20 lines or 30 lines, etc. So “n” should be replaced by an appropriate non-zero positive integer value. Obviously the tail of the file is…

Find all users connected to wifi network using Python 3

Introduction This example will show you how to find all users connected to wifi network using Python 3. Sometimes just for fun we may want to know who all are connected to the same wifi network. We can also use the command netsh wlan show network in cmd window under Windows Operating System to find out who all users are…

How to check saved password in wifi network using Python 3

Introduction This tutorial will show you how to check saved password in wifi network using Python 3. It’s for your experiment purpose only and it does not retrieve your forgotten password from wifi network. Problem Scenario Suppose you have saved your wifi network password and every time you connect to the wifi network you don’t need to input password but…

Mock Drools ObjectFactory, KieSession and StatelessKieSession using Junit

This tutorial example will show you how to mock ObjectFactory<KieSession>, KieSession and KieStatelessSession using Junit. KieSession is the most common way to interact with the engine in Drools. A KieSession allows the application to establish an iterative conversation with the engine, where the state of the session is kept across invocations. The reasoning process may be triggered multiple times for…

Check If A Binary Tree Is Binary Search Tree

Binary Search Tree This tutorial will check if a Binary Tree is Binary Search Tree or not. It is known that a┬ábinary search tree (BST) is a node based binary tree data structure which satisfies the following properties: I will implement the algorithm using Java program in O(n) time complexity to check whether the Binary Tree is Binary Search Tree…

Minimum Moves to Equalize Array Elements

Introduction Here I will show you how to find out minimum moves to equalize array elements. I will check the equality of elements from two arrays. As a pre-condition both arrays must have equal number of elements, i.e., in other words both arrays must be of same length. I will read each element from both arrays one by one at…

Real Time Smile Detection in Webcam using Python 3

Introduction Real time smile detection in webcam using Python 3 will show you how your working webcam detects your face and smile and draws a rectangle around your smile on your face. In my previous tutorial we have seen Real Time Eye Detection in Webcam using Python 3. The similar tutorial we will use here to detect your face and smile…

Spring Data JPA Specification Criteria Query With IN Clause Example

Spring Data JPA Specification Here I will create an example on Spring Data JPA Specification Criteria Query with IN Clause. Spring Data JPA Specification Criteria Query generally used for search functionality on a page where users want to search by providing some inputs or by selecting several dropdown values. In this example I will show you how to use collection…

Real Time Eye Detection in Webcam using Python 3

Introduction Real time eye detection in webcam using Python 3 will show you how your working webcam detects your face and eyes and draws a rectangle around your each eye. In my previous tutorial we have seen Real Time Face Detection in Webcam using Python 3. The similar tutorial we will use here to detect your face and eyes and draw…