Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

Jan-Jaap van Nieuwkerk

+ Follow
since Jul 03, 2006
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 Jan-Jaap van Nieuwkerk

Originally posted by Jinny Morris:
On the other hand, I did not grow up on the internet - and I am still wondering what "FWIW" means - [/QB]

In My Humble Opinion (IMHO) they mean FWIW = "For what It's Worth" and BTW = "By The Way".

You could alway study this list
[ August 02, 2007: Message edited by: Jan-Jaap van Nieuwkerk ]
12 years ago
I could be wrong but shouldn't the ; in C;/dir.txt be a :
13 years ago

Is your team called "the Nads"?

13 years ago
mmmh, my mistake.
I read the post and guessed he was reading the lines (in a loop) and wanted to write each on a newline in a file.

but it will never alter line endings within a String.

<-- i knew that one.
I assumed he ended up with a file that consisted of one line with all the output strung together, so that he was looking for a way to "add" a line seperator.

oops, too many assumptions i guess.
[ October 27, 2006: Message edited by: Jan-Jaap van Nieuwkerk ]
13 years ago
If i understand you correct i guess the solution is using the println() instead of the print command.
13 years ago
Documentum is a product of EMC and a content management ssytem

I guess this question belongs in another forum

Did you look here EMC and Documentum.
13 years ago
Edit: you posted your answer while i was writing this.
good luck

Hi i'll try to say it in another way.

You try to add 1 to countTotalOne by doing the following: countTotalOne+=countOne
if you change that to adding 1 to CountTotalOne instead of the valy of o you get 26 instead of 351 as output.

As i said, look at the counters in your loop and what value you are actualy storing in your counters.

With a change to the abovementioned line i get this output

de ad be ef 42
Total: 40
26 26 14

Now the first number is correct.
The other 2 numbers (26 14) suggest that you do not reset your counters for longest #1 sequence and longest #0 sequence.
You are at the moment counting all ones and zeroes that are in your string.
try to reset your 1 and 0 counter the moment you find a longer string then the one you have found before.

Good Luck.
[ September 29, 2006: Message edited by: Jan-Jaap van Nieuwkerk ]
13 years ago

If i am understanding you correctly this might be the case.

If i am looking at your loop where you count i get the impression you are doing this:
When i add 1 + 2 + 3 + 4 + ... + 26 i get 351 does that suggest where you might have got it wrong?

good luck
13 years ago
Hi Arun,

If i am correct it all has to do with precedence
I guess the answer in this thread applies here too.
13 years ago
Hi Minnie,

instead of
Settings-->Control Panel-->System-->Advanced-->Environment variables--> UserVariables-->Temp& tmp.

You should use

Settings-->Control Panel-->System-->Advanced-->Environment variables--> UserVariables-->path

This variable should be in the same list as TEMP that is shown.
If it does not exist (which i doubt) add the variable PATH and enter
C:\Program Files\Java\jdk1.5.0_07\bin as the value
Hope this helps.
13 years ago
Welli'll give it a try.
Beware! i am only a beginner.
I guess your real question is :
Why does the main thread execute first although you start the other two threads first.

As far as i understood you can not tell which thread will execute first.
When you change your program a bit (add a few extra threads)

and you extend the range of the for loops you will probably see in your output that the order the threads are executed changes.

The why of it all will have to be explained by someone else

Oh and if my answer is wrong please correct me.

good luck

hope it helps a it (probably one of the experts will chime in now)
[EDIT] Look what i found on this site: JavaRanch thread example
[ July 07, 2006: Message edited by: Jan-Jaap van Nieuwkerk ]