Reputation
Next tag badge:
115/100 score
19/20 answers
Badges
5 168 385
Newest
 Necromancer
Impact
~783k people reached

32m
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.
34m
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.
44m
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.
10h
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 {...}.
2d
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.
2d
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.
2d
comment Finding a formula for a 3D shape and colouring it
I did say what would be better: use Polygons.
2d
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?
2d
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.
2d
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.
2d
comment Constant orientation of graphics in Graphics3D
Does this help?
2d
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.
Apr
16
comment Converting a sum into $\Sigma$ notation
Can you give more examples and explain in more detail what sorts of input expressions are possible?
Apr
16
comment SystemModeler join wires
@OleksandrR. Personally I wasn't in favour, but I thought the community decision was that it should be on topic. OP: It is true that few people here have SystemModeler expertise and you'll likely get a faster answer on W Community.
Apr
15
comment MaTeX for Mathematica 9
@Tom Maybe you shouldn't accept my answer. Someone might start working on this and post a more complete answer.
Apr
15
comment Checking if a symbolic matrix is positive semi-definite
"I am therefore interested in an implementation that allows for assumptions." <-- I would recommend rewriting your question, including this bit of information I found, and asking specifically about such an implementation. I deleted my answer to give room for new ones. For reference, my answer pointed at the documentation of PositiveDefiniteMatrixQ, Examples -> Scope.
Apr
15
comment Transfer graphics from Mathematica to Word without loss of quality
I tagged this with windows because the solutions are OS specific and the OP seems to use Windows. On Windows Mathematica uses the EMF format for copying vector graphics to the clipboard. On OS X it uses PDF. There's a very significant difference in quality.
Apr
15
comment Iterator variable not blocked in ParametricPlot
@ShutaoTang Unfortunately I cannot make it compatible with M9. It would be too much work, and in particular it would increase the long-term maintenance burden (I get lots of support requests already). If you are willing to try to get a stripped down version work on your own computer only, check here: mathematica.stackexchange.com/a/79979/12
Apr
15
comment Mathematica: issues storing nested list on disk
If your aim is to re-import into Mathematica, use a format that can store arbitrary Mathematica expressions. This includes the "WDX", "Package" and "MX" Export formats. Some prefer using Compress and exporting the result as a "String". Note that "MX" is not cross-version-compatible and not cross platform before v10.
Apr
14
comment How can I export a notebook into multimarkdown?
There's a duplicate for this somewhere which you might want to try to find. The title might mention posting to SE from Mma directly instead of markdown. Sorry, I don't have time to find it now.