Recent Representative Line

A single line of code from a large application that somehow manages to provide an almost endless insight into the pain that its maintainers face each day.

Sep 2007

Serializalicious

by in Representative Line on

If you aren’t familiar with Serialization in Java, then today is your lucky day! Here’s a quick, crash course in Java Serialization:

Serialization allows instances of classes (i.e. objects) created at runtime to be saved and then later restored at a different runtime. While most developers could probably do this on their own with a GetState() and LoadState() method, Java can automagically do this on virtually any object by preserving its state to a sequence of bytes. All a Java developer has to do is add “implements Serializable” to their class definition, and voila! they can now save state with an ObjectOutputStream and instantiate states into objects with an ObjectInputStream.


SELECT [Connection_String] FROM [WTF]

by in Representative Line on

Telly B. sent in a representative line that returns database connection information... from the database.

SELECT 'driver={SQL Server};user id=<removed>;pwd=<removed>;' +
       'Network=dbms;server=127.0.0.1;database=<removed>;'
    AS dbconn
  FROM users