- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
[quote user="davedavenotdavemaybedave 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.[/quote]
I can both do and not do. I can (for example) both walk and not walk, as the occasion demands. Not at the same time, mind you...
Admin
I don't know about Java, but in C# you can even do this:
1.1.ToString();
Admin
Same here, except that those that were teaching that long were either teaching medieval history (a good thing) or electronic engineering (yes I had a weird set of majors)
Admin
"The same rule holds for negative values of a: -3 (congruent) 2 (mod 5)" http://en.wikipedia.org/wiki/Modular_arithmetic
Admin
Nope, still don't have it right. Let's look at IT Girl's post again. Expanding the contractions we get:
"...those who can do, those who can not do teach..."
You added the "nor".
Just remember; do, or not do, there is no try.:-)
--Lego
Admin
There was a bug in your code, I've fixed it for you.
Admin
Hello Sailor!
Admin
Those who can, do.
Those who can't, teach.
Those who can't teach, teach gym...
Admin
Hmmm. Most 6-sided die I know have the dots 1 thru 6. Maybe we're talking dominoes with either blank or double-blank ;)
Admin
I do the same thing. IMO, the main() function should be bereft of logic to the greatest extent possible (a single if or case function is about all I'll put in there if I can help it). It should merely call other routines to do the actual work. This tends to help make the code much more readable.
Admin
Except when it's an Integer
Admin
Oh my god I hate it when someone makes that incipient statement.
After I am done performing the task it is either done or not done. But while I'm working on the task I am trying to accomplish it. I'll give it my all, to the best of my ability. But until it is finally accomplished or I fail, the best I can say is that I am trying. "Try" does not in any way imply that I am putting in less than maximum effort.
Addendum (2010-06-03 14:53): Make that "insipid", not incipient.
Admin
What is the problem here? This is a perfectly cromulent thing to do on embedded systems.
Admin
That is why you fail....
Admin
How can faculty see this level of incompetence day in and day out and not say something? The problem is that a lot of them are wtf coders themselves who would've been fired from just about any job out there but they were able to stay in school long enough to become academics. I knew plenty of folks who rarely produced programs that would compile much less be correct to turn in for assignments but they would somehow "ace" the tests and pass the class anyway. Sigh
Admin
"I've been waiting for you, Dr. Talbot. We meet again at last. The circle is now complete. When I left you, I was but the learner. Now I am the master"
"Only a master of WTF, Jibran"
Admin
Incipient statement?
Try "insipid", that'll actually make sense.
Admin
I'm really not sure what point you're making. Frits quite correctly added the 'nor' when rearranging the sentence. Either way, it's obvious that logically you cannot be both something and its negation. Whatever X and not-X are, something cannot, by definition, be both at the same time.
Perhaps the double- and triple-negatives are the confusing part?
Admin
Ahh, yes, when I took DP 101 we all quickly learned you do not tell the instructor his code didn't compile, or here's what the computer really does. You just figure out what it takes to make it work, and turn in your result. Even the little old Mexican lady -- who needed to have the concept of "variables" explained over and over again every day -- understood that you don't challenge the teacher.
He reminded us frequently that he really had worked "in industry" a couple years, but decided that teaching was more noble, even though it paid less.
Captcha: ratis. Waiter, a ratis in my soup! Or, I'm staying at the ratisin hotel.
Admin
Admin
FTFY - there is no "Try".
Admin
Or simply ...
Admin
Then as I understand it something is wrong with Java's modulo operator. Modulo is supposed to return the remainder upon division by a x. But if you look at number theory specifically the division algorithm remainders are always positive or zero.
Specifically, the division algorithm states that given two integers a and d, with d ≠ 0
There exist unique integers q and r such that a = qd + r and 0 ≤ r < | d |, where | d | denotes the absolute value of d.
http://en.wikipedia.org/wiki/Division_algorithm
Interestingly enough I tested this in c++ and I ran into the same problem though I had to introduce the negative by using another random number to determine if we multiplied by -1 (since c++ random numbers are positive only). I wonder if it is how the languages are defined or if it is how the processor carries it out.
Admin
There must be a short circuit inside the server letting me post this comment!
Admin
Almost snorted coffee into my monitor :)
Admin
Any explanation that includes the phrase "...so that the computer actually understands that you want..." is not an explanation.
How do people get any CS degree without knowing that computers don't understand anything. Computers are not sentient and that everything is pure math to them.
Admin
Buddy, you are my hero. /Feature
Admin
Admin
Maybe next time you won't sleep through my class.
Admin
How do you think an inductor works? And how did the chaired professor say it does?
Admin
That's how they get past the screening door.
Admin
Never studied quantum mechanics did you?
Admin
No idea how this got here, but I'm the one who actually went through this whole ordeal, or an exactly same one if there's another Jibran somewhere. And believe it or not, the teacher WAS actually 'knowledgeable' enough to give this gem of an advise. Made me laugh for at least 5 mins reading this here.
Admin
The example was almost correct if it was a C program.
In C, after you generate the random number, you have to add '0' to it, which basically adds the ascii code for 0. Having any numerical value (between 0 and 9) added to the ascii code for '0' will give you the ascii digits 0 through 9.
Java just knows it's an integer and returns it as such.
Admin
You both missed my actual point. The main function contains a single function call, and nothing else. In effect, the prof has renamed the main function. The java snippet is logically equivalent to the C code:
#define notMain main int notMain () { // The simplest possible main() is no main() at all!!! woo!!! }
Main has not been simplified, it's been moved
To digress a bit, IMHO, the 'keep main as simple as possible' rule is misguided. I've encountered no convincing rationale for treating main() any differently from any other function in an application, and the same reasoning one uses when deciding to create a subroutine in any other function applies to main. The biggest reasons to create a subroutine are to reuse code, or to segregate a large block of code with a common logical purpose. Usually, moving code which is not logically a subcomponent of a routine into a subroutine impedes understanding, so it is poor practice to arbitrarily move logic into a subroutine simply to make a routine shorter. This logic applies to main() in the same way it applies to any other function.
One always has to keep account for the fact that subroutines have an inherent cost in ease of understanding. When you move to a different location in source to view a subroutine, you have to keep contextual information in your own memory, rather than having it right in front of you.
The principle shouldn't be "Always keep main() as short as possible", it should be "Friends don't let friends pack an entire program into main(). Always use subroutines when they're called for."
But then, I'm a C programmer. Account for subjective sanity modifier offsets as necessary.
Admin
Randomth?
Admin
Admin
Admin
You have made the case that you (and everyone else) criticize.
Of course the more accurate wording based on expansion of the critic's post is: Those who can, do. Those who can't, teach. Those who neither can, nor can't, criticize.
So the resulting set of those who criticize is empty.
Admin
Come on, people! It's a ten-sided dice, but given the RPG context, it's pretty clear: you roll 10's and then you add your player's initiative stat. Clearly, the instructor didn't fare too well when he created his College CompSci Cave Goblin Level 1.
Admin
MUST remember to turn off L to R converter... (or so the professor should have known)
Admin
And to the guy with the 0 on his six-siders: How crappy are the characters you roll, given you've got a stat range of 0 - 15?
Admin
Those who can do................TRUE Those who can't teach...........FALSE Those who do neither criticize..File not found!
It is more fun when the instructor/professor actually knows the subject. It was demonstrated to me when he was having the whole class demonstrate string reversal programs for him and the class. One loaded the program and started it, to which the professor gladly typed in a palindrome as input. IT took a while, but he eventually explained what he was doing, much to the relief of the student. On a related note, don't use '-40' as input to a Celsius to Fahrenheit converter.
As for "adding zero", one computer I worked on when converting from double precision numbers to single precision numbers sometimes produced "denormalized" numbers. The solution was to add zero, which produced the properly normalized number. So sometimes it IS needed.
Admin
Nope you've got me confused with memories of your own life full of fail :-) Ha!!! Douchebag...
Admin
Odd. Most dice I've seen don't have a blank side- there is a side with a zero on it.
It's opposite the site with six zeroes. :)
Admin
The number theorists start from defining a non-negative remainder and as a consequence have integer division always round down (or toward minus infinity, if you will).
Most programming languages start from defining integer division to round towards zero and as a consequence sometimes have negative remainders, as they still want to keep the equation a * (a div b) + (a mod b) = a.
Admin
Of course the +0 is necessary. It's there to account for integer round-off error.
Admin
ROR!
Admin
False True
Perl motto: there's more than one way to do it (and most of them make your eyes bleed and your soul go running to embrace Satan).
Admin
Are you really comparing your programming "career" with NCAA or NBA basketball? You wish.
Many "best practices" are not.
Don't forget where computation came from. Academia. Don't forget where functional programming came from. Academia. Don't forget where OO programming came from. Academia. If OO is as far as you have got, you are either 30 or 5,000 years behind, depending on who is counting.