Saturday, April 17, 2010

Serving static resources in Glassfish 3

I was playing around with the Google Maps API, when I found that I can't access my Javascript files in Glassfish. The JSPs were working fine, so I guess it's some URL handling thing in web.xml. As it turns out, there's a default servlet in Glassfish that should be used to serve static resources (like CSS, Javascript, PDF, image files, etc). Digging into ${GLASSFISH_HOME}/glassfish/domains/domain1/config, I found the default-web.xml. Under the section called "Built In Servlet Definitions", there's this XML snippet:


default
org.apache.catalina.servlets.DefaultServlet

debug
0


listings
false

1


I copied this verbatim into my web.xml.

Now, I want the default servlet to handle all the accesses to the static resources. I tried to map URLs with certain prefixes to this servlet like so:


default
/js/*
/css/*
/img/*


Not sure what the problem is, but it doesn't work. I'm forced to try extension matching instead:


default
*.gif
*.jpg
*.png
*.js
*.css
*.txt
*.pdf


Well, now that works, but it's not an elegant solution. Imagine, if I want to serve a new kind of file, say an Excel file, I have to remember to include the extension in web.xml, besides just throwing the file into the correct folder. I will have to relook into this again, but for now, I'm just happy it works :)

Saturday, April 10, 2010

Four Hands Guitar

It's quite common to see 2 people playing one one piano. It's indeed rare to see 2 guys play the same guitar. Check out this clip for the duet (and look our for Tommy's expression :))

Wednesday, April 7, 2010

92.2% of grads found employment within 6 months


SINGAPORE: 92.2 per cent of students who graduated from the three local universities last year found jobs within six months of graduation, according to figures posted on the Education Ministry's website on Monday.

The employment rate of graduates from the Singapore Management University (SMU) is the highest among the three local varsities.

96.8 per cent of its graduates found jobs within six months of graduation.

In comparison, about 91 per cent of graduates from the National University of Singapore (NUS), and about 89 per cent of graduates from the Nanyang Technological University (NTU) found jobs within six months of graduation.

In terms of salary, graduates from SMU's Information Systems Management course earned the highest mean monthly salary of about S$3,450.

Graduates from the Business Administration with Honours course at NUS came close with a mean monthly salary of about S$3,400.

At the other end of the scale are graduates from NUS's Applied Science course. Their mean monthly salary is about S$2,400.

That's slightly lower than graduates from NTU's Art, Design and Media course, who have a mean monthly salary of about S$2,430. - CNA/vm

Source


In terms of salary, graduates from SMU's Information Systems Management course earned the highest mean monthly salary of about S$3,450.

Creating a PostGIS database

Inside the pgAdmin tool, run
CREATE DATABASE my_spatial_db TEMPLATE=template_postgis

More details here

Tuesday, March 16, 2010

Unable to run Star Tales benchmark.....and even worse

I was downloading Nvidia drivers and I saw this benchmark for Star Tales. Basically it's rendering 5 girls dancing to Wonder Girl's monster hit, Nobody. It's supposed to demonstrate the power of the PhysX in enhancing games. Here's a video of the benchmark


I downloaded the benchmark and installed it. When I tried to run it, the program complained of missing files. That's pretty bad, but worse was to come.

Today, I saw this

That's evil, dude!
That's evil, dude!

Monday, January 25, 2010

It's offficial: Spring 3.0 is not compatible with Hibernate 3.5 beta3

After fiddling around with the persistence.xml for a while, I found the bug report here.

Get the 3.0.1 snapshot!

Thursday, December 24, 2009

Steam promotion for the holidays - up to 80% off!

Steam is having a sale for the holidays, some of the games are up to 80% off! And there are the daily specials: for today, Mirror's Edge is going for $4.99 USD, S.T.A.L.K.E.R. is going for $1.99 USD! I doubt there's a better deal anywhere else!