Win a copy of Rust Web Development this week in the Other Languages forum!

Matt Wright

Greenhorn
+ Follow
since Jan 23, 2014
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 Matt Wright

I took your advice and got an efficient solution. Thank you.
7 years ago
Oh wow! It's the simple mistakes that take the most time. Thank you very much!
7 years ago
I have a data structure such as: ArrayList<ArrayList<Integer,String>

The data looks as [[1,2,3] [3,4] [99,98,40,32,45,65,1]]

I am trying to access each element and put them into a hashtable such as:

Hashtable<Integer,String>

With what I am doing below I am getting an out of bound error but can't see any other way of accessing the element

7 years ago
I am implementing the hash join algorithm for a project with a hard coded hash function. I've hashed the first relation and I've hashed the second relation. The problem is when hashing the second relation I only know how to add the tuple from the second relation into a third relation and not also access the first relation tuple at that time

7 years ago
Thank you man, I really appreciate your help.




Worked beautifully, I didn't realize I wasn't actually printing from the ArrayList
7 years ago
Yes that is line 45, Ah I see, I'm not actually printing out the substrings pushed into the ArrayList.

How can I print out the strings from the arrayList truncated a user defined amount.

I'm pushing in "1234" "1243"

But I want to print from the ArrayList

"12" "14"

if the user enters a 2
7 years ago
I mean that the String index is out of range
7 years ago
Hi guys,

I am new to Java so I am writing a Java permutation program, it takes in N and k and gives k amount of combinations based on N length.
That portion works, but the portion I have that does not work is when k is greater then 1, the array is then then printing strings out of index.

The perm algorithm ends on index - 1 for moving characters but then I push all those characters into an Array List, I would think I could print them off however I want from there but that is not the case. I'll include the minimum amount of code possible.

7 years ago