HOW TO GET CURRENT UNIX TIMESTAMP FROM DATE STRING


In java we might need to get Unix timestamp from a date represented in String.

The following piece of code could convert a date string into a Unix timestamp.




reference: http://stackoverflow.com/questions/13392030/unix-timestamp-creation-in-java

Clear Scala REPL console


Scala REPL is very power tool. REPL stands for Read Evaluate Print Loop

Initially when I started learning scala, REPL was the first place where I got my hands dirty with Scala.

many times i struggled to clear REPL console, then I have to close the session using quit command.



After some checking on google and scala official page, I found that we can reset it using :reset command, while resetting REPL forgets everything done during current session.

To reset REPL session, run command as below:



It shows everything it clears from session. I was having 2 values a and b. 

This command comes handy when you need to reset your REPL session.