Cody

James

4
Rank
32
Badges
25800
Score

Activities

1 – 50 of 3,452

James submitted a Comment to Problem 3075. Matrix of Multiplication Facts

Andrew, I just tried resubmitting my original solution, and the test suite was OK. What is the exact problem that you're having with the test suite when you submit your solution?

on 22 Nov 2017 at 13:43

James submitted a Comment to Solution 1297145

It's a unique solution...I'll grant you that!

on 9 Nov 2017 at 13:35

James submitted a Comment to Solution 1296612

Very sneaky noticing this pattern in the answers.

on 9 Nov 2017 at 13:17

James submitted Solution 1329976 to Problem 42504. Data Regularization

on 6 Nov 2017 at 20:15

James submitted a Comment to Problem 44374. Tautology

@Peng - I apologize. Your solutions are usually among the best for the problems, and I meant no offense. The "Blame Peng" portion of the comment was meant as a joke. You are 100% right that most of the earlier solutions (including all of mine!) would fail with more than two variables. As I said in my earlier comment to Jean, the fact that Jan is trying to come up with a more robust test suite is a good thing, as it will help everyone get better at MATLAB. Again, apologies.

on 3 Nov 2017 at 12:44

James liked Solution 1305838

on 2 Nov 2017 at 18:56

James submitted a Comment to Solution 1305838

I was just happy I could use "diag" and "spiral" in this problem, but it's always nice to see some of my solutions get used in other code.

on 2 Nov 2017 at 18:56

James submitted a Comment to Problem 44381. Cache me Outside

Paul, it uses a feature that was just introduced in R2017a. If the answer hadn't accidentally been in the test suite, I never would have figured this one out either!

on 2 Nov 2017 at 18:46

James submitted Solution 1325361 to Problem 281. Acid and water

on 2 Nov 2017 at 18:29

James submitted a Comment to Solution 1319950

Leo, your theory is correct: The numbers that you're calculating for d>50 are too large to be represented by a 32-bit digit, and won't be calculated correctly for mod(x,2). Think very carefully about the number pattern in the Fibonacci sequence, and see if a pattern emerges.

on 2 Nov 2017 at 18:22

James submitted a Comment to Problem 44374. Tautology

@Jean - Blame Peng for bringing up the "more than 2 variables" caveat that caused all of my solutions to either time out (at least a dozen of mine have vanished due to timing out while rescoring) or outright fail! :-) I agree that having the 26 variables is slight overkill, but that is what makes this the "hard" problem. I set them all equal to 0, then all equal to 1, and then ran a bunch of random permutations of 0 and 1. I evaluated all of those conditions to determine if any of them would come back false. Not perfect, but enough to satisfy the test suite and much quicker than the 2^26 combinations needed for the every possible combination of A-Z.

on 2 Nov 2017 at 18:15

James submitted a Comment to Problem 2523. longest common substring : Skipped character version

For test 5: str1 = 'a string with many characters'; str2 = 'zzz zzz zzz zzz zzz'; Why wouldn't the correct answer be four spaces instead of just one?

on 1 Nov 2017 at 15:01

James liked Problem 44374. Tautology

on 31 Oct 2017 at 17:29

James submitted a Comment to Problem 44374. Tautology

@Jean-Marie - Between the various test suites, I think this is the fourth time I've had to solve the problem. How can you call that boring? :) But seriously, I think it's great that Jan's trying to get the test suite both challenging and correct. A robust test suite is much better than having only a few tests that can easily be fooled.

on 31 Oct 2017 at 17:29

James submitted Solution 1321943 to Problem 44374. Tautology

on 31 Oct 2017 at 17:18

James submitted Solution 1321915 to Problem 44367. Inscribed Pentagon? 2

on 31 Oct 2017 at 17:01

James submitted Solution 1321804 to Problem 44374. Tautology

on 31 Oct 2017 at 15:25

James submitted a Comment to Solution 1319000

Freepass is still active???

on 30 Oct 2017 at 12:47

James submitted Solution 1317295 to Problem 44374. Tautology

on 27 Oct 2017 at 11:35

James received Indexing III Master badge

on 25 Oct 2017

James submitted Solution 1314871 to Problem 44374. Tautology

on 25 Oct 2017

James submitted Solution 1314820 to Problem 44374. Tautology

on 25 Oct 2017

James submitted a Comment to Solution 1314802

If ever there was a problem that should allow "eval" to be used, this should be the one.

on 25 Oct 2017

James submitted a Comment to Problem 44350. Breaking Out of the Matrix

R/C=1 implies that R=C, not necessarily that both R=1 and C=1. When R=C and they are both greater than 1, there is intentional overlap because that is the way the problem is defined. Believe it or not, this is a real world problem, Anselm. One of the people I work with asked me how to do exactly this particular calculation for some work he was doing. I gave him an answer (my answer to the problem, in fact) but figured that there had to be a better way to do it. A good way to determine the best way to do something is to submit it as a problem to Cody, and let the MATLAB geniuses do their thing. The problem that you are describing sounds interesting. How about you write it up and submit it to Cody? They're always looking for new creators, after all.

on 25 Oct 2017

James submitted Solution 1312866 to Problem 44347. Ned's Queens

on 24 Oct 2017

James submitted a Comment to Problem 44350. Breaking Out of the Matrix

Anselm, the problem statement, which describes how you should break a 3x4 matrix up into 2x3 matrices, shows that there are common values in the matrices that comprise the correct solution. The bottom row for X(:,:,1) [2 5 8] is the top row of X(:,:,2). Likewise, the last two columns of X(:,:,1) [4 7 ; 5 8] are the first two columns of X(:,:,3) Unless R=1 and C=1 (which is true in one of the test cases) there will be at least some "intentional overlap" in the matrices that make up the correct solution.

on 24 Oct 2017

James submitted a Comment to Problem 44350. Breaking Out of the Matrix

Forgot to add that if your 2x2 matrices do not overlap in the 7x7, you will get an error since you will run out of space in the last series of matrices. Perhaps that is your problem?

on 24 Oct 2017

James submitted a Comment to Problem 44350. Breaking Out of the Matrix

Viko and Martin - If you are breaking down a 7x7 matrix into multiple 2x2 matrices, you will end up with 36 of them. You will end up with 16 of them if you are breaking a 7x7 up into a set of 4x4 matrices, or if your 2x2 matrices do not overlap with each other. Set A=reshape(1:49,7,7) Because you are breaking A up into multiple 2x2 matrices, the first matrix will be [1 8 ; 2 9] The next one will be [2 9, 3 10]. It will continue all the way down and across to your final matrix - [41 48 ; 42 49]. There will be 36 of them total. If you are getting a 2x2x16 matrix, you may have misunderstood the problem. Please post a comment from your solution so I can see your code.

on 24 Oct 2017

James submitted a Comment to Solution 1309368

Hooray for the File Exchange! I had no idea something like this was already out there.

on 23 Oct 2017

James liked Solution 1309368

on 23 Oct 2017

James submitted a Comment to Problem 44349. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.

Elmar, I readily admit that this is a very easy problem.That's why it is in the "Cody5:Easy" section. There is code that will guarantee a correct solution, regardless of when you submit your entry. However, people going for the lowest possible Cody score will just keep submitting a low score entry until they hit the clock just right. There's really not a whole heck of a lot I can do about that.

on 23 Oct 2017

James submitted a Comment to Problem 44350. Breaking Out of the Matrix

Viko, while it's possible that my test suite has an issue (just check out my Hard problem on Pandigital Numbers for an example in that!) we've had a lot of solvers on this one. It's likely that one of them would have found something wrong with the test suite. However, it's still possible that your solution hit a weird corner case because you were doing it in a unique manner. Please post a comment from the solution that gave you that error so I can take a look at your code.

on 23 Oct 2017

James received Cody5:Easy Master badge

on 23 Oct 2017

1 – 50 of 3,452