21,658 reputation
24697
bio website
location
age
visits member for 3 years
seen 5 hours ago

Frequently Asked Questions

WReach? Is that connected to WRI somehow?

The "WR" in my name has nothing to do with the company that develops Mathematica. It is just a coincidence.

Why do you start all your global variable names with $?

I use dollar signs for ad hoc global variables because I have been bitten too many times by accidentally assigning an own-value to a symbol that I happen to use, for example, in a symbolic equation. So I am in the habit of writing $x instead of x. I stick to that convention even for longer symbols like $initialUrl. Just like the regular symbol convention, Mathematica's predefined global symbols all start with a capital letter after the $. My ad hoc symbols always start with a lower case letter, so there is no conflict.

Why do you put semicolons and commas at the beginning of the line instead of at the end like a normal person?

I don't think of it that way. Rather, I switch from horizontal to vertical layout when a single expression is too long to fit on one line. This has the interesting side-effect of making the important delimiters stand out and line up. I first ran into this practice in the SQL community. SQL "programs" have the unpleasant property that they must be written as a single statement -- even if that statement is a hundred lines long (or more!). Sometimes Mathematica expressions share that property.


Jan
11
revised Rearranging a Dataset
added the Edit section with another way
Jan
11
comment Transform a table (list of associations) to a flat association
+1. For the second question... if we are given ds = Dataset @ as, then we can use ds[Merge[Identity]].
Jan
9
answered GroupBy several keys while keeping the Dataset as a Table (List of Associations)
Jan
9
awarded  Necromancer
Jan
9
revised SQL-like computation on Dataset: Aggregate function
added the second update about `Group@Key@"A"` versus `Group["A"]`
Jan
9
comment SQL-like computation on Dataset: Aggregate function
@GordonCoale Well spotted. Technically you are correct, but a bug in 10.0.1 causes the query to fail unless Key is explicitly present. The bug is fixed in 10.0.2. I left Key in place just in case. I'll add a note to that effect to the response.
Jan
8
comment Evaluate specific cells in Mathematica
+1. When I tried it in V10.0.2 (Win 7/64) it worked perfectly, evaluating all (and only) tagged cells. NotebookEvaluate is defined to return only the value from the last evaluation, so it is hard to see the failure from just the screenshot since none of the cells have visible side-effects. Does it fail if the evaluated cells contain Print expressions, or the InsertResults -> True option is included?
Jan
8
comment Evaluate specific cells in Mathematica
I can reproduce the problem in V9.0.1 on Win7/64. It evaluates all elements in the notebook, ignoring the EvaluationElements. If the NotebookEvaluate expression is in the target notebook, it loops indefinitely. In V10.0.2 it works properly, even from within the same notebook.
Jan
8
revised SQL-like computation on Dataset: Aggregate function
grammar
Jan
8
answered SQL-like computation on Dataset: Aggregate function
Jan
7
revised What are all the named Mathematica styles?
added the expression needed to autoload this functionality
Jan
7
answered What are all the named Mathematica styles?
Jan
7
awarded  programming
Jan
7
comment Select query with named slot lookups?
@alancalvitti If I run your query against the exhibited input data, I get the same result as my query: the single entry for 00:12:27.9. That is correct since it is the only one between 00:12:15 and 00:38:49. Perhaps your screenshot was taken after using different data?
Jan
6
awarded  Good Answer
Jan
6
comment Select query with named slot lookups?
@alancalvitti Ah yes, my misunderstanding. Does my update help?
Jan
6
revised Select query with named slot lookups?
added the update in response to @alancalvitti's comment
Jan
6
answered Interactively inspecting parts of an object
Jan
6
revised Select query with named slot lookups?
missing word
Jan
6
answered Select query with named slot lookups?