3.13.1 Top new questions this week

3.13.1.1 Should I always be using Module in functions unless I explicitly want global variables?
3.13.1.2 Why this real integral yields imaginary results?
3.13.1.3 Would it be a good idea to use Failure and FailureQ in own code
3.13.1.4 Display grayscale image as 3d plot
3.13.1.5 Automatically draw ellipsoids around groups of select points
3.13.1.6 Enter colors directly into notebook?
3.13.1.7 Large Dataset query fails if column contains Missing
3.13.1.1 Should I always be using Module in functions unless I explicitly want global variables?

http://mathematica.stackexchange.com/questions/126877/should-i-always-be-using-module-in-functions-unless-i-explicitly-want-global-var

 
I define functions a ton. In the past, I've mostly just defined my functions like: 
 
myFunc[var1_]:=( 
var2=var1^2; 
Return@var2; 
) 
 
 
And I haven't run into too much trouble. If I wanted to be really  ...
 

- asked by YungHummmma (15 votes), answered by WReach (18 votes)

3.13.1.2 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  ...
 

- asked by Chong Wang (12 votes), answered by bbgodfrey (12 votes)

3.13.1.3 Would it be a good idea to use Failure and FailureQ in own code

http://mathematica.stackexchange.com/questions/126908/would-it-be-a-good-idea-to-use-failure-and-failureq-in-own-code

 
Since version 10 (at least 10.0.2 but I think 10.0.0) there is Failure and since version 10.2 there is also FailureQ. As often the documentation is somewhat vague and says "Failure is generated by  ...
 

- asked by Albert Retey (12 votes), answered by Leonid Shifrin (9 votes)

3.13.1.4 Display grayscale image as 3d plot

http://mathematica.stackexchange.com/questions/127210/display-grayscale-image-as-3d-plot

 
How to build 3d plot of grayscale image where x,y - pixel coordinates, z - pixel intensity? 
 
 
 
I tried ListPlot3D[ImageData[image]], but ImageData gives just intensities. I suppose a possible solution  ...
 

- asked by red1ynx (10 votes), answered by Kuba (11 votes)

3.13.1.5 Automatically draw ellipsoids around groups of select points

http://mathematica.stackexchange.com/questions/126899/automatically-draw-ellipsoids-around-groups-of-select-points

 
Suppose you have a ListPlot, and there are certain points you wish to emphasize belong to particular group. I would like to make a function that automatically draws an ellipsoid around a select group  ...
 

- asked by SumNeuron (10 votes), answered by Szabolcs (11 votes)

3.13.1.6 Enter colors directly into notebook?

http://mathematica.stackexchange.com/questions/127245/enter-colors-directly-into-notebook

 
In Mathematica notebook interface, you can evaluate: 
 
In[1]:= Black 
 
 
and you get a colored squared representing the color. Then I can copy and paste this color square and use it as input, like so: 
 
 
 
...
 

- asked by becko (9 votes), answered by WReach (10 votes)

3.13.1.7 Large Dataset query fails if column contains Missing

http://mathematica.stackexchange.com/questions/126851/large-dataset-query-fails-if-column-contains-missing

 
In version 11.0 (Win 8.1 Pro) a query on a large Dataset for a column that contains Missing fails most unceremoniously. 
 
With 
 
dsTest = AssociationThread[{"a", "b"}, 
If[Last@# == 10000,  ...
 

- asked by Edmund (9 votes), answered by JasonB (7 votes)