10,726 reputation
2046
bio website
location
age
visits member for 3 years, 2 months
seen 4 hours ago

1d
comment Package Function Confusion
I actually also think it is best to let the user provide the symbols which are used for x and y. The only reasonable alternative I know would be to use the special "formal" cahracters which are reserved for such purposes since version 9, they create symbols which are in the System context and protected. One can create them with shortcuts like Esc-$x-Esc or the special characters palette, but it probably is something which as to be explained to potential users of your function...
Mar
27
comment NDSolve in Mathematica won't use all the cores avaiable
So you think that the vectorized operations within test are responsible for the usage of several cores and the speedup? This could of course be, but honestly I could well imagine that it probably is just ode23tb which is fast and the parallelization doesn't actually contribute that much to matlab being faster than Mathematica for this. After all ode23tb is documented to be used "if using crude error tolerances to solve stiff systems." Trading speed for accuracy is of course the easiest way to solve fast -- and if the result is good enough there is nothing wrong with that...
Mar
27
comment NDSolve in Mathematica won't use all the cores avaiable
I think I have given an answer in another question of you which asks the exact same question: you can't expect that NDSolve makes use of your parallel kernels, period. If matlab has a solver which does that and solves the system you want to solve faster and to good accuracy, then you might be better off to use matlab for that task. On the other hand I'm not sure whether you are comparing apples and oranges as the two programs most probably use very different methods and probably won't give results with comparable accuracy.
Mar
20
comment Using packages with symbols that have the same name
yes, Mathematica lets you do a lot of things with namespaces and global/system symbols. It probably shouldn't allow all that but that's how things are, and I guess they'd be really hard to change. IMO code for others to use shouldn't make use of all these possibilities and if foreign code does stuff like modify system symbols or add symbols to "Global`" or other foreign contexts it probably makes sense to complain or avoid such code. Running parts of your code in a parallel kernel just to avoid shading problems seems an extreme kind of workaround, but might be justified if all else fails...
Mar
20
comment Using packages with symbols that have the same name
at least related seems this question of mine and all answers to it:
Mar
19
comment Do ShowGroupOpener and TitleGrouping suffice to control cell grouping?
its difficult to tell what goes wrong without seeing the full notebooks, but the group openers are only shown when there is something to open, that is at least one cell that belongs to the group which the cell would open/close. So I think the openers should appear as soon as you insert e.g. an empty text cell below those cells which don't show an opener...
Mar
17
comment SetSystemOptions in a package
I don't think it is a very good idea if a package globally changes system options on load -- after all it might make all other code that would run in that instance and uses the DataFunctions break. Also your code will break if someone resets the system options to their defaults....
Mar
15
comment Cursor Automatically Placed in InputField
what you want is called to "set the focus", if you search for that you'll find a possible duplicate: [mathematica.stackexchange.com/q/1454]?
Mar
11
comment Package autoloading not working in CDF and Player Pro
Have you seen this answer? I tried to summerize everything you'd need to load packages in Player Pro there, I don't think that things have considerably changed since then. The free CDF Player can not load packages, except if the CDF Player was specially signed, e.g. with an Enterprize License for Mathematica...
Mar
9
comment SQLite and Mathematica
From your question I guess you are somewhat disturbed from the fact that there are two completely independent ways to access SQLite from Mathematica, so maybe this answer is also of interest. One thing that I'd use with care in Mathematica strings is the backquotes: these do have special meanings in e.g. StringForm and similar functionality could potentially interfere with their use in SQL code, so I'd probably avoid them if not needed, I typically get along with single quotes in SQL...
Mar
9
comment SQLite and Mathematica
I think you won't need Needs["DatabaseLink`"] when you use the Database`* functions. These undocumented functions are completely unrelated to the DatabaseLink functionality AFAIK.
Mar
5
comment Delete rows from a dataset
I think your problem is that you are intermixing syntax for patterns and functions. DeleteCases expects a pattern, but you do provide (half of) a function (the other half is the missing &). You probably really should look into the documentation for DeleteCases, Select and Function to understand why and when a & is mandatory. On the other hand to delete from a Dataset you'd typically use the new Query syntax specifically made for them: d[Select[(#SrcClk=!=2107)&]], which you'll find in the documentation for Dataset...
Mar
4
comment Can CDF player (or player pro) run command line tools?
@RolfMertig: interesting hack :-). I mentioned it (for completeness) and added some other details...
Mar
3
comment Side effects in ParallelDo
if you want this to WORK you would need to use SetSharedVariables[A]. If you want it to be FAST you could try ParallelTable as george2079 has suggested. Honestly, I think that even that won't give you the desired speedup as the bottleneck for importing MX files is almost certainly disk access and probably memory allocation, which you should do in advance. For one conventional HD the parallel access will almost be a worst case scenario. So your best bet ist to either distribute the MX files among as many devices as you can or invest in fast storage hardware, e.g. an array of SSDs...
Mar
3
comment Export to JSON format specifically for MongoDB
have you tried ExportString[data, "JSON", "Compact" -> True]? It is the only documented option for "JSON" export format and seems to do what you want...
Feb
27
comment How can I overload a function with multiple bracket-slots so f[a][b] and f[a] can coexist?
@sacratus: just as an advice, I think you really should think about the last sentence in Leonids answer before building "prodution code" that relies on Stack...
Feb
25
comment FilterRules with pattern for name
+1, but you probably want to add the information that you can use SymbolName instead of ToString if you want to also match symbols from contexts currently not on $ContextPath, e.g. rules={test`linx->45} (in case one wants that...).
Feb
25
comment Defining functions when there are a lot of parameters
while one can do what you describe I hardly can believe it really is what you want. Doesn't Davids answer do exactly what you want? You probably should describe more clearly what your ultimate goal is...
Feb
25
comment ParallelTable and global variables
which version do you use? May it be that you have set CellContext to something different than "Global`"? Or are you evaluating the above from a Documentation notebook? I think with the default settings $Context==="Global`" and you shouldn't see the prefix in either case. Despite that I would suggest to not generate symbols on the fly with ToExpression as you do except for some very special cases. Doing that means asking for exactly the kind of problem you are facing...
Feb
23
comment Running PowerShell commands in Mathamatica
@Murta: I think the best solution for your actual problem would be to invest in your ssh client config. On a windows client using the putty/pageant combination does work best for me. You would just have to configure git so that it makes use of a ssh-client which asks peageant for the key. I have such a config working but use mercurial instead of git. But I can hardly imagine that git wouldn't let you configure it so that it can also be called from cmd.exe. You probably want to ask that on a git specific forum...