Open Side Menu Go to the Top

11-10-2015 , 05:15 AM
This would be ok in Java though. Maybe she's mixing up languages.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
11-10-2015 , 06:29 AM
Quote:
Originally Posted by Barrin6
Biggest face palm today when my data structures teacher thought that when you use the new operator in a function, that it wouldn't survive after the scope ends unless it returned it.

For example:

Code:
void foo()
{
    int *bar = new int[5];
}

int main ()
{
     foo(); 
     //At this point she thinks that since bar is out of scope, the memory that       bar was pointing at is gone.
     return 0; 
}
She said she would have to check on that :\.

She stated that it only survives if you returned it in a function. So foo() would have to return the reference to it.
Quote:
Originally Posted by KatoKrazy
What you would have there is a memory leak. bar is still allocated, but you have no way to reference it.

I would really like to hear your professor's explanation as to what she thinks a return statement does and why she thinks that would have anything to do with whether a free store (essentially heap) variable is still allocated or not?
Quote:
Originally Posted by maxtower
This would be ok in Java though. Maybe she's mixing up languages.
So what is your play Barrin, embarrass her or give her an easy out?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 06:35 AM
Quote:
Originally Posted by kerowo
Of course YMMV but one of our product lines started in a hackathon. Our hackathons are a way to let the devs blow off steam and prototype ideas that aren't on Products radar. It's also a way to for people in the company that don't interact with the devs to meat them and see what they do. I thought they were a fairly standard way to innovate.
Seems like a good idea, harmless at the very worst. Does your company sponser them IE give out a charge number?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 08:20 AM
"Charge Number?" We don't track time like that. Not yet anyway.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 10:15 AM
Quote:
Originally Posted by KatoKrazy
What you would have there is a memory leak. bar is still allocated, but you have no way to reference it.

I would really like to hear your professor's explanation as to what she thinks a return statement does and why she thinks that would have anything to do with whether a free store (essentially heap) variable is still allocated or not?
She thought it was a GC language.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 12:30 PM
Quote:
Originally Posted by adios
So what is your play Barrin, embarrass her or give her an easy out?
Lol I am going to give her an easy out and give her a chance to redeem herself.. I think she already hates me for asking that question. Trying to convince my friend to bring it up instead.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 12:32 PM
She has been teaching c++ for several years, but then again she continues to mark down students for doing foo(int *a) instead of foo(int a[])
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 03:23 PM
Call her out, I'm still bitter about her marking us off over the func(int * a) vs. func(int a[]) debacle or whatever it was.

haha, my pony is slow apparently.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 03:26 PM
What was her argument about *a vs a[]?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 03:30 PM
I don't remember but she couldn't really explain it because there's no difference. i'm still angry about it 6 months later.. luckily I got an 87% or something and she gave me an A, those 2 points would have really mattered at that point. And some other stupid **** I got marked off for for no reason.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 03:30 PM
jmakin,

Yea she continues to do that in the class she's teaching right now.

I think her argument was that it's not good for code readability. Something about it being a pointer to an integer, it doesn't convey that it is an array like 'a[]' does.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 03:35 PM
Anyone doing data science by chance? I have a pretty straightforward classification problem.
There's a bunch of text and the classification is simply "positive", "neutral", "negative". I have a good data sample and can tag each sentence (manually) and build my classifier...all nice and dandy.

How would one go about this if there's multiple people doing the tagging? Are there some standard procedures I'm missing?
I was thinking about doing an equivalence test or simply calculate some sort of difference between the taggers (have them all tag the same sample data) and if it's within certain bounds allow them all to do the tagging on different sample data and get 3x the data tagged.

How is this handled in the wild if different experts could come to different conclusions what the ground rating should be. There must be some established ways of dealing with this as I can see it coming up a lot in say medicine (lists of symptoms, different doctors categorize as a disease for the training data but occasionally will pick different diseases)

Any obvious search terms I'm missing? I think I found a couple of papers but didn't have time to read them yet but any input would be helful.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 03:40 PM
Quote:
Originally Posted by Barrin6
jmakin,

Yea she continues to do that in the class she's teaching right now.

I think her argument was that it's not good for code readability. Something about it being a pointer to an integer, it doesn't convey that it is an array like 'a[]' does.
yea.. I could see that but even the most basic lazy documentation would clear that up for anyone that couldn't see right away that it's a pointer to an array. i think if you write correct code you shouldn't be marked off. especially since the other c++ teacher teaches to pass it in pointer notation
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 04:24 PM
I'm actually in her camp regarding readability, although I haven't coded C in ages and have no idea about the naming conventions tbh.

What's the argument against using 'a[]', or is you problem strictly about being marked off for something so minor? Would you be ok being marked off for using non-meaningful variable names?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 05:06 PM
clown, in many applications I think you can just ignore the noise from multiple taggers. That is, the small variation in their tagging styles probably won't have a meaningful effect on your end results. And if you're doing something really subjective that has a high variability in tagging - your end results are probably going to be fairly subjective as well.

I've also seen a multi-tagger system used. So if you have say 10 taggers each data point might get tagged by 3 different people. Then you can either take the majority tag or assign a probability based on the tags and use the probability in generating your model.

If you just want to measure the effect, I think making sure each tagger tags a set of common words amongst the rest of their inputs is probably ok.

Edit: Depending on the number of taggers and the amount of data - you might even be able to use the data itself to 'judge' how well a tagger did. Something like generating your model off of all taggers but 1, then test the tagger's data against that model and compare how the model did to the tagger. I don't know what numbers you need to make that statistically acceptable.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 08:10 PM
Quote:
Originally Posted by Barrin6
jmakin,

Yea she continues to do that in the class she's teaching right now.

I think her argument was that it's not good for code readability. Something about it being a pointer to an integer, it doesn't convey that it is an array like 'a[]' does.
I wouldn't value too much of what she claims, FWIW jmakin is right.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 08:17 PM
Quote:
Originally Posted by plexiq
I'm actually in her camp regarding readability, although I haven't coded C in ages and have no idea about the naming conventions tbh.

What's the argument against using 'a[]', or is you problem strictly about being marked off for something so minor? Would you be ok being marked off for using non-meaningful variable names?
It isn't a matter of a naming convention, int * p == int p[], they are interchangeable.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 08:33 PM
I can at least sympathize a little with the teacher. int p[] does seem 'more readable' and just because two things are functionally equivalent doesn't mean they're equally good.

But I agree that this particular case is pretty ridiculous. And unless the class is a class on 'learning my one true way of writing readable code' taking marks off for int * p (which in some ways actually demonstrates a deeper understanding of what's happening here) is dumb.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 08:35 PM
Yeah, I understand they are technically interchangeable. But you can certainly improve readability a bit if you consistently use p[] to emphasize that this pointer will be used for array purposes, and * p otherwise.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 08:48 PM
man, i have a teacher who takes off points if I do:
foo(){}
instead of
foo() {}
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 09:08 PM
Your teacher is dumb.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 09:20 PM
Quote:
Originally Posted by plexiq
I'm actually in her camp regarding readability, although I haven't coded C in ages and have no idea about the naming conventions tbh.

What's the argument against using 'a[]', or is you problem strictly about being marked off for something so minor? Would you be ok being marked off for using non-meaningful variable names?
My problem is being marked off for something so minor. I only wish I knew this before hand that this was her style of coding. That this is what she wanted. But whatevers, that was last semester, so no big deal.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 09:22 PM
phone interview next week for super-entry-level position
probably just background and behavioral
heard they sometimes ask pretty basic stuff like "what are the parts of a database"
hopefully I can manage
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 09:34 PM
@Barrin6
Yeah. I'm no fan of deducting points for something like this, especially if she didn't mention it before. But I probably wouldn't feel like it's a big deal as long as the mark offs are minor, at least her intentions make some sense.

Roonil's example on the other hand is just plain bad.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-10-2015 , 10:45 PM
Quote:
Originally Posted by Roonil Wazlib
phone interview next week for super-entry-level position
probably just background and behavioral
heard they sometimes ask pretty basic stuff like "what are the parts of a database"
hopefully I can manage
I might be stumped by that. Do they mean, like, "tables"?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m