Mr.Wizard
Reputation
438/400 score
 8h comment Using patterns in pure functions Well the OP already knew about Slot and Function so, bluntly, I don't see the point of the first method. The Switch code however is a good example of the use of a pattern inside a pure function as requested, so +1 for that. 2d comment Using patterns in pure functions I personally prefer to avoid using both Map and Replace as both can take a levelspec as needed. I would instead use If[IntegerQ[#], # (# - 1), #] & /@ {1, 2, 3, x} if avoiding named patterns for some reason. 2d comment Error entering equation in DSolve I just noticed that technically this answer was incorrect. Evaluation of y'[x] is not the issue as one can see with HoldPattern[y'[x]] = "bad"; rather y'[x] parses as Derivative[1][y][x], as seen with HoldForm @ FullForm[y'[x]]. I am editing this answer accordingly. 2d comment How to Keep Input Cells Hidden After Evaluating Notebook @dahnoak To move the cursor to the cell insertion point after the output please try: AutoCollapse[] := (If[$FrontEnd =!=$Failed, SelectionMove[EvaluationNotebook[], All, GeneratedCell]; FrontEndTokenExecute["SelectionCloseUnselectedCells"]; SelectionMove[EvaluationNotebook[], After, Cell]; ]) Apr 30 comment How can a function without an operator form be used in postfix form? FYI: Select[EvenQ[#] &] may be replaced with Select[EvenQ] Apr 26 comment Join a list with {6, 6, 2} dimensions with a list {6, 6} dimensions Related: (3070), (4004), (11298), (13748), (17381), (18213), (54862) Apr 25 comment How to guarantee the point's position is fixed in the Graphics and Image These seem related in concept if not application: (18034), (73522), (83636) Apr 25 comment Matching All Functions linkhyrule5, I saw that this question was one vote from being closed by community votes. I chose to act to close it as a duplicate instead as I think this linking is more useful. I also posted lists to several related questions in a comment above; I encourage you to read them. If after this you feel that your question has been marginalized let me know. Apr 25 comment Matching All Functions Related: (1474), (3414), (4343), (59938) Apr 20 comment How can a function know in which function it was evaluated? @István I am not thinking very well as I first wrote that I did not recall a way, then I immediately thought to try Stack[_] and I think that works in this particular case? Second edit No, that doesn't work I am just fooling myself again. Sorry, I think you better ask someone else today. :-p Apr 14 comment PlotRange adjustments with BarChart @Art Thanks, I'll fix that now. Apr 14 comment How to match sum of two or more objects? If anyone has a suggestion for a better duplicate please comment or flag. Apr 14 comment How to match sum of two or more objects? Plus on the left-hand-side of the rule evaluates, which changes your pattern. Try obj[a] + obj[b] /. Verbatim[Plus][A : Repeated[_obj, {2, Infinity}]] :> Hold[A] instead. This question is a duplicate and I shall mark it as such in a minute. Apr 9 comment A locator that is visible only when it is used oops, I see that my "deeper probing" was only to duplicate the method you started with. I perhaps do not understand the question; are you more interested in a pragmatic solution or the explanation for the need of UpdateInterval? Apr 9 comment How to set similar constraints on multiple variables in Solve @Jens Do you know in which version that first worked? It does in 10.1 but not in 7.0. Apr 6 comment Why differential equation reduces? Correct. I have marked this question as a duplicate as I feel that it may be useful this way. If you object I can revert the change and closed as "a simple mistake" (as it was previously) it will be deleted in time. Mar 27 comment How to Override the Head of a Symbol Comments are not for extended discussion; this conversation has been moved to chat. Mar 26 comment Trial version Mathematica 10.4 corrupts previous versions That is weird, and really annoying. I hope you get this sorted out quickly. Possibly the installer deleted or overwrote your existing licensing files. Maybe you have a back-up? Do the earlier versions give you the menu option to Enter Activation Key? What happens when you try that if they do? Mar 19 comment Why Unevaluated doesn't work on unheld side of Rule/RuleDelayed? Duplicate question on Stack Overflow: (6267143) Mar 18 comment Ways to protect certain parts of expressions @Adam I was not able to reproduce that problem (v10.1.0 under Windows 7) but I think it may be caused by my use of Format instead of MakeBoxes, out of laziness. See (4119830).