10,331 reputation
1945
bio website
location
age
visits member for 3 years
seen 6 mins ago

43m
comment Selecting values over lists for discrete inputs in NDSolve
I think that t_?NumericQ should be the solution to your problem (it works for me). Why do you think it always returns False? It clearly does not for me. You have to do a ClearAll[Controller] before making the new definition, otherwise the old definition will be still used for non-numeric arguments. I would finally suggest to use function names starting with lower case letters for your own functions (e.g. controller instead of Controller), there is a danger of conflicts with system symbols otherwise...
1h
revised Mathematica 10 issue: working with Entities slows down recurrence equations
added note about CanonicalName
14h
comment Mathematica style guide?
@LeonidShifrin: and I really would love an equivalent to pythons import x as y, but I think we had that already discussed once somewhere...
21h
comment How in Mathematica, would I define a function that takes arguments much like one would in an object orientated language
I still find the title and text not fitting the actual content very well. I don't see anything that would qualify "object orientated" in that function definition. It would probably best fit the term "procedural" as it has a side effect which doesn't make it really fit "functional" as well. As it changes a global variable I wouldn't consider it a felicitous construct in any programming paradigm I've ever heard of...
1d
awarded  Generalist
Jan
23
comment Connect to SQLite database
+1: very good finding, I just checked that it is also available on Windows.
Jan
22
comment Using variables in function names
I don't remember what I was thinking when making that comment, but I think I wasn't really meaning to make that comment to your answer but rather to the question. What you suggest is IMHO the best alternative. The problems I described are to expected whenever one needs to make use of ToExpression and ToString and I am quite sure that I meant to put that comment somewhere else. In your approach I only see a potential performance penalty when accessing DownValues and SubValues to find all known definitions, but that might not be a problem at all if you don't have too many...
Jan
19
awarded  Yearling
Jan
17
comment How to do this in Parallel ? the correct way
@Mr.Wizard: I'm just talking about the OPs troubled code. Your code seems to be OK. I first was tricked to believe it had the same problem but it doesn't: the reason is that in your case ParallelMap sees the symbols d and s and can autodistribute them to the parallel kernels...
Jan
17
comment How to do this in Parallel ? the correct way
@Mr.Wizard: you can see what happens when you make the following additional definitions: total[data : {__?NumericQ}] := (Print[$KernelID]; data); myfun[data_, scale_] := (total[data]/scale)
Jan
17
comment How to do this in Parallel ? the correct way
to be precise the evaluation is partially done on the parallel kernels and partially on the master: the problem is that on the parallel kernels Total is called with an undefined symbol as argument (because automatic distribution can't be done as ParallelMap doesn't see symbols but only strings). With a symbol Total gives the error messages as shown and each kernel returns e.g. Total[kiwi]/skiwi, the partially evaluated result. On the master, there are definitions for kiwi and skiwi, so it now starts its own evaluation which will not give messages and return the expected results.
Jan
17
comment How to do this in Parallel ? the correct way
actually the Total::normal warning messages indicate just that (that's why I made that comment). It is of course a quite consealed message. I'm not sure whether we could expect Mathematica to do something smarter here, though...
Jan
16
comment How to programatically set options for a selected word?
behaviour is the same on Windows, at least for me: V8 and V10 do the right thing, V9 changes both words to bold...
Jan
16
comment How to do this in Parallel ? the correct way
it probably is worth mentioning that while you do get the expected result the code is not evaluated in the parallel kernels but on the master, which is most probably not what you intended. What happens is that the parallel kernels return the unevaluated expressions which then are evaluated on the master...
Jan
16
comment Kernel sometimes quit after second evaluation of ListVectorPlot
@Mr.Wizard: crashes with 10.0.0, 10.0.1 and 10.0.2 on Windows but works with 8.0.4 and 9.0.1 on Windows for me. For 10.0.1 there are additional error messages...
Jan
10
comment Change system options in package
While it might possible to create something which would do that packagewise I don't think it would be wise to do so. What I'd recommend is to just write a wrapper for the above code fragment and then define your functions using that wrapper like: f[x_]:=ignoreUnderflow[Exp[-x]] where ignoreUnderflow would be said wrapper. That would be straightforward to implement, easy to read/understand and save you almost completely from any redundancy without making your functions rely on some hidden obscure mechanisms...
Dec
30
comment Trying to Figure Out how to work with datasets & Classify[] and Predict[]
Or, making use of the new v10 functionalities (which will work surprisingly well for this example): beerdata = SemanticImport["https://s3.amazonaws.com/mirlitus/datos/beer.csv"] and then: data = ({"income", "age", "gender", "education"} -> "beer") /. Normal[beerdata]
Dec
24
comment Importing a large Excel file
I'm not sure whether it will be quicker in any case as there is also quite some overhead in the COM approach, especially I think copies of the data will be made which might lead to memory problems. I absolutely aggree that of the many possible ways to get the data every one has its strong and weak sides, it certainly depends very much on the use case which approach will turn out to be the best...
Dec
24
revised Importing a large Excel file
added note about DatabaseLink and ODBC excel driver
Dec
24
comment Importing a large Excel file
have you tried to directly get the data from excel through COM, probably in chunks to save memory? I'm just wondering whether that'd be faster (slower) or more (less) memory efficient and if so by how much. It would also avoid the intermediate file altogether for which writing and reading performance might depend a lot on the hardware (e.g. HD vs. SSD)...