Archives for the Month of January, 2006

Python’s DateTime module

I admit it, I’m a total idiot when it comes to date times. Here’s a crash course for others starting out.
I live in Australia, and we are 10 hours ahead of GMT, and it’s 10pm. My current time (in ISO 8601 format) is:
2006-01-30T22:00:00+10:00
or
2006-01-30T12:00:00Z
(The Z signifies the time is in UTC)
The DateTime module (from Zope), [...]

Continuations Made Simple

Heard of call with current continuation and never grokked it? Here is a worked introduction to call/cc in BASIC.

10 REM —- MAIN ——-
20 PRINT "MAIN 1"
30 GOSUB 110
40 PRINT "MAIN 2"
100 REM — FOOA ——
110 PRINT " FOOA 1"
120 GOSUB 220
130 PRINT " FOOA 2"
140 RETURN
200 REM — FOOB ——
210 PRINT " [...]

JavaScript Grid Calculator

Here’s a handy JavaScript calculator to work out where the guides go on grid systems.

JDBC Connection URLs for 22 Databases

Here is a non-exhaustive list of JDBC connection URLs for various databases. Corrections welcome!
Microsoft SQL Server JDBC connection URL

jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=northwind
com.microsoft.jdbc.sqlserver.SQLServerDriver
msbase.jar;mssqlserver.jar;msutil.jar
downloadl

Microsoft SQL Server 2005 JDBC connection URL

jdbc:sqlserver://serverName\instance:port[;user=value][;password=value][;property=value]
com.microsoft.sqlserver.jdbc.SQLServerDriver
sqljdbc.jar
download SQL Server 2005 driver

Microsoft SQL Server (JTurbo) JDBC connection URL
jdbc:JTurbo://<HOST>:<PORT>/<DB>
com.ashna.jturbo.driver.Driver

Microsoft SQL Server (Sprinta) JDBC connection URL
jdbc:inetdae7:<HOST>:<PORT>?database=<DB>
com.inet.tds.TdsDrive
download

Not another Best Blonde Joke ever

Sheesh, do people never tire of the best cddddddddddddddddddddr blonde joke ever? (Safe for work)

Notes-style replication with relational databases

The Anatomy of a Note ID provides some fundamental ideas how Lotus Notes style replication can be used with little embedded databases like Derby.
The parts of a note ID are:

UNID (Universal Note ID) - Identifies all the copies of a note, regardless of location or time. In other words, every replica of a note has [...]

Multipart/form-data over the wire example

This is just for my personal reference.

C: POST /the_url HTTP/1.1
User-Agent: curl/7.11.1 (i686-pc-cygwin) libcurl/7.11.1 OpenSSL
Host: www.example.com
Content-Length: 38421
Expect: 100-continue
Content-Type: multipart/form-data; boundary=——————–

S: HTTP/1.1 100 Continue
C: ——————————
Content-Disposition: form-data; name="a"

value_for_a
——————————
Content-Disposition: form-data; name="b"

[...]

ZGDChart’s twin brother

I didn’t know ZGDChart had a twin brother. Nice. If you use Perl, check out GDWGRAPH.

XADM: Browsing and Querying Using the LDP Utility

If you are playing with LDAP in an Active Directory environment, a helpful tool called LDP.exe can be found in the Windows Resource Kit. For more information, see: XADM: Browsing and Querying Using the LDP Utility

Jython Loses to Java+Eclipse

In Jython Experiments Part 2, Brandon Corfman reports
The Jython code wasn’t any shorter than the Java code.
…Once I was done with my programs, I sat back in my chair and thought for a minute. I was startled to realize that Java+Eclipse pretty much took away all of Jython’s advantages for my small sample set.

In [...]

WMF Vulnerability - Code vs Data

F-Secure’s weblog explains how WMF’s vulnerability arises from a feature that lets the WMF VM execute x86 code through Escape() function.
When Windows Metafiles were designed in late 1980s, a feature was included that allowed the image files to contain actual code. This code would be executed via a callback in special situations. This was [...]