Decoding Raydium Swaps

In this post, we are going to look into how raydium swap works using Serum CLOB (Central limit order book). Before diving into how swap works in raydium, let’s have a brief look into Solana blockchain and Serum DEX. Solana It’s a layer 1 blockchain similar to ethereum but with... more

Annotations in Java

Annotations are one of those features of Java whose working is not much clear to the developers. This post is for self reference for annotations in java. Some example of annotations below - @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface FunctionalInterface { } @Target(ElementType.METHOD) @Retention(RetentionPolicy.SOURCE) public @interface Override { } Any annotation has... more

Generic Segment Tree

In this post, we are going to create a Generic Segment Tree. Before creating a Generic Segment Tree, we will try to solve a basic segment tree problem and try to find what part of our code is problem specific and abstract it out i.e there are some things which... more

git rebasing - rewrite history

In this post, I am going to discuss a scenario where I had to use “git rebasing” for something other than squashing commits. Lets build up from the starting, I am going to use a short form “CR” for code review. When I have to work on a feature, I... more

Integer Cache in Java

Before starting with the post, try to find the output for below code snippet: Integer a = 100; Integer b = 100; System.out.println(a == b); Integer c = 1000; Integer d = 1000; System.out.println(c == d); Note the answer somewhere, we will come back to it after looking at some... more

Streams in Java

In this post, we are going to discuss about: what streams are in context of CS their support in Java lazy evaluation in streams how to create finite and infinite streams how streams along with functions help in writing declarative code Stream by definition is a sequence of data which... more

Tinkering with Xms in JVM

In this post, I am going to share my observation after playing with Xms parameter in JVM on different Operating Systems. Initially, my understanding of Xms was that Xms is the minimum heap space the JVM should get before starting the Java process, if this much main memory (RAM) isn’t... more

Add BasicAuth in SparkJava Webapp

In this post, I am going to show you how to add Basic Authentication to your SparkJava webapp in Kotlin. Spark Java : Its a micro-framework for creating web applications in Kotlin and Java 8 with minimal effort. Basic Authentication : Its simply an Authorization header whose value is Basic... more

Mocking with Mockito

This is going to be a short post about an issue that I faced in my office project. Context: I was working on a project that generates an output file based on the data that is read by some input files. Now the size of the input files can vary... more

Use Psiphon on Mac OS And Linux

Psiphon is a tool that gives you uncensored access to internet content. Currently Psiphon is available for Android, iOS and Windows. This post will take you through steps to get uncensored access to internet content on you Mac and Linux machines. NOTE : You need an Android Device as we... more