@halirutan hm I found out about Function too late. I suppose I learned about Attributes too late as well. Not saying that I disagree with you but it makes me sad to lose a soul :P
to be serious, I think this sort of thing is best left for when one has a good grasp of the mathematica evaluation sequence. otherwise it's too confusing and likely to lead to frustration
@halirutan That's tough. I'll have to try some things. One would have to put a Dynamic about Plot and then figure out how to isolate the different dynamic parts (x, y, other). Roughly speaking.
@MichaelE2 Yes, and I tried some things today but honestly, I can always find ways to break the toys examples which are not unlikely in real applications.
@MichaelE2 I'm almost utterly clueless with dynamic problems that I don't know if his problem is related to refresh/trackedsymbols/update interval/syncrhonous updating/etc.
@MichaelE2 But, and this is what bugs me, the long updating happens in the line y = timeConsuming[x, a]; only and there should be no way to restrict this only triggering when slider a moves..
@halirutan SynchronousUpdating can be passed to Dynamic, too. I don't understand how that works very well. I haven't ever used it (where it solved my problem). But perhaps, it can be used to make certain things not block the front end.
@MichaelE2 This is one of the next things. Have you tried turning SynchronousUpdating off in the Manipulate and turn it on in one of the nested Dynamic's? Doesn't work like I expect it.
@rm-rf Nope but the question is good.. clear explanation, minimal sample code, LaTeX used.. I can't imaging why it was down-voted.
@rm-rf Btw, do you know whether the SE team plans to fix the site for the Retina display?
@halirutan Yes, I tried something like that at first with the OP's plain DynamicModule example. It didn't work like I expected. I don't really understand SynchronousUpdating in Dynamic.
@halirutan From what I heard last, it will eventually be done, but it's not an easy project, as Jin has to redo every single detail for all the sites in high res. I believe that's the biggest bottleneck (for the devs, changing the code to handle it is a one time thing)
We have plans to update all the icons for SE sites to retina at some point. It will be a lengthy process. We're still deciding on which icons have higher priority. The obvious ones are the logo and voting arrows/favstar.
That's probably the only place where Jin has acknowledged this (and perhaps in our chat during the brainstorming days).
@MichaelE2 I fixed it for you. In future, when you paste a large block of code, you'll see a new button on the right that says "fixed font". Click that and hit send
However, note that you cannot mix it with anything else... i.e., you can't reply/quote/bold/italic/URL/etc. Everything is formatted as code
@halirutan You can still post if you want, but be prepared for silence/boiler plate response from SE :)
actually, it might be better if it is made a question, so that that probably puts some pressure/lets them know that there are people interested in this community too and not just on Ask Different
@halirutan Back in V6, I immediately saw lots of potential. I had done interactive programming for the NeXT making dynamic mathematical examples. So I read the four tutorials (two Dynamic, two Manipulate). Over and over.
@halirutan To tell the truth, I don't know exactly what's going on my answer to today's question. The front end apparently can preempt the kernel and demand to know what x or other is.
@halirutan Yes, and the way the expression x and other are updated but the whole list {Dynamic@x, y, Dynamic@other] is not. All while the kernel is computing timeConsuming.
@halirutan I think that explanation deserves to be in some answer somewhere. Maybe someone should construct a question answerable with it. It's very informative
@hhh so, NestWhileList starts by applying its first argument to its second (the zero). then it checks if the last argument, a function, applied to the result, is true. if it is, it again applies the first argument to the last result it got the first time. then it checks if the condition is true, then repeats, until it stops being true
@hhh it tells mathematica to only supply the last result to the comparison function Abs[#] < escapeRadius &. had it been 2, for example, it would have supplied the last two results to the function (which would need to be a function of two arguments in that case)
so here is what NestWhileList[# + 2 &, 0, # < 5 &] does: first, it puts 0 in the list. then it applies #^2 + c & to it, and adds the result to the end of the list. then it evaluates Abs[#] < escapeRadius & and, if it's true, and simultaneously less than maxItersiterations have been executed, it repeats, but now with the latest result instead of 0. and so on
@hhh yes exactly :)
that would stop the nesting when the abs of the sum of the last two results exceeds escapeRadius
@hhh if you meant to make c a function, the problem is that = has higher precedence than ;. so, you're saying: "assign .1+.1I to c, then evaluate the NestWhileList".
@rm-rf actually it looks like it's just about a particular equation in there (which seems pretty standard when evaluating one-loop corrections, if I remember my thesis correctly)
have seen many much worse the last few days... but it's not good :)
well, I asked what they tried so far. let's see.
(not to be a jerk, but someone who can't work that out probably is in over their head reading a paper)
but maybe they're learning by jumping in the deep end.
I'm not voting on this post because I cannot make head or tails of it, but my main issue with such questions is that it shifts the burden of solving it squarely on the answerer. And in cases like this, might also require someone with deep knowledge of the subject to be able to answer the question (or to at least know what not to read in the paper)
@rm-rf no it's just a d-dimensional integral, it's not about physics at all. but yes, it's basically "how do I do this integral"
it's better than the other one that gives a bunch of code, then asks why it doesn't work (and it is for solving a 4-level time-dependent problem in quantum dynamics). that's basically asking "why doesn't this work".
@rm-rf yes meritocracy would be nice, if it didn't have the disadvantage that "merit" ends up being shorthand for "perceived merit", which is as easily manipulatable as anything else.
so is the conclusion really that it is impossible to express cone in spherical coordinates if the radius is a function of traditional azimuth and zenith?
@halirutan It appears to me that the first update event is on the mouse-down. Then the kernel loses track of the changes in x while timeConsuming is running???
So that y is not reupdated after x stops changing
@halirutan If you drag x for more than a second y is updated (every sec.). But the last fraction of a second is lost.
But the kernel must be generating updates as x is dragged, so that the x in the output is updated. So at least an update for the last change in x has been generated. Because of SynchronousUpdating -> False, the last y update starts before the last x update but finishes after the last x update.
Therefore y is not updated again to sync with the last change in x. Sound plausible?
@halirutan A side-effect of SynchronousUpdating -> False.
@halirutan OK, I don't believe that's the whole story. But I'm going to bed. Good night.
@rm-rf Can you rename tags as a mod? There's the [speed] tag which I think should be changed to [performance-tuning]. There are already 18 questions which is too much to retag manually (it'd fill up the front page)
@Szabolcs Hmm... the performance-tuning tag says that it refers to either speed or memory or both. So if you tag it PT & speed, it is obvious what it means and likewise, for PT & memory
I don't think they should be explicit synonyms of each other
I guess some of them also need the PT tag. I agree that without an accompanying tag, it looks kind of silly... like functionsspeed, for instance.
An L-system or Lindenmayer system is a parallel rewriting system, namely a variant of a formal grammar, most famously used to model the growth processes of plant development, but also able to model the morphology of a variety of organisms. An L-system consists of an alphabet of symbols that can be used to make strings, a collection of production rules which expand each symbol into some larger string of symbols, an initial "axiom" string from which to begin construction, and a mechanism for translating the generated strings into geometric structures. L-systems can also be used to generat...
I have a int, Value with a random number.
So, I need display in a label, the percentage(0~100%), according to Value, ex:
if Value is 30 of 60, then the percentage should be 50% ... What formula should I use? I assume I'm breaking my brain for this silly thing.
@rm-rf yes, writing up stuff so I take any and all opportunities to procrastinate (and reading the news is out these days). also this sort of thing is a super-simplified version of what I am currently doing, research-wise.
@OleksandrR. it's interesting isn't it :)
@rm-rf @OleksandrR. is there any way to insert eqnarray environments in my answers?
@rm-rf I have emacs and sublime text so heavily customised for latex that I don't really think about this, I have shortcuts to insert environments and the like. This is not natural. I hate latex
@acl Pretty impressive that you've shifted fully... I really like it (I think it has great potential) but I can't, at the moment, justify shifting when I have to learn its json syntax in order to customize it the way I want it... I still fiddle with it though
@acl I don't use it, but I can if you want me to test something
@rm-rf I didn't customise it that much. snippets are easy and that's all I do (with emacs I customised it in elisp, the end result being that I need to maintain code I wrote years ago--no thanks)
@rm-rf hard to say, it is intermittent (once a day or so).
@rm-rf I prefer to do it in the workbench or sublime text (but workbench has no template completion, while in sublime text I hacked together something but it's not very good). so I oscillate between the three...
@acl I can imagine :) I have some like this too, but I use options for those, so that I don't need to remember the order of arguments. I just keep the most important ones (e.g., size of the matrix) as an argument and the rest as options
It's the difference between short-term lazy and long-term lazy... You settled for a local minimum, whereas I'm optimizing to achieve the global minimum :P