58,147 reputation
6165258
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 38
visits member for 2 years, 8 months
seen 2 hours ago

Ok, an obligatory note: opinions expressed here are mine and not those of my employer.


Sep
9
comment Replacing matrix values
@SimonWoods Somehow I seemed to recall that Infinity might unpack, so didn't use it. Perhaps, I was wrong - I didn't test it this time.
Sep
9
answered Replacing matrix values
Sep
6
comment How to speed up band matrix-matrix multiplication?
+1. Nice to see you back!
Aug
31
awarded  Enlightened
Aug
31
awarded  Nice Answer
Aug
28
comment How to reduce the InterpolatingFunction building overhead?
@n3rd This may be due to the top-level overhead of Table, and the list in the example is pretty small. For large lists, it should be pretty fast - this is a rather basic code compiled directly to C. It may be that Matlab uses some different and highly-optimized method though.
Aug
27
awarded  Nice Answer
Aug
26
answered UnFlatten an array into a ragged matrix
Aug
18
comment Programmatic formatting for Mathematica code - possible?
@Silvia Sounds good! By now I am fully convinced that such an IDE is possible, realistic, and is a good idea. I have been using some core parts of it to structure my work for almost a year now. The hardest problems are to get the design right on all levels, and to accumulate some critical mass of the functionality that, working together, can support really simple but powerful workflows. Doing this is a lot of work, and of a kind that needs continuous chunks of free time. Right now I feel I am very close to that critical mass.
Aug
18
awarded  Good Answer
Aug
17
comment Programmatic formatting for Mathematica code - possible?
@Silvia .. then it will make it less convenient. Generally, I am working on a full-fledged FE-based IDE, and I have made some good advances recently. The main idea is to make notebook-based approach scalable for large code bases, by providing convenient navigation etc in the notebook environment. Very soon I will have a version for "alpha-testing". If you'd like to test it, I will send you a copy (I intend this to be MIT-licensed). We could perhaps join forces at some point, as you seem to be interested in the same sort of things.
Aug
17
comment Programmatic formatting for Mathematica code - possible?
@Silvia Having on-the fly formatter is a different story though, it may have its own issues to solve. I didn't think about it yer, although I agree that it would be nice. Re: code folding - I also did experiments similar to things I see on the screen shot. I did rather many of such. The final conclusion I came to is that dressing editable code with such constructs will generally make it too fragile to be always sure that what you execute is what you meant. In other words, the robust way to do this would then be to distinguish "read-only" code (which can be foldable), from editable code. But ..
Aug
17
comment Programmatic formatting for Mathematica code - possible?
@Silvia Re: speed of formatter - the formatter is deeply recursive, and that recursion is rather non-trivial. It basically makes several passes through the code. I think, the main slowness is due to the fact that the transformations related to tabification are non-trivial. We should think of them more like compilation. You can look at the output after the tabify / format, but before preformat, for some longer pieces of code, and chances are that you'll see rather large expressions. That said, it may well be that the formatter can be seriously optimized - I just didn't look into it.
Aug
15
comment Programmatic formatting for Mathematica code - possible?
@Silvia Thanks a lot, I do appreciate! Re: recursive - in my experience, recursion in such problems is the most clean, flexible and powerful method. The speed has not been too critical for me so far, and even when it is, I am not at all sure that the bottleneck is due to the use of recursion. You might succeed in using rule replacements (ReplaceAll and ReplaceRepeated) instead, but in my experience they are inferior for harder problems, particularly those which are naturally recursive (like the case at hand).
Aug
9
comment How to make use of Associations?
Re: like dictionaries - to me, some of the more valuable parts of assocs are immutability and transparency on several levels of depth. The former allows to do things not easily possible otherwise (real fp on assocs), and the latter often saves a lot of boilerplate code and reduces complexity. Re: not garbage-collected - I'd think so. I did not do extensive tests, but since you return it from Module as a part of another expression, I'd think you will need to take care of its destruction yourself. If I am wrong, all the better! I will check this soon.
Aug
8
comment How to make use of Associations?
@rm-rf In general, I can tell that the addition of Associations made the language much more powerful, as far as I am concerned, particularly together with operator forms (for which we should thank a number of folks, Tali and Daniel in particular). I can already see that my code patterns have transformed and evolved significantly, to the extent that removing Assocations from the language now would make me feel helpless. One clear sign of importance of a given feature is that it not just simplifies some tasks, but change the ways you think and use the language, which is the case for me here.
Aug
8
comment How to make use of Associations?
@rm-rf A very nice and inventive application, of course you've got my vote. It is somewhat similar in spirit to the trick I am using above in my third version of the object implementation, but in your case it serves a somewhat different purpose. You probably still have to manage the Module-generated symbol, but the complexity reduction from managing complex structure to just a single symbol is quite significant. I can't make immediate examples, but this way of thinking is surely worth exploring much more. One may try to use Associations for novel ways to construct general data structures.
Aug
3
comment Why does list assignment with a packed array result in unpacked values?
@Mr.Wizard Well, I think this was kind of easy to guess, since the pattern matcher has no way to not unpack for this particular rule.
Jul
29
comment Benefit of using Dataset to collect SQLSelect output
It has been discussed in chat several times, around the date of the release, that Dataset currently is optimized to work with hierarchical data, rather than tabular. There are plans to add SQL-like backend(s) to Dataset, which will enable efficient manipulation of tabular data, but those will likely not be based on Associations in the same manner as Dataset is (namely, one Association per row in a db).
Jul
29
awarded  Critic