Search:
Type: Posts; User: tpgettys
Search:
Search took 0.04 seconds.
-
July 21st, 2005, 12:35 AM
The practice I have seen used creates the DataInputStream within the try block, and so it is out of scope by the time either the catch or finally clause executes, meaning a comipler error will result...
-
July 19th, 2005, 06:29 PM
When reading from a DataInputSteam, it is common practice to read until an EOFException is thrown.
Apparently the DataInputSteam object is lost after the try block is exited and the catch clause...
-
August 12th, 2004, 12:38 PM
I would very much like to know how to get low-level control of a physical device, such as the CDROM drive. For example, how can I open and close the tray under program control?
-
March 17th, 2004, 11:45 AM
Thanks for your reply cjard. Please, where is your tutorial located?
I was hoping that there was some tool that would "build" an EXE by compiling and linking together just the code needed from...
-
March 16th, 2004, 04:12 PM
So, are you saying that there is some command-line switch that will cause java.exe to take java class files as input and generate a stand-alone .EXE file as its output?
-
March 16th, 2004, 11:08 AM
cjard, I think your countPairs() method double counts some pairs (which is fine if that is what you want!).
For example, if a hand has three 5's in it, there will be at least 3 pairs reported...
-
March 16th, 2004, 10:59 AM
Does Sun (or someone else) provide a Java compiler that generates an executable (.EXE) for a PC? If so, where can it be found?
I can see that it may make a difference if there are GUI components...
-
March 2nd, 2004, 09:29 PM
I opened a disk file as both an object input stream and an object output stream, wrote to it, then immediately read from it, and it seems to work(!), which is not what I expected.
For starters, I...
-
February 23rd, 2004, 10:53 AM
Thanks for you reply cjard. However, I am aware of the issues you brought up.
Since I wasn't able to provoke the lose of data phenomena by not closing my file, I got to wondering if Java...
-
February 20th, 2004, 05:41 PM
In other languages I have learned that it is imperative that open files must be closed, or risk losing data written to them.
I have tried a few experiments in Java, writing a bit of data but not...
-
February 13th, 2004, 02:51 PM
Hi tszhim.
The problem is that computers use binary but we use decimal. There are many fractions that have a nice, terminating representation in decimal that can only be respresented in binary...
-
February 12th, 2004, 12:45 PM
Thanks khp!
I have done some further investigation and apparently the 4 bytes after the header are a serial number. My understanding is that a serial number is written with every object written...
-
February 10th, 2004, 09:49 PM
I created a binary data file using the following sequence:
ObjectOutputStream outStream = new ObjectOutputStream(
new...
-
January 30th, 2004, 05:29 PM
Yep, you are right magus. So, it has to be that only String literals are checked for equality, so that only one copy is made. I wonder what that is called; maybe something like "String literal...
-
January 30th, 2004, 01:39 PM
The following program compares two different string objects using the == operator and yet it outputs "true":
public class StringEquals
{
String composer = "Telemann";
public...
-
January 29th, 2004, 01:09 AM
hi OSR,
I use jGRASP and do like it, but can't offer any comparison to other Java IDE's. FWIW, the author's are responsive to questions and comments, which is always a big plus! New releases have...
-
January 29th, 2004, 12:06 AM
I have a class Employee with a method named getSalary().
I also have a class Manager that extends Employee with a getSalary() method that overrides the one in Employee.
When I say:
...
-
December 30th, 2003, 05:37 PM
Uggg - Good catch on the reference Barancle.
However, I really don't like saying that private members are not inherited. As delorde suggests, it muddys the discussion (the variable totalMoves...
-
December 30th, 2003, 02:33 PM
This is essentially a question about vocabulary.
I have a Java textbook that states that "the visibility modifiers determine whether a variable or method is inherited into a subclass".
...
-
December 17th, 2003, 05:18 PM
Thanks very much for the link Barancle! Yes, I am very much interested in the math underlying computing. As it turns out, I have a degree in Mathematics, and teach math, including Statistics and...
-
December 17th, 2003, 02:03 PM
It turns out that the proof that Knuth's algorithm will generate each of the 52! permutations with equal probability isn't too hard. The algorithm is:
for (i = 52; i > 1; i--)
{
c =...
-
December 16th, 2003, 09:03 PM
Banancle, you offer a very nice treatment! Thank you very much for your efforts here.
I did a simulaton of the 2 algorithms and obtained the same results, but of course your analysis is much more...
-
December 16th, 2003, 08:55 PM
dlorde, I really wasn't intending to challenge Knuth, sorry. I really am only searching for understanding, doing the best I can.
Part of the motivation for my query is that I actually did work up...
-
December 16th, 2003, 01:47 PM
I have an array of Card objects, and want to "shuffle" it. Knuth (volume 2) suggests something like:
for (i = 51; i > 0; i--)
{
j = i*Math.random(); // select index at random
// swap...
-
December 16th, 2003, 01:27 PM
Thank you for your reply cjard; thoughtful, candid and helpful as always. However, I have to take exception to your comment that
On my planet simply commanding coders not to write buggy...
|
Click Here to Expand Forum to Full Width
|