@Kuba In v8 I'm seeing a message because the Select returns {} and then once the documentation is opened, subsequent F1s behave normally. The notes section starts in its usual closed state.
@MichaelHale Forgive me for spam but please try: (but first close the docs)
Documentation`HelpLookup["Plot"];
test =
Select[Notebooks[], (("DocumentType" /. NotebookInformation[#]) ===
"Help") &][[1]];
@zab It's undocumented but it's not a must here. It's just faster than SelectionMove[.... You have to look for a topics here that contain it, for example: mathematica.stackexchange.com/a/41722/5478 . Experimental is a context so you may want to try Names["Experimental`*"]
Pause seems fine for that. Maybe on a slow/busy computer the first time a doc page is loaded it might take more than a second, but generally it should work. I do think the OP is exaggerating the impact of that design decision on his workflow. Nice work though.
What is the simplest / easiest / most efficient way to set the diagonal of a matrix to zero (or to a certain set of values)? I need to do this often and it still seems there should be an easier solution than the things I'm doing ...
Do[a[[i, i]] = 0, {i, Length[a]}] <- don't like it because it's procedural and changes the variable (instead ofg just returning a result)
a (1-IdentityMatrix@Length[a]) <- memory hungry, makes a big identity matrix for no reason
a - DiagonalMatrix@Diagonal[a] <- same as above
a - DiagonalMatrix@SparseArray@Diagonal[a] <- not sure if still memory hungry, but it's getting overly complicated at this point
@chuy Better, but I guess any non-destructive version of this will be quadratic unless the matrix rows are represented as linked lists, which you wouldn't want for most purposes.
Oops, the first code I posted should be to 6000 not 60,000.
I think I've never used those buttons. I always type * or numbers. I use bold, italic, code and quote a lot though (mostly through keyboard shortcuts).
@LeonidShifrin Looks good. :-) FInally I decided to just write it once and put it in a package where I keep some small functions I use often. The a - DiagonalMatrix@SparseArray@Diagonal[a] version seems faster and more memory efficient for large packed arrays. I should probably write a Compile solution for large packaged arrays.
This should be closed as the duplicate of the link I gave, not as a duplicate of "Common pitfalls..."
@VitaliyKaurov @Szabolcs Those are good when you start typing, not after you have a list as separate lines (because at that point, it's not clear if it is a list or a paragraph or a list of paragraphs). Press the button, you get 1. List item, start typing and then Shift + Enter, you get 2. List item :)