Top.Mail.Ru
October 23rd, 2004 - Java developers — LiveJournal
? ?

Java developers

October 23rd, 2004
 

08:59 am - Imagemoviescriptend - StreamTokenizer help

I'm stuck with a program that I've been writing, and hopefully someone will be able to help.

I'm currently reading a textfile into the program. The textfile format looks somewhat like this:

AA-AAA-ABC-11
AA 11 213 874D
11-A
A B
11 A


What I'm trying to do is to parse the file, and create an array of strings from it, one for each line. I've set the eolIsSignificant field to true, indicating that that should be the end of a string. But is there a way to read an entire line as a single token? One that isn't broken up into words, numbers, etc? Or if that can't be done, can i "force" any token that isn't an EOL to be considered a word?
 

10:14 pm - Imagebattie42

Hello. I'm working on writing a program for class. I prefer to use the command console for input and output, since it appears whenever we run the program anyway.

We're supposed to write a simulation ATM machine that has a manager mode and a customer mode. If I were using a GUI this shouldn't be much a problem, but I'm having a little trouble with the console. I want to find a way to clear all the previous output in the console when the customer mode is entered, but I can't find any methods or classes that might do that. Any ideas?

While I'm at it, I was wondering if there's a method to make cleartext for password entering. Since this is only an exercise, it's not terribly important, but it sure would look snazzy.

Thanks!
 

10:38 pm - Imageex_juan_gan - Method for detecting current client-side browser encoding

How can you detect client-side character encoding and pass it to the server?

The trick is the following:

1. Have a special chunk of text, Unicode-escaped.
2. Have the same chunk of text in native encodings for all the encodings available.
3. In Javascript, compare the first one with the set of encoded texts, until you find the one that matches.
4. You may send information about your discovery back to the server.
5. To make sure you catch the latest setting (user can change it), keep the texts in a form.
6. Of course the fields should be hidden, not to confuse the user.

P.S. It is in the process of being patented, see below.

http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PG01
&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.html&r=1&f=G&l=50
&s1=%2220040205673%22.PGNR.&OS=DN/20040205673&RS=DN/20040205673

(paste these three lines together and copy the result to the address field in your browser)
Powered by LiveJournal.com
Image