I am doing
tbl = {};
Monitor[
Do[AppendTo[tbl, RandomInteger[{1, 100000}, 2]], 100000],
Length[tbl]
]
(well in fact I am doing something less boring but what I want to ask about happens here too)
Every now and then the following message is generated:
RandomInteger::array: The array dimensions 2 given in position 2 of
RandomInteger[{1,100000},2] should be a list of non-negative machine-sized integers
giving the dimensions for the result.
What is wrong?
AppendTo
slows down things needlessly: A randomm table of that size can be obtained withRandomInteger[{1, 100000}, {100000, 2}];
in a 20000th part of the time. $\endgroup$AppendTo
is that what I actually want to do requires some time at each step, so I would like to place aListPlot
as the second argument ofMonitor
, to watch the picture while it gradually emerges. $\endgroup$Do::itform
in MMAv9. $\endgroup$Monitor
, which interacts with the kernel using a thread. THere was a bug, now fixed, in (mis)handling of a signal that hits at an inopportune time; there was cross-talk between threads and theDo
iterator was getting messed up. If you provide full code to replicate we can try testing in a current kernel to make sure we fully made it go splat (the bug, I mean, not your code). Can do this either in this MSE question or through Tech Support. $\endgroup$