JQuery how to resize table and keep table size

When removing a table row, you can prevent an html table size from changing by setting the width explicitly before removing the row:


Javascript function application / currying / callbacks

Javascript partial functions:Here, doSomething is a callback and the second argument should be data from a JQuery ajax call.Say you have a function:

There can be any number of arguments after passing in the function argument, like: partial(fn, arg1, arg2, …, argn), these arguments are applied to the function you will be calling.


The callback after the post will behave just like you called: doSomething(“Test Value”, data) where data is the $.post result.


Postgres on Openshift Java Application

Using an openshift JBoss/Postgres setup trying to create a webapp with a postgres database.

Turns out that the openshift ${OPENSHIFT_POSTGRESQL_DB_URL} variable does not work with the postgres 9.2 JDBC driver.

It’s broken.

The URL should be: jdbc:postgres://hostname:port/database. The URL provided by openshift is not that format.

Note also that SSL is not supported by the database server.

Here is the properties placeholder I’m using with Spring.


I know that the system creates a JNDI connection, but my maven build copies a properties file if the Openshift profile is run, and copies a different properties file if it’s building locally. This allows the proper database connection to be made depending on where it is built.

Java MD5 with no external dependencies

How to generate an MD5 sum with Java – no external dependencies.

To run the file, do:

javac T.java && java T

javac T.java
java T


SQL Server int datetime rounding errors

Demonstration of errors when casting between float and datetime in SQL Server.


SQL Cast Example Data

Synchronous JavaScript for image validation

This function will return an image link if the url passed in is valid, otherwise it will return the no-image text. This is synchronous ajax, which will block your UI, but I use it for popover generation with bootstrap js, and it works just fine.