Reputation
69,183
Next tag badge:
211/100 score
19/20 answers
Badges
6 204 295
Newest
 Nice Answer
Impact
~447k people reached

Jun
23
comment How to avoid nested With[]?
@bdforbes That's a good question. I don't see now, why it is there. But I do recall that it was necessary at some stage. I did have several versions of this function, so presumably that was left from that older code. Unless I am overlooking some subtlety.
Jun
22
comment SetOptions does not give expected result with Grid
Recently, I have become of opinion that SetOptions should in fact never be used, because it redefines the option values in a global way (which means that two different applications using it may easily conflict with each other without knowing it). You can pass options locally, and it should always work and is much safer. I have discussed a solution that would emulate stateful option changes (and make this convenient), while still passing them locally, here and here.
Jun
22
comment Defining a function which takes lists as it arguments and threads over them
This answer of mine may also be somewhat relevant.
Jun
22
answered Create Nested List from tabular data
Jun
22
answered Association of Associations : how to permute level 1 and level 2 keys?
Jun
19
comment Change value associated with keys using alternatives
It will be much easier to answer if you provide some sample data, to make your question self - contained.
Jun
19
comment Query Dataset to check if row contains any from a set of values
Ok, posted an answer as requested.
Jun
19
answered Query Dataset to check if row contains any from a set of values
Jun
18
comment Why is Thread[{ a, b }] the same as Transpose[{ a, b }]?
It may be worth mentioning that Transpose is much more efficient.
Jun
18
comment Query Dataset to check if row contains any from a set of values
You could do Query[Select[MemberQ[check, #[[2]]] &]]@ds, for example.
Jun
18
comment Memory usage optimization for a large Association/SparseArray
You will have better chances for a good answer, if you strip off all the specifics of your particular case, and reduce this to a minimal and simple example illustrating the problem. In the form it is now, it takes too much effort to get to the heart of the matter, for the readers / potential answerers.
Jun
18
comment What are the best practices / most common / idiomatic ways to report errors in Mathematica?
@Guesswhoitis. I wasn't focusing specifically on messages, so did not mention this, but that's a good point. Perhaps, generally, it may be worth it to add a special section on messages and message - handling.
Jun
17
comment What do RecursionLimit and IterationLimit actually set?
The answer becomes clear when you analyze what the tail recursion and execution stack mean in Mathematica. I gave such an analysis here. The main point is that rules which rewrite expression in their entirety (rather than their parts), do not grow the expression stack, and lead to iteration rather than recursion. The limit of such iteration is set by $IterationLimit, and your second example is of that type. Your first example, however, grows the stack, for reasons very similar to what I described in that post - and so is controlled by $RecursionLimit.
Jun
17
comment Why do Mathematica list indices start at 1?
Because the 0-th index is reserved for the head: lst = {1,2,3}; lst[[0]], which in this case is List.
Jun
17
comment Concatenated rule applications (applying rules to rules correctly)
Well, obviously the logic of defining rall[a_] as you did it, is flawed. You instruct the second and third rule to act on the first, instead of all rules to act on some expression - and that is what you get. Why not doing something like rall[a_] := Function[expr, expr /. r1[a] /. r2[a] /. r3[a]];, and then rall[a][a]?
Jun
17
comment Should I Remove the initial symbols of Module?
@DanielLichtblau Actually, when I remember it right, DownValues by themselves are not a problem, as long as that symbol is not referenced from the outside. So, this is Ok: Module[{f}, f[1] = 1;f[1]], while this leads to a leak for f: Module[{g}, Module[{f}, g[x_] := f[x]; f[1] = 1;];g[1]], even though g has been later collected. I mentioned this case here.
Jun
17
comment Extract all Values from nested Association
The question is unclear, and your examples of data don't improve that. Make a small self-contained example, with sample (small!) input and desired output, if you want a better chance to get good answers.
Jun
16
awarded  Guru
Jun
16
comment When does Mathematica automatically use dispatch tables for function evaluation?
In my experience, even millions of simple defintions didn't significantly slow down function dispatch mechanism. You may see something like a 30% slowdown if you move from say 100000 definitions to say 5000000 definitions. As far as I know, definitions not using patterns, are stored internally in a hash table. Definitions using patterns are stored differently, also using certain optimizations, AFAIK. Those optimizations might not scale as well with the number of definitions. Can you provide a self-contained example with working code? It is hard to tell from your description, what's going on.
Jun
14
awarded  Announcer