Reputation
12,361
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
20 49
Newest
 Nice Answer
Impact
~108k people reached

1d
comment Deleting a line from a file
for that application I would strongly suggest to only delete after writing. If your job terminates/crashes during "backup" all efforts will be lost. So if your quota allows two copies, it would make much more sense to write first and only delete when writing has succesfully finished...
1d
comment Graphics3D artifact in Mathematica 10.1 64bit Home Edition - Windows 7?
I don't get those extra lines with 10.1 on Windows 7, both 64bit. So I think it is not a general problem with that version on Windows 7...
Jun
29
comment How to make async functions?
isn't your description of what you want more or less in contradiction with the async in the questions title? Please elaborate what you try to achieve, probably giving an example to play with...
Jun
29
comment Problem with NDSolve: derivative interpreted as square
@jon: the only answer so far suggested that this might be a formatting issue. It can happen in rare cases (e.g. by accidentially using some unknown keyboard shortcuts) that some of the formatting gets into a state where it is difficult to understand what happens. Could you select the cell which contains the equations and then choose the menu entry Cell -> Show Expression? This will show the plain box expression in the FrontEnd. If you would copy that and put it here as code we could probably understand what has happened...
Jun
26
comment Convert spreadsheet (Excel) to *.csv during import
I've seen you have accepted my answer. Would you mind to let us know what you ended up to do and if that worked? I think this kind of feedback is what makes the site valuable and keeps people motivitated to answer questions. It is also encouraged to answer own questions in such cases describing in more detail what you did. My answer is kind of vague and probably only of limited value, so I would even be happy if you'd accept your own answer instead of mine :-)
Jun
26
comment Convert spreadsheet (Excel) to *.csv during import
@SjoerdC.deVries: I added that link to my answer, thanks for the hint, I was too lazy to do the obvious and search this site...
Jun
26
comment Manipulate code crashes V10.1
it doesn't crash for me (10.1 on Windows 7), but it does continuously update as Aloghi mentioned. I think chances are good that this will not crash if you avoid that continuous updating. That can easily be achieved by extracting the body into a function which only has the actual parameters as arguments and use that instead: Manipulate[calculate[ts,f, Z0, RL,T],...]. If you need this inclosed in the Manipulate use SaveDefinitions. Would you let us know if that solves your problem?
Jun
25
comment What is the role of the pattern object in this implementation?
@abrentonc: Mathematica is at its core a symbolic system, so it will evaluate a function for non-numeric arguments, e.g. f[x_]:=x^3;y=.;f[y]. If you call something like NDSolve which only handle those parameters as numeric input, then you have to restrict the function pattern to numeric parameters.
Jun
25
comment Disabling a Button
if the data is just numeric values I think either would work well. I guess that csv is probably somewhat faster to load (importing excel has somewhat more overhead, especially for the first import in a session)...
Jun
25
comment Disabling a Button
@user38498: Ah, ok then the question makes more sense: xls/xlsx vs. csv. I don't think it is easy to give general advice for xls/xlsx vs. csv. I think both can be imported reasonably well in Mathematica, at least for "standard" content, that is not very large, only numbers and strings etc. It should be easy to test whether your data can be imported in either format and how long that tests...
Jun
25
comment Disabling a Button
my comment wasn't meant as critizism: when I saw your answer I just was seeing advantages (concerning robustness and flexibility) if one would not restict the check to an exact match of the initial value as I did. Of course your solution also has the advantage fo being shorter, but I wouldn't trade that for robustness. Concerning that I noticed that you'd actually need something like TrueQ@Quiet@DirectoryQ@DirectoryName[b1] as DirectoryQ doesn't comply with the usual *Q function conventions as it gives a message and returns unevaluated in certain cases...
Jun
25
comment Disabling a Button
but that would start disabled if b1 happend to have a value, for whatever reason. To be more robust one could test for something like: StringQ[b1]&&DirectoryQ[DirectoryName[b1]], which would also keep the button enabled if the user cancelles the file choose dialog. I think the most robust solution would be to use that test and still initialize with something well defined :-).
Jun
25
comment Disabling a Button
@user38498: I don't understand how an .exe (typically an executable program) and a .csv (comma separated values file format for tabular data) could replace one another? An executable can be used to do part of calculations outside of Mathematica, but .csv could only be used to store and load data you need for your calculation or generate with it. What is it that you want to do?
Jun
24
comment Wolfram Script Not Completing when ran as cron job
so if you throw away the sudo it works even with UseFrontEnd? Interesting but good to known. As for the answer: it is welcomed to self-answer on this site in cases like that, I'm happy if you do that.
Jun
20
comment Wolfram Script Not Completing when ran as cron job
I think it could also be good enough to unset the $DISPLAY environment variable, but I have no possibility to test that at the moment...
Jun
20
comment Wolfram Script Not Completing when ran as cron job
I was thinking about a real text console (what you typically get when pressing Ctrl-Alt-F1 on linux), not an emulation which runs as a window in a graphical environment. The point is that there you want no X server running that the script could access. When running from LXTerminal (or any other terminal emulation which is an X client) an X server be available. (note that you should add a @AlbertRetey when writing a comment to be addressed to me, otherwise I will not see it, see the small help link right to the comment field...)
Jun
19
comment Dynamic does not update when wrapped in DynamicModule
No, Block and With won't help or work for these. You can make the symbols used as function names local to DynamicModule, the code in the Initialization option is also having access to the local variables. Doing that seems to work alright, but I'm not sure if I can forsee all the consequences that would have, though. An alternative would be to put them in an own namespace (Context), e.g. one which is unique to the cell in which that DynamicModule lives...
Jun
19
comment Wolfram Script Not Completing when ran as cron job
you might want to test your script directly on a text console to see/verify that the missing X access really is why Export doesn't work...
Jun
19
comment Wolfram Script Not Completing when ran as cron job
have you tried running your script on the console as root or with sudo? Setting up a cron job to be started as user pi and then use sudo in the command seems a bit odd, is there a good reason why you do that? Other than that, for UserFrontEnd to work I think you would need to make available an X server to the cron job (at least thats what you have to do for webMathematica), see documentation here but that seems a little overdressed for your use case...
Jun
19
comment How can I use NDSolve with a variable parameter?
@belisarius: I could verify that error message with version 9. Seems to be a bug which is corrected in at least 10.0.2 and also 10.1.0 (I haven't checked whether the result is numerically correct, though). I will probably add a note about that.