Normally Apache Tomcat comes with the default index.html file. So if you go to http://localhost:8080/index.html with your web browser it will serve you the index.html file with HTTP status 200.

At the terminal, the HTTP status can be obtained with the following command.

curl -sI http://localhost:8080/index.html|head -1|awk '{print $2}'

This…

--

--

Luhn algorithm is the commonly used logic to produce the checksum of credit card number which is the last number of the long series of numbers.

The code below generates a valid Luhn algorithm Visa credit card number that start with the number 4. Explanation of the algorithm is in…

--

--

Plain black and white output on the terminal is harder to distinguish between success and error. If success message is printed in green and error message is printed in red, it is so much easier to differentiate them.

Ruby can easily print color text with the “colorize” module.

<…

--

--

My cheat sheet of array related functions. I’ll add more along the way when I use more of it.

Declaring Array

int[] ia = new int[3];
ia[0] = 9;
ia[1] = 8;
ia[2] = 7;

Char Array To String

char[] ca = {'a', 'p', 'p', 'l', 'e'};
String s = String.valueOf(ca);
System.out.println(s);

Array Sort

String[] fruits = {"pear"…

--

--

Items/ingredients

  • Eggs
  • Pots
  • Stove
  • Ice
  • Water

Instructions

  1. Leave eggs in fridge overnight.
  2. Boil a pot of water. Once boiled, lower the flame to the smallest possible where you could still see small bubbles bubbling.
  3. Put eggs into pot slowly with spoon so that you don’t crack the egg shell.
  4. Let it cook…

--

--

Kevin FOO

Kevin FOO

15 Followers

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.