Untitled

Submitted by reeses on Sun, 2003-02-09 00:16.

Sometimes, when I'm solving a problem, I can see a workable solution. However, this workable solution may appear to exist outside the model for the rest of the solution framework. Such as, if you're building a cabinet, you decide to use superglue to hold the door on, because superglue is what is sitting near to hand.

Now, you can look at that superglue, and sure, it holds the door on very well. But, you have this feeling in the back of your head that no other cabinet maker would ever use superglue at this particular juncture, unless, perhaps, if that cabinet maker worked at IKEA.

My most recent examples of this have two separate results: confusion and mild embarrassment, and frustration.

The first involved the Java Compiler Compiler, JavaCC, which I was using to parse a set of files with semi-structured data of the form "{head/tail {head/tail}
}", which would be easily parseable, except for the fact that one particular head can have a tail spanning multiple lines. So, the default tokeniser would not work without some serious abuse and coercion. So, when I want to parse the flagellum prolixus, I grabbed the underlying input stream, read until I recognised a line starting with a new head, and backed off to the start of that line. At which time, I handed ownership of the input stream back to the tokeniser.

Bleaugh, I agree. Common opinion does, however, fail to inveigh my solution.

The other, more frustrating exception occurred this afternoon, when I was playing (ha!) with importing and manipulating temperature samples in Mathematica. I keep mma around because occasionally, it is very, very useful. In the past, I have written scads of code in it, but at this point, it always takes me a few minutes to come up to speed. However, I discovered that it doesn't really like importing dates from files, at least out of the box. I have a db dump that looks like "yyyy-mm-dd hh:mm:ss temp", and I can't even parse it as "date time temp" without real agony.

So, I bashed around, treated the whole thing like an array, and kluged together a one-liner (which mma encourages due to its craptacular IDE -- oh, wait, there isn't one) that pulls out the temps and plots it:


Anyway, I kept looking for a simple way of specifying a temporal type for an input field, and came up short. It turns out that there is no way, other than writing an input transform, which seemed like too much for a five-minute wank.

All this, because I was trying to avoid gnuplot grabbing implicit focus when my script launched it.

Post new comment

Captcha Image: you will need to recognize the text in it.
Please type in the letters/numbers that are shown in the image above.