Reputation
49,954
Next tag badge:
247/100 score
19/20 answers
Badges
6 79 194
Newest
 Enlightened
Impact
~666k people reached

May
25
comment High-quality RegionPlot3D for logical combinations of predicates
@RahulNarain, thanks. I added a few words about how it works.
May
25
comment Reversing Autocorrect, aka how to find the word that was supposed to be there
Isn't this more of an autocorrect than an inverse autocorrect? If the message writer attempted to type "snort" but wrote "inort" and this was corrected to "inert", the problem is to get from "inert" to "snort".
May
24
comment High-quality RegionPlot3D for logical combinations of predicates
Nice idea. Not really thought this through, but if you use f = BooleanConvert[LogicalExpand[#], "ESOP"] & to convert the predicate to an exclusive sum of products, I think you should split the region into distinct parts which you can use your code on. e.g. Show @@ (myRegionPlot3D[#, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] & /@ f[1/4 <= x^2 + y^2 + z^2 <= 1 && (x <= 0 || y >= 0)])
May
24
comment Evaluation of m.v is blocked by applying MatrixForm. Why?
The documentation for MatrixForm is unfortunately a bit misleading. The statement that it "..."acts as a "wrapper", which affects printing, but not evaluation" implies that it is somehow transparent to the evaluator. As you have found, this is not actually the case. Like Subscript, MatrixForm is something you should reserve for pretty output formatting, but keep out of the internals of your code.
May
22
comment Simplifying Fourier transform of a complicated function
The OP is doing a symbolic Fourier transform with FourierTransform. CUDAFourier does a discrete numerical transform like Fourier.
May
21
comment Extract a list of all built-in functions used in a notebook
@Öskå, from Leonid I would expect 2 pages of code which would not only find the functions but also automatically write the documentation for you :-)
May
21
comment Extract a list of all built-in functions used in a notebook
@LaraJordan, ah okay. I only tested it with the simple example in the question.
May
21
comment Extract a list of all built-in functions used in a notebook
Nice. I forgot about Cells...
May
21
comment Get subgraphs: communities of graph g
FYI you can use the notation 1 <-> 2 for undirected edge.
May
21
comment A fast way to compare interval
Finally, I note that this solution relies on checking interval intersections only between adjacent list elements. So for example Tentative7[{{1, 10}, {2, 4}, {6, 8}}] returns {2} instead of {2, 3}. Is this the intended behaviour?
May
21
comment A fast way to compare interval
Secondly, your GIMQ function may be more succinctly written as GIMQ[{{a_, b_}, {c_, d_}}] := a <= c && b >= d
May
21
comment A fast way to compare interval
A couple of points - firstly please be aware that List is a terrible choice of variable name (as you used in LIP) because it is the symbol used by Mathematica as the head of lists. While it doesn't cause any problem here, it is generally good practice to avoid using built-in symbol names for your own variables.
May
21
comment A fast way to compare interval
I'm surprised you find Rasher's and my solutions so slow on a list of length 2000. For me they both take a fraction of a second. Perhaps your ListT is not a packed array. Try evaluating ListT = Developer`ToPackedArray[ListT]; and run the benchmarks again.
May
20
comment Building adjacency matrix from set data
In your example you have a unique symbol for each player and game. When you have thousands of players do you intend to use thousands of symbols? Does the actual data consist of hundreds of expressions like g1 = {p1, p3, p5} ?
May
19
comment How to do memoization together with evaluation of a complicated function
Oops, sorry, missed that. Maybe Function instead: (f[x_] := f[x] = #) &[test[x]]
May
19
comment How to do memoization together with evaluation of a complicated function
How about With[{t = test[x]}, f[x_] := f[x] = t]
May
19
comment A fast way to compare interval
It is still not clear. Please could you include what the result should be for your example ListT and check that the posted code actually generates that result.
May
19
comment How to optimize my code?
Is it necessary to use exact arithmetic? For example try using 20.0 as the radius. By the way you did not include a definition for coordinateList so your code does not run.
May
17
comment Exp is slower for some number ranges
It appears that Exp[I x] slows down for Abs[x] >= 512. The transition is clearer like this: w = ConstantArray[N[I], {5000000}]; t = Table[{n, Timing[Exp[n w]][[1]]}, {n, 510, 514, 0.1}]
May
15
comment How do you add options to a function that is being mapped?
I edited this answer slightly as I felt it was misleading to say that you need to use a pure function.