1. ## Homework

Sets and Tuples.

They are different, right?

I mean, the elements in a set are not ordered, and the elements in a tuple are ordered.

- - - - - - - Sets - - - - - - - - - - - - - - - - Tuples - - - - - - -
{1, 2, 3, 4} = {1, 3, 2, 4} but (1, 2, 3, 4) <> (1, 3, 2, 4)

So, if I am presented with a group of sets, curly braces and all, and asked which are ordered sets, my answer is none, right?

Since by definition, sets are unordered.

Or did I miss something?

2. While looking at how set theory ties in with relational databases, I realized that the columns in tables are sets. Yeah, I know. Most of you are looking at me like I said water is wet, but this is something new to me. I was looking at the obvious, that a record was a set of related fields, and a table is a set of related records. Then I fixed on the word 'related'. Each column is a set of items of the same type. A set of last names, a set of ID numbers, a set of birthdays, etc.

When I cross all of these sets (columns) in a table, I get a Cartesian product that is the set of all ordered combinations of these sets. Every record is an element of, and a subset of, said Cartesian product, and a subset of a Cartesian product is called a relation.

Enough homework for now; my head is starting to hurt.

3. Originally Posted by Tscheuss
While looking at how set theory ties in with relational databases, I realized that the columns in tables are sets. Yeah, I know. Most of you are looking at me like I said water is wet, but this is something new to me. I was looking at the obvious, that a record was a set of related fields, and a table is a set of related records. Then I fixed on the word 'related'. Each column is a set of items of the same type. A set of last names, a set of ID numbers, a set of birthdays, etc.

When I cross all of these sets (columns) in a table, I get a Cartesian product that is the set of all ordered combinations of these sets. Every record is an element of, and a subset of, said Cartesian product, and a subset of a Cartesian product is called a relation.

Enough homework for now; my head is starting to hurt.
You expect me to remember stuff I studied 20 years ago? Do I look like a university professor to you?

Thanks! I've been wanting to use the rolleyes smilie for ages.

4. Originally Posted by Hazelnut
You expect me to remember stuff I studied 20 years ago? Do I look like a university professor to you?

Thanks! I've been wanting to use the rolleyes smilie for ages.
20 years ago?!? Why, that means you're... erm... let's see...
carry the 3?

*takes off socks

Um, maybe I should just forget the math. I mean, I mustn't get distracted from my homework.

Yeah, that's it. I need to go do my homework.

5. ## Java? But I don't like coffee.

Okay. I got the hang of objects in general, and classes. I know they are the same, but different. So, classes hold the methods and properties that belong to the objects they represent. Inheritance is simple; we covered that in biology - dog is mammal is vertebrate...

I need to keep reading to find out why Java doesn't have multiple inheritance, while C++ does.

I'm pretty sure that is still illegal in some states.

6. Originally Posted by Tscheuss

I need to keep reading to find out why Java doesn't have multiple inheritance, while C++ does.

I'm pretty sure that is still illegal in some states.

Java question: http://javapapers.com/core-java/why-...orted-in-java/

Polymorphism = illegal only if you get caught.

7. ::listens to Daft Punk instead::

8. ## This one I can answer.

Originally Posted by Tscheuss
Okay. I got the hang of objects in general, and classes. I know they are the same, but different. So, classes hold the methods and properties that belong to the objects they represent. Inheritance is simple; we covered that in biology - dog is mammal is vertebrate...
A class is a definition of something that doesn't exist yet. An object is the existence of the thing that is defined by a class. Does that make sense?

Originally Posted by Tscheuss
I need to keep reading to find out why Java doesn't have multiple inheritance, while C++ does.
Because Java is broken, badly broken.

Originally Posted by Tscheuss

I'm pretty sure that is still illegal in some states.
Yes. It should be illegal globally.

Once upon a time, a programmer wrote everything in machine language (ya, binary). Then they got lazy and created this thing called automatic programming which later got renamed to assembly language (no, I'm not kidding). Then they got sick of repeating bits of assembly and created macro assembly. Then some bright guys decided to bundle together a bunch of macros to make things even easier and called it "B" (really). "B" was okay but they wanted it to go a bit further, so they added some more complexity to the "macros" and called their new language "C". Then things started to get weird.

9. Originally Posted by Hazelnut
A class is a definition of something that doesn't exist yet. An object is the existence of the thing that is defined by a class. Does that make sense?
...
Yes. I have been watching my grandpa's Star Trek DVD's. A class is like a transporter pattern, and an object is what materializes from that pattern.
Textbook uses the analogy of blueprints vs. actual car, but there is too much build time for me to like that. I need a faster analogy, and I think it's way cool I can use one from an antique story set in the future.

I think you two are teasing me about polymorphism. I am sure it doesn't mean what it sounds like, or it wouldn't be in the book. lol

10. Originally Posted by cdbd3rd
Java question: http://javapapers.com/core-java/why-...orted-in-java/

Polymorphism = illegal only if you get caught.
Thanks for the link, CD. It doesn't meet the reqs for a cite, but it gives me something to watch for as I scan my text.

ETA: I cited the whitepaper that your link cited. It was old, but still relevant for that question. ty

11. ## From Math to Coding

Functions and their use in programming pertaining to code re-use.

Okay, if I have a series of step I may need to repeat, I can put them in their own procedure.
(Gah!) Twice I had to correct there to their. I know better than that, but the fora seem to be contaminating my spelling. *sigh*)

If the steps are a little broad in scope, I may instead write two or more procedures to call as needed. Better than rewriting extra lines.

Built-in functions vs. User-defined functions.

I think the names are self-explanatory, but anyway. Applications and programming languages may have functions inherent in their features, so they are easily performed by a user. For example, MS Access has built-in functions for finding the maximum, minimum, and average values in a given column of a recordset. User-defined functions do things that weren't in the original product.

12. ## Class is in session

Now I get to make a class with private variables, set/get methods, constructors, and a calculating method. I also get to write a routine, erm... class, that tests the features of the real, erm... first, class. This should be fun.

Note: Insisting on converting the Main() procedure into a class is just STUPID. imho.

13. ## toString() or not toString()

That is the question.

Whether 'tis worth a better grade
to add unrequested functionality to a project...

14. Originally Posted by Tscheuss
That is the question.

Whether 'tis worth a better grade
to add unrequested functionality to a project...
It wouldn't hurt. When I did my computer science coursework the hotel booking system software I wrote actually didn't work that well. However I composed a 150+ page instruction manual and my tutor gave me an A for the project; I doubt he ever read it, at least not all of it. Mostly it's about the effort you put in. If you are willing to work hard the teacher is less likely to discourage you with poor grades even if you made a hash of it. Well, a good teacher anyway.

Just be wary though. Intelligence is a prison and life is about happiness and fulfillment not achievement or academic superiority. The more intelligent you are, the more ostracised you become from members of your own species; it can lead to a lonely life.

15. Originally Posted by Aolas
It wouldn't hurt. When I did my computer science coursework the hotel booking system software I wrote actually didn't work that well. However I composed a 150+ page instruction manual and my tutor gave me an A for the project; I doubt he ever read it, at least not all of it. Mostly it's about the effort you put in. If you are willing to work hard the teacher is less likely to discourage you with poor grades even if you made a hash of it. Well, a good teacher anyway.

Just be wary though. Intelligence is a prison and life is about happiness and fulfillment not achievement or academic superiority. The more intelligent you are, the more ostracised you become from members of your own species; it can lead to a lonely life.
Bull.

Only poor personality/social skills leads to you being ostracised. If you the smartest person on the planet and you have good social skills and a good personality that everyone will love you.

16. Well, I had to include a test class, too, so I overrode the toString method for ease of use. I needed multiple prints to test setter validations, so I also built a testPrint method in the test class so I wouldn't need to copy the code.

Instantiate and initialize
Print
Alter variable
Print
Reset, then alter next variable
Print
.
.
.
Done

17. Originally Posted by Gkar
Only poor personality/social skills leads to you being ostracised. If you the smartest person on the planet and you have good social skills and a good personality that everyone will love you.
I'm not the smartest person on the planet so I won't argue. Anyway it looks like it's off topic for this particular thread.

18. ## Easy A

Had to build a function (math) that added, divided, and multiplied in order. Then input a range of values and create a table of inputs/outputs. Then express the results as a relation R, identify range and domain. Finally, look at three relations and determine whether they were functions, and include reason for decision.

P.S. All three relations did not represent functions for the same reason - more than one output for a given input.

19. ## New assignments

Now I get to deal with exception handling in one class, and recursion and combinatorics in another. Oh, and tests this week, also. <yawn>

Who knew they had special math books for IS? Fortunately, a lot of it seems to be much like what I have already studied, but they like to talk about it like it's different. -_-

20. I am thinking that exception handling is mandatory for any code that is going to interact with people in any uncontrolled fashion. People are sloppy and imprecise, and a programmer needs to user-proof her code. This is especially true when using a language that doesn't have so much validation built in.

I mean like seriously, Java has a getNextInt that breaks when you give it something other than an integer. Weak sauce.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

This form's session has expired. You need to reload the page.