Page 1 of 3 123 LastLast
Results 1 to 20 of 41

Thread: Homework

  1. #1
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default 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?
    Last edited by Tscheuss; 07-19-2013 at 02:59 AM.
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  2. #2
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Lightbulb

    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.
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  3. #3
    2015 DDO Players Council Hazelnut's Avatar
    Join Date
    Jul 2013
    Location
    Canada, EST
    Posts
    888

    Default

    Quote Originally Posted by Tscheuss View Post
    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.
    Zyinniah Hazelnut and Curissa Hazelnut on most servers.

  4. #4
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default

    Quote Originally Posted by Hazelnut View Post
    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.
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  5. #5
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default 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 not sure about the next chapter, though. It's about polymorphism.

    I'm pretty sure that is still illegal in some states.
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  6. #6
    Founder & Hero cdbd3rd's Avatar
    Join Date
    Jan 2006
    Location
    Escaping Mizzery in the Tavern Attic.
    Posts
    22,586

    Default

    Quote Originally Posted by Tscheuss View Post

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

    I'm not sure about the next chapter, though. It's about polymorphism.

    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.
    CEO - Cupcake's Muskateers, Thelanis
    DDO Freebies ____ Monster Manual


  7. #7
    Community Member CheeseMilk's Avatar
    Join Date
    May 2010
    Location
    Canadia
    Posts
    1,840

    Default

    ::listens to Daft Punk instead::

  8. #8
    2015 DDO Players Council Hazelnut's Avatar
    Join Date
    Jul 2013
    Location
    Canada, EST
    Posts
    888

    Default This one I can answer.

    Quote Originally Posted by Tscheuss View Post
    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?

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

    Quote Originally Posted by Tscheuss View Post
    I'm not sure about the next chapter, though. It's about polymorphism.

    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.
    Zyinniah Hazelnut and Curissa Hazelnut on most servers.

  9. #9
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default

    Quote Originally Posted by Hazelnut View Post
    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
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  10. #10
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default

    Quote Originally Posted by cdbd3rd View Post
    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
    Last edited by Tscheuss; 07-25-2013 at 04:26 PM.
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  11. #11
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default 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.
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  12. #12
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default 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.
    Last edited by Tscheuss; 07-27-2013 at 11:20 PM. Reason: Vanishing cr/lf
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  13. #13
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default toString() or not toString()

    That is the question.

    Whether 'tis worth a better grade
    to add unrequested functionality to a project...
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  14. #14
    Community Member
    Join Date
    May 2013
    Location
    London, Great Britain
    Posts
    169

    Default

    Quote Originally Posted by Tscheuss View Post
    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. #15
    Hero Gkar's Avatar
    Join Date
    Oct 2008
    Location
    Canada
    Posts
    5,184

    Default

    Quote Originally Posted by Aolas View Post
    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.
    You have that backwards. Effort with no results should not equal a good grade.

    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. #16
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default

    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
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  17. #17
    Community Member
    Join Date
    May 2013
    Location
    London, Great Britain
    Posts
    169

    Default

    Quote Originally Posted by Gkar View Post
    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. #18
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Cool 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.
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  19. #19
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default 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. -_-
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

  20. #20
    Community Member
    Join Date
    Jan 2012
    Posts
    4,643

    Default

    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.
    Last edited by Tscheuss; 08-01-2013 at 12:40 AM.
    http://myaccount.turbine.com

    Je ne suis pas
    DDO Alpha Tester

Page 1 of 3 123 LastLast

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.

Reload