Reputation
25,023
Next tag badge:
195/100 score
17/20 answers
Badges
2 52 110
Newest
 Nice Answer
Impact
~123k people reached

Apr
20
comment What are the use cases for different scoping constructs?
@episanty The brackets are not strictly necessary but, following common convention, their presence gives the reader a clue that f is a potentially non-determinstic computation rather than a simple value.
Apr
18
comment DateObject for current date skips a day when crossing the date line with TimeZone
I get similar results for V10.1.0 Win7x64. At time of writing, DateObject[] returns Fri 17 Apr 2015 23:09:51 GMT-6 but DateObject[TimeZone->0] returns Sun 19 Apr 2015 05:09:51 GMT (the wrong day). By contrast, DateList[TimeZone->0] returns {2015, 4, 18, 5, 9, 51.2342} with the correct day.
Apr
16
comment Is Sow/Reap compatible with Composition?
I've only just now realized that this behaviour in Composition is discussed at length in (54762).
Apr
13
comment How to Fold over lazy lists and over tasks, just as with Lists?
Rumor has it that we might see official support for lazy lists soon. Also related: (838).
Mar
24
comment Why can I not replace a Dataset using a rule?
@Szabolcs Good catch. Fixed.
Mar
18
comment Time Zone Conversion
I enjoy your clever titles, but might I suggest that you include some indication of the subject matter, perhaps something like Time Zone Conversion: A Theory of Non-Relativity?
Mar
4
comment Fill Dataset value with result of queries on other Datasets
@alancalvitti I am using 10.0.2. In my first alternative I get an invalid result (with Missing elements) if I use KeySort. The query plans are different, reflecting the fact that KeySort is ascending and KeySortBy is descending. In my second alternative, it does not matter whether the operator is ascending or descending, so I just use the shorter-named ascending KeySort.
Feb
24
comment Can someone explain this snippet: (#[#] &)[#[#][#] &]
@MartinJohnHadley I added the phrase "infix operator for function definition", along with a link to the documentation page.
Feb
19
comment Change Values in Dataset under Condition
The workaround should only take effect if there is an explicit reference to noTypes. Do you have a counterexample? In any event, ClearAll[noTypes] will remove the definition. Also, restarting your session will clear it unless you have added to your init.m.
Feb
19
comment Context of localised (dynamic) symbols
@Kuba Thanks for that link -- I had not seen that question. I have added a reference to it at the part in which I said "I dunno what $CellContext does". I'm not sure that I can add to the discussion to be found at that question.
Feb
19
comment Context of localised (dynamic) symbols
@Kuba I don't know of any section in the documentation that pulls all of the recommendations together. There a bits and pieces scattered about in the sections about variables, packages, and the internals of Mathematica. I can also recall some rather lengthy essays and presentations by Stephen Wolfram on the subject. So I guess my so-called recommendations are actually just me trying to summarize my understanding of de facto established practice.
Feb
19
comment Context of localised (dynamic) symbols
@halirutan I took a crack at describing the DynamicModule behaviour. Now I need to lie down :)
Feb
18
comment Context of localised (dynamic) symbols
I realize that there is still more to be said about the double-evaluation and double-scoping of DynamicModule, but I've run out of time to extend this post at the moment :) I figured that I would post it anyway since it is too long for comments.
Feb
18
comment Windows command line arguments, stdin & stdout
Thanks for the bounty :)
Feb
18
comment How to search Dataset to find all keys share same Value
I think that it is application-dependent whether any given association can have two keys with the same value. If not, then your technique presents a valuable optimization. Otherwise, more elaborate measures are needed. Only the OP knows for sure. Ideally, any facility provided by WRI would allow an explicit choice in this matter. In the absence of choice, I think they would be forced to support the more general case (possible duplicates). [I'm pinging @Leonid in case he didn't see your comment.]
Feb
17
comment Windows command line arguments, stdin & stdout
_.cmd accepts any number of arguments -- but mmascript.m only looks at argument #5 (just like test.m). To illustrate what I meant by my comment, I have changed the mmascript.m script to evaluate and print all user-supplied arguments.
Feb
17
comment How to search Dataset to find all keys share same Value
+1, but beware that the simplified version assumes that the right-hand sides of the original rules are all unique (e.g. try it for ds = Dataset@{<|a -> 6, b -> 6|>}).
Feb
17
comment How to search Dataset to find all keys share same Value
@Mr.Wizard Position remains my favourite solution among the answers so far. I added this variant because it closely conforms to the pipeline-style of expression that is encouraged by the Query syntax, and that one finds in "real" query-based databases. I am hoping that some day Query will grow up to be such a "real" engine and then these pipeline forms will become important. Incidentally, I usually find that for maximum performance in the present version, the first thing to do is to get the data out of Dataset and to then apply "normal" operators :)
Feb
16
comment Windows command line arguments, stdin & stdout
@William It accepts only one argument because I was following the lead of test.m. There is no essential obstacle to adjusting the Mathematica script to accept as many arguments as you like, and to evaluate them or not evaluate them as suits the application.
Feb
16
comment Windows command line arguments, stdin & stdout
@William I have added a section detailing the use of a cmd file to emulate the CYGWIN example in your response. Hopefully this version will get you closer to your goal. I have left out the pesky details concerning error handling, escaping, etc. The offer of a bounty is appreciated, but not necessary.