Rojo
Reputation
31,766
503/400 score
 Mar 6 comment Mimicking Console and Output Matlab/Rstudio-Style Environment in Mathematica? Perhaps you could check in your $DisplayFunction if your EvaluationNotebook matches your console notebook. Or add some option (CellEvaluationFunction?) to your notebook that wraps your code into a Block that changes the $DisplayFunction Feb 2 comment Evaluation of Alternatives I have been out of this for a while, but I don't think f[a, f[b, c]] actually matches f[a,b,c]. It evaluates to it, and then it matches it. If you do f[a,b,c]/.HoldPattern@f[a,f[b,c]]:>post you also don't get a match Feb 2 comment Entropy[…] doesn't calculate the entropy of a probability distribution? What does it do? @becko, it's just what the function does, estimate the entropy from samples. Like Mean or Variance. However, those 2 also do the proper symbolic thing when passed a distribution and Entropy doesn't. But you can do it by hand, e.g, entropy[dist_] := Expectation[-Log[PDF[dist, \[FormalX]]], \[FormalX] \[Distributed] dist] ? Nov 21 comment Is it possible to improve Mathematica's auto-completion feature? @Kuba I have no idea, too long ago, sorry Jul 1 comment Programming a recursive FFT with Mathematica @M.R. I just tried your code on Linux, 10.1, clean kernel, and it worked. Weird Jun 7 comment Is there a built-in equivalent to Python's enumerate? Thanks @Leonid, this will be useful! Perhaps now I can stop saving for a new PC with 32GB RAM and settle for 8 :) I've been playing around with Haskell lately and grown fond of it and its lazy data structures; glad to see some of that around here. In a related note, earlier I was counting, given a random permutation of Range@n, the distribution of the number of elements whose value coincides with their position. Had to stop at n=7 or 8 aprox due to RAM. Perhaps with this I could have gone a couple of nums higher Jun 6 comment Is there a built-in equivalent to Python's enumerate? Niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiice May 29 comment How can I effectively performance-profile Dynamics? @episanty I don't have the code fresh in my head, but, probably, I thought the following at the time. It's not important to lose state between kernel sessions. DynamicModule wouldn't be any use (on the contrary) if we are using a multi-cell and multi-notebook apprach, and the new cell isn't spawned from a button inside the containing DynamicModule such that InheritScope works. As it is right now, if changing Module to DynamicModule works (haven't tried it) I think its because of a leak and it shouldn't May 9 comment How do I access the parameters in Classify using Support Vector Machine as method? @chris I don't recall exactly, sorry. Hopefully, they will get documented Apr 24 comment Can this be written well, without loops? @JadeNB that was the spirit :) Feb 19 comment How do I find all the possible events that work with EventHandler? Now you can also look at the autocomplete list when you write CurrentValue[" and some starting letter Feb 13 comment Most efficient way of splitting a file into length-prefixed blocks @LeonidShifrin I had tested it without the last copy to remove the $Failed, but I doubt it makes a difference and if it did, it is easy to avoid. The chunk size dependence makse sense. Feb 11 comment Most efficient way of splitting a file into length-prefixed blocks @Mr.Wizard So far I am finding Haskell really interesting. My guess is you would like it, very terse. You don't even need brackets to call a function ;) Feb 11 comment Most efficient way of splitting a file into length-prefixed blocks No functional benefit, and not really a stylistic preference either. It is what came to mind first. I am not sure which I prefer. I think your last offer is my favourite Feb 11 comment Nested mapping of a function Are you certain that you want a neat version of the first construct? Honest question Feb 11 comment Most efficient way of splitting a file into length-prefixed blocks I thought of not answering because the OP asks for "most efficient". However, when I saw that a naive implementation worked x1.6 slower than a solution which is 200x faster than the OP's, I thought it might be useful anyway. Feb 9 comment How to split a Dataset into training and testing for machine learning? @TaliesinBeynon that's neat, thanks! Nice to see you back around Feb 8 comment Creating a TeXForm/TraditionalForm/etcForm - like function They include the PrintForms which include the BoxForms. I did some digging at the time. Thanks! I think the output forms are those heads that end up showing applied to the cell label such as in mmaOut[34]//InputForm. Try Unprotect@$OutputForms;AppendTo[\$OutputForms, la]; la[5] Feb 1 comment Why Mathematica chooses bracket for function arguments over parenthesis? @rm-rf A few days ago I did a rm * accidentally (I meant rm *.pdf) and lost about 15GB of stuff :) Jan 26 comment What's real analogue for FromDigits? What's the format of the input? If its a simple string, ToExpression or some Interpreter, or InternalStringToDouble`