Reputation
7,339
Next privilege 10,000 Rep.
Access moderator tools
Badges
14 51
Impact
~65k people reached

2d
comment List of dangerous functions
See also the package located at FileNameJoin@{$InstallationDirectory, "AddOns", "Applications", "Security"}
2d
comment How can I evaluate untrusted Mathematica code in a sandbox?
The package located at FileNameJoin@{$InstallationDirectory, "AddOns", "Applications", "Security"} may be of interest (@Szabolcs).
Jul
15
accepted How to sort the ranges of a Piecewise expression?
Jul
15
comment Association's Key[key] extraction different in V10.1/V10.2
Note that the rule inside the association here evaluates, as does the a in the "argument" of the association. a = 42; assoc = <|a -> 2|>; assoc[a] == assoc[42] gives True. Compare with assoc2 = <|Unevaluated[a -> 3]|> ; assoc2[[Unevaluated@Key@a]] =!= assoc2[a]
Jul
14
comment How to sort the ranges of a Piecewise expression?
@MarcoB I suppose it is mostly for aesthetic reasons, i.e. to be able to see how to function works quickly. I suppose this could also eliminate some unnecessary testing in the evaluation of the expression though.
Jul
14
comment How to sort the ranges of a Piecewise expression?
Great! I bet this works for any Piecewise expression that has been sanitized by PiecewiseExpand. It even deals with cases of the form x==num, which I didn't bother to ask.
Jul
14
revised How to sort the ranges of a Piecewise expression?
Neater
Jul
14
comment How to sort the ranges of a Piecewise expression?
@ShutaoTang that is certainly a good start. However, it is not perfect. Note that the case True still corresponds to the specification -6<=x<=-2.
Jul
14
comment How to sort the ranges of a Piecewise expression?
@Guesswhoitis. I get Internal`PiecewiseOrderless@qq == PiecewiseExpand@qq -> True. (StringSplit[#, "`"] & /@ Names["*`*Piecewise*"])[[All, -1]] // Column is interesting.
Jul
14
revised How to sort the ranges of a Piecewise expression?
Bottom to top
Jul
14
asked How to sort the ranges of a Piecewise expression?
Jul
5
comment Generating visually pleasing circle packs
@goulding I have seen javascript snippets on this site before a few times, and generally such a comparison is appreciated. I downloaded your files, but simply opening index.html in a browser did not display anything for me. I changed the path js/main.js to circlePackShape.js but that didnt work. Maybe this is really basic stuff, but still it would be nice for our users if you could make it easier to run for a js novice. If you don't want to put a readme on the github because you also have other audiences in mind, perhaps you can post an answer here. <temporary message>
Jul
3
comment Count the sequences in an array
I hope I didn't mislead you with my "totally readable" comment. It was meant as a joke, because the solution is so unconventional. I hope it was a nice puzzle :). I think the reason why it is faster than the Fold solution is quite subtle, but still it makes some sense to me. +1, especially for the Compile solution.
Jul
3
revised Count the sequences in an array
added 3 characters in body
Jul
3
revised Count the sequences in an array
Optimization
Jul
3
answered Count the sequences in an array
Jun
24
awarded  Nice Question
Jun
23
comment Held keys in associations
@Mr.Wizard you're welcome :)
Jun
19
comment Why do Mathematica list indices start at 1?
From wikipedia we get the following: "Under zero-based numbering, the initial element is sometimes termed the zeroth element" and "In a zero-based indexing scheme, the first element is "element number zero"". I wonder how consistent programmers that use zero-based indexing are with respect to this kind of language.
Jun
15
comment What are the most common pitfalls awaiting new users?
StringMatchQ also treats certain characters as special, see the details and options section of the documentation of StringMatchQ.