19,223 reputation
14286
bio website
location
age
visits member for 2 years, 10 months
seen 6 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.


16h
answered Finding out all undocumented values for “Properties” in XxxData[] functions
1d
answered DateListLogLogPlot
1d
comment Camel hump string split
@alancalvitti See the new section concerning digit characters. I'm afraid that the Mathematica symbolic string pattern syntax does not yet fully support all of the functionality in PCRE regular expressions. I agree that they are so cryptic as to be "write only".
1d
revised Camel hump string split
added the section that includes digits as "hump" characters
2d
comment Camel hump string split
Alas, the two dots are not quite enough for the abbreviations. Notice how "AASTriangle" is not split up. It doesn't detract from a good answer, though.
Nov
20
revised Camel hump string split
added a variant that keeps abbreviations together
Nov
20
answered Camel hump string split
Nov
19
comment Installing LinkSnooper on Windows
@FredSimons You say that you are on 32-bit Windows, but the LinkSnooper command you show references the 64-bit Java directory Windows-x86-64. Does it work if you change that to the 32-bit directory Windows instead?
Nov
19
answered What does it mean: “Assuming a matrix | Use a list of lists instead”?
Nov
17
comment String pattern defined by number of characters
I have added the section about recursive patterns.
Nov
17
revised String pattern defined by number of characters
added the section about recursive patterns
Nov
17
comment String pattern defined by number of characters
@Aisamu There is no direct equivalent in Mathematica's native string pattern syntax. It is probably possible to achieve a similar result using StringCases[s, $patt] where $patt is self-referential. The following pattern comes close, but it fails to preserve proper backtracking: $patt = "b" | "c" | ("a" ~~ (s___ /; StringMatchQ[s, $patt]) ~~ "d"). Even if it worked, it entails an evaluator callback from the PCRE engine for every potential match -- probably more trouble than it is worth.
Nov
17
revised String pattern defined by number of characters
added 59 characters in body
Nov
17
answered String pattern defined by number of characters
Nov
17
answered GroupBy and MaximalBy to create a new Dataset
Nov
17
answered How to get data from DB into dataset with keys
Nov
11
answered How to write Mma notebook input that modifies itself?
Nov
11
comment Pattern matching: Times[a_] vs Times[a__]
@ShutaoTang The Internal package is undocumented, and we use its features at our own risk since it carries no guarantees and could be withdrawn at any time. As the name implies, it is used internally by the Mathematica implementation. There is no official documentation on this package, but this forum is rapidly becoming the repository for the collective findings of the community -- whether about Internal or many of the other undocumented features. And even the documented ones too :)
Nov
11
comment Select last occurence of key in dataset
@Lea As to the dollar sign in $dataset, see the second FAQ in my profile.
Nov
11
revised Select last occurence of key in dataset
added sample data in copy-and-paste form