=== ZachK_ is now known as zkriesse | ||
wesley | does anyone know if this is where the july 10th user day will be held? | 01:43 |
---|---|---|
wesley | is anyone in here? | 01:44 |
zkriesse | wesley: hello | 01:45 |
zkriesse | wesley: Yes it will be held here | 01:45 |
wesley | zkriesse thanks is there anything I can do to help on july 10th? | 01:46 |
zkriesse | wesley: well what do you know | 01:46 |
Pendulum | wesley: if you'd like to help out, feel free to join #ubuntu-classroom-backstage and chat with us there | 01:49 |
Pendulum | this channel is really meant for holding classes only | 01:49 |
zkriesse | hello Nicke | 02:40 |
zkriesse | welcome userdays5 | 02:41 |
=== yofel_ is now known as yofel | ||
=== bgs100 is now known as bgs000 | ||
userdays8 | jn | 08:17 |
ronaldo_ | hello why i after downloading adobe flash...it cannot install here | 10:47 |
=== ghostcube_ is now known as ghostcube | ||
=== bgs000 is now known as bgs100 | ||
=== virtuald_ is now known as virtuald | ||
=== yofel_ is now known as yofel | ||
sirmacik | Hi all! Time for third part of C# introduction | 20:59 |
sirmacik | (; | 21:00 |
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - http://wiki.ubuntu.com/Classroom || Support in #ubuntu || Current Class: Introduction to C# Day 3 | ||
pleia2 | juju2143: around? | 21:03 |
pedro3005 | oh darn? | 21:06 |
pleia2 | just messaged him, hopefully he'll show up :) | 21:06 |
pedro3005 | pleia2, well, he was last seen 71 minutes ago | 21:11 |
sirmacik | :/ | 21:14 |
pleia2 | pedro3005: do you know anyone who has other ways to contact him? | 21:14 |
pedro3005 | pleia2, unfortunately, no | 21:14 |
pleia2 | alright, I think we've done all we can, hopefully he'll see my /msg or remember soon | 21:14 |
pedro3005 | yeah, he won't pick up skype either | 21:15 |
juju2143 | oh im there | 21:19 |
pleia2 | woohoo :) | 21:20 |
juju2143 | I had to leave unexpectly | 21:20 |
sirmacik | \o/ | 21:20 |
juju2143 | everyone's ready? | 21:20 |
juju2143 | Good. | 21:20 |
sirmacik | monodevelop opened (; | 21:20 |
juju2143 | me too | 21:21 |
juju2143 | We will do classes | 21:22 |
pedro3005 | yeah, I have it here | 21:22 |
juju2143 | OOP. | 21:22 |
juju2143 | So open your console project | 21:23 |
pedro3005 | a new one? | 21:24 |
sirmacik | opened | 21:24 |
pedro3005 | I'm afraid I don't have the old one anymore :P | 21:24 |
juju2143 | whatever | 21:24 |
juju2143 | it doesn't matter. | 21:24 |
pedro3005 | ok | 21:24 |
juju2143 | So you have your Main function | 21:25 |
juju2143 | your Mainclass | 21:26 |
sirmacik | yep | 21:26 |
juju2143 | So imagine a class as an object. In fact it is an object. | 21:27 |
juju2143 | So for example, a person. | 21:27 |
juju2143 | So we will make a person class. | 21:28 |
juju2143 | A person have a name, a sex, etc., it can walk, run, etc. | 21:29 |
juju2143 | So the name and the sex is attributes | 21:30 |
juju2143 | and the fact he can walk and run are methods. | 21:30 |
juju2143 | So we'll start with that. | 21:30 |
juju2143 | So what you can write between the penultimate and ultimate } of your file is: | 21:31 |
juju2143 | class Person | 21:31 |
juju2143 | { | 21:31 |
juju2143 | // Insert here attributes | 21:32 |
juju2143 | // Insert here methods | 21:32 |
juju2143 | } | 21:32 |
juju2143 | Now for attributes you can have: | 21:33 |
juju2143 | <public/private> <type> <name of variable>[ = <initial value>] | 21:34 |
juju2143 | ; | 21:34 |
pedro3005 | public is like 'global', and private is like 'local'? | 21:35 |
juju2143 | yes | 21:37 |
juju2143 | public you can access it outside your class | 21:37 |
juju2143 | private, you can't | 21:37 |
pedro3005 | Ok | 21:37 |
juju2143 | and protected, hm it have something to do with inheritance. | 21:38 |
juju2143 | you can also add static, so you can access it outside your class and without initialize it | 21:39 |
juju2143 | like you have public static something; | 21:39 |
juju2143 | you can do Person.sonething without initialize a variable of type Person before | 21:40 |
juju2143 | and also there is properties | 21:40 |
juju2143 | like this: | 21:41 |
juju2143 | public Property | 21:41 |
juju2143 | { | 21:41 |
juju2143 | set | 21:42 |
juju2143 | { | 21:42 |
juju2143 | / do something when Property is set | 21:42 |
juju2143 | } | 21:42 |
juju2143 | get | 21:42 |
juju2143 | { | 21:42 |
juju2143 | // do something when Property is accessed | 21:43 |
juju2143 | } | 21:43 |
juju2143 | } | 21:43 |
pedro3005 | juju2143, so the difference is static wouldn't have the arguments received upon instanciation? | 21:48 |
sirmacik | hmm | 21:56 |
sirmacik | juju2143: can we move on somewhere? | 21:57 |
pedro3005 | juju2143, ? | 22:18 |
sirmacik | -_ | 22:21 |
sirmacik | - | 22:21 |
juju2143 | oh | 22:22 |
juju2143 | back, I had to go | 22:23 |
juju2143 | like, you know parents, "Leave your computer RIGHT NOW" | 22:23 |
juju2143 | so, pedro3005, yeah something like that. | 22:25 |
pedro3005 | juju2143, ok, I was trying to make something and it didn't go very well | 22:25 |
juju2143 | ok... | 22:25 |
juju2143 | so back to our Person example | 22:26 |
pedro3005 | juju2143, http://paste.pocoo.org/show/229992/ | 22:26 |
pedro3005 | wait | 22:26 |
pedro3005 | fail | 22:26 |
pedro3005 | okay, changing "Person.isMale()" to "a.isMale()", I get: "The member `Classes.Person.isMale' cannot be used as method or delegate(CS1955)" | 22:27 |
juju2143 | pedro3005, line 11, since it acts like an attribute, you don't need the ()'s | 22:27 |
pedro3005 | okay, it works | 22:28 |
pedro3005 | :) | 22:28 |
pedro3005 | go on, sorry | 22:28 |
juju2143 | but the rest, it's an perfect example of a class. | 22:28 |
juju2143 | you did the return right | 22:29 |
juju2143 | and in the set clause, you can do value = something | 22:29 |
juju2143 | instead of ismale | 22:29 |
juju2143 | pedro3005, also instead of a int you would use a bool | 22:29 |
juju2143 | return true; or return false; | 22:30 |
pedro3005 | juju2143, yeah I just wanted to make a method :) | 22:30 |
juju2143 | ok | 22:30 |
juju2143 | so properties are like a blend between method and attributes | 22:31 |
juju2143 | also, see the Person a = new Person (); line? | 22:31 |
juju2143 | maybe you want to pass arguments | 22:32 |
pedro3005 | yeah, but how? | 22:32 |
juju2143 | so in your class you need a method of the same name as the class | 22:32 |
juju2143 | Person(string arg) | 22:33 |
juju2143 | { | 22:33 |
juju2143 | //do something, like put the arg in attributes) | 22:33 |
juju2143 | } | 22:33 |
pedro3005 | shouldn't it have public/private and type? | 22:33 |
juju2143 | this is a constructor. | 22:33 |
juju2143 | pedro3005, nope | 22:33 |
juju2143 | no public/private or type | 22:33 |
pedro3005 | Person (string arg) | 22:35 |
pedro3005 | private string sex = arg; | 22:35 |
pedro3005 | this doesn't work, it complains about "private" | 22:35 |
AKShams | Hello | 22:37 |
juju2143 | pedro3005, hmmm | 22:37 |
juju2143 | hi AKShams | 22:37 |
juju2143 | pedro3005, that's because you are inside a method | 22:38 |
juju2143 | inside you don't need private | 22:38 |
AKShams | could you tell me when the Classes take place, it's not listed in the wiki page? | 22:38 |
pedro3005 | juju2143, but then I can't access inside the isMale method | 22:39 |
pedro3005 | AKShams, right now | 22:39 |
AKShams | so, what's going on I'm new! | 22:39 |
pedro3005 | We're learning about classes ;) | 22:40 |
AKShams | hhhhhhhhh | 22:40 |
AKShams | will someone give a lecture or something like that? | 22:40 |
pedro3005 | juju2143 is teaching | 22:40 |
juju2143 | yep. | 22:40 |
sirmacik | AKShams: look at logs | 22:41 |
AKShams | so, what is the subject? | 22:41 |
juju2143 | pedro3005, hm what you have now for code? | 22:41 |
AKShams | ik | 22:41 |
sirmacik | C# introduction | 22:41 |
AKShams | ok | 22:41 |
juju2143 | yep C# | 22:41 |
AKShams | GREAT :D | 22:41 |
pedro3005 | juju2143, http://paste.pocoo.org/show/230008/ | 22:41 |
AKShams | thnx | 22:42 |
pedro3005 | wouldn't you need something like Python's "self" or PHP's $this? | 22:42 |
juju2143 | oh that's because you are declaring a variable in a function and accessing it in another function | 22:43 |
AKShams | Yes ofcourse | 22:43 |
juju2143 | it won't work | 22:43 |
pedro3005 | juju2143, I know, but what's the solution? | 22:43 |
juju2143 | also, there is a this | 22:43 |
juju2143 | pedro3005, declaring sex outside methods, but inside your class | 22:44 |
juju2143 | and with the private. | 22:44 |
pedro3005 | juju2143, still not working http://paste.pocoo.org/show/230011/ (protection level error) | 22:45 |
juju2143 | what? | 22:48 |
juju2143 | which line is the error? | 22:48 |
pedro3005 | juju2143, 9 | 22:49 |
pedro3005 | [Task:File=/home/pedro/Projects/Classes/Classes/Main.cs, Line=9, Column=55, Type=Error, Priority=Normal, Description=`Classes.Person.Person(string)' is inaccessible due to its protection level(CS0122)] | 22:49 |
juju2143 | okkk | 22:50 |
juju2143 | right. I forgot. | 22:51 |
juju2143 | Put a public in front of the constructor. | 22:51 |
pedro3005 | now it runs :) | 22:53 |
juju2143 | :) | 22:54 |
pedro3005 | go on | 22:55 |
juju2143 | ok | 22:55 |
juju2143 | So. you can make attributes, methods and properties. | 22:56 |
juju2143 | So, this is basic OOPÂ. | 22:58 |
juju2143 | Monday, more advanced OOP. | 22:58 |
juju2143 | Inheritance. | 22:58 |
juju2143 | Have questions? | 22:58 |
pedro3005 | juju2143, one question. have you taught arrays? | 22:58 |
juju2143 | yes | 22:58 |
juju2143 | DAy 1 | 22:58 |
pedro3005 | really? I must've forgotten then | 22:59 |
juju2143 | seen the string[] args in the Main args? I told about that in Day 1 | 22:59 |
juju2143 | also this channel is logged. | 22:59 |
AKShams | where to find the logs? | 23:00 |
juju2143 | AKShams, look at the topic | 23:00 |
pleia2 | irclogs.ubuntu.com | 23:00 |
pleia2 | juju2143: added day 4 to the calendar for Monday | 23:01 |
juju2143 | pleia2, k thx. | 23:05 |
pedro3005 | pleia2, hm, I think it's broken... http://irclogs.ubuntu.com/2010/06/22/%23ubuntu-classroom.html | 23:05 |
pleia2 | pedro3005: the classes started on the 23rd, not the 22nd | 23:08 |
pleia2 | so you want this for day one: http://irclogs.ubuntu.com/2010/06/23/%23ubuntu-classroom.html | 23:09 |
pedro3005 | pleia2, quiet day, that was | 23:09 |
pedro3005 | :P | 23:09 |
pleia2 | yeah, we don't have classes every day | 23:09 |
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - http://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!