Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

Christopher Diebold

Greenhorn
+ Follow
since May 23, 2013
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 Christopher Diebold

I have a simple domain class representing time. I want to calculate the elapsed time given start and end time and store it in the database.



my function works as I have unit tested it:


I have tried to use the mapping closure that I found derived properties in the grails documentation.

What is the best approach? Is this something that should not be done in a domain class?
6 years ago

Jeff Verdegan wrote:Also, don't just print getRowSize(). You need to print out all of these



I can't say I much like variables named X and ZZ either.



ok i'll try it.
9 years ago

Jeff Verdegan wrote:That's an awful lot of code to read, so I'm not even going to try.

If you're getting an AIOOBE after 4 iterations on a length-8 array, then you're probably incrementing twice for each iteration. At the very least, you're incrementing more often of by a larger amount than you think.

So just before the line that's giving the exception, add a println() statement that shows you the length of the array and the index you're about to access. And then you may want to go add println()s everywhere you increment that index and print the before and after.



It is a lot. I understand. How about I just post the one method maybe 30 lines. Tell me if it looks right. Its just a double for loop.

>
9 years ago
So I am trrying to implement Stressen's Algorithm for matrix multiplication and I have the weridest error when trying to pad my matrix with zeros. So in my padZeros method I am trying to create a bigger matrix to hold all the values of the next power of 2. SO a 5 x 5 matrix will do matrix multiplication on an 8 x 8 matrix. but when I go to set my matrix it will only iterate 4 times instead of 8 times which is werid because I print out the size of the matrix right before setting it as a debugging check. I dont know if this is maybe an inheritance thing or what. can someone please look at my code and help a fellow coder out? becasue I use inheritance I will post both classes but the error is in the StrassenMatrix.java and in the PadZero method. The comments explain the error. The error is on line 218 of the StrassenMatrix.java In case you dont know Strassens Algorithm here is a wiki link http://en.wikipedia.org/wiki/Strassen_algorithm

Matrix.java

StrassenMatrix.java
9 years ago