6.13 Tuesday, October 6, 2015

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

[How to simplify writing LibraryLink code?]( http://mathematica.stackexchange.com/questions/96127/how-to-simplify-writing-librarylink-code)

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

- asked by Szabolcs (22 votes), answered by Szabolcs (20 votes)

—————————-

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

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

For simple objects this works:

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

- asked by Szabolcs (17 votes), answered by I_Mariusz (7 votes)

—————————-

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

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

Example:

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

- asked by Szabolcs (14 votes), answered by Simon Woods (5 votes)

—————————-

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

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

If[#[[1]] > 0, self[{#[[1]] - 1, #[[2]] #[[1]]}], Print[#[[2]]]] &[{6,  ...

- asked by MathematicaUser39386 (13 votes), answered by Leonid Shifrin (19 votes)

—————————-

[Circle with negative radius?]( http://mathematica.stackexchange.com/questions/96102/circle-with-negative-radius)

Why does this work:

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

But this doesn’t?

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

Telling me:

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

- asked by David (12 votes)

—————————-

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

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

- asked by bbgodfrey (10 votes), answered by Karsten 7. (5 votes)

—————————-

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

Bug introduced in 10.1 and fixed in 10.2

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

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

- asked by LLlAMnYP (9 votes), answered by LLlAMnYP (4 votes)

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

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

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

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

- asked by user2098 (16 votes), answered by Chris Degnen (18 votes)

—————————-

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

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

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

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

- asked by Mia (23 votes), answered by Sjoerd C. de Vries (27 votes)

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

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

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

- asked by qazwsx (3 votes)

—————————-

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

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

- asked by Marius Ladegard Meyer (3 votes)

—————————-

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

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

- asked by QuantumDot (4 votes)