Monthly Archive: March 2017

Create URL shortner or Tiny URL like bitly, goog.gl in Java 0

Create URL shortner or Tiny URL like bitly, goog.gl in Java

Most of us would have used URL shortner or tiny URL websites like bit.ly and goo.gl. These sites help in shortening the long URLs which can be easily shared on twitter and other places...

Jave Treemap – Its internal working and implementation 0

Jave Treemap – Its internal working and implementation

TreeMap is one of the mostly used Java collection after HashMap. TreeMap is Red-Black tree based NavigableMap implementation. It is sorted according to the natural ordering of its keys. Lets see how it works...

How to find character encodings supported in Java SE 0

How to find character encodings supported in Java SE

Run this code to find all available character encodings supported by your current JVM. If you have text in some encoding which is not present in this list, you will end up showing messed...

Doing Facebook oauth login in Java – Creating simple Facebook application 0

Doing Facebook oauth login in Java – Creating simple Facebook application

Step 1 : You need to create Facebook application. Go to this link Facebook developers and create an app Once app is created you will get appid and client secret. Copy and save these...

Facebook app to reply to birthday wishes with single click 0

Facebook app to reply to birthday wishes with single click

Recently my wife had her birthday and she complained me about tedious task of replying to all birthday wishes which she got on her wall. And hence I got the idea of my next...

Posting comments on Facebook posts using Facebook API 0

Posting comments on Facebook posts using Facebook API

  This tutorial assumes that you would have got the access token using Facebook login. We will use restfb java client to interact with Facebook’s API. You can download it, just google about it...

How HashMap works – Its internal implementation 0

How HashMap works – Its internal implementation

HashMap is one of the most commonly used collections in Java. Using it is pretty easy but understanding its implementation can get  a little complicated. Here is a simple example which we will use...

How to split string which has dollars($) 0

How to split string which has dollars($)

Suppose we have a string data1$$$data2$$$data3, how will you split it? If you use str.split(“$$$”) it will not split the string and instead return the same string only. The split function takes a regular...

File change notification example with Watch Service API 0

File change notification example with Watch Service API

Java 7 adds a new feature for its NIO package called Watch Service API which allows applications monitoring directories and files for change events such as creation, deletion and modification. The Watch Service API...

Creating GIF image from normal images in Java 0

Creating GIF image from normal images in Java

I wanted to create a Facebook app in which user’s best 10 pics would be converted into a GIF image and uploaded to his profile. So after googling a lot I found some useful...