Reputation
66,448
Next tag badge:
209/100 score
19/20 answers
Badges
6 195 287
Newest
 Nice Answer
Impact
~421k people reached

6h
comment How to create protected single-file stand-alone CDF applications
@PhilipMaymin I didn't check personally, but I've been told about this by a few people I think I can trust.
6h
comment How to create protected single-file stand-alone CDF applications
@Kuba Indeed, that's possible. This needs a robust built-in solution, I agree.
19h
comment How to create protected single-file stand-alone CDF applications
@Kuba True, but now that Locked is Locked, it's harder to use the tricks :). But yes, I agree. I actually mentioned it in my comment. And now that mx format is cross - platform, things are even better in this regard.
1d
comment How to create protected single-file stand-alone CDF applications
@RolfMertig Makes sense. I don't yet have much experience with this. You certainly know much more about this than me.
1d
comment How to create protected single-file stand-alone CDF applications
@ArielSepulveda Was your first reply to me or to Kuba?
1d
comment How to create protected single-file stand-alone CDF applications
@ArielSepulveda It is, since V10 (but still depends on bitness - 64 or 32 bits. But 32 bits can probably be ignored at this point). But even if you use older versions, I don't see a big problem here - you would just need to prepare several versions of the code for different platforms.
1d
comment memory management in Mathematica
Your best bet is to not use stateful code (variables and assignments), if that can be avoided (and in most cases it can) - then the memory will be claimed automatically by garbage collector. If you use mutable variables, localize them (with Module, for example, or in some cases Block), then those variables will also be cleared automatically at the end (except in a few pathological cases which you are unlikely to hit in practice).
1d
comment How to create protected single-file stand-alone CDF applications
You should be able to DumpSave your code with encryption. I can imagine that you could then store the resulting code inside your CDF as strings, and convert it to .mx files dynamically to then use Get on them, and then possibly delete them. That assumes that enterprise CDF allows you to write to some writable directory. I haven't done this, so don't know if such procedure works or not. The advantage of .mx files is that when they are loaded, this process does not go through the top-level evaluator, so there is no way that one could intercept the loading using Block etc.
2d
awarded  Nice Answer
May
19
comment What's the goal of the Macros` package?
+1. I would add to this that Lisp-style macros are not possible without introducing a separate "read-time", that is, a stage where code has been read (or is being read), but not yet executed, and where one could attach some hooks. In fact, my project on fine-grained modules was meant to provide such read-time (among other things), and I was particularly having in mind Lisp-style macro support. Hopefully, I will move that along some time soon.
May
16
awarded  Nice Answer
May
14
comment Computing large nested values
I tried 2*10^9, and it works just fine. The time to get the result seems to grow linearly with n. Since the computation is done with machine precision, I don't see any issues increasing n further, except the trivial one that it takes proportionally longer to compute.
May
14
comment Only `Break` from innermost loop
Another advantage of the method I proposed is that it won't be too hard to get it into Compile, if needed.
May
14
comment Only `Break` from innermost loop
@MariusLadegårdMeyer Indeed, it works, although it's not obvious at all that it should. I can well imagine an implementation of Do[body, iter1, ..., itern], which would satisfy all the Do specs but where this won't work. So, unless I am missing something, this means relying on hidden deatails or an implementation (which one also often does, but which is generally considered not to be a great practice).
May
14
revised Only `Break` from innermost loop
Corrected per MichaelE2 comment
May
14
comment Only `Break` from innermost loop
@MichaelE2 You are right, nicely spotted! Will edit.
May
14
answered Only `Break` from innermost loop
May
11
comment in the part assignment is not a symbol, create different matrices with a “Do” loop
I have made some suggestions in my answer to the linked question.
May
11
comment in the part assignment is not a symbol, create different matrices with a “Do” loop
The l.h.s. of your assignements, like Ma[1], are what usually is called indexed variables in Mathematica. You can't make part assignment to them, or any other expressions, other than symbols (atomic expressions with head Symbol, such as Ma). The reason for that is that Part, and particularly part assigment, is a lower-level operation than most. In most other operations, one can use indexed variables just like one would use Symbols. Have a look here.
May
8
comment Functions vs. patterns
@JacobAkkerboom Well, but this relies on a global variable. So, in my book this doesn't count, I think. Will revisit this later, right now this is just my first impression.