Aaron Roberts

Ranch Hand
+ Follow
since Sep 10, 2002
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aaron Roberts

Any 3d libraries?

Have you used either of the two you mentioned? I'd like to get a rough idea of how quick they will be with somewhat large data sets.

17 years ago
I'm trying to find a charting library to do line x/y and 3d plots. My max data size would be about 10 meg of x/y/z data.

Does anyone have any experience with scientific visualization using java?

Recommendations on libraries to use?

17 years ago
I need to make a simple app that can record the speech for me. This application will be used by non-technical people, who have little to no understanding of audio formats, specs, etc.

This is what intend to do -

- Record audio on the users computer
- Play audio on the users computer
- Save the audio to a file on their computer
- Send the file to my computer
- Run using JWS

My thought is to run a simple ftp server on my computer (on a non-standard port). The app would ftp the audio files up after they have been recorded.

The user would do the following -

1 - Run the app via JWS
2 - Press a button to start the recording
3 - The screen would present a word to the user, which they say
4 - The app pauses a few seconds and the shows another word
5 - After say 10 words, the application automatically stops recording
6 - The file is transferred up to the server
7 - The repeat 2 - 6 a few times for different sets of words
8 - They are now done and exit the app

I'm sure there are ftp libraries out there for java. The thing I'm not sure of is how to do the recording, ie what approach - JMF, Java Sound, other?

Can you all share some experience and make some suggestions?

Aaron R>
17 years ago
If I understood the purpose of BSF, its to provide connectivity between a language and java. This means to create a working language of my own, I'd need -

Java code I wanted to interact with via my script language
The Java 'glue' code that connected BSF and the above

I wasn't sure if that would actually give me the shell type console I desired.

I think I've settled on BeanShell (bsh), since it retains so much of the java syntax. Can anyone comment on how difficult it would be to make the image app I described? Using beanshell, I'd need -

My application code (this would open a JFrame with an image at the top and the text entry area at the bottom.)

Would the app code be able to use beanshell and instantiate a console?

Aaron R>
17 years ago
I want to have a shell/console in an application. The idea is to make a very simple image application that just applies a few filters to an image. So I would have an image viewing area and an entry area for the shell commands.

In the shell/console area I'd enter commands which would execute methods on java classes. A psuedo syntax might be -

image = new Image("original.png");
Blur.blur(image, 10)
Crop.crop(image, 50, 150)

The idea in the above is that Blur.blur is a static method on a class. Thats a bit of design ignorance, since I don't know enough about scripting with java at all.

Another usage example could be -

load image1 "original.png"
img = blur(image1, 15)
img = crop(img, 50, 150)
save img "newimage.png"

So you can see from both usage examples, the ability to do dynamic inputs is the key part. The syntax isn't so important.

Can someone provide some input on how I might approach this? What might be a pro or con for one method over another?

I don't want to write my own parser for doing this. From what I understand I don't have to with some of the options out there.

I came across this great article on some scripting options out there -

Choosing A Java Scripting Language


Aaron R>
17 years ago
I'd have to agree about Ant. My feeling is that -

Makefile = evil
evil = 666

Build.xml = 333
333 = Half evil

I like ant's build files better than make. Its not easy to just jump into making your own ant file, once the process goes beyond just compiling. The files seem to get a bit unwieldy for me at least.

17 years ago
I'm going to be overtly sarcastic and say this is a bit silly.


There's no such trivial example of MMORPG, because the problem, the data, the everything is basically not trivial.

Arguing over pseudo code or general design doesn't advance the technical implementation much.

If you want to do network game play, then I'd suggest the following -

- go write a game that allows 2 or three players to interact. Cards, shooting, whatever. Learn from the experience and see what issues came up.

- Try using somebody's framework. Frameworks are great, why reinvent the wheel I say. One such is Project Darkstar from Sun.

Once you've done that, then come back to the forums and ask specific questions on implementation details, framework architecture, etc.


Now, I must be off to do some work on a pet project.
17 years ago
Well, here's my two cents.

You assertions are flawed, because they are too general. If you don't know how to program right now, then you won't understand a deep technical reply on the merits of one language over the other. I can provide some insight which I have found to be true for myself.

I prefer Java to C++ because of the following -
- I hate having to look in two source files to get an idea of whats going on. This is a personal peeve, so you should take it as such. Not all source code is well written in C++, which means I end up poking in two files, rather than one in java

- I enjoy not having to muck with pointers. (Don't believe the line that everything in java is a pointer, because its not. See this Java Pass By Value for a nice explanation with lots of sarcasm and thought.

- The language syntax is great. I could not care less if it compiles down to bytecode vs assembly vs basic, as long as it does what I want. Such is the case for this language. This is also the reason I begrudgingly like C# as well. The syntax is so much 'cleaner'.

- In general, with the exception of using JNI and some other detailed Swing nits, it does work on the top three OSes - Mac, Lin, Win

Why I like C++

- Its better than C.

- Its object oriented and provides great flexibility to do whatever well thought out or really stupid implementation scheme I feel like.

- I can use it on any OS I happen to be forced to use.

So here's what I don't like about Java / C++ -

- I've lost touch with the newest cool features, since I currently work at a place that uses C++ only.

- It doesn't run everywhere perfectly, in fact performance can vary widely depending upon OS, JVM version, graphics card installed, memory, etc. Normally this is never an issue for the projects I've worked on, but I am familiar with what things could put a person in the 'bad lands.'

- Sun took too long in making an IDE with a strong GUI development component. There are still tons of ways to make guis by hand, using frameworks, etc. I would have preferred a nice GUI IDE earlier on. There are tons of opinions on this alone, so feel free to disagree.

- Most programs I've come across are C programs that tried to pretend to be C++. The results are silly and its obvious the programmer wasn't an OOP developer.

- A newbie will spend more time fighting tools when learning than programming. You can take someone who is excellent at C++ using MSStudio Vxxx and plop them in front of a Linux box, and they will be helpless to produce a hello world. Not always, but many times. This is the one thing about learning to program any language on any OS that is most annoying. Fighting the tools, just to get the application to compile, link, and execute.

- Makefiles are of the devil. I don't care what anyone says, they are evil. C++ is usually accompanied by these nasty things, regardless the OS.

Ok, so here's my advice. Do youself a favor and take the other posters advice and learn them both. Being a good programmer is like being a linguist. All languages express ideas, its just the words which change. If you understand programming concepts like factory methods, singletons, threads, looping, conditional logic, etc then the language is just a way to make your designs concrete. Some programming languages express some concepts more easily than others.

17 years ago
I've got an app that uses xstream (http://xstream.codehaus.org/) to serialize objects in and out for me. I can jar my application up and run it fine. When I try to deploy it using java web start, I get a security error.

Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkMemberAccess(Unknown Source)
at java.lang.Class.checkMemberAccess(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at com.thoughtworks.xstream.core.JVM.<clinit>(JVM.java:24)

Has anyone used xstream with jws?

17 years ago
Ooops! You did mention an interface. If thats the only thing super OO'ey (definite made up word-thingy there) thing you do, I still think it makes perfect sense.

I'm sure whichever way you end up implementing things will work well. If not, then you can come back and tell us 'I told you so!'

Aaron R>
18 years ago
I'd have to agree with Ernest.

What's so bad about a nice clean basic OO design like you described? There are times when pure OO makes the most sense and when pure function based design does. Often, a mix of both makes for a nice approach.

If you're worrying about performance, don't. Performance metrics are best done once you have something to start with- IE rendering my 9 Million things is slow. (Tongue in cheeck example) Then you can baseline where you are and adjust things to improve.

Since you admitted you are not a lover of scenegraphs, but also that you've never used them to their extent, maybe you're trying to be more anti-scenegraph than is practical? In your example, you didn't mention anything about inheritance of the ship class from a drawable class or a moveable class. You also didn't talk about interfaces. It seems like you've take a reasonable approach to the problem you have at hand. It also seems more intuitively maintainable than going a purely lower level way.

My 3.5 cents.

Aaron R>
18 years ago
Did you ever get any help with this? My wife has a Tungsten E as well and it would be great to do some apps on the Palm.

You can email me at -

antamiga at gmail dotcom

Aaron R>
19 years ago
Hey Rick you're facing the same issue I'm looking at.

I recently got a Sony Clie and wanted to run java apps on it, since I can write in java far faster than C/C++. I was able to download and install the JVM for the Tungsten line of PDAs just fine. My wife has a tungsten E, so I was curious how things would work between the two.

I tried the prc converter on a jad I had made with the j2me wireless toolkit, but it didn't work on the Palm.

I am very comfortable with 'normal' java, but completely new to J2ME.

Could you email me and maybe we can dialog as we both learn?

antamiga at gmail . com

Aaron R>
19 years ago
Thanks Daniel. That is mostly what I want to do. The problem is, I need to get a list of the files in the jar my application is running from.

So if you typed -

java -jar mygame.jar

I want to get a list of the files in that jar while its running. Do you see how its slightly different than knowing the name ahead of time?

Aaron R>
19 years ago
I have a custom swing component which lets you paint on it and stamp. I am getting flickering though.

The user selects a stamp and can move it ontop of the existing drawing. When they want to paste the stamp down, then click. I keep two images, a buffer where the stamp has not been placed, and the current components image. As the stamp moves, I have to redraw what was under it from the original image. The problem is that you can see a flicker when a portion of the stamp imagery overlaps the old location.

Here's a quick snippet -

The g2d is the graphics context passed into the paintComponent() method. the backBuffer is an image which contains the original drawing. The isDoubleBuffered() method returns true on the object. Is there a way to avoid the flicker without making a third image to draw onto the screen in one pass?

I know there are buffer strategies, but that seems overkill for what I have.

Aaron R>
19 years ago