Server upgrade complete!

Welcome to the upgraded server! If you notice anything wrong with the board, please let Jeffrey know!Free packets for study/practiceAnnounced tournament dates

Huge brain fart

Discussion of non-quizbowl topics
Post Reply
User avatar
Jeffrey Hill
Posts: 6358
Joined: Thu Apr 29, 2004 11:00 pm
Location: In between the bright lights and the far unlit unknown (aka Johnson County, KS)
Contact:

Huge brain fart

Post by Jeffrey Hill » Mon Oct 23, 2006 6:15 pm

I spent a good 15-20 minutes trying to figure out why this for loop wouldn't work:

for(int i=0; i++; i<5)
{
//code
}

Talk about forgetting fundamental CS 53... especially when I've been using all sorts of loops several times this year

LibertyMarie
Posts: 2416
Joined: Fri Apr 23, 2004 11:00 pm
Location: MO

Huge brain fart

Post by LibertyMarie » Mon Oct 23, 2006 8:07 pm

hahaha, nice one, Jeph.

East Buc & UMR
Posts: 5401
Joined: Mon Mar 15, 2004 12:00 am
Location: Gower
Contact:

Huge brain fart

Post by East Buc & UMR » Mon Oct 23, 2006 8:18 pm

and I thought my forgetting how to rotate something was bad.

LibertyMarie
Posts: 2416
Joined: Fri Apr 23, 2004 11:00 pm
Location: MO

Huge brain fart

Post by LibertyMarie » Mon Oct 23, 2006 9:01 pm

yeah, I'm disgusted.

User avatar
DeckardCain
Posts: 4400
Joined: Mon Feb 09, 2004 12:00 am
Location: Viburnum, Missouri
Contact:

Huge brain fart

Post by DeckardCain » Mon Oct 23, 2006 9:28 pm

Yep, I don't have a clue what that means, which actually makes this post rather pointless.

User avatar
Jeffrey Hill
Posts: 6358
Joined: Thu Apr 29, 2004 11:00 pm
Location: In between the bright lights and the far unlit unknown (aka Johnson County, KS)
Contact:

Huge brain fart

Post by Jeffrey Hill » Mon Oct 23, 2006 9:42 pm

Do you have to take CS 74/78 (or is it required for anybody, for that matter or just a science elective for certain majors)?

User avatar
DeckardCain
Posts: 4400
Joined: Mon Feb 09, 2004 12:00 am
Location: Viburnum, Missouri
Contact:

Huge brain fart

Post by DeckardCain » Mon Oct 23, 2006 9:52 pm

I'll eventually have to take two CS courses.
UMR Math Department wrote:Computer Science (select at least one from each of the following two groups)
( a ) Introduction to Programming (CS 53), Basic Scientific Programming (CS 073) and Computer Programming Laboratory (CS 077), Introduction to Programming  Methodology (CS 074) and Programming Methodology Lab (CS 078)
( b ) Data Structures I (CS 153), Discrete Mathematics for Computer Science (CS 158),  Introduction to Numerical Methods (CS 228)

jcarkeys
Posts: 400
Joined: Mon Dec 27, 2004 12:00 am

Huge brain fart

Post by jcarkeys » Mon Oct 23, 2006 10:01 pm

You missed a semicolon.

User avatar
Jeffrey Hill
Posts: 6358
Joined: Thu Apr 29, 2004 11:00 pm
Location: In between the bright lights and the far unlit unknown (aka Johnson County, KS)
Contact:

Huge brain fart

Post by Jeffrey Hill » Mon Oct 23, 2006 10:06 pm

jcarkeys wrote:You missed a semicolon.
I'm pretty sure I didn't although it's very common for me to do so especially when I'm messing with strings

User avatar
Jeffrey Hill
Posts: 6358
Joined: Thu Apr 29, 2004 11:00 pm
Location: In between the bright lights and the far unlit unknown (aka Johnson County, KS)
Contact:

Huge brain fart

Post by Jeffrey Hill » Mon Oct 23, 2006 10:09 pm

DeckardCain wrote: I'll eventually have to take two CS courses.
UMR Math Department wrote:Computer Science (select at least one from each of the following two groups)
( a ) Introduction to Programming (CS 53), Basic Scientific Programming (CS 073) and Computer Programming Laboratory (CS 077), Introduction to Programming  Methodology (CS 074) and Programming Methodology Lab (CS 078)
( b ) Data Structures I (CS 153), Discrete Mathematics for Computer Science (CS 158),  Introduction to Numerical Methods (CS 228)
I was thinking math might require more CS courses than the average department.

jcarkeys
Posts: 400
Joined: Mon Dec 27, 2004 12:00 am

Huge brain fart

Post by jcarkeys » Mon Oct 23, 2006 10:19 pm

ScoBo1987 wrote:
jcarkeys wrote:You missed a semicolon.
I'm pretty sure I didn't although it's very common for me to do so especially when I'm messing with strings
Actually, the only language other than HTML that I have any reasonable grasp with is PHP, so I have no clue about C++ or anything else, that's just one of the things I know I've forgotten and I hear is a common thing in C based languages to forget. It sucks trying to debug hundreds of lines of code then realizing that you missed a semicolon on line 37.

User avatar
Jeffrey Hill
Posts: 6358
Joined: Thu Apr 29, 2004 11:00 pm
Location: In between the bright lights and the far unlit unknown (aka Johnson County, KS)
Contact:

Huge brain fart

Post by Jeffrey Hill » Mon Oct 23, 2006 10:26 pm

Yeah it's definitely very common especially when you're used to a language that is much much more lenient with syntax. It's really annoying when ONE missing semicolon confuses the compiler so much that it spits out hundreds of lines of errors.

If anybody's interested in my mistake, here's the syntax for a for loop:
for(action before first time, boolean to continue, what to do after each loop through)
{
//code
}

Basically what my code did was initialize i to 0, and then checked "i++" for true/false. Since i++ increments AFTER being used, it evaluated to 0 and thus false and it never entered the loop. If i had been anything else it would have been an infinite loop.

Whereas if written correctly it would have:
i=0
0<5, so do stuff, then increment i to 1
1<5, so do stuff, then increment i to 2
2<5, so do stuff, then increment i to 3
3<5, so do stuff, then increment i to 4
4<5, so do stuff, then increment i to 5
5 not less than 5, so don't loop again and go on

LibertyMarie
Posts: 2416
Joined: Fri Apr 23, 2004 11:00 pm
Location: MO

Huge brain fart

Post by LibertyMarie » Tue Oct 24, 2006 7:44 am

Right. *shrug* a simple mistake.

Post Reply