================================== Top new questions this week: ================================== [How to generate a random snowflake]\url{http://mathematica.stackexchange.com/questions/39361/how-to- generate-a-random-snowflake} 'Tis the season... And it's about time I posed my first 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 (79 votes), answered by Silvia (107 votes) ---------------------------- [Exporting extremely large images; arrays generated via TensorProduct use 5 times as much RAM as expected?]\url{http://mathematica.stackexchange.com/questions/39412/exporti ng-extremely-large-images-arrays-generated-via-tensorproduct-use-5-times > } I am generating plots of the roots of certain classes of polynomials, in the spirit of the multicolored visuals on the Wiki page on algebraic numbers. I've thus far been able to make some extremely ... - asked by DumpsterDoofus (15 votes), answered by ybeltukov (11 votes) ---------------------------- [Plot discontinuous function with black and white disks marking discontinuities]\url{http://mathematica.stackexchange.com/questions/39445/p lot-discontinuous-function-with-black-and-white-disks-marking-discontinu ities} Let's say I'd like to plot Sign[x + 0.5]: Plot[Sign[x + 0.5], {x, -1, 1}] Mathematica will give this: This plot does not show very clearly the value of Sign[x + 0.5] at x = -0.5: is it 1? is ... - asked by user11426 (11 votes), answered by Michael E2 (15 votes) ---------------------------- [Zero-dimensional matrices]\url{http://mathematica.stackexchange.com/questions/39522/zero-dim ensional-matrices} In a recent Mathematica project, $(n \times 0)$- and $(0 \times n)$-dimensional matrices have suddenly become a frustratingly common edge case for me. For instance, consider the following two ... - asked by Eric Peterson (10 votes), answered by Michael E2 (4 votes) ---------------------------- [Can I return lists with different dimensions from a compiled function?]\url{http://mathematica.stackexchange.com/questions/39360/can-i-r eturn-lists-with-different-dimensions-from-a-compiled-function} Sometimes I'll need several lists with different dimensions to be returned by a compiled function, but compiled function will fail if an irregular list contained: (* The real case is of course much ... - asked by xzczd (10 votes), answered by Michael E2 (3 votes) ---------------------------- [Output from Wolfram language in Python]\url{http://mathematica.stackexchange.com/questions/39546/output-fro m-wolfram-language-in-python} I have a Python program which will run a script in the Wolfram language and then return to the main program. Is it possible to return values/variables to the main program? This is the code in Python ... - asked by Hamoudy (9 votes), answered by halirutan (14 votes) ---------------------------- [Is it Possible to change dashes into circles with Plot command?]\url{http://mathematica.stackexchange.com/questions/39394/is-it-po ssible-to-change-dashes-into-circles-with-plot-command} Is it possible to change the Dashed Style of a curve into circles with Plot command ? Plot[Cos[x], {x, 0, 2*Pi}, PlotStyle -> Directive[Dashed, Thickness[0.005]]] - asked by kamran (9 votes), answered by m_goldberg (4 votes) ================================== Greatest hits from previous weeks: ================================== [Are you interested in purchasing David Wagner's "Power programming with Mathematica"?]\url{http://mathematica.stackexchange.com/questions/16485/are -you-interested-in-purchasing-david-wagners-power-programming-with-mathe mat} I recently contacted McGraw-Hill to see if they have a mechanism in place for printing out-of-print books that are still of interest. Specifically, I asked about "Power programming with Mathematica" ... - asked by Todd Allen (98 votes), answered by Todd Allen (126 votes) ---------------------------- [Pick elements of largest absolute value]\url{http://mathematica.stackexchange.com/questions/31385/pick-elemen ts-of-largest-absolute-value} For example, given list = {{1, -3, -5}, {2, 1, 6}, {0, 2, 4}, {-9, 2, 6}} should return: {-5, 6, 4, -9} Updated I found a undocumented function called "Internal`MaxAbs",but it only accept two ... - asked by expression (16 votes), answered by Simon Woods (20 votes) ================================== Can you answer these? ================================== [How to extract structured array data from DefineDLLFunction in Mathematica]\url{http://mathematica.stackexchange.com/questions/39637/how-t o-extract-structured-array-data-from-definedllfunction-in-mathematica} I want to use my Bluechip PCI-ADC acquisition card in Mathematica via his dynamic link library Bcdll32.dll; (used to access functions on my PCI data acquisition cards). My problem is the function ... - asked by ROSU CONSTANTIN (3 votes) ---------------------------- [Return struct from function (with DownValues)]\url{http://mathematica.stackexchange.com/questions/39520/retur n-struct-from-function-with-downvalues} In Mathematica there is a way to create struct-like data type: struct[myField]=value I want to return myStruct from a function: getStruct[input_List] := Module[{struct}, (*populate ... - asked by EvgenijM86 (3 votes) ---------------------------- [Setting bash environment within external call]\url{http://mathematica.stackexchange.com/questions/39509/setting-bash -environment-within-external-call} I would like to run external command from Mathematica. For this I need to have bash environment configured via reading the content of ${HOME}/.bashrc file. When I execute the following code in ... - asked by mmal (1 vote)
================================== Top new questions this week: ================================== [Any ideas on how to use the Region` context?]\url{http://mathematica.stackexchange.com/questions/39184/any-idea s-on-how-to-use-the-region-context} If you type ?Region`* you'll get: which seems a bunch of interesting and not documented symbols. Any idea (or experience) on how to use them? Edit By using our "collective spelunking" I ... - asked by belisarius (23 votes), answered by m_goldberg (12 votes) ---------------------------- [How to create effect like Van Gogh's stroke brush?]\url{http://mathematica.stackexchange.com/questions/39003/how-to-cre ate-effect-like-van-goghs-stroke-brush} I need to apply Van Gogh's stroke brush effect to a random image Take the following image as an example: Thank you so much if you could help! - asked by user10495 (15 votes), answered by Simon Woods (15 votes) ---------------------------- [Elegant high precision `log1p`?]\url{http://mathematica.stackexchange.com/questions/39126/elegant- high-precision-log1p} Sometimes it is hard to understand how numerical expressions are evaluated. I remember reading claims by Wolfram on how smart the Kernel is to evaluate expressions trees numerically by recognizing ... - asked by alfC (12 votes), answered by Mark Adler (7 votes) ---------------------------- [Elegantly split a matrix into positive and negative parts?]\url{http://mathematica.stackexchange.com/questions/39113/elegantly- split-a-matrix-into-positive-and-negative-parts} I have a matrix $M$ of real components, and I want to split it into two matrices $M^+$ and $M^-$ of the same dimensions as $M$, where $M^+$ contains the positive components of $M$ (the remaining ... - asked by becko (12 votes), answered by Yves Klett (20 votes) ---------------------------- [Is there a difference between Divide[a,b] and a/b?]\url{http://mathematica.stackexchange.com/questions/39200/is-there-a-d ifference-between-dividea-b-and-a-b} In this comment it was asserted that Divide[a,b] and a/b are different, though the documentation indicates that they are the same. In particular, it was asserted that a/b is evaluated as a * 1/b, ... - asked by Mark Adler (10 votes), answered by Szabolcs (10 votes) ---------------------------- [How many Christmas gifts?]\url{http://mathematica.stackexchange.com/questions/39338/how-many-c hristmas-gifts} This question is based on the old song, The Twelve Days of Christmas In a comment made on a recent question, Yves Klett remarked, "no seasonal questions this year?" This reminded me of one I solved ... - asked by m_goldberg (8 votes), answered by rm -rf (13 votes) ---------------------------- [Which ColorFunction should I use to get such a gradient of blue-cyan-green-yellow-orange-red?]\url{http://mathematica.stackexchange.co m/questions/39300/which-colorfunction-should-i-use-to-get-such-a-gradien t-of-blue-cyan-green-yello} I want to get the effect in the above Figure. Here is my code: Plot3D[Log[ 4*((1 + x)^2)*(0.0065^2)*Log[y]/(3*((1 - 2 x))^2*(0.0267^2)) + 1]/ Log[y], {x, 0.315, 0.45}, {y, 0, 1}, Mesh -> ... - asked by Scott Wang (8 votes), answered by rm -rf (12 votes) ================================== Greatest hits from previous weeks: ================================== [List of compilable functions]\url{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 (58 votes), answered by Oleksandr R. (66 votes) ---------------------------- [Can one identify the design patterns of Mathematica?]\url{http://mathematica.stackexchange.com/questions/24988/can- one-identify-the-design-patterns-of-mathematica} ... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed ... - asked by Verbeia (65 votes), answered by Leonid Shifrin (50 votes) ================================== Can you answer these? ================================== [Efficient submatrix swaps for large sparse matrix]\url{http://mathematica.stackexchange.com/questions/39209/efficient- submatrix-swaps-for-large-sparse-matrix} I am implementing the 'swap' algorithm for a binary matrix to generate matrix permutations that maintain row and column totals. My problem is that my matrices are large and sparse (e.g., 19774 x 942, ... - asked by Gareth (1 vote) ---------------------------- [How to simplify expressions]\url{http://mathematica.stackexchange.com/questions/39341/how-t o-simplify-expressions} I read several similar posts but I have not found a solution yet. However, I think that my problem should be quite easy. So here we are. Relations Mt = M1 + M2; x1 = -(M2/Mt)*R; x2 = R*(1 - M2/Mt); ... - asked by Vaggelis_Z (1 vote) ---------------------------- [CountryData -> $Failed]\url{http://mathematica.stackexchange.com/questions/39110/countryda ta-failed} Today I started researching the "Four colours theorem" and to do so I need data, regions for example. I tried using the following line: CountryData["Ukraine", "Regions"] But the result: ... - asked by Vitaliy Sergeyevich Barash (1 vote)
================================== Top new questions this week: ================================== [How to plot contours in the faces of a cube]\url{http://mathematica.stackexchange.com/questions/38656/how-to-plot- contours-in-the-faces-of-a-cube} I'm trying to plot contours of a function f[x,y,z] on the faces of a cube as the example below, which represents the domain of this function. Is there a way to do it in Mathematica? The ... - asked by RaphaelDavid (25 votes), answered by belisarius (10 votes) ---------------------------- [Creating new graphics primitive (EdgeForm, FaceForm)]\url{http://mathematica.stackexchange.com/questions/38753/creatin g-new-graphics-primitive-edgeform-faceform} My question is strongly related to this question, nevertheless I would like to bring it to every ones attention. Lets say I want to create a new graphics primitive Boing which should look like this ... - asked by halirutan (23 votes), answered by Simon Woods (18 votes) ---------------------------- [Graphics elements do not line up perfectly in exported PDFs]\url{http://mathematica.stackexchange.com/questions/38745/graphics-ele ments-do-not-line-up-perfectly-in-exported-pdfs} Graphics elements do not always line up perfectly in exported PDFs. Take for example Graphics[{Point[{0, 1}], Line[{{0, 0}, {0, 1}}]}, AspectRatio -> Automatic] It looks like this on screen: ... - asked by Szabolcs (15 votes), answered by Szabolcs (13 votes) ---------------------------- [Drawing an arrow pointing at the "Enable Dynamics" button]\url{http://mathematica.stackexchange.com/questions/38692/drawing-an -arrow-pointing-at-the-enable-dynamics-button} Sometimes my students are given Mathematica notebooks as part of an assignment, and asked to go through some demonstrations contained in the .nb file. A lot of times I get complaints that the "graphs ... - asked by Steve D (11 votes), answered by Alexei Boulbitch (9 votes) ---------------------------- [ReplaceRepeated seemingly omits some rules]\url{http://mathematica.stackexchange.com/questions/38668/replacerepe ated-seemingly-omits-some-rules} Is there a simple way in Mathematica to prevent rule reordering? Let me give an example: a -> b //. {b -> c, (x_ -> y_) -> (x -> Expand[y])} (* a -> b *) though a -> b /. {b ... - asked by jondaman21 (10 votes), answered by Mr.Wizard (6 votes) ---------------------------- [Formatting Excel Borders with .Net]\url{http://mathematica.stackexchange.com/questions/38891/formatting-e xcel-borders-with-net} I have various tables generated in a Mathematica application and need to export this to MSExcel formatted in a specific way. The Excel formatting has to be generated by Mathematica. I am not ... - asked by BlueMac (9 votes), answered by WReach (11 votes) ---------------------------- [Problem with numerical evaluation of analytically solved integral, solution way off]\url{http://mathematica.stackexchange.com/questions/38734/problem-with- numerical-evaluation-of-analytically-solved-integral-solution-way} The following command in Version 9.0.1: N[Integrate[x^50*Sin[x], {x, 0, 1}]] gives $1.4615\times 10^{48}$ which is way off from the correct solution which is between $0$ and $0.5$. Interestingly ... - asked by vonjd (9 votes), answered by Szabolcs (12 votes) ================================== Greatest hits from previous weeks: ================================== [ShowLegend values]\url{http://mathematica.stackexchange.com/questions/6236/showlegend- values} How do I get ShowLegend to put the max and min values that a plot produces. for example, when using ListDensityPlot, with PlotRange->Automatic, the plot can sometimes clip. How do I get ... - asked by Andrew Spott (23 votes), answered by Jens (30 votes) ---------------------------- [Get a "step by step" evaluation in Mathematica]\url{http://mathematica.stackexchange.com/questions/148/get-a-s tep-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? Example : Let's say I want to ... - asked by Skydreamer (43 votes), answered by J.M. (38 votes) ================================== Can you answer these? ================================== [What are the limits of the Prime-functions?]\url{http://mathematica.stackexchange.com/questions/38819/ what-are-the-limits-of-the-prime-functions} Will Prime and PrimePi test up to 3 * 10^12? Where can I find the limits for these funtions? Also, what are the limits for PrimeOmega and PrimeNu? More generally, is there any documentation that gives ... - asked by martin (2 votes) ---------------------------- [Efficient storage of Kronecker sum of circulant matrices+diagonal matrix]\url{http://mathematica.stackexchange.com/questions/38901/efficient- storage-of-kronecker-sum-of-circulant-matricesdiagonal-matrix} I have a square matrix of the form $$M=D+\overset{N}{\underset{n=1}\bigoplus}R_n,$$ where $R_n$ are circulant matrices, $D$ is a diagonal matrix and $\oplus$ is Kronecker sum. Its size is quite big, ... - asked by Ruslan (2 votes) ---------------------------- [What is available for editing Mathematica source code with Emacs?]\url{http://mathematica.stackexchange.com/questions/38838/what-is-av ailable-for-editing-mathematica-source-code-with-emacs} I can find several Emacs libraries for Mathematica, but I'm not aware of a clear favourite, a definitive list, or of a library which is actively maintained and developed. None of these appear to be in ... - asked by Ian Hinder (6 votes)
================================== Top new questions this week: ================================== [Unexpected dots from Line]\url{http://mathematica.stackexchange.com/questions/38443/unexpected-d ots-from-line} I have noticed cases where Line produces dots in a graphics object when I think it shouldn't. The first of these is: Line[{{0., 0.}}] The second is: Line[{{0., 0.}, {0., 0.}}] Longer lists of ... - asked by m_goldberg (14 votes), answered by ybeltukov (3 votes) ---------------------------- [How to replace an element in a list based on the value of the next element?]\url{http://mathematica.stackexchange.com/questions/38472/how-to-r eplace-an-element-in-a-list-based-on-the-value-of-the-next-element} I use Mathematica a little bit. I try to understand it, but it is hard I have a list of 5 numbers selected randomly from 0 and -1. I have to replace a 0 with a 1 when the 0 is followed by -1. My ... - asked by user11021 (14 votes), answered by ybeltukov (14 votes) ---------------------------- [How to pick increasing numbers from the list]\url{http://mathematica.stackexchange.com/questions/38325/how-to-pick- increasing-numbers-from-the-list} How to pick increasing numbers from the list. lst = {5, 3, 6, 2, 7, 4, 8}; out: {5,6,7,8} So many interesting answers, is it possible know the index of result elements or position of ... - asked by Thomas (11 votes), answered by Simon Woods (6 votes) ---------------------------- [How to collect expressions from cells created by Print?]\url{http://mathematica.stackexchange.com/questions/38216/how-to-col lect-expressions-from-cells-created-by-print} I have a notebook where evaluation of a certain cell produced hundreds of adjacent output cells using Print. I need to create a list containing all expressions from those output cells as elements, and ... - asked by Vladimir Reshetnikov (11 votes), answered by belisarius (17 votes) ---------------------------- [How to constrain memory usage on HPC?]\url{http://mathematica.stackexchange.com/questions/38403/how-to-const rain-memory-usage-on-hpc} I found the performance of built-in function MemoryConstrained is very poor. It stops the evaluation after the memory already exceeds greatly than the values I set. There are several other questions ... - asked by matheorem (9 votes) ---------------------------- [Different results for integration using Mathematica and MATLAB]\url{http://mathematica.stackexchange.com/questions/38457/different- results-for-integration-using-mathematica-and-matlab} I have the following integration: $$\text{y}=2 \sqrt{\frac{1}{\pi }} \int_0^{\infty } \frac{e^{-z} \left(1-e^{-\frac{z}{b}} \left(\frac{a}{a+c z}\right)^L\right)}{\sqrt{z}} \, dz$$ I get different ... - asked by barznjy (9 votes), answered by Peltio (8 votes) ---------------------------- [Disconnected Frame/Axes in Plots]\url{http://mathematica.stackexchange.com/questions/38581/disconnecte d-frame-axes-in-plots} Is it possible to have "Tufte" style figure axes? That is so that the axes do not need to connect or span the entire data range? For an example of what I mean from the R's default histogram style: ... - asked by Gabriel (8 votes), answered by Silvia (6 votes) ================================== Greatest hits from previous weeks: ================================== [How to determine the center and radius of a circle given three points in 3D?]\url{http://mathematica.stackexchange.com/questions/16209/how-to-determ ine-the-center-and-radius-of-a-circle-given-three-points-in-3d} I was wondering if anyone could give me a hand with this problem I have. I have six points on a plane, and I am trying to determine if they form a circle or not. I know that any three points in 2D ... - asked by RedPotatoe (9 votes), answered by Mark McClure (15 votes) ---------------------------- [Get a "step by step" evaluation in Mathematica]\url{http://mathematica.stackexchange.com/questions/148/get-a-s tep-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? Example : Let's say I want to ... - asked by Skydreamer (43 votes), answered by J.M. (38 votes) ================================== Can you answer these? ================================== [Manipulating the pitch of a sound]\url{http://mathematica.stackexchange.com/questions/38423/manipulatin g-the-pitch-of-a-sound} After reading Manipulating a continuous stream of sounds I have to ask about controlling the frequency of a Sin sound in a continuous manner, with a Play inside a Manipulate, for example. The result ... - asked by Andrestand (3 votes) ---------------------------- [How to get vertices of a polytope given by equalities and inequalities?]\url{http://mathematica.stackexchange.com/questions/38414/how -to-get-vertices-of-a-polytope-given-by-equalities-and-inequalities} I have a polytope given by some equalities and inequalities, how can I get all the vertices of the polytope? If there's a way to deal with the one given by inequalities only, how can I reduce the ... - asked by Jason (3 votes) ---------------------------- [Solar system simulation (n-body physics) with OpenCL]\url{http://mathematica.stackexchange.com/questions/38478/solar-syst em-simulation-n-body-physics-with-opencl} I would like to simulate a n-body solar system in Mathematica. I have found the following example: ... - asked by shrx (1 vote)
================================== Top new questions this week: ================================== [Can Mathematica determine part-of-speech for each word in a text?]\url{http://mathematica.stackexchange.com/questions/38053/can-mathema tica-determine-part-of-speech-for-each-word-in-a-text} I've found that WordData has a database of English words and their possible parts of speech. But some words are ambiguous, e.g. result can be a verb or a noun: In[7]:= WordData["result", ... - asked by F'x (16 votes), answered by ssch (12 votes) ---------------------------- [Whether Wolfram Mathematica suits well for doing app in it instead of C++]\url{http://mathematica.stackexchange.com/questions/37888/whether-wolfr am-mathematica-suits-well-for-doing-app-in-it-instead-of-c} At uni I have an yearly essay. I'm allowed to use any technology for implementing it. I've been coding it in C++ with Qt. I thought of about Wolfram Mathematica because I have some expirience in it. ... - asked by gekannt (14 votes), answered by Murta (27 votes) ---------------------------- [How to enumerate all possible binary associations?]\url{http://mathematica.stackexchange.com/questions/37869/how -to-enumerate-all-possible-binary-associations} Suppose I have a list of symbols like: {a,b,c,d} I would like to enumerate all possible binary associations (combining symbols and/or sublists pairwise): {{{a,b},c},d} {{a,b},{c,d}} {a,{b,{c,d}}} ... - asked by Everett You (12 votes), answered by ybeltukov (11 votes) ---------------------------- [How to get list of duplicates when using DeleteDuplicates?]\url{http://mathematica.stackexchange.com/questions/37936 /how-to-get-list-of-duplicates-when-using-deleteduplicates} This might be easy, but can't find a way to use DeleteDuplicates to get also list of the actual duplicates. Example: lstA = {1, 2, 4, 4, 6, 7, 8, 8}; r = DeleteDuplicates[lstA] (* {1, 2, 4, 6, 7, ... - asked by Nasser (11 votes), answered by Mr.Wizard (13 votes) ---------------------------- [Raspberry Pi GPIO operations with Mathematica]\url{http://mathematica.stackexchange.com/questions/37926/raspb erry-pi-gpio-operations-with-mathematica} I started exploring GPIO operations on the RPi with Mathematica by following this brief tutorial which describes how to use DeviceWrite to cycle an LED on and off. A natural extension is to use ... - asked by bobthechemist (11 votes), answered by Daniel Chisholm (6 votes) ---------------------------- [Reduce can't reduce an equation without appropriate assumptions]\url{http://mathematica.stackexchange.com/questions/38118/reduc e-cant-reduce-an-equation-without-appropriate-assumptions} When the number of unknowns is three (x, y, z), Mathematica can solve it: Reduce[Abs[x] + Abs[y] + Abs[z] == 1 && z != 0, {x, y, z}, Reals, Backsubstitution -> True] for four variables ... - asked by expression (9 votes), answered by Artes (11 votes) ---------------------------- [Pasting monospaced text into Mathematica notebook destroys aligment]\url{http://mathematica.stackexchange.com/questions/38073/pasting- monospaced-text-into-mathematica-notebook-destroys-aligment} I drew the little ASCII-art electronics schema below in vim. When i try to paste it into a Mathematica notebook, with: A) A code cell B) A monospaced font (Courier New) Mathematica insists on ... - asked by blondiepassesby (9 votes), answered by WReach (11 votes) ================================== Greatest hits from previous weeks: ================================== [Mathematica9 linux version crash, how to fix it?]\url{http://mathematica.stackexchange.com/questions/17163/mathematica9- linux-version-crash-how-to-fix-it} Ubuntu 12.04 x86_64 kernel 3.2.0-35-generic Mathematica 9 linux version (x86_64) crashes with errors: X Error of failed request: BadGC (invalid GC parameter) Major opcode of failed request: ... - asked by goodluck (10 votes), answered by goodluck (14 votes) ---------------------------- [Calling MATLAB from Mathematica]\url{http://mathematica.stackexchange.com/questions/10231/calli ng-matlab-from-mathematica} How can I call MATLAB functions directly from Mathematica and transfer data/variables between the two systems? - asked by siva82kb (29 votes), answered by Szabolcs (35 votes) ================================== Can you answer these? ================================== [ParametricNDSolve and ProcessEquations]\url{http://mathematica.stackexchange.com/questions/37942/ parametricndsolve-and-processequations} I have a question regarding NDSolve`ProcessEquations and ParametricNDSolve. When using the regular NDSolve we have the option to divide the integration into the three steps ProcessEquations, Iterate ... - asked by jaclea (1 vote) ---------------------------- [How to set the working precision globally? $MinPrecision does not work]\url{http://mathematica.stackexchange.com/questions/38114/how-to-set-t he-working-precision-globally-minprecision-does-not-work} I want to increase the precision globally to 50 at least, but $MinPrecision does not work. $MinPrecision = 50; x = Sin[2.] (* -> 0.909297 *) Precision[x] (* -> MachinePrecision *) How to set ... - asked by renphysics (3 votes) ---------------------------- [matrix with IF/THEN condition]\url{http://mathematica.stackexchange.com/questions/37905/matrix- with-if-then-condition} How to generate all posible matrices with some conditions on the elements? I need to make for given $n$ all $n\times n$ matrices $A=(a_{ij})$ with three conditions: I. $a_{ij}=+1$ or $0$ or $-1$. ... - asked by aeiklmkv (1 vote)
================================== Top new questions this week: ================================== [Is Mathematica an Implementation of the Wolfram Language?]\url{http://mathematica.stackexchange.com/questions/37557/is-math ematica-an-implementation-of-the-wolfram-language} I am trying to figure out what the announcement of the Wolfram Language means for Mathematica. Is Mathematica an implementation of the Wolfram Language, or is it something else? - asked by Eric Brown (21 votes) ---------------------------- [How to plot a certain surface? What is its parametric equation?]\url{http://mathematica.stackexchange.com/questions/37698/how-to- plot-a-certain-surface-what-is-its-parametric-equation} The surface show below is very beautiful; however, I don't know its function either as an implicit function or in parametric form. Anyone have an idea about it and how to draw it with Mathematica? - asked by LCFactorization (14 votes), answered by kirma (35 votes) ---------------------------- [CompiledFunction returns machine numbers smaller than $MinMachineNumber]\url{http://mathematica.stackexchange.com/questions/37764 /compiledfunction-returns-machine-numbers-smaller-than-minmachinenumber> ) When thinking on the workaround for this LogLogPlot bug suggested by halirutan I noticed that CompiledFunction actually can return machine numbers smaller than $MinMachineNumber. Consider: f = ... - asked by Alexey Popkov (13 votes), answered by ybeltukov (12 votes) ---------------------------- [Laplace transform of $\frac{1-\cos (t)}{t}$]\url{http://mathematica.stackexchange.com/questions/37480/laplace- transform-of-frac1-cos-tt} In the documentation, it states that The Laplace transform of a function $f(t)$ is defined to be $\int_0^{\infty } f(t) e^{-s t} \, \mathrm{d}t$. But why can Mathematica not get the Laplace ... - asked by xslittlegrass (13 votes), answered by Vladimir Reshetnikov (17 votes) ---------------------------- [Why is multidimensional Reverse slow?]\url{http://mathematica.stackexchange.com/questions/37777/why-is-mult idimensional-reverse-slow} I have found that multidimensional Reverse is ~10 times slower than exact -1 ;; 1 ;; -1: n = 1000; mat = RandomReal[1, {n, n}]; mat2 = Reverse[mat, 2]; // AbsoluteTiming mat3 = mat[[All, -1 ;; 1 ;; ... - asked by ybeltukov (12 votes), answered by Mr.Wizard (3 votes) ---------------------------- [How can I remove the singleton dimensions of an array?]\url{http://mathematica.stackexchange.com/questions/37656/how-can-i- remove-the-singleton-dimensions-of-an-array} If I have an array A, for which Dimensions[A] is {9, 9, 1, 1, 3, 4}, how can I convert A' into an array with dimensions {9, 9, 3, 4}? I think there is a built-in function for this, but I can't ... - asked by LCFactorization (11 votes), answered by Simon Woods (10 votes) ---------------------------- [Concatenation of lists in a Fibonacci-like pattern]\url{http://mathematica.stackexchange.com/questions/37705/concatena tion-of-lists-in-a-fibonacci-like-pattern} I am trying to create a List of elements that follow the general pattern: $$X_{n+1} = X_n X_{n-1}$$ where the operation on the right hand side is concatenation, i.e., joining. I want to achieve the ... - asked by user106492 (10 votes), answered by Simon Woods (11 votes) ================================== Greatest hits from previous weeks: ================================== [Mathematica9 linux version crash, how to fix it?]\url{http://mathematica.stackexchange.com/questions/17163/mathematica9- linux-version-crash-how-to-fix-it} Ubuntu 12.04 x86_64 kernel 3.2.0-35-generic Mathematica 9 linux version (x86_64) crashes with errors: X Error of failed request: BadGC (invalid GC parameter) Major opcode of failed request: ... - asked by goodluck (9 votes), answered by goodluck (13 votes) ---------------------------- [How do I save a variable or function definition to a file?]\url{http://mathematica.stackexchange.com/questions/1959/how-do-i-sav e-a-variable-or-function-definition-to-a-file} Is it possible to save a function which was created via Interpolation of some data in such a way that I can use this function in a new Mathematica session without repeated interpolation of the data? ... - asked by partial81 (27 votes), answered by acl (24 votes) ================================== Can you answer these? ================================== [Plotting basin boundary]\url{http://mathematica.stackexchange.com/questions/37611/plotting -basin-boundary} How to plot the basin boundary in Mathematica? I have been trying to do this using the system y''[t] == -R y'[t] + (( Y[1] - y[t])/(Sqrt[(X[1] - x[t])^2 + (Y[1] - y[t])^2 + d^2])^3 ... - asked by HQH (1 vote) ---------------------------- [How do I use Greek characters in the WindowTitle option of CreateWindow?]\url{http://mathematica.stackexchange.com/questions/37635/how -do-i-use-greek-characters-in-the-windowtitle-option-of-createwindow} I am trying to write some exercises in Greek using CreateWindow. My problem is with using Greek characters in the option WindowTitle. For example, with CreateWindow[DocumentNotebook[{a}, WindowTitle ... - asked by kornaros (2 votes) ---------------------------- [Need help fixing fit, eliminating the error of property values assuming unconstrained model, and correcting script for an implicit function]\url{http://mathematica.stackexchange.com/questions/37570/need-hel p-fixing-fit-eliminating-the-error-of-property-values-assuming-unconstr> ) I fit some data with FindFit and NonlinearModelFit as well as obtained the parameter table and ANOVA table: data = {{82.5, 5.75}, {75, 5.965}, {68.75, 6}, {63.45, 6.01}, {58.95, 6.03}, {55, 6.04}}; ... - asked by chy (2 votes)
================================== Top new questions this week: ================================== [Even Fibonacci numbers]\url{http://mathematica.stackexchange.com/questions/37266/even-fibo nacci-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 first 10 terms will be: 1, ... - asked by Tangshutao (19 votes), answered by rcollyer (28 votes) ---------------------------- [How to split list into disjoint lists?]\url{http://mathematica.stackexchange.com/questions/37249/how-to-spl it-list-into-disjoint-lists} I wonder if there is any simple way to split a list into its disjoint sublists, e.g. from list={{a,b},{e,f},{b,c},{c,d},{f,g,h}} get a result listdis={{{a,b},{b,c},{c,d}},{{e,f},{f,g,h}}}, so ... - asked by krzysiekb (13 votes), answered by Leonid Shifrin (11 votes) ---------------------------- [How to draw a spring?]\url{http://mathematica.stackexchange.com/questions/37207/how-to-dr aw-a-spring} I am new to Mathematica and have recently been exploring graphical animations. So I was experimenting with simple concepts in periodic motion and hence wondered how can I draw a simple spring? Is ... - asked by David McHarg (13 votes), answered by belisarius (11 votes) ---------------------------- [How to programmatically remove menu items]\url{http://mathematica.stackexchange.com/questions/36923/how-to-prog rammatically-remove-menu-items} I would like to do the opposite of what is described here. So rather than add a menu item I would like to programmatically remove one (or more). So given a knowledge of the structure of the menu *.tr ... - asked by Mike Honeychurch (9 votes) ---------------------------- [Impact Crater Simulation]\url{http://mathematica.stackexchange.com/questions/37183/impact -crater-simulation} I have been trying to model crater formation on a given planetary surface - $500\,\textrm{km}^2$. The locations of impacts are random, however, if an impact is within $30\,\textrm{km}$ of another, the ... - asked by Benjamin L (8 votes), answered by belisarius (6 votes) ---------------------------- [What is wrong with my expression for compiling?]\url{http://mathematica.stackexchange.com/questions/37262/what-i s-wrong-with-my-expression-for-compiling} Following code was translated from a snippet matlab code. Without compiling it worked slowly. I want to compile it, but am getting a numerical error. How do I compile this in a correct way? data = ... - asked by expression (7 votes), answered by ybeltukov (10 votes) ---------------------------- [how to simplify large expression with lots of special functions in it (BesselY, Hypergeometric, MeijerG etc...)]\url{http://mathematica.stackexchange.com/questions/37289/how-to-si mplify-large-expression-with-lots-of-special-functions-in-it-bessely} I saw this DE in Maple forum. When solving it using Mathematica 9.01, even though the result was correct (both solutions gave the same numerical answer for some random values), Mathematica's answer ... - asked by Nasser (7 votes), answered by ssch (1 vote) ================================== Greatest hits from previous weeks: ================================== [How can I improve Mathematica's resolution on a macbook retina display?]\url{http://mathematica.stackexchange.com/questions/18419/how-can- i-improve-mathematicas-resolution-on-a-macbook-retina-display} Mathematica 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 (28 votes), answered by programming_historian (11 votes) ---------------------------- [Where can I find examples of good Mathematica programming practice?]\url{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. (234 votes), answered by Faysal Aberkane (220 votes) ================================== Can you answer these? ================================== [The number of real values assumed by combinations of complex roots of a decic]\url{http://mathematica.stackexchange.com/questions/36933/the-number- of-real-values-assumed-by-combinations-of-complex-roots-of-a-decic} Define complex conjugate as the pair of complex numbers $a+bi,a-bi$. Assume you have 5 such pairs and they are the 10 roots $x_i$ of a 10th-deg equation with integer coefficients. In general, how many ... - asked by Tito Piezas III (1 vote) ---------------------------- [Odd colourization for FourierParameters. UI bug?]\url{http://mathematica.stackexchange.com/questions/37133/odd-colouriz ation-for-fourierparameters-ui-bug} The Mathematica UI colourizes the FourierParameters in the following Clear[x, y] g[x_, y_] = x^2 y ; f[x_, y_] = FourierSeries[x^2 y, {x, y}, {4, 4}, FourierParameters -> {1, 2 Pi}] as in the ... - asked by Peeter Joot (2 votes) ---------------------------- [Using FunctionExpand[] to evaluate symbolic derivatives]\url{http://mathematica.stackexchange.com/questions/37293/using -functionexpand-to-evaluate-symbolic-derivatives} Some symbolic derivatives of certain special function are not expanded automatically, but FunctionExpand often helps to get a derivative-free closed form expression. Derivative[1, 0][BesselJ][0, 1] ... - asked by Vladimir Reshetnikov (5 votes)
================================== Top new questions this week: ================================== [Kernel inexplicably hangs if I define a pure function without suppressing output]\url{http://mathematica.stackexchange.com/questions/35629/kernel-ine xplicably-hangs-if-i-define-a-pure-function-without-suppressing-output} Save any unsaved work before trying as it may crash Mathematica and other programs In v9.0.1.0 on OSX 10.8.5, if I start a new session and define two functions f1P = Sin[#^Sin[Sqrt[Gamma[#]]]] ... - asked by gpap (14 votes), answered by m_goldberg (4 votes) ---------------------------- [Bug in RepeatedNull?]\url{http://mathematica.stackexchange.com/questions/36850/bug -in-repeatednull} RepeatedNull appears to be buggy (version 8.0). Define f as follows: In[1]:= f@s:{h_@___...} := List @@@ s f is intended to accept (possibly empty) List of non-atomic (possibly empty) expressions ... - asked by Akater (13 votes), answered by m_goldberg (5 votes) ---------------------------- [Equivalent Nested Loop Structure]\url{http://mathematica.stackexchange.com/questions/35560/equival ent-nested-loop-structure} Consider the following examples: Flatten @ Table[ f[a, b, c], {a, 1, 3}, {b, 1, 3}, {c, 1, 3}] == f @@@ Tuples[ Range[3], 3] Flatten @ Table[ If[ a != b != c, f[a, b, c], Unevaluated[]], ... - asked by expression (12 votes), answered by Ray Koopman (2 votes) ---------------------------- [Finding the volume of a sphere using the Monte Carlo algorithm]\url{http://mathematica.stackexchange.com/questions/35683/finding -the-volume-of-a-sphere-using-the-monte-carlo-algorithm} I used the following code to find the volume of the sphere $x^2+y^2+z^2 = 1$ in the first octant: McVolume[Num_] := Module[{hit, miss, index, x, y, z}, hit = 0; miss = 0; For[index = 1, index ... - asked by johny (12 votes), answered by Szabolcs (15 votes) ---------------------------- [Making code version aware]\url{http://mathematica.stackexchange.com/questions/36806/making-code -version-aware} Mathics, a free Mathematica-compatible project has been recently launched. It provides a subset of the functions and capabilities of Mathematica at a slower pace. This opens us the tantalizing ... - asked by magma (11 votes), answered by magma (5 votes) ---------------------------- [Partitioning a list of numbers the Mathematica way]\url{http://mathematica.stackexchange.com/questions/36867/partitioning- a-list-of-numbers-the-mathematica-way} I have two sorted lists, one list will be called the "fences" and the other the "values" Fences could be: $\{1, 5, 9, 14\}$ Values could be $\{-1, 1, 3, 4, 6, 9, 10, 13, 14, 15\}$ I want to ... - asked by muzzlator (10 votes), answered by Ray Koopman (18 votes) ---------------------------- [Any way to make my equations look better, more Latex like?]\url{http://mathematica.stackexchange.com/questions/36697/any-way-to- make-my-equations-look-better-more-latex-like} I find that the equations I write in Mathematica are not always publication quality. Here is a typical example: If I copy as Latex, then I get the following code: \frac{\sum _{i=1}^N \frac{(k|k) ... - asked by Tyler Durden (9 votes), answered by Mike Honeychurch (9 votes) ================================== Greatest hits from previous weeks: ================================== [How to manipulate 2D plots?]\url{http://mathematica.stackexchange.com/questions/7142/how-to-mani pulate-2d-plots} When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ... - asked by Istvan Zachar (58 votes), answered by Istvan Zachar (56 votes) ---------------------------- [Programmatic approach to HDR photography with Mathematica image processing functions]\url{http://mathematica.stackexchange.com/questions/9342/programm atic-approach-to-hdr-photography-with-mathematica-image-processing-funct > } The High dynamic range imaging (HDR or HDRI) direction in photography and image processing became very popular recently. Besides obvious photo art applications (see examples), there are many great ... - asked by Vitaliy Kaurov (44 votes), answered by Simon Woods (30 votes) ================================== Can you answer these? ================================== [How can I set constraints on parameters in NelderMeadMinimize package?]\url{http://mathematica.stackexchange.com/questions/35651/how-can- i-set-constraints-on-parameters-in-neldermeadminimize-package} I read about NelderMeadMinimize package. How can I set constraints on the parameters? For example I want to minimize an equation with 10 parameters such as {a1, a2, ....}. I want to put the condition ... - asked by Soodeh Z. (1 vote) ---------------------------- [WhenEvent method with 3 conditions]\url{http://mathematica.stackexchange.com/questions/36869/whenev ent-method-with-3-conditions} I am trying to solve system of differential equations below $x''(t)=-2.25cos(1.5t)-x(t)-x'(t)$ $y''(t)=-1.125cos(1.5t)-4y(t)-y'(t)$ for $x>(1+y)$ then $z'(t)=x(t)-(1+y(t))$ for $|x|<(1+y)$ ... - asked by Dadan Ari Wibowo (1 vote) ---------------------------- [Caching data in Mathematica package]\url{http://mathematica.stackexchange.com/questions/36875/caching-d ata-in-mathematica-package} Consider the following: m=Quantity[1,"meter"] If I run the package, it will return 1m But when I load the package, the package is re-evaluated meaning, that internet i required. Is it possible to ... - asked by OskarNS (1 vote)
================================== Top new questions this week: ================================== [Incorrect result from Integrate]\url{http://mathematica.stackexchange.com/questions/35324/incorre ct-result-from-integrate} I attempted to calculate the following integral: Integrate[ Sqrt[x] Exp[-(x - a)^2], {x, 0, Infinity}, Assumptions -> a > 0] 1/(4 Sqrt[a])I E^(-(a^2/2)) Pi( a^2 BesselI[-(1/4), a^2/2] - (1 + a^2) ... - asked by DumpsterDoofus (12 votes), answered by Michael E2 (10 votes) ---------------------------- [Unpacked eigenvectors of complex matrices]\url{http://mathematica.stackexchange.com/questions/35266/unpacked -eigenvectors-of-complex-matrices} I want to calculate eigenvectors of a Hermitian matrix. For example $HistoryLength = 0; n = 3000; mat = # + ConjugateTranspose[#] &@RandomComplex[{0, 1 + I}, {n, n}]; evec = Eigenvectors[mat]; ... - asked by ybeltukov (11 votes), answered by halirutan (8 votes) ---------------------------- [Wrong numerical value while exporting to a JSON string]\url{http://mathematica.stackexchange.com/questions/35165/wrong-nume rical-value-while-exporting-to-a-json-string} The following code: ExportString[{"a" -> 2000000., "b" -> 0.000001}, "JSON"] Gives the results {"a" : 2.e60, "b" : 1.e-6} The first one is obviously having a wrong numerical value. Also, ... - asked by hwlau (11 votes), answered by hwlau (6 votes) ---------------------------- [Boundary effect of Graphics3D object Tube[]]\url{http://mathematica.stackexchange.com/questions/35331/boundary-e ffect-of-graphics3d-object-tube} I draw a Graphics3D object of two tubes: Graphics3D[{Tube[{{-0.2, -1, 0}, {-0.2, 1, 0}}, 0.05], Tube[{{0, 0, -1}, {0, 0, 1}}, 0.05]}, Boxed -> False] And I get this: Now I want to have ... - asked by 9527 (10 votes), answered by ybeltukov (10 votes) ---------------------------- [Monitoring progress of long calculations]\url{http://mathematica.stackexchange.com/questions/35139/moni toring-progress-of-long-calculations} I've came upon a few methods of how to display "processing" information while Mathematica is running. But, from what I've understood, this only works in between lines of codes. Is it possible to ... - asked by Gabriel (10 votes), answered by Simon Woods (8 votes) ---------------------------- [How to find a specific color in one picture?]\url{http://mathematica.stackexchange.com/questions/35132/how-to-f ind-a-specific-color-in-one-picture} In a picture, there are many different colors. How can I just want to find the position of one color. In the following picture, if I would like to find the coordinates of the position of blue, how can ... - asked by KathyLL (9 votes), answered by cormullion (12 votes) ---------------------------- [Is there a way to make the "Details" section of the documentation expand by default?]\url{http://mathematica.stackexchange.com/questions/35370/is-there -a-way-to-make-the-details-section-of-the-documentation-expand-by-defa} By default, the Mathematica documentation opens with the "Details" section collapsed. This is never what I'm looking for in fact, I've lost count of the times I've sought help on a feature and ... - asked by raxacoricofallapatorius (8 votes) ================================== Greatest hits from previous weeks: ================================== [xkcd-style graphs]\url{http://mathematica.stackexchange.com/questions/11350/xkcd-style -graphs} I received an email to which I wanted to respond with a xkcd-style graph, but I couldn't manage it. Everything I drew looked perfect, and I don't have enough command over PlotLegends to have these ... - asked by Amatya (392 votes), answered by Simon Woods (261 votes) ---------------------------- [Can one identify the design patterns of Mathematica?]\url{http://mathematica.stackexchange.com/questions/24988/can- one-identify-the-design-patterns-of-mathematica} ... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed ... - asked by Verbeia (52 votes), answered by Leonid Shifrin (43 votes) ================================== Can you answer these? ================================== [Problem in exporting a plot with background to pdf]\url{http://mathematica.stackexchange.com/questions/35131/problem-in-ex porting-a-plot-with-background-to-pdf} Just wondering if someone could help me for this problem. I have utilised prolog to use a jpg image as the background of my plot in order to compare my results with a reference plot. Although the ... - asked by mak maak (1 vote) ---------------------------- [Series expansion: Taylor series takes huge amount of time]\url{http://mathematica.stackexchange.com/questions/35372/series-expan sion-taylor-series-takes-huge-amount-of-time} I'm working on a notebook, trying to expand the root of a cubic polynomial in Taylor series. When I type: Series[(Sqrt[46656 a^2 - 864 (3 2^(1/3) a^(2/3) + 2 a B)^3] + 216 a)^(1/3) , {a, 0, 2}] ... - asked by user10387 (2 votes) ---------------------------- [How to define tensor fields in Mathematica?]\url{http://mathematica.stackexchange.com/questions/35374/how- to-define-tensor-fields-in-mathematica} I am wondering if the is any (neat) way to define tensor fields in Mathematica. Let me be more specific, using an example: For instance a tensor W with 3 indices, which is anti symmetric in the first ... - asked by user10389 (1 vote)
================================== Top new questions this week: ================================== [Nice formatting for the results of a dice game simulation]\url{http://mathematica.stackexchange.com/questions/34861/nice-f ormatting-for-the-results-of-a-dice-game-simulation} One of my Mathematica interests is in problems related to the formatting of output. Getting nice formatting from Mathematica is often frustrating, but occasionally Mathematica will delight me by ... - asked by m_goldberg (22 votes), answered by ssch (16 votes) ---------------------------- [Export Code to Pseudocode?]\url{http://mathematica.stackexchange.com/questions/34997/expor t-code-to-pseudocode} I'm writing a paper and all my code is in Mathematica. The snippets are mostly simple, and consist of loops, maps, variables, and conditionals. I'd like add it to my paper, however, not many academic ... - asked by M.R. (13 votes) ---------------------------- [How to efficiently find moments of a multinormal distribution?]\url{http://mathematica.stackexchange.com/questions/34779/how -to-efficiently-find-moments-of-a-multinormal-distribution} I have a multinormal distribution with covariance matrix $\sigma$ and zero mean. I want to find moment $$ E[x_1^{r_1}x_2^{r_2}\cdots x_n^{r_n}] =\,? $$ Of course, there is a build-in function ... - asked by ybeltukov (9 votes), answered by ybeltukov (9 votes) ---------------------------- [Problem importing a JCAMP-DX mass spectral file]\url{http://mathematica.stackexchange.com/questions/34624/problem-impo rting-a-jcamp-dx-mass-spectral-file} I have some problems importing a JCAMP-DX EI-mass spectral file using Mathematica 9. For example, if I download the mass spectrum of nonacosane in JCAMP format from NIST, ... - asked by Tom Wenseleers (8 votes), answered by Sjoerd C. de Vries (8 votes) ---------------------------- [How to partition a list of numbers in two lists of numbers such that each lists elements sums up to the same number?]\url{http://mathematica.stackexchange.com/questions/34952/how-to-pa rtition-a-list-of-numbers-in-two-lists-of-numbers-such-that-each-lists} I have the following list of squares. {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256} Their sum is $1496$, I want to make two partitions with the given numbers and each ... - asked by Gustavo Bandeira (7 votes), answered by Daniel Lichtblau (8 votes) ---------------------------- [finding anagrams]\url{http://mathematica.stackexchange.com/questions/34720/finding- anagrams} What I'm trying to find are the 4 letter words in the mathematica dictionary that have the most anagrams and the amount of anagrams these have each. But I can't seem to find all the 4 letter words in ... - asked by jas (7 votes), answered by rcollyer (7 votes) ---------------------------- [How can I scale a plot in vector graphic or PDF form?]\url{http://mathematica.stackexchange.com/questions/34909/how-can-i-s cale-a-plot-in-vector-graphic-or-pdf-form} I am not at all a computer graphics expert, but it seems that portable document format (PDF) files have a "native size," even though they may (and usually do!) contain vector graphics that can be ... - asked by Andrew (6 votes), answered by Alexey Popkov (4 votes) ================================== Greatest hits from previous weeks: ================================== [Mathematica9 linux version crash, how to fix it?]\url{http://mathematica.stackexchange.com/questions/17163/mathematica9- linux-version-crash-how-to-fix-it} Ubuntu 12.04 x86_64 kernel 3.2.0-35-generic Mathematica 9 linux version (x86_64) crashes with errors: X Error of failed request: BadGC (invalid GC parameter) Major opcode of failed request: ... - asked by goodluck (9 votes), answered by goodluck (13 votes) ---------------------------- [Finding all simple paths between two vertices in a graph]\url{http://mathematica.stackexchange.com/questions/25779/finding-all -simple-paths-between-two-vertices-in-a-graph} There are built-in methods to find a shortest path between two vertices in a graph, and the question on finding all shortest paths between two vertices has gathered quite a bit of attention. A path ... - asked by mrm (9 votes), answered by trybik (8 votes) ================================== Can you answer these? ================================== [Visualizing nested lists for easier human understanding]\url{http://mathematica.stackexchange.com/questions/34651/vis ualizing-nested-lists-for-easier-human-understanding} When interacting with Mathematica, I often find myself staring blankly at waves of curly braces, trying to understand how data is organized hierarchically. For example, the beginning of the result to ... - asked by duozmo (3 votes) ---------------------------- [how to load packages on local computer when using remote kernels]\url{http://mathematica.stackexchange.com/questions/34966/how-to-lo ad-packages-on-local-computer-when-using-remote-kernels} I usually works remotely using kernels on our hpc and front-end on my local laptop. This enable me do relatively large computation within my laptop(IP address of my laptop may change frequently). But ... - asked by xslittlegrass (1 vote) ---------------------------- [Strange behaviour of Internal`InheritedBlock]\url{http://mathematica.stackexchange.com/questions /34698/strange-behaviour-of-internalinheritedblock} I was going to post an answer for fast way to replace all zeros in the matrix. I was even quite happy because timings were the same order of magnitude as others. The idea was to overwrite Identity: ... - asked by Kuba (4 votes)
================================== Top new questions this week: ================================== [How to remap a fisheye image?]\url{http://mathematica.stackexchange.com/questions/34264/how-to-rem ap-a-fisheye-image} I want to flatten a series of fisheye images by remapping them to a rectinlinear projection. To achieve this, I need to be able to remap the pixels of the image using fisheye correction formulas for ... - asked by ErikP (10 votes), answered by Simon Woods (9 votes) ---------------------------- [Using With to scope over pure functions]\url{http://mathematica.stackexchange.com/questions/34345/using-w ith-to-scope-over-pure-functions} Consider this example: given an option for a function func as "x" :> (a&), how can one assign different values to a locally inside func? a = False; (* global value of a *) func[opt_] := ... - asked by Istvan Zachar (10 votes), answered by Rojo (12 votes) ---------------------------- [How do I place a texture on an irregular 3D model?]\url{http://mathematica.stackexchange.com/questions/34144/how-do-i-p lace-a-texture-on-an-irregular-3d-model} I'm trying to reproduce a textured head in Mathematica, and I'm using a kind of 'net' of a head which contains all the features on the face. The texture looks like this: which is supposed to look ... - asked by user10035 (9 votes), answered by Sjoerd C. de Vries (2 votes) ---------------------------- [Finding a point from a set of contours such that it is nearest to a given point]\url{http://mathematica.stackexchange.com/questions/34204/finding-a-p oint-from-a-set-of-contours-such-that-it-is-nearest-to-a-given-point} I have several contour lines and one point. How can I find a point in one of those contour lines which is nearest to the given point? (*Create the implicit curves*) ... - asked by c_susetyo (9 votes), answered by PlatoManiac (11 votes) ---------------------------- [Organise a graph's vertices into levels]\url{http://mathematica.stackexchange.com/questions/34106/organise-a -graphs-vertices-into-levels} I would like to organise a graph's vertices in levels. Consider g = { 0 -> 1, 1 -> 2, 2 -> 3, 0 -> 4, 0 -> 5, 2 -> 6, 2 -> 7, 8 -> 3, 4 -> 9, 5 -> 9, 6 -> 9, 6 ... - asked by (7 votes), answered by ybeltukov (6 votes) ---------------------------- [Limit of sequence of functions behaving strange]\url{http://mathematica.stackexchange.com/questions/34124/limit-of- sequence-of-functions-behaving-strange} I'm trying to determine the limit of the sequence of functions $$f_n(x)=\left(\frac{1}{\pi}\arctan(n x) + 1/2\right)^n. $$ I define f[x_, n_] := (1/2 + ArcTan[n x]/Pi)^n And enter Limit[f[x, ... - asked by Isak Kupersmidt (7 votes) ---------------------------- [Extract urls from list]\url{http://mathematica.stackexchange.com/questions/34484/extract-urls -from-list} If I have a list like list = {"my element 1 http://link.com", "http://link2.com my element 2"} how do I get a list of the links inside each element? Something like StringCases[list, "http" ~~ ... - asked by su1 (6 votes), answered by Yves Klett (9 votes) ================================== Greatest hits from previous weeks: ================================== [Are you interested in purchasing David Wagner's "Power programming with Mathematica"?]\url{http://mathematica.stackexchange.com/questions/16485/are -you-interested-in-purchasing-david-wagners-power-programming-with-mathe mat} I recently contacted McGraw-Hill to see if they have a mechanism in place for printing out-of-print books that are still of interest. Specifically, I asked about "Power programming with Mathematica" ... - asked by Todd Allen (92 votes), answered by Todd Allen (119 votes) ---------------------------- [How to create new "person curve"?]\url{http://mathematica.stackexchange.com/questions/17704/how-to-cr eate-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 (41 votes), answered by Vitaliy Kaurov (14 votes) ================================== Can you answer these? ================================== [Exporting graphics to PDF results in destroyed fonts on Windows 8]\url{http://mathematica.stackexchange.com/questions/34303/exporting-graph ics-to-pdf-results-in-destroyed-fonts-on-windows-8} Executing plot = Plot[x^2, {x, 0, 100}, PlotLabel -> "Plot"]; SetDirectory[NotebookDirectory[]]; Export["plot.pdf", plot, "PDF"]; results in Is this a bug? OS is Windows 8, 64bit. - asked by Frederik Ziebell (1 vote) ---------------------------- [TableHeading Lines Do Not Show Up]\url{http://mathematica.stackexchange.com/questions/34287/tableheading-l ines-do-not-show-up} For a list list = {{"a", "b", "c"}, {"d", "e"}}; Table heading lines do not show up TableForm[list, TableHeadings -> Automatic] But it works if the list list = {{"a", "b", "c"}, {"d", "e", ... - asked by Deco (2 votes) ---------------------------- [Syntax for FrontEnd`SelectionSetStyle]\url{http://mathematica.stackexchange.com/questi ons/34297/syntax-for-frontendselectionsetstyle} I know FrontEnd`SelectionSetStyle is undocumented, but its name suggests it does what I need. What is its syntax? I have already tried several variations of the following button on some selected code ... - asked by Hector (2 votes)
================================== Top new questions this week: ================================== [Strip waste braces in nested list]\url{http://mathematica.stackexchange.com/questions/33837/strip-waste- braces-in-nested-list} I have nested lists wherein there are a lot of waste levels which looks like l = {{{{{{2, 2}}, 3}, 2, {{2, 33}}, 4, 5}}}; I would like to reduce it to somthing like l = {{{2, 2}, 3}, 2, {2, 33}, ... - asked by (16 votes), answered by Leonid Shifrin (19 votes) ---------------------------- [How to get intersection values from a parametric graph?]\url{http://mathematica.stackexchange.com/questions/33947/how-to-get -intersection-values-from-a-parametric-graph} I have this graphed: ParametricPlot[{2.4*Cos[t] + 1.6*Cos[3 t/2], 2.4*Sin[t] - 1.6 Sin[3 t/2]}, {t, 0, 4*Pi}] It is a star, and the lines cross each other twice in the third quadrant. I need to ... - asked by guest (14 votes), answered by Artes (17 votes) ---------------------------- [Mathematica gives wrong result while Wolfram|Alpha is correct]\url{http://mathematica.stackexchange.com/questions/33866/mathemati ca-gives-wrong-result-while-wolframalpha-is-correct} Why does Mathematica and Wolfram|Alpha give different results based upon the same code? I know Wolfram|Alpha's 7.85 is correct. - asked by dansu (11 votes), answered by Michael E2 (12 votes) ---------------------------- [Replace elements in list not matching elements of another list at the same position]\url{http://mathematica.stackexchange.com/questions/33731/replace- elements-in-list-not-matching-elements-of-another-list-at-the-same-posit > } I would like to compare two arrays: m = {a,b,c,d,d,f}; n = {b,b,a,d,d,e}; and get: {0,b,0,d,d,0} I have tried all kinds of things, like: m = {a,b,c,d,d,f}; n = {b,b,a,d,d,e}; Transpose[{m, ... - asked by martin (11 votes), answered by Leonid Shifrin (18 votes) ---------------------------- [How can I type-check the arguments of a Mathematica function?]\url{http://mathematica.stackexchange.com/questions/33884/how-can -i-type-check-the-arguments-of-a-mathematica-function} (For educational purposes) I defined the following functions: Translation (in $\mathbb{R}^2$): trM[vec_] := {{1, 0, vec[[1]]}, {0, 1, vec[[2]]}, {0, 0, 1}} Rotation (in $\mathbb{R}^2$): ... - asked by ndroock1 (10 votes), answered by RunnyKine (6 votes) ---------------------------- [How to bend a logarithmic number line into a circle]\url{http://mathematica.stackexchange.com/questions/33924/how-to-ben d-a-logarithmic-number-line-into-a-circle} One way to plot a sequence of numbers on a logarithmic number line is this: LogLogPlot[0, {t, 8, 16}, Axes -> {True, False}, Ticks -> {{8, 9, 10, 11, 12, 13, 14, 15, 16}}] How can the ... - asked by Bogdan (9 votes), answered by ybeltukov (4 votes) ---------------------------- [Is there a way to find out who is importing a package?]\url{http://mathematica.stackexchange.com/questions/33949/is-there -a-way-to-find-out-who-is-importing-a-package} After calling some functions, if I look into $ContextPath, I can see that JLink` is in there. Is there a way to find out what sequence of functions calls (like a stack-trace) imported a particular ... - asked by Adal (9 votes), answered by Leonid Shifrin (8 votes) ================================== Greatest hits from previous weeks: ================================== [How can I extract data points from a black and white image?]\url{http://mathematica.stackexchange.com/questions/3831/how-can-i-e xtract-data-points-from-a-black-and-white-image} Consider the following graph (source): Is there any way to extract the data points from this image in a semi-automatic way? I have seen, and tried the methods suggested in this question, but they ... - asked by Eli Lansey (29 votes), answered by Sjoerd C. de Vries (33 votes) ---------------------------- [Finding the centroid of the area between two curves]\url{http://mathematica.stackexchange.com/questions/17170/finding-th e-centroid-of-the-area-between-two-curves} When I have an area bounded by curves, is there a built-in way to find the center of the area? Or do I have to plot it first and then use ComponentMeasurements on it? For example: the area under $y= ... - asked by a3f (10 votes), answered by george2079 (3 votes) ================================== Can you answer these? ================================== [How can I find the source of a memory leak?]\url{http://mathematica.stackexchange.com/questions/33707/how-can-i-f ind-the-source-of-a-memory-leak} I found a really weird issue using NDSolve`ProcessEquations inside module. We start by setting HistoryLength to 0. After this we define a function which takes in an integer and creates a Table of ... - asked by jaclea (4 votes) ---------------------------- [Is there something like MaxProcessorUsed?]\url{http://mathematica.stackexchange.com/questions/33775 /is-there-something-like-maxprocessorused} For standard procedures it is easy to test if the implementation is better or worse than other by using Timing etc. It does not help us with creating Dynamic interfaces/visualisations. Sometimes it ... - asked by Kuba (5 votes) ---------------------------- [How does Mathematica estimate error on fit parameters?]\url{http://mathematica.stackexchange.com/questions/33685/how-d oes-mathematica-estimate-error-on-fit-parameters} When performing a fit using NonlinearModelFit (or any of Mathematica fitting functions, but I am particularly interested in nonlinear models), Mathematica makes a covariance matrix available for all ... - asked by ydl (1 vote)
================================== Top new questions this week: ================================== [Compiling ColorFunction for faster complex phase-amplitude plots]\url{http://mathematica.stackexchange.com/questions/32977/compiling-c olorfunction-for-faster-complex-phase-amplitude-plots} I have gotten into the habit of plotting complex-valued functions on a plane using a color-function along the lines of Function[{z}, Hue[Arg[z]/(2 Pi), 1, Abs[z]]]. For example, the following code ... - asked by user93655 (16 votes), answered by halirutan (15 votes) ---------------------------- [Pattern to match L, but not L[_]]\url{http://mathematica.stackexchange.com/questions/33025/pattern-to-m atch-l-but-not-l} I have an expression where I want to replace L but not L[_] For example, the following doesn't work and sub = {L :> 2}; L + L[tilde] /. sub (* 2 + 2[tilde], but I want 2 + L[tilde]*) Is there ... - asked by jlperla (13 votes), answered by Szabolcs (20 votes) ---------------------------- [Is there a Mathematica barcode reader?]\url{http://mathematica.stackexchange.com/questions/33093/is-there- a-mathematica-barcode-reader} Is there a Mathematica barcode image reader (much like TextRecognize) that allows the user to enter an image of a barcode and then read it to get an output string? - asked by David G. Stork (12 votes), answered by belisarius (13 votes) ---------------------------- [How to enlarge $\it{Mathematica}$'s knowledge about certain functions?]\url{http://mathematica.stackexchange.com/questions/33251/how-to -enlarge-itmathematicas-knowledge-about-certain-functions} I'm often troubled with the following task. I need to carry out symbolical computations involving certain special functions. Let me take as an example Barnes gamma-function. It is included in ... - asked by Weather Report (9 votes), answered by WalkingRandomly (6 votes) ---------------------------- [Labeling a three-dimensional plot]\url{http://mathematica.stackexchange.com/questions/33236/labeling-a-t hree-dimensional-plot} As the title says, I want to add some text in a three-dimensional plot, thus labeling specific parts of it. Here is the corresponding Mathematica code V = 1/2*(x^2 + y^2 + z^2) + (x^2*y^2 + x^2*z^2 + ... - asked by Vaggelis_Z (7 votes), answered by Kuba (7 votes) ---------------------------- [Mathematica: computing a difficult integral]\url{http://mathematica.stackexchange.com/questions/33217/mathemat ica-computing-a-difficult-integral} I am trying to compute the following integral: Integrate[Exp[Sum[-((cw*\[Lambda] - b[i])^2/(2*\[Sigma]^2)), {i, 1, n}]], {cw, 0, 1}] And currently Mathematica outputs (Sqrt[\[Pi]/2]\[Sigma](Erf[(Sqrt[n](\[Lambda]- - asked by emaster70 (7 votes), answered by ybeltukov (8 votes) ---------------------------- [How to always display current section identifier (number, name) in notebook?]\url{http://mathematica.stackexchange.com/questions/33173/how-to- always-display-current-section-identifier-number-name-in-notebook} Because I find myself relocating frequently within a long notebook divided into sections, subsections, & subsubsections, I would like to display the identifying information for the section, etc. ... - asked by Brandon Marshall (7 votes), answered by ybeltukov (4 votes) ================================== Greatest hits from previous weeks: ================================== [Plotting Complex Quantity Functions]\url{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 (8 votes), answered by Artes (12 votes) ---------------------------- [How can I extract data points from a black and white image?]\url{http://mathematica.stackexchange.com/questions/3831/how-can-i-e xtract-data-points-from-a-black-and-white-image} Consider the following graph (source): Is there any way to extract the data points from this image in a semi-automatic way? I have seen, and tried the methods suggested in this question, but they ... - asked by Eli Lansey (29 votes), answered by Sjoerd C. de Vries (33 votes) ================================== Can you answer these? ================================== [How to embed graphic-element-specific metadata within a Graphics object?]\url{http://mathematica.stackexchange.com/questions/33207/how-to-em bed-graphic-element-specific-metadata-within-a-graphics-object} One of the most crucial requirements for rich, interactive scientific graphics is being able to "annotate" individual graphic elements (e.g. the data points of a scatterplot, the individual curves in ... - asked by kjo (1 vote) ---------------------------- [How to compute the Lovasz number for the given graph in Mathematica?]\url{http://mathematica.stackexchange.com/questions/33010/how- to-compute-the-lovasz-number-for-the-given-graph-in-mathematica} Here is a graph whose adjacency matrix is m = { {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0}, {0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1}, {0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, ... - asked by Eden Harder (3 votes) ---------------------------- [NDSolve error when solving pde]\url{http://mathematica.stackexchange.com/questions/33166/ndsolve-error -when-solving-pde} I am trying to calculate speed of viscous fluid in a rotating hollow sphere. The sphere is rotating round z axis. The fluid is incompressible. I used Navier-Stockes equations. The only boundry ... - asked by Jure (1 vote) ================================== New blog post: ================================== [Plotting electronic orbitals using Mathematica]\url{http://mathematica.blogoverflow.com/2013/09/plotting-elect ronic-orbitals-using-mathematica/} by Jason B on Sep 27
================================== Top new questions this week: ================================== [Reconstruct text pages cut by shredder]\url{http://mathematica.stackexchange.com/questions/32612/reconstr uct-text-pages-cut-by-shredder} Q1: I have a page of printed text file, but it was cut by a paper shredder (from top to bottom). You can download all the paper fragment here. There are some examples of them. How can I reconstruct ... - asked by mm.Jang (24 votes), answered by Kuba (20 votes) ---------------------------- [Generate a Random Polygon]\url{http://mathematica.stackexchange.com/questions/32767/generate- a-random-polygon} Does some package exist with a function that takes a parameter $n$ and generates a random 2D $n$-sided simple polygon (convex or non-convex), possibly within a certain bounding box? It does not ... - asked by Herng Yi (13 votes), answered by Simon Woods (7 votes) ---------------------------- [How to examine the structure of Graphics objects]\url{http://mathematica.stackexchange.com/questions/32716/how-to-ex amine-the-structure-of-graphics-objects} One difficulty I'm encountering in studying the structure of Graphics objects is that I have not yet found a way to print or display such structure that is sufficiently general. The FullForm of ... - asked by kjo (12 votes), answered by Hector (11 votes) ---------------------------- [Size distribution of nanoparticles from a transmission electron microscopic image]\url{http://mathematica.stackexchange.com/questions/32830/size-distri bution-of-nanoparticles-from-a-transmission-electron-microscopic-imag} I have found a research article about Martian sand grain size determination from the image using Mathematica (Figure 2 in the linked article). They have not provided any detail of the methodology. It ... - asked by Uttam Pal (11 votes), answered by RM1618 (16 votes) ---------------------------- [Slideshow mode: how to cycle slides automatically?]\url{http://mathematica.stackexchange.com/questions/32768/sl ideshow-mode-how-to-cycle-slides-automatically} I'm doing a slideshow for an informative conference, so I need a slideshow running in background on some monitors. My question is: is there any way to make Mathematica to cycle slides automatically? ... - asked by markus (11 votes), answered by Hector (7 votes) ---------------------------- [What's the cleanest functional-programming style way to perform this list operation?]\url{http://mathematica.stackexchange.com/questions/32675/whats- the-cleanest-functional-programming-style-way-to-perform-this-list-opera t} I am looking for the correct method for accomplishing the unknown piece in the following code snippet: rolls = Tuples[Range[1, 4], {2}] {{1, 1}, {1, 2}, {1, 3}, {1, 4}, {2, 1}, {2, 2}, {2, 3}, {2, ... - asked by Techrocket9 (11 votes), answered by RunnyKine (6 votes) ---------------------------- [Solving Killing equations]\url{http://mathematica.stackexchange.com/questions/32843/solving -killing-equations} Is it possible to solve Killing equations in Mathematica for a general vector? I am looking for a way to create Killing equations and then find what the vectors are, but I have a problem with this. ... - asked by dingo_d (10 votes), answered by Daniel Lichtblau (11 votes) ================================== Greatest hits from previous weeks: ================================== [xkcd-style graphs]\url{http://mathematica.stackexchange.com/questions/11350/xkcd-style -graphs} I received an email to which I wanted to respond with a xkcd-style graph, but I couldn't manage it. Everything I drew looked perfect, and I don't have enough command over PlotLegends to have these ... - asked by Amatya (387 votes), answered by Simon Woods (256 votes) ---------------------------- [How to compile effectively?]\url{http://mathematica.stackexchange.com/questions/1803/how-t o-compile-effectively} What are the best practices of compiling functions? I understand that this is a vague question, but let me list some aspects that might trigger useful answers. Some of these have already been answered ... - asked by Istvan Zachar (65 votes), answered by Leonid Shifrin (60 votes) ================================== Can you answer these? ================================== [NDSolve and memory usage]\url{http://mathematica.stackexchange.com/questions/32640/ndsolve-and -memory-usage} After some googling, i've found similar problems around, but didn't find a 100% satisfactory answer, so let me ask here: I'd like to solve a 1+1 problem using the method of lines. In spherical ... - asked by Paolo (3 votes) ---------------------------- [How to simplify really complicated symbolic expression?]\url{http://mathematica.stackexchange.com/questions/32759/how-t o-simplify-really-complicated-symbolic-expression} I have an expression that contains Sinh[x], Cosh[x] and Sin[g], and I want to simplify it into an easier form, based on the physics situation (I am doing some general relativity calculation), I know ... - asked by Jason (1 vote) ---------------------------- [When should I begin a new line for more readable code]\url{http://mathematica.stackexchange.com/questions/32870/when-should- i-begin-a-new-line-for-more-readable-code} After a quick coding, I often try a lot of line feeds patterns on it. And no matter how much I do, there's seems to be no end in sight. Front end automatically indents the code, but I cannot fully ... - asked by asoldat (4 votes)
================================== Top new questions this week: ================================== [Is it possible to use RandomChoice to choose without other choices being evaluated?]\url{http://mathematica.stackexchange.com/questions/32175/is-it- possible-to-use-randomchoice-to-choose-without-other-choices-being-evalu at} I'm trying to do this: i1 = 1; i2 = 1; RandomChoice[{ (i1 = i1 + 1), (i1 = i1 - 1), (i2 = i1 + 1), (i2 = i2 - 1)}] In order to chose randomly which variable is going to be incremented or ... - asked by Gustavo Bandeira (14 votes), answered by ybeltukov (13 votes) ---------------------------- [Color Histogram3D by Bin Location]\url{http://mathematica.stackexchange.com/questions/32460/color-hi stogram3d-by-bin-location} I am using a Histogram3D plot to view the correlation of the R & G of an RGB image. Naturally, I want the bins to have a color corresponding to their $x$, $y$ (R,G) position on the chart. ... - asked by Perfect Tommy (11 votes), answered by Kuba (10 votes) ---------------------------- [Method -> {"AxesInFront" -> False} for Graphics3D]\url{http://mathematica.stackexchange.com/questions/32168/method -axesinfront-false-for-graphics3d} I'm aware of two ways to manage positioning of Axes for Graphics3D: AxesOrigin and AxesEdge. They seem to be quite different in terms of what is actually happening: GraphicsRow[{ ... - asked by Kuba (11 votes), answered by Brett Champion (2 votes) ---------------------------- [Why does Mathematica return a Fourier transform for a function for which it is not defined?]\url{http://mathematica.stackexchange.com/questions/32387/why-does -mathematica-return-a-fourier-transform-for-a-function-for-which-it-is-n > } The following function $$g(x) = (1 + x^{1/a} )^a $$ should NOT have a Fourier transform, as far as I am aware, for any real values of $a$ since $g(x)$ is not nice in the sense of decays quickly ... - asked by Luap Nalehw (10 votes), answered by ybeltukov (11 votes) ---------------------------- [Find eigen energies of time-independent Schrodinger equation]\url{http://mathematica.stackexchange.com/questions/32293/find-eig en-energies-of-time-independent-schrodinger-equation} I'm trying to get the eigenvalues of a one dimensional time-independent Schrodinger equation, $-\frac{h^2}{2m_0}\frac{d^2\psi}{dx^2}+U(x)~\psi=Ei~\psi$ where U(x) is some potential and Ei is the ... - asked by xslittlegrass (10 votes), answered by Jens (13 votes) ---------------------------- [Is there a triangle like this?]\url{http://mathematica.stackexchange.com/questions/32338/is-there-a- triangle-like-this} I want to find the numbers $a$, $b$, $c$, $d$ of the function $y = \dfrac{a x + b}{c x + d}$ so that the triangle $ABC$ with three points $A$, $B$, $C$ have integer coordinates and lies on the graph ... - asked by minthao_2011 (8 votes), answered by belisarius (15 votes) ---------------------------- [Unexpected behaviour of Solve applied to two equations in two variables]\url{http://mathematica.stackexchange.com/questions/32246/unexpec ted-behaviour-of-solve-applied-to-two-equations-in-two-variables} I have a simple Mathematica expression Solve[{a(a-1)Sqrt[1+a^2+b^2] == b(a^3-1), b(b-1)Sqrt[1+a^2+b^2] == a(b^3-1)}] which returns (on version 8.0, and also version 9.0) {{b -> -(a/(1 + a))}, ... - asked by Ashley Montanaro (8 votes), answered by gpap (2 votes) ================================== Greatest hits from previous weeks: ================================== [Finding the centroid of the area between two curves]\url{http://mathematica.stackexchange.com/questions/17170/finding-th e-centroid-of-the-area-between-two-curves} When I have an area bounded by curves, is there a built-in way to find the center of the area? Or do I have to plot it first and then use ComponentMeasurements on it? For example: the area under $y= ... - asked by a3f (9 votes), answered by george2079 (3 votes) ---------------------------- [How can I improve Mathematica's resolution on a macbook retina display?]\url{http://mathematica.stackexchange.com/questions/18419/how-can- i-improve-mathematicas-resolution-on-a-macbook-retina-display} Mathematica 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 (23 votes), answered by programming_historian (10 votes) ================================== Can you answer these? ================================== [Setting PropertyValue for VertexWeight is not persistent]\url{http://mathematica.stackexchange.com/questions/32320/settin g-propertyvalue-for-vertexweight-is-not-persistent} g = CompleteGraph[8, VertexSize -> Medium]; PropertyValue[{g, VertexList[g][[1]]}, VertexWeight] = 10; PropertyValue[g, VertexWeight] {10, 1, 1, 1, 1, 1, 1, 1} PropertyValue[{g, ... - asked by Ilya Sorokin (2 votes) ---------------------------- [Orthogonal basis of a hermitian matrix]\url{http://mathematica.stackexchange.com/questions/32350/orthogonal -basis-of-a-hermitian-matrix} Is there a way to extract an orthogonal basis for a hermitian matrix in Mathematica? A simple diagnolization returns a non orthogonal basis and later using a Grahm-Schmidt process which isn't aware ... - asked by user9522 (1 vote) ---------------------------- [Convert ImageSize to FieldSize]\url{http://mathematica.stackexchange.com/questions/32459/convert -imagesize-to-fieldsize} How might I construct a function called EmToPX[p] such that the following 2 InputFields would be the same width. If not please explain why doing such isn't possible. InputField["a", ImageSize -> ... - asked by Liam William (1 vote)
================================== Top new questions this week: ================================== [Chart illustrating options that affect Graphics/Graphics3D objects]\url{http://mathematica.stackexchange.com/questions/31745/chart-ill ustrating-options-that-affect-graphics-graphics3d-objects} In Mathematica there is a seemingly never-ending list of parameters that affect the appearance of Graphics and Graphics3D objects: ImageSize, ImageSizeRaw, ImagePadding, ImageMargins, PlotRange, ... - asked by kjo (19 votes), answered by Vitaliy Kaurov (18 votes) ---------------------------- [The dangers of SaveDefinitions --- should this really happen?]\url{http://mathematica.stackexchange.com/questions/31998/the-dange rs-of-savedefinitions-should-this-really-happen} I have been bitten hard by SaveDefinitions -> True. I'll describe in detail what happened below. My questions are: Is this a bug? What is the most convenient workaround? Consider a definition ... - asked by Szabolcs (17 votes), answered by Rojo (12 votes) ---------------------------- [How to get Cases to wrap results in an arbitrary head?]\url{http://mathematica.stackexchange.com/questions/31754/how-to-get- cases-to-wrap-results-in-an-arbitrary-head} A number of functions provide for results to be wrapped in an arbitrary head. This is very important in cases where the results should not be evaluated. Take Level as an example: expr = Hold[{2/2, ... - asked by Mr.Wizard (17 votes), answered by Mr.Wizard (15 votes) ---------------------------- [Do Mathematica notebooks include personal metadata?]\url{http://mathematica.stackexchange.com/questions/31928/do-math ematica-notebooks-include-personal-metadata} I am about to send a Mathematica notebook to someone and I would like to make sure it does not contain any information that could personally identify me. I would also like to produce pdf files from ... - asked by episanty (13 votes) ---------------------------- [How to determine numeric equivalent of Tiny, Small, etc. image sizes for Graphics?]\url{http://mathematica.stackexchange.com/questions/31726/how-to- determine-numeric-equivalent-of-tiny-small-etc-image-sizes-for-graphic} Is there a way to find the numeric equivalents of Tiny, Small, Medium, and Large for for ImageSize? In other words, what are the integers t, s, m, and l such that, for Graphics objects, the ... - asked by kjo (13 votes), answered by Szabolcs (12 votes) ---------------------------- [Can ReplacePart be sped up?]\url{http://mathematica.stackexchange.com/questions/31648/can-replacepa rt-be-sped-up} Test case: data = RandomReal[1, {1000, 1000}]; pos = RandomInteger[{1, 1000}, {5*10^5, 2}]; r1 = ReplacePart[data, pos -> 0]; // AbsoluteTiming (data[[##]] = 0) & @@@ pos; // AbsoluteTiming ... - asked by explorer (12 votes), answered by jVincent (4 votes) ---------------------------- [How to identify chemical substance from tattoo?]\url{http://mathematica.stackexchange.com/questions/31657/how-to-id entify-chemical-substance-from-tattoo} A friend of mine made a tattoo on his chest of some chemical substance formula. He challenged us to identify which substance is that. I thought that perhaps a combination of: Mathematica image ... - asked by Zet (12 votes), answered by Sjoerd C. de Vries (18 votes) ================================== Greatest hits from previous weeks: ================================== [How to manipulate 2D plots?]\url{http://mathematica.stackexchange.com/questions/7142/how-to-mani pulate-2d-plots} When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ... - asked by Istvan Zachar (54 votes), answered by Istvan Zachar (53 votes) ---------------------------- [QR Code in shopping cart handle]\url{http://mathematica.stackexchange.com/questions/26268/qr-code-in -shopping-cart-handle} This week, the market people from my work wanted to put QR codes in shopping cart handles, but when they tested it, the QR code did not work. I noted that the cylindrical curvature (even small) ... - asked by Murta (122 votes), answered by halirutan (121 votes) ================================== Can you answer these? ================================== [How can I create jpeg images of a given file size?]\url{http://mathematica.stackexchange.com/questions/31814/how-can-i-c reate-jpeg-images-of-a-given-file-size} Cross-posted at Wolfram Community I would like to have a function makeJPG[megabytes_] that generates random jpg images of given file sizes with itf filesize (in megabytes) watermarked on the image ... - asked by M.R. (3 votes) ---------------------------- [Understanding the discrepancy between txt file import and export times, and possibly speeding up Import]\url{http://mathematica.stackexchange.com/questions/31817/understand ing-the-discrepancy-between-txt-file-import-and-export-times-and-poss} I attempted to import a very short .txt file string using the Import command: Import["C:\\TestFile.txt"] // AbsoluteTiming Out: {0.020001, "Test"} Why does this take 20 milliseconds? Export is ... - asked by Sparse Pine (1 vote) ---------------------------- [Setting OperatorSubstitution to false causes Plot's labels of sufficiently small size not to appear in the specified typeface. Is this a bug?]\url{http://mathematica.stackexchange.com/questions/31784/setting-oper atorsubstitution-to-false-causes-plots-labels-of-sufficiently-small} If I set OperatorSubstitution to False, the labels of Plot will not use the typeface specified by FontFamily unless FontSize is more than certain number. In this test scenario, that certain number is ... - asked by Taiki (2 votes)
================================== Top new questions this week: ================================== [How to create a wind rose with Mathematica?]\url{http://mathematica.stackexchange.com/questions/31257/how- to-create-a-wind-rose-with-mathematica} I am trying to plot wind rose in Mathematica, but have no idea how to do this. Any suggestions ? - asked by bushiwo (22 votes), answered by David Carraher (16 votes) ---------------------------- [How to include Mathematica animation in a PowerPoint presentation?]\url{http://mathematica.stackexchange.com/questions/31511/how -to-include-mathematica-animation-in-a-powerpoint-presentation} I want to include a Mathematica animation in PowerPoint presentation. My code is: SetDirectory[NotebookDirectory[]]; data = ReadList[ "C:\\Users\\luka\\Desktop\\GRAFI- DIPLOMA\\9_gibanje \ ... - asked by Luka (15 votes), answered by Vitaliy Kaurov (18 votes) ---------------------------- [How do I calculate the area of a polygon given its coordinates?]\url{http://mathematica.stackexchange.com/questions/31241/how- do-i-calculate-the-area-of-a-polygon-given-its-coordinates} I have a polygon: Polygon[{{0, 200 }, {200, 100}, {500, 300}, {100, 700}}] How can I figure out its area? The docs page does not have any example. So far I've reached this point with no success: ... - asked by caligula (15 votes), answered by Kuba (14 votes) ---------------------------- [Pick elements of largest absolute value]\url{http://mathematica.stackexchange.com/questions/31385/pick-elemen ts-of-largest-absolute-value} For example, given list = {{1, -3, -5}, {2, 1, 6}, {0, 2, 4}, {-9, 2, 6}} should return: {-5, 6, 4, -9} - asked by explorer (15 votes), answered by Simon Woods (19 votes) ---------------------------- [How to partition a list to make each subset's size equal and mean as close as possible]\url{http://mathematica.stackexchange.com/questions/31469/how-to-p artition-a-list-to-make-each-subsets-size-equal-and-mean-as-close-as-po> ) Suppose we have 3 lists each with 18 numbers like this: list1 = {7.49, 7.56, 7.98, 8.09, 8.16, 8.21, 8.73, 8.64, 8.68, 8.46, 8.57, 8.29, 9.38, 9.43, 8.95, 9.04, 8.9, 9.07}; list2 = {21.08, ... - asked by incognito007 (13 votes), answered by Vitaliy Kaurov (4 votes) ---------------------------- [How can one write a robust ListableQ function?]\url{http://mathematica.stackexchange.com/questions/31498/how-can -one-write-a-robust-listableq-function} I would like to have a test that determines if a particular function is Listable. In the case of Symbols this is merely a matter of checking Attributes. Function definitions with the Listable ... - asked by Mr.Wizard (12 votes), answered by Mr.Wizard (5 votes) ---------------------------- [How can I efficiently "remap" an image?]\url{http://mathematica.stackexchange.com/questions/31274/how-can-i- efficiently-remap-an-image} Many image processing libraries like OpenCV, Intel Performance Primitives or Octave have a useful function called "remap", that takes an image, an array with X coordinates and an array with Y ... - asked by nikie (11 votes), answered by ssch (7 votes) ================================== Greatest hits from previous weeks: ================================== [Voronoi diagrams for generators other than points]\url{http://mathematica.stackexchange.com/questions/20696/voronoi-di agrams-for-generators-other-than-points} Any suggestions how to determine Voronoi diagram for sites other than points, as e.g. in the picture below? Input is a raster image. - asked by DeeDee (22 votes), answered by whuber (26 votes) ---------------------------- [How to compile effectively?]\url{http://mathematica.stackexchange.com/questions/1803/how-t o-compile-effectively} What are the best practices of compiling functions? I understand that this is a vague question, but let me list some aspects that might trigger useful answers. Some of these have already been answered ... - asked by Istvan Zachar (65 votes), answered by Leonid Shifrin (59 votes) ================================== Can you answer these? ================================== [Generating an obstacle-avoiding closed-curve with a fixed perimeter and a target area]\url{http://mathematica.stackexchange.com/questions/31365/generating-a n-obstacle-avoiding-closed-curve-with-a-fixed-perimeter-and-a-target} I was wondering if there was a neat way to solve the following problem in Mathematica v9 - Provided a binarized image (where we call black pixels "obstacles" or vice versa, whichever is most ... - asked by TilePath (3 votes) ---------------------------- [What was added to the LibraryLink API in version 9?]\url{http://mathematica.stackexchange.com/questions/31433/what-was-added -to-the-librarylink-api-in-version-9} Looking at the LibraryLink examples, there are several new functions and objects, as well as example programs, that appeared in version 9. Are these documented? If yes, where? If would be nice to ... - asked by Szabolcs (9 votes) ---------------------------- [Stochastic differential equations in the weak sense]\url{http://mathematica.stackexchange.com/questions/31443/stochastic- differential-equations-in-the-weak-sense} There are some good discussions in http://mathematica.stackexchange.com regarding the numerical solution of SDEs of the form $dX(t)=a(t,X)dt+b(t,X)dW_t$, wherein $X(0)=X_{0},$ $W_t$ is the Wiener ... - asked by Fazlollah Soleymani (1 vote)
================================== Top new questions this week: ================================== [Cropping a Voronoi diagram]\url{http://mathematica.stackexchange.com/questions/31187/cropping- a-voronoi-diagram} Someone know how can I get the correct crop of this Voronoi image using RegionFunction? As you can see, there is a lot of undesired white regions inside the left polygon. Some clue on how to correct ... - asked by Murta (12 votes), answered by Kuba (7 votes) ---------------------------- [Automatically close Mathematica]\url{http://mathematica.stackexchange.com/questions/30974/autom atically-close-mathematica} It seems there are a lot of related topics but I haven't found an answer. I want to automatically quit Mathematica after some procedures are done but dialog window appears: 1 + 1; ... - asked by Kuba (11 votes), answered by John Fultz (11 votes) ---------------------------- [Encrypt the password used for SendMail]\url{http://mathematica.stackexchange.com/questions/30836/encrypt- the-password-used-for-sendmail} I want Mathematica to send me an email when the computation is finished. To that end, I have a cell with SendMail[...] which I place behind my computation in the evaluation queue. The problem I have ... - asked by simsurace (11 votes), answered by Murta (10 votes) ---------------------------- [Detecting and correcting gradational brightness variations in a grayscale image]\url{http://mathematica.stackexchange.com/questions/30823/detecting-a nd-correcting-gradational-brightness-variations-in-a-grayscale-image} I am trying to quantify the proportions of various components in a greyscale image (backscattered electron image of a polished rock sample). Here is the original image: bse = ... - asked by geordie (10 votes), answered by Simon Woods (5 votes) ---------------------------- [Select and Blank]\url{http://mathematica.stackexchange.com/questions/30970/select-and- blank} I try to filter sublists of a list which match a pattern. test = {{"String1", "a"}, {"String2", "b"}, {"String3", "a"}, {"String4", "a"}}; The result should be: result = {{"String1", "a"}, ... - asked by RMMA (8 votes), answered by halirutan (13 votes) ---------------------------- [Cannot find the maximum value of a function]\url{http://mathematica.stackexchange.com/questions/31032/cannot-f ind-the-maximum-value-of-a-function} Consider the following function: $a Sin(x)+b Cos(x)$ I tried to obtain the maximum value of this function using MaxValue[]: MaxValue[a Sin[x] + b Cos[x], x, Reals] I expect Mathematica to return ... - asked by M6299 (7 votes), answered by george2079 (3 votes) ---------------------------- [How can I draw a grid behind graphics without using Plot?]\url{http://mathematica.stackexchange.com/questions/31114/how-can-i-d raw-a-grid-behind-graphics-without-using-plot} I want to a show simple vector summation but I don't know how to draw a grid behind the vectors. I am pretty sure I can do it with Mathematica but how? It should look like this: - asked by Serkan (7 votes), answered by Mr.Wizard (15 votes) ================================== Greatest hits from previous weeks: ================================== [Using the Mathematica front-end efficiently for editing notebooks]\url{http://mathematica.stackexchange.com/questions/8310/using-th e-mathematica-front-end-efficiently-for-editing-notebooks} Background: I have used Vim for 15+ years. There is a certain "one"-ness with the editor one achieves. Emacs users also experience this. Notepad users do not. My current interaction with the ... - asked by user1602 (40 votes), answered by rm -rf (38 votes) ---------------------------- [How can this image (optical illusion) be created with Mathematica?]\url{http://mathematica.stackexchange.com/questions/24148/how- can-this-image-optical-illusion-be-created-with-mathematica} I came across this image the other day: and liked the sensation of it pulsing. I was wondering if anyone would know how to create something similar with Mathematica (without the Pink Floyd Dark ... - asked by Mike Honeychurch (32 votes), answered by halirutan (48 votes) ================================== Can you answer these? ================================== [Assign variables from list inside With or Module]\url{http://mathematica.stackexchange.com/questions/30847/assign-var iables-from-list-inside-with-or-module} I have found that it is possible to assign variables from lists, as follows. In[1]:= r = {1, 2, 3}; In[2]:= {a, b, c} = r; In[3]:= b Out[3]= 2 However, if I try to do this within a With or Module ... - asked by Gyppo (2 votes) ---------------------------- [Is there a way to speed up Simplify and/or PolynomialReduce Modulus-> 2?]\url{http://mathematica.stackexchange.com/questions/31029/is-there-a-way -to-speed-up-simplify-and-or-polynomialreduce-modulus-2} I'm trying to simplify a series of equations with at most 64 input terms. As the number of terms involved in the equations increase, the runtime seems to grow exponentially. Does anyone know of ways ... - asked by botnet (1 vote) ---------------------------- [FrontEndTokens, MathLink, and Serializer.exe]\url{http://mathematica.stackexchange.com/questions/31118/fr ontendtokens-mathlink-and-serializer-exe} I have been using some basic MathLink programming in my work and wanted to create some more sophisticated MathLink programs. I came across the book "MathLink: Network Programming with Mathematica", ... - asked by user2694879 (2 votes)
================================== Top new questions this week: ================================== [What bug fixes can be implemented in init.m?]\url{http://mathematica.stackexchange.com/questions/30599/what-bug- fixes-can-be-implemented-in-init-m} In comments on this question, Mr. Wizard suggested a community wiki to share the bug fixes/workarounds (or possibly other tricks) people load in their init.m. I think this could provide a nice ... - asked by jkrich (16 votes), answered by Mr.Wizard (8 votes) ---------------------------- [when is f@g not the same as f[g]?]\url{http://mathematica.stackexchange.com/questions/30425/when-is-fg- not-the-same-as-fg} I have always thought that f@g will give the same result as f[g] in all cases, and it is just a matter of style which one to use and that g will always evaluates first, and then f will evaluate using ... - asked by Nasser (16 votes), answered by Mr.Wizard (22 votes) ---------------------------- [Blend code for "Sunset Colors"]\url{http://mathematica.stackexchange.com/questions/30508/blend-cod e-for-sunset-colors} Hi I want to get a blend similar to "SunsetColors". To make those slight modifications, I would like to know the precise blend of that ColorScheme. My try: Graphics[Table[{Blend[{Black, ... - asked by Francisco (14 votes), answered by Simon Woods (13 votes) ---------------------------- [Looking for a way to insert multiple elements into multiple positions simultaneously in a list]\url{http://mathematica.stackexchange.com/questions/30647/looking-for- a-way-to-insert-multiple-elements-into-multiple-positions-simultaneo} I would like to take the following data: insertvalues = {r, x}; insertpositions = {{1}, {5}}; origlist = {a, b, c, d, e, f, g}; and generate output that looks like this: {r,a,b,c,d,x,e,f,g} ... - asked by Todd Allen (13 votes), answered by Mr.Wizard (14 votes) ---------------------------- [How can I manipulate TemporalData?]\url{http://mathematica.stackexchange.com/questions/30712/how -can-i-manipulate-temporaldata} Version 9 introduced TemporalData but, truth be told, the documentation doesn't suggest that one can do much with it. Many of us have probably assumed we'd be better off sticking with the date-value ... - asked by Verbeia (13 votes), answered by Verbeia (15 votes) ---------------------------- [Measure perimeter of black edge in Mathematica]\url{http://mathematica.stackexchange.com/questions/30461/measu re-perimeter-of-black-edge-in-mathematica} I have a pattern like the one below. How could I measure the total length of the perimeter of the black/white edge? This would give me a measure of spatial frequency. Any tips would be great! Thanks! ... - asked by Levi (13 votes), answered by belisarius (11 votes) ---------------------------- [Filtering elements from a list that appear only once]\url{http://mathematica.stackexchange.com/questions/30610/filtering-el ements-from-a-list-that-appear-only-once} I want to be able to select elements from a list that only appear once. I originally had this: Select[Table[Count[list, i], {i, list}], # == 1] But the issue is that my list has about 60,000 ... - asked by Mark (12 votes), answered by belisarius (17 votes) ================================== Greatest hits from previous weeks: ================================== [How to create hedcut style images?]\url{http://mathematica.stackexchange.com/questions/8716/how-to-cre ate-hedcut-style-images} Yesterday the hedcut style was brought up in chat. How can we create a hedcut-like style automatically in Mathematica, using a photograph as a starting point? I am looking to create a similar ... - asked by Szabolcs (43 votes), answered by Simon Woods (32 votes) ---------------------------- [Plotting Complex Quantity Functions]\url{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 (8 votes), answered by Artes (12 votes) ================================== Can you answer these? ================================== [NDSolve: ProcessEquations and Reinitialize with Piecewise functions]\url{http://mathematica.stackexchange.com/questions/30426/ndsolve -processequations-and-reinitialize-with-piecewise-functions} I am having trouble with using NDSolve`Reinitialize when the system consists of a pieceise function. If we define the ODE system simplesys = {r'[t] == Piecewise[{{1, 0 <= t <= 10}, {0, 10 ... - asked by jaclea (3 votes) ---------------------------- [Does one need to be careful about loading multiple (many) contexts or packages in the same session?]\url{http://mathematica.stackexchange.com/questions/30758/does-one -need-to-be-careful-about-loading-multiple-many-contexts-or-packages-i} I have a number of large pieces of precomputed data which I am considering putting into individual packages in order to load them (via DeclarePackage) and unload them (via Leonid Shifrin's ... - asked by Tobias Hagge (4 votes) ---------------------------- [Mathematica and strong AI]\url{http://mathematica.stackexchange.com/questions/30585/mathematica-an d-strong-ai} David Deutsch (physicist / quantum computing theorist) wrote an article for Aeon Magazine last year: On Artificial Intelligence that got me thinking. The article assesses and critiques the ... - asked by Jagra (7 votes)
================================== Top new questions this week: ================================== [Detecting patterns of black and white stones on a 2D board]\url{http://mathematica.stackexchange.com/questions/46631/detecting-p atterns-of-black-and-white-stones-on-a-2d-board} I'm writing a program to play a game of Pente, and I'm struggling with the following question: What's the best way to detect patterns on a two-dimensional board? For example, in Pente a pair of ... - asked by Victor K. (20 votes), answered by Mr.Wizard (9 votes) ---------------------------- [Is there a better way to add elements to a Graphics expression repeatedly?]\url{http://mathematica.stackexchange.com/questions/46746/is-th ere-a-better-way-to-add-elements-to-a-graphics-expression-repeatedly} Consider simple example where a set of points is generated and some are displayed. k = 10^5; p = RandomReal[{-1, 1}, {k, 2}]; n = 2 Graphics[Dynamic@Point@p[[;; n]], Frame -> True, PlotRange -> ... - asked by Kuba (13 votes), answered by Rom38 (5 votes) ---------------------------- [Full documentation for AppearanceElements]\url{http://mathematica.stackexchange.com/questions/4679 2/full-documentation-for-appearanceelements} As explained in this solution, ListAnimate[Table[Plot[Sin[n x], {x, 0, 2}], {n, 3}]]//InputForm will allow me to view the types of appearance element for the ListAnimate controller. But the same ... - asked by fairflow (8 votes), answered by Nasser (8 votes) ---------------------------- [StringReplace, ReplaceAll and Rule interact in a bizarre way]\url{http://mathematica.stackexchange.com/questions/46611/stringreplace -replaceall-and-rule-interact-in-a-bizarre-way} I have the following pair of things: ClearAll[foo, labeledFoo]; labeledFoo = {"FooBarBazQuux", foo}; This works like you'd expect: labeledFoo /. hdr_String :> StringReplace[hdr, ... - asked by Pillsy (8 votes), answered by Leonid Shifrin (11 votes) ---------------------------- [Is it possible to create iOS apps with Mathematica?]\url{http://mathematica.stackexchange.com/questions/46888/is-i t-possible-to-create-ios-apps-with-mathematica} I am fairly new to Mathematica and don't have much experience with other programming languages, but I can already see that Mathematica and the Wolfram language are far easier to use than most others. ... - asked by Aron (7 votes), answered by Vitaliy Kaurov (9 votes) ---------------------------- [Creating a Mathieu stability diagram]\url{http://mathematica.stackexchange.com/questions/46750/creating- a-mathieu-stability-diagram} I am attempting to re-create a Mathieu stability diagram like the one shown here: I expected that I could use MathieuC to generate this graph by assuming that instability occurs when the function ... - asked by bobthechemist (7 votes), answered by Oleksandr R. (10 votes) ---------------------------- [How to request financial data from Yahoo's YQL?]\url{http://mathematica.stackexchange.com/questions/46760/how-to-reque st-financial-data-from-yahoos-yql} How can I download historical data from Yahoo ? Although Mathematica's FinancialData function uses Yahoo it could be useful to have more control on how to retrieve data from Yahoo's YQL. - asked by Faysal Aberkane (7 votes), answered by Faysal Aberkane (12 votes) ================================== Greatest hits from previous weeks: ================================== [Get a "step by step" evaluation in Mathematica]\url{http://mathematica.stackexchange.com/questions/148/get-a-s tep-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? Example : Let's say I want to ... - asked by Skydreamer (50 votes), answered by J.M. (44 votes) ---------------------------- [How to create word clouds?]\url{http://mathematica.stackexchange.com/questions/2334/how-to-cre ate-word-clouds} Word clouds are rather useless fancy and visually appealing plots, where words are plotted with different sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ... - asked by Istvan Zachar (91 votes), answered by Heike (78 votes) ================================== Can you answer these? ================================== [What is " (Dialog) Input [ ] := " after evaluating a cell?]\url{http://mathematica.stackexchange.com/questions/46669/what-is-dia log-input-after-evaluating-a-cell} I have done a time-consuming run and calculation. After many hours ( about 7 hours!), the black color which shows that the cell is evaluating, turn into gray and a strange text appears like this : ... - asked by Shellp (2 votes) ---------------------------- [make mathematica recognize CCompiler and NVCC on remote Windows machine]\url{http://mathematica.stackexchange.com/questions/46971/make-math ematica-recognize-ccompiler-and-nvcc-on-remote-windows-machine} I have setup a mathematica remote kernel on a Windows 7 64 bit machine, which has MS Visual Studio 2010 installed. When I start mathematica on the windows machine mathematica recognizes the MS ... - asked by Wizard (1 vote) ---------------------------- [Function with a sharp resonance which Mathematica fails to integrate. Why?]\url{http://mathematica.stackexchange.com/questions/46737/function-wit h-a-sharp-resonance-which-mathematica-fails-to-integrate-why} I'm a new user of Mathematica and I'm trying to use it to calculate the collisional cross-section as a function of energy for a given potential and decay rate. I know that the resulting function ... - asked by Woody (3 votes)
================================== Top new questions this week: ================================== [Undocumented form for Extract]\url{http://mathematica.stackexchange.com/questions/46261/undocumen ted-form-for-extract} Prompted by a comments conversation here, here's an interesting (and often performance enhancing) use of Extract: target = Join[Range[100], {{1, 2, 3, Range[20]}}]; Rest@Extract[target, {{{}}, {2 ;; ... - asked by rasher (17 votes), answered by Jacob Akkerboom (7 votes) ---------------------------- [Bizarre behavior of With, Compile and Break]\url{http://mathematica.stackexchange.com/questions/46315/bizarre-beh avior-of-with-compile-and-break} I'm guessing this is almost certainly a bug in Compile (because they're fairly common), but it's pretty weird and I spent about an hour tracking down the issue and finding a test case. Consider this ... - asked by Pillsy (10 votes), answered by Leonid Shifrin (10 votes) ---------------------------- [Finding "Maxima" and "Minima" on a B-Spline]\url{http://mathematica.stackexchange.com/questions/46517/finding- maxima-and-minima-on-a-b-spline} I need to find the "Maxima" and "Minima" on a B-Spline or more correct the points where the 2nd components of the derivate equal zero. For example: g = BSplineFunction[{{1, 2}, {2, 4}, {3, -1}, ... - asked by cxkoda (8 votes), answered by Silvia (12 votes) ---------------------------- [Select cases from a list]\url{http://mathematica.stackexchange.com/questions/46472/select-cases -from-a-list} I have a list in the form : {1,1,1,0,-1,-1,1,1,1,0,0,0,0,-1,-1} No I'm trying to select only those sequences which start with 1 have a zero (or many zeros) between and are followed by -1. For ... - asked by holistic (8 votes), answered by halirutan (11 votes) ---------------------------- [Filling a curve between a line and the x-axis]\url{http://mathematica.stackexchange.com/questions/46332/filling-a- curve-between-a-line-and-the-x-axis} I'm trying to plot the function $f(x)=\dfrac{1}{x^2}$, filling the square area from (0,0) to (1,1) with purple and filling the area under the curve from 1 to 4 with red. However, Mathematica is not ... - asked by Eudokia (8 votes), answered by Kuba (7 votes) ---------------------------- [Explain the difference between ViewPoint and ViewVector?]\url{http://mathematica.stackexchange.com/questions/46266/expla in-the-difference-between-viewpoint-and-viewvector} I've read the documentation, but am still very unclear as to what the difference is between ViewVector and ViewPoint for Graphics3D. Could someone explain it concisely and clearly enough so that an ... - asked by Aron (7 votes), answered by Pickett (3 votes) ---------------------------- [Measuring curve length on a binarized image]\url{http://mathematica.stackexchange.com/questions/46342/measuring-c urve-length-on-a-binarized-image} With the help of almighty Mathematica 9, I got from this To this: with this code: MorphologicalBinarize[ Import["http://i.stack.imgur.com/79l19.jpg"]~ ColorConvert~"Grayscale"]; ... - asked by iccthedral (7 votes), answered by halirutan (6 votes) ================================== Greatest hits from previous weeks: ================================== [How to generate a random snowflake]\url{http://mathematica.stackexchange.com/questions/39361/how-to- generate-a-random-snowflake} 'Tis the season... And it's about time I posed my first 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 (86 votes), answered by Silvia (117 votes) ---------------------------- [What is the best Mathematica tutorial for young people?]\url{http://mathematica.stackexchange.com/questions/733/what-is-the -best-mathematica-tutorial-for-young-people} As Conrad Wolfram said at the TED conference, in the future kids should focus more on new technology. Computers compute better than humans, so we should focus more on thinking and getting the ... - asked by noisy (32 votes), answered by Vitaliy Kaurov (17 votes) ================================== Can you answer these? ================================== [How to get mathematica to simplify a result]\url{http://mathematica.stackexchange.com/questions/46254/how-to-get -mathematica-to-simplify-a-result} I have the following output $\text{Li}_2\left(3-2 \sqrt{2}\right)-4 \text{Li}_2\left(-1+\sqrt{2}\right)$. This turns out to be equivalent to $\displaystyle\log^2(1+\sqrt{2})-\frac{\pi^2}{4}$. How ... - asked by Oliver (3 votes) ---------------------------- [Why does Network`GraphPlot`wrapper appear in my GraphPlot?]\url{http://mathematica.stackexchange.com/questions/46377/why-do es-networkgraphplotwrapper-appear-in-my-graphplot} I'm making a GraphPlot of data similar to this: gpd = ... - asked by ArgentoSapiens (1 vote) ---------------------------- [Simplifying trig expressions containing Sqrt or Abs]\url{http://mathematica.stackexchange.com/questions/46560/simplifying-t rig-expressions-containing-sqrt-or-abs} The following Maple code can simplify abs(sin(x)) into -sin(x) given the condition -3Pi/4 < x < -Pi/2 simplify(abs(sin(x))) assuming -3*Pi < x, x < -5*Pi/2; I tried what I thought would ... - asked by mathe (6 votes)
================================== Top new questions this week: ================================== [Sketch-type graphics with transparency and dashed hidden lines?]\url{http://mathematica.stackexchange.com/questions/45410/sketch-typ e-graphics-with-transparency-and-dashed-hidden-lines} I'd like to create transparent graphs like the following from P1095, Calculus 6th Ed, by James Stewart. Can Mathematica accomplish this? By "transparent," I mean the ability to see the interior, ... - asked by LePressentiment (18 votes), answered by Silvia (35 votes) ---------------------------- [Animating moving surface of torus]\url{http://mathematica.stackexchange.com/questions/45417/animating-m oving-surface-of-torus} I would like to try to recreate something similar to Paolo eri's torus animation: I have isolated the moving surface torus section form this Wolfram Demonstration by Kevin Sonnanburg: t = s; s = ... - asked by martin (11 votes), answered by Kuba (15 votes) ---------------------------- [Fit two intersecting straight lines in Mathematica]\url{http://mathematica.stackexchange.com/questions/45401/fit-t wo-intersecting-straight-lines-in-mathematica} I am trying to do a Kurie analysis of the double beta decay of Strontium-90. Here we have two straight sections, and I need to obtain a value for the intersection along with an error for it. I ... - asked by ephimetheus (11 votes), answered by Vitaliy Kaurov (13 votes) ---------------------------- [Plotting Fourier spectrum versus frequency of a signal]\url{http://mathematica.stackexchange.com/questions/45502/plotting-f ourier-spectrum-versus-frequency-of-a-signal} I have looked around here, and i am sure this has been answered, but i don't understand it. The thing is, I have taken a introductory signal processing course, and we had to use Mathematica, and i had ... - asked by mickey (10 votes), answered by Vitaliy Kaurov (17 votes) ---------------------------- [Wikipedia People only search]\url{http://mathematica.stackexchange.com/questions/45393/wikipedia- people-only-search} I am trying to search people from Wikipedia(For example .*John.* in REGEX). The following query is close, but it isn't generalized like .*John.* and only gives back historic figures that have ... - asked by Liam William (8 votes), answered by Michael Hale (8 votes) ---------------------------- [Smoothing ListContourPlot contours]\url{http://mathematica.stackexchange.com/questions/45519/smoothin g-listcontourplot-contours} I have some data of type {{x1, y1, f1}, {x2, y2, f2}, ...} and want to do ListContourPlot. However, there is a problem that the data f is not smooth enough and has small errors. Here is a toy ... - asked by Yi Wang (7 votes), answered by Rahul Narain (8 votes) ---------------------------- [Half-delayed evaluation]\url{http://mathematica.stackexchange.com/questions/45361/half-d elayed-evaluation} In a certain wider context, I need to make some delayed definitions, such as x := a + b + c, but within these definitions I want a and b to be evaluated to their current values, not their later ... - asked by Dror Bar-Natan (7 votes), answered by WReach (5 votes) ================================== Greatest hits from previous weeks: ================================== [How do I plot coordinates (latitude and longitude pairs) on a geographic map?]\url{http://mathematica.stackexchange.com/questions/2076/how-do-i-plot -coordinates-latitude-and-longitude-pairs-on-a-geographic-map} I'm attempting for the first time to create a map within Mathematica. In particular, I would like to take an output of points and plot them according to their lat/long values over a geographic map. I ... - asked by Peter House (36 votes), answered by kguler (24 votes) ---------------------------- [What are the most common pitfalls awaiting new users?]\url{http://mathematica.stackexchange.com/questions/18393/what-are-t he-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 (134 votes), answered by Michael E2 (67 votes) ================================== Can you answer these? ================================== [How to not include data value outside plot range in the plot]\url{http://mathematica.stackexchange.com/questions/45537/how-to-not-i nclude-data-value-outside-plot-range-in-the-plot} Consider this list plot ls = Table[Sin[t], {t, 0, 100, 0.1}]; p = ListPlot[ls, PlotRange -> {{0., 0.1}, All}, DataRange -> {0, 1}, Joined -> True] If we look at the data in the plot, we ... - asked by xslittlegrass (2 votes) ---------------------------- [Finding undetermined coefficients with boundary conditions]\url{http://mathematica.stackexchange.com/questions/45219/findin g-undetermined-coefficients-with-boundary-conditions} I have 2 equations which are; To[x_] := c1 E^(-a1 x)/2 + c2 E^(a1 x)/2 + a2 Tu[x_] := c3 E^(-a3 x)/2 + c4 E^(a3 x)/2 Tu equals almost zero (10^-6) at end of the wires. To must be equal to Tu at ... - asked by CanYusuf (1 vote) ---------------------------- [Why does setting $Assumptions make my Fourier transforms slow?]\url{http://mathematica.stackexchange.com/questions/45258/why-does-se tting-assumptions-make-my-fourier-transforms-slow} Consider these Fourier transforms AbsoluteTiming[FourierTransform[Exp[(-I)*\[Omega]0*t]*Exp[-t^2], t, \[Omega]]; ] AbsoluteTiming[FourierTransform[Exp[(-I)*\[Omega]0*t]*Exp[-(t/T0)^2], t, \[Omega]]; ] ... - asked by xslittlegrass (2 votes)