Reputation
70,840
Next tag badge:
565/400 score
73/80 answers
Badges
5 172 391
Newest
 Good Answer
Impact
~819k people reached

Apr
21
revised Exchange variable value between Mathematica and Autohotkey script
edited tags
Apr
20
awarded  Nice Answer
Apr
19
comment Assignments in ParallelDo when using indexed variables
@VladimirMatveev If you like, treat it as goto . When people ask about doing such things on this site, in the majority of cases it turns out to be a bad idea. It doesn't mean that there's no room for SetSharedFunction and it's always a bad idea.
Apr
19
comment Assignments in ParallelDo when using indexed variables
@VladimirMatveev It's up to you to find out. If there isn't in this case, there might be any time you use zeros (after SetSharedFunction) in a different parallel computation. In general it is a good idea to avoid modifying the same variable from different kernels in Mathematica. If you need to assign to zeros, you can do it after you've returned a result from a parallel computation, and avoid ever setting zeros as shared.
Apr
19
answered Assignments in ParallelDo when using indexed variables
Apr
19
comment Assignments in ParallelDo when using indexed variables
longComputation(n) is not correct Mathematica syntax for a function call. In this case you would need SetSharedFunction as you are dealing with DownValues. However, the communication overhead you introduce with this is likely going to negate any benefits or parallelization. Try to write parallel code that never requires write access to the same variable from different threads. Reformulate your problm in terms of ParallelMap or ParallelTable.
Apr
19
revised Syntax highlighter shows error for Manipulate when it's inside a Block or a Module
added 1 character in body
Apr
19
answered Module and Manipulate: Why the Red Highlighting?
Apr
19
revised Alternatives to Mathematica
added 2 characters in body
Apr
19
comment Sequence evaluation in an If statement
The SequenceHold attribute needs to be assigned to the head that contains the Sequence[]. Here SetAttributes[seq, SequenceHold]; is not needed. Your example will work the same without it, seq = Sequence is sufficient. The evaluator will only flatten out a literal Sequence[] in If before evaluating the If. seq[] is not Sequence[] so it won't be flattened out before If is evaluated. Once If is evaluated, it yields seq[], which then is evaluated to Sequence[] which is then flattened out inside the {...}.
Apr
19
answered Sequence evaluation in an If statement
Apr
19
awarded  Necromancer
Apr
17
comment Can I redefine the ++ increment operator to make it behave like Haskell
No, it's not possible because ++ is a prefix or postfix operator. You can't use it as infix. Even if it were possible, due to how the language works, it would very likely break internal code. So trying to do this is generally a bad idea.
Apr
17
comment Finding a formula for a 3D shape and colouring it
Did you already look up Polygon in the documentation? You already have the lines, now using the same coordinates include the polygons as faces.
Apr
17
comment Finding a formula for a 3D shape and colouring it
I did say what would be better: use Polygons.
Apr
17
comment Finding a formula for a 3D shape and colouring it
Instead of parametric equations I would use Polygon to create non-transparent faces. What is your goal? Why do you think ParametricPlot3D is better?
Apr
17
comment Is there a way to change the indentation behavior of the postfix operator //?
The last one is not possible because x on a line by itself is already a complete expression. x// is not a complete expression, so Mathematica will keep reading more from the next time. Similarly, x, newline, +y is two different expressions and not equivalent to x+, newline, y, i.e. x+y. If a line ends with a backslash, Mathematica will keep reading on the next line, but make sure no spaces follow the backslash. This is just a comment, I don't know the answer to your main question. You can use Code cells which don't indent at all but I don't think that's what you want.
Apr
17
comment How to synchronize the display of dynamic objects?
Moving the Dynamic outside does indeed work. I really wonder why this makes such a difference.
Apr
17
comment Constant orientation of graphics in Graphics3D
Does this help?
Apr
17
comment Saving a source file adds (* ::Package:: *) to the first line
Not only does it add that line, it also mangles all non-ASCII characters. If you have e.g. (* :Author: Pál *), it'll change to (* :Author: P[\AAcute]l *), which is very annoying. For these reasons I try to avoid using the front end to edit .m files.