## Chapter 4Year 2017

### 4.1 Tuesday, December 26, 2017

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

[How fast is my ﬁdget spinner spinning? A sound experiment!] https://mathematica.stackexchange.com/questions/162303/how-fast-is-my-fidget-spinner-spinning-a-sound-experiment

I would like to measure how fast my 6-bladed ﬁdget spinner spins. To do so, after giving it a hard spin, I gently touch the spinner with a wooden stirring stick to create a buzzing sound which ...

—————————-

[Sub-packages and auto-completion] https://mathematica.stackexchange.com/questions/162386/sub-packages-and-auto-completion

Cross-posted on Wolfram Community

I have a Mathematica application that consists of two sub-packages, corresponding to the contexts foo‘ (foo.m) and foo‘b‘ (b.m). Some of the deﬁnitions in foo.m ...

—————————-

[Why does Cases not ﬁnd a match to the pattern using n_. when n is a number other than 1?] https://mathematica.stackexchange.com/questions/162559/why-does-cases-not-find-a-match-to-the-pattern-using-n-when-n-is-a-number-oth

I am not good in patterns in Mathematica, and so can’t ﬁgure what I am doing wrong.

This example works, when the exponent is 1

ClearAll[y,x,n]
Cases[{( y[x]/x)^1}, (y[x]/x )^(n_.) :&gt; n]

But ...

—————————-

[How to make an Epilog moveable with drag and drop] https://mathematica.stackexchange.com/questions/162572/how-to-make-an-epilog-moveable-with-drag-and-drop

I would like to make an Epilog moveable. For example, the following code generates a Manipulate with a framed pane containing some notes. I would like the user to be able to move those notes anywhere ...

—————————-

[Map every second element of a list] https://mathematica.stackexchange.com/questions/162334/map-every-second-element-of-a-list

Colors = Import[
"d:\\bitbucket\\diversity\\data\\nlcd\\nlcd-colors.csv", "CSV"]
{{0., " 0.00000000000 0.00000000000 0.00000000000"}, {11.,
" 0.27843137255 0.41960784314  ...

—————————-

[Table of precedence values for all System‘ symbols] https://mathematica.stackexchange.com/questions/162474/table-of-precedence-values-for-all-system-symbols

Has anyone created a table listing the precedences for all symbols? Also, it would be nice if there were a function that for a given precedence value or interval, returned all the symbols with that ...

—————————-

[How to make a custom DynamicImage which support mouse wheel and show pixel value?] https://mathematica.stackexchange.com/questions/162311/how-to-make-a-custom-dynamicimage-which-support-mouse-wheel-and-show-pixel-value

The built-in DynamicImage just click the plus sign or minus sign to rescale the image. I have to say click is a not very good operation. Could we make the custom DynamicImage which support the mouse ...

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

[xkcd-style Plots] https://mathematica.stackexchange.com/questions/11350/xkcd-style-plots

I received an email to which I wanted to respond with a xkcd-style graph, but I couldn’t manage it. Everything I drew looked perfect, and I don’t have enough command over PlotLegends to have these ...

—————————-

[Why round to even integers?] https://mathematica.stackexchange.com/questions/2116/why-round-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 ...

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

[How can I check that a graph is edge weighted, fast?] https://mathematica.stackexchange.com/questions/162391/how-can-i-check-that-a-graph-is-edge-weighted-fast

I need to check if a graph is edge-weighted while maintaining good performance.

This should be an easy task, but it is not. It is a good example of why it is so terribly frustrating to work with ...

—————————-

[contour of inside of a volume] https://mathematica.stackexchange.com/questions/162306/contour-of-inside-of-a-volume

I have the following volume:

RegionPlot3D[-j^2*y^2 + j*l &lt; 11, {l, 0, 10}, {j, 0, 10}, {y, 0, 1}]

However, I am not able to obtain a 2D graph from it (contour), which shows the region inside the ...

- asked by Darrin Cope (1 vote)

—————————-

[Finsler or Lagrange geometry package?] https://mathematica.stackexchange.com/questions/162489/finsler-or-lagrange-geometry-package

I was wondering if there exist any packages or examples of work on Finsler-Lagrange geometry. I need it to do symbolic calculations, as for example calculations of non-linear connection coeﬃcients, ...

- asked by Athis Startis (1 vote)

### 4.2 Tuesday, December 12, 2017

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

[Why does Mathematica results diﬀer from C++ results within machine precision?] https://mathematica.stackexchange.com/questions/161716/why-does-mathematica-results-differ-from-c-results-within-machine-precision

I am trying to wrap my head around ﬂoating-point precision. Performing the following numeric operation:

275./6.*1.03692775514337

in Mathematica and C++ and taking the diﬀerence of the two results ...

—————————-

[Bug with Block & Lookup: Scope Variable Leak] https://mathematica.stackexchange.com/questions/161616/bug-with-block-lookup-scope-variable-leak

After debugging a large chunk of code, I could identify this MWE.

ClearAll@test
test[var_String]:= Block[{association},
association = &lt;|"x"-&gt; &lt;|"key01"-&gt; "ok"|&gt;|&gt;[var];
...

—————————-

[Why is ”k” in the output of Sum[Log[k]/k^k, {k,1,Infinity}]?] https://mathematica.stackexchange.com/questions/161704/why-is-k-in-the-output-of-sumlogk-kk-k-1-infinity

NSum[Log[k]/k^k, {k,1,Infinity}, WorkingPrecision-&gt;50]
(* 0.219947267975228664843531307905860703797097130 *)

But

Sum[Log[k]/k^k, {k,1,Infinity}]
(* -(PolyLog^(1,0))[0,1/k] *)

What does "k" in  ...

—————————-

[Simulating molecular dynamics eﬃciently] https://mathematica.stackexchange.com/questions/161471/simulating-molecular-dynamics-efficiently

The following website oﬀers a very nice molecular dynamics simulation: http://physics.weber.edu/schroeder/md/. It is pretty neat and quite a few physical phenomena can be described from that small ...

—————————-

[Why is listable not an attribute of the Set function?] https://mathematica.stackexchange.com/questions/161428/why-is-listable-not-an-attribute-of-the-set-function

The following is a list of attributes for the Set function:

Attributes[Set]

HoldFirst, Protected, SequenceHold

Why is Listable not included?

—————————-

[How to improve quality of this Plot3D] https://mathematica.stackexchange.com/questions/161771/how-to-improve-quality-of-this-plot3d

I tried driving up PlotPoints and MaxRecursion but the intersections look weird, is there some other trick I can do?

plot = Plot3D @@ {Abs[Sqrt[x] + Sqrt[y]] /. {x -&gt; Sin[2 x],
y -&gt; Cos[2  ...


—————————-

[How can I tell Mathematica to interpret 0xﬀﬀ as a hexadecimal number?] https://mathematica.stackexchange.com/questions/161646/how-can-i-tell-mathematica-to-interpret-0xffff-as-a-hexadecimal-number

I am stuck. I would like Mathematica simply accept 0x as a preﬁx Operator for Hexadecimal Numbers. I know that 0x is interpreted as 0*x, so maybe this is just not possible. I am a programmer and am ...

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

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

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

The ...

—————————-

[How to create eﬀect like Van Gogh’s stroke brush?] https://mathematica.stackexchange.com/questions/39003/how-to-create-effect-like-van-goghs-stroke-brush

I need to apply Van Gogh’s stroke brush eﬀect to a random image

Take the following image as an example:

Thank you so much if you could help!

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

[How to export graphics to SVG in script executed through cron?] https://mathematica.stackexchange.com/questions/161756/how-to-export-graphics-to-svg-in-script-executed-through-cron

I have a Wolfram script that generates plots, and exports them by evaluating expressions of the form

Export[”/path/to/some.svg”, myPlot];

The script works as intended when I run it from the [Unix] ...

—————————-

[Is it possible to prevent LUDecompositon from pivoting?] https://mathematica.stackexchange.com/questions/161552/is-it-possible-to-prevent-ludecompositon-from-pivoting

By construction LUDecomposition performs LU-decomposition with pivoting, i.e. with row permutations (otherwise the decomposition may not exist). Is it possible to tell Mathematica not to use pivoting ...

- asked by faleichik (1 vote)

—————————-

[How Many of R’s Functionalities Are Available From Inside Mathematica?] https://mathematica.stackexchange.com/questions/161664/how-many-of-rs-functionalities-are-available-from-inside-mathematica

When R is linked to Mathematica, how many of its functionalities are available from inside of Mathematica?

### 4.3 Tuesday, December 5, 2017

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

[Sharing small code snippets] https://mathematica.stackexchange.com/questions/161269/sharing-small-code-snippets

As part of my never-ending goal of getting Mathematica code to be as easily shared as python packages I was recently thinking about how to make code easy to share.

So what’s are some good ways to ...

—————————-

[InverseTotient[ ]?] https://mathematica.stackexchange.com/questions/160949/inversetotient

Maple has a function InverseTotient( c ), which returns all those natural numbers $$n$$ whose Euler totient function $$\phi ( n ) = c$$. Is there an equivalent inverse of EulerPhi[ ] in Mathematica? If ...

—————————-

[What are the counterparts in Wolfram to left and right division of a matrix in other programming language, e.g. Julia and MATLAB?] https://mathematica.stackexchange.com/questions/161301/what-are-the-counterparts-in-wolfram-to-left-and-right-division-of-a-matrix-in-o

Sometimes, to ﬁnd the inverse of a matrix is a labor-consuming task or even ”disgusting”, especially when the matrix is ”ill”. It is said, e.g. in Julia, that the left/right division operation is ...

—————————-

[How to perform Loop subdivision on a triangle mesh with Mathematica?] https://mathematica.stackexchange.com/questions/161331/how-to-perform-loop-subdivision-on-a-triangle-mesh-with-mathematica

Every now and then, the question pops up how a given geometric mesh (e.g. a MeshRegion) can be reﬁned to produce a i.) ﬁner and ii.) smoother mesh. For example, the following triangle mesh from the ...

—————————-

[How to speed up ‘RotationMatrix‘?] https://mathematica.stackexchange.com/questions/161230/how-to-speed-up-rotationmatrix

I frequently run into the situation that I have to apply RotationMatrix to a huge bunch of 3D vectors and angles for numerical computations. On the one hand, the syntax of RotationMatrix forces me to ...

—————————-

[How to create (Header + Main area + Settings pane) notebook layout] https://mathematica.stackexchange.com/questions/161203/how-to-create-header-main-area-settings-pane-notebook-layout

cross-posted in community.wolfram.com

The goal is something like in the picture below.

Basic? I dare you to try to implement it in a manageable, scalable and ﬂexible way.

Requirements:

The ...

—————————-

My understanding of the irective is that it should preserve the sizes of all elements in the expression. But when I try this:

m1 = Inset[MaTeX["\\sqrt{\\phantom{a^2}b}", Magnification -&gt;  ...

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

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

Question

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

—————————-

[How to create eﬀect like Van Gogh’s stroke brush?] https://mathematica.stackexchange.com/questions/39003/how-to-create-effect-like-van-goghs-stroke-brush

I need to apply Van Gogh’s stroke brush eﬀect to a random image

Take the following image as an example:

Thank you so much if you could help!

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

[Is there any code formatting style reference?] https://mathematica.stackexchange.com/questions/161344/is-there-any-code-formatting-style-reference

Is there any code formatting style reference for Wolfram Language similar to https://www.python.org/dev/peps/pep-0008/ and https://google.github.io/styleguide/javaguide.html? I’m teaching some people ...

—————————-

[Plot spectrum Fourier Transform] https://mathematica.stackexchange.com/questions/161381/plot-spectrum-fourier-transform

i want to plot the spectrum of the following function. I hope that anybody is able to help me. I don’t know how to plot the dirac delta function. I tried it this way but it didn´t work so far. Thanks! ...

- asked by Luke (1 vote)

—————————-

[Wrapper for mathematica code with GUI] https://mathematica.stackexchange.com/questions/160966/wrapper-for-mathematica-code-with-gui

I have a code written in Mathematica. What I am trying to do is to write a wrapper (say using Python) that will take user input for the Mathematica code, run the code, and create output.

I do not ...

### 4.4 Tuesday, November 28, 2017

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

[The fastest thing since sliced cubes?] https://mathematica.stackexchange.com/questions/160527/the-fastest-thing-since-sliced-cubes

I’ve fallen down a rabbit hole recently, and need a reality check.

Suppose you have an arbitrary unit vector, $$u \in \mathbf {R}^3$$, and you cut up the unit cube into slices orthogonal to $$u$$ with ...

—————————-

[Mathematica does not respect linearity of integral] https://mathematica.stackexchange.com/questions/160655/mathematica-does-not-respect-linearity-of-integral

I have the following issue, trying to evaluate an integral. Mathematica tells me

Integrate[x^2 (1 + x^2)^(1/2) + y + z, {x, y, z} ∈ Sphere[{0, 0, 0}, 1]]

(* 1/2 π (3 Sqrt[2] - Log[2 (2 + Sqrt[2])])  ...

—————————-

Given an arbitrary mesh region, how can I eﬃciently obtain the graph describing the adjacency structure of mesh cells?

For example, given the following mesh,

SeedRandom[123]
pts = RandomReal[1,  ...

—————————-

[Can a symbol have both OwnValues and DownValues?] https://mathematica.stackexchange.com/questions/160740/can-a-symbol-have-both-ownvalues-and-downvalues

Mathematica Version 11.2 desktop / Windows 10 Pro 64-bit

I am trying to understand if a symbol can have both OwnValues and DownValues.

Is this acceptable or not acceptable?

As an experiment, I ...

—————————-

[Diﬀerences between DSolve and NDSolve] https://mathematica.stackexchange.com/questions/160560/differences-between-dsolve-and-ndsolve

I have a question about the diﬀerence in the solution between DSolve and NDSolve.

I want to solve the Friedmann equation of

\begin {align} 3\left (\frac {\dot {a}^2}{a^2}+\frac {k}{a^2}\right )=8\pi \end {align}

—————————-

[How to check if a vector is an eigenvector of a matrix using mathematica?] https://mathematica.stackexchange.com/questions/160801/how-to-check-if-a-vector-is-an-eigenvector-of-a-matrix-using-mathematica

Here is a vector

Here is a matrix

$$\begin{pmatrix}2&amp; i&amp;0\\-i&amp;1&amp;1\\0 &amp;1&amp;0\end{pmatrix}$$

Is there a simple way to determine ...

—————————-

[How do I read values from photocells connected to analog pins of Arduino Uno?] https://mathematica.stackexchange.com/questions/160761/how-do-i-read-values-from-photocells-connected-to-analog-pins-of-arduino-uno

Generally, I need to connect my Arduino Uno to Mathematica and read 3 analog values from A0, A1, A2 in real-time.

As I understand, I have 2 ways of connecting Arduino to Mathematica:

First: I have a ...

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

[How to manipulate 2D plots?] https://mathematica.stackexchange.com/questions/7142/how-to-manipulate-2d-plots

When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ...

—————————-

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

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

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

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

[Default options of LinearSolve] https://mathematica.stackexchange.com/questions/160693/default-options-of-linearsolve

I would like to know what is the default options of LinearSolve when using LinearSolve[A,b], where A is a sparse matrix. There are several methods available such as Cholesky and Krysol etc., see here. ...

- asked by Wilhelm (1 vote)

—————————-

[Prevent Semi-Transparent Pixels in Export] https://mathematica.stackexchange.com/questions/160578/prevent-semi-transparent-pixels-in-export

I’ve noticed that when I export plots in Mathematica without a background, a lot of the text ends being made of semi-transparent pixels. For example:

myplot = ContourPlot[Cos[x] + Cos[y], x, 0, 4 ...

- asked by ereHsaWyhsipS (1 vote)

—————————-

[Identifying the range of the voice] https://mathematica.stackexchange.com/questions/160731/identifying-the-range-of-the-voice

I’m trying to do an equalization in an audio program called Audition.

To have a good voice equalization, I need to have a frequency range of my voice.

A minimum value and a maximum frequency value.

...

### 4.5 Tuesday, November 21, 2017

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

[Is it possible to construct a fullform trace function] https://mathematica.stackexchange.com/questions/160184/is-it-possible-to-construct-a-fullform-trace-function

Is it possible to construct a FullFormTrace function that takes an arbitrary expression and prints a sequence (or returns a list) of the evaluation steps in full form. For instance

...

—————————-

[Integrate gives wrong result for simple function] https://mathematica.stackexchange.com/questions/160278/integrate-gives-wrong-result-for-simple-function

(probably) Bug introduced in 9.0 or earlier and persisting through 11.2

It looks like this.

NIntegrate[1/(2 + Sin[x + y]), {x, 0, 2 Pi}, {y, 0, 2 Pi}]
22.7929
Integrate[1/(2 + Sin[x + y]), {x, 0,  ...

—————————-

[Select the same elements from lists] https://mathematica.stackexchange.com/questions/160222/select-the-same-elements-from-lists

I need a special intersectant operation for List other than Set.

There maybe some duplicate elements, also need to count instead of merging as Intersection.

For example:

...

—————————-

[Building a convenient package distribution system] https://mathematica.stackexchange.com/questions/160330/building-a-convenient-package-distribution-system

The PacletManager is nice, but it’s not really a low-eﬀort system to work with.

Installing a package can be made pretty easy, but only if the location from which it is to be installed makes it so.

...

—————————-

[How to merge two lists with diﬀerent dimensions] https://mathematica.stackexchange.com/questions/160159/how-to-merge-two-lists-with-different-dimensions

I have two list, just like

a={a1,a2,a3,a4};
b={b1,b2,b3,b4,b5};

I want merge them and save to excel, as they have diﬀerent dimention, so I want it have the following format.

...

—————————-

[What is the elegant way of applying function to two lists?] https://mathematica.stackexchange.com/questions/160028/what-is-the-elegant-way-of-applying-function-to-two-lists

I am interested in ﬁnding the most concise elegant way of doing the following: We have a function fun[x1,x2] and two lists:

ls1={a1,a2,a3,a4,......}

and

ls2={b1,b2,b3,b4,......}

I ...

—————————-

[Legend displaying the expected number of points per unit area next to density plot] https://mathematica.stackexchange.com/questions/160193/legend-displaying-the-expected-number-of-points-per-unit-area-next-to-density-pl

I have 2d points and want to show a colored density plot of them. I also want to display a legend showing which point density (number of points per unit area) the colors in the plot represent.

Let’s ...

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

[Creating legends for plots with multiple lines?] https://mathematica.stackexchange.com/questions/4025/creating-legends-for-plots-with-multiple-lines

So I have a graph with multiple lists, for e.g.

data = {{1,2}, {3,4}, {3,5}, {2,3} . . .}

If I then do ListLinePlot[Table[{#1,Log[b,#2]}&amp;@@@data, {b,1,10,2}]]
I have no way to generate a legend  ...

—————————-

[What does # mean in Mathematica?] https://mathematica.stackexchange.com/questions/19035/what-does-mean-in-mathematica

I asked Mathematica to compute the following

Solve[c (1-x)^2-x^(1/4) == 0, x]

and it returned this:

x = Root[#1^8 c^4 - 8 #1^7 c^4 + 28 #1^6 c^4 - 56 #1^5 c^4 + 70 #1^4 c^4 - 56 #1^3 c^4 + 28  ...

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

[Convergent inﬁnite sum fails to converge in Sum[...]] https://mathematica.stackexchange.com/questions/160280/convergent-infinite-sum-fails-to-converge-in-sum

It looks like this.

Limit[Sum[1/((2 n + 1) Pi I - x), {n, -m, m}], m -&gt; ∞]
= -(1/2) Tanh[x/2]

Sum[1/((2 n + 1) Pi I - x), {n, -∞, ∞}]
Sum::div: Sum does not converge.

Turning on Regularization ...

- asked by huotuichang (1 vote)

—————————-

[Stacked BarChart with Callout] https://mathematica.stackexchange.com/questions/159945/stacked-barchart-with-callout

BarChart examples include this code :

BarChart[Table[Callout[RandomReal[{0, 1}], Unique["text"]], 2, 8],
BarSpacing -&gt; 2, ChartLayout -&gt; "Stacked"]

Its result should be :

But I can’t ...

—————————-

A similar post was found here, but it’s not using MMA.

A small test to export HDF5 ﬁle,

Export["test.h5", { "summary_Shoe" -&gt; anssummary, "summary_Tie" -&gt; anssummaryTie}]

Woks ﬁne.

But ...

### 4.6 Tuesday, November 14, 2017

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

[Drawing Cliﬀord Attractors in Mathematica] https://mathematica.stackexchange.com/questions/159668/drawing-clifford-attractors-in-mathematica

I came upon the ”Cliﬀord Attractor” today, which are equations of the form:

They create some incredible images by ...

—————————-

[Mismatch between Mathematica and COMSOL in 3D FEM problem] https://mathematica.stackexchange.com/questions/159506/mismatch-between-mathematica-and-comsol-in-3d-fem-problem

I would like to solve an advection-diﬀusion problem on a torus domain. There are three Dirichlet conditions: One at the inlet (concentration $$c=0$$), one at the outlet ($$c=0.5$$) and one at the wall ...

—————————-

[Unexpected behaviors in built-in functions] https://mathematica.stackexchange.com/questions/159895/unexpected-behaviors-in-built-in-functions

Existence of this topic is discussed in this mathematica.meta post.

I’m sure I am not the only non-beginner in WL who from time to time ﬁnds themselves not being able to predict an outcome of a ...

—————————-

[How to create a faded image using an existing image ﬁle] https://mathematica.stackexchange.com/questions/159662/how-to-create-a-faded-image-using-an-existing-image-file

The question is simple:

How can I take an image of a perfect stamp (load an image ﬁle) such as

and make it look old, worn, and faded, with missing arbitrary small bits, like the following stamp

...

—————————-

[Building a Noisy Function] https://mathematica.stackexchange.com/questions/159614/building-a-noisy-function

Here’s a nice function with a nice plot:

f[t_] := Exp[-Abs[t]] Sin[t];
Plot[f[t], {t, -10, 10}, PlotRange -&gt; All]

What I would like to do is to make it noisy... to add something to f[t] so ...

—————————-

[Inaccurate (non-smooth) boundary of the mesh generated by ToElementMesh] https://mathematica.stackexchange.com/questions/159775/inaccurate-non-smooth-boundary-of-the-mesh-generated-by-toelementmesh

I try to generate a mesh over a region, which has a wavy boundary at its bottom and needs very ﬁne mesh around the bottom.

However, the generated mesh boundary is not as smooth as the speciﬁed one. ...

—————————-

[remove transparency of background Image] https://mathematica.stackexchange.com/questions/159837/remove-transparency-of-background-image

I have the following image:

As you can see the background is kind of white-ish. Now my question is: How can I remove this transperancy of the background image ?

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

[Creating Mathematica packages] https://mathematica.stackexchange.com/questions/29324/creating-mathematica-packages

I’m building a package to help me write packages and their documentation. In this post I explained how to make a package and its documentation. In the answer I provided I describe how to build a very ...

—————————-

[Diﬀerence between != and =!=] https://mathematica.stackexchange.com/questions/153694/difference-between-and

I (think I) understand the diﬀerence between == (semantic) and === (syntactic). So when comparing != and =!= I was expecting a similar diﬀerence. So can anyone explain why the third line in this ...

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

[On comparable hardware, is Mathematica known to perform better in one operating system over the others?] https://mathematica.stackexchange.com/questions/159699/on-comparable-hardware-is-mathematica-known-to-perform-better-in-one-operating

Have any benchmarks been published by Wolfram Research to compare the performance of Mathematica in the major operating systems (Windows 10, Linux, MacOS)? If not, has anyone here performed such ...

—————————-

I am currently working with rainfall data from hurricane Harvey in order to better understand how to allocate resources in the event of another disaster. I want to accomplish a few things given this ...

—————————-

[how to count or extract Cases out of list of association that matches pattern] https://mathematica.stackexchange.com/questions/159783/how-to-count-or-extract-cases-out-of-list-of-association-that-matches-pattern

I have list of associations

lr1 = {&lt;|a -&gt; {0,0}, b -&gt; "TRUE"|&gt;, &lt;|b -&gt; "FALSE", a -&gt; {0,1}|&gt;, &lt;|a -&gt; {1,0}, b -&gt; "FALSE"|&gt;, &lt;|b -&gt; "TRUE", a -&gt;  ...

### 4.7 Tuesday, November 7, 2017

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

[Automatic edX Pdf Handout creator] https://mathematica.stackexchange.com/questions/159065/automatic-edx-pdf-handout-creator

I am trying to make an automatic handout creator for my courses on edX. It took me a long time to do it...

(If you don’t know edX: https://www.edx.org/

I wrote a program that adds to each slide ...

—————————-

[The area of a unit disk is $$2\pi$$? (NIntegrate over a numerical region)] https://mathematica.stackexchange.com/questions/159194/the-area-of-a-unit-disk-is-2-pi-nintegrate-over-a-numerical-region

EDIT: The example below concerns the construction of a numerical region from a general boolean-valued function. The question of how to properly construct such a region has been answered below (by M. ...

—————————-

[How many Capitals are closer to me than my own?] https://mathematica.stackexchange.com/questions/159041/how-many-capitals-are-closer-to-me-than-my-own

A recent question in chat about ”When you are in Aachen, Germany, ﬁve other countries capitals are closer than Berlin.” triggered me to try to write something to ﬁnd the cities automatically for ...

—————————-

[How to SortBy Last and in Reverse order?] https://mathematica.stackexchange.com/questions/159295/how-to-sortby-last-and-in-reverse-order

I am looking at the two functions SortBy and ReverseSort.

SortBy[{{1, 2, 3}, {2, 3, 1}, {3, 1, 2}, {2, 2}}, Last]

{{2, 3, 1}, {2, 2}, {3, 1, 2}, {1, 2, 3}}


How do I sort this by the ...

—————————-

[CatalanNumber[-1] formula on functions.wolfram.com unequals result from Mathematica] https://mathematica.stackexchange.com/questions/159143/catalannumber-1-formula-on-functions-wolfram-com-unequals-result-from-mathemat

The formula for CatalanNumber[-1] on this functions.wolfram.com page gives:

-(1/2)

whereas CatalanNumber[-1] directly evaluated gives?

-1

—————————-

[DiscretizeGraphics issues with transformations] https://mathematica.stackexchange.com/questions/159035/discretizegraphics-issues-with-transformations

I noticed DiscretizeGraphics does not work correctly with transformed Graphics such as

Graphics[Rotate[Rectangle[], 30°]]

Both using Rotate and GeometricTransformation together with ...

—————————-

[How to locate a stream line starting from a saddle point?] https://mathematica.stackexchange.com/questions/159093/how-to-locate-a-stream-line-starting-from-a-saddle-point

I read in a table of gradient vectors and plot using the ListStreamPlot. I want to locate and color the line that represents the ”boundary” of the ﬂux. A ﬂux line that 1)starts from a saddle point ...

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

[What are the most common pitfalls awaiting new users?] https://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 ...

—————————-

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

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

The ...

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

[Editing pdf ﬁles with Mathematica] https://mathematica.stackexchange.com/questions/159074/editing-pdf-files-with-mathematica

As an example, consider this pdf ﬁle.

Would it be possible to edit the pdf, such as removing a logo, the page numbering and even frames, and save the result as a pdf? I would like to keep the pdf ...

—————————-

[A question concerning a generalization of HypergeometricPFQ] https://mathematica.stackexchange.com/questions/159242/a-question-concerning-a-generalization-of-hypergeometricpfq

I have been trying to ﬁnd explicit formulas for the real and imaginary parts of the Wolfram function EllipticK. An interesting formula for the real part of EllipticK evaluated at a complex number is ...

- asked by John M. Campbell (1 vote)

—————————-

[Export cdf does not work in MathKernel command line] https://mathematica.stackexchange.com/questions/159210/export-cdf-does-not-work-in-mathkernel-command-line

I am using Mathematica through command line MathKernel. I am not trying to draw any graphics in the console. But I should be able to export things a CDF. Why can’t I export a CDF through command line ...

### 4.8 Tuesday, October 31, 2017

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

[Implementing a planetary terrain generation algorithm] https://mathematica.stackexchange.com/questions/158843/implementing-a-planetary-terrain-generation-algorithm

From this (now deleted) question I found this site where the author discusses a simple technique for random terrain generation on a sphere.

The method discussed is as follows:

—————————-

[Performance of Select] https://mathematica.stackexchange.com/questions/158583/performance-of-select

I have a data set of about 4*10^6 3d-coordinates.

From this volume I am sequentially selecting coordinates along one axis and manipulating this subset.

My question: can the Select function be ...

—————————-

[Create a simple split tree] https://mathematica.stackexchange.com/questions/158858/create-a-simple-split-tree

I am trying to create a simple split tree.

The growth should be only upwards, the vertical element length constant (1), the size of the horizontal bars should be halved in each iteration and the ...

—————————-

[Easy printing of executable code] https://mathematica.stackexchange.com/questions/158901/easy-printing-of-executable-code

I’m working on a package that has functions that call other existing and packaged functions. I’d like a way to output what some of those key calls are, so users can see what’s happening under the ...

—————————-

[Two bouncing balls in 1 dimension, issues with two diﬀerent methods?] https://mathematica.stackexchange.com/questions/158857/two-bouncing-balls-in-1-dimension-issues-with-two-different-methods

I’m trying to simulate 2 balls with the same mass and diameter bouncing one on top of another under gravity, see the illustration below (not ideal, but this is the best result I’ve got so far, the ...

—————————-

Is Mathematica able to communicate with macOS’s native Notiﬁcation Center in order to notify me if an evaluation ﬁnishes in any of my open notebooks?

I’m looking for a solution similar to this one ...

—————————-

[Why does repeated export of JPG-Images consume all memory?] https://mathematica.stackexchange.com/questions/158690/why-does-repeated-export-of-jpg-images-consume-all-memory

I was looking in the history of asked questions for similar questions, but none of the alike questions answered my problem suﬃciently. So I ask nevertheless.

My system memory is leaked by simple ...

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

[Is it possible to draw this ﬁgure using Mathematica?] https://mathematica.stackexchange.com/questions/110848/is-it-possible-to-draw-this-figure-using-mathematica

The ﬁgure is

See the how-to video or a speeded-up GIF.

I believe it should be possible to draw this ﬁgure programmatically using some Random function, but I’m rather new to Mathematica, so I ...

—————————-

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

Question

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

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

[Number Formatting Functions Do Not Evaluate with ExportString] https://mathematica.stackexchange.com/questions/158694/number-formatting-functions-do-not-evaluate-with-exportstring

I need to export in a particular text ﬁle format and tried NumberForm, PaddedForm, AccountingForm, and DecimalForm to see which would work best. To my surprise only NumberForm evaluates when ...

—————————-

[DSolve Throw::nocatch: Uncaught Throw[$Failed,balancefail] returned to top level. error in 11.2] https://mathematica.stackexchange.com/questions/158817/dsolve-thrownocatch-uncaught-throwfailed-balancefail-returned-to-top-level Reported also to WRI. [CASE:3965533] I am in the process of updating Kamke diﬀerentional equations tests for 11.2 when encountered a new error I have not seen before on one of the Kamke ODE’s ... - asked by Nasser (3 votes) —————————- [Solve for several constants using a set of initial conditions] https://mathematica.stackexchange.com/questions/158783/solve-for-several-constants-using-a-set-of-initial-conditions I have a set of diﬀerential equations that I am trying to solve for chemical reaction rate constants. So far I can get DSolve to solve the ODEs with initial conditions which provides the chemical ... - asked by razzle_dazzle_84 (1 vote) ### 4.9 Tuesday, October 24, 2017 ================================== Top new questions this week: ================================== [Strange behavior of Table] https://mathematica.stackexchange.com/questions/158186/strange-behavior-of-table Whenever I run the code a = 0; code := (a++); Table[code; a, {1000}] I get a list of 1000 zeros. However, if I replace 1000 with 100, then a get a list equal to Range[100]. Is this a bug or am I ... - asked by Antonio De Juárez (12 votes), answered by Szabolcs (21 votes) —————————- [Large increase in integrate result leaf size after version 9. Looking for common cause] https://mathematica.stackexchange.com/questions/158059/large-increase-in-integrate-result-leaf-size-after-version-9-looking-for-common reported to WRI. [CASE:3960295] I run the CAS integration tests which contains 15000 integrals over number of Mathematica versions. I found that the average leaf size of the anti-derivatives ... - asked by Nasser (12 votes), answered by Itai Seggev (8 votes) —————————- [Convert Real packed array of pairs to Complex packed array] https://mathematica.stackexchange.com/questions/158082/convert-real-packed-array-of-pairs-to-complex-packed-array I have a Real packed array arr. It may have arbitrary depth but Last@Dimensions[arr] == 2. For example, arr = N@Partition[Partition[Range[24], {2}], 3] I want to convert it to a Complex packed ... - asked by Szabolcs (12 votes), answered by Carl Woll (9 votes) —————————- [Conversion of Matrix of Characters to a Matrix of Zeros and Ones based on Column Frequency] https://mathematica.stackexchange.com/questions/158465/conversion-of-matrix-of-characters-to-a-matrix-of-zeros-and-ones-based-on-column I have a matrix of characters that I wish to convert to a matrix of 0’ s and 1’ s. Although the matrix is large[17, 4301], I subsample this for purposes of my question. The matrix is:  m = {{"T", ... - asked by Stuart Poss (11 votes), answered by Nasser (4 votes) —————————- [What’s the fastest way to take Mean of a Tensor in given slot?] https://mathematica.stackexchange.com/questions/158345/whats-the-fastest-way-to-take-mean-of-a-tensor-in-given-slot One should expect that the implementation of the built-in function Mean was quick. However, as I recently observed, this is not true at all, in particular for matrices. Just compare Mean to the ... - asked by Henrik Schumacher (9 votes), answered by Carl Woll (6 votes) —————————- [Animating a Potential Function (eigenfunctions of Laplace’s equation)] https://mathematica.stackexchange.com/questions/158412/animating-a-potential-function-eigenfunctions-of-laplaces-equation I have written the following DynamicModule. The idea is that you can change the boundary, calculate the eigenfunctions and then animate them. Here is the code: DynamicModule[{pts, bdr = {{0, 0}, {1, ... - asked by Hugh (9 votes), answered by Kuba (8 votes) —————————- [How to implement a free version of WebImageSearch?] https://mathematica.stackexchange.com/questions/158134/how-to-implement-a-free-version-of-webimagesearch I really don’t like functions that I have to pay for, if they can be implemented for free. Is there a way to get around this pay-wall for WebImageSearch? Perhaps using some other free api or service? ... - asked by M.R. (9 votes), answered by b3m2a1 (11 votes) ================================== Greatest hits from previous weeks: ================================== [How to express trigonometric equation in terms of of given trigonometric function?] https://mathematica.stackexchange.com/questions/434/how-to-express-trigonometric-equation-in-terms-of-of-given-trigonometric-functio How can I express a trigonometric equation / identity in terms of a given trigonometric function? using following trigonometric identities Sin[x]^2+Cos[x]^2==1 Sin[x]/Cos[x]==Tan[x] ... - asked by Prashant Bhate (27 votes), answered by Simon (34 votes) —————————- [Learn Mathematica (Wolfram) Language in one day] https://mathematica.stackexchange.com/questions/138366/learn-mathematica-wolfram-language-in-one-day Currently I am trying to learn Python. Searching for relevant material I came across X in Y minutes and books with titles such as Learn Python in one day, in 24 hours, etc. Similar material exists ... - asked by dimitris (26 votes), answered by masterxilo (11 votes) ================================== Can you answer these? ================================== [How to draw a generic 3D closed shape to be analyzed in AceFEM?] https://mathematica.stackexchange.com/questions/158446/how-to-draw-a-generic-3d-closed-shape-to-be-analyzed-in-acefem I would like to draw a 3D shape to test my AceGen procedure. I will insert the AceFEM part of my code. In this example, I have performed the analysis on a hexahedron element. - asked by M.Rock (2 votes) —————————- [Kernel crash with KeySelect and repeated keys on list of rules] https://mathematica.stackexchange.com/questions/158421/kernel-crash-with-keyselect-and-repeated-keys-on-list-of-rules After running KeySelect[{"a" -&gt; 0, "a" -&gt; 1}, True &amp;] my kernel either hangs forever (possibly with the eventual warning that ”the kernel is not responding to a Dynamic evaluation”) or ... - asked by masterxilo (2 votes) —————————- [How to remove circled noise from image] https://mathematica.stackexchange.com/questions/158123/how-to-remove-circled-noise-from-image Consider a simpliﬁed example: noise noise = Table[ RandomVariate[ NormalDistribution[1, 0.2]] Sin[Sqrt[x^2 + y^2]]^8, {x, -16, 16 - 16/512, 32/512}, {y, -16, 16 - 16/512, 32/512}]; ... - asked by xslittlegrass (3 votes) ### 4.10 Tuesday, October 17, 2017 ================================== Top new questions this week: ================================== [Is building an event-based parser possible/reasonable in Mathematica (WL)?] https://mathematica.stackexchange.com/questions/157834/is-building-an-event-based-parser-possible-reasonable-in-mathematica-wl Too long? Go to Problems section Background I like to learn by doing small, sometimes artiﬁcial, projects. Among other things I had ’parsers’, and ’stream methods / streams in MMA’ on my to learn ... - asked by Kuba (11 votes) —————————- [Test if a list is a constant integer multiple of another list] https://mathematica.stackexchange.com/questions/157783/test-if-a-list-is-a-constant-integer-multiple-of-another-list I have a list of lists, and I want to eliminate all the lists that are constant integer multiples of another list. My initial approach was to divide the lists using nested tables. ex1 = {{1, 1, 1}, ... - asked by Lokdal (10 votes), answered by Mr.Wizard (9 votes) —————————- [Cannot Reproduce Answer to 99576] https://mathematica.stackexchange.com/questions/157889/cannot-reproduce-answer-to-99576 Bug introduced between versions 10.1 and 10.4, and persisting through 11.2. Reported to Wolfram, Inc as CASE:3958778. Using either 11.2 or 10.4 on Windows 10 (64 bit), I am unable to reproduce the ... - asked by bbgodfrey (9 votes) —————————- [Does ‘SeedRandom‘ give the same set of random numbers across operating systems?] https://mathematica.stackexchange.com/questions/157621/does-seedrandom-give-the-same-set-of-random-numbers-across-operating-systems If I use SeedRandom[12345] RandomReal[{0,1},100] I get the same random numbers on two versions of Mathematica: 10.4.1.0 on Windows 10 and 11.1.1.0 on Windows 7. But does the same seed get the ... - asked by JimB (9 votes), answered by halirutan (8 votes) —————————- [Fill the data of an Association based on a list] https://mathematica.stackexchange.com/questions/157852/fill-the-data-of-an-association-based-on-a-list Consider the following the list and association. list1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; asc = &lt;|1 -&gt; a, 4 -&gt; b, 7 -&gt; c, 10 -&gt; d|&gt;; I would like to create an association which ... - asked by Anjan Kumar (7 votes), answered by Kuba (5 votes) —————————- [How to extract data points from two graphics and ﬁnd the intersections between them?] https://mathematica.stackexchange.com/questions/157787/how-to-extract-data-points-from-two-graphics-and-find-the-intersections-between I am working on a mathematical problem called ”Buﬀon’s Needle”. Here is the setup I made: point[v_, u_] := Normalize[v - u] + u experiment50 = Show[ Graphics[ Table[{ RGBColor[0, 0, 0], ... - asked by Anna Morales Melgares (7 votes), answered by kglr (7 votes) —————————- [How to thread over ragged list while skipping empty sub-lists?] https://mathematica.stackexchange.com/questions/157635/how-to-thread-over-ragged-list-while-skipping-empty-sub-lists I have a very large ragged list result that is a list of list of pairs where sometimes the sub-list contains the empty list. res = {{{20, 1}, {200, 2}}, {{}}, {{175, 1}}}; In the above minimal ... - asked by Edmund (7 votes), answered by kglr (9 votes) ================================== Greatest hits from previous weeks: ================================== [LaTeXand Mathematica] https://mathematica.stackexchange.com/questions/736/latex-and-mathematica I quite often would like to draw graphics in my LaTeXdocuments using Mathematica. I have encountered three problems. I would like to know if there are any workarounds to these problems I would ... - asked by Thomas Rot (108 votes), answered by Simon (40 votes) —————————- [Code that generates a mandala] https://mathematica.stackexchange.com/questions/136974/code-that-generates-a-mandala My little brother asked me to print original mandalas for coloring. I would like some idea on how to create them, but without color, so he can color them. examples - asked by zeros (48 votes), answered by Anton Antonov (71 votes) ================================== Can you answer these? ================================== [Export BatchNormalizationLayer as MXNet] https://mathematica.stackexchange.com/questions/157856/export-batchnormalizationlayer-as-mxnet I just tried to import a net from mathemtica into pythons using MXNet. It works ﬁne with the following manual. However, as soon as I try to add a BatchNormalizationLayer to my net MXNets bind() ... - asked by MaxJ (3 votes) —————————- [ListPlot point colors by list of colorfunctions] https://mathematica.stackexchange.com/questions/157963/listplot-point-colors-by-list-of-colorfunctions I would like to display the positions of a collection of particles as a function of time (animated) and color code them based on their velocities. For example, consider 10 particles moving in a 2D ... - asked by SeanM (1 vote) —————————- [Why are Label Pixelated?] https://mathematica.stackexchange.com/questions/157693/why-are-label-pixelated It seems that Mathematica implements the processing of labels quite diﬀerent for diﬀerent plot-functions. The good -> Plot[]: l1 = GraphPlot[Table[i -&gt; 1, {i, 0, 1}]] TPlot = Plot[{Cos[x], ... - asked by Freeman (2 votes) ### 4.11 Tuesday, October 10, 2017 ================================== Top new questions this week: ================================== [How can I determine the type of a packed array?] https://mathematica.stackexchange.com/questions/157484/how-can-i-determine-the-type-of-a-packed-array Packed arrays can be of type Integer, Real or Complex. Knowing that an array arr is packed, how can I eﬃciently determine its type? - asked by Szabolcs (15 votes), answered by Szabolcs (17 votes) —————————- [Deleting sublists from lists] https://mathematica.stackexchange.com/questions/157267/deleting-sublists-from-lists I have a list consisting of symbols and integers. I would like to delete the integers from the list only if a symbol precedes and follows each integer: testList={a,b,3,c,4,5,d,e,f,1,g,4} becomes: ... - asked by Suite401 (12 votes), answered by jjc385 (13 votes) —————————- [Summation bug in 11.2] https://mathematica.stackexchange.com/questions/157290/summation-bug-in-11-2 If I sum all the positive-numbered Fourier coeﬃcients of $$\cos (x)$$, I get the correct answer. If I sum the negative-numbered ones, I get a wrong answer. Splitting the sum into two parts somehow ... - asked by level1807 (10 votes), answered by Michael E2 (14 votes) —————————- [Calculating the size of objects in the picture] https://mathematica.stackexchange.com/questions/157374/calculating-the-size-of-objects-in-the-picture I’m new to Wolfram Mathematica. I have an initial image: My goal is to ﬁnd a radius of the water drop, like so: With that in mind, I’ve changed the initial photo: resultImage = ... - asked by Elias (9 votes), answered by b3m2a1 (7 votes) —————————- [Overlapping graphic primitives] https://mathematica.stackexchange.com/questions/157489/overlapping-graphic-primitives I am trying to make a ﬁgure in Mathematica using some graphic primitives: rod[l_, r_] := GraphicsGroup[{Opacity[.1], {Disk[{-l/2 + r, 0}, r, {\[Pi]/2 , 3 \[Pi]/2}]}, {Disk[{l/2 - r, 0}, r, ... - asked by Ruud3.1415 (7 votes), answered by kglr (3 votes) —————————- [How can I implement my own documentation search function?] https://mathematica.stackexchange.com/questions/157303/how-can-i-implement-my-own-documentation-search-function The current documentation search doesn’t allow for very sophisticate searching, can I write my own function to search through the docs? - asked by b3m2a1 (7 votes), answered by b3m2a1 (8 votes) —————————- [Can I implement something like the old documentation help browser?] https://mathematica.stackexchange.com/questions/157317/can-i-implement-something-like-the-old-documentation-help-browser Old versions of Mathematica had a help browser that was more click through and structured. How can I reimplement something like that for the new (since v6) docs? - asked by b3m2a1 (6 votes), answered by b3m2a1 (10 votes) ================================== Greatest hits from previous weeks: ================================== [What are the most common pitfalls awaiting new users?] https://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 Dr. belisarius (405 votes), answered by Michael E2 (235 votes) —————————- [How do I clear all user deﬁned symbols?] https://mathematica.stackexchange.com/questions/850/how-do-i-clear-all-user-defined-symbols Is there some way to do this other than going to Evaluation -&gt; Quit kernel and ﬁring a new one up? - asked by niklasﬁ (58 votes), answered by Artes (56 votes) ================================== Can you answer these? ================================== [Memoization of built in function] https://mathematica.stackexchange.com/questions/157429/memoization-of-built-in-function What is the best way to let mathematica memoize built-in function like e.g. SphericalHarmonicY[l,m,th,ph] One possibility would be for sure: sphericalHarmonicY[l_,m_,th_,ph_]:= ... - asked by Mr Puh (3 votes) —————————- [Can’t import Gluon into mma] https://mathematica.stackexchange.com/questions/157466/cant-import-gluon-into-mma This is a simple DNN from Fast, portable neural networks with Gluon HybridBlocks: This is json ﬁle and params ﬁle of Gluon(MXNet) import mxnet as mx from mxnet.gluon import nn print(”mxnet ... - asked by partida (4 votes) —————————- [NIntegrate and deﬁnite Integrate give diﬀerent results] https://mathematica.stackexchange.com/questions/157300/nintegrate-and-definite-integrate-give-different-results Suppose the function f[x_,q_]=(15876 Exp[-0.527076 q^2] (x^2-2 x+2) SphericalBesselJ[1,5 q]^2 (q^2-8100 x^2))/(3425*Pi*q^5*x); I need to perform the integration over q in the domain ... - asked by John Taylor (1 vote) ### 4.12 Tuesday, October 3, 2017 ================================== Top new questions this week: ================================== [Frown for a sex change, or, how do I unbork the ”FacialGender” classiﬁer in 11.2?] https://mathematica.stackexchange.com/questions/156847/frown-for-a-sex-change-or-how-do-i-unbork-the-facialgender-classifier-in-11 The limits of machine learning. I thought the new ”FacialGender” option for Classiﬁer would be an amusing thing to explore. So far, so good. But that’s me with bed-head. So let’s try a picture ... - asked by Verbeia (17 votes), answered by Searke (2 votes) —————————- [Improve the mesh smoothing procedure] https://mathematica.stackexchange.com/questions/156611/improve-the-mesh-smoothing-procedure My question is inspired by this answer about meshing with quadrilateral elements. The following functions are my (naive) try of implementing the Laplacian smoothing. I ﬁnd interior nodes in the mesh ... - asked by Pinti (11 votes), answered by user21 (10 votes) —————————- [Possible bug in RegionUnion or related functions?] https://mathematica.stackexchange.com/questions/157031/possible-bug-in-regionunion-or-related-functions Functions for derived geometric regions (RegionUnion and related) have been signiﬁcantly updated in MMA 11.2 and now this simple example doesn’t work any more as expected. Could this be a bug or I am ... - asked by Pinti (8 votes), answered by Szabolcs (5 votes) —————————- [Dataset - append row with a value which depends on two other rows] https://mathematica.stackexchange.com/questions/156980/dataset-append-row-with-a-value-which-depends-on-two-other-rows I have go through the forum but did not see this question. Hope I don’t miss it. I want to add a new colum ”C” to a dataset with existing columns named ”A” and ”B”. The value of ”C” shall be the ... - asked by Porty (7 votes), answered by WReach (6 votes) —————————- [How to tell Mathematica to do this with decimal part of real number?] https://mathematica.stackexchange.com/questions/156823/how-to-tell-mathematica-to-do-this-with-decimal-part-of-real-number My apologies if this was asked here before. My friend and I want to do this: Suppose that we have some real number $$a. a_1 a_2...a_n...$$ where $$a_i$$ are digits in the set $$\{1,2,3,4,5,6,7,8,9,0\}$$ ... - asked by Antoine de Paladin (7 votes), answered by Edmund (6 votes) —————————- [FullForm of b/c and c/b with diﬀerent order] https://mathematica.stackexchange.com/questions/156757/fullform-of-b-c-and-c-b-with-different-order I am studying Mathematica myself and doing some exercises for improvement.  Question: Try to guess the internal forms of b/c and c/b. Verify your answer using FullForm. Here is what I got by ... - asked by anhnha (7 votes), answered by Mr.Wizard (6 votes) —————————- [Generate random walk on a graph] https://mathematica.stackexchange.com/questions/156626/generate-random-walk-on-a-graph I have a graph with 100 nodes and 200 edges. How can I generate a random walk in it and animate it? - asked by nasha amalina (7 votes), answered by rhermans (13 votes) ================================== Greatest hits from previous weeks: ================================== [How to ﬁnd the position of elements in a list satisfying criteria] https://mathematica.stackexchange.com/questions/180/how-to-find-the-position-of-elements-in-a-list-satisfying-criteria Say I have a list x={2,4,6,8,10} and I want to find out the positions of the elements that are greater than 7. Select[x, #&gt;7&amp;] gives the elements themselves, and Position[x,8] gives the ... - asked by PeterR (47 votes), answered by J. M. (45 votes) —————————- [How to calculate contour integrals with Mathematica?] https://mathematica.stackexchange.com/questions/34073/how-to-calculate-contour-integrals-with-mathematica How to calculate the integral of $$\frac {1}{\sqrt {4 z^2 + 4 z + 3}}$$ over the unit circle counterclockwise for each branch of the integrand? - asked by user64494 (30 votes), answered by Artes (53 votes) ================================== Can you answer these? ================================== [How to decode Ascii85 format (AKA base85)?] https://mathematica.stackexchange.com/questions/156667/how-to-decode-ascii85-format-aka-base85 The ASCII85 encoding is a binary string encoding where every four bytes are encoded with ﬁve ASCII letters, using 85 diﬀerent types of characters. Unfortunately, it’s not in$CharacterEncodings:

...

—————————-

[FIR ﬁlter and the relation between Sample rate and cut-oﬀ frequency] https://mathematica.stackexchange.com/questions/156685/fir-filter-and-the-relation-between-sample-rate-and-cut-off-frequency

I have problem to unterstand the logic of the cut-oﬀ frequency of the FIR ﬁlter. Suppose my sample rate is 2MHz and I want to design a lowpass ﬁlter with a cut-oﬀ frequency 100Hz. What will be ...

—————————-

[FindCluster only ﬁnds cluster ”with a little help”] https://mathematica.stackexchange.com/questions/156984/findcluster-only-finds-cluster-with-a-little-help

Currently I made some slides to illustrate clustering. As an example I made a point set of two clusters:

   {clusters, graph} = Block[{c1, c2, cluster1, cluster2},
c1 = {1, 2};
cluster1 = (# +  ...

### 4.13 Tuesday, September 26, 2017

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

[Finite element mesh not resolving features] https://mathematica.stackexchange.com/questions/156174/finite-element-mesh-not-resolving-features

I am trying to make a ﬁnite element mesh in 2D. The features are not found by ToElementMesh. This is a shelf bracket with nails. I build the region using RegionDiﬀerence and RegionUnion and the ...

—————————-

[Are the mail settings as given in preferences still programmatically accessible in V 11.2] https://mathematica.stackexchange.com/questions/156183/are-the-mail-settings-as-given-in-preferences-still-programmatically-accessible

In versions before 11.2 (and after 9) one could get the
current settings as defined in the preferences (Internet &amp; Email -> Mail Settings)
with Options[SendMail]. As the options for SendMail have  ...

—————————-

[Implement fractional Laplacian] https://mathematica.stackexchange.com/questions/156420/implement-fractional-laplacian

What is a way to implement the Fractional Laplacian with Mathematica?

How can we apply such implementation to numerically solve the problem

$$(-\Delta)^su = 1 \text{ in } B_1(0), \\ u = 0 \text{ in ... - asked by Jay (9 votes), answered by Henrik Schumacher (14 votes) —————————- [Blur, GaussianFilter and ImageConvolve doesn’t work on some images] https://mathematica.stackexchange.com/questions/156210/blur-gaussianfilter-and-imageconvolve-doesnt-work-on-some-images In versions 8.0.4 and 9.0.1 applying Blur to an image gives expected result: img = Import["http://i.stack.imgur.com/UsJTa.png"] blurred = Blur[img, 5] ColorSeparate[blurred] But ... - asked by Alexey Popkov (9 votes), answered by Alexey Popkov (11 votes) —————————- [Error and uncertainty propagation: Is using Precision/Accuracy a sound strategy?] https://mathematica.stackexchange.com/questions/156481/error-and-uncertainty-propagation-is-using-precision-accuracy-a-sound-strategy Questions What are the available resources to deal with experimental error and uncertainty propagation in Mathematica? Given that Mathematica already uses linearized model of error propagation on ... - asked by rhermans (8 votes) —————————- [Unexpected behavior using ‘ReplaceAll[]‘ for nested lists] https://mathematica.stackexchange.com/questions/156538/unexpected-behavior-using-replaceall-for-nested-lists ReplaceAll[] might lead to unexpected behavior (at least it surprised me). I use ReplaceAll[] to convert a list (basically data cleanup). For the command: {{1, "2"}, {2, "3"}} /. {x_, _ } :&gt; {x, ... - asked by Dennis (7 votes), answered by Szabolcs (9 votes) —————————- [What are the possible Method option values for plotting functions?] https://mathematica.stackexchange.com/questions/156475/what-are-the-possible-method-option-values-for-plotting-functions Many plotting functions have a Method options with descriptions like this: Plot: ”the method to use for reﬁning curves” RegionPlot: ”the method to use for reﬁning regions” ContourPlot: ”the method ... - asked by Szabolcs (7 votes) ================================== Greatest hits from previous weeks: ================================== [How to perform a multi-peak ﬁtting?] https://mathematica.stackexchange.com/questions/26336/how-to-perform-a-multi-peak-fitting I am wondering how to implement the multi-peak detecting and fitting in Mathematica. Following is an example of fitting the data using three peaks (such that the data ~ peak1 + peak2 + peak3). The ... - asked by Everett You (46 votes), answered by Silvia (47 votes) —————————- [How do I clear all user deﬁned symbols?] https://mathematica.stackexchange.com/questions/850/how-do-i-clear-all-user-defined-symbols Is there some way to do this other than going to Evaluation -&gt; Quit kernel and firing a new one up? - asked by niklasﬁ (55 votes), answered by Artes (54 votes) ================================== Can you answer these? ================================== [Possible Symbolic Integration Bug] https://mathematica.stackexchange.com/questions/156215/possible-symbolic-integration-bug Bug introduced between 5 and 8 and persisting through 11.2 I think I may have found a bug, and want to verify is this reproducible in other versions and platforms and not a mistake of mine. I ... - asked by yyli (5 votes) —————————- [Finding the slowest decay to a value for a 2D function] https://mathematica.stackexchange.com/questions/156338/finding-the-slowest-decay-to-a-value-for-a-2d-function I have a function acf2[x,y] that describes the auto-correlation function of a simulated real surface, with a peak at the origin (acf2[0,0] = 1), and need to ﬁnd the maximum distance from the origin ... - asked by L.Todhunter (1 vote) —————————- [Can Mathematica run javascript on a website?] https://mathematica.stackexchange.com/questions/156377/can-mathematica-run-javascript-on-a-website One way of running Javascript on a website is to use for instance Greasemonkey. By any chance, would it be possible to execute Javascript commands from Mathematica? - asked by anderstood (1 vote) ### 4.14 Tuesday, September 19, 2017 ================================== Top new questions this week: ================================== [Pop-up appeared and then disappeared during ﬁrst documentation search in 11.2] https://mathematica.stackexchange.com/questions/155717/pop-up-appeared-and-then-disappeared-during-first-documentation-search-in-11-2 After installing Mathematica 11.2, the ﬁrst time I searched for something in the help center a pop-up appeared and then disappeared. It didn’t appear on a subsequent search, even if I restarted ... - asked by Itai Seggev (23 votes), answered by Itai Seggev (26 votes) —————————- [ExternalEvaluate for Python fails with Import::nopythonevals] https://mathematica.stackexchange.com/questions/155821/externalevaluate-for-python-fails-with-importnopythonevals I tried using ExternalEvaluate on OS X with Anaconda Python, and every ExternalEvaluate call failed with the Import::nopythonevals message. This happened even though an external evaluator was ... - asked by Szabolcs (15 votes), answered by Szabolcs (12 votes) —————————- [Visualizing a holomorphic bijection between the unit disc and a domain] https://mathematica.stackexchange.com/questions/155954/visualizing-a-holomorphic-bijection-between-the-unit-disc-and-a-domain One can construct a holomorphic bijection between the (open) unit disc $$D=\{z\in {\bf C}: |z|<1\}$$, and a domain $$D\setminus \overline {B_{1/2}(-1/2)}$$ where $$B_r(z_0)$$ denotes the ball of radius $$r$$ ... - asked by Jack (12 votes), answered by Michael E2 (13 votes) —————————- [How to create search indices for custom documentation pages?] https://mathematica.stackexchange.com/questions/155932/how-to-create-search-indices-for-custom-documentation-pages I have a package that uses custom documentation pages that are not generated with Wolfram Workbench. How can I create search indices for these pages? Requirements: Searching should work in ... - asked by Szabolcs (10 votes), answered by Szabolcs (1 vote) —————————- [Compile M11.1-compatible LibraryLink libraries using M11.2] https://mathematica.stackexchange.com/questions/155940/compile-m11-1-compatible-librarylink-libraries-using-m11-2 WolframLibraryVersion, deﬁned in WolframLibrary.h, was bumped from 3 to 4 in Mathematica 11.2. This causes libraries compiled with M11.2 to fail to load in earlier versions. Is it possible to ... - asked by Szabolcs (9 votes) —————————- [How to insert dimensions in graphics?] https://mathematica.stackexchange.com/questions/155677/how-to-insert-dimensions-in-graphics I’m creating ﬁgures (a T beam section) using the Graphics function. Like this: a = Graphics[Polygon[{{0, 80}, {0, 85}, {100, 85}, {100, 80}}]]; b = Graphics[Polygon[{{47.5, 80}, {52.5, 80}, {52.5, ... - asked by Diogo (9 votes), answered by wxﬄes (10 votes) —————————- [Mathematica 11.2 Import Statement Produces Errors & Truncates CSV Data Created in 11.1] https://mathematica.stackexchange.com/questions/155908/mathematica-11-2-import-statement-produces-errors-truncates-csv-data-created-i Bug introduced in 11.2.0 TL;DR Issue 1 (bug): Import of CSV files with column specification fails when "HeaderLines" or "SkipLines" option is used: Import["ExampleData/financialtimeseries.csv", ...  - asked by Joseph Karpinski (8 votes), answered by Itai Seggev (8 votes) ================================== Greatest hits from previous weeks: ================================== [How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc] https://mathematica.stackexchange.com/questions/66273/how-to-tell-mathematica-that-certain-variables-are-real-imaginary-integer-value I’m trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example, u[x_] := Sqrt[2/L] * Sin[Pi * n * x / L] and then ... - asked by Matthew Brunetti (17 votes), answered by SquareOne (11 votes) —————————- [How do I clear all user deﬁned symbols?] https://mathematica.stackexchange.com/questions/850/how-do-i-clear-all-user-defined-symbols Is there some way to do this other than going to Evaluation -&gt; Quit kernel and firing a new one up? - asked by niklasﬁ (55 votes), answered by Artes (54 votes) ================================== Can you answer these? ================================== [Covariant derivative given Christoﬀel symbols] https://mathematica.stackexchange.com/questions/155871/covariant-derivative-given-christoffel-symbols I’ve been trying to take covariant derivative of various quantities along various surfaces in Mathematica, but I keep running into issues, frequently I get a tensor with the wrong dimension. Using the ... - asked by Noahb32 (1 vote) —————————- [How to pass in-memory images through ExternalEvaluate?] https://mathematica.stackexchange.com/questions/156051/how-to-pass-in-memory-images-through-externalevaluate Version 11.2 has a new import/export format PythonExpression. Unfortunately, it doesn’t work out-of-the-box with images: And using the ImageData directly is too slow: Anyhow, I have some image ... - asked by M.R. (4 votes) —————————- [GeneralizedLinearModelFit IRwLS] https://mathematica.stackexchange.com/questions/155692/generalizedlinearmodelfit-irwls I’m interested in Mathematica’s capabilities with regard to robust ﬁtting vs. outliers. In the Statistical Model Analysis Tutorial under the Generalized Linear Models section heading, there is this ... - asked by Chris Chiasson (1 vote) ### 4.15 Tuesday, September 12, 2017 ================================== Top new questions this week: ================================== [Framework behind Graph plots. DynamicNamespace and friends] https://mathematica.stackexchange.com/questions/155237/framework-behind-graph-plots-dynamicnamespace-and-friends As shown in DynamicLocation usage, we can use it to quickly create very nice functionality, that it to refer to graphics’ primitives relative coordinates without calculations of boundary etc. As ... - asked by Kuba (15 votes), answered by Kuba (12 votes) —————————- [DynamicLocation usage] https://mathematica.stackexchange.com/questions/155157/dynamiclocation-usage Background DynamicLocation can be very useful: LocatorPane[Dynamic@x, Graphics[ { EdgeForm @ Thick, FaceForm @ None, Rectangle[BoxID -&gt; "box"] , Arrow[{Dynamic[x], ... - asked by Kuba (14 votes), answered by b3m2a1 (9 votes) —————————- [How can I use GitHub as a paclet server?] https://mathematica.stackexchange.com/questions/155123/how-can-i-use-github-as-a-paclet-server I want to use GitHub as a paclet server, but this fails: PacletInstall[ "ServiceConnection_StackExchange", "Site" -&gt; "https:/github.com/b3m2a1/PacletServer" ] PacletSiteUpdate::err: An error ... - asked by b3m2a1 (13 votes), answered by b3m2a1 (16 votes) —————————- [Permanently extending the behaviour of functions (like decorators)] https://mathematica.stackexchange.com/questions/155567/permanently-extending-the-behaviour-of-functions-like-decorators Suppose I have a function, e.g. f[x_] := x^2 It works like this: f[5] (* 25 *) I would like to permanently modify it so that calling f[5] will perform some action before and after the evaluation ... - asked by Szabolcs (11 votes), answered by Leonid Shifrin (9 votes) —————————- [Is Tooltip broken in MMA 11.1.1?] https://mathematica.stackexchange.com/questions/155434/is-tooltip-broken-in-mma-11-1-1 Bug introduced in 11.1.0 and persisting through 11.1.1 I have just discovered that Tooltip works diﬀerently from as described in the documentation, at least in my version of MMA (11.1.1.0, Windows ... - asked by Oleg Soloviev (9 votes) —————————- [Install paclets into BaseDirectory on multi-user system] https://mathematica.stackexchange.com/questions/155122/install-paclets-into-basedirectory-on-multi-user-system PacletInstall will install paclets into the UserBaseDirectory by default. How can we install them in BaseDirectory so that all users on the system will have access? Is this currently possible? ... - asked by Szabolcs (9 votes), answered by halirutan (5 votes) —————————- [How can I reproduce the result of PrincipalComponents] https://mathematica.stackexchange.com/questions/155467/how-can-i-reproduce-the-result-of-principalcomponents matrix = N[{{1, 2}, {2, 3}, {4, 10}}] {{1., 2.}, {2., 3.}, {4., 10.}} res1 = PrincipalComponents[matrix, Method -&gt; "Correlation"] {{1.10388, 0.130549}, {0.478746, -0.170139}, {-1.58262, ... - asked by HyperGroups (8 votes), answered by J. M. (13 votes) ================================== Greatest hits from previous weeks: ================================== [Labeling individual curves in Mathematica] https://mathematica.stackexchange.com/questions/4444/labeling-individual-curves-in-mathematica I need to create a plot for export and inclusion in a report. Is there a better way to label curves than PlotLegends? From what I’ve read and my personal experience, PlotLegends is pretty bad. Is ... - asked by Tianxiang Xiong (52 votes), answered by Artes (40 votes) —————————- [What does # mean in Mathematica?] https://mathematica.stackexchange.com/questions/19035/what-does-mean-in-mathematica I asked Mathematica to compute the following Solve[c (1-x)^2-x^(1/4) == 0, x] and it returned this: x = Root[#1^8 c^4 - 8 #1^7 c^4 + 28 #1^6 c^4 - 56 #1^5 c^4 + 70 #1^4 c^4 - 56 #1^3 c^4 + 28 ... - asked by ronanymous (20 votes), answered by Dr. belisarius (43 votes) ================================== Can you answer these? ================================== [Question about RandomSeed option in AdaptiveMonteCarlo NIntegrate method] https://mathematica.stackexchange.com/questions/155249/question-about-randomseed-option-in-adaptivemontecarlo-nintegrate-method I’ve been familiarising myself with the diﬀerent options available in the AdaptiveMonteCarlo method for NIntegrate but one of the things that I can’t really understand is what the numbers correspond ... - asked by user35305 (1 vote) —————————- [Delete duplicates in a list compiled of diﬀerent lists and also delete] https://mathematica.stackexchange.com/questions/155261/delete-duplicates-in-a-list-compiled-of-different-lists-and-also-delete I've got three lists: Lst1 has 100 different values for "r". Lst2 has 100 different values for "a". And Lst3=Pi*Lst1^2*Lst2. In Lst3 I've got duplicates and I want to get rid of them, but I also want ... - asked by Cornelis (1 vote) —————————- [How to implement LinkLaunch-like functionality with timeout?] https://mathematica.stackexchange.com/questions/155493/how-to-implement-linklaunch-like-functionality-with-timeout tl;dr: What is the best way (and correct sequence of operations) to connect two programs using MathLink while anticipating failures / timeouts? Launch program and connect, with timeout I have a ... - asked by Szabolcs (4 votes) ### 4.16 Tuesday, September 5, 2017 ================================== Top new questions this week: ================================== [Finding $$n^{\text {th}}$$ largest/smallest element] https://mathematica.stackexchange.com/questions/154944/finding-n-textth-largest-smallest-element Ordering can quickly ﬁnd the position of the largest/smallest element in a list, but ﬁnding the position of the $$n^{\text {th}}$$ largest/smallest element is much slower: data = RandomReal[10, 10^7]; ... - asked by Carl Woll (13 votes), answered by Carl Woll (12 votes) —————————- [Fast pairwise SameQ test of an ordered list] https://mathematica.stackexchange.com/questions/155017/fast-pairwise-sameq-test-of-an-ordered-list I have an ordered list of $$N$$ numbers, and I want to ﬁnd out whether adjacent numbers are SameQ or not, returning a list of 0s and 1s of length $$N-1$$. One approach is something like: ... - asked by Carl Woll (11 votes), answered by jkuczm (8 votes) —————————- [Given an ordered set S, ﬁnd the points in S corresponding to another list] https://mathematica.stackexchange.com/questions/154893/given-an-ordered-set-s-find-the-points-in-s-corresponding-to-another-list Given a sorted list of numbers $$S$$, I want to create a function that accepts a list of numbers $$L$$ and for each number $$l \in L$$ it returns the index of the largest number $$s \in S$$ such that ... - asked by Carl Woll (11 votes), answered by nikie (13 votes) —————————- [Geolocate multiple IP addresses] https://mathematica.stackexchange.com/questions/155076/geolocate-multiple-ip-addresses I would like to geolocate a few hundred IP addresses (as part of analysing server logs). What is the best way to do this using Mathematica? Does Mathematica have any builtin functionality for this? ... - asked by Szabolcs (9 votes), answered by Szabolcs (9 votes) —————————- [How to connect two images] https://mathematica.stackexchange.com/questions/155093/how-to-connect-two-images I have talk about how to catenate two images whose have same part totally in my this post. But in this case two images have similar information, not totally same. img1 = Import @ ... - asked by yode (9 votes), answered by Kuba (8 votes) —————————- [Filter elements in descending order] https://mathematica.stackexchange.com/questions/154761/filter-elements-in-descending-order I want to solve the following problem eﬃciently: Given a list of pairs (value, data), I want to remove all the pairs so that the resulting list has the value property of its elements sorted. That ... - asked by José D. (9 votes), answered by Mathe172 (9 votes) —————————- [Changing numbers inside list to a list] https://mathematica.stackexchange.com/questions/154911/changing-numbers-inside-list-to-a-list I have a list wich contains numbers and other lists, and what I want is to change every number x to x,0. So if the function I’m seeking is called f, then a = {1,Pi,2+3I,{1,2},{3,4},-2} f[a] ... - asked by Garmekain (8 votes), answered by John Joseph M. Carrasco (10 votes) ================================== Greatest hits from previous weeks: ================================== [Is it possible to draw this ﬁgure using Mathematica?] https://mathematica.stackexchange.com/questions/110848/is-it-possible-to-draw-this-figure-using-mathematica The ﬁgure is See the how-to video or a speeded-up GIF. I believe it should be possible to draw this ﬁgure programmatically using some Random function, but I’m rather new to Mathematica, so I ... - asked by AccidentalFourierTransform (62 votes), answered by M.R. (86 votes) —————————- [Can Mathematica do symbolic linear algebra?] https://mathematica.stackexchange.com/questions/3242/can-mathematica-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 (47 votes), answered by helen (25 votes) ================================== Can you answer these? ================================== [Strange result for an improper integral $$\int _{0}^{1}\frac {x^{-1/2}}{e^{x}-1} \sin \left (\frac {1}{x}\right )dx$$] https://mathematica.stackexchange.com/questions/155066/strange-result-for-an-improper-integral-int-01-fracx-1-2ex-1-s The improper integral is convergent conditionally. (Applying Dirichlet Test, ... - asked by user250236 (1 vote) —————————- [Perplexing simpliﬁcation of RotationMatrix] https://mathematica.stackexchange.com/questions/154793/perplexing-simplification-of-rotationmatrix The result of FullSimplify[RotationMatrix[θ, {Cos[ψ], Sin[ψ], 0}], ψ &gt; 0].{0, 0, 1} in Mathematica 11 is {Sign[Sec[ψ]]^2 Sin[θ] Sin[ψ], -Cos[ψ] Sin[θ], Cos[θ]} instead of the nicer result ... - asked by theindigamer (1 vote) —————————- [collecting terms with diﬀerent order] https://mathematica.stackexchange.com/questions/154849/collecting-terms-with-different-order I am using homotopy perturbation method to solve nonlinear ODE. The ﬁrst step is to introduce P parameter and collect diﬀerent order of P. The code is like this: Collect[(1 - p) ((((1 + ... - asked by sajad.sharhani (1 vote) ### 4.17 Tuesday, August 29, 2017 ================================== Top new questions this week: ================================== [Inserting some zeros in a list by a rule of positions] https://mathematica.stackexchange.com/questions/154551/inserting-some-zeros-in-a-list-by-a-rule-of-positions I have a list: mainlist={0.23, 0.34, 0.8, 0.0, -0.2, 0.4, -0.1}; I have to extend the above list to another one ﬁnalresult with Length=17. But in ﬁnalresult the elements of the mainlist must be ... - asked by Inzo Babaria (12 votes), answered by John Joseph M. Carrasco (14 votes) —————————- [How to use Streaming package in v11.1?] https://mathematica.stackexchange.com/questions/154439/how-to-use-streaming-package-in-v11-1 I am trying to use the streaming package for lazy list operations demonstrated in this post. But I found that the package was signiﬁcantly changed in version 11. After some observations, I found that ... - asked by happy ﬁsh (11 votes), answered by Leonid Shifrin (9 votes) —————————- [Interior of discretized region] https://mathematica.stackexchange.com/questions/154544/interior-of-discretized-region I have some domain of interest: r = 0.3; dom = ImplicitRegion[(x - 1/2)^2 + (y - 1/2)^2 &gt;= r^2, {{x, 0, 1}, {y, 0, 1}}]; Now I can extract mesh of the whole domain or just boundary: ... - asked by user16320 (9 votes), answered by C. E. (10 votes) —————————- [Orientation of boundary domain normals] https://mathematica.stackexchange.com/questions/154656/orientation-of-boundary-domain-normals I would like to use BoundaryNormals provided by the ElementMesh object. To demonstrate my problem I will take my favorite domain: dom = ImplicitRegion[(x - 1/2)^2 + (y - 1/2)^2 &gt;= (1/4)^2, {{x, 0, ... - asked by user16320 (8 votes), answered by user16320 (4 votes) —————————- [Best Practices for Creating CDF e-textbook] https://mathematica.stackexchange.com/questions/154550/best-practices-for-creating-cdf-e-textbook I attended a talk given by Eric Schulz a few years ago. It was similar to his talk ”Sharing Wisdom Gained from Publishing a CDF Ebook” given here. I am Math instructor and have been creating ... - asked by Michael McCain (8 votes) —————————- [Markdown parser in Mathematica] https://mathematica.stackexchange.com/questions/154634/markdown-parser-in-mathematica Is there already a markdown to XML parser implemented in Mathematica? I wrote a one for my pelican rewrite, but realized I should have asked here ﬁrst. Mine is almost certainly faulty in a few major ... - asked by b3m2a1 (7 votes), answered by b3m2a1 (3 votes) —————————- [ListContourPlot with hatched regions] https://mathematica.stackexchange.com/questions/154481/listcontourplot-with-hatched-regions I’m using ListContourPlot on a table of data, and I’d like to hash the regions rather than colour them, so the plot works in black and white. data = Flatten[Table[{x, y, Cos[x] + Cos[y]}, {x, 0, 3, ... - asked by KraZug (7 votes), answered by John Joseph M. Carrasco (8 votes) ================================== Greatest hits from previous weeks: ================================== [Creating legends for plots with multiple lines?] https://mathematica.stackexchange.com/questions/4025/creating-legends-for-plots-with-multiple-lines So I have a graph with multiple lists, for e.g. data = {{1,2}, {3,4}, {3,5}, {2,3} . . .} If I then do ListLinePlot[Table[{#1,Log[b,#2]}&amp;@@@data, {b,1,10,2}]] I have no way to generate a legend ... - asked by Eiyrioü von Kauyf (61 votes), answered by Jens (91 votes) —————————- [Learn Mathematica (Wolfram) Language in one day] https://mathematica.stackexchange.com/questions/138366/learn-mathematica-wolfram-language-in-one-day Currently I am trying to learn Python. Searching for relevant material I came across X in Y minutes and books with titles such as Learn Python in one day, in 24 hours, etc. Similar material exists ... - asked by dimitris (26 votes), answered by masterxilo (11 votes) ================================== Can you answer these? ================================== [NetTrain with External GPU?] https://mathematica.stackexchange.com/questions/154380/nettrain-with-external-gpu I’d like to use the new Neural Networks functionalities in v11 on my Macbook Pro, unfortunately, most macs do not have the supported Nvidia cards. However, there is the option for using an external ... - asked by M.R. (3 votes) —————————- [Solution (numerical or symbolic) of functional equations?] https://mathematica.stackexchange.com/questions/154515/solution-numerical-or-symbolic-of-functional-equations Can I solve functional equations with Mathematica? How? For example, I am trying to solve: for speciﬁc values of $$a$$. Can ... - asked by becko (1 vote) —————————- [Amplitude of a transfer function] https://mathematica.stackexchange.com/questions/154489/amplitude-of-a-transfer-function I’m looking to calculate the amplitude of a transfer function which is deﬁned in a symbolic way : T=(1 + 2 I r λ)/(1 - r^2 + 2 I r λ) I try this, i doesn't work Assuming[{λ &gt; 0, r &gt; 0}, ... - asked by Bendesarts (1 vote) ### 4.18 Tuesday, August 22, 2017 ================================== Top new questions this week: ================================== [Mathematica vs. Comsol for ﬁnite element analysis?] https://mathematica.stackexchange.com/questions/154254/mathematica-vs-comsol-for-finite-element-analysis Being relatively new to ﬁnite element analysis, I was wondering how expert users assess Mathematica’s capabilities in solving PDEs via the ﬁnite element method compared to other commercial tools ... - asked by Alexander Erlich (13 votes), answered by Alexei Boulbitch (7 votes) —————————- [Mathematica Syntax Coloring in GitHub README] https://mathematica.stackexchange.com/questions/153836/mathematica-syntax-coloring-in-github-readme GitHub doesn’t auto-detect and color Mathematica code in its markdown. Can we make it do so? This may be trivial, but many README ﬁles don’t seem to have it. - asked by b3m2a1 (10 votes), answered by b3m2a1 (13 votes) —————————- [HoldPattern vs Unevaluated] https://mathematica.stackexchange.com/questions/153844/holdpattern-vs-unevaluated For learning purposes I created this code: {g, 3*(10 + g)} /. HoldPattern[Plus[t__]] :&gt; (Plus[t] /. g -&gt; h) I am learning about HoldPattern. As I understand it HoldPattern makes sure that the ... - asked by GambitSquared (8 votes), answered by Mr.Wizard (9 votes) —————————- [Who is to blame: parsing UTF8 encoded JSON HTTPResponse fails] https://mathematica.stackexchange.com/questions/154245/who-is-to-blame-parsing-utf8-encoded-json-httpresponse-fails Background V11.1.1 I’m using URLRead to fetch some data, can’t show everything but headers contain: "content-type-&gt;application/json; charset=utf-8" and body (returned from URLRead) contains ... - asked by Kuba (7 votes), answered by Alexey Popkov (5 votes) —————————- [Number elements in a list] https://mathematica.stackexchange.com/questions/153951/number-elements-in-a-list I’m trying to learn more about list replacement without using Table. I have a list like this: list = {{{"a", "b", "c"}, {"d", "e", "f"}, {"g", "h", "i"}}} Now, I want to modify the list elements, ... - asked by holistic (7 votes), answered by MarcoB (9 votes) —————————- [Fill a sphere above an arbitrary curve] https://mathematica.stackexchange.com/questions/153994/fill-a-sphere-above-an-arbitrary-curve I have a function which generates a curve on the surface of a unit sphere, parameterised by the azimuthal angle. How can I plot a sphere with two diﬀerent colour above and below this curve? f[t_] := ... - asked by Tom (6 votes), answered by Kuba (9 votes) —————————- [is it possible to change/customize some conversions done by TeXForm?] https://mathematica.stackexchange.com/questions/153876/is-it-possible-to-change-customize-some-conversions-done-by-texform I use TeXForm to convert output of some computation to Latex. I’d like to ask if there is a way to override/change/customize some of these conversions, related to just the name Mathematica assigns to ... - asked by Nasser (6 votes), answered by jkuczm (7 votes) ================================== Greatest hits from previous weeks: ================================== [How to manipulate 2D plots?] https://mathematica.stackexchange.com/questions/7142/how-to-manipulate-2d-plots When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ... - asked by István Zachar (122 votes), answered by István Zachar (137 votes) —————————- [Mathematica erroneously says this integral does not converge] https://mathematica.stackexchange.com/questions/144965/mathematica-erroneously-says-this-integral-does-not-converge Mathematica (as of v. 11.1.0) does not recognize that this special case of Frullani’s integral converges: Integrate[(ArcTan[a*x] - ArcTan[b*x])/x, {x, 0, Infinity}] (* Integrate::idiv: Integral of ... - asked by Pillsy (14 votes), answered by Michael E2 (20 votes) ================================== Can you answer these? ================================== [Is there a good explanation of the output of FeatureExtract anywhere?] https://mathematica.stackexchange.com/questions/154044/is-there-a-good-explanation-of-the-output-of-featureextract-anywhere I have been looking at the oﬃcial documentation of FeatureExtract, and I’m having a bit of diﬃculty interpreting the output–or understanding the reasons for some of the choices that were made. ... - asked by Shredderroy (1 vote) —————————- [How to work out sums symbolically?] https://mathematica.stackexchange.com/questions/153820/how-to-work-out-sums-symbolically Intro Consider these two equal expressions of the variance and $$\frac{\sum _{i=1}^n \left(x(i)-\frac{\sum  ...

- asked by Remi.b (1 vote)

—————————-

[Expectation value of standard deviation] https://mathematica.stackexchange.com/questions/153848/expectation-value-of-standard-deviation

I was trying to calculate the expectation value of the standard deviation, if I only take two data points into account. My code is the following:

n[x_] = PDF[NormalDistribution[μ, σ], x];
σ2[x1_,  ...

- asked by Glostas (1 vote)

### 4.19 Tuesday, August 15, 2017

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

How can I remove a paclet that was automatically downloaded when I used a function for the ﬁrst time (i.e. NetChain)?

I believe the download was faulty, preventing me from using any of the ...

—————————-

[Best way to expand vocabulary of Mathematica functions?] https://mathematica.stackexchange.com/questions/153469/best-way-to-expand-vocabulary-of-mathematica-functions

I’m enjoying slowly learning Mathematica but noticing one skill I’m lacking is a comprehensive vocabulary of Mathematica functions. I was wondering if members would mind sharing some strategies they ...

—————————-

[high pass ﬁlter without losing detail] https://mathematica.stackexchange.com/questions/153414/high-pass-filter-without-losing-detail

I have troubles doing a simple high pass ﬁltering...

Downloading the test data https://pastebin.com/74J8t2YV as ”test.dat”, you can see that overimposed on the signal there are some low frequencies ...

—————————-

[Accesing keys based on position in an association] https://mathematica.stackexchange.com/questions/153689/accesing-keys-based-on-position-in-an-association

I would like to have the following simple function ”GetKey[]” on a very large association.

(* The actual Association is very large, this is just small example *)
assoc = &lt;|{1,1} -&gt; 2, {1,2}  ...

—————————-

[How to calculate CellularAutomaton rule numbers in higher dimensions?] https://mathematica.stackexchange.com/questions/153388/how-to-calculate-cellularautomaton-rule-numbers-in-higher-dimensions

Where can I ﬁnd documentation of the rule number convention for CellularAutomaton for higher than 1 dimension?

I understand the convention for elementary 1D automata, but I don’t understand even ...

—————————-

[Clicking on any Line of Code causes Plotted Points to Vanish] https://mathematica.stackexchange.com/questions/153368/clicking-on-any-line-of-code-causes-plotted-points-to-vanish

Bug detected in 11.1, apparently related but not identical to bug in 10.4. Reported to Worfram, Inc as CASE:3926732

$Version (* "11.1.1 for Microsoft Windows (64-bit) (April 18, 2017)" *) p1 = ...  - asked by bbgodfrey (7 votes), answered by John Joseph M. Carrasco (3 votes) —————————- [Puzzled about the behavior of NDSolve (ODE’s involving Integrals)] https://mathematica.stackexchange.com/questions/153624/puzzled-about-the-behavior-of-ndsolve-odes-involving-integrals Any idea why NDSolve can easily handle the ﬁrst of these examples, but not the 2nd? I have a system of ODE’s involving integrals without closed-form solutions, and keep getting the 2nd error message. ... - asked by Andrea Wilson (6 votes), answered by Michael E2 (5 votes) ================================== Greatest hits from previous weeks: ================================== [Labeling individual curves in Mathematica] https://mathematica.stackexchange.com/questions/4444/labeling-individual-curves-in-mathematica I need to create a plot for export and inclusion in a report. Is there a better way to label curves than PlotLegends? From what I’ve read and my personal experience, PlotLegends is pretty bad. Is ... - asked by Tianxiang Xiong (52 votes), answered by Artes (40 votes) —————————- [Is there an open source implementation of Mathematica-the-language?] https://mathematica.stackexchange.com/questions/4454/is-there-an-open-source-implementation-of-mathematica-the-language I’ve seen questions before such as ”What is the best open-source equivalent for Mathematica?”, but that speciﬁc question (and that line of inquiry in general) cares more about the computer algebra ... - asked by sblom (88 votes), answered by Simon (68 votes) ================================== Can you answer these? ================================== [Analysis of the periodic data by the maximum entropy method] https://mathematica.stackexchange.com/questions/153487/analysis-of-the-periodic-data-by-the-maximum-entropy-method I am trying to get the frequency spectrum of a periodic data. Since the data set is short, the outcome of the frequency peaks are not sharp enough, which prevents me for further analysis. I know the ... - asked by Phyman (1 vote) —————————- [Plotting InterpolationFunction over Quantities] https://mathematica.stackexchange.com/questions/153458/plotting-interpolationfunction-over-quantities What’s the proper syntax to plot Interpolation functions deﬁned over Quantities? points = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}}; Change domain to Quantities: points2 = points // ... - asked by alancalvitti (2 votes) —————————- [Fastest form of a function] https://mathematica.stackexchange.com/questions/153602/fastest-form-of-a-function I’m trying to ﬁnd the fastest form for a function. I have a few approaches with test results.The function I’m working with is the 3rd derivative of the incomplete beta function with respect to its ... - asked by FalafelPita (1 vote) ### 4.20 Tuesday, August 8, 2017 ================================== Top new questions this week: ================================== [Why can’t I inject expressions in Compile using (only) With] https://mathematica.stackexchange.com/questions/153064/why-cant-i-inject-expressions-in-compile-using-only-with Generally speaking, With can be used to inject into arbitrarily held expressions, for example: With[{args = 2}, Hold @ Hold @ HoldComplete[args] ] (* Out[1]= Hold[Hold[HoldComplete[2]]] *) ... - asked by glS (14 votes), answered by Leonid Shifrin (15 votes) —————————- [Why Mathematica can not factorize polynomials over algebraic ﬁelds?] https://mathematica.stackexchange.com/questions/152949/why-mathematica-can-not-factorize-polynomials-over-algebraic-fields I noticed that a factorization over algebraic ﬁelds is useless in Mathematica. Here is the example over the ﬁeld containing I*Sqrt[3]: Pol=4 (3 I Sqrt[3] (-12 + 6 x - 4 x^2 + x^3) y^3 z + 9 (12 - ... - asked by Aus Man (14 votes), answered by chyaong (11 votes) —————————- [RegionMeasure is wrong for simple 1D Path] https://mathematica.stackexchange.com/questions/153323/regionmeasure-is-wrong-for-simple-1d-path Bug introduced in 11.1 Take the simple path deﬁned by a line through a set of points pts = {{0, 0}, {0, 1.5}, {0.05, 1.5}, {0.05, 0.5}, {0.1, 0.5}, {0.1, 1.5}, {0.15, 1.5}, {0.15, 0.5}, {0.2, ... - asked by Sascha (13 votes), answered by Michael E2 (8 votes) —————————- [Why am I seeing what looks like a violation of operator precedence?] https://mathematica.stackexchange.com/questions/153258/why-am-i-seeing-what-looks-like-a-violation-of-operator-precedence Why is it that when I evaluate 2*2.848529281693615+3*-0.5155083247776808 I get (* -2.93688 *) which is wrong. 2*2.848529281693615 + (3*-0.5155083247776808) (* 4.15053 *) Any help would be ... - asked by An old man in the sea. (9 votes), answered by C. E. (9 votes) —————————- [Need a gentle introduction to stylesheet writing] https://mathematica.stackexchange.com/questions/153102/need-a-gentle-introduction-to-stylesheet-writing I have searched Mathematica.SE for stylesheet and found a lot of useful information on speciﬁc issues but no general introduction. There were 746 hits, and it is very time consuming for anyone to ... - asked by m_goldberg (9 votes), answered by m_goldberg (7 votes) —————————- [Unexpected behavior when directly assigning to DownValues] https://mathematica.stackexchange.com/questions/152999/unexpected-behavior-when-directly-assigning-to-downvalues I’m encountering some unexpected behavior when assigning to DownValues. When I assign two deﬁnitions for test[1] as below, Mathematica stores both deﬁnitions: DownValues[test] = ... - asked by tom (9 votes), answered by b3m2a1 (6 votes) —————————- [Except @ OptionsPattern[] aﬀects OptionValue] https://mathematica.stackexchange.com/questions/152984/except-optionspattern-affects-optionvalue The background This example works as expected, small function with a special case rule: foo // ClearAll foo // Options = {"bar" -&gt; 1}; foo[x_, y : Except[_Rule], patt : OptionsPattern[] ... - asked by Kuba (9 votes), answered by Mr.Wizard (7 votes) ================================== Greatest hits from previous weeks: ================================== [Mathematica 10.0.x freezes in Initializing kernels] https://mathematica.stackexchange.com/questions/92931/mathematica-10-0-x-freezes-in-initializing-kernels Bug caused by paclet update and ﬁxed by paclet update. I updated to Windows 10 and have been running Mathematica ﬁne on it for over a month. For some reason, it has just stopped working. I don’t ... - asked by mitcheljh (73 votes), answered by ilian (95 votes) —————————- [Exporting graphics to PDF - huge ﬁle] https://mathematica.stackexchange.com/questions/1542/exporting-graphics-to-pdf-huge-file I want to draw some basic surfaces, export them to PDF and include them in a LaTeX ﬁle. I create a simple 3D graphics object, for instance with  ParametricPlot3D[{r Cos[θ], r Sin[θ], r^2}, {r, 0, ... - asked by Matthew Leingang (94 votes), answered by Heike (80 votes) ================================== Can you answer these? ================================== [Operator on a multivariable function in a sum] https://mathematica.stackexchange.com/questions/153092/operator-on-a-multivariable-function-in-a-sum I need to deﬁne an operator that does as follow for any function $$h_m$$. $\qquad O[h_m](k,M,b,l_{max})=\sum_{l\neq (0,m)}^{l_{max}}il \left (h_l(k,M,b,l_{max}) b_{m-l}(k)- c_l\partial_k  ...

- asked by Michael_J (1 vote)

—————————-

[Direct input in Chinese, Korean or Japanese] https://mathematica.stackexchange.com/questions/153042/direct-input-in-chinese-korean-or-japanese

Sometimes I need to create a document in Japanese: I know Mathematica supports typing in Japanese. However it doesn’t seem to support direct (inline) input in Japanese.

Whenever I need to convert a ...

—————————-

[Parametric Plot of Faces] https://mathematica.stackexchange.com/questions/152909/parametric-plot-of-faces

In How do I draw a pair of buttocks? there is a discussion how to draw a human backside. It shows an example of Manipulate to ParametricPlot3D this part of a body.

In this discussion they were ...

### 4.21 Tuesday, August 1, 2017

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

[String operation 1000X slower for special characters] https://mathematica.stackexchange.com/questions/152293/string-operation-1000x-slower-for-special-characters

It seems that the string operation is very slow if we have special characters in the string. Consider this example,

str =
StringJoin@
RandomChoice[Join[Alphabet[], ToString /@ Range[0, 9]],  ...

—————————-

[Making a website with Mathematica] https://mathematica.stackexchange.com/questions/152663/making-a-website-with-mathematica

I know many people here have various websites associated with them and I’m guessing do at least some of the development of that stuﬀ in Mathematica.

I recently fell down that rabbit hole myself, ...

—————————-

[Convert association with list key to nested assocations] https://mathematica.stackexchange.com/questions/152676/convert-association-with-list-key-to-nested-assocations

I have an association that maps x, y pairs to values, for example:

 &lt;|{0, 0} -&gt; "a", {-1, -4} -&gt; "b", {-1, 1} -&gt; "c", {-1, 0} -&gt; "d", {1, 0} -&gt; "e"|&gt;

I want to convert this ...

—————————-

[Matching (y/x)^u terms wherever the appear in an expression] https://mathematica.stackexchange.com/questions/152559/matching-y-xu-terms-wherever-the-appear-in-an-expression

Mathematica keeps rewriting expressions, so it is hard to ﬁgure what pattern to use.

I am trying to replace all occurrences of $$\frac {y}{x}$$ by $$t$$, but Mathematica re-writes ...

—————————-

[Bulletprooﬁng packages against SetOptions of built-ins] https://mathematica.stackexchange.com/questions/152472/bulletproofing-packages-against-setoptions-of-built-ins

Packages are (obviously) written in terms of built-in Mathematica functions. But many (if not, most) of these functions have options, like Expand, Solve, Compile

While a package is active, the user ...

—————————-

[How can I oﬀset a curve from the given data points?] https://mathematica.stackexchange.com/questions/152298/how-can-i-offset-a-curve-from-the-given-data-points

I am new to Mathematica programming.

I have a question related to my work with this software.

I have the data points below:

{{128.011, 86.7748}, {128.011, 86.7748}, {128.167, 86.7663}, {128.19,  ...

—————————-

[Export[..., ”tsv”] drops minus signs from Dataset [horriﬁc bug?]] https://mathematica.stackexchange.com/questions/152355/export-tsv-drops-minus-signs-from-dataset-horrific-bug

Toy example:

First, create a Dataset:

data = Dataset[{&lt;|"x" -&gt;  1, "y" -&gt; -2|&gt;,
&lt;|"x" -&gt; -3, "y" -&gt;  4|&gt;}]


Next, export it as a TSV ﬁle:

...

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

[Entering numbers in Scientiﬁc Notation?] https://mathematica.stackexchange.com/questions/36792/entering-numbers-in-scientific-notation

I need to play with a lot of powers such as 10^-3. 1E-3 does not work for it. Is there any short form for it?

—————————-

[Creating legends for plots with multiple lines?] https://mathematica.stackexchange.com/questions/4025/creating-legends-for-plots-with-multiple-lines

So I have a graph with multiple lists, for e.g.

data = {{1,2}, {3,4}, {3,5}, {2,3} . . .}

If I then do ListLinePlot[Table[{#1,Log[b,#2]}&amp;@@@data, {b,1,10,2}]] I have
no way to generate a legend  ...

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

[Obstacle problem for the heat equation] https://mathematica.stackexchange.com/questions/152491/obstacle-problem-for-the-heat-equation

Consider the problem

\begin{cases}
\max\{\Delta u -\partial_t u, \varphi - u \} = 0 &amp; \text{ in } (0,T)\times \mathbb{R}^n \\
u(0,\cdot) = \varphi(0,\cdot) &amp; \text{ in } \mathbb{R}^n.
...

—————————-

[DateListPlot of multiple time series with data values and legend appearing as the cursor moves over ploted lines] https://mathematica.stackexchange.com/questions/152405/datelistplot-of-multiple-time-series-with-data-values-and-legend-appearing-as-th

This is very similar to my previous question. I want to use ”DateListPlot” to visualize multiple time series (n) and see data values and legend as I move the cursor over plotted lines. To begin with, ...

—————————-

[Using FindMinimum for a table of functions] https://mathematica.stackexchange.com/questions/152595/using-findminimum-for-a-table-of-functions

I am relatively new to Mathematica and am having trouble with my code running quite slowly. What I am attempting to do is ﬁnd the minimum value of a function (a chi^2) of one ﬁt variable, but this ...

- asked by nsbd88 (1 vote)

### 4.22 Tuesday, July 25, 2017

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

[Reduce Code Length] https://mathematica.stackexchange.com/questions/152003/reduce-code-length

I have the following that works good, and computes in one shot,but the code is so long. Can someone please help me to reduce the size of this?

...

—————————-

[Best way to handle nested Maps?] https://mathematica.stackexchange.com/questions/151742/best-way-to-handle-nested-maps

I often ﬁnd myself working with lists of lists of data, gathering data, performing computations, and producing a variety of diﬀerent sorts of output. Intuitively, it seems like this should be done ...

—————————-

The code below is to create something like a logo. I want to apply a color gradient over the polygons of the pattern, but they vary along the path. The image that I want to approach is this:

ang = ...

—————————-

[Oﬀset Partition with only one remainder element] https://mathematica.stackexchange.com/questions/152152/offset-partition-with-only-one-remainder-element

I would like to use a combination of options of Partition in a way that I can’t seem to ﬁnd in the documentation.

Given example input {a,b,c,d,e,f,g}, I would like output  ...

—————————-

[Slot # corresponding to subset of a list in select] https://mathematica.stackexchange.com/questions/152082/slot-corresponding-to-subset-of-a-list-in-select

Is it possible to use # in the select function preserving the structure of the list?

Here an example of what I mean. Let's say I want to select all the pairs
where the first element is 1:

data1 =  ...

—————————-

[Any faster approach than Outer for my computation] https://mathematica.stackexchange.com/questions/151892/any-faster-approach-than-outer-for-my-computation

Outer is slowing down considerably when the first argument is Abs[#1 - #2]/Max[#1, #2]&amp;

Outer[List, Range[5000], Range[5000]]; // AbsoluteTiming
(* {0.120091, Null} *)

Outer[Abs[#1 -  ...

—————————-

I would like to generate a random password of a deﬁned length which can easily be typed in with a standard keyboard.

As a start I tried the following:

SeedRandom["pass"];
...

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

[Why should I avoid the For loop in Mathematica?] https://mathematica.stackexchange.com/questions/134609/why-should-i-avoid-the-for-loop-in-mathematica

Some people advise against the use of For loops in Mathematica. Why? Should I heed this advice? What is wrong with For? What should I use instead?

—————————-

[Why round to even integers?] https://mathematica.stackexchange.com/questions/2116/why-round-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}


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

[How can I exclude factors containing a certain symbol form matching my pattern] https://mathematica.stackexchange.com/questions/151971/how-can-i-exclude-factors-containing-a-certain-symbol-form-matching-my-pattern

Ok, I give up. I can’t ﬁgure how to tell Mathematica to do replacement using a pattern except for some special case. Easier to explain with small example.

I want to change  pattern Exp[any_. c] to c  ...

—————————-

[Graphics3D with explicit ViewAngle inside Manipulate disappears for a moment when starting rotation] https://mathematica.stackexchange.com/questions/151978/graphics3d-with-explicit-viewangle-inside-manipulate-disappears-for-a-moment-whe

Given the following:

Manipulate[
ContourPlot3D[
x^4 + y^4 + z^4 - (x^2 + y^2 + z^2)^2 + 3 (x^2 + y^2 + z^2) == 3 c,
{x, -3, 3},
{y, -3, 3},
{z, -3, 3},
...

- asked by Mark (1 vote)

—————————-

[MTensor from existing memory?] https://mathematica.stackexchange.com/questions/151780/mtensor-from-existing-memory

I am wondering whether it’s possible to return a tensor from my C++ code using LibraryLink without copying the memory (because it’s large). So, instead of

libData-&gt;MTensor_new(..., &amp;T0);
...

### 4.23 Tuesday, July 18, 2017

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

[Is there concise code for the list operation I want to perform?] https://mathematica.stackexchange.com/questions/151550/is-there-concise-code-for-the-list-operation-i-want-to-perform

Is there any concise syntax for the following partitioning of a list. Given 1, 2, 3, 4, I want to get the output as shown below. I have tried various function such as Partition and others, but I ...

—————————-

[Animate Koch curve generation and include a transition eﬀect] https://mathematica.stackexchange.com/questions/151621/animate-koch-curve-generation-and-include-a-transition-effect

Recently, I saw two kinds of animation of Koch curve iteration generation.

I don’t know how to make this eﬀect, now I can only do this

Clear[koch];
koch[{A_, B_}] :=
Partition[
{A, (2 A  ...

—————————-

[How to ﬁnd the sum for each individual row in a binary matrix until the ﬁrst zero is reached from left to right.] https://mathematica.stackexchange.com/questions/151396/how-to-find-the-sum-for-each-individual-row-in-a-binary-matrix-until-the-first-z

I have a 150 by 300 binary matrix. I would like to sum the 1’s for each individual row (from left to right) until the ﬁrst zero is encountered. For example, if a given row is 1 1 1 1 1 1 0 0 0 1 0 0  ...

—————————-

[Replace element in array by checking condition in another list] https://mathematica.stackexchange.com/questions/151293/replace-element-in-array-by-checking-condition-in-another-list

Im trying to escape doing double loops given the large number of items in the arrays.

I have two list with a format like this:

list1={{1,2,0},{1,3,0},{4,6,0},{2,3,0}} (*Third element of each item is  ...

—————————-

I came across the problem of calculating the circumcenters of triangles symbolically within another algorithm (as well as possibly doing other similar geometry computations). I was hoping Mathematica ...

—————————-

[Trace of the points of intersection of two moving curves] https://mathematica.stackexchange.com/questions/151325/trace-of-the-points-of-intersection-of-two-moving-curves

I would like to trace the points of intersection between the polar curves

r == Cos[n θ + k t]

and

r == t Csc[θ]

as t goes from -1 to 1. (n and k are constants, and y, r, and θ relate in the  ...

—————————-

[How to delete the parameter of a Neural Network?] https://mathematica.stackexchange.com/questions/151591/how-to-delete-the-parameter-of-a-neural-network

Mathematica Neural Networks based on MXNet. And there is lots of model in MXNet(MXNet Model Zoo).

For example,I follow a tutorial An introduction to the MXNet API — part 4, It uses Inception v3(net ...

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

[Why should I avoid the For loop in Mathematica?] https://mathematica.stackexchange.com/questions/134609/why-should-i-avoid-the-for-loop-in-mathematica

Some people advise against the use of For loops in Mathematica. Why? Should I heed this advice? What is wrong with For? What should I use instead?

—————————-

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

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

The ...

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

[Unexpected Behavior of Parametric Sensitivity in ParametricNDSolveValue] https://mathematica.stackexchange.com/questions/151294/unexpected-behavior-of-parametric-sensitivity-in-parametricndsolvevalue

While exploring alternative methods of solving 33538, I encountered diﬃculties with the parametric sensitivity capability of ParametricNDSolveValue. (Useful background on parametric sensitivity is ...

—————————-

[FindShortestTour suddenly runs far slower for large numbers of points] https://mathematica.stackexchange.com/questions/151513/findshortesttour-suddenly-runs-far-slower-for-large-numbers-of-points

I was doing a benchmark of FindShortestTour and I noticed something really weird. Around 10000 points, FindShortestTour suddenly takes 6 times as long without explanation:

times = Table[
pts =  ...


—————————-

[Manual CellGroups: problem with closing nested CellGroupData] https://mathematica.stackexchange.com/questions/151336/manual-cellgroups-problem-with-closing-nested-cellgroupdata

Background

CellGroupData second argument allows to specify which cells are visible. I faced problems though.

This example works well, the second group is not visible:

Notebook[{
Cell @  ...


- asked by Kuba (1 vote)

### 4.24 Tuesday, July 11, 2017

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

[Replace elements that do not match a pattern] https://mathematica.stackexchange.com/questions/149736/replace-elements-that-do-not-match-a-pattern

I have the following matrix

mat={{0,a,b},{c,0,d},{0,0,e}}

I would like to replace the zero elements of it with 1 and the remaining with zero. The ﬁrst step would be

mat/.{0-&gt;1}

However I ...

—————————-

[Image segmentation by pixel value] https://mathematica.stackexchange.com/questions/149966/image-segmentation-by-pixel-value

I’m looking for a way to segment a grayscale image (or a 2D array) by its pixel values. We look at two neighboring pixels, if their values are close within a certain threshold, then we say they are ...

—————————-

When one has the output of a function like TreeForm, for instance:

Can this be turned into a Graph object? I would like to be able to apply functions like VertexList, VertexDegree, AdjacencyList, ...

—————————-

[Layout tips to keep UI responsive] https://mathematica.stackexchange.com/questions/149835/layout-tips-to-keep-ui-responsive

Bug introduced in V10.4 or earlier and persisting through V11.1.1

  CASE:3914402

Here is an example of a problem I have. Gutted version of something much bigger:

handler2 =  Framed[#,     ...

—————————-

[How to use LaTeXin Mathematica text] https://mathematica.stackexchange.com/questions/151102/how-to-use-latex-in-mathematica-text

I would like to formulate a question in a notebook for my students using LaTeX(or MathML) to typeset functions and matrices. I speciﬁcally want a language other than Mathematica as students ...

—————————-

[getting zero for special positions in a matrix] https://mathematica.stackexchange.com/questions/149767/getting-zero-for-special-positions-in-a-matrix

There are a list

list={{1, 2, 3, 2, 3}, {3, 1, 1, 2, 3}, {3, 2, 1, 3, 2}, {1, 2, 1, 1, 1}};

I wish to have all elements be zero except the first
and the fourth in each row: desired:

list={{1, 0,  ...

—————————-

[To Work with Barchart or DiscretePlot?] https://mathematica.stackexchange.com/questions/149960/to-work-with-barchart-or-discreteplot

I would like to create a graph similar to this below using some slightly dotted bar style like the one shown in the ﬁgure ...

And I’m trying to open a space between bars 6 and 8, but I’m failing.

...

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

[How to manipulate 2D plots?] https://mathematica.stackexchange.com/questions/7142/how-to-manipulate-2d-plots

When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ...

—————————-

[Learn Mathematica (Wolfram) Language in one day] https://mathematica.stackexchange.com/questions/138366/learn-mathematica-wolfram-language-in-one-day

Currently I am trying to learn Python. Searching for relevant material I came across

X in Y minutes

and books with titles such as Learn Python in one day, in 24 hours, etc.

Similar material exists ...

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

[Sorting a list of rules] https://mathematica.stackexchange.com/questions/149862/sorting-a-list-of-rules

When we give several deﬁnitions for a function f, the DownValues of f are automatically sorted with respect to the domain deﬁned by the pattern:

f[x_]:=2;
f[x_?Positive] := 3;
f[1]=4;
...

—————————-

[Plotting orbits of trajectories of bodies sharing the earth’s orbit in coordinates centered at the barycenter of the solar system] https://mathematica.stackexchange.com/questions/151069/plotting-orbits-of-trajectories-of-bodies-sharing-the-earths-orbit-in-coordinat

I am attempting to try and plot the trajectories of a trio of satellites that are orbiting with the earth-moon system around the solar system’s barycenter. Originally, I had the satellites in orbit ...

- asked by SSoltero (1 vote)

—————————-

[Mathematica not releasing RAM] https://mathematica.stackexchange.com/questions/151127/mathematica-not-releasing-ram

The following code is supposed to sequentially read data from a large CSV ﬁle and put it row by row into an SQL server. Although I thought RAM consumption should be constant the system keeps asking ...

### 4.25 Tuesday, July 4, 2017

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

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

[Is there a simple and fast way to delete dependent lines of a matrix] https://mathematica.stackexchange.com/questions/149281/is-there-a-simple-and-fast-way-to-delete-dependent-lines-of-a-matrix

I am building a matrix, but some of the lines are dependant. I would like to only keep independant lines (so erase all lines that depend from another).

I could compute the nullspace of the transpose ...

—————————-

[Vertex coloring for bi-connected graphs] https://mathematica.stackexchange.com/questions/149247/vertex-coloring-for-bi-connected-graphs

In graph theory, a bi-connected component is a maximal bi-connected subgraph of a graph $$g$$–i.e., a connected subgraph that would remain connected if any one of its vertexes were to be removed. An ...

—————————-

[Compile and uncompilable function bug?] https://mathematica.stackexchange.com/questions/149343/compile-and-uncompilable-function-bug

I think I found a bug, but I still have MMA version 11.0.1 installed. Can somebody please check if this persists in the latest version?

When I compile this function:

cf = Compile[{{n, _Integer}},
...

—————————-

[How to make the result of InputForm balance the bracket] https://mathematica.stackexchange.com/questions/149558/how-to-make-the-result-of-inputform-balance-the-bracket

I always use InputForm to check the result object,such as Dataset or Graphics or other objects.But if you are in the result of InputForm,you cannot use the Front-End function of balance the bracket. ...

—————————-

[KeyValuePattern in matching and replacement in nested associations] https://mathematica.stackexchange.com/questions/149402/keyvaluepattern-in-matching-and-replacement-in-nested-associations

This case revealed I am missing something in pattern matching and evaluation in case of match, or I can’t grasp it due to the busy week I have. Either way, I ﬁnd this problem interesting for wider ...

—————————-

My biologist friend has to align sperm images according to their heads. He usually does that manually by rotating each image. The problem is that there are so many images and it takes a lot of time. ...

—————————-

[A more convenient Fourier series] https://mathematica.stackexchange.com/questions/149468/a-more-convenient-fourier-series

Personally, I feel the design of FourierSeries/FourierSinSeries/FourierCosSeries/FourierTrigSeries not convenient enough because:

They can’t give general formula of series as output, one must set a ...

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

[Why should I avoid the For loop in Mathematica?] https://mathematica.stackexchange.com/questions/134609/why-should-i-avoid-the-for-loop-in-mathematica

Some people advise against the use of For loops in Mathematica. Why? Should I heed this advice? What is wrong with For? What should I use instead?

—————————-

[My Girlfriend is going to prison...Save her with Math] https://mathematica.stackexchange.com/questions/135937/my-girlfriend-is-going-to-prison-save-her-with-math

Salacious title, but true story.

 dmethyl1 = {
{0, 0},
{.25, 1},
{.5, 7},
{1, 26},
{1.5, 40},
{2, 45},
{2.5, 45},
{3, 44},
{3.5, 44},
{4,  ...

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

[Serious regression in Integrate in 11.1.1? Division by zero generated] https://mathematica.stackexchange.com/questions/149495/serious-regression-in-integrate-in-11-1-1-division-by-zero-generated

What is going on here? In version 11.1.1 on windows 7

Using Version 11.0.1 also on windows 7

Source code

ClearAll[x, n, c, a ,b]
Integrate[(a + b*(c*x^n)^(2/n))^3, x]

Why does ...

—————————-

[Hiding inputs with speciﬁc function] https://mathematica.stackexchange.com/questions/149298/hiding-inputs-with-specific-function

I believe this question could be a duplication, but I did some searches with the term ”hide the input cell”, but none answered me. Only inputs with this function.

I have several input cells using the ...

—————————-

[Gravitational Lensing Simulation, Coordinate and Rendering Issues] https://mathematica.stackexchange.com/questions/149447/gravitational-lensing-simulation-coordinate-and-rendering-issues

I am trying to replicate this gravitational simulation online application called LensToy using Mathematica instead. I have two issues.

First, unlike LensToy, my rendering is extremely slow and drives ...

### 4.26 Tuesday, June 27, 2017

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

[Display 10^n as power] https://mathematica.stackexchange.com/questions/148794/display-10n-as-power

How can I tell MMA to display input of the form 10^n as $$10^n$$ and not e.g. as 1000 for $$n = 3$$ or the rational $$\frac {1}{1000}$$ for $$n = -3$$.

This would help to keep tables compact when some ...

—————————-

[How to remove unknown zero-width character from string?] https://mathematica.stackexchange.com/questions/148899/how-to-remove-unknown-zero-width-character-from-string

I have text that contains a zero-width character that I am not able to remove. A minimum example is in str below where the character is at the start of the text.

str = "​​4-6";
res = ToExpression /@  ...

—————————-

[Series sum approximation] https://mathematica.stackexchange.com/questions/149090/series-sum-approximation

Since there is no closed formula, as far as I know, to ﬁnd the sum of

I used //N to ﬁnd an approximation and Mathematica gave me ...

—————————-

[How to extract ﬁrst 9 rows from every block of 22 rows?] https://mathematica.stackexchange.com/questions/149026/how-to-extract-first-9-rows-from-every-block-of-22-rows

I’m working with a list of lists (a large table).

How would I extract the ﬁrst 9 rows from every 22 rows of this list?

Essentially, I’d like to drop rows 10 to 22, and then 32 to 44, and so on, ...

—————————-

Set has the attribute HoldFirst. Expectedly the following does not work, i.e. it does not assign the OwnValue of 3 to x:

In[1]:= {x, y}[[1]] = 3

During evaluation of In[1]:= Set::setps: {x,y} in the  ...

—————————-

[What algorithm is Mathematica using to ﬁnd the smallest eigenvalue so quickly?] https://mathematica.stackexchange.com/questions/148759/what-algorithm-is-mathematica-using-to-find-the-smallest-eigenvalue-so-quickly

My question is what kind of black magic is Mathematica doing to obtain the correct answer so quickly compared to other programming languages?

Details:

I’ve written a Mathematica notebook to ﬁnd the ...

—————————-

[Simplify expression with Sqrt] https://mathematica.stackexchange.com/questions/149186/simplify-expression-with-sqrt

Hi folks I have a simple Simplify[] question

the following expression simpliﬁes nice:

Sqrt[4 (a + b) - 4 c] // Simplify
2 Sqrt[a + b - c]

the next one refuses

Sqrt[4 (a + b) - 4 (c + d)] //  ...

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

[Calculate the 2D Fourier transform of an Image] https://mathematica.stackexchange.com/questions/29203/calculate-the-2d-fourier-transform-of-an-image

I am new to Mathematica, and using version 8.0.

I would like to calculate the 2D Fourier Transform of an Image with Mathematica and plot the magnitude and phase spectrum, as well as reconstruct the ...

—————————-

[Entering numbers in Scientiﬁc Notation?] https://mathematica.stackexchange.com/questions/36792/entering-numbers-in-scientific-notation

I need to play with a lot of powers such as 10^-3. 1E-3 does
not work for it. Is there any short form for it?

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

[Cross-section of graph] https://mathematica.stackexchange.com/questions/148902/cross-section-of-graph

I am trying to use the following code to plot the cross-section
of the graph z=x^2+y^2 and x=t. I use Manipulate to vary t.

h = z - x^2 - y^2;
g = x;
Manipulate[
Show[
ContourPlot3D[{h == 0, g ==  ...

- asked by henryforever14 (1 vote)

—————————-

[How to embed Mathematica or Wolfram Alpha results in a website] https://mathematica.stackexchange.com/questions/149063/how-to-embed-mathematica-or-wolfram-alpha-results-in-a-website

Is it possible to dynamically embed responses into a blog post?

So the user would see:

There are 390900 plant species in the world.

With pseudo code:

There are #{worlfram(number of plant species)}  ...

- asked by Mr. Demetrius Michael (1 vote)

—————————-

[Package MathWorld] https://mathematica.stackexchange.com/questions/148837/package-mathworld

I’m looking for MathWorld packages, but I can not ﬁnd anywhere. I found an question that came very close but did not help me.

I got lost on the site and did not ﬁnd anything.

I need to use the ...

### 4.27 Tuesday, June 20, 2017

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

[Good references for parallel programming in Mathematica] https://mathematica.stackexchange.com/questions/148489/good-references-for-parallel-programming-in-mathematica

There are plenty of good references for all sorts of Mathematica programming:

This forum is a great example for speciﬁc questions/”getting things done”. Books like those by R.Maeder (esp. the now ...

—————————-

[Dot not well-deﬁned: are there better examples?] https://mathematica.stackexchange.com/questions/148465/dot-not-well-defined-are-there-better-examples

Dot is not ”well-deﬁned” in Mathematica - we cannot simultaneously have it being associative and working with 1D and 2D arrays. For example, the order we substitute for variables should not change ...

—————————-

[Internal‘Bag memory usage] https://mathematica.stackexchange.com/questions/148594/internalbag-memory-usage

1. How does Internal‘Bag handle memory inside a compiled function? (examples below)

2. Is there a way to explicitly free up memory used by Internal‘Bag without exiting the function?

Preface: The ...

—————————-

[Preventing an unwanted vertical line from appearing my plot] https://mathematica.stackexchange.com/questions/148502/preventing-an-unwanted-vertical-line-from-appearing-my-plot

How can I eliminate (remove) the unwanted vertical line x = 1 when I make the plot shown below.

p3 =
Plot[
{0.5/(-0.1 x + 0.1),
0.04/(-0.004 x + 0.004),
1.359/(-0.08 x + 0.08),
...

—————————-

[Integer to Alpha Representation] https://mathematica.stackexchange.com/questions/148446/integer-to-alpha-representation

I wanted a nice way to convert natural numbers to alphabetic representations like:

1-&gt;"A",
2-&gt;"B",
...
26-&gt;"Z",
27-&gt;"AA,
...
26*2-&gt;"AZ",
26*2+1-&gt;"BA",
...

And I knew this was ...

—————————-

[How to display numbers as multiples of a square root] https://mathematica.stackexchange.com/questions/148551/how-to-display-numbers-as-multiples-of-a-square-root

The extension ﬁeld $$\mathbb {Q}(\sqrt {2} + \sqrt {3})$$ can be represented by a $$4$$ - dimensional vector space over $$\mathbb {Q}$$ with basis $$\{1, \sqrt {2}, \sqrt {3}, \sqrt {6}\}$$.

—————————-

[Visually permute rows of a matrix via mouse dragging] https://mathematica.stackexchange.com/questions/148448/visually-permute-rows-of-a-matrix-via-mouse-dragging

I’m looking for a way to permute the rows of a matrix visually via mouse dragging, for example by clicking and dragging on a row in the MatrixPlot corresponding to the matrix.

What would be the best ...

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

[How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc] https://mathematica.stackexchange.com/questions/66273/how-to-tell-mathematica-that-certain-variables-are-real-imaginary-integer-value

I’m trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example,

u[x_] := Sqrt[2/L] * Sin[Pi * n * x / L]

and then ...

—————————-

[Entering numbers in Scientiﬁc Notation?] https://mathematica.stackexchange.com/questions/36792/entering-numbers-in-scientific-notation

I need to play with a lot of powers such as 10^-3. 1E-3
does not work for it. Is there any short form for it?

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

[Which method should I use for a numerical triple Integration?] https://mathematica.stackexchange.com/questions/148629/which-method-should-i-use-for-a-numerical-triple-integration

Which method should I use for this numerical integration? Does it converge?

My constants are:

P = 10.5;
m = 48.2;
c = 1;
α = 0.01;
V0 = 10;
EE = 2.3;
II = 1.;
k = 68.9*10^3;

My Integration is

...

—————————-

[possible memory problem with WatershedComponents] https://mathematica.stackexchange.com/questions/148318/possible-memory-problem-with-watershedcomponents

This could be regarded as a follow-up question to a previous post of mine (link).

When I use the WatershedComponents function on a large image (about 6000 x 10000 pixels) Mathematica comes up with an ...

—————————-

[Swedish characters in Databin] https://mathematica.stackexchange.com/questions/148550/swedish-characters-in-databin

I want to store strings with Swedish characters like å, ä and ö in a Databin, but get the following result:

bin = CreateDatabin[];
Values[bin]
{a,"a""}

Does anyone ...

### 4.28 Tuesday, June 13, 2017

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

[Same region, diﬀerent meshes] https://mathematica.stackexchange.com/questions/148210/same-region-different-meshes

I’m playing around with ToElementMesh and I noticed the following behaviour that puzzles me. Consider the two regions

&lt;&lt; NDSolveFEM

Ω1 =
Polygon[{{-1/2, -1}, {-1/2, 1}, {1/2, 1}, {1/2,  ...

—————————-

[Rearrange the list in a speciﬁc way] https://mathematica.stackexchange.com/questions/147876/rearrange-the-list-in-a-specific-way

Suppose I have a list like {"e", "c", "a", "d", "b"} and list of
rules {1 -&gt; 5, 2 -&gt; 3, 3 -&gt; 1, 4 -&gt; 4, 5 -&gt; 2}. The second
list says that for example element on position 1 shoud be on  ...

—————————-

[Self contained APIFunction. Collecting deﬁnitions] https://mathematica.stackexchange.com/questions/148207/self-contained-apifunction-collecting-definitions

Cross posted on community.wolfram.com

Background

After failed attempt (1) to create a complex API, by nicely linking my APIFunction to a cloud based package, I decided to go with the ﬂow and trust ...

—————————-

[Substitute some 1s with 0s in random list] https://mathematica.stackexchange.com/questions/148134/substitute-some-1s-with-0s-in-random-list

How is it better to substitute list of random combination of 1 and 0 (binary image) so that only ﬁrst (or central) instance of 1 left in each group.

list = 0,1,1,0,0,1,0,1,1,1,0 should be ...

—————————-

[Pattern matching Association in rules] https://mathematica.stackexchange.com/questions/148074/pattern-matching-association-in-rules

I would appreciate an explanation of how Associations behave in pattern matching, especially when matching rules, and using HoldPattern.

Consider the following:

assocRuleList = {&lt;||&gt; :&gt;  ...

—————————-

[How to combine Neural Network and Audio like Classify?] https://mathematica.stackexchange.com/questions/148158/how-to-combine-neural-network-and-audio-like-classify

I want to combine Audio object and Neural Network ,ﬁrst thing I remember is Classify

windInstrument = ExampleData[{"Sound", #}] &amp; /@ {"AltoFlute", "AltoSaxophone", "BassClarinet", "BassFlute",  ...

—————————-

[ROT13 and upside-down text (ﬂip text)] https://mathematica.stackexchange.com/questions/147829/rot13-and-upside-down-text-flip-text

How can we transform text in order to achieve ROT13 and ﬂip text using Wolfram Mathematica?

1. ROT13

2. Flip text

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

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

Bug caused by paclet update and ﬁxed by paclet update.

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

—————————-

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

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

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

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

[How to improve the creation of tables of code and comments] https://mathematica.stackexchange.com/questions/148160/how-to-improve-the-creation-of-tables-of-code-and-comments

While writing a response to a certain MSE question I made a function that tabulates code and comments. (See the deﬁnition below.)

Here is an example:

code = "
FoldList[(* reduction function *)
...

—————————-

[Export as HTML: Image of text is squished] https://mathematica.stackexchange.com/questions/147819/export-as-html-image-of-text-is-squished

When exporting a notebook to HTML, the notebook’s cells render as images, but the text is often squished. For example, this notebook:

... renders as

If I manually line-break the code, the ...

—————————-

[How to implement the same function use *Layer function?] https://mathematica.stackexchange.com/questions/148181/how-to-implement-the-same-function-use-layer-function

Reading YOLO method to detect object in the image(paper),I want to train this tiny-VOLO v1 on Mathematica,but the special loss function is very diﬃcult to write.

Total loss is:

For brief,I use ...

### 4.29 Tuesday, June 6, 2017

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

[List of symbols without built-in meaning] https://mathematica.stackexchange.com/questions/147328/list-of-symbols-without-built-in-meaning

Is there a list of all symbols with special display forms but no built-in meaning? That is, operators that are described in the tutorial Operators without Built-in Meanings?

—————————-

So GitHub sent me on quite the journey, after it opened its desktop app from my browser. Copying the link I found something looking like: "github-mac://...".

I spent the next like 15 minutes trying ...

—————————-

This is a methodological question with two parts:

How to use monadic programming in Mathematica?

and Why use monadic programming in Mathematica?

In my opinion the questions are inter-related – ...

—————————-

[Google Drive API connection: (or how can I build a service connection to an OAuth2 service?)] https://mathematica.stackexchange.com/questions/147451/google-drive-api-connection-or-how-can-i-build-a-service-connection-to-an-oaut

From here I know how to build a a basic service connection.

And that’s ﬁne in simple authentication cases but how do I do this for OAuth services?

Even more speciﬁcally, how can I do this for ...

—————————-

[Performance of Nest vs. Do] https://mathematica.stackexchange.com/questions/147545/performance-of-nest-vs-do

When I am iterating the logistic function using a pure function, comparing Do and Nest:

x = 0.1; Do[x = 3 x (1 - x), 300] // RepeatedTiming
Nest[3 # (1 - #) &amp;, .1, 300] // RepeatedTiming

—————————-

[Huge arrows in 3D graphics] https://mathematica.stackexchange.com/questions/147586/huge-arrows-in-3d-graphics

Hi. Consider the following code:

f1 = Plot3D[-Exp[-x^2-y^2],{x,-5,5},{y,-5,5},PlotRange-&gt;All]
f2 = Graphics3D[Table[{Arrowheads[.01],Arrow[{{2Cos[i],2Sin[i],0},{2.5Cos[i],  ...

—————————-

[Clean package update for API/FormFunctions on Wolfram Cloud] https://mathematica.stackexchange.com/questions/147330/clean-package-update-for-api-formfunctions-on-wolfram-cloud

Cross posted on community.wolfram.com (new comments)

TLDR

There is a pool of kernels/sessions available for each user, you don’t have control over the pool only over speciﬁc kernel you currently ...

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

[My Girlfriend is going to prison...Save her with Math] https://mathematica.stackexchange.com/questions/135937/my-girlfriend-is-going-to-prison-save-her-with-math

Salacious title, but true story.

 dmethyl1 = {
{0, 0},
{.25, 1},
{.5, 7},
{1, 26},
{1.5, 40},
{2, 45},
{2.5, 45},
{3, 44},
{3.5, 44},
{4,  ...

—————————-

[Creating legends for plots with multiple lines?] https://mathematica.stackexchange.com/questions/4025/creating-legends-for-plots-with-multiple-lines

So I have a graph with multiple lists, for e.g.

data = {{1,2}, {3,4}, {3,5}, {2,3} . . .}

If I then do ListLinePlot[Table[{#1,Log[b,#2]}&amp;@@@data, {b,1,10,2}]] I have no way to generate a legend  ...

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

[URLFetch parameters interfere with POST] https://mathematica.stackexchange.com/questions/147526/urlfetch-parameters-interfere-with-post

(orig: URLFetch Multipart POST fails to post Body?)

Update 2:

So after much weeping and gnashing of teeth our Lord and Savior Mathematica deemed me worthy of ﬁguring out (some of) what the hell was ...

- asked by b3m2a1 (1 vote)

—————————-

[What is the best method for solving $$D(a,b,r,t)$$ under a 5-minute computation time?] https://mathematica.stackexchange.com/questions/147520/what-is-the-best-method-for-solving-da-b-r-t-under-a-5-minute-computation-ti

Consider set $$\left \{\left . T(c,d)\right |c,d\in \mathbb {Z}\right \}$$, a subset of rational numbers, where $$T(c,d)$$ is a function.

I want to compute $$D(a,b,r,t)$$

...

- asked by Arbuja (1 vote)

—————————-

[Loop construction with multiple expressions for solving diﬀerential equation] https://mathematica.stackexchange.com/questions/147523/loop-construction-with-multiple-expressions-for-solving-differential-equation

I want to solve the following ODE.

$$H'' + \frac {2}{r}H'-\frac {\partial V_{eff}(H,r)}{\partial H}=0$$

with the following conditions

$$\frac {dH}{dr}(r=0)=0$$ and $$H(r= \infty )=0$$

Regardless of the ...

### 4.30 Tuesday, May 30, 2017

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

[Estimate the ”Blurry” distribution of an image] https://mathematica.stackexchange.com/questions/146989/estimate-the-blurry-distribution-of-an-image

I’m trying to analyze an image obtained by scanning electron microscope(SEM) where diﬀerent parts of the same image has has diﬀerent blurring radius. My goal is to determine how blurry diﬀerent ...

—————————-

[Nest list with two functions] https://mathematica.stackexchange.com/questions/147055/nest-list-with-two-functions

Is it possible to use the NestList command with two functions, one at every even step and apply the other at every odd step. If this is possible could someone share an example ?

—————————-

[Exporting structured data to HDF5] https://mathematica.stackexchange.com/questions/146859/exporting-structured-data-to-hdf5

Sadly the documentation is lacking any useful examples on how to Export more complex data in HDF5. There is only

  Export["file.h5",{expr1,...},{"Datasets", {"dataset1",...}}] creates an HDF5 file,  ...

—————————-

[Using Mathematica to create an H-Tree] https://mathematica.stackexchange.com/questions/146797/using-mathematica-to-create-an-h-tree

Can folks show me several methods I can use to draw the following fractal H-Tree?

I did use Free-Form input, as:

= h-fractal

And got this image, which is three iterations, but no idea how it was ...

—————————-

[Combining # & pure functions with post-fix notation] https://mathematica.stackexchange.com/questions/147132/combining-pure-functions-with-post-fix-notation

I can’t ﬁnd the link anymore but there was a talk at a Wolfram conference (referencing v7 I think) where the authors highlight that stringing together functions like this:

Range[100] //  ...

—————————-

I want to make a curated data function, but I have no good place to store the paclets.

Per the pricing page I only get:

And that’s really not enough to host all of my data plus give me room to do ...

—————————-

[Interpolate the noisy data] https://mathematica.stackexchange.com/questions/146688/interpolate-the-noisy-data

I have some noisy data

data = Uncompress[FromCharacterCode[
Flatten[ImageData[Import["http://i.stack.imgur.com/RZcpj.png"],"Byte"]]]]

Plot looks like this

There is noise in certain region, ...

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

[Creating Mathematica packages] https://mathematica.stackexchange.com/questions/29324/creating-mathematica-packages

I’m building a package to help me write packages and their documentation. In this post I explained how to make a package and its documentation. In the answer I provided I describe how to build a very ...

—————————-

[How can I plot the direction ﬁeld for a diﬀerential equation?] https://mathematica.stackexchange.com/questions/8841/how-can-i-plot-the-direction-field-for-a-differential-equation

I’d like to plot the graph of the direction ﬁeld for a diﬀerential equation, to get a feel for it. I’m a novice, right now, when it comes to plotting in Mathematica, so I’m hoping that someone can ...

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

[How to replace all instances of a number throughout my entire cell] https://mathematica.stackexchange.com/questions/146971/how-to-replace-all-instances-of-a-number-throughout-my-entire-cell

I have a cell where for several instances throughout I label certain functions, strings, and ranges using a similar pattern so as to follow through with integration calculations, list forming, and ...

—————————-

[Error occurred while connecting to remote kernel.Can’t use dynamic] https://mathematica.stackexchange.com/questions/146823/error-occurred-while-connecting-to-remote-kernel-cant-use-dynamic

When Open Mathematica using remote kernel,it throws LinkConnect error.
But normal command can evaluate.Like Range@5,$Version... But Can't use dynamic.It throws An unknown box name. So if I want to ... - asked by partida (4 votes) —————————- [Partition an Image automatically Based on Borders] https://mathematica.stackexchange.com/questions/146837/partition-an-image-automatically-based-on-borders I would like to be able to train a model to recognize the borders in a newspaper image and then partition those into separate Images. Images similar to this would be the input Image And then ... - asked by Avadhut Bhosarekar (2 votes) ### 4.31 Tuesday, May 23, 2017 ================================== Top new questions this week: ================================== [PerformanceGoal option ignored in V11.1] https://mathematica.stackexchange.com/questions/146214/performancegoal-option-ignored-in-v11-1 Bug introduced in 11.1 [CASE:3892079] was created [...] I have reproduced this problem with PerformanceGoal in version 11.1 and reported the issue to our developers [...] Take this code: ... - asked by Kuba (14 votes), answered by Kuba (15 votes) —————————- [Can I build my own curated data function?] https://mathematica.stackexchange.com/questions/146220/can-i-build-my-own-curated-data-function I love the huge curated datasets, but they don’t cover everything. I have my own huge dataset which is too much to distribute as an EntityStore so is there a way to build my own analog of, say, ... - asked by MB1965 (13 votes), answered by MB1965 (16 votes) —————————- [Support for low-complexity (compressible) lists] https://mathematica.stackexchange.com/questions/146244/support-for-low-complexity-compressible-lists By ”low-complexity list” I mean a list like the following: lcl = {17, 17, 17, 17, 17, 21, 21, 21, 21, 21, 21, 21, 21, 11, 11, 11, 11, 11, 11, 11} It contains 20 elements, but only 3 ... - asked by kjo (10 votes), answered by Mr.Wizard (6 votes) —————————- [Automating documentation generation] https://mathematica.stackexchange.com/questions/146670/automating-documentation-generation Outside of kernel symbols Mathematica provides access to lots of usage info, e.g. DownValues, Options, Messages, etc. Most languages, if given this sort of info, would be able to provide an automatic ... - asked by MB1965 (9 votes), answered by MB1965 (10 votes) —————————- [Trace of -1 expression] https://mathematica.stackexchange.com/questions/146506/trace-of-1-expression I’m trying to understand Trace. Usually it doesn’t repeat but it adds -1,-1 for his simple expression after having a correct result. -{1}//Trace {-1, {-1}, {-1, -1}, {-1}} Why -{1}//Trace is ... - asked by io_tuta (9 votes), answered by Michael E2 (7 votes) —————————- [How to import a Tensorﬂow model?] https://mathematica.stackexchange.com/questions/146216/how-to-import-a-tensorflow-model I’ve trained a network in Tensorﬂow and have the checkpoint ﬁles, I’d like to if anyone has written a parser or importer to pull the evaluation graph and/or weights into Mathematica? - asked by user5601 (9 votes) —————————- [intersection between two 2D arrays with labeled data is slow] https://mathematica.stackexchange.com/questions/146558/intersection-between-two-2d-arrays-with-labeled-data-is-slow Here is how to Generate data the function is below with two images to generate data img1 img2 segmentImage[binarizedMask_?ImageQ] := Module[{seg, areas, indexMaxarea, maxArea}, seg = ... - asked by Ali Hashmi (8 votes), answered by Carl Woll (6 votes) ================================== Greatest hits from previous weeks: ================================== [Exporting graphics to PDF - huge ﬁle] https://mathematica.stackexchange.com/questions/1542/exporting-graphics-to-pdf-huge-file I want to draw some basic surfaces, export them to PDF and include them in a LaTeX ﬁle. I create a simple 3D graphics object, for instance with  ParametricPlot3D[{r Cos[θ], r Sin[θ], r^2}, {r, 0, ... - asked by Matthew Leingang (92 votes), answered by Heike (80 votes) —————————- [Generating a Sierpinski carpet] https://mathematica.stackexchange.com/questions/22052/generating-a-sierpinski-carpet I am trying to draw a Sierpinski_carpet. I have code that works, but I think there is a more elegant way to do than my way. Maybe I couls use Tuples or Permutations or some similar function to ... - asked by chyaong (46 votes), answered by Mr.Wizard (75 votes) ================================== Can you answer these? ================================== [Exporting graphics with VertexColors problem] https://mathematica.stackexchange.com/questions/146306/exporting-graphics-with-vertexcolors-problem I’ve generated a graphics which exhibit gradient color in rectangle and export it as: SetDirectory[NotebookDirectory[]]; Export["./test.pdf", Graphics[{Polygon[{{-4, 5/3}, {-4, 0}, {4, 0}, {4, ... - asked by RoderickLee (3 votes) —————————- [How to imitate the opacity plot in EditColorFunction] https://mathematica.stackexchange.com/questions/146623/how-to-imitate-the-opacity-plot-in-editcolorfunction I wish to imitate the opacity plot as shown below: Here is ... - asked by Majis (3 votes) —————————- [Possible bug in Export with CharacterEncoding -¿ ”PrintableASCII”] https://mathematica.stackexchange.com/questions/146294/possible-bug-in-export-with-characterencoding-printableascii In the Documentation we read (emphasis is mine): By default, the Wolfram System uses the character encoding ”PrintableASCII” when saving notebooks and packages. This means that when special ... - asked by Alexey Popkov (4 votes) ### 4.32 Tuesday, May 16, 2017 ================================== Top new questions this week: ================================== [Mathematica stuck in ”running” for every calculation I attempt, kernel error] https://mathematica.stackexchange.com/questions/146005/mathematica-stuck-in-running-for-every-calculation-i-attempt-kernel-error Bug caused by paclet update and ﬁxed by paclet update. I downloaded Mathematica this morning to do an implicit polar plot. I attempt to run the code Manipulate[ ContourPlot[ Evaluate@With[{r = ... - asked by 0celouvskyopoulo7 (26 votes), answered by ilian (16 votes) —————————- [How to split data into clusters based on ﬁtting to function] https://mathematica.stackexchange.com/questions/146079/how-to-split-data-into-clusters-based-on-fitting-to-function I have data which looks somewhat like this: On the picture, you can see that the data can be described by 2 linear functions - if you manage to split it into 2 groups, each can easily be ﬁtted ... - asked by Arsen Zahray (10 votes), answered by rhermans (11 votes) —————————- [Inserting cones at intersection points two curves] https://mathematica.stackexchange.com/questions/145874/inserting-cones-at-intersection-points-two-curves I am plotting the null geodesics for a Schwarzschild surface in Schwarzschild coordinates and would light to insert small future light-cones at the points of intersection to emphasize the tipping over ... - asked by Soof_ﬁe (9 votes), answered by rhermans (3 votes) —————————- [How to deﬁne a function inside a Compile?] https://mathematica.stackexchange.com/questions/145931/how-to-define-a-function-inside-a-compile I want to compile a variety of commands, including a function. I need to map this function, inside the compilation, and I can’t include the function without facing errors such as ... - asked by user5253864 (9 votes), answered by xzczd (10 votes) —————————- [How to automatically do a computation, Quit[], restart and do a new computation] https://mathematica.stackexchange.com/questions/145852/how-to-automatically-do-a-computation-quit-restart-and-do-a-new-computation Related questions have been asked before (eg Where does a package have to be loaded?, http://stackoverflow.com/questions/6152023/quit-kernel-in-mathematica-by-a-command-not-using-evaluation-menu - asked by Gaius (9 votes), answered by Shadowray (6 votes) —————————- [1D transient heat equation problem with controller] https://mathematica.stackexchange.com/questions/145799/1d-transient-heat-equation-problem-with-controller I would appreciate some help with following issue: I am trying to solve a 1D transient heat equation problem with a control loop in order to compensate a time variable boundary condition at one ... - asked by daklems (9 votes), answered by user21 (6 votes) —————————- [Clarify when to use Style vs Directive vs List] https://mathematica.stackexchange.com/questions/145856/clarify-when-to-use-style-vs-directive-vs-list I am confused about when to use a simple list of style options, the Directive function or the Style function. As shown below, for simple situations at least, they seem entirely equivalent which ... - asked by Joe (8 votes) ================================== Greatest hits from previous weeks: ================================== [How to manipulate 2D plots?] https://mathematica.stackexchange.com/questions/7142/how-to-manipulate-2d-plots When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ... - asked by István Zachar (115 votes), answered by István Zachar (131 votes) —————————- [Where can I ﬁnd examples of good Mathematica programming practice?] https://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ... - asked by J. M. (463 votes), answered by faysou (411 votes) ================================== Can you answer these? ================================== [Unexpected behavior of a variable] https://mathematica.stackexchange.com/questions/145661/unexpected-behavior-of-a-variable I am confused with a strange phenomenon that I observe and do not understand. Look, here is a simple code making a random walk: Clear[list]; list = Accumulate[RandomInteger[{-1, 1}, {10, 2}]] - asked by Alexei Boulbitch (2 votes) —————————- [How can I disable system updates only?] https://mathematica.stackexchange.com/questions/146133/how-can-i-disable-system-updates-only Suppose I’m quite happy with my current Mathematica installation and wish to keep the system in its current form just reliably working. Since there were already at least two cases[1,2] when a lot of ... - asked by Alexey Popkov (7 votes) —————————- [Import/export manipulate state in ﬁle] https://mathematica.stackexchange.com/questions/146017/import-export-manipulate-state-in-file Is it possible to export the state of Manipulate with big number of parameters in ﬁle and then restore the parameters of Manipulate from this ﬁle? - asked by Филипп Цветков (3 votes) ### 4.33 Tuesday, May 2, 2017 ================================== Top new questions this week: ================================== [Count works diﬀerently depending on how an association was created] https://mathematica.stackexchange.com/questions/144813/count-works-differently-depending-on-how-an-association-was-created Bug introduced in 10.4 and persisting through 11.1.1 I create two associations, that are supposed to be exactly the same. And then I want to count the elements at the second level. And I get ... - asked by Stitch (19 votes), answered by WReach (12 votes) —————————- [Why is Plus so much slower than Total?] https://mathematica.stackexchange.com/questions/145019/why-is-plus-so-much-slower-than-total Why is Plus so much slower than total for summing lists? list = RandomReal[1, 10000000]; AbsoluteTiming[Plus @@ list] AbsoluteTiming[Total[list]] Output: {1.67408, 5.00073*10^6} {0.00570379, ... - asked by Jorge Perez (14 votes), answered by Shadowray (17 votes) —————————- [Delete duplicates from list of lists as if on a necklace] https://mathematica.stackexchange.com/questions/144696/delete-duplicates-from-list-of-lists-as-if-on-a-necklace Given a list of lists of integers, all of the same length, I want to regard two elements as equivalent if one is the rotated and/or reﬂected version of another (that is, if the two lists are the same ... - asked by rogerl (13 votes), answered by Shadowray (13 votes) —————————- [Exchanging numpy arrays between Python and Mathematica?] https://mathematica.stackexchange.com/questions/144770/exchanging-numpy-arrays-between-python-and-mathematica I've been using np.savetxt(location, result, delimiter=',') in Python followed by Import[location,"CSV"] in Mathematica. Some of my files are around 1GB, opening seems a bit slow, what else do people ... - asked by Yaroslav Bulatov (12 votes), answered by xslittlegrass (16 votes) —————————- [How to plot planar graphs in a visually pleasing way?] https://mathematica.stackexchange.com/questions/144594/how-to-plot-planar-graphs-in-a-visually-pleasing-way Cross posted to Wolfram Community Mathematica has a layout algorithm to plot planar graphs without edge crossings. This typically produces an ugly triangular layout where some vertices and edges ... - asked by Szabolcs (11 votes), answered by Szabolcs (6 votes) —————————- [Where are my Cloud Credits going?] https://mathematica.stackexchange.com/questions/144859/where-are-my-cloud-credits-going In less than a month I've used 5k cloud credits (half of my quota) and all I did was deploying a bunch of static notebooks with CloudDeploy[CurrentNotebook[],permissions-&gt;Public] (more ... - asked by Yaroslav Bulatov (10 votes) —————————- [Mathematica erroneously says this integral does not converge] https://mathematica.stackexchange.com/questions/144965/mathematica-erroneously-says-this-integral-does-not-converge Mathematica (as of v. 11.1.0) does not recognize that this special case of Frullani’s integral converges: Integrate[(ArcTan[a*x] - ArcTan[b*x])/x, {x, 0, Infinity}] (* Integrate::idiv: Integral of ... - asked by Pillsy (10 votes), answered by Michael E2 (16 votes) ================================== Greatest hits from previous weeks: ================================== [Generating a Sierpinski carpet] https://mathematica.stackexchange.com/questions/22052/generating-a-sierpinski-carpet I am trying to draw a Sierpinski_carpet. I have code that works, but I think there is a more elegant way to do than my way. Maybe I couls use Tuples or Permutations or some similar function to ... - asked by chyaong (46 votes), answered by Mr.Wizard (75 votes) —————————- [Alternatives to procedural loops and iterating over lists in Mathematica] https://mathematica.stackexchange.com/questions/7924/alternatives-to-procedural-loops-and-iterating-over-lists-in-mathematica While there are some cases where a For loop might be reasonable, it’s a general mantra – one I subscribe to myself – that ”if you are using a For loop in Mathematica, you are probably doing it wrong”. ... - asked by Mr.Wizard (154 votes), answered by Mr.Wizard (104 votes) ================================== Can you answer these? ================================== [How to get parent key in Query on Association/Dataset?] https://mathematica.stackexchange.com/questions/144995/how-to-get-parent-key-in-query-on-association-dataset Is there a general and terse method to obtain the parent key of the current ”position” in a Query of an Association/Dataset? Say I have the following Association. assoc = &lt;|"A" -&gt; ... - asked by Edmund (3 votes) —————————- [Can anyone help me decipher these few lines? Also, converting this code for a 2x2 matrix input to a 3x3 matrix input?] https://mathematica.stackexchange.com/questions/145049/can-anyone-help-me-decipher-these-few-lines-also-converting-this-code-for-a-2x Here’s the code. I’m completely new to Mathematica so bear with me. clear[ug]; ug[{{a11_, a12_}, {a21_, a22_}}] := Module[{A, f, b1, b2, y1, y2, U, P1, P2, UG}, A = {{a11, a12}, {a21, a22}}; ... - asked by Pacotacobell (2 votes) —————————- [Bifurcation package like AUTO?] https://mathematica.stackexchange.com/questions/144795/bifurcation-package-like-auto I was wondering if there is any available continuation and bifurcation analysis package for Mathematica. I’m looking for something like AUTO. I’ve seen there is already a Matlab version of the ... - asked by Mirko Aveta (3 votes) ### 4.34 Tuesday, April 25, 2017 ================================== Top new questions this week: ================================== [Fast spherical polygon] https://mathematica.stackexchange.com/questions/144167/fast-spherical-polygon Cross posted on Wolfram Community Question Given a list of points on a sphere and the sphere’s radius, I’d like to plot a spherical polygon with those points as vertices. And this needs to be fast, ... - asked by Kuba (20 votes), answered by halirutan (7 votes) —————————- [How to uncompress strings safely (without any evaluation)?] https://mathematica.stackexchange.com/questions/144171/how-to-uncompress-strings-safely-without-any-evaluation Compressed strings are often used to exchange Mathematica expressions on the Internet. It is, however, not easy to see what such expression will do after decompression. Resulting code can perform ... - asked by Shadowray (15 votes), answered by Itai Seggev (11 votes) —————————- [Sharing data via the cloud] https://mathematica.stackexchange.com/questions/144130/sharing-data-via-the-cloud I’ve got some stuﬀ that I want to be able distribute to my totally real friends, but I don’t want to have to email them every time I change something. How can I set up sharing via the cloud? - asked by MB1965 (13 votes), answered by MB1965 (13 votes) —————————- [C++ interface to large project] https://mathematica.stackexchange.com/questions/144047/c-interface-to-large-project We are developing a quite large mathematical software in C++ and would like to have a Mathematica interface. We have our own C++ library and our idea would be, to write a Mathematica wrapper class and ... - asked by Richard (12 votes), answered by Szabolcs (12 votes) —————————- [Why doesn’t FullSimplify return -x working on Abs[x] and x¡0?] https://mathematica.stackexchange.com/questions/144310/why-doesnt-fullsimplify-return-x-working-on-absx-and-x0 I am using Mathematica 11.1, and I stumbled upon this strange response using the Abs function. FullSimplify[Abs[x],x&lt;0] (* Abs[x] *) while, for example FullSimplify[Abs[x],x&gt;0] (* x *) as ... - asked by mickep (10 votes), answered by Simon Woods (13 votes) —————————- [ParallelMap vs Map performance comparsion] https://mathematica.stackexchange.com/questions/144056/parallelmap-vs-map-performance-comparsion The ParallelMap claims doing map faster than the normal Map, and I checked the demo does as the document describing but, I try my testing, it seems not exactly while ParallelMap excuting with 8 ... - asked by Jerry (10 votes), answered by Szabolcs (10 votes) —————————- [How to plot a matrix with 3D style] https://mathematica.stackexchange.com/questions/144443/how-to-plot-a-matrix-with-3d-style I have a list like SeedRandom[1] MatrixForm[list = RandomInteger[5, {5, 5}]] We can plot it with MatrixPlot directly with 2D style MatrixPlot[list] I hope to plot it with 3D style.This is ... - asked by yode (9 votes), answered by kglr (2 votes) ================================== Greatest hits from previous weeks: ================================== [Where can I ﬁnd examples of good Mathematica programming practice?] https://mathematica.stackexchange.com/questions/18/where-can-i-find-examples-of-good-mathematica-programming-practice I consider myself a pretty good Mathematica programmer, but I’m always looking out for ways to either improve my way of doing things in Mathematica, or to see if there’s something nifty that I haven’t ... - asked by J. M. (463 votes), answered by faysou (410 votes) —————————- [How can I plot the direction ﬁeld for a diﬀerential equation?] https://mathematica.stackexchange.com/questions/8841/how-can-i-plot-the-direction-field-for-a-differential-equation I’d like to plot the graph of the direction ﬁeld for a diﬀerential equation, to get a feel for it. I’m a novice, right now, when it comes to plotting in Mathematica, so I’m hoping that someone can ... - asked by Matt Groﬀ (20 votes), answered by Peter Breitfeld (16 votes) ================================== Can you answer these? ================================== [Quality of RegionIntersection[]: How to control?] https://mathematica.stackexchange.com/questions/144270/quality-of-regionintersection-how-to-control This code produces a crude intersection. a = {-1/2, -1/2, -1/2}; b = {1/2, 1/2, 1/2}; R = RegionIntersection[Ball[a, 1], Ball[b, 1]]; Region[R] How can I control the quality so that the ... - asked by Joseph O’Rourke (4 votes) —————————- [Why ReadList ignores NullRecords for Number?] https://mathematica.stackexchange.com/questions/144149/why-readlist-ignores-nullrecords-for-number When thinking on this recent question the immediately obvious solution which came to my mind was to use ReadList with options RecordLists -&gt; True and NullRecords -&gt; True for reading objects of ... - asked by Alexey Popkov (5 votes) —————————- [Why does the domain of an interpolating function not match the corresponding ParametricNDSolve solution range?] https://mathematica.stackexchange.com/questions/144355/why-does-the-domain-of-an-interpolating-function-not-match-the-corresponding-par Question I had believed - and mostly observed - that when I use ParametricNDSolve the obtained ParametricFunctions given as the solution to some ODE or DAE will be translated into ... - asked by gwr (3 votes) ### 4.35 Tuesday, April 18, 2017 ================================== Top new questions this week: ================================== [Crack CAPTCHA using deep learning] https://mathematica.stackexchange.com/questions/143691/crack-captcha-using-deep-learning Deep convolutional neural networks are very good at computer vision related tasks. Optical Character Recognition (OCR) is one important branch of computer vision. In fact, the convolution neural ... - asked by xslittlegrass (50 votes), answered by xslittlegrass (52 votes) —————————- [Changes to Series[...] in version 11.1] https://mathematica.stackexchange.com/questions/143414/changes-to-series-in-version-11-1 I have updated to Mathematica 11.1 and I am shocked to see that the Series-function now works diﬀerently: If I enter Series[x^2+x^3, {x,0,0}] it will return x^2+O[x]^3 which is just weird. In ... - asked by Matthias Koenig (16 votes), answered by QuantumDot (3 votes) —————————- [WLNet format incompatible between version 11.0 and 11.1] https://mathematica.stackexchange.com/questions/143699/wlnet-format-incompatible-between-version-11-0-and-11-1 It seems that there are some behavior changes of neural network layers from version 11.0 to 11.1 that leads to the incompatibility of WLNet format. Consider this example: Network exported in 11.0 ... - asked by xslittlegrass (13 votes), answered by Taliesin Beynon (7 votes) —————————- [DSolve solution depends on ordering of equation] https://mathematica.stackexchange.com/questions/143726/dsolve-solution-depends-on-ordering-of-equation Bug introduced in 8.0 or earlier and persisting through 11.1.0 or later I am trying to obtain the general solution, $$G(x_1,x_2,x_3,x_4)$$ to the very easy system of PDEs: - asked by Jeremy Upsal (12 votes), answered by Nasser (8 votes) —————————- [Why the Callout option makes plotting performance poor] https://mathematica.stackexchange.com/questions/143711/why-the-callout-option-makes-plotting-performance-poor Bug introduced in 11.0 and ﬁxed in 11.1 The Callout option is a new option for plotting, but the performance is very poor, see bellow testing case. num = 1000; list = N@Sin@Range[num]; list2 = ... - asked by Jerry (11 votes) —————————- [Neural machine translation model using deep learning] https://mathematica.stackexchange.com/questions/143609/neural-machine-translation-model-using-deep-learning In Mathematica version 11.1, SequenceAttentionLayer is introduced to model attentions in the recurrent neural network. It has been shown that attention mechanism can greatly improve the quality of a ... - asked by xslittlegrass (11 votes), answered by Sebastian (8 votes) —————————- [Backslide in NSolve in V11.1?] https://mathematica.stackexchange.com/questions/143824/backslide-in-nsolve-in-v11-1 In V11.1, NSolve[BesselJ[0, x] == 0 &amp;&amp; 0 &lt; x &lt; 20, x] returns no solutions: But in V11.0 (and earlier), it returns all solutions: Is there anyway to get NSolve to solve this ... - asked by Michael E2 (10 votes), answered by Nasser (8 votes) ================================== Greatest hits from previous weeks: ================================== [How to perform a multi-peak ﬁtting?] https://mathematica.stackexchange.com/questions/26336/how-to-perform-a-multi-peak-fitting I am wondering how to implement the multi-peak detecting and ﬁtting in Mathematica. Following is an example of ﬁtting the data using three peaks (such that the data peak1 + peak2 + peak3). The ... - asked by Everett You (43 votes), answered by Silvia (45 votes) —————————- [How to make an inkblot?] https://mathematica.stackexchange.com/questions/3345/how-to-make-an-inkblot How to eﬀectively create a polygon that looks like a realistic inkblot? So far, I could come up with this (borrowing from Ed Pegg Jr.’s Rorschach demonstration): RandomBlot[num_, opts___] := ... - asked by István Zachar (84 votes), answered by Sjoerd C. de Vries (47 votes) ================================== Can you answer these? ================================== [How to create an APIFunction that takes a list with constraints on the list elements?] https://mathematica.stackexchange.com/questions/143709/how-to-create-an-apifunction-that-takes-a-list-with-constraints-on-the-list-elem This APIFunction takes a list as an argument: func = APIFunction[{"x" -&gt; DelimitedSequence["Integer", ","]}, #x^3 &amp;] func["x" -&gt; Range[4]] What I’d like to be able to do is place a ... - asked by Mike Honeychurch (4 votes) —————————- [How to setup FrameTicks for TradingChart] https://mathematica.stackexchange.com/questions/143705/how-to-setup-frameticks-for-tradingchart I’m trying to setup FrameTicks for TradingChart, but it dosn’t work. (*take data*) data = FinancialData["NASDAQ:AAPL", "OHLCV", {{2017, 1, 1}, {2017, 4, 16}}]; (*def. of ticks*) maxh = ... - asked by Jerry (3 votes) —————————- [What are the software requirements to train neural networks on GPU?] https://mathematica.stackexchange.com/questions/143795/what-are-the-software-requirements-to-train-neural-networks-on-gpu It seems that GPU training in Mathematica has some additional requirements on the software. For example, when I run this example on a Linux system, I get the following errors trainingData = ...  - asked by xslittlegrass (8 votes) ### 4.36 Tuesday, April 11, 2017 ================================== Top new questions this week: ================================== [L-System in Mathematica] http://mathematica.stackexchange.com/questions/143214/l-system-in-mathematica Here is some Maple code for drawing an L-System:  with(Fractals:-LSystem) cons := ["A" = "draw:1", "+" = "turn:-90", "B" = "turn:90"] state, rules := "A", ["A" = "AB+BA+B", "B" = "B+AAB"] ... - asked by vito (21 votes), answered by Szabolcs (21 votes) —————————- [What’s purpose of the new function BinarySerialize?] http://mathematica.stackexchange.com/questions/141885/whats-purpose-of-the-new-function-binaryserialize 11.1 introduced a new function BinarySerialize, but I don’t know what it can do better than the traditional method.Its behavior is very similar to Compress,though I cannot ﬁnd any advantage of it.It ... - asked by yode (17 votes), answered by Shadowray (14 votes) —————————- [Why does SetPrecision not apply to 0?] http://mathematica.stackexchange.com/questions/143296/why-does-setprecision-not-apply-to-0 Is there a rationale why SetPrecision works on integers except for 0? SetPrecision[1,5] 1.0000 SetPrecision[0,5] 0 - asked by alancalvitti (11 votes), answered by Shadowray (17 votes) —————————- [How to use Mathematica to train a network Using out of core classiﬁcation?] http://mathematica.stackexchange.com/questions/142135/how-to-use-mathematica-to-train-a-network-using-out-of-core-classification I see there is doc about how to train a network Using out of core image classiﬁcation and this question.But the object is only image. I want to use a binary ﬁle as data,for example,this. data = ... - asked by partida (10 votes), answered by xslittlegrass (9 votes) —————————- [Combining pure functions] http://mathematica.stackexchange.com/questions/142072/combining-pure-functions Is there an easy way to combine pure functions into a single pure function? For example, say I have f = #1^2 &amp;; g = #1 - 2 &amp;; and I want to deﬁne a new pure function h that is the ... - asked by tparker (10 votes), answered by Kuba (5 votes) —————————- [Question about changes in Documentation Center from version 10 to 11] http://mathematica.stackexchange.com/questions/143335/question-about-changes-in-documentation-center-from-version-10-to-11 The package Exploring Abstract Algebra with Mathematica works ﬁne in Mathematica 10.4. After installing it in the$UserBaseDirectory it neatly shows up under Add-Ons and Packages in the ...

—————————-

[How can I install packages distributed as .paclet ﬁles?] http://mathematica.stackexchange.com/questions/141887/how-can-i-install-packages-distributed-as-paclet-files

I downloaded a Mathematica package. It came as a ﬁle with the .paclet extension. How can I install or uninstall it?

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

[Exporting graphics to PDF - huge ﬁle] http://mathematica.stackexchange.com/questions/1542/exporting-graphics-to-pdf-huge-file

I want to draw some basic surfaces, export them to PDF and include them in a LaTeX ﬁle. I create a simple 3D graphics object, for instance with

 ParametricPlot3D[{r Cos[θ], r Sin[θ], r^2}, {r, 0,  ...

—————————-

[Unit Discovery: Is this some sort of a sick joke?] http://mathematica.stackexchange.com/questions/124745/unit-discovery-is-this-some-sort-of-a-sick-joke

Alright, let’s have some fun here. I am essentially following the documentation by Wolfram, just looking at diﬀerent quantities.

N[UnitConvert[Quantity["earth's gravity"]]]

9.80665m/(s)^2

Hmm,  ...

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

[How to get consistent/predictable results from ‘Alignment‘ specs within a ‘Grid‘ environment?] http://mathematica.stackexchange.com/questions/142047/how-to-get-consistent-predictable-results-from-alignment-specs-within-a-grid

IME, the results of Alignment speciﬁcations within a Grid environment are completely unpredictable.

I give several examples below illustrating this unpredictability.

My questions are:

Is there a ...

—————————-

[Why Integrate does not work in the ﬁrst call?] http://mathematica.stackexchange.com/questions/143199/why-integrate-does-not-work-in-the-first-call

Consider an example (calculated in Mathematica 11.0.1.0):

In[1]:= Integrate[(Sin[(\[Pi] xc)/(2 Lc)] Sin[(m \[Pi]  ...

—————————-

[Geo data load issues: Texas is missing from GeoRegionValuePlot in v11, but only when mapping US states] http://mathematica.stackexchange.com/questions/142079/geo-data-load-issues-texas-is-missing-from-georegionvalueplot-in-v11-but-only

UPDATE: this is not a global Mathematica issue, but a data load issue on a local machine. Does anyone know how to clear Geo cache and reload the data? I’ve also noticed on this machine that ...

### 4.37 Tuesday, April 4, 2017

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

[Object detection and localization using neural network] http://mathematica.stackexchange.com/questions/141598/object-detection-and-localization-using-neural-network

Four important computer vision tasks are classiﬁcation, localization, object detection and instance segmentation (image taken from cs224d course):

These four tasks are all built on top of the deep ...

—————————-

[Ball Bouncing on Hilly Terrain] http://mathematica.stackexchange.com/questions/141209/ball-bouncing-on-hilly-terrain

There is a maple code for the bouncing ball on the given curve.

I tried to make this animation by using Mathematica

Why does the following code not work?

surf := Sin[x] + (0.2 Cos[4 x + Sin[4  ...

—————————-

I’m trying to use Dataset to explore some large data. I notice that the performance decrease more than 20X by adding heads to the columns. Here is an example:

We generate some data with integers

...

—————————-

[Benchmarking: unexplained switching between high and low performance] http://mathematica.stackexchange.com/questions/141350/benchmarking-unexplained-switching-between-high-and-low-performance

tl;dr I am trying to accurately benchmark some vectorized operations, and compare them between systems. But benchmarking is hard to do well, and I am getting inconsistent results: performance is ...

—————————-

[How to visualize attention?] http://mathematica.stackexchange.com/questions/141542/how-to-visualize-attention

In the articles about sequence attention we can see images like this:

Here we see that while translating from French to English, the network attends sequentially to each input state, but sometimes ...

—————————-

[Can one create a custom front-end for Mathematica?] http://mathematica.stackexchange.com/questions/141581/can-one-create-a-custom-front-end-for-mathematica

I’d like to create my custom front-end for Mathematica. I know there’s a console interface (launched as math), which mostly works great, but it can’t really provide functionality of e.g. interactive ...

—————————-

[How to clear Integrate internal memory?] http://mathematica.stackexchange.com/questions/141324/how-to-clear-integrate-internal-memory

I noticed that when I call Integrate for the ﬁrst time, on an integral that I know will take longer than the time limit I give it, it will abort for the ﬁrst time, as expected when wrapped by ...

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

[Creating legends for plots with multiple lines?] http://mathematica.stackexchange.com/questions/4025/creating-legends-for-plots-with-multiple-lines

So I have a graph with multiple lists, for e.g.

data = {{1,2}, {3,4}, {3,5}, {2,3} . . .}

If I then do ListLinePlot[Table[{#1,Log[b,#2]}&amp;@@@data, {b,1,10,2}]]
I have no way to generate a legend  ...


—————————-

[Labeling individual curves in Mathematica] http://mathematica.stackexchange.com/questions/4444/labeling-individual-curves-in-mathematica

I need to create a plot for export and inclusion in a report. Is there a better way to label curves than PlotLegends? From what I’ve read and my personal experience, PlotLegends is pretty bad.

Is ...

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

[GraphicsComplex dynamic colors] http://mathematica.stackexchange.com/questions/141489/graphicscomplex-dynamic-colors

I have a fairly large GraphicsComplex (surface mesh with more than several thousand vertices) and I want to visualize a scalar function that is deﬁned on the vertices. I map the function to vertex ...

—————————-

[how to eﬃciently generate all directed graphs with 6 vertices] http://mathematica.stackexchange.com/questions/141681/how-to-efficiently-generate-all-directed-graphs-with-6-vertices

I am attempting to generate all non-isomorphic directed graphs with 6 vertices using command ListGraphs[6, Directed].But it does not work eﬃciently and takes a month producing nothing.

Can anyone ...

—————————-

[Bug in Limit in version 11.1.0] http://mathematica.stackexchange.com/questions/141233/bug-in-limit-in-version-11-1-0

Bug introduced in version 11.1.0

The inﬁnite limit

Assuming[a&gt;0&amp;&amp;b&gt;0,
Limit[((1+a)*b*x)/Sqrt[1+(1+a)*b*x*((1+a)*b*x+Sqrt[1+(1+a)^2*b^2*x^2])],
x-&gt;Infinity]]

gives the ...

### 4.38 Tuesday, March 28, 2017

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

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

[Faster derangements?] http://mathematica.stackexchange.com/questions/140794/faster-derangements

I wonder what is the fastest method to generate derangements?

Both the Combinatorica function and Martin Ender’s answer to Permutations of lists of ﬁxed even numbers are based on ﬁltering the ...

—————————-

[Why Except is so slow as compared to equivalent RegularExpression?] http://mathematica.stackexchange.com/questions/140752/why-except-is-so-slow-as-compared-to-equivalent-regularexpression

When comparing performance of the solutions suggested for this question I discovered that StringExpression involving Except is two orders of magnitude slower for large strings as compared to ...

—————————-

[FrameTicks setting for ”tick marks on all sides, but labels only on right and top”] http://mathematica.stackexchange.com/questions/140966/frameticks-setting-for-tick-marks-on-all-sides-but-labels-only-on-right-and-to

Short version: Is there a value for the FrameTicks option that retains the default tick marks on all sides, and puts tick labels only on the right and top sides?

I can imagine all manner of ...

—————————-

[Quickly importing several thousands of jpg ﬁles?] http://mathematica.stackexchange.com/questions/140974/quickly-importing-several-thousands-of-jpg-files

I have several thousands of small .jpg ﬁles (30kb each) which I need to import into Mathematica. (I plan to use ImageDistance to investigate their diﬀerences.) I tried several ways to import these ...

—————————-

[Select seems unusually slow] http://mathematica.stackexchange.com/questions/140861/select-seems-unusually-slow

I haven’t been doing nearly as much Mathematica as I really should for the past few months, and in order to get my head back in the game I’ve been using it to run roughshod over easy Project Euler ...

—————————-

[Permutations of nested parentheses (Dyck words)] http://mathematica.stackexchange.com/questions/141127/permutations-of-nested-parentheses-dyck-words

How would I construct a function that outputs Dyck Words?

e.g. - there are 14 words in $$\mathcal {D}_{8}$$:

[[[[]]]], [[[][]]], [[[]][]], [[][[]]], [[[]]][], [[][][]], [][[[]]],
[[][]][], [[]][[]],  ...

—————————-

[Bug: Library functions from older versions of Mathematica may crash in Mathematica 11.1 and conversely] http://mathematica.stackexchange.com/questions/140758/bug-library-functions-from-older-versions-of-mathematica-may-crash-in-mathemati

The following is a conﬁrmed bug [CASE:3846875] that turned up in the prerelease 11.1.0 and is not solved in the oﬃcial release.

This is a small example. Execute the following commands in ...

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

[How to make a Spherical Cow?] http://mathematica.stackexchange.com/questions/125043/how-to-make-a-spherical-cow

Being a theoretical physicist, I always have a great respect for Spherical Cow. So I thought about making one myself. I am not sure how can I create (something considered to be the simplest!) this ...

—————————-

[How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc] http://mathematica.stackexchange.com/questions/66273/how-to-tell-mathematica-that-certain-variables-are-real-imaginary-integer-value

I’m trying to expedite some quantum mechanical calculations (expectation values etc.) by running them through Mathematica. When I say, for example,

u[x_] := Sqrt[2/L] * Sin[Pi * n * x / L]

and then ...

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

[Why does LatticeReduce require integral or at least rational inputs?] http://mathematica.stackexchange.com/questions/141002/why-does-latticereduce-require-integral-or-at-least-rational-inputs

The function LatticeReduce in Mathematica implements the LLL algorithm. It requires the lattice basis to be described as integral or at least rational numbers.

Why so?

The LLL algorithm itself is ...

—————————-

[Textual progress in console?] http://mathematica.stackexchange.com/questions/140675/textual-progress-in-console

Is there any way to get a textual progress bar (e.g. like the progressbar module in a python repl) when working in console mode?

Anything would be better than this:

—————————-

[How to trigger an ”ErrorBox behavior”?] http://mathematica.stackexchange.com/questions/140979/how-to-trigger-an-errorbox-behavior

Here’s an example of what I mean by an ”ErrorBox behavior”. In the front end, if one evaluates the expression

Graphics[Circle[], ImageSize -&gt; Tiny, PlotRange -&gt; {All}]

(which includes the ...

### 4.39 Tuesday, March 21, 2017

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

[V11.1: Eﬀective methods to use paid functions economically] http://mathematica.stackexchange.com/questions/140261/v11-1-effective-methods-to-use-paid-functions-economically

In the newly released version 11.1, Mathematica introduces three new functions: WebSearch, WebImageSearch and TextTranslation that requires Service Credits. While I haven’t found much information ...

—————————-

[How do I disable the stack tracing feature in Mathematica 11?] http://mathematica.stackexchange.com/questions/140285/how-do-i-disable-the-stack-tracing-feature-in-mathematica-11

Bug was introduced in 11.0 and persisting through 11.1

It looks like the Mathematica 11 stack tracing feature (see red ellipsis in front of any warning message) prevents the garbage collector from ...

—————————-

Generative adversarial networks (GAN) is regarded as one of ”the most interesting idea in the last ten years in machine learning” by Yann LeCun. It can be used to generate photo-realistic images that ...

—————————-

I would like to show the iterative stages of infection for problem 2 in this link.

In case the link dies, I have copied the text for the problem below:

One hundred computers are connected in a ...

—————————-

[how to remove the little × that shows up in frontend when typing?] http://mathematica.stackexchange.com/questions/140583/how-to-remove-the-little-x-that-shows-up-in-frontend-when-typing

Version 11.1 now shows a little grayed out x (a multiplication sign) when one is editing something, to warn them that the expression will be interpreted as the multiplication of what precedes and ...

—————————-

[Delete redundant x,y pairs] http://mathematica.stackexchange.com/questions/140571/delete-redundant-x-y-pairs

Working through the problems from Hazrat’s Mathematica book and there’s a simple exercise to ﬁnd all the square numbers where $$n^2+m^2=h^2$$ yields $$h$$ as an integer (I think they’re also called ...

—————————-

[Getting Compile to work with Visual Studio 2017 Community Edition] http://mathematica.stackexchange.com/questions/140071/getting-compile-to-work-with-visual-studio-2017-community-edition

The new Visual Studio is out since a week and I tried to get it to work with Mathematica (v 11.0). However the usual tricks for working with a new VS version fail here.

Related seems to be the ...

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

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

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

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

—————————-

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

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

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

[Explaining error when using Part inside Module in Dataset] http://mathematica.stackexchange.com/questions/140541/explaining-error-when-using-part-inside-module-in-dataset

I have a vague recollection of seen an explanation for this, but I can not ﬁnd it, so it may be a false memory. Will delete if duplicated.

Let ds be a simple Dataset

ds = Dataset@Table[
...

—————————-

[Performance-driven approach to using Big Data without killing the hard-drive] http://mathematica.stackexchange.com/questions/140114/performance-driven-approach-to-using-big-data-without-killing-the-hard-drive

Situation

A calculation has to be done in which the amount of data is too much to ﬁt into memory. Fortunately, only a part of the overall data set has to be known at a time. The preprocessing is ...

—————————-

[Bug with PlotLegends-¿Placed in GraphicsRow] http://mathematica.stackexchange.com/questions/140539/bug-with-plotlegends-placed-in-graphicsrow

Bug introduced in 11.0 and persisting through 11.1

The FrontEnd of Mathematica 11.1.0 on my Windows 7 box runs permanently at 100% CPU when I execute the following command:

...

### 4.40 Tuesday, March 14, 2017

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

[How to implement a discrete data representation?] http://mathematica.stackexchange.com/questions/139818/how-to-implement-a-discrete-data-representation

I’m currently working with large datasets of ”discrete data”. Each of these is a multiset of real numbers of the form $$kS + B$$, where $$k$$ is an integer, and $$S$$ (the ”scale”) and $$B$$ (the ”bias”) are ...

—————————-

[Mathematica incorrectly giving zero for partial derivative] http://mathematica.stackexchange.com/questions/139669/mathematica-incorrectly-giving-zero-for-partial-derivative

Bug introduced in 9.0.1 or earlier

Mathematica is incorrectly reporting that the partial derivative of a certain expression is zero.

I try to compute the following:

D[SymmetricPolynomial[3, {x1,  ...

—————————-

[Finding vampire numbers] http://mathematica.stackexchange.com/questions/139808/finding-vampire-numbers

How to ﬁnd vampire numbers by using Mathematica?

A number $$v=xy$$ with an even number $$n$$ of digits formed by multiplying a pair of $$n/2$$-digit numbers (where the digits are taken from the ...

—————————-

[Why do subsequent evaluations seem to be stopped by a False Condition (/;)?] http://mathematica.stackexchange.com/questions/139461/why-do-subsequent-evaluations-seem-to-be-stopped-by-a-false-condition

Exploring another problem and this example of @halirutan, I came across an evaluation behavior I don’t understand.

When g[] below is evaluated the ﬁrst time, ig[] is evaluated and a message printed; ...

—————————-

[Bug? Numerical calculation error with FullSimplify and arbitrary precision] http://mathematica.stackexchange.com/questions/139697/bug-numerical-calculation-error-with-fullsimplify-and-arbitrary-precision

Bug introduced after 5.2, ﬁxed in 8.0, reintroduced in 9.0 and persisting through 11.0.1

Is this a bug?

If I do

FullSimplify[n E^(010 n)]

then it returns

n/2

what is obviously incorrect.

...

—————————-

[Is there a convention on which name to use for a throwaway variable? (Like underscore in Python)] http://mathematica.stackexchange.com/questions/139622/is-there-a-convention-on-which-name-to-use-for-a-throwaway-variable-like-under

I would prefer to write {_, foo} = LongFunctionName[arg1, arg2] instead of
foo = LongFunctionName[arg1, arg2][[2]] or foo = Last @ LongFunctionName[arg1, arg2].
Using an actual name for the throwaway  ...

—————————-

[Extract images from large avi movies (50-100 GB)] http://mathematica.stackexchange.com/questions/139819/extract-images-from-large-avi-movies-50-100-gb

I will get large RGB avi ﬁles (35 Hz, 1600*1200 pixels) of up to 100 GB size. All three channels contain the same grayscale image.

I want to extract each avi ﬁle into one channel png images.

To do ...

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

[How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc] http://mathematica.stackexchange.com/questions/66273/how-to-tell-mathematica-that-certain-variables-are-real-imaginary-integer-value

I’m trying to expedite some quantum mechanical calculations by running them through Mathematica. Expectation values and stuﬀ like that. When I say, for example,

u[x_] := Sqrt[2/L] * Sin[Pi * n * x /  ...

—————————-

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

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

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

[Integrating rational functions of several variables over $$\mathbb {H}^4$$] http://mathematica.stackexchange.com/questions/139631/integrating-rational-functions-of-several-variables-over-mathbbh4

Let $$W$$ be a rational function of $$8$$ variables $$a,b,c,d,e,f,g,h$$ from this ﬁle, e.g.:

W = (256*b*d*f*(a^5 + b^4*(c - 2*e) - a^4*(3*c + 2*e) - c*(c^2 + d^2)*(e^2 + f^2) + a^3*(2*b^2 + 3*c^2 + d^2 +  ...

—————————-

[Best Wolfram tool for interactive web-based calculator] http://mathematica.stackexchange.com/questions/139954/best-wolfram-tool-for-interactive-web-based-calculator

A colleague is considering re-implementing this online ”Photon Propulsion Calculator” using a Mathematica-based product. I wanted to ask the community which product would be best.

WebMathematica

...

—————————-

[How to get rid of a built-in context from autocomplete?] http://mathematica.stackexchange.com/questions/139783/how-to-get-rid-of-a-built-in-context-from-autocomplete

I have noticed that when I type the name of built-in function Limit in Mathematica, the autocomplete suggests two variants at the top: the ﬁrst one is the working one, and the second one is just ...

### 4.41 Tuesday, March 7, 2017

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

[What are some common issues with ﬁtting functions to data?] http://mathematica.stackexchange.com/questions/139038/what-are-some-common-issues-with-fitting-functions-to-data

Mathematica has numerous functions designed to, or capable of, ﬁtting known functions, and ﬁnding unknown functions to match data sets. What are some common issues that come with ﬁnding those ﬁts? ...

—————————-

[Notebook’s TaggingRules inherit too much] http://mathematica.stackexchange.com/questions/139017/notebooks-taggingrules-inherit-too-much

Bug introduced in V10.4 or earlier and persisting through 11.0.1

[CASE:3852725] was created

[...] I have forwarded an incident report to our developers with the information you provided. ...

—————————-

[Is ExportString defective in V11?] http://mathematica.stackexchange.com/questions/138932/is-exportstring-defective-in-v11

Mathematica doesn’t do the best job of exporting ﬁgures with shading or transparency to vector graphics formats such as PDF.

A common trick employed here and elsewhere on the web to workaround this ...

—————————-

[Commands to stop and continue evaluation without Debugger] http://mathematica.stackexchange.com/questions/139377/commands-to-stop-and-continue-evaluation-without-debugger

I would like to stop the evaluation somehwere at a speciﬁy line in a notebook. Then I could for example check the state of some variables.

After that I would like to continue the evaluation from the ...

—————————-

[How am I misusing EvenQ, or, how are EvenQ and (Mod[2,#]==0)& diﬀerently evaluated?] http://mathematica.stackexchange.com/questions/139281/how-am-i-misusing-evenq-or-how-are-evenq-and-mod2-0-differently-evalua

While working on a problem, I was using EvenQ in a RegionPlot. I came across this interesting case (simpliﬁed here for speciﬁcity). I expected to see a bunch of stripes, but got nothing:

...

—————————-

[Partition a list by count of a number] http://mathematica.stackexchange.com/questions/138905/partition-a-list-by-count-of-a-number

I want to take this list when the 2 appear 3 times

SeedRandom[1]
list = RandomChoice[{.2, .5, .3} -&gt; {1, 2, 3}, 20]

{3,1,3,1,2,1,2,2,2,3,2,3,2,2,3,3,3,2,2,2}

Hope to get {{3, 1, 3, 1, 2, 1,  ...

—————————-

[Why SciDraw can not handle the StreamPlot?] http://mathematica.stackexchange.com/questions/138926/why-scidraw-can-not-handle-the-streamplot

I ﬁnd that the package SciDraw is suitable for preparing the ﬁgure in the thesis. When I use it to plot the line, it works well. For example

<<SciDraw
...


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

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

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

using following trigonometric identities

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

—————————-

[Calculate the 2D Fourier transform of an Image] http://mathematica.stackexchange.com/questions/29203/calculate-the-2d-fourier-transform-of-an-image

I am new to Mathematica, and using version 8.0.

I would like to calculate the 2D Fourier Transform of an Image with Mathematica and plot the magnitude and phase spectrum, as well as reconstruct the ...

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

[Two-Point correlation function of Ising data is not giving expected results] http://mathematica.stackexchange.com/questions/139016/two-point-correlation-function-of-ising-data-is-not-giving-expected-results

Due to the nature of my problem, and readers perhaps not having a physics background, I need to give some context to my problem which is intrinsic to it. The problem however is not a physics one, but ...

—————————-

[Evaluating an expectation expressed by a diﬃcult expression] http://mathematica.stackexchange.com/questions/138917/evaluating-an-expectation-expressed-by-a-difficult-expression

Background

I have a 2-dimensional space. The receiver is at the center. The locations of transmitters are given by the PPP $$\Phi$$ with density $$\lambda$$. The serving transmitter is the one that is ...

—————————-

[How to control indentation of a cell relative to it’s parent?] http://mathematica.stackexchange.com/questions/138971/how-to-control-indentation-of-a-cell-relative-to-its-parent

Is there a stylesheet property that can be set to control the extra level of indentation of a cell in its group (I don’t want to specify absolute CellMargins)?

Carl suggests in the comments to use ...

### 4.42 Tuesday, February 28, 2017

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

[Parallelize Map and ParallelMap] http://mathematica.stackexchange.com/questions/138476/parallelize-map-and-parallelmap

Bug introduced in 8.0 and persisting through 11.0.1 or later

It is stated in the documentation that

  Parallelize[Map[f, expr]] is equivalent to ParallelMap[f, expr].

—————————-

This is a bid at creating a canonical Q&A.

Many questions have been asked that come down to the fact that Thread evaluates its ﬁrst argument before threading is attempted. In a few minutes I ...

—————————-

[Learn Mathematica (Wolfram) Language in one day] http://mathematica.stackexchange.com/questions/138366/learn-mathematica-wolfram-language-in-one-day

Currently I am trying to learn Python. Searching for relevant material I came across

X in Y minutes

and books with titles such as Learn Python in one day, in 24 hours, etc.

Similar material exists ...

—————————-

[Puzzle — 20 People to consume 20 units of food under constraints] http://mathematica.stackexchange.com/questions/138637/puzzle-20-people-to-consume-20-units-of-food-under-constraints

I am learning Mathematica because I love it. I also love solving puzzles so I think it would be a nice way to learn Mathematica through puzzles. This is ﬁrst puzzle in series I intend to solve.

So ...

—————————-

[Compute the curvature of a bent stack of paper] http://mathematica.stackexchange.com/questions/138583/compute-the-curvature-of-a-bent-stack-of-paper

My goal is to link the curvature of a bent stack of paper in a wind tunnel to its bending modulus $$B$$, knowing all the other physical properties. To this end, I would like to reproduce the numerical ...

—————————-

[WordOrientation does not work in v11?] http://mathematica.stackexchange.com/questions/138811/wordorientation-does-not-work-in-v11

Bug introduced in 11.0.1

It seems that WordOrientation does not work in v11. The sample code

input = ExampleData[{"Text", "AliceInWonderland"}];
WordCloud[input, WordOrientation -&gt; "Random"]

...

—————————-

[Code request: Make ”copy formatted code” bulletproof] http://mathematica.stackexchange.com/questions/138436/code-request-make-copy-formatted-code-bulletproof

With the GeneralUtilities‘PrintDeﬁnitions functions comes a usable code formatting engine. On this site, most of the time we share code. I believe it would be awesome to have a robust button that ...

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

[Why round to even integers?] http://mathematica.stackexchange.com/questions/2116/why-round-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 ...

—————————-

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

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

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

[Plotting a 2D slice of a 3D function] http://mathematica.stackexchange.com/questions/138808/plotting-a-2d-slice-of-a-3d-function

I'd like to plot (Sqrt[x] + Sqrt[y] + Sqrt[z])^2 in a slice defined by x+y+z=1

I ﬁgured out similar problem 5 years ago, but it was a bit involved, ie, needing 10 lines of Mathematica code. Is there ...

—————————-

[Export of Plot3D function completely diﬀerent from the render within Mathematica] http://mathematica.stackexchange.com/questions/138412/export-of-plot3d-function-completely-different-from-the-render-within-mathematic

I am plotting a simple function:

Plot3D[-RandomReal[{0, 10}] Cos[x/3] Cos[y/3],
{x, -π, π}, {y, -π, π},
Axes -&gt; False,
Boxed -&gt; False,
BoundaryStyle -&gt; None,
Mesh -&gt; None]

...

- asked by waﬄ (1 vote)

—————————-

[CreateExecutable returns $Failed] http://mathematica.stackexchange.com/questions/138328/createexecutable-returns-failed My platform is win10 64b, Mathematica 11 and Visual Studio 2015. When I apply CreateExecutable, it always returns$Failed. The conﬁguration is right. Please what is the problem? Thank you.

...

- asked by tu312 (1 vote)

### 4.43 Tuesday, February 21, 2017

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

For the purposes of creating a publication-quality plot marker I wish to convert a font glyph into a simpliﬁed Polygon where points are taken adaptively according to curvature of the boundary. ...

—————————-

[Can Mathematica be used to make anamorphic distortions like these?] http://mathematica.stackexchange.com/questions/137853/can-mathematica-be-used-to-make-anamorphic-distortions-like-these

We have all see these sidewalk and street images that appear to be 3D based on the viewers perspective, but then wildly distort when viewed from a diﬀerent perspective.

Seems to me anamorphic ...

—————————-

[How to implement lane-change rules for Nagel Schreckenberg model] http://mathematica.stackexchange.com/questions/138138/how-to-implement-lane-change-rules-for-nagel-schreckenberg-model

I am trying to extend the Nagel-Schreckenberg model for traﬃc ﬂow to include two lanes of traﬃc.

—————————-

[How to make a custom NN layer in Mathematica?] http://mathematica.stackexchange.com/questions/138230/how-to-make-a-custom-nn-layer-in-mathematica

Is there a way to create our own custom layers for Neural Networks in Mathematica ? I suspect it should be possible, any pointers or directions on how to go about it?

I am interested in ...

—————————-

[How to build private function with built-in function’s option] http://mathematica.stackexchange.com/questions/138126/how-to-build-private-function-with-built-in-functions-option

Since this code work well:

Needs["GeneralUtilities"]
GeneralUtilitiesBenchmarkPlot[{SortBy[#, Identity] &amp;, Sort}, Range,
"IncludeFits" -&gt; True, TimeConstraint -&gt; 8]

I want to set ...

—————————-

[Doing combinations of sub-sublists] http://mathematica.stackexchange.com/questions/138178/doing-combinations-of-sub-sublists

To create a list of all the possible combinations of a sublist. I have a list, somewhat resembling the following format:

{{{a1, a2}, {b1}}, {{a1, a2}, {c1, c2}}, {{a1, a2}, {c1, c2}, {d1, d2}}}

...

—————————-

[Warning: FrontEnd crash with ‘Graphics@InﬁniteLine‘ for unknown symbolic coordinates] http://mathematica.stackexchange.com/questions/137847/warning-frontend-crash-with-graphicsinfiniteline-for-unknown-symbolic-coordi

Bug introduced in 10.0 and persisting through 11.0.1 InﬁniteLine is new in 10.0.

  [CASE:3840702] From your description, I gather you are noticing an unexpected crash
while trying to evaluate  ...

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

In the plot below I would like to add two vertical lines at $$x = \frac {\pi }{15} \pm \frac {1}{20}$$. How can I do that?

f[x_] := (x^2 z)/((x^2 - y^2)^2 + 4 q^2 x^2) /. {y -&gt; π/15, z -&gt; 1, q -&gt;  ...

—————————-

[Can Mathematica do symbolic linear algebra?] http://mathematica.stackexchange.com/questions/3242/can-mathematica-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?
...

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

[Calculate PDF of diﬀerence of Max and Min for Gaussian random variables] http://mathematica.stackexchange.com/questions/138027/calculate-pdf-of-difference-of-max-and-min-for-gaussian-random-variables

Although this should be a standard question I didn’t ﬁnd it in SE, and it was a nice exercise in Mathematica.

Let $$x$$ and $$y$$ be two independent Gaussian random variables with distribution $$N(0,1)$$. ...

—————————-

[Implementing t-SNE (t-Distributed Stochastic Neighbor Embedding)] http://mathematica.stackexchange.com/questions/137955/implementing-t-sne-t-distributed-stochastic-neighbor-embedding

Context

Six months ago @M.R. asked about an implementation of the
t-Distributed Stochastic Neighbor Embedding (t-SNE) algorithm by van der
Maaten and Hinton (2008). (@M.R.'s question)

@Alexey  ...

—————————-

[Is there an easy way to to collect a large number variables into a list or list of lists?] http://mathematica.stackexchange.com/questions/138225/is-there-an-easy-way-to-to-collect-a-large-number-variables-into-a-list-or-list

I have a large number of variables in a notebook from a data analysis routine, the results of which now need to be fed through a mathematical model and various items for visualization.

For example, ...

### 4.44 Tuesday, February 14, 2017

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

I have the following code that generates a ﬁnite element mesh:


Needs["NDSolveFEM"]
order = 2;
mesh = ToElementMesh[
DiscretizeGraphics[
GraphicsComplex[{{0, 4}, {5, 4}, {5, 0}, {8, 0}, {8,  ...

—————————-

[Why can’t I plot Log[Gamma[x]] for x ¿ 170?] http://mathematica.stackexchange.com/questions/137666/why-cant-i-plot-loggammax-for-x-170

Bug introduced in 11.0

For some reason I can’t plot Log[Gamma[x]] for values of x larger than approximately 170:

Plot[Log[Gamma[x]], {x, 130, 200}, PlotRange -&gt; All]

It works perfectly well ...

—————————-

[Finding the number of odd quintinomial coeﬃcients] http://mathematica.stackexchange.com/questions/137692/finding-the-number-of-odd-quintinomial-coefficients

I am searching for the number of odd coeﬃcients of

$$\qquad (x^4 + x^3 + x^2 + x + 1)^n$$

for arbitrary $$n$$.

It took some hours to compute the result for $$n=12207$$. There are $$16333$$ odd ...

—————————-

[Possible bug with RegionPlot] http://mathematica.stackexchange.com/questions/137273/possible-bug-with-regionplot

RegionPlot[ImplicitRegion[(2 x - 1)/(x - 1) &lt; 3/2, {x, y}],
PlotRange -&gt; {{-9, 9}, {-9, 9}}]

Just checking whether anyone else can replicate this. Can anybody conﬁrm such behavior and, ...

—————————-

Suppose I have a list that looks like the following (Town names and total distance to that town)

resupply = {
{"Coleman", 0},
{"Highwood House", 106},
{"Canmore", 229},
{"Exshaw", 245},
...

—————————-

[How to superimpose plots and graphics in the same coordinate system?] http://mathematica.stackexchange.com/questions/137408/how-to-superimpose-plots-and-graphics-in-the-same-coordinate-system

NB: I am aware that ”plots” are graphics too, so the title would be more precisely worded if ”graphics” were replaced by ”non-plot graphics”.

EDIT: I have edited my original example to make the ...

—————————-

[Unit tests for Graphics or FE boxes] http://mathematica.stackexchange.com/questions/137541/unit-tests-for-graphics-or-fe-boxes

Consider the following expression with bad syntax:

Graphics[foo]

How can I detect the error and retrieve the error message programmatically, so I can check for it in unit tests?

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

[Labeling individual curves in Mathematica] http://mathematica.stackexchange.com/questions/4444/labeling-individual-curves-in-mathematica

I need to create a plot for export and inclusion in a report. Is there a better way to label curves than PlotLegends? From what I’ve read and my personal experience, PlotLegends is pretty bad.

Is ...

—————————-

[Why this real integral yields imaginary results?] http://mathematica.stackexchange.com/questions/127301/why-this-real-integral-yields-imaginary-results

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

The above integral yields -1-4Iπ/3 in Mathematica. Since the integrand is real (although divergent at some points), how does ...

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

[How to convert ‘LogTicks[0, 2][[1, 2]]‘ to a regular number] http://mathematica.stackexchange.com/questions/137208/how-to-convert-logticks0-21-2-to-a-regular-number

I want to convert the $$10^i$$ tick labels generated by LogTicks of the CustomTicks package to regular numbers. The ﬁrst tick label is in element [[1,2]] of the object generated by LogTicks. FullForm ...

- asked by Felix (1 vote)

—————————-

[Solving the Euler-Lagrange equation with NDSolve‘ProcessEquations] http://mathematica.stackexchange.com/questions/137292/solving-the-euler-lagrange-equation-with-ndsolveprocessequations

I would like to compute the shortest distance between a number on pairs of points on a 2-dimensional Riemanniann statistical manifold (Negative Binomial distributions manifold, equipped with the Rao’s ...

- asked by C. Manté (1 vote)

—————————-

[Constraining the independent variable in a control system] http://mathematica.stackexchange.com/questions/137581/constraining-the-independent-variable-in-a-control-system

For an analog closed loop feedback control, I can do the following to model the response of a second-order physical system with an order 1 zeros polynomial to a step disturbance. I have a proportional ...

### 4.45 Tuesday, February 7, 2017

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

[Code that generates a mandala] http://mathematica.stackexchange.com/questions/136974/code-that-generates-a-mandala

My little brother asked me to print original mandalas for coloring. I would like some idea on how to create them, but without color, so he can color them.

examples

—————————-

Is there a way to have Mathematica at the notebook level
(SetOptions[EvaluationNotebook[], CellContext -&gt; Notebook])
only uses a set of declared variables in the notebook context. Any variables  ...

—————————-

[Shorthand for map at level 2] http://mathematica.stackexchange.com/questions/136751/shorthand-for-map-at-level-2

I love the shorthand /@. It is amazing for readability (and laziness when typing).
However, right now I find that I need Map at level 2, i.e.
Map[f, List[List[a,b],List[c,d]], {2}], a lot and I'd wish  ...

—————————-

[Proteins, ProteinData, WolframAlpha] http://mathematica.stackexchange.com/questions/136741/proteins-proteindata-wolframalpha

Apologies in advance, this is the ﬁrst I’ve messed with ProteinData and access through WolframAlpha, so clearly I may not know how Mathematica and Alpha decide on what is the ’right way’ to ask ...

—————————-

[Simplifying a reverse Fold for a Query] http://mathematica.stackexchange.com/questions/136856/simplifying-a-reverse-fold-for-a-query

Is there a simpler way to parametrize this tail-recursive expression to be applied as a Query (for processing a nested Association)? The pattern is shown by example with ﬁrst 3 levels:

—————————-

[Where is Abbott? How to make logograms from the ﬁlm ”Arrival”?] http://mathematica.stackexchange.com/questions/137156/where-is-abbott-how-to-make-logograms-from-the-film-arrival

The ﬁlm Arrival showed Wolfram Language code in action analysing alien logograms. A recent blog describes some details and mentions a live-coding video by Christopher Wolfam. See also Stephen ...

—————————-

[How to implement neural style transfer?] http://mathematica.stackexchange.com/questions/136704/how-to-implement-neural-style-transfer

In the paper A Neural Algorithm of Artistic Style, Leon A. Gatys et all. describe a process of extracting the content and style vectors from an image separately. They use this technique to generate ...

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

In the plot below I would like to add two vertical lines at $$x = \frac {\pi }{15} \pm \frac {1}{20}$$. How can I do that?

f[x_] := (x^2 z)/((x^2 - y^2)^2 + 4 q^2 x^2) /. {y -&gt; π/15, z -&gt; 1, q -&gt;  ...

—————————-

[Calculate the 2D Fourier transform of an Image] http://mathematica.stackexchange.com/questions/29203/calculate-the-2d-fourier-transform-of-an-image

I am new to Mathematica, and using version 8.0.

I would like to calculate the 2D Fourier Transform of an Image with Mathematica and plot the magnitude and phase spectrum, as well as reconstruct the ...

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

[Nonsparse sparse array crashes kernel on windows] http://mathematica.stackexchange.com/questions/136835/nonsparse-sparse-array-crashes-kernel-on-windows

On win 10, 64 bit, version 11.0.1, my kernel just started crashing for no reason as for as I can see. Does/should the following crash your kernel?

sparse = SparseArray[ArrayRules[RandomInteger[{1,  ...

—————————-

[How to visualize the vorticity of a 3D velocity ﬁeld?] http://mathematica.stackexchange.com/questions/136917/how-to-visualize-the-vorticity-of-a-3d-velocity-field

I have a snapshot of a system with 50 particles.

The snapshot is a list of 3 coordinates and 3 velocities per each particle. Namely, $$(x,y,z,\dot {x},\dot {y},\dot {z})$$, which AKA phase space ...

—————————-

[Finding line segments on the image by using ImageLines] http://mathematica.stackexchange.com/questions/136795/finding-line-segments-on-the-image-by-using-imagelines

There is an image from wolfram documentation

I want to ﬁnd and highlight lines on the following image

I tried:

img = Import["http://imgur.com/NbNwYWC.png"]

lines = ImageLines[EdgeDetect[img],  ...

### 4.46 Tuesday, January 31, 2017

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

[How to get a speciﬁed number of points that are nearly equally spaced in a closed rectangle] http://mathematica.stackexchange.com/questions/136447/how-to-get-a-specified-number-of-points-that-are-nearly-equally-spaced-in-a-clos

TriangulateMesh is almost the right tool for this problem. For example,

numb = 113;
region = BoundaryMeshRegion[{{0, 0}, {3, 0}, {3, 1}, {0, 1}}, Line[{1, 2, 3, 4, 1}]];
mesh =  ...

—————————-

[Tutorial on creating publication quality documents in Mathematica?] http://mathematica.stackexchange.com/questions/136426/tutorial-on-creating-publication-quality-documents-in-mathematica

Are there books or tutorials that walk one through creating a professional publication quality notebook?

For example, I would like to create a two column article using an IEEE format. Is this ...

—————————-

[Type conversions] http://mathematica.stackexchange.com/questions/136476/type-conversions

I have the following list, each element of which is of type string:

”abc”, ”def”,”2”,”ghi”,”7”

Is there an eﬃcient way to arrive at:

”abcdef”, 2,”ghi”,7

—————————-

[Alternatives and the Flat attribute] http://mathematica.stackexchange.com/questions/136157/alternatives-and-the-flat-attribute

When a head has the attribute Flat then the pattern matcher is able to pick out a sublist of its arguments, even though the structure doesn’t match:

SetAttributes[f, Flat];
f[a, b, c, d] /. f[a, b]  ...

—————————-

[Assign names to Dataset columns] http://mathematica.stackexchange.com/questions/136422/assign-names-to-dataset-columns

I am constructing a dataset like so:

data = Dataset[AssociationThread[Keys[characterCounts], charFrequencies]]

which gives me a dataset that looks like this:

This is all ﬁne, but as you can ...

—————————-

[Dataset interferes with SeedRandom] http://mathematica.stackexchange.com/questions/136339/dataset-interferes-with-seedrandom

This seems like a pretty awful bug:

SeedRandom[1];
RandomInteger[10, 10]

Out: {1,4,0,7,0,0,8,6,0,4}

While:

SeedRandom[1];
Dataset[&lt;|a -&gt; 1, b -&gt; 2|&gt;];
RandomInteger[10, 10]

Out:  ...

—————————-

[Problem with integrating DiracDelta] http://mathematica.stackexchange.com/questions/136214/problem-with-integrating-diracdelta

I thought I had found a bug in Mathematica and reported it already in version 9, since it wasn’t ﬁxed in version 10 or 11 I reported it two more times but I never get any reply whatsoever so I’m ...

================================== 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?

—————————-

[How to create a fascinating QR code like this?] http://mathematica.stackexchange.com/questions/120041/how-to-create-a-fascinating-qr-code-like-this

Check the facinating QRCode in my proﬁle page here

You can ﬁnd that this QRCode is some sort of intriguing as the QRCode is a IMAGE ITSELF!!!

So my question is, how to create such a QRCode ...

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

[How to Approximate at Non-diﬀerentiable Point (forced Series Expansion around Branch Cut)] http://mathematica.stackexchange.com/questions/136395/how-to-approximate-at-non-differentiable-point-forced-series-expansion-around-b

I need a numerical approximation around some functions at $$x = 0^{-}$$ from the left side, where $$x = 0$$ is unfortunately the right end of the domain (in the reals) so the functions are not ...

—————————-

[3D reconstruction of a 2D SEM image] http://mathematica.stackexchange.com/questions/136284/3d-reconstruction-of-a-2d-sem-image

I am curious if Mathematica could do reconstruction of a 2D SEM image into a 3D. It is the same what can be done by MountainsMap SEM software http://www.digitalsurf.fr/en/mntsem.html

Visually it ...

—————————-

[Help needed in Understand the following program in solving a stiﬀ nonlinear diﬀerential equation] http://mathematica.stackexchange.com/questions/136607/help-needed-in-understand-the-following-program-in-solving-a-stiff-nonlinear-dif

I am trying to solve a particular Cauchy problem given by

I found from a particular paper that the solutions looks like

For the auxiliary conditions

For only speciﬁc values of $$a_{i}$$

I ...

- asked by kernel_panic (1 vote)

### 4.47 Tuesday, January 24, 2017

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

[My Girlfriend is going to prison...Save her with Math] http://mathematica.stackexchange.com/questions/135937/my-girlfriend-is-going-to-prison-save-her-with-math

Salacious title, but true story.

 dmethyl1 = {
{0, 0},
{.25, 1},
{.5, 7},
{1, 26},
{1.5, 40},
{2, 45},
{2.5, 45},
{3, 44},
{3.5, 44},
{4,  ...

—————————-

[How to use the iterator in Mathematica] http://mathematica.stackexchange.com/questions/135916/how-to-use-the-iterator-in-mathematica

I ﬁnd the Mathematica has the iterator data structure. We can build some iterators like this:

Constant iterator

GeneralUtilitiesConstantIterator[5]

Key value iterator

...

—————————-

[SquaresR memory leak?] http://mathematica.stackexchange.com/questions/135781/squaresr-memory-leak

I have tried the following code in Mathematica 11.0.1.0 on my MacBook:

### 4.50 Tuesday, January 3, 2017

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

[Why should I avoid the For loop in Mathematica?] http://mathematica.stackexchange.com/questions/134609/why-should-i-avoid-the-for-loop-in-mathematica

Some people advise against the use of For loops in Mathematica. Why? Should I heed this advice? What is wrong with For? What should I use instead?

—————————-

[Is there a style sheet that can be used to generate Stack Exchange input?] http://mathematica.stackexchange.com/questions/134518/is-there-a-style-sheet-that-can-be-used-to-generate-stack-exchange-input

It would be convenient if there were a style sheet that automatically indented input cells, and automatically commented output cells, so that one could generate a stack exchange response in WL, and ...

—————————-

[Function to create a path made of horizontal and vertical lines between a number of points] http://mathematica.stackexchange.com/questions/134424/function-to-create-a-path-made-of-horizontal-and-vertical-lines-between-a-number

I would like to create a function where I can deﬁne which case I want to use to create a path.

p1 = {40, 48}; p2 = {50, 116}; p3 = {63, 160};
listPurple = Symbol["p" &lt;&gt; ToString[#]] &amp; /@  ...

—————————-

[How to wrap a crumpled paper over a surface?] http://mathematica.stackexchange.com/questions/134514/how-to-wrap-a-crumpled-paper-over-a-surface

My initial question was about the making of a crumpled paper. After reading this article suggested by J.M. and little more browsing (kind of random walk you do on a Saturday) I thought about expanding ...

—————————-

[Would like input and output printed on same line, w/o needing extra syntax] http://mathematica.stackexchange.com/questions/134406/would-like-input-and-output-printed-on-same-line-w-o-needing-extra-syntax

SUMMARY

I’d like to get MMA to automatically print both input and output on the same line, in TraditionalForm, without having to add any extra syntax. Further, I’d like the output to be fully ...

—————————-

[Issue with Cell Frames in version 11] http://mathematica.stackexchange.com/questions/134665/issue-with-cell-frames-in-version-11

Since upgrading to version 11, all of my notebooks now have cell frames are either missing the top or bottom part. Is anyone else experiencing this? Is there a way to ﬁx this? Is this considered ...

—————————-

How to speed up this code? It’s unbelievably slow!!! My solution with pen and paper is faster.

Clear[R, h];
Integrate[
Integrate[
Integrate[1, {z, h, Sqrt[R^2 - x^2 - y^2]},
Assumptions -&gt;  ...

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

[Exporting graphics to PDF - huge ﬁle] http://mathematica.stackexchange.com/questions/1542/exporting-graphics-to-pdf-huge-file

I want to draw some basic surfaces, export them to PDF and include them in a LaTeX ﬁle. I create a simple 3D graphics object, for instance with

 ParametricPlot3D[{r Cos[θ], r Sin[θ], r^2}, {r, 0,  ...

—————————-

[Entering numbers in Scientiﬁc Notation?] http://mathematica.stackexchange.com/questions/36792/entering-numbers-in-scientific-notation

I need to play with a lot of powers such as 10^-3. 1E-3 does not work for it.
Is there any short form for it?

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

[How to specify halting states when using function TuringMachine?] http://mathematica.stackexchange.com/questions/134628/how-to-specify-halting-states-when-using-function-turingmachine

The function TuringMachine generates a list that represents the evolution of a Turing Machine given a rule that speciﬁes its behaviour (i.e. set of instructions).

For example, the following rule ...

—————————-

[Can I use Mathematica for the symbolic veriﬁcation of cases of a general problem?] http://mathematica.stackexchange.com/questions/134515/can-i-use-mathematica-for-the-symbolic-verification-of-cases-of-a-general-proble

I have never used Mathematica before, but I am contemplating using it to solve this problem for a simple case of $$f(x) = C, 1<x<2$$ and $$= 0$$ and $$= 0$$. I can easily get $$\hat {f}$$, the Fourier transform of ...

Style[Plot3D[Cos[x + 0*y], {x, -10, 10}, {y, -2, 42}, Mesh -&gt; None],
Antialiasing -&gt; True]