Max Benjamin

Greenhorn
+ Follow
since Apr 12, 2006
Merit badge: grant badges
For More
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 Max Benjamin

More details:

The applet takes a string either(I haven't worked out all the details) from a file on the host server or from a parameter in the applet's html. It breaks this string into individual words and an object is created for each word that contains it's name(the individual word as String) and an x position and y position of where it is to be drawn in the applet. The initial set up of the objects(their position) is determined by the font used and applet size. A user can then click and drag on the different words repositioning them on the screen and thus changing their internal x y state. I would like to save these x and y coodinates for each object so that the next user will see what the last user altered and be able to change that.

I was thinking one answer might be to use javascript/java LiveConnect to grab this information from the applet and write it to a file on the server by sending it in a POST request(my host supports ruby, php, python). I could then write the infromation to parameters in the applet's html as strings and then parse out the infromation in those strings when the applet is loaded again.

I'm a noob so any other suggestions are more than welcome. I appreciate those thus far though it's not really "just a gimmick". I think that depends more on the "why" than the "what".

Best,
Max
17 years ago
I'm not sure that this is the right place to ask this question as it concerns an applet but is not necessarily applet specific.

I am trying to work out a way to save object states in an applet so that the next person who downloads the applet will see it in the state it was left by the previous user(images may be repositioned by the user). Unfortunately, my host does not support java and so serializing is not an option. What would be a recommeded way to deal with this issue. Is saving the data in an XML file a good idea? If so, what libs or docs should I look at? Other ideas?

Thanks,
Max
17 years ago
Thanks so much. I will give it a go.
Best,
Max
17 years ago
This is a bit of a noob question but here it goes:
I'm currently developing an applet that pulls data from a text file located on my host and displays it. I would like the user to be able to edit that text and then upload the edited text back to the server. I don't have the option of running java on my host and I'm wondering if there is a way to validate the data being sent to the host server using ruby. Can I send the data in an http post and validate it with ruby? How would I do this, what docs I should look at, etc?
Thanks for any help,
Max
17 years ago
The problem was with the setter method in the phoneme speaker class, stupid mistake.
17 years ago
Thanks for the quick reply. Still getting the same error however.
Best,
Max
17 years ago
Hi, I'm trying to build a (for now) simple app that speaks text entered into a JTextarea. When I run the app and attempt to have it speak the text entered I get the following error:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
I think I may need to start a new thread when the "speak text" button is pressed but so far I've been unable to correctly implement this. Can anyone give me a hint or suggest a better design. Here's the code to the app in three files:







Thanks,
Max
17 years ago
Thanks so much. Very helpful.
Max
17 years ago
I know that the two subjects in my heading probably seem a little unreleated but I wanted to fool around with FreeTTS http://freetts.sourceforge.net/docs/index.php#download_and_install

I'm new to Java and so I'm not sure how to include jars in my build path for complilation. I'm on OSX and using Bash and javac to compile.

Also can anyone recommend some speech synthesis libraries besides freeTTS?

Thanks,
Max
17 years ago
Hello,
I'm going through Head First Java and I've come to one of the "sharpen your pencil" questions that is giving me a little trouble. It's on page 291 regarding autoboxing:



So, yes it does compile but gives a null pointer exception at runtime. Am I understanding the code correctly?

*A new reference variable "t" is created that refers to:
*A new instance of the TestBox class is created
*This new TestBox object has a Integer wrapper object that holds an int "i" variable and TestBox has a int instance variable "j".

Is the null pointer exception comming from "i" not having been set to a particular int(so it's essentially wraping null) and then attempting to set "j" to null? Would the correct term be autoboxing null?

I wish the sharpen your pencil answers were available for the later chapters. So Java has pointers after all?

help appreciated,
Max
17 years ago
I'm currently learning Java, so this is a bit of a newbie question I'm afraid.
Is the following possible without having a serverlet/jsp running on the host computer:
User downloads applet, draws image on applet.
User hits a send button, user's drawing is uploaded to Server Database.
User2 downloads applet with previous user's drawing contained.
User2 draws on applet, altering the earlier drawing and uploads.
And so on...

Is this possible? If so, could someone point me in the right direction to get started.

I have some experience with Python, PHP, MySQL if there's some hack I can employ there...

Thanks
17 years ago
I'm just trying to get started with Java and have run into some difficulties already. I think the problem is that I haven't set the environment path correctly. When I attempt to run a short program(from the headfirst java book) I get the following error:

Welcome to Darwin!
Max-Bejnamins-Computer:~ maxbenjamin$ java /Users/maxbenjamin/Desktop/BeerSong.class
Exception in thread "main" java.lang.NoClassDefFoundError: /Users/maxbenjamin/Desktop/BeerSong/class


I tried to set the PATH variable by altering the /private/etc/profile to:

# System-wide .profile for sh(1)

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin"
export PATH
[ -r /etc/bashrc ] && source /etc/bashrc

I'm on OSX 10.3.9 using the bash shell.
If anyone could help me out I'd be very thankful.
17 years ago
I'm just trying to get started with Java and have run into some difficulties already. I think the problem is that I haven't set the environment path correctly. When I attempt to run a short program(from the headfirst java book) I get the following error:

Welcome to Darwin!
Max-Bejnamins-Computer:~ maxbenjamin$ java /Users/maxbenjamin/Desktop/BeerSong.class
Exception in thread "main" java.lang.NoClassDefFoundError: /Users/maxbenjamin/Desktop/BeerSong/class


I tried to set the PATH variable by altering the /private/etc/profile to:

# System-wide .profile for sh(1)

PATH="/bin:/sbin:/usr/bin:/usr/sbin:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/bin"
export PATH
[ -r /etc/bashrc ] && source /etc/bashrc

I'm on OSX 10.3.9 using the bash shell.
If anyone could help me out I'd be very thankful.
17 years ago