Monday, March 24th, 2008 10:48 am
for my next trick, staring into the sun
Hi and Welcome
So. Multidimensional arrays. Well.
See, I thought hell was classes. No. Hell was functions? No. Is hell, in fact, a two dimensional array? Actually, no.
Hell is a book that acts like they are just two arrays brought together magically.
Starting on Friday, through midnight Sunday, I suffered under the delusion that all I had to do was create two arrays, then bring them together with magic. Like this.
table[array1][array2]
Voila! Your work here is done. Or so the book says.
And I'm sure in some universe--the example in the book, say--that works. You might be surprised to know I cried, considered drowning myself, and opened up The Erdős–Faber–Lovász conjecture to stare at (speaking of, I'm still not sure why two people can't just belong to one committee period, because that would short circuit that entire issue right off the bat). And let me tell you, when working on unsolved graphing problems you don't even understand is preferable to spending any amount of time looking at your two dimensional array? You have reached hell.
(Seriously. Why can't two people work only one committee? I'm also weirded out by the fact the entire thing really looks neat if it's k chairs, k people and k+1 committees. I don't even know what that means but the graph has four colors and is deeply, deeply awesome and also congruent, which satisfies the small part of me that likes everything to be balanced. I ended up trying to do it three dimensionally but again, no toothpicks. I also gave the people names. Perhaps off my flist. It was more fun that way).
But you know what's so much easier than both of these? Treat the fucker like an address.
table[rows][columns]
I keep going back to read the book and they just do not even imply that. They don't! They initialize it, or enter data from it, but nowhere does it say, "Oh, by the way. Please don't take this literally. This is an address." An address. A pointer, though not officially, if you will. You don't have to create an array to take your data before hand! No, this one can do it all on its own!
One. Line. Would. Have. Saved. My. Sanity.
The only comfort I have atm is that the average grade on this is very low so far. Still have searching the char array to do (Pretty sure this isn't going well; my first attempt last night ended up with strange results that might be, oh, crazy) and organizing the data. Yeah.
I always wondered about people who said they could pass a class easily and never learn anything. It scares me that it's very possible without a lab practical, which makes me wonder why on earth there isn't one for this.
I wish there were other news, but really. Really close to writing a sternly worded letter to the book person to use examples that are, say, clearer. Using the Angry Snail Icon of Anger.
So. Multidimensional arrays. Well.
See, I thought hell was classes. No. Hell was functions? No. Is hell, in fact, a two dimensional array? Actually, no.
Hell is a book that acts like they are just two arrays brought together magically.
Starting on Friday, through midnight Sunday, I suffered under the delusion that all I had to do was create two arrays, then bring them together with magic. Like this.
table[array1][array2]
Voila! Your work here is done. Or so the book says.
And I'm sure in some universe--the example in the book, say--that works. You might be surprised to know I cried, considered drowning myself, and opened up The Erdős–Faber–Lovász conjecture to stare at (speaking of, I'm still not sure why two people can't just belong to one committee period, because that would short circuit that entire issue right off the bat). And let me tell you, when working on unsolved graphing problems you don't even understand is preferable to spending any amount of time looking at your two dimensional array? You have reached hell.
(Seriously. Why can't two people work only one committee? I'm also weirded out by the fact the entire thing really looks neat if it's k chairs, k people and k+1 committees. I don't even know what that means but the graph has four colors and is deeply, deeply awesome and also congruent, which satisfies the small part of me that likes everything to be balanced. I ended up trying to do it three dimensionally but again, no toothpicks. I also gave the people names. Perhaps off my flist. It was more fun that way).
But you know what's so much easier than both of these? Treat the fucker like an address.
table[rows][columns]
I keep going back to read the book and they just do not even imply that. They don't! They initialize it, or enter data from it, but nowhere does it say, "Oh, by the way. Please don't take this literally. This is an address." An address. A pointer, though not officially, if you will. You don't have to create an array to take your data before hand! No, this one can do it all on its own!
One. Line. Would. Have. Saved. My. Sanity.
The only comfort I have atm is that the average grade on this is very low so far. Still have searching the char array to do (Pretty sure this isn't going well; my first attempt last night ended up with strange results that might be, oh, crazy) and organizing the data. Yeah.
I always wondered about people who said they could pass a class easily and never learn anything. It scares me that it's very possible without a lab practical, which makes me wonder why on earth there isn't one for this.
I wish there were other news, but really. Really close to writing a sternly worded letter to the book person to use examples that are, say, clearer. Using the Angry Snail Icon of Anger.
no subject
From:Oh, god. This is exactly where I am right now. I laughed my ass off when i read this, and if that laughter was somewhat manically tinged...I know you understand why. Who new there was a worse hell than classes?
(- reply to this
- thread
- link
)
no subject
From:(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:It's so freakin' demoralising.
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:-Bree
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:(- reply to this
- parent
- top thread
- link
)
no subject
From:Multidimensional arrays are fun, and useful, and fun. I'm sorry the book made them way more difficult then they should have been :/
Have you done linked lists?
(- reply to this
- thread
- link
)
no subject
From:My brain thinks in arrays. I still can't take an object out of freaking queue without breaking it. My dream was haunted by "null pointer exceptions" for a very, very long time. ;)
Of course, now that I've graduated I can just use other people's linked list code. :D
-Bree
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:We did linked lists first, and they so broke my brain. I could use them now, if I needed to, which I don't, pretty much ever. Then we went on to arrays and that made so much more sense.
Hah, I had dreams about how the items in my linked lists would just...move around all by themselves >.< Then it would be all out of order, and I'd never know, and I think somewhere I had some sort of linked list loop...It was bad times for sure.
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:Bah! Give me an array any day. :D Especially since I do a lot of programming in PHP now, and the only advantage linked-lists had in most firmly structured languages is gone in PHP since arrays can be of variable non-declared length. :D
Gosh, I sound like such a dork. LOL
-Bree
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:We have lists and other fun collection objects in Java that make linked lists just not useful.
Hahaha...programmer squee
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:This is why I can never be a teacher outside of fandom. ;)
I'm such a big geek though. :D I have programmer squeeeeee. Right now I'm doing work for a website with databases and crazy arrays and being buried in that code has brought out my full-on geek.
-Bree (who signs her name because there are two people using this journal, /random disclaimer)
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:And the programmer squee? Comes with the territory, at least for us programmers who don't get to talk to other programmers much. :D (I'm so glad I still get excited about it, once you're not excited, get out of the field, too much work if you don't enjoy it.)
*needs a geek icon*
(- reply to this
- parent
- top thread
- link
)
no subject
From:(- reply to this
- parent
- top thread
- link
)
no subject
From:A 2d array is a matrix, plain and simple.
And I LOVE them. I love them.
I have, in fact, used a 3d array once because multi-dimensional arrays just make me that damn happy.
If you ever wanna see 2d arrays in lots of action: http://www.cis.uab.edu/breecita I have my code posted still for that. It's a project I did for my Multimedia Database class that pretty much analyzes pictures on a pixel by pixel basis and compares pictures based on their content.
And I really, really want to load it full of hot actors and see if it can start recognizing them. My plan is for it to become sentient, turn into Skynet, and start manufacturing thousands of clones of very, very hot men since that's what it specializes in.
:D
-Bree
(- reply to this
- thread
- link
)
no subject
From:(- reply to this
- parent
- top thread
- link
)
no subject
From:(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:Seriously, the only reason I figured any of this out was because I kept trying and trying and trying. The sad but true truth is that I just continued to be confused until I suddenly GOT it.
And getting it rarely had to do with teaching. :p
It's one of the reasons I want to teach some days. Maybe I'm not perfect, but I KNOW how useless some of the tired old ways of explaining it are.
-Bree
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:...seriously. Looking back, that was just insane.
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:(If I were a teacher, I would teach everything with arbitrary pictures of hot people doin' it. Maybe I shouldn't be a teacher.)
-Bree
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:Man, I'd take that. You know, to refresh my knowledge. ;)
-Bree
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:We can all be....refreshed.
*insert some witty remark about linked lists and 7 degrees of separation...*
(- reply to this
- parent
- top thread
- link
)
no subject
From:(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:(I'm also prone to long boring rants about how CS is traditionally taught, and could be taught better, and might do better if better addressed to different personalities/learning styles. Including what is clearly a large and untapped population of what are not just visual learners, but OMG KARL URBAN GOING TO TOWN ON THAT WOMAN'S CHIN learners.)
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:Yes, yes he is going to town (http://www.tapfer.org/karlurban/urban2.jpg) all right and I just gotta say...I feel inspired to learn. :D
I seriously learned so little from actual classes. I was somewhere in the middle of my Algorithms & Data Structures class before I really "got" classes and objects. I understood scope somewhere in the middle of my Programming Languages class, when I was building a bloody interpreter from scratch. (And oh, ouch. OUCH. Still the most painful experience of my young life.)
I actually explained Classes/Objects to someone using fanfiction once. It turned out to be a really good analogy! Much better than the freaking car or frogs or whatever the textbooks are prattling on about this week.
-Bree
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:I seriously didn't completely understand the point of encapsulation until I built the W/R archive that first time. LOL Or rather, when I sat down to try to make changes to it. Then I was like "...crap. THAT'S what encapsulation means. Not having to edit every. damn. file. because my data is being changed outside of the class."
-Bree
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:Here it's just--literally, staring at the text and googling until it clicks. And I swear the only reason the coordiate thing occurred to me was I was working on impossible graphs.
(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:I really think it's easiest to think of a 2d array as a list of arrays. The first number tells you which array to go to, and the second number tells you which "cell" of that array to look in. All this crap they do otherwise is just silly.
-Bree
ETA: Ooh, though I forgot something that I've noticed confuse people. In a 1d array you have two "values"...the key and the value stored within that location. Array[x] = y. In a 2d you have 3 values, key 1, key 2, and the value that they point to. Array[x][y] = z. Once you truly understand how that works, you can use arrays for all SORTS of tricky things. (I love to use them for counting instances of numbers. I'm a cheater. :D)
(- reply to this
- parent
- top thread
- link
)
no subject
From:(- reply to this
- parent
- thread
- top thread
- link
)
no subject
From:Though I am slightly disturbed by the possibility that I will start thinking about 2d Arrays every time I see Karl Urban now... That wouldn't do at all. :D
-Bree
(- reply to this
- parent
- top thread
- link
)
no subject
From:(- reply to this
- thread
- link
)
no subject
From:(- reply to this
- parent
- top thread
- link
)