Jinny Morris

Ranch Hand
+ Follow
since Apr 29, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jinny Morris

Thank you thank you thank you!
8 years ago
I've installed jdk 1.8.0_77. But when I run the cmd prompt in Windows I get this:

C:\>java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) Client VM (build 25.77-b03, mixed mode, sharing)

C:\>javac -version
javac 1.7.0_07

I don't understand why the "compiler" version given is not the version that I just installed, and suspect that this is why I cannot compile or run from the command window. Does anyone know what I did wrong, or what I should do now?

Thank you!
8 years ago
Shannon -

Thank you so much! I finally did solve my problem (with help) in a very unexpected way. I had ok'd automatic updates from Sun; it turned out that in addition to putting the executables in the program files \ java directory, the updates were also putting copies of the executables in my windows \ system32 directory. Because I had added the "java" path to the end of my list of paths, the executables in the windows directory were being used to run my programs. Unfortunately, none of the subsidiary files (in this case lib \ audio \ soundbank) were in the windows directory. So my BeatBox program couldn't find a soundbank, let alone any instruments! (I had tried getting the default soundbank in code; null was returned.)

So I disabled the executables that were "in the wrong place" and also disabled the automatic updates. Now I have something appalling like 400 or so "instruments"; since I also have screwed-up speakers, the long trek continues ...

Thanks again!
16 years ago
Katrina -

Thanks - but - well, but ... I had asked Pauline about this one, & she suggested that I ask on the forum. The trouble with obfuscating the instructor's code in this instance is that I (at least) had to look at the code twice in order to see what it was doing, and had been being "picked" on exactly that point (that if the code is clear, you shouldn't have to look at it twice). So on the one hand, I can see why you did that, but on the other hand, just saying "string stuff" seems like it kind of loses my point. And when the "string stuff" uses a count of digits, I still have to count the digits in my number ...

??
16 years ago
Uh ... yeah! On the other hand, I've been nitpicked for both "num" and "max" ...
16 years ago
Ladies, Gentlemen and Nit-Pickers -

I have spent the past eternity being "picked" with respect to clarity, readability and simplicity of code. So now I have a "nit": When it's necessary to test a command-line input for range, say the input number must be between 0 and 99 inclusive, it seems to me that the obvious and simplest test would be something like


But instructors' solutions have code like


I seems to me that the instructors' solutions are less "obvious" than the simple "is it in this range" comparison. The range comparison does not require more code, since the input string has to be converted to an integer anyway; in any case, I have been told that more code is just fine as long as it's not more than 3 or 4 (or so) more lines. So what's the story here?

Thanks!

[ January 22, 2008: Message edited by: Jinny Morris ]

[ko]: edited to obfuscate code
[ January 22, 2008: Message edited by: Katrina Owen ]
16 years ago
Some time back, I posted a somewhat desperate question about my efforts to "play around" with the Beat Box app in Head First Java. I have now found the answer to my problem, with lots of help, in a very unexpected (to me, at any rate) place; since it applies to lots in addition to my original problem, I'm starting another thread.

I had Java automatic updates enabled on my computer. It turns out that in addition to installing the updates in the Program Files\Java folder, the executable files java.exe, javaw.exe and javaws.exe were also being inserted into my WINDOWS\SYSTEM32 folder. The update log does not mention this. It further seems that in spite of my setting my path correctly (I thought, anyway; it's been working for a while), the command prompt "java ClassName" looks first in the windows directory for an executable. Since the windows\system32 folder does not contain all of the subsidiary files, this is not a good thing. Specifically, the audio file which contains the Java sound bank does not exist in this directory. When I disable (by renaming) the executables in the system32 directory, everything works just beautifully.

So I have disabled automatic update and posted a question about it on one of the Sun forums. I suppose I could put the "java" path at the front of my list of paths, but I don't think that this should be necessary ...

In case anyone else is having really weird problems, maybe this could help.
16 years ago
I am revisiting the Head First "boom box" and am stuck in two places:

First, the very first example program, which turns a note on and then off, never stops - I have to use Cntl-C in the command window. I tried using System.exit(0) (this suggestion was also made by Daniel Gagnon), but then I never hear the note at all (the program does stop, though!)

Second, I am one of several who would like to know what instruments I have available. I have tried using the getAvailableInstruments method of the Synthesizer class by reading Sun's API and got 0 instruments; so I tried searching the ranch. I found 2 hunks of code, one posted by Kathy Sierra and one posted by Timothy Stone (both a long time ago). Both of these programs also tell me that I have 0 instruments.

If I try the getDefaultSoundbank method of class Synthesizer, it returns null.

However, if I just play the program in the Head First book, I get the promised piano note. So there's obviously something somewhere! I just wish I could find it/them ...

I am very confused! Could anyone cast any light on this?

PS - I also tried the getLoadedInstruments method. Same results.

[ January 13, 2008: Message edited by: Jinny Morris ]

[ January 13, 2008: Message edited by: Jinny Morris ]

[ January 13, 2008: Message edited by: Jinny Morris ]
[ January 13, 2008: Message edited by: Jinny Morris ]
16 years ago
Katrina -

Thanks for the implicit assumption that I'm not a complete idiot! No, it was "totally me" I'm afraid ... the web designer did a fine job!
16 years ago
Ummmm ... yeah! Afraid I just permanently acquired the record for denseness - so you don't have a chance! Having seen those, I have just been reviewing the books I've been using - and not even noticing their "linkiness"! And some of my assignment attempts have suffered from the "dancing bear" phenomenon: it's amazing that it dances at all, don't ask how well it dances!

Have fun! I find that it's a truly great opportunity to practice the virtue of humility ...
16 years ago
Sorry to be so dense, but in reading the post on atomics I tried the link to "one of the instructional pages". I've never found anything like that - nor could I find it just now looking around the Cattle Drive home page. Where are they? Where should I be looking? I could certainly use some of that kind of material ... as my nitpickers would be happy to testify, I'm sure!
16 years ago
Marilyn -

Thank you! That worked - along with (as I should have thought of earlier) setting the font in both notepad and my email to Courier.

And, yes, I'm using Windows XP - should have said.
16 years ago
I'm using emacs to type my code - because the highlighting etc really help me out. In my emacs file my formatting is perfection itself (I know this because I just crawled through the current file counting spaces in the front of every line), but when I copy and paste into notepad, or anything else for that matter, my indentations are 3 spaces, not the 4 that I have laboriously counted. Does anyone else use this particular text editor? Or do you have any suggestions for something else that I could use that would provide some syntax checking?

Thanks!
16 years ago
HALLELUIA!!!

Thank you!
16 years ago
I think it's C-ish or VB-ish or something like that - nicely convenient, in any case (although perhaps not as "readable" as null?)
16 years ago