## Chapter 6Year 2015

### 6.1 Tuesday, December 29, 2015

==================================
Top new questions this week:
==================================

[$$\sum _{k=1}^{\infty } \left \lfloor \frac {5}{5^k}\right \rfloor$$ giving wrong answer?] http://mathematica.stackexchange.com/questions/102722/sum-k-1-infty-left-lfloor-frac55k-right-rfloor-giving-wrong-ans

When I try to evaluate the following: using

Sum[Floor[5/5^k], {k, 1, $Infinity]}] Mathematica provides an answer of $$0$$ when it ... - asked by 1110101001 (14 votes), answered by ttetrafon (-4 votes) —————————- [How do I insert a calculated value into a text cell?] http://mathematica.stackexchange.com/questions/102849/how-do-i-insert-a-calculated-value-into-a-text-cell Suppose in a notebook I’ve calculated the value of some expression and assigned it to a variable. How do I insert the value of that variable in a text cell without just typing in the value? That is, I ... - asked by Robert B (10 votes), answered by eldo (3 votes) —————————- [Prevent Plus from threading] http://mathematica.stackexchange.com/questions/102721/prevent-plus-from-threading This is probably a very simple question, but I couldn’t ﬁnd a duplicate. As everybody knows, x, y + v gives x + v, y + v. But if I intend v to represent a vector, for example if I am going to ... - asked by Rahul (10 votes), answered by JHM (5 votes) —————————- [What kind of patterns in a list of rules would beneﬁt from being Dispatched?] http://mathematica.stackexchange.com/questions/102873/what-kind-of-patterns-in-a-list-of-rules-would-benefit-from-being-dispatched I have a long list of rules for manipulating expressions. They are of the form: complexRules = {f[x_, y_]^2 :&gt; (*something*), f[x_, y_] f[x_, z_] :&gt; (*something*), ... - asked by QuantumDot (9 votes), answered by Schopenhauer (7 votes) —————————- [Revolution of Koch Snowﬂake] http://mathematica.stackexchange.com/questions/102697/revolution-of-koch-snowflake How to plot shape which made from revolution of the Koch Snowﬂake? I try to use $$RevolutionPlot3D[f,\lbrace {t,t_1} \rbrace ]$$, but I think there is no $$f$$ for Koch Snowﬂake. Sorry for my ... - asked by vito (9 votes), answered by ubpdqn (11 votes) —————————- [Reverse Polish Notation] http://mathematica.stackexchange.com/questions/102976/reverse-polish-notation Is there a way to evaluate a string containing RPN in Mathematica? SE thinks this question is too short, so let me expand on it. Do you know of any function, that provides the following ... - asked by murphy (8 votes), answered by Mark Adler (4 votes) —————————- [Bug? Completely wrong results from NSolve] http://mathematica.stackexchange.com/questions/102724/bug-completely-wrong-results-from-nsolve The following code creates two polynomials $$q_1$$ and $$q_2$$ in variables $$c$$ and $$p$$, then uses NSolve to ﬁnd roots. But the polynomials don’t evaluate to zero at those roots. pp[n_] := If[n &gt; 0, ... - asked by Jerry Guern (8 votes), answered by Rom38 (6 votes) ================================== Greatest hits from previous weeks: ================================== [Advice for Mathematica as Mathematician’s Aid] http://mathematica.stackexchange.com/questions/92686/advice-for-mathematica-as-mathematicians-aid I use Mathematica mainly as an aid in symbolic attacks on problems, usually intermediate or harder and often number theoretic. While Reduce, Simplify, et al. are remarkably powerful, they of course ... - asked by CarlEdman (55 votes), answered by MarcoB (39 votes) —————————- [Where can I ﬁnd examples of good Mathematica programming practice?] http://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ... - asked by J. M. (386 votes), answered by faysou (354 votes) ================================== Can you answer these? ================================== [CDF Enterprise : Protection and licensing] http://mathematica.stackexchange.com/questions/102650/cdf-enterprise-protection-and-licensing I am new to Mathematica but on top of that I am asked to create a CDF ﬁle that is IP protected (encrypted) and also licensed. In this video they are giving the way to protect the code. At the end ... - asked by Erdem (3 votes) —————————- [Speedup ListCorrelation when using generalized correlation function] http://mathematica.stackexchange.com/questions/102708/speedup-listcorrelation-when-using-generalized-correlation-function ImageCorrelation provides several general function that can be used to replace the default Dot function. For example, in the documentation of ImageCorrelation, there is an example using CosineDistance ... - asked by xslittlegrass (1 vote) —————————- [How can I deﬁne geographic regions and new entities?] http://mathematica.stackexchange.com/questions/102948/how-can-i-define-geographic-regions-and-new-entities There are three functions (GeoListPlot, GeoGraphics and Entity) related to working with geographic regions but it is not clear from the documentation how to create new Entities or custom geographic ... - asked by Tyler Durden (4 votes) ### 6.2 Tuesday, December 22, 2015 ================================== Top new questions this week: ================================== [How to organically build up nested associations?] http://mathematica.stackexchange.com/questions/102466/how-to-organically-build-up-nested-associations Suppose I want to construct an association of associations, such as a list of people with attributes: peopleFacts=&lt;| alice-&gt; &lt;|age-&gt;29,shoeSize-&gt;7|&gt;, bob-&gt; ... - asked by Jess Riedel (17 votes), answered by Kuba (14 votes) —————————- [How to restart computation when kernels die?] http://mathematica.stackexchange.com/questions/102268/how-to-restart-computation-when-kernels-die When an important process needs to be kept alive, there are monitoring tools to restart them if they die (e.g. god tasks in ruby), in my case I have an overnight scraping task that I need to have done ... - asked by M.R. (15 votes), answered by Szabolcs (11 votes) —————————- [If I have a very large Popup Menu list how can I make that searchable?] http://mathematica.stackexchange.com/questions/102470/if-i-have-a-very-large-popup-menu-list-how-can-i-make-that-searchable Imagine that you have a PopupMenu’s list that requires a lot of scrolling through the selections. Is there a way to create a control that will only display a subsection of the complete list? - asked by Mike Honeychurch (14 votes), answered by Mike Honeychurch (14 votes) —————————- [Bug in RegionMember?] http://mathematica.stackexchange.com/questions/102439/bug-in-regionmember RegionMember (new in V10) appears to have a bug. For some polygons it ﬁnds points that are clearly outside to be ”members” of the region. This depends on the shape of the polygon in a way that is ... - asked by kukako-muka (14 votes) —————————- [Which elements of a large array are part of a set?] http://mathematica.stackexchange.com/questions/102212/which-elements-of-a-large-array-are-part-of-a-set I have a large integer packed array arr. My array is multidimensional, but for simplicity let’s consider 1D arrays for now. ArrayReshape takes care of the rest. I also have a set of integers (a ... - asked by Szabolcs (14 votes), answered by Leonid Shifrin (11 votes) —————————- [more numerically accurate inverse matrix] http://mathematica.stackexchange.com/questions/102261/more-numerically-accurate-inverse-matrix I encountered the following matrix mat = {{2, 2.161209223472559 + 1.682941969615793 I}, {2.161209223472559 - 1.682941969615793 I, 2}} and Inverse[mat] will give {{-0.57092 - ... - asked by matheorem (12 votes), answered by Karsten 7. (11 votes) —————————- [Stress calculations using ﬁnite elements] http://mathematica.stackexchange.com/questions/102522/stress-calculations-using-finite-elements A standard engineering problem is to calculate stresses in a structure due to applied forces. With the inclusion of the ﬁnite element method in version 10 this question attempts to investigate how ... - asked by Hugh (11 votes), answered by user21 (2 votes) ================================== Greatest hits from previous weeks: ================================== [Upgrade to Windows 10] http://mathematica.stackexchange.com/questions/89407/upgrade-to-windows-10 Can users of Mathematica on Windows 7 or Windows 8/8.1 upgrade their computers to Windows 10 – a process that began today? Does Mathematica work? Are all the settings, licenses, access to ﬁles and ... - asked by Lubos Motl (38 votes), answered by RunnyKine (32 votes) —————————- [How can I improve Mathematica’s resolution on a macbook retina display?] http://mathematica.stackexchange.com/questions/18419/how-can-i-improve-mathematicas-resolution-on-a-macbook-retina-display Mathematica 9.0 looks a bit fuzzy on the retina screen, how can I increase the resolution? Here another screenshot showing a direct comparison between the browser and Mathematica - asked by Tom Wellington (39 votes), answered by programming_historian (20 votes) ================================== Can you answer these? ================================== [How to avoid crashing with ConformImages?] http://mathematica.stackexchange.com/questions/102578/how-to-avoid-crashing-with-conformimages ConformImages[] is causing a kernel crash when applied to a list of 5k images. Is there any way to apply ConformImages on the list in batches or asynchronously to conserve memory? Here’s the ... - asked by M.R. (2 votes) —————————- [Fitting real and imaginary parts of a function] http://mathematica.stackexchange.com/questions/102233/fitting-real-and-imaginary-parts-of-a-function I have an analytic form of a function G[w_] = -I*z0*w/(1 + I*z0*w*a) I know this function can be obtained (up to some overall normalization) from solving a diﬀerential equation numerically for ... - asked by Physics Moron (3 votes) —————————- [Reconstruct a ‘Graph‘ from a picture] http://mathematica.stackexchange.com/questions/102362/reconstruct-a-graph-from-a-picture Actually,I post a very similar question before this.How to generate a Graph from a picture of a graph The Dr. belisarius’s answer have accomplished it.But I ﬁnd a limitation in that method:If the ... - asked by yode (6 votes) ### 6.3 Tuesday, December 15, 2015 ================================== Top new questions this week: ================================== [How can I use Kenneth Moreland’s ”Diverging Color Maps for Scientiﬁc Visualization” in plots?] http://mathematica.stackexchange.com/questions/101625/how-can-i-use-kenneth-morelands-diverging-color-maps-for-scientific-visualizat I often want to plot two dimensional data that is centered around zero (for me, this is usually a 2D optical spectroscopy signal, but there are other cases), and the MATLAB ”Jet” color scheme is ... - asked by Jason B (21 votes), answered by Jason B (25 votes) —————————- [Named patterns in Except] http://mathematica.stackexchange.com/questions/101903/named-patterns-in-except Bug introduced in 8 or earlier and persisting through 10.3 or later Bug isn’t present in version 5.2 I don’t think I quite understand how Except works. I want to deﬁne $$f(a,b) = (a-b)\ln (a-b)$$, ... - asked by QuantumDot (12 votes), answered by Kuba (11 votes) —————————- [What is the diﬀerence between Inherited and (Inherited + 0)] http://mathematica.stackexchange.com/questions/101715/what-is-the-difference-between-inherited-and-inherited-0 Let’s create a stylesheet: NotebookPut@ Notebook[{ Cell[StyleData[StyleDefinitions -&gt; "Default.nb"]], Cell[StyleData["myStyle"]], Cell[StyleData["myStyle2", StyleDefinitions -&gt; ... - asked by Kuba (12 votes), answered by Kuba (5 votes) —————————- [Why is DiscretizeGraphics missing points on my curve?] http://mathematica.stackexchange.com/questions/101594/why-is-discretizegraphics-missing-points-on-my-curve I have a graphics expression which renders nicely as a closed curve when put in Graphics, I don’t understand why I can’t get the lines from DiscretizeGraphics or BoundaryDiscretizeGraphics: p = ... - asked by M.R. (12 votes), answered by Jason B (7 votes) —————————- [What’s going on here? Some kind of rationalization ”under the covers”?] http://mathematica.stackexchange.com/questions/102050/whats-going-on-here-some-kind-of-rationalization-under-the-covers Observe: eq = (.25 a + .5 b + .25 c); CoefficientRules[eq^2] CoefficientRules[eq^2 // Expand] results in {{2, 0, 0} -> 1/16, {1, 1, 0} -> 1/4, {1, 0, 1} -> 1/8, {0, 2, 0} -> 1/4, ... - asked by ciao (11 votes) —————————- [Integration of incomplete rings (ellipses) pattern] http://mathematica.stackexchange.com/questions/102069/integration-of-incomplete-rings-ellipses-pattern I am facing a problem in trying to do a series of averages in incomplete images. I have a series of X-ray data images, like this one: As you can see my image is a series of partial rings/ellipses ... - asked by Matteo S (10 votes), answered by nikie (16 votes) —————————- [Is mathematica’s right click menu customizable to add Simplify tools?] http://mathematica.stackexchange.com/questions/101684/is-mathematicas-right-click-menu-customizable-to-add-simplify-tools Mathematica provide Algebraic Manipulate palette for simplifying expression. But the palette window will always stay on top, which is quite annoying. Is is possible to customize mathematica’s right ... - asked by matheorem (10 votes), answered by Karsten 7. (7 votes) ================================== Greatest hits from previous weeks: ================================== [Where can I ﬁnd examples of good Mathematica programming practice?] http://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ... - asked by J. M. (382 votes), answered by faysou (348 votes) —————————- [How to make Jacobian automatically in Mathematica] http://mathematica.stackexchange.com/questions/5790/how-to-make-jacobian-automatically-in-mathematica If we have two vectors, $$a$$ and $$b$$, how can I make Jacobian matrix automatically in Mathematica?  a=\left( \begin{array}{c} x_1^3+2x_2^2 \\ 3x_1^4+7x_2 \end{array} \right);b=\left(  - asked by George Mills (20 votes), answered by Jens (27 votes) ================================== Can you answer these? ================================== [Coppersmith’s algorithm like Pari’s zncoppersmith?] http://mathematica.stackexchange.com/questions/101978/coppersmiths-algorithm-like-paris-zncoppersmith Is there some Mathematica package (or built-in that I missed) available, more or less equivalent to Pari’s zncoppersmith function? Paraphrasing that source: given a polynomial $$P(x)$$ with integer ... - asked by fgrieu (1 vote) —————————- [How do I calculate this integral along a complex line (not a contour) in mathematica?] http://mathematica.stackexchange.com/questions/102088/how-do-i-calculate-this-integral-along-a-complex-line-not-a-contour-in-mathema Given the function: Where a is a positive constant and: z = \frac{i}{b} + t  t&gt;a Where b is also a ... - asked by T. Welsh (1 vote) —————————- [How to add symbols to autocompletion list] http://mathematica.stackexchange.com/questions/101871/how-to-add-symbols-to-autocompletion-list There are some built-in Mathematica symbols that I use quite frequently but are not included in the autocompletion list in the front end. Examples are Analytic and PolynomialForm. (As @march points ... - asked by QuantumDot (4 votes) ### 6.4 Tuesday, December 8, 2015 ================================== Top new questions this week: ================================== [Can I emulate Wolfram’s automatic package updating in my own packages?] http://mathematica.stackexchange.com/questions/101035/can-i-emulate-wolframs-automatic-package-updating-in-my-own-packages It seems that some Wolfram-provided packages are smart enough to automatically check with the Wolfram servers, notice when a newer version is available, and download it, so that the user always has ... - asked by ibeatty (12 votes), answered by ZachB (3 votes) —————————- [Zooming using GeoGraphics] http://mathematica.stackexchange.com/questions/100920/zooming-using-geographics Suppose I do: GeoGraphics[Entity[”City”, ”Eureka”, ”California”, ”UnitedStates”]] What do folks do at this point to zoom in to various parts of the image? - asked by David (12 votes), answered by Peter Roberge (12 votes) —————————- [Shortest tour with vertex priority] http://mathematica.stackexchange.com/questions/101175/shortest-tour-with-vertex-priority I changed the title of my question and tried to simplify formulation of the problem. I solve a very big vehicle routing problem. I divided this one big problem on many small sub-problems. Each small ... - asked by Alexey Golyshev (10 votes), answered by Alexey Golyshev (4 votes) —————————- [Backquote in string template?] http://mathematica.stackexchange.com/questions/101342/backquote-in-string-template I need to have backquotes in a StringTemplate. For example StringTemplate["1"] Returns "21" instead of "2". How can I get the correct result ? Of course a solution would be to use ... - asked by faysou (8 votes), answered by Kuba (5 votes) —————————- [create an (almost) hexagonal mesh on an ellipsoid] http://mathematica.stackexchange.com/questions/101183/create-an-almost-hexagonal-mesh-on-an-ellipsoid EDIT I edited the question in order to take into @Kuba’s comment. I want to create this ﬁgure with Mathematica (in particular an almost hexagonal mesh on an ellipsoid; thanks to @Kuba I know this ... - asked by dimitris (8 votes), answered by Kuba (10 votes) —————————- [How to count number of small dots in a picture] http://mathematica.stackexchange.com/questions/100957/how-to-count-number-of-small-dots-in-a-picture I have this picture of small particles in a polymer ﬁlm. I want to count how many particles in the ﬁgure, so that I can have a rough estimation of the particle density. But the image quality is ... - asked by MYG (8 votes), answered by Graumagier (4 votes) —————————- [Why some GeoProjections show just half of Chukotka region (Russian map)] http://mathematica.stackexchange.com/questions/101334/why-some-geoprojections-show-just-half-of-chukotka-region-russian-map I’ve moved to V.10.3 as suggested and proceed with Russian map (the aim is to geoplot regional distributions of some values). Notice most eastern Russian region - Chukotka. Chukotka, unlike other ... - asked by garej (7 votes), answered by Peter Roberge (1 vote) ================================== Greatest hits from previous weeks: ================================== [How can I improve Mathematica’s resolution on a macbook retina display?] http://mathematica.stackexchange.com/questions/18419/how-can-i-improve-mathematicas-resolution-on-a-macbook-retina-display Mathematica 9.0 looks a bit fuzzy on the retina screen, how can I increase the resolution? Here another screenshot showing a direct comparison between the browser and Mathematica - asked by Tom Wellington (38 votes), answered by programming_historian (20 votes) —————————- [How do I draw a pair of buttocks?] http://mathematica.stackexchange.com/questions/66538/how-do-i-draw-a-pair-of-buttocks I’m trying to develop a function which 3D plot would have a buttocks like shape. Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ... - asked by Simpleton Jack (236 votes), answered by mikuszefski (360 votes) ================================== Can you answer these? ================================== [Using Mathematica with touchscreens] http://mathematica.stackexchange.com/questions/101089/using-mathematica-with-touchscreens I really like using my Windows 10 touchscreen to move around in websites, documents, etc. It doesn’t work in Mathematica. Can that be ﬁxed by changing a global notebook setting, or is it something ... - asked by George Wolfe (4 votes) —————————- It’s a hard for me to write english so I’ll try to go straight to my problem. There is abstract predicate f, that takes two parameters. There are also two other predicates b and u: b[x_, y_] := ... - asked by rattrapper (5 votes) —————————- [Initializing FinancialData indices .... never ﬁnishes] http://mathematica.stackexchange.com/questions/101339/initializing-financialdata-indices-never-finishes Retrieving data using FinancialData became more unreliable in the last couple of months, but simply retrying was enough to ﬁnally get the data. Now it seems to be nearly completely broken in ... - asked by Karsten 7. (3 votes) ### 6.5 Tuesday, December 1, 2015 ================================== Top new questions this week: ================================== [Wiggly and imprecise animated gif output] http://mathematica.stackexchange.com/questions/100628/wiggly-and-imprecise-animated-gif-output Trying to make animated gif of zooming into famous Ford circles. With the code visibleQ[lh_, hr_, c_, k_] := Which[ lh &gt;= 1/(2 k), If[2 c k^2 &lt;= 1 &amp;&amp; lh^2 &lt; c (1 - c k^2), True, ... - asked by (12 votes), answered by Michael E2 (7 votes) —————————- [What is the diﬀerence between Dynamic[x] and Dynamic[ h[x] ] for DynamicModule variables?] http://mathematica.stackexchange.com/questions/100828/what-is-the-difference-between-dynamicx-and-dynamic-hx-for-dynamicmodule Why plain Dynamic[x] is less sensitive and less likely to automatically be updated than e.g. Dynamic[x]? The issue was raised here couple of times but I don’t remember any general answer, just work ... - asked by Kuba (11 votes) —————————- [Pick elements from list ”separately”] http://mathematica.stackexchange.com/questions/100696/pick-elements-from-list-separately I have the following list I want to pick elements from: mylist = 1, 5, 7, 3, 4, 7, 2, 9, 9, 1, 10, 12, 2, 64, 34, 64 I have another list with 0’s and 1’s which is my selector: selector = 1, 1, ... - asked by holistic (11 votes), answered by eldo (11 votes) —————————- [A quicker than outer] http://mathematica.stackexchange.com/questions/100551/a-quicker-than-outer I need to get a matrix $$\{a(x_i-x_j)\}$$, where $$x_i$$ form a partition of an interval, $$a(x)$$ is a given function. I use In:= a[x_?NumericQ] := N[Exp[-Abs[x]]]; x = Table[-10 + 0.02 (j - ... - asked by Dmitri (11 votes), answered by Szabolcs (14 votes) —————————- [Converting a list of rules to a list of lists] http://mathematica.stackexchange.com/questions/100700/converting-a-list-of-rules-to-a-list-of-lists What are some easy ways to convert the list of Rules {"Joe" -&gt; 94, "Jane" -&gt; 85, "Bob" -&gt; 82, "Bill" -&gt; 83, "Michelle" -&gt; 98} into a list of lists: ... - asked by David (9 votes), answered by eldo (14 votes) —————————- [Magnifying Glass on a Plot] http://mathematica.stackexchange.com/questions/100691/magnifying-glass-on-a-plot Although there is a trick in TEX magnifying glass but I want to know is there any function to magnifying glass on a plot with Mathematica? For example for a function as Sin[x] and at x=Pi/6 Below, ... - asked by Ackaran (9 votes), answered by Karsten 7. (13 votes) —————————- [How to extract a region shape from an 2 colour image?] http://mathematica.stackexchange.com/questions/100578/how-to-extract-a-region-shape-from-an-2-colour-image I’ll start by saying that I don’t know anything about image processing. I have an image and I need to extract its outermost shape for use in a WordCloud. The image only has two colours and the ... - asked by Edmund (9 votes), answered by nikie (4 votes) ================================== Greatest hits from previous weeks: ================================== [How to express trigonometric equation in terms of of given trigonometric function?] http://mathematica.stackexchange.com/questions/434/how-to-express-trigonometric-equation-in-terms-of-of-given-trigonometric-functio How can I express a trigonometric equation / identity in terms of a given trigonometric function? using following trigonometric identities Sin[x]^2+Cos[x]^2==1 Sin[x]/Cos[x]==Tan[x] ... - asked by Prashant Bhate (24 votes), answered by Simon (28 votes) —————————- [How to ﬁnd all the local minima/maxima in a range] http://mathematica.stackexchange.com/questions/5575/how-to-find-all-the-local-minima-maxima-in-a-range I want to ﬁnd : all local maxima in range all local minima in range From those points I can interpolate and combine functions upper and lower boundary. What I am really interested in, is the ... - asked by Margus (52 votes), answered by Daniel Lichtblau (56 votes) ================================== Can you answer these? ================================== [Solving this system of nonlinear equations] http://mathematica.stackexchange.com/questions/100466/solving-this-system-of-nonlinear-equations Edit Interestingly, I realized solving my problem with $$2n$$ equations appeared to be more eﬃcient than using mathematical results on the solutions to reduce the problem to $$n$$ equations (the $$n$$ ... - asked by anderstood (2 votes) —————————- [Share variables among notebooks with diﬀerent Kernels] http://mathematica.stackexchange.com/questions/100760/share-variables-among-notebooks-with-different-kernels So I have a server running in another notebook with a secondary kernel. I run my main notebook and launch the server notebook, but I have conﬁgured the variables in my main one, and can’t ﬁnd a way ... - asked by jaimehrubiks (2 votes) —————————- [Planning ﬂights for a special route] http://mathematica.stackexchange.com/questions/100768/planning-flights-for-a-special-route I want to plan a world trip with Mathematica. So I already have the dataset with all the cities I want to visit and the tour (with the command FindShortestTour). So now I want to know how to come from ... - asked by Kristina (3 votes) ### 6.6 Tuesday, November 24, 2015 ================================== Top new questions this week: ================================== [Is Mathematica worth it for me?] http://mathematica.stackexchange.com/questions/100072/is-mathematica-worth-it-for-me I’m 13 years old and in 7th grade. I’m currently in Algebra 1, and I have fallen in love with both math and programming. When I came upon Mathematica, it was awesome. My two favorite things fused ... - asked by TreFox (50 votes), answered by Pillsy (33 votes) —————————- [GroupBy twice gives diﬀerent results] http://mathematica.stackexchange.com/questions/100139/groupby-twice-gives-different-results update: conﬁrmed as a bug related to ’N’ when using GroupBy or GatherBy. It is a bug at least since version 7 It took me quite a lot of time to ﬁnally trace down to this strange output. I really ... - asked by matheorem (25 votes), answered by Patrick Stevens (15 votes) —————————- [How to make a blob in 3D?] http://mathematica.stackexchange.com/questions/99754/how-to-make-a-blob-in-3d I am trying to make a blob like the one shown below, but in 3D so I can rotate it. I’m trying to use ParametricPlot3D or SphericalPlot3D. I can make a sphere easily. But my knowledge of how to modify ... - asked by Michael McCain (20 votes), answered by Eric Towers (12 votes) —————————- [Coordinate system transformation problem (about Euler angle)] http://mathematica.stackexchange.com/questions/100054/coordinate-system-transformation-problem-about-euler-angle This question comes from the work that constructing the general cylinder by the NURBS. I have implemented the point-set $$P_1,P_2,\cdots ,P_n$$ that in the $$O-xyz$$ plane, now I want to implement the ... - asked by Shutao TANG (14 votes), answered by J. M. (9 votes) —————————- [List of symbols marked [[EXPERIMENTAL]] in the documentation] http://mathematica.stackexchange.com/questions/100058/list-of-symbols-marked-experimental-in-the-documentation Some of the built-in Wolfram Language symbols are marked as [[EXPERIMENTAL]] in the documentation. For example [Echo] How can I get a list of all the symbols marked as [[EXPERIMENTAL]]? (This ... - asked by Karsten 7. (14 votes), answered by Karsten 7. (20 votes) —————————- [Random letters: What is the chance, that true words are coming?] http://mathematica.stackexchange.com/questions/99800/random-letters-what-is-the-chance-that-true-words-are-coming Suppose, that we are just typing random letters with our keyboards(we use space bar too). We don’t make diﬀerence between big and small letters. If we work for a long time, how much from the words ... - asked by Arquis (13 votes), answered by belisarius has settled (18 votes) —————————- [How to take and evaluate a speciﬁc part of a list without evaluating the rest?] http://mathematica.stackexchange.com/questions/100217/how-to-take-and-evaluate-a-specific-part-of-a-list-without-evaluating-the-rest I have a large list, for example, lis = {x + y, x y, Sin[x] y + Exp[y], x^2 y} and its elements depend on variables x and y. Later I assign numerical values to x and y x = {1, 2, 3, 4, 5} y = {3, ... - asked by renphysics (9 votes), answered by Chris Degnen (9 votes) ================================== Greatest hits from previous weeks: ================================== [How to use Mathematica functions in Python programs?] http://mathematica.stackexchange.com/questions/4643/how-to-use-mathematica-functions-in-python-programs I’d like to know how can I call Mathematica functions from Python. I appreciate a example, for example, using the Mathematica function Prime. I had search about MathLink but how to use it in Python ... - asked by GarouDan (35 votes), answered by GarouDan (14 votes) —————————- [Mathematica sporadically crashes on open] http://mathematica.stackexchange.com/questions/32232/mathematica-sporadically-crashes-on-open Sometimes, when I open Mathematica, while the opening splash screen still says ”Initializing Kernel Connections”, Windows will tell me that ”Wolfram Mathematica 9 has stopped working”. This will ... - asked by William Kunkel (9 votes), answered by Bingo (5 votes) ================================== Can you answer these? ================================== [Can’t get Mathematica to Import PDF ﬁles with diacritics on the ﬁle name] http://mathematica.stackexchange.com/questions/99980/cant-get-mathematica-to-import-pdf-files-with-diacritics-on-the-file-name Tested with versions 9.0.0, 10.0.2 and 10.3.0, all under OS X 10.10.5. The drag-and-drop front-end functionality also results in Failed. Surprisingly, Importing, JPEGs, TXTs, and XLSX work just ... - asked by Aisamu (4 votes) —————————- [Where can I ﬁnd documentation on use of special characters in templates?] http://mathematica.stackexchange.com/questions/100023/where-can-i-find-documentation-on-use-of-special-characters-in-templates I am new to Templates. I have seen the usage "\!$$\*StyleBox ...)" as here: disabling templates What does the string "!(*" accomplish and can I find some documentation of this notation? - asked by John McGee (1 vote) —————————- [Exponential Matrix Diﬀentiation] http://mathematica.stackexchange.com/questions/100214/exponential-matrix-diffentiation I have been struggling with the following question while solving an optimization problem in \(\mathbb {R}_{+}^G$$. Basically, I have - asked by Guilherme Thompson (1 vote) ### 6.7 Tuesday, November 17, 2015 ================================== Top new questions this week: ================================== [Terrifying performance decrease for contour/density plots in v10.1 -¿ 10.3] http://mathematica.stackexchange.com/questions/99255/terrifying-performance-decrease-for-contour-density-plots-in-v10-1-10-3 I setup for download a test dataset at http://www.inrim.it/~magni/cm.dat.gz (a set of 64800 triplets x,y,z). The behavior can be reproduced with the following code: link = ... - asked by alessandro (24 votes), answered by Jason B (13 votes) —————————- [Cyclic Take function?] http://mathematica.stackexchange.com/questions/99188/cyclic-take-function Is there some direct and simple ”cyclic Take”, sometimes also known as ”overtake” in Mathematica. That is, if the take speciﬁcation runs out of elements, it just cycles back to the beginning (as many ... - asked by murray (21 votes), answered by kglr (22 votes) —————————- [Speeding up generation of block diagonal matrix] http://mathematica.stackexchange.com/questions/99467/speeding-up-generation-of-block-diagonal-matrix I’m struggling with the following problem. I have $$48$$ square matrices (full, ﬁlled with real machine precision numbers, thus are packed, all diﬀerent) of size $$128$$. I wolud like to place them on a ... - asked by mmal (16 votes), answered by ybeltukov (14 votes) —————————- [Integrate returns imaginary answer for smooth, real function] http://mathematica.stackexchange.com/questions/99395/integrate-returns-imaginary-answer-for-smooth-real-function Bug introduced in 7 or earlier and persisting through 10.3 I’m trying to evaluate the integral: with ... - asked by Kevin Driscoll (15 votes) —————————- [Detecting an ellipse in a glaucoma photo] http://mathematica.stackexchange.com/questions/99578/detecting-an-ellipse-in-a-glaucoma-photo For glaucoma diagnosis it is common to determine a ”cup to disk ratio” which compares the diameter of the optic disk (VDD) and optic cup (VCD). The optical disk is visible as a circular red feature ... - asked by indra ginanjar A.T (14 votes), answered by belisarius has settled (17 votes) —————————- [How to implement the general array broadcasting method from NumPy?] http://mathematica.stackexchange.com/questions/99171/how-to-implement-the-general-array-broadcasting-method-from-numpy A friend of mine introduced array broadcasting in the Python NumPy package which is very convenient (and also highly eﬃcient). The idea is perfectly shown in this picture: Basically, the method ... - asked by matheorem (14 votes), answered by Pillsy (15 votes) —————————- [Derivative of a pure function with SlotSequence] http://mathematica.stackexchange.com/questions/99439/derivative-of-a-pure-function-with-slotsequence I can live with this but I can’t ﬁgure out why the following is 0:  Derivative[f[##] &amp;][x] 0 From documentation for Derivative: [...] Whenever Derivative[n][f] is generated, the WL ... - asked by Kuba (14 votes), answered by Michael E2 (13 votes) ================================== Greatest hits from previous weeks: ================================== [Even Fibonacci numbers] http://mathematica.stackexchange.com/questions/37266/even-fibonacci-numbers Today, I found the Euler Project. Problem #2 is Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the ﬁrst 10 terms will be: 1, ... - asked by Shutao TANG (26 votes), answered by rcollyer (34 votes) —————————- [How can I plot the direction ﬁeld for a diﬀerential equation?] http://mathematica.stackexchange.com/questions/8841/how-can-i-plot-the-direction-field-for-a-differential-equation I’d like to plot the graph of the direction ﬁeld for a diﬀerential equation, to get a feel for it. I’m a novice, right now, when it comes to plotting in Mathematica, so I’m hoping that someone can ... - asked by Matt Groﬀ (16 votes), answered by Peter Breitfeld (13 votes) ================================== Can you answer these? ================================== [Odd Coloring with GeoRegionValuePlot] http://mathematica.stackexchange.com/questions/99478/odd-coloring-with-georegionvalueplot When I’m plotting data with GeoRegionValuePlot, I’m getting some strange coloring errors: The grid included shows the top 10 countries with arable land per population. However, Australia is colored ... - asked by DavisDude (1 vote) —————————- [Find regions in which the roots of a third degree polynomial are real] http://mathematica.stackexchange.com/questions/99167/find-regions-in-which-the-roots-of-a-third-degree-polynomial-are-real I have to ﬁnd the roots of a third degree polynomial in $$\phi$$ that depends from 3 parameters, namely $$t,s,w\in \mathbb R$$. In order to do that I’ve used the command Solve, in the following way: ... - asked by Claretta (5 votes) —————————- [Works with example numbers, but not with variables alone] http://mathematica.stackexchange.com/questions/99575/works-with-example-numbers-but-not-with-variables-alone  The following code prints the correct solution for variable a (2.23). But if i comment out the 5 given example numbers on top it fails. If i remove some of the constraints at the bottom (&amp;&amp; ... - asked by JoDo (1 vote) ### 6.8 Tuesday, November 10, 2015 ================================== Top new questions this week: ================================== [How to draw cylinders inside a cube] http://mathematica.stackexchange.com/questions/98724/how-to-draw-cylinders-inside-a-cube I want to create the following graphic (ignore the unit vectors). What I do is the following (not the most elegent and smart way I guess:-)!): 1) Use the code below to generate randomly distributed ... - asked by dimitris (23 votes), answered by ybeltukov (37 votes) —————————- [Sparse Cholesky Decomposition] http://mathematica.stackexchange.com/questions/98702/sparse-cholesky-decomposition I am working with square matrices with a special form, which for large rank (&gt; 100,000) would be best stored and manipulated as a SparseArray. I believe that the Cholesky decomposition of these ... - asked by Eric Brown (17 votes), answered by J. M. (16 votes) —————————- [Histogram3D with various colors and textures on cuboids’ faces] http://mathematica.stackexchange.com/questions/98687/histogram3d-with-various-colors-and-textures-on-cuboids-faces I’m trying to produce an Histogram3D-like graph, but with a little more customization. In particular I want to manually specify the color of each cuboid and to print some information on the top ... - asked by glance (14 votes), answered by Taiki (10 votes) —————————- [Can anyone explain this weird Plot3D error?] http://mathematica.stackexchange.com/questions/98813/can-anyone-explain-this-weird-plot3d-error This is more of a fun question because I see the source of the error, but cannot explain what Plot3D is doing. Can you ﬁgure it out? L = 111; X = Table[{0, 0}, {n, 1, L}]; X3D[n_, m_] := ... - asked by lynvie (13 votes), answered by Michael E2 (6 votes) —————————- [Piecewise imposes internal boundaries in NDSolve - is this expected?] http://mathematica.stackexchange.com/questions/98734/piecewise-imposes-internal-boundaries-in-ndsolve-is-this-expected In the following code I used True as the predicate for DirichletCondition and found that the boundary condition was applied not only at the boundary of the speciﬁed region but also at the internal ... - asked by Simon Woods (13 votes), answered by user21 (8 votes) —————————- [What is the diﬀerence between a .wl package and a .m package?] http://mathematica.stackexchange.com/questions/98981/what-is-the-difference-between-a-wl-package-and-a-m-package In Mathematica 10.x, one now has both .wl Wolfram Language Packages and .m Wolfram Mathematica Packages. What’s the diﬀerence? Is one of the two formats to be preferred in certain situations and, ... - asked by murray (12 votes) —————————- [Defer, Hold, Unevaluated, Inactivate – which one when?] http://mathematica.stackexchange.com/questions/98874/defer-hold-unevaluated-inactivate-which-one-when What are some guidelines on which function to select from among the superﬁcially similar functions Defer, Hold, Unevaluated, and Inactivate? Consider, for example: Defer[Defer[Sum[1/k^2, {k, 1, ... - asked by murray (12 votes) ================================== Greatest hits from previous weeks: ================================== [Python-style plots in Mathematica] http://mathematica.stackexchange.com/questions/84877/python-style-plots-in-mathematica I love making plots in Mathematica. And I love to spend a lot of time making high-quality plots that maximize readability and aesthetics. For most cases, Mathematica can make very beautiful images, ... - asked by Pablo Galindo Salgado (49 votes), answered by halirutan (49 votes) —————————- [What are the most common pitfalls awaiting new users?] http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ... - asked by belisarius has settled (278 votes), answered by Michael E2 (148 votes) ================================== Can you answer these? ================================== [How do I determine which ChartElementDataFunction is Automatic?] http://mathematica.stackexchange.com/questions/98820/how-do-i-determine-which-chartelementdatafunction-is-automatic In the course of exploring @kglr's answer to Edmund's question gain some insight into how I might answer my own question here, I came across the undocumented SystemChartElementData function, which ... - asked by Pillsy (7 votes) —————————- [Control Front End in ”mathlink” mode] http://mathematica.stackexchange.com/questions/98686/control-front-end-in-mathlink-mode Note: This question was already posted in the Wolfram community. In a terminal math session, we can start a front end (FE) easily by launching it though LinkLaunch or by using functions provided in ... - asked by halirutan (11 votes) —————————- [Multivariate Path Construction using Sobol numbers] http://mathematica.stackexchange.com/questions/98914/multivariate-path-construction-using-sobol-numbers I am sharing my code,which I have tried to perform as per the instruction mentioned below. Please correct it so that I could get my output. Instruction: Use the ﬁrst m dimensions of the Sobol vector ... - asked by Pankaj Mani (1 vote) ### 6.9 Tuesday, November 3, 2015 ================================== Top new questions this week: ================================== [Incorrect Timing of Total] http://mathematica.stackexchange.com/questions/98453/incorrect-timing-of-total For demonstrating how fast C-compiled functions can be, in one of my courses I use the following function for ﬁnding the sum of a list of reals: myTotal = Compile[{{lst, _Real, 1}},Module[{s=0.}, ... - asked by Fred Simons (17 votes), answered by ilian (12 votes) —————————- [Aggregation queries on lists of associations in 10.3] http://mathematica.stackexchange.com/questions/98277/aggregation-queries-on-lists-of-associations-in-10-3 Bug introduced in 10.3 Some aggregation queries applied to a list of associations (or Dataset’s with this structure) lock up the front end or crash the kernel in Version 10.3. xx = {&lt;|"a" -&gt; ... - asked by Daniel W (14 votes), answered by SquareOne (7 votes) —————————- [On making a graphical real-time memory usage monitor] http://mathematica.stackexchange.com/questions/98205/on-making-a-graphical-real-time-memory-usage-monitor I’d like to make a graphical version of Dynamic[Refresh[MemoryInUse[], UpdateInterval -&gt; 1]] A naive implementation would be something like: miu = {}; Dynamic[Refresh[ListPlot[AppendTo[miu, ... - asked by kjo (12 votes), answered by Karsten 7. (7 votes) —————————- [How to sort list of mixed types of elements with each type a speciﬁed canonical order?] http://mathematica.stackexchange.com/questions/98438/how-to-sort-list-of-mixed-types-of-elements-with-each-type-a-specified-canonical For example, here is a list {{1, "u"}, {6, "d"}, {3, "u"}, {4, "d"}, {2, "u"}, {5, "u"}, {3, "d"}, {1, "d"}, {4, "u"}, {2, "d"}, {5, "d"}, {6, "u"}} The default canonical order for integer is ... - asked by matheorem (11 votes), answered by belisarius is forth (14 votes) —————————- [How do you concatenate matrices? And how do you make block matrices?] http://mathematica.stackexchange.com/questions/98406/how-do-you-concatenate-matrices-and-how-do-you-make-block-matrices This is pretty trivial to do in Matlab, but I have not seen a function for it in Mathematica. Here is how you can do it with Join and Transpose. Is there an easier way to do it than this? ... - asked by luke wendt (10 votes), answered by Taiki (12 votes) —————————- [Association Subtotals with Lists as Keys] http://mathematica.stackexchange.com/questions/98346/association-subtotals-with-lists-as-keys I have the following Association: as = &lt;|{5, 2, 1} -&gt; 3, {6, 1, 4} -&gt; 9, {5, 1, 9} -&gt; 12, {5, 2, 4} -&gt; 6, {6, 2, 8} -&gt; 10|&gt;; I want to total the values on the right side of the ... - asked by eldo (10 votes), answered by Pillsy (13 votes) —————————- [get position index for all element in a list] http://mathematica.stackexchange.com/questions/98170/get-position-index-for-all-element-in-a-list For example mat={{a,b},{c,a,a}} How to write a function posindex that posindex[mat] will give {{a -&gt; {1, 1}, b -&gt; {1, 2}}, {c -&gt; {2, 1}, a -&gt; {2, 2}, a -&gt; {2, 3}} And the function ... - asked by matheorem (10 votes), answered by Michael E2 (8 votes) ================================== Greatest hits from previous weeks: ================================== [3D surface that looks like a virus] http://mathematica.stackexchange.com/questions/74193/3d-surface-that-looks-like-a-virus I have been recently using Mathematica for composing animations that are part of the supplementary information of my papers. I am currently trying to build an animation that involves a viral ... - asked by user2098 (16 votes), answered by Chris Degnen (18 votes) —————————- [Mathematica Minecraft] http://mathematica.stackexchange.com/questions/19669/mathematica-minecraft Some time ago I asked myself: with all these great graphics and interactive capabilities of Mathematica, what kinds of 3D games can be implemented in it? And the answer which came to mind is ... - asked by faleichik (131 votes), answered by faleichik (176 votes) ================================== Can you answer these? ================================== [Triggering events based on choices made inside of system dialogs (e.g. window close)] http://mathematica.stackexchange.com/questions/98091/triggering-events-based-on-choices-made-inside-of-system-dialogs-e-g-window-cl I’m trying to arrange for Mathematica to perform a certain action every time a notebook is saved or closed (with or without saving). The obvious way to do this would be through event handling. So, ... - asked by Paco Jain (5 votes) —————————- [ListContourPlot and ListContourPlot3D use better interpolation for arrays of values than for lists of tuples (i.e. x,y,z,f[x,y,z]..] http://mathematica.stackexchange.com/questions/98145/listcontourplot-and-listcontourplot3d-use-better-interpolation-for-arrays-of-val From reading the documentation, it seems that ListContourPlot3D should work equally well on an array versus a list of tuples, ?ListContourPlot3D ListContourPlot3D[array] generates a contour plot ... - asked by Jason B (10 votes) —————————- [Size problems combining objects in a Graphics using Inset] http://mathematica.stackexchange.com/questions/98282/size-problems-combining-objects-in-a-graphics-using-inset The Problem I need to put together diﬀerent graphics objects in a precise way inside a Graphics. Some objects are drawn directly by graphics primitives, some others are the result of calls to ... - asked by Guido (4 votes) ### 6.10 Tuesday, October 27, 2015 ================================== Top new questions this week: ================================== [Recursively appending elements to a list] http://mathematica.stackexchange.com/questions/97684/recursively-appending-elements-to-a-list In wanting to demonstrate the power of Mathematica, I wanted to show my 11-year-old son how we could validate that his sequences homework was correct. We could generate the next value in sequence in a ... - asked by AnthonyMiller (15 votes), answered by J. M. (19 votes) —————————- [What is ”MemoryMonitor”?] http://mathematica.stackexchange.com/questions/97810/what-is-memorymonitor Evaluating one of the following inputs CurrentValue[EvaluationNotebook[], WindowElements] CurrentValue[FrontEndSession, WindowElements] CurrentValue[FrontEnd, WindowElements] ... - asked by Karsten 7. (12 votes), answered by m_goldberg (10 votes) —————————- [Pop-up documentation for ”The new function of the day”] http://mathematica.stackexchange.com/questions/97552/pop-up-documentation-for-the-new-function-of-the-day The Wolfram Language has more than 5000 built-in functions and constants. functionslist = Flatten[ Names[#] &amp; /@ Flatten[ {# &lt;&gt; "*", "" &lt;&gt; # &lt;&gt; "*"} &amp; /@ ... - asked by rhermans (12 votes), answered by J. M. (5 votes) —————————- [ListContourPlot has wrong colouring: workaround?] http://mathematica.stackexchange.com/questions/97596/listcontourplot-has-wrong-colouring-workaround ListContourPlot uses the wrong colouring here: res = Import["https://dl.dropboxusercontent.com/u/38623/res.wdx", "WDX"]; ListContourPlot[res, Contours -&gt; Range[0.66, 0.9, 0.02], ColorFunction ... - asked by Szabolcs (12 votes), answered by Jason B (9 votes) —————————- [How do you handle upgrade frequency now that minor releases come so quickly?] http://mathematica.stackexchange.com/questions/97493/how-do-you-handle-upgrade-frequency-now-that-minor-releases-come-so-quickly Does anyone understand the Mathematica upgrade treadmill these days? With the minor releases (10.2, 10.3) coming out fairly quickly and the upgrade price associated with each, I have no idea what my ... - asked by sblom (12 votes) —————————- [More eﬃcient method to compute moments of the Johnson $$S_B$$ distribution] http://mathematica.stackexchange.com/questions/97750/more-efficient-method-to-compute-moments-of-the-johnson-s-b-distribution Here is a very speciﬁc feature request. I need Mean[JohnsonDistribution["SB", \[Gamma], \[Delta], 0, 1]] When I issue e.g. Table[N[Mean[JohnsonDistribution["SB", \[Gamma], \[Delta], 0, 1]]], {\[Gamma], -10, 10}, {\[Delta], 1, 10}] - asked by (11 votes), answered by J. M. (15 votes) —————————- [Path Names Longer Then 256 on Windows] http://mathematica.stackexchange.com/questions/97736/path-names-longer-then-256-on-windows Is there a way to work with pathnames that are longer then the typical 256 in Mathematica? For example run the following in Cygwin echo 1 &gt; ... - asked by William (11 votes), answered by WReach (10 votes) ================================== Greatest hits from previous weeks: ================================== [Mathematica Minecraft] http://mathematica.stackexchange.com/questions/19669/mathematica-minecraft Some time ago I asked myself: with all these great graphics and interactive capabilities of Mathematica, what kinds of 3D games can be implemented in it? And the answer which came to mind is ... - asked by faleichik (131 votes), answered by faleichik (176 votes) —————————- [3D surface that looks like a virus] http://mathematica.stackexchange.com/questions/74193/3d-surface-that-looks-like-a-virus I have been recently using Mathematica for composing animations that are part of the supplementary information of my papers. I am currently trying to build an animation that involves a viral ... - asked by user2098 (16 votes), answered by Chris Degnen (18 votes) ================================== Can you answer these? ================================== [How to model discontinuities in a NonlinearStateSpaceModel] http://mathematica.stackexchange.com/questions/97717/how-to-model-discontinuities-in-a-nonlinearstatespacemodel I know that it is possible to model discontinuities like bouncing and other collisions by using WhenEvent with NDSolve. However, I am using the tools for Non linear systems and I’d like to know if ... - asked by RationalAsh (2 votes) —————————- [How to pass a custom method to a particular option?] http://mathematica.stackexchange.com/questions/97753/how-to-pass-a-custom-method-to-a-particular-option In an answer to my question More eﬃcient method to compute moments of the Johnson $$S_B$$ distribution, J. M. has come up with a method to compute the moments of the Johnson $$S_B$$ distribution, which ... - asked by (4 votes) —————————- [Scaling 1D ArrayPlot divide by zero error] http://mathematica.stackexchange.com/questions/97467/scaling-1d-arrayplot-divide-by-zero-error I am trying to overlay an ArrayPlot onto a WaveletScalogram, using the helpful answer here; however, my ArrayPlot is one-dimensional. My code: Show[{ WaveletScalogram[trainWaveData["A1 HbO"], ... - asked by Lylax (2 votes) ### 6.11 Tuesday, October 20, 2015 ================================== Top new questions this week: ================================== [DumpSave 10.2 style from 10.3] http://mathematica.stackexchange.com/questions/97357/dumpsave-10-2-style-from-10-3 Szabolcs has asked WRI support about mx ﬁles, in particular: Can we expect that MX ﬁles written by Mathematica 10.0.0 will be readable by future point released such as 10.0.1 or 10.0.2? ... - asked by Kuba (14 votes) —————————- [Plot3D is incorrectly returning ”1/0. encountered”] http://mathematica.stackexchange.com/questions/97104/plot3d-is-incorrectly-returning-1-0-encountered The line of code Plot3D[1/y, {x, 0, 1}, {y, x + 1, x + 2}] is returning several ”Power::infy: Inﬁnite expression 1/0. encountered.” error messages, and then returning an empty plot. But the ... - asked by tparker (13 votes), answered by rhermans (8 votes) —————————- [Fast Selections Testing on Inequality] http://mathematica.stackexchange.com/questions/97083/fast-selections-testing-on-inequality Is there a functional idiom for fast selections testing on inequality? For example, ﬁnding values from list a &amp; b where the key is less than or equal to a value, in this case 4 or 9. An ... - asked by Chris Degnen (13 votes), answered by Chris Degnen (5 votes) —————————- [Generate two random numbers with constraint] http://mathematica.stackexchange.com/questions/97424/generate-two-random-numbers-with-constraint I want to generate two random numbers p and q between 0.5 and 1. They are connected by the following constraint $$1/2q\&gt ;p$$. How to do that? - asked by Chandan Datta (12 votes), answered by rhermans (18 votes) —————————- [How to evaluate the second argument of Cases only once] http://mathematica.stackexchange.com/questions/96939/how-to-evaluate-the-second-argument-of-cases-only-once I’d like to ﬁnd a fast but readable way to achieve the following: Cases[RandomInteger[{AbsoluteTime["2001"], AbsoluteTime["2003"]}, 1000], a_ /; a &gt; AbsoluteTime["2002"]] The correct result ... - asked by Italianice (10 votes), answered by Michael E2 (11 votes) —————————- [How to predict the degree of the ﬁrst series coeﬃcient?] http://mathematica.stackexchange.com/questions/97313/how-to-predict-the-degree-of-the-first-series-coefficient Given an expression f that is a function of x and a number x0, what is the least integer n that produces a non-zero coeﬃcient in Series[f, x, x0, n]?  For instance, here, is the answer is n = ... - asked by Michael E2 (9 votes), answered by bbgodfrey (0 votes) —————————- [Trying to ﬁnd the asymptote to a function] http://mathematica.stackexchange.com/questions/97365/trying-to-find-the-asymptote-to-a-function I am trying to ﬁnd the asymptote to a solution of a diﬀerential equation. I solved x'(t) = \sin(x(t) + t) using NDSolve and plotted my solution. sol = NDSolve[{x'[t] == Sin[x[t] + t], x == ... - asked by Jacobadtr (9 votes), answered by bbgodfrey (9 votes) ================================== Greatest hits from previous weeks: ================================== [Generating visually pleasing circle packs] http://mathematica.stackexchange.com/questions/40334/generating-visually-pleasing-circle-packs EDIT: (my conclusion and thank you note) I want to thank you all guys for this unexpected intellectual and artistic journey. Hope you had fun and enjoyed it the same as I did. I would like to ... - asked by VividD (86 votes), answered by level1807 (51 votes) —————————- [Is there a syntax for single-line comments for notebooks?] http://mathematica.stackexchange.com/questions/1496/is-there-a-syntax-for-single-line-comments-for-notebooks I’m aware that I can use (* ... *) to comment out stuﬀ in a notebook. Many languages have a syntax for single-line comments, such as // in C, C++, Java, C#, ... # in shell, Python, ... For ... - asked by Peeter Joot (35 votes), answered by Szabolcs (42 votes) ================================== Can you answer these? ================================== [SyntaxInformation: take allowed options from multiple symbols – possible?] http://mathematica.stackexchange.com/questions/97411/syntaxinformation-take-allowed-options-from-multiple-symbols-possible Suppose I have a function like Options[f] = {foo -&gt; 1}; f[opt : OptionsPattern[{f,g}]] := h@g[Sequence @@ FilterRules[{opt}, Options[g]]] I purposefully do not want to append Options[g] to ... - asked by Szabolcs (4 votes) —————————- [Is there any way to export vector graphics with shading?] http://mathematica.stackexchange.com/questions/97305/is-there-any-way-to-export-vector-graphics-with-shading This has irked me for a while as I really feel its a signiﬁcant shortfall in Mathematica’s abilities but maybe I am missing something. I would like to export simple graphics with shading in a ... - asked by Quantum_Oli (9 votes) —————————- [Why is 13 the smaller height dimension of a Graphics?] http://mathematica.stackexchange.com/questions/97364/why-is-13-the-smaller-height-dimension-of-a-graphics It seems that you cannot get a Graphics image with a height dimension less than 13. Trying to draw something and then asking for the ImageDimensions of the resulting Graphics, you will get three ... - asked by Guido (6 votes) ### 6.12 Tuesday, October 13, 2015 ================================== Top new questions this week: ================================== [Progress bar for FullSimplify] http://mathematica.stackexchange.com/questions/96602/progress-bar-for-fullsimplify Sometimes FullSimplify takes a really long time and it is not really clear if it makes sense to wait another half an hour in hopes for it to ﬁnish, or if it will actually take three years in which ... - asked by Kagaratsch (18 votes), answered by Sjoerd C. de Vries (26 votes) —————————- [Construct a master curve from data] http://mathematica.stackexchange.com/questions/96393/construct-a-master-curve-from-data I will try to be as informative as possible. Clear["Global*"] I have the following data data91 = {{-0.209091, 2.89296}, {0.281818, 2.92958}, {0.8, 2.97535}, {1.28182, 3.03028}, ... - asked by dimitris (11 votes), answered by Sjoerd C. de Vries (17 votes) —————————- [Upper bound ”Vicious nearest neighbour” algorithm suggestions] http://mathematica.stackexchange.com/questions/96691/upper-bound-vicious-nearest-neighbour-algorithm-suggestions I am asking a question based on this question from the sister site MSE. In an eﬀort to make this a self-contained question, I include the ﬁorst documented posing of the problem by Robert Abilock in ... - asked by martin (10 votes), answered by Arnoud Buzing (2 votes) —————————- [Symbolic sum of Stirling numbers gives wrong answer] http://mathematica.stackexchange.com/questions/96575/symbolic-sum-of-stirling-numbers-gives-wrong-answer This issue originated from my attempt to answer a question on MathOverﬂow:  Sum[StirlingS2[i, 2], {i, 0, n}] on Mathematica 10.2.0.0 gives as answer $$\frac {1}{2} (-3 + 2^{1 + n} - 2 n)$$, while the ... - asked by Carlo Beenakker (10 votes), answered by Bob Hanlon (6 votes) —————————- [Map a function of several arguments] http://mathematica.stackexchange.com/questions/96803/map-a-function-of-several-arguments I have three lists, e.g. list1 = {{a,b,...}}; list2 = {{1,2},{3,4},...}; list3 = {{x,y},{z,w},...}; and a function f[x_,y_]:=(* whatever it does *); I need to get ... - asked by T. Rihacek (10 votes), answered by Kuba (12 votes) —————————- [Why does Nearest not support Sqrt?] http://mathematica.stackexchange.com/questions/96588/why-does-nearest-not-support-sqrt Simple examples with two points nf1=Nearest[{{0, 0}, {Sqrt, Sqrt}}] nf1[{0, 0}, {All, 2.1}] gives {{0, 0}} This is incorrect. If we test bigger radius, we can ﬁnd that Mathematica takes ... - asked by matheorem (9 votes) —————————- [Unique Element in List] http://mathematica.stackexchange.com/questions/96747/unique-element-in-list I have a list a, and want to ﬁnd out whether there is a unique element in the list. For instance a=x,y,z,y,x has an unique element (z), while a=1,2,3,4,5,1,2,3,4,5 has no unique element. There ... - asked by NicoDean (8 votes), answered by J. M. is back. (11 votes) ================================== Greatest hits from previous weeks: ================================== [1 Plot, 2 Scale/Axis] http://mathematica.stackexchange.com/questions/627/1-plot-2-scale-axis I would like to plot those two datasets on top of each other. But they have very diﬀerent range on the $$y$$ axis. How can I have two diﬀerent axis? I found the following on the help menu but quite ... - asked by 500 (87 votes), answered by ArgentoSapiens (83 votes) —————————- [Mathematica Minecraft] http://mathematica.stackexchange.com/questions/19669/mathematica-minecraft Some time ago I asked myself: with all these great graphics and interactive capabilities of Mathematica, what kinds of 3D games can be implemented in it? And the answer which came to mind is ... - asked by faleichik (131 votes), answered by faleichik (175 votes) ================================== Can you answer these? ================================== [Examples of using Mathematica to solve matrix equations symbolically] http://mathematica.stackexchange.com/questions/96405/examples-of-using-mathematica-to-solve-matrix-equations-symbolically Suppose we want to solve a linear system like \[ \left \lbrack \begin {array}{cc}M& S\\ -S^{T}&0 \end {array} \right \rbrack \left \lbrack \begin {array}{c} x\\ y\end {array}\right \rbrack = \left \lbrack \begin {array}{c} f \\g \end {array} \right \rbrack$

—————————-

[General suggestions to accelerate Simplify and FullSimplify] http://mathematica.stackexchange.com/questions/96476/general-suggestions-to-accelerate-simplify-and-fullsimplify

To my understanding, the function Simplify[] and FullSimplify[] work by applying a series of built-in transformation rules to the expression and trying to minimize the TransformationFunctions in the ...

- asked by Yuchen Xie (1 vote)

—————————-

[External and internal Assumptions on ‘PiecewiseExpand‘ and ‘Mod‘] http://mathematica.stackexchange.com/questions/96596/external-and-internal-assumptions-on-piecewiseexpand-and-mod

After this question I’m intrigued about the diﬀerent behaviors depending where and how the assumptions are given.

PiecewiseExpand[Mod[n, m]]    (* case #1 *)
(* Mod[n, m] *)

PiecewiseExpand[Mod[n,  ...


### 6.13 Tuesday, October 6, 2015

==================================
Top new questions this week:
==================================

LibraryLink is an API for extending Mathematica through C or C++. It is very fast because it gives direct access to Mathematica’s packed array data structure, without even needing to make a copy of ...

—————————-

[Find the volume of Phobos and Deimos]( http://mathematica.stackexchange.com/questions/96125/find-the-volume-of-phobos-and-deimos)

How can we calculate the volume of a 3D object using the new-in-10 computational geometry functions?

For simple objects this works:

shuttle = ExampleData[{"Geometry3D", "SpaceShuttle"}]

—————————-

[Convert binary voxel image to geometric region] (http://mathematica.stackexchange.com/questions/96134/convert-binary-voxel-image-to-geometric-region)

I have a binary voxel image which described a contiguous region in space.

Example:

arr = Array[
Function[{x, y, z}, (1 + Sin[5 x] Sin[5 y] Sin[5 z]/2) - (x^2 + y^2 + z^2)],
{100, 100, 100},  ...

—————————-

[Is it possible to reference ”self” from a pure function?]( http://mathematica.stackexchange.com/questions/96220/is-it-possible-to-reference-self-from-a-pure-function)

This would calculate the factorial of 6, if the ”self” was the function itself. Is there something that could allow this?

If[#[] &gt; 0, self[{#[] - 1, #[] #[]}], Print[#[]]] &amp;[{6,  ...

—————————-

Why does this work:

Graphics[{Circle[{0, 0}, -Pi/4]}]

But this doesn’t?

Graphics[{Circle[{0, 0}, N[-Pi/4]]}]

Telling me:

Radius -0.78539816339744828 should be a positive number or pair of ...

—————————-

[DSolve documention on web diﬀers greatly from distributed MMA 10.2.0 version] (http://mathematica.stackexchange.com/questions/96089/dsolve-documention-on-web-differs-greatly-from-distributed-mma-10-2-0-version)

In the course of improving my answer to 95361, I noticed that the DSolve documentation on the web is much better written than that distributed with Mathematica 10.2.0 for Microsoft Windows (64-bit) ...

—————————-

[MapAt with Replace(All) causing kernel crash]( http://mathematica.stackexchange.com/questions/96193/mapat-with-replaceall-causing-kernel-crash)

Bug introduced in 10.1 and ﬁxed in 10.2

I wanted to roll a function that works like /. but only acts on the very ﬁrst match it encounters.

ReplaceAtFirst =
Function[{expr, rule},
...

================================== Greatest hits from previous weeks: ==================================

[3D surface that looks like a virus] (http://mathematica.stackexchange.com/questions/74193/3d-surface-that-looks-like-a-virus)

I have been recently using Mathematica for composing animations that are part of the supplementary information of my papers.

I am currently trying to build an animation that involves a viral ...

—————————-

[Trying to Visualize a Collatz - The Collatz conjecture]( http://mathematica.stackexchange.com/questions/85718/trying-to-visualize-a-collatz-the-collatz-conjecture)

So I’m new in this and learning— and I happen to have this collatz

collatz[x_, y_] := If[x == 3*y || x == 2*y + 1 || y == 3*x || y == 2*x + 2, 2, 0]

So i want a visual 3D adjacency graph of my ...

================================== Can you answer these? ==================================

[How to ”fake” a front-end object when running a Mathematica script?] (http://mathematica.stackexchange.com/questions/95779/how-to-fake-a-front-end-object-when-running-a-mathematica-script)

I’m running a Mathematica script (content of which cannot be disclosed here) and some part of it requires ”front-end”? Since it’s running in a script, there is not one and it gave the following error: ...

—————————-

[INTERNAL SELF-TEST ERROR: FileNotify—c—305]( http://mathematica.stackexchange.com/questions/96273/internal-self-test-error-filenotifyc305)

Does anybody know what this error means? Clicking the link in the warning message gives a ”page not found”, and Googling does not produce anything for this exact error code. I get it whenever I try to ...

—————————-

[Does Compilation option ”InlineExternalDeﬁnitions”/”InlineCompiledFunctions” lead to unnecessarily complicated nesting?] (http://mathematica.stackexchange.com/questions/96147/does-compilation-option-inlineexternaldefinitions-inlinecompiledfunctions-le)

Question:  When an external (possibly complicated) definition f
is used inside a compiled function with
CompilationOption-&gt;{"InlineCompiledFunctions"-&gt;True},
does Mathematica really store the  ...

### 6.14 Tuesday, September 29, 2015

==================================
Top new questions this week:
==================================

[Fast calculation of discrete logarithms] http://mathematica.stackexchange.com/questions/95590/fast-calculation-of-discrete-logarithms

Does Mathematica have any built-in fast algorithms for calculating discrete logarithms over $$(\mathbb {Z}_p)^\times$$ (the group of integers modulo $$p$$)?

Essentially, for a ﬁxed large prime p, a ...

—————————-

[What pseudo-random number generators are available to Mathematica users?] http://mathematica.stackexchange.com/questions/95533/what-pseudo-random-number-generators-are-available-to-mathematica-users

One would think I should be able answer the question I pose in the title for myself by reading the Documentation Center article ref/SeedRandom, but it’s not so simple.

That article does give a list ...

—————————-

[Eﬃcient conversion between two partition representations] http://mathematica.stackexchange.com/questions/95410/efficient-conversion-between-two-partition-representations

I have a list of distinct expressions. We can represent a partitioning of list in two ways:

As a list of sublists partitions = a, b, ..., x, y, ..., ....

As a vector of integer partition ...

—————————-

[Why do singularities disappear when performing convolutions with the Dirac Delta function?] (http://mathematica.stackexchange.com/questions/95588/why-do-singularities-disappear-when-performing-convolutions-with-the-dirac-delta)

I am attempting to perform a convolution involving the Dirac Delta function:

$$\int _{-\infty }^{\infty } \frac {1}{t+1} \cdot \delta (t+1)\ dt$$

I would expect that the result of this integral is ...

—————————-

[Determine height of box packed with spheres] (http://mathematica.stackexchange.com/questions/95566/determine-height-of-box-packed-with-spheres)

I got such a wonderful answer regarding The Diagonals of a Regular Octagon, so I thought I’d try asking another question we had on our Pizza and Problem quiz activity at College of the Redwoods. The ...

—————————-

[How to automatically remove text from images?] (http://mathematica.stackexchange.com/questions/95512/how-to-automatically-remove-text-from-images)

I’d like to remove the text in the center of images automatically. To use Inpaint[], you need a mask, but I don’t have one. So really the problem is:

How to build a mask for an image that contains a ...

—————————-

[Front ends gone wild with named slots] (http://mathematica.stackexchange.com/questions/95351/front-ends-gone-wild-with-named-slots)

Bug introduced in version 10

Assume the following simple expression

{#"Test"}&amp;

Now go in front of the # and just start typing another named slot expression. On my system, the front end ...

================================== Greatest hits from previous weeks: ==================================

[Python-style plots in Mathematica] http://mathematica.stackexchange.com/questions/84877/python-style-plots-in-mathematica

I love making plots in Mathematica. And I love to spend a lot of time making high-quality plots that maximize readability and aesthetics. For most cases, Mathematica can make very beautiful images, ...

—————————-

[How to ﬁnd all the local minima/maxima in a range] http://mathematica.stackexchange.com/questions/5575/how-to-find-all-the-local-minima-maxima-in-a-range

I want to ﬁnd :

all local maxima in range

all local minima in range

From those points I can interpolate and combine functions upper and lower boundary. What I am really interested in, is the ...

================================== Can you answer these? ==================================

[Time complexity to choose the right overload from the memoized function] http://mathematica.stackexchange.com/questions/95399/time-complexity-to-choose-the-right-overload-from-the-memoized-function

If we want to save some outputs of the function, we often use the memoization pattern as follows,

f[x_]:=f[x]=x
f/@Range[10^5]

If I call this function many times for diﬀerent arguments, ...

—————————-

[Diagonalisation of equations for NDSolve] http://mathematica.stackexchange.com/questions/95383/diagonalisation-of-equations-for-ndsolve

I have a linear matrix diﬀerential equation and I wish to speed up evaluation by diagonalising using eigenvectors. There is an example in Help for ﬁnite elements under ”swinging beam” that is ...

—————————-

[TableDirections example produces an error message] http://mathematica.stackexchange.com/questions/95321/tabledirections-example-produces-an-error-message

Bug introduced in 10.0 and persisting through in 10.2

Can anyone replicate this? In Mathematica 10.2 on Win 64:

TableForm[{{a, b}, {c, d}, {e, f}}, TableDirections -&gt; Row]

I get the ...

### 6.15 Tuesday, September 22, 2015

==================================
Top new questions this week:
==================================

[How to speed up PDF export in Mathematica 10] (http://mathematica.stackexchange.com/questions/94776/how-to-speed-up-pdf-export-in-mathematica-10)

Based on this question: - Version 7 print environment - I set up two 10 page test documents in version 7.0.1 and version 10.1. The version 7 document exported to PDF in 4.18 seconds whereas the ...

—————————-

[How can I import a huge CSV ﬁle quickly?] (http://mathematica.stackexchange.com/questions/94752/how-can-i-import-a-huge-csv-file-quickly)

I have two CSV ﬁles, each one is around 1 GB of data. When I use Import[”ﬁle.csv”], it takes a very, very, long time to import the data. So how can I accelerate the import procedure?

The ﬁle ...

—————————-

[Is it possible to change the order that symbol deﬁnitions are checked? (DownValues vs UpValues)] (http://mathematica.stackexchange.com/questions/95087/is-it-possible-to-change-the-order-that-symbol-definitions-are-checked-downval)

Suppose I have the function f with the following deﬁnition assigned to it:

f // ClearAll;
f // Attributes = { HoldAll };
f /: HoldPattern[ f[x_] + f[y_] ] := upvalue;

If I evaluate f[x] + f[y], I  ...

—————————-

[Is it a bug in Limit?](http://mathematica.stackexchange.com/questions/95052/is-it-a-bug-in-limit)

Bug introduced in 9.0 and ﬁxed in 10.0.0

Mathematica 9 on Windows and WolframAlpha says

Limit[Sin[Sqrt[x+1]]-Sin[Sqrt[x]],x-&gt;Infinity]

is Interval[{-2,2}].

But actually the limit is 0.

...

—————————-

What is the syntax to add v1 to each vector in v2? I know it has to be simple, but I really have searched and not found it.

v1 = {a, b, c}
v2 = {{d, e, f}, {g, h, i}, {j, k, l}}

i.e., sum them in ...

—————————-

[How to remove a LocalSymbol (or CloudSymbol)?] (http://mathematica.stackexchange.com/questions/94978/how-to-remove-a-localsymbol-or-cloudsymbol)

In version 10.2 LocalSymbol can be used to create a persistent store of a variable. Once this is created I don’t see a method to remove it. How are are they removed.

LocalSymbol["MySolution"] = 7

...

—————————-

[How can I route edges manually for a Graph?] (http://mathematica.stackexchange.com/questions/95013/how-can-i-route-edges-manually-for-a-graph)

Most graph layouts supported by Mathematica use straight lines for edges; or at least something that only depends on the coordinates of the two adjacent vertices of the edge and nothing else.

A ...

==================================
Greatest hits from previous weeks:
==================================

[Elegant operations on matrix rows and columns] (http://mathematica.stackexchange.com/questions/3069/elegant-operations-on-matrix-rows-and-columns)

Question

The Mathematica tutorial has a section ’Basic Matrix Operations’, describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...

—————————-

[How to make use of Associations?]( http://mathematica.stackexchange.com/questions/52393/how-to-make-use-of-associations)

I have been curious about it for long. Now that Mathematica 10 arrives, I think it’s time to ask the question: How the new Association data structure would be used to improve Mathematica programming?

...

==================================
==================================

[Why is an imported plot diﬀerent from the saved one?] (http://mathematica.stackexchange.com/questions/94757/why-is-an-imported-plot-different-from-the-saved-one)

I have a question concerning the importing of previously saved graphics. So I drew a plot in Mathematica and saved it by right clicking on it and saving it (”save as...”). When I open this (.pdf) ...

—————————-

[Number of 4-colorings of Johnson solids] (http://mathematica.stackexchange.com/questions/95066/number-of-4-colorings-of-johnson-solids)

I want to know the number of 4-colorings for all Johnson solids. This is equivalent to evaluating the ﬂow polynomial for the corresponding polyhedral graphs at $$k=4$$.

I tried the following to get ...

—————————-

[How to have Mathematica pronounce/speak International Phonetic Alphabet?] (http://mathematica.stackexchange.com/questions/95068/how-to-have-mathematica-pronounce-speak-international-phonetic-alphabet)

We know that Speak could read out English words and sentences such as

Speak["this is a sentence"]

Unfortunately, Speak only works for English. Speak[" "] will only yield silence.

In fact ...

### 6.16 Tuesday, September 15, 2015

==================================
Top new questions this week:
==================================

[Spacing out random walks so they don’t overlap] (http://mathematica.stackexchange.com/questions/94363/spacing-out-random-walks-so-they-dont-overlap)

From an external simulation program, I have lots of particle tracks which follow random walks, all of which start at or near the origin $$(0,0)$$. This means that when I plot the walks in Mathematica, ...

—————————-

[How to avoid the wiggly text on Ticks and Labels when rotating 3D objects] (http://mathematica.stackexchange.com/questions/94470/how-to-avoid-the-wiggly-text-on-ticks-and-labels-when-rotating-3d-objects)

Motivation

I’m trying to do a nice animation of the rotation of a ParametricPlot3D . My problem is that the Ticks numbers and AxesLabel text wiggle with an undesirable noisy component as the ...

—————————-

[Eﬃciently generating 2-D Gaussian random ﬁelds on the sphere] (http://mathematica.stackexchange.com/questions/94390/efficiently-generating-2-d-gaussian-random-fields-on-the-sphere)

Context

A couple of years ago I posted this question for an eﬃcient code to generate an n-D Gaussian random ﬁeld (sometimes called processes in other ﬁelds of research), which has applications in ...

—————————-

Why does the following pattern matching not succeed?

ClearAll[f];
SetAttributes[f,Orderless];
HoldForm[f[a,d[],b,c]]/.HoldPattern[f[a,d[],b,z_]]:&gt;{z}
(* f[a,d[],b,c] *)

I expected that because f ...

—————————-

[What are the requirements for a well behaved indexed variable? Subscript, ToExpression, Downvalue?] (http://mathematica.stackexchange.com/questions/94294/what-are-the-requirements-for-a-well-behaved-indexed-variable-subscript-toexpr)

On writing this answer I needed to call a function, (NonlinearModelFit) with an unknown number of parameters.

We have learned that we should not use Subscript for indexing variables because ...

—————————-

[What is wrong with RuleCondition here?] (http://mathematica.stackexchange.com/questions/94413/what-is-wrong-with-rulecondition-here)

Hold@15 /. x_Real :&gt; RuleCondition[N@x, True]
Hold@15 /. x_Real :&gt; RuleCondition[N@25, True]
Hold@25 /. x_Real :&gt; RuleCondition[N@25, True]
Hold@15 /. x_Real :&gt; RuleCondition[N@t,  ...

—————————-

[$$\tt AddTo$$ regression in v10]( http://mathematica.stackexchange.com/questions/94296/tt-addto-regression-in-v10)

As we know we can assign special addition rules to symbols by using UpValues:

ClearAll[mySymbol]
mySymbol /: mySymbol + x_ := {mySymbol, x}

They are used when we directly add something to mySymbol

...

================================== Greatest hits from previous weeks: ==================================

[Elegant operations on matrix rows and columns] (http://mathematica.stackexchange.com/questions/3069/elegant-operations-on-matrix-rows-and-columns)

Question

The Mathematica tutorial has a section ’Basic Matrix Operations’, describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...

—————————-

[What are the most common pitfalls awaiting new users?] (http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users)

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...

================================== Can you answer these? ==================================

[Interfacing Red Pitaya board with Mathematica] (http://mathematica.stackexchange.com/questions/94493/interfacing-red-pitaya-board-with-mathematica)

I just discovered the Red Pitaya board and borrowed a unit to play during this weekend. Surprisingly I did not ﬁnd any reference to Mathematica on the Red Pitaya forum, nor did I ﬁnd any reference ...

—————————-

[Using NMaximize to get integer results for a fractional programming problem] (http://mathematica.stackexchange.com/questions/94549/using-nmaximize-to-get-integer-results-for-a-fractional-programming-problem)

I have an optimization problem that I am trying to model in mathematica (wolfram cloud, to be precise).

Link to notebook for code described here: ...

—————————-

[How to speed up summing a large number of vectors] (http://mathematica.stackexchange.com/questions/94660/how-to-speed-up-summing-a-large-number-of-vectors)

First let me explain what I am trying to do in my code.

Assume that I send a very short chirp (2,000 ms long) into a domain ﬁlled with 20,000 particles randomly scattered in the domain.

The ...

### 6.17 Tuesday, September 8, 2015

==================================
Top new questions this week:
==================================

[Mathematica 10.0.x freezes in Initializing kernels] (http://mathematica.stackexchange.com/questions/92931/mathematica-10-0-x-freezes-in-initializing-kernels)

I updated to Windows 10 and have been running Mathematica ﬁne on it for over a month. For some reason, it has just stopped working. I don’t remember any Windows updates occurring which would have ...

—————————-

[How to restore corrupted ﬁles?] (http://mathematica.stackexchange.com/questions/92814/how-to-restore-corrupted-files)

I have a ﬁle that I can’t reopen because MMa was ”Not Responding” and I had to shut it down.

I found links online to this: http://support.wolfram.com/kb/12423

I executed those two instructions in a ...

—————————-

[No help from ?-command] (http://mathematica.stackexchange.com/questions/94165/no-help-from-command)

I recently upgraded to Mathematica 10.2, and there seem to be a problem with the help system. When typing

?Integrate

I get the following output

Integrate
System
CreateUUID["Info-"]
False
False
...

—————————-

[Syntax for using Tooltip in DiscretePlot] (http://mathematica.stackexchange.com/questions/93990/syntax-for-using-tooltip-in-discreteplot)

Tooltip works ﬁne in ListPlot:

ListPlot[Table[Tooltip[PDF[PoissonDistribution, x]], {x, 0, 20}]]

in which the decimal value of the distribution at a point is revealed when a cursor is placed ...

—————————-

[Fast way to pass an array of integers to Java using JLink] (http://mathematica.stackexchange.com/questions/92878/fast-way-to-pass-an-array-of-integers-to-java-using-jlink)

I am using a package from java to compress a list of integers, this package provide me two methods, one for compress and other one for uncompress. Each of these methods has a version to int [] arrays ...

—————————-

[How to share a notebook?] (http://mathematica.stackexchange.com/questions/92848/how-to-share-a-notebook)

I have a folder in dropbox syncing to my desktop. I tried sharing a notebook ﬁle this way, but this generates lots of errors, conﬂicts, and data loss:

I have notebooks with Dynamic and other ...

—————————-

I’m using GeoGraphics and Polygon[Interpreter[”USState”][”Colorado”]] to create a map of Colorado and several bordering states. With automatic GeoStyling, I get a decent map with cities and roads ...

==================================
Greatest hits from previous weeks:
==================================

[Alternatives to Mathematica] (http://mathematica.stackexchange.com/questions/28162/alternatives-to-mathematica)

Inspired by the recent question Alternatives to LaTeX (currently 58 upvotes) on http://tex.stackexchange.com/

Are there any paid-for or open source alternatives to Mathematica which produce equal or ...

—————————-

[What are the most common pitfalls awaiting new users?] (http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users)

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...

==================================
==================================

[Help nedeed for understanding NDSolve architecture -Vacuum Heating Simulation] (http://mathematica.stackexchange.com/questions/94163/help-nedeed-for-understanding-ndsolve-architecture-vacuum-heating-simulation)

I am a beginner in mathematica and I am facing a problem that is way bigger than my knowledge..

I am tryng to simulate a sempliﬁcated version of Brunel Eﬀect, wich is a Laser-Plasma interaction ...

—————————-

[Strange behavior of autocomplete for ColorData] (http://mathematica.stackexchange.com/questions/94135/strange-behavior-of-autocomplete-for-colordata)

I’m seeing very weird behavior when autocompleting:

Not sure if this is a bug. Is it?

(I have OSX v10.2)

—————————-

I’m using Mathematica on a Ubuntu with a dark theme. When I click on the open ﬁle menu option, it shows up with a white background and white letters. I can only see something if the folder or ﬁle is ...

### 6.18 Tuesday, September 1, 2015

==================================
Top new questions this week:
==================================

I use Mathematica mainly as an aid in symbolic attacks on problems, usually intermediate or harder and often number theoretic. While Reduce, Simplify, et al. are remarkably powerful, they of course ...

[How can I evaluate untrusted Mathematica code in a sandbox?] (http://mathematica.stackexchange.com/questions/92347/how-can-i-evaluate-untrusted-mathematica-code-in-a-sandbox)

Is there any way to build a sandbox to evaluate untrusted Mathematica expressions in order to prevent them from having (malicious or accidental) harmful side eﬀects?

Context: I’m developing a system ...

[Eﬃcient lazy weak compositions] (http://mathematica.stackexchange.com/questions/92647/efficient-lazy-weak-compositions)

In Mathematica all weak k-compositions of integer n can be generated using permutations of integer partitions:

ClearAll[weakCompositionsPermPart]
weakCompositionsPermPart[n_Integer,  ...

[SeriesData sucks when it can. How do I keep SeriesData from sucking?] (http://mathematica.stackexchange.com/questions/92646/seriesdata-sucks-when-it-can-how-do-i-keep-seriesdata-from-sucking)

When I run

Series[f[x]*Sin[x],{x,0,3}, Analytic-&gt;False]

I get:

f[x](x-x^3/3+O[x]^4)

as expected.  In FullForm, this is

Times[f[x],SeriesData[x,0,List[1,0,Rational[-1,6]],1,4,1]]

But  ...

[How to zero (or replace) the diagonal of a square matrix?] (http://mathematica.stackexchange.com/questions/92666/how-to-zero-or-replace-the-diagonal-of-a-square-matrix)

Zeroing the diagonal of a square matrix is an operation I need frequently, but somehow I still haven’t managed to ﬁnd an elegant solution that satisﬁes all these requirements:

works with both ...

[Splitting a list into increasing sublists] (http://mathematica.stackexchange.com/questions/92527/splitting-a-list-into-increasing-sublists)

I have a list of numbers (say, for example, 1,2,3,4,3,2,1,2,3,4,3,2), and I want to split it into sublists so that each sublist is the (smallest) sublist whose sum is larger than the preceding one. ...

[How to detect loops in a vector ﬁeld?] (http://mathematica.stackexchange.com/questions/92425/how-to-detect-loops-in-a-vector-field)

Given a vector ﬁeld and I’d like to detect if there are streamlines in closed patterns. For example, if the input is a vector ﬁeld like this:

image = ColorConvert[Rasterize[$Infinity], ImageSize ... - asked by M.R. (14 votes), answered by nikie (19 votes) ================================== Greatest hits from previous weeks: ================================== [Understanding diﬀerences between Maple and Mathematica in examples picked by Maplesoft] (http://mathematica.stackexchange.com/questions/60124/understanding-differences-between-maple-and-mathematica-in-examples-picked-by-ma) I am reading the document How Maple Compares to Mathematica. On page 15 there is an example where Mathematica produces wrong results. Does anybody know why? MAPLE: MATHEMATICA: Also on page 17 ... - asked by mrz (31 votes), answered by Mr.Wizard (37 votes) [How to express trigonometric equation in terms of of given trigonometric function?] (http://mathematica.stackexchange.com/questions/434/how-to-express-trigonometric-equation-in-terms-of-of-given-trigonometric-functio) How can I express a trigonometric equation / identity in terms of a given trigonometric function? using following trigonometric identities Sin[x]^2+Cos[x]^2==1 Sin[x]/Cos[x]==Tan[x] ... - asked by Prashant Bhate (23 votes), answered by Simon (27 votes) ================================== Can you answer these? ================================== [Creating a certain image (3D shadows, highlighted intersections)] (http://mathematica.stackexchange.com/questions/92494/creating-a-certain-image-3d-shadows-highlighted-intersections) I would like to learn how to code within Mathematica the following picture: I tried using planarShadow[x_, direction_, normal_, darkShadow_: True] := Module[{d, n}, d = Normalize[direction]; ... - asked by boldbrandywine (5 votes) [How to stop auto loading of previously opened notebooks] (http://mathematica.stackexchange.com/questions/92699/how-to-stop-auto-loading-of-previously-opened-notebooks) I’m trying to prevent Mathematica from opening previously opened notebooks when I start it up. I’m using version 10.0.0.0 on Mac OS X Yosemite. I’ve dug around in the preferences, and have tried ... - asked by Peter Wills (2 votes) —————————- [Visualising a 1-(50,15,15) design] (http://mathematica.stackexchange.com/questions/92605/visualising-a-1-50-15-15-design) The problem I have is the visualisation of a $$1-(50,15,15)$$ design. That is a set of $$50$$ points and $$50$$ blocks (lines), so that each point is on $$15$$ lines, and each line contains $$15$$ points. My ... - asked by user32681 (4 votes) ### 6.19 Tuesday, August 25, 2015 ================================== Top new questions this week: ================================== [Strange behavior with Cases and Position with SetDelayed] (http://mathematica.stackexchange.com/questions/91917/strange-behavior-with-cases-and-position-with-setdelayed) I feel like I must be missing something simple and obvious here, but this has me scratching my head. This works as expected: list = {f[a], f[b]}; Cases[list, f[x_] :&gt; x] -&gt; Position[list, ... - asked by rhennigan (16 votes), answered by Leonid Shifrin (15 votes) —————————- [Scraping High-Res images from the MoMA and the Van Gogh Museum websites]( http://mathematica.stackexchange.com/questions/91982/scraping-high-res-images-from-the-moma-and-the-van-gogh-museum-websites) Many art websites allow the user to zoom into an image to see it at high resolution by using image tiles. It is great on the website, but presents problems if one wishes to compile a complete high ... - asked by martin (13 votes), answered by belisarius (16 votes) —————————- [best practices for saving Datasets and TemporalData to a SQL database] (http://mathematica.stackexchange.com/questions/92020/best-practices-for-saving-datasets-and-temporaldata-to-a-sql-database) I have been working with a simulation tool that generates large volumes of data, and it’s time to start saving this to a proper database. Is there an established mechanism for saving TemporalData ... - asked by Michael Stern (12 votes), answered by Leonid Shifrin (6 votes) —————————- [How to determine if a function is continuous?] (http://mathematica.stackexchange.com/questions/91877/how-to-determine-if-a-function-is-continuous) I wish to write code for Riemann Stieltjes integrals in Mathematica. A necessary condition for the theorem to hold is that the function must be continuous. The domain of the function is a closed ... - asked by Katherine (12 votes) —————————- [How to service preemptive computations while running a LibraryLink function?] (http://mathematica.stackexchange.com/questions/91893/how-to-service-preemptive-computations-while-running-a-librarylink-function) Cross-posted to Wolfram Community The following is from the comparison between WSTP (MathLink) and LibraryLink in the documentation: When the Wolfram Language is waiting for a WSTP application ... - asked by Szabolcs (11 votes) —————————- [Why does this LibraryLink example of LinkObject based passing not work? Bug or user error?] (http://mathematica.stackexchange.com/questions/92047/why-does-this-librarylink-example-of-linkobject-based-passing-not-work-bug-or-u) There’s an example of LinkObject-based passing in the LibraryLink documentation. Unfortunately the cell in the documentation notebook is corrupted, but to skip that problem I’m going to reproduce it ... - asked by Szabolcs (9 votes), answered by ilian (6 votes) —————————- [Form of citation for data via Wolfram Mathematica] (http://mathematica.stackexchange.com/questions/92179/form-of-citation-for-data-via-wolfram-mathematica) What citation or reference should I adhere to if I’m using curated data obtained via Mathematica? I’m talking about data, or eg. plots thereof, obtained using functions such as SatelliteData, ... - asked by zentient (9 votes), answered by V-J (5 votes) ================================== Greatest hits from previous weeks: ================================== [Generating visually pleasing circle packs] (http://mathematica.stackexchange.com/questions/40334/generating-visually-pleasing-circle-packs) EDIT: (my conclusion and thank you note) I want to thank you all guys for this unexpected intellectual and artistic journey. Hope you had fun and enjoyed it the same as I did. I would like to ... - asked by VividD (80 votes), answered by level1807 (49 votes) —————————- [What are the most common pitfalls awaiting new users?] (http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users) As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ... - asked by belisarius (263 votes), answered by Michael E2 (139 votes) ================================== Can you answer these? ================================== [Intersecting RegionPlots] (http://mathematica.stackexchange.com/questions/92252/intersecting-regionplots) Does the Mathematica graphics system have any concept of intersecting regionplots? I’ve found about intersecting graphics but not regionplots so far. For example, if I want to show the intersection of ... - asked by Elsa (3 votes) —————————- [MathLink (WSTP) vs LibraryLink performance] (http://mathematica.stackexchange.com/questions/91887/mathlink-wstp-vs-librarylink-performance) Has anyone benchmarked LibraryLink vs MathLink when passing large arrays? Speciﬁcally I would like to know how performance compares when using the following to pass and return a large array: ... - asked by Szabolcs (6 votes) —————————- [Issues adding properties to multigraph] (http://mathematica.stackexchange.com/questions/92014/issues-adding-properties-to-multigraph) Today I was working with a large multi-graph with properties on the edges when I discovered that properties aren’t assigned as expected. My preferred graph construction method is to specify ... - asked by Martin John Hadley (2 votes) ### 6.20 Tuesday, August 18, 2015 ================================== Top new questions this week: ================================== [Given an exact formula, how can Mathematica ﬁnd a probability distribution whose PDF matches it?](http://mathematica.stackexchange.com/questions/91408/given-an-exact-formula-how-can-mathematica-find-a-probability-distribution-whos) So, given some data, Mathematica 10.2 can now attempt to ﬁgure out what probability distribution might have produced it. Cool! But suppose that, instead of having data, we have something that is in ... - asked by Seth Chandler (19 votes), answered by Vitaliy Kaurov (12 votes) —————————- [Improving speed of code computing number of nonrepeating partitions] (http://mathematica.stackexchange.com/questions/91613/improving-speed-of-code-computing-number-of-nonrepeating-partitions) I need to answer the following for a number of parameters: How many ways can the integer $$k$$ be written as a sum of $$n$$ diﬀerent integers ranging from $$1$$ to $$m$$? My initial attempt was the ... - asked by jorgen (16 votes), answered by ciao (14 votes) —————————- [Implementing the PCG random number generator] (http://mathematica.stackexchange.com/questions/91497/implementing-the-pcg-random-number-generator) PCG (”permuted congruential generator”) is a recently-introduced random number generator. PCG is a family of simple fast space-eﬃcient statistically good algorithms for random number generation. ... - asked by blochwave (15 votes), answered by Guess who it is. (13 votes) —————————- [Use Compile to improve performance] (http://mathematica.stackexchange.com/questions/91787/use-compile-to-improve-performance) I’ve recently discovered Compile as a way to optimize my code. I wrote a program to learn something new about Compile. I have a function that creates a vector in the following form: ... - asked by Vanille (14 votes), answered by halirutan (19 votes) —————————- [Why does’t SeedRandom work here?] (http://mathematica.stackexchange.com/questions/91523/why-doest-seedrandom-work-here) From the docs on SeedRandom, SeedRandom[] resets the generator, using as a seed the time of day and certain attributes of the current Wolfram System session. This means that every time I use ... - asked by Szabolcs (14 votes), answered by Mr.Wizard (2 votes) —————————- [How to implement a more eﬃcient inverse triangular recursion?] (http://mathematica.stackexchange.com/questions/91610/how-to-implement-a-more-efficient-inverse-triangular-recursion) Consider the following inverse triangular formula \left( \begin{array}{ccccc} &amp; &amp; &amp; &amp; N_{i-p,p}\left(u_0\right) \\ &amp; &amp; N_{i-2,2}\left(u_0\right) &amp; &amp; - asked by Shutao Tang (11 votes), answered by xzczd (7 votes) —————————- [Nearest Kronecker Product] (http://mathematica.stackexchange.com/questions/91651/nearest-kronecker-product) Some people (see The ubiquitous Kronecker product by Van Loan) have worked on ﬁnding two matrices $$\mathbf A$$,$$\mathbf B$$ of speciﬁed size whose tensor product $$\mathbf A\otimes \mathbf B$$ is closest ... - asked by pdmclean (10 votes), answered by Guess who it is. (10 votes) ================================== Greatest hits from previous weeks: ================================== [How to make use of Associations?] (http://mathematica.stackexchange.com/questions/52393/how-to-make-use-of-associations) I have been curious about it for long. Now that Mathematica 10 arrives, I think it’s time to ask the question: How the new Association data structure would be used to improve Mathematica programming? ... - asked by Yi Wang (87 votes), answered by Leonid Shifrin (96 votes) —————————- [3D surface that looks like a virus] (http://mathematica.stackexchange.com/questions/74193/3d-surface-that-looks-like-a-virus) I have been recently using Mathematica for composing animations that are part of the supplementary information of my papers. I am currently trying to build an animation that involves a viral ... - asked by user2098 (16 votes), answered by Chris Degnen (18 votes) ================================== Can you answer these? ================================== [Restarting random number generators where you left oﬀ] (http://mathematica.stackexchange.com/questions/91612/restarting-random-number-generators-where-you-left-off) I have code that uses both RandomReal and RandomInteger a number of times to produces a sequence of $$n$$ data sets. After closing the notebook and quitting the kernel, I would like to be able to start ... - asked by user26718 (7 votes) —————————- [Swinging Beam example from Help. Not Understanding/Not Working] (http://mathematica.stackexchange.com/questions/91393/swinging-beam-example-from-help-not-understanding-not-working) To help me understand ﬁnite element analysis with Mathematica I have been reading the Finite Element Method User Guide in Help and am stuck on the example in Coupled PDEs. Here there is a static beam ... - asked by Hugh (2 votes) —————————- [Mathematica 10 Audio Export Issue] (http://mathematica.stackexchange.com/questions/91649/mathematica-10-audio-export-issue) Summary of the problem: When exporting data as an audio ﬁle (AIFF/WAV etc.), there appears to be unwanted scaling and oﬀset in the data such that the minimum and maximum values are forced to be -1 ... - asked by Rahul (2 votes) ### 6.21 Tuesday, August 11, 2015 ================================== Top new questions this week: ================================== [Listable compiled function crashes the kernel with ”no more memory available”] (http://mathematica.stackexchange.com/questions/90081/listable-compiled-function-crashes-the-kernel-with-no-more-memory-available) Bug introduced in 9.0.0 and persisting through 10.2.0 I am trying to speed up a function that involves continued fractions. Since ContinuedFraction cannot be compiled and the alternative way with ... - asked by shrx (16 votes) —————————- [Can Mathematica Export Shapeﬁles?] (http://mathematica.stackexchange.com/questions/90063/can-mathematica-export-shapefiles) Mathematica is great at importing ESRI shapeﬁles (.shp). Import["http://exampledata.wolfram.com/usamap.zip", "Graphics"] But it seems like it’s a glaring omission that it can’t export them. ... - asked by kale (16 votes), answered by kale (21 votes) —————————- [Integration of a PDE solution over a custom-deﬁned subdomain] (http://mathematica.stackexchange.com/questions/90094/integration-of-a-pde-solution-over-a-custom-defined-subdomain) Preamble: In my previous question I raised a problem of a custom-chosen integration of the solution of a PDE. In that case it was an integration along a line lying within the PDE domain. The solution ... - asked by Alexei Boulbitch (11 votes), answered by Michael E2 (6 votes) —————————- [Detect if code is running in the cloud] (http://mathematica.stackexchange.com/questions/91202/detect-if-code-is-running-in-the-cloud) Wolfram oﬀers several services for running code in the cloud: Mathematica Online, Programming Cloud, CloudEvaluate, etc. How can a piece of code detect if it is being run in the cloud or the ... - asked by Szabolcs (11 votes), answered by Leonid Shifrin (10 votes) —————————- [Fastest way to sum the upper triangle] (http://mathematica.stackexchange.com/questions/90067/fastest-way-to-sum-the-upper-triangle) I feel like this is an recurring question: if there’s a symmetric matrix whose diagonal is not all 0, how could I get the sum of the part of it that’s above the diagonal as fast as possible? Small ... - asked by arax (10 votes), answered by MarcoB (3 votes) —————————- [Possible bug in VonMisesDistribution?] (http://mathematica.stackexchange.com/questions/90019/possible-bug-in-vonmisesdistribution) Observe: FullSimplify[PDF[VonMisesDistribution[\[Mu], 0], x], (((-Pi + \[Mu] & )*lt; ) = (x & )*lt; ) = Pi + \[Mu]] == FullSimplify[PDF[UniformDistribution[{\[Mu] - Pi, \[Mu] + Pi}], x], (((-Pi + \[Mu] & )*lt; ) = (x & )*lt; ) = Pi + \[Mu]] (* True *) ... - asked by ciao (10 votes), answered by Karsten 7. (7 votes) —————————- [Faster position-based duplicate removal in a ragged array?] Take a ragged 2D array: rArray=4, 2, 1, 0, 2, 2, 0, 0, 3, 3, 3, 4, 0, 3, 4 I need to ”deduplicate” this, where a duplicate is any element of a sublist where that element exists at the ... - asked by ciao (9 votes), answered by sakra (7 votes) ================================== Greatest hits from previous weeks: ================================== [How to ask Mathematica to imitate Andy Warhol’s pop-art painting?] (http://mathematica.stackexchange.com/questions/59132/how-to-ask-mathematica-to-imitate-andy-warhols-pop-art-painting) I tried to ask Mathematica to imitate Andy Warhol, let it convert a Marilyn Monroe’s portrait so that it looks like Warhol’s world famous pop-art painting. However, the result shown below is far from ... - asked by Putterboy (43 votes), answered by belisarius (50 votes) —————————- [How to ﬁnd the position of elements in a list satisfying criteria] (http://mathematica.stackexchange.com/questions/180/how-to-find-the-position-of-elements-in-a-list-satisfying-criteria) Say I have a list x=2,4,6,8,10 and I want to ﬁnd out the positions of the elements that are greater than 7. Select[x, #&gt;7&amp;] gives the elements themselves, and Position[x,8] gives the ... - asked by PeterR (25 votes), answered by Guess who it is. (19 votes) ================================== Can you answer these? ================================== [Mathematica package for explicit matrix representations of group generators?] (http://mathematica.stackexchange.com/questions/89964/mathematica-package-for-explicit-matrix-representations-of-group-generators) While there are several packages that are capable of working with weights and roots (for example LieArt), I couldn’t ﬁnd any package that spits out explicit matrices for the generators, for example ... - asked by JakobH (4 votes) —————————- [Mathematica claiming two Weierstrass half-periods not independent] (http://mathematica.stackexchange.com/questions/91322/mathematica-claiming-two-weierstrass-half-periods-not-independent) I have the following code: f[x_, y_, p_] = (p*(E^(Pi/y)*x + 2*x*Cosh[(2*Pi*x)/y] - 2*Sinh[(2*Pi*x)/y]))/(y*(E^(Pi/y) + 2*Cosh[(2*Pi*x)/y])); y1 = 1/11; t1 = I*y1; p1 = 1; xf = ...  - asked by spietro (1 vote) —————————- [Solving for the roots of a trilinear system of polynomials] http://mathematica.stackexchange.com/questions/91254/solving-for-the-roots-of-a-trilinear-system-of-polynomials I have been trying to solve for the roots of the following system of trilinear polynomials: eq1 = a6 x y + a5 x z + a4 y z + a3 x + a2 y + a1 z + a0; eq2 = x y z + b6 x y + b5 x z + b4 y z + b3 x + ... - asked by Kagaratsch (2 votes)  ### 6.22 Tuesday, August 4, 2015 ================================== Top new questions this week: ================================== [Upgrade to Windows 10] http://mathematica.stackexchange.com/questions/89407/upgrade-to-windows-10 Can users of Mathematica on Windows 7 or Windows 8/8.1 upgrade their computers to Windows 10 – a process that began today? Does Mathematica work? Are all the settings, licenses, access to ﬁles and ... - asked by Lubos Motl (23 votes), answered by RunnyKine (21 votes) —————————- [Solve slower in versions 9 and 10] http://mathematica.stackexchange.com/questions/89650/solve-slower-in-versions-9-and-10 With some systems of equations, Solve is much slower in versions 9 and 10 than in earlier versions, apparently because it is doing more simpliﬁcation of the results. With the following example ... - asked by Simon Rochester (21 votes), answered by Michael E2 (11 votes) —————————- [Speeding up the built-in Rudin-Shapiro and Thue-Morse sequence functions] http://mathematica.stackexchange.com/questions/89345/speeding-up-the-built-in-rudin-shapiro-and-thue-morse-sequence-functions Version 10.2 introduced two well-studied sequences as functions: the (Golay-)Rudin-Shapiro sequence (RudinShapiro[]) and the (Prouhet-)Thue-Morse sequence (ThueMorse[]). Since these functions are ... - asked by Guess who it is. (19 votes), answered by Oleksandr R. (22 votes) —————————- [Change in Lighting and Show in V10?] http://mathematica.stackexchange.com/questions/89491/change-in-lighting-and-show-in-v10 According the documentation for Show: Options explicitly speciﬁed in Show override those included in the graphics expression. The lists of non-default options in the Subscript[g, i] are ... - asked by Michael E2 (13 votes), answered by Mr.Wizard (7 votes) —————————- [Global‘ context not empty at startup in v10.2.0] http://mathematica.stackexchange.com/questions/89686/global-context-not-empty-at-startup-in-v10-2-0 Bug introduced in 10.2 and persisting through 10.2 or later Note that the analysis of this problem revealed a diﬀerent problem than in Potential pollution of Global‘ context in fresh kernel (see ... - asked by Chen Stats Yu (12 votes), answered by Michael E2 (8 votes) —————————- [How to monitor the progress of training a classiﬁer?] http://mathematica.stackexchange.com/questions/89444/how-to-monitor-the-progress-of-training-a-classifier I've had p = Predict[x -&gt; y] running for hours and I have now idea if I should kill it or not. I'm looking for some rough bounds for an estimate of how long Predict[] or Classify[] will take to ... - asked by M.R. (12 votes), answered by Sebastian (12 votes) —————————- [All value types for a symbol?] http://mathematica.stackexchange.com/questions/89607/all-value-types-for-a-symbol Robby Villegas here shows a nice way to see all the types associated with a symbol. He sets a symbol, valueTypes, to an explicit list of the values types in version 3.0 of Mathematica (I took oﬀ his ... - asked by Reb.Cabin (11 votes), answered by Reb.Cabin (6 votes) ================================== Greatest hits from previous weeks: ================================== [How to perform a multi-peak ﬁtting?] http://mathematica.stackexchange.com/questions/26336/how-to-perform-a-multi-peak-fitting I am wondering how to implement the multi-peak detecting and ﬁtting in Mathematica. Following is an example of ﬁtting the data using three peaks (such that the data peak1 + peak2 + peak3). The ... - asked by Everett You (27 votes), answered by Silvia (29 votes) —————————- [Get a ”step-by-step” evaluation in Mathematica] http://mathematica.stackexchange.com/questions/148/get-a-step-by-step-evaluation-in-mathematica Is it possible in Mathematica to get a step-by-step evaluation of some functions; that’s to say, outputting not only the result but all the stages that have led to it? If so, how does one do it? ... - asked by Skydreamer (75 votes), answered by Guess who it is. (61 votes) ================================== Can you answer these? ================================== [Fast Partition of list at depth 2] http://mathematica.stackexchange.com/questions/89809/fast-partition-of-list-at-depth-2 I am looking to partition a list up at a certain depth level. Following code should demonstrate what I mean: test = Table[Random[], {1000}, {32}, {32}]; result = Map[Partition[#, {5, 5}, 1] &amp;, ... - asked by Julian Francis (6 votes) —————————- [ListLogPlot error when forcing y axes start at 0] http://mathematica.stackexchange.com/questions/89524/listlogplot-error-when-forcing-y-axes-start-at-0 I came across an error I can not circumvent. When plotting the following: ListLogPlot[Table[1/x, {x, 1, 100}]] I receive a functioning plot. If I now want to add a speciﬁc PlotRange, i.e. ... - asked by mondo (4 votes) —————————- [DSolve returns an answer that is not a solution] http://mathematica.stackexchange.com/questions/89550/dsolve-returns-an-answer-that-is-not-a-solution Investigating DSolve misses a solution of a diﬀerential equation, I came across this odd behavior of DSolve. The following DSolve command returns an answer to the ODE but the solutions do not ... - asked by Michael E2 (5 votes) ### 6.23 Tuesday, July 28, 2015  ================================== Top new questions this week: ================================== [A With expression local variable speciﬁcation without head List] http://mathematica.stackexchange.com/questions/88920/a-with-expression-local-variable-specification-without-head-list I just noticed a new form of With in its documentation:  With[x=x_0, expr] speciﬁes that all occurrences of the symbol $$x$$ in $$expr$$ should be replaced by $$x_0$$. Note the lack of braces ... - asked by jkuczm (17 votes), answered by Itai Seggev (9 votes) —————————- [New AssociationThread forms in 10.2?] http://mathematica.stackexchange.com/questions/88940/new-associationthread-forms-in-10-2 Is this another case of ”documented” but ”not implemented” ? or at least it is not explained clearly as I cannot make it work: Two new forms appears in the new 10.2 doc. of AssociationThread (the ... - asked by SquareOne (17 votes) —————————- [Visualizing Type System Operations] http://mathematica.stackexchange.com/questions/89080/visualizing-type-system-operations With the introduction of Dataset in version 10, Mathematica acquired a static type-checking subsystem. A fair number of dataset-related questions here on MSE concern the operation of that type ... - asked by WReach (16 votes), answered by WReach (16 votes) —————————- [Dataset seems to break Information] http://mathematica.stackexchange.com/questions/89036/dataset-seems-to-break-information Bug present in version 10.2 My little function, from pre-10.2 ,to turn a headed table into a Dataset. toDataset[table_List] := Dataset@(Association /@ (Function[r, Thread[First[r] -&gt; #] ... - asked by Ymareth (16 votes), answered by WReach (14 votes) —————————- [Initial values in Manipulate are hijacked by existing global variable values] http://mathematica.stackexchange.com/questions/89108/initial-values-in-manipulate-are-hijacked-by-existing-global-variable-values Is the following behaviour a bug? It's the same in all versions between 9.0-10.2.0. Let's try this simple Manipulate with the initial value of a set to 1: Manipulate[Style[a, Large], {{a, 1}, 0, ... - asked by Szabolcs (13 votes) —————————- [Undocumented fourth parameter of Collect; how long has it been there?] http://mathematica.stackexchange.com/questions/88781/undocumented-fourth-parameter-of-collect-how-long-has-it-been-there While tinkering with How to get a list of monomials of a polynomial without coeﬃcients? on a whim I tried a fourth argument in Collect and found: Collect[(x + y + z + 1)^2, {x, y}, foo, bar] ... - asked by Mr.Wizard (13 votes) —————————- [How can we show the boundary of a WordCloud shape?] http://mathematica.stackexchange.com/questions/88846/how-can-we-show-the-boundary-of-a-wordcloud-shape WordCloud can arrange the words inside a shape. data = EntityValue[CountryData[], {"Name", "Population"}]; WordCloud[data, Disk[], WordOrientation -&gt; "Random", Frame -&gt; True] As you can see ... - asked by Szabolcs (12 votes), answered by Sjoerd C. de Vries (12 votes) ================================== Greatest hits from previous weeks: ================================== Parallel and perpendicular symbol from Mathematica to LaTeXhttp://mathematica.stackexchange.com/questions/46538/parallel-and-perpendicular-symbol-from-mathematica-to-latex I want to get the following expression from Mathematica to LaTeX\[ \begin {bmatrix} E_{\parallel } \\ E_{\perp } \end {bmatrix}$ I have tried to use inbuilt ’symbol’ character from the special ...

—————————-

[Generating visually pleasing circle packs] http://mathematica.stackexchange.com/questions/40334/generating-visually-pleasing-circle-packs

EDIT: (my conclusion and thank you note) I want to thank you all guys for this unexpected intellectual and artistic journey. Hope you had fun and enjoyed it the same as I did.

I would like to ...

================================== Can you answer these? ==================================

[Call library function in compile] http://mathematica.stackexchange.com/questions/89134/call-library-function-in-compile

On the Wolfram oﬃcial website, there is an example of calling library function in a compiled function:

Needs["CompiledFunctionTools"]

...

—————————-

[MMA breaks down when DSolve -ing a third-order linear ODE] http://mathematica.stackexchange.com/questions/88862/mma-breaks-down-when-dsolve-ing-a-third-order-linear-ode

My code is:

DSolve[y'''[x] + (x^3 + a^3) y[x] == 0, y[x], x]

It should be noted that similar code not only meets the similar
problem but also returns more warning messages:

DSolve[y'''[x] + (x^3  ...

—————————-

[HistogramList is much Slower in 10.2 vs 10.1] http://mathematica.stackexchange.com/questions/88992/histogramlist-is-much-slower-in-10-2-vs-10-1

While I was running a code I wrote using version 10.1, I noticed that in version 10.2 the running time of the same code was more than twice as long. After some digging, I ﬁgured out the culprit is ...

### 6.24 Tuesday, July 21, 2015

==================================
Top new questions this week:
==================================

[How do I remove grid from this photo?] http://mathematica.stackexchange.com/questions/88494/how-do-i-remove-grid-from-this-photo

I found this cat a month ago, and I’m not his owners’ friend so the mosquito grid was the inevitable problem. I would like to post-process this photo to get rid of it, but I don’t know exactly how ...

—————————-

[What is behind Mathematica’s experimental ‘FindFormula‘ function?] http://mathematica.stackexchange.com/questions/88511/what-is-behind-mathematicas-experimental-findformula-function

In version 10.2 there is a new experimental function: FindFormula.

I suspect that a genetic programming algorithm (symbolic regression) is behind this new feature but I can’t ﬁnd any references.

My ...

—————————-

[Is there a GraphicsPrimitiveQ (or a complete list of Heads of graphics primitives)?] http://mathematica.stackexchange.com/questions/88342/is-there-a-graphicsprimitiveq-or-a-complete-list-of-heads-of-graphics-primitive

For various reasons related to workﬂow associated with creating ﬁgures for journals, I am creating functions that will accept graphics primitives and a set of options and spit out a Graphics object ...

—————————-

[Symbolic area calculation for a parametric self-intersecting closed curve] http://mathematica.stackexchange.com/questions/88623/symbolic-area-calculation-for-a-parametric-self-intersecting-closed-curve

The parametric equation of the curve is: which can be easily ...

—————————-

[What’s the point of ContainsAll, ContainsAny and friends?] http://mathematica.stackexchange.com/questions/88295/whats-the-point-of-containsall-containsany-and-friends

Mathematica 10.2 contains a few new functions that test set containment: ContainsAll, ContainsAny and a few others. The documentation mentions that these are equivalent to existing functions like ...

—————————-

[10.2 Dataset extraneous print using Transpose] http://mathematica.stackexchange.com/questions/88238/10-2-dataset-extraneous-print-using-transpose

Introduced in 10.2, ﬁxed by paclet update (GeneralUtilities 10.2.1).

This is probably patch code in 10.2. Is there a way to turn oﬀ print with Transpose?

ds = &lt;|"k1" -&gt; &lt;|"a" -&gt; 1,  ...

—————————-

[What will happen if I set ExclusionsStyle for points in 2D plot?] http://mathematica.stackexchange.com/questions/88479/what-will-happen-if-i-set-exclusionsstyle-for-points-in-2d-plot

For example

f[x_] := (x^5 - 4 x^2 + 1)/(x - 1/2);
Plot[f[x], {x, -1, 2}, Exclusions -&gt; {f[x] == 0}, ExclusionsStyle -&gt; Dashed]

Has the ExclusionsStyle -&gt; Dashed option done anything ...

================================== Greatest hits from previous weeks: ==================================

I need to get the DateValues of the last 30 days (starting from yesterday, not today!) excluding saturdays and sundays. I want that the dates are german time (GMT + 1). The only solution I have found ...

—————————-

[Assign the results from a Solve to variable(s)] http://mathematica.stackexchange.com/questions/6669/assign-the-results-from-a-solve-to-variables

I understand Mathematica can’t assign the results of a Solve to the unknowns because there may be more than 1 solution. How can I assign the 4 values of following result to variables?

================================== Can you answer these? ==================================

[RegionPlot, RegionPlot3D and diﬀering embedding dimensions] http://mathematica.stackexchange.com/questions/88584/regionplot-regionplot3d-and-differing-embedding-dimensions

RegionPlot seems to be for plotting regions with an embedding dimensions of 2 only, and RegionPlot3D for regions with an embedding dimensions of 3.

Yet passing a region of the wrong embedding ...

—————————-

[How can I force the use of sparse diagonalization methods?] http://mathematica.stackexchange.com/questions/88551/how-can-i-force-the-use-of-sparse-diagonalization-methods

When I evaluate the Eigenvalues function on a very large
(e.g. 2^16 x 2^16) sparse matrix, Mathematica says something like:

Because ﬁnding 65536 out of the 65536 eigenvalues and/or eigenvectors ...

—————————-

By default code copied from the FrontEnd is formatted with backslashes added at the ends of lines. For example, evaluating in a Notebook

Range

and copying the output produces the following when ...

### 6.25 Tuesday, July 14, 2015

==================================
Top new questions this week:
==================================

[New behavior of PlotRange in Mathematica 10] http://mathematica.stackexchange.com/questions/87808/new-behavior-of-plotrange-in-mathematica-10

In Mathematica 10, when I plot data that has small changes around some non-zero value, the plot chooses a PlotRange that ”collapses” the data so that the variations cannot be seen. The only way I can ...

—————————-

[Simple Matrix multiplication takes very long] http://mathematica.stackexchange.com/questions/87857/simple-matrix-multiplication-takes-very-long

Bug introduced in 10.1.0

I came across some strange behaviour during a computation involving matrices with symbolic values. It is reproduced below.

Multiplying a random 30x30 array with symbolic ...

—————————-

[Why does leaving and re-entering a context lose values deﬁned in that context?] http://mathematica.stackexchange.com/questions/88147/why-does-leaving-and-re-entering-a-context-lose-values-defined-in-that-context

I’m getting unexpected behavior when beginning a new context, leaving it, and then re-entering it. Speciﬁcally, when re-entering the context, symbols that had been previously deﬁned in that context ...

—————————-

[Use of Key to extract a key value in Associations not working in V10.1] http://mathematica.stackexchange.com/questions/88034/use-of-key-to-extract-a-key-value-in-associations-not-working-in-v10-1

V10.1:

&lt;|a -&gt; 1|&gt;[Key @ a]
(* Missing["KeyAbsent", Key[a]]*)

V10.0:

&lt;|a -&gt; 1|&gt;[Key @ a]
(* 1 *)

Bug or Design Change?

—————————-

[Using Mathematica to solve a probability problem] http://mathematica.stackexchange.com/questions/88178/using-mathematica-to-solve-a-probability-problem

The problem is from Principles of Statistics by M.G. Bulmer:

In a certain survey of the work of chemical research workers, it was found, on the basis of extensive data, that on average each man ...

—————————-

[What does this message mean and how serious is it?] http://mathematica.stackexchange.com/questions/87891/what-does-this-message-mean-and-how-serious-is-it

I had some Mathematica ﬁles on over which recently I have faced to this message:

However, after searching, I have seen some blogs in Mathematica SE or in somewhere else about that, but I could not ...

—————————-

[Remove static objects from an image sequence] http://mathematica.stackexchange.com/questions/87901/remove-static-objects-from-an-image-sequence

Is it possible to remove static objects/pixels from a sequence of images?

Lets say I have a black square in the middle of my white picture (white background) and a black circle is orbiting around it. ...

================================== Greatest hits from previous weeks: ==================================

[Multivariable Taylor expansion does not work as expected] http://mathematica.stackexchange.com/questions/15023/multivariable-taylor-expansion-does-not-work-as-expected

The basic multivariable Taylor expansion formula around a point is as follows: —————————-

I tried to ask Mathematica to imitate Andy Warhol, let it convert a Marilyn Monroe’s portrait so that it looks like Warhol’s world famous pop-art painting. However, the result shown below is far from ...

================================== Can you answer these? ==================================

[How to add AccuracyGoal and PrecisionGoal options in a numerical function?] http://mathematica.stackexchange.com/questions/88182/how-to-add-accuracygoal-and-precisiongoal-options-in-a-numerical-function

There are many built-in functions that contain AccuracyGoal, PrecisionGoal and WorkingPrecision.

For instance

NSolve

NSolve[x^3 + 2 x + 7 == 0, x, WorkingPrecision -&gt; 40]

{{x -&gt;  ...

—————————-

[What is the best way to take the Bourdet derivative?]http://mathematica.stackexchange.com/questions/87760/what-is-the-best-way-to-take-the-bourdet-derivative

Given a list of paired delta-time, delta-pressure, $$(dt,dp)$$, what might be the best approach to calculate the Bourdet derivative, described below? I am unclear how to manipulate elements of the ...

—————————-

[Dirichlet coeﬃcients as limits: wrong] http://mathematica.stackexchange.com/questions/87766/dirichlet-coefficients-as-limits-wrong

Perhaps I should have included the word ”bug” in my question. Here we go

There is a bug in this Limit

Limit[3^s (-1 - 2^-s + Zeta[s]), s -&gt; \[Infinity]]
(* 0 *)

It should be 1

and there is a  ...



### 6.26 Tuesday, July 7, 2015

==================================
Top new questions this week:
==================================

[Faster binary Hamming weight for big integers?]http://mathematica.stackexchange.com/questions/87486/faster-binary-hamming-weight-for-big-integers

While working on an answer to Count the sequences in an array I found that DigitCount was the bottleneck in my code when used as DigitCount[num, 2, 1]. DigitCount ﬁrst expands the number to an ...

—————————-

[Dataset vs an association of associations]http://mathematica.stackexchange.com/questions/87360/dataset-vs-an-association-of-associations

Associations with a record structure (e.g., a ﬂat table) can be organised in one of two main ways. First as a list of associations, which is also used in the case of Mathematica’s data set ...

—————————-

[Count the sequences in an array]http://mathematica.stackexchange.com/questions/87406/count-the-sequences-in-an-array

Is there a short and easier way to count number of sequences in a list?

Let’s say I have three lists:

list1 = 0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0

list2 = 0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1 ...

—————————-

[Plot is discontinuous (it shouldn’t be)]http://mathematica.stackexchange.com/questions/87504/plot-is-discontinuous-it-shouldnt-be

Plot[{(E^x)^(-2I \[Pi])Hypergeometric2F1[-2I \[Pi]-2I Sqrt\[Pi],
-2I \[Pi]+2I Sqrt\[Pi],1-4I \[Pi],-E^x]+(E^x)^(2I \[Pi])Hypergeometric2F1[2I \[Pi]-2I...

—————————-

[What’s wrong with Simplify and FullSimplify?]http://mathematica.stackexchange.com/questions/87305/whats-wrong-with-simplify-and-fullsimplify

I have a quite complex list of equations and inequalities I combine to a boundary condition for my cost function. After investigation of two days I found the bug (I really name it a bug!). One of my ...

—————————-

[What function generates random numbers in a compiled function?]http://mathematica.stackexchange.com/questions/87364/what-function-generates-random-numbers-in-a-compiled-function

I am writing a simulation for 2D random walk. I wrote several version of code, and found that the speed is like this (fastest to slowest): C++, Mathematica compiled procedural code, Mathematica ...

—————————-

[Trainable WEKA segmentation of images] http://mathematica.stackexchange.com/questions/87256/trainable-weka-segmentation-of-images

Is there a Mathematica equivalent of Trainable WEKA Segmentation as implemented in Fiji, the image processing software? A Google search did not return any relevant links.

I attach the original image ...

================================== Greatest hits from previous weeks: ==================================

[How to make Jacobian automatically in Mathematica] http://mathematica.stackexchange.com/questions/5790/how-to-make-jacobian-automatically-in-mathematica

If we have two vectors, a and b, how can I make Jacobian matrix automatically in Mathematica?

$$a=\left( \begin{array}{c} \text{x1}^3+2\text{x2}^2 \\ 3\text{x1}^4+7\text{x2} \end{array}$$

—————————-

[Assign the results from a Solve to variable(s)] http://mathematica.stackexchange.com/questions/6669/assign-the-results-from-a-solve-to-variables

I understand Mathematica can’t assign the results of a Solve to the unknowns because there may be more than 1 solution. How can I assign the 4 values of following result to variables?

================================== Can you answer these? ==================================

[Does Sum calculate all terms before summing them?] http://mathematica.stackexchange.com/questions/87444/does-sum-calculate-all-terms-before-summing-them

After calculating the sum of a large number of large objects, using

B = Sum[RandomInteger[{0, 1}, {10^6}], {100}];

I ﬁnd that MaxMemoryUsed[] has increased by 400MB, which is about 100 times ...

- asked by Stephen Powell (1 vote)

—————————-

[Performing a convolution for smoothing a function]http://mathematica.stackexchange.com/questions/87674/performing-a-convolution-for-smoothing-a-function

I want to smooth a one-dimensional oscillating function by convolving it with another function that I’ll call the screening function. This screening function should have a trapezoidal form and go to ...

—————————-

[Alternative to use a function as an argument in Compile]http://mathematica.stackexchange.com/questions/87618/alternative-to-use-a-function-as-an-argument-in-compile

I am currently working on problems that require the use of functions such as :

Alpine[x__] := Total@Table[Abs[i*Sin[i] + 0.1*i], {i, x}];
ParabolaMin [x__] := Total@Table[i^2, {i, x}];

It may be  ...

- asked by Doedalos (1 vote)


### 6.27 Tuesday, June 30, 2015

==================================
Top new questions this week:
==================================

[Does Mathematica have a built-in tool that allows one to operate on both sides of an equation?]http://mathematica.stackexchange.com/questions/86906/does-mathematica-have-a-built-in-tool-that-allows-one-to-operate-on-both-sides-o

Geogebra has a very neat CAS view that allows one to solve an equation step by step in the following fashion:

$$\quad \quad \quad \quad \quad \quad \quad \quad \quad$$

You type an equation and ...

—————————-

[Is ColorDistance symmetric?]http://mathematica.stackexchange.com/questions/86730/is-colordistance-symmetric

Is the function ColorDistance symmetric, i.e. is it always true that ColorDistance[a,b] == ColorDistance[b,a], as use of the word distance would suggest?

—————————-

[my Mathematica has turned orange and not able to ﬁnd out why]http://mathematica.stackexchange.com/questions/87072/my-mathematica-has-turned-orange-and-not-able-to-find-out-why

I do not know what happened. But when I rebooted my PC, now Mathematica comes up orange colored. I shut down the PC and tried again, it is still orange. Here is screen shot:

I also did a reset. ...

—————————-

[Solve a trig equation system] http://mathematica.stackexchange.com/questions/86894/solve-a-trig-equation-system

Background of the problem

In the same plane, P is a ﬁxed point, A,B,C are moving point, PA=a, PB=b, PC=c, ﬁnd the maximize perimeter of ?ABC.

let ?BPC=A, ?CPA=B, ?APB=2*Pi-A-B, then the ...

—————————-

[How to retrieve current FaceForm?] http://mathematica.stackexchange.com/questions/86990/how-to-retrieve-current-faceform

The current colour in a Graphics object can be retrieved using CurrentValue[”Color”] for use in Dynamic stuﬀ.

Example:

Graphics[ RGBColor[2/3, 1/3, 2/3], Dynamic[If[CurrentValue[”MouseOver”], ...

—————————-

[Using Simplify on a consistent system returns False]http://mathematica.stackexchange.com/questions/86791/using-simplify-on-a-consistent-system-returns-false

Bug introduced in 8.0 and persisting through 10.1.0 or later

It’s late, but am I missing something here? Why should two independent equations, which together are consistent, Simplify to False?

...

—————————-

[Modifying strings in a list eﬃciently] http://mathematica.stackexchange.com/questions/86778/modifying-strings-in-a-list-efficiently

I have a list of strings $$\{s_1,s_2,\ldots ,s_n\}$$. I would like to to produce the following list of strings:

$$\{s_1&lt;&gt;1,\ 1&lt;&gt;s_2&lt;&gt;1,\ldots,\ 1&lt;&gt;s_n\}$$

In other words, I want ...

================================== Greatest hits from previous weeks: ==================================

[Finding real roots of negative numbers (for example, $$\sqrt {-8}$$)] http://mathematica.stackexchange.com/questions/3886/finding-real-roots-of-negative-numbers-for-example-sqrt3-8

Say I want to quickly calculate $$\sqrt {-8}$$, to which the most obvious solution is $$-2$$.

When I input $$\sqrt {-8}$$ or Power[-8, 3^-1], Mathematica gives the result $$2 (-1)^{1/3}$$. Not what I ...

—————————-

[Parallel and perpendicular symbol from Mathematica to LaTeX] http://mathematica.stackexchange.com/questions/46538/parallel-and-perpendicular-symbol-from-mathematica-to-latex

I want to get the following expression from Mathematica to LaTeX:

\begin{bmatrix}
E_{\parallel} \\ E_{\perp}
\end{bmatrix}

I have tried to use inbuilt ’symbol’ character from the special ...

================================== Can you answer these? ==================================

[Why is the Max function so slow when operating on lists of dates?]http://mathematica.stackexchange.com/questions/87204/why-is-the-max-function-so-slow-when-operating-on-lists-of-dates

Example:

dates = DateRange[DateObject[], DatePlus[DateObject[], 15]]; First[AbsoluteTiming[Max[dates]]]

(* 21.364247 *)

As a workaround, DateObject[Max[AbsoluteTime /@ dates]] will get the same ...

—————————-

[Discrete Fourier Transform baseline subtraction]http://mathematica.stackexchange.com/questions/86951/discrete-fourier-transform-baseline-subtraction

I am trying to remove sinusoidal variability from a set of evenly-spaced intensity vs. time data. These data contain periodic events that are separated by a normalized (but sinusoidally variable) ...

- asked by John (1 vote)

—————————-

[How to use Wolfram language in an external program with low latency?]http://mathematica.stackexchange.com/questions/87168/how-to-use-wolfram-language-in-an-external-program-with-low-latency

Im using Wolfram language on Pi B,and I want to compile a ’.m’ ﬁle (like ”test.m” that contains Wolfram functions), in an external program like a C/C++ and then Export the output in an image ﬁle ...

- asked by Babak akbari (1 vote)

### 6.28 Tuesday, June 23, 2015

==================================
Top new questions this week:
==================================

[Summer Solstice Spurious Correlations Challenge] http://mathematica.stackexchange.com/questions/86413/summer-solstice-spurious-correlations-challenge

I came across this hilarious web site that has charts of bizarre ”correlations” between disparate categories. Results like this:

In the spirit of my summer solstice shedding spuriously earned rep. ...

—————————-

[Is there any Mathematica functionality enabling its use for the blind?]http://mathematica.stackexchange.com/questions/86538/is-there-any-mathematica-functionality-enabling-its-use-for-the-blind

A colleague of mine has become blind as the result of a sudden medical misfortune. We want to help him to feel useful and active again. We, however, still cannot determine what can be done and to what ...

—————————-

[Nearest neighbor search in n-dimensions]http://mathematica.stackexchange.com/questions/86262/nearest-neighbor-search-in-n-dimensions

Suppose a list of items such as: L1 = RandomReal[0, 100, 1000];

I need to ﬁnd the position of each k-neighbor in the original list. And very quickly if possible. As we can see, the problem is ...

—————————-

[HDF5 importing large arrays]http://mathematica.stackexchange.com/questions/86544/hdf5-importing-large-arrays

I have some computations that output a 300,000,000 element array of long unsigned ints, so about 2.4GB, in an h5 ﬁle. Mathematica handles ﬁles south of 2GB ﬁne, albeit taking very long to import ...

—————————-

[How does Rescale[] handle inﬁnities?]http://mathematica.stackexchange.com/questions/86365/how-does-rescale-handle-infinities

Rescale appears to be a simple function. It just does a simple linear $$y = a x + b$$ type rescaling of the values:

Rescale@Range[0, 10] (* 0, 1/10, 1/5, 3/10, 2/5, 1/2, 3/5, 7/10, 4/5, 9/10, 1 *)

...

—————————-

[How to ﬁll the space outside of an image after rotating it]http://mathematica.stackexchange.com/questions/86528/how-to-fill-the-space-outside-of-an-image-after-rotating-it

I want to rotate this image by -50 degrees, and then ﬁll up the black space around the rotated image with a bluish color. I can’t ﬁnd any documentation/answers that suggest how to do it. (Sorry ...

—————————-

[How do I add my own help pages to the in-built Wolfram documentation?]http://mathematica.stackexchange.com/questions/86137/how-do-i-add-my-own-help-pages-to-the-in-built-wolfram-documentation

How do I add my own help pages to the in-built Wolfram documentation ?

================================== Greatest hits from previous weeks: ==================================

[Where can I ﬁnd examples of good Mathematica programming practice?]http://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice

I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ...

—————————-

[How to express trigonometric equation in terms of of given trigonometric function?]http://mathematica.stackexchange.com/questions/434/how-to-express-trigonometric-equation-in-terms-of-of-given-trigonometric-functio

How can I express a trigonometric equation / identity in terms of a given trigonometric function?

using following trigonometric identities

Sin[x]^2+Cos[x]^2==1
Sin[x]/Cos[x]==Tan[x]
...

================================== Can you answer these? ==================================

[Export 3D plot or Graphics3D object as stereoscopic 3D .jps ﬁle]http://mathematica.stackexchange.com/questions/86354/export-3d-plot-or-graphics3d-object-as-stereoscopic-3d-jps-file

I recently came across some Matlab code to output a 3D graph as a stereoscopic left/right .JPS ﬁle, viewable e.g. with 3D Media Viewer, Stereoscopic Player or using any 3D television or beamer: ...

—————————-

[DiscretizeRegion of ImplicitRegion too small]http://mathematica.stackexchange.com/questions/86600/discretizeregion-of-implicitregion-too-small

I have a 2D function that has some sharp peeks within the my domain. I need to ﬁnd a tight region that contains these sharp peeks. The following is an example of what I would like to do.

An example ...

—————————-

[Is it possible to automatically apply Parallelize when possible]http://mathematica.stackexchange.com/questions/86373/is-it-possible-to-automatically-apply-parallelize-when-possible

Parallelize in Mathematica is pretty easy to use. Most of the time, applying Parallelize to an expression, it tries to evaluates expr using automatic parallelization. Is there an option that ...

### 6.29 Tuesday, June 16, 2015

==================================
Top new questions this week:
==================================

[Memoization with pure functions?]http://mathematica.stackexchange.com/questions/85750/memoization-with-pure-functions

Is this possible?

If I have a simple function, say:

f=If[#&gt;0,1,2]&amp;

then for each value of # this will re-evaluate f right?


Is it possible to deﬁne a pure function like this:

...

—————————-

[Trying to Visualize a Collatz - The Collatz conjecture] http://mathematica.stackexchange.com/questions/85718/trying-to-visualize-a-collatz-the-collatz-conjecture

So I’m new in this and learning— and I happen to have this collatz

collatz[x_, y_] := If[x == 3*y || x == 2*y + 1 || y == 3*x || y == 2*x + 2, 2, 0]

Array[#1 + 2 #2 &amp;, {4, 4}]

output =

3, ...

—————————-

[How to plot an emission spectrum?]http://mathematica.stackexchange.com/questions/85990/how-to-plot-an-emission-spectrum

If I have a list of data with various wavelengths in nanometers, how would I plot them on a graph so it looks like this:

So far I have managed to plot a spectrum in DensityPlot, but I have no idea ...

—————————-

[How: 2D scatterplots with quantitative density-dependent coloring]http://mathematica.stackexchange.com/questions/85530/how-2d-scatterplots-with-quantitative-density-dependent-coloring

Consider the following scatterplot of a 50K-point dataset:

ListPlot[data,
AspectRatio -&gt; Automatic, PlotRange -&gt; {{x0, x1}, {y0, y1}},
ImageSize -&gt; Small,
Frame -&gt; True,
...

—————————-

[How to deﬁne a recursive pattern?]http://mathematica.stackexchange.com/questions/85683/how-to-define-a-recursive-pattern

I want to translate this recursive syntactic deﬁnition into a Mathematica pattern1: In other ...

—————————-

[Mathematica: 3D plot based on combined 2D graphs] http://mathematica.stackexchange.com/questions/85717/mathematica-3d-plot-based-on-combined-2d-graphs

I have several sigmoidal ﬁts to 3 diﬀerent datasets, with mean ﬁt predictions plus the 95% conﬁdence limits (not symmetrical around the mean) and the actual data.

I would now like to show these ...

—————————-

I’ve seen the operation described in the title before (basically, swap the heads of the ﬁrst two levels of an expression), but I can’t ﬁnd it...

Does anyone know the function (or idiom/incantation) ...

================================== Greatest hits from previous weeks: ==================================

[Where can I ﬁnd examples of good Mathematica programming practice?]http://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice

I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ...

—————————-

[Is it possible to export the equations from Mathematica to MATLAB?]http://mathematica.stackexchange.com/questions/14035/is-it-possible-to-export-the-equations-from-mathematica-to-matlab

Is it possible to export the output expressions from Mathematica computations (e.g., equations) in valid MATLAB syntax?

================================== Can you answer these? ==================================

[Sub-processes (like XML.exe, GZIP.exe) not ended properly]http://mathematica.stackexchange.com/questions/85668/sub-processes-like-xml-exe-gzip-exe-not-ended-properly

I have diﬃculties with running MathKernel.exe from .NET and sub-processes like XML.exe and GZIP.exe, which are not terminated properly. Sometimes even the MathKernel.exe task stays active and is ...

- asked by akm (1 vote)

—————————-

[Fitting data to a complicated function]http://mathematica.stackexchange.com/questions/85778/fitting-data-to-a-complicated-function

So, where to begin. I have a certain dataset that I want to ﬁt to a function. However, the function is rather complicated (matrix inversions, linearsolve) and does in general not have a closed form ...

—————————-

[Partitioning Table]http://mathematica.stackexchange.com/questions/85820/partitioning-table

I have a long vector array in the following format:

x1,y1,z1,a,b,c,x1,y1,z2,d,e,f,...,x1,y2,z1,g,h,i,x1,y2,z2, ...

### 6.30 Tuesday, June 9, 2015

==================================
Top new questions this week:
==================================

[Error ”Throw::nocatch: Uncaught Throw[False] returned to top level” given each time I open a new Mathematica 10.1 session]http://mathematica.stackexchange.com/questions/85013/error-thrownocatch-uncaught-throwfalse-returned-to-top-level-given-each-t

From a few days now each time I open a new Mathematica session I get the small error messages window with the error

Throw::nocatch: Uncaught Throw[False] returned to top level.

repeatedly given, as ...

—————————-

[Is it possible to extract data from an eps plot not generated in Mathematica?]http://mathematica.stackexchange.com/questions/85320/is-it-possible-to-extract-data-from-an-eps-plot-not-generated-in-mathematica

I want to extract data from an eps plot not generated in Mathematica and replot it. In general is it possible to extract data from plots in any formats in Mathematica? I searched but unfortunately ...

—————————-

[Mimic a procedural, recursive clustering algorithm for site percolation using functional programming]http://mathematica.stackexchange.com/questions/85185/mimic-a-procedural-recursive-clustering-algorithm-for-site-percolation-using-fu

Sorry in advance for my logorrhea: I just want to make sure all of the information is here.

Context and Question

I am investigating site percolation on a square lattice. I have a working, ...

—————————-

[Subtracting two plots from each other after shifting one]http://mathematica.stackexchange.com/questions/85420/subtracting-two-plots-from-each-other-after-shifting-one

I have the following lists representing energy spectra that need to be subtracted from each other to produce a diﬀerence spectrum.

data1 = ...

—————————-

[Lookup with default broken in Dataset]http://mathematica.stackexchange.com/questions/85114/lookup-with-default-broken-in-dataset

Given an Association,

data = &lt;|"1" -&gt; &lt;|"A" -&gt; 10, "B" -&gt; 20|&gt;,
"2" -&gt; &lt;|"C" -&gt; 30, "B" -&gt; 40|&gt;|&gt;

Lookup works w/ default:

 data // Map[Lookup[#, "A", 0]  ...

—————————-

[Confused by the opts : OptionsPattern[ ] pattern] http://mathematica.stackexchange.com/questions/85347/confused-by-the-opts-optionspattern-pattern

I’m trying to make sense of the syntax in the clause opts:OptionsPattern[], as found in this standard ”rule-based” (pseudo-)function deﬁnition pattern:

aFunction[a1_, a2_, a3_,  ...

—————————-

[Why Mathematica cannot apply The Fundamental Theorem of Calculus automatically?] http://mathematica.stackexchange.com/questions/85166/why-mathematica-cannot-apply-the-fundamental-theorem-of-calculus-automatically

For some reason Mathematica cannot evaluate this deﬁnite integral:

\$Version
(* 10.1.0  for Microsoft Windows (64-bit) (March 24, 2015) *)

Integrate[1/(Sqrt[x] Sqrt[1 - x + x^2]), {x, 1, 2}]
(*  ...

================================== Greatest hits from previous weeks: ==================================

[How to make an inkblot?] http://mathematica.stackexchange.com/questions/3345/how-to-make-an-inkblot

How to eﬀectively create a polygon that looks like a realistic inkblot? So far, I could come up with this (borrowing from Ed Pegg Jr.’s Rorschach demonstration):

RandomBlot[num_, opts___] :=  ...

—————————-

[1 Plot, 2 Scale/Axis] http://mathematica.stackexchange.com/questions/627/1-plot-2-scale-axis

I would like to plot those two datasets on top of each other. But they have very diﬀerent range on the $$y$$ axis. How can I have two diﬀerent axis?

I found the following on the help menu but quite ...

================================== Can you answer these? ==================================

[ConvexHullMesh sometimes excludes valid points from convex hull] http://mathematica.stackexchange.com/questions/85466/convexhullmesh-sometimes-excludes-valid-points-from-convex-hull

I have a sequence of polytopes that I am trying to visualize, and I ﬁnd that ConvexHullMesh sometimes excludes points from the convex hull, and it does so inconsistently.

In particular, notice these ...

—————————-

[How to specify ﬁnite diﬀerence approximation order in ‘NDSolve‘] http://mathematica.stackexchange.com/questions/85439/how-to-specify-finite-difference-approximation-order-in-ndsolve

According to here, NDSolve, when using the method of lines, creates partial derivatives in the spacial coordinate (lets talk just about one spacial coordinate for now) using the ﬁnite diﬀerence ...

- asked by rspencer (1 vote)

—————————-

[Better to have inﬁnities in limits or integrands (‘NIntegrate‘)?] http://mathematica.stackexchange.com/questions/85483/better-to-have-infinities-in-limits-or-integrands-nintegrate

I'm using ListPlot to plot the integral of a function with respect of the function's second variable:
ListPlot[NIntegrate[integrand[x, #], {x, -Infinity, 0}]&amp;/@Range[10, 20]]. The integral  ...

### 6.31 Tuesday, June 2, 2015

==================================
Top new questions this week:
==================================

[Python-style plots in Mathematica] http://mathematica.stackexchange.com/questions/84877/python-style-plots-in-mathematica

I love making plots in Mathematica. And i love to spend a lot of time making high-quality plots that maximize readability and aesthetics. For most cases, mathematica can make very beautiful images, ...

—————————-

[Numerically solving Helmholtz equation in 3D for arbitrary shapes] http://mathematica.stackexchange.com/questions/84726/numerically-solving-helmholtz-equation-in-3d-for-arbitrary-shapes

Context

While studying manifold Learning I got interested in ﬁnding the eigenvectors of the Laplacian. (also in connection to this problem of solving the heat equation)

Following this and that ...

—————————-

[Can A Plot Be Overlayed With A Map?] http://mathematica.stackexchange.com/questions/84598/can-a-plot-be-overlayed-with-a-map

Some brief, only slightly important background. I am doing a research project using the data from NASA’s GRACE mission. I wrote a short Perl script to take two data ﬁles and ﬁnd the change in ...

—————————-

[How can we make publication-quality PlotMarkers without version 10?] http://mathematica.stackexchange.com/questions/84857/how-can-we-make-publication-quality-plotmarkers-without-version-10

Suppose that for certain reasons we are not yet using Mathematica version 10, or we have a version with buggy PlotMarkers. It is well known that the default markers are font glyphs, and as a result ...

—————————-

[Eigenfunctions of the Laplacian on an arbitrary mesh] http://mathematica.stackexchange.com/questions/84607/eigenfunctions-of-the-laplacian-on-an-arbitrary-mesh

So, I’ve constructed a mesh over which I’d like to ﬁnd eigenfunctions of Laplace’s equation with a free boundary (a zero Neumann boundary condition along the edge).

Mostly because I ﬁgured an ...

—————————-

[Why is ListPlot so slow here?] http://mathematica.stackexchange.com/questions/84739/why-is-listplot-so-slow-here

While examining How can I monitor the progress of a Plot? I was surprised to discover that in some cases ListPlot in version 10.0 and 10.1 is orders of magnitude slower than it is in version 7. This ...

—————————-

[Is there a way to control which special forms Normal converts?] http://mathematica.stackexchange.com/questions/84783/is-there-a-way-to-control-which-special-forms-normal-converts

Normal[expr] converts expr to a normal expression, from a variety of special forms.

But is there a way to control which special forms it converts and which it does ...

================================== Greatest hits from previous weeks: ==================================

[Get a ”step-by-step” evaluation in Mathematica] http://mathematica.stackexchange.com/questions/148/get-a-step-by-step-evaluation-in-mathematica

Is it possible in Mathematica to get a step-by-step evaluation of some functions; that’s to say, outputting not only the result but all the stages that have led to it? If so, how does one do it?

...

—————————-

[Plotting Complex Quantity Functions] http://mathematica.stackexchange.com/questions/3458/plotting-complex-quantity-functions

Trying to plot with complex quantities seems not to work properly in what I want to accomplish. I would like to know if there is a general rule/way of plotting when you have complex counterparts in ...

================================== Can you answer these? ==================================

[Why is setting SynchronousUpdating -¿ True causes mouse motion to pause/freeze Dynamics?] http://mathematica.stackexchange.com/questions/84826/why-is-setting-synchronousupdating-true-causes-mouse-motion-to-pause-freeze-d

When making a Manipulate, I noticed that setting SynchronousUpdating -&gt; True
have a very annoying side effect. By just moving the mouse anywhere on
the same cell the Manipulate is running, causes  ...

—————————-

[Using a Mathematica index as a DiscreteVariable in NDSolve when solving a coupled set of ordinary diﬀerential equations] http://mathematica.stackexchange.com/questions/84471/using-a-mathematica-index-as-a-discretevariable-in-ndsolve-when-solving-a-couple

Context

Since the explanation below of the problem to be solved is lengthy, let me preamble this by saying that I have code that works to solve the problem, but I don’t know whether (1) it’s ...

—————————-

[Why is Transpose Dataset slow in one direction]http://mathematica.stackexchange.com/questions/84585/why-is-transpose-dataset-slow-in-one-direction

Transpose is faster when it distributes Keys at the 2nd level of a Dataset than when it factors them out.

 ds[len_] := &lt;|"a" -&gt; Range[len], "b" -&gt; (1/Range[len] // N)|&gt; // Dataset

...

### 6.32 Tuesday, May 26, 2015

==================================
Top new questions this week:
==================================

[A bug in Integrate] http://mathematica.stackexchange.com/questions/84089/a-bug-in-integrate

Integrate[(1 + 16 Tan[2 x - y]^2)/(1 + 4 Tan[2 x - y]^2), {x, 0, 2 Pi}]

Mathematica (wrong) output is (tested under versions 8 and 10.0, took   1 minute of CPU time)

10 Pi

The correct value of this ...

—————————-

[What is the FrontEnd?] http://mathematica.stackexchange.com/questions/84173/what-is-the-frontend

Can anyone sort out what the Front-End is, how it is structured and what its relationship to the Kernel is. The FrontEnd is mentioned quite often but elusively avoids to be caught and clearly deﬁned. ...

—————————-

[Regime Change Stochastic Process] http://mathematica.stackexchange.com/questions/84054/regime-change-stochastic-process

I would like to simulate an Ito process in which the drift and diﬀusion terms change after hitting a boundary for the ﬁrst time.

For example, a Geometric Brownian Motion X which has 0 drift and ...

—————————-

[How to speed up Colorize] http://mathematica.stackexchange.com/questions/83967/how-to-speed-up-colorize

I have a list of about 500 images similar to the following:

A = Import["http://i.stack.imgur.com/1bV4O.png"]
AbsoluteTiming[Colorize[A, ColorFunction -&gt; "AvocadoColors"]]

Gives   0.6 ...

—————————-

[Does Mathematica have an equivalent of Python’s float.as_integer_ratio?] http://mathematica.stackexchange.com/questions/84234/does-mathematica-have-an-equivalent-of-pythons-float-as-integer-ratio

The Python programming language has a float.as_integer_ratio(x)
function which exactly converts an IEEE 754 floating-point number
into a numerator/denominator pair of integers. For example:

...

—————————-

[Does Mathematica have an equivalent of C’s nextafter?]http://mathematica.stackexchange.com/questions/84237/does-mathematica-have-an-equivalent-of-cs-nextafter

In C (and many other programming languages), there is a function

double nextafter(double x, double y)

which takes two (IEEE 754) ﬂoating-point numbers and returns the next representable ...

—————————-

[How can I make FilledCurve smoother?]http://mathematica.stackexchange.com/questions/84247/how-can-i-make-filledcurve-smoother

In How can I generate and randomly assign color to annular sectors? J.M. showed an interesting way to create a sector graphic using FilledCurve. Unfortunately it was marred by an inferior rendering ...

================================== Greatest hits from previous weeks: ==================================

[Alternatives to Mathematica]http://mathematica.stackexchange.com/questions/28162/alternatives-to-mathematica

Inspired by the recent question Alternatives to LaTeX (currently 58 upvotes) on http://tex.stackexchange.com/:

Are there any paid-for or open source alternatives to Mathematica which produce equal or ...

—————————-

[How do I draw a pair of buttocks?]http://mathematica.stackexchange.com/questions/66538/how-do-i-draw-a-pair-of-buttocks

I’m trying to develop a function which 3D plot would have a buttocks like shape.

Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ...

================================== Can you answer these? ==================================

[Simpliﬁcation with absolute value]http://mathematica.stackexchange.com/questions/83933/simplification-with-absolute-value

I have a long expression that has absolute values in the exponent. Some parts of the expression would clearly simplify if one assumes that the power is an odd or even integer. When I give one of this ...

- asked by Jools (1 vote)

—————————-

[Wrong Limit with LaguerreL] http://mathematica.stackexchange.com/questions/84077/wrong-limit-with-laguerrel

Limit[(n!LaguerreL[n,-1]/(n^(n+1/4)/Sqrt/E^(n-2Sqrt[n]+1/2))-1)Sqrt[n],n-&gt;\[Infinity]]

Mathematica (wrong) output

13/16 = 0.8125

The right result is:

31/48 = 0.645833...

But numerically it ...

—————————-

[Fast construction and reshaping of large tensors]http://mathematica.stackexchange.com/questions/83999/fast-construction-and-reshaping-of-large-tensors

I’m trying to construct a large matrix which is derived from some higher rank tensor (the rank of interest to me changes case by case, so it needs to be a general method). Currently, the process of ...

- asked by user12876 (1 vote)

### 6.33 Tuesday, May 19, 2015

==================================
Top new questions this week:
==================================

[Why is calling Dot with many arguments so ineﬃcient?] http://mathematica.stackexchange.com/questions/83412/why-is-calling-dot-with-many-arguments-so-inefficient

Say I want to multiply a reasonably large list of symbolic matrices.

tab =
Partition[#,4]&amp;/@
Table[
Symbol[CharacterRange["a","z"][[nm]]&lt;&gt;ToString[nn]],{nn,1,12},{nm,1,16}];

...

—————————-

[Performance problems in new Sequence functions]http://mathematica.stackexchange.com/questions/83325/performance-problems-in-new-sequence-functions

The new-in-10.1 Sequence* family of functions should provide newly optimized methods for handling sequence problems. Happily in some cases they do! For example Murta reports 28 times faster ...

—————————-

[What are SparseArray Properties? How and when should they be used?]http://mathematica.stackexchange.com/questions/83721/what-are-sparsearray-properties-how-and-when-should-they-be-used

A strange undocumented form of SparseArray is increasingly used in answers on this site:

SparseArray[(* data *)][”NonzeroPositions”]

What is this, and why would anyone want to use this? Are there ...

—————————-

[A better (but slower) FullSimplify function]http://mathematica.stackexchange.com/questions/83756/a-better-but-slower-fullsimplify-function

I am creating this question and posting an answer to it as a help for those who have problems with Mathematica simpliﬁcation oddities that appear in many other questions on the site.

First of all, ...

—————————-

[Is there a programmatic equivalent of Edit ¿ Find…?]http://mathematica.stackexchange.com/questions/83492/is-there-a-programmatic-equivalent-of-edit-find

Most things that can be done via the front-end interface in Mathematica can also be accomplished by some function. Is that the case for ﬁnd-and-replacing? That is, is there some code I could execute ...

—————————-

[Is FullGraphics an abandoned function? Is there an alternative?]http://mathematica.stackexchange.com/questions/83648/is-fullgraphics-an-abandoned-function-is-there-an-alternative

FullGraphics hasn’t worked entirely for a long time and the situation appears to be getting worse instead of better. In Mathematica 10.0 and 10.1 a simple usage throws numerous errors and returns a ...

—————————-

[How to ﬁnd all the positions of max value of a list eﬃciently?]http://mathematica.stackexchange.com/questions/83602/how-to-find-all-the-positions-of-max-value-of-a-list-efficiently

For Example, list=RandomInteger[1,100,2000]. Yes,I know Position[list,Max[list]] can do. But it’s based on pattern matching! Ordering[list,-1] could ﬁnd one position but not all. So how to ...

================================== Greatest hits from previous weeks: ==================================

[How to make use of Associations?]http://mathematica.stackexchange.com/questions/52393/how-to-make-use-of-associations

I have been curious about it for long. Now that Mathematica 10 arrives, I think it’s time to ask the question: How the new Association data structure would be used to improve Mathematica programming?

...

—————————-

[How to ﬁnd the position of elements in a list satisfying criteria] http://mathematica.stackexchange.com/questions/180/how-to-find-the-position-of-elements-in-a-list-satisfying-criteria

Say I have a list x=2,4,6,8,10 and I want to ﬁnd out the positions of the elements that are greater than 7.

Select[x, #&gt;7&amp;] gives the elements themselves, and Position[x,8] gives the  ...

================================== Can you answer these? ==================================

[Indeterminate expression 0(I*Inﬁnity]) on indeﬁnite integrals on ﬁrst use only]http://mathematica.stackexchange.com/questions/83450/indeterminate-expression-0iinfinity-on-indefinite-integrals-on-first-use-onl

I do not know if this is new or not, I googled before.

Windows 7, 10.1 64 bit: Integrals generate this error message

The strange thing also is that the message shows up the ﬁrst time the command ...

—————————-

[Undo automatic update] http://mathematica.stackexchange.com/questions/83795/undo-automatic-update

I was working with Predict function (with a neural network and today, and when I executed the same notebook I have been working for some time, Machine Learning package was automatically updated (it ...

—————————-

[How to match the arguments of the function in any order] http://mathematica.stackexchange.com/questions/83396/how-to-match-the-arguments-of-the-function-in-any-order

The issue is the following, with a dumb function with (4) arguments of (4) diﬀerent heads (for each head is always no grater than one arguments):

func[x_a,y_b,z_c,w_d] := Print[x,y,z,w]

If I type ...

### 6.34 Tuesday, May 12, 2015

==================================
Top new questions this week:
==================================

[Documentation of the frequently-used functions in the context of Internal‘ and Compile‘] http://mathematica.stackexchange.com/questions/82790/documentation-of-the-frequently-used-functions-in-the-context-of-internal-and-c

In this site, I have gradually found out that there is a collection of functions in all kinds of answers. For instance, Compile‘GetElement, Internal‘Bag,etc. However, these functions are undocumented. ...

—————————-

[Does Mathematica store hidden information for matrix objects?]http://mathematica.stackexchange.com/questions/82854/does-mathematica-store-hidden-information-for-matrix-objects

Bug introduced in 10.0.0 and persisting through 10.1.0 or later

I found a case where calling one built-in function (HermitianMatrixQ) for a given matrix changes the behavior of another built-in ...

—————————-

[What’s going on with performance of Tally here?]http://mathematica.stackexchange.com/questions/82978/whats-going-on-with-performance-of-tally-here

Observe:

l1 = l2 = RandomInteger[1, 100000, 1000000]; l2[[-1]] = -1; t1 = First@Timing@Tally[l1]; t2 = First@Timing@Tally[l2];

l1 = l2 = RandomInteger[1, 100000, 1000100]; l2[[-1]] = -1; t3 = ...

—————————-

[Hightlight all the self-intersections of a Lissajous ﬁgure]http://mathematica.stackexchange.com/questions/83118/hightlight-all-the-self-intersections-of-a-lissajous-figure

This graph–also known as a Lissajous ﬁgure–contains so many self-intersections.How can I highlight them?

ParametricPlot[{Sin[100 t], Sin[99 t]}, {t, 0, 2 Pi},
PlotRange -&gt; All]

—————————-

[Is MathieuC for moderately large imaginary arguments broken?] http://mathematica.stackexchange.com/questions/83032/is-mathieuc-for-moderately-large-imaginary-arguments-broken

I’m trying to plot MathieuC[-3,0.3,I x] for $$x\in [0,10]$$, and here’s what I get (using ListPlot and Table instead of Plot to make computation faster and use a regular grid):

...

—————————-

[In 10.1.0 BenchmarkPlot doesn’t work?] http://mathematica.stackexchange.com/questions/83226/in-10-1-0-benchmarkplot-doesnt-work

In Mathematica 10.1.0 BenchmarkPlot from the GeneralUtilities package doesn’t work; copying Taliesin Beynon’s initial use of the function on this site:

Needs["GeneralUtilities"]

myPosIdx[x_] :=  ...

—————————-

[How to ContourPlot a function of the coordinates on the Earth’s surface on a map projection] http://mathematica.stackexchange.com/questions/83050/how-to-contourplot-a-function-of-the-coordinates-on-the-earths-surface-on-a-map

There are two similar questions (this and this), but one is too speciﬁc and the other is apparently not clear and has no answers. I’ll try to make the question more complete.

Suppose you have a ...

================================== Greatest hits from previous weeks: ==================================

[Is it possible to export the equations from Mathematica to MATLAB?] http://mathematica.stackexchange.com/questions/14035/is-it-possible-to-export-the-equations-from-mathematica-to-matlab

Is it possible to export the output expressions from Mathematica computations (e.g., equations) in valid MATLAB syntax?

—————————-

[How do I draw a pair of buttocks?] http://mathematica.stackexchange.com/questions/66538/how-do-i-draw-a-pair-of-buttocks

I’m trying to develop a function which 3D plot would have a buttocks like shape.

Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ...

================================== Can you answer these? ==================================

[Negative accuracy numerics ( 0“-128 notation )] http://mathematica.stackexchange.com/questions/82683/negative-accuracy-numerics-0-128-notation

What does it mean to have a negative accuracy number?

I understand 0“128 to mean ”the number zero to 128 decimal points”. Mathematica corroborates this:

In:= 0128 &lt; 1
(* Out= True *)
...

—————————-

[Orthogonal projection of NURBS surface]http://mathematica.stackexchange.com/questions/82855/orthogonal-projection-of-nurbs-surface

How can one make an orthogonal projection of NURBS surface? For example the one from wolfram demos http://demonstrations.wolfram.com/DesigningACarBodyWithSplines/.

—————————-

[DiracDelta and version 10.0.0] http://mathematica.stackexchange.com/questions/83198/diracdelta-and-version-10-0-0

Note: This issue seems to aﬀect version 10.0.0 only and is ﬁxed in 10.0.1, 10.0.2, and 10.1

When evaluating the following two inputs:

Integrate[DiracDelta[1-x] DiracDelta[y-2] Sin[x] Cos[y], x, ...

### 6.35 Tuesday, May 5, 2015

==================================
Top new questions this week:
==================================

[Two, maybe related, issues with ParallelTable] http://mathematica.stackexchange.com/questions/82496/two-maybe-related-issues-with-paralleltable

I will use a very simple example for demonstrating two issues I face with ParallelTable, one with respect to the speed and one with respect to the use of memory. These issues might be related.

Let us ...

—————————-

[Switch from logarithmic to linear scaling partway along a plot’s axis] http://mathematica.stackexchange.com/questions/82581/switch-from-logarithmic-to-linear-scaling-partway-along-a-plots-axis

In the 2015 Planck satellite results, they give the latest plot of the temperature power spectrum of the cosmic microwave background, which I show below. (I am only interested in the main plot; you ...

—————————-

[Solving and Animating Three Body Problem] http://mathematica.stackexchange.com/questions/81340/solving-and-animating-three-body-problem

I am attempting to solve a three-body problem using the Lagrange formalism, with a 1/r potential.

I started oﬀ by deﬁning T and U (kinetic and potential energy) as follows:

Tx = .5 m1  x1'[t]^2 +  ...

—————————-

[Analyze touching particles with holes in a microscopic image] http://mathematica.stackexchange.com/questions/81176/analyze-touching-particles-with-holes-in-a-microscopic-image

I am looking for an easy method to count individual particles in a microscopic image. It is quite diﬃcult for Mathematica to detect them, because they are touching each other. I am quite a beginner ...

—————————-

[How do I draw a polygon deﬁned by a list of data points?] http://mathematica.stackexchange.com/questions/81191/how-do-i-draw-a-polygon-defined-by-a-list-of-data-points

I am attempting to make a 3D model of a device deﬁned by a list of x,y,z points, digitized from a 2D image. The z coordinate is deﬁned in mma.

What I tried so far:

area = 0, 452.45658, ...

—————————-

[Is there a good reason for the removal of this FrameTicks syntax?] http://mathematica.stackexchange.com/questions/82625/is-there-a-good-reason-for-the-removal-of-this-frameticks-syntax

In past versions of Mathematica one could use a terse syntax for FrameTicks:

bottom, left, top, right

In 10.1 this syntax is no longer recognized requiring the addition of two sets of brackets:

...

—————————-

[How to remove outliers from data] http://mathematica.stackexchange.com/questions/81121/how-to-remove-outliers-from-data

I have a data with noise which some times includes signiﬁcant outliers. The position of the outliers are random.

For example:

data1 = Table[PDF[NormalDistribution[3.5, .8], i], i, -5, 15, .01] + ...

================================== Greatest hits from previous weeks: ==================================

[1 Plot, 2 Scale/Axis] http://mathematica.stackexchange.com/questions/627/1-plot-2-scale-axis

I would like to plot those two datasets on top of each other. But they have very diﬀerent range on the $$y$$ axis. How can I have two diﬀerent axis?

I found the following on the help menu but quite ...

—————————-

[How to ﬁnd the position of elements in a list satisfying criteria] http://mathematica.stackexchange.com/questions/180/how-to-find-the-position-of-elements-in-a-list-satisfying-criteria

Say I have a list x=2,4,6,8,10 and I want to ﬁnd out the positions of the elements that are greater than 7.

Select[x, #&gt;7&amp;] gives the elements themselves, and Position[x,8] gives the  ...

================================== Can you answer these? ==================================

I’m trying to Manipulate a Graphics3D ﬁgure, and am seeing some errors. If I execute the following code, and move the slider, the head on one of arrows bounces around, unattached to the line of the ...

—————————-

[How to deﬁne $$\operatorname {Mc}$$ and $$\operatorname {Ms}$$ Mathieu functions in terms of MathieuC and MathieuS?] http://mathematica.stackexchange.com/questions/81395/how-to-define-operatornamemc-and-operatornamems-mathieu-functions-in-t

Reading multiple books about Mathieu functions, I always come across notation like $$\operatorname {ce}_r(z,q)$$, $$\operatorname {se}_r(z,q)$$ for angular functions and $$\operatorname {Ce}_r(z,q)$$, ...

—————————-

[Partial Diﬀerential Formatting by default] http://mathematica.stackexchange.com/questions/82629/partial-differential-formatting-by-default

http://blog.wolfram.com/2011/12/15/mathematica-qa-series-converting-to-conventional-mathematical-typesetting/

and I could use pdConv mentioned there, or

pdConv[f_] :=  TraditionalForm[ f  ...

- asked by Hojin Cho (1 vote)

### 6.36 Tuesday, April 28, 2015

==================================
Top new questions this week:
==================================

[Removing a histogram’s vertical edges]http://mathematica.stackexchange.com/questions/80949/removing-a-histograms-vertical-edges

Let’s say I have a histogram:

Histogram[RandomVariate[NormalDistribution[10, 2], 500]]

How can I remove vertical lines inside the histogram and keep only the edge?

—————————-

[Generating animations of clouds with Mathematica]http://mathematica.stackexchange.com/questions/80486/generating-animations-of-clouds-with-mathematica

I’d like to generate some visually-pleasing animations of clouds, fog or smoke with Mathematica. My idea of ”visually-pleasing” is along the lines of one of the images on the Wikipedia article for ...

—————————-

[Better way to visualize cylinder puzzle solution]http://mathematica.stackexchange.com/questions/80902/better-way-to-visualize-cylinder-puzzle-solution

The above puzzle has been a recent source of amusement in my clique.

I decided to provide a visualization to motivate solution (here):

My code:

s[x_] := Piecewise[{{4 Mod[x, 3]/3,
...

—————————-

[Mathematica 10.1.0.0 (OS X) high CPU usage even for empty notebook]http://mathematica.stackexchange.com/questions/80630/mathematica-10-1-0-0-os-x-high-cpu-usage-even-for-empty-notebook

Since update to 10.1.0.0 Mathematica has a high CPU usage even when no evaluation is running (even for empty notebook opened). I am running OS X Yosemite 10.10.3 on the following conﬁguration:

...

—————————-

[Right Ascension and Declination in astronomical functions] http://mathematica.stackexchange.com/questions/80787/right-ascension-and-declination-in-astronomical-functions

In the process of answering this question, I was forced to confront the various astronomical coordinate systems used by Mathematica.

Background

In astronomy, positions of celestial objects (stars, ...

—————————-

[Can’t inject EncryptedObject] http://mathematica.stackexchange.com/questions/80763/cant-inject-encryptedobject

Here are minimal examples:

encryptedObj = Encrypt["pass", "TestCase"];

Decrypt["pass", encryptedObj] (*returns correct "TestCase"*)

With[{x = encryptedObj}, Button["Try with", Decrypt["pass",  ...

—————————-

[Diﬀerence between Fitting Algorithms] http://mathematica.stackexchange.com/questions/80998/difference-between-fitting-algorithms

I am new to Mathematica, and I don’t quite understand, what the diﬀerence between the ﬁtting algorithms Fit, FindFit, LinearModelFit, NonLinearModelFit are. Why is the syntax so diﬀerent ($$1,x,x^2$$ ...

================================== Greatest hits from previous weeks: ==================================

[How to make Jacobian automatically in Mathematica] http://mathematica.stackexchange.com/questions/5790/how-to-make-jacobian-automatically-in-mathematica

If we have two vectors, a and b, how can I make Jacobian matrix automatically in Mathematica?

$$a=\left( \begin{array}{c} \text{x1}^3+2\text{x2}^2 \\ 3\text{x1}^4+7\text{x2} \end{array}$$

—————————-

[Is there an open source implementation of Mathematica-the-language?] http://mathematica.stackexchange.com/questions/4454/is-there-an-open-source-implementation-of-mathematica-the-language

I’ve seen questions before such as ”What is the best open-source equivalent for Mathematica?”, but that speciﬁc question (and that line of inquiry in general) cares more about the computer algebra ...

================================== Can you answer these? ==================================

FindMaximum in region is a new function in mma10,but when I tried the following example:

region = Polygon[{{0, 0}, {10, 0}, {10, 5}, {5, 5}, {5, 10}, {0, 10}}]
FindMaximum[{x + y, {x, y} \[Element]  ...

—————————-

[Diverging solution to coupled second order ODEs from NDSolve] http://mathematica.stackexchange.com/questions/80692/diverging-solution-to-coupled-second-order-odes-from-ndsolve

For a physics application I am considering the radial Bogoliubov-de Gennes equations in two dimensions. In dimensionless form they read as follows

$$\begin{cases} ... - asked by Funzies (3 votes) —————————- [Does ”FiniteRingData” or something like that exists?] http://mathematica.stackexchange.com/questions/81009/does-finiteringdata-or-something-like-that-exists I want to ﬁnd a function like FiniteGroupData but for ﬁnite rings. Does something like that exists? - asked by kp9r4d (1 vote) ### 6.37 Tuesday, April 21, 2015 ================================== Top new questions this week: ================================== [Bug in MovingMap (breaking change between version 10.1 and 10.0.2)?] http://mathematica.stackexchange.com/questions/79931/bug-in-movingmap-breaking-change-between-version-10-1-and-10-0-2 The MovingMap window spec has been changed between version 10.1 and 10.0.2. Version 10.0.2 MovingMap[h, a, b, c, d, e, f, 2] (* h[a, b], h[b, c], h[c, d], h[d, e], h[e, f] *) Here we ... - asked by Edmund (18 votes), answered by Stefan R (9 votes) —————————- [Analogue for Maple’s dchange - change of variables in diﬀerential expressions] http://mathematica.stackexchange.com/questions/80241/analogue-for-maples-dchange-change-of-variables-in-differential-expressions Maple owns an interesting function called dchange which can change the variables of diﬀerential equations, but there seems to be no such function in Mathematica. Has any one ever tried to write ... - asked by xzczd (16 votes), answered by Kuba (18 votes) —————————- [Finding the period of an array of integers] http://mathematica.stackexchange.com/questions/80163/finding-the-period-of-an-array-of-integers A simple array of integers is given. The problem is to detect if a pattern is repeatedly occurring in the array, and ﬁnd the length of that pattern. For example, for 19, 6, 19, 6, 19, 6, 19, 6, ... - asked by VividD (12 votes), answered by Chris Degnen (6 votes) —————————- [How to have one or multiple Boxed graphics, mixed with non Boxed, in the same Graphics3D] http://mathematica.stackexchange.com/questions/80380/how-to-have-one-or-multiple-boxed-graphics-mixed-with-non-boxed-in-the-same-gr In the following example, I would like to Boxed only the RegionPlot3D, and not the Sphere. That is, to obtain this: instead of this: Here’s the sample code: Show[ RegionPlot3D[x^2 + y^3 - ... - asked by P. Fonseca (8 votes), answered by kguler (3 votes) —————————- [How to access an already opened Excel ﬁle in Mathematica?] http://mathematica.stackexchange.com/questions/80186/how-to-access-an-already-opened-excel-file-in-mathematica This post 4594 shows how to open a existent Excel ﬁle with Mathematica. And this 6686886 shows how to do what I need, but in C#. This 12282310 is another related one. How can I connect to a ... - asked by Murta (8 votes), answered by Murta (8 votes) —————————- [JoinAcross on nested association by nested key] http://mathematica.stackexchange.com/questions/80311/joinacross-on-nested-association-by-nested-key I would like to join two associations on nested keys. Is this possible? first = {&lt;|"away" -&gt; &lt;|"name" -&gt; "bob", "money" -&gt; 10 |&gt;, "home" -&gt; &lt;|"name" -&gt; "Sue", "money" ... - asked by Ray Troy (7 votes), answered by WReach (8 votes) —————————- [How to synchronize the display of dynamic objects?] http://mathematica.stackexchange.com/questions/80027/how-to-synchronize-the-display-of-dynamic-objects I was looking at this question, which asks to keep the orientation of some 3D graphics objects constant (relative to the viewer) while rotating the rest with the mouse. I thought that maybe the ... - asked by Szabolcs (7 votes), answered by Gerli (3 votes) ================================== Greatest hits from previous weeks: ================================== [How do I draw a pair of buttocks?] http://mathematica.stackexchange.com/questions/66538/how-do-i-draw-a-pair-of-buttocks I’m trying to develop a function which 3D plot would have a buttocks like shape. Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ... - asked by Simpleton Jack (214 votes), answered by mikuszefski (335 votes) —————————- [Plotting Complex Quantity Functions] http://mathematica.stackexchange.com/questions/3458/plotting-complex-quantity-functions Trying to plot with complex quantities seems not to work properly in what I want to accomplish. I would like to know if there is a general rule/way of plotting when you have complex counterparts in ... - asked by night owl (15 votes), answered by Artes (16 votes) ================================== Can you answer these? ================================== [MoonPosition and TimeZone support] http://mathematica.stackexchange.com/questions/80269/moonposition-and-timezone-support With this question, I noticed some some weird results of MoonPosition. Consider the following code: dateSunEclipse = DateObject[{2015,03,20,10,32,09},TimeZone-&gt;1]; dateSunEclipse0 = ... - asked by unlikely (5 votes) —————————- [I can create an H2 database with the H2 Console, but I can’t ﬁnd the database with MMA] http://mathematica.stackexchange.com/questions/80408/i-can-create-an-h2-database-with-the-h2-console-but-i-cant-find-the-database-w I can create an H2(Server) database using the tool that H2 provides, but although i can create a memory based H2 database with the Database Explorer, when I try to create a connection to the ... - asked by George Wolfe (1 vote) —————————- [Empty Blank regression in v10.1] http://mathematica.stackexchange.com/questions/80090/empty-blank-regression-in-v10-1 In v10.1.0.0 on Linux, when Blank[] is used in Alternatives with pattern that can match a sequence, whole pattern unexpectedly matches sequences of any length. ClearAll[matchLists] matchLists[patt_] ... - asked by jkuczm (5 votes) ### 6.38 Tuesday, April 14, 2015 ================================== Top new questions this week: ================================== [many indeﬁnite integrals do not evaluate in 10.1, looking for the cause] http://mathematica.stackexchange.com/questions/79367/many-indefinite-integrals-do-not-evaluate-in-10-1-looking-for-the-cause Many integrals no longer evaluate in V 10.1 when they did in 10.0.2 Here are some 23 integrals as an example, that all produced results in V 10.0.2, but now all returns unevaluated! I am hoping ... - asked by Nasser (19 votes) —————————- [Why does a comma insert a line break in a comment?] http://mathematica.stackexchange.com/questions/79463/why-does-a-comma-insert-a-line-break-in-a-comment I like to include capital letters and punctuation in my comments. But when I put a comma into a Mathematica comment of the (* ... *) type, it usually causes the comment line to break, with a new line ... - asked by Ralph Dratman (17 votes), answered by sacratus (7 votes) —————————- [Why do lookup times in Dataset and Association diﬀer by orders of magnitude?] http://mathematica.stackexchange.com/questions/79522/why-do-lookup-times-in-dataset-and-association-differ-by-orders-of-magnitude Consider the following three data structures: a list of rules, an association, and a dataset:  n = 1000000; list = (ToString[#] -&gt; #) &amp; /@ Range[n]; assoc = Association@list; dataset = ... - asked by verse (14 votes), answered by WReach (10 votes) —————————- [How to get the directory of a package?] http://mathematica.stackexchange.com/questions/79510/how-to-get-the-directory-of-a-package I have a package that I have placed in the BaseDirectory Applications directory so that Needs can ﬁnd it. I have a logo in the directory that I will return when a function is called. However, when ... - asked by Edmund (10 votes), answered by Szabolcs (10 votes) —————————- [RegionPlot returning a number] http://mathematica.stackexchange.com/questions/79572/regionplot-returning-a-number Introduced in 10.0, persists in 10.1. I had updated my mathematica to version 10 few days ago. And I had been shocked by the following fact: s = FunctionInterpolation[Sin[x], x, 0, 1]; ... - asked by WateSoyan (10 votes) —————————- [Why does Plot try symbolic values?] http://mathematica.stackexchange.com/questions/79573/why-does-plot-try-symbolic-values I have the following code: Test[a_] := (Print[a]; a*2) Plot[Test[a], {a, 0, 10}, PlotPoints -&gt; 5, MaxRecursion -&gt; 0] This should plot a*2 for ﬁve points between a = 0 and a = 10, and print ... - asked by Matthew (10 votes), answered by Simon Woods (9 votes) —————————- [Most eﬃcient way of making pair list from a list] http://mathematica.stackexchange.com/questions/79622/most-efficient-way-of-making-pair-list-from-a-list I have a bunch of datasets which looks like: 3 7 1 6 5 8 2 4 1 2 8 1 5 2 5 ... and I need to make a list of pairs such that the ﬁrst element makes a pair with other elements in the same line. 3 7 ... - asked by Mahdi (9 votes), answered by Kuba (11 votes) ================================== Greatest hits from previous weeks: ================================== [List of compilable functions] http://mathematica.stackexchange.com/questions/1096/list-of-compilable-functions Is there somewhere a list on the functions that Compile can compile, or the cases in which a particular function can be compiled that I haven’t found? I’d be glad even with a list of some of them ... - asked by Rojo (83 votes), answered by Oleksandr R. (92 votes) —————————- [How to use Mathematica functions in Python programs?] http://mathematica.stackexchange.com/questions/4643/how-to-use-mathematica-functions-in-python-programs I’d like to know how can I call Mathematica functions from Python. I appreciate a example, for example, using the Mathematica function Prime. I had search about MathLink but how to use it in Python ... - asked by GarouDan (29 votes), answered by GarouDan (11 votes) ================================== Can you answer these? ================================== [Strange Integrate messages RecursionLimit being ignored] http://mathematica.stackexchange.com/questions/79801/strange-integrate-messages-recursionlimit-being-ignored Introduced in 10.1.0 The following behavior was observed in Mathematica 10.1 (Windows 64 bit) When attempting to evaluate the following integral, Mathematica outputs several messages which appear ... - asked by Nick (2 votes) —————————- [ListConvolve Memory Hemorrhage] http://mathematica.stackexchange.com/questions/79340/listconvolve-memory-hemorrhage I wrote a routine that convolves an impulse response array with a test array and checks for the RMS diﬀerence between that convolution and a data array. I do this iteratively so that I can modify the ... - asked by A. McEvoy (6 votes) —————————- [SystemException[MemoryAllocationFailure] with Memoized function] http://mathematica.stackexchange.com/questions/79378/systemexceptionmemoryallocationfailure-with-memoized-function Version 10.1 Win7x64 Enterprise. This is more of a report than a question but others may have seen the same / have insights. I have some code (that I can’t really post as it’s too big) with a large ... - asked by Ymareth (1 vote) ### 6.39 Tuesday, April 7, 2015 ================================== Top new questions this week: ================================== [String-manipulation bugs in v10.1] http://mathematica.stackexchange.com/questions/78884/string-manipulation-bugs-in-v10-1 The new version 10.1 has introduced some strange (possibly buggy) behaviour compared to v10.0: StringCases[”1472”, Except[”0”, DigitCharacter]] (* v10.0 *) ”1”,”4”,”7”,”2” (* v10.1 *) ”1” ... - asked by Istvan Zachar (25 votes), answered by Stefan R (8 votes) —————————- [What are the cool kids talking about when they use ##&[]?] http://mathematica.stackexchange.com/questions/78910/what-are-the-cool-kids-talking-about-when-they-use All the cool kids are apparently using ##&amp;[] for Unevaluated @ Sequence[] but I have no idea what either means. Please explain what these things are so I can be a cool kid! - asked by raxacoricofallapatorius (23 votes), answered by rasher (18 votes) —————————- [Mathematical morphology: removing text features from image, while keeping connectivity] http://mathematica.stackexchange.com/questions/79066/mathematical-morphology-removing-text-features-from-image-while-keeping-connec I have this image of London’s road networks. img = Image[ Import[”https://maps.googleapis.com/maps/api/staticmap?center=+51.5+ ... - asked by andandandand (17 votes), answered by mm.Jang (12 votes) —————————- [What is the diﬀerence between Composition (@*) and sequential applications (@)?] http://mathematica.stackexchange.com/questions/78979/what-is-the-difference-between-composition-and-sequential-applications What is the diﬀerence between f@*g@*h@x and f@g@h@x Both evaluate to f[g[h[x]]] If they’re the same, why introduce Composition as a new feature? - asked by raxacoricofallapatorius (15 votes), answered by Szabolcs (22 votes) —————————- [Random polyhedra walk] http://mathematica.stackexchange.com/questions/79099/random-polyhedra-walk I would like to recreate ssch’s random polyhedra random walk, which he posted in the chat. For convenience here it is again: Since it’s been one and a half year since then I’ve certainly had time ... - asked by Pickett (14 votes) —————————- [Plot a partition of the sphere given vertices of polygons] http://mathematica.stackexchange.com/questions/78705/plot-a-partition-of-the-sphere-given-vertices-of-polygons I saw in this question that Mathematica can draw spherical triangles. I guess something similar can be done to plot a spherical polygon. I am interested in something similar: I have a set of ... - asked by Beni Bogosel (12 votes), answered by Taiki (14 votes) —————————- [Why is a symbol still found after changing its context?] http://mathematica.stackexchange.com/questions/78926/why-is-a-symbol-still-found-after-changing-its-context It seems that we can change the context of symbols: In:= x = 1 Out= 1 In:= Context[x] = ”foo‘”; But then x is still interpreted as foo‘x (and not Global‘x) even though foo‘ is not in ... - asked by Szabolcs (8 votes), answered by penguin77 (0 votes) ================================== Greatest hits from previous weeks: ================================== [Where can I ﬁnd examples of good Mathematica programming practice?] http://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ... - asked by J.M. (339 votes), answered by faysou (314 votes) —————————- [How do I draw a pair of buttocks?] http://mathematica.stackexchange.com/questions/66538/how-do-i-draw-a-pair-of-buttocks I’m trying to develop a function which 3D plot would have a buttocks like shape. Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ... - asked by Simpleton Jack (212 votes), answered by mikuszefski (333 votes) ================================== Can you answer these? ================================== [short cut entry in KeyEventTranslations.tr works on V 10.0.2 but does not work in V 10.1] http://mathematica.stackexchange.com/questions/79195/short-cut-entry-in-keyeventtranslations-tr-works-on-v-10-0-2-but-does-not-work-i I added 2 useful key shortcuts to my V 10.0.2 KeyEventTranslations.tr to allow adding [[ and ]] using ctrl-[ and ctrl-] (thanks to this post by Szabolcs at WRI community some time ago) and these ... - asked by Nasser (1 vote) —————————- [Compile, ”global variables” and recursion] http://mathematica.stackexchange.com/questions/78768/compile-global-variables-and-recursion I am trying to do something similar to this, namely to make a Compile’d function outer that itself calls a Compile’d function inner which accesses a variable deﬁned in outer. Copy-pasting the example ... - asked by Marius Ladegard Meyer (3 votes) —————————- [Issues reproducing reversible CA from NKS] http://mathematica.stackexchange.com/questions/78931/issues-reproducing-reversible-ca-from-nks I want to recreate the output of the reversible cellular automaton described in this page of the NKS book. The book speciﬁes that this is a modiﬁed version of R214, where the new state (step+1) ... - asked by andandandand (1 vote) ### 6.40 Tuesday, March 31, 2015 ================================== Top new questions this week: ================================== [How to sort digits in a string while keeping other characters untouched?] http://mathematica.stackexchange.com/questions/78464/how-to-sort-digits-in-a-string-while-keeping-other-characters-untouched Now there is a string with digits and letters, for instance, ”95uge678r3gi89hgfe30kgh063d51”. And the expected output is ”00uge133r3gi55hgfe66kgh788d99”. I am able to do it in this way ... - asked by Felix (12 votes), answered by Mr.Wizard (8 votes) —————————- [Expansion of a hypergeometric function takes ages with Mathematica 9 and 10 (regression?)] http://mathematica.stackexchange.com/questions/78534/expansion-of-a-hypergeometric-function-takes-ages-with-mathematica-9-and-10-reg Mathematica 8 (Linux version) can evaluate AbsoluteTiming[Series[Hypergeometric2F1[1, 1 - eps/2, 3 - eps, 1/2], eps, 0, 0]] in no time. On one of the university machines the result is 0.175840, ... - asked by vsht (10 votes), answered by Eric Towers (4 votes) —————————- [Opposite of StringSplit]http://mathematica.stackexchange.com/questions/78405/opposite-of-stringsplit What is an appropriate command that does the opposite of the following. StringSplit[”a b c d e f g”,” ”] - asked by William (10 votes), answered by Pickett (16 votes) —————————- [Why can I not replace a Dataset using a rule?]http://mathematica.stackexchange.com/questions/78131/why-can-i-not-replace-a-dataset-using-a-rule Simple replacement of a Dataset object does not seem to follow the expected behavior... Dataset[{}] /. _Dataset-&gt;1 Returns the empty Dataset not 1 as I would have expected. Whereas... - asked by Ymareth (9 votes), answered by WReach (11 votes) —————————- [Turning a set of random walk data 45 degrees] http://mathematica.stackexchange.com/questions/78347/turning-a-set-of-random-walk-data-45-degrees I have a set of data that is just a ”random” (generated by me, not by computer) sequence of length 2000 of 1’s and (-1)’s. I used it to plot a 1-D random walk where +1 is step up, (-1) is step down, ... - asked by Solarmew (8 votes), answered by Karsten 7. (4 votes) —————————- [Unexpected slowness checking for empty list?] http://mathematica.stackexchange.com/questions/78155/unexpected-slowness-checking-for-empty-list I thought I had a ﬁrm understanding of the diﬀerences between Equal and SameQ, but this has me puzzled: test = RandomInteger[100000000, 10000000]; == test // AbsoluteTiming === test // ... - asked by rasher (8 votes), answered by Mr.Wizard (9 votes) —————————- [Mathematica on Raspberry Pi] http://mathematica.stackexchange.com/questions/78319/mathematica-on-raspberry-pi Can I develop BSD/MIT open-source library for Mathematica using free non-commercial version on Raspberry Pi? To state it diﬀerently: does the non-commercial limitation of Mathematica on RPi limit ... - asked by denfromufa (7 votes), answered by denfromufa (3 votes) ================================== Greatest hits from previous weeks: ================================== [Divide all but the maximal element in a list by 10?]http://mathematica.stackexchange.com/questions/69547/divide-all-but-the-maximal-element-in-a-list-by-10 I have a list of numerical data, and I want to write a program that will keep the maximum as it is, but reduce the rest by certain factor (such as 10). For example: input = 2, 3, 1, -3, -5, 9, 2, 6, ... - asked by Paul (13 votes), answered by WReach (20 votes) —————————- [Division by zero is slow]http://mathematica.stackexchange.com/questions/64247/division-by-zero-is-slow Suppose I have two arrays of data, which I want to divide: n = 1000; a = RandomInteger[1, 9, n, n]; b = RandomInteger[1, 9, n, n]; First @ AbsoluteTiming @ (a/b) 0.637064 But suppose ... - asked by wxﬄes (12 votes), answered by Michael E2 (6 votes) ================================== Can you answer these? ================================== [Display of ConfusionMatrixPlot depends on Stylesheet] http://mathematica.stackexchange.com/questions/78229/display-of-confusionmatrixplot-depends-on-stylesheet I’m using Classify and do the testing via ClassiﬁerMeasurements. Now I observed that ConfusionMatrixPlot is not shown correctly when using StyleSheet Report(default). Maybe you can reproduce (example ... - asked by mgamer (2 votes) —————————- [How to restart a Clock] http://mathematica.stackexchange.com/questions/78677/how-to-restart-a-clock The code below is to demonstrate color afterimages. The user chooses a color, ﬁxates the changing numbers at the center until they reach 30 (seconds), then manually switches to white to observer the ... - asked by abwatson (1 vote) —————————- [NDSolve Poisson PDE for rectangle with hole] http://mathematica.stackexchange.com/questions/78624/ndsolve-poisson-pde-for-rectangle-with-hole When I solved the Poisson PDE with function NDSolve in a rectangular domain with hole in the center, and search the ﬁrst derivative with x and y why appear these protrusions on the diagram around the ... - asked by wlkyr (1 vote) ### 6.41 Tuesday, March 24, 2015 ================================== Top new questions this week: ================================== [Faster position list construction from a ”take instructions” list] http://mathematica.stackexchange.com/questions/77542/faster-position-list-construction-from-a-take-instructions-list Take some list, e.g., 1,2,3,4,5, and a ”take instructions” list, say 1,1,2,1,1. The latter is read as ”take the ﬁrst element from the list, drop it from the list, take the ﬁrst element of the ... - asked by rasher (16 votes), answered by 2012rcampion (9 votes) —————————- [Capturing Data from an Android Phone] http://mathematica.stackexchange.com/questions/77514/capturing-data-from-an-android-phone Is there a way to capture Data from an android phone to be later analyzed in Mathematica? - asked by Zviovich (10 votes), answered by Zviovich (10 votes) —————————- [Match opening and closing parentheses?] http://mathematica.stackexchange.com/questions/77779/match-opening-and-closing-parentheses Suppose I have a List of the form: lst=”(”, ”(”, ”(”, ”)”, ”(”, ”)”, ”)”, ”)” By running Position[lst, ”(”] and Position[lst, ”)”], I can get the positions of the opening and closing parentheses ... - asked by becko (8 votes), answered by Simon Woods (12 votes) —————————- [Segmenting Sections of Lines in an Image] http://mathematica.stackexchange.com/questions/77972/segmenting-sections-of-lines-in-an-image I have taken several gps readings while driving around town. gpsPositions=GeoPosition[33.657, -84.5197, 33.6687, -84.4977, 33.692, -84.4907, 33.7057, -84.4287, 33.7431, -84.4027, ... - asked by Zviovich (7 votes), answered by nikie (8 votes) —————————- [Flatten nested lists]http://mathematica.stackexchange.com/questions/78030/flatten-nested-lists I have a list as follows lis= a, b, c,d,e, f, g,h,i which I would like to ﬂatten to ﬂattenLis=a,b,c,d,e,f,g,h,i Does anyone have a hint. All my ﬂatten attempts did not ... - asked by Phadreus (7 votes), answered by Kuba (7 votes) —————————- [How to make a binary function associative? (Or deﬁne an n-ary function?)]http://mathematica.stackexchange.com/questions/77913/how-to-make-a-binary-function-associative-or-define-an-n-ary-function Suppose I have a simple function that I assign to an operator f[a_, b_] := a + b CirclePlus = f Then I want to write 1 (+) 2 (+) 3 But it doesn’t work, because it’s trying to evaluate f[1,2,3]. ... - asked by Noon Silk (7 votes), answered by halirutan (9 votes) —————————- [Strange answer from StringReplace] http://mathematica.stackexchange.com/questions/77771/strange-answer-from-stringreplace I have a list of strings and I would check if there is an empty string element, that’s ””, because I need to replace it with a ”0”. I try the following StringReplace[{"90", "", "20"}, "" -&gt; "0"] ... - asked by bobknight (7 votes), answered by Sjoerd C. de Vries (8 votes) ================================== Greatest hits from previous weeks: ================================== [How to use Mathematica functions in Python programs?] http://mathematica.stackexchange.com/questions/4643/how-to-use-mathematica-functions-in-python-programs I’d like to know how can I call Mathematica functions from Python. I appreciate a example, for example, using the Mathematica function Prime. I had search about MathLink but how to use it in Python ... - asked by GarouDan (28 votes), answered by GarouDan (10 votes) —————————- [A one line proof that one is zero using Mathematica 10] http://mathematica.stackexchange.com/questions/65624/a-one-line-proof-that-one-is-zero-using-mathematica-10 a = (Sqrt + 1) (Sqrt - 1) - 1; a/a, Simplify[a]/a, b/b == Simplify[b]/b 1, 0, True This one line ”proof” that one equals zero is disturbing (and could possibly lead to wrong results ... - asked by Gregoire Nicollier (11 votes), answered by Szabolcs (24 votes) ================================== Can you answer these? ================================== [How to simplify an expression with a radical sign nesting in a radical sign] http://mathematica.stackexchange.com/questions/77902/how-to-simplify-an-expression-with-a-radical-sign-nesting-in-a-radical-sign Is there a function can simplify an expression with a radical sign nesting in a radical sign in Mathematica? I use V9. RatDenmon is a function that can rationalize the denominator. - asked by user27189 (1 vote) —————————- [Plotting data with four variables; two labels for one of the axes] http://mathematica.stackexchange.com/questions/77727/plotting-data-with-four-variables-two-labels-for-one-of-the-axes I am having diﬃculty related to 3D plotting task. I have a set of data points in the following form : data=1x, 1y1,1y2,1z, 2x,2y1,2y2,2z,....nx,ny1,ny2,nz The set of points ... - asked by user91411 (2 votes) —————————- [Lisp Interpreter] http://mathematica.stackexchange.com/questions/77661/lisp-interpreter What is the cleanest way to build a lisp interpreter inside Mathematica. I’m not looking for all the functions to be implemented but instead just the basic syntax. - asked by William (3 votes) ### 6.42 Tuesday, March 17, 2015 ================================== Top new questions this week: ================================== [White balance correction with Mathematica] http://mathematica.stackexchange.com/questions/77235/white-balance-correction-with-mathematica Does Mathematica include a function to correct the white balance of an image? ImageAdjust would seem to be the ﬁrst go-to choice, but I haven’t found a way to correct white balance without changing ... - asked by shrx (12 votes), answered by Karsten 7. (11 votes) —————————- [Inline documentation of ”Properties”] http://mathematica.stackexchange.com/questions/77056/inline-documentation-of-properties Context I ﬁnd the documentation has become a bit of a maze, in particular given the more recent convention of having keywords has strings rather than Mathematica Keywords. For instance, ... - asked by chris (10 votes), answered by halirutan (15 votes) —————————- [What is the fastest way to get the nth distinct permutation of a list?] http://mathematica.stackexchange.com/questions/77443/what-is-the-fastest-way-to-get-the-nth-distinct-permutation-of-a-list What is the fastest way to write a function nthPermutation[xs_List, n_Integer] which is equivalent to Permutations[xs][[n]] but does not explicitly compute all the permutations of xs? This feature ... - asked by David Zhang (8 votes), answered by 2012rcampion (6 votes) —————————- [Area of Self-Intersecting Polygon with Repeated Vertices] http://mathematica.stackexchange.com/questions/76999/area-of-self-intersecting-polygon-with-repeated-vertices So Mathematica uses an even-odd rule for self-intersecting polygons, both when rendering them and when calculating their area: poly = Polygon@0., 0, 3, 0, 3, 2, 1, 2, 1, 1, 2, 1, 2, 3, ... - asked by Martin Buttner (8 votes), answered by Michael E2 (7 votes) —————————- [Why does cropping an image improve TextRecognize so much?] http://mathematica.stackexchange.com/questions/76993/why-does-cropping-an-image-improve-textrecognize-so-much I am trying to use the TextRecognize function to extract data from certain screenshots. This is already a cropped version. Using TextRecognize on this yields 12 Catherine FicktEuSC|'\A|V|K. Not ... - asked by timvermeulen (8 votes) —————————- [How to evaluate a function on a list until stable?] http://mathematica.stackexchange.com/questions/77403/how-to-evaluate-a-function-on-a-list-until-stable I need to evaluate a function func on a range of integers (NOT recursively, just sequentially) until the result is stable enough. I can write a not very clever step-by-step program using While: ... - asked by Zioﬁl (7 votes), answered by Pickett (6 votes) —————————- [How to programmatically covert a function-like rule to a pure function?] http://mathematica.stackexchange.com/questions/77436/how-to-programmatically-covert-a-function-like-rule-to-a-pure-function Is there a programmatic way to convert a Mathematica rule that acts like a typical mathematical function of one variable into the equivalent pure function? For example, the code should convert f[x_] ... - asked by ibeatty (7 votes), answered by rasher (7 votes) ================================== Greatest hits from previous weeks: ================================== [List of compilable functions] http://mathematica.stackexchange.com/questions/1096/list-of-compilable-functions Is there somewhere a list on the functions that Compile can compile, or the cases in which a particular function can be compiled that I haven’t found? I’d be glad even with a list of some of them ... - asked by Rojo (82 votes), answered by Oleksandr R. (91 votes) —————————- [Having used Mathematica as a ”gateway” language, where to from here?] http://mathematica.stackexchange.com/questions/25702/having-used-mathematica-as-a-gateway-language-where-to-from-here I have been using Mathematica for about a year. It is the ﬁrst language that I have attempted to learn. I’m still very much a newbie, but there are moments I feel more like I am waving than drowning. ... - asked by geordie (42 votes), answered by Leonid Shifrin (47 votes) ================================== Can you answer these? ================================== [What is the ”Origin” rule for in a Dataset?] http://mathematica.stackexchange.com/questions/77186/what-is-the-origin-rule-for-in-a-dataset Take an innocuous Dataset. d= Dataset[List[ Association[Rule[”A”,”K1”],Rule[”B”,6.‘]], Association[Rule[”A”,”K1”],Rule[”B”,1.‘]], Association[Rule[”A”,”K2”],Rule[”B”,1.‘]], ... - asked by Ymareth (1 vote) —————————- [Running Java with Wolfram Workbench on a parallel kernel] http://mathematica.stackexchange.com/questions/77137/running-java-with-wolfram-workbench-on-a-parallel-kernel I’m trying to load my package on a parallel kernel while debugging in Wolfram Workbench 2.0. My project is set up as a Java project and parts of it use Java functions located in jar ﬁles. The java ... - asked by faysou (1 vote) —————————- [Fitting data to a derivative model]http://mathematica.stackexchange.com/questions/77345/fitting-data-to-a-derivative-model I just started using Mathematica. I would like to use Mathematica to do non-linear regression. My model equation is : ... - asked by Asd (1 vote) ### 6.43 Tuesday, March 10, 2015 ================================== Top new questions this week: ================================== [Diﬀerent ﬂoating-point numbers equal?] http://mathematica.stackexchange.com/questions/76896/different-floating-point-numbers-equal Let’s deﬁne two diﬀerent numbers. x = 1. y = 1. + 2^-52 (* equivalently, 1 + MachineEpsilon *) Let's make sure they're different with FullForm: x // FullForm (* 1. *) y // FullForm (* ...  - asked by 2012rcampion (12 votes), answered by Karsten 7. (8 votes) —————————- [Major slowdown when using a ColorFunction with more than one named scheme] http://mathematica.stackexchange.com/questions/76610/major-slowdown-when-using-a-colorfunction-with-more-than-one-named-scheme Earlier Kuba noted a major slowdown with code Simon Woods posted. Here is a simpliﬁed example. First a color function using two diﬀerent named gradient schemes: fn = ColorData[If[# &lt; 0.5, ... - asked by Mr.Wizard (12 votes), answered by Mr.Wizard (15 votes) —————————- [Min, Max are slow on TimeObjects]http://mathematica.stackexchange.com/questions/76652/min-max-are-slow-on-timeobjects There’s something wrong with how Min and Max are implemented for TimeObject: times = TimeObject[List[0, 14, 55.99‘]], TimeObject[List[0, 14, 57.8‘]], TimeObject[List[0, 14, 59.09‘]], ... - asked by alancalvitti (12 votes), answered by Mr.Wizard (10 votes) —————————- [How to properly inject iterators into table?]http://mathematica.stackexchange.com/questions/76917/how-to-properly-inject-iterators-into-table Gooﬁng oﬀ on a prior question, I was ﬁddling with other methods, which led me to the need to inject a constructed set of iterators into a table construct. Now, ClearAll[a, b, z, z2] z = a, 2, ... - asked by rasher (8 votes), answered by Kuba (7 votes) —————————- [How to make a movie from a complex demonstration?]http://mathematica.stackexchange.com/questions/76832/how-to-make-a-movie-from-a-complex-demonstration I have a complex Manipulate-based demonstration containing a few sliders and a Setterbar. I would like to make a movie out of it, avi, or whatever else. The movie will then be used for a journal ... - asked by Alexei Boulbitch (8 votes), answered by Karsten 7. (6 votes) —————————- [Mathematica not honoring the distributive property of multiplication?] http://mathematica.stackexchange.com/questions/76457/mathematica-not-honoring-the-distributive-property-of-multiplication Reduce[ ForAll[ multiplicant, summandA, summandB, Element[multiplicant, summandA, summandB, Reals], multiplicant*summandA - multiplicant*summandB == multiplicant*(summandA - ... - asked by gaazkam (8 votes), answered by Adam Strzebonski (10 votes) —————————- [How to Map a function with HoldAll attribute]http://mathematica.stackexchange.com/questions/76558/how-to-map-a-function-with-holdall-attribute First of all, I’m not sure about the title of this question, so please correct me if there is any title more sensible than mine. The problem is the following: I have a function f that checks if a ... - asked by bobknight (7 votes), answered by kguler (5 votes) ================================== Greatest hits from previous weeks: ================================== [How to make use of Associations?]http://mathematica.stackexchange.com/questions/52393/how-to-make-use-of-associations I have been curious about it for long. Now that Mathematica 10 arrives, I think it’s time to ask the question: How the new Association data structure would be used to improve Mathematica programming? ... - asked by Yi Wang (71 votes), answered by Leonid Shifrin (71 votes) —————————- [How to create a new ”person curve”?] http://mathematica.stackexchange.com/questions/17704/how-to-create-a-new-person-curve Wolfram|Alpha has a whole collection of parametric curves that create images of famous people. To see them, enter WolframAlpha["person curve"] into a Mathematica notebook, or person curve into ... - asked by Simon (49 votes), answered by Vitaliy Kaurov (21 votes) ================================== Can you answer these? ================================== [How to force the writing of buﬀers onto disk?]http://mathematica.stackexchange.com/questions/76351/how-to-force-the-writing-of-buffers-onto-disk Usually, buﬀering is good; except when you critically need to write data to disk. Is there a way to force the writing of buﬀers onto disk? (I’m using a binary ﬁle) I believe a Close[ ] followed ... - asked by richard (4 votes) —————————- [Trouble using Solve and NSolve with functions involving Erf]http://mathematica.stackexchange.com/questions/76429/trouble-using-solve-and-nsolve-with-functions-involving-erf I have the following functions: R[k_, x_, t_] := -.5*(k - x)*(1 + Erf[-(k - x)/t]) L[k_, c_, x_, t_] := .5*c*(k - x)*(1 + Erf[(k - x)/t]) I’m interested in ﬁnding the k that solves some equation ... - asked by Pburg (1 vote) —————————- [Packages and Notebooks as a Databin]http://mathematica.stackexchange.com/questions/76474/packages-and-notebooks-as-a-databin The new Data Drop product sounds interesting. Can I use Databin to share Packages and Notebooks? If yes. How? Something like: bin = CreateDatabin[] DatabinAdd[bin, &lt;|"myPack" -&gt; "???"|&gt;] ... - asked by Murta (1 vote) ### 6.44 Tuesday, March 3, 2015 ================================== Top new questions this week: ================================== [Finding a function that ﬁts the shape of an image]http://mathematica.stackexchange.com/questions/75855/finding-a-function-that-fits-the-shape-of-an-image How can I ﬁnd a function that ﬁts the given shape of an image? Or instead extract a point set from the shape and then ﬁnd an interpolating function ﬁts the shape. An example image is attached. - asked by Mikayel (12 votes), answered by belisarius (21 votes) —————————- [Adding Trace produces error messages]http://mathematica.stackexchange.com/questions/76082/adding-trace-produces-error-messages This is very strange. As I was trying to debug this problem, I noticed when I add Trace then I get lots of internal errors generated. This also happens the ﬁrst time after the kernel is started. ... - asked by Nasser (11 votes), answered by WReach (9 votes) —————————- [How can I deﬁne or use a new coordinate system in Mathematica?]http://mathematica.stackexchange.com/questions/75815/how-can-i-define-or-use-a-new-coordinate-system-in-mathematica I want to use the dipole coordinate system as deﬁned in this paper: http://arxiv.org/abs/physics/0606044 I see that Mathematica can do all kinds of vector analysis using diﬀerent kinds of ... - asked by jvriesem (7 votes), answered by Itai Seggev (0 votes) —————————- [Inconsistent behavior of undocumented Encode-¿Import-¿StringToStream-¿Get on password-locked stream]http://mathematica.stackexchange.com/questions/76085/inconsistent-behavior-of-undocumented-encode-import-stringtostream-get-on-pas Let’s save a deﬁnition. Encode it with password/key and Get it again. We will not use Get directly on directory but with combination of Get+StringToStream+Import. Get works with streams since V9.0 ... - asked by Kuba (7 votes), answered by Jinxed (1 vote) —————————- [Ghost trails with Animate?]http://mathematica.stackexchange.com/questions/75936/ghost-trails-with-animate What are some approaches to integrate Ghost trails methods with Animate, which otherwise seem more suited for exporting individual frames? For example, given this rootPlot function, how can trails ... - asked by alancalvitti (7 votes), answered by Pickett (9 votes) —————————- [how to build matrix from set of vectors and other matrices using ArrayFlatten]http://mathematica.stackexchange.com/questions/76311/how-to-build-matrix-from-set-of-vectors-and-other-matrices-using-arrayflatten I want to build a 6 by 3 matrix, from the following: one vector is 3 by 1, then a matrix, which is 3 by 2. These will go to the top 3 rows. Now the bottom 3 rows, I’ll have 3 vectors each is 3 by 1. ... - asked by Nasser (6 votes), answered by Kuba (5 votes) —————————- [Computing launch parameters for hitting a point in 3D with projectile under inﬂuence of wind]http://mathematica.stackexchange.com/questions/75945/computing-launch-parameters-for-hitting-a-point-in-3d-with-projectile-under-infl The end goal of this problem is to compute functions which describe the launch parameters which are needed to hit a speciﬁed goal in 3D in the presence of wind disturbances. This is as far I have ... - asked by Julian (6 votes), answered by belisarius (7 votes) ================================== Greatest hits from previous weeks: ================================== [Where can I ﬁnd examples of good Mathematica programming practice?] http://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ... - asked by J.M. (333 votes), answered by faysou (308 votes) —————————- [How do I draw a pair of buttocks?]http://mathematica.stackexchange.com/questions/66538/how-do-i-draw-a-pair-of-buttocks I’m trying to develop a function which 3D plot would have a buttocks like shape. Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two ... - asked by Simpleton Jack (209 votes), answered by mikuszefski (327 votes) ================================== Can you answer these? ================================== [FindMinimum’s WorkingPrecision behaviour]http://mathematica.stackexchange.com/questions/76259/findminimums-workingprecision-behaviour I discovered the following behaviour when using FindMinimum for constrained optimization: Clear@f f[x_?NumericQ] := (Print@Precision@x; x^2) FindMinimum[{f[x], x &lt; 1}, {x, 1}, WorkingPrecision ... - asked by sebhofer (1 vote) —————————- [Font style in Mathematica and .tex ﬁle]http://mathematica.stackexchange.com/questions/76250/font-style-in-mathematica-and-tex-file I am using Mathematica 8. I want to label the axes of ﬁgure in ”Times” font. Plot[Sin[z], {z, -2 Pi, 2 Pi}, Frame -&gt; True, FrameLabel -&gt; {"z", "a(z)"}, LabelStyle -&gt; Directive[FontSize ... - asked by zenith (3 votes) —————————- [ParametricNDSolveValue over a region]http://mathematica.stackexchange.com/questions/75887/parametricndsolvevalue-over-a-region I’m getting the following behavior I don’t understand when using ParametricNDSolveValue over a region. You can reproduce the behavior considering Poisson’s equation as shown below The below works as ... - asked by user2162855 (1 vote) ### 6.45 Tuesday, February 17, 2015 Tuesday, February 24, 2015 ================================== Top new questions this week: ================================== [Can Mathematica’s random number generation be improved?]http://mathematica.stackexchange.com/questions/75303/can-mathematicas-random-number-generation-be-improved Performance on Random Number generation is intolerable. Whenever you need many deviates from the same distribution but with diﬀerent parameters it takes forever. Here is a thread on Poisson ... - asked by JEP (11 votes), answered by JEP (4 votes) —————————- [The efficiency compare between Flatten[#, 1] & and Join @@ #&] http://mathematica.stackexchange.com/questions/75590/the-efficiency-compare-between-flatten-1-and-join Err..Often I met the situation to join lists at the first level and I used to just Flatten[#, 1] &amp;@ them. However, I found(when glance over the mathematica.stackexchange.com) someone else prefer ... - asked by Harry (11 votes), answered by Michael E2 (8 votes) —————————- [Is Mathematica ‘ContourPlot‘ function really so eﬃcient?] http://mathematica.stackexchange.com/questions/75352/is-mathematica-contourplot-function-really-so-efficient I wanted to ﬁnd the roots of the function $$f(x,y)=\sin (3.2x)\sin (1.3y)-2.1 \sin (1.3x)\sin (3.2y)$$. This is what the function looks like: f[x_, y_] = Sin[3.2 x]*Sin[1.3*y] - 2.1*Sin[1.3*x]*Sin[3.2*y] ... - asked by anderstood (11 votes), answered by george2079 (16 votes) —————————- [How to randomly select subsets]http://mathematica.stackexchange.com/questions/75431/how-to-randomly-select-subsets I have a list of around 300 elements. I want to sample subsets of length 25 such that my samples are all distinct. My ﬁrst inclination was to use something like RandomSample[Subsets[list, 25], ... - asked by mtiano (7 votes), answered by Mr.Wizard (8 votes) —————————- [Prevent Export from overwriting ﬁles]http://mathematica.stackexchange.com/questions/75745/prevent-export-from-overwriting-files Export[”ﬁlepath1”,Expression1] works for me, but if ﬁlepath1 already exists, it will be overwritten. I’d like Export to notify me and ask for a conﬁrmation, if it tries to overwrite ﬁlepath1. I ... - asked by user1541776 (6 votes), answered by Mr.Wizard (11 votes) —————————- [How trustworthy is NMaximize?]http://mathematica.stackexchange.com/questions/75668/how-trustworthy-is-nmaximize Suppose I solve a constrained optimisation problem using NMaximize. How conﬁdent can I be of the accuracy of the result? For concreteness, suppose that F,G are (exactly known) functions (say, ... - asked by Feanor (6 votes), answered by mikeagibson (8 votes) —————————- [Mathematica and POV-Ray workﬂow: ListContourPlot3D]http://mathematica.stackexchange.com/questions/75497/mathematica-and-pov-ray-workflow-listcontourplot3d I have the following function describing a molecular electronic Orbital. f[r_] = E^-((r - R0)/\[CapitalDelta]r)^2; r = Sqrt[x^2 + y^2 + z^2]; cosphi[x_, y_, z_] := If[x == 0 &amp;&amp; y == 0 ... - asked by DPengel (6 votes) ================================== Greatest hits from previous weeks: ================================== [How to generate a random snowﬂake]http://mathematica.stackexchange.com/questions/39361/how-to-generate-a-random-snowflake ’Tis the season... And it’s about time I posed my ﬁrst question on Mathematica Stack Exchange. So, here’s an holiday quest for you Graphics (and P-Chem?) gurus. What is your best code for generating ... - asked by Peltio (100 votes), answered by Silvia (132 votes) —————————- [Where can I ﬁnd examples of good Mathematica programming practice?]http://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ... - asked by J.M. (333 votes), answered by faysou (308 votes) ================================== Can you answer these? ================================== [Precision loss in FourierDCT]http://mathematica.stackexchange.com/questions/75292/precision-loss-in-fourierdct I have high precision data that I want to do Fourier transform with, but it looks like the precision is lost dramatically. data = ... - asked by xslittlegrass (2 votes) —————————- [Can I use Mathematica 9.0 to open an MX ﬁle produced by Mathematica 10?]http://mathematica.stackexchange.com/questions/75581/can-i-use-mathematica-9-0-to-open-an-mx-file-produced-by-mathematica-10 I have used Mathematica 10 installed on a workstation of university’s lab to run a NDSlove code that produced a .mx ﬁle. Then I copy the .mx ﬁle to my laptop which has Mathematica 9.0. When I try to ... - asked by lxy (1 vote) —————————- [Is it possible to circumvent this overﬂow?]http://mathematica.stackexchange.com/questions/75329/is-it-possible-to-circumvent-this-overflow I’m trying to evaluate the following function numerically:  f(A,B)=\frac{2A\pi ^{5/2} (-1)^B}{(A!)^2B!} \, _4\tilde{F}_3\left({\frac{1}{2},1-A,1-A,1-B\atop ... - asked by Zioﬁl (1 vote) ### 6.46 Tuesday, February 17, 2015 ================================== Top new questions this week: ================================== [Change Values in Dataset under Condition]http://mathematica.stackexchange.com/questions/74165/change-values-in-dataset-under-condition I have the following Dataset: ds = Dataset@*Map[AssociationThread[{"ID", "VAL1", "VAL2", "VAL3", "Type"} -&gt; #] &amp;]@ {{"C09", 18.5, 18.5, 18.5, "FE"}, {"C11", 21, 21, 21, "FE"}, {"C10", ... - asked by Lea (10 votes), answered by WReach (6 votes) —————————- [Drawing a Gradient Between Two Circular Arcs]http://mathematica.stackexchange.com/questions/73928/drawing-a-gradient-between-two-circular-arcs Suppose I wanted to use Mathematica graphics primitives to create a gradient of colors between two circular arcs. It’s easy enough to make an area between two circles a solid color, but what if I ... - asked by Noah Rubin (10 votes), answered by ybeltukov (11 votes) —————————- [How to search Dataset to ﬁnd all keys share same Value]http://mathematica.stackexchange.com/questions/74200/how-to-search-dataset-to-find-all-keys-share-same-value If I have the following Dataset ds=Dataset[{ &lt;|"a" -&gt; 1, "b" -&gt; "x", "c" -&gt; 6|&gt;, &lt;|"a" -&gt; 2, "b" -&gt; "y", "c" -&gt; {2, 3}|&gt;, &lt;|"a" -&gt; "x", "b" -&gt; "z", "c" ... - asked by Algohi (8 votes), answered by Leonid Shifrin (5 votes) —————————- [Windows command line arguments, stdin & stdout] http://mathematica.stackexchange.com/questions/74032/windows-command-line-arguments-stdin-stdout Is it possible to utilize all three: commandline arguments, stdin, and stdout all at once in script for Windows? Unix is fairly esay, but I can’t get the following to work with Windows. Using the ... - asked by William (8 votes), answered by WReach (7 votes) —————————- [How can I replace the Greek symbols in an expression with their plain text names?]http://mathematica.stackexchange.com/questions/74047/how-can-i-replace-the-greek-symbols-in-an-expression-with-their-plain-text-names Suppose I have an expression with Greek symbols in it. How would I convert that expression to another expression where the Greek symbols have been replaces with their names in plain text? I’ve ... - asked by jmbejara (8 votes), answered by Mr.Wizard (11 votes) —————————- [Convert number to word]http://mathematica.stackexchange.com/questions/73717/convert-number-to-word I have a big number like: 123 456 789. Now I’ll to writ it like this 123 million 456 thousand 789 I’ve search on the internet but nothing found that works. How can you do that? Thanks. - asked by Luis (8 votes), answered by Mr.Wizard (10 votes) —————————- [Why does an inert ReplaceAll modify this Dataset?]http://mathematica.stackexchange.com/questions/73855/why-does-an-inert-replaceall-modify-this-dataset I cannot see any reason for this behavior besides a bug, but I’ve been wrong before so I put it before the community: ds = Dataset[{ &lt;|"ID" -&gt; "Alpha", "v1" -&gt; 1, "v2" -&gt; 0|&gt;, ... - asked by Mr.Wizard (7 votes), answered by Leonid Shifrin (7 votes) ================================== Greatest hits from previous weeks: ================================== [Image processing: Floor plan - detecting rooms’ borders (area) and room names’ texts]http://mathematica.stackexchange.com/questions/19546/image-processing-floor-plan-detecting-rooms-borders-area-and-room-names-t Here is a simple building ﬂoor plan. I would like to derive the rooms as (rectangular) components and the names of the rooms. This is very common representation of building ﬂoor plans. The ... - asked by s.s.o (39 votes), answered by nikie (39 votes) —————————- [Generating visually pleasing circle packs]http://mathematica.stackexchange.com/questions/40334/generating-visually-pleasing-circle-packs EDIT: (my conclusion and thank you note) I want to thank you all guys for this unexpected intellectual and artistic journey. Hope you had fun and enjoyed it the same as I did. I would like to ... - asked by VividD (70 votes), answered by level1807 (42 votes) ================================== Can you answer these? ================================== [Exclusion disappears but style doesn’t work]http://mathematica.stackexchange.com/questions/73894/exclusion-disappears-but-style-doesnt-work Consider this code: f[x_]:=(6 + 4 x + x^2 - x^3)/(x-2) Plot[f[x], {x, -10, 10}, Exclusions -&gt; {2}, ExclusionsStyle -&gt; Directive[Red, Dashed]] It produces this image. Note that the vertical ... - asked by David (4 votes) —————————- [What is Association[Rule[”ID”,number ] and how it is used]http://mathematica.stackexchange.com/questions/74197/what-is-associationruleid-number-and-how-it-is-used I am trying to understand the structure and the use of Dataset and I came across something new to me. First check this example: ds1=Dataset[{ &lt;|"a" -&gt; 1, "b" -&gt; "x", "c" -&gt; 6|&gt;, ... - asked by Algohi (4 votes) —————————- [Can I get a symbol cross-reference of a Mathematica Notebook?]http://mathematica.stackexchange.com/questions/73927/can-i-get-a-symbol-cross-reference-of-a-mathematica-notebook Is there a way to get a cross reference listing for a notebook or set of notebooks? - asked by Ralph Dratman (1 vote) ### 6.47 Tuesday, February 10, 2015 ================================== Top new questions this week: ================================== [Messages leak out from Block]http://mathematica.stackexchange.com/questions/73458/messages-leak-out-from-block When assigning message to a symbol localized by Block, I would expect that this message is not accessible outside of Block, but I observe diﬀerent behavior: ClearAll[x] Block[x, x::test1 = ... - asked by jkuczm (12 votes), answered by Mr.Wizard (6 votes) —————————- [Copy Built-in function to new name]http://mathematica.stackexchange.com/questions/73454/copy-built-in-function-to-new-name It is know that some built-in functions are system function and changing their properties may cause trouble. Suppose for example I want to change features of Cases: SetAttributes[Cases, HoldFirst] ... - asked by Algohi (10 votes), answered by Mr.Wizard (8 votes) —————————- [Possible bug: Quantity[2,”meters”] returns 2 None meters]http://mathematica.stackexchange.com/questions/73259/possible-bug-quantity2-meters-returns-2-none-meters I’m using 10.0 for Linux. Trial 1: Quantity[2,”meters”] 2 None meters Trial 2: Quantity[2,”Meters”] 2 meters Trial 3: Quantity[2,”meters”] //InputForm Quantity[2*None, ”Meters”] It seems ... - asked by Jacob Schwartz (10 votes) —————————- [How does CellContext‘ work?] http://mathematica.stackexchange.com/questions/73530/how-does-cellcontext-work The only oﬃcial info about CellContext‘ I was able to ﬁnd is: placeholder for the context of a symbol inside Dynamic from StandardNamespaces I have some intuitive understanding how it works ... - asked by Kuba (9 votes), answered by Kuba (5 votes) —————————- [Solve a PDE over a region deﬁned by a Bezier patch]http://mathematica.stackexchange.com/questions/73350/solve-a-pde-over-a-region-defined-by-a-bezier-patch I am using NDSolve to ﬁnd the solution to a PDE over an arbitrary domain. The domain is speciﬁed by a Bezier patch. pts = 10, 0, 0, 30, 15, 10, 8, 30, 25, 37, 20, 37, 35, ... - asked by cfdguy (9 votes), answered by Michael E2 (3 votes) —————————- [Triangular mesh of random points on a sphere] http://mathematica.stackexchange.com/questions/73354/triangular-mesh-of-random-points-on-a-sphere My employer with a new logo (shown below). I do not have information on how this was created (as it was done by an outside company), though I’m fairly sure it was not done in any formal mathematical ... - asked by user1375062 (9 votes), answered by ybeltukov (15 votes) —————————- [Slow work of SQLInsert with MS SQL Server in V10] http://mathematica.stackexchange.com/questions/73444/slow-work-of-sqlinsert-with-ms-sql-server-in-v10 This question is very similar to: Slow work of SQLInsert with SQLite, but for MS SQL Server. Unfortunately the use of SQLBeginTransaction and SQLCommitTransaction do not improved the performance as in ... - asked by Murta (8 votes), answered by Murta (8 votes) ================================== Greatest hits from previous weeks: ================================== [How to use Mathematica functions in Python programs?] http://mathematica.stackexchange.com/questions/4643/how-to-use-mathematica-functions-in-python-programs I’d like to know how can I call Mathematica functions from Python. I appreciate a example, for example, using the Mathematica function Prime. I had search about MathLink but how to use it in Python ... - asked by GarouDan (28 votes), answered by GarouDan (10 votes) —————————- [How do I clear all user deﬁned symbols?] http://mathematica.stackexchange.com/questions/850/how-do-i-clear-all-user-defined-symbols Is there some way to do this other than going to Evaluation -&gt; Quit kernel and firing a new one up? - asked by niklasﬁ (27 votes), answered by Artes (24 votes) ================================== Can you answer these? ================================== [Problem with DiscretizeRegion] http://mathematica.stackexchange.com/questions/73470/problem-with-discretizeregion R = RegionUnion[Disk[{0, 0}, 1, {0, Pi}], Disk[{1/2, 0}, 1/2]] // RegionDifference[#, RegionUnion[Disk[{1/2, 0}, 1/6], Disk[{-1/2, 0}, 1/2]]] &amp; (dr = DiscretizeRegion[R]) // Timing If you run ... - asked by Apple (6 votes) —————————- [How to get the correct latitude and longitude coordinates using FindGeoLocation on street addresses] http://mathematica.stackexchange.com/questions/73656/how-to-get-the-correct-latitude-and-longitude-coordinates-using-findgeolocation Have a list of street addresses: addresses = {"123 D st, Davis, CA 95616", "140 B St, Davis, CA 95616", "212 E st, Davis, CA 95616", "325 G St, Davis, CA 95616"}; I used FindGeoLocation to ... - asked by Rebecca (2 votes) —————————- [Why does Mathematica provide incosistent convergence conditions?]http://mathematica.stackexchange.com/questions/73652/why-does-mathematica-provide-incosistent-convergence-conditions In:= Clear[a, n] In:= SumConvergence[(n^(n - 2))/((a^n)*(n!)), n] Out= Abs[a] &gt; E In:= SumConvergence[(n^(n - 2))/((E^n)*(n!)), n] Out= True All right. So, according to Out, the ... - asked by gaazkam (2 votes) ### 6.48 Tuesday, February 3, 2015 ================================== Top new questions this week: ================================== [Mathematica and POV-Ray workﬂow (Q&A)] http://mathematica.stackexchange.com/questions/72899/mathematica-and-pov-ray-workflow-qa A couple of years ago, Alexey Popkov asked this question: Which ray tracing software is compatible with Graphics3D? It is my opinion, for various reasons, that out of the many ray tracing programs ... - asked by Kim Fierens (18 votes), answered by xslittlegrass (17 votes) —————————- [Confused about how Partition works] http://mathematica.stackexchange.com/questions/72740/confused-about-how-partition-works I have a problem about the padding list about Partition command. For instance, Partition[a, b, c, d, e, f, g, 3, 1, -2, 1, x, y, z] z, a, b, a, b, c, b, c, d, c, d, e, d, e, f, ... - asked by ShutaoTang (16 votes), answered by Mr.Wizard (15 votes) —————————- [I deﬁne a variable as local to a module BUT then the module uses its global value! Why?] http://mathematica.stackexchange.com/questions/72758/i-define-a-variable-as-local-to-a-module-but-then-the-module-uses-its-global-val I have a question about modules and local variables. Here’s my example: h = 5; Module[{a, h}, a[h_]= h^2; a] (*Out = 25*) I expected the module to return 16 and not 25! I believed h to be ... - asked by pan_e_gaban (12 votes), answered by Leonid Shifrin (13 votes) —————————- [Floating point operations — division vs multiplication; how do they aﬀect accuracy?] http://mathematica.stackexchange.com/questions/72801/floating-point-operations-division-vs-multiplication-how-do-they-affect-accur Given two functions: f[x_] := x ((x + 1)^(1/2) - x^(1/2)) g[x_] := x/((x + 1)^(1/2) + x^(1/2)) Which one is more accurate? Side note: If you could explain why, that would really help me out, I ... - asked by Claire Blackman (10 votes), answered by DumpsterDoofus (8 votes) —————————- [A better ”VisibleSpectrum” function?] http://mathematica.stackexchange.com/questions/73161/a-better-visiblespectrum-function Since ColorData[”VisibleSpectrum”] is wrong I would like to have a more accurate function to use. Can this information be extracted from Mathematica itself? - asked by Mr.Wizard (9 votes), answered by Mr.Wizard (10 votes) —————————- [Why can AppendTo modify a referenced list in-place but Part cannot?] http://mathematica.stackexchange.com/questions/72624/why-can-appendto-modify-a-referenced-list-in-place-but-part-cannot Part, AppendTo, PrependTo, AddTo, etc. allow in-place modiﬁcation of a list, but only Part requires that the list be referenced through a simple symbol, e.g. the following all does what you’ld ... - asked by Eric Parker (9 votes), answered by Leonid Shifrin (11 votes) —————————- [Is there a way to identify a symbolic fraction?] http://mathematica.stackexchange.com/questions/73075/is-there-a-way-to-identify-a-symbolic-fraction Is there a way to use Head to detect a symbolic fraction? In particular I ﬁnd, Head[a/b] Head[1/5] Times Rational where I would like to get Head[a/b] = Rational. I want to test if a ... - asked by JeﬀDror (8 votes), answered by ybeltukov (11 votes) ================================== Greatest hits from previous weeks: ================================== [Division by zero is slow] http://mathematica.stackexchange.com/questions/64247/division-by-zero-is-slow Suppose I have two arrays of data, which I want to divide: n = 1000; a = RandomInteger[1, 9, n, n]; b = RandomInteger[1, 9, n, n]; First @ AbsoluteTiming @ (a/b) 0.637064 But suppose ... - asked by wxﬄes (12 votes), answered by Michael E2 (6 votes) —————————- [Alternatives to procedural loops and iterating over lists in Mathematica]http://mathematica.stackexchange.com/questions/7924/alternatives-to-procedural-loops-and-iterating-over-lists-in-mathematica While there are some cases where a For loop might be reasonable, it’s a general mantra – one I subscribe to myself – that ”if you are using a For loop in Mathematica, you are probably doing it wrong”. ... - asked by Mr.Wizard (101 votes), answered by Mr.Wizard (66 votes) ================================== Can you answer these? ================================== [Extra spaces when exporting strings into pdf (bug, linux)]http://mathematica.stackexchange.com/questions/72896/extra-spaces-when-exporting-strings-into-pdf-bug-linux Rationale: Imagine you would like to create a publication quality ﬁgure in Mathematica, from under Linux. Naturally, it will contain text/labels. Problem: Here is a simple string ”Amin,new”. ... - asked by Alexey Bobrick (1 vote) —————————- [LayeredGraphPlot Vertex Spacing]http://mathematica.stackexchange.com/questions/72847/layeredgraphplot-vertex-spacing For anyone who has used LayeredGraphPlot, you have probably seen that the vertex spacing is consistent throughout, that vertices have the same minimum unit of spacing in the vertical and horizontal ... - asked by iwantmyphd (1 vote) —————————- [Header and footer banners in Slide Show style]http://mathematica.stackexchange.com/questions/72903/header-and-footer-banners-in-slide-show-style I would like to create Mathematica slide shows that contain several tailored, ﬁxed banners as headers and footers, much as MS Powerpoint, MS Word, Apple Pages, and LaTeX documents allow one to ... - asked by David G. Stork (3 votes) ### 6.49 Tuesday, January 27, 2015 ================================== Top new questions this week: ================================== [Can Mathematica solve Plateau’s problem (ﬁnding a minimal surface with speciﬁed boundary)?] http://mathematica.stackexchange.com/questions/72203/can-mathematica-solve-plateaus-problem-finding-a-minimal-surface-with-specifie Given a closed curve $$\mathcal C$$ in three dimensions, is it possible to use Mathematica’s built-in functionality to compute a minimal surface whose boundary is $$\mathcal C$$? For simplicity, let us ... - asked by Rahul (20 votes), answered by ybeltukov (17 votes) —————————- [Maximize[Cos[x - 1], x] is not evaluated] http://mathematica.stackexchange.com/questions/72444/maximizecosx-1-x-is-not-evaluated No explanation needed: Maximize[Cos[x + 1], x] Maximize[Cos[x - 1], x] producing {1, {x -&gt; -1 + 2 Pi}} Maximize[Cos[1 - x], x] Needless to say, this is pretty amusing. Does anyone know why ... - asked by DumpsterDoofus (18 votes), answered by Michael E2 (8 votes) —————————- [Reading from a socket stream] http://mathematica.stackexchange.com/questions/72551/reading-from-a-socket-stream I noticed an undocumented socket package (SocketLink) in Mathematica (Using version 10, not sure when it was actually added) and wrote a barebones HTTP responder using it: &lt;&lt;SocketLink host = ... - asked by MBryn (10 votes) —————————- [For a given expression: if it appears, remove it, but if it is absent, add it] http://mathematica.stackexchange.com/questions/72380/for-a-given-expression-if-it-appears-remove-it-but-if-it-is-absent-add-it While reformatting Szabolcs’s code from (42660) I noticed this interesting operation: expr/.{{-\[Infinity],mid___,\[Infinity]}:&gt;{mid},{-\[Infinity],mid___}:&gt;{mid,\[Infinity]},{mid___,\[Infinity]} - asked by Mr.Wizard (10 votes), answered by Mr.Wizard (5 votes) —————————- [Unexpected pattern matching behaviour: PatternSequence vs. Optional]http://mathematica.stackexchange.com/questions/72290/unexpected-pattern-matching-behaviour-patternsequence-vs-optional Consider the following pattern-matching expressions: MatchQ[{1, 2}, {a_, b_}] (* True *) MatchQ[{1, 2}, {a_, b_:0}] (* True *) MatchQ[{1, 2}, ... - asked by WReach (10 votes) —————————- [Incorrect use of Scaled causes crash]http://mathematica.stackexchange.com/questions/72560/incorrect-use-of-scaled-causes-crash Bug introduced in 8.0 and persisting through 10.0.2 or later While playing with Scaled, I made a syntax error which caused a crash instead of an error message ... Do you get the same ? (I have ... - asked by SquareOne (9 votes) —————————- [Using map projections with astronomical data]http://mathematica.stackexchange.com/questions/72426/using-map-projections-with-astronomical-data I noticed that all important ”Geoprojections” are available in projections for a spherical reference models: GeoProjectionData function; 1 - I am trying using the sinusoidal projection for ... - asked by locometro (8 votes), answered by Kuba (7 votes) ================================== Greatest hits from previous weeks: ================================== [How to ﬁnd all the local minima/maxima in a range]http://mathematica.stackexchange.com/questions/5575/how-to-find-all-the-local-minima-maxima-in-a-range I want to ﬁnd : all local maxima in range all local minima in range ¿From those points I can interpolate and combine functions upper and lower boundary. What I am really interested in, is the ... - asked by Margus (46 votes), answered by Daniel Lichtblau (45 votes) —————————- [Alternatives to procedural loops and iterating over lists in Mathematica]http://mathematica.stackexchange.com/questions/7924/alternatives-to-procedural-loops-and-iterating-over-lists-in-mathematica While there are some cases where a For loop might be reasonable, it’s a general mantra – one I subscribe to myself – that ”if you are using a For loop in Mathematica, you are probably doing it wrong”. ... - asked by Mr.Wizard (101 votes), answered by Mr.Wizard (66 votes) ================================== Can you answer these? ================================== [Is there a notebook to create entries for OEIS?]http://mathematica.stackexchange.com/questions/72451/is-there-a-notebook-to-create-entries-for-oeis Is there a notebook to create entries for OEIS? I seem to recall something like this a few years ago, but I haven’t been able to ﬁnd one. It might be from MathWorld. Any suggestions? Edit If I had ... - asked by Fred Kline (2 votes) —————————- [SumConvergence fails in version 10] http://mathematica.stackexchange.com/questions/72361/sumconvergence-fails-in-version-10 SumConvergence[(-1)^(n + 1) ((Cos[n^2] + Sin[n + 2])/7^n), n] Mathematica fails to provide a result (true/false) but wolfram alpha works. What should I do ? It gives ... - asked by Parhs (5 votes) —————————- [How can I detect certain letters by shape in an image?] http://mathematica.stackexchange.com/questions/72497/how-can-i-detect-certain-letters-by-shape-in-an-image I have a website where people can post Flipbook animations, called Flipnotes. Unfortunately, most of the Popular ﬂipnotes are in the following categories: MV (Music Video) AV (Audio Video) AMV ... - asked by Austin Burk (1 vote) ### 6.50 Tuesday, January 20, 2015 ================================== Top new questions this week: ================================== [Excessive memory use by Mathematica kernel in 10.0.2 after executing simple commands] http://mathematica.stackexchange.com/questions/71889/excessive-memory-use-by-mathematica-kernel-in-10-0-2-after-executing-simple-comm Warning: the code below may hang your system if you have the Suggestions Bar enabled. When issuing the following simple statements to Mathematica, it responds with a valid answer. However, ... - asked by Simon (18 votes), answered by Simon (8 votes) —————————- [What is the purpose of Internal‘LocalizedBlock?]http://mathematica.stackexchange.com/questions/71881/what-is-the-purpose-of-internallocalizedblock I have come across the (internal) use of of the function: Internal‘LocalizedBlock I am trying to determine its purpose. It seem to behave like Internal‘InheritedBlock except that a starting value ... - asked by Mr.Wizard (14 votes), answered by Dan Fortunato (19 votes) —————————- [Least eﬀort to handle a point source inside the domain of PDE(s)]http://mathematica.stackexchange.com/questions/71902/least-effort-to-handle-a-point-source-inside-the-domain-of-pdes By point source I mean a constrained condition at one point inside the domain of PDE(s). For example: $$\frac{\partial ^2u(t,x,y)}{\partial t^2}=\frac{\partial
^2u(t,x,y)}{\partial  ...

—————————-

[Partitioning with constraints on subsets]http://mathematica.stackexchange.com/questions/71827/partitioning-with-constraints-on-subsets

Given the following data:

constraints = 11, 2, 11, 3, 11, 4, 11, 6, 11, 9, 1, 6, 5, 6, 2, 5;

weights = 3, 7, 3, 2, 4, 2, 2, 2, 3, 2, 1;

I wish to partition the integers from 1 ...

—————————-

[Filling to Axis as Arrow]http://mathematica.stackexchange.com/questions/72002/filling-to-axis-as-arrow

In version 9 I could do the following with the output as shown.

ListPlot[Table[{x, x^2}, {x, 0, 1, 0.1}], PlotRange -&gt; All,
Filling -&gt; Axis, FillingStyle -&gt; (Arrow[#] &amp;)]

Now in ...

—————————-

[Label multiple edges between same vertices]http://mathematica.stackexchange.com/questions/72003/label-multiple-edges-between-same-vertices

I have a simple graph with multiple edges between two vertices, say:

Graph[{
Labeled[a -&gt; b, "A"],
Labeled[a -&gt; b, "B"]
}]

Unfortunately, Mathematica labels both edges ”A”.

How can I ...

—————————-

[Synchronizing the camera view of multiple Image3D panels within a Manipulate interface]http://mathematica.stackexchange.com/questions/71653/synchronizing-the-camera-view-of-multiple-image3d-panels-within-a-manipulate-int

I’m trying to synchronize the camera view of multiple Image3D panels displayed within a Manipulate interface.

A random 3D image will do for demonstration purposes.

theimg = Image3D[RandomReal[1, ...

================================== Greatest hits from previous weeks: ==================================

[How to use Mathematica functions in Python programs?]http://mathematica.stackexchange.com/questions/4643/how-to-use-mathematica-functions-in-python-programs

I’d like to know how can I call Mathematica functions from Python.

I appreciate a example, for example, using the Mathematica function Prime.

—————————-

[How to make use of Associations?]http://mathematica.stackexchange.com/questions/52393/how-to-make-use-of-associations

I have been curious about it for long. Now that Mathematica 10 arrives, I think it’s time to ask the question: How the new Association data structure would be used to improve Mathematica programming?

...

================================== Can you answer these? ==================================

[How to rewrite a nested loop with Reap and Sow]http://mathematica.stackexchange.com/questions/71838/how-to-rewrite-a-nested-loop-with-reap-and-sow

I was wondering if anyone know how to rewrite the following nested loop but using Reap and Sow. I need to reduce the execution time. Thank you.

list = ; AbsoluteTiming[ Do[ AppendTo[list, ]; ...

- asked by Paul (1 vote)

—————————-

[PlotRange-¿Automatic the exact function used to calculate outliers]http://mathematica.stackexchange.com/questions/71808/plotrange-automatic-the-exact-function-used-to-calculate-outliers

I know that PlotRange-&gt;Automatic does the following:

”the distribution of coordinate values is found, and any points suﬃciently far out in the distribution are dropped. Such points are often ...

—————————-

[How to reduce a quartic form to a quadratic form with equal roots]http://mathematica.stackexchange.com/questions/72083/how-to-reduce-a-quartic-form-to-a-quadratic-form-with-equal-roots

Preface: To clear the theoretical background this question is cross-posted on math.stackexchange here.

I have a polynomial in $$n$$ variables of the form

...

### 6.51 Tuesday, January 13, 2015

==================================
Top new questions this week:
==================================

[Why is my data 10 times slower than random data when doing matrix multiplication] http://mathematica.stackexchange.com/questions/71377/why-is-my-data-10-times-slower-than-random-data-when-doing-matrix-multiplication

I have some data generated from some program, and it appears that matrix multiplication on these data are about 10 times slower than on some random data:

Get[”tb.dat”];

xls = Range[-500, 500, ...

—————————-

[What happens when you divide by ##?] http://mathematica.stackexchange.com/questions/71348/what-happens-when-you-divide-by

I’ve been playing around with sequences a bit. In particular with using ## with unary and binary operators.

Let’s start simple, the following all make some kind of sense:

+ ## &amp; [a,b] (* a + b  ...

—————————-

[How can FactorInteger be so slow if PrimeQ is fast?] http://mathematica.stackexchange.com/questions/71489/how-can-factorinteger-be-so-slow-if-primeq-is-fast

My 8th grade son had a homework problem to ﬁnd a prime factor of 99!-1. I thought to be clever/lazy and used FactorInteger[99!-1], but it takes forever. PrimeQ[99!-1] very quickly gives False. It ...

—————————-

[Orderless pattern matching] http://mathematica.stackexchange.com/questions/71463/orderless-pattern-matching

The MMA docs state that ”In matching patterns with Orderless functions, all possible orders of arguments are tried”.

Why then does the following not work?

plus[x__Integer, y__Real] := x+y
...

—————————-

Why does this strange behavior occur when dealing with units and quantities?

A[t_] := A0 Exp[-b t / (2m)]

FullSimplify[A[Quantity[0, "Seconds"]]]

A0 – ...

—————————-

[Multiple bwspec for BoxWhiskerChart] http://mathematica.stackexchange.com/questions/71478/multiple-bwspec-for-boxwhiskerchart

If I want to make a horizontal boxplot (with outliers) for y:

y = {5.5, 5.61, 4.88, 5.07, 5.42, 5.55, 5.36, 5.29, 5.58, 5.65, 5.57,
5.53, 5.62, 5.29, 5.44, 5.34, 5.79, 5.1, 5.27, 5.39, 5.42, 5.47,  ...

—————————-

[The longest run of at most k diﬀerent elements in a list] http://mathematica.stackexchange.com/questions/71587/the-longest-run-of-at-most-k-different-elements-in-a-list

I have a long list with ca. 500K elements. The list contains about 10K diﬀerent elements.

For simplicity let’s assume the list is of the following form:

list={a,c,b,a,a,a,b,c,e,f,b,a,e,e,e,a}

I ...

================================== Greatest hits from previous weeks: ==================================

[What are the most common pitfalls awaiting new users?] http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...

—————————-

[Assign the results from a Solve to variable(s)] http://mathematica.stackexchange.com/questions/6669/assign-the-results-from-a-solve-to-variables

I understand Mathematica can’t assign the results of a Solve to the unknowns because there may be more than 1 solution. How can I assign the 4 values of following result to variables?

================================== Can you answer these? ==================================

[Extracting an equation from an interpolated function] http://mathematica.stackexchange.com/questions/71595/extracting-an-equation-from-an-interpolated-function

Im trying to use LibraryLink to do some calculations in C but part of the expression i want to calculate is an Interpolating Function. C cant use that obviously so I’m trying to shift it to a data ...

—————————-

[Input Reduce[Mod[a + x, l] == 0, x]' and output x == -a + kl?] http://mathematica.stackexchange.com/questions/71365/input-reducemoda-x-l-0-x-and-output-x-a-kl

Reduce[a + x == k l &amp;&amp; k &gt; 0, x]
(* k &gt; 0 &amp;&amp; x == -a + k l *)

I think a + x == k l and Mod[a + x, l] == 0 are equivalent, but when I
replace a + x == k l by Mod, Mathematica  ...

- asked by LoveRight (1 vote)

—————————-

[ListPlot3D keeps crashing] http://mathematica.stackexchange.com/questions/71559/listplot3d-keeps-crashing

I have some data, and I want to plot it by ListPlot3D:

image1 = Import["image1.dat", "TSV"];
image1 // Dimensions
(* -&gt; {150000, 3} *)

I used:

ListPlot3D[image1[[1 ;; 50000]], MaxPlotPoints  ...

- asked by yashar (1 vote)

### 6.52 Tuesday, January 6, 2015

==================================
Top new questions this week:
==================================

[Generating 250 random points crashes the kernel, but not 249] http://mathematica.stackexchange.com/questions/69891/generating-250-random-points-crashes-the-kernel-but-not-249

Consider the following function, which generates uniformly random points on the surface of the 2-sphere:

randSphere[] := Block[{z = RandomReal[{-1, 1}, 3]},
If[Total[z^2] &gt; 1, randSphere[],  ...

—————————-

m = {
{3, 5, 5, 5, 5, 5, 5, 5},
{3, 6, 8, 8, 8, 8, 8, 8},
{3, 6, 10, 11, 11, 11, 11, 11},
{3, 6, 10, 14, 14, 14, 14, 14},
{3, 6, 10, 15, 17, 17, 17, 17},
{3, 6, 10, 15,  ...

—————————-

[Gap in a continuous plot] http://mathematica.stackexchange.com/questions/69976/gap-in-a-continuous-plot

Why do I get a gap in the plot below and how can I ﬁx it? (If you are interested in it, you can see a new related question: How to plot an implicit value funtion, which is also a little chanlenging)

...

—————————-

[Max element of a list with a custom ordering function] http://mathematica.stackexchange.com/questions/69971/max-element-of-a-list-with-a-custom-ordering-function

I need a function to ﬁnd max element of a list according to some custom ordering function, assuming that the function implements a total order (elements being compared might not even be numbers). ...

—————————-

[Choose between ‘Apply‘ and ‘Map‘] http://mathematica.stackexchange.com/questions/70201/choose-between-apply-and-map

Even though this might be too general question(or not answerable), I want to get some advice here. I apologize in advance if it is not a relevant question.

I frequently have to process large list of ...

—————————-

[Collatz optimization] http://mathematica.stackexchange.com/questions/69902/collatz-optimization

I’m VERY new to Mathematica programming (and by new I mean two days), and was solving Project Euler question 12, which states:

Which starting number, under one million, produces the longest ...

—————————-

[How to connect discrete points and make them become continuous curve?] http://mathematica.stackexchange.com/questions/70102/how-to-connect-discrete-points-and-make-them-become-continuous-curve

Given that I have two variables $$\theta ,t$$, for the varible $$t$$, $$\theta$$ always owns several values. Namely, where $$t$$ in the interval$$[0,1]$$ and ...

================================== Greatest hits from previous weeks: ==================================

[Image processing: Floor plan - detecting rooms’ borders (area) and room names’ texts] http://mathematica.stackexchange.com/questions/19546/image-processing-floor-plan-detecting-rooms-borders-area-and-room-names-t

Here is a simple building ﬂoor plan. I would like to derive the rooms as (rectangular) components and the names of the rooms. This is very common representation of building ﬂoor plans.

The ...

—————————-

[1 Plot, 2 Scale/Axis] http://mathematica.stackexchange.com/questions/627/1-plot-2-scale-axis

I would like to plot those two datasets on top of each other. But they have very diﬀerent range on the $$y$$ axis. How can I have two diﬀerent axis?

I found the following on the help menu but quite ...

================================== Can you answer these? ==================================

[How to control pedestrians to enter the simulation region with random functions?] http://mathematica.stackexchange.com/questions/70173/how-to-control-pedestrians-to-enter-the-simulation-region-with-random-functions

I am working on simulating crowds of a cross-typed region, given that pedestrians entering from 4 gates of north, east, west and south,

spacesize = 100;width = Floor[0.1 spacesize];
npeople =  ...

—————————-

[Why does Mathematica show 4095/4096 terms in TrigExpand?] http://mathematica.stackexchange.com/questions/70092/why-does-mathematica-show-4095-4096-terms-in-trigexpand

Clear[x, n];
expr = Cos[x]^(n - 2) (1 - Cos[x]^2 + Sin[x]);
r=TrigExpand[expr]

Where do those 4095/4096 comes from? It is correct, but it seems very strange way to represent the result.

...