Pencils Down

This weblog is about my experiences in software development

Browsing Posts in Uncategorized

Yet another Oracle error.  However, in this case it is accurately described.

Ran into this with HQL where clause something like:

where entity1.id = entity2.id

One of the id’s was numeric, the other was a string.  Had made the silly assumption that PK’s would all be nice integers.

Found some really useful code samples at Diving into HTML5.  They make liberal use of Modernizr (easy way to detect browser capabilties)

Coding for a particular feature boils down to:

in HTML head

<script src='modernizr.min.js'></script>

and then wherever you want:

if (Modernizr.feature) { supported }

Very easy to code and use.

You need to generate Modernizr with the features you care about.  (That’s a little odd – why not just do everything?)

Have detection page coded at http://www.dantoomeysoftware.com/html5/html5.html

Just read Ghost in the Wires, the autobiography of Kevin Mitnick, a celebrated phone phreak/hacker.

I don’t know what I expected.  I have read most things by Bruce Schneier for some time along the security vein, so I guess I expected something with a technical angle to it.  Mitnick provides that, but the overall impression of an OCD person who can’t control his behavior:

  • In jail he uses the pay phone to break into phone systems.
  • While on parole he breaks into phone systems.
  • When on the run from a federal warrant he breaks into phone systems.
  • When he knows he is about to be arrested for breaking into phone systems he proceeds to break into more phone systems.

I wonder if most phreaks are obsessed.  I somehow had the impression it would be something of a lark, kind of an i’m bored, it’s the weekend, i wonder how this works.

I can see where illegal types would be attracted to doing this.  I know there are things out there the could be grabbed.  But I wonder if even a crook would be so completely obsessed.

After a while it became cumbersome to read on about some new exploit.  You know he’s going to get caught, pay a heftier fine, spend more time in jail and he just can’t help himself.  Feels like seeing anyone obsessed with some other aspect of life: just makes you want to walk on by as quick as possible.  You know they won’t listen to advice or seek help.

At my current workplace we are automating a lot of tasks that were done using Oracle Forms to perform under a web interface. Sounds good so far.

One of the forms invokes some tens of thousands of lines of SQL code on the backend touching a large number of tables and invoking a good number of stored procedures. In order to automate this someone on the web team has to understand all that code. Again, from a programmers point of view, doable – might take a while.

Ok, now how to explain the size, scale of the problem to someone who knows nothing about programming?

I threw out the idea of going to the library, reading a novel that was several hundred pages long and having to understand exactly what happens to every character portrayed in chronological order.

Thinking about that later I wonder if I was very far off:

  • A typical page of a novel has 50-60 lines which equates to several hundred pages.
  • A line of SQL does not correspond well to a line in a novel, but given the power of the syntax it may have as much meaning
  • The chronological importance is important in both cases, more so for the SQL.

Maybe it’s not such a bad analogy to use.  Maybe even the PHB might get it:)

I am one of the lucky people to have bought a desktop with Vista installed.  It’s like the even numbered Star Trek movies – avoid at all costs! Random crashes, blue screens, hijacks and now the thing rearranges my desktop icons every time I reboot.

From poking around the internet I am not alone. And of course there are quite an array of ’solutions’ that don’t do anything useful. Kind of interesting that MS hasn’t come out with a workaround or fix that solves the issue. Especially where the problem appears to have existed for some time and is present in some Windows 7 installs as well.

I found a really useful product called Fences. The product allows you to create sets of desktop icons on your desktop with real names, like “Work in Progress”, “Tools”, or anything else.

Windows Fences

Windows Fences

This is really what I was trying to do anyhow. Best is the common usage version is free! Highly recommend.

Project Ending

No comments

The project manager for our project is leaving. She is a contractor. The project is complete so they are closing her contract. From 50,000 feet it makes sense. Kind of an accountants dream – have people on board just for the time you need them then they go away. She had been here a little over a year.

I have seen this happen many times. The “worst” was a 20 year systems engineer at a big DOD contractor was allowed to retire early otherwise his pension would have decreased kind of per day he stayed on. Again, quite the accountant’s ideal – nice little annuity math that can be produced in a spreadsheet instantly.

My first inclination is that, no, they won’t really do that. How can the company recapture the knowledge that is sitting in these people’s brains? All the big and little nuances about how the company runs, works, operates, gets things done. Gone in the time it takes to sign the closing NDA. I don’t think reading about reincarnation lately has made me feel better about the loss.

Afterwards started to think like the Sherlock Holme’s approach (quite mangled): “After eliminating the possibilities, whatever is left must be true”. I think this means the companies have a kind of planned obsolescence to their business model. They WANT to re-evaluate, start again, rethink, redevelop.

Seems like a gutsy plan. Who am I to argue? The current company just celebrated 150 years. The DOD contractor has been around about 50 years. Just seems inhuman(e).

Neato company has a patent pending process for re-compressing JPEG files. Looks like 75% or better reduction in size for average JPEGS with no loss. Hopefully companies like GIMP will sign up.

http://www.jpegmini.com/main/home

While reading through a CEH test guide there is a set of articles on steganography. I think most people are familiar with encoding bits in a JPG. A more interesting example was using complete in the clear text in an XML file. The trick is to place your special ‘hidden’ text in the XML, but outside of any tags. For example:

<root id='folders>

This text is in the XML file but not visible using standard parsers since not part of any tag<tag1>blah</tag1>

<tag2 id='something/>

</root>

I could imagine some larger XML file without pretty print that you would have no idea there were something embedded even if you looked at it.

We had a need to sort by the main column selected and the user’s name. I wanted to keep using the internal sorting mechanism of displaytag rather than deal with callbacks to the controller to handle the sorting.

The current settings for the table are:

  • sort=”list”
  • defaultsort = col
  • defaultorder =”ascending”

So, assume our table has two columns: name and year.

Sorting by name is easily accomplished: set sortProperty=”name”. Displaytag does this well.

The problem is year. We want to sort by year, but since there is liklihood of collision allow for name to be the secondary sort order.

In the dto used for the table elements we have the name and year fields. These are used as the displaytag property’s.

We can add an artificial accessor to the dto, call it YearName. We write an accessor for getYearName() which returns a new YearName object.

The YearName object has a constructor for YearName(year, name) that stuffs the other dto fields in it when called:

public class YearName {
private String year;
private String name;
public YearName(String year, String name) {
this.year = year;
this.name = name;
}

The YearName object also implements Comparator<YearName>. This comes down to a public int compareTo(YearName other).

In the compare routine we do something like:

public int compareTo(YearName other) {
int compare = this.year.compareTo(other.year);
if (compare!=0) return compare;
return this.name.compareTo(other.name);
}

So, with minor coding in the dto we keep using displaytag’s internal sorting mechanism.

If you were to get an exception thrown in your app and the exception contents printed in the log is just a single digit, like 7 what you really have is an array out of bounds exception.  The number referenced is the index into an array on the line suggested by the exception.

Just trying to save someone else some pain.