Stack is an abstract data-structure. This data-structure allows user to access the contents in Last In First Out order. This means, the latest element which was put in the data-structure, will be the first one to be removed on remove operation. You can watch my video, where I code this implementation. The operation, where we […]
AVL Tree Insertion Deletion Search in C Programming Language
AVL Tree is a Balanced Binary Search Tree. What does balance means? It means that, we try to minimize the number of traversals, during search, insertion or deletion or any other operations on a binary search tree. We achieve this by trying to minimize the height differences between the left sub-tree and right-sub tree. The […]
Use IntUnaryOperator to calculate sum and cube of an int using modern java : java functional programming
There are different ways to implement IntUnaryOperator . You can watch my video, where I am implementing IntUnaryOperator. Utility Class with square and cube static functions. private static class Utility{ private static final int square(final int intValue) { return (int) intValue * intValue; } private static final int cube(final int intValue) { return (int) intValue * […]
you have not chosen to trust usertrust rsa certification authority citrix 18.04
I faced this issue of UBUNTU 18.04. I saw other solution on the internet, but they did not work for me. I hope this blog helps you. Citrix complains about “User Trust rsa certification authority” permission does not exists. The /etc/ssl/certs folder has a permission file with exact same name USERTrust_RSA_Certification_Authority.pem . So, I copied this certificate from […]
How to prevent java reflection to create new instance by accessing private constructor of a class
This code will work on Java 9 and above. StackWalker was added in java 9. You can watch me work on this code on YouTube. We can use class check to make sure, the private constructor is not accessed from any other class. You can read entire source code at github. To restrict the access, […]
Use java reflection api to access private constructor of a class and create an instance
This code will work in Java 9 and above. You can watch my Youtube video, where I am working on this code. In java, we can use reflection apis to access all the properties of a java class. In this blog, I will show you how you can make a private constructor public and use […]
How to call c or cpp function from java, JNI native function implementation
I am running ubuntu 18.04 and java version 15. You can watch me work on this code on YouTube. Java provides a feature where we can call C or C++ functions. This should be used in the cases, where you need more performance. In that cases, you can just skip the JVM and call the […]
Why thread priority should not be used as base while designing multi-threaded applications
In October or November of 2018, I was asked a question in interview process by an interviewer from Sapient, Noida, India. The interviewer Subrata Kundu asked .. What is Thread priority? I said, thread priority is a kind of relative importance given to threads with respect to each other. That relative importance can be a […]
java.util.function.IntPredicate implementation using Modern Java
In this blog, I am going to show how to implement IntPredicate using lambdas. And, use them to do useful work. I am going to create a person class. Which has three properties, age, salary and name. And, I will use lambdas to find count of person, who are above thirty years of age or […]
java.util.function.IntFunction implementation using modern java
IntFunction is a functional interface, it takes an int and returns a reference type. This reference type can be specified by using generic type specification. We can implement it in different ways. Implement using a regular class. private class IntFuncImpl implements IntFunction<Integer>{ @Override public Integer apply(final int intValue) { return Integer.valueOf(intValue); } } Implement using […]