Wednesday, April 7, 2010

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!

Saturday, November 14, 2009

Reinstalling PostgreSQL - deleting the "postgres" service account

I was playing around with PostgreSQL 8.4 for my personal project. After my initial installation, I uninstalled it and tried to reinstall it. During the installation, I was prompted to enter the password for the "postgres" service account, which I don't remember. To continue with the installation, I needed to enter the following command and create a new password

net user /delete postgres

Friday, November 6, 2009

Removing external Javascript from Spring 3 documentation with jEdit

The Spring 3 reference in HTML format loads Javascript files from external sites. It's a bit annoying to wait for the loading of the scripts, particularly when I need to navigate between the pages frequently.

I used jEdit to search for the following regular expressions in the HTML files and replace them with a space
(?s)Begin Google Analytics code.*End Google Analytics code

(?s)Begin LoopFuse code.*End LoopFuse code

Thursday, November 5, 2009

Problems creating a JDBC resource with Glassfish 3 and PostgreSQL 8.4 drivers

What I initially thought was a straight-forward task turns out to be more complex than I imagined. After dumping the jars for PostgreSQL 8.4 driver (postgresql-8.3-701.jdbc3.jar
, postgresql-8.4-701.jdbc4.jar) into <GLASSFISH>/domains/domain1/lib/databases, I started the GF 3 server and tried to create a connection pool. I tried to create a javax.sql.ConnectionPoolDataSource resource using org.postgresql.ds.PGConnectionPoolDataSource. However I kept getting this error:
Can't find ConfigModel.Property for attr -isolation-level-guaranteed on interface com.sun.enterprise.config.serverbeans.JdbcConnectionPool

I get this error even when I do not specifiy "guranteed" for the isolation level.

Googling around,  I finally found someone with a similar problem. Seems that there is a bug in some of the earlier builds, so I downloaded the latest build (build 70)and reinstalled GF3.

All's well? Not quite. When I tried to start the server, I get some problem with using port 7676 for the default JMS host. I dont think I've gotten this error before in the older builds. Well, I did change the http-listener-2 port in domain1's domain.xml, not sure if I introduced some typo error there, so I ran
asadamin verify-domain-xml

and checked that the domain.xml is ok. The error is something along the line of
java.net.SocketException: Address family not supported by protocol family: bind

It turns out that for some reason the new GF3 build has problem using Vista's default hosts file (at C:\Windows\System32\drivers\etc).

To get it to work, change
::1 localhost

to
127.0.0.1 localhost
#::1 localhost

Restart the server again.

Now proceed to create the connection pool. However, according to the PostgreSQL driver download website,
It comes in two flavors, JDBC3 and JDBC4. If you are using the 1.6 JVM, then you should use the JDBC4 version.

.....

JDK 1.6 - JDBC4. Support for JDBC4 methods is limited. The driver builds, but the majority of new methods are stubbed out.

So, you'll need to specify an additional property JDBC30DataSource and set it to true when configuring the connection pool. That should be about it, now you can get some real work done.