OSG Community College C# Beginners Class #3 Log 02/19/2009

0 views
Skip to first unread message

AdelleF

unread,
Feb 22, 2009, 5:43:09 PM2/22/09
to OSG Community College
There are two chat logs as the group was split for the task.
Pastebins are at the bottom.


[2009/02/19 12:58] Adelle Fitzgerald: hello!
[2009/02/19 12:58] Snowdrop Short: hi Adelle
[2009/02/19 12:58] M1sha Dallin: Talking of bumpy - I did a bit more
playing with the Groups problem from Tuesday
[2009/02/19 12:58] M1sha Dallin: Hi Adelle
[2009/02/19 12:58] Snowdrop Short: it seems to be the big night for
ghosts
[2009/02/19 12:58] Adelle Fitzgerald: M1sha, Snowdrop, youre both
clouds
[2009/02/19 12:59] M1sha Dallin: Snap
[2009/02/19 12:59] Adelle Fitzgerald: I am too?
[2009/02/19 12:59] M1sha Dallin: You and Snowdrop are to me
[2009/02/19 12:59] Snowdrop Short: yes
[2009/02/19 12:59] Adelle Fitzgerald: oh well
[2009/02/19 12:59] Tinsel Silvera: hello everyone
[2009/02/19 12:59] Snowdrop Short: what did you do M1sha?
[2009/02/19 12:59] Adelle Fitzgerald: hi Tinsel
[2009/02/19 12:59] M1sha Dallin: http://www.pastebin.ca/1342213
[2009/02/19 12:59] Tinsel Silvera: everyone is an orb to me
[2009/02/19 12:59] Tinsel Silvera: {:o)
[2009/02/19 13:00] M1sha Dallin: Added a number of methods and some
test code
[2009/02/19 13:00] M1sha Dallin: also changed to a dictionary
[2009/02/19 13:00] Snowdrop Short: I don't know what's wrong, this
sim is supposed to be better than the old one
[2009/02/19 13:01] Adelle Fitzgerald: hmm, i dont think the version
has changed since tuesday either
[2009/02/19 13:01] M1sha Dallin: May just be the Asset server
[2009/02/19 13:01] M1sha Dallin: I was a cloud to me at my own sim -
corrected after a teleport
[2009/02/19 13:01] Adelle Fitzgerald: just gonna quickly relog
[2009/02/19 13:03] Adelle Fitzgerald: hmm, no better i suspect
[2009/02/19 13:03] Snowdrop Short: wow .. M1sha you've really gone
quite a ways
[2009/02/19 13:03] Tinsel Silvera: i see adelle now
[2009/02/19 13:03] Snowdrop Short: I'm going to relog too
[2009/02/19 13:04] Tinsel Silvera: is there any way of copying from
pastebin without it taking the line numbers?
[2009/02/19 13:04] M1sha Dallin: Yep - scroill down
[2009/02/19 13:04] Tinsel Silvera: k
[2009/02/19 13:05] M1sha Dallin: there without line numbers in the
other pane
[2009/02/19 13:05] Tinsel Silvera: duh
[2009/02/19 13:05] Tinsel Silvera: i see that
[2009/02/19 13:05] Tinsel Silvera: geesh
[2009/02/19 13:05] Tinsel Silvera: i need new glasses
[2009/02/19 13:05] M1sha Dallin: Think I need some idea of what the
overall design is
[2009/02/19 13:05] M1sha Dallin: or should be
[2009/02/19 13:06] M1sha Dallin: I've guessed what might be useful
[2009/02/19 13:08] eaglefx Binder: good evening
[2009/02/19 13:08] M1sha Dallin: Hi
[2009/02/19 13:08] Tinsel Silvera: hello eagle
[2009/02/19 13:08] Adelle Fitzgerald: hi eagle
[2009/02/19 13:08] eaglefx Binder: Hio
[2009/02/19 13:08] eaglefx Binder: oh nice outfit ;)
[2009/02/19 13:08] Adelle Fitzgerald: wlw clouds everywhere
[2009/02/19 13:08] eaglefx Binder: hehe
[2009/02/19 13:08] Adelle Fitzgerald: *wow
[2009/02/19 13:08] Adelle Fitzgerald: who? me?
[2009/02/19 13:08] eaglefx Binder: yes ;)
[2009/02/19 13:09] Adelle Fitzgerald: thanks :)
[2009/02/19 13:09] M1sha Dallin: Adelle is OK to me now
[2009/02/19 13:09] Tinsel Silvera: i see snowdrop
[2009/02/19 13:09] eaglefx Binder: Hi Snowdrop
[2009/02/19 13:09] M1sha Dallin: and Snowdrop is OK
[2009/02/19 13:09] eaglefx Binder: I see all
[2009/02/19 13:09] M1sha Dallin: welcome back
[2009/02/19 13:09] eaglefx Binder: where is all the sitting balls
[2009/02/19 13:09] Snowdrop Short: actually I'm not quite ok
[2009/02/19 13:09] Snowdrop Short: but a big part of my inventory is
gone
[2009/02/19 13:10] M1sha Dallin: ouch
[2009/02/19 13:10] Adelle Fitzgerald: oh no
[2009/02/19 13:10] eaglefx Binder: creepy
[2009/02/19 13:10] eaglefx Binder: some theft?
[2009/02/19 13:10] Snowdrop Short: I really don't know
[2009/02/19 13:10] Starky Rubble: Asset Issues is the technical term
[2009/02/19 13:11] Starky Rubble: I think
[2009/02/19 13:11] eaglefx Binder: allright
[2009/02/19 13:12] Starky Rubble: yikes lotsa issues lol
[2009/02/19 13:12] Christy Lock: hello all
[2009/02/19 13:12] Snowdrop Short: hi
[2009/02/19 13:12] Starky Rubble: hi
[2009/02/19 13:12] Snowdrop Short: nebadon is looking into things
right now
[2009/02/19 13:12] Snowdrop Short: in the mean time, we should get
started
[2009/02/19 13:12] eaglefx Binder: who Hi Christy
[2009/02/19 13:12] Snowdrop Short: hi all
[2009/02/19 13:12] eaglefx Binder: with no who ;)
[2009/02/19 13:12] Snowdrop Short: :-)
[2009/02/19 13:13] eaglefx Binder: why is there no sti balls
[2009/02/19 13:13] eaglefx Binder: sit
[2009/02/19 13:13] M1sha Dallin: Hi Christy
[2009/02/19 13:13] Adelle Fitzgerald: there are two next to M1sha
[2009/02/19 13:13] Starky Rubble: Flakyness in the grid Eagle
[2009/02/19 13:13] eaglefx Binder: oki
[2009/02/19 13:13] eaglefx Binder: i dont see any yet
[2009/02/19 13:13] eaglefx Binder: maybe i gotta relog
[2009/02/19 13:13] Starky Rubble: theres one to my left
[2009/02/19 13:13] Adelle Fitzgerald: hmm, maybe those asset issues
[2009/02/19 13:14] Starky Rubble: same same I imagine
[2009/02/19 13:14] Starky Rubble: be careful when building lol
[2009/02/19 13:14] Starky Rubble: always keep an oar in the water
[2009/02/19 13:15] eaglefx Binder: ah there it is
[2009/02/19 13:16] Starky Rubble: oops - life is but a dream lol
[2009/02/19 13:16] eaglefx Binder: u are a cloud M1sha
[2009/02/19 13:16] eaglefx Binder: didnt you drees before you
came ... lol
[2009/02/19 13:16] M1sha Dallin: :-)
[2009/02/19 13:16] Starky Rubble: at least shes here
[2009/02/19 13:16] eaglefx Binder: hehe
[2009/02/19 13:16] eaglefx Binder: well i was kidding
[2009/02/19 13:17] M1sha Dallin: I got a prompt that Christy was
online th emoment she disappeared
[2009/02/19 13:17] eaglefx Binder: you are a cloud too starky
[2009/02/19 13:17] M1sha Dallin: something is borked
[2009/02/19 13:17] eaglefx Binder: well adelle and me is not a cloud
[2009/02/19 13:17] M1sha Dallin: wb Christy
[2009/02/19 13:17] Christy Lock: ty
[2009/02/19 13:17] eaglefx Binder: anmd cristy is good too
[2009/02/19 13:17] Christy Lock: yeah my land the same way half
clouds
[2009/02/19 13:18] eaglefx Binder: oh seems like this is unstable
[2009/02/19 13:18] BlueWall Slade: seems fine to me
[2009/02/19 13:18] BlueWall Slade: Hello
[2009/02/19 13:19] Snowdrop Short: hi
[2009/02/19 13:19] Snowdrop Short: Sorry about that
[2009/02/19 13:19] Adelle Fitzgerald: hi Blue
[2009/02/19 13:19] Snowdrop Short: I crashed and had trouble getting
back in
[2009/02/19 13:19] Snowdrop Short: apparently the ghosting thing has
to do with the version of the sim where you came from
[2009/02/19 13:20] eaglefx Binder: am i a ghost too?
[2009/02/19 13:20] Snowdrop Short: no
[2009/02/19 13:20] BlueWall Slade: there is a lot of work in teh
cooms for the region s
[2009/02/19 13:20] eaglefx Binder: ok
[2009/02/19 13:20] BlueWall Slade: so there wil be a few things pop
up
[2009/02/19 13:20] BlueWall Slade: but, this seems really stable and
responsive to me
[2009/02/19 13:20] eaglefx Binder: starky is gone?
[2009/02/19 13:21] Christy Lock: listen events and timers still fail
on my land
[2009/02/19 13:21] Christy Lock: had them for 8474 then gone again
[2009/02/19 13:21] M1sha Dallin: Hey - just noticed - the viewer
clock and real time clock are in sync
[2009/02/19 13:21] eaglefx Binder: you will have to pur some coke
into the puter to make it run smoother ;)) also called the Brown
Gold ;)
[2009/02/19 13:21] M1sha Dallin: they used to be 20 minutes out
[2009/02/19 13:21] Adelle Fitzgerald: eek scary!
[2009/02/19 13:21] BlueWall Slade: we're catching up, lol
[2009/02/19 13:22] Snowdrop Short: running on head is not easy, but
somebody has to do it :-)
[2009/02/19 13:22] Snowdrop Short: except is it running pst and not
gmt
[2009/02/19 13:22] BlueWall Slade: I have been building here today,
and it was stabel
[2009/02/19 13:22] Starky Rubble: am I here?
[2009/02/19 13:22] Snowdrop Short: yes, partially
[2009/02/19 13:22] BlueWall Slade: not busy with traffic though
[2009/02/19 13:23] eaglefx Binder: yep as a cloud from the owen ;)
[2009/02/19 13:23] Snowdrop Short: but you seem to have tp'ed in from
a sim running on an older version
[2009/02/19 13:23] BlueWall Slade: starky - try to re-wear your
clothes?
[2009/02/19 13:23] Snowdrop Short: I think of 'em as ghosts
[2009/02/19 13:23] Starky Rubble: Well mist is better thn nuttin lol
[2009/02/19 13:23] Christy Lock: onward through the fog
[2009/02/19 13:24] Snowdrop Short: I whish there was a way to do that
on purpose, sometimes it is kind of cool to be a ghost
[2009/02/19 13:24] Christy Lock: onward even though we are fog
[2009/02/19 13:24] Snowdrop Short: ok
[2009/02/19 13:24] M1sha Dallin: How old id old - I tp'd from 8477
[2009/02/19 13:24] Christy Lock: hey starsky I see you now
[2009/02/19 13:24] Snowdrop Short: 8447, they say
[2009/02/19 13:25] Snowdrop Short: ok
[2009/02/19 13:25] Snowdrop Short: although I've lost a bit of weight
since last
[2009/02/19 13:25] Starky Rubble: heh
[2009/02/19 13:25] eaglefx Binder: lol
[2009/02/19 13:25] Snowdrop Short: I think we should get started
[2009/02/19 13:26] Snowdrop Short: I think last time we looked at
basic statements
[2009/02/19 13:26] Snowdrop Short: of c#
[2009/02/19 13:26] Snowdrop Short: and some good and not so good ways
of writing code
[2009/02/19 13:26] Adelle Fitzgerald nods
[2009/02/19 13:27] Snowdrop Short: and today, I think we should try
to talk about objects
[2009/02/19 13:27] Starky Rubble: ok
[2009/02/19 13:27] Snowdrop Short: and object orientated programming
[2009/02/19 13:28] Snowdrop Short: lets start from where we left off
last
[2009/02/19 13:28] Snowdrop Short: http://www.pastebin.ca/1342276
[2009/02/19 13:29] Snowdrop Short: I think that's where we left off
last
[2009/02/19 13:29] Snowdrop Short: has everybody got it?
[2009/02/19 13:29] Adelle Fitzgerald: yep
[2009/02/19 13:29] M1sha Dallin: yep
[2009/02/19 13:29] Starky Rubble: yes'm
[2009/02/19 13:30] eaglefx Binder: yup
[2009/02/19 13:30] Snowdrop Short: good
[2009/02/19 13:30] Christy Lock: kk yes
[2009/02/19 13:30] Snowdrop Short: what you see here is an example of
what is called "functional" programming
[2009/02/19 13:31] Starky Rubble: right
[2009/02/19 13:31] Snowdrop Short: the principle behind functional
programming is that you write some
[2009/02/19 13:31] Starky Rubble: or procedural
[2009/02/19 13:31] Snowdrop Short: "Functions"
[2009/02/19 13:31] Snowdrop Short: you input some date into a
function, it performs its magic
[2009/02/19 13:32] Snowdrop Short: and outputs a result
[2009/02/19 13:32] Snowdrop Short: in the example here
[2009/02/19 13:32] Snowdrop Short: we input a year
[2009/02/19 13:32] Snowdrop Short: and the output is a day and a
month
[2009/02/19 13:33] Snowdrop Short: in object oriented programming we
do the opposit
[2009/02/19 13:33] Snowdrop Short: we have some data
[2009/02/19 13:33] Snowdrop Short: e.g. a date
[2009/02/19 13:33] Snowdrop Short: and then we send a signal to the
data, to do something
[2009/02/19 13:34] Snowdrop Short: e.g. calculate the day of easter
sunday of the year
[2009/02/19 13:34] Snowdrop Short: so we could have a piece of data,
containing a date
[2009/02/19 13:34] Snowdrop Short: and then say something like
[2009/02/19 13:35] Snowdrop Short: date.FindEasterSundayOfTheYear()
[2009/02/19 13:36] Starky Rubble: right
[2009/02/19 13:36] Snowdrop Short: or date.PrintEasterSundayOfTheYear
()
[2009/02/19 13:36] Snowdrop Short: so in a way we reverse the process
[2009/02/19 13:37] Snowdrop Short tries to scan the place for faces
which looks confused
[2009/02/19 13:37] eaglefx Binder: hehe
[2009/02/19 13:37] M1sha Dallin: I'm happy :-)
[2009/02/19 13:37] Starky Rubble: its a tricky percutual shift
[2009/02/19 13:37] eaglefx Binder: i will see when easter arrives ;)
[2009/02/19 13:37] Starky Rubble: perceptual
[2009/02/19 13:38] Snowdrop Short: yes, it is a big shift in
perspective
[2009/02/19 13:38] Snowdrop Short: and one that many has a difficult
time understanding
[2009/02/19 13:38] Starky Rubble: I am hoping that in a few weeks I
can think OOP rather than the old way
[2009/02/19 13:38] Christy Lock: it reminds me of spanish
[2009/02/19 13:38] Starky Rubble: right
[2009/02/19 13:39] Snowdrop Short: some people get it in a week
[2009/02/19 13:39] Snowdrop Short: some ... well, they need more time
[2009/02/19 13:39] Starky Rubble: heh
[2009/02/19 13:39] Snowdrop Short: but it is a concept which is core
to c#
[2009/02/19 13:39] Adelle Fitzgerald: so the data can be a variable
that is inputted, or sent by another program, then that lies dormant
until we call on the object?
[2009/02/19 13:40] Snowdrop Short: actually you ask the data to send
it self
[2009/02/19 13:40] Snowdrop Short: or you ask it to be inputtet
[2009/02/19 13:40] Starky Rubble: the data being one aspect of the
object
[2009/02/19 13:40] Snowdrop Short: like date.ReadFromConsole()
[2009/02/19 13:41] Adelle Fitzgerald: so
date.PrintEasterSundayOfTheYear(), is actually
<variable>.PrintEasterSundayOfTheYear() ?
[2009/02/19 13:41] Snowdrop Short: or data.Upload()
[2009/02/19 13:41] Snowdrop Short: yes
[2009/02/19 13:41] Adelle Fitzgerald: ahhhh
[2009/02/19 13:41] Adelle Fitzgerald: i get it!
[2009/02/19 13:41] Christy Lock: house.big() instead of the big house
or house = big_house?
[2009/02/19 13:41] Snowdrop Short: if you want to have the house
change from a small one to a big one
[2009/02/19 13:42] Snowdrop Short: you say house.GrowBig()
[2009/02/19 13:42] Christy Lock: yes
[2009/02/19 13:42] Christy Lock: ok
[2009/02/19 13:42] Starky Rubble: is it always noun.verb?
[2009/02/19 13:42] Snowdrop Short: yes
[2009/02/19 13:42] Starky Rubble: good
[2009/02/19 13:43] Snowdrop Short: ok
[2009/02/19 13:43] Snowdrop Short: so I was thinking...
[2009/02/19 13:43] Snowdrop Short: no .. scrap that for now :-)
[2009/02/19 13:43] Adelle Fitzgerald: hehe
[2009/02/19 13:44] Snowdrop Short: so the programming language needs
to have some way of defining the data
[2009/02/19 13:44] Snowdrop Short: and the operations we want to
perform
[2009/02/19 13:44] Snowdrop Short: that's why we talk about "object
oriented languages"
[2009/02/19 13:45] Snowdrop Short: because the language has some
instructions which allows us to define data and the operations allowed
on that data
[2009/02/19 13:45] Snowdrop Short: in c# and most all other languages
[2009/02/19 13:45] Snowdrop Short: the most important thing is
[2009/02/19 13:46] Snowdrop Short: class <name> { .... some
definitions }
[2009/02/19 13:46] Snowdrop Short: if you look in the pastebin
[2009/02/19 13:46] Snowdrop Short: you can see one
[2009/02/19 13:47] Adelle Fitzgerald: yes, MainClass
[2009/02/19 13:47] Snowdrop Short nods
[2009/02/19 13:47] Snowdrop Short: that's how classes are defined
[2009/02/19 13:48] Snowdrop Short: when we talk about things
[2009/02/19 13:48] Snowdrop Short: we think in terms of classes and
objects
[2009/02/19 13:48] Snowdrop Short: the class is the definition
[2009/02/19 13:48] Snowdrop Short: or the template
[2009/02/19 13:50] Starky Rubble: and the objects are instances of
that definition?
[2009/02/19 13:50] Snowdrop Short: pastebining
[2009/02/19 13:50] Snowdrop Short: yes
[2009/02/19 13:51] Snowdrop Short: http://www.pastebin.ca/1342292
[2009/02/19 13:51] Snowdrop Short: here you see a very simple class
[2009/02/19 13:51] Snowdrop Short: there are no operations we can
perform on it
[2009/02/19 13:51] Snowdrop Short: and it can contain two pieces of
data
[2009/02/19 13:51] Snowdrop Short: Name and Age
[2009/02/19 13:52] Snowdrop Short: so the "variable" declarations are
inside the class
[2009/02/19 13:52] Snowdrop Short: that's an important thing to
observe
[2009/02/19 13:53] Snowdrop Short: but remember the class is just
static code
[2009/02/19 13:53] Snowdrop Short: only when we "instantiate" and
instance of Person do we have an object
[2009/02/19 13:54] Snowdrop Short: and the variables (which is called
"Properties", in OO programming) will contain values
[2009/02/19 13:54] Snowdrop Short: like "Bluewall Slade" for name
[2009/02/19 13:54] Snowdrop Short: and Age could be "Indeterminate"
[2009/02/19 13:54] Starky Rubble: using New
[2009/02/19 13:55] Starky Rubble: to create it?
[2009/02/19 13:55] Snowdrop Short: yes, so we could say
[2009/02/19 13:55] Snowdrop Short: <variable> = new Person();
[2009/02/19 13:55] Snowdrop Short: remember in C# case matters
[2009/02/19 13:56] Snowdrop Short: so New is not the same as new
[2009/02/19 13:56] Starky Rubble: heh
[2009/02/19 13:56] Snowdrop Short: New != new
[2009/02/19 13:57] Snowdrop Short: lets try to add and operation to
that class
[2009/02/19 13:58] Snowdrop Short: http://www.pastebin.ca/1342298
[2009/02/19 13:59] Christy Lock: kk I see it
[2009/02/19 13:59] Starky Rubble: mm hmm...
[2009/02/19 13:59] Snowdrop Short: in functional programming you
would have said
[2009/02/19 13:59] Snowdrop Short: Print(<person variable)
[2009/02/19 14:00] Snowdrop Short: here we say <person variable>.Print
()
[2009/02/19 14:00] Snowdrop Short: the operation is performed on the
data
[2009/02/19 14:01] Snowdrop Short: so when programming, you need
always to think about "what kind of things you have"
[2009/02/19 14:01] Snowdrop Short: and "what are they supposed to do"
[2009/02/19 14:02] Snowdrop Short: you are awfully quiet
[2009/02/19 14:02] Starky Rubble: ah
[2009/02/19 14:02] Starky Rubble: sorry
[2009/02/19 14:02] Snowdrop Short: am I going too fast?
[2009/02/19 14:02] Starky Rubble: not for me
[2009/02/19 14:03] Christy Lock: I get it now
[2009/02/19 14:04] Christy Lock: what had got me was I thought you
could try to use a method that was not possible with an object but I
see you cant as that object is created from only that template
[2009/02/19 14:04] Snowdrop Short: yes, you can only perform
operations on objects
[2009/02/19 14:05] Starky Rubble: So when developing an algorithm in
OOP do you start by identifying the useful data?
[2009/02/19 14:05] Snowdrop Short: (that's not entirely true, but for
now, lets keep it a secret)
[2009/02/19 14:05] Christy Lock: oh
[2009/02/19 14:05] Snowdrop Short: that depends on how your mind
works
[2009/02/19 14:05] Snowdrop Short: and the task at hand
[2009/02/19 14:06] Snowdrop Short: one way of getting sense of it is
to write things down
[2009/02/19 14:06] Snowdrop Short: and your nouns are probably going
to be data
[2009/02/19 14:06] Starky Rubble: pseudo-code
[2009/02/19 14:06] Starky Rubble: ok
[2009/02/19 14:06] Snowdrop Short: and your verbs are probably going
to be methods
[2009/02/19 14:06] Starky Rubble: right
[2009/02/19 14:07] Snowdrop Short: sometimes you discover that you
can create an abstract term, which can replace two or more words
[2009/02/19 14:08] Snowdrop Short: so now we've looked at classes and
objects
[2009/02/19 14:09] Snowdrop Short: currently our Person class
contains to properties
[2009/02/19 14:09] Snowdrop Short: both are of type strings
[2009/02/19 14:09] Starky Rubble: ah so when you find one of those
abstrct terms - you have idenfied a need for a class that fits?
[2009/02/19 14:10] Snowdrop Short: or you can make your program
simpler, by using the same class in both situations
[2009/02/19 14:10] Snowdrop Short: and a few other neat tricks
[2009/02/19 14:10] Starky Rubble: ok - back to Person (sorry)
[2009/02/19 14:10] Snowdrop Short: last we talked about different
data types
[2009/02/19 14:11] Snowdrop Short: integers, floats etc.
[2009/02/19 14:11] Starky Rubble: yes
[2009/02/19 14:11] Snowdrop Short: our properties can have different
datatypes
[2009/02/19 14:11] Snowdrop Short: I chose the data type "string" for
Age
[2009/02/19 14:11] Snowdrop Short: but I chould have chosen
"DateTime"
[2009/02/19 14:12] Snowdrop Short: but what if I told you that all
datatypes in C# are classes
[2009/02/19 14:12] Christy Lock: eep
[2009/02/19 14:13] Snowdrop Short: Console.WriteLine(Name.ToLower() +
" " + Age);
[2009/02/19 14:13] Starky Rubble: I'd say you were looking under the
hood lol
[2009/02/19 14:13] Snowdrop Short: is perfectly legal and valid c#
[2009/02/19 14:13] Starky Rubble: yes
[2009/02/19 14:13] Snowdrop Short: we tell the value name to change
itself to lower case
[2009/02/19 14:13] Snowdrop Short: before being printed
[2009/02/19 14:14] Christy Lock: ohhh I see so you used the ToLower()
methond because the Name is a string which is a class
[2009/02/19 14:14] Starky Rubble: and thas defined in System?
[2009/02/19 14:14] Christy Lock: inside the string class then is the
method ToLower()>
[2009/02/19 14:14] Snowdrop Short: yes, it is a class which comes in
the framework
[2009/02/19 14:14] Snowdrop Short: the most basics of that exists in
"System"
[2009/02/19 14:14] Snowdrop Short: yes
[2009/02/19 14:15] Christy Lock: duh ok now I know why Ive been
typing that
[2009/02/19 14:15] Starky Rubble: like the old sets of Predefined
Functions
[2009/02/19 14:15] Snowdrop Short: yes, but this is object oriented
[2009/02/19 14:15] Starky Rubble: of course
[2009/02/19 14:15] Snowdrop Short: so we perform the operation on the
data
[2009/02/19 14:15] Starky Rubble: yes
[2009/02/19 14:16] Snowdrop Short: so we could even have other
classes we've defined on our own as properties of our class
[2009/02/19 14:16] Snowdrop Short: it can make your head spin
thinking about it
[2009/02/19 14:16] Starky Rubble: right so the libary System is a
collection of predefined casses and methods
[2009/02/19 14:17] Snowdrop Short: of classes, with predefined
methods on the classes
[2009/02/19 14:17] Starky Rubble: precisely
[2009/02/19 14:17] Snowdrop Short: here is a little example
[2009/02/19 14:17] Snowdrop Short: http://www.pastebin.ca/1342314
[2009/02/19 14:19] Snowdrop Short: how is that?
[2009/02/19 14:20] Snowdrop Short: http://www.pastebin.ca/1342316
[2009/02/19 14:20] Snowdrop Short: or this
[2009/02/19 14:20] Christy Lock: so that prperty is a data tyoe that
uses the class Person
[2009/02/19 14:20] Starky Rubble: it looks like you could then say
Spouse.Print();\
[2009/02/19 14:20] Christy Lock: ?
[2009/02/19 14:20] Snowdrop Short: yes
[2009/02/19 14:20] Starky Rubble: no slash of course lol
[2009/02/19 14:21] Snowdrop Short: http://www.pastebin.ca/1342317
[2009/02/19 14:22] Snowdrop Short: when we have something like
"Spouse" in a class
[2009/02/19 14:22] Snowdrop Short: we talk about a one to one
relation ship
[2009/02/19 14:23] Snowdrop Short: but notice the "this" in
AssignPartner
[2009/02/19 14:23] Snowdrop Short: what is that about?
[2009/02/19 14:23] M1sha Dallin: Own object
[2009/02/19 14:23] Snowdrop Short: anybody care to venture a guess?
[2009/02/19 14:23] M1sha Dallin: Self
[2009/02/19 14:23] M1sha Dallin: Spouses Partner is myself
[2009/02/19 14:24] Snowdrop Short: yes .. he'd better, I hate messy
relationships :-)
[2009/02/19 14:24] M1sha Dallin: :-)
[2009/02/19 14:24] Starky Rubble: the obect it contains
[2009/02/19 14:24] Starky Rubble: containing it rather lol
[2009/02/19 14:24] Snowdrop Short: yes, it is a reference to the
"self" instance
[2009/02/19 14:25] Snowdrop Short: Console.WriteLine(this.Name.ToLower
() + " " + this.Age);
[2009/02/19 14:25] Snowdrop Short: is the same as saying
[2009/02/19 14:25] Snowdrop Short: Console.WriteLine(Name.ToLower() +
" " + Age);
[2009/02/19 14:26] Snowdrop Short: ok
[2009/02/19 14:26] Snowdrop Short: time for you guys to do some work
[2009/02/19 14:26] Starky Rubble: ok
[2009/02/19 14:27] Christy Lock: kk
[2009/02/19 14:27] Starky Rubble: hmm are we all still here?
[2009/02/19 14:27] M1sha Dallin: yep
[2009/02/19 14:27] Snowdrop Short: I think we need to figure out a
way to calculate the age difference
[2009/02/19 14:27] Adelle Fitzgerald: mhmm
[2009/02/19 14:27] Snowdrop Short: I hear you starky
[2009/02/19 14:27] Starky Rubble: ok
[2009/02/19 14:28] Snowdrop Short: so we need to do a few changes
[2009/02/19 14:28] Starky Rubble: you mean the data wants to know the
age difference?
[2009/02/19 14:28] Starky Rubble: lol
[2009/02/19 14:28] Snowdrop Short: and add a method which returns the
age difference between "self" and spouse
[2009/02/19 14:28] Starky Rubble: ok
[2009/02/19 14:28] Snowdrop Short: yes, or I want the data to be able
to tell me
[2009/02/19 14:29] Snowdrop Short: I would suggest Christy, Starky
and eagle form a team
[2009/02/19 14:29] Snowdrop Short: and Adelle and M1Sha form another
[2009/02/19 14:29] M1sha Dallin: ok
[2009/02/19 14:29] Adelle Fitzgerald: :)
[2009/02/19 14:29] Starky Rubble: ok we're the firepit team then?
[2009/02/19 14:29] Snowdrop Short: the large team can wander off to
the firepit
[2009/02/19 14:30] Snowdrop Short: lets meet here in 20 minutes
[2009/02/19 14:30] Christy Lock: kk

**Class was split into two groups here, see 2nd chat log below**

[2009/02/19 14:30] BlueWall Slade: I put a building to our right
today
[2009/02/19 14:30] BlueWall Slade: so wen we grow to 3 groups
[2009/02/19 14:30] BlueWall Slade: or a place to meet up
[2009/02/19 14:31] Snowdrop Short nods
[2009/02/19 14:31] Snowdrop Short: good idea
[2009/02/19 14:31] M1sha Dallin: Are we proposing to retaina string
for Age?
[2009/02/19 14:31] Snowdrop Short: I think it is best to change it
[2009/02/19 14:31] M1sha Dallin: good :-)
[2009/02/19 14:31] Snowdrop Short: that's why I suggested "changing a
few things"
[2009/02/19 14:31] Snowdrop Short: hint
[2009/02/19 14:32] Snowdrop Short: datetime has a method for
calculating the distance between two dates
[2009/02/19 14:32] Snowdrop Short: itself and another date actually
[2009/02/19 14:32] M1sha Dallin: ok
[2009/02/19 14:32] Snowdrop Short: I'll go check on the others :-)
[2009/02/19 14:34] Adelle Fitzgerald: i really dont understand this
[2009/02/19 14:36] M1sha Dallin: OK I was just trying a few things
[2009/02/19 14:37] M1sha Dallin: We need to define the Class Person
slightly differently
[2009/02/19 14:37] M1sha Dallin: public Person(string Name, DateTime
DateOfBirth)
{
_Name = Name;
_DateOfBirth = dDateOfBirth;
_Spouse = new Person("",);

}
public string Name;
public DateTime DateOfBirth;
public Person Spouse;
[2009/02/19 14:40] M1sha Dallin: Did that make any sense?
[2009/02/19 14:40] Adelle Fitzgerald: no, none of it is sinking in :(
[2009/02/19 14:42] Adelle Fitzgerald: im gonna have to go over this
tomorrow when I'm not as tired
[2009/02/19 14:43] Snowdrop Short: is there anything I can do to help
Adelle?
[2009/02/19 14:44] Adelle Fitzgerald: i dunno, its just not sinking
in properly. i just dont understand this bit: public Person Spouse;
[2009/02/19 14:44] Adelle Fitzgerald: i keep going over it, but makes
no sense
[2009/02/19 14:44] Snowdrop Short: we have three properties on our
class
[2009/02/19 14:45] Snowdrop Short: Name which is using the data type
"string"
[2009/02/19 14:45] Snowdrop Short: Age which also uses "string" as
the data type
[2009/02/19 14:45] Snowdrop Short: and Spouse, which uses Person as
the data type
[2009/02/19 14:46] Snowdrop Short: we have defined a class called
"Person"
[2009/02/19 14:46] Snowdrop Short: and it is just as valid a data
type as any other
[2009/02/19 14:46] Snowdrop Short: it doesn't matter if the data type
is defined by the language or machine
[2009/02/19 14:47] Snowdrop Short: or by us, we are allowed to use
that type, just like any other
[2009/02/19 14:47] Snowdrop Short: even within our own Person class
[2009/02/19 14:47] Snowdrop Short: so a Spouse is a piece of date
inside our person
[2009/02/19 14:48] Snowdrop Short: so if we had an object where Name
="Peter"
[2009/02/19 14:48] Snowdrop Short: and another where Name="Mary"
[2009/02/19 14:48] Snowdrop Short: so person1.Name = Mary
[2009/02/19 14:49] Snowdrop Short: and person2.Name = "Paul"
[2009/02/19 14:49] Snowdrop Short: then person1.Spouse.Name = "paul"
[2009/02/19 14:51] Adelle Fitzgerald: grrr.. im getting frustraited
at myself now...
[2009/02/19 14:52] Adelle Fitzgerald: person is a datatype right?
[2009/02/19 14:52] Adelle Fitzgerald: *Person
[2009/02/19 14:52] Snowdrop Short: take a look at this paste bin
[2009/02/19 14:52] Snowdrop Short: http://www.pastebin.ca/1342337
[2009/02/19 14:53] Snowdrop Short: look into the Main thing
[2009/02/19 14:53] Snowdrop Short: I'll try to go over it
[2009/02/19 14:53] Snowdrop Short: in line 28
[2009/02/19 14:53] Snowdrop Short: we create an object of type Person
[2009/02/19 14:53] Adelle Fitzgerald: ok, i understand line 28-32 ok
[2009/02/19 14:54] Snowdrop Short: ok so in 34
[2009/02/19 14:54] Snowdrop Short: we decide that Mary should become
the spouse of Paul
[2009/02/19 14:54] Snowdrop Short: incluside of spelling mistakes :)
[2009/02/19 14:55] Snowdrop Short: so by saying p1.AssingPartner(p2)
[2009/02/19 14:55] BlueWall Slade: lol
[2009/02/19 14:55] Snowdrop Short: we perform the operation
"AssingPartner" on the "Mary" object
[2009/02/19 14:56] M1sha Dallin: I was thinking along the lines of
http://www.pastebin.ca/1342338 (cheated a bit on the date comparison)
[2009/02/19 14:56] Snowdrop Short: inside AssingPartner
[2009/02/19 14:57] Snowdrop Short: we give the value of the handle to
p2 into the Spouse handle
[2009/02/19 14:57] Snowdrop Short: you can think of p1, p2 and Spouse
as handles, holding on to our objects
[2009/02/19 14:57] Snowdrop Short: so in line 19
[2009/02/19 14:58] Snowdrop Short: the Spouse handle inside the
"Mary" object "points" to "Paul"
[2009/02/19 14:58] Adelle Fitzgerald: im kinda getting it... the code
is like snakes and ladders...
[2009/02/19 14:59] Adelle Fitzgerald: ive never done anything like
this before
[2009/02/19 14:59] Snowdrop Short: in line 20, we let the Spouse
handle in the "Paul" object "point" to Mary
[2009/02/19 14:59] Snowdrop Short: that's why we have classes, to try
to do things we haven't done before
[2009/02/19 14:59] Snowdrop Short: but with the support of your
classmates and tutors
[2009/02/19 15:00] Adelle Fitzgerald: im gonna need some time to work
this out
[2009/02/19 15:00] Adelle Fitzgerald: i know its only simple math
[2009/02/19 15:00] Snowdrop Short: it is a bit confusing, I know
[2009/02/19 15:00] Snowdrop Short: maybe I skipped ahead too fast
[2009/02/19 15:00] Adelle Fitzgerald: no, i think im just having an
'off' night
[2009/02/19 15:00] M1sha Dallin: I get confused
[2009/02/19 15:01] Adelle Fitzgerald: ill go over it all again
tomorrow and it will more than likely make perfect sense
[2009/02/19 15:01] M1sha Dallin: actually I think thi sis better - I
was using an arbitrary Person rather than self
[2009/02/19 15:01] M1sha Dallin: http://www.pastebin.ca/1342348
[2009/02/19 15:01] Snowdrop Short: I'll be more than happy to give
you a one on one session tomorrow if you are up to it
[2009/02/19 15:02] Adelle Fitzgerald: ok, will see, ill go over this
task again tomorrow see if i can make more sense of it
[2009/02/19 15:02] Adelle Fitzgerald: and give you a shout on IRC or
something
[2009/02/19 15:02] Snowdrop Short: sure .. I should be on IRC most of
my day tomorrow
[2009/02/19 15:02] Adelle Fitzgerald: i think i need to scribble
stuff on paper
[2009/02/19 15:02] Snowdrop Short: M1sha... what is the boolean
return value about?
[2009/02/19 15:03] Snowdrop Short: we all have different ways of
learning
[2009/02/19 15:03] M1sha Dallin: Whether the operation was valid - No
spouse returns false
[2009/02/19 15:03] Snowdrop Short: here in Denmark, the current rage
is the 7 different learning styles
[2009/02/19 15:03] M1sha Dallin: 7?
[2009/02/19 15:04] Snowdrop Short: yes
[2009/02/19 15:04] Snowdrop Short: those who read
[2009/02/19 15:04] Snowdrop Short: those who need to touch
[2009/02/19 15:04] Snowdrop Short: those who need to move about
[2009/02/19 15:04] Snowdrop Short: and so on
[2009/02/19 15:04] M1sha Dallin: Not sure which I am - varies :-)
[2009/02/19 15:05] Snowdrop Short: I think we all do, I need to read
and try things out for my self
[2009/02/19 15:05] Snowdrop Short: but all people are different
[2009/02/19 15:05] M1sha Dallin: Is there a standard way of handling
nulls?
[2009/02/19 15:05] BlueWall Slade bangs his head on a plywood cube
till it sinks in
[2009/02/19 15:05] M1sha Dallin: How should no spouse be handled for
example with a birth date?
[2009/02/19 15:05] Snowdrop Short: yes... but that's more for the
tuesday sessions :-)
[2009/02/19 15:06] M1sha Dallin: ok
[2009/02/19 15:06] Adelle Fitzgerald: i prefer kicking them Blue ;)
[2009/02/19 15:06] M1sha Dallin: It would obviously make more sense
for the function to return the difference
[2009/02/19 15:06] Snowdrop Short: can I help blue?
[2009/02/19 15:06] M1sha Dallin: but if no spouse what should be
returned?
[2009/02/19 15:06] BlueWall Slade: lol I'm ok
[2009/02/19 15:07] Snowdrop Short: you could simply say that the age
difference was 0 if there was no spouse
[2009/02/19 15:07] Snowdrop Short: and leave it up to the "user" or
"caller" to deal with it
[2009/02/19 15:07] M1sha Dallin: but that might occur if they had the
same birthdates :-)
[2009/02/19 15:08] Snowdrop Short: there is another way
[2009/02/19 15:08] Snowdrop Short: called "throw new Exception("the
person has no spouse");
[2009/02/19 15:08] Snowdrop Short: or
[2009/02/19 15:08] Snowdrop Short: as the first statement, in line 15
[2009/02/19 15:09] M1sha Dallin: exceptions as flow control wer
frowned on in Ada
[2009/02/19 15:09] Snowdrop Short: System.Diagnostics.Trace.Assert
(Spouse != null);
[2009/02/19 15:10] M1sha Dallin: OK - I'll do some research :-)
[2009/02/19 15:10] Snowdrop Short: the question is ...
[2009/02/19 15:10] Snowdrop Short: is it a question of flow control
[2009/02/19 15:10] Snowdrop Short: or and indication of a serious
problem, if a person has no spouse
[2009/02/19 15:10] M1sha Dallin: In RL I don't have one - and it's
not serious (yet) :-)
[2009/02/19 15:11] Snowdrop Short: but if this was an application for
tracking married copules
[2009/02/19 15:11] Snowdrop Short: couples, even
[2009/02/19 15:11] Snowdrop Short: maybe it would be and indication
of a serious error
[2009/02/19 15:12] BlueWall Slade: List<Person> Wives = new
List<Spouse>();
[2009/02/19 15:12] M1sha Dallin: yep - so depends on context and
requirements - but the class may get re-used and the constraints may
not be valid for the re-use
[2009/02/19 15:12] Adelle Fitzgerald: so, public Person Spouse is the
class Person, but is spouse.Person?
[2009/02/19 15:12] Snowdrop Short: exceptions as flow controll is bad
in every programming language
[2009/02/19 15:12] M1sha Dallin: yep
[2009/02/19 15:12] Snowdrop Short smiles
[2009/02/19 15:12] Adelle Fitzgerald: ahaa
[2009/02/19 15:12] M1sha Dallin: I'll think on it
[2009/02/19 15:12] Snowdrop Short: yes, it can make your head spin
[2009/02/19 15:12] Adelle Fitzgerald: righty, im getting somewhere
[2009/02/19 15:12] M1sha Dallin: Getting late - must go to bed
[2009/02/19 15:13] Snowdrop Short too
[2009/02/19 15:13] BlueWall Slade: g'night M1sha
[2009/02/19 15:13] M1sha Dallin: Thanks Snowdrop
[2009/02/19 15:13] Snowdrop Short: we'lll discuss results next time
[2009/02/19 15:13] M1sha Dallin: ok
[2009/02/19 15:13] M1sha Dallin: Bye all
[2009/02/19 15:13] Adelle Fitzgerald: night M1sha, sleep well
[2009/02/19 15:13] M1sha Dallin: g'night
[2009/02/19 15:13] Snowdrop Short: ping me on IRC, if you need help
Adelle
[2009/02/19 15:13] Snowdrop Short: ni ni
[2009/02/19 15:13] Adelle Fitzgerald: i will Snowdrop, thanks :)
[2009/02/19 15:13] Snowdrop Short: np :-)
[2009/02/19 15:13] BlueWall Slade: g'night Snowdrop
[2009/02/19 15:13] Snowdrop Short: nite Blue
[2009/02/19 15:14] Snowdrop Short: I'll just tuck the others in
[2009/02/19 15:14] Adelle Fitzgerald: night Snowdrop, sleep well :)
[2009/02/19 15:14] Snowdrop Short: then I'm off to never land



**Chat log from 2nd group**

[2009/02/19 14:30] Sit: Hello! Starky Rubble
[2009/02/19 14:30] Sit: Hello! Christy Lock
[2009/02/19 14:30] eaglefx Binder: looks muddy
[2009/02/19 14:31] eaglefx Binder: :)
[2009/02/19 14:31] Christy Lock: hehe okies
[2009/02/19 14:31] Sit: Hello! eaglefx Binder
[2009/02/19 14:31] Christy Lock: so the idea is the difference in age
[2009/02/19 14:31] Starky Rubble: ok we all settled?
[2009/02/19 14:31] Starky Rubble: right
[2009/02/19 14:31] eaglefx Binder: well i think i'm behind ;) you
better lead the word .. ;)
[2009/02/19 14:32] Starky Rubble: person.FindAgeDiff();
[2009/02/19 14:32] Starky Rubble: or some such
[2009/02/19 14:32] Christy Lock: ok
[2009/02/19 14:32] Christy Lock: so in the Person class
[2009/02/19 14:32] Christy Lock: we have an age
[2009/02/19 14:33] Christy Lock: so when we create the first person
object with the new keyword
[2009/02/19 14:33] Christy Lock: we get an age
[2009/02/19 14:33] Christy Lock: then with the spouse it also has one
[2009/02/19 14:33] Snowdrop Short: hi
[2009/02/19 14:33] Christy Lock: hi
[2009/02/19 14:33] Snowdrop Short: a small hint
[2009/02/19 14:33] Starky Rubble: I think we need to stay in the
class
[2009/02/19 14:33] Snowdrop Short: the DateTime
[2009/02/19 14:33] Snowdrop Short: data type
[2009/02/19 14:33] Starky Rubble: I think the data needs a new mthod
to tell us the diff
[2009/02/19 14:34] Christy Lock: yes
[2009/02/19 14:34] Starky Rubble: yes
[2009/02/19 14:34] Snowdrop Short: has a method for calculating
differences
[2009/02/19 14:34] Starky Rubble: ah
[2009/02/19 14:34] Christy Lock: so Starsky your right we can use a
new method and then do it there
[2009/02/19 14:34] Starky Rubble: why not just use Ints?
[2009/02/19 14:34] Snowdrop Short: it's up to you
[2009/02/19 14:35] Snowdrop Short: it is your program
[2009/02/19 14:35] Snowdrop Short: you write it ... you decide :-)
[2009/02/19 14:35] Starky Rubble: Ok but the - is a predefined mthod
too isnt it?
[2009/02/19 14:35] Snowdrop Short: yes
[2009/02/19 14:35] Starky Rubble: and ages are all unsigned ints?
[2009/02/19 14:35] Snowdrop Short: it's called an operator
[2009/02/19 14:36] Snowdrop Short: as long as you all agree
[2009/02/19 14:36] Snowdrop Short: I'm happy
[2009/02/19 14:36] Starky Rubble: heh
[2009/02/19 14:36] Snowdrop Short: and it works :-)
[2009/02/19 14:36] Snowdrop Short: open souce is about doing what you
like
[2009/02/19 14:36] Starky Rubble: ok... do we want fractional ages or
ages to the minute?
[2009/02/19 14:36] Snowdrop Short: but also about co-operations
[2009/02/19 14:37] Starky Rubble: I just wondered
[2009/02/19 14:37] Starky Rubble: Im ool either way
[2009/02/19 14:37] Snowdrop Short: ok .. I'll leave that debate to
you guy
[2009/02/19 14:37] Snowdrop Short: I'lll go chech on the others
[2009/02/19 14:37] Starky Rubble: ok
[2009/02/19 14:37] Snowdrop Short: IM me if you have trouble
[2009/02/19 14:37] Starky Rubble: so what does our age data look
like?
[2009/02/19 14:38] Christy Lock: ok so lets start with the mehod
then?
[2009/02/19 14:38] Christy Lock: FindAgeDiff()?
[2009/02/19 14:38] Starky Rubble: lets make sure we agree on the
data?
[2009/02/19 14:38] Christy Lock: ok
[2009/02/19 14:38] Christy Lock: Id say to the year is fine
[2009/02/19 14:38] Starky Rubble: ok
[2009/02/19 14:38] Christy Lock: but if its easier to get it any
other way
[2009/02/19 14:39] Christy Lock: what does the predefined datetime()
give us
[2009/02/19 14:39] Starky Rubble: we know how to find the difference
in ints
[2009/02/19 14:40] Starky Rubble: lessee... we might have to negate
it we use ints
[2009/02/19 14:40] Christy Lock: no c# operates on datetime itself
[2009/02/19 14:40] Christy Lock: I read that just last night
[2009/02/19 14:40] Starky Rubble: yes
[2009/02/19 14:40] Christy Lock: so we can manipulate it as a
variable
[2009/02/19 14:40] Christy Lock: ok lemme grab my book
[2009/02/19 14:41] Starky Rubble: so lets use DateTime for age... it
looks like the difference is always unsigned
[2009/02/19 14:42] Christy Lock: ok
[2009/02/19 14:43] Starky Rubble: did you get DateTime.Subtraction??
[2009/02/19 14:43] Christy Lock: DateTime myBirthDay = new DateTime
(1985,8,31);
[2009/02/19 14:43] Christy Lock: Im showing tyou what Im reading
about this
[2009/02/19 14:44] Christy Lock: then
[2009/02/19 14:44] Christy Lock: Console.WriteLine(myBirthDay.ToString
());
[2009/02/19 14:44] Christy Lock: so we have to create a new objject
of type DateTime()?
[2009/02/19 14:44] Starky Rubble: which makes it String type
[2009/02/19 14:45] Starky Rubble: no
[2009/02/19 14:45] Christy Lock: the mdsn site shows similar things
[2009/02/19 14:45] Starky Rubble: DateTime is a data type
[2009/02/19 14:45] Starky Rubble: we have age as a string right now
[2009/02/19 14:45] eaglefx Binder: i have to run guys, see ya laters
[2009/02/19 14:45] Starky Rubble: strings don't DO math
[2009/02/19 14:45] Sit: Good Bye! eaglefx Binder
[2009/02/19 14:45] Starky Rubble: bye
[2009/02/19 14:45] Christy Lock: ok eagle tc
[2009/02/19 14:46] Starky Rubble: so
[2009/02/19 14:46] Christy Lock: you can do math on Dates and Time
though
[2009/02/19 14:46] Christy Lock: the new DateTime object I fed my
birthday to
[2009/02/19 14:46] Starky Rubble: we either have to do a typecast on
age to DateTime or some other numeric data type
[2009/02/19 14:46] Starky Rubble: or just say age is a number
[2009/02/19 14:47] Christy Lock: ok Im looking at adding or
subtracting date and time in my book
[2009/02/19 14:47] Starky Rubble: of type DateTime or Int
[2009/02/19 14:47] Starky Rubble: or whatever in the class definition
[2009/02/19 14:47] Christy Lock: to adda or subtract you use methods
of the dateTime() class
[2009/02/19 14:48] Starky Rubble: http://www.pastebin.ca/1342333
[2009/02/19 14:48] Christy Lock: omg it has .Month and .Day built in
[2009/02/19 14:48] Starky Rubble: sure
[2009/02/19 14:50] Christy Lock: ok well that works too
[2009/02/19 14:50] Starky Rubble: we need a Main{}
[2009/02/19 14:50] Christy Lock: Im not sure why we dont need an
object
[2009/02/19 14:51] Christy Lock: http://www.pastebin.ca/1342336
[2009/02/19 14:51] Christy Lock: ok now back to your original idea to
create the method to find the dif
[2009/02/19 14:53] Starky Rubble: the class Spouse will have a
FindAgeDiff method?
[2009/02/19 14:53] Christy Lock: you mean the class Person?
[2009/02/19 14:53] Christy Lock: I think under AssignPartner()
[2009/02/19 14:54] Christy Lock: ok first it will be public
[2009/02/19 14:54] Christy Lock: but what kind of data does it
return?
[2009/02/19 14:54] Christy Lock: public int pulblic double
[2009/02/19 14:54] Starky Rubble: so we will be aboe to say
Console.Writeline(Spouse.FindAgeDiff());
[2009/02/19 14:54] Christy Lock: public void maybe and we print it in
the method to the console?
[2009/02/19 14:55] Christy Lock: right
[2009/02/19 14:55] Christy Lock: ok reading a sec on my book
[2009/02/19 14:55] Starky Rubble: it only makes sense in S[pouse
[2009/02/19 14:55] Starky Rubble: because it need two
[2009/02/19 14:55] Starky Rubble: ages
[2009/02/19 14:55] Christy Lock: ok but we need public void
FindAgeDiff() though
[2009/02/19 14:56] Starky Rubble: yes
[2009/02/19 14:56] Starky Rubble: and Spouse is a person not a class
[2009/02/19 14:56] Starky Rubble: so Im confuddled and this flipping
back and forth is driving me crazy lol
[2009/02/19 14:57] Starky Rubble: brb
[2009/02/19 14:57] Christy Lock: ok I added that to pastebin soon as
it updates
[2009/02/19 14:57] Christy Lock: http://www.pastebin.ca/1342342
[2009/02/19 14:57] Christy Lock: ok the FidAgeDiff() does it need to
accept some input?
[2009/02/19 14:58] Christy Lock: or just do the math on Spouse.Age -
Your.Age?
[2009/02/19 14:58] Starky Rubble: ok how about this...
[2009/02/19 14:58] Starky Rubble: below AssingPartner (we should fix
that lol)
[2009/02/19 14:59] Starky Rubble: public void FindAgeDiff
(otherperson)
[2009/02/19 14:59] Starky Rubble: Person otherpesron)
[2009/02/19 15:00] Christy Lock: no because both use the same class
as a template
[2009/02/19 15:00] Starky Rubble: you see what I mean
[2009/02/19 15:00] Christy Lock: I think when a new object is created
[2009/02/19 15:00] Christy Lock: which we are not doing yet
[2009/02/19 15:00] Christy Lock: then there will be code to enter the
birthday
[2009/02/19 15:00] Christy Lock: we need an array for that that
accepts it
[2009/02/19 15:01] Christy Lock: so each person does that
[2009/02/19 15:01] Starky Rubble: OK - are we finding the difference
between this and some otherperson or between any two persons
[2009/02/19 15:01] Christy Lock: then we do a datetime subtraction i
[2009/02/19 15:01] Christy Lock: any two will work
[2009/02/19 15:01] Starky Rubble: we dont need the birthday really
just the age
[2009/02/19 15:01] Starky Rubble: ok
[2009/02/19 15:01] Christy Lock: I have an idea
[2009/02/19 15:02] Starky Rubble: so you are saying this method is
not in the Person class
[2009/02/19 15:02] Christy Lock: lemme try to write the input part
[2009/02/19 15:02] Christy Lock: I was thinking now
[2009/02/19 15:02] Starky Rubble: but rather is in Main
[2009/02/19 15:02] Christy Lock: not
[2009/02/19 15:02] Christy Lock: right
[2009/02/19 15:02] Christy Lock: what we need is to get this to let
us input a birthday
[2009/02/19 15:02] Christy Lock: then another one
[2009/02/19 15:02] Starky Rubble: and really only uses the Peron.Age
[2009/02/19 15:02] Christy Lock: then in main calc the dif
[2009/02/19 15:02] Starky Rubble: Person.age
[2009/02/19 15:03] Christy Lock: ConSole.ReadLine()?
[2009/02/19 15:03] Starky Rubble: so this.age - Spouse.age
[2009/02/19 15:03] Christy Lock: Ill mess with with getting a date
input
[2009/02/19 15:03] Starky Rubble: sure or just assign it for now
[2009/02/19 15:03] Starky Rubble: Spouse.age = 29
[2009/02/19 15:04] Christy Lock: oh thats better
[2009/02/19 15:04] Christy Lock: ok
[2009/02/19 15:04] Christy Lock: lets do that
[2009/02/19 15:04] Starky Rubble: this.age = 35;
[2009/02/19 15:04] Christy Lock: ok lest do that
[2009/02/19 15:05] Starky Rubble: if we mage age of type Int
[2009/02/19 15:05] Starky Rubble: make
[2009/02/19 15:05] Starky Rubble: taht will do it
[2009/02/19 15:05] Christy Lock: then we can do without datetime
[2009/02/19 15:05] Starky Rubble: yes
[2009/02/19 15:05] Christy Lock: ok lets start there
[2009/02/19 15:05] Starky Rubble: I like it cause its more easier lol
[2009/02/19 15:05] Christy Lock: wait she gave us a hint ofDateTime
though
[2009/02/19 15:06] Christy Lock: ok work on the date as int
[2009/02/19 15:06] Christy Lock: and Ill work on it as datetime
[2009/02/19 15:06] Starky Rubble: I suspect there is a method in
DateTime that takes care of the messy 50% of ther time a random diff
wil be a negative number
[2009/02/19 15:06] Christy Lock: and see what we can do
[2009/02/19 15:06] Starky Rubble: there is no reason we can't negate
it if it comes pout negative
[2009/02/19 15:07] Christy Lock: I bet dateTime.Age1 - dateTime.Age2
will work
[2009/02/19 15:07] Starky Rubble: just *-1
[2009/02/19 15:07] Christy Lock: right
[2009/02/19 15:07] Christy Lock: ok lemme hack a sec
[2009/02/19 15:07] Starky Rubble: if its < 0
[2009/02/19 15:14] Christy Lock: crap
[2009/02/19 15:14] Snowdrop Short: it's getting late
[2009/02/19 15:15] Starky Rubble: crap
[2009/02/19 15:15] Snowdrop Short: I think we should talk about the
results next time
[2009/02/19 15:15] Starky Rubble: Ok
[2009/02/19 15:15] Christy Lock: Person wife = new Person();
[2009/02/19 15:15] Snowdrop Short: could one of you send me a log of
the chat
[2009/02/19 15:15] Christy Lock: okies ill work on it a bit more
though
[2009/02/19 15:15] Snowdrop Short: so we can combine the two and make
it public
[2009/02/19 15:15] Snowdrop Short: think of it as home work
[2009/02/19 15:15] Christy Lock: kk
[2009/02/19 15:16] Snowdrop Short: ping me on IRC tomorrow, if you
need help
[2009/02/19 15:16] Starky Rubble: ok
[2009/02/19 15:16] Christy Lock: did you get the chat?
[2009/02/19 15:16] Snowdrop Short: nope
[2009/02/19 15:16] Starky Rubble: I have a quik questiomn
[2009/02/19 15:16] Snowdrop Short: yes.. Starky
[2009/02/19 15:17] Starky Rubble: are we finding the difference
between this.age and Spouse.age or any two persons?
[2009/02/19 15:17] Snowdrop Short: this.age and Spouse.age
[2009/02/19 15:17] Christy Lock: I wanted to write it to have input
on birthdays then calculate
[2009/02/19 15:17] Starky Rubble: ok
[2009/02/19 15:18] Christy Lock: but lol baby steps I know I know
[2009/02/19 15:18] Snowdrop Short: in OO, we perform operations on
data
[2009/02/19 15:18] Snowdrop Short: so it would be nice to be able to
say
[2009/02/19 15:18] Snowdrop Short: myPersonHandle.SpouseAgeDifference
[2009/02/19 15:18] Snowdrop Short: or something like it
[2009/02/19 15:19] Christy Lock: if I wanted birthdays
[2009/02/19 15:19] Christy Lock: cann that be asked in the class
Person?
[2009/02/19 15:19] Snowdrop Short: yes
[2009/02/19 15:19] Christy Lock: as each is created
[2009/02/19 15:19] Christy Lock: you catch their bdays
[2009/02/19 15:19] Snowdrop Short: this.SpouseAgeDifference
[2009/02/19 15:19] Snowdrop Short: is perfectly valid
[2009/02/19 15:19] Christy Lock: and then after you have two of them
simple print the dif
[2009/02/19 15:20] Snowdrop Short: but reall.. it is way late for me
[2009/02/19 15:20] Christy Lock: okies ty so much
[2009/02/19 15:20] Christy Lock: Ill work on it





http://www.pastebin.ca/1342213

using System;
using System.Collections;
using System.Collections.Generic;

namespace Groups
{

//
--------------------------------------------------------------------
public class GroupMember
{
// define the information needed to describe a group member
public GroupMember(string memberName, Guid memberGuid, string
memberTitle, DateTime memberLastLogin)
{
_MemberName = memberName;
_MemberGuid = memberGuid;
_MemberTitle = memberTitle;
_MemberLastLogin = memberLastLogin;
}

public void WriteToConsole()
{
Console.WriteLine("Member Name={0}, GUID={1}, Title {2},
Last Login {3}", _MemberName, _MemberGuid, _MemberTitle,
_MemberLastLogin);
}


public string _MemberName;
public Guid _MemberGuid;
public string _MemberTitle;
public DateTime _MemberLastLogin;
}


//
--------------------------------------------------------------------
public class Group
{
public Group(string name, string description)
{
_Name = name;
_Description = description;
_Members = new ArrayList();

}

public void WriteToConsole()
{
Console.WriteLine("Name={0}, Description={1}, #of Members
{2}", _Name, _Description, _Members.Count);
foreach (Group GroupMember in _Members)
GroupMember.WriteToConsole();
}

// Type definitions for the Group Structure
public string _Name;
public string _Description;
public ArrayList _Members;

}


//
--------------------------------------------------------------------

public class GroupDictionary
{
// The GroupDictionary structure
Dictionary<Guid, Group> _OSGroups = new Dictionary<Guid,Group>
();

// Method: to return a Group Structure and its key from the
GroupDictionary, based on GroupName
// Parameters: in GroupName
// out Group
// out GroupID
// Return: true if the group exists
// false if the group does not exist
//
public Boolean GetGroup(string GroupName, out Guid GroupID)
{
foreach (KeyValuePair<Guid, Group> pair in _OSGroups)
{
if (pair.Value._Name == GroupName)
{
GroupID = pair.Key;
return true;
}
}

GroupID = Guid.Empty;
return false;
}


// Method: to return a Group Structure and its key from the
GroupDictionary, based on GroupName
// Parameters: in GroupName
// out Group
// out GroupID
// Return: true if the group exists
// false if the group does not exist
//
public Boolean GetGroup(string GroupName, out Group
GroupDetail, out Guid GroupID)
{
foreach (KeyValuePair<Guid, Group> pair in _OSGroups)
{
if (pair.Value._Name == GroupName)
{
GroupDetail = pair.Value;
GroupID = pair.Key;
return true;
}
}

GroupDetail = new Group("", "");
GroupID = Guid.Empty;
return false;
}


// Method: to return a Group Structure from the
GroupDictionary, based on GroupID
// Parameters: in GroupID
// out Group
// Return: true if the group exists
// false if the group does not exist
//
public Boolean GetGroup(Guid GroupID, out Group GroupDetail)
{
if (_OSGroups.ContainsKey (GroupID))
{
GroupDetail = _OSGroups [GroupID];
return true;
}

GroupDetail = new Group("", "");
return false;
}


// Method: Determine if a group exists in the GroupDictionary,
search on Name
// Parameters: in GroupName
// Return: true if the group exists
// false if the group does not exist
//
public Boolean GroupExists (string GroupName)
{
foreach (KeyValuePair<Guid, Group> pair in _OSGroups)
{
if (pair.Value._Name == GroupName)
{
return true;
}
}

return false;

}


// Method: Determine if a group exists in the GroupDictionary,
search on GroupID
// Parameters: in GroupName
// Return: true if the group exists
// false if the group does not exist
//
public Boolean GroupExists(Guid GroupID)
{
if (_OSGroups.ContainsKey(GroupID))
{
return true;
}

return false;

}


// Method: to add a new group to the GroupDictionary
// Parameters: in Group
// ref GroupID
// Return: true if group is successfully added
// false if a group of the same name already
exists
//
public Boolean AddGroup (Group GroupDetail, out Guid GroupID)
{
GroupID = Guid.Empty;
if (GroupExists (GroupDetail._Name)) return false;

GroupID = Guid.NewGuid();
_OSGroups.Add(GroupID, GroupDetail);

return true;
}


// Method: to delete a group from the GroupDictionary
// Parameters: in GroupID
// Return: true if group is successfully deleted
// false if the group cannot be located
//
public Boolean DeleteGroup(Guid GroupID)
{
if (GroupExists(GroupID))
{
_OSGroups.Remove(GroupID);
return true;
}

return false;
}



// Method: to delete a group from the GroupDictionary
// Parameters: in GroupName
// Return: true if group is successfully deleted
// false if the group cannot be located
//
public Boolean DeleteGroup(string GroupName)
{
Guid GroupID;

if (GetGroup (GroupName, out GroupID))
{
_OSGroups.Remove(GroupID);
return true;
}

return false;
}


// Method: to write details of all groups in the
GroupDictionary to the Console
// Parameters: None
// Return: None
//
public void WriteGroupDictionaryToConsole()
{
foreach (KeyValuePair<Guid, Group> pair in _OSGroups)
{
pair.Value.WriteToConsole();
}

}

}




//
--------------------------------------------------------------------
class MainClass
{
public static void Main(string[] args)
{
GroupDictionary AllGroups = new GroupDictionary();

Group Group1 = new Group("Group 1", "Test Group 1");
Group Group2 = new Group("Group 2", "Test Group 2");
Group Group3 = new Group("Group 3", "Test Group 3");
Group GroupA;
Group GroupB;

Guid Gid1, Gid2, Gid3;
Guid Gid4 = Guid.Empty;

// Test of Method AddGroup
if (AllGroups.AddGroup(Group1, out Gid1)) Console.WriteLine
("Test 1 Passed");
if (AllGroups.AddGroup(Group2, out Gid2)) Console.WriteLine
("Test 2 Passed");
if (!AllGroups.AddGroup(Group2, out Gid3))
Console.WriteLine("Test 3 Passed");
if (AllGroups.AddGroup(Group3, out Gid3)) Console.WriteLine
("Test 4 Passed");

// Test of Method GroupExists
if (AllGroups.GroupExists(Gid1)) Console.WriteLine("Test 5
Passed");
if (AllGroups.GroupExists(Gid3)) Console.WriteLine("Test 6
Passed");
if (!AllGroups.GroupExists(Gid4)) Console.WriteLine("Test
7 Passed");

if (AllGroups.GroupExists("Group 1")) Console.WriteLine
("Test 8 Passed");
if (!AllGroups.GroupExists("Group 16")) Console.WriteLine
("Test 9 Passed");

// Test of Method GetGroup
if (AllGroups.GetGroup("Group 1", out Gid4))
{
if (Gid4 != Guid.Empty) Console.WriteLine("Test 10
Passed");
}

if (!AllGroups.GetGroup("Group 16", out Gid3))
{
if (Gid4 == Guid.Empty) Console.WriteLine("Test 11
Passed");
}

if (AllGroups.GetGroup("Group 1", out GroupA, out Gid2))
{
if (Gid2==Gid4
&& Group1._Name==GroupA._Name
&& Group1._Description==GroupA._Description)
Console.WriteLine("Test 12 Passed");
}

if (!AllGroups.GetGroup("Group 16", out GroupB, out Gid3))
{
if (Gid3 == Guid.Empty
&& GroupB._Name==""
&& GroupB._Description=="") Console.WriteLine("Test
13 Passed");
}

// Test of DeleteGroup
Console.WriteLine("Groups 1, 2 and 3 should be listed
below");
AllGroups.WriteGroupDictionaryToConsole();

if (AllGroups.GetGroup("Group 1", out Gid4))
{
if (AllGroups.DeleteGroup(Gid4))
{
if (!AllGroups.GetGroup("Group 1", out Gid4))
{
Console.WriteLine ("Test 14 Passed");
}
}
}

if (!AllGroups.DeleteGroup("Group 1")) Console.WriteLine
("Test 15 Passed");
if (AllGroups.DeleteGroup("Group 3")) Console.WriteLine
("Test 16 Passed");

Console.WriteLine("Groups 2 only should be listed below");
AllGroups.WriteGroupDictionaryToConsole();

}
}
}



http://www.pastebin.ca/1342276

using System;

namespace Lesson06
{
class MainClass
{
//EASTER DATE CALCULATION FOR YEARS 1583 TO 4099
// y is a 4 digit year 1583 to 4099
// d returns the day of the month of Easter
// m returns the month of Easter

// Easter Sunday is the Sunday following the Paschal Full Moon
// (PFM) date for the year

// This algorithm is an arithmetic interpretation of the 3 step
// Easter Dating Method developed by Ron Mallen 1985, as a vast
// improvement on the method described in the Common Prayer Book

// Because this algorithm is a direct translation of the
// official tables, it can be easily proved to be 100% correct

// This algorithm derives values by sequential inter-dependent
// calculations, so ... DO NOT MODIFY THE ORDER OF CALCULATIONS!
static void Calculate(out int d, out int m, int y)
{
int FirstDig, Remain19, temp; //intermediate results
int tA, tB, tC, tD, tE; //table A to E results

FirstDig = y / 100; //first 2 digits of year
Remain19 = y % 19; //remainder of year / 19


// calculate PFM date
temp = (FirstDig - 15) / 2 + 202 - 11 * Remain19;
switch(FirstDig)
{
case 21:
case 24:
case 25:
case 27:
case 28:
case 29:
case 30:
case 31:
case 32:
case 34:
case 35:
case 38:
temp = temp - 1;
break;
case 33:
case 36:
case 37:
case 39:
case 40:
temp = temp - 2;
break;
}
temp = temp % 30;

tA = temp + 21;
if(temp == 29)
tA = tA - 1;

if(temp == 28 && Remain19 > 10)
tA = tA - 1;

//find the next Sunday
tB = (tA - 19) % 7;

tC = (40 - FirstDig) % 4;

if(tC == 3)
tC = tC + 1;

if(tC > 1)
tC = tC + 1;

temp = y % 100;
tD = (temp + temp / 4) % 7;

tE = ((20 - tB - tC - tD) % 7) + 1;
d = tA + tE;

// return the date
if(d > 31)
{
d = d - 31;
m = 4;
}
else
{
m = 3;
}
}

public static void Main(string[] args)
{
int day;
int month;

Calculate(out day, out month, 1617);
Console.WriteLine("Result day={0}, month={1}", day, month);
}
}
}




http://www.pastebin.ca/1342292

using System;

namespace Lesson06
{
class Person
{
public string Name;
public string Age;
}
}





http://www.pastebin.ca/1342298

using System;

namespace Lesson06
{
class Person
{
public string Name;
public string Age;

public void Print()
{
Console.WriteLine(Name + " " + Age);
}
}
}





http://www.pastebin.ca/1342314

using System;

namespace Lesson06
{
class Person
{
public string Name;
public string Age;
public Person Spouse;

public void Print()
{
Console.WriteLine(Name.ToLower() + " " + Age);
}
}
}





http://www.pastebin.ca/1342316

using System;

namespace Lesson06
{
class Person
{
public string Name;
public string Age;
public Person Spouse;

public void Print()
{
Console.WriteLine(Name.ToLower() + " " + Age);
}

public void AssingPartner(Person partner)
{
Spouse = partner;
partner.Spouse = this;
}
}
}





http://www.pastebin.ca/1342317

using System;

namespace Lesson06
{
class Person
{
public string Name;
public string Age;
public Person Spouse;

public void Print()
{
Console.WriteLine(Name.ToLower() + " " + Age + "\n" + "Spouse:");
Spouse.Print();
}

public void AssingPartner(Person partner)
{
Spouse = partner;
partner.Spouse = this;
}
}
}





http://www.pastebin.ca/1342337

using System;

namespace Lesson06
{
class Person
{
public string Name;
public string Age;
public Person Spouse;

public void Print()
{
Console.WriteLine(Name.ToLower() + " " + Age + "\n" + "Spouse:");
Spouse.Print();
}

public void AssingPartner(Person partner)
{
Spouse = partner;
partner.Spouse = this;
}
}

class Main
{
public static void Main(string[] args)
{
Person p1 = new Person();
p1.Name = "Mary";

Person p2 = new Person();
p2.Name = "Paul";

p1.AssingPartner(p2);
p1.Spouse.Print();
}
}
}





http://www.pastebin.ca/1342338

public Person(string Name, DateTime DateOfBirth)
{
_Name = Name;
_DateOfBirth = DateOfBirth;
_Spouse = new Person("", DateTime.MinValue);

}

public string _Name;
public DateTime _DateOfBirth;
public Person _Spouse;

public Boolean SpouseAgeDifference(Person Somebody, out int
AgeDifference)
{
if (Somebody._Spouse._Name != "")
{
AgeDifference = Math.Abs (Somebody._DateOfBirth.Year -
Somebody._Spouse._DateOfBirth.Year);
return true;
}

AgeDifference = 0;
return false;
}




http://www.pastebin.ca/1342348

public Person(string Name, DateTime DateOfBirth)
{
_Name = Name;
_DateOfBirth = DateOfBirth;
_Spouse = new Person("", DateTime.MinValue);

}

public string _Name;
public DateTime _DateOfBirth;
public Person _Spouse;

public Boolean SpouseAgeDifference(out int AgeDifference)
{
if (this._Spouse._Name != "")
{
AgeDifference = Math.Abs (this._DateOfBirth.Year -
this._Spouse._DateOfBirth.Year);
return true;
}

AgeDifference = 0;
return false;
}




http://www.pastebin.ca/1342333

using System;

namespace Lesson06
{
class Person
{
public string Name;
public DateTime Age;
public Person Spouse;

public void Print()
{
Console.WriteLine(Name.ToLower() + " " + Age + "\n" +
"Spouse:");
Spouse.Print();
}

public void AssignPartner(Person partner)
{
Spouse = partner;
partner.Spouse = this;
}
}
}




http://www.pastebin.ca/1342336

using System;

namespace Lesson06
{
class Person
{
public string Name;
public DateTime Age;
public Person Spouse;

public void Print()
{
Console.WriteLine(Name.ToLower() + " " + Age + "\n" +
"Spouse:");
Spouse.Print();
}

public void AssignPartner(Person partner)
{
Spouse = partner;
partner.Spouse = this;
}
}



class MainClass
{
public static void Main(string[] args)
{

}
}
}




http://www.pastebin.ca/1342342

using System;

namespace Lesson06
{
class Person
{
public string Name;
public DateTime Age;
public Person Spouse;

public void Print()
{
Console.WriteLine(Name.ToLower() + " " + Age + "\n" +
"Spouse:");
Spouse.Print();
}

public void AssignPartner(Person partner)
{
Spouse = partner;
partner.Spouse = this;
}
public void FindAgeDiff()
{


}
}



class MainClass
{
public static void Main(string[] args)
{

}
}
}
Reply all
Reply to author
Forward
0 new messages