@acl I think so, but that's just for styles(fonts,colors,text-size), not really layout, right? I want to make mathematica layouts that are similiar to html/css webpages.
@Szabolcs I never made measurements because I have a Linux and 3 OSX but they are not the same machine.
And I don't use something like Virtual Box.
@halirutan The bad thing is, that all other projects don't need and incremental parser which can do the job on-the-fly during writing. They all use some parser-generator :-(
@acl regarding this : I regret having answered. Should have just downvoted. Physicists and mathematicians just cannot talk about feynman integrals it seems ...
Once I had a program which ran much faster on Linux than on Windows. The funny thing was that the Windows executable ran much faster under Wine too ... Finally I figured out that the difference was due to the floor function. Which is strange because I didn't expect that to map to a system function. I thought gcc would generate direct code for it instead of making an actual function call ...
@acl yes, nice, but more of general interest in a way. I stop on that. Need to worry about post-processing Mathematica code ... (nasty, there should be an easier way to manipulate M-code).
@RolfMertig I find the complexities of Mathematica's evaluation sequence make it really painful (for me) to programmatically handle code. Lisp is (was) much easier in that
I've seen questions before such as "What is the best open-source equivalent for Mathematica?", but that specific question (and that line of inquiry in general) cares more about the computer algebra system and less about the core language and its unique and powerful features.
My interest in Mathe...
@acl: yes, though I work now on HoldComplete[] expression. The problem is interesting: translating a looooong Mathcad program: to be equally nice as Mathcad I use the FrontEnd: But, memoizing functions without arguments are hard to deal with in M, so automatically figuring out function arguments and post-process all is challenging (and I tried to it manually: no fun for 150 formulas ...)
Ah, the good old golden days of community led deletions 1, 2... we were all piranhas back then (of course, the thresholds were lower, so a lot more folks could participate)
I wrote a Mathematica parser in 300 lines of OCaml code under contract for Wolfram Research and found it to be quite easy because the grammar is clearly documented in their literature and any ambiguities are easily found by playing with Mathematica itself.
Back in 2004, we wrote a mini Mathematica implementation in OCaml in only four days. For fun, we decided to port this OCaml program to F#. Incredibly, porting just the lexer and parser from OCaml to F# has taken longer than it took us to write the entire original OCaml code! The reason is simply that OCaml has an incredibly powerful and mature suite of compiler tools for generating lexers and parsers whereas F# does not.
Sqrt is just there because I want to return some sort of number between 0 and 1, related to how close the orbit is to escaping, and Sqrt[s] looked better than just s
@hhh but I warn you, I cobbled that together. it's much harder to understand than it should be, because I built it up by fiddling with things. it's very opaque
@hhh so, it iterates up to maxIter, counting how many iterations it did. then outputs Sqrt[iters/maxiter]. If it's not escaped (ie we went up to maxIter and gave up), this will be 1. if it escapes, iters will be less than maxIter.
basically the shade of grey tells you how long that point takes to escape
(the Sqrt is for aesthetic purposes, I just fiddled until it looked nice)
@hhh maybe I'm not being of much help here. that code isn't well written at all. why don't you try your hand in writing it? you'll learn a lot by doing that (and can always ask for help here)
@hhh this is similar to Table[x*y, {x, 1, 10}, {y, 1, 10}], except that the output of Tablehere is a list of lists (or a 2d array) instead of just a list
@hhh in general, you can do something that x=5;y=2 which will "return" 2, and, after that, x will "contain" 5 while y will contain "2"
think of ; as suppressing output
@hhh well that's wrong syntax
@hhh break your problem down. first, understand what ; does (it separates expressions, and suppressed the output of the one before it, while that expression still gets evaluated)
@acl thank you, I finally understood the code -- could read it through and could understan d every point -- functional properties in Python helped a bit :)
Hey @acl, while you're at it, can you also write my paper and perhaps finish up the little that's left of my thesis work? :D I don't want to miss this opportunity...
Usually I only procrastinate what's mine and don't mind working on others' stuff instead... after all, why else would I be spending time here solving others' code blocks instead of fixing my own :D
everything moves along splendidly in the beginning of any project, when you're exploring ideas. then you start carefully implementing everything; a bit less exciting, but at least you get to see if the details really work. then you have to write it up. weeks of reading news, answering questions on mma.se, being verbally abused by collaborators etc
of course, writing a phd thesis is the mother of all writeups
when I tried to write mine up, I ended up starting an entirely new project instead, which grew into 2/3 of the thesis
I guess so; I've seen three other folks here accept that and get lazy — i.e., sign on thinking "ok, 6 mo. and I'm out", but end up staying for 2 yrs (and in the case of one, 5!), so I want to force myself out
although I do agree that it's probably a good move to go somewhere else, career-wise (ha, send me a mail for career advise--look at what I did, don't do it is a good summary)
@rm-rf OK sure, you just need to have some sort of self motivation. if you don't have that you're shafted anyway (in academia, and if you're doing this on merit).
@acl not bad per se, but we have to work with what we have and currently the SE software does not allow you to force users to use certain tags (I recall some requests along these lines on MSO in the past, and they've always declined it)
I have a set of 2D points in the square defined by {-1, -1} and {1, 1}. These points typically form compact groups. I need to break them into clusters in such a way that the rectangular bounding boxes of the clusters will not overlap. The bounding boxes are expanded by a pre-specified margin, ...
I am trying to understand a non-linear system of equations, and find their steady states and dynamics. I am noob to understanding Mathematica (I am using version 6, but I have access to the latest versions in the lab) and I wondered if some kind soul would be able to help me with some of the code...
Ah Heya @Szabolcs em, well, see my answer here :) http://mathematica.stackexchange.com/a/21801/4330
I thought that if you would be able to predict that a certain function call would be used a number of times in a row, you could save time on lookups of symbol of the function by using ReplaceRepeated. It seems that it is slower though :(
Suppose I have a list of 2D points and corresponding function values. What's a simple way to assemble them into a list of 3-tuples? Currently I use ArrayFlatten[{{points, List /@ values}}].
Ah well... maybe it's his daughter/wife winning a pie eating competition. There are a lot of folks that use their kids/SO's proud/silly moments as gravatars
@Verbeia Oh, just saw your comment... (I already dismissed the flag)
@Verbeia It's in this room anyway, so might as well clean it up (there wasn't anything directly related to the answer there... mostly just a conversation between Leonid and myslf)
Btw women can choose to sound quite aggressive and male if they want. Tis is an old example but a good one of someone playing with the "voice" of her writing. I can assure you she's not like that in real life. old.macedition.com/cb
@Verbeia Re: aggressive women - I can believe that, but that blogger is a different story. Here is the blog. The writer isn't aggressive, but there is something in his style that is very hard to associate with a woman mental state, for me at least
@LeonidShifrin re: the piece of code I showed, apparently what happens is that the MATLAB parser sees x*x' and "knows" that it should be Hermitian, so optimizes the product to end up with one. However, the key is that it needs to be a variable, whereas with squeeze(mat(...)), the final size of the resulting squeeze is not known at parsing, so it lets FP errors accumulate
since FP math is not necessarily associative, the result is not necessarily Hermitian
@rm-rf Man that just sucks! Parsing should be minimally coupled with semantics, if at all. But you know, I am not surprised. I once wrote a rather complete Matlab parser, and in the process I've had to go down a very weird and evil road...
@rm-rf I hasten to add that the credit for the parser mainly goes to some guys who published a rather comlplete grammar, already in the form of lex / yacc specification, and a long paper explaining it
@LeonidShifrin well, you can imagine my shock and horror (before I switched to using an intermediate variable and before I got a reply from support) when the eigenvalues I got were complex!
It all depends on the next person I work with... some are flexible (let you use what you want), whereas others are anal, which means you're stuck with FORTRAN 77 or Pascal :O
@rm-rf Well, I am quite happy in that respect now. I work with Tom Wickham-Jones, and he is one of the best programmers I personally know, and very flexible too.
@rm-rf But one of the reasons I left academia is that somehow I realized that the freedom I had there was in many ways an illusion. You can't do what you like there unless it happens to be currently fashionable, or you get no funding. You have to waste a lot of time for stuff which is not really worth it. You depend on lots of other people / infrastructure, etc etc
@Verbeia Maybe Mathematica is not more popular because it is not free? Or because it is not well enough documented (I mean the documentation is good, but not good enough for all the different user groups, like beginners, advanced programmers, hobbyists)? Or because it is so hard to learn well? Or because consultants don't get tenders with it?
@rm-rf Compared to that, in programming / software development I am definitely more busy, and have much more routine stuff to do, but in some ways I am more free. And, no one can stop you - you can go ahead and develop some crazy new stuff - you don't need anyone's approval. And really great hackers can put together amazing things just by themselves.
@LeonidShifrin I fully see what you mean and have been feeling that too... perhaps just not enough (or not yet). In any case, what I yearn for most these days is a 9-5 job :)
@rm-rf Well, also, you have time. I think what is really important if someone decides to switch is not how old one is by the time, but how much of that other road he made alone, since I believe that one makes the biggest progress solving hard problems by oneself. I wish I had another couple of years to spend on open source development in mma and otherwise, before starting to work professionally - would have made me a hell lot better programmer
@acl I have already "used"in my work C, Java, Matlab, R, and Mathematica :)
@acl Re: accurate assessment - which part did you refer to?
@LeonidShifrin the academia bit. It is hard (or rather painful) to do what you like unless it's currently fashionable. And you do depend on a lot of other people. In fact it seems to me that the opinion of other people is relatively more important than in any other area of life I'm familiar with.
@acl It is this realization, among with a few other things, which prompted me to quit. In a better world(or, perhaps, better time), I'd be working on quark confinement in QCD right now.
@acl I think it was. We've got tons of information noise in the recent years, and also, people somehow lost the long-term goals and understanding of why they came to this world, and what they want to accomplish. In the past, life was harder, simpler, less flashy, but more genuine.
@LeonidShifrin Perhaps but, in terms of the "scientific community", everything being driven by fashion and a few individuals, good at connecting themselves, controlling everything has always been the case.
About life in general, I am pretty sure you're right and it was simpler :)
@acl But it wasn't like that before! If we look at the structure of scientific community say in the late 20-s and early 30-s, it was much smaller, and from what I understand much more pragmatic, critical and to the point - but not driven by fashion in the modern meaning of the word
@acl I mean, some influential ideas and personal connections were always important, but the criteria to judge the research were much more real, at the end.
@acl The problem with academia these days is that you're pigeon holed into being someone who does X and X alone, and gets funding for X, goes to conferences in X, etc. Even if you have a stellar idea in Y, you can't get funding/pursue it unless you foot the bill yourself or team up with someone else in Y (and now why would they agree to that?)
@LeonidShifrin much smaller, yes. much more critical? I don't know. firstly, the 20s is an anomalous time (once you realize QM is the way to go, there's a huge open field of "easy" problems and it's obvious where to work). secondly, look at the 50s and 60s. almost totally dominated by a small group of people, or at least, the histories are (looking at papers, things are different)
@LeonidShifrin OK, this much is perhaps true
@rm-rf yes this is absolutely true.
doing work on many areas is actually against you, even if the work is good. If you don't specifically do that, you are simply being unprofessional.
@rm-rf Agree also, very true. And also very ironic, because I think we are at the stage where cross-displinary work and attempts to use already accumulated knowledge in novel ways have much more potential then further ultra-specialization and solving very specialized problems using very specialized scientific languages
@acl In partical physics at least, 50-s and 60-s were a time of confusion, although the efforts made there were what made the progress of the late 60-s and 70-s possible.
@acl But whatever was going on then, people didn't dare to come with anything like String Theory, and this was good.
@acl in 50-s and 60-s. It is much harder and needs more courage to bump your head against a wall of real problems than to retreat to nice and abstract universe and then pretend that you describe the reality
@LeonidShifrin Well, I never really found particle physics exciting so can't really tell. string theory seems to me particularly fanciful, but I do not know enough to have a serious opinion (not that it stops me)
anyway, courage is to be admired even if it doesn't work. the problem is that doing string theory doesn't require courage, it's not doing it that does, if I judge by acquaintances trying to not do ST
@acl I've had a lot of friends who went there, and we were discussing it a lot. I don't have a proper math background to be able to carefully evaluate it, but I just have a gut feeling that it grew very much out of proportion in terms of its importance relative to other fields / problems.
@acl "Scientific progress advances in units of courage, not intelligence."- P.A.M.Dirac
@acl Nature always picks some things out of larger pools. What matters is that there is a pool of people who value courage and try to be true to their inner feelings of what is a right thing to do
@acl Of course, freaking cool -- you applied the list with that operation, read it once but forgot it -- have do more like this operations to train it :)
@acl I can not, and so I quit science. But it is a personal thing, there are many people in academia currently who are doing great work and feel that they do what they have to (I am sure you are one of them) - I can only be happy for them.