Reputation
64,678
Next tag badge:
207/100 score
19/20 answers
Badges
6 194 284
Newest
 Guru
Impact
~405k people reached

Mar
24
revised Why can I not replace a Dataset using a rule?
Added a note why this method might be better
Mar
24
comment Why can I not replace a Dataset using a rule?
+1. Apparently, more complex solutions are always late.
Mar
24
answered Why can I not replace a Dataset using a rule?
Mar
24
revised How to find out where an error occurs?
Generalized the functionality of debug
Mar
24
answered How to find out where an error occurs?
Mar
24
comment How to find out where an error occurs?
I wrote a function, debug, which implements some of the suggestions given to you in comments. You can try using it, it has been one of the best debugging tools for me. I have also included it in RLink, so you can call Needs["RLink`"], and then call RLink`Developer`debug[your-code].
Mar
24
answered Count elements between matching opening and closing parentheses?
Mar
22
comment Dynamic arrays and lists with compile (Append, Linked lists etc.)
There is also this question
Mar
22
comment Match opening and closing parentheses?
Not to diminish this answer (I upvoted it), but just for future visitors who might not know it: this one will in general have a quadratic complexity in the size of the list with parentheses (which was the main reason I discarded this version myself, when answering).
Mar
21
comment How to convert a notebook to an association and back?
@rcollyer I'd agree with this. The problem of denormalization is more important either when this leads to excessive memory usage (less important issue), or when the database is writeable and the data may become corrupted if it exists in several places and goes out of sync. For read-only databases this is much less critical.
Mar
20
comment Dataset: sort rows in descending order of first column
dataset[SortBy[-#a &]].
Mar
20
answered Match opening and closing parentheses?
Mar
20
comment Resource management in Mathematica
Somehow I missed this answer, and only discovered it by accident when looking at the old SO question on this, and seeing your more recent comment there. I've been using your CleanUp function from that old post extensively, but this seems a better alternative. Big +1.
Mar
19
comment Does Mathematica support out-of-core Associations?
It does not yet, but the support for it mau be added in the future (I am not speaking in any official capacity here, so this is just a guess).
Mar
19
comment Does Mathematica support an unordered set (e.g. hashset) data structure?
I think that for all practical purposes, you can consider Association to have O(1) complexity for all those operations. The point is that, implementing on the top-level any such structure would lead to constant factors far greater that log n for any sensible size of the set. You can also try System`Utilities`HashTable, described in e.g. this answer.
Mar
15
awarded  Nice Answer
Mar
15
comment Why do functions defined with SetDelayed and Function behave differently in callbacks?
Some more information on strong types in Mathematica is in this discussion. An interesting discussion of differences between Mathematica and traditional languages (the high-level view on them) is inside this answer.
Mar
15
comment Why do functions defined with SetDelayed and Function behave differently in callbacks?
@ibeatty [2/2] ... pass f[1,2] as a function. There may be other similar constructs. I seem to remember some discussions about checks for functions, but I can't find them now. The other way would be to use an inert wrapper, e.g. Fun[...], and then place inside this wrapper the function. So then, your definition would look like g[Fun[ff_],y_]:=..., and the caller is responsible for wrapping a function in Fun when passing arguments to g. This, of course, does not prevent the caller from passing a wrong thing inside Fun, but at least it will probably rule out accidental mistakes.
Mar
15
comment Why do functions defined with SetDelayed and Function behave differently in callbacks?
@ibeatty [1/2] I am not aware of a fully robust way to differentiate between functions and other things in Mathematica. Partly this is because for the core evaluator, what we consider functions are no different from other expressions. In other languages, calling a function which evaluator knows nothing about, is an error. In Mathematica, it is not, and the call (expression) is simply returned back. One way I was using before was to use the pattern _Symbol | _Function, but this isn't robust either. For example, people may define SubValues of the form f[a_,b_][x_,y_]:=a+b+x+y, and then ...
Mar
14
comment Why do functions defined with SetDelayed and Function behave differently in callbacks?
@Pickett Re: retracted close vote - thanks. Re: answer - done.