55,857 reputation
5157249
bio website mathprogramming-intro.org
location St. Petersburg, Russia
age 37
visits member for 2 years, 6 months
seen 1 hour ago

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


1h
comment How do you set attributes on SubValues?
@Mr.Wizard Sorry, I don't. Will look into that later.
2h
comment How to prevent notebook from moving/reshuffling code around while one is typing?
Ok, sorry, I didn't notice that you mentioned that.
2h
comment How do you set attributes on SubValues?
@Mr.Wizard Interesting. But I can't look into it now alas, am off for today. Perhaps you could edit your suggestion in? I will try not to forget to have a look at it tomorrow.
13h
comment How to make use of Associations?
@TedErsek Perhaps I should later add some simple examples to this post, to illustrate those things I mention (immutability, etc). The problem is that the post is already pretty long.
15h
comment How to make use of Associations?
@TedErsek I don't have any formal CS training either (I wish I had though, that would've been very useful for me now). My background has been Theoretical Physics, I switched to programming relatively recently. But the things you mentioned are not as bad or hard as they sound. Anyone with the familiarity of a few languages, like say C, Java and Mathematica, would be able to learn about these things relatively quickly.
1d
awarded  Good Answer
1d
comment Is the use of Block to temporarily override definitions inherently unsafe?
Ok, if you say so. Will vote to close then.
1d
comment Is the use of Block to temporarily override definitions inherently unsafe?
This question might be relevant.
1d
comment Swap elements in list without copy
@m_goldberg Thanks for spotting this. Actually, I first posted the comment, then tested and found those error, but got distracted and forgot to paste the correct version.
1d
comment Is Wolfram Language suitable for building web applications?
While the new release has some nice web-app related functionality (particularly when used together with the cloud), it does not IMO qualify as a good general platform for web-development, for a number of reasons. The web - related functionality in M10 is supposed to greatly simplify the process of using WL / Mathematica to do some computations possibly needed by web apps, but this is not a substitute for the standard web stack. Your best bet would be IMO to learn some web framework / language to build the core web app infrastructure, and use M10 / WPL to call WL functionality from there.
1d
comment Swap elements in list without copy
You can use swap = Function[{list,i,j},list[[{j,i}}]] = list[[i,j]],HoldFirst]. Example: lst = Range[10]; swap[lst, 3, 7];lst
2d
comment How to make use of Associations?
@YiWang Insertion time is fast when you don't care where to insert, or insert at the beginning or at the end. I did not benchmark what happens when you insert somewhere in the middle. Besides, in linked lists you usually have some control over the "current position", and I don't see how to do this with Associations. But this has to be investigated further.
Jul
10
comment Why is Return not forcing an exit from my function?
While I agree in general about the undocumented functionality, I think that in this particular case the use of Return with a second argument is a better solution. It is very unlikely that this feature will be discontinued, AFAICT.
Jul
10
revised How to make use of Associations?
Added a section on structs
Jul
10
awarded  Nice Answer
Jul
10
comment How to make use of Associations?
@MikeHoneychurch Totally agree, Associations are very powerful. I'll add some more stuff to this post soon.
Jul
10
revised How to make use of Associations?
Edited in Tali's comments / suggestions. Added a note on Dataset
Jul
10
comment How to make use of Associations?
@TaliesinBeynon Thanks, Tali, well spotted! I will edit your versions in, and correct my comment. Great to see you here, finally :)
Jul
10
comment How to make use of Associations?
Someone upvoted after a few seconds of this being posted. Either this is a new speed record in reading, or some people have too much trust in me :)
Jul
10
answered How to make use of Associations?