Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!

Eric Blische

Greenhorn
+ Follow
since Feb 02, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Eric Blische

Thanks to both of you for your thoughtful replies.

I don't like the answer but I guess I'll just ignore the
grouchy compilation warnings.
13 years ago
After two hours of frustration, thought I'd post.
I'm trying to upgrade my application to Java 5 (JDK 1.5.0).
Generics frustrate me. Printed out the transition PDF
white paper. Read through it and marked it up. Still
having difficulty.

Simply stated, how does one declare and initialize an
array of three ArrayLists whose generic type (for example)
is String ? Is the secret in the usage of a wildcard "?" ?

Here's how it was done with 1.4.2 ... simple ...

ArrayList [] array = new ArrayList []
{ new ArrayList(), new ArrayList(), new ArrayList() };

or ArrayList [] array = new ArrayList [3]; // 3 null elements

I tried all sorts of variations, even tried using
the Arrays newInstance() method, but ... still getting
compilation warnings. I'm obviously missing sumpthin' !

Hey - Thanks !

- Eric
13 years ago
I am still trying to come up with the
strength of will to tackle the RMI part,
and felt compelled to respond just how
interesting this insightful (and also
respectful) thread of discussion is.
- Eric

Performance doesnt suffer at all. Im sure there is a small time lag. But unless you can do something constructive or less boring than sit around for several nano seconds its not an issue.


Thanks for that Adam, after a long day that made me smile !
Eric
Hi Aadhi,
On my UI there is only a combo box to
select the Departing Airport and Arriving
Airport (no carrier). My combo box model
is populated initially from the database,
and an additional value "any" is added as
the first (default) combo box "selected" value.
So by default, a valid query (arriving=any and
departing=any) is available w/o any interaction.
I didn't think selecting carrier was necessary-
when I book a flight, I want to see all the flights from point A to point B, then pare down
the results by flight time and carrier. Anyone
else have an opinion about the Carrier?
Eric
Thanks for the reply Mark,
I am in the same boat, wading through a river of RMI material thinking "how the heck will I package this up ?"
Eric
Hi,
Thought I'd try to clever with mine ... I start off by populating my departing and arriving combo boxes with all the known possible values, but am considering making my combo's editable ... because another API might support adding a new flight to the schedule whose 3-letter-acronym was not there at startup. Maybe out of scope, but I recall the requirement stating the user may "enter an airport...".
I did make "any" (or was it "all") an option, too because it seemed pretty clearly to be a requirement.
Hi Zhou,
I would try something like this ...

I *think* this will accomplish what you need, coercing the dialog to come to the front while recognizing that it is modal.
Another possibility is to overload the setVisible
method of the dialog to invoke the superclass setVisible but also add a toFront().
Two ideas off the top of my head....
Eric
Hi Zhou,
I would try something like this ...
Hi Mario,
My early design uses an approach similar to that which you mentioned - but if no flights are found my table consists of zero rows. I also provide a "Clear flights table" button that takes it back to zero rows.
Also similar to you, I have a two line scrolling text area at the bottom of my GUI where I display status messages (connecting to remote database, accessing flight information, 'N' records returned). I might make it just one line but allow navigation to scrolled-off messages (via up-arrow). A checkbox menu item off of my menu bar will permit hiding/showing the status bar.
Eric
Hi, my name is Eric and I live in Maryland on the US East Coast. I am very strong in the GUI area but admittedly weak in distributed computing and RMI.
I started off writing the GUI (playing to my strengths as it were). I have a simple question, though:

The user must be able to book one or more seats on a chosen flight. If the flight cannot provide those seats, the user must be informed. It is not necessary to provide for live updates on multiple clients when new bookings are made at other clients.


Currently my user would do a search using departing and arriving airports, which populates my JTable, and when selecting a given row, is able to enter the number of seats and press my reserve seats button (the text field and button are disabled until a flight is selected).
Anyone else take my approach (some number of seats reserved for one flight) or generally do you folks permit reserving different numbers of seats on many different flights in a single invocation (button press, rmi call, etc) ?
Thanks a lot !
Eric
Thinking about it for a minute it occurs to me the behavior SOUNDS to me to be right, the getValueIsAdjusting() should return true only if the event is indicative of a "temporary" list change, ie, if the focus passes to a popup menu and the like. So when you select a row with the keyboard, it is a "permanent" selection ... getValueIsAdjusting() should always return false (and you state it does). Maybe you problem can be solved by minimizing the work done when a row is selected, perhaps by caching, or another strategy to limit the overhead ?
Eric
17 years ago
Just a Guess but you might
try overriding getValueIsAdjusting()
in your ListSelectionListener object
to return a value more in league with
what you want to know ?
Eric
17 years ago
Hiya,
One possible approach is to get all the leaf nodes (which are DefaultMutableTreeNodes ?), and throw the buggers into a vector. On second thought, get each of their TreePath's and throw THEM into a vector, instead. Then once the model is loaded, pull the TreePaths outta the vector and iteratively expand each one (using getLastPathComponent I think?).
Hope this helps, it's not pretty but might get you functional until a better solution can be investigated ....
Eric
17 years ago
Hiya,
In my experience the appropriate approach is
to return the
<IMG SRC="http://eric:80/images/someimage.gif"; HEIGHT="100" WIDTH="100" BORDER="1" />
element in the html your servlet is generating, and keeping the image(s) on a webserver where they can be "brought over" at the appropriate time (ie, when the html is loaded in a browser).
Hope this helps,
Eric
17 years ago