This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!

Darko Jakimovski

Greenhorn
+ Follow
since Nov 01, 2018
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
7
Given in last 30 days
4
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Darko Jakimovski

I'm using Streams because the code is part of an exercise I did about Streams. The whole point of it was to find a way to do what was done using Streams.

About the modulo... Maybe I could have just added it like this without the if statement


I'm using an extra index because the first file that I'm writing to has to get the bigger chunk when bytes are odd. As for using index 155 would be fine because that's half of an even number. I'll just split the byte array in two.

1 week ago


This is what it took. The ranch always helps me take a more serious approach to things when I ask a question and you guys ask something back I can't believe what I was doing.  I read what you wrote like maybe 70 times. Thank you for the time spared.
1 week ago
It's simple, I have a disability I need to address. There is no other explaination to my spending 3 hours on this, cracking my keyboard, smelling like the discharge of a garbage bin and losing half my hair. I'm soooooooooooooooooooooooo mad right now!
I've tried everything that I can possibly think of, red everything there is to read and still I can't understand what's happening and how to solve this in the first place. I also tried dividing the buffer into 2 other byte arrays but that didn't work as well.
1 week ago
count at line 13 --> 307
modulo at line 16 --> 1
halfData at line 22 --> 154
1 week ago
Exception in thread "main" java.lang.IndexOutOfBoundsException
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:326)
Thrown at line 24

Also I printed out the values and they are as they should be
1 week ago
I get the exception for the following code, though I don't get it why, I tried changing the values for the second argument in the write() method by +-1 but I still got the same Exception. The task is to divide one file into two, and if the length is an odd number the first file should get the bigger half.  Any input would be much appreciated.





1 week ago
OMG! Thank you so much. I had issues in the past few days because of my total lack of knowledge in debugging. Campbell, you are the man!
4 weeks ago
Thanks. And yeah... I realized that the second I posted my question. I figured it out once I asked the question myself in a forum form
4 weeks ago


So I'm doing a small task where I need to display a user entered URL's parameters. This is the code I found as a possible solution. But I can't understand why is it you can put a split String into a Map that has String for both key and value and the split method returns a String array. I obviously can't wrap my head around on why are the square brackets added after calling the split method. Is that supposed to be the index of the returned array? Care to explain fellas?

Glad to be back on the ranch, after a long pause (needed some extra knowledge to be comfortable to ask questions ), cheers.
4 weeks ago
Congrats guys.
6 months ago
The book and all of the source code can be found on the link below:
JavaDocs7

The code is the author's as a solution to one of the exercises. As for the imports they are all mine, since I'm doing all of my exercises from the book and various other in the same class
7 months ago
Eureka! The random number IS the index and every time you hit it again it's value or index element goes up by one. Thanks Kenneth!
7 months ago
I tried printing every step of the way before posting and exhausted every source available to me.
7 months ago
I still don't get it. If the random number is say 300, does it hit the nameFound[300] index? And every time it hits the same index the value goes up by one? What is the value of the 300-th index when it first time hits? Does it assign the value of the random number? That's my confusion.
7 months ago