38,284 reputation
554157
bio website
location
age
visits member for 2 years, 4 months
seen 2 hours ago

Jun
12
comment Devising a sparse array rule
SparseArray[A -> 77] ?
Jun
11
comment Can I use Map here rather than Table?
Or Import[#1, {"Sheets", #2}] & ~MapThread~ {fileNames, sheetNames}
Jun
11
comment How would you efficiently implement BinListsBy?
@Mr.Wizard, this one?
Jun
11
comment Thread over uneven (ragged) expressions with full functionality?
@Rojo, thanks - good points.
Jun
10
comment Smooth 4D (3D + color) plot from discrete points
I think you missed the bit where you get from nf to colfun
Jun
10
comment State “i” goes to state “j”
@MarianadaCosta, the symbol | is a shorthand for Alternatives, so as Paxinum said, "1"|"4" is a pattern which matches either "1" or "4". You may have no use for this, but I thought it worth mentioning.
Jun
9
comment Thread over uneven (ragged) expressions with full functionality?
Thread2[{{1, 2, 3, 4, 5}, {6, 7, 8}}] gives a Thread::tdlen error.
Jun
8
comment Trying to plot the trajectory of a particle using its Lagrangian; the plot is wrong
Try using traj = ... instead of traj := ...
Jun
7
comment Can I change Legend text in a stylesheet?
@Mr.Wizard, I had a look but couldn't see where the explicit font setting was applied. I think it must be somewhere in MakeBoxes.
Jun
6
comment Pattern evaluation in nested function call
@Ramiro, yes they're global symbols. Sometimes it's very useful to use Module symbols like that, it's not necessarily a bad thing. You just have to wary of leaking memory if the Module is evaluated many times because it will create a new unique symbol each time. In this case it was more just that there was no need to use symbolic parameters in the Function when the numerical values were already known.
Jun
6
comment Can I change Legend text in a stylesheet?
For me the TemplateBox tag is a string, so I tried creating a named style for LineLegend. It turns out the legend will pick up the font size, weight and colour from the stylesheet but not the font family. Looking at the boxes, the Times font is explicitly specified in a StyleBox which overrides the style from the stylesheet :-( So I think you are right, I will have to set the LabelStyle option in the kernel.
Jun
4
comment Finding all sets of elements with two common elements in a large dataset
+1 Nice use of tags in Sow
Jun
4
comment Making a Mathematica package manager?
It might be better to follow halirutan's lead and make this a self-answered question (Q. Can we create a package manager? A. Yes we can...) with an associated chat room for discussions. As currently posed it's not clear what would constitute a "correct" answer and it risks being closed as primarily opinion based.
Jun
2
comment Partial zeta curlicues
You could use something like data = Transpose@{Re@#, Im@#} &@ Accumulate[Range[3000]^-(0.5 + 10000 I)]; to calculate the data
May
29
comment How do I save the values in a table?
If you want to create a table, don't use For. Use a function that creates a table, such as Table.
May
28
comment How can I speed up this code with multiple sum?
@user14634, I added some explanation.
May
27
comment Exhaustive examples of variable replacement due to nested scoping constructs
How about TagSet and UpSet
May
26
comment Generating $n$ random samples every time
+1 This must be the most efficient approach I think. You could write the output more succinctly as Differences@Join[{0}, slices, {n}]
May
26
comment Generating $n$ random samples every time
So you are trying to create a list of n random integers such that Total[list]==100 and Min[list]==1 ?
May
26
comment Generating $n$ random samples every time
This is very unclear. There is no $n$ in your code.