3.1.1 Top new questions this week

3.1.1.1 Optional throws error when called from a package. Workaround?
3.1.1.2 How to automatically have ContourLabels in middle of Contour lines if specific levels are not specified?
3.1.1.3 Generating assignments and transforming code inside Holding forms when generating code
3.1.1.4 Overlay vs Show for plots?
3.1.1.5 What should I learn from DSolve working better with a named constant than a number in this case?
3.1.1.6 W A or Mathematica for CountryData?
3.1.1.7 How to implement JoinTo efficiently?
3.1.1.1 Optional throws error when called from a package. Workaround?

http://mathematica.stackexchange.com/questions/103084/optional-throws-error-when-called-from-a-package-workaround

 
Bug introduced in 8.0 or earlier and persisting through 10.3 or later. 
 
Case number: 305932. 
 
 
 
In the front-end notebook (Mathematica 9.0 and 10.2): 
 
g[x: Optional[_,default]]:=x; 
 
 
has no problems,  ...
 

- asked by QuantumDot (10 votes), answered by jkuczm (11 votes)

3.1.1.2 How to automatically have ContourLabels in middle of Contour lines if specific levels are not specified?

http://mathematica.stackexchange.com/questions/103289/how-to-automatically-have-contourlabels-in-middle-of-contour-lines-if-specific-l

 
I looked at all the questions/answers relating to placement of ContourLabels but could not find an answer to this. Some of the answers before are based on user giving before-hand, the Contours levels  ...
 

- asked by Nasser (8 votes), answered by Jens (10 votes)

3.1.1.3 Generating assignments and transforming code inside Holding forms when generating code

http://mathematica.stackexchange.com/questions/103263/generating-assignments-and-transforming-code-inside-holding-forms-when-generatin

 
I have been playing with slightly above trivial code manipulations in Mathematica. I thought Mathematica would be great for this kind of work because of rule replacement and expression manipulation,  ...
 

- asked by Manuel Odendahl (7 votes), answered by Leonid Shifrin (9 votes)

3.1.1.4 Overlay vs Show for plots?

http://mathematica.stackexchange.com/questions/103073/overlay-vs-show-for-plots

 
I am trying to understand  the differences of Overlay and Show to combine two plots. A typical use case is to superpose a ListPlot of some data with a Plot of a curve to fit the data. 
 
The following  ...
 

- asked by becko (7 votes), answered by eldo (13 votes)

3.1.1.5 What should I learn from DSolve working better with a named constant than a number in this case?

http://mathematica.stackexchange.com/questions/103327/what-should-i-learn-from-dsolve-working-better-with-a-named-constant-than-a-numb

 
I have an equation 
$$\bigl(r''(\phi)r(\phi) - r'(\phi)^2\bigr)\bigl(b + r(\phi)\bigr) = r(\phi)\bigl(r'(\phi)^2 + r(\phi)^2\bigr)$$ 
Here $b$ and $r$ are lengths, and $\phi$ is an angle (in radians, so  ...
 

- asked by David Z (7 votes), answered by bbgodfrey (2 votes)

3.1.1.6 W A or Mathematica for CountryData?

http://mathematica.stackexchange.com/questions/103302/wa-or-mathematica-for-countrydata

 
Sometimes W|A gives you something ... 
 
WolframAlpha["electricity production of the United States in 2007", "Result"] 
 
 
 
 
... not available in the WDF 
 
CountryData["UnitedStates",  ...
 

- asked by Ronald Monson (7 votes), answered by Paco Jain (3 votes)

3.1.1.7 How to implement JoinTo efficiently?

http://mathematica.stackexchange.com/questions/103238/how-to-implement-jointo-efficiently

 
AppendTo is not efficient so I'm not quite sure of the best way to implement its analogue for joining (e.g. in python this would be extend function). So how can this be improved: 
 
ClearAll[JoinTo]; 
...
 

- asked by M.R. (7 votes), answered by eldo (0 votes)