Yeah, so last week I had 3 people come and do labs.
This week it was marginally better. Maybe. One guy came in and just wanted to check if the work he'd done at home was on the right sort of lines and would I accept it when it came to marking it. 'twas ok, although there were some things I didn't like about it - I pointed out the errors of his ways and sent him off happy!
Then in came two dudes from Slovenia or was it Slovakia, I forget... anyways... they've brought in a laptop with their work to show me.
So, the first ones code worked, but there were millions of things that wouldn't make me give them them the lab - just clumsy programming, which pretty much everyone who I've seen does - I don't think I've seen anyone who has worked out how to compare two fractions without having to resort to making them both floating point numbers and comparing - yeah it's the easy way out, but what if floating point precision gets in the way (0.499999999999 isn't 0.5).
Then came the look at the second guys code - I asked him if he'd done similar errors to the other guy, so I didn't need to explain them all to him... he had made the same errors... the exact same errors, with code which if diffed with the other guy's code would probably only result in the authour's name having been changed.
Ah well. How blatant?
I don't think I'm gonig to moan too much as they're both on a "No Award" exchange scheme thingy so it's not as if their marks actually matter for shit.
Then there were two people who wanted their second lab marking... not on my life.
"But but but, we were told by the lecture that because of the mixup with the computers and the labs and stuff that he'd extended the deadline..."
"only for lab 1... and that was last week. Lab one was due two weeks ago, and you managed to do that one..."
"Hmph"
"Go and see the lecturer, worst he'll do is tell you to piss off for being cheeky"
"OK"
"So, are you staying to do this lab?"
"We don't have the notes, we missed yesterday's lecture, where can we get them from."
"Ah ha"
I'm beginning to see why they've missed the deadline for the lab... 'cause they don't go to the lectures to find anything out!
Then there was another dude who seemed logically challenged, he was there for ages but at least it gave me something to do and he left know what it was all about :-)
So, six is better than 3, even though two of them were drongos with nothing to show me... well OK, they had stuff to show me, I just refused to look!
so what is the best way to compare two fractions then? i'd multiply them up and compare integers if you know what they're likely to be, or else do a-(1e-10) < b < a+(1e-10). Is there a better way (or is this question specific to java? - which I have no knowledge of). I suppose it depends on what you mean by fractions in the context of programming.
Posted by: bill on March 3, 2006 6:13 PMTwo fractions a/b and c/d.
compare a*d and b*c
Is that what you meant about multiplying up?
'tis that simple and means it'll always work as you don't go into floating point numbers at all.
Yes, that's what I meant. But wouldn't a/b and c/d have to be stored as some type? or doesn't java need that?
Posted by: bill on March 4, 2006 2:40 AMAssuming they are proper fractions, then you could store a, b, c, and d as integer values.
Incidentally Ed, aren't your students likely to find this blog and object in some way to you calling them drongos? Be a little bit careful, I've been in trouble for such antics before.
Your students seem worse than mine for attendance. That said, I'm convinced some aren't going to turn up to the phase test this week because they haven't been to a single lecture to learn when it is!
Owen
Posted by: Owen on March 8, 2006 10:27 AMAt least 2 of Ed's students read his blog...
Posted by: Jeremy on March 8, 2006 10:55 PMI was going to say that, but I decided not to.
Thing is, I know that you're not one of the drongos... that said, you are a cheeky monkey... 'can you mark my lab via MSN?'... pah!
Posted by: Ed on March 9, 2006 2:32 AM