Blog Archive for January 6, 2010

Storing data on the DOM using jQuery

January 6, 2010

On this blog, I have a maximise link at the top right of this post. This maximises the main body of the post, removing the right hand sidebar in the process. (This lets you see the long lines of code I sometimes put in here.) Clicking again minimises. This is …

ORA-06401: NETCMN: invalid driver designator

January 6, 2010

I was getting the error cx_Oracle.DatabaseError: ORA-06401: NETCMN: invalid driver designator when connecting to an Oracle database from my python script. This seems to only happen when I'm on the VPN.

Here's the code that connects to the database and exhibits this problem:

lConnectString = "%s/%s@ …

Bitmasks in Java

January 6, 2010

If you need to store multiple boolean flags for something, you can do it using bits and storing that inside a single integer. The examples below use Java, but this is possible in most languages.

First, some constants:

public static final int FLAG_A = 1;  // Binary 00001
public …

Tags: java bitmask