I’m testing out a java desktop application that I’m pretty excited about, but when I run it on my Linux desktop, if I do a drag ‘n drop, it freezes. A little research and I find the following bug: http://bugs.sun.com/view_bug.do?bug_id=6397447 . Basically, if you have Java6’s “splash screen” feature enabled for your application, and you use swing’s Drag ‘n Drop functionality, Xwindows will freeze on DND. The bug report has more details.
Interesting work-around, though: If you start another application that uses swing’s dnd, but doesn’t use a splash screen, leave that running, then start your real application, it works fine. Conveniently, http://java.sun.com/docs/books/tutorial/uiswing/dnd/basicdemo.html is such an application, it’s small, it starts fast, and you can webstart it. So I just inserted that into the startupscript for the application that suffers from the bug.
Author Archives: bob
Java Drag ‘n Drop + Splash screen bug in Linux
More on Python..
This is hardly interesting pressing news, but it’s left an impression on me, so I choose to share: In my tinkering with python, I’ve found the python console to be a priceless tool when helping to discover syntax. In this afternoon’s example, I was wondering about different cute ways to loop through lists, so I drop to a prompt, type python, hit enter, and:
>>> a = [1, 2, 3]
>>> a.append(4)
>>> print a
[1, 2, 3, 4]
>>> while 7 not in a:
... a.append(int(raw_input('append?')))
...
append?4
append?3
append?5
append?6
append?7
>>> print a
[1, 2, 3, 4, 4, 3, 5, 6, 7]
>>>
OK, that skips the step where I googled, saw an example, and then wanted to try it out in a simple cases to make sure I got it. But this still demonstrates the value, right?
Python Time Travel
I’ve been using python for some sysadmin tools lately, and thoroughly enjoyed python’s ability to invoke the future standards. Python’s PEP system (Python Enhancement Proposals) promotes a public forum for changes. I’m not familiar with the political process, but that’s soon on my to-investigate list.
While reading about a proposed enhancement to while loops (PEP 315 — Enhanced While Loop - enhancing to allow a do/while struct), I found a usage description.
Because of the new keyword "do", the statement
from __future__ import do_while
will initially be required to use the do-while form.
This allows you to beckon the Gods for a new version and use it, because it’s even been thought of! Amazing. No, really, it allows them to add a new feature gracefully. Announce a change and allow the use of it through a special format that will be forwards compatible.
phpclasses.org is the worst website ever created.
Brian and I are geeking out here, resurrecting the quotefile webpage. I’m trying to add openid authentication. Details on all that hullabaloo later. My main problem is that I find a nicely reviewed simple openid php class that I want to use, but the downloads are hosted on this god-forsaken disaster of a website: Welcome to the PHP Classes Repository - PHP Classes.
As a lesson to all website creators out there, do not imitate their mistakes. If you can find anything that this site has done in your own work, change professions. I don’t even think I can describe it. Just go try and hit that site, search for something, and download it. I apologize in advance for the agony.

