Installing Java on Ubuntu 11

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-jre
sudo update-alternatives --config java

Thanks to http://www.ozmox.com/2011/04/30/installing-sun-oracle-java-6-jrejdk-on-ubuntu-11/

Memcached

Starting memcached can be done by the following command;

memcached -u memcached -d -m 30 -l 127.0.0.1 -p 11211

OR;

memcached -d -P pidfile -l 127.0.0.1

Install guide; http://www.glenscott.co.uk/blog/2009/08/30/install-memcached-php-extension-on-os-x-snow-leopard/

Todo – startup item in mac: http://snippets.dzone.com/posts/show/2618

Spring & Tomcat – custom errors

In spending a few hours on trying to get the error-page tag in tomcat’s web.xml working, i’ve found a better way to do it – one which uses spring to take on exception handling rather than Tomcat itself – something which also lets spring give the error-page visibility on other view-objects and business-rules.

Simple enough to implement and works wonderfully! 🙂

Eg;

<bean>
<property name="exceptionMappings">
<map>
<entry key="project.exception.RecordNotFoundException" value="recordNotFoundException" />
</map></property>
</bean>

http://developingdeveloper.wordpress.com/2008/03/09/handling-exceptions-in-spring-mvc-part-2/

Cheesy puffs

Cheesy Triangles/Puffs:

  • 400-500g ricotta (I get the low fat stuff from the supermarket deli) 2 cups of cheese for mix 1 cup for sprinkling on top (I use devondale tasty / lite n tasty)
  • 1-2 blocks (140-250g) of fetta (any will do but the danish fetta is the creamiest)
  • 10 pack of borgs reduced fat puff pastry (any puff pastry will do though)

Method:

  1. Preheat over to 180 and leave the pastry out to thaw. Mix all the cheeses together (you can also add spinach as well – a 250g block from the freezer section of the supermarket thawed and then squeeze out the juice before you add it to the mix) and shape them in to little balls (about a big teaspoon of mix (10 – 20cents coin but in a ball).
  2. Cut the pastry into squares (I cut into 9 squares for one sheet) place a ball of mixture in the square and fold into triangle (so fold in half diagonally) and press together the edges of the triangle. Place on baking paper on baking tray and sprinkle with cheese.
  3. Put it in the over for around 15mins (until they are golden)