Reputation
Next tag badge:
605/400 score
77/80 answers
Badges
5 189 428
Newest
 Announcer
Impact
~921k people reached

59m
comment How to zero (or replace) the diagonal of a square matrix?
@ciao Thanks! I think this will be very hard to beat, but I'll wait until tomorrow with the accept. And I know the solution looks trivial, but I never thought of this specific one, and all the other (more obvious) ones have problems.
1h
comment How to zero (or replace) the diagonal of a square matrix?
@ciao Looks like it might be exactly the thing I need. Can you post it as an answer?
1h
comment How to zero (or replace) the diagonal of a square matrix?
This is a good start, so +1, but it fails on one count: if the array is packed, I'd need to explicitly check whether its type is real, integer or complex, and replace with 0., 0 or 0. + 0. I accordingly. Otherwise it unpacks.
2d
comment Creating “detached” plots
Here are some comments/suggestions: 1, WindowFrame -> "ThinFrame" has no title bar and its not closeable or movable on OS X. 2, 3D graphics can't easily be rotated without SphericalRegion -> True or RotationAction -> "Clip". 3, You could also set $DisplayFunction globally. (But non-plotting functions don't apply DisplayFunction without Show) 4, I really like DocumentNotebook instead of CreateDocument here because it doesn't pop out the window immediately but it does give a popout button. (@denfromufa)
Aug
27
comment Can I code a conditional jump between cells in a notebook?
Note that Mathematica doesn't depend on the notebook interface either, it can function without it. Programs can be (and are) written in plain text. Making a program dependent on notebook magic will make it impossible to transfer it to plain text (e.g. a package) and will make it difficult to transfer it between notebooks.
Aug
27
comment Can I code a conditional jump between cells in a notebook?
It can be done, but don't do it. If you want to make it accessible to your students, don't do it. Instead do what Patrick suggests. "Easy to do in Fortran, Python, etc but I'd like to do it in Mathematica - which is more accessible to my students." <- Python and Fortran don't have cells, and Python doesn't have goto. Do you mean a conditional, like if? If so, it works the same in Mathematica, just don't split it into multiple cells. Expressions cannot be split between cells.
Aug
27
comment Can I code a conditional jump between cells in a notebook?
I would not try to do this at the notebook level. You can define two functions, then call the appropriate one based on the condition. This is easier and more flexible than trying to evaluate a certain cell based on the condition. Also, it doesn't depend on one particular notebook and its structure.
Aug
27
comment Reading NIfTI-1 files
Well, I was wrong, it does read my files correctly. This looks to be a large package with some very complete bits. Implementing the NifTI importer must have taken quite a bit of time.
Aug
27
comment Reading NIfTI-1 files
@Sektor Sorry, no answer yet. I'm looking at Neurotica but it doesn't handle my files. I might end up doing it from scratch. Either way, I thought it would be a good idea to have a question on this.
Aug
27
comment How can I make a summary of all the commands of Mathematica?
It's a bit weird that WolframLanguageData downloads the whole dataset every time I use it, instead of caching it like some *data functions used to do.
Aug
26
comment How can I evaluate untrusted Mathematica code in a sandbox?
You could also run it on Linux in VirtualBox (free). It might be overkill though. Also relevant: stackoverflow.com/questions/4249063/…
Aug
26
comment How can I evaluate untrusted Mathematica code in a sandbox?
I wonder if the security features the CDF player uses can be enabled in any way. There's more than these functions that can be used for harm, though I don't know which ones of those use one of these internally.
Aug
26
comment GraphDistance gives incorrect result in weighted multigraph
I think this is directly related: mathematica.stackexchange.com/questions/92014/… I do think that multigraphs are near-unusable un Mathematica and should not have been introduced in this state. It is in everyone's interest to have these bugs fixed. But for that to happen, you need to talk to Wolfram. I voted to close this post because it is clearly not a question but a complaint and thus unsuitable for this site. I suggest rephrasing it as a question to prevent closing.
Aug
26
comment GraphDistance gives incorrect result in weighted multigraph
If you want this fixed, please report it to Wolfram. This website is not affiliated with Wolfram. They might not notice that you complained about this here. This website is not for complaints, it's for questions. If they do notice, and they do create a bug report, it might not receive the same weight as if you had reported it yourself.
Aug
21
comment How to write crash-robust code?
You have Mma 10.3?
Aug
21
comment Why does this LibraryLink example of LinkObject based passing not work? Bug or user error?
It seems with Interface Version 3 it's also an int, but MLCheckFunction (deprecated in 4) has a long.
Aug
21
comment Why does this LibraryLink example of LinkObject based passing not work? Bug or user error?
4 minutes apart :)
Aug
21
comment How to auto-run user-interface in Player Pro
This of course won't work with GUIKit, but you can have a normal button in the notebook which will launch the GUIKit UI. I don't know if there are other ways. I don't have and have never used Player Pro, so this is based on plain Mathematica experience.
Aug
21
comment How to auto-run user-interface in Player Pro
I can't comment on what is more robust, but I think I do know the solution for Dynamic GUIs (untested): instead of evaluating CreateDialog, which creates a dialog notebook, just make the dialog notebook the notebook that the user will open. The point is that the dialog itself is a notebook. You can have a DynamicModule within which can have an Initialization :> ... option for any setup. But the GUI (at least the part that shows first) doesn't need to be created by evaluating something. It's just saved in the notebook.
Aug
21
comment How to auto-run user-interface in Player Pro
Do you really need to use the old GUIKit, or can you use the newer UI construction methods?