Chapter 7
Year 2014

7.1 Tuesday, December 30, 2014
7.2 Tuesday, December 16, 2014
7.3 Tuesday, December 16, 2014
7.4 Tuesday, December 9, 2014
7.5 Tuesday, December 2, 2014
7.6 Tuesday, November 25, 2014
7.7 Tuesday, November 18, 2014
7.8 Tuesday, November 11, 2014
7.9 Tuesday, November 4, 2014
7.10 Tuesday, October 28, 2014
7.11 Tuesday, October 21, 2014
7.12 Tuesday, October 14, 2014
7.13 Tuesday, October 7, 2014
7.14 Tuesday, September 30, 2014
7.15 Tuesday, September 23, 2014
7.16 Tuesday, September 16, 2014
7.17 Tuesday, September 9, 2014
7.18 September 2, 2014
7.19 August 26, 2014
7.20 August 19, 2014
7.21 August 12, 2014
7.22 August 5, 2014
7.23 July 29, 2014
7.24 July 22, 2014
7.25 July 15, 2014
7.26 July 8,2014
7.27 July 1, 2014
7.28 June 24, 2014
7.29 June 17, 2014
7.30 June 10, 2014
7.31 June 3, 2014
7.32 May 27 2014
7.33 May 20 2014
7.34 May 13, 2014
7.35 May 6, 2014
7.36 April 15, 2014
7.37 April 1, 2014
7.38 March 25, 2014
7.39 March 18, 2014
7.40 March 11, 2014
7.41 March 4, 2014
7.42 February 25, 2014
7.43 February 18, 2014
7.44 February 11, 2014
7.45 February 4, 2014
7.46 January 28, 2014
7.47 January 21, 2014
7.48 January 14, 2014
7.49 January 7, 2014

7.1 Tuesday, December 30, 2014

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

[How would I return a random Mathematicacommand?] http://mathematica.stackexchange.com/questions/69627/how-would-i-return-a-random-mathematica-command

I’m doing some metaprogramming. How would I make a Mathematica function that returns a random Mathematica command? Is there a list of command names that I could use RandomChoice on?

I’m looking for ...

- asked by Alexander Gruber (10 votes), answered by bill s (16 votes)

—————————- [Rendering thousands ofpoints] http://mathematica.stackexchange.com/questions/69774/rendering-thousands-of-points

I am trying to render an image with some 120,000 Points. Technically it’s just 10,000 points, plus their reflection, plus 5 rotations of both of those sets, but I’m not sure that’s relevant. The code ...

- asked by Martin Buttner (9 votes), answered by Sjoerd C. de Vries (11 votes)

—————————-

[Truncating a list once all members of a set have appeared?] http://mathematica.stackexchange.com/questions/69613/truncating-a-list-once-all-members-of-a-set-have-appeared

Consider if you would the case where we have some list of elements:

list0 = 54, 4, 7, 9, 3, 54, 4, 20, 2, 456, 2, 3;

And we have some target list:

targetList = 2, 3, 4, 7;

We’d like to scan ...

- asked by GreenField (9 votes), answered by Mr.Wizard (4 votes)

—————————-

[Find the minimum integer r such that \((10^r - 1)/37\) is an integer] http://mathematica.stackexchange.com/questions/69811/find-the-minimum-integer-r-such-that-10r-1-37-is-an-integer

I know Element[(10^r - 1)/37, Integers] tests the condition.

So what is the command that gives me the minimum integer value r such that the condition is true?

- asked by LoveRight (7 votes), answered by Oleksandr R. (10 votes)

—————————-

[Definite integral incorrectly giving a nonreal value] http://mathematica.stackexchange.com/questions/69718/definite-integral-incorrectly-giving-a-nonreal-value

In Mathematica 10.0, when I enter

N[Integrate[Sqrt[1+x^3],{x,-1,3}]] 
 
, I get a nonreal value.  (I.e., the imaginary part is nonzero.)  Why? 
 
This arose when I was seeing if Sqrt[1_x^3] has an  ... 

- asked by Stephen Herschkorn (7 votes), answered by Nasser (6 votes)

—————————-

[LetterCharacter for Cyrillic symbols]http://mathematica.stackexchange.com/questions/69728/lettercharacter-for-cyrillic-symbols

Why does the code

StringMatchQ["bl", LetterCharacter]

return False?

Probably because:

StringMatchQ[bl", LetterCharacter] // HoldForm // FullForm 
...

- asked by molekyla777 (7 votes), answered by Karsten 7. (7 votes)

—————————-

[How discretize a region placing vertices on a specific non-uniform grid] http://mathematica.stackexchange.com/questions/69584/how-discretize-a-region-placing-vertices-on-a-specific-non-uniform-grid

Given a generic region, for example:

\[CapitalOmega] = ImplicitRegion[((2*x^2 + 3*y^2 + 2*x*y - 2 & )*lt; ) = (0^x^2 + y^2 & )*gt; 0.1, {x, y}]; 
 
and a non-uniform grid, for example: 
 
\[CapitalOmega]b = RegionBounds[\[CapitalOmega]]; 
{xg, yg} =  ...

- asked by unlikely (6 votes), answered by kguler (9 votes)

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

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

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

- asked by stevenvh (17 votes), answered by Artes (10 votes)

—————————-

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

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

- asked by belisarius (184 votes), answered by Michael E2 (99 votes)

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

[DSolve versus DSolveValue] http://mathematica.stackexchange.com/questions/69793/dsolve-versus-dsolvevalue

I’ve just discovered the new command DSolveValue in Mathematica 10. Is this new command now the preferred instead of DSolve? Is it the better command to teach to students? Same question for ...

- asked by David (2 votes)

—————————-

[Font rendering difference between .jpg & .pdf] http://mathematica.stackexchange.com/questions/69825/font-rendering-difference-between-jpg-pdf

I have some planar graphics involving lines and text, produced by Line[] and Text[], accepting the default font on the latter. When I Save Graphics as .jpg, it looks fine, left below. When I save as ...

- asked by Joseph O’Rourke (2 votes)

—————————-

[Regular Polyhedra coordinate points generation] http://mathematica.stackexchange.com/questions/69839/regular-polyhedra-coordinate-points-generation

Is it possible to get all points on a Polyhedron surface using two surface parameters, say

\( \phi ,\theta \) spherical co-ordinates?

Just like in ParametricPlot3D, can we start with PolyhedronData ...

- asked by Narasimham (1 vote)

7.2 Tuesday, December 16, 2014

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

[Buying a new computer (specifically for Mathematica)] http://mathematica.stackexchange.com/questions/69404/buying-a-new-computer-specifically-for-mathematica

My current computer is a MacBook Air, the mid-2011 version: 4 GB RAM, 1.7 GHz Intel dual core. It runs Mathematica 9 smoothly, but a bit too slowly for my taste. I use Mathematica almost exclusively ...

- asked by Kim Fierens (14 votes), answered by halirutan (15 votes)

—————————-

[Difference between Association and Dispatch] http://mathematica.stackexchange.com/questions/69291/difference-between-association-and-dispatch

In the example below, Association has a different behavior from Dispatch:

{1, 2, 3} /. Association@{1 -> "test",2 -> "test" , _Integer -> 
Null} 
{1, 2, 3} /. Dispatch@{1 -> "test" ,2 ->  ...

- asked by Murta (13 votes), answered by Leonid Shifrin (15 votes)

—————————-

[Real Numbers in the Wolfram Language] http://mathematica.stackexchange.com/questions/69525/real-numbers-in-the-wolfram-language

This is more of a request for advice and input than a solution to a programming challenge, but I thought it might be useful to raise here nonetheless.

I am wondering if Mathematica and the Wolfram ...

- asked by David Carraher (11 votes)

—————————-

[InverseFourierTransform of simple function takes forever] http://mathematica.stackexchange.com/questions/69477/inversefouriertransform-of-simple-function-takes-forever

i’m quite new to Mathematica. I’m trying to do something along the lines of:

InverseFourierTransform[1/(w^2 - I*w*b + c) , w, t, FourierParameters 
-> {1, -1}, Assumptions -> {b > 0, c >  ...

- asked by pnjun (9 votes), answered by bbgodfrey (8 votes)

—————————-

[Divide all but the maximal element in a list by 10?] http://mathematica.stackexchange.com/questions/69547/divide-all-but-the-maximal-element-in-a-list-by-10

I have a list of numerical data, and I want to write a program that will keep the maximum as it is, but reduce the rest by certain factor (such as 10). For example:

input = {2, 3, 1, -3, -5, 9, 2, 6,  ...

- asked by Paul (8 votes), answered by WReach (10 votes)

—————————-

[Select a particular rules out of a list] http://mathematica.stackexchange.com/questions/69299/select-a-particular-rules-out-of-a-list

rule = {beta -> 4, alpha -> 2, x -> 4, z -> 2, w -> 0.8} 
Select[rule, beta] 
Select[rule, beta &] 
Select[rule, beta -> _ &]

How would I select the rule that applies to beta ...

- asked by Chen Stats Yu (8 votes), answered by kguler (12 votes)

—————————-

[10.0.2 another Dataset type system (inference?) warning] http://mathematica.stackexchange.com/questions/69542/10-0-2-another-dataset-type-system-inference-warning

Bug introduced in 10.0.2

The warning below seems unrelated to these issues: Did 10.0.2 break some forms for named slots? and 10.0.2 mapping Association to Dataset warning.

First noticed w/ ...

- asked by alancalvitti (7 votes), answered by Stefan R (11 votes)

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

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

I want to find :

all local maxima in range all local minima in range

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

- asked by Margus (45 votes), answered by Daniel Lichtblau (43 votes)

—————————-

[How to create animated snowfall?] http://mathematica.stackexchange.com/questions/16881/how-to-create-animated-snowfall

Well, the title is self-explanatory. What sorts of snowfall can we generate using Mathematica? There are two options I suggest to consider:

1) Continuous GIF animations with smallest possible number ...

- asked by faleichik (30 votes), answered by Simon Woods (35 votes)

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

[How to execute code on FrontEnd quit?] http://mathematica.stackexchange.com/questions/69385/how-to-execute-code-on-frontend-quit

I would like to execute a block of code whenever the FrontEnd quits. I know about $Epilog, but it seems that this would execute every time the kernel quits, which is not what I want. Does anyone know ...

- asked by rdjain1 (4 votes)

—————————-

[Logarithmic vertex placement in large tree graphs] http://mathematica.stackexchange.com/questions/69555/logarithmic-vertex-placement-in-large-tree-graphs

This question about graph layout is fairly general, but can be illustrated in the case of the Collatz Conjecture. Collatz created the following function over positive integers: If the integer n is ...

- asked by David G. Stork (1 vote)

—————————-

[Background color does not display in InputField unless Appearance option is also specified] http://mathematica.stackexchange.com/questions/69446/background-color-does-not-display-in-inputfield-unless-appearance-option-is-also

I get the same behavior for v.10.0.2 and v.9 with OS X (10.9.5) :

No background color is displayed in InputField if I just set properly the option. For example, the background just remains white if ...

- asked by SquareOne (2 votes)

7.3 Tuesday, December 16, 2014

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

[Bug in ArcLength?]http://mathematica.stackexchange.com/questions/69122/bug-in-arclength

With Mathematica 10.0.2:

ArcLength[Line[{{0, 0}, {1, 0}, {2, 0}}]] 
ArcLength[Line[{{0}, {1}, {2}}]] 
(* 2 *) 
(* 2 *) 
 
 
However, 
 
ArcLength[Line[{{0, 0}, {1, 0}, {2.0, 0}}]] 
ArcLength[Line[{{0}, {1},  ...

- asked by qwerty (15 votes)

—————————-

[Save as pdf broken in version 10.0.2?] http://mathematica.stackexchange.com/questions/68893/save-as-pdf-broken-in-version-10-0-2

It looks like the save as pdf is broken after I update to version 10.0.2. The labels in the plot become a mess.

Are there ways to fix it? The Export function works well though.

Here is a screenshot

...

- asked by xslittlegrass (12 votes)

—————————-

[What does f_[whoCalled]^:=f really mean?] http://mathematica.stackexchange.com/questions/68823/what-does-f-whocalled-f-really-mean

I came across the following post by John Doty in this Google Groups discussion:

On Friday, January 11, 2013 8:23:16 PM UTC-7, amzoti wrote:

It is clear the Mathematica uses Lisp as one ...

- asked by Shredderroy (11 votes), answered by Chris Degnen (1 vote)

—————————-

[10.0.2 mapping Association to Dataset warning] http://mathematica.stackexchange.com/questions/68875/10-0-2-mapping-association-to-dataset-warning

In 10.0.2

ExampleData[{"Dataset", "Titanic"}][All, <| "gender" -> #sex|> 
&] 
 
 
Outputs the expected result, but also throws: 
 
 
MapAt::partw: Part {1,All,2} of 
...

- asked by alancalvitti (10 votes), answered by Taliesin Beynon (12 votes)

—————————-

[Sampling phase space uniformly for a given energy] http://mathematica.stackexchange.com/questions/69029/sampling-phase-space-uniformly-for-a-given-energy

For example, for the 1D harmonic oscillator, the energy is given by: \[ E = \frac {1}{2 m} p^2 + \frac {m \omega ^2}{2} x^2 \] where x is position and p is the momentum.

I would like to sample phase ...

- asked by user29165 (8 votes), answered by bbgodfrey (5 votes)

—————————-

[representation of custom deformation on a meshgrid] http://mathematica.stackexchange.com/questions/69132/representation-of-custom-deformation-on-a-meshgrid

I am trying to represent 2D deformations on a rectangular grid. In Mathematica 10, there is a method to solve the elastic differential equations and then represent the deformation as presented here:

...

- asked by Botond (7 votes), answered by Michael E2 (9 votes)

—————————-

[Processing a circular rainbow in an image] http://mathematica.stackexchange.com/questions/69092/processing-a-circular-rainbow-in-an-image

I was flying cross country last week. We were at about 35000 feet with a complete cloud deck below us. I looked down and saw a complete circular rainbow above the clouds. It was in view about 10 ...

- asked by Rob (7 votes), answered by bill s (9 votes)

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

[How to find the domain and range of a function with Mathematica?] http://mathematica.stackexchange.com/questions/8016/how-to-find-the-domain-and-range-of-a-function-with-mathematica

I’m studying calculus and in some exercises I am asked to find the domain and range of a function. Does Mathematica have already a built-in function for this?

I can imagine some ways of doing so, ...

- asked by Vyska (17 votes), answered by Szabolcs (18 votes)

—————————-

[How to ask Mathematica to imitate Andy Warhol’s pop-art painting?] http://mathematica.stackexchange.com/questions/59132/how-to-ask-mathematica-to-imitate-andy-warhols-pop-art-painting

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

- asked by Putterboy (37 votes), answered by belisarius (41 votes)

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

[Linux: Mathematica crashes when clicking documentation links very fast] http://mathematica.stackexchange.com/questions/68927/linux-mathematica-crashes-when-clicking-documentation-links-very-fast

Can someone confirm the following behavior: Open a new Mathematica and go to the documentation. Navigate to any reference page (I used RegionPlot) and click repeatedly and very fast the RegionPlot ...

- asked by halirutan (5 votes)

—————————-

[Import/Export a FIT file, Fitness file created by Garmin GPS’s and others] http://mathematica.stackexchange.com/questions/69085/import-export-a-fit-file-fitness-file-created-by-garmin-gpss-and-others

A FIT file is a binary replacement for GPX and TCX text files containing GPS and fitness data (heart monitors, etc.). Mathematica reads GPX and TCX files and represents them as XML. I would like to ...

- asked by Douglas Kubler (1 vote)

—————————-

[Creating REST Web Service with webMathematica] http://mathematica.stackexchange.com/questions/69021/creating-rest-web-service-with-webmathematica

Someone knows how can I implement a REST Web Service with webMathematica?

The SOAP service is well documented here and in the webMathematica User Guide.

I saw that is possible to create a REST ...

- asked by Murta (4 votes)

7.4 Tuesday, December 9, 2014

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

[Where is the old option TraceInternal->True?] http://mathematica.stackexchange.com/questions/67305/where-is-the-old-option-traceinternal-true

Already at least in version 2 (I think), the function Solve calls the function Roots. At that time, I had a rather dirty trick, that still works, to verify this:

Unprotect[Roots]; 
Roots[x___] /;  ...

- asked by Fred Simons (14 votes), answered by WReach (13 votes)

—————————-

[What are the purposes of functions in FrontEnd‘ context which are duplicates of those in System‘?] http://mathematica.stackexchange.com/questions/67179/what-are-the-purposes-of-functions-in-frontend-context-which-are-duplicates-of

I noticed that for notebook-related heads, there are usually a pair of same functions, one in System context, another in FrontEnd context. I filtered out a list of functions of this kind:

candidates ...

- asked by Naitree (9 votes), answered by Naitree (6 votes)

—————————-

[Modify existing color scheme] http://mathematica.stackexchange.com/questions/67212/modify-existing-color-scheme

I am using the "TemperatureMap" color scheme for image processing. How can I set the lowest color value to Black?

Generally speaking, is it possible to exchange a specific color (at a certain value ...

- asked by Milenko Rubin-Zuzic (8 votes), answered by rm -rf (13 votes)

—————————-

[Get rational and irrational parts] http://mathematica.stackexchange.com/questions/67293/get-rational-and-irrational-parts

Consider an expression of the form \(a + b \sqrt {2}\), where \(a,b \in \mathbb {Q}\). How can I extract \(b\) (or equivalently \(a\)) from this expression?

- asked by Tyson Williams (8 votes), answered by Michael E2 (6 votes)

—————————-

[Implementation of Partial Least Squares (PLS)?] http://mathematica.stackexchange.com/questions/67282/implementation-of-partial-least-squares-pls

I’m looking for a PLS implementation for Wolfram Mathematica. I just cant seem to find any implementation for it - do you know one? In general, I’m a bit confused that there exist only so few ...

- asked by tim (6 votes)

—————————-

[A short notation to fix the assumption that all involved parameters are, say, positive] http://mathematica.stackexchange.com/questions/67601/a-short-notation-to-fix-the-assumption-that-all-involved-parameters-are-say-po

Often I make simplifications or other operations with assumptions. Sometimes the assumptions simply state that all parameters involved are positive.

I wonder, if there is a short notation for such a ...

- asked by Alexei Boulbitch (5 votes), answered by kguler (2 votes)

—————————-

[Why are TimeSeries objects reported with head "TemporalData"?] http://mathematica.stackexchange.com/questions/67597/why-are-timeseries-objects-reported-with-head-temporaldata

I am quite surprised to find that

ts = TimeSeries[ {1,2,3,4}, {{1,2,3,4}}]; 
Head @ ts 
 
 
returns 
 
(* TemporalData *)

I do find this quite inconsistent as the object is also reported with ...

- asked by gwr (5 votes)

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

[Even Fibonacci numbers] http://mathematica.stackexchange.com/questions/37266/even-fibonacci-numbers

Today, I found the Euler Project. Problem #2 is

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, ...

- asked by ShutaoTang (24 votes), answered by rcollyer (31 votes)

—————————-

[Implementing efficient multiple undo] http://mathematica.stackexchange.com/questions/1953/implementing-efficient-multiple-undo

At the time this question was asked, version 10 was not out yet. The Front End of Mathematica 10 does have multiple undo, see the answer by John Fultz.

The Mathematica Front End’s built-in Undo ...

- asked by Rojo (112 votes), answered by John Fultz (38 votes)

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

[The CorrelationMatrix is equal to corrcoef of Matlab?] http://mathematica.stackexchange.com/questions/67348/the-correlationmatrix-is-equal-to-corrcoef-of-matlab

I know that my question imply to know matlab, and this is not the right place, but i’m a physics student and i don’t quite yet understand this concepts. When i make a LinearModelFit i can get a ...

- asked by Kafkarudo (2 votes)

—————————-

[How to assemble and disassemble a function into steps] http://mathematica.stackexchange.com/questions/67325/how-to-assemble-and-disassemble-a-function-into-steps

I’ve watched many programmers (both novice and expert) write functions in Mathematica and have observed a common behavioral pattern. This pattern has many elements that would be automated and thus ...

- asked by user5601 (3 votes)

—————————-

[Mathematica 10 and Mac] http://mathematica.stackexchange.com/questions/67552/mathematica-10-and-mac

This might be a the wrong place to post the question, but I am sure that there would be few places where I would find people who would know more about how mathematica works.

I am looking to buy a new ...

- asked by ALEXANDER (2 votes)

7.5 Tuesday, December 2, 2014

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

[Wind Map Artwork] http://mathematica.stackexchange.com/questions/66936/wind-map-artwork

I would like some help generating an image like the one seen below.

The image above is an art piece called Wind Map by artists Fernanda Viegas and Martin Wattenberg.

I would like to take wind ...

- asked by James Rohal (15 votes), answered by Silvia (10 votes)

—————————-

[Visual representation of a Ranking over time (image provided)] http://mathematica.stackexchange.com/questions/66581/visual-representation-of-a-ranking-over-time-image-provided

[Disclaimer: I initially posted this question on stackOverflow 2 months ago and think it might be better suited for this forum (link to original question)]

The graph below shows a ranking of ...

- asked by Seb (15 votes), answered by belisarius (17 votes)

—————————-

[Drawing a square root spiral] http://mathematica.stackexchange.com/questions/66969/drawing-a-square-root-spiral

Here is a start, i’m looking for a nice way.

Graphics[{EdgeForm[Black], White, 
Polygon@{{0, 0}, {-1, 0}, 
Sqrt[2] {Cos[#], Sin[#]} &[Pi - (ArcCot[1])]}, 
Polygon@{{0, 0}, Sqrt[2]  ...

- asked by mathe (12 votes), answered by Bob Hanlon (7 votes)

—————————-

[Mathematica, animations, and external ray tracing programs] http://mathematica.stackexchange.com/questions/66638/mathematica-animations-and-external-ray-tracing-programs

As much as I enjoy and admire Mathematica’s animation capabilities, I would like to take my animations to the next level by exporting the geometry of every frame to an external ray tracing program ...

- asked by Kim Fierens (11 votes), answered by Alexey Popkov (4 votes)

—————————-

[Combine Stereographic "Entity" Plot of Arctic Sea with Contour Plot] http://mathematica.stackexchange.com/questions/66562/combine-stereographic-entity-plot-of-arctic-sea-with-contour-plot

In the announcement of Mathematica 10 there were some very cool features for every geo-related researcher. Like this one

what i’m trying to do is to overlay an ContourPlot onto this beautiful arctic ...

- asked by Julian Carpenter (10 votes), answered by FJRA (3 votes)

—————————-

[Generating Random Real numbers with certain numbers not included] http://mathematica.stackexchange.com/questions/66756/generating-random-real-numbers-with-certain-numbers-not-included

I’m writing a program that i need 1000 real number between -3 and 6. the code that I used for generating and saving them was

l = RandomReal[-3, 6, 1000]

But I want to be sure none of these ...

- asked by user2838619 (9 votes), answered by belisarius (9 votes)

—————————-

[Detect implicit grid in image with monospaced characters] http://mathematica.stackexchange.com/questions/66886/detect-implicit-grid-in-image-with-monospaced-characters

I’m trying to detect the monospaced-grid in a possibly slightly deformed image of a receipt. Example input (full size here)

My idea is to obtain the centroids or bounding boxes of all components ...

- asked by Thijs (8 votes), answered by belisarius (9 votes)

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

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

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

- asked by stevenvh (16 votes), answered by Artes (10 votes)

—————————-

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

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

I would like to ...

- asked by VividD (67 votes), answered by level1807 (42 votes)

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

[Lists for built-in functions that can work without brackets] http://mathematica.stackexchange.com/questions/67039/lists-for-built-in-functions-that-can-work-without-brackets

I just noticed that Exit and Quit can work without brackets i.e. a single

Exit

or

Quit

will quit the kernel. Quite surprising!

This isn’t mentioned in the document of them. Is there a list for ...

- asked by xzczd (3 votes)

—————————-

[ImportString JSON possible bug] http://mathematica.stackexchange.com/questions/67076/importstring-json-possible-bug

My problem is when I catch up some json output of  whatever method and 
process it with ImportString[%, "JSON"], The first time when it 
executes, it works and then without doing anything, it stops  ...

- asked by d555 (4 votes)

—————————-

[Fractals or other patterns in the quadruple linked pendulum] http://mathematica.stackexchange.com/questions/67012/fractals-or-other-patterns-in-the-quadruple-linked-pendulum

This will seem like a physics question, but I’m looking for something to do in Mathematica specifically. I’ve successfully modeled a quadruple linked pendulum by setting up the ODEs and solving them ...

- asked by Lonely Mathematician (3 votes)

7.6 Tuesday, November 25, 2014

================================== 
Top new questions this week: 
================================== 
 
[Is it possible to draw really thin lines in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/66177/is-i 
t-possible-to-draw-really-thin-lines-in-mathematica} 
 
I want to have in Mathematica the same result I have in Python: 
 
 
I have this nice effect simply by using very thin lines. But it seems in 
Mathematica thickness property has some limit and i just got  ... 
 
- asked by funnypony (18 votes), answered by Alexey Popkov (18 votes) 
 
---------------------------- 
 
[How to write Morse code into Plot 
Dashing?]\url{http://mathematica.stackexchange.com/questions/66267/how-to-w 
rite-morse-code-into-plot-dashing} 
 
How can we define a dashing pattern in a plot such that it reads 
arbitrary text in Morse code? 
 
For instance 
 
Graphics[{DotDashed, Line[{{0, 0}, {5, 0}}]}] 
 
 
 
 
 
 
this could be interpreted as ".-"  ... 
 
- asked by rhermans (14 votes), answered by rhermans (20 votes) 
 
---------------------------- 
 
[How do I draw a pair of 
buttocks?]\url{http://mathematica.stackexchange.com/questions/66538/how-do- 
i-draw-a-pair-of-buttocks} 
 
I'm trying  to develop a function which 3D plot would have a buttocks 
like shape. 
 
Several days of searching the web and a dozen my of own attempts to 
solve the issue have brought nothing but two  ... 
 
- asked by Simpleton Jack (11 votes), answered by gpap (20 votes) 
 
---------------------------- 
 
[Automatically execute command after 
save]\url{http://mathematica.stackexchange.com/questions/66239/automaticall 
y-execute-command-after-save} 
 
I want to run some code automatically after saving my notebook. Is there 
a $ variable or setting for this? 
 
 
- asked by Giovanni (10 votes), answered by funnypony (13 votes) 
 
---------------------------- 
 
[Minesweeper beta : How to Dynamic a lot of graphics with high-speed] 
\url{http://mathematica.stackexchange.com/questions/66133/minesw 
eeper-beta-how-to-dynamic-a-lot-of-graphics-with-high-speed} 
 
Recently I want to write a game,Minesweeper.Here is my completed code. 
 
Clear["Global`*"] 
path = "http://i.stack.imgur.com//" <> # &; 
filenames1 = {"P22Go.jpg", "Zh27M.jpg", "vKZZr.jpg",  ... 
 
- asked by Chenminqi (8 votes) 
 
---------------------------- 
 
[Is plot polluting my 
context?]\url{http://mathematica.stackexchange.com/questions/66255/is-plot- 
polluting-my-context} 
 
Whenever I plot something 3 temporary variables get added to my current 
context. 
 
Example (fresh Kernel): 
 
Plot[x, {x, -1, 1}]; 
Names["Global`*"] 
 
 
Output: 
 
{"x", "$3", "$4", "$5"} 
 
 
When I do the  ... 
 
- asked by Max1 (8 votes) 
 
---------------------------- 
 
[How to subtract one list from another, treating each elements as 
distinct?]\url{http://mathematica.stackexchange.com/questions/66079/how-to- 
subtract-one-list-from-another-treating-each-elements-as-distinct} 
 
Suppose that I have 
 
a = {"A", "A", "A", "B", "B", "C"} 
b = {"A", "B"} 
 
 
How can I subtract b from a such that the result is {"A", "A", "B", 
"C"}? 
 
One solution I can think of is to use 
 
... 
 
- asked by Taiki (8 votes), answered by Kuba (8 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 (60 votes), answered by J.M. (51 votes) 
 
---------------------------- 
 
[How to create a new "person 
curve"?]\url{http://mathematica.stackexchange.com/questions/17704/how-to-cr 
eate-a-new-person-curve} 
 
Wolfram|Alpha has a whole collection of parametric curves that create 
images of famous people. To see them, enter WolframAlpha["person curve"] 
into a Mathematica notebook, or person curve into  ... 
 
- asked by Simon (48 votes), answered by Vitaliy Kaurov (21 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Mod[1.2, 0.2] is not equal to 
zero]\url{http://mathematica.stackexchange.com/questions/66386/mod1-2-0-2-i 
s-not-equal-to-zero} 
 
I'm new to mathematica but this doesn't seem to make any sence 
 
In[1]:=Mod[1.2, 0.2] 
Out[1]=0.2 
 
 
Why is it not zero? 
 
Edit: 
 
This is what I wanted to do: 
 
xgrid = Table[{i,If[Mod[i, 0.2] == 0 ,  ... 
 
- asked by Patrick Chin (2 votes) 
 
---------------------------- 
 
[Parsing RLink RObject for 
summary.aovlist]\url{http://mathematica.stackexchange.com/questions/66506/p 
arsing-rlink-robject-for-summary-aovlist} 
 
There's some slightly similar requests out there (e.g. Getting R textual 
output into Mathematica ) but I'm wondering if anyone has put together a 
more general purpose solution to parsing RObject[]  ... 
 
- asked by flip (1 vote) 
 
---------------------------- 
 
[Implement a piecewise function elegantly and 
efficiently]\url{http://mathematica.stackexchange.com/questions/66209/imple 
ment-a-piecewise-function-elegantly-and-efficiently} 
 
Given that 
$$ 
g(x)= 
\begin{cases} 
max(x_{min},x-m) & 0.5x \leq max(x_{min},x-m) \\ 
0.5x & max(x_{min},x-m)<0.5x<min(1,x+m) \\ 
min(1,x+m) & min(1,x+m)\leq 0.5x 
\end{cases}$$ 
... 
 
- asked by ShutaoTang (4 votes) 

7.7 Tuesday, November 18, 2014

================================== 
Top new questions this week: 
================================== 
 
[How to extract a list of available 
Method-s]\url{http://mathematica.stackexchange.com/questions/65680/how-to-e 
xtract-a-list-of-available-method-s} 
 
The option Methodapplies for several functions, such as NDSolve, 
FindRoot, NIntegrate and some others. It is difficult, however, to find 
a list of Methods for a given function. By digging through  ... 
 
- asked by Alexei Boulbitch (16 votes), answered by Nasser (18 votes) 
 
---------------------------- 
 
[How to programmatically extract mathematical formulas from Word with 
Mathematica 
9?]\url{http://mathematica.stackexchange.com/questions/65666/how-to-program 
matically-extract-mathematical-formulas-from-word-with-mathematica} 
 
I have a bunch of(1000+) Microsoft Word document in .Docx format. How 
can I programmatically extract the mathematical formulas from MS Word 
using Mathematica 9? 
 
This is what example looks like (or  ... 
 
- asked by Xiang Li (15 votes), answered by WolframFan (15 votes) 
 
---------------------------- 
 
[Why is TextString[-0.5] a positive 
number?]\url{http://mathematica.stackexchange.com/questions/65600/why-is-te 
xtstring-0-5-a-positive-number} 
 
I want to format numbers in decimal notation and chose TextString for 
this task. But today, when looking at the final result of my 3-weeks 
measurement, the sign seemed odd. I traced it to the  ... 
 
- asked by Martin J.H. (14 votes), answered by Szabolcs (10 votes) 
 
---------------------------- 
 
[Quickly test if all element in list is the 
same]\url{http://mathematica.stackexchange.com/questions/65782/quickly-test 
-if-all-element-in-list-is-the-same} 
 
I'm running a Monte Carlo simulation. At the end, I want to count how 
many simulations return a list of same element. 
 
My problem: 
 
SimulationResult = (* n x m matrix of real numbers *) 
c =  ... 
 
- asked by Zoff Dino (12 votes), answered by Michael E2 (9 votes) 
 
---------------------------- 
 
[Efficient way to compare animated images to tell if they are the 
same]\url{http://mathematica.stackexchange.com/questions/65794/efficient-wa 
y-to-compare-animated-images-to-tell-if-they-are-the-same} 
 
I have a Student license for Mathematica, and felt like I wasn't making 
full use of the wonderful toolkit that it is; so I looked into things 
like its image processing capabilities. Now, I made and  ... 
 
- asked by Austin Burk (11 votes), answered by Pickett (7 votes) 
 
---------------------------- 
 
[A one line proof that one is zero using Mathematica 
10]\url{http://mathematica.stackexchange.com/questions/65624/a-one-line-pro 
of-that-one-is-zero-using-mathematica-10} 
 
a = (Sqrt[2] + 1) (Sqrt[2] - 1) - 1; 
{a/a, Simplify[a]/a, b/b == Simplify[b]/b} 
 
 
 
{1, 0, True} 
 
 
 
This one line "proof" that one equals zero is disturbing (and could 
possibly lead to wrong results  ... 
 
- asked by Gregoire Nicollier (11 votes), answered by Szabolcs (22 
votes) 
 
---------------------------- 
 
[Curve fitting by running through hundreds of models and return the one 
with best 
fit]\url{http://mathematica.stackexchange.com/questions/65757/curve-fitting 
-by-running-through-hundreds-of-models-and-return-the-one-with-best} 
 
In the past, I used to solve a lot of my regression analysis (curve 
fitting) problems with a program called DataFit which runs on Windows. 
It has hundreds of regression models which it runs through in  ... 
 
- asked by MathLind (9 votes), answered by kguler (17 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[How to create a new "person 
curve"?]\url{http://mathematica.stackexchange.com/questions/17704/how-to-cr 
eate-a-new-person-curve} 
 
Wolfram|Alpha has a whole collection of parametric curves that create 
images of famous people. To see them, enter WolframAlpha["person curve"] 
into a Mathematica notebook, or person curve into  ... 
 
- asked by Simon (47 votes), answered by Vitaliy Kaurov (20 votes) 
 
---------------------------- 
 
[Numerically solving Helmholtz equation in 2D for arbitrary 
shapes]\url{http://mathematica.stackexchange.com/questions/56305/numericall 
y-solving-helmholtz-equation-in-2d-for-arbitrary-shapes} 
 
I would like to solve the Helmholtz equation with dirichlet boundary 
conditions in 2 dimensions for an arbitrary shape. (for a qualitative 
comparison of the eigenstates to periodic orbits in the  ... 
 
- asked by Julian S. (35 votes), answered by Mark McClure (30 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Find d'Alembertian in the output and convert into Einstein summation 
convention 
form]\url{http://mathematica.stackexchange.com/questions/65469/find-dalembe 
rtian-in-the-output-and-convert-into-einstein-summation-convention} 
 
I am trying to do field variations in Mathematica and would like some 
nice formatting. My output is in the form 
 
$ -\frac{1}{c^2}V^{(1,0,0,0)}[t,x,y,z] +  ... 
 
- asked by SlipStream (2 votes) 
 
---------------------------- 
 
[remote kernel through 
SSH]\url{http://mathematica.stackexchange.com/questions/65953/remote-kernel 
-through-ssh} 
 
Is it possible to setup connection to remote kernels through ssh? 
 
I'm able to SSH into the remote server(linux) and start a kernel in the 
terminal, but it can't connect back to my local front end. I  ... 
 
- asked by xslittlegrass (3 votes) 
 
---------------------------- 
 
[Understanding polyharmonic 
splines]\url{http://mathematica.stackexchange.com/questions/65763/understan 
ding-polyharmonic-splines} 
 
Raul Narain and J.M. gives implementation of the thin plate polyharmonic 
splines in this post. Raul Narian's method is clear. J.M.'s is 
convenient to reuse. But J.M. used too many  ... 
 
- asked by xibinke (1 vote)

7.8 Tuesday, November 11, 2014

 
================================== 
Top new questions this week: 
================================== 
 
[Exclude data from a 
list]\url{http://mathematica.stackexchange.com/questions/65246/exclude-data 
-from-a-list} 
 
Let's create some random sample data 
 
data = Table[{RandomReal[{-10, 10}], RandomReal[{-10, 10}]}, {i, 1, 
300}]; 
 
 
Then we plot them using ListPlot 
 
L0 = ListPlot[data, Frame -> True, Axes ->  ... 
 
- asked by Vaggelis_Z (13 votes), answered by kguler (15 votes) 
 
---------------------------- 
 
[How do I understand ListCorrelate(contains $\{k_L,k_R\}$) when it works 
for 2-dimentional 
data?]\url{http://mathematica.stackexchange.com/questions/64925/how-do-i-un 
derstand-listcorrelatecontains-k-l-k-r-when-it-works-for-2-di} 
 
Two months ago, I asked a question here 
 
And @nikie give me a solution: 
 
 
The intuitive way to understand ListCorrelate is that the kernel is 
"moved" to every position in the array, and the sum of  ... 
 
- asked by ShutaoTang (12 votes), answered by Simon Woods (11 votes) 
 
---------------------------- 
 
[Using 0 to create new columns in a list with 
Part]\url{http://mathematica.stackexchange.com/questions/65200/using-0-to-c 
reate-new-columns-in-a-list-with-part} 
 
I just discovered a nice way to create intermediary columns in a list, 
and I would like to know if I can have some problem with it. It Works 
like this: 
 
Imagine I have this list, 5x3: 
 
SeedRandom[0] 
... 
 
- asked by Murta (10 votes), answered by Mr.Wizard (12 votes) 
 
---------------------------- 
 
[Glitch in 
Filling?]\url{http://mathematica.stackexchange.com/questions/64988/glitch-i 
n-filling} 
 
I ran into a problem while plotting and I was able to narrow it to this. 
Before I start "spelunking" I'd like to know if I am overlooking 
something or if this is a problem others have worked through. 
... 
 
- asked by Mr.Wizard (9 votes), answered by ybeltukov (5 votes) 
 
---------------------------- 
 
[Multiple-colored regions on a Sphere in 
Mathematica]\url{http://mathematica.stackexchange.com/questions/65174/multi 
ple-colored-regions-on-a-sphere-in-mathematica} 
 
The problem: I would like to draw a sphere where the bottom half is one 
color, and the top half is split into 3 equal regions, each with its own 
color. 
 
I have come up with the following code, by  ... 
 
- asked by Nick Lassonde (8 votes), answered by Michael E2 (8 votes) 
 
---------------------------- 
 
[Is there a way to control V10's undo 
length?]\url{http://mathematica.stackexchange.com/questions/65055/is-there- 
a-way-to-control-v10s-undo-length} 
 
This may be a duplicate (if so I will remove this), but I was having 
trouble finding the relevant bit of documentation to fix it. I noticed 
that my FrontEnd memory use was growing out of control when  ... 
 
- asked by DumpsterDoofus (8 votes), answered by rm -rf (6 votes) 
 
---------------------------- 
 
[What is the best way to draw a shaded 
table?]\url{http://mathematica.stackexchange.com/questions/65356/what-is-th 
e-best-way-to-draw-a-shaded-table} 
 
I'm trying to format a raster-style table with row and column headings 
and in which each cell is shaded according to the value in the cell, and 
the value of the cell is displayed in as text in a  ... 
 
- asked by raxacoricofallapatorius (6 votes), answered by Arnoud Buzing 
(7 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 (58 votes), answered by J.M. (50 votes) 
 
---------------------------- 
 
[Why round to even integers?] 
\url{http://mathematica.stackexchange.com/questions/2116/why-roun 
d-to-even-integers} 
 
According to the Mathematica help: 
 
 
Round rounds numbers of the form x.5 toward the nearest even integer. 
 
 
For example: 
 
Round[{0.5, 1.5, 2.5, 3.5, 4.5}] 
 
 
gives 
 
{0, 2, 2, 4, 4} 
 
 
What's the  ... 
 
- asked by wxffles (26 votes), answered by Per Alexandersson (22 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Sizing elements correctly in a DistributionChart with custom 
ChartElementFunction]\url{http://mathematica.stackexchange.com/questions/65 
395/sizing-elements-correctly-in-a-distributionchart-with-custom-chartel 
ementfunctio} 
 
This is a follow-up question to Histogram scale error when using 
DistributionChart; Weird output of DistributionChart is also related. 
I'd like to make a DistributionChart where the elements are  ... 
 
- asked by Daniel Weissman (1 vote) 
 
---------------------------- 
 
[Capturing microphone 
data]\url{http://mathematica.stackexchange.com/questions/65276/capturing-mi 
crophone-data} 
 
How to capture current microphone data, just like using the function 
CurrentImage[] for capturing image? 
 
For example, this captures an image: 
 
Dynamic [x = CurrentImage []; EdgeDetect [x, 3]] 
 
 
But I  ... 
 
- asked by Dragan Mrakovic (3 votes) 
 
---------------------------- 
 
[How to download and combine S&P 500 stock 
prices]\url{http://mathematica.stackexchange.com/questions/65386/how-to-dow 
nload-and-combine-sp-500-stock-prices} 
 
I want to download historical S&P 500 stock prices and combined them 
into one big file, having only one column of date referencing all 
stocks. Here is what I have do so far. 
 
stdate =  ... 
 
- asked by rka (5 votes)

7.9 Tuesday, November 4, 2014

================================== 
Top new questions this week: 
================================== 
 
[DumpsterDoofus's captivating generative 
art]\url{http://mathematica.stackexchange.com/questions/64492/dumpsterdoofu 
ss-captivating-generative-art} 
 
How can I render these beautiful images that DumpsterDoofus posted? 
 
- asked by Mr.Wizard (23 votes), answered by DumpsterDoofus (24 votes) 
 
---------------------------- 
 
[Is there an easy way to use Matteo Niccoli's perceptual color maps for 
2D plots in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/64513/is-t 
here-an-easy-way-to-use-matteo-niccolis-perceptual-color-maps-for-2d-plo 
ts} 
 
I have been using the ubiquitous Jet color palette for 2D plots for some 
time now, and don't really care for it.  Then I came across the series 
of blog posts, The rainbow is dead...long live the  ... 
 
- asked by Jason B (22 votes), answered by Jason B (20 votes) 
 
---------------------------- 
 
[How to wrap a plot around a 
circle?]\url{http://mathematica.stackexchange.com/questions/64534/how-to-wr 
ap-a-plot-around-a-circle} 
 
Consider the code 
 
a = Table[BesselJ[i, x], {i, 0, 3}] 
Plot[a, {x, 0, 20}, Axes -> False] 
 
 
producing 
 
 
 
I'd like to transform the plot into a circle. In other words, I'd like 
to wrap the plot  ... 
 
- asked by Sigur (14 votes), answered by Junho Lee (15 votes) 
 
---------------------------- 
 
[Which Mathematica function has the longest name (by character 
length?)]\url{http://mathematica.stackexchange.com/questions/64718/which-ma 
thematica-function-has-the-longest-name-by-character-length} 
 
I came across DamerauLevenshteinDistance[u,v] in the documentation 
center so that got me thinking: 
 
Which documented Mathematica function has the longest name? 
 
Also, is there is a limit to the length  ... 
 
- asked by QuantumDot (11 votes), answered by Artes (18 votes) 
 
---------------------------- 
 
[Phase portrait on a 
cylinder]\url{http://mathematica.stackexchange.com/questions/64407/phase-po 
rtrait-on-a-cylinder} 
 
It is very nice and very easy to make a sketch of a phase portrait with 
StreamPlot. For example, for the classical pendulum, defined by 
$$ 
\dot x=y,\\ 
\dot y=-\sin x, 
$$ 
The code 
 
StreamPlot[{y,  ... 
 
- asked by Artem (10 votes), answered by Kuba (12 votes) 
 
---------------------------- 
 
[Why does the documentation call functions 
"pure"?]\url{http://mathematica.stackexchange.com/questions/64577/why-does- 
the-documentation-call-functions-pure} 
 
Clearly, functions in mathematica are not pure functions according to 
the definition on Wikipedia (no side effects - basically implementabe 
with table lookups): 
 
x = 4; 
y = 1; 
a = Function[y = 0; x +  ... 
 
- asked by masterxilo (9 votes), answered by WReach (7 votes) 
 
---------------------------- 
 
[Rasterize: Resolution option not working 
properly]\url{http://mathematica.stackexchange.com/questions/64758/rasteriz 
e-resolution-option-not-working-properly} 
 
Something about Rasterize which doesn't seem to work as intended. 
 
Recipe: 
 
 
Make some simple vector graphics: 
 
Test = Graphics[Circle[{0, 0} 1]] 
 
Try to rasterize it having defined ImageSize and  ... 
 
- asked by Alexey Bobrick (8 votes), answered by Alexey Popkov (5 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[How can I draw the Olympic rings with 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/8885/how-c 
an-i-draw-the-olympic-rings-with-mathematica} 
 
How can I draw the 5 interlocking Olympic rings with Mathematica? 
 
 
 
(SVG version) 
 
 
 
Edit 
 
Hard choice, but some pretty cool answers here. I didn't have 3D answers 
in mind when I posted the question  ... 
 
- asked by Mike Honeychurch (33 votes), answered by cormullion (15 
votes) 
 
---------------------------- 
 
[Why round to even 
integers?]\url{http://mathematica.stackexchange.com/questions/2116/why-roun 
d-to-even-integers} 
 
According to the Mathematica help: 
 
 
Round rounds numbers of the form x.5 toward the nearest even integer. 
 
 
For example: 
 
Round[{0.5, 1.5, 2.5, 3.5, 4.5}] 
 
 
gives 
 
{0, 2, 2, 4, 4} 
 
 
What's the  ... 
 
- asked by wxffles (26 votes), answered by Per Alexandersson (22 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Dependent probabilities 
distributions?]\url{http://mathematica.stackexchange.com/questions/64719/de 
pendent-probabilities-distributions} 
 
What's the best way to model situations with dependencies--I pick a 
world state, then pick a distribution to draw samples from based on that 
state. Here's a concrete version: 
 
 
If I choose a 6-sided  ... 
 
- asked by Victor Shnayder (1 vote) 
 
---------------------------- 
 
[How to get data from DB into dataset with 
keys]\url{http://mathematica.stackexchange.com/questions/64391/how-to-get-d 
ata-from-db-into-dataset-with-keys} 
 
I'm a Mathematica newbie and I have the following problem: I connect to 
a Oracle DB and read out a set of variables, further on I want to 
histogram some of the variables. A Dataset seems to be the  ... 
 
- asked by Lea (4 votes) 
 
---------------------------- 
 
[Max iterations in K-means clustering 
algorithm]\url{http://mathematica.stackexchange.com/questions/64343/max-ite 
rations-in-k-means-clustering-algorithm} 
 
I want to use k-means for clustering. I have used the 
ClusteringComponents function but I said how can I control the 
max-iteration for k-means ? 
 
 
- asked by Developer2000 (2 votes) 

7.10 Tuesday, October 28, 2014

================================== 
Top new questions this week: 
================================== 
 
[Why do big-O terms disappear in definite integrals since Mathematica 
9?]\url{http://mathematica.stackexchange.com/questions/64318/why-do-big-o-t 
erms-disappear-in-definite-integrals-since-mathematica-9} 
 
In Mathematica 8, when I computed the following input: 
 
Integrate[Series[Cos[x], {x, 0, 2}], {x, 0, a}] 
 
 
Mathematica returned an expression that had a O[a^4] in it. (In other 
words, the result had  ... 
 
- asked by Martin J.H. (4 votes) 
 
---------------------------- 
 
[How to track Part of Symbol or How to symbolize Parts of Symbol without 
copying 
data]\url{http://mathematica.stackexchange.com/questions/64312/how-to-track 
-part-of-symbol-or-how-to-symbolize-parts-of-symbol-without-copying} 
 
Let's create simple function: 
 
SetAttributes[h, HoldFirst]; 
h[data_] := Dynamic[Grid[data], TrackedSymbols :> {data}] 
 
test = RandomReal[1, {2, 2}]; 
h[test] 
 
 
Now you can evaluate somewhere else: 
 
... 
 
- asked by Kuba (1 vote) 
 
---------------------------- 
 
[Unimportant change in 
Dynamic]\url{http://mathematica.stackexchange.com/questions/64310/unimporta 
nt-change-in-dynamic} 
 
I just observed an unimportant change in version 10 with respect to 
Dynamic. 
 
The command 
 
x=0; Dynamic[x=x+1] 
 
 
returns a cell showing an infinite loop for the value of x. 
 
Before Mathematica 10,  ... 
 
- asked by Fred Simons (2 votes) 
 
---------------------------- 
 
[Classify Function : Sentiment 
Polarity]\url{http://mathematica.stackexchange.com/questions/64306/classify 
-function-sentiment-polarity} 
 
I have been working on a project involving the new Classify[] function. 
More specifically, the sentiment analysis function. 
It works perfectly well, as in the documentation: 
 
Classify["Sentiment", {  ... 
 
- asked by afentis (1 vote), answered by rcollyer (0 votes) 
 
---------------------------- 
 
[User defined functions and decimal places 
displayed]\url{http://mathematica.stackexchange.com/questions/64284/user-de 
fined-functions-and-decimal-places-displayed} 
 
I have a couple of complicated user-defined functions, one which calls 
the other, and I wish to control the number of decimal places displayed 
when I call the "mother" function. I have tried the  ... 
 
- asked by Freakalien (1 vote), answered by Mr.Wizard (1 vote) 
 
---------------------------- 
 
[aligning the axeslabel in a 3D list 
plot]\url{http://mathematica.stackexchange.com/questions/64280/aligning-the 
-axeslabel-in-a-3d-list-plot} 
 
I have the following code 
 
plot = ListPlot3D[mydata5, DataRange -> {{0, 6}, {0, 6}}, 
PerformanceGoal -> "Quality", BoxRatios -> {1, 1, .7}, AxesLabel 
-> {Style[Subscript[t, l], FontSize  ... 
 
- asked by Seyhmus Gungoren (1 vote), answered by xzczd (1 vote) 
 
---------------------------- 
 
[Solving system of differential equations using 
loops]\url{http://mathematica.stackexchange.com/questions/64278/solving-sys 
tem-of-differential-equations-using-loops} 
 
I have $F$ system of differential equations. Out of those $F$ equations 
except for first and last I have general form for the remaining 
equations (say $ dP_{i}/dt)$. 
Let $dP_0/dt,dP_F/dt$  denotes the  ... 
 
- asked by user1659936 (1 vote), answered by Michael E2 (1 vote) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Implementing efficient multiple 
undo]\url{http://mathematica.stackexchange.com/questions/1953/implementing- 
efficient-multiple-undo} 
 
At the time this question was asked, version 10 was not out yet. The 
Front End of Mathematica 10 does have multiple undo, see the answer by 
John Fultz. 
 
The Mathematica Front End's built-in Undo  ... 
 
- asked by Rojo (111 votes), answered by John Fultz (34 votes) 
 
---------------------------- 
 
[Programming paradigm 
change]\url{http://mathematica.stackexchange.com/questions/45829/programmin 
g-paradigm-change} 
 
I'm new to Mathematica, I've been learning by myself, and, being a Java 
developer for some time, it makes it hard to adapt. 
 
I've tried to solve a Reddit challenge, and I came up with this 
solution: 
 
... 
 
- asked by MHero (29 votes), answered by WReach (49 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[FindSequenceFunction for sum of hypergeometric 
terms]\url{http://mathematica.stackexchange.com/questions/64168/findsequenc 
efunction-for-sum-of-hypergeometric-terms} 
 
Mathematica's built-in function FindSequenceFunction is quite good at 
recognizing hypergeometric terms, i.e. terms $c_k$ for which 
$c_{k+1}/c_k$ is a rational function of $k$. 
 
For instance. 
 
... 
 
- asked by Eckhard (4 votes) 
 
---------------------------- 
 
[Finding the minimum vertex cut of a 
graph]\url{http://mathematica.stackexchange.com/questions/63783/finding-the-minimum-vertex-cut-of-a-graph} 
 
It seems that Mathematica is not correctly finding the smallest set of 
vertices that will disconnect a graph. Here is an example: 
 
g = GraphData[{"Cycle", 5}] 
FindVertexCut[g]; 
HighlightGraph[g, %] 
... 
 
- asked by Lonely Mathematician (3 votes) 
 
---------------------------- 
 
[NMaximize gives wrong answer when using high 
precision] 
\url{http://mathematica.stackexchange.com/questions/64256/nmaximize-gives-wrong-answer-when-using-high-precision} 
 
I'm using NMaximize to find the maximum of a function under constrain, 
but it seems to gives wrong answer when using high precisions. 
 
f[t_, t1_] := (Cos[2 Pi t] - Cos[2 Pi t1] + 2 Pi (t - t1) Sin[2 Pi  ... 
 
- asked by xslittlegrass (1 vote) 

7.11 Tuesday, October 21, 2014

================================== 
Top new questions this week: 
================================== 
 
[Total much slower in version 
10]\url{http://mathematica.stackexchange.com/questions/63209/total-much-slo 
wer-in-version-10} 
 
Compilation nowadays may give very fast functions. Here is an example 
for finding the sum of a list of machine numbers, just as the built-in 
function Total: 
 
myTotal =   Compile[{{lst, _Real, 1}}, 
... 
 
- asked by Fred Simons (15 votes), answered by Karsten 7. (5 votes) 
 
---------------------------- 
 
[Drawing the schematic diagram of 
algorithm]\url{http://mathematica.stackexchange.com/questions/63471/drawing 
-the-schematic-diagram-of-algorithm} 
 
The B-Spline function used the alogrithm as shown below: 
 
 
 
 
 
I would like to draw it in Mathematica (Although this is my first time 
to use TreePlot) 
 
TreePlot[ 
{1 -> 2, 1 -> 3, 2 -> 4,  ... 
 
- asked by ShutaoTang (14 votes), answered by kguler (9 votes) 
 
---------------------------- 
 
[How can I evaluate only a single step of a recursive 
function?]\url{http://mathematica.stackexchange.com/questions/63256/how-can 
-i-evaluate-only-a-single-step-of-a-recursive-function} 
 
Let's say have a simple recursive function for the Fibonacci sequence 
 
f[0] := 1 
f[1] := 1 
f[n_] := f[n - 1] + f[n - 2] 
 
 
but I want to see how it will expand in a given number of steps, but not 
all  ... 
 
- asked by Jakub Arnold (12 votes), answered by Daniel Lichtblau (16 
votes) 
 
---------------------------- 
 
[How to build a 3D graph from a 3D 
matrix?]\url{http://mathematica.stackexchange.com/questions/63428/how-to-bu 
ild-a-3d-graph-from-a-3d-matrix} 
 
Following this 
and that question 
and the corresponding answers, Mathematica can build 2D graph from 2D 
matrices. 
 
 
 
Question 
 
 
How to make the corresponding 3D graphs from 3D cubes? 
 
 
Attempt 
 
... 
 
- asked by chris (11 votes), answered by kguler (5 votes) 
 
---------------------------- 
 
[Listable functions thread over Associations; is this 
documented?]\url{http://mathematica.stackexchange.com/questions/63293/lista 
ble-functions-thread-over-associations-is-this-documented} 
 
Thanks to a somewhat misapplied use of MapThread I learned of this 
behavior: 
 
<|a -> 1, b -> 2|> + <|a -> 5, b -> 6|> 
 
 
 
<|a -> 6, b -> 8|> 
 
 
 
Furthermore this  ... 
 
- asked by Mr.Wizard (10 votes), answered by m_goldberg (3 votes) 
 
---------------------------- 
 
[Bug(?) in version 10: Tooltip and 
ListPointPlot3D]\url{http://mathematica.stackexchange.com/questions/63667/b 
ug-in-version-10-tooltip-and-listpointplot3d} 
 
Bug introduced in 10.0.0 
 
 
 
The coordinates of a point in a three dimensional graph can be shown in 
a tooltip: 
 
ListPointPlot3D[Tooltip[RandomReal[{0, 1}, {50, 3}]], PlotStyle -> 
{PointSize[.02]}] 
 
... 
 
- asked by Fred Simons (9 votes) 
 
---------------------------- 
 
[How to align rotated BarChart 
labels?]\url{http://mathematica.stackexchange.com/questions/63263/how-to-al 
ign-rotated-barchart-labels} 
 
I'd like to use long text labels for a simple BarChart, but when I apply 
a rotation to label strings with different lengths the end of the text 
is no longer aligned with the bars in the chart: 
 
... 
 
- asked by dionys (9 votes), answered by Brett Champion (10 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[How to make use of 
Associations?]\url{http://mathematica.stackexchange.com/questions/52393/how 
-to-make-use-of-associations} 
 
I have been curious about it for long. Now that Mathematica 10 arrives, 
I think it's time to ask the question: How the new Association data 
structure would be used to improve Mathematica programming? 
 
... 
 
- asked by Yi Wang (53 votes), answered by Leonid Shifrin (54 votes) 
 
---------------------------- 
 
[Programming paradigm 
change]\url{http://mathematica.stackexchange.com/questions/45829/programmin 
g-paradigm-change} 
 
I'm new to Mathematica, I've been learning by myself, and, being a Java 
developer for some time, it makes it hard to adapt. 
 
I've tried to solve a Reddit challenge, and I came up with this 
solution: 
 
... 
 
- asked by MHero (28 votes), answered by WReach (48 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Visualise sets giving some relations on those 
sets]\url{http://mathematica.stackexchange.com/questions/63391/visualise-se 
ts-giving-some-relations-on-those-sets} 
 
I'm not very experienced with wolfram, but I'm searching for a function 
that can basicly do the following. 
 
Giving some sets $A,B,C$ and some relations for example $B \subset 
A$,$C\subset B$. I would  ... 
 
- asked by Kasper (1 vote) 
 
---------------------------- 
 
[StyleSheet for custom 
application]\url{http://mathematica.stackexchange.com/questions/63313/style 
sheet-for-custom-application} 
 
I'm working on a package that for some reasons needs to be installed 
into a "non standard" path, that means neither $BaseDirectory or 
$UserBaseDirectory 
I added the package's path to the variable   ... 
 
- asked by bobknight (1 vote) 
 
---------------------------- 
 
[ListContourPlot in 
V10]\url{http://mathematica.stackexchange.com/questions/63653/listcontourpl 
ot-in-v10} 
 
It seems that I obtain different results when using ListContourPlot 
under V9 and V10. 
 
Using this datafile http://pastebin.com/2p4ew0NJ (modified to use 
pastebin), this code: 
 
ListContourPlot[cm,  ... 
 
- asked by alessandro (1 vote)

7.12 Tuesday, October 14, 2014

================================== 
Top new questions this week: 
================================== 
 
[Assign a randomly generated list to 
variable]\url{http://mathematica.stackexchange.com/questions/62921/assign-a 
-randomly-generated-list-to-variable} 
 
I don't know if this is a silly question, but it really baffles me. So 
please help me understand this behavior. 
 
list=RandomInteger[100,100] 
 
 
I interpret the (silly) code above as randomly generating  ... 
 
- asked by Naitree (19 votes), answered by rhermans (5 votes) 
 
---------------------------- 
 
[Dataset seems unable to handle ListDensityPlot and 
ListContourPlot]\url{http://mathematica.stackexchange.com/questions/61572/d 
ataset-seems-unable-to-handle-listdensityplot-and-listcontourplot} 
 
If I create a Dataset: 
 
dataSet = Dataset[ 
AssociationThread[{"a", "b", "c", "d", "e"} -> #] & /@ 
RandomReal[{-1, 1}, {1000, 5}] 
]; 
 
 
It should be easy to use a plotting function on it 
 
... 
 
- asked by gpap (15 votes), answered by RunnyKine (14 votes) 
 
---------------------------- 
 
[Make my data-structure 
atomic]\url{http://mathematica.stackexchange.com/questions/61587/make-my-da 
ta-structure-atomic} 
 
Lately, and by lately I mean since version 7 or so, the number of atomic 
expressions in Mathematica constantly grew. In former times only the 
native types like integers and optimised arrays were  ... 
 
- asked by halirutan (14 votes), answered by Leonid Shifrin (10 votes) 
 
---------------------------- 
 
[Applying different functions to different columns of a 
Dataset]\url{http://mathematica.stackexchange.com/questions/61710/applying- 
different-functions-to-different-columns-of-a-dataset} 
 
Suppose I have different functions: Total, Mean and Max and the 
following Dataset 
 
SeedRandom[0] 
dataSet = Dataset[AssociationThread[{"a", "b", "c", "d"} -> #] & 
/@ RandomReal[4, {10, 4}]] 
 
 
 
 
... 
 
- asked by smayhem (13 votes), answered by RunnyKine (9 votes) 
 
---------------------------- 
 
[Sorting Lists of lists of arbitrary 
length]\url{http://mathematica.stackexchange.com/questions/61560/sorting-li 
sts-of-lists-of-arbitrary-length} 
 
I'm trying to sort a list of lists.  The sublists are defined in length, 
but the length of the list containing it varies. 
 
A simplified set might be: 
 
{{1, 2, 3}, {7, 1, 4}, {3, 5, 6}, {10, 7, 1}} 
 
 
... 
 
- asked by Rick R (10 votes), answered by RunnyKine (11 votes) 
 
---------------------------- 
 
[Best way to find permutation with specific 
total]\url{http://mathematica.stackexchange.com/questions/62956/best-way-to 
-find-permutation-with-specific-total} 
 
Can anyone suggest a good way to find permutations of 12 digits, 0 to 4, 
totalling 24. 
 
I.e. two such permutations:- 
 
{2, 1, 4, 1, 2, 2, 2, 2, 2, 2, 1, 3} // Total 
 
 
 
24 
 
 
{4, 4, 4, 4, 4, 4, 0, 0,  ... 
 
- asked by Chris Degnen (9 votes), answered by thils (6 votes) 
 
---------------------------- 
 
[Segmentation of a microscopy image with uneven 
illumination]\url{http://mathematica.stackexchange.com/questions/62976/segm 
entation-of-a-microscopy-image-with-uneven-illumination} 
 
I am trying to do a little image segmentation on some cells taken from 
microscopy images that have uneven illumination.  I am having trouble 
getting the background of the image cleaned up after  ... 
 
- asked by user13999 (9 votes), answered by bobthechemist (4 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Alternatives to procedural loops and iterating over lists in 
Mathematica]\url{http://mathematica.stackexchange.com/questions/7924/altern 
atives-to-procedural-loops-and-iterating-over-lists-in-mathematica} 
 
While there are some cases where a For loop might be reasonable, it's a 
general mantra  one I subscribe to myself  that "if you are using a 
For loop in Mathematica, you are probably doing it wrong".  ... 
 
- asked by Mr.Wizard (91 votes), answered by Mr.Wizard (59 votes) 
 
---------------------------- 
 
[How to make use of 
Associations?]\url{http://mathematica.stackexchange.com/questions/52393/how 
-to-make-use-of-associations} 
 
I have been curious about it for long. Now that Mathematica 10 arrives, 
I think it's time to ask the question: How the new Association data 
structure would be used to improve Mathematica programming? 
 
... 
 
- asked by Yi Wang (53 votes), answered by Leonid Shifrin (54 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Error messages from TensorContract and 
TensorReduce]\url{http://mathematica.stackexchange.com/questions/61719/erro 
r-messages-from-tensorcontract-and-tensorreduce} 
 
I am struggling with a few errors when using symbolic tensors. 
I am using mathematica 9.0.1.0, linux x86. 
 
The following code generates what seems to me an incorrect tensor, this 
is the smallest  ... 
 
- asked by Artur Gower (4 votes) 
 
---------------------------- 
 
[Oddify an even function and vice 
versa?]\url{http://mathematica.stackexchange.com/questions/62957/oddify-an- 
even-function-and-vice-versa} 
 
I want to know how to construct a function in Mathematica which would 
produce even analog of odd function and vice versa in closed form? 
 
The mathematical definitions are as follows: 
 
... 
 
- asked by Anixx (2 votes) 
 
---------------------------- 
 
[Create SQL Database on a manually specified 
directory]\url{http://mathematica.stackexchange.com/questions/61568/create- 
sql-database-on-a-manually-specified-directory} 
 
I am inserting lots of data into the preinstalled SQL Database in MM: 
 
con= OpenSQLConnection["demo"] > SQLCreateTable[con, 
SQLTable["anyname"], SQLcolums] > ... 
 
I am running out of disk space on my  ... 
 
- asked by Patrick Bernhard (2 votes) 

7.13 Tuesday, October 7, 2014

================================== 
Top new questions this week: 
================================== 
 
[Visualisation of a recursive 
function]\url{http://mathematica.stackexchange.com/questions/61323/visualis 
ation-of-a-recursive-function} 
 
Is there a way to nicely visualize recursive functions? (diagrams/plots) 
 
More specifically I'm looking for a way to make contrast (visually) 
between e.g. the cosine function which if continuously  ... 
 
- asked by Phonon (16 votes), answered by ybeltukov (23 votes) 
 
---------------------------- 
 
[Using an Image as the Fill/Texture (not background) of a Plot (not 
polygon)]\url{http://mathematica.stackexchange.com/questions/61341/using-an 
-image-as-the-fill-texture-not-background-of-a-plot-not-polygon} 
 
Is it possible to use an image, rather than a color, or ColorFunction, 
as the filling for a plot? 
 
For instance, I want to make a plot using DateListPlot, and have set 
Filling->Axis, and would like  ... 
 
- asked by iwantmyphd (11 votes), answered by Jens (4 votes) 
 
---------------------------- 
 
[Intelligently formatting 
PDFs]\url{http://mathematica.stackexchange.com/questions/61209/intelligentl 
y-formatting-pdfs} 
 
I'm exporting a Grid[] to a PDF. It's working, but it's real ugly. Here 
is an example of what it looks like: 
 
 
 
Possibly the first problem is the reason I posted a picture of (rather 
than sharing) the  ... 
 
- asked by F dot Floss (11 votes), answered by Lou (5 votes) 
 
---------------------------- 
 
[How to show matrix multiplication step by 
step?]\url{http://mathematica.stackexchange.com/questions/61377/how-to-show 
-matrix-multiplication-step-by-step} 
 
Given a matrix, A: 
 
A = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; 
 
 
How can I do the matrix multiplication A times A step by step? 
 
 
- asked by Mats Granvik (8 votes), answered by ybeltukov (22 votes) 
 
---------------------------- 
 
[How to deal with recursion formula in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/61050/how- 
to-deal-with-recursion-formula-in-mathematica} 
 
In engineering problems, I am always seeing many recursion formula. 
 
For instance, In the book "The NURBS book", I discovered many recursion 
formula 
 
 
Fibonacci $$f(n+2)=f(n+1)+f(n)$$ 
deCasteljau  ... 
 
- asked by Tangshutao (8 votes), answered by Igor Rivin (6 votes) 
 
---------------------------- 
 
[Is there a way to revert to the built-in function after overwritting it 
using 
Unprotect]\url{http://mathematica.stackexchange.com/questions/61472/is-ther 
e-a-way-to-revert-to-the-built-in-function-after-overwritting-it-using-u 
n} 
 
When using Unprotect, we can overwrite a functions definition: 
 
Unprotect[Sqrt] 
Sqrt[x_]="blahblah" 
Protect[Sqrt] 
 
 
Once this is done, can we revert to the built-in version of Sqrt? 
 
 
- asked by user13675 (7 votes), answered by eldo (8 votes) 
 
---------------------------- 
 
[Why PlotStyle->Dashed make everything 
dashed?]\url{http://mathematica.stackexchange.com/questions/61058/why-plots 
tyle-dashed-make-everything-dashed} 
 
Bug introduced in 10.0.0 -- appears to affect Linux only. 
 
 
 
It has been really strange for me. I am not sure it's regression after 
v10.0.1, or something went wrong with my system. After running this  ... 
 
- asked by Yi Wang (7 votes), answered by Neven Caplar (2 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 (109 votes), answered by Todd Allen (159 votes) 
 
---------------------------- 
 
[How should I reproduce this colorful swirling 
gif?]\url{http://mathematica.stackexchange.com/questions/47597/how-should-i 
-reproduce-this-colorful-swirling-gif} 
 
Surfing on the web, I came upon this cool gif: 
 
 
 
Does any one know how to reproduce this in Mathematica? I have some 
ideas myself, so I will try to answer this question as well. 
 
 
- asked by Ali (10 votes), answered by Kuba (23 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[How to update bundled SQLite library (or driver?) in V10 for OS 
X]\url{http://mathematica.stackexchange.com/questions/61116/how-to-update-b 
undled-sqlite-library-or-driver-in-v10-for-os-x} 
 
I've been using undocumented Database functions with Mathematica V9 to 
acces my SQLite database, which is a Firefox-generated database that 
contains cookies. 
 
db = Database`OpenDatabase[ 
... 
 
- asked by shrx (3 votes) 
 
---------------------------- 
 
[Is it possible to implement symbolic sub 
matrices?]\url{http://mathematica.stackexchange.com/questions/61442/is-it-p 
ossible-to-implement-symbolic-sub-matrices} 
 
The accepted answer in the following link: 
 
http://stackoverflow.com/questions/5708208/symbolic-matrices-in-mathemat 
ica-with-unknown-dimensions 
 
provides a functionality to create symbolic matrices  ... 
 
- asked by Kagaratsch (1 vote) 
 
---------------------------- 
 
[Format Mathematica complex number for fortran code 
use]\url{http://mathematica.stackexchange.com/questions/61432/format-mathem 
atica-complex-number-for-fortran-code-use} 
 
I'm using Mathematica 10. I am trying to write into a file complex 
number output to then be read by a Fortran code. 
 
But when I do : 
 
Print[comp, "  ", FortranForm[comp]] 
 
 
I get this : 
 
 
... 
 
- asked by berhan (1 vote)

7.14 Tuesday, September 30, 2014

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

[Join lists with nested list] http://mathematica.stackexchange.com/questions/60666/join-lists-with-nested-list

Is there a way of smarter way of joining list of the form

l1 = a,b,c; l2 = d,e,f; l3 = g,h,i;

To obtain

a,d,g,b,c,e,f,h,i

The code I have is

{Sequence @@ #1, Flatten[#2]}  ...

- asked by mete (14 votes), answered by Junho Lee (9 votes)

—————————-

[Different results between V9 and V10 when using Style with Listplot]http://mathematica.stackexchange.com/questions/60929/different-results-between-v9-and-v10-when-using-style-with-listplot

Consider this example:

data = Table[{x, x^2}, {x, -2, 2, 0.1}]; 
ListPlot[Style[{#1, #2}, PointSize[Abs[#2]/50], Hue[#2]] & @@@ data]

the results from V9 and V10 are as follows:

V9

V10

It ...

- asked by Algohi (13 votes), answered by Brett Champion (7 votes)

—————————-

[Bug in Operator Form of StringCases]http://mathematica.stackexchange.com/questions/60871/bug-in-operator-form-of-stringcases

According to the documentation there’s an operator form for StringCases

?StringCases

Here is the normal form

StringCases["abcadcacb", "a" ~~ x_ ~~ "c"] 
 
 
 
{"abc", "adc"}

Now, the operator ...

- asked by RunnyKine (12 votes), answered by WReach (8 votes)

—————————-

[Around the Clock]http://mathematica.stackexchange.com/questions/60728/around-the-clock

I want to produce with Mathematica something like this

Or this

12 hours should be arranged in a pleasing ("rotated") style around / within a rectangle. I don’t ask for the hands - depending on ...

- asked by eldo (12 votes), answered by belisarius (15 votes)

—————————-

[How to assign a list of numbers into letter grades]http://mathematica.stackexchange.com/questions/60497/how-to-assign-a-list-of-numbers-into-letter-grades

Here is my list:

collection = 76.6256, 51.9264, 50.238, 14.4203, 80.9205, 12.2036, 2.39568, 38.2747, 12.4422, 29.9621

collection /. {x_ /; x < 50 -> "F"}

and this gives me

...

- asked by Lonely Mathematician (12 votes), answered by belisarius (14 votes)

—————————-

[Joining ordered set of points with splines in spiral]http://mathematica.stackexchange.com/questions/60619/joining-ordered-set-of-points-with-splines-in-spiral

I have a collection of points

-0.137445, -0.0103507, -0.0452845, 0.0343154, 0.30498, -0.0118266, -0.0224633, 0.0197979, -0.168469, -0.0197066, 0.0973217, 0.0478612, -0.0441388, ...

- asked by martin (11 votes), answered by Rahul Narain (11 votes)

—————————-

[Fitting ellipse to 5 given points on the plane]http://mathematica.stackexchange.com/questions/60779/fitting-ellipse-to-5-given-points-on-the-plane

Five points are required to define a unique ellipse. An ellipse has five degrees of freedom: the \(x\) and \(y\) coordinates of each focus, and the sum of the distance from each focus to a point on the ...

- asked by user153012 (11 votes), answered by Mark McClure (21 votes)

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

[Efficient way to build a certain quadratic matrix]http://mathematica.stackexchange.com/questions/51798/efficient-way-to-build-a-certain-quadratic-matrix

For odd n I’m looking for a short and swift way to construct with (f.e.)

n = 3

n = 11

n=1111

- asked by eldo (15 votes), answered by RunnyKine (15 votes)

—————————-

[Finding all simple paths between two vertices in a graph]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 (11 votes), answered by trybik (10 votes)

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

[Weird glitch again!]http://mathematica.stackexchange.com/questions/60623/weird-glitch-again

I have been struggling with these glitches for two days...

A related question I asked is here How to eliminate the white gaps in the graph

Here is the code,

Show[Plot[Sin[x], x, -2 Pi, 2 Pi, ...

- asked by Tony (2 votes)

—————————-

[How to solve a PDE with Robin Boundary Condition inside considered region?]http://mathematica.stackexchange.com/questions/60890/how-to-solve-a-pde-with-robin-boundary-condition-inside-considered-region

I’m trying to solve the heat diffusion equation in cylindrical coordinates. The main problem is that I would like to include the Robin Boundary Condition inside considered region in order to simulate ...

- asked by Jerry (1 vote)

—————————-

[FITS metadata problem]http://mathematica.stackexchange.com/questions/60639/fits-metadata-problem

Looks to me that the FITS Export is borged. Here is the problem:

When I export out images with accustom metadata into a FITS file, Mathematica truncates and overwrites it.

Here is the metadata I ...

- asked by infocean (1 vote)

7.15 Tuesday, September 23, 2014

================================== 
Top new questions this week: 
================================== 
 
[Maple vs. 
Mathematica]\url{http://mathematica.stackexchange.com/questions/60124/maple 
-vs-mathematica} 
 
I am reading the document "How Maple Compares to Mathematica" found at 
http://www.maplesoft.com/products/maple/compare/HowMapleComparestoMathem 
atica.pdf. 
 
On page 15 there is an example where  ... 
 
- asked by Milenko Rubin-Zuzic (16 votes), answered by Mr.Wizard (22 
votes) 
 
---------------------------- 
 
[StringCases is Confused with Patterns in Version 
10.0.1]\url{http://mathematica.stackexchange.com/questions/60156/stringcase 
s-is-confused-with-patterns-in-version-10-0-1} 
 
I observed the following with StringCases when trying to use 
rules/patterns. Here is a screenshot of the behavior: 
 
 
 
Not only is the pattern highlighted in red, hovering the mouse over it 
claims it's  ... 
 
- asked by RunnyKine (14 votes) 
 
---------------------------- 
 
[How can I restore the old `ImageCompose` 
behaviour?]\url{http://mathematica.stackexchange.com/questions/60048/how-ca 
n-i-restore-the-old-imagecompose-behaviour} 
 
Prior to version 10, if ImageCompose was used to overlay a partially 
transparent image region over a completely transparent image region, the 
result would keep the colour of the overlay. Like this: 
 
 
 
... 
 
- asked by Simon Woods (13 votes), answered by Karsten 7. (3 votes) 
 
---------------------------- 
 
[Better way to test that a matrix is 
upper-triangular?]\url{http://mathematica.stackexchange.com/questions/60081 
/better-way-to-test-that-a-matrix-is-upper-triangular} 
 
Today, I got to thinking about how to test that a matrix was 
upper-triangular. So I had a try at it. 
 
Algorithm 
 
$\quad \quad a_{ij}=0 $  Or  $i \leq j$  $\Rightarrow$  $True$ 
 
My solution is 
 
... 
 
- asked by Tangshutao (13 votes), answered by Mr.Wizard (9 votes) 
 
---------------------------- 
 
[How to get Company Logo or 
Image]\url{http://mathematica.stackexchange.com/questions/60041/how-to-get- 
company-logo-or-image} 
 
I can see that companies have a logo in Wolfram|Alpha when I type in 
their name but I can't get them in Mathematica. 
 
For example searching for Apple, Inc. in W|A one of the outputs is the 
Apple logo.  ... 
 
- asked by Edmund (12 votes), answered by eldo (15 votes) 
 
---------------------------- 
 
[How to make a 3D topographic 
globe?]\url{http://mathematica.stackexchange.com/questions/60427/how-to-mak 
e-a-3d-topographic-globe} 
 
I've made some attempt with this dataset of elevation. 
 
But I have some trouble with ListSurfacePlot3D, which can not show the 
globe correctly: 
 
 
And I've checked that the data is out of problem,  ... 
 
- asked by RexDiego (11 votes), answered by bobthechemist (10 votes) 
 
---------------------------- 
 
[Is there a better way to "grow" black 
tulips?]\url{http://mathematica.stackexchange.com/questions/59905/is-there- 
a-better-way-to-grow-black-tulips} 
 
I used the following clumsy way to obtain a bundle of black tulips. Is 
there a better way to do so? 
 
im = Import["http://i.stack.imgur.com/qclHT.jpg"] 
 
cols = DominantColors[im, 9] 
rim1 =  ... 
 
- asked by Putterboy (11 votes), answered by ybeltukov (17 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Can Mathematica do symbolic linear 
algebra?]\url{http://mathematica.stackexchange.com/questions/3242/can-mathe 
matica-do-symbolic-linear-algebra} 
 
For instance, is there some way I can say "let A and B be arbitrary real 
$m\times n$ and $k\times m$ matrices, 
Simplify[Transpose[Transpose[A].Transpose[B]]]" and Mathematica would 
simplify it to B.A? 
... 
 
- asked by nikie (24 votes), answered by helen (12 votes) 
 
---------------------------- 
 
[Why round to even 
integers?]\url{http://mathematica.stackexchange.com/questions/2116/why-roun 
d-to-even-integers} 
 
According to the Mathematica help: 
 
 
Round rounds numbers of the form x.5 toward the nearest even integer. 
 
 
For example: 
 
Round[{0.5, 1.5, 2.5, 3.5, 4.5}] 
 
 
gives 
 
{0, 2, 2, 4, 4} 
 
 
What's the  ... 
 
- asked by wxffles (26 votes), answered by Per Alexandersson (22 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Solving a system of two nonlinear equations with many symbolic 
parameters]\url{http://mathematica.stackexchange.com/questions/59930/solvin 
g-a-system-of-two-nonlinear-equations-with-many-symbolic-parameters} 
 
I have two nonlinear equations with two unknowns, $x$ and $y$, and many 
symbolic parameters, $a, b, c, d$. They look someting like: 
 
$\frac{1}{x}(1+x)^a (1-b)(cx+dy)=0$ 
 
... 
 
- asked by jim (2 votes) 
 
---------------------------- 
 
[Example in Help File does not evaluate as 
claimed]\url{http://mathematica.stackexchange.com/questions/60281/example-i 
n-help-file-does-not-evaluate-as-claimed} 
 
In the help file, under BellB, I read at 'Properties and Relations': 
"Sum can give results involving BellB ": 
 
Sum[k^n/k!, {k, 0, Infinity}] 
E BellB[n] 
 
 
but, in my version 10.0.1.0 it does not  ... 
 
- asked by Wouter (2 votes) 
 
---------------------------- 
 
[How to get the centroids of the ClusterComponents 
function]\url{http://mathematica.stackexchange.com/questions/60301/how-to-g 
et-the-centroids-of-the-clustercomponents-function} 
 
I use the ClusterComponent function to get the k-means clustering: 
 
Needs["HierarchicalClustering`"] 
cl = ClusteringComponents[data, 4, 1, 
DistanceFunction -> CorrelationDistance, Method ->  ... 
 
- asked by user13675 (2 votes) 

7.16 Tuesday, September 16, 2014

================================== 
Top new questions this week: 
================================== 
 
[How many triangles are 
there?]\url{http://mathematica.stackexchange.com/questions/59350/how-many-t 
riangles-are-there} 
 
Some time ago I found a puzzle and it stopped my work until I solved it. 
 
 
 
One of the possible solutions: 
 
Let us sum upright and upside down triangles whose top lies in the 
$i$-th row. 
$$ 
... 
 
- asked by ybeltukov (22 votes), answered by george2079 (20 votes) 
 
---------------------------- 
 
[Composition a la Mondrian] 
\url{http://mathematica.stackexchange.com/questions/59620/composition-a-la-mondrian} 
 
I would like to paint something like this 
 
 
 
or,even better, like this 
 
 
 
I have tried 
 
colors = 
{Red, Blue, Yellow, White, Black}; 
 
cells = 
ConstantImage[RandomChoice[colors], #] & /@ 
... 
 
- asked by eldo (21 votes), answered by Simon Woods (11 votes) 
 
---------------------------- 
 
[Homotopy 
Visualization]\url{http://mathematica.stackexchange.com/questions/59463/hom 
otopy-visualization} 
 
I noticed that both the lower cased 'i' and the Apple logo  are 
topologically equivalent to  the disjoint union of two closed discs. 
 
 
 
I'd like to animate a homeomorphism from the left to the right,  ... 
 
- asked by Tobi Lehman (18 votes), answered by Michael E2 (28 votes) 
 
---------------------------- 
 
[Finding all paths of certain length between vertices in path graph, 
non-simple ones 
too]\url{http://mathematica.stackexchange.com/questions/59554/finding-all-p 
aths-of-certain-length-between-vertices-in-path-graph-non-simple-o} 
 
First I will tell you what my ultimate goal is, because maybe there's 
another way of doing it other than what I am trying. 
 
I need a list of all $(a_1, a_2, \ldots, a_N)$ tuples that satisfy 
certain  ... 
 
- asked by luke (12 votes), answered by ybeltukov (7 votes) 
 
---------------------------- 
 
[How to manipulate a circle in GeoGebra 
style?]\url{http://mathematica.stackexchange.com/questions/59726/how-to-man 
ipulate-a-circle-in-geogebra-style} 
 
I want to emulate the GeoGebra app. I want to get an effect like this in 
Mathematica. 
 
 
 
I don't know how to move whole circle without changing the radius of the 
circle. 
 
My sample code: 
 
... 
 
- asked by mathe (11 votes), answered by Kuba (5 votes) 
 
---------------------------- 
 
[Splitting strings into letter keys and 
integers]\url{http://mathematica.stackexchange.com/questions/59690/splittin 
g-strings-into-letter-keys-and-integers} 
 
I have strings of the following form: 
 
string = "ABC123DEFG456HI89UZXX1"; 
 
 
Letter keys of variable lengths are followed by (positive) integers. 
 
I want to get this transformation: 
 
 
{{"ABC", 123},  ... 
 
- asked by eldo (11 votes), answered by RunnyKine (10 votes) 
 
---------------------------- 
 
[Mathematica isn't sure whether a sum of two positives is positive or 
not]\url{http://mathematica.stackexchange.com/questions/59589/mathematica-i 
snt-sure-whether-a-sum-of-two-positives-is-positive-or-not} 
 
Mathematica is not able to tell whether a summation of two positive 
expressions is positive or not. Which is very strange. 
 
My three symbolic arguments, $x$, $y$, and $z$, are all real numbers 
bounded  ... 
 
- asked by jim (10 votes), answered by Jens (9 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Generating visually pleasing circle 
packs]\url{http://mathematica.stackexchange.com/questions/40334/generating- 
visually-pleasing-circle-packs} 
 
EDIT: I want to thank you all guys for this unexpected intellectual and 
artistic journey. Hope you enjoyed as I did. 
 
I would like to generate a circle pack that mimics this: (don't pay 
attention on  ... 
 
- asked by VividD (62 votes), answered by level1807 (39 votes) 
 
---------------------------- 
 
[Finding real roots of negative numbers (for example, 
$\sqrt[3]{-8}$)]\url{http://mathematica.stackexchange.com/questions/3886/fi 
nding-real-roots-of-negative-numbers-for-example-sqrt3-8} 
 
Say I want to quickly calculate $\sqrt[3]{-8}$, to which the most 
obvious solution is $-2$. 
 
When I input $\sqrt[3]{-8}$ or Power[-8, 3^-1], Mathematica gives the 
result "$2 (-1)^{1/3}$". Not what I  ... 
 
- asked by jtbandes (33 votes), answered by Brett Champion (13 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[NIntegrate::ncvbr: How should we interpret and handle this error not 
mentioned in any 
documentation?]\url{http://mathematica.stackexchange.com/questions/59371/ni 
ntegratencvbr-how-should-we-interpret-and-handle-this-error-not-mentione 
d-i} 
 
I have some user-defined module describing my integrand which has to be 
computed numerically (it's much more complicated than this but bear with 
me): 
 
foo[x_?NumericQ, y_?NumericQ, z_?NumericQ] :=  ... 
 
- asked by Sarah (3 votes) 
 
---------------------------- 
 
[How can I solve an equation where indexed variables get updated during 
iteration?]\url{http://mathematica.stackexchange.com/questions/59776/how-ca 
n-i-solve-an-equation-where-indexed-variables-get-updated-during-iterati 
on} 
 
I am trying to solve for a root for a certain equation, but some of the 
variables in this equation are indexed and get updated during iteration. 
The code that I am interested in is like the following: 
... 
 
- asked by erickwy (1 vote) 
 
---------------------------- 
 
[Generalize WASD Function First Person 
Viewing]\url{http://mathematica.stackexchange.com/questions/59655/generaliz 
e-wasd-function-first-person-viewing} 
 
How might I generalize the following WASD question such that it works 
with any Graphics3D object and includes q and e for z(up and down) 
movement?  For example qweasd[gr_]. 
 
In addition, how might I  ... 
 
- asked by Liam William (2 votes) 

7.17 Tuesday, September 9, 2014

================================== 
Top new questions this week: 
================================== 
 
[Finding length of intersection of two 
surfaces]\url{http://mathematica.stackexchange.com/questions/58768/finding- 
length-of-intersection-of-two-surfaces} 
 
I would like to know how we find the length of the intersection of two 
surfaces. For instance, in the following example,a surface intersects 
with a plane: 
 
How do we find the length of intersection  ... 
 
- asked by user19522 (25 votes), answered by RunnyKine (18 votes) 
 
---------------------------- 
 
[How to ask Mathematica to imitate Andy Warhol's pop-art 
painting?]\url{http://mathematica.stackexchange.com/questions/59132/how-to- 
ask-mathematica-to-imitate-andy-warhols-pop-art-painting} 
 
I tried to ask Mathematica to imitate Andy Warhol, let it convert a 
Marilyn Monroe's portrait looks like Warhol's world famous pop-art 
painting. However, the result shown below is far from  ... 
 
- asked by Putterboy (24 votes), answered by Karsten 7. (16 votes) 
 
---------------------------- 
 
[How to speed up my Project Euler 
code]\url{http://mathematica.stackexchange.com/questions/58751/how-to-speed 
-up-my-project-euler-code} 
 
The evaluation speed of Mathematica often depresses me. It did it again 
when I wrote a code to solve a Project Euler problem. 
https://projecteuler.net/problem=206 
 
Here's my code: 
 
ClearAll[a]; 
a = 
... 
 
- asked by Eric (17 votes), answered by Teake Nutma (13 votes) 
 
---------------------------- 
 
[How do you turn off the Dashed graphics 
directive?]\url{http://mathematica.stackexchange.com/questions/58992/how-do 
-you-turn-off-the-dashed-graphics-directive} 
 
I'm looking at Graphics Directives but can't figure out a way to turn 
off the Dashed graphics directive. For example, given 
 
ListPlot[{Table[Sin[i], {i, 25}], Table[Cos[i], {i, 25}]}, 
Joined ->  ... 
 
- asked by Andrew Cheong (16 votes), answered by m_goldberg (15 votes) 
 
---------------------------- 
 
[symbolic integration 
error]\url{http://mathematica.stackexchange.com/questions/58940/symbolic-in 
tegration-error} 
 
I'm running Mathematica 10.0.0 and encountered a disturbing error in the 
symbolic integration of a rather simple function 
 
Integrate[(1 - x)*(1 + 2*x)^6/Sqrt[1 - x^2], {x, -1, 1}]/Pi 
 
 
The correct  ... 
 
- asked by Carlo Beenakker (16 votes), answered by Artes (11 votes) 
---------------------------- 
 
[How to generate a blank crossword 
sheet?]\url{http://mathematica.stackexchange.com/questions/59001/how-to-gen 
erate-a-blank-crossword-sheet} 
 
I attempted to generate a blank crossword sheet. My method is by 
combining the rows and columns as shown on the graph below. However, 
some of the across and down numbers then appeared out of place  ... 
 
- asked by Putterboy (14 votes), answered by ybeltukov (17 votes) 
 
---------------------------- 
 
[Where to see all Mathematica 
units]\url{http://mathematica.stackexchange.com/questions/58793/where-to-se 
e-all-mathematica-units} 
 
Is there a tutorial page that have all Mathematica units? I sometimes 
have hard time figuring out the correct unit spelling when using 
quantities 
 
 
- asked by Yituo (13 votes), answered by paw (17 votes) 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Finding unit tangent, normal, and binormal vectors for a given 
r(t)]\url{http://mathematica.stackexchange.com/questions/18598/finding-unit 
-tangent-normal-and-binormal-vectors-for-a-given-rt} 
 
For my Calc III class, I need to find $T(t), N(t)$, and $B(t)$ for $t=1, 
2$, and $-1$, given $r(t)=\{t,t^2,t^3\}$. 
 
I've got Mathematica, but I've never used it before and I'm not sure how 
to coerce  ... 
 
- asked by a98 (12 votes), answered by Artes (29 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 (55 votes), answered by  J.M. (47 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[CUDALink Error: A CUDALink kernel timed 
out?]\url{http://mathematica.stackexchange.com/questions/58853/cudalink-err 
or-a-cudalink-kernel-timed-out} 
 
I'm following the CUDALink tutorial [ 
http://reference.wolfram.com/language/CUDALink/tutorial/Introduction.htm 
l ] and everything is going fine until I get to the part that calls 
CUDADot on the  ... 
 
- asked by Edmund (2 votes) 
 
---------------------------- 
 
[Using ParallelMap to run multiple Game of Life simulations 
simultaniously]\url{http://mathematica.stackexchange.com/questions/59224/us 
ing-parallelmap-to-run-multiple-game-of-life-simulations-simultaniously> 
) 
 
My Assignment and Code 
 
As an exercise in Parallel computing I've been tasked with implementing 
Conway's GoL in a way such that at every iteration only a fraction of 
cells are updated. I'm then to run  ... 
 
- asked by Jason Houtekamer (2 votes) 
 
---------------------------- 
 
[How to syntax check that all instance of symbol must be contained in 
Subscript[]]\url{http://mathematica.stackexchange.com/questions/59202/how-t 
o-syntax-check-that-all-instance-of-symbol-must-be-contained-in-subscrip 
t} 
 
I have a function f[expr] that is only allowed to take an expression 
expr that is a polynomial in Subscript[x,_].  By this, I mean that expr 
can be a sum/difference of terms (up to other  ... 
 
- asked by QuantumDot (2 votes)

7.18 September 2, 2014

================================== 
Top new questions this week: 
================================== 
 
[Object separation from a 2.5D 
surface]\url{http://mathematica.stackexchange.com/questions/58269/object-se 
paration-from-a-2-5d-surface} 
 
I'm trying to identify the shape and the boundaries of objects. The data 
was generated with a laser scanner and represent the surface of an area 
in which many boulders lay on the ground and making up  ... 
 
- asked by zeckra (18 votes), answered by shrx (3 votes) 
 
---------------------------- 
 
[Site - Cell Correspondence in Voronoi Diagram obtained via 
VoronoiMesh]\url{http://mathematica.stackexchange.com/questions/58395/site- 
cell-correspondence-in-voronoi-diagram-obtained-via-voronoimesh} 
 
Consider the following: 
 
pts = RandomReal[4, {10, 2}]; 
vor = VoronoiMesh[pts, {{0, 4}, {0, 4}}]; 
 
Graphics[{GraphicsComplex[ 
MeshCoordinates[vor], {Thick, Blue, MeshCells[vor, 1], 
... 
 
- asked by RunnyKine (12 votes), answered by ybeltukov (7 votes) 
 
---------------------------- 
 
[How to create a neon light effect in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/58602/how- 
to-create-a-neon-light-effect-in-mathematica} 
 
I tried to use Glow to create a neon light effect on a torus object. The 
result shown on the left of the picture below looks quite different from 
the real one on the right. Is there a way to obtain a  ... 
 
- asked by Putterboy (12 votes), answered by DaveStrider (26 votes) 
 
---------------------------- 
 
[Find maximum value of interpolation function - obviously wrong 
result]\url{http://mathematica.stackexchange.com/questions/58244/find-maxim 
um-value-of-interpolation-function-obviously-wrong-result} 
 
Minimizing and maximizing interpolation function has already been asked 
and answered, see here for example. 
 
Yet, I observe a strange behaviour. Well, I can understand that the 
wrong guess of  ... 
 
- asked by anderstood (11 votes), answered by Karsten 7. (12 votes) 
 
---------------------------- 
 
[Set of integers not divisible by smaller set of 
primes]\url{http://mathematica.stackexchange.com/questions/58520/set-of-int 
egers-not-divisible-by-smaller-set-of-primes} 
 
Let $p_n$ be the sequence of prime numbers, and $s(x,n)=$ the set of 
integers less or equal than $x$ that are not divisible by 
$p_1,\dots,p_n.$ I can define it as follows: 
 
... 
 
- asked by martin (10 votes), answered by Mr.Wizard (14 votes) 
 
---------------------------- 
 
[Neumann boundary conditions in NDSolve over nontrivial 
region]\url{http://mathematica.stackexchange.com/questions/58412/neumann-bo 
undary-conditions-in-ndsolve-over-nontrivial-region} 
 
The problem I would like to solve involves diffusion in the following 
region 
 
reg = ImplicitRegion[-5 <= x <= 5 && -5 <= y <= 5 
&& x^2 + y^2 >= 1^2, {x, y}]; 
... 
 
- asked by Greg P (10 votes), answered by user21 (9 votes) 
 
---------------------------- 
 
[Is garbage collection broken in version 
10.0.0?]\url{http://mathematica.stackexchange.com/questions/58375/is-garbag 
e-collection-broken-in-version-10-0-0} 
 
In version 10.0.0 under Windows I am observing the following behavior: 
 
Do[Module[{foo}, foo[x_] := 1; foo[0]], {10}] 
 
Names["foo$*"] 
 
 
 
{"foo$593", "foo$594", "foo$595", "foo$596", "foo$597",  ... 
 
- asked by Mr.Wizard (9 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Can Mathematica do symbolic linear 
algebra?]\url{http://mathematica.stackexchange.com/questions/3242/can-mathe 
matica-do-symbolic-linear-algebra} 
 
For instance, is there some way I can say "let A and B be arbitrary real 
$m\times n$ and $k\times m$ matrices, 
Simplify[Transpose[Transpose[A].Transpose[B]]]" and Mathematica would 
simplify it to B.A? 
... 
 
- asked by nikie (24 votes), answered by helen (12 votes) 
 
---------------------------- 
 
[How to force 
2+2=5]\url{http://mathematica.stackexchange.com/questions/48929/how-to-forc 
e-22-5} 
 
I was looking at this question (writing a program such that 2 + 2 = 5) 
and tried to write something in Mathematica, but I couldn't get 
something to work without completely replacing Plus. Neither of  ... 
 
- asked by Artefacto (4 votes), answered by halirutan (7 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[SyntaxForm not correctly parsed by 
FrontEnd]\url{http://mathematica.stackexchange.com/questions/58531/syntaxfo 
rm-not-correctly-parsed-by-frontend} 
 
When using TagBox with SyntaxForm, I noticed sometimes it is not well 
parsed by the FrontEnd. Here is a minimal example. First input 
 
TagBox["f", "test", SyntaxForm -> "^"] // DisplayForm 
 
 
Then  ... 
 
- asked by Yi Wang (1 vote) 
 
---------------------------- 
 
[Segmentation of 
sunspots]\url{http://mathematica.stackexchange.com/questions/58673/segmenta 
tion-of-sunspots} 
 
I recently went for a walk with my camera and snapped a few pictures of 
the sun. The pictures didn't turn out too well, but this was to be 
expected without a telescope. I thought it might be a nice  ... 
 
- asked by paw (6 votes) 
 
---------------------------- 
 
[Implementation of Series 
function]\url{http://mathematica.stackexchange.com/questions/58343/implemen 
tation-of-series-function} 
 
I'm trying to evaluate the partial derivatives of some function F[x,y] 
at some point, i.e. 
 
Limit[Limit[D[F[x,y],{x,m},{y,n}],x->x0],y->y0] 
 
 
However, for higher derivatives I find that it fails  ... 
 
- asked by Barefeg (2 votes) 

7.19 August 26, 2014

================================== 
Top new questions this week: 
================================== 
 
[Proving the hairy ball theorem using 
xAct]\url{http://mathematica.stackexchange.com/questions/57726/proving-the- 
hairy-ball-theorem-using-xact} 
 
I would to formally prove the hairy ball theorem in Mathematica, 
initially just for the $S^2$, and then see about generalizing. 
 
An approach I thought about to use the xAct package to define $S^2$ 
and  ... 
 
- asked by Daniel Mahler (15 votes) 
 
---------------------------- 
 
[How to understand the usage of Inner and Outer 
figuratively?]\url{http://mathematica.stackexchange.com/questions/57760/how 
-to-understand-the-usage-of-inner-and-outer-figuratively} 
 
Description: 
 
In Mathematica the functions like Thread, Inner, Outer etc. are very 
important and are used frequently. 
 
For the function Thread: 
 
ThreadUsage1: 
 
Thread[f[{a, b, c}]] 
 
 
 
{f[a], f[b],  ... 
 
- asked by Tangshutao (15 votes), answered by Timothy Wofford (5 votes) 
 
---------------------------- 
 
[Make MapIndexed 
listable]\url{http://mathematica.stackexchange.com/questions/57898/make-map 
indexed-listable} 
 
My goal is to apply MapIndexed to every element of a nested list without 
destroying the arithmetic operations within the elements. For example, 
let's start with this list: 
 
{a, {b, {c^d, {e + f g}}}} 
 
... 
 
- asked by seismatica (14 votes), answered by Mr.Wizard (10 votes) 
 
---------------------------- 
 
[Is it possible to insert new colour schemes into 
ColorData?]\url{http://mathematica.stackexchange.com/questions/57885/is-it- 
possible-to-insert-new-colour-schemes-into-colordata} 
 
Because of the standards in my field, for many plots I need to use (or 
at least end up using) rather narrowly defined colour schemes, and in 
particular the Matlab "Jet" scheme, which is well described  ... 
 
- asked by episanty (12 votes), answered by Mr.Wizard (10 votes) 
 
---------------------------- 
 
[How to combine one or more rotated graphics 
objects?]\url{http://mathematica.stackexchange.com/questions/57803/how-to-c 
ombine-one-or-more-rotated-graphics-objects} 
 
I wish to produce an image with more than one composite graphics objects 
which have been modified using Rotate. I feel this should not be 
difficult, but haven't yet found a solution. 
 
A simple example  ... 
 
- asked by image_doctor (11 votes), answered by mfvonh (11 votes) 
 
---------------------------- 
 
[What is the correct way to use specific rule for specific pattern match 
when parsing an 
expression?]\url{http://mathematica.stackexchange.com/questions/58010/what- 
is-the-correct-way-to-use-specific-rule-for-specific-pattern-match-when- 
par} 
 
update: 
Thanks for the answers below. But I noticed they do not handle the 
following special cases: lis=1 and lis=z , lis=1/z and lis=-z as these 
are also considered legal input as given in the  ... 
 
- asked by Nasser (10 votes), answered by seismatica (6 votes) 
 
---------------------------- 
 
[Map of United States as a 3D 
histogram]\url{http://mathematica.stackexchange.com/questions/57872/map-of- 
united-states-as-a-3d-histogram} 
 
By combining the state data from here and the extrusion code from here I 
have managed to make prisms of the various US states such as 
 
 
 
However, the extrusion method looses information about the  ... 
 
- asked by sonright (10 votes), answered by Vitaliy Kaurov (11 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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 (11 votes), answered by trybik (10 votes) 
 
---------------------------- 
 
[Marking points of intersection between two 
curves]\url{http://mathematica.stackexchange.com/questions/10472/marking-po 
ints-of-intersection-between-two-curves} 
 
I'm trying to illustrate the solutions numerically and graphically for 
an equation such as Tan[x] == x. I think I did everything ok except I 
wanted to mark each intersection between Tan[x] and x. 
 
... 
 
- asked by fiz (24 votes), answered by belisarius (31 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Error when using 
EquationTrekker]\url{http://mathematica.stackexchange.com/questions/58005/e 
rror-when-using-equationtrekker} 
 
I just got to know EquationTrakker because I need to do phase graphs for 
my classes. 
 
When I load it 
 
<< EquationTrekker` 
 
 
everything works fine with no errors. 
 
However when I try to use an  ... 
 
- asked by Geo (2 votes) 
 
---------------------------- 
 
[How to solve for exponents in an infinite 
product?]\url{http://mathematica.stackexchange.com/questions/57930/how-to-s 
olve-for-exponents-in-an-infinite-product} 
 
Say I have a power series, $f(x,y) \in 1 + x\mathbb{Z}[[x,y]]$ 
 
Then it admits a unique expansion 
 
$$f(x,y) = \prod_{i=1}^\infty \prod_{j=0}^\infty (1 - x^i 
y^j)^{n_{i,j}}$$ 
 
for some integers, $i,  ... 
 
- asked by Vivek Shende (2 votes) 
 
---------------------------- 
 
[Exporting a compiled function for later 
use]\url{http://mathematica.stackexchange.com/questions/58108/exporting-a-c 
ompiled-function-for-later-use} 
 
I compiled a function then used it in NMinimize. The computation took 19 
seconds. Then, I exported this compiled function and restarted MMA and 
imported this compiled function into my notebook. This  ... 
 
- asked by yashar (5 votes)

7.20 August 19, 2014

================================== 
Top new questions this week: 
================================== 
 
[Is this 30% slowdown in Mathematica 10 due to DownValues lookup 
time?]\url{http://mathematica.stackexchange.com/questions/57301/is-this-30- 
slowdown-in-mathematica-10-due-to-downvalues-lookup-time} 
 
Running several numerical self-programmed packages I realized already 
some time ago that Mathematica 10 needed between 20 and 40% more time. 
I did already report this of course with a simple example  ... 
 
- asked by Rolf Mertig (26 votes) 
 
---------------------------- 
 
[2D random walk within a bounded 
area]\url{http://mathematica.stackexchange.com/questions/57561/2d-random-wa 
lk-within-a-bounded-area} 
 
I want to simulate a random walk on two dimension in a bounded area such 
as a square or circle. I am thinking of using If statement to define a 
boundary. Is there a better way to define a bounded  ... 
 
- asked by yashar (20 votes), answered by Pickett (21 votes) 
 
---------------------------- 
 
["Indexing" a 
vector]\url{http://mathematica.stackexchange.com/questions/57613/indexing-a 
-vector} 
 
I need to "index" a vector according to the first occurence of its 
distinct elements. 
 
I have written 
 
index[list_] := 
Module[{x = list, p}, 
p = Flatten /@ Map[Position[x, #] &,  ... 
 
- asked by eldo (13 votes), answered by kguler (18 votes) 
 
---------------------------- 
 
[Convert spectral distribution to RGB 
color]\url{http://mathematica.stackexchange.com/questions/57389/convert-spe 
ctral-distribution-to-rgb-color} 
 
Presume I have a spectrum as a function of wavelength (an example being 
the blackbody spectrum): 
 
 
 
I want to convert that to a single RGB color to display on-screen, i.e. 
the "color" of that object  ... 
 
- asked by Guillochon (13 votes), answered by Sjoerd C. de Vries (11 
votes) 
 
---------------------------- 
 
[Why does Mathematica simplify 
$x/x\to1$?]\url{http://mathematica.stackexchange.com/questions/57489/why-do 
es-mathematica-simplify-x-x-to1} 
 
If I enter x/x, I get 1. Such behavior leads to this: 
 
Simplify[D[Sqrt[x^2], x, x]] 
 
 
 
0 
 
 
The same would be even if I use Together instead of Simplify. 
 
One could then think that $\sqrt{x^2}$ is  ... 
 
- asked by Ruslan (11 votes), answered by Jens (5 votes) 
 
---------------------------- 
 
[Manipulate crashes after running 4 
minutes]\url{http://mathematica.stackexchange.com/questions/57247/manipulat 
e-crashes-after-running-4-minutes} 
 
The following code generates the familiar 3D-plot: 
 
Manipulate[ 
Plot3D[Sin[x a] - Cos[y ], {x, -10, 10}, {y, -10, 10}, 
ColorFunction -> "TemperatureMap"], {a, -2, 2, 0.1}] 
 
 
However  ... 
 
- asked by MathLind (10 votes), answered by Szabolcs (2 votes) 
 
---------------------------- 
 
[Incompatible InterpolatingFunction between V9 (and earlier) and 
V10]\url{http://mathematica.stackexchange.com/questions/57608/incompatible- 
interpolatingfunction-between-v9-and-earlier-and-v10} 
 
I am encountering compatibility issues when loading DumpSave(d) 
definitions in V10 that have been created with earlier versions. V10 
appears to be unable to digest `InterpolatingFunction from earlier  ... 
 
- asked by Markus Roellig (10 votes), answered by Mr.Wizard (4 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Marking points of intersection between two 
curves]\url{http://mathematica.stackexchange.com/questions/10472/marking-po 
ints-of-intersection-between-two-curves} 
 
I'm trying to illustrate the solutions numerically and graphically for 
an equation such as Tan[x] == x. I think I did everything ok except I 
wanted to mark each intersection between Tan[x] and x. 
 
... 
 
- asked by fiz (24 votes), answered by belisarius (31 votes) 
 
---------------------------- 
 
[How to find all the local minima/maxima in a 
range]\url{http://mathematica.stackexchange.com/questions/5575/how-to-find- 
all-the-local-minima-maxima-in-a-range} 
 
I want to find : 
 
 
all local maxima in range 
all local minima in range 
 
 
>From those points I can interpolate and combine functions upper and 
lower boundary. What I am really interested in, is the  ... 
 
- asked by Margus (38 votes), answered by Daniel Lichtblau (40 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Is it possible to Compile the function with string 
argument?]\url{http://mathematica.stackexchange.com/questions/57355/is-it-p 
ossible-to-compile-the-function-with-string-argument} 
 
As we can see from the Compile documentation, the typical arguments for 
Compile should be Integer, Real, Complex and True | False: 
 
 
 
Is it possible to use a String as argument type for Compile? 
 
May  ... 
 
- asked by Rom38 (2 votes) 
 
---------------------------- 
 
[Functional-Style Fixed-Length Queue 
Object?]\url{http://mathematica.stackexchange.com/questions/57539/functiona 
l-style-fixed-length-queue-object} 
 
Following up on question Side-effecting an array in an association? and 
@Mr.Wizard's answer in there, I'm modernizing and tweaking Daniel 
Lichtblau's efficient queues and ran into a little roadblock. 
... 
 
- asked by Reb.Cabin (2 votes) 
 
---------------------------- 
 
[Adding an unused column creates an error in 
JoinAcross]\url{http://mathematica.stackexchange.com/questions/57345/adding 
-an-unused-column-creates-an-error-in-joinacross} 
 
I'd been having trouble using JoinAcross on two datasets.  After going 
through the answers to my original question and fixing my code, I find 
I'm now having a problem that I think is being caused by  ... 
 
- asked by Mitchell Kaplan (2 votes)

7.21 August 12, 2014

================================== 
Top new questions this week: 
================================== 
 
[Incompatible Changes since Mathematica Version 
7?]\url{http://mathematica.stackexchange.com/questions/56728/incompatible-c 
hanges-since-mathematica-version-7} 
 
There is documentation of the incompatible changes made to Mathematica 
with each major release: 
 
 
Incompatible Changes since Mathematica Version 1 
 
 
Unfortunately that documentation simply stopped  ... 
 
- asked by Mr.Wizard (22 votes), answered by Mr.Wizard (22 votes) 
 
---------------------------- 
 
[How to make a stereogram in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/57034/how- 
to-make-a-stereogram-in-mathematica} 
 
Given a background and a pattern jpg files, is there a quick and easy 
way to produce a stereogram by using Mathematica? The following picture 
was produced from Photoshop, spent about half an hour. 
 
 
... 
 
- asked by user16069 (15 votes), answered by Simon Woods (9 votes) 
 
---------------------------- 
 
[Combining images with 
CUDA]\url{http://mathematica.stackexchange.com/questions/56786/combining-im 
ages-with-cuda} 
 
2nd Edition: 
To make it a bit more clear, and to summarize the discussion in 
comments. 
 
I have a small image, like this one: 
 
InsertImage = 
DensityPlot[Sqrt[1 - x^2 - y^2], {x, -1, 1}, {y, -1, 1}, 
... 
 
- asked by Alexey Bobrick (13 votes), answered by Simon Woods (10 votes) 
 
---------------------------- 
 
[How to change element color in Periodic 
Table?]\url{http://mathematica.stackexchange.com/questions/57133/how-to-cha 
nge-element-color-in-periodic-table} 
 
The command 
 
ColorData["Atoms", "Panel"] 
 
 
generates a periodic table. 
 
As I don't want to reinvent the wheel, I asked myself how to change the 
color of each cell in the periodic table, (hydrogen ->  ... 
 
- asked by Zhozer (12 votes), answered by belisarius (14 votes) 
 
---------------------------- 
 
[Apply an image as a texture to 
text]\url{http://mathematica.stackexchange.com/questions/56719/apply-an-ima 
ge-as-a-texture-to-text} 
 
I have the following equation 
 
eq = Sum[x^2, {x, 0, 10}] 
 
 
and an image image = 
Import["http://creativity103.com/collections/Graphic/rainbowbars.jpg"]. 
 
How might I output a transparent version of the  ... 
 
- asked by Liam William (11 votes), answered by Simon Woods (16 votes) 
 
---------------------------- 
 
[Dataset: get number of levels and 
elements]\url{http://mathematica.stackexchange.com/questions/56983/dataset- 
get-number-of-levels-and-elements} 
 
The summary box for Dataset objects shows the number of levels and 
elements at the bottom. 
 
How can we get these values programmatically? 
 
For example, "4 levels, 350 elements" in the Planets  ... 
 
- asked by Szabolcs (10 votes), answered by WReach (7 votes) 
 
---------------------------- 
 
[PlotLegends -> "Expressions" not working when Plot given one 
function]\url{http://mathematica.stackexchange.com/questions/56829/plotlege 
nds-expressions-not-working-when-plot-given-one-function} 
 
I don't get a legend when I use the option PlotLegends -> 
"Expressions" when the first argument to Plot is a single function. It 
works OK when I give Plot a list of functions. 
 
Test cases: 
 
... 
 
- asked by mathe (10 votes), answered by rcollyer (8 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Finding unit tangent, normal, and binormal vectors for a given 
r(t)]\url{http://mathematica.stackexchange.com/questions/18598/finding-unit 
-tangent-normal-and-binormal-vectors-for-a-given-rt} 
 
For my Calc III class, I need to find $T(t), N(t)$, and $B(t)$ for $t=1, 
2$, and $-1$, given $r(t)=\{t,t^2,t^3\}$. 
 
I've got Mathematica, but I've never used it before and I'm not sure how 
to coerce  ... 
 
- asked by a98 (12 votes), answered by Artes (29 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? 
================================== 
 
[Plotting a transformed region only works with integer 
inputs]\url{http://mathematica.stackexchange.com/questions/57112/plotting-a 
-transformed-region-only-works-with-integer-inputs} 
 
I can't figure out why the following code only works with integers. 
 
r1 = TransformedRegion[Cuboid[{-1, -1, -1}, {1, 1, 1}], 
TranslationTransform[{0, 1, 0}]] 
RegionPlot3D[r1] 
DiscretizeRegion[r1] 
... 
 
- asked by jeff (5 votes) 
 
---------------------------- 
 
[Symbolic integration of elliptic 
functions]\url{http://mathematica.stackexchange.com/questions/57024/symboli 
c-integration-of-elliptic-functions} 
 
Is there some clever way to integrate products of elliptic functions 
$\wp(z;g_2,g_3)$ or $\zeta(z;g_2,g_3)$ in Mathematica? 
 
 
 
Mathematica seems to be able to integrate functions like 
 
... 
 
- asked by TheTwistedSector (3 votes) 
 
---------------------------- 
 
[Version 10 cannot print 
properly?]\url{http://mathematica.stackexchange.com/questions/57182/version 
-10-cannot-print-properly} 
 
I have two problems with printing in version 10. 
 
First, I can't print correctly with a setting of printing scale 
 
For example, I have some plots in a notebook, 
 
Grid@Table[ 
Plot[Sin[x], {x, 0, 2  ... 
 
- asked by xslittlegrass (2 votes) 

7.22 August 5, 2014

================================== 
Top new questions this week: 
================================== 
 
[Numerically solving Helmholtz equation in 2D for arbitrary 
shapes]\url{http://mathematica.stackexchange.com/questions/56305/numericall 
y-solving-helmholtz-equation-in-2d-for-arbitrary-shapes} 
 
I would like to solve the Helmholtz equation with dirichlet boundary 
conditions in 2 dimensions for an arbitrary shape. (for a qualitative 
comparison of the eigenstates to periodic orbits in the  ... 
 
- asked by Julian S. (25 votes), answered by Mark McClure (20 votes) 
 
---------------------------- 
 
[V10's Operator Forms - what are they good 
for?]\url{http://mathematica.stackexchange.com/questions/56504/v10s-operato 
r-forms-what-are-they-good-for} 
 
V10 introduces an operator form for several functions perhaps primarily 
due to their role in queries as part of introducing data science 
functionality. At first pass it seems a lot of effort to add  ... 
 
- asked by Ronald Monson (22 votes), answered by Simon Woods (24 votes) 
 
---------------------------- 
 
[Why is Query so much slower than 
Part?]\url{http://mathematica.stackexchange.com/questions/56609/why-is-quer 
y-so-much-slower-than-part} 
 
Time for another of these(1),(2) as yet another new-in-10 function 
appears to have poor performance compared to older alternatives.  This 
time: Query appears to be orders of magnitude slower than Part  ... 
 
- asked by Mr.Wizard (15 votes), answered by m_goldberg (8 votes) 
 
---------------------------- 
 
[BitShiftRight produces incorrect results in Version 
10]\url{http://mathematica.stackexchange.com/questions/56241/bitshiftright- 
produces-incorrect-results-in-version-10} 
 
With Mathematica 10 for Mac, BitShiftRight works properly on lists of up 
to 100000 numbers, but appears to give incorrect results when threaded 
over lists of 100001 or more: 
 
v1 = Table[i, {i, 1,  ... 
 
- asked by DBM (14 votes), answered by Mr.Wizard (9 votes) 
 
---------------------------- 
 
[Speed of curated data calls in Version 
10]\url{http://mathematica.stackexchange.com/questions/56172/speed-of-curat 
ed-data-calls-in-version-10} 
 
Curated datasets underwent a significant overhaul in version 10, 
primarily in the way content is delivered in the form of Objects and 
Entities.  Additionally, it appears that this change in content  ... 
 
- asked by bobthechemist (14 votes), answered by Nick Lariviere (13 
votes) 
 
---------------------------- 
 
[the winding number for the circle map (Arnold 
tongue)]\url{http://mathematica.stackexchange.com/questions/56499/the-windi 
ng-number-for-the-circle-map-arnold-tongue} 
 
I want to do an iterative calculation: 
 
f[n_, a_, b_] := Nest[# + a - b Sin[2 Pi #] &, 0, n]/n; 
 
 
If I use i use the machine precision, it maybe produce a great error,for 
example: 
 
N@f[500, 1/2,  ... 
 
- asked by Chenminqi (12 votes), answered by heropup (10 votes) 
 
---------------------------- 
 
[Speed up adding Poisson noise to an 
image]\url{http://mathematica.stackexchange.com/questions/56180/speed-up-ad 
ding-poisson-noise-to-an-image} 
 
I'm simulating some images corrupted with Poisson noise, but I'm 
encountering a few problems with performance. According to the 
documentation on ImageEffect, one can add Poisson noise according to the 
... 
 
- asked by blochwave (11 votes), answered by blochwave (16 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[How can I add drop shadows and specular highlights to 2D 
graphics?]\url{http://mathematica.stackexchange.com/questions/43186/how-can 
-i-add-drop-shadows-and-specular-highlights-to-2d-graphics} 
 
I thought I'd share some code in the form of a self-answered question, 
but other answers are of course welcome. 
 
Drop shadows are a familiar visual effect, giving the impression of a 
graphical element  ... 
 
- asked by Simon Woods (31 votes), answered by Simon Woods (35 votes) 
 
---------------------------- 
 
[Resources for beautiful Mathematica 
Stylesheets]\url{http://mathematica.stackexchange.com/questions/5846/resour 
ces-for-beautiful-mathematica-stylesheets} 
 
When the Wolfram Demonstrations were introduced and the 
Documentation-Center was redesigned, I remember it was the first time I 
thought someone had put some effort into creating a beautiful  ... 
 
- asked by halirutan (81 votes), answered by rm -rf (41 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[DatabaseLink Example for DB2 and 
Mathematica]\url{http://mathematica.stackexchange.com/questions/56283/datab 
aselink-example-for-db2-and-mathematica} 
 
could someone please point me to good example on how to make a JDBC 
connection to an IBM DB2 database? 
 
 
- asked by Rick QI (1 vote) 
 
---------------------------- 
 
[Precision problem while evaluating RegionMember or Element in 
V10]\url{http://mathematica.stackexchange.com/questions/56402/precision-pro 
blem-while-evaluating-regionmember-or-element-in-v10} 
 
I'll try to give you a background on where the problem occured. The 
problem itself is defined near the end of the post. 
 
I'm running a sort of a simulation of a particle in a box. I finally got 
my  ... 
 
- asked by Daroslav (3 votes) 
 
---------------------------- 
 
[Workarounds for a possible bug in the linearity of 
FourierTransform]\url{http://mathematica.stackexchange.com/questions/56237/ 
workarounds-for-a-possible-bug-in-the-linearity-of-fouriertransform} 
 
This is somewhat similar to this question, except the problem I am 
encountering is to do with Fourier transforms of scalar multiples of 
functions and their derivatives. 
 
I wish to input  ... 
 
- asked by Oliver Lunt (2 votes) 

7.23 July 29, 2014

================================== 
Top new questions this week: 
================================== 
 
[Best practice of passing a large number of parameters to 
functions]\url{http://mathematica.stackexchange.com/questions/55833/best-pr 
actice-of-passing-a-large-number-of-parameters-to-functions} 
 
I have a number of functions which all take a large number of 
parameters. I am wondering which is the best practice of passing these 
parameters to those functions. I could of course simply specify the  ... 
 
- asked by Uwe Thummel (16 votes), answered by Mr.Wizard (12 votes) 
 
---------------------------- 
 
[Is there a way to recreate the typical Red/Blue-Postereffect using 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/55684/is-t 
here-a-way-to-recreate-the-typical-red-blue-postereffect-using-mathemati 
ca} 
 
I think nearly all of us have at least once seen an image like this: 
 
 
 
So I wondered whether it is possible to recreate this effect using 
Mathematica because it seems like it wouldn't need that many  ... 
 
- asked by Levix (15 votes), answered by kale (14 votes) 
 
---------------------------- 
 
[How can I mend this broken 
heart?]\url{http://mathematica.stackexchange.com/questions/55905/how-can-i- 
mend-this-broken-heart} 
 
Try to evaluate the following code: 
 
ContourPlot3D[(x^2 + 9/4 y^2 + z^2 - 1)^3 == x^2 z^3 + 9/80 y^2 z^3, 
{x, -6/5, 6/5}, {y, -6/5, 6/5}, {z, -6/5, 3/2}, 
Mesh -> None, Boxed -> False,  ... 
 
- asked by LCFactorization (13 votes), answered by Rahul Narain (18 
votes) 
 
---------------------------- 
 
[Geographic background containing both outlines and contours: 
how?]\url{http://mathematica.stackexchange.com/questions/55900/geographic-b 
ackground-containing-both-outlines-and-contours-how} 
 
I would like to create a map which will show lakes and rivers together 
with elevation contours and contour labels.  What is the simplest way to 
do this with GeoGraphics in version 10? 
 
The solution I  ... 
 
- asked by Szabolcs (11 votes), answered by WReach (11 votes) 
 
---------------------------- 
 
[What is the natural way of using Dataset to get a 
FittedModel?]\url{http://mathematica.stackexchange.com/questions/56110/what 
-is-the-natural-way-of-using-dataset-to-get-a-fittedmodel} 
 
The new Dataset in Mathematica 10 is a great addition to the language, 
potentially reducing the convenience gap with R. Given this, I would 
like to understand what the equivalent simple or natural  ... 
 
- asked by Simplex (10 votes), answered by WReach (5 votes) 
 
---------------------------- 
 
[Testing Credit Usage in Wolfram Programming 
Cloud]\url{http://mathematica.stackexchange.com/questions/55970/testing-cre 
dit-usage-in-wolfram-programming-cloud} 
 
I currently have a free WPC account, which I am using for testing 
purposes.  Amongst other things, I want to find out more about how the 
credit system works, in particular how many credits are used,  ... 
 
- asked by Analyst (9 votes), answered by Analyst (5 votes) 
 
---------------------------- 
 
[Possible bug in 
Dynamic]\url{http://mathematica.stackexchange.com/questions/55855/possible- 
bug-in-dynamic} 
 
The code below crashes the Mathematica kernel in version 10 (not in V9) 
every time I run it on Windows and on Mac OS. I've sent it to WRI, but 
was told that they could not reproduce the crash. 
 
Does  ... 
 
- asked by nikie (9 votes), answered by Michael E2 (4 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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 (22 votes), answered by rcollyer (29 votes) 
 
---------------------------- 
 
[Implementing efficient multiple 
undo]\url{http://mathematica.stackexchange.com/questions/1953/implementing- 
efficient-multiple-undo} 
 
At the time this question was asked, version 10 was not out yet. The 
Front End of Mathematica 10 does have multiple undo, see the answer by 
John Fultz. 
 
The Mathematica Front End's built-in Undo  ... 
 
- asked by Rojo (111 votes), answered by John Fultz (30 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Result of Integrate depends on order of integration although the domain 
is 
rectangular]\url{http://mathematica.stackexchange.com/questions/55868/resul 
t-of-integrate-depends-on-order-of-integration-although-the-domain-is-re 
cta} 
 
The following: 
 
Mass/(2 J) 
Integrate[(-2Rotation(r^2(r-Mass)(1-3Cos[\[Theta]]^2) - Rotation^2(r Cos[\[Theta]]^2(3-Cos[\[Theta]]^2)-Mass(1+Cos[\[Theta]]^2)(2-Cos[\[Theta]]^2))))/(r^2+Rotation^2Cos[\[Theta]]^2)^2 
 
- asked by auxsvr (2 votes) 
 
---------------------------- 
 
[PlotMarkers problem in ErrorListPlot, Mathematica 
10]\url{http://mathematica.stackexchange.com/questions/56132/plotmarkers-pr 
oblem-in-errorlistplot-mathematica-10} 
 
I recently upgraded to Mathematica 10, very excited about the multiple 
undo function of course. 
 
However I very quickly noticed that if I specify a setting for 
PlotMarkers in the ErrorListPlot  ... 
 
- asked by nate (2 votes) 
 
---------------------------- 
 
[Unique CellID in-between 
notebooks]\url{http://mathematica.stackexchange.com/questions/55968/unique- 
cellid-in-between-notebooks} 
 
Documentation says that CellID is guaranteed to be unique for a given 
notebook. 
I've noticed that CellID are fairly high numbers and although 
probabilistically speaking the odds of coincidence are  ... 
 
- asked by Ranza (2 votes)

7.24 July 22, 2014

 
================================== 
Top new questions this week: 
================================== 
 
[DeleteDuplicatesBy is not performing as I'd hoped. Am I missing 
something?]\url{http://mathematica.stackexchange.com/questions/55294/delete 
duplicatesby-is-not-performing-as-id-hoped-am-i-missing-something} 
 
Deja vu: a new-in-v10 function should provide a better solution to an 
old problem, but my enthusiasm is curbed when I run timings.  This time 
the function is DeleteDuplicatesBy and while its  ... 
 
- asked by Mr.Wizard (18 votes), answered by Jacob Akkerboom (23 votes) 
 
---------------------------- 
 
[Mathematica 10 Notebook Fonts Look 
Bad]\url{http://mathematica.stackexchange.com/questions/55071/mathematica-1 
0-notebook-fonts-look-bad} 
 
I've upgraded my home installation of Mathematica from version 9 to 10 
today on a Windows 8.1 machine, and I'm getting a weird font issue - the 
fonts are not anti-aliased, and look unbalanced and  ... 
 
- asked by Gleno (17 votes), answered by Tetsuo Ichii (17 votes) 
 
---------------------------- 
 
[Mathematica 10 funny bug / Easter 
egg?]\url{http://mathematica.stackexchange.com/questions/55081/mathematica- 
10-funny-bug-easter-egg} 
 
I have no idea what is happening here. 
I'm using Mathematica 10. 
 
I mistyped "FriendNetwork" as "FriendsNetwork" and got a weird result: 
 
 
 
The option "FriendsNetwork" is not even listed in the help  ... 
 
- asked by Space monkey (17 votes), answered by Pickett (20 votes) 
 
---------------------------- 
 
[Why does ImportString["1c", "Table"] eat the letter 
c?]\url{http://mathematica.stackexchange.com/questions/55245/why-does-impor 
tstring1c-table-eat-the-letter-c} 
 
I have some whitespace-separated matrix data that I read with 
Import[..., "Table"].  The data contained mixed strings and numbers (the 
strings are for row and column names). 
 
I noticed this weird  ... 
 
- asked by Szabolcs (14 votes), answered by Szabolcs (16 votes) 
 
---------------------------- 
 
[HoldForm doesn't hold 
form]\url{http://mathematica.stackexchange.com/questions/55506/holdform-doe 
snt-hold-form} 
 
In Mathematica version 10, HoldForm no longer produces the same results 
as in version 8 (edit: I only have versions 10 and 8 installed, so can't 
compare to version 9 directly). Here are some examples  ... 
 
- asked by Jens (12 votes), answered by Simon Woods (4 votes) 
 
---------------------------- 
 
[Why does WRI not provide symbolic solution(s) to Heat 
equation?]\url{http://mathematica.stackexchange.com/questions/55546/why-doe 
s-wri-not-provide-symbolic-solutions-to-heat-equation} 
 
Why does WRI not provide symbolic solution(s) to Heat equation? 
 
or more generally, Green functions to known PDEs 
 
I am interested in variations of the heat equation: 
 
 
 
I understand that Mathematica  ... 
 
- asked by chris (12 votes) 
 
---------------------------- 
 
[BarLegend changes in Version 
10]\url{http://mathematica.stackexchange.com/questions/55150/barlegend-chan 
ges-in-version-10} 
 
Apparently, BarLegend in version 10 displays tick legends in scientific 
notation when they are smaller in magnitude than 0.01.  For instance, 
 
BarLegend[{"Rainbow", {-.015, .015}}, 
LabelStyle ->  ... 
 
- asked by bbgodfrey (11 votes), answered by kguler (8 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[When running Mathematica from a Linux terminal, how can I prevent a 
script from terminating upon 
logout?]\url{http://mathematica.stackexchange.com/questions/42838/when-runn 
ing-mathematica-from-a-linux-terminal-how-can-i-prevent-a-script-from} 
 
I am running Mathematica on a remote Linux cluster, by the terminal, 
using the math command.  (I do not have access to a terminal GUI.  For 
example, when I type the command mathematica, I get this  ... 
 
- asked by Andrew (11 votes), answered by shrx (2 votes) 
 
---------------------------- 
 
[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 (22 votes), answered by rcollyer (29 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[LibraryLink: is WolframLibraryData libData 
persistent?]\url{http://mathematica.stackexchange.com/questions/54962/libra 
rylink-is-wolframlibrarydata-libdata-persistent} 
 
I am writing some C++ code that I want to call both through LibraryLink 
and independently from Mathematica.  Thus it must be compatible with 
LibraryLink but not depend on it. 
 
When calling it from  ... 
 
- asked by Szabolcs (3 votes) 
 
---------------------------- 
 
[Issuing user-defined messages takes a long time (Message is 
slow)]\url{http://mathematica.stackexchange.com/questions/55069/issuing-use 
r-defined-messages-takes-a-long-time-message-is-slow} 
 
Issuing messages takes a very long time in version 9 and version 10. 
Can others reproduce this?  Is there a fix? 
 
Update:  This is slow only when using the front end, but not when 
running the kernel  ... 
 
- asked by Szabolcs (6 votes) 
 
---------------------------- 
 
[Report: IgnoringInactive: a 
bug?]\url{http://mathematica.stackexchange.com/questions/55462/report-ignor 
inginactive-a-bug} 
 
Just to report. 
 
IgnoringInactiveshould work with Cases. In agreement with the things 
written at the Documentation Center this: 
 
Cases[{Cos[a], Inactive[Cos][b]}, IgnoringInactive[Cos[x_]]] 
 
 
works  ... 
 
- asked by Alexei Boulbitch (9 votes) 

7.25 July 15, 2014

================================== 
Top new questions this week: 
================================== 
 
[How to make use of 
Associations?]\url{http://mathematica.stackexchange.com/questions/52393/how 
-to-make-use-of-associations} 
 
I have been curious about it for long. Now that Mathematica 10 arrives, 
I think it's time to ask the question: How the new Association data 
structure would be used to improve Mathematica programming? 
 
... 
 
- asked by Yi Wang (38 votes), answered by Leonid Shifrin (36 votes) 
 
---------------------------- 
 
[PositionIndex is horribly 
slow]\url{http://mathematica.stackexchange.com/questions/54853/positioninde 
x-is-horribly-slow} 
 
I do not know how best to formulate this as a question but the new 
PositionIndex is horribly slow. 
 
Using Szabolcs's clever GatherBy inversion we can implement our own 
function for comparison: 
 
... 
 
- asked by Mr.Wizard (25 votes), answered by Taliesin Beynon (15 votes) 
 
---------------------------- 
 
[Is it possible to define new 
PlotTheme?]\url{http://mathematica.stackexchange.com/questions/54545/is-it- 
possible-to-define-new-plottheme} 
 
In version 10 one can define, say, 
 
$PlotTheme = "Scientific" 
 
 
Which changes the appearance of all plots. This is fantastic because on 
the one hand, I can have nice plots very easily and globally  ... 
 
- asked by Yi Wang (19 votes), answered by Mr.Wizard (12 votes) 
 
---------------------------- 
 
[What information is sent to Wolfram Research when loading or working 
with 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/54921/what 
-information-is-sent-to-wolfram-research-when-loading-or-working-with-ma 
them} 
 
Recently I am told that information unknown to the user is sent to 
Wolfram Servers. Is there any truth behind it ? I was told that more 
than just an IP address of the user is sent to them and that  ... 
 
- asked by nathan (18 votes) 
 
---------------------------- 
 
[How to disable the small pop-up windows when mouse is over a 
Mathematica command in 
V10?]\url{http://mathematica.stackexchange.com/questions/52406/how-to-disab 
le-the-small-pop-up-windows-when-mouse-is-over-a-mathematica-command} 
 
In version 10, when the mouse is over a Mathematica command, a small 
pop-up window comes up that one can click on for help on the command. 
 
Is there an option to disable this feature?  Screen shot: 
 
 
 
... 
 
- asked by Nasser (17 votes), answered by Martin John Hadley (17 votes) 
 
---------------------------- 
 
[What's the difference between Inactive and 
HoldForm?]\url{http://mathematica.stackexchange.com/questions/54556/whats-t 
he-difference-between-inactive-and-holdform} 
 
In version 10, Mathematica not only added Inactive / Activate but also 
highlighted this change in the "New in 10" page (in Core Language 
Enhancements). Thus, I suppose it should be something useful.  ... 
 
- asked by Yi Wang (14 votes), answered by mfvonh (11 votes) 
 
---------------------------- 
 
[Mma 10: Half the parallel power (Mac 
Pro)?]\url{http://mathematica.stackexchange.com/questions/54553/mma-10-half 
-the-parallel-power-mac-pro} 
 
Here is a comparison of the parallel kernels launched under  Mathematica 
under v9 and v10, on the same identical current 2014 R2-D2 Mac Pro ... 
 
Under v9.01 
 
$ProcessorCount 
 
 
 
12 
 
 
Issuing: 
 
... 
 
- asked by wolfies (14 votes), answered by Szabolcs (10 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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 (33 votes), answered by Szabolcs (43 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 (33 votes), answered by Vitaliy Kaurov (17 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[possible bug in Mathematica TeXForm? Generating 
\left\left]\url{http://mathematica.stackexchange.com/questions/54857/possib 
le-bug-in-mathematica-texform-generating-left-left} 
 
I asked about this in the TeX chat. It seems Mathematica generate 
invalid Latex in this example. 
 
ClearAll[y,x]; 
ode = D[y[x], x] - (y[x]^2 + 1)/(Abs[y[x] + (1 + y[x])^(1/2)]*(1 + 
x)^(3/2)); 
... 
 
- asked by Nasser (2 votes) 
 
---------------------------- 
 
[How to get a uniformly distributed list of points from a B-spline 
function]\url{http://mathematica.stackexchange.com/questions/54841/how-to-g 
et-a-uniformly-distributed-list-of-points-from-a-b-spline-function} 
 
I created a spline function from a list of points and made a plot as 
follows: 
 
list2 = {{3.93453, -0.623168}, {3.79708, -0.187231}, {3.72835, 
0.0307369}, {3.65963, 0.248705}, {3.5909, 0.466673},  ... 
 
- asked by Kaisey (1 vote) 
 
---------------------------- 
 
[Autocomplete of non-global 
functions]\url{http://mathematica.stackexchange.com/questions/54827/autocom 
plete-of-non-global-functions} 
 
In Mathematica 9 and 10 they added autocompletion. Out of the box this 
works great, but when I set the CellContext to "Notebook" instead of the 
default "Global" (following this) it no longer  ... 
 
- asked by Anders (7 votes)

7.26 July 8,2014

================================== 
Top new questions this week: 
================================== 
 
[Quick way to use conditioned patterns when defining multi-argument 
function?]\url{http://mathematica.stackexchange.com/questions/52057/quick-w 
ay-to-use-conditioned-patterns-when-defining-multi-argument-function} 
 
I have a simple function that is supposed to only accept numeric values 
(i.e. complex/real numbers and constant symbols e.g. Pi, E). 
 
$$f(a,b,c)=a+b+c$$ 
 
Edit: I should have chosen a less simple  ... 
 
- asked by seismatica (13 votes), answered by Mr.Wizard (14 votes) 
 
---------------------------- 
 
[ToExpression fails with long nested string 
expressions]\url{http://mathematica.stackexchange.com/questions/52097/toexp 
ression-fails-with-long-nested-string-expressions} 
 
Consider the following conversion from String to Mathematica Expression: 
 
n = 10; 
ToExpression[Table["{", {n}] <> Table["}", {n}]] 
 
 
 
{{{{{{{{{{}}}}}}}}}} 
 
 
 
Everything is fine. 
 
However, when  ... 
 
- asked by shrx (10 votes), answered by Mr.Wizard (7 votes) 
 
---------------------------- 
 
[The mysterious gap inside 
Grid]\url{http://mathematica.stackexchange.com/questions/52185/the-mysterio 
us-gap-inside-grid} 
 
There's this gap inside Grid which I cannot seem to remove. Perhaps 
someone knows how. 
 
blocks = Table[{Graphics[{Darker@Green, Rectangle[{0, 0}, {1000, 
200}]}]}, {i, 6}] 
myGrid = Grid[blocks,  ... 
 
- asked by Jonie (8 votes), answered by Mr.Wizard (3 votes) 
 
---------------------------- 
 
[Why are functions called first-class objects in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/52064/why- 
are-functions-called-first-class-objects-in-mathematica} 
 
I've heard lots of people say a function is a first-class object in 
Mathematica. "Everything is an expression, including function." "There 
is no distinction between functions and data." 
 
Having read  ... 
 
- asked by Eric (8 votes), answered by nikie (12 votes) 
 
---------------------------- 
 
[Dual graph of an arbitrary (planar) 
graph]\url{http://mathematica.stackexchange.com/questions/52056/dual-graph- 
of-an-arbitrary-planar-graph} 
 
Every planar graph has a dual. How can I obtain it with Mathematica? 
 
I know that GraphData provides the DualGraph property for its named 
graphs, but I have found no method for computing the dual of  ... 
 
- asked by user16311 (7 votes), answered by Grisha Kirilin (9 votes) 
 
---------------------------- 
 
[256 Shades of 
Grey]\url{http://mathematica.stackexchange.com/questions/52099/256-shades-o 
f-grey} 
 
I noticed that the following line, 
 
Image[Table[x, {y, 1, 250}, {x, 30/256, 40/256, 0.02/256}], 
Magnification -> 1] 
 
 
results in the following image: 
 
 
 
In the preceding image, there are 10  ... 
 
- asked by DumpsterDoofus (7 votes), answered by joojaa (5 votes) 
 
---------------------------- 
 
[Implementing key-value associations in Mathematica 9 with inexact 
numbers for 
keys]\url{http://mathematica.stackexchange.com/questions/51997/implementing 
-key-value-associations-in-mathematica-9-with-inexact-numbers-for-ke} 
 
I'm not sure of what type of problem my issue falls into, so I haven't 
been able to search forums with any success. If this has already been 
solved then my apologies! 
 
Essentially I'm trying to set a  ... 
 
- asked by Andrew Stewart (7 votes), answered by Michael E2 (2 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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 (43 votes), answered by Joel Klein (18 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 (33 votes), answered by Szabolcs (43 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Compiled 
NormFunction]\url{http://mathematica.stackexchange.com/questions/52202/comp 
iled-normfunction} 
 
I would like to use a user-defined NormFunction with NDSolve, e.g., 
 
NormFunction -> (Norm[Take[#, 2], \[Infinity]] &) 
 
 
which says that the infinity norm should be used on the first two state 
... 
 
- asked by jaclea (1 vote) 
 
---------------------------- 
 
[Calculating probabilities 
symbolically]\url{http://mathematica.stackexchange.com/questions/51994/calc 
ulating-probabilities-symbolically} 
 
Is there a way to solve for statistical quantities 
analytically/symbolically in Mathematica? 
 
example 1: 
Lets say that I want to do a calculation that requires Bayes theorem. 
 
I know p(a), p(b) and  ... 
 
- asked by kamula (5 votes) 
 
---------------------------- 
 
[How to implement nested With as a single construct using functional 
programming 
(Fold)?]\url{http://mathematica.stackexchange.com/questions/51976/how-to-im 
plement-nested-with-as-a-single-construct-using-functional-programming} 
 
It is possible to define my own With construct where each local constant 
can depend on the previous defined local constants? 
 
I wish to replace something like this 
 
With[{m=10}, 
With[{h=1/m}, 
... 
 
- asked by unlikely (1 vote) 

7.27 July 1, 2014

================================== 
Top new questions this week: 
================================== 
 
[Fitting points to tilted, off-center 
ellipse]\url{http://mathematica.stackexchange.com/questions/51491/fitting-p 
oints-to-tilted-off-center-ellipse} 
 
I have 24 x-y points that are supposed to form an ellipse. 
 
... 
 
- asked by seismatica (15 votes), answered by ubpdqn (17 votes) 
 
---------------------------- 
 
[Combining BarChart and Grid - IPCC 
style]\url{http://mathematica.stackexchange.com/questions/51708/combining-b 
archart-and-grid-ipcc-style} 
 
I would like to combine a plot with a table. Something like this famous 
plot/table from IPCC: 
 
 
 
So after reading Combining graphics & lists / tables I tried an 
approach using Grid. Pretty  ... 
 
- asked by gogoolplex (12 votes), answered by Oska (4 votes) 
 
---------------------------- 
 
[How to implement Donald Knuth's up-arrow 
notation]\url{http://mathematica.stackexchange.com/questions/51657/how-to-i 
mplement-donald-knuths-up-arrow-notation} 
 
How does one enter very large numbers in up-arrow notation? Up-arrow 
notation was created by Donald Knuth to write very large numbers in it 
iterated exponentiation form, for example 63 = 6^6^6. 
 
 
- asked by user4401 (12 votes), answered by Szabolcs (20 votes) 
 
---------------------------- 
 
[Is there a way to increase the smoothness of a 
cylinder?]\url{http://mathematica.stackexchange.com/questions/51565/is-ther 
e-a-way-to-increase-the-smoothness-of-a-cylinder} 
 
I am using Cylinder to produce wide flat disks (in Mathematica 8). This 
works just fine except that the circular base of such a cylinder turns 
out to be really just a 40-gon which is simply too coarse  ... 
 
- asked by Burkard Polster (11 votes), answered by Mr.Wizard (13 votes) 
 
---------------------------- 
 
[Efficient way to build a certain quadratic 
matrix]\url{http://mathematica.stackexchange.com/questions/51798/efficient- 
way-to-build-a-certain-quadratic-matrix} 
 
For odd n I'm looking for a short and swift way to construct with (f.e.) 
 
n = 3 
 
 
 
 
n = 11 
 
 
 
 
n=1111 
 
 
 
 
 
- asked by eldo (9 votes), answered by RunnyKine (8 votes) 
 
---------------------------- 
 
[Finding maximum or minimum of implicit 
functions]\url{http://mathematica.stackexchange.com/questions/51679/finding 
-maximum-or-minimum-of-implicit-functions} 
 
is there any built in function that can be used to find maximum or 
minimum of implicit functions? 
 
For example, if we have the equation 
$$x^2 + y^2 = (2 x^2 + 2 y^2 - x)^2,$$ 
then we can visualize the  ... 
 
- asked by Algohi (7 votes), answered by Kuba (15 votes) 
 
---------------------------- 
 
[How can a power of 0 or 1 be 
replaced?]\url{http://mathematica.stackexchange.com/questions/51585/how-can 
-a-power-of-0-or-1-be-replaced} 
 
Consider this given example for ReplaceAll 
 
1 + x^2 + x^4 /. x^p_ -> f[p] 
 
 
This returns 1+f[2]+f[4] - works good (!). But if you choose 
 
In[175]:= 1 +x+ x^2 + x^4 /. x^p_ -> f[p] 
Out[175]=  ... 
 
- asked by Sumit (7 votes), answered by Daniel Lichtblau (6 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Resources for beautiful Mathematica 
Stylesheets]\url{http://mathematica.stackexchange.com/questions/5846/resour 
ces-for-beautiful-mathematica-stylesheets} 
 
When the Wolfram Demonstrations were introduced and the 
Documentation-Center was redesigned, I remember it was the first time I 
thought someone had put some effort into creating a beautiful  ... 
 
- asked by halirutan (80 votes), answered by rm -rf (40 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 (53 votes), answered by  J.M. (44 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[What's a non-trivial Mathematica program involving conscious choice of 
stack vs. queue data 
structure?]\url{http://mathematica.stackexchange.com/questions/51862/whats- 
a-non-trivial-mathematica-program-involving-conscious-choice-of-stack-vs 
> } 
 
In a typical computer science algorithms course, much attention is given 
to the discussion of queues vs. stacks as a data structure programmers 
need to consciously choose from to achieve algorithmic  ... 
 
- asked by Problemaniac (1 vote) 
 
---------------------------- 
 
[Import Excel data forcing links (ie workbooks) to be 
updated]\url{http://mathematica.stackexchange.com/questions/51873/import-ex 
cel-data-forcing-links-ie-workbooks-to-be-updated} 
 
We have noticed importing data from an Excel spreadsheet doesnt update 
links. 
 
The problem with this is if you import a spreadsheet that comprises of 
linked workbooks data and those workbooks have  ... 
 
- asked by WolframFan (3 votes) 
 
---------------------------- 
 
[Smooth out contour in 
RegionPlot/ContourPlot]\url{http://mathematica.stackexchange.com/questions/ 
51518/smooth-out-contour-in-regionplot-contourplot} 
 
I would like to smooth out the jagged edges in the outermost contours in 
the following plot: 
 
I have data of values as a function of variables (x,y) in the form 
 
data =  ... 
 
- asked by Philo (1 vote) 
 
 
--- 
Subscribe to more Stack Exchange newsletters: 
<http://stackexchange.com/newsletters> 
---

7.28 June 24, 2014

================================== 
Top new questions this week: 
================================== 
 
[Longest path in 0/1 
matrix]\url{http://mathematica.stackexchange.com/questions/51247/longest-pa 
th-in-0-1-matrix} 
 
I have a matrix of 0's and 1's forming a number of disjoint paths: 
 
&nbsp; 
 
 
I would like to find the lengths of the paths, and from that "spectrum," 
the longest length (in the above example: 27,  ... 
 
- asked by Joseph O'Rourke (25 votes), answered by rm -rf (24 votes) 
 
---------------------------- 
 
[Visualization: elliptical insights into data 
sets]\url{http://mathematica.stackexchange.com/questions/51163/visualizati 
on-elliptical-insights-into-data-sets} 
 
I was recently reading the following paper on visualization techniques 
using ellipses to gain statistical insights. Elliptical visualization 
for looking at correlations has briefly been touched on  ... 
 
- asked by Pam (12 votes), answered by Pam (2 votes) 
 
---------------------------- 
 
[What is the relationship between Mathematica and Wolfram 
Desktop?]\url{http://mathematica.stackexchange.com/questions/51372/what-is- 
the-relationship-between-mathematica-and-wolfram-desktop} 
 
I'm confused about the differences among various Wolfram products. In 
particular what is the relationship among Mathematica, Mathematica 
Online, Wolfram Programming Cloud, and Wolfram Desktop? 
 
Are  ... 
 
- asked by raxacoricofallapatorius (12 votes), answered by mfvonh (8 
votes) 
 
---------------------------- 
 
[Find intersection of pairs of straight 
lines]\url{http://mathematica.stackexchange.com/questions/51391/find-inters 
ection-of-pairs-of-straight-lines} 
 
I have a list of 24 points, in which 2 consecutive points (1st and 2nd, 
3rd and 4th, ...) are supposed to form a line. 
 
p1={{243.8, 77.}, {467.4, 12.}, {291.8, 130.}, {476., 210.5}, {103.2, 
327.},  ... 
 
- asked by seismatica (6 votes), answered by eldo (9 votes) 
 
---------------------------- 
 
[What is wrong about Abs[x]-a? Is it a 
bug?]\url{http://mathematica.stackexchange.com/questions/51118/what-is-wron 
g-about-absx-a-is-it-a-bug} 
 
 
 
Why is the Out[74] not {1 - a, {x -&gt; -1}}? 
 
Maximize[{Sqrt[x^2] - a, -1 &lt;= x &lt;= 1}, x] 
 
 
 
{1 - a, {x -&gt; -1}} 
 
 
 
 
- asked by fptan (6 votes), answered by RiemannZeta (4 votes) 
 
---------------------------- 
 
[Find the smallest positive integer that satisfies a certain 
condition]\url{http://mathematica.stackexchange.com/questions/51086/find-th 
e-smallest-positive-integer-that-satisfies-a-certain-condition} 
 
I know Mathematica is really powerful when it comes to functional 
operations like applying a list of tasks to a list of variables. 
Sometimes I feel like it isn't the most powerful tool when it comes  ... 
 
- asked by cartonn (6 votes), answered by mfvonh (9 votes) 
 
---------------------------- 
 
[Why am I getting wildly incorrect results from 
FirstPassageTimeDistribution with inexact transition 
matrix?]\url{http://mathematica.stackexchange.com/questions/51018/why-am-i- 
getting-wildly-incorrect-results-from-firstpassagetimedistribution-with> 
) 
 
Working on some large systems using DiscreteMarkovProcess, I changed the 
transition matrix to machine precision vs using exact values, which sped 
things up handily. The only problem was for edge  ... 
 
- asked by rasher (6 votes), answered by Bhuvanesh (4 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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 (18 votes), answered by rm -rf (23 votes) 
 
---------------------------- 
 
[Generating visually pleasing circle 
packs]\url{http://mathematica.stackexchange.com/questions/40334/generating- 
visually-pleasing-circle-packs} 
 
EDIT: I want to thank you all guys for this unexpected intellectual and 
artistic journey. Hope you enjoyed as I did. 
 
I would like to generate a circle pack that mimics this: (don't pay 
attention on  ... 
 
- asked by VividD (60 votes), answered by level1807 (36 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Solve set of non-linear equations with least-squares-fitting - 
constrain 
results?]\url{http://mathematica.stackexchange.com/questions/51274/solve-se 
t-of-non-linear-equations-with-least-squares-fitting-constrain-results} 
 
I'm trying to solve a set of functions to determine the material 
properties from a set of measurement values. (To set up this method I 
just want to fit my model with some already calculated data). 
 
My  ... 
 
- asked by dummesschaf (1 vote) 
 
---------------------------- 
 
[what is the best package/way to insert Mathematica code in latex 
docs?]\url{http://mathematica.stackexchange.com/questions/51215/what-is-the 
-best-package-way-to-insert-mathematica-code-in-latex-docs} 
 
I know that this question is not about strictly mathematica issue, but I 
think that in this site should be many pepople that use latex to 
distribute mathematica source code/examples. 
If the moderators  ... 
 
- asked by Mika Ike (1 vote) 
 
---------------------------- 
 
[How to force the compilation language to be C++ (not C) in 
CreateExecutable or 
CreateLibrary]\url{http://mathematica.stackexchange.com/questions/51012/how 
-to-force-the-compilation-language-to-be-c-not-c-in-createexecutable-or- 
c} 
 
I'm trying to speed up a section of a Mathematica 9.0.1 notebook by 
performing some calculations in C++ with the Cilk Plus and Threading 
Building Blocks tools available for the Intel C++ 14.0 compiler  ... 
 
- asked by user15996 (4 votes) 

7.29 June 17, 2014

================================== 
Top new questions this week: 
================================== 
 
[Smooth Peter de Jong 
attractor]\url{http://mathematica.stackexchange.com/questions/50839/smooth- 
peter-de-jong-attractor} 
 
Today I was playing with Peter de Jong attractor. 
 
At the bottom of the page I've linked there are beautiful examples like: 
 
 
My attempts are not so great: 
 
 
 
It is around 10^5 points. For more than  ... 
 
- asked by Kuba (17 votes), answered by KennyColnago (15 votes) 
 
---------------------------- 
 
[How would you efficiently implement 
BinListsBy?]\url{http://mathematica.stackexchange.com/questions/50559/how-w 
ould-you-efficiently-implement-binlistsby} 
 
Let's say I have a list like this: 
 
data = {{21, "Alice"}, {27, "Bob"}, {22, "Charles"}, {34, "Dora"}, {75, 
"Eliza"}} 
 
 
containing ages and names of persons. What I would like is a list of 
e.g.  ... 
 
- asked by nikie (9 votes), answered by Mr.Wizard (8 votes) 
 
---------------------------- 
 
[Mathematica outliner's 
capabilities]\url{http://mathematica.stackexchange.com/questions/50637/math 
ematica-outliners-capabilities} 
 
As my notebooks get larger, I often try to organize them with 
titles/subtitles etc, structuring them as an outliner 
(http://en.wikipedia.org/wiki/Outliner) 
 
This also helps me as I try to structure a  ... 
 
- asked by alessandro (8 votes), answered by Mike Honeychurch (7 votes) 
 
---------------------------- 
 
[Control BarLegend 
size]\url{http://mathematica.stackexchange.com/questions/50913/control-barl 
egend-size} 
 
I want to plot a big 2D array of experiment data. I need plot axes and 
tick labels as well as a bar legend using BarLegend: 
 
ArrayPlot[ 
Array[RandomInteger[100] &amp;, {100, 100}], 
PlotLegends -&gt;  ... 
 
- asked by Johu (6 votes), answered by Johu (6 votes) 
 
---------------------------- 
 
[Skip header lines on 
import]\url{http://mathematica.stackexchange.com/questions/50718/skip-heade 
r-lines-on-import} 
 
When importing a data file what are the comment symbols for Mathematica? 
That is, given a file like this 
 
blabla 
bulbul 
 
1 2 6 54 7 ... 
.. 
 
 
what symbol do I have to put in front of header lines so  ... 
 
- asked by user3683367 (6 votes), answered by george2079 (7 votes) 
 
---------------------------- 
 
[How can I list all the 'countries 4000 km far from current 
location'?]\url{http://mathematica.stackexchange.com/questions/50786/how-ca 
n-i-list-all-the-countries-4000-km-far-from-current-location} 
 
A friend said to me on Facebook that she is 4000km away. So I want to 
try to guess where she is. 
 
How can I find which countries are a given distance from my current 
location? 
 
 
- asked by Boti (5 votes), answered by Oska (14 votes) 
 
---------------------------- 
 
[Can I automatically stop operation that is too 
slow?]\url{http://mathematica.stackexchange.com/questions/50746/can-i-autom 
atically-stop-operation-that-is-too-slow} 
 
I need to write code like this: Do operation 1, but if it takes more 
that 5 seconds then stop it and do operation 2. 
Is it possible to do this somehow without manual interruption? 
 
 
- asked by user15933 (5 votes), answered by Nasser (8 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[What is the fastest way to extract a substring from a huge 
string?]\url{http://mathematica.stackexchange.com/questions/44175/what-is-t 
he-fastest-way-to-extract-a-substring-from-a-huge-string} 
 
I develop an algorithm to find the most common substrings of a given 
length n up to a certain distance l in front of a pattern p in a huge 
sequence S. E.g. I want to find the most common hexamers  ... 
 
- asked by g3kk0 (11 votes), answered by Leonid Shifrin (9 votes) 
 
---------------------------- 
 
[When running Mathematica from a Linux terminal, how can I prevent a 
script from terminating upon 
logout?]\url{http://mathematica.stackexchange.com/questions/42838/when-runn 
ing-mathematica-from-a-linux-terminal-how-can-i-prevent-a-script-from} 
 
I am running Mathematica on a remote Linux cluster, by the terminal, 
using the math command.  (I do not have access to a terminal GUI.  For 
example, when I type the command mathematica, I get this  ... 
 
- asked by Andrew (10 votes), answered by shrx (2 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Understanding performance: graph connected 
components]\url{http://mathematica.stackexchange.com/questions/50523/unders 
tanding-performance-graph-connected-components} 
 
I need to analyze directed graphs with 10M edges, 1M vertices, and 300K 
strongly connected components, so that the largest one contains 400K 
vertices. 
 
I read some explanations of Leonid Shifrin here,  ... 
 
- asked by Grisha Kirilin (3 votes) 
 
---------------------------- 
 
[Natural boundary conditions variational 
methods]\url{http://mathematica.stackexchange.com/questions/50526/natural-b 
oundary-conditions-variational-methods} 
 
I am working on a problem of the calculus of variations. From the 
Variational Methods package, I can very conveniently use EulerEquations 
to get stationarity conditions in the form of Euler-Lagrange  ... 
 
- asked by Marijnn (1 vote) 
 
---------------------------- 
 
[How to find a scaling parameter in matrix inversion process by 
MMA?]\url{http://mathematica.stackexchange.com/questions/50660/how-to-find- 
a-scaling-parameter-in-matrix-inversion-process-by-mma} 
 
I simply would like to find the inverse of a given matrix $A$ by the 
iterative method $X_{k+1}=X_k(2I-AX_k)$ using 
$X_0=\frac{1}{\sigma_{max}^2}A^*$. An example is as follows 
 
SeedRandom[123]; m = n =  ... 
 
- asked by Fazlollah Soleymani (1 vote) 

7.30 June 10, 2014

================================== 
Top new questions this week: 
================================== 
 
[Making a Mathematica package 
manager?]\url{http://mathematica.stackexchange.com/questions/49111/making-a 
-mathematica-package-manager} 
 
I'd like to get a serious discussion started about a package manager. 
This has come up elsewhere, and many people have implemented their own 
solutions. It would be nice to have a standardized way to  ... 
 
- asked by mfvonh (10 votes), answered by mfvonh (7 votes) 
 
---------------------------- 
 
[Graph from binary matrix (not adjacency) respecting the original matrix 
positions]\url{http://mathematica.stackexchange.com/questions/50363/graph-f 
rom-binary-matrix-not-adjacency-respecting-the-original-matrix-position> 
) 
 
 
 
I have a binary matrix. My objective is to connect every close (without 
"jump") elements with value equal to 1, but I must keep the point 
positions, just like it's shown at the image. 
 
Can somebody  ... 
 
- asked by Jazz (9 votes), answered by Oska (11 votes) 
 
---------------------------- 
 
[Using Mathematica to make a graphics array of 
circles]\url{http://mathematica.stackexchange.com/questions/49176/using-mat 
hematica-to-make-a-graphics-array-of-circles} 
 
I need to make .svg file that contains an array of black circles that 
all have radii of 5 units ad are evenly spaced apart from each other 32 
units. 
 
The difficulty in creating this design is the  ... 
 
- asked by Sebastian Freeman (9 votes), answered by halirutan (3 votes) 
 
---------------------------- 
 
[CSS Selectors for Symbolic 
XML]\url{http://mathematica.stackexchange.com/questions/49052/css-selectors 
-for-symbolic-xml} 
 
Symbolic XML is a convenient way of managing XML in Mathematica, at 
least for casual use or small tasks. Here and elsewhere you can find 
examples of XML handling in Mathematica, including XSLT/XPath  ... 
 
- asked by Fallible (8 votes), answered by Fallible (12 votes) 
 
---------------------------- 
 
[Complement of 
multisets]\url{http://mathematica.stackexchange.com/questions/49068/complem 
ent-of-multisets} 
 
Given lists $a$ and $b$, which represent multisets, how can I compute 
the complement $a\setminus b$? 
 
I'd like to construct a function xunion that returns the symmetric 
difference of multisets. 
For  ... 
 
- asked by Leon Lampret (8 votes), answered by rasher (8 votes) 
 
---------------------------- 
 
[Thread over uneven (ragged) expressions with full 
functionality?]\url{http://mathematica.stackexchange.com/questions/49359/th 
read-over-uneven-ragged-expressions-with-full-functionality} 
 
There are a number of questions on this site about "threading" including 
several relating to uneven (ragged) lists.  However, none that I could 
find deal with the full functionality of Thread but  ... 
 
- asked by Mr.Wizard (7 votes), answered by mfvonh (5 votes) 
 
---------------------------- 
 
[Hatched Filling for 
ListPlot]\url{http://mathematica.stackexchange.com/questions/49202/hatched- 
filling-for-listplot} 
 
I am plotting to data curves using ListLinePlot. I like the look of 
Filling, but this is going to be printed, so I want something both black 
and white friendly, but giving more definition and  ... 
 
- asked by ThomasH (7 votes), answered by ThomasH (4 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Finding real roots of negative numbers (for example, 
$\sqrt[3]{-8}$)]\url{http://mathematica.stackexchange.com/questions/3886/fi 
nding-real-roots-of-negative-numbers-for-example-sqrt3-8} 
 
Say I want to quickly calculate $\sqrt[3]{-8}$, to which the most 
obvious solution is $-2$. 
 
When I input $\sqrt[3]{-8}$ or Power[-8, 3^-1], Mathematica gives the 
result "$2 (-1)^{1/3}$". Not what I  ... 
 
- asked by jtbandes (31 votes), answered by Brett Champion (10 votes) 
 
---------------------------- 
 
[Is it possible to export the equations from Mathematica to 
MATLAB?]\url{http://mathematica.stackexchange.com/questions/14035/is-it-pos 
sible-to-export-the-equations-from-mathematica-to-matlab} 
 
Is it possible to export the output expressions from Mathematica 
computations (e.g., equations) in valid MATLAB syntax? 
 
 
- asked by Seyhmus Gungoren (14 votes), answered by rm -rf (20 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Relative performance of the Julia 
language]\url{http://mathematica.stackexchange.com/questions/50391/relative 
-performance-of-the-julia-language} 
 
I was just reviewing the Mathematica benchmark code linked from the 
Julia language home page http://julialang.org/. The stated goal of the 
benchmarks is to test the performance of specific algorithms,  ... 
 
- asked by TheDoctor (2 votes) 
 
---------------------------- 
 
[Help wanted in evaluating an 
integral]\url{http://mathematica.stackexchange.com/questions/49319/help-wan 
ted-in-evaluating-an-integral} 
 
Trying to evaluate an integral. To be specific, I'm trying to find the 
expectation value of $x^2$ for the ground state of hydrogen. Here is the 
code I used: 
 
FullSimplify[ 
Integrate[x^2/(Pi*a^3)  ... 
 
- asked by Sam (1 vote) 
 
---------------------------- 
 
[Tooltip over a picture & creating complex 
forms]\url{http://mathematica.stackexchange.com/questions/49235/tooltip-ove 
r-a-picture-creating-complex-forms} 
 
I have some picture like the one seen below. Now, I'm trying to create 
some tooltip with some descriptions when moving with the mouse over a 
body part e.g. "this is the head", "This is the left arm"  ... 
 
- asked by holistic (1 vote)

7.31 June 3, 2014

================================== 
Top new questions this week: 
================================== 
 
[Is this the most effective and efficient programming style for 
prototyping (a ray tracer) in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/48675/is-t 
his-the-most-effective-and-efficient-programming-style-for-prototyping-a 
-ra} 
 
I am trying out Mathematica as a prototyping tool.  As an initial 
exercise I have put together a brute force ray tracer, with a view to 
using Mathematica's built in probability distribution functions  ... 
 
- asked by jrp (22 votes) 
 
---------------------------- 
 
[Negative 
probability?]\url{http://mathematica.stackexchange.com/questions/48814/nega 
tive-probability} 
 
I am trying to get the sum of the squares of seven random variables, all 
uniformly distributed. This is what I tried. 
 
Probability[ 
a^2 + b^2 + c^2 + d^2 + e^2 + f^2 + g^2 &lt; 1, 
{a, b, c, d, e,  ... 
 
- asked by bobbym (18 votes), answered by m_goldberg (12 votes) 
 
---------------------------- 
 
[Aligning two 
lists]\url{http://mathematica.stackexchange.com/questions/48908/aligning-tw 
o-lists} 
 
I have two lists, L1 and L2, each with a key and some data. Let us say 
the key is a person's name, a string, and the data follows. (To respond 
to rasher's query:) Let us also assume the lists are  ... 
 
- asked by Joseph O'Rourke (8 votes), answered by Mr.Wizard (4 votes) 
 
---------------------------- 
 
[Any way I can solve this 
integral?]\url{http://mathematica.stackexchange.com/questions/48766/any-way 
-i-can-solve-this-integral} 
 
So, Mathematica can't solve it. Any workaround? 
 
\begin{equation*} 
\int_0^\pi \frac{1}{\sin\left(\frac{\theta}{2}\right)^\beta + 1} 
\mathrm{d}\theta 
\end{equation*} 
 
The code is: 
 
... 
 
- asked by user1883163 (7 votes), answered by Vitaliy Kaurov (10 votes) 
 
---------------------------- 
 
[Speed up 
ContourPlot3D]\url{http://mathematica.stackexchange.com/questions/48773/spe 
ed-up-contourplot3d} 
 
I have two issues with the following code. (1) It executes too slowly. 
If I use "Speed" instead of "Quality" for PerformanceGoal, I get the 
speed but an undesirable delay in proper rendering of the  ... 
 
- asked by Stephen (7 votes), answered by Kuba (4 votes) 
 
---------------------------- 
 
[Binarize turning image completely 
black?]\url{http://mathematica.stackexchange.com/questions/48683/binarize-t 
urning-image-completely-black} 
 
Running Binarize (or EdgeDetect) on a filled black and white image is 
resulting in an all black image. 
 
The image has the following color distribution (with most images points 
falling in either a  ... 
 
- asked by Peeter Joot (7 votes), answered by Jens (14 votes) 
 
---------------------------- 
 
[Why does Equal["string", False] not evaluate to 
False?]\url{http://mathematica.stackexchange.com/questions/48851/why-does-e 
qualstring-false-not-evaluate-to-false} 
 
Why does Equal["string", False] not evaluate to False? I would have 
thought Mathematica could prove that these two things are not equal. 
 
 
- asked by Fructose (6 votes), answered by eldo (5 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[What Mathematica book to 
buy?]\url{http://mathematica.stackexchange.com/questions/5059/what-mathemat 
ica-book-to-buy} 
 
I have used Mathematica for several years but at a pretty low level - 
piecing together built-in function inefficiently and fearing the sight 
of # and &amp;'s when I see others use them (I never do). I  ... 
 
- asked by BeauGeste (28 votes), answered by David (42 votes) 
 
---------------------------- 
 
[How to find all the local minima/maxima in a 
range]\url{http://mathematica.stackexchange.com/questions/5575/how-to-find- 
all-the-local-minima-maxima-in-a-range} 
 
I want to find : 
 
 
all local maxima in range 
all local minima in range 
 
 
>From those points I can interpolate and combine functions upper and 
lower boundary. What I am really interested in, is the  ... 
 
- asked by Margus (35 votes), answered by Daniel Lichtblau (37 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Suspend computation so it can be resumed even after the PC is 
rebooted]\url{http://mathematica.stackexchange.com/questions/48793/suspend- 
computation-so-it-can-be-resumed-even-after-the-pc-is-rebooted} 
 
Sometimes a computation takes a long time. But when I sleep in the 
night, I want to shutdown my PC. Next morning when I wake, I want to 
start Mathematica and resume the computation. 
 
If you are  ... 
 
- asked by user565739 (3 votes) 
 
---------------------------- 
 
[Simulating a system of nonlinear 
ODEs?]\url{http://mathematica.stackexchange.com/questions/49004/simulating- 
a-system-of-nonlinear-odes} 
 
I was trying to simulate a system of ODEs on Mathematica in an effort to 
try to understand how to muck around with Mathematica but for some 
reason the following lines of code do not yield any results;  ... 
 
- asked by Gadha007 (2 votes) 
 
---------------------------- 
 
[Documentation build failed with 
Workbench]\url{http://mathematica.stackexchange.com/questions/48958/documen 
tation-build-failed-with-workbench} 
 
I'm starting to use Wolfram Workbench 2 to develop a Mathematica 
package.  For the first time I tried "Documentation - Build" under the 
"Application Tools" but got fatal errors: 
 
BUILD FAILED 
... 
 
- asked by Chris K (2 votes) 
 
 
---

7.32 May 27 2014

================================== 
Top new questions this week: 
================================== 
 
[Why won't Parallelize speed up my code?] 
<http://mathematica.stackexchange.com/questions/48295/why-wont-parallelize-speed-up-my-code> 
 
What reasons are there that can cause parallelized Mathematica code not 
to run with full performance? 
 
 
- asked by Szabolcs (18 votes), answered by Szabolcs (26 votes) 
 
---------------------------- 
 
[High-quality RegionPlot3D for logical combinations of 
predicates]\url{http://mathematica.stackexchange.com/questions/48486/high-q 
uality-regionplot3d-for-logical-combinations-of-predicates} 
 
Unlike RegionPlot, RegionPlot3D copes poorly with logical combinations 
of predicates (&amp;&amp;, ||), which should result in sharp edges in 
the region to be plotted. Instead, these edges are usually  ... 
 
- asked by Rahul Narain (11 votes), answered by Simon Woods (10 votes) 
 
---------------------------- 
 
[Correct way to integrate a certain 
function]\url{http://mathematica.stackexchange.com/questions/48437/correct- 
way-to-integrate-a-certain-function} 
 
I want to integrate 
$$ 
\int_{0}^{2\pi} dt_1  \frac{a + b*\cos(t_1 - t_2)}{c + d*\cos(t_1 - 
t_2)} 
$$ 
where $a, b, c, d, t_2$ are real numbers and $c + d &gt; 0$ &amp;  $0 
\leq t_2 \leq 2\pi$. 
I used  ... 
 
- asked by vik (9 votes), answered by Michael E2 (4 votes) 
 
---------------------------- 
 
[How do I get Mathematica to return a function call 
unevaluated?]\url{http://mathematica.stackexchange.com/questions/48349/how- 
do-i-get-mathematica-to-return-a-function-call-unevaluated} 
 
How do I get Mathematica to return a function call (conditionally) 
unevaluated? I expect this may use the slightly-mysterious Hold 
function. 
 
As a toy example, suppose I want to define AlgebraicQ such  ... 
 
- asked by Charles (9 votes), answered by Szabolcs (9 votes) 
 
---------------------------- 
 
[Why is plot legend 
unsafe?]\url{http://mathematica.stackexchange.com/questions/48291/why-is-pl 
ot-legend-unsafe} 
 
Every time I open a notebook contains a legend, I get the message 
warning that it's not safe. 
 
Why does this happen and how to fix it? 
 
- asked by xslittlegrass (9 votes), answered by Szabolcs (12 votes) 
 
---------------------------- 
 
[Faster way to compute the distance from a point to a surface in 
3D]\url{http://mathematica.stackexchange.com/questions/48565/faster-way-to- 
compute-the-distance-from-a-point-to-a-surface-in-3d} 
 
I am trying to compute the shortest distance between a point and a 
triangle in 3D 
 
distance[point_, {p1_, p2_, p3_}] := Module[{p, s, t, sol}, 
p = s*p1 + (1 - s)*(t*p2 + (1 - t)*p3); 
... 
 
- asked by tintin (8 votes), answered by RunnyKine (15 votes) 
 
---------------------------- 
 
[Does the syntax coloring I see indicate a real 
problem?]\url{http://mathematica.stackexchange.com/questions/48432/does-the 
-syntax-coloring-i-see-indicate-a-real-problem} 
 
I need a behaviour provided by: 
 
x = 2; 
Block[{x = HoldForm[x]}, x] 
 
x 
 
 
 
FrontEnd marks this syntax as not quite correct. 
 
It has not caused me any troubles so far so my question is: could it 
... 
 
- asked by Kuba (8 votes), answered by halirutan (6 votes) 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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 (18 votes), answered by rm -rf (23 votes) 
 
---------------------------- 
 
[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 (87 votes), answered by Silvia (117 votes) 
 
================================== 
Can you answer these? 
================================== 
 
[Diagonalization in 
parallel]\url{http://mathematica.stackexchange.com/questions/48416/diagonal 
ization-in-parallel} 
 
I would like to diagonalize one unitary non-sparse matrix of size 12870 
with complex number entries (not symbols, this is really a numerical 
problem). Is is possible to make eigensystem run in  ... 
 
- asked by lagoa (1 vote) 
 
---------------------------- 
 
[Package 
FiniteFields]\url{http://mathematica.stackexchange.com/questions/48379/pack 
age-finitefields} 
 
In a Mathematica session, I evaluate: 
 
Needs["FiniteFields`"]; 
fld = GF[2]; 
 
 
Now, for example, I'd like to compute $a^3+a^5$ for $a \in{Z_2}$. The 
result I'd like to have is $0$, because in $Z_2$,  ... 
 
- asked by user14545 (1 vote) 
 
---------------------------- 
[When to use indexed 
variables]\url{http://mathematica.stackexchange.com/questions/48602/when-to 
-use-indexed-variables} 
 
Still learning the fundamentals of the language I would like to ask you 
what advantages there might be in writing something like: 
 
a[1] = 2; 
a[2] = 4; 
a[3] = "x"; 
 
 
It seems to me that it is always  ... 
 
- asked by eldo (3 votes)

7.33 May 20 2014

================================== 
Top new questions this week: 
================================== 
 
[How can I get the color of overlapping disks to be equal in any 
order?]\url{http://mathematica.stackexchange.com/questions/47809/how-can-i- 
get-the-color-of-overlapping-disks-to-be-equal-in-any-order} 
 
When Graphics is used, necessarily the objects come in order. This 
affects which ones obscure others. When Opacity is not 1, it also 
affects the color. I would like the color of overlaps to depend  ... 
 
- asked by Russ Lyons (19 votes), answered by Mr.Wizard (9 votes) 
 
---------------------------- 
 
[Bug in mathematica analytic 
integration?]\url{http://mathematica.stackexchange.com/questions/48113/bug- 
in-mathematica-analytic-integration} 
 
I found Mathematica provides me a wrong answer for a relatively simple 
analytically solvable integral: 
 
Integrate[Exp[-I\[Theta]]/(1+b Cos[\[Theta]]),{\[Theta],0,2\[Pi]} 
Assumptions -&gt; b &lt; 1 &amp;&amp; b  ... 
 
- asked by user14456 (14 votes), answered by Artes (14 votes) 
 
---------------------------- 
 
[how to make a pie chart using custom 
image]\url{http://mathematica.stackexchange.com/questions/48078/how-to-make 
-a-pie-chart-using-custom-image} 
 
Can we make a pie chart using a costumed picture? 
For example, in representing the 0.1 cent, I would like to use this 
image and cut a piece out, and make a clickable pie chart. Any 
suggestions are  ... 
 
- asked by xslittlegrass (13 votes), answered by belisarius (20 votes) 
 
---------------------------- 
 
[Undocumented use of Integrate: Integrating over 
regions]\url{http://mathematica.stackexchange.com/questions/48166/undocumen 
ted-use-of-integrate-integrating-over-regions} 
 
I have come across a few questions asking about integrating over 
regions. And while the answers are impressive there should be a better 
more consistent way. So my question is, are there ways,  ... 
 
- asked by RunnyKine (12 votes), answered by RunnyKine (15 votes) 
 
---------------------------- 
 
[Rebuild a polygon so it doesn't self 
intersect]\url{http://mathematica.stackexchange.com/questions/48091/rebuild 
-a-polygon-so-it-doesnt-self-intersect} 
 
If you consider the following Polygon: 
 
coor = {{6, 0}, {6, 1}, {4, 0}, {5, 2}}; 
(* and coor = {{7, 2}, {7, 1}, {5, 2}, {6, 1}} *) 
pol = Polygon@coor; 
Graphics@pol 
 
I would like to know if there is  ... 
 
- asked by Oska (10 votes), answered by Rahul Narain (10 votes) 
 
---------------------------- 
 
[Exp is slower for some number 
ranges]\url{http://mathematica.stackexchange.com/questions/47982/exp-is-slo 
wer-for-some-number-ranges} 
 
I get a hit on performance with the Exp function depending on the range 
of my inputs.  for example, with: 
 
w1 = RandomComplex[-20000 I, {10000000}]; 
Exp[w1]; // Timing 
 
w2 = RandomComplex[-20 I,  ... 
 
- asked by user173743 (10 votes) 
 
---------------------------- 
 
[Determine frequency of 
oscillations]\url{http://mathematica.stackexchange.com/questions/47917/dete 
rmine-frequency-of-oscillations} 
 
I am wondering how I could determine the frequency of oscillations of a 
differential model equation? How could I find the frequency from this 
example given in Mathematica Documentation: 
 
s =  ... 
 
- asked by tarhawk (10 votes), answered by Daniel Lichtblau (15 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Generate a Unit Circle 
Trigonometry]\url{http://mathematica.stackexchange.com/questions/2456/gener 
ate-a-unit-circle-trigonometry} 
 
Struggling often with Trigonometry I would like to have some code to 
generate this Unit Circle Trigonometry. Would be of great help when I 
need to transform some data : 
 
- asked by 500 (13 votes), answered by Mark McClure (27 votes) 
 
---------------------------- 
 
[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 (37 votes), answered by kguler (24 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[How can I make sure that 3D plots have the exact same orientation and 
viewpoint?]\url{http://mathematica.stackexchange.com/questions/47996/how-ca 
n-i-make-sure-that-3d-plots-have-the-exact-same-orientation-and-viewpoin 
t} 
 
First off, I apologize that I can't come up with a simpler working 
example, but I only seem to have this problem with the larger examples. 
 
I am trying to make animations, using functions like the  ... 
 
- asked by Jason B (5 votes) 
 
---------------------------- 
 
[Why setting PlotPoints make my 3d contour plot 
broken?]\url{http://mathematica.stackexchange.com/questions/47924/why-setti 
ng-plotpoints-make-my-3d-contour-plot-broken} 
 
I'm trying to make a iso surface plot from some data using 
ContourPlot3d. My data is a 3 dimension data with form like 
{{x,y,f[x,y]},...}. I first make this data into 4d by rotating it along 
the x  ... 
 
- asked by xslittlegrass (2 votes) 
 
---------------------------- 
 
[What's the difference between variables with and without a 
subscript?]\url{http://mathematica.stackexchange.com/questions/48174/whats- 
the-difference-between-variables-with-and-without-a-subscript} 
 
If I input $x = a + b$, the $x$, $a$ and $b$ are blue. When I hit 
Shif+Enter, the $x$ turns black, indicating the kernel now knows this 
variable. But when I input $x_r = a + b$, and hit Shift+Enter,  ... 
 
- asked by user303446 (1 vote)

7.34 May 13, 2014

================================== 
Top new questions this week: 
================================== 
 
[Format and TeXForm does not work as 
expected]\url{http://mathematica.stackexchange.com/questions/47417/format-a 
nd-texform-does-not-work-as-expected} 
 
Recently, we had a nice question which brought up an issue that I 
believe is a bug. In the tutorial Defining Output Formats is an example 
at the end which doesn't make sense 
 
 
This specifies the  ... 
 
- asked by halirutan (12 votes), answered by halirutan (4 votes) 
 
---------------------------- 
 
[How to implement the Observer design 
pattern?]\url{http://mathematica.stackexchange.com/questions/47659/how-to-i 
mplement-the-observer-design-pattern} 
 
As a programmer with a history with procedural languages, the Observer 
design pattern inmediately springs to my mind when attacking certain 
class of problems, mostly UI/notifications related. 
 
A  ... 
 
- asked by Fallible (11 votes), answered by Leonid Shifrin (9 votes) 
 
---------------------------- 
 
[How should I reproduce this colorful swirling 
gif?]\url{http://mathematica.stackexchange.com/questions/47597/how-should-i 
-reproduce-this-colorful-swirling-gif} 
 
Surfing on the web, I came upon this cool gif: 
 
 
 
Does any one know how to reproduce this in Mathematica? I have some 
ideas myself, so I will try to answer this question as well. 
 
 
- asked by Ali (10 votes), answered by Kuba (20 votes) 
 
---------------------------- 
 
[How to create Line Chart with real third 
coordinates?]\url{http://mathematica.stackexchange.com/questions/47541/how- 
to-create-line-chart-with-real-third-coordinates} 
 
I would like to generate something like 3D Line Chart in Excel. Like the 
following figure 
 
 
 
but including third coordinates. 
 
Example 
 
I have a set of 2D data combied with 1D spatial data. 
 
dxy =  ... 
 
- asked by Vica (9 votes), answered by Yves Klett (2 votes) 
 
---------------------------- 
 
[How can I tell how much memory is taken by an 
expression?]\url{http://mathematica.stackexchange.com/questions/47491/how-c 
an-i-tell-how-much-memory-is-taken-by-an-expression} 
 
ByteCount and LeafCount don't really work, as shown below. 
 
Mathematica 9.0 .. on a 32 bit Windows machine. 
 
f[n_] := Block[{k = f[n - 1]}, {k, k}] 
f[0] = x 
 
 
LeafCount[f[k]]  for particular small  ... 
 
- asked by Richard Fateman (7 votes), answered by billisphere (5 votes) 
 
---------------------------- 
 
[Simplify with Assumptions 
Sqrt[(expr)^2]]\url{http://mathematica.stackexchange.com/questions/47548/si 
mplify-with-assumptions-sqrtexpr2} 
 
While trying to simplify expressions in the form Sqrt[(expr)^2] when 
expr&gt;0 I noticed a peculiar behavior that was not resolved with code 
from this Q&amp;A. 
 
Simplify[Sqrt[(x - y + a b c)^2], x - y  ... 
 
- asked by tchronis (6 votes), answered by Simon Woods (9 votes) 
 
---------------------------- 
 
[How to use PlotRange -> All with 
ListLogLinearPlot?]\url{http://mathematica.stackexchange.com/questions/4739 
3/how-to-use-plotrange-all-with-listloglinearplot} 
 
I would like to generate a ListLogLinearPlot that automatically shows 
all the data points. However the option PlotRange -&gt; All does not 
achieve this. Why does All not include all of the data in  ... 
 
- asked by Italianice (6 votes), answered by Alexey Popkov (3 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) 
 
---------------------------- 
 
[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? 
================================== 
 
[Module in numerical model for NonlinearModelFit is slow and leaks 
memory]\url{http://mathematica.stackexchange.com/questions/47562/module-in- 
numerical-model-for-nonlinearmodelfit-is-slow-and-leaks-memory} 
 
I am trying to make a NonlinearModelFit where the model is the result of 
a numerical calculation. My code works, but it is very slow and also 
seems to have a memory leak.  I'd appreciate advice about  ... 
 
- asked by jkrich (3 votes) 
 
---------------------------- 
 
[Quantities formatting 
problem]\url{http://mathematica.stackexchange.com/questions/47515/quantitie 
s-formatting-problem} 
 
So I've developed this simple code 
 
Mes /: MakeBoxes[Mes[mess_, error_, unit_], 
form : (StandardForm | TraditionalForm) : StandardForm 
] := RowBox[{ 
... 
 
- asked by Ranza (2 votes) 
 
---------------------------- 
 
[calling CUDA library 
functions]\url{http://mathematica.stackexchange.com/questions/47702/calling 
-cuda-library-functions} 
 
Mathematica has some predefined CUDA functions, like CUDAMap, 
CUDAFourier, etc. My question is how can one call functions which are 
part of CUDA library but not part of predefined Mathematica  ... 
 
- asked by user1188038 (1 vote) 

7.35 May 6, 2014

================================== 
Top new questions this week: 
================================== 
 
[May the Fourth be with 
you]\url{http://mathematica.stackexchange.com/questions/47268/may-the-fourt 
h-be-with-you} 
 
Happy Star Wars day.  I was playing around with the image manipulation 
functions in Mathematica in an attempt to recreate the Star Wars crawl. 
There's an HTML/CSS implementation which is in my  ... 
 
- asked by bobthechemist (18 votes), answered by Kuba (19 votes) 
 
---------------------------- 
 
[Mathematica 9 cannot solve a difference equation that Mathematica 8 
can]\url{http://mathematica.stackexchange.com/questions/47097/mathematica-9 
-cannot-solve-a-difference-equation-that-mathematica-8-can} 
 
Consider 
 
RSolve[{a[n + 1] == 2 a[n] + n (1 + 2^n), a[1] == 1}, a[n], n] 
 
 
Mathematica 8 can solve this quickly, but Mathematica 9, even after 
being allowed to run for a long time, cannot giva a  ... 
 
- asked by mathe (14 votes), answered by m_goldberg (3 votes) 
 
---------------------------- 
 
[Taking Top K 
Occurrences]\url{http://mathematica.stackexchange.com/questions/47120/takin 
g-top-k-occurrences} 
 
Having millions of numbers in a list, I want to take top K occurrences. 
MMA Commonest is very slow so I write my own versions: 
 
a=RandomInteger[{1,1000000},50000000]; 
 
... 
 
- asked by Mohsen Afshin (12 votes), answered by Mr.Wizard (11 votes) 
 
---------------------------- 
 
[Parametric Interpolation of 2D 
data]\url{http://mathematica.stackexchange.com/questions/47332/parametric-i 
nterpolation-of-2d-data} 
 
I want to create an interpolation through the following 2dim data 
points: 
 
data = {{22.78, 0.2431}, {22.06, 0.262}, {21.51, 0.2774}, {21.07, 
0.2905}, {20.7, 0.302}, {20.38, 0.3121}, {20.1,  ... 
 
- asked by Martin (11 votes), answered by bobthechemist (11 votes) 
 
---------------------------- 
 
[Importing an mx file into a 
context]\url{http://mathematica.stackexchange.com/questions/47110/importing 
-an-mx-file-into-a-context} 
 
Consider the following simple code which dumps the global context: 
 
var = 5; 
DumpSave["test.mx", "Global`"]; 
 
 
Now, in a new notebook, I would like to import var in another context. 
Trying 
 
... 
 
- asked by Massimo Ortolano (10 votes), answered by Leonid Shifrin (11 
votes) 
 
---------------------------- 
 
[Faster "stuttering" 
accumulate?]\url{http://mathematica.stackexchange.com/questions/47296/faste 
r-stuttering-accumulate} 
 
Given some list of arbitrary precision numbers, e.g. (actual lists are 
1M+ elements long): 
 
test={0, 2, 2, 47839283, 2, 0, 0, 2, 0, 1, 2, 0} 
 
 
I need to accumulate the list, but where a specified  ... 
 
- asked by rasher (9 votes), answered by Mr.Wizard (10 votes) 
 
---------------------------- 
 
[Why is this semicolon in 
red?]\url{http://mathematica.stackexchange.com/questions/47113/why-is-this- 
semicolon-in-red} 
 
I have a piece of code that works well, but when I put a semicolon after 
a plotting statement, the semicolon appears in red. What's the error? 
 
 
 
 
- asked by Mika Ike (9 votes), answered by Kuba (12 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Generate a Unit Circle 
Trigonometry]\url{http://mathematica.stackexchange.com/questions/2456/gener 
ate-a-unit-circle-trigonometry} 
 
Struggling often with Trigonometry I would like to have some code to 
generate this Unit Circle Trigonometry. Would be of great help when I 
need to transform some data : 
 
 
 
 
- asked by 500 (13 votes), answered by Mark McClure (27 votes) 
 
---------------------------- 
 
[Can Mathematica do symbolic linear 
algebra?]\url{http://mathematica.stackexchange.com/questions/3242/can-mathe 
matica-do-symbolic-linear-algebra} 
 
For instance, is there some way I can say "let A and B be arbitrary real 
$m\times n$ and $k\times m$ matrices, 
Simplify[Transpose[Transpose[A].Transpose[B]]]" and Mathematica would 
simplify it to B.A? 
... 
 
- asked by nikie (22 votes), answered by helen (11 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Travel time sweet spot using: Mathematica and Google Maps 
API]\url{http://mathematica.stackexchange.com/questions/47198/travel-time-s 
weet-spot-using-mathematica-and-google-maps-api} 
 
I want to use Mathematica to do some time minimisation calculations 
calling on Google Maps API for travel time data.  I'm concerned with 
travel time, e.g. along roads (by car or walk) and not linear  ... 
 
- asked by PeteCog (1 vote) 
 
---------------------------- 
 
[Graphics always rendered twice with SimpleFrontEnd 
example?]\url{http://mathematica.stackexchange.com/questions/47304/graphics 
-always-rendered-twice-with-simplefrontend-example} 
 
I am looking at the Java SimpleFrontEnd example provided by Mathematica. 
Everything goes well except it always renders graphics twice. 
 
 
 
Can anyone help me with this? 
 
BTW: I am using version 9 under  ... 
 
- asked by Michael (2 votes) 
 
---------------------------- 
 
[How to specify initial condition including integral equations in the 
case of the dirac 
equations?]\url{http://mathematica.stackexchange.com/questions/47358/how-to 
-specify-initial-condition-including-integral-equations-in-the-case-of-t 
he} 
 
Hi I am trying to solve a system of differential equation with NDSolve. 
The problem is I have like $3$ (maybe $5$) boundary conditions, but only 
$2$ differential equations. The equations to solve are  ... 
 
- asked by Terratoss (1 vote) 
 

7.36 April 15, 2014

================================== 
Top new questions this week: 
================================== 
 
[Programming paradigm 
change]\url{http://mathematica.stackexchange.com/questions/45829/programmin 
g-paradigm-change} 
 
I'm new to Mathematica, I've been learning by myself, and, being a Java 
developer for some time, it makes it hard to adapt. 
 
I've tried to solve a Reddit challenge, and I came up with this 
solution: 
 
... 
 
- asked by MHero (20 votes), answered by WReach (30 votes) 
 
---------------------------- 
 
[C Code generated from Mathematica not 
working?]\url{http://mathematica.stackexchange.com/questions/45619/c-code-g 
enerated-from-mathematica-not-working} 
 
I am a .Net developer. I'm trying to build a Visual C++ application 
using C code generated from Mathematica (by another person). I don't 
have Mathematica installed on my machine. When I try to compile  ... 
 
- asked by pag (10 votes) 
 
---------------------------- 
 
[What kind of check does DirectoryQ exactly 
perform?]\url{http://mathematica.stackexchange.com/questions/45793/what-kin 
d-of-check-does-directoryq-exactly-perform} 
 
I'm using Mathematica 9.0.1 on Windows XP and my drive letters are 
assigned as follows: C: and D: are hard local disks, while E: is 
assigned to some removable media. Now, the situation is as follows 
 
... 
 
- asked by mitochondrial (9 votes), answered by librik (12 votes) 
 
---------------------------- 
 
[What is the most efficient way to map a linked 
list?]\url{http://mathematica.stackexchange.com/questions/45593/what-is-the 
-most-efficient-way-to-map-a-linked-list} 
 
In order to work with lists effectively using common recursive patterns 
from functional programming, it's often most convenient to worked with 
the "linked list" representation, that looks like this: 
 
... 
 
- asked by Pillsy (8 votes), answered by Leonid Shifrin (9 votes) 
 
---------------------------- 
 
[How to protect functions in a Mathematica 
Package?]\url{http://mathematica.stackexchange.com/questions/45773/how-to-p 
rotect-functions-in-a-mathematica-package} 
 
I'm writing a Mathematica Package with many functions, but only two can 
be seen/public. I have: 
 
BeginPackage["VolumeReserves`"]; 
 
startInterface::usage = "..."; 
 
detailRock::usage = "..."; 
 
(*  ... 
 
- asked by Lory Lory (8 votes), answered by halirutan (8 votes) 
 
---------------------------- 
 
[How to change the appearance of a group 
opener?]\url{http://mathematica.stackexchange.com/questions/46082/how-to-ch 
ange-the-appearance-of-a-group-opener} 
 
I would like to change the GroupOpener appearance. In the present Mma 
design it is too small and can be missed by a reader unfamiliar with 
Mma. I know, how to change its color through the  ... 
 
- asked by Alexei Boulbitch (7 votes) 
 
---------------------------- 
 
[Equivalence under common 
permutations]\url{http://mathematica.stackexchange.com/questions/45851/equi 
valence-under-common-permutations} 
 
I have lists which consists of sublists of equal length. The outer list 
is regarded as a multiset (that is, permutations of the sublists don't 
matter, but repetitions do), but the order in the  ... 
 
- asked by celtschk (7 votes), answered by Leonid Shifrin (3 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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 (22 votes), answered by rcollyer (29 votes) 
 
---------------------------- 
 
[Problem with 
NonlinearModelFit]\url{http://mathematica.stackexchange.com/questions/2309/ 
problem-with-nonlinearmodelfit} 
 
I'm having trouble with a non-linear fit: 
 
fit = NonlinearModelFit[data, 
y0 + A Sin[\[Pi] (x - xc)/w], {y0, xc, A, w}, x] 
 
where data has about 15 thousand points and looks like this: 
 
 
 
The data  ... 
 
- asked by becko (14 votes), answered by Oleksandr R. (25 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Automatic replacing of [ with 
[]]\url{http://mathematica.stackexchange.com/questions/45992/automatic-repl 
acing-of-with} 
 
I tried to modify the KeyEventTranslations.tr file in order to always 
place a closed bracket instead of an open bracket once I press [. 
However once I press [ after the modification nothing happens  ... 
 
- asked by Max1 (6 votes) 
 
---------------------------- 
 
[Setting an initial value for 
ListAnimate?]\url{http://mathematica.stackexchange.com/questions/45892/sett 
ing-an-initial-value-for-listanimate} 
 
ListAnimate is fairly similar to Manipulate, but while Manipulate has a 
simple way to request an initial value for the manipulation parameter, I 
haven't found a way to tell ListAnimate to start with a  ... 
 
- asked by Steve (1 vote) 
 
---------------------------- 
 
[How can I select two lists from a list of lists so that I receive the 
system of equations has only rational 
solutions?]\url{http://mathematica.stackexchange.com/questions/45877/how-ca 
n-i-select-two-lists-from-a-list-of-lists-so-that-i-receive-the-system-o 
f} 
 
I want to make a sytem of equations has the form 
$$\begin{cases} 
a_1x^2+b_1y^2 + c_1xy+d_1x + e_1y+3=0,\\ 
a_2x^2+b_2y^2 + c_2xy+d_2x + e_2y+3=0. 
\end{cases}$$ 
so that the given system of equations has  ... 
 
- asked by minthao_2011 (1 vote)

7.37 April 1, 2014

================================== 
Top new questions this week: 
 
================================== 
 
[Creating sculptural forms using graphics 
primitives]\url{http://mathematica.stackexchange.com/questions/44858/creati 
ng-sculptural-forms-using-graphics-primitives} 
 
This is a question based on this answer by halirutan. 
 
Some amazing images can be created with this code, and I was wondering 
whether it was possible to extend the principle to different shapes. 
 
I  ... 
 
- asked by martin (16 votes), answered by Szabolcs (15 votes) 
 
---------------------------- 
 
[Making Monte Carlo simulation with 
ParallelTable]\url{http://mathematica.stackexchange.com/questions/44917/mak 
ing-monte-carlo-simulation-with-paralleltable} 
 
I would like to to MonteCarlo simulations of various regressions - 
basically, doing OLS under various conditions to test approaches. 
 
On my macpro  2x 2.8 GHz quad core Xeon, 32 Gb RAM DDR2 @ 667 Mhz,  ... 
 
- asked by guylhem (14 votes), answered by Szabolcs (7 votes) 
 
---------------------------- 
 
[Bug with SparseArray selector in 
Pick]\url{http://mathematica.stackexchange.com/questions/44868/bug-with-spa 
rsearray-selector-in-pick} 
 
I have created a notebook with two cells. This is the content of the 
first: 
 
g = Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 1 
\[UndirectedEdge] 3, 1 \[UndirectedEdge] 4, 4 \[UndirectedEdge]  ... 
 
- asked by Adam Reith (11 votes), answered by Istvan Zachar (8 votes) 
 
---------------------------- 
 
[Image Processing: Edge detection of the tumor on tomogram. Calculation area of the tumor] 
\url{http://mathematica.stackexchange.com/questions/44809/image-processing-edge-detection-of-the-tumor-on-tomogram-alculation-area-of-t} 
 
The task is to identify the image region of the tumor. 
 
 
 
I try to use example from documentation centre: 
 
tom1 = Import["http://i.stack.imgur.com/mZ4fR.jpg"]; 
tumor = SelectComponents[ 
... 
 
- asked by Alex Skudarev (10 votes), answered by halirutan (12 votes) 
 
---------------------------- 
 
[Applying non-Affine transforms to 2D polygons with 
textures]\url{http://mathematica.stackexchange.com/questions/44863/applying 
-non-affine-transforms-to-2d-polygons-with-textures} 
 
I am trying to create a vanishing point perspective transformation of 2D 
polygons, for example transforming the red polygon into the blue 
polygon: 
 
p1 = Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}]; 
p2 =  ... 
 
- asked by bobthechemist (8 votes), answered by Silvia (6 votes) 
 
---------------------------- 
 
[How does Mathematica understand branchcuts of the complex 
logarithm?]\url{http://mathematica.stackexchange.com/questions/44767/how-do 
es-mathematica-understand-branchcuts-of-the-complex-logarithm} 
 
Say I have the function $f(x) = x \tanh(\pi x) \log (x^2 +a^2)$ where 
$a$ is some positive real number. Then it seems to be me that 
Mathematica when given such a Log[] function implicitly puts a  ... 
 
- asked by user6818 (7 votes), answered by Jens (14 votes) 
 
---------------------------- 
 
[Morphological Components with periodic boundary 
conditions]\url{http://mathematica.stackexchange.com/questions/44924/morpho 
logical-components-with-periodic-boundary-conditions} 
 
I would like to find the connected(with periodic boundary conditions) 
components in a large binary matrix. What I've tried, and it does a fair 
job is: 
 
MorphologicalComponents[RandomInteger[{0, 1},  ... 
 
- asked by Ali (7 votes), answered by David Carraher (10 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Resources for beautiful Mathematica 
Stylesheets]\url{http://mathematica.stackexchange.com/questions/5846/resour 
ces-for-beautiful-mathematica-stylesheets} 
 
When the Wolfram Demonstrations were introduced and the 
Documentation-Center was redesigned, I remember it was the first time I 
thought someone had put some effort into creating a beautiful  ... 
 
- asked by halirutan (76 votes), answered by rm -rf (38 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 (31 votes), answered by Vitaliy Kaurov (17 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Challenge: Creating Compilable Permutations 
Function]\url{http://mathematica.stackexchange.com/questions/44949/challeng 
e-creating-compilable-permutations-function} 
 
As Mathematica's implemented Permuations function is not compilable I 
tried to write my very own Permutations implementation, called 
PermutationsNew, which I want to compile later on. Unfortunately  ... 
 
- asked by Wizard (1 vote) 
 
---------------------------- 
 
[Notation, Format and 
Interpretation]\url{http://mathematica.stackexchange.com/questions/44986/no 
tation-format-and-interpretation} 
 
I am unclear on the exact relationship between Notation, Format and 
Interpretation. 
Format[X] := Y seems similar to Notation[Y &lt;= X] for formating and 
Interpretation[X, Y] seems related to  ... 
 
- asked by Daniel Mahler (2 votes) 
 
---------------------------- 
 
[Speed up 
MinimalPolynomial]\url{http://mathematica.stackexchange.com/questions/44763 
/speed-up-minimalpolynomial} 
 
My Mathematica code runs slowly 
 
MinimalPolynomial[Sqrt[2] + Sqrt[3]+ Sqrt[5]+ Sqrt[7]+ Sqrt[11]+ 
Sqrt[13], x] 
 
 
runs slowly, but the Maple version 
 
... 
 
- asked by user13209 (1 vote)

7.38 March 25, 2014

================================== 
Top new questions this week: 
================================== 
 
[How to make a curve selectable from a scaned image and convert it to a 
list of 
coordinates]\url{http://mathematica.stackexchange.com/questions/44355/how-t 
o-make-a-curve-selectable-from-a-scaned-image-and-convert-it-to-a-list-o 
f-c} 
 
I have a scanned image (binary-ized): 
 
 
 
Is there any way to reduce one of these curved lines (full or dotted) to 
a series of its coordinates (e.g., sampling interval of 0.01 on x-axis)? 
 
I've read  ... 
 
- asked by Tough Kid (10 votes), answered by Alexei Boulbitch (11 votes) 
 
---------------------------- 
 
[Alternating 
sum]\url{http://mathematica.stackexchange.com/questions/44564/alternating-s 
um} 
 
A frog is at the bottom of a 30 metre well. Each day it climbs 5 metres 
up the side, but it then slips back 3 metres each night. How long does 
it take to reach the top of the well? 
 
Is there an easier  ... 
 
- asked by martin (7 votes), answered by Leonid Shifrin (5 votes) 
 
---------------------------- 
 
[How to extract the edge from a set of 
points]\url{http://mathematica.stackexchange.com/questions/44694/how-to-ext 
ract-the-edge-from-a-set-of-points} 
 
I have an accumulation of points representing a body as you can see in 
the image below. From this data I want to generate a list of points or a 
curve, which is the envelope. 
 
 
 
The first idea was a  ... 
 
- asked by zeckra (6 votes), answered by halirutan (4 votes) 
 
---------------------------- 
 
[Map of Specific US States? 
(Isolated)]\url{http://mathematica.stackexchange.com/questions/44505/map-of 
-specific-us-states-isolated} 
 
My question here is fairly basic, and I'm sure I'm overlooking something 
basic. I know about CountryData for creating shapes of entire countries, 
and it works, to an extent; I can plot geographical  ... 
 
- asked by Smith W. (6 votes), answered by Pickett (5 votes) 
 
---------------------------- 
 
[Exporting EPS figures with dashing from 
ListPlot]\url{http://mathematica.stackexchange.com/questions/44560/exportin 
g-eps-figures-with-dashing-from-listplot} 
 
I am having difficulties exporting EPS figures. 
If I use the LineLegend option to create a dashed or a dot-dashed line, 
it seems ok in Mathematica 9.0 e.g.: 
 
 
 
But the problem came out when the  ... 
 
- asked by Qu8k (5 votes), answered by george2079 (6 votes) 
 
---------------------------- 
 
[How to import a large (~50Mb) json file in 
mathematica]\url{http://mathematica.stackexchange.com/questions/44671/how-t 
o-import-a-large-50mb-json-file-in-mathematica} 
 
I am trying to import a 46Mb json file into mathematica (which by the 
way I exported using mathematica) but its failing with the following 
messages: 
 
Java::pexcptn: A Java exception occurred after the  ... 
 
- asked by Trollkemada (5 votes), answered by Sjoerd C. de Vries (4 
votes) 
 
---------------------------- 
 
[How to select only NotebookObjects that are referring to ordinary 
notebooks? (not palettes 
etc.)]\url{http://mathematica.stackexchange.com/questions/44588/how-to-sele 
ct-only-notebookobjects-that-are-referring-to-ordinary-notebooks-no} 
 
There is of course function 
 
Notebooks[] 
 
 
 
 
 
 
But, unfortunatelly it hasn't got useful options in this context. 
 
My question is how to pick Notebooks excluding: 
 
 
Help, 
Palettes, 
Packages, 
... 
 
- asked by Kuba (5 votes), answered by Kuba (3 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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 (31 votes), answered by Vitaliy Kaurov (17 votes) 
 
---------------------------- 
 
[Problem with 
NonlinearModelFit]\url{http://mathematica.stackexchange.com/questions/2309/ 
problem-with-nonlinearmodelfit} 
 
I'm having trouble with a non-linear fit: 
 
fit = NonlinearModelFit[data, 
y0 + A Sin[\[Pi] (x - xc)/w], {y0, xc, A, w}, x] 
 
where data has about 15 thousand points and looks like this: 
 
 
 
The data  ... 
 
- asked by becko (14 votes), answered by Oleksandr R. (23 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Maintaining postfix convention for directives in 
notebooks]\url{http://mathematica.stackexchange.com/questions/44606/maintai 
ning-postfix-convention-for-directives-in-notebooks} 
 
It seems to be a fairly common convention to write certain 'meta' 
functions in postfix form like 
 
f[x] // Simplify 
 
 
to keep the the mathematical content at the front separate from the 
various  ... 
 
- asked by Daniel Mahler (2 votes) 
 
---------------------------- 
 
[Function behavior based on 
Head]\url{http://mathematica.stackexchange.com/questions/44425/function-beh 
avior-based-on-head} 
 
I'm figuring how to implement a function behavior based on the Head of 
its argument. 
 
I mean 
 
Unprotect@Head; 
Head[p_[x]]:= Kind; 
Protect@Head; 
function[h_]:= 0; 
function[p_Kind]:= 1; 
 
Head[f[x]] 
... 
 
- asked by Fabio (1 vote) 
 
---------------------------- 
 
[Controlling output of graphics, the role of ";" and code 
structure/formatting]\url{http://mathematica.stackexchange.com/questions/44 
630/controlling-output-of-graphics-the-role-of-and-code-structure-format 
ting} 
 
";" is described under Compound Expression as a delimiter, such that 
only the output of the last item in the compund expression is given. 
 
Situation: 
 
1/ Print[] produces output whether followed by  ... 
 
- asked by Julian Moore (1 vote)

7.39 March 18, 2014

================================== 
Top new questions this week: 
================================== 
 
[What does ImageSize -> 1 -> 1 
mean?]\url{http://mathematica.stackexchange.com/questions/43820/what-does-i 
magesize-1-1-mean} 
 
On the page 
http://www.wolfram.com/language/gallery/blur-faces-in-an-image/ the 
example code has ImageSize -&gt; 1 -&gt; 1. I am unfamiliar with this 
chaining of rules... What does it mean?  Note I  ... 
 
- asked by PeterR (16 votes), answered by rm -rf (13 votes) 
 
---------------------------- 
 
[Web Browser Screen 
Shot]\url{http://mathematica.stackexchange.com/questions/44099/web-browser- 
screen-shot} 
 
I have Safari, Opera, Chrome, Firefox and IE installed how might a get a 
browser screen shot of a set of HTML code from inside Mathematica(for 
any of those browsers)? 
 
 
 
(Image is optional) 
 
The  ... 
 
- asked by Liam William (15 votes), answered by WReach (23 votes) 
 
---------------------------- 
 
[What is the fastest way to extract a substring from a huge 
string?]\url{http://mathematica.stackexchange.com/questions/44175/what-is-t 
he-fastest-way-to-extract-a-substring-from-a-huge-string} 
 
I develop an algorithm to find the most common substrings of a given 
length n up to a certain distance l in front of a pattern p in a huge 
sequence S. E.g. I want to find the most common hexamers  ... 
 
- asked by g3kk0 (8 votes), answered by Leonid Shifrin (9 votes) 
 
---------------------------- 
 
[Fast way of finding position of Interval containing an 
Integer]\url{http://mathematica.stackexchange.com/questions/43885/fast-way- 
of-finding-position-of-interval-containing-an-integer} 
 
I have a large list (about 2.2 million) of pairs of integers. Each pair 
defines an Interval[{}]. Given some integer x, I need to find the 
position of the interval in my list that bounds x (or  ... 
 
- asked by user1375062 (8 votes), answered by Leonid Shifrin (12 votes) 
 
---------------------------- 
 
[How to calcuate the sum of 1/x, where x is an integer not containing the digit 9 and 10,000,000 <= x <= 88,888,888] 
\url{http://mathematica.stackexchange.com/questions/43919/how-to-calcuate-the-sum-of-1-x-where-x-is-an-integer-not-containing-the-digit-9} 
 
My code is: 
 
nonine[x_] := If[StringMatchQ[IntegerString[x], "*9*"], False, True]; 
SetAttribute[nonine, Listable]; 
 
tbl = Select[Range[10^2, 888], nonine[#] &amp;]; 
 
Total[1.0/tbl] 
 
 
got out of memory  ... 
 
- asked by user2218402 (7 votes), answered by Simon Woods (10 votes) 
 
---------------------------- 
 
[Compile function which calls other functions to 
C]\url{http://mathematica.stackexchange.com/questions/44226/compile-functio 
n-which-calls-other-functions-to-c} 
 
I have a function which calls other functions and I would like to 
compile it to C code. For example: 
 
foo[p_] := 0.7 Exp[-p^2] 
f[a_, n_] := 
Module[{s, p, i}, s = 0; p = a; 
For[i = 0, i &lt; n,  ... 
 
- asked by Danvil (6 votes), answered by halirutan (7 votes) 
 
---------------------------- 
 
[Mathematica-To-MATLAB 
Dictionary!]\url{http://mathematica.stackexchange.com/questions/44223/mathe 
matica-to-matlab-dictionary} 
 
Is there a dictionary to translate Mathematica functions and commands to 
MATLAB? 
 
 
- asked by Behzad (6 votes), answered by ndetermin (4 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Problem with 
NonlinearModelFit]\url{http://mathematica.stackexchange.com/questions/2309/ 
problem-with-nonlinearmodelfit} 
 
I'm having trouble with a non-linear fit: 
 
fit = NonlinearModelFit[data, 
y0 + A Sin[\[Pi] (x - xc)/w], {y0, xc, A, w}, x] 
 
where data has about 15 thousand points and looks like this: 
 
 
 
The data  ... 
 
- asked by becko (14 votes), answered by Oleksandr R. (23 votes) 
 
---------------------------- 
 
[How to find the phase difference of two sampled sine 
waves?]\url{http://mathematica.stackexchange.com/questions/11046/how-to-fin 
d-the-phase-difference-of-two-sampled-sine-waves} 
 
I'm trying to measure a phase difference between two Sine functions I've 
acquired with a computer. I'm uploading one of the .txt files with the 
data I'm working with here: txt file. To remove the  ... 
 
- asked by Juan (20 votes), answered by bill s (18 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[RSolve: Errors while solving Partial Difference 
Equation]\url{http://mathematica.stackexchange.com/questions/44194/rsolve-e 
rrors-while-solving-partial-difference-equation} 
 
I tried solving following partial difference equation in Mathematica by 
typing 
 
RSolve[{C[n, k] == C[n-1, k] + C[n-1, k-1], C[n, 0] == 1, C[n, n] == 1}, 
C[n, k], {n, k}] 
 
 
but returns the following  ... 
 
- asked by user136040 (1 vote) 
 
---------------------------- 
 
[How to apply an rule to factors matching a certain 
form]\url{http://mathematica.stackexchange.com/questions/43903/how-to-apply 
-an-rule-to-factors-matching-a-certain-form} 
 
Suppose we have many expressions involving irrational ArcTan expressions 
(such as ArcTan[Sqrt[3],5]) along with other irrational factors (such as 
1/Sqrt[2]). 
 
I want to simplify all of these  ... 
 
- asked by Steve (1 vote) 
 
---------------------------- 
 
[How to make noncommutative multiplication agree with commutative 
multiplication]\url{http://mathematica.stackexchange.com/questions/44157/ho 
w-to-make-noncommutative-multiplication-agree-with-commutative-multiplic 
ation} 
 
I need a noncommutative multiplication that is 
 
 
Associative 
Distributive 
$A**0=0$, $A**1=A$ 
Agrees with the commutative multiplication ($A**(k B)=(k A)**B=k 
(A**B)$) 
 
 
I have found a code 
 
... 
 
- asked by 8k14 (1 vote)

7.40 March 11, 2014

================================== 
Top new questions this week: 
================================== 
 
[Most influential and/or disrupting features introduced with new 
versions of 
Mathematica]\url{http://mathematica.stackexchange.com/questions/43631/most- 
influential-and-or-disrupting-features-introduced-with-new-versions-of-m 
ath} 
 
This is something that has been bugging me for ages. 
 
With every upgrade, Mathematica has added new functionalities and 
amendend some of its bugs. In the process, though, some older 
functionality has  ... 
 
- asked by Peltio (11 votes), answered by Mark Adler (3 votes) 
 
---------------------------- 
 
[Fast way to get positions of "boxed" array 
elements?]\url{http://mathematica.stackexchange.com/questions/43557/fast-wa 
y-to-get-positions-of-boxed-array-elements} 
 
Given a 2D array (arbitrary numeric / evaluates to numeric elements, 
simplified for examples, and can be arbitrary dimensions so long as the 
operation makes sense, I'm working with 2K X 2K in my  ... 
 
- asked by rasher (9 votes), answered by rasher (6 votes) 
 
---------------------------- 
 
[Drop selection of columns from a ragged 
array]\url{http://mathematica.stackexchange.com/questions/43785/drop-select 
ion-of-columns-from-a-ragged-array} 
 
I have an application where I need to drop some arbitrary list of 
columns from a ragged array (where of course the shortest array rows 
have at least all the specified columns). 
 
E.g., given a ragged  ... 
 
- asked by rasher (8 votes), answered by Mr.Wizard (6 votes) 
 
---------------------------- 
 
[How to match a cyclically repeating 
sequence?]\url{http://mathematica.stackexchange.com/questions/43801/how-to- 
match-a-cyclically-repeating-sequence} 
 
I have run across several times recently where I must match a sequence 
that is cyclically repeating. For example, with the sequence, 
 
Sequence[a, b, c] 
 
 
how would I write a pattern that matched  ... 
 
- asked by rcollyer (7 votes), answered by rm -rf (3 votes) 
 
---------------------------- 
 
[Is there a function which instantly tells you whether an element is 
part of a 
list?]\url{http://mathematica.stackexchange.com/questions/43541/is-there-a- 
function-which-instantly-tells-you-whether-an-element-is-part-of-a-li} 
 
I have a very long list of numbers and I want to check whether there's a 
function (something that would look like PartOfQ[element,list]) that 
tells you immediately with a True or False as to whether  ... 
 
- asked by Aron (7 votes), answered by Szabolcs (7 votes) 
 
---------------------------- 
 
[Suppress connection to Wolfram|Alpha when making unit 
conversions]\url{http://mathematica.stackexchange.com/questions/43515/suppr 
ess-connection-to-wolframalpha-when-making-unit-conversions} 
 
I want to speed up calculations with unit conversions. I suspect 
primarily that some units evaluate from Wolfram|Alpha. Any way to 
prevent this automatically, so that Mathematica throws  ... 
 
- asked by denfromufa (7 votes), answered by rm -rf (5 votes) 
 
---------------------------- 
 
[How to handle keyboard events for unselected item in 
CDF?]\url{http://mathematica.stackexchange.com/questions/43432/how-to-handl 
e-keyboard-events-for-unselected-item-in-cdf} 
 
How can I force the keyboard input to work for this cell without 
clicking on it after I evaluate or showing a blinking selection cursor? 
This is for running CDF games in a browser. 
 
pos = {0, 0}; 
... 
 
- asked by Michael Hale (6 votes), answered by Michael Hale (3 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[3D heatmap density 
plot]\url{http://mathematica.stackexchange.com/questions/17260/3d-heatmap-d 
ensity-plot} 
 
I have a set of data that looks like {{x1, y1, z1}, {x2, y2, z2}, ...} 
so it describes points in 3D space. I want to make a heatmap out of this 
data. So that points with a high density are shown as a  ... 
 
- asked by norty (25 votes), answered by PlatoManiac (27 votes) 
 
---------------------------- 
 
[Plotting the frequency spectrum of a data series using 
Fourier]\url{http://mathematica.stackexchange.com/questions/18082/plotting- 
the-frequency-spectrum-of-a-data-series-using-fourier} 
 
testData = Table[N@Sin[500 x], {x, 0, 100}]; 
ListLinePlot[Abs[Fourier[testData]], PlotRange -&gt; Full] 
 
 
Gives me 
 
 
 
Which I do not expect because the Fourier Transform is 
FourierTransform[Sin[500  ... 
 
- asked by Pickett (7 votes), answered by KennyColnago (8 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Fourier transformation of HeavisideTheta 
functions]\url{http://mathematica.stackexchange.com/questions/43445/fourier 
-transformation-of-heavisidetheta-functions} 
 
I want to find 2D-Fourier transformation of the function given below 
 
f = HeavisideTheta[y1]*HeavisideTheta[y2 - y1] 
 
 
For the purpose, I use built-in function in two ways as below, 
 
... 
 
- asked by user58226 (3 votes) 
 
---------------------------- 
 
[Autocomplete from inside Module and 
SetDelayed]\url{http://mathematica.stackexchange.com/questions/43393/autoco 
mplete-from-inside-module-and-setdelayed} 
 
Autocomplete in Mathematica 9 offers suggestions from inside SetDelayed 
and Module. For example, after running: 
 
func[thing1_, thing2_] := thing1 + thing2; 
Module[{thing3}, 
thing3 = 10; 
thing3 + 4 
] 
... 
 
- asked by Italianice (1 vote) 
 
---------------------------- 
 
[Slow mixture fitting when having ill-conditioned covariance matrices. 
How to make it 
faster?]\url{http://mathematica.stackexchange.com/questions/43592/slow-mixt 
ure-fitting-when-having-ill-conditioned-covariance-matrices-how-to-mak} 
 
I'm using Mathematica 9.0 to fit multidimensional observations with a 
gaussian mixture. To do so I first adapted these steps to ensure that 
the mixture parameters are well defined (see  ... 
 
- asked by p-d (1 vote)

7.41 March 4, 2014

================================== 
Top new questions this week: 
================================== 
 
[How can I add drop shadows and specular highlights to 2D 
graphics?]\url{http://mathematica.stackexchange.com/questions/43186/how-can 
-i-add-drop-shadows-and-specular-highlights-to-2d-graphics} 
 
I thought I'd share some code in the form of a self-answered question, 
but other answers are of course welcome. 
 
Drop shadows are a familiar visual effect, giving the impression of a 
graphical element  ... 
 
- asked by Simon Woods (26 votes), answered by Simon Woods (29 votes) 
 
---------------------------- 
 
[Are greek symbols causing different 
evaluation?]\url{http://mathematica.stackexchange.com/questions/43108/are-g 
reek-symbols-causing-different-evaluation} 
 
I've updated today to Mathematica 9.0.1.0 from version 8 and found 
something that absolutely confuses me. 
Let us define a piecewise function: 
 
gr[x_, v1_, v2_, v3_, v4_, v5_] = 
Piecewise[{{g, v1  ... 
 
- asked by Mike (14 votes) 
 
---------------------------- 
 
[How to make a function with its own options as well as passing options 
to other 
functions]\url{http://mathematica.stackexchange.com/questions/43088/how-to- 
make-a-function-with-its-own-options-as-well-as-passing-options-to-other 
> } 
 
I have a function with many of its own options, but I would also like to 
pass options to subfunctions using the FilterRules function.  Here's a 
simple example: 
 
Options[pfunc] = {"test" -&gt; True}; 
... 
 
- asked by Jason B (11 votes), answered by rm -rf (8 votes) 
 
---------------------------- 
 
[Why the Block command does not forget the $ContextPath 
variable]\url{http://mathematica.stackexchange.com/questions/43137/why-the- 
block-command-does-not-forget-the-contextpath-variable} 
 
I do not understand this behavior: 
 
method[args_] := 
(* forget the context path *) 
Block[{$ContextPath}, 
(* should given nothing, right? *) 
Print["cpath=", $ContextPath]; 
... 
 
- asked by zorank (11 votes), answered by Szabolcs (8 votes) 
 
---------------------------- 
 
[Third argument of 
Compile]\url{http://mathematica.stackexchange.com/questions/43128/third-arg 
ument-of-compile} 
 
In his last comment on this answer, halirutan shows an example in which 
the third argument of Compile does not have any effect. The example is 
as follows. 
 
cfu = Compile[{}, Module[{y = {}},  ... 
 
- asked by Jacob Akkerboom (11 votes), answered by halirutan (5 votes) 
 
---------------------------- 
 
[Plot Matlab 
icon]\url{http://mathematica.stackexchange.com/questions/43012/plot-matlab- 
icon} 
 
I started to explore this on a whim and hasn't succeeded yet Some 
introduction for the icon is found here but I can't understand it very 
well. (I admit that, though playing with NDSolve a lot, I  ... 
 
- asked by xzczd (8 votes), answered by episanty (10 votes) 
 
---------------------------- 
 
[Why does Plot[Hold[x], {x,0,1}] 
work?]\url{http://mathematica.stackexchange.com/questions/43318/why-does-pl 
otholdx-x-0-1-work} 
 
It appears that, counter to my expectation, all of these (and probably 
many others) seem to work fine: 
 
Plot[Hold[x], {x, 0, 10}] 
 
FindRoot[Hold[x^2 == 2], {x, 1}] 
 
NMinimize[Hold[x^2], x] 
 
 
I would  ... 
 
- asked by Szabolcs (8 votes), answered by Michael E2 (5 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Plotting the frequency spectrum of a data series using 
Fourier]\url{http://mathematica.stackexchange.com/questions/18082/plotting- 
the-frequency-spectrum-of-a-data-series-using-fourier} 
 
testData = Table[N@Sin[500 x], {x, 0, 100}]; 
ListLinePlot[Abs[Fourier[testData]], PlotRange -&gt; Full] 
 
 
Gives me 
 
 
 
Which I do not expect because the Fourier Transform is 
FourierTransform[Sin[500  ... 
 
- asked by Pickett (7 votes), answered by KennyColnago (8 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 (45 votes), answered by J.M. (41 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Is there a package or canonical way for writing test harnesses in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/43014/is-t 
here-a-package-or-canonical-way-for-writing-test-harnesses-in-mathematic 
a} 
 
I've written a complicated function foo.1 
 
I'd now like to simplify this function's code, and later enhance it with 
more features. With each change, however, I'd like to be confident that 
I'm not  ... 
 
- asked by acheong87 (2 votes) 
 
---------------------------- 
 
[Young Tableaux 
Miscellanea]\url{http://mathematica.stackexchange.com/questions/43157/young 
-tableaux-miscellanea} 
 
I have a problem which is mostly neatly described by using Young 
Tableaux.  Mathematica seems to have these Tableaux built in, except 
that the Tableaux function is only in Combinatorica.  When I  ... 
 
- asked by evanb (2 votes) 
 
---------------------------- 
 
[Assign a value to a variable without using Set or 
SetDelayed?]\url{http://mathematica.stackexchange.com/questions/43306/assig 
n-a-value-to-a-variable-without-using-set-or-setdelayed} 
 
I supose probably yes, but at the end I assume that internally 
mathematica has to use Set or SetDelayed. Am I right? 
 
Background: I am developing a super simple phraser that takes a code 
description  ... 
 
- asked by zorank (1 vote) 

7.42 February 25, 2014

================================== 
Top new questions this week: 
================================== 
 
[Implementing a Beeswarm plot in 
Mathematica]\url{http://mathematica.stackexchange.com/questions/42585/imple 
menting-a-beeswarm-plot-in-mathematica} 
 
I am looking for a Beeswarm plot implementation in Mathematica. 
 
Consider the following data: 
 
data = {RandomVariate[NormalDistribution[], 100], 
RandomVariate[NormalDistribution[], 100]}; 
 
 
Lets  ... 
 
- asked by Pam (16 votes), answered by Szabolcs (10 votes) 
 
---------------------------- 
 
[Object differentiation in 
image]\url{http://mathematica.stackexchange.com/questions/42809/object-diff 
erentiation-in-image} 
 
After purchasing a box of alphabet pasta for the kids, I wondered if 
there was way to extract the frequency of appearance of letters in the 
box by taken a sample and the analyzing the picture. 
 
i =  ... 
 
- asked by PatoCriollo (10 votes), answered by lalmei (2 votes) 
 
---------------------------- 
 
[Why does $Failed have attribute 
HoldAll?]\url{http://mathematica.stackexchange.com/questions/42531/why-does 
-failed-have-attribute-holdall} 
 
Why does $Failed have attribute HoldAll?  Are there typical situations 
where $Failed is returned as a head that must not evaluate further, or 
is this just a relic from Mathematica's early times? 
 
... 
 
- asked by Szabolcs (9 votes), answered by Leonid Shifrin (6 votes) 
 
---------------------------- 
 
[When running Mathematica from a Linux terminal, how can I prevent a 
script from terminating upon 
logout?]\url{http://mathematica.stackexchange.com/questions/42838/when-runn 
ing-mathematica-from-a-linux-terminal-how-can-i-prevent-a-script-from} 
 
I am running Mathematica on a remote Linux cluster, by the terminal, 
using the math command.  (I do not have access to a terminal GUI.  For 
example, when I type the command mathematica, I get this  ... 
 
- asked by Andrew (8 votes), answered by Stefan (12 votes) 
 
---------------------------- 
 
[Deleting quasi-duplicates from large list 
efficiently]\url{http://mathematica.stackexchange.com/questions/42599/delet 
ing-quasi-duplicates-from-large-list-efficiently} 
 
I have the need to remove "duplicates" from large (>10K members) lists, 
where a "duplicate" is either a verbatim duplication, or the element's 
second entry exists as a first entry for some "earlier"  ... 
 
- asked by rasher (8 votes), answered by Mr.Wizard (9 votes) 
 
---------------------------- 
 
[Export an image at 1000 
dpi]\url{http://mathematica.stackexchange.com/questions/42519/export-an-ima 
ge-at-1000-dpi} 
 
I'm trying to export an image at 1000 dpi. The author guide of a lot of 
papers wants this resolution! Then I must to import this image in Word 
in a small box; let's say 7x4 cm. This is the code that I  ... 
 
- asked by Mary (8 votes), answered by Szabolcs (10 votes) 
 
---------------------------- 
 
[Generating Gelfand-Tsetlin 
patterns]\url{http://mathematica.stackexchange.com/questions/42745/generati 
ng-gelfand-tsetlin-patterns} 
 
I am doing some research on some combinatorial object called 
GT-patterns. 
They are generated from three parts of data. 
 
Two integer, partitions (sequences of weakly decreasing numbers), 
$\lambda =  ... 
 
- asked by Paxinum (7 votes) 
 
 
================================== 
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 (34 votes), answered by programming_historian 
(14 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 (21 votes), answered by belisarius (26 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Transform an expression to remove the 
singularity]\url{http://mathematica.stackexchange.com/questions/42634/trans 
form-an-expression-to-remove-the-singularity} 
 
I have the expression Sin[c x]/c. Clearly it is undefined at $c=0$, but 
that is merely a removable singularity, since 
$$\frac{\sin(cx)}c=x\frac{\sin(cx)}{cx}= x\operatorname{sinc}(cx),$$ 
which is  ... 
 
- asked by Rahul Narain (4 votes) 
 
---------------------------- 
 
[Highlighting Mathematica code in LaTeX 
document]\url{http://mathematica.stackexchange.com/questions/42793/highligh 
ting-mathematica-code-in-latex-document} 
 
I was thinking about the best way to include Mathematica code in a LaTeX 
document with a nice syntax highlighting. 
 
I have tried the packages listings and minted (with pygments), which 
both claim to  ... 
 
- asked by Eckhard (5 votes) 
 
---------------------------- 
 
[Is there a way to tell mathematica to minimize the number of 
multiplication in an expression? (Simplify and FullSimplify don't cut 
it)]\url{http://mathematica.stackexchange.com/questions/42611/is-there-a-wa 
y-to-tell-mathematica-to-minimize-the-number-of-multiplication-in-a} 
 
I have an expression, here's a clip of it: 
 
 
...LF (LG LQ Lsig^2 + 2 LQ Lsig RG Rl + LG LQ Rl^2 + Lsig^2 RG RQ + 
2 LG Lsig Rl RQ + 2 LQ Lsig RG Rs + 2 LG LQ Rl Rs + 
2 LG Lsig RQ Rs + LG  ... 
 
- asked by bwna (2 votes)

7.43 February 18, 2014

================================== 
Top new questions this week: 
================================== 
 
[Highlight Pie in 
PieChart]\url{http://mathematica.stackexchange.com/questions/42201/highligh 
t-pie-in-piechart} 
 
PieChart has the nice functionality of highlighting a single pie when 
you click on it. It is then sticking out a little. 
See the following example: 
 
PieChart[{1, 2, 3}] 
 
 
 
 
Now, if I click on the  ... 
 
- asked by Markus Roellig (20 votes), answered by Simon Woods (20 votes) 
 
---------------------------- 
 
[M9 performance regression for 
Fold?]\url{http://mathematica.stackexchange.com/questions/42419/m9-performa 
nce-regression-for-fold} 
 
I noticed an over 10x performance drop on Mathematica v9.0.1 (as 
Oleksandr R. commented, also v8) compared with v7.01 for this code: 
 
SetSystemOptions["CatchMachineUnderflow" -&gt; False]; 
... 
 
- asked by Yi Wang (16 votes) 
 
---------------------------- 
 
[Finding the intersection of a curve with an interpolation 
function]\url{http://mathematica.stackexchange.com/questions/42304/finding- 
the-intersection-of-a-curve-with-an-interpolation-function} 
 
There are no issues trying to find the intersection points of two 
defined curves. 
 
f[x_] := 2 (x - 1) (x - 1.5) (x - .5) (x + .5) (x + 1) (x + 1.5); 
g[x_] := 0.4 x - 0.4; 
Solve[f[x] ==  ... 
 
- asked by PatoCriollo (13 votes), answered by Daniel Lichtblau (12 
votes) 
 
---------------------------- 
 
[How to find out what files are touched when Get is 
called?]\url{http://mathematica.stackexchange.com/questions/42453/how-to-fi 
nd-out-what-files-are-touched-when-get-is-called} 
 
Is there a way to capture all package files touched whenever a package 
is called via Get, Needs, Beginpackage or similar? 
 
While FindFile["package`"] can point to the first file that is called, 
the  ... 
 
- asked by Istvan Zachar (11 votes), answered by Istvan Zachar (11 
votes) 
 
---------------------------- 
 
[Rearranging a 
List]\url{http://mathematica.stackexchange.com/questions/42219/rearranging- 
a-list} 
 
I am trying to rearrange/sort a list i.e. 
 
{{1,2},{10,140},{43,10},{1,140},{43,2}} 
 
 
into 
 
{{1,2},{2,43},{43,10},{10,140},{140,1}} 
 
 
or any cyclic permutation of it. 
The numbers don't repeat more  ... 
 
- asked by lalmei (9 votes), answered by Leonid Shifrin (6 votes) 
 
---------------------------- 
 
[What are the differences between library call back functions and 
WolframCompileLibrary 
macros?]\url{http://mathematica.stackexchange.com/questions/42409/what-are- 
the-differences-between-library-call-back-functions-and-wolframcompilel> 
) 
 
I'm trying to use LibraryLink in Mathematica, and come across some 
problems. 
 
Consider if we have a MTensor m1 which contains a one dimensional double 
array, and I want to get the data of that array.  ... 
 
- asked by xslittlegrass (8 votes), answered by halirutan (6 votes) 
 
---------------------------- 
 
[How does PlotLegends actually work with 
ListPlot3D?]\url{http://mathematica.stackexchange.com/questions/42262/how-d 
oes-plotlegends-actually-work-with-listplot3d} 
 
I'm sensing this might be a rookie mistake but normally I roll my own 
legends but decided to try the built in legends for a ListPlot3D. 
PlotLegends is listed as an option for ListPlot3D but curiously  ... 
 
- asked by Mike Honeychurch (8 votes), answered by rm -rf (10 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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) 
 
---------------------------- 
 
[What Mathematica book to 
buy?]\url{http://mathematica.stackexchange.com/questions/5059/what-mathemat 
ica-book-to-buy} 
 
I have used Mathematica for several years but at a pretty low level - 
piecing together built-in function inefficiently and fearing the sight 
of # and &amp;'s when I see others use them (I never do). I  ... 
 
- asked by BeauGeste (26 votes), answered by David (39 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[How to extract a variable names (not values) from a list of 
transformation 
rules?]\url{http://mathematica.stackexchange.com/questions/42405/how-to-ext 
ract-a-variable-names-not-values-from-a-list-of-transformation-rules} 
 
I am trying to extract variable names from a list of transformation 
rules mapping = {var1 -&gt; 'val1', var2 -&gt; 'val2' }. Variables var1 
and var2 are already defined in my notebook: 
 
 
var1 =  ... 
 
- asked by verse (1 vote) 
 
---------------------------- 
 
[Establish connection with RLink and 
Rtools]\url{http://mathematica.stackexchange.com/questions/42408/establish- 
connection-with-rlink-and-rtools} 
 
Has anyone gotten RLink to work with Rtools (or even tried)? 
If so a simple step-by-step would be much appreciated ! 
 
When attempting to access any Rtools functionality through RLink I get: 
 
 
The  ... 
 
- asked by David Ross (2 votes) 
 
---------------------------- 
 
[NMinimize seems to call function with the same values multiple 
times]\url{http://mathematica.stackexchange.com/questions/42215/nminimize-s 
eems-to-call-function-with-the-same-values-multiple-times} 
 
I have to minimize a function where the evaluation of one parameter set 
takes very long (around 5sec) and discovered alongside, that NMinimize 
seems to call this function multiple times with the exact  ... 
 
- asked by Frederik Ziebell (3 votes)

7.44 February 11, 2014

================================== 
Top new questions this week: 
================================== 
 
[A set of 
elements]\url{http://mathematica.stackexchange.com/questions/41753/a-set-of 
-elements} 
 
I have a set of say 100 numbers {1,3,7,11,19,...3971}. All elements are 
previously determined. I want to check whether 376 belongs to this set 
or not. what is the fastest way? 
Thanks 
 
 
- asked by Meqdad (9 votes), answered by Mr.Wizard (10 votes) 
 
---------------------------- 
 
[Unwanted PlotMarkers appear at non-existent 
places]\url{http://mathematica.stackexchange.com/questions/41706/unwanted-p 
lotmarkers-appear-at-non-existent-places} 
 
In this simple code 
 
ListPlot[Table[Sin[x], {x, 0, Pi, .1}], PlotRange -&gt; {0, 0.5}, 
Joined -&gt; True, PlotMarkers -&gt; Automatic, ClippingStyle -&gt; 
None, Frame -&gt; True] 
 
 
 
 
We can see that  ... 
 
- asked by saturasl (9 votes), answered by Coolwater (9 votes) 
 
---------------------------- 
 
[Find positions of items in a list based on 
neighbours]\url{http://mathematica.stackexchange.com/questions/41937/find-p 
ositions-of-items-in-a-list-based-on-neighbours} 
 
How can I select items from a list where the selection criterion depends 
on the neighbouring items? 
 
For example select all indices where a change has occurred with respect 
to the previous element in  ... 
 
- asked by Danvil (8 votes), answered by Simon Woods (14 votes) 
 
---------------------------- 
 
[How to run mathematica scripts without initializing the kernel every 
time]\url{http://mathematica.stackexchange.com/questions/41742/how-to-run-m 
athematica-scripts-without-initializing-the-kernel-every-time} 
 
I have written a Mathematica script that is to be run periodically on a 
Raspberry Pi. The code takes about 3 seconds to execute if I test it in 
a CLI Mathematica session. However, when I execute the  ... 
 
- asked by shrx (7 votes), answered by shrx (1 vote) 
 
---------------------------- 
 
[Get Coordinates 4 significant digits 
limitation]\url{http://mathematica.stackexchange.com/questions/42112/get-co 
ordinates-4-significant-digits-limitation} 
 
The tool "get coordinates" (clicking on a plot), seems to work with a 
fixed number of significant digits (4), in a way that we can quickly 
lose sensibility (the tool really becomes useless). The  ... 
 
- asked by P. Fonseca (6 votes), answered by chuy (2 votes) 
 
---------------------------- 
 
[How to take derivative of parameterized 
coordinate?]\url{http://mathematica.stackexchange.com/questions/41907/how-t 
o-take-derivative-of-parameterized-coordinate} 
 
Suppose I have a vector in $\mathbb{R}^n$ but $n$ is not known in 
advance. I want to be able to write functions which operate on the 
components of that vector, and then I'd like to be able to take  ... 
 
- asked by Tom (6 votes) 
 
---------------------------- 
 
[How to randomly erode a 3D distribution of points with Mma 
7.0?]\url{http://mathematica.stackexchange.com/questions/41801/how-to-rando 
mly-erode-a-3d-distribution-of-points-with-mma-7-0} 
 
Suppose we have a 3D distribution of points, like the spherical ball 
example below : 
 
Ball[num_]:=Table[ 
{ 
#1 Sqrt[1-#2^2]Cos[#3], 
#1 Sqrt[1-#2^2]Sin[#3], 
#1 #2 
} 
 
&amp;[ 
... 
 
- asked by Cham (6 votes), answered by chuy (6 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Marking points of intersection between two 
curves]\url{http://mathematica.stackexchange.com/questions/10472/marking-po 
ints-of-intersection-between-two-curves} 
 
I'm trying to illustrate the solutions numerically and graphically for 
an equation such as Tan[x] == x. I think I did everything ok except I 
wanted to mark each intersection between Tan[x] and x. 
 
... 
 
- asked by fiz (20 votes), answered by belisarius (30 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 (121 votes), answered by Michael E2 (64 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[OpenCLLink specify grid size when calling 
function]\url{http://mathematica.stackexchange.com/questions/41992/openclli 
nk-specify-grid-size-when-calling-function} 
 
The Mathematica documentation (section "Details": 
https://reference.wolfram.com/mathematica/OpenCLLink/ref/OpenCLFunction. 
html) states that: 
 
 
On launch, if the number of threads is not specified  ... 
 
- asked by user2224780 (1 vote) 
 
---------------------------- 
 
[Import merged cells from 
Excel]\url{http://mathematica.stackexchange.com/questions/42069/import-merg 
ed-cells-from-excel} 
 
in a scientific paper I've found some data. I've saved it in Excel from 
a .pdf file. 
But it was saved in a strange way: all data are in two cells in Excel. 
In large merged cells. 
Now when I try to  ... 
 
- asked by Mary (1 vote) 
 
---------------------------- 
 
[Mysterious behavior of Precision for complex 
arrays]\url{http://mathematica.stackexchange.com/questions/42075/mysterious 
-behavior-of-precision-for-complex-arrays} 
 
Mysterious behavior of Precision: 
 
{{1.0+I*0.0},{0.0+I*0.0}} // SetPrecision[#,30]&amp; // Precision // 
Print; 
 
 
 
0. 
 
 
 
{{1.0},{0.0}} // SetPrecision[#,30]&amp; // Precision // Print; 
 
 
 
30. 
 
 
 
Why is  ... 
 
- asked by John Sidles (3 votes)

7.45 February 4, 2014

================================== 
Top new questions this week: 
================================== 
 
[Extracting angles from a simple 
picture]\url{http://mathematica.stackexchange.com/questions/41563/extractin 
g-angles-from-a-simple-picture} 
 
I'm not sure if this is even possible with Mathematica, but I want to 
extract the angles between all lines in this picture: 
 
 
 
It consists of $12$ lines, so I want a matrix with $144$ entries. I  ... 
 
- asked by holistic (13 votes), answered by Kuba (14 votes) 
 
---------------------------- 
 
[Shuffle product of two 
lists]\url{http://mathematica.stackexchange.com/questions/41614/shuffle-pro 
duct-of-two-lists} 
 
I want to do the following: I have two lists {a_1,...a_n}, {b_1,...,b_n} 
and I would like to build now all shuffles out of this. This means all 
unions of these lists while still keeping the individual  ... 
 
- asked by A friendly helper (12 votes), answered by Mr.Wizard (9 votes) 
 
---------------------------- 
 
[Strange behavior when using Row with packed 
arrays]\url{http://mathematica.stackexchange.com/questions/41653/strange-be 
havior-when-using-row-with-packed-arrays} 
 
Today I lost a lot of time with a strange behavior and I narrowed it 
down to this small piece of code: 
 
a = {1, 2}; 
ToString@Row[DeleteDuplicates[a], ","] 
ToString@Row[Union[a], ","] 
 
 
 
"Row[{1, 2},  ... 
 
- asked by Murta (11 votes), answered by Szabolcs (11 votes) 
 
---------------------------- 
 
[Graphics`Mesh`FindIntersections[ ] fails to detect 
intersections]\url{http://mathematica.stackexchange.com/questions/41496/gra 
phicsmeshfindintersections-fails-to-detect-intersections} 
 
Graphics`Mesh`FindIntersections[ ] is an undocumented function for, 
well, detecting intersections very efficiently. Take a look: 
 
i = Import@"http://i.stack.imgur.com/PcWcz.png"; 
perim =  ... 
 
- asked by belisarius (10 votes) 
 
---------------------------- 
 
[Checking through an 
expression]\url{http://mathematica.stackexchange.com/questions/41324/checki 
ng-through-an-expression} 
 
I am writing a code that manipulates expressions that contains functions 
with an arbitrary number of arguments.  An example expression is 
 
expr = x f[a, b, c, d] - 4 f[b, a, d] + z f[] + f[a, b, d] -  ... 
 
- asked by QuantumDot (7 votes), answered by Artes (5 votes) 
 
---------------------------- 
 
[LengthWhile until first 
duplication]\url{http://mathematica.stackexchange.com/questions/41469/lengt 
hwhile-until-first-duplication} 
 
I have the need to trim each of a large number of potentially very long 
lists (10^6+ elements) to the length where the last occurrence of any 
distinct element happens, or said another way, where the  ... 
 
- asked by rasher (7 votes), answered by rasher (2 votes) 
 
---------------------------- 
 
[Why do I get a different value when I change the order of 
integration?]\url{http://mathematica.stackexchange.com/questions/41454/why- 
do-i-get-a-different-value-when-i-change-the-order-of-integration} 
 
I think the following two-dimensional integrals should be equal, since 
they both integrate the function over the half plane defined by 
$t&gt;\tau$. 
 
$$\int_{-\infty}^\infty \mathrm{d}t  ... 
 
- asked by Jason B (7 votes), answered by Michael E2 (9 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[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) 
 
---------------------------- 
 
[Finding the best way to visualize rather complicated 
data]\url{http://mathematica.stackexchange.com/questions/33429/finding-the- 
best-way-to-visualize-rather-complicated-data} 
 
I have the following data 
 
data = {{7.5, 12.45, 12.45, 12.75, 12.75, 12.25, 12.25, 12.53, 12.53}, 
{8.5, 12.22, 12.22, 12.23, 12.23, 13, 13, 12.54, 12.54}, 
{9.5, 11.58, 11.53, 12.75, 13.48, 12.39,  ... 
 
- asked by Vaggelis_Z (12 votes), answered by Pinguin Dirk (10 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Load a Mathematica Notebook using .Net 
code]\url{http://mathematica.stackexchange.com/questions/41410/load-a-mathe 
matica-notebook-using-net-code} 
 
I have gotten a tremendous amount of information from the question 
posted at (Load a Mathematica Package via .Net code), which my 
application is very similar to. Specifically in that thread, the  ... 
 
- asked by Josh (1 vote) 
 
---------------------------- 
 
[Trying to find the best Pade approximant for a given numer of 
terms]\url{http://mathematica.stackexchange.com/questions/41620/trying-to-f 
ind-the-best-pade-approximant-for-a-given-numer-of-terms} 
 
Let suppose that I have a function $f[x]$ I want to approximate using a 
Pade expansion and that I decide what would be maximum number of terms 
to be used. 
 
Is there any way with Mathematica to find  ... 
 
- asked by Claude Leibovici (1 vote) 
 
---------------------------- 
 
[Estimation of vector autoregressive (VAR) 
process]\url{http://mathematica.stackexchange.com/questions/41330/estimatio 
n-of-vector-autoregressive-var-process} 
 
To estimate 1-dimensional VAR process (which is AR process) you can 
easily use functions EstimatedProcess or FindProcessParameters like 
this: 
 
sample = RandomFunction[ARProcess[{.2,-.4},.1], {1,300}]; 
... 
 
- asked by matt525252 (3 votes) 

7.46 January 28, 2014

================================== 
Top new questions this week: 
================================== 
 
[Why are numeric division and subtraction not handled better in 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/40927/why- 
are-numeric-division-and-subtraction-not-handled-better-in-mathematica} 
 
There is something that has been troubling me for a while.  At least in 
version 7, the performance of a / b and a - b is not equivalent to, and 
significantly inferior to, Divide[a, b] and Subtract[a,  ... 
 
- asked by Mr.Wizard (37 votes) 
 
---------------------------- 
 
[Cancellation of common 
terms]\url{http://mathematica.stackexchange.com/questions/41070/cancellatio 
n-of-common-terms} 
 
Can someone explain why the term A in case 2 does not get canceled out 
when case 1 does? 
I use "9.0 for Microsoft Windows (64-bit) (January 25, 2013)" 
 
case1 = A*(E^(-\[Lambda]) + \[Alpha]) == A; 
Simplify[case1, A  ... 
 
- asked by user11946 (10 votes), answered by user11946 (2 votes) 
 
---------------------------- 
 
[Plotting time data with axes labels and point 
labels]\url{http://mathematica.stackexchange.com/questions/41113/plotting-t 
ime-data-with-axes-labels-and-point-labels} 
 
I am trying to create a set of commands to automatically create clinical 
lab value plots. Using time is my major issue here. It is hard to 
dynamically reference the different point positions to  ... 
 
- asked by James Wine (10 votes), answered by ubpdqn (6 votes) 
 
---------------------------- 
 
[Is there a guideline about when to end expressions with 
semicolons?]\url{http://mathematica.stackexchange.com/questions/41086/is-th 
ere-a-guideline-about-when-to-end-expressions-with-semicolons} 
 
Whether for nested Ifs or within scoping constructs like Module and 
Block, I never know whether to end the final expression with a 
semicolon. I know the semicolon suppresses output, but, for example, 
... 
 
- asked by acheong87 (10 votes), answered by Mr.Wizard (13 votes) 
 
---------------------------- 
 
[How to efficiently mask an 
image?]\url{http://mathematica.stackexchange.com/questions/41125/how-to-eff 
iciently-mask-an-image} 
 
I want to extract/cut out a part of an image. Since my mask is not 
rectangular I want to set pixels that are not masked to zero (black). My 
current approach is something like this: 
 
img =  ... 
 
- asked by chromate (9 votes), answered by Pickett (11 votes) 
 
---------------------------- 
 
[Why is this code slow and how could I speed it 
up?]\url{http://mathematica.stackexchange.com/questions/41185/why-is-this-c 
ode-slow-and-how-could-i-speed-it-up} 
 
My goal is given an integer number to deduce if its digits increase (or 
remain the same) from left to right or not. 
 
Example: $1236, 123336$ are both considered numbers with increasing 
digits, but  ... 
 
- asked by Zet (8 votes), answered by Kuba (13 votes) 
 
---------------------------- 
 
[How is the mysterious Raw function 
used?]\url{http://mathematica.stackexchange.com/questions/40982/how-is-the- 
mysterious-raw-function-used} 
 
I have never seen an example use for the mysterious Raw function: 
 
 
Raw[h, "hexstring"] 
constructs a raw data object with head h, and 
with contents corresponding to the binary bit pattern  ... 
 
- asked by Mr.Wizard (8 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[How to play with Facebook data inside 
Mathematica?]\url{http://mathematica.stackexchange.com/questions/11673/how- 
to-play-with-facebook-data-inside-mathematica} 
 
I saw this post from Wolfram here and I would like to know how to import 
facebook data into Mathematica. 
 
 
- asked by Murta (20 votes), answered by Murta (24 votes) 
 
---------------------------- 
 
[Is there an open source implementation of 
Mathematica-the-language?]\url{http://mathematica.stackexchange.com/questio 
ns/4454/is-there-an-open-source-implementation-of-mathematica-the-langua 
ge} 
 
I've seen questions before such as "What is the best open-source 
equivalent for Mathematica?", but that specific question (and that line 
of inquiry in general) cares more about the computer algebra  ... 
 
- asked by sblom (46 votes), answered by Simon (39 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Poor CUDALink performance, when calling a kernel multiple 
times]\url{http://mathematica.stackexchange.com/questions/41102/poor-cudali 
nk-performance-when-calling-a-kernel-multiple-times} 
 
When working on a project of mine I noticed that CUDALink shows very 
poor performance when calling CUDA kernels multiple times in a 
loop-construct. 
 
To demonstrate this I put together this little  ... 
 
- asked by definitely.uncertain (6 votes) 
 
---------------------------- 
 
[Does Mathematica compute free-form-input on Wolfram 
servers?]\url{http://mathematica.stackexchange.com/questions/41238/does-mat 
hematica-compute-free-form-input-on-wolfram-servers} 
 
I've just started to use mathematica and I'm using the free-form input 
alot. The computation time for simple problems seems to take alot of 
time and my CPU isn't really used at all. I first thought  ... 
 
- asked by qwertz (4 votes) 
 
---------------------------- 
 
[Non linear model fit 
mathematica]\url{http://mathematica.stackexchange.com/questions/41017/non-l 
inear-model-fit-mathematica} 
 
I want to fit experimental data (temp,alpha) to the following equation 
for calculating k and Ea 
 
-Log[alpha]^n = function(k,Ea,temp) 
 
 
However i do not know exact value of "n". By this time i am  ... 
 
- asked by Farrukh Shehzad (1 vote) 

7.47 January 21, 2014

================================== 
Top new questions this week: 
================================== 
 
[Moving maximum 
function?]\url{http://mathematica.stackexchange.com/questions/40526/moving- 
maximum-function} 
 
How can I construct a moving maximum function? 
 
For example, if I have a list of 12 values: { 5, 6, 9, 3, 2, 6, 7, 8, 1, 
1, 4, 7 } and I want to maximize over 3 values then the expected result 
would  ... 
 
- asked by Tyler Durden (11 votes), answered by rasher (16 votes) 
 
---------------------------- 
 
[AndersonDarlingTest and DistributionFitTest Leaking 
Memory]\url{http://mathematica.stackexchange.com/questions/40661/andersonda 
rlingtest-and-distributionfittest-leaking-memory} 
 
I believe AndersonDarlingTest and probably all other tests are keeping a 
copy of data somewhere and not freeing it: 
 
Quit[]; (*Must be run in different cell*) 
 
 
$HistoryLength = 0; 
memdata =  ... 
 
- asked by Ajasja (8 votes), answered by Ajasja (2 votes) 
 
---------------------------- 
 
[Faster list duplicate 
'limiter']\url{http://mathematica.stackexchange.com/questions/40765/faster- 
list-duplicate-limiter} 
 
Given some list, e.g., {5, 3, 2, 3, 1, 0, 1, 3, 5, 5, 4, 5, 1, 2, 5, 2, 
2, 0, 1, 4}, I need to limit the duplicates, if any, to an arbitrarily 
chosen number. The excess duplicates are to be chopped  ... 
 
- asked by rasher (7 votes), answered by rasher (4 votes) 
 
---------------------------- 
 
[When does a list contain only 
ones?]\url{http://mathematica.stackexchange.com/questions/40670/when-does-a 
-list-contain-only-ones} 
 
I am starting with a list of length n that contains all -1's. For 
instance, when n = 6 the list is {-1, -1, -1, -1, -1, -1}. I pick a 
random integer from 1 to n and toggle the element by multiplying  ... 
 
- asked by bobbym (7 votes), answered by rasher (6 votes) 
 
---------------------------- 
 
[Converting StringJoin to StringForm inside 
Hold]\url{http://mathematica.stackexchange.com/questions/40628/converting-s 
tringjoin-to-stringform-inside-hold} 
 
Let's say I have a piece of code: 
 
Hold[{code1, 
"asdad " &lt;&gt; ToString[testa] &lt;&gt; " adsd " &lt;&gt; 
ToString[testb], 
code2}] (*MWE ofc*) 
 
 
which I want to convert. Each  ... 
 
- asked by Kuba (7 votes), answered by Leonid Shifrin (8 votes) 
 
---------------------------- 
 
[Graph databases / Nosql with 
Mathematica]\url{http://mathematica.stackexchange.com/questions/40731/graph 
-databases-nosql-with-mathematica} 
 
I am very new to mathematica but it looks like an interesting language 
and I would like to explore it for a future project to create a web 
search engine. It seems like it would be fairly well suited  ... 
 
- asked by user2433617 (6 votes), answered by Mike Honeychurch (2 votes) 
 
---------------------------- 
 
[Counting adjacent elements in a 
Matrix?]\url{http://mathematica.stackexchange.com/questions/40593/counting- 
adjacent-elements-in-a-matrix} 
 
To start, I have a situation where I have some matrix, for example 
 
$$ 
A=\left[ 
\begin{matrix} 
4&amp;2&amp;2&amp;3&amp;3\\ 
2&amp;3&amp;1&amp;2&amp;3\\ 
3&amp;0&amp;4&amp;0&amp;4\\ 
... 
 
- asked by Alizter (6 votes), answered by Rojo (3 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[Automatic e-mail/text message when a calculation has 
finished?]\url{http://mathematica.stackexchange.com/questions/30167/automat 
ic-e-mail-text-message-when-a-calculation-has-finished} 
 
Sometimes Mathematica takes quite a while to finish calculations and it 
would be convenient to be able to move away from the computer while it 
is working. I was wondering if there is any "clever" hack  ... 
 
- asked by Paco (36 votes), answered by rm -rf (41 votes) 
 
---------------------------- 
 
[How to check if a 2D point is in a 
polygon?]\url{http://mathematica.stackexchange.com/questions/9405/how-to-ch 
eck-if-a-2d-point-is-in-a-polygon} 
 
Background: I use code from An Efficient Test For A Point To Be In A 
Convex Polygon Wolfram Demonstration to check if a point ( mouse pointer 
) is in a ( convex ) polygon. Clearly this code fails for  ... 
 
- asked by ndroock1 (42 votes), answered by kguler (30 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[Schedule programing problem with integer linear 
programming]\url{http://mathematica.stackexchange.com/questions/40739/sched 
ule-programing-problem-with-integer-linear-programming} 
 
I know how to model this question on paper, but I don't know how doing 
it in Mathematica. 
 
Imagine , there is a university student who want to choose courses for 
this semester and he got the  ... 
 
- asked by DSaad (4 votes) 
 
---------------------------- 
 
[Cannot compile OpenGL code in Mathematica (vc2010-windows 
8.1)]\url{http://mathematica.stackexchange.com/questions/40705/cannot-compi 
le-opengl-code-in-mathematica-vc2010-windows-8-1} 
 
LinkError of OpenGL 
 
 
 
My enviroment is windows 8.1 x64, Mathematica 9.0.1, opengl 1.1 
 
targetDirectory = "E:\\Users\\Hyper\\Documents\\OpenGL"; 
sourceDirectory =  ... 
 
- asked by HyperGroups (1 vote) 
 
---------------------------- 
 
[BubbleChart bubble scale depends on y 
position]\url{http://mathematica.stackexchange.com/questions/40576/bubblech 
art-bubble-scale-depends-on-y-position} 
 
I noticed that the scaling of bubbles in the BubbleChart function 
depends on the y position of a bubble. 
 
Compare these two examples. 
 
BubbleChart[{{60.0, 20.0, 50.0}, {60.0, 90.0, 50.0}}, 
... 
 
- asked by Jeff Lapides (1 vote)

7.48 January 14, 2014

================================== 
Top new questions this week: 
================================== 
 
[Generating visually pleasing circle 
packs]\url{http://mathematica.stackexchange.com/questions/40334/generating- 
visually-pleasing-circle-packs} 
 
I would like to generate a circle pack that mimics this: (don't pay 
attention on numbers, and colors at all, at the moment I am interested 
in circle positions and radii only) 
 
 
 
or this: 
 
 
 
I am new  ... 
 
- asked by VividD (23 votes), answered by Istvan Zachar (30 votes) 
 
---------------------------- 
 
[Why do certain values in ArcSin not fully 
evaluate?]\url{http://mathematica.stackexchange.com/questions/40080/why-do- 
certain-values-in-arcsin-not-fully-evaluate} 
 
This is a continuation of: Why do certain fractional values in 
TriangleWave not evaluate? 
The analysis by R.M and rasher revealed that problem to reduce to the 
behavior of: 
 
ArcSin[Sin[Pi/ 10]] 
 
 
 
... 
 
- asked by Mr.Wizard (14 votes), answered by Simon Woods (14 votes) 
 
---------------------------- 
 
[More efficient way of generating list of occurrence 
counts?]\url{http://mathematica.stackexchange.com/questions/40377/more-effi 
cient-way-of-generating-list-of-occurrence-counts} 
 
Given a list, e.g., target = {a, b, c, b, c, d, c, d, e, f, a, h, g}, I 
want to generate a list containing the occurrence count of the 
corresponding element of the target list, e.g., {1, 1, 1, 2, 2,  ... 
 
- asked by rasher (11 votes), answered by s0rce (7 votes) 
 
---------------------------- 
 
[How to avoid an expensive subset of a Manipulate computation when 
dependent variables have not 
changed?]\url{http://mathematica.stackexchange.com/questions/40066/how-to-a 
void-an-expensive-subset-of-a-manipulate-computation-when-dependent-vari 
> } 
 
I have a Manipulate where a portion of the calculation that ends up 
displayed is dependent on a subset of the Manipulate control variables. 
It would make sense to cache that portion of the  ... 
 
- asked by Peeter Joot (9 votes), answered by Nasser (8 votes) 
 
---------------------------- 
 
[help to plot Poincare section for double 
pendulum]\url{http://mathematica.stackexchange.com/questions/40122/help-to- 
plot-poincare-section-for-double-pendulum} 
 
I am reading a book about classical mechanics. In the chapter about 
chaos, it gives the simplified and scaled equations for double pendulum 
as 
 
$$ 
\frac{d}{dt}\left[ 
\begin{matrix} 
\alpha \\[3mm]  ... 
 
- asked by user1285419 (8 votes), answered by belisarius (5 votes) 
 
---------------------------- 
 
[Another difference between Set and Setdelayed. Evaluation 
shortcut?]\url{http://mathematica.stackexchange.com/questions/40182/another 
-difference-between-set-and-setdelayed-evaluation-shortcut} 
 
A little while ago I wondered why 
 
f[x_] = f[x] 
 
 
gives an infinite iteration. I ended up discovering the following 
difference in evaluation between Set and SetDelayed with Evaluate. 
 
count = 0; 
... 
 
- asked by Jacob Akkerboom (7 votes), answered by Jacob Akkerboom (1 
vote) 
 
---------------------------- 
 
[Arbitrary precision spline 
interpolation]\url{http://mathematica.stackexchange.com/questions/40163/arb 
itrary-precision-spline-interpolation} 
 
Current implementation of Interpolation does not allow arbitrary 
precision spline interpolation. Yu-Sung Chang say here that "it is not 
hard to implement it manually for arbitrary precision using  ... 
 
- asked by Alexey Popkov (7 votes), answered by belisarius (3 votes) 
 
 
================================== 
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 (32 votes), answered by programming_historian 
(14 votes) 
 
---------------------------- 
 
[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 (35 votes), answered by Kuba (31 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[InverseFunction 
oddity]\url{http://mathematica.stackexchange.com/questions/40398/inversefun 
ction-oddity} 
 
InverseFunction[ConditionalExpression[#, 0 &lt;= # &lt;= 1] &amp;] 
InverseFunction[ConditionalExpression[#, -1 &lt;= # &lt;= 1] &amp;] 
 
 
The first line produces what I would expect: 
 
... 
 
- asked by Will Vousden (4 votes) 
 
---------------------------- 
 
[How to Check Spelling strings written inside input 
cells]\url{http://mathematica.stackexchange.com/questions/40199/how-to-chec 
k-spelling-strings-written-inside-input-cells} 
 
Is it possible to check the spelling of strings? Strings are often used 
to show messages in my user interfaces, and I would like to have an 
automatic checking. 
 
Methods that export all the strings to  ... 
 
- asked by P. Fonseca (4 votes) 
 
---------------------------- 
 
[Biorthogonal Projector Construction in 
Mathematica]\url{http://mathematica.stackexchange.com/questions/40294/biort 
hogonal-projector-construction-in-mathematica} 
 
(Note: This was originally posted on SE Mathematics, but I'm reposting 
it here as suggested by rm-rf, as I'm translating the theorem into 
Mathematica code to test it) 
 
I was trying to prove that the  ... 
 
- asked by DumpsterDoofus (2 votes)

7.49 January 7, 2014

================================== 
Top new questions this week: 
================================== 
 
[Create a torus with a hexagonal mesh for 
3D-printing]\url{http://mathematica.stackexchange.com/questions/39879/creat 
e-a-torus-with-a-hexagonal-mesh-for-3d-printing} 
 
I am new to Mathematica, and I'm looking for a way to create patterns on 
the surface of 3D objects. One thing I have not been able to do is 
create a hexagonal mesh on a torus. What I would like to  ... 
 
- asked by Manna (24 votes), answered by rm -rf (34 votes) 
 
---------------------------- 
 
[Benchmarking Mathematica performance on the Raspberry 
Pi]\url{http://mathematica.stackexchange.com/questions/39684/benchmarking-m 
athematica-performance-on-the-raspberry-pi} 
 
It is not surprising that Mathematica on the Raspberry Pi is slow and 
clunky.  In Stephen Wolfram's words, the command line is "quite zippy" 
but the notebook interface is "a trifle sluggish by modern  ... 
 
- asked by bobthechemist (20 votes), answered by bobthechemist (22 
votes) 
 
---------------------------- 
 
[Fast 
DensityPlot]\url{http://mathematica.stackexchange.com/questions/39826/fast- 
densityplot} 
 
Is it possible to increase the perforamce the DensityPlot? 
 
For example, let's try to plot this "flower" 
 
f[x_, y_] := (x^2 + y^2) Exp[-x^2 - y^2] Sin[10 Sqrt[x^2 + y^2] + 10 
ArcTan[x, y]]^4; 
 
... 
 
- asked by ybeltukov (16 votes), answered by ybeltukov (14 votes) 
 
---------------------------- 
 
[How to plot ternary density 
plots?]\url{http://mathematica.stackexchange.com/questions/39733/how-to-plo 
t-ternary-density-plots} 
 
How can I get a ternary density plot just like the plots from OriginLab? 
 
 
ContourPlot and DensityPlot seemingly can solve the 
[f,{x},{y}]-style, but cannot solve the [f,{x},{y},{z}]-style 
 
 
- asked by Scott Wang (15 votes), answered by Michael E2 (17 votes) 
 
---------------------------- 
 
[Get tab key to indent a block of 
code]\url{http://mathematica.stackexchange.com/questions/39876/get-tab-key- 
to-indent-a-block-of-code} 
 
Is there some way I can change Mathematica keyboard behavior so I could 
select a block of text/code, press tab, and the selection would be 
indented to right? Similarly, I would like shift+tab to  ... 
 
- asked by Murta (9 votes), answered by Leonid Shifrin (5 votes) 
 
---------------------------- 
 
[Probability of the sum of the largest n 
samples]\url{http://mathematica.stackexchange.com/questions/39848/probabili 
ty-of-the-sum-of-the-largest-n-samples} 
 
15 numbers are randomly chosen from U(0,1), what is the probability that 
the sum of largest four numbers is greater than 3.5? 
 
With[{f = OrderDistribution[{UniformDistribution[], 15}, #] &amp;}, 
... 
 
- asked by bobbym (9 votes), answered by belisarius (9 votes) 
 
---------------------------- 
 
[Create a new infix 
operator]\url{http://mathematica.stackexchange.com/questions/39696/create-a 
-new-infix-operator} 
 
It is well known that the infix operator @@ is used as a short form of 
Apply. 
 
For example, both Apply[f,{a,b,c}] and f@@{a,b,c} return f[a,b,c]} 
 
Also the infix operator @@@ is used as a short form  ... 
 
- asked by tchronis (8 votes), answered by Rojo (7 votes) 
 
 
================================== 
Greatest hits from previous weeks: 
================================== 
 
[How to find the phase difference of two sampled sine 
waves?]\url{http://mathematica.stackexchange.com/questions/11046/how-to-fin 
d-the-phase-difference-of-two-sampled-sine-waves} 
 
I'm trying to measure a phase difference between two Sine functions I've 
acquired with a computer. I'm uploading one of the .txt files with the 
data I'm working with here: txt file. To remove the  ... 
 
- asked by Juan (19 votes), answered by bill s (18 votes) 
 
---------------------------- 
 
[Finding the best way to visualize rather complicated 
data]\url{http://mathematica.stackexchange.com/questions/33429/finding-the- 
best-way-to-visualize-rather-complicated-data} 
 
I have the following data 
 
data = {{7.5, 12.45, 12.45, 12.75, 12.75, 12.25, 12.25, 12.53, 12.53}, 
{8.5, 12.22, 12.22, 12.23, 12.23, 13, 13, 12.54, 12.54}, 
{9.5, 11.58, 11.53, 12.75, 13.48, 12.39,  ... 
 
- asked by Vaggelis_Z (12 votes), answered by Pinguin Dirk (10 votes) 
 
 
================================== 
Can you answer these? 
================================== 
 
[How can I take a function as data from a text field in order to plot 
it?]\url{http://mathematica.stackexchange.com/questions/39755/how-can-i-tak 
e-a-function-as-data-from-a-text-field-in-order-to-plot-it} 
 
I would like to create a window where a student may enter an equation 
and, by clicking on a button, the function gets plotted. 
 
(Quiero realizar una ventana en la cual el alumno tenga la opcion de 
... 
 
- asked by Jenny Ojeda (1 vote) 
 
---------------------------- 
 
[Want explanation of when different looping constructs are 
appropriate]\url{http://mathematica.stackexchange.com/questions/39704/want- 
explanation-of-when-different-looping-constructs-are-appropriate} 
 
For example when would you use a Do loop over a For loop? For which 
tasks would you use Map, Table, Scan, et cetera? I'm quite new to 
Mathematica and I don't really get what the advantages of any of  ... 
 
- asked by Aron (1 vote) 
 
---------------------------- 
 
[Error messages from 
NDSOlve]\url{http://mathematica.stackexchange.com/questions/39820/error-mes 
sages-from-ndsolve} 
 
I am trying to solve a boundary value problem with NDSolve. The code is: 
 
sol = Block[{M = 0.0}, 
NDSolve[{ 
f'''[x] + f[x]*f''[x] - f'[x]*f'[x] - M*f'[x] == 0, 
f[0] == 0, f'[0] == 1, f'[15]  ... 
 
- asked by usman saeed (1 vote)