Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Adam Brown

Greenhorn
+ Follow
since Jan 08, 2004
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 Adam Brown

I understand that this may be a performance-newbie question, but why does the JVM have a max memory allocation setting of 2GB? I have been reading on threads that this may be different with different flavors of the JRE that run on 64-bit architectures (unfortunately I am running on 32 bit).

The reason that I ask is that I have a Java process that is servicing requests from many hosts over a several week period, and after mapping out some quick figures from some performance tests I've run - I won't be able to make it beyond about 13 days. Does anyone have some great suggestions on where I can find a good resource for Java Application performance-tuning?

Thanks in advance for your time and consideration,

Adam
13 years ago
Good Deal!

Thanks for the help Ajay,

Adam
I don't not know if this is possible, but is there a way to conditionally release / renew an IP of a machine using Java? I understand that Java does not tie itself to any specific OS, but in way of testing "Out of Comms" scenarios I am looking to create a test that I can automate to alleviate the need to yank the network cable from the machine and then plug it back in.

Any thoughts would be very appreciated!

Thanks!
I apologize for both the delay in this post and the clarification needed. I suppose what I am trying to accomplish is the throwing of an exception in my code if a primitive is of a specific type.
For example, I have a JTextField that reads a double value that will be manipulated in some sort of financial equasion. Granted, I understand that a JTextField takes a string argument and has to be parsed into a double value, but would I have to create a custom Exception class to handle whether or not that value could or could not be converted into a double?
This was a problem that was presented in class, and everyone is kind of chewing on it for the time being (including our professor). It has turned into a kind of competition, actually, to see who can research and find the most elegant solution. If someone does not want to give me the answer but rather point me in the right direction I would be very grateful.
Thanks in advance,
Adam
18 years ago
withour examining at the code itself, is there a method that will tell me what type a variable is. For example, i want to distinguish an int from a char.
thanks in advance,
Adam
18 years ago
I agree with Brad. Putting your thread to sleep is an easy way to put a time delay in a process. The only thing is that you need put your thread to sleep within a try/catch block. Here's an example that prints out 10 numbers with a five second delay between each display:
18 years ago
I'm not sure how far along you are with your study of Java, but if you're trying to create a "dynamic" array of objects, you might want to look into Array Lists. Array Lists allow you to add and remove objects from an object array, however, once objects are added to the array list they will no longer be type specific in regards to what objects you are "pushing" (and I use the term loosely...) in. Simply put, if you were to add Car objects to an ArrayList, they would no longer be objects of type Car. They instead would be objects of type Object (notice I used a capital 'O', meaning that 'Object' is a class, a top-level class of the java.lang package). In order to extract any information on a specific object within the ArrayList you have to find the index you want and cast it back as a Car object. This explanation may or may not be of any help to you but regardless, a look at the ArrayList class located in the java.util package (java.util.ArrayList; = fully qualified name) would be to your benefit.
For the official scoop on what an ArrayList is, go here
18 years ago
Going by your snippet of code, I'm pretty sure that you are creating a student object, passing in your specific arguments to the Student constructor, and then adding that student object to an array list. Are you trying to cycle through those objects and assign an index value to each? Would it be passed in as one of the arguments in the Student constructor? Your request is a bit vague in that respect...Is there anyway that you could clarify what you're looking to accomplish?
[ March 04, 2004: Message edited by: Adam Brown ]
18 years ago
As an edition to Mr. F-H's explanation on protected members, it should also be noted that if another subclass 'B' were to extend from subclass 'A' already extended from a superclass containing protected members (while existing in another package), those protected members would only be seen by the subclass 'A'. In a sense, those inherited protected members assume private visibility within subclass 'A' and cannot be seen by subclass 'B'.
18 years ago
Thanks Stan.
I think that I have a little bit of a different perspective on the issue after reading the information you offered.
Thanks again for your time.
-Adam
Hi all,
I am in the middle of developing a Java application for one of my classes and have come across what is turning out to be quite the obstacle to overcome...
My application allows a student to keep track of their class grades, for multiple classes which are selected from a master list stored in an Access db. I want to allow the student to add courses to and delete them from the db...so far i seem to be in good shape. My connections are fine, my queries are fine, the GUI interface is operational, and I can read and write to and from my db...kinda. The problem I'm running into is that through using a JDesktopPane and multiple JInternalFrames, whenever I make changes to the db using one form, I cannot see those changes where I should be able to in another. In fact, they are not pulling any information from my db at all. The only way I can see my updates through those forms is if I restart the application entirely (which is baaaaad).
In class, our instructor briefly introduced us to the 'Observable / Observer' relationships that can exist between the different elements of an MVC pattern. From what I understand I have the classes created in a fashion that uses MVC (a dataModel, forms for the interface, and controls that are looseley defined in each...which is where I'm most likely having problems!). If anyone could point me in a direction where I could see a code example of how to successfully implement a simple Observable / Observer relationship using JDBC, I would be very appreciative!
Thanks in advance,
Adam
7th Semester CIS student
DeVry University | Orlando, FL