@Szabolcs well, then you'll be even more surprised when you get to 10k on SO :)
I personally think that if the answerer feels that it is a duplicate (or almost close to being a dupe), even if unintentional, it's better to delete than leave as is
Also, if the delta improvement in the answer would have a better impact if it were made to the other person's answer (perhaps due to more visibility/votes/ etc), I'd prefer that...some users do that meticulously
I personally also favour a single answer with a couple of different options rather than one answer for each little bit (unless if it is significantly different/equally long)... like it or not, all of these are the improvements of SO over traditional forums, which (I think) we've all come to like...
does anybody know of anywhere I can look up benchmark results for different computers? I am interested mainly in the built-in benchmark (on different processors, mainly)
Do you think it is a reasonable topic for a question here? We could maintain a single answer with all the results tallied, so it would not constitute an open-ended discussion.
I don't know. it would be useful, in the sense that it could be kept up to date as mma versions change, while simultaneously keeping older results visible for those not interested in newer versions.
but I don't know what the community here would think. perhaps I could ask it on meta
(as an aside, @MrW, turns out I didn't know where Oregon was--fixed now, courtesy of wikipedia)
as an aside, I just ran a numerical integration of a stochastic differential equation in mathstudio (mathstudio.net) in an old iphone that someone gave me for free. it seems to be slightly slower than the same integration done in mma v5 on an old laptop that I did for my phd (which I ran on a laptop someone had again given me at the time as "too old"--I wrote my phd on that thing!). of course the mma code is, now that I look back, atrocious, but...
and this was in 2005. OK it was underpowered even at the time, but still
comparing my macbook air to my office workstation (4-core Xeon) is also amusing. each core on the mba is faster than a core on the workstation. progress is great
...and yeah, considering that the Atom is quite underpowered compared to the current crop of high-performance processors, it's boggling to think how much faster my old code would probably run on those multicore beasts...
and of course the aforementioned ancient laptop used to overheat too. so I'd leave it computing overnight, upside down and with a pan containing something frozen sitting on it to cool it down
I couldn't resist. For the max value question, I submitted an answer involving Reap and Sow. I don't know how it compares, speedwise, but I imagine it's a contender.
Introduction
I have no deep knowledge of all of this, but there were times when I wrote a cweb plugin for Idea to have my code highlighted there. In an IDE all this is not a one step process. It is divided into several steps and each step has more highlighting-abilities. Let me explain this a bi...
Right, the other option was bold-face and black for defined symbols, which was downvoted by Szabolsz and Tim when I remember right. Keywords are blue in the Workbench and in all other language extensions too, so I guess we should try to like it.
@halirutan I'd never noticed that the workbench also colours mma keywords blue...
@rcollyer don't think it matters any more, everything is fast enough. i went for the macbook air even though it only has 4GB RAM because it's tiny (the 11" model that is)
@acl Impressed. My c++ code for my project is estimated to take about that. Only one machine publicly available on campus has anything like that much ram.
Ok, I'm out for tonight. When anyone finds strange coloring or errors in the highlighter, it would be really nice to leave a note with @halirutan either in this chat or here: meta.mathematica.stackexchange.com/q/118/187
@rcollyer My opinion as new-comer: The time until you have an answer here is very short. We have a bunch of highly motivated experts around. The interface for writing posts is awsome. I like it a lot more than MathGroup where I have to wait one or two days. I think chances are good.
@acl That's very true. I got to the point yesterday where I realized I couldn't get any farther (at that moment) on the part I was working on, so I went on to another. Kinda freeing. But, still got a ways to go for Wednesday.
I do not mean to single any body out here, but both FindInstance and Exists have their own tags, findinstance and exists, respectively. This brings up the question of what circumstances are necessary for a function to have its own tag? I can think of two potential criteria:
the function is like...
@celtschk Please check whether there are synonyms before creating a new tag wiki. We already have parallel, so the existing parallel-processing question should probably be retagged
I'm going ahead and removing remote-kernel because there is only a single question tagged remote-kernel that is not also tagged -remote-access. @yoda @rcollyer what do you think?
Click here to install and test @halirutan's syntax highlighter on Mma.SE. With Firefox, you need to install Greasemonkey first, with Chrome it works out of the box. Please test, this will eventually become part of the site! Problem reports go here.
@Szabolcs I'm asking at this very moment at javascript.SO whether it is a good idea to compile the regex for the keywords. I don't know whether this makes sense since I believe the google-prettify script is loaded everytime from the beginning. A compiled regex would only speed things up when it would be used several times in compiled state. But maybe the script stays loaded on the server.. I have no idea.
@halirutan I pinned a new message with a bit more instructions on how to install. I hope more people will test it this way. Must update the meta post where we can collect bug reports because now we are focusing on your script (can you edit it?)
This is a collectively edited collection of problems with @halirutan and @TimStone's syntax highlighter.
Click here to install the syntax highlighter userscript
Please test it, and report any problems you find here. The aim is eventually integrate this syntax highlighter into the website.
How...
@yoda Here goes: the only way to fake MATLAB's reshape() in Mathematica is through a combination of Partition[] and Flatten[], no? Or is there built-in functionality and I haven't been looking hard enough at the manual?
@JM There's Internal`Deflatten which is almost a reshape()
It'll happily crash your kernel if you go over the bounds
@J.M. Is there a way at all to ping you in chat? :-) Also, as a future pro tem mod, can you look at what I posted about tagging above? I need some confirmation before I can go ahead with e.g. retagging the remote-kernel questions to remote-access
@JM I agree, I prefer remote-acess to be primary and that's why I rejected a tag wiki for remote-kernel. Also, there's a single question which is tagged remote-kernel but not tagged remote-access. So suggest synonym or retag? I think synonyms are most useful when the tag names are different, and people would not always find the right tag. But as soon as one types remote... both come up
So I don't think a synonym is needed here.
If no objections, I'll go and retag now. If there are concerns, I'll add the suggestion to the synonyms meta post.
@JM Again, as a soon to be pro tem mod, can you take a look at the FAQ post? I am going to make an annoucement on MathGroup tomorrow, and I want to keep things moving so the site will look a bit more polished by the time people start coming in larger numbers
Take care, if the list is too short (shorter than 2*4) this will crash your kernel.
@JM Well, but I'm the only one who replied to that question, and I got no feedback... Also, I'm not the best person to formulate it, as you see I can't even speak correct English :-)
It's a bit easier to use it for multidimensional arrays than Partition is
I got so sloppy ... before I took care to speak correctly and made an effort to improve my English. Now I just write and say whatever comes into my mind. Speaking more is not always an improvement :-)
I feel this is too short to ask on main, so: is there a better way to implement the following function: f[vec_?VectorQ, m_Integer] := Accumulate[vec[[Mod[Range[m], Length[vec], 1]]]]?
@JM Maybe f2[v_List, m_Integer] := Accumulate[PadRight[v, m, v]] I think head List is sufficient, since you only pad and add them. This should work with most kind of expressions inside a List. Watch how I shortened variable names ;-)
@Szabolcs Short update: The regex of the long list of keywords is compiled at the first run and should stay in cache like that (stackoverflow.com/q/9052140/1078614). This means we shouldn't really be concerned about speed. It will be fast enough, even when I add the 175 system variables I forgot: Names[RegularExpression["\$.*"]]
@halirutan Oh, not the workload, of course. I was concerned if the SE folks would be willing to update easily. But I guess with the current release rate of Mma it's not an issue.
@halirutan This is just personal opinion, so I'm not positing it on the meta thread: since you don't make function names bold any more, I'd prefer that brackets aren't bold either. This is a little thing. A bigger one is that since in Mathematica blue usually means undefined, I'd prefer not to have system symbols in any shade of blue. Again, this is my personal preference only :-) Others might disagree.
I know, yoda thinks in your way. The thing is, making them black and the rest blue looks shitty like hell. I tried it at first for exactly your reasons.
It makes the code really disturbing and chaotic looking. Btw, is there any concept for the final layout of the site? I mean, if the final site looks brown for instance, I would make the color scheme of the code fit into the whole site.
Oh, I think that's a misunderstanding. I didn't downvote bold black. Or at least I don't now. I like Tim's scheme with bold symbols and italic patterns.
I have 3 arguments and of course I would care if the democratic decision vote them anyway down:
1. Wolfram Workbench which is used by a lot of package writers uses blue, nevertheless it does mean something else in the frontend
2. Every IDE I know has blue for keywords
3. It fits into all the other language color-styles on SO. I checked at least Java, C, C++, Haskell, Python, JavaScript.
Sorry, first sentence should be "wouldn't"
Look for instance here askubuntu.com If our final color-scheme (when we really make it to final) would be like that, I really would overthink the colors too and I'm sure Jin would be on my side there.
Since a large part of every post is code, it has to fit into the whole page. Therefore, it might be possible we make keywords brown, or dark red.
@halirutan Don't think about the final colour scheme now. We can't get that for at least 3 months abyway, and stylesheets are easily tweaked afterwards
I think bold brackets and non bold everything is a little strange or straining (the problem with bold is that the rendering, especially the weight difference between bold and non bold, depends a lot on the OS and font --- here on Windows it's a bit weird)
@halirutan here it appears to use different shades of blue for defined and undefined symbols:
note the last line (shdg etc is not defined, hbruterandomtrap is)
I'm not sure copying this convention is such a fantastic idea though (but then again, so long as there is some colour differentiation I'm happy, so...)
@Szabolcs I don't feel very strongly about it. it would probably feel strange for a while, though (although when I write python I do not get confused by keywords being blue; in fact I just noticed it when halirutan mentioned it)
but, what is the motivation for blue for system, black for others?
(apart from "it's like this in other languages", which point halirutan has made already)
(xcode seems to have pink for keywords; again I'd never noticed it until now--guess @david will now hate macs even more)
@Szabolcs, @halirutan I don't think the specific colours are so important in general. however, choosing the exact opposite of the frontend feels a little strange.
I have a question regarding Mathematica's global optimization capability. I came across this text related to the NAG toolbox (kind of white paper).
Now I tried to solve the test case from the paper. As expected Mathematica was pretty fast in solving it.
n=2;
fun[x_,y_]:=10 n+(x-2)^2-10Cos[2 Pi(...
Would be possible. I just followed the order: Pattern objects start with a letter and have either _ or __ or ___ attached, like for example, x_, x__ and x___. These can also have additional letters following the underscore, as x_abc, etc. All of these should be highlighted in green.
Slots are # and ## and can also be followed by an integer as #1, ##4, etc., and should also be in green.
@Heike The main question is: Do we highlight the keywords (in blue) or do we clone the Mathematica-frontend, where keywords like Integrate are black and the rest is blue.
@rcollyer I have to think about it but I'm sure we cannot match this without a real parser.
Hmm, if the goal is to colour the underscores, you could match on something like [a-z]:{((?:_+,?)+)} and pass the capture group to a sublexer, which will know to handle the _ differently. I have a feeling that the actual use case can be a bit more complex, though?
@TimStone Hi Tim. We couldn't match the right side of the colon. There could be any expression and this has to be parsed. But it would be possible to match the literal before the colon.
@halirutan I prefer highlighting keywords. For readability's sake, I care more about distinguishing between functions/variables and other stuff like operators and parentheses than between between system and non-system functions/symbols in a post.
@halirutan @rcollyer While it is true that : is used for patterns, it is also used for default arguments, and it is also present in some uncommon but important operators such as /:. I am worried that a robust implementation for highlighting :-patterns is not easy ... If it's possible, great, just take into consideration all the other :-usages.
btw, to all — I think it was a big mistake on my part to have requested migration of the "undocumented" functions big-list question. These are exactly the kind of questions we were trying to avoid (and even shut down in private beta), and would be better off in the tag wiki for undocumented
well, there was a conversation about it and I just happened to see it on SO and thought hey, good stuff here... since I have a high # of useful flags and activity on mma.so, it was accepted right away.
then I saw that it had uncwed, and there were talks of CWing it again, but there are no mods yet and the SE folks won't do it (they hate CW).
Today a tag wiki was created for the best-practices tag. I have concerns about having a tag with such a name.
Question: Do we need such a tag? If yes, what shall it be used for? And what is it going to be named?
What's wrong with the name "best practices"?
it is explicitly subjective, pron...
Last time we talked about this (@yoda, I remember you were here) the consensus was that this tag name is best avoided. I'd just like to have a decision on it, whichever way we go
@yoda you mean the "big list" stuff? @Szabolcs that display name is only on Mathematica.SE. Yoda told me how I could revert it to Mr.Wizard but I decided to leave it for a while.
@rcollyer those operators with : i them are standard notation: /: is for upvalues, :> and := everyone knows, and f[x_:0] := ... is for default values (again, common). I can't think up more right now.
@yoda still, it's the kind of thing that can easily get out of hand even in a tag wiki ... what undocumented functions shall be included? which are "useful enough"? It's going to be a big mess.
Right, message name @rcollyer, as said above by MrW: fun::usage := ...
It seems to me that there needs to be a kind of information repository, something like a Wiki. This was discussed previously, but I cannot recall by whom.
The last time I was using it mathematica-users.org had problems, but I think it is a good idea. Perhaps we could coordinate with that site for things that are running-CW topics, if it can be made stable.
@Szabolcs right, but it will still be a privilege in the hands of a few, so easier to maintain... with CW, anyone can edit and answer freely, which makes t a mess
@yoda Alright. I share you concert about big-lists (even though I contributed), and I don't want to lose the information, so let's make it a tag wiki. But how will it get expanded then? Anyone can suggest edits? Can we contact those who have suggested the edits?
@yoda When do you expect the pro tem mods will be named? We have enough candidates, there seems to be a consensus (I support all three), so all we need is that SE should grant them the rights, right?
@Szabolcs I don't know what the rep threshold is, to suggest tagwiki edits, but it surely is very low. I can suggest edits on a graduated site with only 100 rep, so it should be lower for beta. By requiring someone with atleast 1500 rep to approve it, there is some form of quality control
if you're rejecting an edit, you have the option to leave a custom rejection message. That is, assuming they go back and check if it was accepted or rejected and if so, why... you can always comment on one of their posts and refer to this
@Szabolcs My guess is hopefully next week. They usually send out an email (I don't know if they've gotten it) to those who have expressed interest (and sometimes, to others that they feel like)
@yoda @MrWizard Every time these questions come up, I wish we had a wiki for the same community. I get more and more convinced that it'd be best to collaborate with mathematica-users.org , as MrW said. The maintainer of that wiki is Luc Barthelet, WolframAlpha executive director who has also committed to this site.
The disadvantage is that we can't share a login ...
that's a rather big disadvantage
The situation is made better by the fact that MediaWiki supports OpenID with an extension I wonder if that can be integrated into the existing site.
I'd like to avoid having to work across 2 sites... I mean, that's the whole reason we split away from Stack Overflow, Super User, Mathematics and others
@Szabolcs there is no single tag that goes to... those should just be maintained as separate questions. If need be, we can have a big-list question on meta, where you just dump links to good questions
that way, it is collected and you don't clutter the main site.
The other reason was that I think the two sites has minimal overlap (one is a wiki and one is a QA site). But I agree it'd be too, at least let the dust settle here before trying to expand.
@yoda Any suggestions about best-practices? meta.mathematica.stackexchange.com/questions/174/… This morning I was faced with accepting or rejecting a tag wiki suggestion for it. That big circled review queue indicator always makes me a bit uncomfortable ...
And I feel I can't just act on these alone, without consulting anyone. What do all you long time 10k+ users do on SO?
@Szabolcs SO requires 2 users to approve everything. All other sites require only 1. That said, go by your conscience and what you think is right. It's not the end of the world if you accept something incorrect or reject something correct. They can always be fixed :)
This is probably something the new mods will have to keep in mind as well... their votes to close and delete are instantaneous – doesn't require community approval. You might actually find yourself cramped because you can't vote as a normal user
and I'm sure @MrWizard will be disappointed to find out that he cannot, even as a mod, see who voted for a particular answer =)
@yoda thanks for asking. He is the luckiest guy ever, survived a ruptured aneurysm, was out of ICUS within 24 hours and might even be home tomorrow. Time is of the essence with one of those and he got to the hospital fast.
@Heike @yoda he has done amazingly well, especially for an 82-year-old. I think the hospital is a bit amazed at the speed of his recovery. Thanks for your concern. Kinda amazing when people you've never met are concerned too.
@Szabolcs Hmm, while /:,:=, :> or :-usage would be not problem, the default argument colon is not easy to handle. @Szabolcs, @yoda: Would it be very bad if in default arg constructions like blub:1 the blub would be green too?
@halirutan I vote for just leaving colon-patterns alone (they're not that common anyway) because I'm worried about miscolouring, but you're the one who knows what's possible and what isn't, so up to you. I think incorrectly colouring default arguments is a very minor issue. Don't forget about :: either (for messages), and ^:=
@yoda what I meant was: Can you give an example, where after : as default argument directly follows a =,> or -? The Mathematica tokenizer should have problems with that too. I don't believe this exists.
@halirutan I don't think so. And as szabolcs said, don't worry about the small minor cases. What you have here is great! The blue color is beginning to grow on me :)
We'll all collectively test this out for the next few months before implementing it to the main site
I haven't really been focusing on the syntax highlighting, but I would note that the blue used in Wolfram Workbench isn't the strong blue that is the basic colour in most computer systems. I'd describe it as a medium denim-blue or cornflower blue with the slightest hint of grey-green to it. I don't have WW here so I can't match the colour but I'll see if I can work out roughly what it is in RGB space.