Articles from March 2011



simple scones recipe

After being in a project that demanded 110% of my time I finally have some time to blog and cook! so here is a scones recipe that is simple.

  • 3 cups of flour
  • 2 eggs
  • 1+ cups of milk
  • little oil if you want

first preheat oven to 220 degrees (very important that oven is hot)  mix it all together with wooden spoon.  the mix will be very sticky. once it is mixed sprinkle some flour on it so it doesn’t stick to your hands. make about 24 small balls and put them in the oven. wait for about 15 minutes and check they are the right color

Java print date (calendar) dd/MM/yyyy

This code is very simple but when I need it I always forget how to do it and i spend to long searching for it.

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;

import org.junit.Test;

public class ManualOverrideProcessImplTest  {

	@Test
    public void test1() {
		Calendar today = new GregorianCalendar();

		SimpleDateFormat df = new SimpleDateFormat();
		df.applyPattern("dd/MM/yyyy");
        System.out.println(df.format(today.getTime()));
	}

}

Also it is very easy to create a static String but a Date takes a little more work

    public static final Date END_DATE;
    static{
    	DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    	try {
			END_DATE = (Date)format.parse("9999-12-31");
		} catch (ParseException e) {
			throw new RuntimeException(e);
		}
    }

END