Sam Bluesman

Ranch Hand
+ Follow
since Nov 21, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sam Bluesman

Hi.

If I have 10000 strings, for example, and I want to read a file to see if each string I come across is in my 10000 strings, is HashMap the best way to store my list of 10000 as keys (assigning a null value to each) and use the containsKey() method the quickest method to see if they are in there or is there a quicker way of doing this? Note I am more interested in speed rather than memory usage here (assume I have infinite memory!).

Thanks.

Sam
10 years ago
Hi.

Can anyone help me on the best method to use to read file lines in a specified order. For example, say I have a text file with 10 lines but I want them read in the order 8-3-1-2-4-9-10-7-6-5 then what is the best way of doing this rather than having to open and close the file 10 times to get to the line I want to process each time?!? Note that the file is too big to read into memory...

Thanks.

Sam
11 years ago
you should try c++ if you think Java's hard!
11 years ago
Hi there.

I have a question regarding JOptionPanes. Basically, I have a JOptionPane which gives feedback after a button is clicked. What I would like is for the user to be click the 'OK' button and for a different card to appear after the JOptionPane closes.

So within the action performed method I have something like this:


I'm not sure how to amend the setDefaultCloseOperation method so that it closes the JOptionPane AND change the card, e.g.

Can anyone assist?

Thanks,

Sam.
13 years ago
Hi,

OK so I have been using putty to connect to the server and then logged into mysql from there, using the defauly port:22 option.

That seems to have done something but given the code above I am not getting the following error:

com.mysql.jdbc.PacketTooBigException: Packet for query is too large

But this still does not put "Sucess" as it should in the code so not sure if it connecting. Any advice?

Thanks
I don't have priviliges to see that.
Hi,

No - there is no port number when i type 'status' at the MySQL prompt. I have tried the default 3306 and this did not work...

I get the error:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
Hi there.

I am trying to connect to a mysql server that does not have a port number, but does have a socket.

My understanding is that in the past JDBC did not support sockets. Does it now? How do I go about setting up a connection using the socket if I already have the code below?

Thanks.

Hi all,

I have a class ClassA which calls on ClassB to perform a function which generates 3 vectors. I need to pass these vectors back to ClassA so that it can continue with the program and call ClassC which will use these 3 vectors to perform some processing. Is it possible to somehow merge these vectors together in order to return them from ClassB to ClassA? Two of the vectors are of type String and the other Integer.

Thanks,

Sam
16 years ago
Please state the compiler errors exactly and we might be able to help. I'm unsure if we can solve all your problems given that we are not all familair with 'Head First Java' but we might be able to point you in the right direction.

Sam
[ March 27, 2008: Message edited by: Sam Bluesman ]
16 years ago
Hello.

Say I have two jTextFields next to each other (side by side). One allows the user to put in a name of a person. The other allows the user to put in a phone number for that person. Is it possible to add another two jTextFields below these fields if requested by the user, using an 'Add another person' button, for example?

Thanks

SB
16 years ago
Try the sun's Java tutorial.... that will give you what you need.
16 years ago
Thanks guys - i guess i'll be looking at servlets and JSP. No doubt I'll have questions in the near future!

Thanks again
16 years ago
Yeah there is some serious data processing that must go on, given a set of input text files.

Basically, the program takes in 2 text files (one of which can be up to 2Mb). This is taken in through a front end. Thhen there is a lot of data processing that goes on and file creation that is based on this data. The files generated are then used to generate a graphical output.

Are there any good places you know of that can guide me on this? - and yes... - i HAVE tried google.com!

Ulf: Could you tell me what exactly you mean by Web Apps?

Ihave created one in Netbeans but im running an applet at the moment -i.e. my applet is my web app.

Thanks
[ October 03, 2007: Message edited by: Sam Bluesman ]
16 years ago
Hi.

I am use to programming client-side applications. I am trying to convert my application (consisting of multiple java classes) to a web application. It essentially has a GUI, takes in data using files stored on the Client's machine and outputs data (both in files and graphically). My question is simple:

Should I use an applet of JSPs to do this?
[ October 03, 2007: Message edited by: Sam Bluesman ]
16 years ago