« first day (725 days earlier)      last day (2504 days later) » 

3:41 AM
@AndrasDeak Ooooh
 
 
4 hours later…
7:16 AM
@AndrasDeak awesome!
 
 
2 hours later…
EBH
9:18 AM
How bad can code get?!
 
 
1 hour later…
10:36 AM
Wow.
I was just telling the missus about a recent rise in eval questions
 
 
1 hour later…
11:51 AM
How did he even come up with that code?!?
I mean, sure, you can wrap everything in eval blocks, but why on Earth would you? It's obfuscated, slow, and takes more care and effort to program than regular code...
 
12:27 PM
@LeanderMoesinger why'd you delete that comment? That seems to be exactly what he needs (even though he doesn't actually ask a question)
 
12:38 PM
I'm wondering if we should write an "I painted myself in an eval corner" Q&A
 
I'm doubtful, as the answer'd be: start over and don't use eval. Most cases can be covered by "use multidimensional matrices, cells or structs", but more exotic cases like this one won't be covered in that case
 
I mean this:
6
A: MATLAB: Loop through the values of a list from 'who' function

Andras Deak@Suever nicely explained the straightforward way to get this information. As I noted in a comment, I suggest that you take a step back, and don't generate those dynamically named variables to begin with. You can access structs dynamically, without having to resort to the slow and unsafe eval: t...

exactly for the "start over", without having to start over
nobody will abandon eval if it means redoing days of stupid work
but the question there is not really suitable for linking
but yeah, that Q&A wouldn't be a suitable dupe for many things, I guess
 
I sorry for my poor writing! really thank u! — jackson 43 secs ago
facepalm
@AndrasDeak well, there's your canonical for that pitfall of eval
just went unclear on Jackson's Q btb, as he still doesn't ask a question
 
@Adriaan yeah but the question has nothing to do with that...a lot like your eval dupe target
 
12:53 PM
ah right.
 
@Adriaan That solution also contains permutations, which he doesn't want. But frankly I have no what he actually wants to do with the "remaining" elements
 
@LeanderMoesinger I just voted unclear, as he still doesn't ask a question as ewll
 
@Adriaan will do so too, it really is
 
@LeanderMoesinger hehe, well, all you can do is flag, which doesn't add anything now, as my close vote already sent it to the queue
get to 3k rep and close vote along with us ;)
 
ah, i wasn't aware there is a difference between flagging and voting. I always thought that if a lot of people flag a post that that is also some sort of voting.
 
12:57 PM
nope
 
A flag of yours is "needs to be closed, because (...)" and sends it to the "Close vote queue", in which users with more than 3k reputation can actually vote to close it. So all you do is send out a signal that it needs to be closed
 
close-flagging will put the question in the close vote review queue, where carbon-based droids can see if they deserve close votes
close flagging is mostly relevant when there are no close votes on the post yet
 
flags of yours on answers (VLQ/NAA) are actually used the same as ours, to put it in the deletion queue
 
EBH
@AndrasDeak Only one left...
 
Spam/rude flags are also the same as ours, 6 of those and the user gets -100 rep, the post gets nuked and the OPs IP gets banned
 
1:00 PM
@EBH meh, nobody in their right mind would try to copy that, I hope
speaking of:
 
 
1 hour later…
2:10 PM
Another hot meta post fistpumps
 
2:25 PM
got my upvote
 
@AndrasDeak 'tis a bit arrogant, calling yourself god, don't you think?
 
2:42 PM
no, because it's a generous god
 
3:14 PM
@EBH that code gives me hives
@AndrasDeak how many people in their right mind have you seen on stackoverflow?
 
:|
@beaker don't be rash
 
 
1 hour later…
4:49 PM
0
Q: parfor error: "the variable can't be classified"

Chuchu Xiangall, I want to modify some elements in a array in each loop (the elements modified vary in each loop), but looks like 'parfor' only allows me to use fixed index. I can fill in zero for the elements which are not selected, but I tried not to, because the array is very large in my code. The simpl...

Dupe (cc @AnderBiguri @rayryeng)
 
5:20 PM
-2
Q: How to concatenate these subplots on one graph?

Mark DelphiHere is the a simpler version of my code. ..... ch_array = [36, 40, 44, 48, 149, 161]; figure; for i=1:length(ch_array) ch = ch_array(i); subplot(3, 3, i); eval(sprintf('plot(mean_a_%d_f, ''r'')', ch)); hold on; eval(sprintf('plot(mean_b_%d_f, ''b'')', ch)); xlabel...

This is the third self-dupe and still not clear.
The xticks are not in accordance with the original plots. e.g the first subplot graph has last x value around 58 but in the concatenated plot, it's in between 36 and 40
 
oh gods why
cc @EBH -------^
@SardarUsama careful when suggesting to askers to edit earlier questions: this shouldn't invalidate existing answers, see also chameleon questions
 
Shouldn't the answerers have asked for clarification instead?
 
ideally yes, or not even answer in the first place...
 
exactly but i will be more careful
 
in this specific crappy instance there's probably no good course of action:)
just wanted you to be aware of this aspect
 
5:29 PM
thanks, and yes this question seems to be meeting the same fate as of the earlier self-dupes
 
a winning combination of "wtf?!" and "huh?"
maybe I should answer that clusterfuck :S
I actually understand what he wants
I guess I'll do that, and show him the eval-less way in the mean time
 
do it ! may b your answer clarifies the question to others as well who may want to answer
btw I suggested that offset thing too but this:
15 mins ago, by Sardar Usama
The xticks are not in accordance with the original plots. e.g the first subplot graph has last x value around 58 but in the concatenated plot, it's in between 36 and 40
 
EBH
5:46 PM
@SardarUsama nice illustration ;)
 
@EBH thanks :D I've bookmarked it for the future questions with eval
 
5:59 PM
@AndrasDeak midpoints(end+1) :/ no pre-allocation
 
6:13 PM
Thank you for your reply! I changed it to a function as following, but it gave a arror "Function definitions are not permitted in this context" a=zeros(5,1); parfor t=1:3 ind=randsample(5,4); a=pf(ind,a) end function a = pf(ind,a) a(ind)=a(ind)+2; end — Chuchu Xiang 54 mins ago
facepalm
 
@SardarUsama 9 elements; I can't be arsed :P
otherwise you're right
hmm, actually, we know the length from ch_array, I'll prealloc, thanks
fixed it
(I would've reacted sooner but there was a jar emergency)
 
@AndrasDeak I see you're cheating your way up the rep ladder through [python], no wonder you're running so fast
 
the questions I answer barely get any views or votes there :|
much like
I'd be way past 20k if I were willing to repwhore
 
I'm actually also closing the Qs I could've answered, like that parfor one just now
especially since I'm almost first in that tag
 
6:50 PM
@Adriaan sigh
I'm not even sure what they're messing up
oh, everything
What do you expect the parfor to do with your loop? And please don't answer "speed it up". — Andras Deak 2 mins ago
Hi, this is the simplified code. The real code has a large matrix and I want to use parfor to speed it up. — Chuchu Xiang 1 min ago
FWIW I edited the second sentence right after posting so they may have not read it
OK, I checked and I can reproduce your error (deleted my previous comment). The problem is probably that the parfor in this context is meaningless. Do you understand what parfor does? — Andras Deak 1 min ago
I need 'parfor' for a large matrix in the real code. — Chuchu Xiang 23 secs ago
That's not what I asked. — Andras Deak 15 secs ago
Ok, they edited
0 characters left in comment
OK, so what is "this work"? One typically uses parfor to compute independent slices of a large array. Like a Fourier transform. In these cases each loop iteration is independent. In your case, every loop iteration is doing something to the whole array (incrementing it, to be specific). If the operation was something more complicated and not just increments, even the order of iterations would matter! This is clearly not something parfor can be used for, out of the box. You need to rewrite it so that it makes sense: for instance by adding a new dimension and collecting increments in the end. — Andras Deak 7 secs ago
 
7:15 PM
"If you're not in control of data creation, keep hitting the head of the person who is, so that they stop" :D
 
@AndrasDeak haha, that is awesome. "...please don't answer "speed it up"" - "...I want to use parfor to speed it up". You're a psychic!
 
7:26 PM
@AndrasDeak you can point him to my parfor answer, as that basically explains which operations it would speed up
 
probably a her
@Adriaan wanna leave an answer?
 
@AndrasDeak No, as I am not sure what the problem is + my parallel computing tollbox is botched >.<
although I'm fairly certain that it can be solved if you pull the ind outside the loop and make it a 3D matrix...
answered anyway
 
OK, I won't then
I'm not sure your answer will help though
 
neither am I, as I can't test it, since the parallel toolbox isn't working for me.
Let me know if it doesn't, then I'll delete
 
they will, don't worry
hope they won't ask a new question
 
7:37 PM
Oh goody, my grandma is becoming 99 in three weeks. What fun that will be
Last year of peace; then each year the mayor will come by with flowers on her birthday
 
nice!
 
8:02 PM
left an answer, reread it later
 
@AndrasDeak looks good
 
8:20 PM
Nothing to see here, move along.
 
@AndrasDeak spot on ;)
 
EBH
8:35 PM
What's wrong with imgur?
0
A: Rectangular grid using MATLAB

EBHYou can use boxplots to create the initial structure of the plot, and then alter them to represent what you want. I'm not sure why are you using cell array to hold your data, but it seems that each matrix x is converted to one grid plot. Here is a short code to do what you want: x = rand(10,5)*...

 
@EBH don't upload to imgur directly; use the in-answer upload link. Then it uploads it to stack.imgur
 
@EBH seems fine when i follow the link
 
EBH
Doesn't show the image in my answer
@Adriaan That gave me an error
 
@EBH yae, upload using the in-answer upload dialogue to get it on stack.imgur. SO might have blocked the regular imgur
@EBH nvm, nothing is wrong with imgur, you are wrong :P
you gave a link to an imgur page, not the image directly. I.e. your "image" didn't end on an image-file extension, so SO didn't recognise it as image
 
EBH
@Adriaan Too bad I didn't take a printscreen of the error...
 
8:39 PM
when you upload to imgur, be sure to right click on the image and select "copy image url", to have only the image, and not the full imgur-page where you can leave comments and stuff
 
EBH
I usually use the built-in tool for that, but honestly - it didn't work...
 
8:56 PM
@Adriaan thanks, I won't reread it then :D
 
@AndrasDeak probably a follow-up question will come since it's still not the real code
 
EBH
@AndrasDeak I think you should let him rewrite his code before he gets further help with that
 
I agree
but I still think it's a she
 
I think they need to ask a question with their actual code attached, not some over-simplified example
 
9:00 PM
then again sooner or later they'll run into a question ban
actually, no downvote on their current question
 
EBH
@AndrasDeak with the name "Mark"?
 
@EBH oh, we're talking about different users :P
 
@EBH we're talking about a different user this time :)
Mark's hopeless
if they ask another one and it has eval in it, I'll close vote as a dupe of the one I answered :P
 
I'm talking about the parfor lass. She has 3 questions, all on 0 score (one actually on \pm 1), two closed. Not a whole lot to go on for a Q ban
they need more downvotes for an actual Q ban I think
 
The new one of Chuchu is not that bad, it's a real problem described in clear terms. The only problem is their re-asking similar stuff
and then again it was only 1 incident, the previous having been hammered quickly
so hopefully this won't escalate
 
9:04 PM
If a next time occurs: simply ask for the real code, instead of an over-simplified example.
 
inb4 they post a 5k-lines-of-code program
It seems that their current understanding is "parfor good, parfor fast", so they'll run into a few surprises down the road
 
@AndrasDeak at least he's got a good reason for using eval...
eval allows accessing to the dynamic variable. SO, I posted a new equation — Mark Delphi 5 hours ago
:-/
 
yeah, real convincing :S
 
Can you guys confirm if this happens to you? (Unwanted line at the start of your profile as seen by yourself). It's been suggested in comments that it may happen only to "potential employers" (whatever that means)
 
Oh cool, I got the convention badge today and am within 1 vote of sportmanship :D
@LuisMendo I'm not using jobs at all since they started to pester me on my profile page.
 
9:10 PM
Neither am I :-(
Just the profile
 
@LuisMendo Isn't that line only there until you actually add a role and company name to your profile?
 
@LuisMendo I'm not sure what you mean. Can you edit the question with a screenshot with a freehand red circle?
 
@beaker Perhaps. But I don't want to add it (and it's down in the text anyway)
 
EBH
@LuisMendo I don't see anything like this, but I may not know where to look for it
 
@Adriaan Good idea. Done
@EBH ^
 
EBH
9:19 PM
@LuisMendo well, I don't see this nither in yours nor in mine profile
 
@LuisMendo ah, I think I don't have that as I have a study+location set
and what Tiny Giant says, probably it shows up for prospective employers
 
Thanks. So it's true that not everyone sees it. @EBH Did you set those fields (and that's why it doesn't show)? Or it just never showed?
 
EBH
@LuisMendo I set "Career" to school, so I don't have this fields
 
Nice bsxfun solution @LuisMendo I played with it for some ten minutes, then realised I'm not good enough at keeping track of all my dimensions and which goes where.
 
@EBH Ah, ok. So that may be the reason why it doesn't show. One more question: does what you set there show up in the profile somewhere?
 
9:25 PM
@LuisMendo yes, see my profile. You see what I study and where I study
 
@Adriaan Ah, as a sub-heading. The truth is, it looks nice. I may add it after all :-)
@Adriaan Thanks! It's just practice :-) Divakar's record is 7D I think
 
EBH
@LuisMendo my sub heading is free text written in "Title" field
@LuisMendo I can't see what's under "Career" anywhere in my profile
Even if I change it to work
I see now. If you leave the "Title" empty, then it takes what's under "Career"
 
@EBH Good to know. But one thing is the "title" field and another is the "Career" section, which is where the red-freehand part links to
I think I'll fiddle with that and actually write something there. But only after a few daus, otherwise my question on meta becomes less meaningfuk :-)
 
@LuisMendo But we want MORE meaningfuk
such an @ander esque spelling mistake ;)
 
:-D
The Spaniard connection sloppiness it's late and I'm tired :-P
 
9:34 PM
Yea, I think I'm off to bed as well. Read a bit of Tolstoy and start fresh for studying again tomorrow >.<
 
EBH
I'm out as well. Good night.
 
9:52 PM
Good night!
 

« first day (725 days earlier)      last day (2504 days later) »