masterxilo
• Member for 8 years, 9 months
• Last seen more than a week ago
• Berne, Switzerland

I think all of these algorithms can be described in the following form: Assume your iterative numerical algorithm f takes and returns a pair {x, additionalState}. x is the quantity (tensor) that ...

Run SetOptions[$FrontEnd, PrintAction -> "PrintToConsole"] The setting will persist across restarts of Mathematica. View answer 3 votes It would be helpful if Mathematica could at least say that the error lies in the pdf version mismatch. Thanks @Jens. Here is another way to fix a pdf generated from pdflatex to be Importable in ... View answer 3 votes This can now be done with an InfiniteLine in Epilog or Prolog since version 10: Manipulate[ Plot[10^f*x^3, {x, -E/2, 1}, PlotRangePadding -> 0, Epilog -> InfiniteLine[{0.5, 0}, {0, 1}]], {{... View answer Accepted answer 16 votes For learning what I consider "just the wolfram/mathematica language" I would proceed as follows and start at the very low-level basics: Learn what is meant by a symbolic expression: ... View answer 2 votes You could do CArray[CString@"a", 0] // ToCCodeString giving "a"[0] maybe wrap it in CParentheses. Alternatively, just put it there verbatim (losing the type information): CAssign[a, "'a'"] // ... View answer 1 votes You can do this using the discrete laplacian computed on the mesh by transforming along the thusly computed mean curvature flow. This operation is often called called smoothing in Geometry Processing. ... View answer 1 votes For what it's worth, there also seems to be a way to integrate Mathematica into matlab (the other way around) using the "Mathematica Symbolic Toolbox for MATLAB--Version 2.0" http://ch.mathworks.com/... View answer 10 votes Graph being AtomQ has about the same implications as doing lots of overloadings of the type Part[_Graph,___] := Error[]; Replace[_Graph,___] := Error[]; .... It signifies that it is an "abstract data ... View answer 3 votes This is purely a formatting "issue": View answer 1 votes Inspired by Szabolcs answer and the discussion in the comments, here's another solution: EvaluateOwnValuesOnlyAndHold~SetAttributes~HoldAll EvaluateOwnValuesOnlyAndHold[expr_] := Hold[expr] /. ... View answer Accepted answer 2 votes This was fixed in 11.0.0. The output is all 0 now as expected. View answer 2 votes In my opinion, Optional should just consistently not match when the default value does not match the pattern, period. Now we have nonsense like this: {}~MatchQ~{Optional[0., 0]} False You might ... View answer 1 votes HeldOptional = Function[, HoldPattern@Optional[#1, #2], HoldRest] Remove[CurrentTime] CurrentTime[time_~HeldOptional~DateList[]] := {time, DateList[]}; Pause[1] CurrentTime[] c.f. How to write a ... View answer 1 votes This formats Associations in the usual way: ShallowAssociation[x_Association] := RawBoxes@(({s = Shallow@Normal@x}~With~MakeBoxes@s)~ Replace~(RowBox[{"{", val_, "}"}] :> RowBox@{"\... View answer 1 votes$r = Association["x" -> ConstantArray[0, {1000, 1000}]]; Shallow@($r /. Association -> Normal@*Association) performs well. View answer 0 votes Export["file.m", FullForm@HoldComplete[Format[$hello, StandardForm]], "String"] works, but all operators will be eliminated because of FullForm: FullForm@HoldComplete[Format[$hello, StandardForm]*2] ... View answer 10 votes The result of the front-end's parsing is definitely used, but it does not need to be complete, it seems. This can be seen by constructing Cells/Boxes manually. Try RawBoxes@RowBox[{"1", "+", RowBox[{... View answer 4 votes Let's ask FormulaData. These should suffice (there are not that many anyways :( ): Flatten@{FormulaData["TriangleAreaSSS"], FormulaData["TriangleAreaBH"]} // TeXForm (I started looking for something ... View answer Accepted answer 1 votes This numerical approach seems to work: Norm2[x_] := x.x; ConvertEquationsToLeastSquares[eqns : {__Equal}] := Norm2@Flatten[eqns //. { Equal[x_, y_, rest___] -> {Subtract[x, y], Equal[y, ... View answer 1 votes This works: ClearAll[DontEvaluateInOptional]; DontEvaluateInOptional~SetAttributes~HoldAllComplete; DontEvaluateInOptional /: (h: Except[Optional])[l___, HoldPattern@DontEvaluateInOptional[b___], ... View answer 0 votes This is not an answer as to why, wolfram-language-design wise, but to how: It seems Block[{x = new}, ...code...] effectively does the following: newValue = new; allValues = ... View answer 0 votes A VerificationTest with Outcome Error cannot be fixed by changing the expected-messages argument. This only applies to MessagesFailure Outcome (orange versus yellow cross, a bit hard to distinguish). ... View answer 3 votes I'm using this now: Unprotect@HoldForm; Format[HoldForm[x_], StandardForm] := {boxes = MakeBoxes@x, bg = LightBlue}~With~ RawBoxes@ InterpretationBox[ TagBox[StyleBox[boxes, ... View answer 3 votes Defining$AssertFunction might be a place to get started, but it is not ideal since when it gets called, the evaluation will have already happened. You will change the program behaviour if you ...

Go to Edit > Preferences > Messages and set Minor user interface warnings: to Ignore.

If I where to do this manually, I would start with PythonForm~SetAttributes~HoldAll (*known symbols*) PythonForm[Sin[x_]] := StringTemplate["math.sin(`)"]@PythonForm@x PythonForm[Times[a_, b_]] := ...

Probably, MathematicalFunctionData["ArcTanh"] knows about this. First let's see what categories of things are known: MathematicalFunctionData["ArcTanh", "Properties"] ah well, let's just list them ...