« first day (35 days earlier)      last day (2063 days later) » 

4:19 AM
I think I may have gone overboard with this answer, but I tried to cover everything.
and the kitchen sink ...
1 hour later…
5:45 AM
\O/ 1000 questions on Gardening and Landscaping! Took us a while, but we got there. Looks like Mathematica will get there in less than a month though :)
4 hours later…
9:21 AM
@yoda Congrats. Maybe, as a celebration, you can post a question on how to make confetti from petals :-)
9:42 AM
Last night when sending my last message, I got "kicked out" (logged out) from chat and couldn't log back in until clearing all cookies today.
@Szabolcs That's a feature! It's called the you-look-tired-Go-to-bed-for-christs-sake plugin.
10:26 AM
@Heike haha! lol
@Szabolcs There are some changes coming to chat... so must have been a routine thing. Also, since you said you're using dev chrome, you should note that it's not officially supported
@yoda I don't use dev chrome. It's just the version of Chrome I have. I use Firefox. Beta browsers have bitten be before
10:46 AM
@Szabolcs Well, it's supposedly fixed
1 hour later…
12:10 PM
Has anyone developed a robust method to rasterize all of a 2D graphic except the axes / text / frame / labels, etc. ?
I can do it, but if someone has already done it and worked about the detail, worked around the problems, that'd be great!
Q: How to decrease file size of exported plots while keeping labels sharp

Eli LanseyWhen exporting rather complicated plots (especially ListDensityPlot) as a PDF or EPS (for publication, for example), the resulting file size can be quite large. For example: data = Flatten[Table[{f0, f, Exp[-(f - f0)^2/25^2]}, {f0, 500, 700, 5}, {f, 300, 900}], 1]; plot=ListDensityPlot[data,Pl...

12:36 PM
Q: Tag for questions regarding Mathematica's design

Mr.WizardI think that questions of this genre should have their own tag. What should it be? Example: DiracDelta attributes

1:35 PM
rasterizeBackground[g_, res_: 300] :=
     PlotRangePadding -> 0, ImagePadding -> 0, ImageMargins -> 0,
     LabelStyle -> Opacity[0], FrameTicksStyle -> Opacity[0],
     FrameStyle -> Opacity[0], AxesStyle -> Opacity[0],
     TicksStyle -> Opacity[0], PlotRangeClipping -> False],
    ImageResolution -> res] /.
   Raster[data_, rect_, rest__] :>
     Transpose@OptionValue[AbsoluteOptions[g, PlotRange], PlotRange],
     rest], Sequence @@ Options[g], Sequence @@ Options[g, PlotRange]]
1:46 PM
@Szabolcs I've moved my answer about turning the camera off.
@Heike Thanks, I edited it a little bit!
It's not possible to mark a question community wiki.
2:04 PM
@Szabolcs I'll have to give this a shot. It was always shocking and horrifying to see 70mb files....
@EliLansey It is not perfect, for example if the graphic to rasterize is Graphics[Circle[], the edges of the circle might be cut off (due to the finite line width). I didn't bother to fix this. Everything from the plot range padding region is just cut off. But it works well enough for my ListDensityPlot-like function.
I updated my connector line ordering post with this note:
"Given two lists, l1 and l2, containing the same elements in different orders, the permutation that re-orders l1 to l2 is Part[Ordering[l1], Ordering@Ordering[l2]]. This may be useful for reordering points."
Is there a simpler way to do the reordering, in the general case?
@Szabolcs have you tried my current answer code? Regarding ordering, that looks familiar so it's probably what I've used before.
@MrWizard looks good
@Szabolcs I cannot view whatever is at that link, but if you say it looks good I shall initiate comments-cleanup.
@MrWizard Why can't you?
@MrWizard If something's wrong with ge.tt, I need to know, so I won't use it to send files any more.
2:31 PM
@Szabolcs sorry I was poking around with connector lines. I think you've used that site before but maybe not for PDF. One way or another I wasn't seeing anything, but clicking the Download link loaded the file off-line.
@Szabolcs which of these looks better to you?
I'd say no. 2 if lines (3) and (12) didn't touch in a point
If I could swap 9<->6 and 7<->1 in no. 1, I'd definitely say no. 1.
These were produced with the same tour but different rotations. The first is what my algorithm picks now. I think perhaps a hybrid approach that checks number of intersections is needed. Would you please try this data with the other answers and tell me which looks best?
{{0.228562, 0.675022}, {0.376503, 0.343297}, {0.0902031,
  0.0551051}, {0.959674, 0.0905196}, {0.855165, 0.747163}, {0.14913,
  0.949981}, {0.131851, 0.660994}, {0.472054, 0.0377793}, {0.157586,
  0.822339}, {0.818154, 0.163548}, {0.67575, 0.374831}, {0.131394,
Sorry, I do not have time to do that now, but of course I'll check them later---I need to to pick one
Understood. I think mine in its present form should do a fairly good job of getting things in the right place; if it was followed by an algorithm that checked if switching pairs around the perimeter improved the layout I think it would be near-optimal, and still very fast.
2:50 PM
@MrWizard This is the picture I get with my code for those points:
I think I like Heike's results best so far, but it might be that her solution was just "lucky" to get easy point sets by random when I tried it. I'll mail you the actual figure I made, just for fun :-)
3:09 PM
@Heike This is what your method gives on the subplot example (but collinear points are admittedly special):
but wait, the reordering is wrong
3:25 PM
@Szabolcs This is what I get with starting points start = Transpose[{-1/24 + Range[12]/12, ConstantArray[.5, 12]}];
@Heike I'm sorry, I made a mistake.
@Szabolcs Looks nice
3:49 PM
Hola @belisarius!
Hi all!
@rcollyer Hi!
Long time no see. How's it going?
Too much work :(
I know the feeling.
I am sure :)
3:51 PM
Anyway, I have to run.
See you later.
@rcollyer See ya!
4:04 PM
Hello @belisarius -- I hope you stop by more often.
4:19 PM
Here's an oddity that I didn't know: you can use SetAttributes on a Protected function. Jens showed how an attribute oversight can be easily corrected with this trick.
4:52 PM
@rcollyer I knew this and I think this is intentional. Protected itself is an attribute. I think the difference between Protected and Locked is that Locked locks attributes as well.
@Szabolcs I had forgotten about Locked, but I agree it definitely seems deliberate. The behavior just surprised me.
Here's something else unusual (for me:):
In[423]:= Position[{1, 2, 3}, _]

Out[423]= {{0}, {1}, {2}, {3}, {}}
What is that {}?
5:10 PM
@Szabolcs why did you delete your answer? I tried to vote for it.
@MrWizard It is not different enough, and I wish it handled adjacent delimiters, but then it got complicated and I thought it's not worth bothering.
@MrWizard feel free to edit it into your if you wish
@Szabolcs It seems to related to expressions at level 0. For example Position[{1, 2}, _, {0}] returns {{}} and Position[{1, 2}, _, {1}] returns {{0}, {1}, {2}}
Interestingly enough, Extract[{1, 2}, {{}}] returns {{1, 2}}
Ah, I tried Extract, but only Extract[{1,2,3},{}], not the {{}} version.
5:28 PM
@rcollyer Not only that, you can change the context of Protected system functions. See comments below this.
@Szabolcs That's a very interesting question. I'm not sure why I haven't noticed it before.
it's possible to change the context of a symbol without recreating the symbol itself??
Clearly {} represents the entire expression {1, 2, 3} as one can see from using, e.g. :
Position[{1, 2, 3}, _?((Print@HoldForm@#; True) &)]
For some reason chat sounds don't work for me today.
@Szabolcs They are unreliable for me every day it seems.
@MrWizard I hadn't noticed that before. How odd.
5:42 PM
Neither have I.
BTW, I added my own answer to Pillsy's question.
btw, @rcollyer, you still owe me the spectral range for that spectrum...
@EliLansey Yes, I do. Remind me this weekend.
@rcollyer someone just walked by as I was looking at your answer. it occurs to me that MMA code can be quite strange to see at first glance for people familiar with other coding languages (ie matlab)
@EliLansey most functional languages are. But, I try to structure my code in such a way that it is readable even to the novice.
5:50 PM
Does anyone here have a function for testing if a point is inside a (not necessarily convex) polygon?
I need to mask some regions.
@Szabolcs You could look at the winding number.
@Szabolcs This is from my answer for the intersecting graphics question:
winding[poly_, pt_] := Round[(Total@ Mod[(# - RotateRight[#]) &@(ArcTan @@ (pt - #) & /@ poly), 2 Pi, -Pi]/2/Pi)]
Ah, I didn't notice your answer yesterday!
if the winding number is zero the point lies outside the polygon.
@Szabolcs I don't think many people have given the age of the question
I was just going to ask you for the polygon intersection code actually
@Heike I get an error when running the Manipulate in your answer
@Szabolcs Oh, I forgot to update the code. Give me moment.
5:59 PM
@Heike You had a global value for n when you made it
@Heike In the Manipulate, the value of n does not take effect in the {pts, RandomReal[{-1, 1}, {2 n, 2}]} part
@Szabolcs random There was something on Mathgroup a while back
let me see if I can find it
@Szabolcs Yes, that's right.
I've fixed it now
Note that the code doesn't seem to work well for areas where the winding number is >1. I still need to sort that out.
Like this one?
6:05 PM
Yes exactly
I hate it when they start using this office for a lab, especially experiments with loudspeakers
I must flee or my eardrums will pop
6:16 PM
@Szabolcs Is that part of the experiment?
The polygons? No. They're just knocking ping pong balls around with loudspeakers
to model a gas
@Heike done deleting comments.
it's actually cool
bloody hell.
maybe it's a typo?
Yeah, I have two: a conference proceedings and a pre-print that isn't likely to ever be anything but. Kind of makes you feel a little worthless.
It depends on the field too
i finally got a paper published
@EliLansey no... I checked his webpage. Can't judge the papers/journals though
6:39 PM
this month
@yoda sheesh
i see 5 journal articles
in real journals
(and a bunch of preprints)
PRA, AJP, etc
@yoda Yeah, my adviser is considering my conference proceeding as meeting the publication requirement to graduate.
But, damn. I feel inadequate.
It depends on the field too. Over here the experimentalists working for CERN had nothing until the machine started up.
Now they have lots.
each with 2000 authors on it ...
A lot of it depends on the lab, area of research and timing (i.e., when they joined the lab). A friend of mine joined 1 month after a major experiment and there was enough data to squeeze 4 quick papers... 3 years later, I'm trying to scrape the innards of it for morsels of info
6:43 PM
@Szabolcs :)
Also, who you are working with, how many times you've switched topics (pretty bad for me), did you do your masters on the same thing, etc.
And who your advisor is
How many times you've gone down the wrong path ... (guilty)
there's a group we "compete" with whose head is more well-known than my advisor
they publish some really crap papers
but reviewers must be like "oh, it him, must be good"
6:45 PM
We don't do group papers... each student has an individual project and research and no collaborations with fellow grad students. Other labs do group papers where each contributes something to all projects and so by the time they graduate, they have about 7-8 pubs (admittedly, 3-4 of them second authors and rarely third)
One of the groups in my dept does that.
@yoda that;s true
truth is, my recent paper was a "group" but really just me
but there was another grad student who was loosly connected to the work who we included
gotta suck when that happens
have to agree with yoda on that one.
Of course, I included my adviser on mine, but I did all the work. including the interpretation.
@rcollyer that's standard operating procedure
and if there's a nobel prize from the work, he's the one who's gonna get it :)
6:48 PM
There was also an instance of that happening
@EliLansey absolutely. But, it does rankle a little, especially about the Nobel thing.
these guys would find it hard not to do group papers
they only have one BIG machine to do the expriment on
@Szabolcs yeah, the particle physics papers are insane. it's like a whole page of authors, and two pages of text
i briefly did some work in particle physics -- totally crazy
In that field you can tell if a paper is an experimental one by looking at the first author: if the name starts with an A, it's likely to be experimental ;-)
6:51 PM
@EliLansey There's at least one exception to that rule: Josephson.
Wouldn't a For[] have some use in code compiled to C?
I would think so, but it isn't my forte.
Ok, Leonid agrees =)
Then it must be correct. :)
@Szabolcs yes switching is rarely a good move career-wise... neither is working on lots of topics
6:56 PM
See you all later.
I used to say For is never ever needed
And got a reply from Daniel Lichtblau on MathGroup once with some use cases
it was years ago, I don't remember much
@yoda I'm not proud of the way I wrote this message (my only excuse could being too young), but maybe the thread is interesting: forums.wolfram.com/mathgroup/archive/2008/Mar/msg00367.html
Anybody have a response to this?
@rcollyer Mathematica is really not simply a computer algebra system, that couldn't be any more clear. It's also excellent for list manipulation.
@rcollyer weird. he's giving matlab code...
7:09 PM
Isn't list manipulation the one of the bases of Mathematica?
@EliLansey He mentions Matlab in his answer as well
I think he's a bit confused
@Szabolcs I'm very much aware that it is a general purpose programming language. It does have some deficiencies and some things it is very good at, but so do all programming languages. I think the other solutions show that there are a variety of ways to accomplish the task.
@Heike yeah, by saying "probably not best to use MMA" here's a matlab code...
@Heike I think you're right.
@rcollyer agreed
@EliLansey He mentions "You will probably be able to bypass most of Matlabs higher (work intensive language transforms: this is where, from what I can tell switching from cygwin/awk to some of the more mainstream stuff, most of the performance hits occur) functionality that way."
7:12 PM
@Heike that is nontrivial to interpret in the context of the question
I took it as "here's some code so you don't have to use Matlab's higher functions"
I don't understand the reply completely it is not very clearly written.
Mathematica isn't mentioned at all in his list of skills on his profile
His solution is to output it to a file, process it with some other program, e.g. awk or sed, and load in the results.
@Heike but he does mention F# which is functional.
how's that ever going to be faster?
7:14 PM
It's not.
He's written a comment underneath his answer
Two, now.
@Szabolcs wow, never knew about the Goto and Label thing. Almost makes me want to dust off my old C64 BASIC code and convert it to MMA....
@rcollyer He's starting to sound like the "Why should I use Mathematica. I know c++" guy.
@Heike I know c++, I can get things up and running faster in mma, or F# (if I knew it) would work, also.
7:19 PM
I have to go, good night all!
@Heike Which is funny, 'cause I imagine most people here are of the "Why should I use *? I know Mathematica" persuasion
@EliLansey :)
@rcollyer The guy I was referring to was of the opinion that any algorithm in Mathematica could be programmed more efficiently in C++.
7:21 PM
@Heike I'm aware. But, time to program it increases dramatically.
@EliLansey I'm trying to learn Objective C at the moment and that thought has occurred to me more than once.
well, now he says "If Matlab implements R-style linguistic techniques that I am not aware of, I apologize" so I guess we should just leave him alone until he sobers up
@acl ha!
@acl ah, the noon and still drunk theory. :-)
perhaps I should reply, "Actually, Mathematica supplies inverse reactive current for use in unilateral phase detractors, and is also be capable of automatically synchronizing cardinal grammeters. This greatly improves its efficient processing of strings."
7:25 PM
Maybe we should point him to the matlab proposal
Yes, he does sound very confused (up at 3 AM or drunk?)
@EliLansey Buzzword bingo for scientists.
@EliLansey LOL please do.. I wanna watch.
@EliLansey Well, it will definitely answer the "is he drunk" question.
Hey, this is at the top in the hot questions list
that's the explanation
(my program stopped, I had to fix it before I could leave. I want results by morning)
okay, it's running fine now, so good night!
7:32 PM
Night, again.
My turn, again. Bye all.
> Matlab is based on R.
'tis time he stopped...
@yoda Maybe we should call in a moderator? :)
would actually be a bad idea
Por qua?
It's slippery slope when mods begin to judge answers for correctness and delete... it's generally an accepted network wide policy to not do so, except in cases of spam/link only/etc answers (will most likely backfire badly if the user is somewhat active on SE)
there are three 4k non-mod users... they can easily vote to delete
7:40 PM
So Matlab is based on R but it doesn't include R-style linguistic techniques?
Odd like that ...
Definitely good night this time.
@rcollyer and you're back just like that ;)
i feel like that comment thread is rapidly approaching a someone is wrong on the internet thread
I made it go away. I hope I did the right thing.
@yoda I guess I'm one of those 4k users, but I'm hesitant to vote to delete at this moment. I'm still hoping he'll come to his senses.
7:45 PM
@Heike too late, already deleted it.
Yes, I just saw
@yoda For some reason it didn't drop my icon. Maybe it will this time.
I shall be interested to see any solution to this:
Q: Can this be written well, without loops?

Mr.WizardInspired by this question I would like to know if the following code can be written without explicit loops (For, While, etc.) in a clean and non-contrived way. I have been unable to do so. max = 5000; a = ConstantArray[0, max]; x = y = z = n = 1; val := 2 (2 n^2+(y-2) (z-2)+x (y+z-2)+2 n (x+y+z...

As I recall there is a recursive solution that I think I got working but it was even uglier than the For loops and I deleted it. It's been some months since and I don't recall the details.
7:54 PM
We've started getting nutjobs on our site... must mean we're doing well =)
@MrWizard That looks like one complicated for loop
@yoda Apart from the regulars you mean?
@Heike it's the only nontrivial piece of For loop code I've written in the last year or so.
@Heike Ha!
I know this is a near-hopeless question
but does anyone know of a way to convert some matlab code to MMA (automatically)
my advisor has a bunch of stuff written in matlab
that i'd really prefer working with in mma...
@EliLansey There's the ToMatlab package, but you probably should double check its output
@yoda But i want a FromMatlab package :)
8:03 PM
Oh crud. Misread that...
I don't know if it's a good idea to post on main though...
@yoda well, the Matlab-is-R guy may be able to answer it
@acl He'll probably suggest rewriting the code from scratch in Fortran.
8:21 PM
posted on February 22, 2012 by Vitaliy Kaurov

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team. This week’s question comes from Tom, a teacher who wants to post his lessons online: How can I use CDF to include Mathematica content on web pages? Read below [...]

@David if you don't feel like working through the code yourself and posting a solution, do you have an idea for how my For loop program could be written better?
I guess in general you want to have some n*n*n*n space and find the points that satisfy some equation ...?
It would really help if you could give us some worded version of your code, as in "find the 3-tuples x,y,z for which ...".
Right now it's transforming your code to the idea that lead to it, and then translating that again to functional.
Needless to say, there's plenty of room for errors there.
val seems to be symmetrical in x, y, and z. It can be written as val:=4 (n - 2) (n - 1) + 2 (x y + y z + x z) + (x + y + z) (n - 1) 4
"Find all possible values of val"?
... where x <= y <= z
And count how many times each value occurs
That's where I've got
8:34 PM
5000^4 long list
@David Sounds good so far. I'd rather you not focus on val and just consider it a black box function, as my question really is about the loops and not the underlying mathematics.
obviously not the 5000^4 part ;-)
The fact that you're checking for x<y is only to speed up programming, right?
@David as I recall x>y>z is a bound on the solution. It's been a year since I put this together.
So this is not only only academic, it's also outdated? ;-)
Of course. :p
The thing is the only piece of For-loop code I couldn't write better in a different way.
8:44 PM
can anybody offer a guess as to why this person's answer was downvoted?
A: Are there any cases when For[] loops are reasonable?

user640078I'd argue that For should be used when you want to iterate through a list of options and insure that they are not run in parallel. To give a silly example, Table[CelebrateBirthday[i],{i,0,18}] is equivalent to For[i=0,i<19,i++,CelebrateBirthday[i]] However, a later programmer might try a...

is something wrong with it?
@acl it seems like a reasonable answer to me
to me too; I was wondering whether I missed something
just random downvoting perhaps
Fat finger syndrome?
Maybe someone wanted to get the badge.
How I know this works? lalala
(He could've undone his vote afterwards though.)
9:07 PM
This problem would be so much easier in Haskell.
Wait, you didn't say you wanted to use Mathematica explicitly did you?
sourcecode = '.....................'
David, may I email you?
result = haskellCompile[sourcecode]; ListPlot@result
Is the one in your profile valid?
(I haven't looked at it yet)
Yes. Does it show?
Only if I request it as a moderator.
9:09 PM
Ah okay. Fine then
lol I just looked -- is that really it?
Possibly yes.
Oh, I've used that one.
Yes, that's valid.
okay, off to compose an email
This is the general purpose not serious one.
I've also got one that I could give to someone in real life and one for spam. Do you want to send me spam? ;-)
Only on Tuesdays. ^_^
By then it's getting a bit rancid and I don't want it, after all.
9:16 PM
I'm still trying. Haskell showed me how to do it. Now I've still got to nail it in Mathematica.
It could be done with Reduce, but it's terribly slow.
The fastest way will be compiling it, but I don't think this is about performance.
@David email sent.
go tit
Wait, that space went terribly wrong
@Heike yes indeed. I added "efficient" to my requirements because of this.
9:25 PM
Oh, that one.
9:54 PM
Anyone who hasn't voted yet, one more vote gets Leonid another Good Answer badge:
A: Functions with Options

Leonid ShifrinThe main change since that time seems to be that the modern way of using options is associated with OptionsPattern[] - OptionValue commands. A typical way of defining a function would be: Options[f] = { FirstOption -> 1, SecondOption ->2 } f[x_,y_,opts:OptionsPattern[]]:= Pri...

10:25 PM
Why do I lose a rep-point if I down-vote??
@halirutan because you were a naughty boy? I think it's to keep people from downvoting for no good reason.
@MrWizard Hmm.. I would never do this..
11:15 PM
@halirutan there you go then. What is a rep point compared to Doing What Must Be Done?
11:38 PM
Anyone here?
@yoda are you online
@acl I meant "I would never downvote for no reason". I vote down no matter I lose rep if I think an answer leads to the wrong impression.
I just wondered. I voted down several times but I must have missed that you lose one rep.
11:54 PM
@halirutan I'm not sure why you didn't answer, but I'd like your opinion about migrating questions (and answers) from StackOverflow when a duplicate is posted here. That happened with this, duplicate of this.
@MrWizard give me a sec
@MrWizard Aehmm, where did I not answer?
You mean the "Anyone here?" question?

« first day (35 days earlier)      last day (2063 days later) »