You wait and see when the smoke clears Lessons for the day (more for archival benefit than because you guys will be interested...):
You can't use relative path names for images that you want to load from jars. You have to use a ClassLoader to getResource().
It takes about 3 hours to determine this, if you forget that you can see the console output *if you run the jar from the command line* instead of trying to load it through Java WebStart.
It takes about 10 minutes to fix this problem, thanks to Find/Replace.
You cannot load files into a File object by their filename (even if you use getResource) if they are stored in a jar. Apparently, jarring them cause them to not be files any more (I know, it makes no sense to me either, but that's the best answer I could come up with from the forums). You need to use ClassLoader.getResourceAsStream() to put the jarred file directly into an input stream, skippign hte file object all together.
It takes another three hours of [Run the program in Eclipse. See that it works. Jar the project. Sign the jar. Run the jar through WebStart. See that it's broken.] repeated, ad nauseum, and googling various variations on the theme of "jar read from file" before you remember that you can run the jar from the command line. And get the exception output, with the error name, and google that.
It takes about 30 seconds to fix this problem, once you know how.
And, if you spend all day debugging all this stuff... you get no real quantifiable work accomplished.
John Backus died Saturday... which is sad. He invented Fortran, but I'm more familiar with him due to his work on the Backus-Naur form, which is a formal language to describe programming languages (similar to Chomsky's grammer for natural languages).
Yeah... another developer tool I'll only be able to afford if they put it on MSDNAA (ie, it's free). Although, I think for my current needs, .NET works fine. So the upgrade is just for coolness value, I guess.
So if C# and Java 1.5 are essentially the same... why don't we trash C#? I mean... I guess variety is a good thing, but Java has been around longer... and I have a terrible hatred for C# (which, in fairness, may be an unreasonable bias, but still).
But as I have no Intar-web at the apartment until tomorrow... the evil bloggage will have to wait a day or two.
Interesting project afoot, though... any java programmers out there? Looks like a few of us are going to try to code a card game... kinda as a warm up to programming something big that someone else has been planning for awhile :-)
And I got a spiffy new AI book... specifically targeted at game AI (as in, rpg and first person shooters), but applicable to such mundane things as Shanghi. *sigh* Life is good.
Preacher sent me this... too funny. Especially after the conversation Dr. Moore and I had about him teaching Fortran at the University back in the day. Only the Aerospace people do Fortran here now I think.... :-)
As soon as we started programming, we found out to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.
--Maurice Wilkes
Yeah. That's about it. I have this awful feeling that sometime this weekend I'm going to break my rule about not crying in the computer lab... It seems like everything is setting me off... I have cried more in the past three days than I have cried all bloody year... Yeah. So I guess tomorrow, I'll have to give Jeremy the "If I start bawling it's not your fault" speech. Hope I don't freak the dude out...
These coding nightmares are killing me... I tried to nap, but I started dreaming... I was stuck inside a java source file, and I couldn't get out... I was walking through all the member data and methods and everything (Like I was stuck in the computer screen, walking over the text)... I kept tripping over the dadgum curly braces, too.. they were getting caught in my shoelaces like some kind of wild vine or something. Then an SQL exception started chasing me through the code (I know it was an SQL exception, because it looked like a a giant squirrel... dadgum you, William)... I knew if I could make it into the Oracle database, I could hide in the User table I made for the site, and the SQLexception couldn't go there. But first I had to remember the password to get in... and then when I did, I couldn't connect to the database... And the SQL exception was still after me... and I looked at my watch and it was 11:00pm, which means the database was down for backup. For thirty minutes. And I knew I was going to die. The last thing I thought before the SQL exception pounced on me and I woke up was "Damn... Why didn't I just set up a try / catch block?"
And, of course, that made no sense to anyone who has never programmed in Java. But that's ok, you should get the gist of it (If you missed it in all the technical stuff: A giant squirrel was chasing me around a computer screen and I couldn't get away. And the squirrel caught me and did whatever sqirrels do to you when the catch you, but I missed that part, because I woke up).
So yeah... taking lots of drugs does weird things to your dream life.