[HELP] Single questions & Help Thread [n00b] (61)

1 Name: #!usr/bin/anon 2005-10-20 18:41 ID:U7k5C2I3

If you have a single (or some more) question regarding any of the tech topics of this board and feel that it wouldn't justify creating an own thread just for that, feel free to post it in here.
If you know the answer to any of the questions in this thread, please help us out here! I am sure it's going to be appreciated.

(We need one of these threads here, kopipe from tech)

2 Name: #!usr/bin/anon 2005-10-20 18:46 ID:Heaven

Java Swing question

Sometimes the components I add turn out to small when displayed. To fix this, I've been hardcoding the components sizes. For example:

JList test = new JList(data);
test.setPreferredSize(new Dimension(800,600));

However, I hate to do this. I don't want to force the user into a single window size. Is there a way to say "use 80% of window" or use (window size - 80 pixels)?

3 Name: Washii 2005-10-23 05:48 ID:bFw9io5W

To the JList Question:
Whenever I worked with Swing, I tended to figure out what a good size would be for the application, set those in some static variables, then do random percentages or subtractions for the paddings and things when working.

You should be able to poll back up to a parent for the (window size - # pixels). You should also be able to poll the JavaVM for some sort of desktop size (in Windows, atleast), figure out a good window size from that with some simple math inside function calls.

However, it has been awhile since I did Java Swing, and even then, I didn't do much work with it. I found it way too cludgy.

4 Name: Washii 2005-10-23 05:54 ID:bFw9io5W

Yes. I'm big for console apps.

Viva la console!

5 Name: #!usr/bin/anon 2005-10-23 19:06 ID:77nhEW8J

Speaking of console apps (or: a programming-related question):

Does something like a tabbed console/terminal emulator exist for Windows?
Basically I am looking for a Konsole-clone (and no, kde-cygwin is not an option).

6 Name: #!usr/bin/anon 2005-11-13 03:12 ID:yJwm1zSQ

Perhaps by using a windowmanager that support having applications in tabs? (like fluxbox)

7 Name: #!usr/bin/anon 2005-11-13 03:16 ID:Heaven

Um, if X window managers can run on Windows (the Microsoft OS, I assume), then that would be news to me.

8 Name: #!usr/bin/anon 2005-11-13 03:48 ID:yJwm1zSQ

There is a port of blackbox to Windows, fluxbox isn't far from blackbox, so why not?

http://bb4win.sourceforge.net/bblean/

9 Name: #!usr/bin/anon 2005-11-13 04:07 ID:lyz6s7v0

>>7
i ran openbox on cygwin for a while... i tried compiling fluxbox once, but it didn't work and i didn't care enough to try to figure out what was wrong...

10 Name: #!usr/bin/anon 2005-11-13 07:25 ID:OiCy3bjN

>>8
Doesn't support tabs (yet).

11 Name: #!usr/bin/anon 2005-11-16 22:01 ID:ct7YFe+n

I've just run on the need of a hash function with a peculiar property: f(A,B,C) = f(B,A,C); IOW, the function should return the same result if two of its parameters are swapped (all parameters are integers).

For example, I could simply do A XOR B then hash it with C, this would give the expected result, but wouldn't give a good hashing result, since it is easly exploitable: f(0x01,0x20,C) = f(0x00,0x21,C).

I need this for classifying network streams: it doesn't matter if a given packet cames from host A to host B or vice-versa, the connection is the same. Does someone have a suggestion?

This thread has been closed. You cannot post in this thread any longer.