• Ken (unregistered) in reply to I have no clue

    Most d10's I've used have a 0 as a placeholder for 10 so when you roll two together it represents either 09 for 9 for 90 for 90. (You need two different colors and one of them has to be declared to be the 10's digit.)

  • robo (unregistered) in reply to GEE
    GEE:
    When you find a modulus of a negative number the result is always positive (as it is the remainder after an integer division).

    So '% 10' limits the results to something between 0 and 9.

    import java.util.Random;

    public class Test { public static void main(String[] args) { Random r = new Random(); for (int i = 0; i < 10; i++) { int roll = r.nextInt() % 10; System.out.println(roll); } } }

    Outputs: 0 -7 -9 8 -9 -4 8 0 5 -2

    Apparently java does not behave as you would expect with modulo division. see http://mindprod.com/jgloss/modulus.html, http://www.davidflanagan.com/2006/06/integer-division-and-negative-numbers.html

  • Anonymous (unregistered)

    When I did OO programming at University, the course had just that year changed over from teaching C++ to teaching Java. Our OO prof was a C++ lecturer with no Java experience who now had to teach Java to a bunch of bright young minds, many of whom had been coding in Java for years. To be fair he did an OK job, but you could tell that was learning from the same course we were; he just made sure he kept about two weeks ahead of us in the course notes. If anyone asked what was coming up later in the year, we'd invariably get told "sorry, I haven't got that far yet"!

  • anon (unregistered)

    A prof failed a piece of my coursework once (something to do with implementing counting semaphores in Pascal FC) because it wasn't possible to do what he'd asked in fewer lines than he had. He hadn't read my documentation. To give him a little credit he gave me an "A" after I persuaded him to take another look.

  • adam (unregistered)

    oh dear god, i hope that man wasn't tenured.

  • wtf (unregistered) in reply to Anonymous
    Anonymous:
    When I did OO programming at University, the course had just that year changed over from teaching C++ to teaching Java. Our OO prof was a C++ lecturer with no Java experience who now had to teach Java to a bunch of bright young minds, many of whom had been coding in Java for years. To be fair he did an OK job, but you could tell that was learning from the same course we were; he just made sure he kept about two weeks ahead of us in the course notes. If anyone asked what was coming up later in the year, we'd invariably get told "sorry, I haven't got that far yet"!

    Perfectly reasonable, especially since he made it clear that he was working through new material. My compilers prof had a similar answer on some material - although in his case the answer was "I haven't written that chapter yet". (to be fair, that was usually followed by a thorough discussion of the question which answered the student's question, as well as the three or four other questions the student should have asked, but hadn't thought of.

  • Anonymouse (unregistered) in reply to adam
    adam:
    oh dear god, i hope that man wasn't tenured.

    That is pretty harsh. There is no reason for an actual PhD wielding professor to teach a bunch of freshman Java. That is what grad students are for. Maybe the dude was a theory guy who was forced to teach this course?

  • A pedant (unregistered) in reply to Anon

    They have to roll 2 10-sided dice in order not to fall under a sleep spell. (thus emulating a d100)

  • A pedant (unregistered) in reply to Anon
    Anon:
    but was so monotonous it could put an elephant under.

    I wasn't aware that elephants were legendary for their alertness.

    They have to roll 2 10-sided dice in order not to fall under a sleep spell. (thus emulating a d100)

    feugiat: feugiat ireparabile tempus < latin typo.

  • Pro nun see ay shun (unregistered) in reply to madjo
    madjo:
    When I got taught Java, for the first 10 weeks we didn't have any practical lessons. Exams were done on paper without the use of a computer. Yes, that meant writing source code on paper, though most questions were multiple choice type questions. And the programs you were asked to write weren't very long, and pretty easy.

    And the teacher pronounced the names of certain functions weirdly. Sleep for instance was pronounced as "Slape" (as that's how you pronounce sleep in Dutch), and a thread became threed (though I'm not sure why he did that, probably because in some cases ea is pronounced as ee in English (like eat), and he stuck to it)

    It may sounds as an exaggeration, but I assure you it's not.

    I believe it. I spent the first half of my Java 101 learning "YAY-WA". I have no idea where "Axel" was from, I'm guessing Germany.

    It wasn't that I didn't understand it, it was just REALLY distracting.

  • anoni-mouse (unregistered)

    Please tell me this was community college!

  • Matt Westwood (unregistered) in reply to Procedural
    Procedural:
    madjo:
    When I got taught Java, for the first 10 weeks we didn't have any practical lessons. Exams were done on paper without the use of a computer. Yes, that meant writing source code on paper, though most questions were multiple choice type questions. And the programs you were asked to write weren't very long, and pretty easy.

    And the teacher pronounced the names of certain functions weirdly. Sleep for instance was pronounced as "Slape" (as that's how you pronounce sleep in Dutch), and a thread became threed (though I'm not sure why he did that, probably because in some cases ea is pronounced as ee in English (like eat), and he stuck to it)

    It may sounds as an exaggeration, but I assure you it's not.

    Well, you can slape the threed in Amsterdam; it's just 10 extra kronors.

    Only if you're going to pay in Sweden, and then the plural is "kronor", singular "krone". In Amsterdam it's Euros, although up till ten or so years ago it was guilders (Dutch: "gulden").

  • Doozerboy (unregistered) in reply to Case
    Case:
    To be honest, I think the professor was actually screwing with him for sleeping in class every day. Anyone who was awake heard his explanation that the +0 was just a placeholder for the offset you want in your random number. Then that dumbass wakes up mid-class and asks a retarded question so the prof gave him a retarded joke answer.

    Then when it came to the lab, the professor mocked him even further. I know if I was in that class, I'd have been laughing so hard.

    Hardest i ever laughed in my Java classes was when a fellow SECOND year student after seein the following code snippet on the board

    int i = 1; double ii = 17.5;

    said "is it called ii because it's a double?"

  • (cs) in reply to OldJavaGuy
    OldJavaGuy:
    This must be an advanced class since they're simulating 10-sided dice.

    I think the code should have been

    Random rand = new Random(); int n = rand.nextInt() % 10 + 10;

    in order to simulate a 19 sided die, as nextint can generate a negative number

  • (cs) in reply to Ken
    Ken:
    Most d10's I've used have a 0 as a placeholder for 10 so when you roll two together it represents either 09 for 9 for 90 for 90. (You need two different colors and one of them has to be declared to be the 10's digit.)

    It's a little more complicated than that (you can get away with one dice if you roll it twice and declare that the first roll is "tens")

    // input: each d10 is a number from 0 to 9
    // output: a number from 1 to 100
    int d100_from(int first_d10, int second_d10) {
        if (0 == first_d10 && 0 == second_d10) { return 100; }
        return 10 * first_d10 + second_d10;
    }
    
  • Ozz (unregistered)

    I had a teacher in college once who insisted that AC stood for Actual Current and DC stood for Differentiating Current. When shown the correct terms in the book, he insisted the book was wrong...

  • (cs) in reply to wtf
    wtf:
    I thought the Dutch pronunciations were a tribute to Java's origin on a Dutch colony.
    +0
  • Paula (unregistered)

    1.) Make saving throw with D10. 2.) ?????????? 3.) Profit!

  • Herohtar (unregistered) in reply to anon
    anon:
    The *10 is for the offset. The +0 is to be able to adjust the precision.

    I hope that was just a failed attempt at a joke/sarcasm...

  • Procedural (unregistered) in reply to Matt Westwood
    Matt Westwood:
    Procedural:
    madjo:
    When I got taught Java, for the first 10 weeks we didn't have any practical lessons. Exams were done on paper without the use of a computer. Yes, that meant writing source code on paper, though most questions were multiple choice type questions. And the programs you were asked to write weren't very long, and pretty easy.

    And the teacher pronounced the names of certain functions weirdly. Sleep for instance was pronounced as "Slape" (as that's how you pronounce sleep in Dutch), and a thread became threed (though I'm not sure why he did that, probably because in some cases ea is pronounced as ee in English (like eat), and he stuck to it)

    It may sounds as an exaggeration, but I assure you it's not.

    Well, you can slape the threed in Amsterdam; it's just 10 extra kronors.

    Only if you're going to pay in Sweden, and then the plural is "kronor", singular "krone". In Amsterdam it's Euros, although up till ten or so years ago it was guilders (Dutch: "gulden").

    I see you have a lot of experience paying for stuff in Amsterdam. Good for you.

  • I have no clue (unregistered) in reply to Mister Zimbu
    Mister Zimbu:
    I have no clue:
    Isnt that actually a 9 sided die? Well I guess 10 if you count the 0, but I've never seen a blank side of a die.

    NINJA VANISH!!

    I'm not sure what dice you're using, but most 6-sided dice I've seen DO have a side with a "0" on it.

    Screw you all! All I know is when I play yatzee, there ain't no blanks! :P

  • Some Old Guy (unregistered)

    I had a Chinese professor in college for a course in assembly language. He was ok except when he wanted us to queer the registers.

  • (cs) in reply to VBMaster_VBFaster
    VBMaster_VBFaster:
    Cliff notes anyone:
    Knux2:
    OK kids, remember to always add "" to every String.

    Captcha: nibh - a nibble header

    Actually, that's how I convert numbers to strings since this is a compile error:

    double d = 1.1; String x = 1.1; // compile error String x = "" + 1.1; // works

    yes, with the Double class I could do this differently but the way I do it, it works fine.

    yeah, do the same in VB when Strict is On, easier to write:

    Dim crapLanguage as String = someInt & ""

    than

    Dim crapLanguage as String = someInt.ToString()

    But, then you are missing any code telling what string representation of an integer you would like. I always suggest like:

    Dim crapLanguage as String = someInt.ToString("X2")

  • DumbLemon (unregistered)

    I had an idiotic professor (R. Citro) for my VHDL class. I got a 60 on a midterm instead of a 90 because the retard gave me a 0 on 30-point question. The question was to implement a state machine (figure provided). I did so. But he told me my solution was wrong. Why? Because according to him the inputs go in the circles and the outputs (values that effect the transition) are on the arrows. Idiot.

  • RichAromas (unregistered)

    I once had a problem with some COBOL code that contained the line:

    COMPUTE X = X + 1.

    My project leader insisted that the problem was because I didn't say "X = X + +1" and the absence of a sign meant that the code would sometimes add PLUS 1 and sometimes add MINUS 1, randomly!

    I quit the company shortly after that.

  • ShatteredArm (unregistered)

    Not a programming class, but in my circuits class a few years back, I started an argument with our professor, who was a chaired professor in the electrical engineering department, about how an inductor works. Here were me and several undergraduate classmates in an introductory circuits class explaining to our chaired professor why he is wrong about one of the most basic circuit components. It's just bizarre how some of these people get where they are.

  • PITA (unregistered)

    int GetRandomInt() { return 4; //just as likely as any other number }

  • SR (unregistered) in reply to Anonymous
    Anonymous:
    When I did OO programming at University, the course had just that year changed over from teaching C++ to teaching Java. Our OO prof was a C++ lecturer with no Java experience who now had to teach Java to a bunch of bright young minds, many of whom had been coding in Java for years. To be fair he did an OK job, but you could tell that was learning from the same course we were; he just made sure he kept about two weeks ahead of us in the course notes. If anyone asked what was coming up later in the year, we'd invariably get told "sorry, I haven't got that far yet"!

    Perfectly reasonable. He sounds a much better professor than a lot mentioned in these comments. At least put your education before his ego enough to be honest with you.

  • RIT_Warrior (unregistered)

    I had a professor in my Computer Organization class actually say, pretty much word for word:

    "I really like C++, but I hate the standard template library. If you want to use code you should write it yourself!"

    No, he wasn't joking. He was dead serious. I figured that was why he didn't let us use pseudo-commands in our MIPS projects.

  • Thready Noodle (unregistered)

    My OS prof was very good but had a strong chinese accent. So when we were talking about forking processes, it would sound like "fcking processes". Hilarity ensued when he started talking about child processes: "You must fck the child process. F*ck the child first!"

    • Thready
  • SeanJA (unregistered) in reply to madjo
    madjo:
    ... Sleep for instance was pronounced as "Slape" (as that's how you pronounce sleep in Dutch)

    It is actually because the dutch word for sleep is slapen (as in I am sleeping) or slaap (as in I sleep, elongated a sound, hard p).

  • (cs) in reply to Doozerboy
    Doozerboy:
    Hardest i ever laughed in my Java classes was when a fellow SECOND year student after seein the following code snippet on the board

    int i = 1; double ii = 17.5;

    said "is it called ii because it's a double?"

    Now I'm curious. Why is it called "ii"?

  • (cs) in reply to IT Girl
    IT Girl:
    Pete:
    Are WTF's drying up is all code in the world becoming better.

    I think we all know there are teachers in colleges and universities that don't have a clue. Those who can't do teach after all.

    That's right, those who can do, those who can't teach, and those who can do neither, criticize.

    Are you saying critics have superpowers? Because those who 'do neither' would be people who can both 'do' and 'not do' at the same time.

    Just asking, y'know.

  • (cs) in reply to DumbLemon
    DumbLemon:
    I had an idiotic professor (R. Citro) for my VHDL class. I got a 60 on a midterm instead of a 90 because the retard gave me a 0 on 30-point question. The question was to implement a state machine (figure provided). I did so. But he told me my solution was wrong. Why? Because according to him the inputs go in the circles and the outputs (values that effect the transition) are on the arrows. Idiot.

    I had a maths teacher who marked me (and a few other people) as about 3/200 on a maths exam. The exam instructions had said to attempt each question on a separate page, and attach the pages in the order you attempted the questions. About three of us actually read the instructions and did so. Idiot teacher marked the questions as if the first one in the bundle was Q1, the second Q2, etc., even when that plainly wasn't the case.

  • (cs) in reply to davedavenotdavemaybedave
    davedavenotdavemaybedave:
    IT Girl:
    Pete:
    Are WTF's drying up is all code in the world becoming better.

    I think we all know there are teachers in colleges and universities that don't have a clue. Those who can't do teach after all.

    That's right, those who can do, those who can't teach, and those who can do neither, criticize.

    Are you saying critics have superpowers? Because those who 'do neither' would be people who can both 'do' and 'not do' at the same time.

    Just asking, y'know.

    Let's try restating IT Girl's post:

    Those who can neither do, nor teach, criticize.

    What's the problem, exactly?

  • Thinice (unregistered) in reply to Thready Noodle
    Thready Noodle:
    My OS prof was very good but had a strong chinese accent. So when we were talking about forking processes, it would sound like "f*cking processes". Hilarity ensued when he started talking about child processes: "You must f*ck the child process. F*ck the child first!"
    • Thready

    This made my day

    Captcha: Duis, duis now!

  • (cs)

    I don't think the short circuit was in the computer...

  • Lego (unregistered) in reply to robo
    robo:
    madjo:
    And the teacher pronounced the names of certain functions weirdly. Sleep for instance was pronounced as "Slape" (as that's how you pronounce sleep in Dutch), and a thread became threed (though I'm not sure why he did that, probably because in some cases ea is pronounced as ee in English (like eat), and he stuck to it)
    My computing 4 prof and his thick accent had me wondering for quite a while what the heck a "java washing machine" was...

    Wonderful Java, write once run anywhere. Described here is the Maytag JVM, it keeps your whites white. :-)

    Writing code on paper, that is the meat JVM. From the look of things this one is seldom used these days.

    -Lego

  • Jay (unregistered) in reply to dtobias
    dtobias:
    Some of those pronunciations are in fact how English pronounced those things before the Great Vowel Shift of around 1500.

    Thus explaining for the curious pronunciations by all those college professors who learned software development prior to 1500.

  • Some Guy (unregistered) in reply to GEE
    GEE:
    When you find a modulus of a negative number the result is always positive (as it is the remainder after an integer division).

    So '% 10' limits the results to something between 0 and 9.

    import java.util.Random;

    public class Test { public static void main(String[] args) { Random r = new Random(); for (int i = 0; i < 10; i++) { int roll = r.nextInt() % 10; System.out.println(roll); } } }

    Outputs: 0 -7 -9 8 -9 -4 8 0 5 -2

    No. Just, no. Performing modulus division on a negative number always results in a negative number.

    Let's go back to "frist" grade for a moment here, and do some "remainder division".

    21 / 5 = 4R1. Simple. Dividing 5 goes into 21 4 times, leaving 1 leftover unit. Reversing this, we get 5 * 4 + 1 = 21.

    Now, let's add the not-quite-so-frist grade concept of negative numbers into the fray.

    -21 / 5 = X. We already know that we'll get -4, but what remains? The remainder is -1. Dividing a negative number by a positive one cannot result in a positive remainder. Why? Reverse the equation. 5 * -4 + X = -21. X becomes -1. So -21 / 5 = -4R-1. QED.

  • jls (unregistered) in reply to dtobias
    dtobias:
    Some of those pronunciations are in fact how English pronounced those things before the Great Vowel Shift of around 1500.

    Well, the author doesn't state how old this prof is, but my bet is that he doesn't have a 500 +/- year old speech habit.

  • Me (unregistered) in reply to dtobias
    dtobias:
    Some of those pronunciations are in fact how English pronounced those things before the Great Vowel Shift of around 1500.

    Fortunately, only a few of my professors had been teaching for that long...

  • Jay (unregistered) in reply to Cliff notes anyone
    Cliff notes anyone:
    Actually, that's how I convert numbers to strings since this is a compile error:

    double d = 1.1; String x = 1.1; // compile error String x = "" + 1.1; // works

    yes, with the Double class I could do this differently but the way I do it, it works fine.

    Except that when you do it this way, Java first creates a StringBuilder object, then appends an empty string to it, then converts 1.1 to a string, then appends this to the StringBuilder, and then converts the StringBuilder to a String.

    If instead you wrote

    String x=Double.toString(1.1);

    or

    String x=String.valueOf(1.1);

    Java would just convert 1.1. to a string and be done with it.

  • Brent (unregistered) in reply to DCRoss

    You can't be that old... otherwise "real" dice would be completely blank, and you'd need to get a marker to write in the numbers. They'd also be made of hard plastic which would eventually explode spectacularly from the repeated shock of rolling them. Which is why you don't see many of those real dice anymore.

  • Jay (unregistered) in reply to Case
    Case:
    To be honest, I think the professor was actually screwing with him for sleeping in class every day. Anyone who was awake heard his explanation that the +0 was just a placeholder for the offset you want in your random number. Then that dumbass wakes up mid-class and asks a retarded question so the prof gave him a retarded joke answer.

    Mention of the idea of an offset brings an interesting thought to mind. Assuming that you are wrong and the professor was serious, maybe some time early in his career he got a piece of example code on how to generate a random number in a given range that said "value=randomint()%span+offset". That's the generic formula. And then the person demonstrating put in an offset of 0 for an example. And he got the idea that for some reason you needed the "+0" for it to work.

  • Yatta (unregistered) in reply to Some Old Guy

    you think that's bad, we had a low level OS class where the prof could not pronounce the word "fork"... little imagination to see how he pronounced it..

  • The Bytemaster (unregistered) in reply to Cliff notes anyone
    Cliff notes anyone:

    Actually, that's how I convert numbers to strings since this is a compile error:

    double d = 1.1; String x = 1.1; // compile error String x = "" + 1.1; // works

    yes, with the Double class I could do this differently but the way I do it, it works fine.

    You mean that you program in Java the same way I see a lot of VB programmers do? Congrats to the superior language.

  • RIT_Warrior (unregistered) in reply to Case
    Case:
    To be honest, I think the professor was actually screwing with him for sleeping in class every day. Anyone who was awake heard his explanation that the +0 was just a placeholder for the offset you want in your random number. Then that dumbass wakes up mid-class and asks a retarded question so the prof gave him a retarded joke answer.

    Then when it came to the lab, the professor mocked him even further. I know if I was in that class, I'd have been laughing so hard.

    I had a professor who would do things like that. If someone was asleep and woke up in the middle of class, he would finish his sentence and say something to the effect of "and that's the answer to the super-secret exam question", or something to that effect.

    If someone slept till the end of class, he'd tell everyone to very quietly go out to the hallway, then he would turn off the lights and close the door(he taught night classes). He said he liked to imagine the student waking up at midnight and wondering how the hell they got into a dark classroom with no one around at such an hour.

  • Dolcraith (unregistered) in reply to Spoe

    I don't know about you, but when I look at my d10s they go from 0-9, I've never seen this mythical '10' side.

  • (cs) in reply to frits
    frits:
    davedavenotdavemaybedave:
    IT Girl:
    Pete:
    Are WTF's drying up is all code in the world becoming better.

    I think we all know there are teachers in colleges and universities that don't have a clue. Those who can't do teach after all.

    That's right, those who can do, those who can't teach, and those who can do neither, criticize.

    Are you saying critics have superpowers? Because those who 'do neither' would be people who can both 'do' and 'not do' at the same time.

    Just asking, y'know.

    Let's try restating IT Girl's post:

    Those who can neither do, nor teach, criticize.

    What's the problem, exactly?

    Those who teach are those who cannot do. Substitute it in and you get:

    Those who can neither do, nor not do, criticise.

    That is of course equivalent to 'Those who can both do and not do', which is a more comprehensible way to phrase it.

Leave a comment on “Surpassing the Master”

Log In or post as a guest

Replying to comment #:

« Return to Article