#ubuntu-classroom 2007-09-24
<Red-Sox> Jordan_U: do you know if there are any microsoft keyboard/mouse drivers that support the media buttons/side buttons
<Jordan_U> !media keys
<ubotu> Sorry, I don't know anything about media keys - try searching on http://ubotu.ubuntu-nl.org/factoids.cgi
<Red-Sox> NICE
<Red-Sox> ;)
<Jordan_U> Red-Sox, Meh, there's a factoid for it but you can set them up in System -> Preferences -> Keyboard Shortcuts IIRC
<Red-Sox> okay
<Red-Sox> thanks
<Red-Sox> well how come play/pause doesn't work with banshee
<Jordan_U> Red-Sox, Some keyboards ( like mine ) Just Work
<Red-Sox> HAHA
<Red-Sox> I like microsoft hardware for the most part
<Red-Sox> Sturdy keyboard, comfortable mouse
<Red-Sox> $80
<Red-Sox> not bad
<Jordan_U> Red-Sox, Have you set up that shortcut in System -> Preferences Shortcuts?
<Red-Sox> nope
<Red-Sox> getting there
<Red-Sox> :P
<Jordan_U> Red-Sox, You just click the function and press the key that you want to associate with it
<Red-Sox> I like gmail for email...idk I'm just that way...so that's what I want the mail button to launch :P
<Jordan_U> Red-Sox, Easiest way to do that is to get the gmail applet thing
<Red-Sox> I don't see shortcuts
<Red-Sox> Under prefs
<Red-Sox> I see _keyboard_ shortcuts....
<Jordan_U> That's it
<Red-Sox> Oh wait well first I want to set play/pause etc to banshee
<Red-Sox> that's what I thought you meant
<Jordan_U> Red-Sox, Do you want play/pause to open Banshee or to control banshee?
<Red-Sox> Control
<Red-Sox> I want the music botton to open
<Jordan_U> Red-Sox, IIRC once it's set up in in Gnome it will work
<Red-Sox> haha there are...24 extra keys on this
<Red-Sox> Well it's installed....
<Red-Sox> hmm
<Red-Sox> It won't recognize a lot of those buttons, even when I tap one to try to map it
<Jordan_U> Red-Sox, So what do you want to do that you still don't understand / know how to do?
<Jordan_U> Red-Sox, BTW, it's not a driver issue, it's just matching the keycodes that the keyboard gives to the function you want it to perform
<Red-Sox> Jordan_U: First of all, Jordan_U, this is my keyboard: http://www.microsoft.com/hardware/mouseandkeyboard/productdetails.aspx?pid=082
<Jordan_U> Red-Sox, So any keyboard with any "Functions" will work, since the "Functions" Are just a matter of how it's configured and what label they decided to put on what key :)
<Red-Sox> Okay
<Red-Sox> Also, the six ones on the bottom of the ones labled '4' in the diagram won't work
<Jordan_U> Red-Sox, Is there a larger image than the "larger image" ? :) I can't see what extra keys you have
<Red-Sox> and the two below that won't
<Red-Sox> Haha sure hold on
<Red-Sox> Jordan_U: The one on top: http://www.geekz1.com/images/reviews/msftkbd/DSC_6233.JPG
<Red-Sox> closer: http://www.geekz1.com/images/reviews/msftkbd/DSC_6245.JPG
<Jordan_U> Red-Sox, Do you want the top arrow keys to switch tracks?
<Red-Sox> Jordan_U: I can't find the media buttons
<Red-Sox> and no
<Jordan_U> Red-Sox, Ahh, Ok, what are those supposed to do?
<Red-Sox> still looking though haha
<Red-Sox> I want those to control back/forward in firefox, Jordan_U
<Red-Sox> Jordan_U: somewhat visible http://static.flickr.com/119/308116801_dc57f2ff09.jpg
<Red-Sox> Well looking at that, Jordan_U, here's what I want each key to do.
<Jordan_U> Red-Sox, Looks like that isn't a default in Gnome, and they don't seem to let you add more ( one of those stupid decisions I mentioned earlier ) so that will probably have to be done manually
<Jordan_U> Red-Sox, Just list the functions that you want to perform that aren't in the default list of actions( where the key is or what it looks like doesn't really matter )
<Red-Sox> From the bottom left, I want that rocker to control zoom (if that's possible,) I want the gadgets button to launch the terminal.  Above that, bottom left, I want the music button to launch banshee, the VoIP button to launch Gaim, the photos button to launch facebook, the mail button to launch gmail, the documents menu to bring up the menu, and the home button to launch my browser.  Above that, I want the left arrow to go back and the right a
<Jordan_U> Red-Sox, Zoom as in zooming into the entire desktop? I think that to do that smoothly you will need to use Compiz ( and it is really easy to setup keyboard shortcuts in Compiz / Beryl )
<Red-Sox> Jordan_U: Okay, that's how it was in OS X and it was amazing
<Red-Sox> So compiz
<Red-Sox> I was gonna have to tackle that at some point
<Jordan_U> Red-Sox, Please list only the functions that are't in the list of actions in System -> Preferences -> Keyboard Shortcuts, since I assume you can do that yourself
<Red-Sox> Okay well actually all of those but the volume ones.......
<Jordan_U> Red-Sox, Unless you don't know how to for instance set bansee to run when Gnome tries to "Launch Music Player"
<Red-Sox> Because most of them aren't mapped to the correct app
<Red-Sox> That's what I don't know
<Red-Sox> Jordan_U: keytouch?
<Jordan_U> Red-Sox, I don't think you need that, maybe it would be easier to setup but I have never tried it
<Red-Sox> It looks as if this will help immensel
<Red-Sox> immensely*
<Red-Sox> I...just...can't find it
<Red-Sox> I just installed it
<Red-Sox> it's not anywhere in the middle
<Red-Sox> menu*
<Jordan_U> Red-Sox, Use galternatives to change the default app for a given task
<Red-Sox> Is that installed already?
<Jordan_U> Red-Sox, I don't know, try running it from a terminal and find out :)
<Red-Sox> yay I found KeyTouch
<Red-Sox> and I installed galternatives, I just on't know where it is lol
<Red-Sox> don't*
<Jordan_U> Red-Sox, Use whatever works, at this point if you can't tell I am just figuring out things as we go
<Red-Sox> yeah and thanks btw you've helped a lot today :D
<Jordan_U> np
<Red-Sox> hmm well KeyTouch won't work, but I'll hang on to it just in case
<Red-Sox> Jordan_U: this isn't my keyboard but I'm trying it http://ubuntuforums.org/showthread.php?t=229559
<Jordan_U> Red-Sox, Just ask in #ubuntu how to make Banshee the default media player in Gnome that should solve most of your problems
<Red-Sox> Okay
<Red-Sox> Those ones to the left aren't that important
<Red-Sox> Something odd though is when I mute, banshee overides it
<Red-Sox> oh it doesn't work at all
<Red-Sox> so the system volume is pointless....
<Red-Sox> Jordan_U: I don't think anyone knows :P
<Red-Sox> actually, Jordan_U, it IS default
<Jordan_U> Red-Sox, You may just need to show the other channels in the volume preferences
<Red-Sox> Okay
<Jordan_U> Red-Sox, What defaults are not set as you want them to be?
<Red-Sox> Jordan_U: Well banshee is all I care about anymore
<Jordan_U> Red-Sox, Oh, BTW, you do *not* want to follow the instructions on that post, at least as far as I can tell it is not required, and may break things
<Jordan_U> Red-Sox, So you are fine?
<Red-Sox> Jordan_U: crap
<Red-Sox> haha
<Red-Sox> I'll reserve that later
<Red-Sox> as for now I have xc
<Red-Sox> bye guys
<Red-Sox[away] > oh and thanks again Jordan_U
<Jordan_U> Red-Sox[away] , np, and don't change your nick, just set an away message
<Red-Sox[away] > Back
<Red-Sox> Jordan_U: what's the matter with changing the nick?
<Jordan_U> Red-Sox, It just adds more clutter in large channels like #ubuntu
<Jordan_U> !nickspam
<ubotu> You should avoid changing your nick in a busy channel like #ubuntu - it causes unrequired scrolling which is unfair on new users. The same goes for using noisy away messages : use the command "/away <reason>" to set your client away silently - See also !Guidelines
<Red-Sox> Okay
<Red-Sox> nalioth: does the volume work on your internal speakers but not for your externals?
<nalioth> internal speakers?
* nalioth uses a powermac
<Red-Sox> well does audio work for your external speakers?
<Jordan_U> Red-Sox, I didn't think the mac mini had internal speakers
<Red-Sox> Jordan_U: yes just one though
<tators> hi
<jrib> paste output of 'sudo fdisk -l'
<jrib> hi
<tators> what
<tators> where do I paste this
<jrib> here is fine or http://paste.ubuntu-nl.org if it's >5 lines
<tators> sudo fdisk -1
<tators> sudo fdisk -l
<tators> this is my windows machine btw
<jrib> the output :0
<tators> not my linux machine
<tators> oh into the terminal
<tators> hold on
<tators> I can't paste it becuase its a different computer
<tators> what info do you need
<jrib> does the other computer not have internet access?
<tators> it does
<tators> can I install irc on it
<jrib> sure
<tators> even tho I'm not logged in and its a live cd
<tators> ok hold on
<Red-Sox> Jordan_U: Do you know how to use this: http://bugzilla.gnome.org/show_bug.cgi?id=395433 ?
<tators> what is a linux irc client
<jrib> Red-Sox: you would need to know how to recompile
<jrib> tators: xchat
<Red-Sox> oh crap
<Red-Sox> I freackin give up
<jrib> gaim works too but I don't know how
<Jordan_U> Red-Sox, "This patch has been applied to the Banshee package in Ubuntu to good effect."
<jrib> Jordan_U: probably only in gutsy?
<Jordan_U> jrib, I havn't actually checked the bug report on launchpad
<Red-Sox> Jordan_U: ?
<Jordan_U> 87299
<Red-Sox> jrib: wasn't gaim changed to pidgin?
<tators> yeah I don't knwo how to install xchat in linux
<tators> what info do you need to know
<jrib> Red-Sox: starting in gutsy, yes
<Jordan_U> tators, Applications -> Add / Remove
<jrib> sorry, but why do you set a root password and not know how to install applications...
<Red-Sox> jrib: Oh
<Red-Sox> tators: Or you could use apt (sudo apt-get install xchat) in the terminal without the parens
<Jordan_U> tators, That is how you install all Applications pretty much, not the "Advanced" option ( which is the same as System -> Administration -> Synaptic Package Manager )
<tattors_> yo
<tattors_> ok
<Red-Sox> Jordan_U: If that's been applied to the ubuntu package, how come it won't work?
<tattors_> ubuntu@ubuntu:~$ sudo fdisk -l
<tattors_> Disk /dev/sda: 160.0 GB, 160041885696 bytes
<tattors_> 255 heads, 63 sectors/track, 19457 cylinders
<tattors_> Units = cylinders of 16065 * 512 = 8225280 bytes
<tattors_>    Device Boot      Start         End      Blocks   Id  System
<tattors_> /dev/sda1   *           1       19130   153661693+  83  Linux
<tattors_> /dev/sda2           19131       19457     2626627+   5  Extended
<tattors_> /dev/sda5           19131       19457     2626596   82  Linux swap / Solar
<Red-Sox> tattors_: We might try pastebin.ca next time, too
<jrib> tators: do this command: sudo mkdir /media/sda1 && sudo mount /dev/sda1 /media/sda1
<tattors_> was something supposed to happen
<tattors_> I pasted everything you said after command:
<jrib> tators: what does 'ls /media/sda1' now return?
<tattors_> no such...
<Jordan_U> tattors_, No such what?
<tattors_> file or directory
<Jordan_U> tattors_, Not possible
<jrib> did you do: sudo mkdir /media/sda1 && sudo mount /dev/sda1 /media/sda1
<jrib> tators:
<tattors_> ubuntu@ubuntu:~$ sudo mkdir /media/sda1 && sudo mount /dev/sda1 /media/sda1
<tattors_> ubuntu@ubuntu:~$ ls /media/sdal
<tattors_> ls: /media/sdal: No such file or directory
<tattors_> ubuntu@ubuntu:~$
<jrib> that's a 1 as in the number one, not an l
<tattors_> oh sda1
<tattors_> ok
<tattors_> ubuntu@ubuntu:~$ sudo mkdir /media/sda1 && sudo mount /dev/sda1 /media/sda1
<tattors_> ubuntu@ubuntu:~$ ls /media/sdal
<tattors_> ls: /media/sdal: No such file or directory
<tattors_> ubuntu@ubuntu:~$
<tattors_> err sorry
<tattors_> bin    dev   initrd      lib64       mnt   root  sys  var
<tattors_> boot   etc   initrd.img  lost+found  opt   sbin  tmp  vmlinuz
<tattors_> cdrom  home  lib         media       proc  srv   us
<jrib> ok, now do 'sudo chroot /media/sda1'
<tattors_> k
<jrib> what does your prompt look like now?
<tattors_> root@ubuntu
<jrib> good
<jrib> now do 'passwd root' and set a password you can remember :)
<jrib> did you forget your user's password as well?
<tattors_> possibly
<jrib> do you remember the username?
<tattors_> yea
<tattors_> but not the pw
<jrib> after you reset the root password, do 'passwd THE_USERNAME_HERE'
<Jordan_U> Red-Sox, "
<Jordan_U> I can confirm that this patch builds cleanly and works as expected.
<Jordan_U> The package is easily rebuilt through instructions here: https://wiki.ubuntu.com/UbuntuPackagingGuide/BuildFromDebdiff. I got some help on IRC in #ubuntu-motu, so head there if you need help. :)"
<tattors_> sweet
<Jordan_U> Red-Sox, From https://bugs.launchpad.net/ubuntu/+source/banshee/+bug/87299
<tattors_> so now I can get off the livecd
<tattors_> nd everything should be fine?
<jrib> tattors_: in theory, but come back here if there are issues
<tators> k thx
<Jordan_U> tattors_, Why do you have a root password?
<tators> i dont know
<Jordan_U> tators, Then you might want to set it back to the default of being "disabled" with "passwd root -d"
<Red-Sox> Jordan_U: can I download a patch there or something?
<Red-Sox> If so I'm not seein it...
<tators> is mysql and apache already installed from my live cd
<tators> or do I have to install it all
<jrib> tators: on the live cd system that you get when you boot from the cd?
<tators> uhm yea
<tators> I did a search for mysql
<tators> and it only had administrator software
<jrib> no, mysql and apache are not installed by default on the live cd
<tators> not the actual sever
<tators> so how do I instlal it
<jrib> why do you want to use the live cd instead of your installed system?
<tators> I don't
<tators> I took out the cd
<tators> but I was wondering if it was already installed
<tators> and if not
<tators> where do I get it from
<jrib> !lamp
<ubotu> LAMP is an acronym for Linux-Apache-MySQL-PHP. However, the term is often used for setups using alternative but different software, such as Perl or Python instead of PHP, and Postgres instead of MySQL. For help with setting up LAMP on Ubuntu, see  https://help.ubuntu.com/community/ApacheMySQLPHP - See also the Server CD installation process (different in Edgy+)
<tators> because applications --> add/remove doesn't have it
<jrib> read that link
<tators> ty
<jrib> I have to go now, good night and good luck :)
<Red-Sox> anyone know how this would work: http://ubuntuforums.org/showthread.php?t=178574#5
<Red-Sox> Jordan_U: I got it!!! There was an included plugin!
<Red-Sox> Jordan_U: Now all I need to do is figure out this audio problem and get my 5-button mouse working, then I'll be happy
<tattors> http://paste.ubuntu-nl.org/38420/
<tattors> any help would be great ;)
* Starting logfile irclogs/ubuntu-classroom.log
<Red-Sox> Hi
#ubuntu-classroom 2007-09-25
<jrib> cjae_: the bot's instructions have some enigmail info in them as well
<cjae_> jrib, but you do know about encryption right
<cjae_> I have pgp in thunderbird now from what you explained enigmail is like a wizard for it or no
<jrib> it's a plugin that makes it easy to do encryption
<cjae_> anyway do I have the general idea right each person on either side of the email (send/receiver) has two keys one pblic and one private right?
<jrib> it provides buttons for "sign message" and "encrypt message", stuff like that
<jrib> cjae_: yes
<cjae_> ok so I use pgp to encrypt it with my public key right?
<jrib> well
<jrib> if you want to make it so only you can open it and read it, yes
<cjae_> ok so i want to use my private key so someone else can read it
<jrib> you wouldn't do that
<cjae_> this is where i am confused
<jrib> lets call your friend bob
<cjae_> k
<jrib> you want to encrypt and email so only bob can read it
<cjae_> k
<jrib> so you encrypt the message with his public key.  At this point, not even you can decrypt it.  The only way to decrypt it is for bob to use his private key.  And since it's private, only he can read it
<jrib> get it?
<cjae_> ah the keys work together
<cjae_> makes snese or it wouldn't have been very secure
<jrib> if he wants to send you a message that no one but you can read, he goes to a key server and gets your public key (like anyone can) and encrypts the message with that.  Then you get the message and decrypt it with your private key
<cjae_> where does one find these servers
<jrib> the !gpg link explains how to get your key onto a key server
<cjae_> k
<jrib> the other thing you do is sign messages
<cjae_> must one do this too
<jrib> basically, that works by encrypting a hash of your message with your private key.  Then anyone can decrypt it with your public key and verify they get the right hash for the message
<cjae_> sort of like md5
<jrib> hash is used just for sake of space...
<jrib> you could do the whole message I guess
<jrib> but the important thing is that you can't create the string that when the public key is applied to it gives you back the original message unless you know your private key.  And only you know your private key, so it must be you that signed the message
#ubuntu-classroom 2007-09-26
<doug__> here jrib
<jrib> have you formatted the partition now?
<doug__> jrib no
<doug__> what i wanna do is just make it a storage unit nothn more
<jrib> yes
<doug__> give me 5 min ill be running on the live cd
<jrib> why?
<jrib> ...
<ubuntu> lol forgot the #
<ubuntu> ok jrib im on live cd
<jrib> k, format the ntfs as ext3
<ubuntu> wait
<ubuntu> now on the real ext3 note i have crucial 76gb data i cant lose or back up
<jrib> there's no such thing as crucial data you can't back up.  If it's crucial, you back it up
<jrib> is it on the same hard drive?
<ubuntu> i cant i have no cd's nor othr drives
<ubuntu> yes
<ubuntu> its all school and work stuff
<jrib> then it's up to you if you want to format the other partition.  Nothing should go wrong, but of course nothing is ever 100%
<jrib> s/ever/never
<ubuntu> ok so format the ntfs as ext3?
<jrib> wait no, ever was right...
<jrib> ubuntu: yes
<ubuntu> The following operation could not be applied to disk:  Format /dev/sda1 as ext3
<doug__> jrib:  i got The following operation could not be applied to disk:  Format /dev/sda1 as ext3
<doug__> the format and the mkfs.ext3 /dev/sda1 failed
<jrib> is it mounted?
<doug__> jrib:  lol yea now its done
<doug__> jrib  its now ext3
<jrib> k
<jrib> reboot then
<doug__> k brb
<doug__> wait jrib do i boot into that one first thn the real one?
<jrib> huh?
<jrib> boot into your normal install
<doug__> ok
<doug__> jrib:  ok now how i get read/write to it
<jrib> have you managed to add it to your fstab?
<doug__> how?
<jrib> pastebin the output of 'blkid' and the current contents of your /etc/fstab
<jrib> !paste
<ubotu> pastebin is a service to post large texts so you don't flood the channel. The Ubuntu pastebin is at http://paste.ubuntu-nl.org (make sure you give us the URL for your paste - see also the #ubuntu channel topic)
<doug__> http://paste.ubuntu-nl.org/38639/
<jrib> doug__: /etc/fstab is a file, open it with 'gedit /etc/fstab'
<doug__> jrib:  http://paste.ubuntu-nl.org/38640/
<jrib> doug__: you don't have to paste it in both channels
<jrib> change line 11 from: UUID=48C45190C451815C /media/sda1 ntfs-3g defaults,locale=en_US.UTF-8 0 1
<jrib> to:
<jrib> UUID=2665e48d-5f45-4604-8ba7-6fd146a32c85 /media/sda1 ext3 defaults 0 2
<doug__> done
<doug__> it wont let me save
<jrib> oh right, close that and open it with "gksudo gedit /etc/fstab"
<doug__> did
<doug__> forgot the sudo
<doug__> now what i do with it jrib?
<jrib> you changed the line?
<doug__> yep and saved
<jrib> now type 'sudo mount -a' in a terminal
<doug__> done and it went to a new line
<jrib> now what permissions do you want on it?
<doug__> none
<doug__> oh i want read/write
<doug__> i have non as of now
<jrib> with everyone or just your user?
<doug__> im only one uses it so me
<jrib> do:  sudo chown $USER: /media/sda1
<doug__> and how do i make it mount and have read/write auto on bootup
<jrib> it already is
<doug__> do i have to do sudo chown $USER: /media/sda1 on evry boot?
<jrib> no
<doug__> jrib:  i put somethng in it and i cant delete it now
<jrib> tell me the output of: ls -ld /media/sda1 /media/sda1/*
<doug__> drwxr-xr-x 4 doug doug  4096 2007-09-26 09:12 /media/sda1
<doug__> drwx------ 2 root root 16384 2007-09-26 08:52 /media/sda1/lost+found
<doug__> drwxr-xr-x 2 doug doug 12288 2007-09-23 07:30 /
<jrib> did you truncate the output?
<doug__> i only did what u told me
<doug__> so nope
<jrib> is "drwxr-xr-x 2 doug doug 12288 2007-09-23 07:30 /" actually what it said on the last line, check that you copied the entire line
<doug__> drwxr-xr-x 2 doug doug 12288 2007-09-23 07:30 /media/sda1/My Pictures
<doug__>      is the last line
<doug__> sorry must of cut some off
<jrib> so you put "My Pictures" in there, correct?
<jrib> and you can't delete it?
<doug__> yes
<doug__> yes
<doug__> i was testing it
<jrib> what happens when you try?
<doug__> nothin
<doug__> its not whre i can pick it
<jrib> press "reload" in nautilus and try again
<doug__> its greyed out
<doug__> k brb
<doug__> how i do the reload
<doug__> all i know how do is reload x with out totaly rebooting
<jrib> in the bar, there is an icon with two arrows going around in a circle
<jrib> or view -> reload, or ctrl-r
<doug__> oh *slaps self on face*
<doug__> i thought u ment somethng else
<doug__> ok done and done
<jrib> so you can delete now?
<doug__> thanks jrib
<doug__> yep
<jrib> no problem
<doug__> sorry or the trouble
<doug__> for*
<jrib> no trouble
#ubuntu-classroom 2007-09-27
<schnoodles> hello i have burnt the ubtunu .iso with nero through windows twice now, each time i got this thing saying its a foreign format so i chose ignore. The problem is when i boot up with the CD the ubuntu menu pops up, so when i go to install i get a bad disk i/o error. has anyone run into this ?
<schnoodles> does anyone know ?
#ubuntu-classroom 2007-09-28
<dholbach> MOTU Q&A session in 12 minutes
<dholbach> HEY flohack
<flohack> Hi! I'll wait until 14.00 before I repost my question
<dholbach> heya jussi01
<jussi01> hi dholbach :)
<BugMaN> hi
* flohack is back
<dholbach> hey guys :)
* jussi01 hugs Hobbsee Hello!
<Hobbsee> hiya!
* Hobbsee is not here
<dholbach> hi-bye Hobbsee :)
<dholbach> hello everybody - welcome to another MOTU Q&A session
<dholbach> if you're here for the session, please quickly introduce yourself :-)
<dholbach> I'm Daniel Holbach, MOTU for quite a long time now and trying to make it as easy as possible to join the developer crowd - if you still have questions after the session, please mail me with anything
<dholbach> Who else do we have here? :-)
<flohack> Hi! I'm one of the developers of ktikz, a small application designed for scientific writers who use TikZ for drawing their illustrations. I try to get ktikz into Ubuntu :-)
<dholbach> great to have you here flohack
<TheMuso> Hi. I am Luke Yelavich, a MOTU since January, and packaging lead for the UbuntuStudio project, as well as a regular accessibility team contributer.
<dholbach> seb128: we're going through a round of introductions atm
<flohack> Don't laugh at the name ktikz please...not one of my most creative inventions I know gg
<seb128> Hi, I'm Sebastien and I'm working on the Ubuntu Desktop for canonical
<dholbach> flohack: don't worry - I think there are names for software that are worse :)
<dholbach> anybody else?
<BugMaN> Hi! I'm Maurizio, i try to improve my skills on packages activities
<dholbach> great to have you here, BugMaN
<pleia2> hey, I'm Lyz, I do some software packaging for Debian, will sort of be lurking (I'm at work) but am interested in starting to pick up on how things work in MOTU
<dholbach> AstralJava, adam_b: we're going through a quick round of introductions atm - nice you are stopping by :)
<dholbach> pleia2: excellent
<porthose> Hi I packaged ampache for debian, just hanging out
<dholbach> porthose: nice to see you again
<porthose> :)
<dholbach> ok, maybe everybody else will introduce themselves during the session; let's go :-)
<dholbach> the documents I can suggest to all those of you who are new to packaging are
<dholbach>  - https://wiki.ubuntu.com/MOTU (of course)
<dholbach>  - https://wiki.ubuntu.com/MOTU/Recipes (to start playing with tools you use for packaging everyday)
<dholbach>  - https://help.ubuntu.com/6.10/ubuntu/packagingguide/C/ (to look up whatever might be new to you)
<dholbach> https://wiki.ubuntu.com/MOTU/Documentation (has important links to all kinds of packaging docs)
<dholbach> who of you started packaging new software or working on existing packages already?
<porthose> new
<flohack> I just uploaded ktikz to REVU, could someone please give me a link to the review procedure, or explain? Do I have to ask someone here for a review explicitly, or are you reviewing packages all the time and should I just wait until my package is reviewed?
<jussi01> Hei, Im Jussi, Im a motu mentoree - hopefully one day I'll get to MOTU. Im also part of the ubuntu studio team
<flohack> so that would be new then
<dholbach> flohack: yes, that's a NEW package
<dholbach> flohack: good question... the MOTU policy says that two MOTUs will have to give a positive review for your package
<flohack> Yes that's clear from the docs
<TheMuso> Since we are close to a release, bug fixing is more of a priority at the moment, so your package likely won't be looked at till next cycle.
<dholbach> flohack: you can ask for reviews on #ubuntu-motu on the ubuntu-motu-mentors@ mailing list, but at the moment we're in NewPackagesFreeze
<dholbach> so we're focusing more on existing bugs, etc
<TheMuso> dholbach: That too.
<dholbach> flohack: but it does not hurt to send a mail to ubuntu-motu-mentors@; somebody with a bit of free time will look after your package
<flohack> I thought that was just for main atm...but you just released beta...which probably introduced the freeze i suppose
<TheMuso> flohack: The freeze has been in place for a few weeks actually.
<dholbach> http://wiki.ubuntu.com/GutsyReleaseSchedule has more info on all the freezes
<porthose> During next release cycle will MOTU be reviewing packages in PPA's
<dholbach> porthose: yes, if they have bugs with needs-packaging assigned to them
<TheMuso> porthose: They would be better on revu, as there is a comments system that allows for viewing of what has been reviewed, and what needs work etc.
<TheMuso> IMO
<flohack> Is FeatureFreeze the relevant deadline for new Universe packges?
<dholbach> yes, it's as TheMuso says; we currently are in a state where we have not integrated the PPA system into our review processes fully yet
<porthose> Cool Thx
<dholbach> flohack: yes, https://wiki.ubuntu.com/FeatureFreeze
<dholbach> Who of you worked on existing packages already? Like applied a patch?
<norsetto> me :-)
<jussi01> me
<BugMaN> me sometimes :)
<AstralJava> o/
<dholbach> great :)
<dholbach> how did you get your packages uploaded?
<dholbach> first of all, I'm pleased to see that you are working on existing packages like that - that's one thing I like about MOTU: if there's a bug that bothers you, it's very easy to just change it and get things fixed
<dholbach> did you make use of  https://wiki.ubuntu.com/SponsorshipProcess  to get the change included in Ubuntu or did you ping somebody to get it done?
<BugMaN> yes, usual i'm subscribe bug to universe or main sponsors
<jussi01> no, pinged
<jussi01> nice page to know though :)
<dholbach> BugMaN: nice
<dholbach> jussi01: yeah, it's good to use that process, because you're not blocked on individual persons, who might or might not have time
<BugMaN> dholbach: i done that via LP and not with a tool
<flohack> Thank you very much for helping! Unfortunately I have to get back to my thesis. Keep up the good work!
<dholbach> jussi01: also you get input from not just one, but lots of different people
<dholbach> flohack: let me know how your attempts at becoming a MOTU go
<flohack> I'll do!
<dholbach> flohack: I'm keen to see you on that team and keen to see you project in Ubuntu soon
<dholbach> rock on!
<flohack> thanks!
<dholbach> BugMaN: yeah that's fine too; as long as ubuntu-*-sponsors are on the bug
<dholbach> does anybody have any concrete questions?
<dholbach> any package or problem we could take a look at together?
<jussi01> dholbach: is there a list of things you need to know for becoming a motu?
<dholbach> jussi01: good question
<dholbach> jussi01: no, there's not; but the process is very easy and very straight-forward
<TheMuso> My answer to that would be, you can't know everything, but you need to know where to go to get the answers you seek.
<dholbach> 1) basically you contribute changes, new packages, patches, etc by the process described above
<TheMuso> THings you do need to know, are how to read and understand diffs, understand the commonly used files in the debian directory, and how a package goes together.
<dholbach> 2) at some stage your sponsors tell you "hey man, you should be able to do this yourself; you're doing good work"
<dholbach> 3) you send a small application to the MOTU Council
<dholbach> 4) You become MOTU
<jussi01> ahhh :)
<dholbach> https://wiki.ubuntu.com/MOTU/Hopeful/Recruitment is the process for that
<jussi01> cool. thank you
<dholbach> it's really straight-forward and it takes people like norsetto just a few weeks ;-)
* dholbach hugs norsetto
* norsetto hugs dholbach back
<jussi01> (and people like jussi01 a few years...lol)
<dholbach> but TheMuso has a good point: it's really important to know who to ask and when to ask other people
<dholbach> that's why it's good to be on the ubuntu-motu and ubuntu-motu-mentors mailing lists and ask people if you're unsure
<dholbach> also to get your packages reviewed by a variety of people
<dholbach> jussi01: I doubt that :-)
<TheMuso> Agreed. Getting known amongst the MOTUs, means a better chance of becoming one yourself.
<dholbach> hey gpocentek
<gpocentek> hello dholbach
<jussi01> dholbach: :) One more question - is it necessary to become an ubuntu member before becoming a motu?
<TheMuso> jussi01: No.
<dholbach> jussi01: no, motu membership includes ubuntumembers membership
<jussi01> ok. :)
<dholbach> if you want to get involved with the MOTUs and don't know what to work on: https://wiki.ubuntu.com/MOTU/TODO has a variety of easy bugs and packages to fix
<dholbach> for example the weekly bitesize tasks at the bottom of the page
<huats> jussi01: and you will notice that everyone is very nice with you when you start (even after ofcourse...)
* TheMuso has been trawling the big pile of universe bugs lately, and found a fair few that he could fix.
<jussi01> huats: very true :)
<TheMuso> SO theres plenty there, just be prepared to do some bug triaj along the way. :p
<dholbach> https://launchpad.net/ubuntu/+bugs?field.tag=unmetdeps for example
<norsetto> jussi01: a little word of advice from a fresh motu: don't be shy or afraid to ask, ask, ask, and when in doubt ask. oh, and ask
<dholbach> that's a list of bugs of packages that are not installable in gutsy at the moment
* jussi01 needs to head home from work, will catch you all later. 
<TheMuso> jussi01: Thanks for dropping by.
<jussi01> norsetto: thanks...dont worry... I do
<dholbach> jussi01: see you around and let me know how things go
<ian_brasil> hi ..i have just ported a couple of apps to ubuntu mobile. I assume that I need to make the .deb packages now and then ping someone when it is done ..is this the correct procedure. Also is there a canonical tutorial for packaging?
<BugMaN> dholbach: for those bugs it's better to have a pbuilder envy for gutsy to test?
<jussi01> dholbach: np. I will
<dholbach> BugMaN: and probably a chroot to test-install the packages in afterwards
<dholbach> BugMaN: but yeah, that's a requirement
<BugMaN> dholbach:
<BugMaN> dholbach: ok
<TheMuso> dholbach: Do we have a good document explaining what a chroot is?
<dholbach> ian_brasil: I can paste you a few documentation links I mentioned at the beginning of the session
<ian_brasil> cool
<dholbach> TheMuso: DebuggingProgramCrash has one I think
<TheMuso> dholbach: ah ok.
<dholbach> sudo mkdir /chroots; sudo debootstrap gutsy /chroots/gutsy     should work I think
<dholbach> (getting debootstrap from -backports is necessary for that)
<norsetto> TheMuso: I find this very good https://wiki.ubuntu.com/DebootstrapChroot
<dholbach> ah nice
<TheMuso> norsetto: Yeah thats another good one, but it uses the slowly phasing out dchroot.
<dholbach> ian_brasil: after that uploading them and asking for review using http://wiki.ubuntu.com/SponsorshipProcess will get you reviews for those packages
<norsetto> TheMuso: yes, but it says so ;-)
<TheMuso> I use LVM snapshots with chroots and sbuild personally.
<dholbach> ian_brasil: after having gone through a bunch of successful sponsored uploads, people will ask you to become a MOTU yourself and you can send an application to the MOTU Council
<dholbach> ian_brasil: that's basically it
<dholbach> any more questions?
<dholbach> any packages / patches we should look at together?
<ian_brasil> dholbach: that helps a lot...thx
<Goliath23> dholbach: i have a technical question. debuild fails on my machine here with an error message.
<Goliath23> can I post it?
<dholbach> Goliath23: fire away
<norsetto> !ask | goliath23
<ubotu> goliath23: Don't ask to ask a question. Just ask your question :)
<Goliath23> checking if C++ programs can be compiled... no
<Goliath23> configure: error: Your Installation isn't able to compile simple C++ programs.
<Goliath23> Check config.log for details - if you're using a Linux distribution you might miss
<Goliath23> a package named similar to libstdc++-dev.
<TheMuso> Goliath23: DO you have build-essential installed?
<dholbach> Goliath23: do you have build-essential installed?
<Goliath23> I have the standard c++ libs installes. on my computer at home debuild works fine
<dholbach> hehe
<Goliath23> yes
<dholbach> is this a certain package?
<dholbach> or some other software?
<Goliath23> nono, ist ksplash-engine-moodin
<Goliath23> works fine and builds fine at home
<dholbach> try       sudo apt-get build-dep ksplash-engine-moodin
<Goliath23> nothing installed
<dholbach> then config.log will have the answer
<Goliath23> can I somehow remove and reinstall build-essential and all deps of it?
<norsetto> Goliath23: can you paste your configure.log to pastebin?
<Goliath23> #ifdef __cplusplus
<Goliath23> extern "C" void std::exit (int) throw (); using std::exit;
<Goliath23> configure: exit 1
<Goliath23> norsetto: sure
<Goliath23> http://pastebin.com/m658d4398
<slytherin> Is there any page mentioning what kind of changes can/should/should not be done when creating a package from existing debian package?
<TheMuso> slytherin: What reason do you have to modify a debian packge for Ubuntu
<TheMuso> Usually f possible, its better to send the fix to Debian, and sync accross to Ubuntu.
<dholbach> slytherin: not to my knowledge. but there's an easy rule of thumb: if it addresses a certain need that we can't achieve by syncing from debian, keep the changes as small as possible
<Goliath23> norsetto: hm, line 1012 something about pthread..
<slytherin> TheMuso: ex. I modified copyright year and download url in debian/copyright of a package. I also added version for libvorbis-dev as per my understanding of configure sript.
<dholbach> slytherin: the thing is: we re-merge all our changed packages with debian in the beginnign of the release cycle and the bigger your change, the more conflicts it's probably going to have with a new version from debian we're merging with
<TheMuso> slytherin: That sounds like something that could go to Debian, and synced accross.
<slytherin> dholbach: That is right. That is why I wanted to know if their are any guidelines.
<dholbach> slytherin: that sounds like cosmetical changes the user probably has no benefit of
<dholbach> slytherin: no strict guidelines, but bear in mind that you or somebody else will have to re-do your changes to package when merging again
<norsetto> Goliath23: yes, sounds like an header problem
<slytherin> dholbach: hmm
<dholbach> slytherin: does that make sense?
<slytherin> dholbach: yes, it does
<dholbach> ok
<dholbach> Goliath23: what kind of modifications did you do?
<Goliath23> dholbach: no modifications.. I guess I'll be able to continue from here... I guess I have to remove some deprecated libsomthing-dev ...
<norsetto> Goliath23: try reinstalling libc6-dev
<Goliath23> kk, thanks guys
<huats> Hey all
<dholbach> generally a: sudo apt-get install devscripts build-essential fakeroot; sudo apt-get build-dep <package>; fakeroot apt-get source -b <package>       should enable you to build it
<Goliath23> ah... apt-get remove --purge libpthread-dev did the job!
<dholbach> hey huats
<dholbach> any more packaging problems? any packages we should look at?
<huats> oups I thought Goliath23 was over... I let you finish and then I ask mine :-)
<dholbach> huats: fire away
<Goliath23> i'm finished
<dholbach> ian_brasil: any mobile packages you have lined up? :)
<huats> I have problems for solving bug #36733
<huats> the rubber part....
<dholbach> oh, the py[co]  one? :)
<huats> yep
<norsetto> bug 36733
* dholbach remembers the bug number :)
<dholbach> https://bugs.launchpad.net/ubuntu/+source/adonthell/+bug/36733
<huats> you saw it so many times...
<dholbach> yes :)
<dholbach> alright, which source package are we looking at?
<huats> well I have been searching a way to remove the pyc and the only one was to make a find /rm
<dholbach> rubber?
<huats> rubber
<huats> yep
<slytherin> is ubotu sleeping? Why didn't he read the bug description for us?
<dholbach> slytherin: no idea
<ian_brasil> i have ported gpodder and liferea to UME
<dholbach> ian_brasil: wow - nice
<ian_brasil> i python and i C app
<huats> so I tried to insert that in debian/rules inside the install target
<huats> but nothing seems to work...
<dholbach> can you post the new rules file somewhere?
<huats> yep
<huats> pastebin....
<dholbach> does everybody understand what huats' bug is about?
<ian_brasil> I am writing the UME Guide so my idea is to document the whole MOTU process for other mobile devs
<dholbach> ian_brasil: that's great - we should chat about that at some stage
<ian_brasil> for sure..i was hoping you would say that :)
<porthose> is there a way to setup multiple pbuilder like one for feisty, one for gusty etc?
<dholbach> porthose: I think that's documented too on PbuilderHowto
<TheMuso> porthose: Yes. There is a script in ubuntu-dev-tools to do this I think.
<dholbach> yeah
<TheMuso> pbuilder-dist
<dholbach> huats: do you have the rules file up somewhere?
<huats> paste.ubuntu.com/491/
<porthose> Thx
<huats> sorryfor the delay (the file was on another compuer)
<huats> I have put in purpose the find/rm twice
<TheMuso> huats: WHy did you put the find line twice?
<huats> TheMuso: juste to shiw you where I have tried to use it
* dholbach does a test build: apt-get source rubber; #download rules file, stick into debian/rules
<huats> s/shiw/show/
<TheMuso> huats: Right
<TheMuso> huats: Wht has worked, and what hasn't?
<huats> nothing has worked... it builds correctly, but the .pyc are still there...
<TheMuso> Right.
<TheMuso> huats: Have you considered building the package step by step by hand, and attempting to determine which step creates the files? By steps I mean, fakeroot debian/rules clean, ./debian/rules build, fakeroot debian/rules install and fakeroot debian/rules binary
<huats> TheMuso: no but I'll be very interested in doing it...
<TheMuso> I personally have found this very helpful, especially recently, in finding problems.
<huats> TheMuso: how can I do that ?
<huats> TheMuso: after a  pbuilder login or not ?
<TheMuso> huats: You need to make sure you have all the package's build-dependencies installed, and run the above commands manually.
<TheMuso> huats: If you can login to a pbuilder, and get the package into the chroot, thats great, but things like this need a general purpose chroot handy.
<TheMuso> i.e not specifically for pbuilder use.
<huats> TheMuso: ok so I chroot to my pbuilder env
<huats> TheMuso: and the I can build it step by step...
<TheMuso> huats: Yes.
<norsetto> dholbach: you may want to look at my changes some time today: https://wiki.ubuntu.com/MOTU/Mentoring/Contributor
<dholbach> norsetto: will do
<dholbach> I found the problem
<dholbach> install: build
<dholbach>         dh_testdir
<dholbach>         dh_testroot
<dholbach>         dh_clean -k
<dholbach>         dh_installdirs
<dholbach>         $(MAKE) install prefix=$(CURDIR)/debian/rubber/usr
<dholbach>         find $(CURDIR) -name '*.pyc' -exec rm {} \;
<dholbach> # Build architecture-independent files here.
<dholbach> this will make it work
<dholbach> you have to put *.pyc into ''
<huats> dholbach: I know
<huats> dholbach: :-)
<TheMuso> find is funny like that at times.
<dholbach> else the shell will expand it to the first thing it finds
<dholbach> ok great :)
<dholbach> another bug solved
<huats> dholbach: oh
<dholbach> huats: let me know when you put up the debdiff for the fix :-)
<huats> dholbach: I had misread your sentence
<huats> dholbach: ok
<huats> dholbach: sorry for bothering...
<dholbach> huats: does it make sense?
<dholbach> huats: no, you're not bothering at all
<dholbach> huats: what do you think how many times I made that particular mistake
<TheMuso> huats: This is what we are here for.
<huats> dholbach: yes... you use the same command at the same place, but with the correct syntax...
<dholbach> it's a mistake that's easy to make
<TheMuso> dholbach: Often not quoting the name parameter stuff works.
<dholbach> in debian/rules you often mix shell code with Makefile code
<dholbach> it's easy to be wrong there
<TheMuso> As I said, find can be an unusual beast.
<dholbach> yes
<dholbach> any other bugs you want to talk about? if not I have one
* TheMuso will be heading off to bed soon, so won't be round much longer.
<dholbach> I talked about 'unmetdeps' bugs before; package that are not installable because their dependencies cannot be resolved
<dholbach> I'll make this the last one then
<dholbach> we should have another session next week :)
* norsetto keeps TheMuso awake by hammering him on the head every 30 sec
<dholbach> https://bugs.launchpad.net/ubuntu/+source/wammu/+bug/145538 is one of the list I mentioned earlier
<dholbach> norsetto: you're so mean
<TheMuso> norsetto: DO you want me to fix bugs, or not? :)
<dholbach> can anybody find out what the problem is with this bug?
* norsetto keeps TheMuso awake by gently hammering him on the head every 30 sec
<TheMuso> norsetto: DO you want me to fix bugs, or not? :)
<TheMuso> To fix bugs, I need sleep at some point.
<dholbach> if you look at the bug you will notice that it mentions amd64 - you can ignore that
* norsetto sings a lullaby to TheMuso
<dholbach> this bug affects all architectures
* TheMuso listens to the lullaby, and then sings along with it, singing a harmony.
<dholbach> so? anybody up for fixing the bug? :)
* norsetto notice all the cats are suddendly fleeing his house ....
<dholbach> ok, maybe we can get this one fixed next time or you can look at it and let me know what you find :-)
<norsetto> dholbach: give them time to donwload the source :-)
<dholbach> you don't need to download the source if you're on gutsy
<dholbach> just try to install it by running           sudo apt-get install --dry-run wammu
<TheMuso> dholbach: Often though, you do need to look atht e source package to get a good idea of why the unmet dep is the way it is.
<dholbach> TheMuso: absolutely
* TheMuso makes the meeting the last task for tonight.
<AstralJava> wammu: Depends: python-gammu (>= 0.21) but it is not going to be installed
<dholbach> AstralJava: yep
<norsetto> AstralJava: and why is that?
<adam_b> dholbach: the dry run was happy to install (until I updated repositorys, then as AstralJava)
<dholbach> why is this not possible to install?
<AstralJava> Hang on, I'll get the source. :)
<norsetto> AstralJava: no need yet .....
<adam_b> python-gammu is only 0.20-1
<dholbach> exactly
<dholbach> so we need to get a newer version from Debian
<AstralJava> Heh, didn't think of that.
<dholbach> http://packages.debian.org/src:python-gammu
<adam_b> dholbach: thats ok with freeze?
<dholbach> https://wiki.ubuntu.com/UbuntuDevelopment#SyncingAndMerging is the process for that
<dholbach> adam_b: it will have to get a FeatureFreeze exception
<dholbach> https://wiki.ubuntu.com/FreezeExceptionProcess#head-1d28045481b8803d4815989e93edc4206f4848c4
<dholbach> but I'm sure it will get granted, because it fixes a serious bug
<dholbach> does anybody of you want to work on that?
<dholbach> and follow up with our findings on the bug report?
* AstralJava can volunteer if no one else wants to
<dholbach> AstralJava: that's great
<dholbach> AstralJava: be sure to let me know if it gets stuck somewhere
<TheMuso> AstralJava: Great. Feel free to ask me any questions if you have any.
<dholbach> so you see; sometimes being a MOTU is some kind of detective work
<adam_b> what about testing if wammu really needs the new version of python-gammu?
<dholbach> and it's important to follow up on bug reports with what you've found out
<AstralJava> Sure thing, and dholbach, TheMuso is my sponsor so I'll see him first before bugging all the world. :)
<AstralJava> Oh wait, no that's wrong.
<AstralJava> Nevermind.
* AstralJava is still a bit buggered-up because of the flu
<TheMuso> AstralJava: mentor.
<AstralJava> Heh, yeah that too. :)
<dholbach> adam_b: we inherited both versions from Debian (no Ubuntu changes), so the debian maintainer must have thought that it's necessary to have that new version
<norsetto> adam_b: note as well the version of wammu
<dholbach> adam_b: as it happens the debian maintainer is also the upstream author, so it's probably right what he's doing :-)
* porthose thinks this has been a good Q&A session :)
<dholbach> adam_b: but you're right; sometimes version numbers are too strict and you can "bend" them to make packages installable again
<dholbach> adam_b: in this case I think it's not applicable
<dholbach> porthose: thanks a lot for that
<dholbach> it's been great to have you all around
<adam_b> ahh ok, and probably worth checking that the newer python_gammu dosnt need any other new things?
<dholbach> and make sure you're on the ubuntu-motu-mentors list, then I'll announce the next session there
<pleia2> dholbach: quick policy question?
<norsetto> everybody a good applause for dholbach!
<dholbach> adam_b: exactly
<TheMuso> Great to see the Q&A sessions are attracting peopl.
<TheMuso> people
<dholbach> pleia2: fire away
* norsetto applauds
<dholbach> thanks a lot... applaud yourselves too - you all were great
<dholbach> and I hope to see you all as MOTUs soon :-)
* porthose claps
* TheMuso seconds dholbach.
<pleia2> so I'm wondering what the opinion is about packaging in general because of my involvement with Ubuntu-Women, we've sort of been pushing women to contribute directly to Debian rather than Ubuntu since it'll benefit both distros
* huats claps
<dholbach> pleia2: right... that's a valid point
<pleia2> so is this appropriate?
<dholbach> pleia2: I can only speak for myself: I contribute to Ubuntu, because I use Ubuntu and test things on Ubuntu
<pleia2> I do tend to suggest they check out their package in Ubuntu too, see how it's doing and all, if it needs help
* pleia2 nods
<dholbach> pleia2: but I have close contact to debian developers, so I let them know about things I do
<AstralJava> Thank you norsetto, dholbach, TheMuso and all others for having us here. :) Great job.
<Hobbsee> pleia2!
<pleia2> hey Hobbsee :)
<dholbach> or another example: if I package a new software, I follow up on a debian RFP (request for package) or ITP (intent to package) bug to let them know, that I've already done the work in UBuntu, so they can benefit from that
<pleia2> dholbach: good to know, thanks
<dholbach> pleia2: so my answer would be something like: to contribute to Debian (and make other people benefit from our work too) you don't have to be a debian developer
<dholbach> as long as you're easy to work with and maintain good channels of communication
<dholbach> I hope that makes sense
<pleia2> well the RFP and ITP bug notification if you package in ubuntu is a great idea
<Hobbsee> of course, it helps that there are DD's around that you can persuade to upload your package to debian too
<pleia2> I come from Debian, so that's why my dev work is over there, and it's neat to see my packages end up in Ubuntu too ;)
<TheMuso> Well folks, I must be off. Hope to see all you hopefuls around ni the community, asking questions, and fixing bugs/updating packages.
* norsetto notices the use of thw word "persuade"
<TheMuso> s/ni/in/
<dholbach> I'm off for lunch now
<pleia2> enjoy, thanks!
<dholbach> I'll let you all know on ubuntu-motu-mentors about the next session
<norsetto> TheMuso: thanks for sticking with us so late :-)
<dholbach> thanks a lot to all of you again!
<TheMuso> norsetto: This is my normal time for staying up anyway.
<huats> TheMuso: finally the hammer thing will stop :-)
<AstralJava> Thanks again.
<TheMuso> huats: heh.
<huats> thanks all once again....
<porthose> Thanks to all
<huats> dholbach: will you put the log of this meeting somewhere ?
<huats> well daniel or someone else :-)
<dholbach> huats: http://daniel.holba,ch/temp/motu-qa.log
<dholbach> it'd be nice if somebody could put this into some better place
<dholbach> maybe on the wiki somewhere
<huats> dholbach: ok thanks
<dholbach> de rien
<huats> dholbach: :-)
* dholbach needs to get his computer repaired, so see you later
<norsetto> dholbach: perhaps in the MOTU/School section
* dholbach -> lunch
<huats> dholbach: I have provided the debdiff to correct the rubber pb...
<dholbach> huats: great, will take look later
<huats> dholbach: of course... and "bon apptit"
<dholbach> merci
<sacater> es you can
<sacater> eep
<sacater> sorry wrong chan
#ubuntu-classroom 2007-09-29
<bebers> http://tubeimage.com/viewer.php?file=x7o3ydsiwmvc6pnvqyd3.jpg
<linuxwarrior> is there any classroom forseen soon ?
#ubuntu-classroom 2007-09-30
<brownie17> jrib, i'm here
<jrib> hi
<brownie17> jhi
<brownie17> sorry for making you wait. needed bathroom
<jrib> ok, first thing to understand is the basic syntax of convert
<brownie17> k
<darkchr0n0s> what are we learning today ?
<brownie17> darkchr0n0s, batch image conversion with imagemagick
<jrib> so, according to http://www.imagemagick.org/script/convert.php, it's  convert IN_FILE OUT_FILE
<jrib> convert doesn't change the image you give it, it saves the change as OUT_FILE and leaves IN_FILE alone
<brownie17> jrib, yes. i aslo tried the 'mogrify' option instead of convert, which i think just modifies the original files
<jrib> right
<jrib> which one do you want to use?
<jrib> mogrify will leave you with no backups
<brownie17> jrib, i'd prefer mogrify
<brownie17> jrib, i already made backups
<jrib> k
<jrib> so my command should work if you change "convert" to "mogrify"
<jrib> find /some/directory -iname '*.jpg' -exec convert -interlace none '{}' \;
<jrib> find /some/directory -iname '*.jpg' -exec mogrify -interlace none '{}' \;
<brownie17> okay ahh, i leave the  '{}' \;    exactly as it is?
<jrib> you can omit "/some/directory" if you are in the directory already that you want to start it
<jrib> s/it/in
<jrib> brownie17: yes, '{}' gets changed to the filename that find finds, and "\;" is just an escaped ";" to specify the end of the command that you want find to execute
<brownie17> jrib, k it's working
<jrib> great
<brownie17> wait
<brownie17> sorry i mean
<brownie17> it is currently doing the task, i don't know if it's functioning correctly
<brownie17> jrib, there's around 80 meg of 50-100 kb images each. so i expect it to take a considerable amount of time
<darkchr0n0s> brownie17 :  try on single image first?
<brownie17> darkchr0n0s, i made backups, so that's no worry. but i'd rather not CTRL+C out of this in case it ruins some of the images.
<brownie17> darkchr0n0s, in other words, too late! ;D
<brownie17> one or two of the jpgs have been reported as corrupt, but that's to be expected i think. i haven't verified all of these are already working fine
<brownie17> jrib, okay it's finished the process now, checking the files they all appear intact, how can i quickly check a single file to see if it is baseline or progressive?
<jrib> no idea
<brownie17> jrib, k thanks so much for your help
#ubuntu-classroom 2008-09-22
<jmota> hi all
<revenger98> hola
<revenger98> que tal
<revenger98> hello
#ubuntu-classroom 2009-09-24
<Garefield> hi everyone i need some help installing my cdma modem on ubuntu 9.04
<jussi01> Garefield: #ubuntu is for support :)
<Garefield> yea thanks
<Garefield> can u help me
<soren> Garefield: You don't understand.. You're in #ubuntu-classroom, not in #ubuntu. You should be asking this question in #ubuntu.
<Garefield> wvdial does not detects my cdma modem its a Huawei 2258 cdma phone with internet capabilities
<Garefield> sorry
<Garefield> how do i go to #ubuntu i am using opera browser for this irc chat
<soren> How did you get here?
<Garefield> there was a list of rooms and i clicked on classroom
<soren> Well, click on the one that is just #ubuntu.
<Garefield> yea i am there now
<Garefield> but none seems intrested
<Garefield> ok thanks bye
<dpm> hello everyone!
<ianto> Aloha
<dpm> hi ianto
<dpm> hi effie_jayx
<effie_jayx> hello
<dpm> so how are you guys doing? All set up for the UGJ events?
<ianto> Yeah Cymru is all set up
<effie_jayx> pretty much
<dpm> \o/
 * dpm just realises that the UGJ meeting is in 1h, but it's good to know that you're pretty much set up :)
<jcastro> alright, Global Jam Discussion in about 3 minutes
<jcastro> who's around
 * ianto stands up
<jcastro> woo hoo
<czajkowski> aloha
<jcastro> alright! Let's give it a minute or two for the stragglers
<jcastro> czajkowski: now would be a good time to make an announcement about Arthur's Day
<jcastro> ok, let's begin, who's here, I'm Jorge from ubuntu-us-mi.
<ianto> I'm Chris from ubuntu-cym
<czajkowski> jcastro: To arthur :D
<czajkowski> Guinness stor has over 250 people at it drinking!
<pleia2> I'm Lyz from Pennsylvania :)
<czajkowski> I stayed in to do NGO interviews!
<brobostigon> i am philip also from ubuntu-cym
<czajkowski> I'm laura from Ireland
<jcastro> ok so
<jcastro> by now most everyone should be in the final or near-final stages of their planning
<jcastro> anyone have any "OMG!"'s or anything out of the ordinary?
<czajkowski> our venue got pulled last saturday so now we're working on a plan B, may not be able to do all 3 days though
<czajkowski> but we're working on it
<jcastro> you were planning on meeting all three days? wow.
<jcastro> we;'re only doing a few hours on one day
<jcastro> I have something I'd like to run past the group
<jcastro> so, with the jam being around beta
<jcastro> and release parties coming shortly afterwards
<czajkowski> jcastro: just the sat and sunday
<jcastro> do you guys think that would dilute one or the other?
<jcastro> so for example "Let's not do a jam, let's do a release party instead" or the other way around?
<mhall119|work> jcastro: the Florida team has had to deal with that, since FLS is on the 24th as well
<jcastro> or do you think most locos wouldn't mind doing 2 events so close to each other?
<dariusH> No because the jam is a get together for the purpose of improving ubuntu, and the release party is more like a drink in a pub, nobody's going to miss that :P
<czajkowski> I dont think mind as such, just getting people to come to both can be a bot tricky thats' 2 weekends taken up.
<mhall119|work> the events aren't the issue, the travel is.  Making a 2 hour drive is fine once a month, but 2 weekends in a row and it can be costly
<czajkowski> can be a bit hard
<JanC> we've been too busy with fair booths to even think much about a release party yet this month...  :-/
<jcastro> well, I think that a loco getting together should like "count" for something
<brobostigon> agreed jcastro
<jcastro> so like, you might not have a release party but you did a booth at a linuxfest or soemthing
<ianto> I think that a Jam is more important for a LoCo than a release party.  Parties come and go and not all members are too fussed about new releases but at least in a Jam teams get to work together
<jcastro> ianto: yeah but in many ways the social bonds are just as important as the technology
<mhall119|work> release parties have always been a good way to get new users and future users into the group
<jcastro> right
<czajkowski> yup,
<jcastro> if we only got together to work on ubuntu people would go insane
<czajkowski> we've gotten more members from the party or people seeing us having cd burning and pub quiz then jamming
<mhall119|work> There's nothing wrong with doing both parties and jams, it's just the proximity that is making people have to choose between attending one or the other
<mhall119|work> if the UGJ was about a month earlier, it would be easier
<czajkowski> I'm with mhall119|work on this this. they are a tad close, but there's not much you can really do is there. perhaps spread them out by a month would help
<jcastro> czajkowski: haha a pub quiz is awesome
<jcastro> ok
<jcastro> I think it's useful to have the jam right after beta though for hw submissions
<jcastro> though I can see a benefit to both
<mhall119|work> next time, I wouldn't reschedule the UGJ now
<brobostigon> and ubuntu pub quiz, :) #ubuntu-trivia,
<jcastro> or we could uncouple the jam from the release more, but I don't know about that
<czajkowski> jcastro: aye, we had one question, name all the release names and what did sabdfl stand for
<mhall119|work> jcastro: just need enough room for people to recover
<czajkowski> shudda seen the answers
<jcastro> heh
<mhall119|work> I can imagine
<jcastro> ok, so, I think discussing the Jam date is a good UDS topic
<jcastro> I think overall this year we were way more prepared than last time
<jcastro> so I think that's a good sustainable thing
<czajkowski> yes
<jcastro> any other ideas or topics?
<jcastro> we seem to be running too smoothly to have any issues
<jcastro> either that or we're not getting enough teams to participate, heh
<czajkowski> jcastro: shhh don't jinx it
<czajkowski> jcastro: will the lp server stay up on the day :p
<ianto> Other than of course fixing Ubuntu, have other teams planned any additional stuff like competitions or key signing etc/
<jcastro> well, it's post lp-3.0 so cross your fingers
<jcastro> one group was looking at a marketing(!) jam
<brobostigon> an idea i though of, when we had out meeting about this in ubuntu-cym the other day, is a voip connection to jam, for those that cant attend.
<jcastro> well, once we iron out empathy voip we should be good
<brobostigon> :)
<jcastro> for next cycle though. :-/
<brobostigon> yes.
<jcastro> I am wondering if any group is going to live ustream or something
<brobostigon> jcastro: ubuntu-cym had that idea.
<czajkowski> would be deadly if folks could see other jams going on
<jcastro> indeed
<brobostigon> and fun,
<jcastro> we should Just Try It on that day
<jcastro> I bet if  one group does it everyone will just start doing it
<brobostigon> remote participation.
<jcastro> kind of like a viral video thing
<mhall119|work> jcastro: live streaming to multiple people over a free WiFi?
<ianto> jcastro: Is tehre gonna be an #ubuntu-jam chanel or siilar?
<jcastro> mhall119|work: well, depends on the venue of course
<ianto> *similar
<jcastro> ianto: I don't think so, last time we just hung out in -bugs, or whichever channel you were participating in
<jcastro> though I don't think it would hurt
<czajkowski> or even just -locoteams
<czajkowski> it's where everyone is
<jcastro> you know what, not another channel, let's get the good stuff in -locoteams
<jcastro> yeah!
<czajkowski> and would be nice to see more activity in there
<ianto> jcastro: Last time was focused on one section though but I think a general channel would be good
<czajkowski> it does lack at times
<jcastro> indeed
<jcastro> since this is loco oriented I think -locoteams is appropriate
<czajkowski> jono dented it one day and we got loads in , we really should encourage our teams to go in there
<jcastro> and the local channels too
<jcastro> indeed
<ianto> Alright fair enough then :)
 * jcastro edits the wiki page
<jcastro> any other ideas/business?
<czajkowski> after the GJ, dont just head off home, try and stay around afterwards close the laptop
<mhall119|work> having everyone participate in -locoteams will raise awareness of the channel
<czajkowski> and grab a drink or food and meet more of your loco
<jcastro> czajkowski: yeah
<czajkowski> it's not work we're doing so we should enjoy it
<ianto> Ooh an important thing, maps!
<ianto> I've taken pictures of the entire capital's high street on how to get to the library for people who aren't used to Cardiff
<czajkowski> you could have an osm party afterwards and help that group
<ianto> Perhaps others might need that too ^
<mhall119|work> osm?
<ianto> From Train Station and from High St
<ianto> Open Street Maps?
<mhall119|work> ah
<qwebirc11239> hello
<ianto> Hello there qwebirc11239
<qwebirc11239> i think i am in the right place I want to learn about building packages and helping the comm.
<ianto> AH, I think that unless there is a lesson planned for that you might want to go to #ubuntu-motu for help on packaging
<qwebirc11239> ah ok thank you
#ubuntu-classroom 2009-09-25
<shift_wreck> 'elo bluetux
<bluetux> shang, hello
<bluetux> sorry
<bluetux> shift_wreck, hello
<shift_wreck> you can call me shang if you want :)
<shift_wreck> whats up?
<bluetux> No, just join :-)
<shift_wreck> ah, welcome
<bluetux> Thanks you~~
<shift_wreck> yep
<suji> hi
<suji> what package need to download torrent file in Ubuntu?
<jussi01> suji: support is in #ubuntu
<suji> ok
#ubuntu-classroom 2009-09-27
<nessen> hi i need to optimize a netbook with 9.04 it seem to slow, from starup to the window manager, is this a right chanel.?
<jmarsden> nessen: Try asking in #ubuntu -- #ubuntu-classroom is usually only active when there is a specific class scheduled.
#ubuntu-classroom 2010-09-27
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: From mockup to bling - Instructors: MacSlow
<akgraner> Welcome to Ubuntu App Developer week! (Formally known as Ubuntu Opportunistic Developer Week).
<akgraner> Ubuntu App Developer Week is a week of sessions aimed at enabling and inspiring developers to write applications that scratch their itches. Our goal is to give all attendees a taste of the wide variety of tools on the Ubuntu platform that can be used to create awesome applications, and to showcase some applications that have been created and explain how they were put together.
<akgraner> to ask questions please ask in ubuntu-classroom-chat
<akgraner> and form the questions using QUESTION: in front of your questions
<akgraner> So lets start scratching some itches, sharing some tools, creating awesome applications and showcasing others.
<akgraner> Welcome - Mirco "MacSlow" MÃ¼ller who will be opening Ubuntu App Developer Week with a session on "From mockup to bling.
<akgraner> Micro if you are ready the floor is yours!
<MacSlow> ah ok... thanks akgraner
<MacSlow> So in this session I will talk about general principles, common practises, helpful workflows and tips/tricks to go "from mockup to bling"
<MacSlow> meaning pretty designer drawn images to working apps/code
<MacSlow> as akgraner said questions can come in anytime, right?
<MacSlow> As an example for "from mockup to bling" I'll use unity's quicklist
<MacSlow> I hope by everybody knows what unity is :)
<MacSlow> take a look at this image http://macslow.net/images/quicklist-mockup.png
<MacSlow> That's a mock of of the designers idea of what quicklists should look like
<MacSlow> but for the person meant to make that into working code it's not really the full story
<MacSlow> becasue it needs to be a bit more "systematic"
<MacSlow> to implement this one needs hard facts (numbers for radii, widths, lenghts, etc)
<MacSlow> which much easier flow into code
<MacSlow> what you need to create (or ask from the designers) is a more schematic drawing like this...
<MacSlow> http://macslow.net/images/quicklist-schematic.png
<MacSlow> That looks less shiny but is a lot simpler to put into code (what up with "em" I'll get to after this)
<MacSlow> in this drawing you see what's important and one can almost right away start codeing that as it easily maps to drawing-calls from e.g. cairo or QPainter
<MacSlow> With colors, gradients, patterns and opacity you need to deal in the same way.
<MacSlow> Everything clear up to know?
<MacSlow> So what's with EM stuff in the schematic you ask.
<MacSlow> That's the measurement for making all your UI-elements resolution-independent.
<MacSlow> Most of the time one gets only discrete pixel-values (by measureing that in gimp in the mockup-graphic)
<MacSlow> an implemented UI-element based on that will only work as the end-user will not have a dramatically different screen (with super high DPI) and/or a different font-size set
<MacSlow> UIs implemented in a resolution-independent fashion will automatically adapt to new conditions like those. If only based on hard-coded pixel-sizes it can break in a nasty (visual) way.
<MacSlow> So what is an EM now?
<MacSlow> It's the unity-size of the set system-font (height)
<MacSlow> usually 10 points
<MacSlow> I will bore you with the formular for this now... :)
<MacSlow> pixels_per_em = font_point_size * screen_dpi / 72.0f;
<MacSlow> Where all those are floats... but pixels_per_em should be rounded to int of course
<MacSlow> font_point_size and screen_dpi you can query via you toolkit api of choice (gtk+ and Qt have means for that)
<MacSlow> A good way to provide artwork for the real app and stay resolution-indepdented is to use SVGs.
<MacSlow> For static parts that perfectly ok. If animated elements are needed this will not fully fit the bill.
<MacSlow> Animated SVG, while spec'ed out, are still a dream for day-to-day use in UI-development
<MacSlow> Let's move to some common practises.
<MacSlow> I mentioned cairo and QPainter earlier.
<MacSlow> Those are currently the best choices on the Linux desktop of doing custom UI/widget development...
<MacSlow> to fill in the "rects"
<MacSlow> If you look at any application they are 2D and made up of rectangular regions.
<MacSlow> What you need to do is fill them with "meat"
<MacSlow> This meat is either an image, text, gradient, some sort of line-drawing
<MacSlow> for this nothing beats cairo (or QPainter)
<MacSlow> Some interesting things to do with you "rects" then before they land on the screen is to "post-process" them
<MacSlow> Of course depending what the initial design ask for.
<MacSlow> Commong are fade-out masks...
<MacSlow> http://macslow.net/clips/animated-text.ogv
<MacSlow> blurs, glows, drop-shadows
<MacSlow> that screencast example shows fade-out masks (see top and bottom of scrolling text), drop-shadows and glows (very subtle in the text)
<MacSlow> for those you'll need to deal with offscreen-rendering
<ClassBot> jledbetter_ asked: Which is better: Cairo or QPainter?
<MacSlow> Ok, let's continue
<MacSlow> so offscreen-rendering...
<MacSlow> This "draws" into an non-visible memory area where you can perform any kind of manipulation before finally blitting the end-result to the screen for the user to see.
<MacSlow> With the scrolling-text example from the last screencast, the text is drawn offscreen (with a transparent background) and then the upper and lower edges are earased using a gradient mask (about 10 pixels high) going from full to 0 opacity
<MacSlow> after that's done it is then put on screen with the visual result of the text dissolving at the top and bottom edge
<MacSlow> This approach is also used for doing the "glow" behind the text there. The glow is actually dark (almost) black to make the white text appear crisper.
<MacSlow> In that case the text is initially rendered offscreen as a mask...
<MacSlow> That mask is used to draw (offscreen again) the text in dark-grey...
<MacSlow> This is blurred to give it the "glow"...
<MacSlow> then the same text-mask is used to paint in white over it...
<MacSlow> only now the assembled result is them blit on screen
<MacSlow> Ok, so much for this short glimpse into the world of UI/bling hacking.
<MacSlow> Now is hte time to ask any sort of UI/graphics related questions you didn't see fitting before.
<MacSlow> AlanBell_ asked: does the bling slow things down? all that double rendering and blurring sounds like a lot of work
<MacSlow> Of course there is a burden for doing this.
<MacSlow> But with clever caching you can eliminate some of the CPU/GPU-load
<MacSlow> First of all if you on a CPU try to restrict the area to blur as much as you can... and cache the result, if you can/need to reuse it later.
<MacSlow> next thing is to be clever about the algorithm to blur
<MacSlow> it's easier on the CPU to do a box-blur than a full gaussian-blur
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Hello World in Python (and maybe a bit more) - Instructors: AlanBell
<AlanBell> Hello and welcome to this Application Developer week session on Python.
<AlanBell> This session is an introduction to Python from the very very beginning, I going to do my best to assume no prior knowledge at all.
<AlanBell> just so I can see who is here say hi in the #ubuntu-classroom-chat channel o/
<AlanBell> great, good to see you all
<AlanBell> Python is a programming language, but not a scary hard one.
<ClassBot> nitrat_gray asked: hello
<AlanBell> oh, clever nitrat_gray, and yes, that is a good demo of how to ask a question!
<AlanBell> Python is kind of like BASIC, except you don't have to be embarrassed about saying you are a Python programmer!
<AlanBell> OK, so lets get started.
<AlanBell> So we are going to write a computer program, which is a set of instructions to the computer to tell it to do some interesting stuff for us.
<AlanBell> Lets get set up first, we are going to need a text editor to write the instructions in and a terminal to tell the computer to do the instructions.
<AlanBell> You will find the text editor and the terminal next to each other in the Applications-Accessories menu
<AlanBell> go open both now and arrange the screen so you can see the IRC classroom and the editor and the terminal all at once
<AlanBell> are we sitting comfortably with three windows on screen?
<AlanBell> plain old text editor is perfect, none of your fancy IDEs for this session
<AlanBell> Traditionally the first program you should write in any language is one to get the computer to say hello to the world! so lets do that.
<AlanBell> in the text editor type the following:
<AlanBell> print "Hello, World!"
<AlanBell> that is it, your first program, now lets save it and run it (I did tell you it looked like BASIC)
<AlanBell> file-save as and call it hello.py
<AlanBell> this will save it into your home directory by default, fine for now, but you would probably want to be a bit more organised when doing something serious
<ClassBot> jledbetter_ asked: Does it have to be in a certain dir?
<AlanBell> no, not particularly
<AlanBell> ok, now in the terminal lets run the program
<AlanBell> python hello.py
<AlanBell> doesn't matter so much where you save the program, but always save your python programs with a name ending in .py
<AlanBell> It should respond by greeting the world in a friendly fashion
<AlanBell> so at the $ prompt in the terminal you just type "python hello.py"
<AlanBell> as we saved the hello.py in the home directory and the termial opens by default to the home directory it should just kinda work
<AlanBell> if you save it somewhere else you would use the cd command in the terminal to go to the right place
<AlanBell> ok, so that was running the program by running python then the name of our application, but we can do it a different way, by telling Ubuntu that our program is executable
<AlanBell> What we are going to do now is try to make our program directly executable, in the terminal we are going to CHange the MODe of the program to tell Ubuntu that it is eXecutable
<AlanBell> so at the $ prompt of the terminal type:
<AlanBell> chmod +x hello.py
<AlanBell> now we can try to run it
<AlanBell> again at the $ prompt
<AlanBell> ./hello.py
<AlanBell> oh noes!!!
<AlanBell> Warning: unknown mime-type for "Hello, World!" -- using "application/octet-stream"
<AlanBell> ubuntu doesn't know how to run this application yet, we need to add some extra magic at the top of our program to help it understand what to do with it.
<AlanBell> back in the editor, above the print "Hello, World!" add the following line
<AlanBell> #!/usr/bin/env python
<AlanBell> so the /usr/bin/env bit is some magic that helps it find stuff, and the thing it needs to run this application is python
<AlanBell> now you should be able to save that and flip back to the terminal and run your program
<AlanBell> ./hello.py
<AlanBell> ok, so the magic line at the top you don't need to worry about  too much, it just has to be there or you might end up seeing that error message
<ClassBot> AbhiJit asked: i remember that '#' is used to comment something. but here why we have commented? and if we commented then how ubuntu knows what to do?
<AlanBell> excellent question
<AlanBell> from the point of view of python that is indeed a comment that it ignores
<AlanBell> so when you run python hello.py it will ignore the first line, it doesn't care
<AlanBell> the #!something bit is read by bash (I think)
<AlanBell> it checks the first two bytes for #! then looks at the rest of the line for instructions on what to do with it
<AlanBell> quite a lot of different file types start with #!
<AlanBell> ok, everyone have a running program now?
<AlanBell> OK, lets go on to the next concept, giving our program some structure
<AlanBell> back to the editor, and between the two lines we have already add a new line
<AlanBell> while 2+2==4:
<AlanBell> and on the next line put four spaces before the print "Hello, World!"
<AlanBell> save that
<AlanBell> so the while statement starts a loop, in this instance it will carry on until 2+2 is equal to something other than 4
<AlanBell> the double equals means "is equal to" a single equals is used to assign a value to something (more on that later)
<AlanBell> the colon at the end is an important part of the while statement.
<AlanBell> There is no "until" "wend" "end while" type statement at the end, as you might expect to find in lesser languages :)
<AlanBell> the indentation of the print statement is not just cosmetic and for our benefit
<AlanBell> the indentation level is part of the language, when the indentation stops that is the end of the loop (or other structure that you might expect to have an end)
<AlanBell> this means that python always looks neat and tidy (or it doesn't work)
<AlanBell> Always use four spaces to indent, not three, not five and certainly not a tab.
<AlanBell> Other indentations will work, but if you ever have to work with anyone else you must always be using the same indentation, so we all get in the habit of using four spaces.
<AlanBell> Lets run our new program, just save it in the editor and run it again in the terminal with ./hello.py
<ClassBot> jledbetter_ asked: 4 always? So if nesting, 8 spaces?
<AlanBell> yes, 4 spaces per level of indentation
<AlanBell> so if you have a for loop inside a while loop the inner code would be 8 spaces deep
<ClassBot> skkeeper asked: not using a TAB is a matter guaranteeing the code works on multiple platforms right?
<AlanBell> no, not so much, tabs are portable. In fact I kinda wish the convention was tabs.
<AlanBell> the issue is portability amongst humans
<AlanBell> if you have two humans working on some code, one likes 4 spaces the other likes tabs you are going to get a ton of errors
<AlanBell> in gedit if you go to the preferences window, editor tab
<AlanBell> you can set the tab width to 4 and check the box Insert spaces instead of tabs
<AlanBell> ok, so you have the program running now?
<AlanBell> now we can wait for 2+2 to be something other than 4.
<AlanBell> or, if you are in a hurry, you can press ctrl+c
<AlanBell> ok, so ctrl+c is handy for breaking in to an out-of-control python program
<AlanBell> you can do other fun stuff with the print statement, if you change it to read:
<AlanBell>     print "Ubuntu totally rocks!   ",
<AlanBell> and run it again (note the comma at the end)
<AlanBell> you will see it doesn't do a newline and fills your terminal with stuff
<AlanBell> ctrl+c again to break out of it
<AlanBell> OK, that was fun wasn't it!
<AlanBell> lets do something different now
<AlanBell> in the terminal, type python at the $ prompt and hit return
<AlanBell> you should have a >>> prompt and a cursor
<AlanBell> this is the interactive python console
<AlanBell> you can type print "hello" here if you want
<AlanBell> or do some maths like:
<AlanBell> print 2**1000
<AlanBell> which will show you the result of 2 multiplied by itself a thousand times
<AlanBell> python is kinda good at maths
<AlanBell> you could even try "print 2**100000" it won't take long, and you can always stop it with ctrl+c
<ClassBot> AbhiJit asked: what does ** means in 2**1000?
<AlanBell> 2 to the power of 1000
<AlanBell> or 2*2*2*2 . . . .
<AlanBell> as mhall119 points out, in the console you don't really need the print statement (but I like it)
<AlanBell> while we are on the subject of maths, lets get the value of pi
<AlanBell> print pi won't do anything useful (but feel free to try it)
<AlanBell> we need more maths ability than the python language has built in
<AlanBell> so we need to get a library of specialist maths stuff, so type
<AlanBell> import math
<AlanBell> it will look like it did nothing, but don't worry
<AlanBell> print math.pi
<AlanBell> that should return 3.14159265359
<AlanBell> So we have seen here how to import a library of functions to do something, and called one of the functions from the library
<ClassBot> resno asked: How do you know where packages are and which to import?
<AlanBell> there are stacks of python packages in Ubuntu, have a look in synaptic at everything starting "python-" as to what is in them, just getting to that . . .
<AlanBell> ok, so what is in the math package, apart from pi?
<AlanBell> try typing dir(math) at the python console
<AlanBell> ['__doc__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'hypot', 'isinf', 'isnan', 'ldexp', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']
<AlanBell> you can also look at http://docs.python.org/library/math.html
<ClassBot> skkeeper asked: How can I ask for a more precise value of pi?
<AlanBell> skkeeper: I have no idea! I am sure there is a library for that
<AlanBell> dir() is a good way to find out what something can do for you
<AlanBell> there is also a help() command which is useful
<AlanBell> All this command line stuff is all very well, but we want to do applications that have pretty windows and stuff!
<AlanBell> In the interactive console type or paste the following
<AlanBell> import gtk
<AlanBell> which will load a library full of stuff to do with the gtk toolkit that powers the gnome desktop
<AlanBell> foo=gtk.Window(gtk.WINDOW_TOPLEVEL)
<AlanBell> that assigns a window object to a variable called foo
<AlanBell> (the name doesn't matter, the single equals does)
<AlanBell> but nothing  much seems to have happened yet, so type:
<AlanBell> foo.show()
<AlanBell> yay, a real live little window should be on screen now!
<AlanBell> lets see what we can do to it with dir(foo)
<AlanBell> quite a lot! lets try:
<AlanBell> foo.set_title("my little window")
<AlanBell> I think you have to click on your window for the title to update
<AlanBell> go ahead and change the title a few times
<ClassBot> nitrat_gray asked: are all the class references case-sensitive?
<ClassBot> bas89 asked: is it with Qt as easy as with gtk?
<AlanBell> there is a certain amount of case sensitivity, but there are conventions on how to use case
<AlanBell> http://www.python.org/dev/peps/pep-0008/
<AlanBell> the style guide has more detail on case conventions
<AlanBell> yes, I believe QT is just as easy as GTK
<AlanBell> when developing applications you would generally use an IDE and a user interface builder like Glade, what I want to show today is the relationship between command line code and windowing code and the lack of special magic required!
<ClassBot> resno asked: What is the best source to learn more python? python.net?
<AlanBell> there are a number of books that are good
<AlanBell> I like Snake Wrangling for kids
<AlanBell> also there is a book in the repos called dive into python
<AlanBell> as to the snake questions, python is indeed a snake, but it was named after the Monty Python comedy series
<AlanBell> I should really have used spam as my window variable name rather than foo
<AlanBell> oh yeah, the oreilly learning python book with a rat on the cover is on my desk
<AlanBell> ok, so now lets recap on what we have covered
<AlanBell> #!/usr/bin/env python goes at the top of your file
<AlanBell> loops don't have end statements, the indentation is part of the syntax and makes end statements redundant
<AlanBell> indentation is 4 spaces
<AlanBell> not 3, not 5
<AlanBell> not tabs
<AlanBell> 4
<AlanBell> libraries are collections of useful stuff, loaded with the import statement
<AlanBell> Python is easy and fun!
<AlanBell> oh yeah, and as mentioned in the -chat to get out of the interactive python console do ctrl+d or exit()
<AlanBell> or quit()
<AlanBell> great, 5 minutes or so for questions, and keep them easy because I am not that good a programmer :)
<AlanBell> recommended IDE, well I like gedit, it does python syntax highlighting which is awesome (does it automatically on files ending in .py)
<AlanBell> there is also SPE which used to be my favorite
<AlanBell> stani's python editor
<AlanBell> and stani is the person who designed an awesome bit of dutch currency
<AlanBell> !info spe
<AlanBell> oh, no bot to do that :(
<ClassBot> AbhiJit asked: is for(i=0;i<=10;i++): is right?
<ClassBot> lmh74 asked: best IDE for python in my opinion is Geany with the VTE, very light weight but effective
<ClassBot> AbhiJit asked: i actually wanted for,while,do while syntax. please?
<ClassBot> bas89 asked: What software is good for designing GUIs?
<AlanBell> AbhiJit: nope, not quite
<AlanBell> try this
<AlanBell> for i in range(10):
<AlanBell> the for statement itterates over arrays and collections, range makes an array of the numbers 0 to 10
<AlanBell> geany sounds good
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Contributing without the Command Line - Instructors: doctormo - Slides: http://divajutta.com/doctormo/foo/slides/
<AlanBell> oh I am done!
<ClassBot> Slides for Contributing without the Command Line: http://divajutta.com/doctormo/foo/slides/
<Pendulum> thanks AlanBell!
<Pendulum> Next up is doctormo with Contributing without the Command Line
<doctormo> Hello everyone
<doctormo> Once you have something to contribute to a project, or a project of your own to get busy with. You need to be able to store your files and share them with outs.
<doctormo> others*
<doctormo> Traditionally in programming this is done with a repository system. This is a system which logs your files and the changes you make to them.
<doctormo> The system used in Ubuntu is bazaar (bzr) but it's quite possible to do development with git or mecural. there does exist other repositories cvs and svn but use is discouraged now that we have good distributed repositories.
<doctormo> The problem with all of these systems for storing files
<doctormo> Is that they all use the command line
<doctormo> And many programmers like the command line
<doctormo> With is fine
<doctormo> Which is fine*
<doctormo> But there are plenty of contributions, developing an application which are not programming and could quite reasonably be done by someone who has never used the command line.
<doctormo> which is why I'll be talking about how you can contribute to a project and use these repositories without ever touching the command line.
<doctormo> http://divajutta.com/doctormo/foo/slides/slide-00.png
<doctormo> OK so first, show of hands who's listening in on chat?
<doctormo> OK so for this exercise we have some requirements
<doctormo> http://divajutta.com/doctormo/foo/slides/slide-01.png
<doctormo> You'll need Ubuntu or Design with gnome and we'll be using you launchpad account.
<doctormo> OK so the first thing to do is to install groundcontrol, you can install this package via the command line or via the Software Center.
<doctormo> Ground control was designed to let users interact with launchpad and bazaar in a way that made it fun and easy to code, design and do other things.
<doctormo> http://divajutta.com/doctormo/foo/slides/slide-02.png
<doctormo> If you've got groundcontrol installed, then let's begin
<doctormo> http://divajutta.com/doctormo/foo/slides/slide-03.png
<doctormo> Go to System > Preferences > Ground Control Configuration
<doctormo> In here you will press the button to log onto your language account, enter your email address and password and wait for launchpad to give your keys.
<doctormo> Now for those who have not done development on launchpad before, you will be asked to create some ssh keys. These are keys that allow you to securely interact with launchpad bzr branches.
<doctormo> Once complete, you should have a fully set up development environment. Congratulations!
<doctormo> Now all you have to do is go to Places > Home Folder. You will get a nautilus window and in there you should have a new Projects folder
<doctormo> this folder will be used to hold projects downloaded from launchpad (you can rename it and move it anywhere you like)
<doctormo> Once inside the Projects folder you will find a bar on the top, in that bar will be two buttons.
<doctormo> Something like this: http://doctormo.ubuntu-ma.us/wp-content/uploads/2010/01/screenshot1.png
<doctormo> The Get Project button will pop up a window to search for a launchpad project. We're going to do a search for groundcontrol it's self.
<doctormo> Fetch Project*
<doctormo> If you don't see that bar then it's because nautilus needs to restart, you could do this with a computer restart, but we'll just do this: Alt+F2 and type in nautilus --quit
<doctormo> It'll automatically reload.
<doctormo> Normally the groundcontrol packagaing restarts nautilus for you, but restarting nautilus is a known hazard.
<doctormo> OK so I'll let those people catch up http://divajutta.com/doctormo/foo/slides/Screenshot.png
<doctormo> Now once you've pressed ok on the project search/select window, ground control will download the project from launchpad and make a new groundcontrol folder.
<doctormo> Navigating into that directory will give you a new set of buttons, one of which is "Fetch Branch"
<doctormo> Click on that
<doctormo> When it loads, click on the Trunk branch, give it a name or put your name in the "local branch name:" field.
<doctormo> When you press ok it's download the branch
<doctormo> http://divajutta.com/doctormo/foo/slides/Screenshot-1.png
<doctormo> you will have  new folder
<doctormo> What will will do is go into this folder and edit the README file
<doctormo> this is a very important point about ground control and the "Desktop as your IDE" theme.
<doctormo> GC and projects like her do not reinvent the IDE wheel by trying to manage your code, or giving you editors. There are far too many types of files to make an IDE with all kinds of editors possible.
<doctormo> So use what you like to edit the files you want to.
<doctormo> when you save the file, you should notice that the buttons in this bar have changed to "Commit Files"
<doctormo> Commit Changes*
<doctormo> I just discovered there is an error here, but it's new and never been seen before. So it'll have to be reported after this session ends.
<doctormo> You should still have downloaded a branch however.
<doctormo> If you see a "Read Only Branch" message, this is because the error causes the configuration to be wrong, it never sets a push location so you can't commit code.
<doctormo> So you can show hidden files, go into a directory called .bzr then into brach and edit a file called branch.conf
<doctormo> In here there should have been set the push_location = bzr+ssh://bazaar.launchpad.net/~[username]/groundcontrol/[your-banch-name]/
<doctormo> If you do manage to set that and tell natulus to browse the branch directory again, you should have a commit button instead of a read only warning.
<doctormo> Pressing the commit button will allow you to specify what you changed: http://divajutta.com/doctormo/foo/slides/Screenshot-2.png
<doctormo> Once that's done we'll need to upload, it's a simple matter of pressing the Upload Branch button that appears.
<doctormo> OK I tried this with another project and it worked fine... something about ground control's lp project perhaps. If you are having dificulty then please download the ubuntu-learning-materials project using the method above.
<doctormo> And download the website branch and modify that and continue on from there...
<doctormo> Once you've uploaded your changes you'll be presented with a Request Merge button, this part is not in bzr.
<doctormo> http://divajutta.com/doctormo/foo/slides/Screenshot-3.png
<doctormo> This will let the project owners know that you've completed some work and you'd like it to be reviewed and merged in.
<doctormo> Congratulations, if you've managed to dodge the trip wires in this session, you'll have contributed to ubuntu and it's projects.
<doctormo> There is more functionality to groundcontrol that allows project maintainers to merge-in, and you can specify bugs and so on when doing commits. play with it.
<doctormo> Now I will answer some questions.
<doctormo> Question: Can I erase the groundcontrol folder whit nautilus? or I have to use another method?
<doctormo> I don't understand this question
<doctormo> QUESTION: can name contain spaces? do they need to be escaped or quoted or can they just be typed normally?
<doctormo> Branch names should probably not contain spaces.
<doctormo> QUESTION: So once I download a project and modify its source (lets say fix a big, implement a feature, etc), all I have to do is commit it for review? The file I modified will be uploaded for review?
<doctormo> Yes, you've made a branch of the original code and the project owners can see the changes you've made.
<doctormo> Question: Is there a way to views diffs from within nautilus (right-click/diffs with previous version...)?
<doctormo> Use the commit window, clicking on any file will show you a diff
<doctormo> QUESTION: What does GC do when it say "Loading Launchpad"? Why does it take so long and why is there a need for GC to do that just to search for a project on launchpad?
<doctormo> It's getting a brand new OAuth token each time, it takes time and isn't very good.
<doctormo> MAfifi asked: How's that different from the explorer plugin in bzr for example?
<doctormo> the bzr explorer and gtk-bazaar plugins are designed around the idea of providing ALL of bazaar functionality into nautilus with very little workflow design. It's the command line for your browser.
<doctormo> GC on the otherhand is more a tool for the launchpad/bazaar development workflow rather than just being a bzr tool.
<doctormo> It has all the social rules built in and best practices.
<ClassBot> MAfifi asked: How's that different from the explorer plugin in bzr for example?
<ClassBot> MAfifi asked: Does it work with nautilus only? Can it work with dolphin in KDE as well?
<doctormo> the version in lucid and maverick only work in gnome/nautilus. There is no reason it couldn't work in kde/dolphin. Just needs a developer to do the work.
<ClassBot> CajunTechie asked: Can I create a new project using GC? I notice that was scheduled for inclusion but don't see it anywhere
<doctormo> The current version in lucid can not create projects.
<ClassBot> sinisterstuf asked: Can I delete my local branch just by selecting the folder in nautilus and moving it to the deleted items folder?
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Writing a dataprovider for Zeitgeist - Instructors: thekorn
<thekorn> Okidoki, I guess it's my turn now....
<thekorn> Hi, everybody, my name is Markus Korn, I'm one of the Maintainers of zeitgeist, and I would like to talk to you about ways to get your apps data into zeitgeist
<thekorn> so, first of all, What's zeitgeist?
<thekorn> zeitgeist started as one result of the 2008 Boston user experience hackfest
<thekorn> it started with a full featured UI, which was call gnome-journal
<thekorn> and it's basic idea ist to track 'events' on your desktop
<thekorn> so, first of all, what's an event
<thekorn> .
<thekorn> An event is something you do on your computer,
<thekorn> like opening files, visting web pages, swithing the focus of your application, and so on
<thekorn> GNOME (and I'm sure other systems like KDE have one too) has something called "recently used documents"
<thekorn> you can see them in the places menu
<thekorn> but zeitgeist is more than that
<thekorn> it tries to provide a unified way for ALL your events
<thekorn> so yo don't have the history of all your browsers, the history of played songs, etc.
<thekorn> .
<thekorn> And zeitgeist needs the applications to feed their events into the zeitgeist system,
<thekorn> and that's what this talk is baout
<thekorn> any question so far?
<thekorn> or can we start with some coding ;)
<thekorn> augdawg> what webrowsers use zeitgeist?
<thekorn> right now we support firefox, chromium, epiphany, and support for opera is in developemnt
<thekorn> .
<thekorn> so that's the plan for this Session: we all know this beautiful app called software-center
<thekorn> and how cool would it be if we can track the applications you visit in the app by zeitgeist
<thekorn> so whenever you open an app page there, track a zeitgeist event
<thekorn> .
<thekorn> to follow this example, you have to option,
<thekorn> +s
<thekorn> 1.) try to follow the steps I do here on this channel locally,
<thekorn> or
<thekorn> 2.) just read, and I will try to paste as much code as possible on the internet, I'll give you links
<thekorn> .
<thekorn> first of all, we need some software installed, so please run
<thekorn> sudo apt-get install intltool raptor-utils python-sphinx bzr
<thekorn> .
<thekorn> btw, please tell me when I'm too fast/slow
<thekorn> .
<ClassBot> augdawg asked: what language will we be using?
<thekorn> in this example we will use python,
<thekorn> but as you find out soon, you talk to zeitgeist using dbus,
<thekorn> so you can basically try to reproduce the examples in any language which has dbus support
<thekorn> .
<thekorn> just a small note to the users using unity, or which have zeitgeist already installed and running on their system,
<thekorn> you might want to backup your activity log, so just incase we insert some garbage, you can restore your old database after this session,
<thekorn> to do so please run
<thekorn> cp ~/.local/share/zeitgeist/activity.sqlite ~/Desktop
<thekorn> .
<thekorn> I think everybody should now have the app installed, let's get started
<thekorn> cd ~
<thekorn> (so we are all in the same dir, please use any other dir if you like)
<thekorn> now we get the zeitgeist source
<thekorn> wget http://edge.launchpad.net/zeitgeist/0.5/0.5.2/+download/zeitgeist-0.5.2.tar.gz
<thekorn> tar xzf zeitgeist-0.5.2.tar.gz
<thekorn> cd zeitgeist-0.5.2
<thekorn> ...and unpack it
<thekorn> ...and now we just build zeitgeist
<thekorn> ./configure
<thekorn> make
<thekorn> this might take a while
<thekorn> ok, next step is to run zeitgeist
<thekorn> upps, I'm too fast :(
<thekorn> loet's have some questions first
<ClassBot> sinisterstuf asked: What is dbus?
<thekorn> dbus is a way for applications to communicate to each other using a socket
<thekorn> QUESTION : so zeitgeist is written in python?
<thekorn> yes it is
<thekorn> to run zeitgeist, we need a clean environment
<thekorn> mkdir /tmp/zeitgeist-data
<thekorn> export ZEITGEIST_DATA_PATH=/tmp/zeitgeist-data
<thekorn> this tells zeitgeist where to write the data
<thekorn> and now we can run the daemon
<thekorn> ./zeitgeist-daemon --no-datahub --replace
<thekorn> --replace should kill any running zeitgeist instances
<thekorn> so far so good, we now have a running zeitgeist instace, which we can feed data into
<thekorn> let's open a new terminal, and start writing a plugin to software-center which does the job
<thekorn> .
<thekorn> .
<thekorn> ok, let's say the deamon is running, open a new terminal, and run
<thekorn> export PYTHONPATH=~/zeitgeist-0.5.2
<thekorn> this will tell software-center where to find the zeitgeist modul
<thekorn> and now we can start writing the software-center plugin....
<thekorn> let's get a first version
<thekorn> bzr cat -r 1 http://bazaar.launchpad.net/~thekorn/+junk/softwarecenter-zeitgeist-plugin/softwarecenter-zeitgeist-plugin.py > ~/zeitgeist-plugin.py
<thekorn> (or for the people who just want to see the code  http://bazaar.launchpad.net/~thekorn/%2Bjunk/softwarecenter-zeitgeist-plugin/annotate/1/softwarecenter-zeitgeist-plugin.py)
<thekorn> this is a *very* minimal plugin for software-center
<thekorn> .
<thekorn> unfortunatly s-c has no other way to load the plugin then loading it from some system dir
<thekorn> so, let's symlink this file to the right place
<thekorn> sudo mkdir -p /usr/share/software-center/plugins
<thekorn> cd /usr/share/software-center/plugins
<thekorn> sudo ln -s ~/zeitgeist-plugin.py .
<thekorn> cd ~
<thekorn> .
<thekorn> has everybody done this successfully?
<thekorn> .
<thekorn> if you now run  software-center --debug   from the terminal you should see the loading message somewhere
<thekorn> .
<thekorn> but anyway, this plugin does nothing so far
<thekorn> let's pimp it
<thekorn> bzr cat -r 2 http://bazaar.launchpad.net/~thekorn/+junk/softwarecenter-zeitgeist-plugin/softwarecenter-zeitgeist-plugin.py > ~/zeitgeist-plugin.py
<thekorn> or
<thekorn> http://bazaar.launchpad.net/~thekorn/%2Bjunk/softwarecenter-zeitgeist-plugin/annotate/2/softwarecenter-zeitgeist-plugin.py
<thekorn> for the reader out there ;)
<thekorn> this code does two things
<thekorn> 1.) it creates a connection to the zeitgeist daemon,
<thekorn> by running   ZeitgeistClient()
<thekorn> 2.) it connects to the signal of software-center which indicates a user switching the view
<thekorn> now run   software-center  --debug   again,   and you should see some logging when you swith between applications
<thekorn> by switching I mean  "clicking the "read more" button
<thekorn> .
<thekorn> is it working so far for everybody?
<thekorn> great
<ClassBot> aseem24 asked: it's working but i get this on my terminal..DEBUG:root:run_thumb_missing_js
<thekorn> this just sounds like a debugging message from s-c, nothing to care about
<thekorn> let's just ignore it for now
<ClassBot> iamlouis asked: when I change view should I see anything in the zeitgeist terminal output? Using rev 2 of the plugin
<thekorn> nothing yet, we come to it NOW!
<thekorn> bzr cat -r 3 http://bazaar.launchpad.net/~thekorn/+junk/softwarecenter-zeitgeist-plugin/softwarecenter-zeitgeist-plugin.py > ~/zeitgeist-plugin.py
<thekorn> (or, again: http://bazaar.launchpad.net/~thekorn/%2Bjunk/softwarecenter-zeitgeist-plugin/annotate/3/softwarecenter-zeitgeist-plugin.py)
<thekorn> now, this change actually tells s-c which event to insert into zeitgeist
<thekorn> I'll paste it here, because it's important ;)
<thekorn> event = Event.new_for_values(
<thekorn>             interpretation=Interpretation.ACCESS_EVENT,
<thekorn>             manifestation=Manifestation.USER_ACTIVITY,
<thekorn>             actor="application://software-center.desktop",
<thekorn>             subject_uri="application://%s" %app.pkgname,
<thekorn>             subject_interpretation=Interpretation.SOFTWARE,
<thekorn>             subject_manifestation=Manifestation.SOFTWARE_ITEM,
<thekorn>         )
<thekorn> as you can see, Events do have a certain structure
<fagan> thekorn is after losing connection so he cant type in here :/
 * thekorn checks the mic...
<thekorn> let's continue with the structure of Events
<thekorn> event = Event.new_for_values(
<thekorn>             interpretation=Interpretation.ACCESS_EVENT,
<thekorn>             manifestation=Manifestation.USER_ACTIVITY,
<thekorn>             actor="application://software-center.desktop",
<thekorn>             subject_uri="application://%s" %app.pkgname,
<thekorn>             subject_interpretation=Interpretation.SOFTWARE,
<thekorn>             subject_manifestation=Manifestation.SOFTWARE_ITEM,
<thekorn>         )
<thekorn> events have na interpretation,
<thekorn> which means: what is the event about
<thekorn> a manifestation, which is: who does something
<thekorn> and it has an actor
<thekorn> which is, who does something
<thekorn> so in this case, the s-c app visits an application page on behalf of the user
<ClassBot> testtest asked: ?:Thoughts on privacy, user opt-out?
<thekorn> yes, we have ways to blacklist certain events
<thekorn> and there are already UIs implementing this
<thekorn> it is call Backlist in our terms
<thekorn> okidoki, I've only four minutes left
<thekorn> and I'm a bit running out of time
<thekorn> the last revision (revno 3) is basically a working dataprovider for s-c
<thekorn> so whenever you start s-c now, and visit an application's page
<thekorn> an event should be inserted into zeitgeist
<thekorn> one of our devs Seif Lotfy will talk about ways to get this data back later this week
<thekorn> .
<thekorn> I would like to end this session with some ressource:
<thekorn> first of all, if you are interressted in this project, or have any questions, please join us in the #zeitgeist channel
<thekorn> or visit our webpage at   www.zeitgeist-project.com
<thekorn> or our launchpad page at launchpad.net/zeitgeist
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Making Programs with Quickly in Vala - Instructors: fagan
<thekorn> we also have bindings for other languages like C, C#, vala, java, etc.
 * fagan loves vala
<fagan> thanks thekorn :)
<fagan> Ok hi everyone
<fagan> and im going to talk about the infamous quickly
<fagan> So to start this is a preview release of the Quickly Vala template.
<fagan> Its not in the repo yet and is very very new. It has a good lot of things working so far but not packaging or building.
<fagan> Also translations are not working yet properly because it relies on the build systems for Vala.
<fagan> Its still a good start and is usable at the moment for little projects that you want to do.
<fagan> Oh and if you have questions ill be looking at the chat so ill get to them as soon as i can.
<fagan> So lets get this started then
<fagan> first we need to prepare a little to run this template you need quickly and Valac installed so if you don't have them run this command please:
<fagan> sudo apt-get install quickly valac
<ClassBot> augdawg asked: when it hits the repos, i assume it wil do this automatically right?
<fagan> Well I didnt want it in the maverick repos
<fagan> Im waiting for the build issues and other stuff to be fixed first
<fagan> Now lets start get the template
<fagan> so open up the terminal and type:
<fagan> mkdir quickly-templates;cd quickly-templates;bzr branch lp:~shanepatrickfagan/quickly/Quickly-vala
<fagan> (in the root directory of your home)
<fagan> Now you should have everything you need
<fagan> Is everyone good?
<fagan> Ok ill slow down a bit :)
<fagan> ok so moving on
<fagan> lets get making programs then
<fagan> ok get out of the quickly templates directory: cd ..
<fagan> run this command in terminal to get your project created:
<fagan> quickly create Quickly-vala <project name>
<fagan> Good?
<fagan> Now our project is set up and the directory is created.
<fagan> So now go into your project directory
<fagan> cd <project name>
<fagan> So are you all there?
<fagan> So in this directory you will see a /bin /data and two text files so its very similar to the other quickly projects that you may have used before.
<fagan> you can now run the project with
<fagan> quickly run
<fagan> just like the python templates
<fagan> This command does a few things it compiles the .vala file and runs it.
<fagan> so it needs to do a few things to get the .vala file up and running but its in the background so its all good
<fagan> Ill get into the problems with doing this in a little while but first ill get you developing.
<fagan> Oki doke so moving on
<fagan> anymore questions?
<fagan> ok so
<fagan> So do get editing your code use:
<fagan> quickly edit
<fagan> Just like the python template :)
<fagan> At the moment I only have 1 .vala project file I plan on adding the about box very soon too.
<ClassBot> augdawg asked: can you use glade to desgin a gui?
<fagan> yep
<fagan> So in gedit you should see the base of a class. So to start developing all you need to do is scroll down to the bottom of the page and look for the line that says "write your code here".
<ClassBot> beardygnome asked: i'm running xubuntu - do i need to install gedit?
<fagan> sorry about that
<fagan> its a bug
<fagan> Ill be fixing it later in the week
<ClassBot> beardygnome asked: or can i use geany?
<fagan> Yep you can
<fagan> you just have to double click on the .vala files to edit it
<fagan> but still thats a bug
<fagan> my bad
<fagan> the warning you can ignore
<fagan> its a problem with glade and vala not being entirely in sync
<fagan> So in gedit you should see the base of a class. So to start developing all you need to do is scroll down to the bottom of the page and look for the line that says "write your code here".
<fagan> so its fairly easy to use
<fagan> and hopefully there is enough comments to guide you guys
<fagan> Oh and on that I tried to use xdg-open instead of just using gedit *.vala but it wasnt working right so I left it.
<fagan> thats the way I was originally going to do it
<fagan> it doesnt handle multiple files
<fagan> so thats why I dropped it
<fagan> anyway all the other stuff on the page is gtk and glade stuff
<fagan> so you can ignore all of that
<fagan> just write your code below the comment saying write your code here
<fagan> Here is the link to the Vala docs to get started and developing with code examples:
<ClassBot> augdawg asked: what is this written in?
<fagan> Well thats a good question actually
<fagan> the template is written in sh scripts really
<fagan> and the template is for vala so its vala there
<fagan> and the create command is pulled from quickly itself so its in python
<fagan> and the ui is glade
<fagan> ok so
<fagan> moving on
<fagan> Here is the link to the Vala docs to get started and developing with code examples:
<fagan> http://live.gnome.org/Vala/Documentation
<fagan> They have most of the code that you will be looking for already there. So just have a poke about and they will give you tutorials on everything
<fagan> for beginners to more advanced stuff
<fagan> So I should say how to do the glade thing and can you guess what the command is?
<fagan> quickly design
<fagan> just like the python quickly projects
<fagan> :)
<fagan> Oh I should say how to add your listeners to the code for glade events
<fagan> If you want to create listeners for the widgets you add you just have to use code similar to how I wrote the quit menu item handler in the template itself. Like this:
<fagan> [CCode (cname = "G_MODULE_EXPORT name_of_event")]
<fagan> public void name_of_event () {
<fagan> // code here
<fagan> }
<fagan> You put the name of your event in there instead for both bits.
<fagan> (the name in glade itself)
<fagan> oh and the CCode bit is just so it will work on windows too but I like leaving it in anyway even though I wont be porting anything to windows.
<fagan> so is everyone still with me?
 * fagan moves very fast
<fagan> ok I broke quickly design yesterday
<fagan> its just the wrong directoy
<fagan> ill fix it after this
<fagan> my bad
<fagan> or data
<fagan> sorry
<fagan> damn
<fagan> anyhow ill move on
<fagan> :P
<fagan> So we now have you guys editing your projects so what if you add extra classes to the project or you start using an external binding other than gtk+ or glib?
<fagan> thats the problem with vala
<fagan> You will have to add the binding to the run method with this command:
<fagan> quickly edit_run
<fagan> and then you will get your editor and have to add the --pkg to compile it properly
<fagan> so if you have used Vala before you would know what to add but if you don't its just:
<fagan> --pkg <binding>
<fagan> and I have the code commented so you guys should find it fairly easily
<fagan> Sorry about this problem but we are going to work on this for 11.04 and was the main reason we haven't released it yet.
<fagan> its a challenge for me to fix :)
<fagan> ok so thats most of the work so far
<fagan> is anyone having problems with anything other the quickly design command
<fagan> ?
<fagan> or do you guys have any questions?
<ClassBot> testtest asked: how many terminals should I have open for this
<fagan> Well only 1 is needed
<fagan> you can type them in a line
<ClassBot> beardygnome asked: what should quickly edit_run have done?  it just ran the app when i tried it.
<fagan> huh
<fagan> oh now I get why it did that
<fagan> its not picking it up as a text file
<fagan> fail
<fagan> :)
<fagan> just gedit .run
<fagan> and it will do it
<fagan> I used xdg-open and it didnt open the text file :/
<fagan> anyhow if there are no more questions ill get into what my plans are
<fagan> any takers?
<fagan> good good
<fagan> Ok so my plans are for 11.04 and beyond.
<fagan> Well like quickly itself I really want to make things easy. I want everything to be automated and done for the user without much input.
<fagan> So my plan for the end is to have 1 config file for the users to edit and all that needs to be inputted is authors info like email and name, category (for the menu entry), URL, description and long description.
<fagan> so that packaging and building is as easy as possable
<fagan> So all of that is in the python template now but you have to edit the authors file, desktop.in and the setup.py file. The way im thinking is to do it in 1 file and make it more invisible how the magic is done.
<fagan> so the python template is a little bit hard if you didnt see any tutorials on how to do it
<fagan> My idea is to have that all in one text file. How its displayed is up for discussion and ill talk about that at the UDS probably. (ill be participating remotely).
<fagan> I also plan on having packaging and building done properly for 11.04 which is going to take most of the cycle and involves a lot of things.
<fagan> 1. Detecting depends so the user doesn't have to do the --pkg thing or have to use makefiles and all of that crap.
<fagan> (this is a big problem with vala in terms of new developers)
<fagan> 2. a great build system (this is going to be done with buildj hopefully) and a standard project directory layout so we just have to scan the dirs for files to detect what to add to the build.
<fagan> 3. packaging stuff but since this really relies on 1 and 2 its going to be done last. Plus im not a motu or do any packaging in general so the tools are quite new for me so it will take a little bit of fiddling. (if anyone wants to help with this ill buy you a drink sometime for your trouble)
<fagan> thats a lot of hard work for 1 cycle :)
<fagan> ohter than that and some other boring stuff ill just be updating the template a little
<fagan> to make it a little bit more like the python template
<fagan> which is awesome
<fagan> and I might give desktopcouch a try in vala
<fagan> if the binding is there
<fagan> ok any more questions?
<fagan> I have just a little bit more
<fagan> ok so no questions?
<fagan> moving on then
<fagan> oooh
<fagan> someone has one
<fagan> beardygnome > can we use pdb for debugging (i see there's a session on this later this week)
<fagan> well debugging is built into the valac compiler
<fagan> and it does give out some awesome info
<fagan> so there is no reason to use phb
<fagan> anyhow
<fagan> so im starting to run out of things to talk about so ill just go into the "why use Vala over python?" question
<fagan> Well the simplest answer is that Vala is a lot lot faster than python and its very well integrated into the gnome platform.
<fagan> The other answer is that its the perfect language to got to if you started programming in Java or C# (if you don't want to use mono) oh and did I say its faster than both of those languages too.
<ClassBot> beardygnome asked: i have one
<fagan> lol
<fagan> Didnt mean to paste that one :/
<fagan> QUESTION : there is no intermediate language in vala right ?
<fagan> I dont have a clue what the question is :)
<fagan> If anyone is wondering how its faster its because Vala is more or less a big wrapper over C.
<fagan> Valac the Vala complier converts your code to to C then uses the C complier to make the binary. C is one of the oldest modern languages (its about 40 years old now) and is by a good stretch the fastest.
<ClassBot> jthompson asked: Did you mention Vala run in Windows?  Does it use GTK for the GUI layer?
<fagan> I kinda glossed over the vala on windows thing
<fagan> but yeah it does work on windows
<fagan> and it does use GTK
<fagan> you can get an installer for both im pretty sure on windows
<fagan> but you do have to change your / to \
<fagan> so the directories work
<fagan> since windows is backwards
<ClassBot> augdawg asked: is there a valac for windows?
<fagan> yes
<fagan> :)
<fagan> http://live.gnome.org/Vala/ValaOnWindows
<fagan> thanks for the link wutzara
<fagan> thoughts on quickly work-flow, e.g. multiple terminals <-> new developers?
<fagan> Well you can use quickly with a single terminal
<fagan> but I have a small bug at the moment where it only allows one command at a time
<fagan> so its a little bit bad
<fagan> any more questions
<fagan> I flew through the whole session
<fagan> so im sorry if I was a little fast
<ClassBot> w1ngnut asked: Don't know if was asked. Is there any IDE with code-completion for vala?
<fagan> Yep geany is nice for that
<fagan> and valide (I think thats the name)
<fagan> valide is a plugin for gedit and it has autocompletion just like netbeans or visual studio
<fagan> so its very nice
<fagan> http://code.google.com/p/vtg/
<fagan> http://www.valaide.org/
<fagan> thanks chat for the links :)
<ClassBot> augdawg asked: what do yu use?
<fagan> well I use gedit
<fagan> but I turn on the line numbering and i use different colours because the default ones are ugly
<fagan> oh and I should give the tools page too http://live.gnome.org/Vala/Tools
<ClassBot> jiga asked: I was previously using QT with c++, and I'm wondering, what are the benefits of quickly-vala over QT
<fagan> great question
<fagan> Well I dont have a clue about QT really or the state of its bindings with vala
<fagan> but id say there are
<fagan> so you wouldnt really need to use one or the other
<fagan> well im almost out of time but keep the questions coming if you have them
<fagan> :)
<ClassBot> wutzara asked: is there autotools support in quickly-vala
<fagan> Well I hate autotools
<fagan> So im working with buildj for 11.04 hopefully
<fagan> so we can have an easier way to build programs
<ClassBot> augdawg asked: does vala have alot of module type thingies?
<fagan> Well you have a lot of classes and bindings and stuff but all of them are similar to that in python
<fagan> so its not any more than any other language
<ClassBot> w1ngnut asked: Vala seems a good alternative for one coming from C# or java but the namespaces/methods inherit more from glib than the java-c# pattern. Do you have any tip for someone with experience on java-c# wanting to migrate/start learning vala?
<fagan> Well the easiest way is to dive in
<fagan> the tutorials are on the vala website
<fagan> and since its very similar to C# and java its easy to switch to
<fagan> the only major difference is instead of swing in java its GTK
<fagan> but thats awesome
<fagan> well since the syntax is very similar its fairly easy to switch
<fagan> Ok so thanks for listening and if you have any problems with my template go to #quickly on freenode or if you want help with Vala itself go to #vala on gimpnet. Of course patches are welcome and I hope you guys like it.
<fagan> Anyhow im out of time
<fagan> :)
<fagan> thanks everyone :P
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
<monkey_gorilla> what are you talking about now
#ubuntu-classroom 2010-09-28
<Avo> hey guys, is there are any way to get the app dev week stuff I'm going to miss this week? I've got a totally loaded week but there's some stuff I wouldn't (but have) to miss. Thanks!
<jiga> Avo, there are IRC logs
<Avo> And would that have all the important info?
<jiga> everything is happening on #ubuntu-classroom or #ubuntu-classroom-chat
<Avo>  Ah cool, cool. That's what I'll do then. Thanks!!
<jiga> you can find logs here: http://irclogs.ubuntu.com/
<pragad7> hello
<pragad7> join #ubuntu
<purvesh> can someone tell me how to protect ubuntu wiki pages from editing ?
<jcastro> 7 minutes until we start!
<OskO> Hello
<jcastro> Hi everyone
<jcastro> welcome to day #2 of ubuntu application developer week!
<OskO> Hi!
<jcastro> I hope everyone has had a good time so far
<jcastro> ok, so from now on please move all discussion to #ubuntu-classroom-chat
<jcastro> so that the speaker can present in here
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: From vision to an Ubuntu application in 4 simple steps - Instructors: didrocks
<jcastro> first up today we have Didier Rocks, aka, didrocks
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session.
<jcastro> 4 steps to an ubuntu application
<jcastro> didrocks, ready?
<didrocks> jcastro: yeah o/
<didrocks> thanks jcastro!
<didrocks> welcome everyone :)
<didrocks> can you raise your hands on #ubuntu-classroom-chat so that I can know how many people we have there?
<didrocks> good, a lot of people there!
<didrocks> welcome to the session on "4 steps to develop your application for ubuntu"
<didrocks> this session will be mostly a basic presentation of Quickly, which is the application we started to develop one year and half ago for developping applications in ubuntu
<didrocks> do you know about Quickly?, please answer in #ubuntu-classroom-chat
<didrocks> (that will enable me to know what's the audience is :))
<didrocks> ok, some people know about it, others don't :-) this session is really on basics of Quickly, let's start on it
<didrocks> so, some quick words of presentation first
<didrocks> my name is Didier Roche, I'm working in the ubuntu desktop team on updating GNOME and UNE (Ubuntu Netbook Edition)
<didrocks> I'm maintaining unity, that some of you probably heard of
<didrocks> also, as a spare time project with Rick Spencer, I'm hacking on Quickly
<didrocks> so, what is Quickly?
<didrocks> Quickly is to bring back fun in development!
<didrocks> Rick, the person who created the concept of Quickly, call it, among other things, an "Application Templating System"
<didrocks> the essence of the project is to provide you boiler plate for the kind of program you want to write
<didrocks> the boiler plate is the code that you would have to write for every program of a certain type gets generated for you
<didrocks> we have different boiler plates right now:
<didrocks> ubuntu-application, ubuntu-cli and ubuntu-pygame in lucid and maverick
<didrocks> some people seem to create new boiler plate, like vala and such
<didrocks> but Quickly is also a set of commands
<didrocks> the commands are designed to integrate with the Ubuntu Application infrastructure
<didrocks> things like bzr, launchpad, PPAs, etc..
<didrocks> those are something hard to learn when you just want to develop for fun
<didrocks> and you have a lot to look at too
<didrocks> the commands are what make all that work for you!
<didrocks> The moto of Quickly is "Easy and Fun"
<didrocks> while I'll answer to the first set of questions, you can install it (not mandatory to follow the session): sudo apt-get install quickly
<ClassBot> doktor777 asked: do you know any popular app developed with quickly?
<didrocks> some applications on ubuntu are using Quickly
<didrocks> like bughugger, pytask, lernid
<didrocks> (maybe some of you are using lernid to follow the session btw)
<didrocks> there are others apps like photobomb and such that are develop with Quickly
<didrocks> you can find them at http://theravingrick.blogspot.com/
<didrocks> but Quickly isn't made to create huge applications, it's more for what most of 1 person team will do
<didrocks> so, it fits most of the needs we can have, I guess
<ClassBot> Kruptein asked: so is quicly a programing language on it self or does it use an other language?
<didrocks> Quickly is a set of templates and commands
<didrocks> that means, the templates contains the code
<didrocks> I'll discuss about that later on, but the templates I presented before are made of python
<didrocks> but there is a incoming vala template
<didrocks> and theorically template (and commands) can from every languages you want
<ClassBot> hernejj asked: Does quickly help with packaging as well?
<didrocks> yeah, and this is the goodness :)
<didrocks> in one command, you can create a release, get a package, uploading the tarball to launchpad, create a milestone, get a changelog and push your project in your ppa
<didrocks> no need to harrass to create the package manually
<didrocks> or to file the dependencies :)
<ClassBot> doktor777 asked: how stable/mature it is?
<didrocks> Quickly has been launched in may 2009
<didrocks> so, it's more or less one year and half
<didrocks> it's quite mature, contains a lot of code
<didrocks> and we handle upgrade and such of your project
<ClassBot> zinga24 asked: what templates does it deliver? gui-templates?
<didrocks> so, with Quickly, on ubuntu, you have 3 templates:
<didrocks> ubuntu-application: is a template creating a gui application
<didrocks> (I'll present it in more extends later on)
<didrocks> ubuntu-cli is for command line application
<didrocks> and ubuntu-pygame for small and fun games using pygame
<didrocks> you can hav some examples on the link pasted before
<ClassBot> Kruptein asked: so can I pack my python programs in quickly to generate the packages only?
<didrocks> right, and some people did that as far as I know of
<didrocks> you just have to create some files like a .quickly file as root with some parameters
<didrocks> we can help you with that if you jump to #quickly on freenode
<ClassBot> doktor777 asked: what do you mean by "and we handle upgrade and such of your project" ?
<didrocks> for instance, in Quickly 0.4, we introduced apport support
<didrocks> and launchpad integration as well you know, the "ask a question/report a bug" in the help menu of default ubuntu application?
<didrocks> we thought it would be good for application which were created with Quickly 0.2 to get those 2 things on upgrade
<didrocks> and so, it's optionnaly added to people upgrading
<didrocks> that's what I meant by on "upgrade"
<didrocks> ok, no more question in the queue
<didrocks> let's continue then :)
<didrocks> so, first, what *is not* Quickly
<didrocks> Quickly is not an IDE
<didrocks> but you can use whatever IDE you want
<didrocks> it's a command line tool and there is some API for people wanting to bind it to an IDE
<didrocks> So, the title of the classroom was "4 steps to create your application"
<didrocks> let's begin for step 0, before the first one :)
<didrocks> think what you want to achieve with your application
<didrocks> try to not NIH (Not Invented Here) and reinventing the whell
<didrocks> why people want to install and then use your futur application instead of existing one?
<didrocks> so design is the most important step in my opinion :)
<didrocks> and no rush to step 1 until then!
<didrocks> step 1 is creating your application
<didrocks> which Quickly, it's fairly easy
<didrocks> $ quickly create ubuntu-application foo
<didrocks> this will create a "foo" ubuntu-application in a "foo" directory
<didrocks> you will have all what's needed with an application, like:
<didrocks> preferences integrations, menus, about box, easter eggs :)
<didrocks> so, quickly create launch your application and you can see the boiler plate
<didrocks> of course, you have all internationalization support and some icon/desktop file as well for people wanting to use it
<didrocks> the most important part is that there is no dependency on Quickly itself for your application
<didrocks> all is based on well known technology, but your application is then independent (in other words, Quickly isn't a framework)
<didrocks> and that's by design
<didrocks> so, for people running it during the session, you can see in the folder a lot of files have been created for you
<didrocks> in the ubuntu-application template, you have:
<didrocks> - python as a language to develop in
<didrocks> - glade for editing the GUI
<didrocks> - gedit as default editor (you can override this by exporting the EDITOR variable)
<didrocks> - pygtk for the toolkit
<didrocks> - desktopcouch for storing persistent data
<didrocks> - launchpad integration
<didrocks> all is chosen for helping you starting with your app
<didrocks> - (and bzr for revision control)
<didrocks> then, if you are confident enough and know what you need, you can remove each block you don't want and replace by yours
<didrocks> or create your own template even!
<didrocks> the idea is really to drive development and help opportunistic developer to know "where to start"
<didrocks> rather than beeing lost in choices
<didrocks> for helping starting development too, we have a complete tutorial:
<didrocks> $ cd foo/
<didrocks> $ quickly tutorial
<didrocks> this will bring you up the tutorial for the ubuntu-application template
<didrocks> Quickly has a lot of shell completion goodness
<didrocks> depending on where you are, it will suggest the right command on the right time
<didrocks> so, do not hesitate to press tab tab :)
<didrocks> also I heard that an "ubuntu developer manual" is on the way :)
<didrocks> this one will use Quickly as well and will be a good documentation reference
<didrocks> let's see to some questions before moving to step 2 :)
<ClassBot> doktor777 asked: and how do you upgrade, there's a command for that?
<didrocks> $ quickly upgrade
<didrocks> but it's launched for your each time Quickly is upgraded on your system and your application isn't transitionned
<didrocks> so nothing to worry about :)
<ClassBot> gaberlunzie44 asked: does quickly templates accept user input to customise/personalise apps?
<didrocks> sure, once the application created, it's yours!
<didrocks> so, as I said, you can customize every part of it
<didrocks> and there is no dep on Quickly, you can use qt instead of gtk for instance :)
<ClassBot> blackrock asked: Can I use git instead of bzr?
<didrocks> ah, the traditional questions :)
<didrocks> well, git isn't integrated to launchpad as well as bzr
<didrocks> and a lot of people are telling "I want to use git with Quickly"
<didrocks> well, you can create a ubuntu-git-application template :)
<didrocks> and change the commands to use git
<didrocks> but you will surely loose a lot of integration I'll explain afterwards
<didrocks> and ideally, if you only use Quickly, you don't need to know which versionning system is used for you
<didrocks> (for instance, you don't bzr commit, but you quickly save)
<ClassBot> doktor777 asked: hmm, I'd prefer to launch a command myself, can the auto-upgrade be easily disabled?
<didrocks> no, but you can create a template which doesn't have upgrade
<didrocks> we changed the format sometimes and we bzr commit before and after the upgrade
<didrocks> so you still can revert
<didrocks> ok, no more question, let's move on step 2 then!
<didrocks> once you know what you want to do
<didrocks> and how to do it (the tutorial), with some base (the app you created), it's time to personalize your application
<didrocks> this can be done with:
<didrocks> $ quickly design
<didrocks> this commands fires up glade to edit your user interface
<didrocks> glade is a tool for building gtk-based UI
<didrocks> (old screenshot of it: http://glade.gnome.org/images/glade-main-page.png)
<didrocks> so, you can there add widgets
<didrocks> change your window size
<didrocks> labels and such
<didrocks> you choose your components and draw them on the application area
<didrocks> the quickly tutorial explains the basic of this
<didrocks> in fact, Glade is a UI editing tool, that creates the XML you need to describe your windows and widgets
<didrocks> don't worry because the quickly template totally handles keeping the code and the XML hooked up
<didrocks> if others templates, like if kubuntu comes, we assume it won't use glade, obviously :)
<didrocks> hence the "design" command to launch it and not "glade"
<didrocks> so here are some tips for using Glade if you are new to Glade
<didrocks> first, adding widgets works like a fill tool
<didrocks> you click the widget you want in the toolbox, and then click where you want it to be on the window
<didrocks> the widgets will then fill the space alloted to it
<didrocks> to layout the form, you use HBoxes and VBoxes
<didrocks> an HBox handles Horizontal layout, and a VBox handles vertical
<didrocks> so you will find yourself putting lots of boxes within boxes
<didrocks> when you add a widget to a window, you can select it in the "inspector" tree if it is hard to select in the window itself'
<didrocks> boxes can be hard to select in the window, for example
<didrocks> if a widget is in a box, use the position property in the "Property editor" window in the "packing" tab to change the order
<didrocks> you can also add new dialogs with Quickly:
<didrocks> 1. close glade
<didrocks> 2. run: quickly add dialog <dialog_name>
<didrocks> 3. quickly design
<didrocks> and you will see the new dialog opened for you in glade :)
<didrocks> then, once you have done that, you want to create some kind to use your new widgets and dialogs
<didrocks> for that:
<didrocks> quickly edit
<didrocks> it will fire up gedit in the ubuntu-application template (and derivatives)
<didrocks> it will configure it to use spaces instead of tabs and spaces to behave like tabs
<didrocks> it opens every files you need to work with
<didrocks> so, that's where the hard work should take place :)
<didrocks> but don't take that too hard and test regularly which will be our step 3 after I answer some questions
<didrocks> as told previously, you can take some snapshot of your code with:
<didrocks> $ quickly save
<didrocks> or even:
<didrocks> $ quickly save implement a fantastic dialog to make cow to moooo
<didrocks> if you want to give a reason of what you have done :)
<ClassBot> blackrock asked: How do you create new template (like ubuntu-cli, ubuntu-application)?
<didrocks> really easy
<didrocks> ubuntu-cli and ubuntu-pygame are basically 0 line of code!
<didrocks> yeah, 0 :)
<didrocks> the commands are the same that in ubuntu-application
<didrocks> we just ship a different boiler plate
<didrocks> for that, Quickly support inheritance
<didrocks> which means "imports commands from"
<didrocks> so, ubuntu-cli imports all commands from ubuntu-application
<didrocks> if you want to create your own template, you can start by an existing one
<didrocks> like
<didrocks> $ quickly quickly ubuntu-application my-new-template
<didrocks> and it will create my-new-template in ~/quickly-templates, importing by default all commands from ubuntu-application
<didrocks> you can also create your own template in /quickly-templates
<didrocks> ~/quickly-templates,
<didrocks> I've documented that in my blog, which is down right now as I'm moving, sorry :)
<didrocks> but for further reference:
<didrocks> http://blog.didrocks.fr
<didrocks> (once up again)
<ClassBot> ozalexo asked: Why XML? And why not YAML?
<didrocks> ask that to glade people :)
<ClassBot> Kruptein asked: I'm using wxPython and have actually already created my project in python, why would/should I use quickly? or should I better stay with what I have right now
<didrocks> well, let's see the packaging part and we will discuss that :)
<didrocks> so, quickly on step 3 :)
<didrocks> which is testing!
<didrocks> to run your application from trunk
<didrocks> quickly run
<didrocks> this will enables your, taking all the right paths for you, to test it extensivily
<didrocks> if you want some people to test it, you can share a small first package with them
<didrocks> quickly share
<didrocks> it will upload to your ppa a packaged snapshot of your application
<didrocks> and so, people can test
<didrocks> quickly debug
<didrocks> is for debugging your application in winpdb
<didrocks> ok, so, now, the step your are all expected is release!
<didrocks> when you really want everyone to see your apps in a shiny stable version!
<didrocks> we took days and days to think about the name and the command to use :)
<didrocks> and finally, we ended up with:
<didrocks> quickly release
<didrocks> :)
<didrocks> this commands does a lot for you
<didrocks> it's packaging your application, changing some path for you to use system libraries (if present)
<didrocks> it detects all the dependencies needed
<didrocks> and put that into the package
<didrocks> it will create a gpg key for you if you don't have one on launchpad
<didrocks> same for ssh key
<didrocks> it's pushing your code in the trunk in launchpad, tagging it as stable
<didrocks> also, it detects all the ppa you have access too and push to it
<didrocks> also, it collects all messages you put in quickly save, and create an annoucement with that
<didrocks> publish through launchpad rss feed
<didrocks> also, it takes your upstream tarball, sign it with the gpg key, create the launchpad milestone and attaching everything for you
<didrocks> and finally, it exports the translations for you to launchpad so that people can translate your application
<didrocks> (in next version, it will import them for you as well :))
<didrocks> *phew* just that for one shiny little command :)
<didrocks> the release command just use the ubuntu way of creating version
<didrocks> like YY.MM
<didrocks> so, if you release this month
<didrocks> it will be 10.10
<didrocks> oupss
<didrocks> 10.09
<didrocks> (living in futur, it seems :))
<didrocks> if you release again tomorrow, it will be 10.09.1
<didrocks> and so onâ¦
<didrocks> ok, seeing a lot of questions, let's go back to them
<ClassBot> ozalexo asked: can I just create a deb package without putting it to launchpad?
<didrocks> and the answer isâ¦ yes!
<didrocks> quickly package :)
<didrocks> this will create a .deb that you can install locally
<ClassBot> gabri_biolab asked: I've allready developed a project in C++ Qt ITK VTK as external libraries, is there a way to easy move my existing project to quickly?
<didrocks> current templates are made of python
<didrocks> but we just count on people to extend and create new templates!
<didrocks> the core (the part common to templates) is in python, but templates and commands can be in whatever language of your wish
<ClassBot> louis-nb asked: why is postfix a dependency?
<didrocks> ahah, good one!
<didrocks> (this is in Quickly itself, not in your applications)
<didrocks> well, Quickly is pulling a lot of developers tools for you
<didrocks> to be able to create a package and such
<didrocks> one of them in ubuntu-dev-tools
<didrocks> which has a lot of deps
<didrocks> and one of those deps (devscripts if I remember correctly) is depending on postfix
<didrocks> that's something I want to fix
<didrocks> patch devscripts in ubuntu and debian
<didrocks> to make postfix optional
<didrocks> but it's taking time!
<didrocks> I've already had a look some months ago
<didrocks> but being sidetrack :)
<ClassBot> Kruptein asked: you said: it will push to every ppa you have access too, but why would I want to push "foo" to "bar" if I have both access to "foo" and "bar" which do not have to do anything with eachother
<didrocks> by default, it's picking the older one
<didrocks> but you have commands to configure that
<didrocks> already a complicated command name
<didrocks> quickly configure <what to configure>
<didrocks> so
<didrocks> quickly configure ppa my-ppa-name
<didrocks> (use tab completion, you will see what you can configure with)
<didrocks> quickly configure <tab><tab>
<didrocks> in bahs
<didrocks> bash*
<didrocks> also, think about the help on commands
<didrocks> quickly help <command_name>
<didrocks> will bring you the correct command help depending on the context
<didrocks> to see you command you can have helpâ¦
<didrocks> shell completion again! quickly help <tab><tab>
<didrocks> ok, let's quickly wrapping up
<didrocks> so, for references:
<didrocks> https://wiki.ubuntu.com/Quickly#Other Resources
<didrocks> you can see we got some press review, this is not exhaustive
<didrocks> we also welcome everyone on #quickly on freenode :)
<didrocks> and welcome contributions, a lot of people are contributing to quickly as well as in quickly-widgets
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: SHOWCASE: Pytask - Instructors: nisshh
<didrocks> (the latter is definitively a project you should look at)
<didrocks> yeah, just in time!
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session.
<didrocks> thanks everyone
<Pendulum> thanks didrocks!
<jcastro> nisshh, you're up!
<nisshh> yep
<nisshh> ok, hello everyone!
<nisshh> my name is Ryan Macnish, and this session is about my app called Pytask
<nisshh> which is created and maintained with Quickly
<nisshh> can i get a show of hands to see who is here right now?
<nisshh> in -chat of course :)
<nisshh> ok, looks like a fair few
<nisshh> right
<nisshh> i created Pytask way back in the middle of last year
<nisshh> i wanted to get going with Python and GTK back then, and Pytask was the first thing that came into my head
<nisshh> link to Pytask on launchpad: https://launchpad.net/pytask
<nisshh> back when i first started the project, i was writing it in pure GTK
<nisshh> sorry pure pyGTK
<ClassBot> TobiS asked: Do you have a website of your project with some information?
<nisshh> see my link to the project page on launchpad above
<nisshh> sometime later that year, i discovered glade, so i started using that to develop the GUI
<nisshh> fastforward to about march this year
<nisshh> and thats when i discovered the hidden gem that was Quickly
<nisshh> but anyway, thats enough story :)
<nisshh> basically, Pytask uses a combination of Quickly, Quickly-Widgets (which ill talk about in a sec) and CouchDB
<nisshh> Currently Pytask is such a simple application
<nisshh> it consists of just the Quickly generated code, plus less than 100 lines of code that i added in
<nisshh> thats right, LESS than 100 lines of code
<nisshh> it was possible to do this because i used Quickly and Quickly-Widgets
<nisshh> Quickly-Widgets is basically a convenience
<nisshh> it makes it much, much easier to create and modify certain widgets
<nisshh> such as Treeviews, Couchgrids (which i will talk about in a sec), and popup yes/no/ok dialogs
<nisshh> before i continue are there any more questions?
<nisshh> no?
<nisshh> ok
<nisshh> moving on, now ill talk about Couchgrid :)
<nisshh> Couchgrid in quickly-widgets is really awesome
<nisshh> with Pytask, it basically allowed me to do 3 things very, very easily:
<nisshh> 1) create and show an editable treeview
<nisshh> 2) easily modify the contents and arrangement of that treeview
<nisshh> 3) sync the tasks in the treeview with Ubuntu One
<nisshh> oh
<nisshh> for those of you who dont know, Pytask is a todo list management app
<nisshh> similar to Getting Things Gnome
<nisshh> number 3 is especially cool, since it allows me to sync tasks with Ubuntu One, with just a few lines of code :)
<ClassBot> gaberlunzie44 asked: what quickly commands are used for widgets and db connectivity?
<nisshh> very good question
<nisshh> for the db connectivity, there are no quickly commands
<nisshh> i simply had to import quickly widgets into my Pytask code
<nisshh> and create the db itself, plus some keys
<nisshh> currently, the only release of Pytask that can Sync with Ubuntu One is 10.06.1
<nisshh> (the latest one)
<nisshh> there is one little quirk though
<nisshh> originally, Rick Spencer named quickly-widgets Quidgets
<nisshh> so on launchpad, the project is Quidgets
<nisshh> but in lucid and maverick
<nisshh> the package is called quickly-widgets
<nisshh> as an added bonus of Pytask using quickly-widgets, i have worked with Rick Spencer to iron out many bugs from quickly-widgets, just for you guys :)
<nisshh> now, CouchDB :)
<nisshh> Couchgrid uses CouchDB to sync with Ubuntu one
<nisshh> and Couchgrid is included in quickly-widgets
<nisshh> couchDB makes it super simple to create, delete, edit, modify, etc
<nisshh> all your databases and database entries
<ClassBot> gaberlunzie44 asked: link for quickly-widgets? (just to be complete)
<nisshh> https://launchpad.net/quidgets
<nisshh> thats quickly-widgets on launchpad
<nisshh> moving on
<nisshh> now, one awesome feature that i am working on for one of the upcoming releases of Pytask
<nisshh> is the ability to use tasks interchangeably between Pytask and Getting Things Gnome
<nisshh> this is made possible
<nisshh> because Getting Things Gnome has support for multiple backends
<nisshh> one of which is CouchDB
<nisshh> (the same one as Pytask uses)
<nisshh> so what will eventually be possible
<nisshh> is that you will be able to create your tasks in say, Getting Things Gnome, while using the CouchDB backend of course
<nisshh> then if you decide you like Pytask better, simply load it up, and force Pytask to use the same database as Getting Things Gnome
<nisshh> this isnt currently possible, even in trunk
<nisshh> but it will be very soon
<nisshh> the next version of Pytask will, feature Indicator support
<nisshh> which will just make it hideable on the desktop
<nisshh> before i go any further, do we have any more questions?
<nisshh> ok
<nisshh> moving on
<nisshh> the latest release of Pytask is always available in my PPA here: https://launchpad.net/~nisshh/+archive/pytask-releases
<nisshh> which currently wont work for maverick users
<nisshh> but is good to go for lucid
<ClassBot> gaberlunzie44 asked: any plan for a graph/chart view, like a gantt?
<nisshh> no, not currently
<nisshh> when i created Pytask, i planned it to be more on the simple side
<nisshh> but, as time goes on, i may add features like that
<nisshh> that reminds me
<nisshh> another feature i am very excited to be adding in soon
<nisshh> is launchpadlib support
<nisshh> whats this you ask?
<nisshh> launchpadlib is a Python library that allows you to fetch objects from launchpad
<nisshh> things like bug titles, project names, etc
<nisshh> you can even write new data to launchpad with it if you wish
<nisshh> anyway
<nisshh> what i want to do is enable Pytask to fetch data from launchpad so it can be included in tasks
<nisshh> for example:
<nisshh> say i wanted to create a task reminding me to fix a certain bug in one of my projects on launchpad
<nisshh> i could either add the information manually (the bug number, title, and project name)
<nisshh> OR
<nisshh> i could do it the cool way
<nisshh> and use launchpadlib to quickly fetch the data from launchpad (anonymously, for those of you worried about privacy)
<nisshh> and have Pytask automatically add it to the task in question
<nisshh> sounds cool huh?
<nisshh> any questions about that before i move on>
<nisshh> ok
<nisshh> moving on
<ClassBot> gaberlunzie44 asked: what about sharing? thru launchpad?
<nisshh> this, is interesting
<nisshh> if its what i think it is that your refferring to
<nisshh> sharing tasks through launchpad would not work really
<nisshh> although, im not sure how that would benefit anyway
<nisshh> ok
<ClassBot> hackerswami asked: Couldn't sharing work via Ubuntu one support?
<nisshh> thats exactly what Pytask already does
<nisshh> Pytask saves tasks into a CouchDB database
<nisshh> which then automatically get synced through Ubuntu One
<nisshh> to any other computers connected to the same Ubuntu One account
<nisshh> that is why i love Couchgrid so much :)
<nisshh> also, after i push out the next release, ill be working with some people on the Ubuntu Desktop team
<nisshh> to get Pytask into the official repositories
<nisshh> for the uninitiated, that means you will be able to install it from the software centre :)
<ClassBot> and471_42 asked: now that you have gone quite far in pytask, are there somethings that when you look back, you wish you had/hadn't done?
<nisshh> wow
<nisshh> you guys ask good questions :)
<nisshh> well, i certainly don't have any regrets
<nisshh> learning to program on Ubuntu and learning the tools of the trade, have taught me a lot
<nisshh> it's been an absolute joy so far :)
<nisshh> one thing i feel i should have done though
<nisshh> is started using Quickly sooner
<nisshh> it would have made my life much easier back then
<nisshh> ok, almost out of time onw
<nisshh> now*
<nisshh> are there any last minute questions?
<ClassBot> apachelogger asked: does quickly include unicorns?
<nisshh> silly question
<nisshh> but, yes, quickly includes unicorns of awesomeness :)
<nisshh> ok, to wrap up
<nisshh> feel free to get in touch with me in #quickly on freenode
<nisshh> im nearly always there
<ClassBot> SilentRock asked: how can i get pytask sir?
<nisshh> my PPA
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Unicorn sparkles with Qt development - Instructors: apachelogger
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session.
<apachelogger> good morning everyone
<apachelogger> while quickly comes with unicorn awesomeness Qt features unicorn sparkles and I hope you are ready for that :D
<apachelogger> I'd like to welcome everyone to a (rather short) journey through the wonders and beauties of Qt development ... yay
<apachelogger> first off let me make clear that by no means I intent to teach you Qt in this hour of fun
<apachelogger> instead I would like ot motivate you to check out one of the many tutorials on Qt programmming and get to love the power and awesomeness of Qt
<apachelogger> before we get started I would like to ask you to get the Qt SDK (that is if you want to take part in a live coding example later on)
<apachelogger> You can get it from:
<apachelogger> http://qt.nokia.com/downloads/sdk-linux-x11-32bit-cpp
<apachelogger> or for 64bit:
<apachelogger> http://qt.nokia.com/downloads/sdk-linux-x11-64bit-cpp
<apachelogger> please note taht both are of considerable size (>422 MiB) but contain just about anything you will ever need for Qt development, and certainly is a good starting point for us so we do not have to worry about dependencies and what not
<apachelogger> should you however wish to, you can also use ubuntu packages ... sudo apt-get install libqt4-dev libphonon-dev qt-creator qt4-demos phonon phonon-backend-xine
<apachelogger> (if you are running gnome you might want to use phonon-backend-gstreamer instead of that xine thing at the ende there)
<apachelogger> IN ANY CASE please make sure the package build-essential is installed
<apachelogger> now then
<apachelogger> let me start by answering the question that probably haunts you already....
<apachelogger> "What is this Qt that due is talking about?"
<apachelogger> (yes I can read minds :P)
<apachelogger> Qt is a cross-platform application development framework for C++.
<apachelogger> that makes it totally clear, right? ;)
<apachelogger> Qt is a vast collection of more or less generic software technologis you will most likely  need and want to use to create feature rich applications  of any sort
<ClassBot> doktor777 asked: does it make sense to develop in Qt for Ubuntu (which is based on gtk)?
<apachelogger> Yes it does
<apachelogger> Among other things, Qt features very powerful integration into GTK and GNOME.
<apachelogger> So if you develop something in Qt it will integrate well on Windows and OSX and KDE *AND* GNOME
<apachelogger> Also Qt is a very powerful framework with lots and lots of functionality...., so ;)
<ClassBot> Caagalar asked: Is that SDK come from QT Creator from ubuntu repositories?
<apachelogger> The SDK is a self-contained package of all Qt components (that includes the regular development tools) and Qt Creator.
<apachelogger> so basically evyerthing you will ever want
<apachelogger> But let us continue on me informing you :D
<apachelogger> Something important to note is that Qt, contrairy to what some people believe, is not a graphics toolkit!!!!!!elven*star*
<apachelogger> It certainly features a lot of graphics technology that helps with creating graphical applications, but it is not limited to that.
<apachelogger> In particular Qt is made up of many modules and you decide which modules you want to use.
<apachelogger> Some important ones have names like QtCore QtGui QtWebKit and QtDBus
<apachelogger> Now say you create an appliation using only QtCore you do not need a graphics stack at all
<apachelogger> for example the IRC client Quassel can use a server application running on a proper server without graphics.
<apachelogger> this is possible because the quassel server is written only using QtCore and QtNetwork (which both do not do any graphics magic)
<ClassBot> SilentRock asked: why would i choose QT?
<apachelogger> I hope to have answered that implicitly by the end of the talk, if not feel free to ask it again :)
<apachelogger> So, you can create a lot of applications (both graphical and non-graphical), but also terrific is that you can deploy those applications on quite a bit of platforms.
<apachelogger> Well, lets say operating systems...
<apachelogger> Qt is available for quite a lot of them and say you write an application that only uses standard C++ and Qt you can compile and run it on Linux just as well as on Windows.
<apachelogger> Qt is by design made cross-platform.
<apachelogger> To be precise the following operating systems are officilly supported:
<apachelogger> Linux
<apachelogger> Windows
<apachelogger> Windows CE
<apachelogger> Mac OS X
<apachelogger> MeeGo (i.e. Maemo as seen on the Nokia N900)
<apachelogger> and Symbian
<apachelogger> On top of that there are partially experimental third part portations available for:
<apachelogger> OpenSolaris
<apachelogger> *BSD
<apachelogger> Haiku
<apachelogger> OS/2
<apachelogger> Android
<apachelogger> iPhone
<apachelogger> Amazon's Kindle
<apachelogger> and probably many more
<apachelogger> I did not convince you yet?
<apachelogger> Well then.
<apachelogger> I said that Qt is a framework for C++
<apachelogger> that is true, but also a bit limited...
<apachelogger> In Qt 4.7 you can also officially use JavaScript (or rather ECMAScript) ... that would then be called QML
<apachelogger> BUT
<apachelogger> additionally to that there are some language bindings available
<apachelogger> to my knowledge there are bindings for:
<apachelogger> Ruby
<apachelogger> Python
<apachelogger> C#
<apachelogger> Java
<apachelogger> Ada
<apachelogger> Lua
<apachelogger> Common Lisp
<apachelogger> PHP (yes the web PHP)
<apachelogger> R
<apachelogger> ...
<ClassBot> doktor777 asked: and what if I use something like pyQt? the portability gets worse?
<apachelogger> well, Qt itself is still portable the bindings however might not be... I am quite certain that pyQt however runs on all 3 major platforms though
<ClassBot> SilentRock asked: what about D?
<apachelogger> I don't think there are bindings for D, maybe someone wants to do them? ;)
<apachelogger> Now for some change, let us watch a video together, shall we?
<apachelogger> A very nice intro on Qt http://www.youtube.com/watch?v=p0xiKBEx8RA
<ClassBot> rooliganLernid asked: but where are the disadventages?
<apachelogger> You might be asking the wrong person ;)
<apachelogger> Well, one obvious disadvantage is that of course a Qt application has a bigger footprint than a standard C++ one
<apachelogger> So using it for a hello world application that only uses QtCore and outputs to the console would not make sense ;)
<apachelogger> Other than that I could not really think of disadvantages I personally experienced
<apachelogger> Well then.
<apachelogger> I hope everyone has finished watching the video.
<apachelogger> And we already sort of ended up at the question "What can you really do with Qt?"
<apachelogger> Let me put it this way: there is almost nothing you cannot do with it...
<apachelogger> As I said earlier, Qt provides various moduels by default (note that all those modules and classes are essentially based on core functions of the QtCore modules, so one can just as well write own stuff)
<apachelogger> those modules allow you ot create very richa nd advanced graphic user interfaces, embed multimedia content, draw custom 2D graphics, draw custom 3D graphics, make us of multiple CPU(core)s, embed web content, include scripting capabilities, connect to databases ranging from sqlite to postgresql and many many more things.
<apachelogger> It is terribly difficult to comunicate something as extraordinary as Qt through writing, so I better adivse you to take a look at some Qt show cases.
<apachelogger> http://qt.nokia.com/qt-in-use/ambassadors/showcase
<apachelogger> With Qt you can not simply create dull graphical applications, you can create beauty.
<apachelogger> And please keep in mind, this beauty is cross-platform.
<apachelogger> Are we finished with downloading the SDK yet?
<ClassBot> SilentRock asked: apache,thats a cliche,all programmers say the same about theyre favorite lenguage,how can you prove that hte possibilities of Qt are unlimitted?
<apachelogger> That is a difficult one ...
<apachelogger> I mentioned earlier that Qt in itself is based on its QtCore module (largely), so while you can already do all sorts of things out of the box, you can implement an indefinit amount of other new things using the existing solutions.
<apachelogger> building up on them
<apachelogger> In essence that is what KDE does.
<apachelogger> KDE takes Qt and stacks a whole bunch of additionaly refined specified solutions on top of it that are necessary to create a coherent desktop environment.
<apachelogger> But since only 30 mins are left we better continue ;)
<apachelogger> With some coding
<apachelogger> \o/
<apachelogger> yay
<apachelogger> hooray
<apachelogger> \o/
<apachelogger> those that do not want to take part right now, can continue watching videos
<apachelogger> e.g.
<apachelogger> Qt @ Embedded World 2010: http://www.youtube.com/watch?v=hq34gppsnzw
<apachelogger> Qt Everywhere on All Platforms: http://www.youtube.com/watch?v=yh5Rt3cfuoQ
<apachelogger> Or generally stuff from QtStudios on YouTube. One gets a very good impression of Qt from those videos.
<apachelogger> SO.
<apachelogger> After installing the SDK you should have Qt Creator opened
<apachelogger> that is Qt's own IDE
<apachelogger> We will use it to swiftly create an application that I like to calll Cappuccino
<apachelogger> simply put: we are going to make a video player \o/
<apachelogger> On Qt creator ....
<apachelogger> in the menubar....
<apachelogger> File -> new project
<apachelogger> We will make a Qt C++ Project
<apachelogger> in specific a Qt Gui Application
<apachelogger> that should be default already
<apachelogger> click choose
<apachelogger> then give it our cool name and select a path where to place the source
<apachelogger> next -> next -> finish
<apachelogger> we now have a very basic application already if you hit CTRL+R you should get a plain window already
<apachelogger> (instead of CTRL+R you can also press the green play icon thingy)
<apachelogger> in qt creator you should have a very strange view right now
<apachelogger> with loads of elements and a plain window in the middle
<apachelogger> that is our designer
<apachelogger> here we can compose simple things using drag and drop
<apachelogger> so lets do that
<apachelogger> in the bar on the left hand side filter for "widget"
<apachelogger> an drag a "Widget" onto our window
<apachelogger> next filter for "push"
<apachelogger> and drag a push button below the widget in our window
<apachelogger> now right click on empty bakckground space of the window and choose Lay out -> lay out vertically
<apachelogger> that should have brought things into order already
<apachelogger> now lets tweak around a bit
<apachelogger> first click on the button
<apachelogger> on the right hand side there is at the top a list of our widgets in the window (which is rather uninteresting right now) and below an editor for the properties of the currently selected widget
<apachelogger> so lets change the button around a bit
<apachelogger> filter for 'flat' (or scroll to the very bottom) and check the checkbox there
<apachelogger> now filter for 'text' and remove the text
<apachelogger> now filter for 'icon' and
<apachelogger> well
<apachelogger> let me get a URL real quick
<apachelogger> http://people.ubuntu.com/~apachelogger/uadw/09.10/data/play.png
<apachelogger> download that and place it somewhere you can find it
<apachelogger> e.g. your home directory
<apachelogger> now back in qt creator
<apachelogger> if you select the icon property there is an arrow next to the value field, click that arrow and choose from file
<apachelogger> select the play.png
<apachelogger> also while we have a filter on 'icon' set the icon size to 48x48
<apachelogger> now lets do something to the widget
<apachelogger> right click on the widget and choose "promote to"
<apachelogger> that is somehwere in the middle of the context menu
<apachelogger> at the bottom of the dialog we'll add a new class
<apachelogger> class name: Phonon::VideoWidget
<apachelogger> header file: Phonon/VideoWidget
<apachelogger> [x] global include
<apachelogger> then clik 'add' and finally 'promote'
<apachelogger> save and close the file (using the x in the upper right corner)
<apachelogger> you should now find a projects overview on the left hand side
<apachelogger> there open the Cappuccino.pro file
<apachelogger> there you should find the following line:
<apachelogger> QT       += core gui
<apachelogger> just append 'phonon' to that
<apachelogger> QT       += core gui phonon
<apachelogger> like that
<apachelogger> save and close again
<apachelogger> in the sources folder of the projects overview you will find a mainwindow.cpp file
<apachelogger> there we will now create the application logic of our player
<apachelogger> first add a couple of includes at the top
<apachelogger> #include <Phonon/AudioOutput>
<apachelogger> #include <Phonon/MediaObject>
<apachelogger> #include <Phonon/MediaSource>
<apachelogger> now within the curly brackets of MainWindow::MainWindow we do everything that follows
<apachelogger> first we create a phonon media object
<apachelogger> phonon is the multimedia magic of Qt and a media object is the thing that will hold a video file or an audio file
<apachelogger> Phonon::MediaObject *media = new Phonon::MediaObject(this);
<apachelogger> as easy as that ;)
<apachelogger> now we attach this media to our widget in the window
<apachelogger> Phonon::createPath(media, ui->widget);
<apachelogger> we would also like some audio
<apachelogger> so we create an audio output
<apachelogger> Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
<apachelogger> and also attach our media to that output
<apachelogger> Phonon::createPath(media, audioOutput);
<apachelogger> finally we make our button invoke the playback
<apachelogger> connect(ui->pushButton, SIGNAL(clicked()), media, SLOT(play()));
<apachelogger> now
<apachelogger> if you are still following, because I am quite fast because we were chit chatting too much earlier :P....
<apachelogger> if you hit CTRL+R (or that green play icon thingy) you should get a window
<apachelogger> and if you hit the play button it should start playback
<apachelogger> or not... ;)
<apachelogger> something we forgot was to define a media source
<apachelogger> i.e. the actual thing that we want to play back
<apachelogger> so just add this
<apachelogger> media->setCurrentSource(Phonon::MediaSource("http://people.ubuntu.com/~apachelogger/uadw/09.10/humanity.ogv"));
<apachelogger> then try CTRL+R again and hit the play button again and now you should get a video
<apachelogger> of course now the button is useless after you hit i once, so we will just hide it once hit
<apachelogger> connect(ui->pushButton, SIGNAL(clicked()), ui->pushButton, SLOT(hide()));
<apachelogger> now we have a pretty decent video player
<apachelogger> in case you got stuck: http://people.ubuntu.com/~apachelogger/uadw/09.10/Cappuccino/
<apachelogger> here is my source
<apachelogger> also you can find me in #kubuntu-devel where we can continue making it work for you too
<apachelogger> Where you can and should go now...
<apachelogger> Take a look at the getting started guide
<apachelogger> http://doc.qt.nokia.com/latest/gettingstarted.html
<apachelogger> and the examples  http://doc.qt.nokia.com/latest/all-examples.html
<apachelogger> your Welcome page of Qt Creator already contains all examples so you can easily try them and explore the real power of Qt
<apachelogger> some Examples I can recommend:
<apachelogger>  Animated Frameworks -> Animated Tiles
<apachelogger>  Graphics View -> Elastic Nodes
<apachelogger>  Main Windows -> Application
<apachelogger>  Items View -> Puzzle
<apachelogger> And last but not least join #qt ;)
<apachelogger> Any question that I can answer in one minue?
<apachelogger> *minute
<apachelogger> Well.
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Using the indicator stack in your Python application - Instructors: sense
<apachelogger> Thank you everyone, you were an amazing  audience
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session.
<sense> thanks to apachelogger for a great and very filled session and welcome to everyone attending this session on Indicators!
<sense> This session I want to talk you through two code examples of two types of indicators, using them to explain how the indicators work. The rest of the time I will try to answer questions about using indicators. If you want to use an indicator in your own application, save your questions
<sense> The first example is code of an Application Indicator, the second of an application registered in the Me Menu.
<sense> I will not explain how to let your application use the Me Menu, since that is not extensible, and I will only briefly touch the Sound Menu during the section about the Messaging Menu.
<sense> The two code examples can be found at <http://people.ubuntu.com/~sense/uadw/>, the .desktop file is for the Messaging Menu.
<sense> First, let us talk about the Application Indicator. Everyone, open http://people.ubuntu.com/~sense/uadw/appind-example.py if you want to read along. I'll try to copy crucial code into the chat.
<sense> Everyone's got the file?
<sense> Skip past the license to read the first line of interest:
<sense> import appindicator
<sense> This line of Python code tells we want to use the Application Indicator library.
<sense> If you don't have the package 'python-appindicator' installed you want to install it before testing this example/
<sense> Skipping past a function we will come back to later, and past the creation of a GtkWindow we see the second line of interest:
<sense>     ind = appindicator.Indicator ("example-simple-client",
<sense>                                 "indicator-messages",
<sense>                                 appindicator.CATEGORY_APPLICATION_STATUS)
<sense> This is the most important call we make: here we register the application with the Application Indicator 'server'.
<sense> The first argument is the (unique) ID of your application. You probably want to use the same name here as you use for your package and icon names.
<sense> The second argument, 'indicator-messages' is actually the icon name.
<sense> The third argument is the category of the Application Indicator.
<sense> There are five different categories:
<sense> APP_INDICATOR_CATEGORY_APPLICATION_STATUS
<sense> APP_INDICATOR_CATEGORY_COMMUNICATIONS
<sense> APP_INDICATOR_CATEGORY_SYSTEM_SERVICE
<sense> APP_INDICATOR_CATEGORY_HARDWARE
<sense> APP_INDICATOR_CATEGORY_OTHER
<sense> In Python you call them differently:
<sense> appindicator.CATEGORY_APPLICATION_STATUS
<sense> appindicator.CATEGORY_COMMUNICATIONS
<sense> appindicator.CATEGORY_SYSTEM_SERVICE
<sense> appindicator.CATEGORY_HARDWARE
<sense> appindicator.CATEGORY_OTHER
<sense> The first category is used by applications to show their status, the second by communications-related applications, the third by system-related applications and the fourth by... hardware related applications (think Bluetooth indicators and such). The fifth is 'miscellaneous', but shouldn't really be used unless there really is no other option.
<sense> In the future the developers of the Application Indicators project can use these categorise to alter the way different types of applications are shown.
<ClassBot> ozalexo asked: How can I check that my application name (first parameter) is unique at this time?
<sense> ozalexo: You cannot be sure, of course. There is always a small chance the name is not unique. That won't crash your system, but please try to check if an application using the name already exists before using it as an ID. That's related to choosing a name for your application, though, so it should be done when starting your project.
<sense> The two lines of code after the initial call to the appindicator library are interesting:
<sense>     ind.set_status (appindicator.STATUS_ACTIVE)
<sense>     ind.set_attention_icon ("indicator-messages-new")
<sense> The first line sets to the status to 'active'. When the status of the application indicator is 'active', it is shown. By default it is 'passive', then it is hidden.
<sense> The next line is related to the third status. It sets the 'attention-icon'. The attention-icon is displayed when the status is set to 'attention'.
<sense> You can use that status when you want to grab the attention of the user.
<sense> appindicator.STATUS_PASSIVE and appindicator.STATUS_ATTENTION are the Python names of the other two statuses.
<sense> The next few lines of code in the example are for creating the menu. Once you've got your menu (as you can see, you can connect signals just like you would do with a regular menu), you need to tell it should be associated with the application indicator.
<sense> In our case, the line of code to do that is:
<sense>     ind.set_menu(menu)
<sense> This is a short overview of the Application Indicator code example. Are there any questions so far?
<sense> Alright then!
<sense> Lets take a look at the Python code that registers an application in the Messaging Menu!
<sense> You need the code example at <http://people.ubuntu.com/~sense/uadw/messmenu-example.py> for this, and the .desktop file at <http://people.ubuntu.com/~sense/uadw/example.desktop>. Place both files in the same directory.
<sense> If you don't understand a piece of the code, be it code related to the messaging menu, or other code, don't be afraid to ask!
<sense> Here we need to import the libindicate library:
<sense> import indicate
<sense> After that initial line of library importing there are two functions that are used as callback functions and then the first line of interesting code:
<sense> mm_server = indicate.indicate_server_ref_default()
<sense> mm_server.set_type("message.mail")
<sense> mm_server.set_desktop_file(os.path.join(os.getcwd(), "example.desktop"))
<sense> mm_server.connect("server-display", server_activated)
<sense> The first line of the four I just pasted into the chat creates a reference to a new 'server' entry in the indicator server. This is the general representation of our application in the Messaging Menu, and the main way of interacting with it.
<sense> The second line sets the type: in our case it is a 'mail' application.
<sense> Please refer to <https://wiki.ubuntu.com/MessagingMenu> for an overview of the different types.
<sense> Here also comes the note on the Sound Menu:
<sense> Actually, libindicate isn't just for the Messaging Menu. Our application will show up in the Messaging Menu, but only because we've set the type to 'message.mail'.
<sense> But libindicate also registers applications with other indicators, like the Sound Menu. Rhythmbox uses the same code, but sets its type to 'music.rhythmbox'.
<sense> This has the consequence that applications only have to register themselves at one place, and that then libindicate will make sure they are represented as they should be.
<sense> Of course, in order to be shown in the Sound Menu you also need to have an MPRISv2 interface available, but that is out of the scope of this session.
<sense> Back to the four lines I pasted into the chat.
<sense> The third line of those four is also important, it is actually a required step.
<sense> Here you register your application's .desktop file. Thanks to this it is possible for users to launch an application from the Messaging Menu after it was closed.
<sense> The fourth code line is just a registration of a callback function, executed when someone clicks on the main ('server') entry in the messaging menu.
<sense> Am I understandable?
<sense> In the next part of the code example you can see a 'for' loop, used to quickly create three different entries, 'mail boxes' in this case.
<sense> You see that we start with creating a new 'Indicator' object. This is the unfortunate terminology for the subentries of applications in the Messaging Menu.
<sense> http://people.ubuntu.com/~sense/uadw/messmenu-example.py
<sense>     box = indicate.Indicator()
<sense> Please note that in order for a subitem to stay around you need to keep a reference.
<sense> The next part of the code inside the for loop is for setting the properties of our subitem:
<sense>     box.set_property("name", "Mailbox %d" % i)
<sense>     box.set_property("count", str(i))
<sense>     box.label = "Mailbox %d" % i
<sense>     box.connect("user-display", mailbox_activated)
<sense> We set the indiator's name, which will be used for the label of the subitem in the Messaging Menu and the 'count'. That 'count' can be used for showing the number of unread mails in your mailbox.
<sense> Chat clients can use other properties when they want to show the time since someone e.g. mentioned your name in a conversation.
<sense> The last line in the pasted code connects again a callback function, which is executed when the user clicks the subitem.
<sense> You have to call     box.show() on the subitems to make them be displayed.
<sense> The same is true of the main item: mm_server.show()
<sense> Are there questions about what I previously said?
<sense> Actually, mm_server.show() is not required.
<sense> You just need to make sure you let the subitems show, by calling the show() function on them.
<sense> Any questions about what I've said so far?
<ClassBot> ozalexo asked: Is it possible to use any own icons in the menus?
<sense> ozalexo: Good question! I forgot to mention that the Messaging Menu sets the icon using the desktop file provided to it.
<sense> In the file 'example.desktop' you see the following line:
<sense> Icon=applications-email-panel
<sense> The Messaging Menu reads that line and uses the applications-email-panel icon.
<sense> Is there anyone reading who is using an indicator in his or her application?
<sense> Any questions about that? What do you think of the technology?
<ClassBot> jiga asked: is there a simple way to do the baloon notifications too?
<sense> jiga: Notify OSD is Canonical's implementation of the Notification Specification, and is part of Ayatana. However, the libraries used for creating notification bubbles are not developed by Canonical, since they were developed together with the standard.
<sense> Let me show you a few lines of code to help you along.
<sense> jiga: I think that this is a reasonable example: <http://ubuntuforums.org/showthread.php?t=926797>
<sense> Generally, you need pynotify
<ClassBot> ozalexo asked: Is it possible to implement smth like Chrome's menu?
<sense> ozalexo: It is not possible to have special menu items like that in the Messaging Menu or the Application Indicators' menu, because that is custom interface. We're only using the standard GTK+ interface toolkit, and on top of that, we don't provide the functions to the application developers to do it themselves. In case of the Application Indicator we put the provided menu in some sort of pseudo-menu structure before passing it over DBus to th
<sense> e server, which deconstructs it again, and then rebuild it. But that only works for regular menus. The messaging Menu even provides less options for customisation.
<ClassBot> rooliganLernid asked: How to change the icon in the first example? There is no .desktop file. So what to do?
<sense> rooliganLernid: For application indicators you provide the general icon name as the second of the three arguments you give to the initialisation function.
<sense>     ind = appindicator.Indicator ("example-simple-client",
<sense>                                 "indicator-messages",
<sense>                                 appindicator.CATEGORY_APPLICATION_STATUS)
<sense> In this case the icon is 'indicator-messages'
<sense> You can also set a special attention icon, which is shown when you set the status to appindicator.STATUS_ATTENTION
<ClassBot> rooliganLernid asked: So just edit it to "/home/user/blah"?
<sense> rooliganLernid: You cannot provide a direct path to an icon, but in the regular constructor you give the icon name.
<sense> The icon is then searched for in the theme.
<sense> However, you can set the icon theme path, to extend the search.
<sense> rooliganLernid: Does that make sense to you?
<sense> The function for setting the icon theme path is '.set_icon_theme_path('/icon/theme/path')'
<sense> Any other questions, remarks, suggestions?
<sense> No?
<jcastro> alright sense! good job!
<sense> In that case I would like to thank you for your attention and point you to jcastro for the next session!
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Building your package daily - Instructors: jcastro
<jcastro> Awesome, thanks for coming everyone
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html following the conclusion of the session.
<jcastro> This session is going to be about daily builds
<jcastro> and how you can set them up for your project
<jcastro> So before we start, I'm going to link you up to some documentation that you can follow along with
<jcastro> https://help.launchpad.net/Packaging/SourceBuilds
<jcastro> ok so first off, what is a daily build?
<jcastro> this is your software, pulled out of version control and built every night in launchpad
<jcastro> COntrary to popular belief, daily builds aren't about getting you the latest crack, it's about getting testing of specific features and bugs tested.
<jcastro> also, feel free to ask questions at any time
<jcastro> so, imagine you have a program, that is at version 1.0
<jcastro> you report a bug and then the developer fixes it
<jcastro> and commits it
<jcastro> but, until the developer release 1.1 (or whatever), it's hard for you to test
<jcastro> because unless you're an expert, you may not know how to build the software from source
<jcastro> so, daily builds allow the developer to say "here try this PPA, let me know if the bug is fixed"
<jcastro> and then you can easily try it, say yes! or no! and then be on your merry way
<jcastro> we call this "tightening the feedback loop between developers and users"
<jcastro> getting feedback back to developers quicker
<jcastro> and developers getting stuff for users to test quicker
<jcastro> so, in order to do this, the launchpad team have made it easy for just about any project to fire up daily builds
<jcastro> (Note, this isn't a software development class, so if you're unsure on why your project should have dailies, a trunk that builds at all times, etc. please see other documentation on the internet)
<jcastro> ok, so, I'm going to show you an example of how to take a project
<jcastro> import it into launchpad
<jcastro> and then fire off dailies
<jcastro> since this is a Launchpad feature, we need two things to make the debs
<jcastro> we need
<jcastro> 1) The upstream source code
<jcastro> 2) the packaging
<jcastro> now, I am lazy, so there's no way I'm going to go figure out how to package shotwell
<jcastro> however .... https://code.launchpad.net/~ubuntu-desktop/
<jcastro> as it turns out the ubuntu desktop team keeps all their packaging in version control
<jcastro> wow, that's handy!
<jcastro> Now, I know what you are thinking... "Jorge, are you telling me I can just reuse the existing packaging and spit out debs of whatever I want?"
<jcastro> yes and no
<jcastro> First off, not every team in Ubuntu is using bzr for packaging (yet)
<jcastro> but we're well on our way
<jcastro> and, there's no guarantee that taking packaging for something in the distro will Just Work(tm) on a pure upstream source.
<jcastro> So .... I went and tried it!
<jcastro> ok so from looking at that list, I find shotwell's packaging
<jcastro> https://code.launchpad.net/~ubuntu-desktop/shotwell/ubuntu
<jcastro> there it is
<jcastro> this is basically the debian/ directory of the package the desktop team uses in ubuntu
<jcastro> Now we need the source code from upstream!
<jcastro> I can quickly google that
<jcastro> http://yorba.org/shotwell/install/
<jcastro> aha, there it is....
<jcastro> $ svn co svn://svn.yorba.org/shotwell/trunk shotwell
<jcastro> is what they tell us.
<jcastro> But they're using subversion, and I'm using Launchpad ....
<jcastro> so, I can tell Launchpad to import the Shotwell svn repository
<jcastro> by requesting a code import: https://code.launchpad.net/+code-imports/+new
<jcastro> code imports work for cvs, svn, and git
<jcastro> there is currently a limitation with the git import (no submodule support yet)
<jcastro> but the bzr team is working hard on that so more git using upstreams can use this feature
<jcastro> then launchpad goes and imports it and sends you a mail
<jcastro> how long it takes depends on the import
<jcastro> In the mail it tells me it's imported shotwell into launchpad here: https://code.launchpad.net/~jorge/shotwell/trunk
<jcastro> any questions so far?
<jcastro> so far we've imported shotwell into launchpad, and found the packaging branch the desktop team uses for shotwell
<jcastro> ok, so we've got the 2 parts we need
<jcastro> now we're going to tell Launchpad to shove it all in a blender and spit out debs!
<jcastro> we do this by using what we call recipes
<jcastro> https://code.edge.launchpad.net/~jorge/shotwell/trunk
<jcastro> and you  can click "Create a packaging recipe"
<jcastro> but, I've got done done already
<jcastro> https://code.edge.launchpad.net/~jorge/+recipe/shotwell-daily
<jcastro> there it is
<jcastro> now, this recipe is where the magic is
<jcastro> and covered in greater detail here: https://help.launchpad.net/Packaging/SourceBuilds/GettingStarted
<jcastro> so let's look at it
<jcastro> # bzr-builder format 0.2 deb-version 1.0+{time}
<jcastro> lp:shotwell
<jcastro> nest shotwellpackaging lp:~ubuntu-desktop/shotwell/ubuntu debian
<jcastro> these three lines are basically "we're building shotwell, the version is 1.0+$whatever_time_it_is, grab the source code from lp:shotwell, and then mush the packaging branch from lp:~ubuntu-desktop/shotwell/ubuntu and make a deb"
<jcastro> when I create the recipe I can choose which PPA to send it to
<jcastro> as you can see, I sent it to my "Daily test builds" PPA I made
<jcastro> https://code.edge.launchpad.net/~jorge/+archive/dailies/+packages
<jcastro> you can find the .deb there.
<jcastro> or NOT, because it failed.
<jcastro> hmm, I must have missed something.
<jcastro> right, I forgot to test my recipe to see if it even worked!
<jcastro> now, everytime I set up a daily build, this uses up resources
<jcastro> and the last thing we need is daily builds contributing to the heat death of the universe
<jcastro> so ... we first need to test the build locally
<jcastro> to make sure we've shaken out the bugs
<jcastro> this also means that you can also use your own machine to make daily builds
<jcastro> so if you have your favorite project and want to just set that up locally, you can totally do that
<jcastro> https://help.launchpad.net/Packaging/SourceBuilds/GettingStarted#Testing locally
<jcastro> this has instructions for how to test them locally, using bzr-builder, and pbuilder
<jcastro> any questions so far?
<jcastro> no questions? This can't be that easy!
<jcastro> ok
<jcastro> so, let's see what we can do with these things
<jcastro> let's use the amazing server team as an example on how they use daily builds
<jcastro> they maintain a whole bunch of these
<jcastro> https://edge.launchpad.net/~ubuntu-server-edgers
<jcastro> what we've got here is a collection of daily builds for all sorts of projects
<jcastro> apache, mysql, nagios, puppet, samba, varnish, etc. etc.
<jcastro> the list goes on and on
<jcastro> so, the team uses daily builds so people who are deploying these applications can test /the very latest/ code, right as it's committed
<jcastro> this leads to better bug reports, and better testing (remember what I said earlier about tightening the feedback loop)
<jcastro> ok so we've set up shotwell for dailies now (that was just an example, I haven't actually helped the shotwell guys set up dailies, but we're getting together this week to do it)
<jcastro> now, theoretically, launchpad goes off and builds the debs and publishes them to a PPA I've designated
<jcastro> This happens on the launchpad build farm: https://launchpad.net/builders
<jcastro> this is where you can see packages being built for both the distro and PPAs, in every supported arch
<jcastro> when you set this up launchpad mails you when it starts to build these, and it does a good job of telling you if it fails or something
<ClassBot> ozalexo asked: Is it possiblt to make my daily-builds hidden from people? What if I hezitate to show it, but I need to test it? :)
<jcastro> this is a good question
<jcastro> so in the example I set everything up in my little launchpad space, which is why the url's all have ~jorge in them
<jcastro> chances are no one cares about those too seriously
<jcastro> however, when you're ready to go public, you can put them in a more canonical place
<jcastro> https://launchpad.net/shotwell
<jcastro> they will eventually show up here ^^^
<jcastro> but yeah, when I am playing with them and they are broken I put them under ~jorge
<jcastro> one thing some projects fear is that users will use daily builds instead of releases
<jcastro> because we're maniacs everyone loves to have the pure hotness delivered every day
<jcastro> how you handle that is up to your project
<jcastro> and launchpad has facilities to ensure that you're not being spammed by bug reports from package versions that aren't in the archive
<jcastro> however if you have a dedicated group of people who know how to test, dailies bring a bunch of benefits
<jcastro> which I think outweigh the downsides
<jcastro> ok so wow, I type way faster than I should, any other questions?
<jcastro> another question I hear often is "If I am building trunk every day what if I break something! OMG anxiety!"
<jcastro> the simple answer to that is in a world with distributed version control and branching and merging you can do all sorts of development in a branch and then merge it into trunk when it's ready and works
<jcastro> and since we let you make as many recipes and branches as you want
<jcastro> there's nothing stopping you from making myapp-newfeature daily builds until you're ready to merge it
<jcastro> I forsee a world where application developers can just spit out .debs for individual fixes, so users can confirm it fixes their bug, and then the dev just rolls that into trunk and moves on\
<jcastro> any other questions?
<jcastro> abentley: any comments?
<jcastro> Aaron has been working on this feature all cycle!
<abentley> jcastro: seems like a good introduction.  Did you mention that we also support imports from Mercurial?
<jcastro> nope, I didn't know that!
<jcastro> and CVS still too I assume?
<abentley> jcastro: yes, we still support CVS.
<jcastro> someone asked about git: yes, as I said earlier the only gotcha is we don't support importing projects that use submodules
<jcastro> but the bzr team is working on fixing that
<jcastro> ok so unless there's any more questions I guess smoke if you got 'em, next class starts in about 20 minutes!
<jcastro> or not ... I was last today wasn't I?
<abentley> jcastro: Another small thing-- not only does building locally avoid contributing to the heat death of the universe, but it also helps you avoid running out of quota.
<jcastro> oh, there's a quota?
<jcastro> tell me about it, that sounds sneaky. :)
<abentley> jcastro: You have five builds per recipe per distroseries per 24 hours (yes, sliding window).
<jcastro> ah ok, so as long as I test before hand and don't spam the system with builds I should be ok?
<jcastro> ok so that's it for today, make sure to join us tomorrow
<jcastro> here's the schedule! http://people.ubuntu.com/~nhandler/classroom.html
<abentley> jcastro: yes.
<ClassBot> sinisterstuf asked: can anyone add their pc to the build farm?
<jcastro> ooh, time for one more
<jcastro> the answer is No.
<jcastro> For security reasons we don't allow untrusted machines in the build farm
<abentley> The PPA-targetting machines in the build farm are as locked-down as we can manage.  They run virtual machines and can't talk to anything on the net except the buildmaster.
<abentley> Since building packages means running arbitrary code, people who contributed their machines to the build farm would be running a grave security risk for themselves.
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2010/09/28/%23ubuntu-classroom.html
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
#ubuntu-classroom 2010-09-29
<sKuarecircle_> Hello
<serfus> sKuarecircle_, hey there, what are you looking for?
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Manage your source code history! - Version Control with Bazaar - Instructors: MSK61
<MSK61> Welcome, everybody.
<MSK61> May I know who's there by saying hi?
<MSK61> OK. Seems good. Let's tatart.
<MSK61> Start*.
<MSK61> Today's session is about source control(aka other names like revision control, version control, ...etc).
<MSK61> So what's source control? It's the ability to keep the history of how a software project evolved through different stages.
<MSK61> It maintains information about who contributed to each feature, when different releases were available, ...etc.
<MSK61> As if someone were able to take snapshots for a software project across different instants of time.
<MSK61> Historically, there were two models for version control: centralized and distributed.
<MSK61> Centralized version control works in a client-server fashion, with the server having all the meta-data for the project, while different contributors check out a working tree for the trunk(or a specific version).
<MSK61> And every time someone wants to commit, he/she must be connected to the server.
<MSK61> Distributed, on the other hand, worked on peer-to-peer like fashion.
<MSK61> Each contributor had the full source tree(with all revisions and history), and any contributor can pull from/push to other contributors.
<MSK61> Clear so far?
<MSK61> So which model does bzr follow?
<MSK61> Fine, it follows the latter model, distributed.
<MSK61> And this has the benenfit that you don't have to be connected to a server to commit; you can just commit as many versions as you can offline, and then push to another repository when you get connected.
<MSK61> OK. To start, we first need to install bzr.
<MSK61> In a terminal, type "yum install bzr".
<MSK61> Should be pretty fast.
<MSK61> We'll base our example on plain-text files, but of course it should work with any type of files.
<MSK61> Now create a directory called "myProj" for example.
<MSK61> mkdir myProj.
<MSK61> Now, cd myProj.
<MSK61> mkdir trunk.
<MSK61> To crearte a trunk branch(; it may be called anythin).
<MSK61> Now, in the terminal type echo "Thi's the first line" > hello.txt
<ClassBot> maheshmohan asked: What is a trunk?
<MSK61> A trunk is conventionally the branch which holds the development(read most recent) snapshot of the software project.
<MSK61> You can give it any name, but trunk is a famous convention.
<MSK61> Other SCM(source control management) tools might call it tip, or so,.
<MSK61> Now inside trunk when you list the files you should see hello.txt
<MSK61> OK for all?
<MSK61> So everyone is now inside trunk the trunk folder and sees hello.txt file?
<MSK61> OK. Now we've created a source file(hello.txt in our case).
<MSK61> ls -AR should produce something like this http://paste.ubuntu.com/502649/
<MSK61> Now issue the command bzr stat
<MSK61> Get out of the trunk folder.
<MSK61> Remove it with "rm -r trunk".
<MSK61> OK?
<MSK61> Now, being inside myProj, issue the command "bzr init-repo ."
<MSK61> This's needed to tell bzr to create a repository(a place where it'll maintain a project history in).
<MSK61> ls -AR should yield http://paste.ubuntu.com/502652/
<MSK61> OK?
<MSK61> I'll illustrate what the steps we did so far were for.
<MSK61> From scratch:
<MSK61> mkdir myProj => Create a directory for the bzr repository.
<MSK61> cd myProj => Enter the directory.
<MSK61> bzr init-repo . => Tell bzr to initialize the repository with metadata.
<MSK61> Clear so far?
<MSK61> Anyone missing should be OK by executing these steps from scratch.
<MSK61> Now, issue
<MSK61> mkdir trunk => conventional trunk(development) branch
<MSK61> A repository can hold several branches, for example branches for different releases, different platforms, ...etc.
<MSK61> But a repository should contain at least one branch(trunk in our case).
<MSK61> cd trunk => Enter the branch directory.
<MSK61> bzr init => Initialize the branch metadata.
<MSK61> You notice now that two different commands for metada are used, one previously for the repository, and one for each branch you create(just trunk in our case).
<MSK61> And for the branch, if you're inside the branch directory, you don't have to specify the location(like we did with . in the repo).
<MSK61> Now, create a source file.
<MSK61> echo "This's the first line." >> hello.txt
<MSK61> This command created a source file called hello.txt.
<MSK61> OK?
<MSK61> Now issue the long awaited command
<MSK61> bzr stat => Show the status of changed files in the branch.
<MSK61> You should get this http://paste.ubuntu.com/502661/
<MSK61> This means that bzr has found a strange file(a file that hasn't been added to the source control).
<MSK61> Now to add it, issue
<MSK61> bzr add => Add all unknown(new, strange) files to the source control.
<MSK61> bzr stat => This time it'll show http://paste.ubuntu.com/502663/
<MSK61> Which means bzr shows that the file has been added.
<MSK61> However, all these changes have been made into the working tree.
<MSK61> Everybody is aware of the working tree concept?
<MSK61> OK. A working tree is the copy of the source files you're locally using on your computer.
<MSK61> When you change anything there, it doesn't mean it'll be retained by bzr history management.
<MSK61> Until you tell bzr to do.
<MSK61> Clear?
<MSK61> Now we want to tell bzr to add it as a history point in the history log.
<MSK61> Issue the command:
<MSK61> bzr commit => Add the changes as a revision in the history.
<MSK61> You'll be introuduced by an editor to write a description message for what's been done in this revision.
<MSK61> Type in any message, like "first release"(without the quotes), and save and close.
<MSK61> Before, at the very first line.
<ClassBot> rooligan_ asked: before or after the "--------" line?
<MSK61> Before, at the very first line.
<MSK61> Now issue the command
<MSK61> bzr log => Brwose the history of our project.
<MSK61> http://paste.ubuntu.com/502666/
<MSK61> Everyone got that?
<MSK61> The committer would be different in your case of course.
<MSK61> Congratulations, you've just created your first release.
<MSK61> Fine, you don't have to check out because you already have all the history locally.
<MSK61> If you want to make changes, just make changes and commit again.
<MSK61> A new release, with a new description message.
<MSK61> OK. I had many other things to talk about, but there isn't really much time left.
<MSK61> So I just skim on them.
<MSK61> For pushes, you can push to a remoate or local branch with bzr push command.
<ClassBot> maheshmohan asked: How can I make my code to colloborate with other developers?
<MSK61> Basically, bzr push and bzr pull.
<MSK61> bzr push to publish your changes to another branch, bzr pull to get the recent changes from another branch to your local one.
<MSK61> Remember that you can always commit locally(as many times as you want), and then push later.
<MSK61> Now to get help about available commands, just type bzr help.
<MSK61> bzr help commands.
<MSK61> The online documentation is also very useful and detailed.
<MSK61> Other useful, widely used commands, are ls, info, remove, ignore, push, pull, annotate.
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Integrate Ubuntu One in your applications - Instructors: rodrigo
<rodrigo_> ah, hello!
<rodrigo_> shall I start?
<Pendulum> rodrigo_: it's all yours!
<rodrigo_> ok, so hi everyone
<rodrigo_> my name is Rodrigo Moya, and I work for the online services team at Canonical
<rodrigo_> working on GNOME integration of U1
<rodrigo_> I guess you all know what Ubuntu One is, but just in case, I'll do a small introduction
<rodrigo_> U1 is your personal cloud, a place where you can store your files and other data that you can sync between machines
<rodrigo_> apart from syncing your files, it has integration of syncing of other data, like Tomboy notes, Evolution contacts
<rodrigo_> as well as syncing from mobile phones
<rodrigo_> so, my talk is about a new library I wrote during Maverick cycle with 2 goals:
<rodrigo_> * first, avoid duplication of lots of code in our projects (U1-related)
<rodrigo_> * and 2nd, but most important, allow 3rd parties to integrate their apps with U1
<rodrigo_> so, a bit of background
<rodrigo_> U1 has 2 components on the desktop, a daemon that takes care of syncing your files
<rodrigo_> and a personal CouchDB server to sync notes, contacts, bookmarks, gwibber messages, etc
<rodrigo_> for the CouchDB part, we already have good APIs, like couchdb-glib, which is a C GObject-based API with introspection (so has bindings automatically for several languages)
<rodrigo_> and desktopcouch, which is a Python API, about which aquarius has already given talks at other developer weeks
<rodrigo_> for the file syncing daemon, we already had an API, but it was a DBus API
<rodrigo_> while it is great to be able to communicate with it via DBus
<rodrigo_> time has proven that 3rd parties don't want to deal with low level details of a DBus API
<rodrigo_> also, DBus needs you to take care of asynchronous calls, error reporting, data marshaling, etc
<rodrigo_> that's the code we were duplicating in our U1-related projects
<rodrigo_> so, the Nautilus plugin and the music store widget (yeah, I forgot to say U1 also has a music store!) and other parts of the system were using this DBus API
<rodrigo_> but no 3rd party, till now that I know, has made use of it
<rodrigo_> so, I started writing a library (libsyncdaemon) which is a layer on top of this DBus API
<rodrigo_> it hides all the complexity
<rodrigo_> like async calls, data marshalling, etc
<rodrigo_> and offers a GObject-based C API, with introspection for automatic generation of bindings for several languages
<rodrigo_> btw, if there are questions, feel free to interrupt me, ping me on #ubuntu-classroom-chat
<rodrigo_> so, any question so far?
<rodrigo_> ok, no questions :)
<rodrigo_> btw, alecu is giving a talk about DBus later on :)
<rodrigo_> ok, so this library, given the time constraints I had for maverick, only wraps the low level DBus API, so that's what we'll be looking at
<rodrigo_> but I already started adding high level stuff to the API, so for Natty, there should be much easier ways of doing what we'll be showing during the talk
<rodrigo_> so, what does wrapping the DBus API mean?
<rodrigo_> it means that it provides a similar API than what the DBus thuing offers
<rodrigo_> but with a few helpers
<rodrigo_> for instance, you don't have to deal with data marshalling
<rodrigo_> this is very important, since the DBus API returns a lot of data in dictionaries
<rodrigo_> to read the data in the dictionaries, you need to understand what each field means, apart from knowing the names of the fields
<rodrigo_> also, it deals with service lifecycle
<rodrigo_> it shouldn't happen, but sometimes DBus services die
<rodrigo_> there is a way in Dbus to detect that, but it's a bit lowlevel
<rodrigo_> so libsyncdaemon does it for you
<rodrigo_> so, if the dbus sertvice dies and is restarted, libsyncdaemon will keep working, you won't have to recreate the objects, connect to the signals again, etc
<rodrigo_> so, this for some background, so if there are no questions, we can go to see actual code
<rodrigo_> ok, seems no questions
<rodrigo_> so, let's see some code
<rodrigo_> I'll show the C code, and I'll try to guess the Python code equivalent to the C code
<rodrigo_> so, in C:
<rodrigo_> #include <libsyncdaemon/libsyncdaemon.h>
<rodrigo_> in Python: from gi.repository import SyncDaemon
<rodrigo_> btw, to see the actual code: bzr get lp:ubuntuone-client
<rodrigo_> or if you just want the headers/introspection stuff:
<rodrigo_> sudo apt-get install gir1.0-syncdaemon-1.0 libsyncdaemon-1.0-dev
<rodrigo_> so, the main object you want to start with is, in C, SyncdaemonDaemon (yeah, redundant :-)
<rodrigo_> in Python: SyncDaemon.Daemon()
<rodrigo_> this is the main class, and has access to all the functionalities
<rodrigo_> first, it provides some functions of its own, not very interesting:
<rodrigo_> syncdaemon_daemon_connect (or daemon.connect() in python)
<rodrigo_> syncdaemon_daemon_disconnect
<rodrigo_> syncdaemon_daemon_quit
<rodrigo_> it also deals with the startup problem in u1 syncdaemon itself
<rodrigo_> it needs to do a lot of things before he can respond to the DBus calls, so SyncdaemonDaemon object has a "ready" signal
<rodrigo_> which signals apps when they can start calling it
<rodrigo_> so, for instance, you would do in your app:
<rodrigo_> daemon = syncdaemon_daemon_new ();
<rodrigo_> g_signal_connect (daemon, "ready", daemon_is_ready_cb, my_data);
<rodrigo_> and when your callback is called, you can start doing whatever you want with syncdaemon
<rodrigo_> SyncdaemonDaemon also has a lot of signals for notifying the app about status changes, transfers, etc
<rodrigo_> so, this is the main object
<rodrigo_> and since it wraps the dbus API completely, it provides access to the different interfaces implemented by syncdaemon (the dbus service)
<rodrigo_> there are 6 of them, but only a few of them are of interest to us
<rodrigo_> there is the config interface, which allows you to check/change the configuration of syncdaemon
<rodrigo_> like how much bandwidth to use, etc
<rodrigo_> this is not very interesting to apps, so I'll skip it
<rodrigo_> ditto for the events interface, it provides notifications of different low level events, so, since we have some high-level ones, I'll skip this one also
<rodrigo_> the next one is the filesystem interface
<rodrigo_> you can get a handle to it with:
<rodrigo_> interface = syncdaemon_daemon_get_filesystem_interface (daemon) <- C
<rodrigo_> interface = daemon.get_filesystem_interface () <- python
<rodrigo_> this interface allows you to retrieve metadata for a given file or folder
<rodrigo_> to get information like whether the file is synced or not, for instance
<rodrigo_> metadata = syncdaemon_filesystem_interface_get_metadata (interface, path, TRUE or FALSE)
<rodrigo_> this returns a SyncdaemonMetadata object, which contains that information I was talking about
<rodrigo_> the next interface is a bit more interesting, so if you're not asleep yet, please listen :)
<rodrigo_> this next interface is the folders interface, which allows you to synchronize any folder on your $HOME with Ubuntu On
<rodrigo_> that's interesting, because a photo app, for instance, could easily provide a way for synchronizing a photo album to your personal cloud
<rodrigo_> (that's the kind of 3rd parties we are looking for, as an example)
<rodrigo_> this interface, like all others, is retrieved with:
<rodrigo_> interface = syncdaemon_daemon_get_folders_interface (daemon);
<rodrigo_> with this interface, you can retrieve the list of folders set up for syncing already:
<rodrigo_> GSList                     *syncdaemon_folders_interface_get_folders (SyncdaemonFoldersInterface *interface);
<rodrigo_> or add new folders (your photo album):
<rodrigo_> void                        syncdaemon_folders_interface_create (SyncdaemonFoldersInterface *interface, const gchar *path);
<rodrigo_> or delete folders you don't want to be synced anymore:
<rodrigo_> void                        syncdaemon_folders_interface_delete (SyncdaemonFoldersInterface *interface, const gchar *folder_id);
<rodrigo_> you can also do things that are not available in the current GUI for maverick
<rodrigo_> like subscribing/unsubscribing a folder
<rodrigo_> unsubscribing means that you don't want a specific folder to be copied to this machine
<rodrigo_> imagine a netbook with very little disk space, you might not want to sync your huge music collection to it
<rodrigo_> now, to the most interesting one, since it allows to do a lot of nice things
<rodrigo_> there is the notion of public files, whcih are files that you publish via U1 and that everyone can see, no matter if they have an U1 account or not
<rodrigo_> this is very nice for, "I'll take a screenshot and show you' kind of things
<rodrigo_> this is, again, retrived with:
<rodrigo_> interface = syncdaemon_daemon_get_publicfiles_interface (daemon);
<rodrigo_> and has a simple call that does everything:
<rodrigo_> void                            syncdaemon_publicfiles_interface_change_public_access (SyncdaemonPublicfilesInterface *interface,
<rodrigo_>        const gchar *share_id,
<rodrigo_>        const gchar *node_id,
<rodrigo_>        gboolean is_public);
<rodrigo_> as you can see, it is low level, since it includes stuff you shouldn't be dealing with
<rodrigo_> I tried to add a simple publish_file API, where you pass a path only, but it's not as easy as that
<rodrigo_> first, publishing a file only works on folders that are setup to be synced to U1
<rodrigo_> but I plan to add it to the high level API
<rodrigo_> so, in a screenshot app, for instance, you could add a button that said 'Publish in U1'
<rodrigo_> and just call that imaginary high level API (syncdaemon_daemon_publish_file) and the file will be published at a given url
<rodrigo_> something like http://one.ubuntu.com/p/Df3dr
<rodrigo_> a lot of examples about this raise, like publishing photos from the photo app
<rodrigo_> and I'm sure you can find a lot
<rodrigo_> the last interface we're going to see is the shares ones, which allows you to share a folder already in U1 with someone else
<rodrigo_> as well as deal with shares offered by other users to you
<rodrigo_> void                       syncdaemon_shares_interface_accept (SyncdaemonSharesInterface *interface, const gchar *share_id);
<rodrigo_> void                       syncdaemon_shares_interface_reject (SyncdaemonSharesInterface *interface, const gchar *share_id);
<rodrigo_> these 2 are for accepting or rejecting shares by other users
<rodrigo_> void                       syncdaemon_shares_interface_create (SyncdaemonSharesInterface *interface,
<rodrigo_>                                                                const gchar *path,
<rodrigo_>                                                                GSList *usernames,
<rodrigo_>                                                                const gchar *name,
<rodrigo_>                                                                gboolean allow_modifications);
<rodrigo_> void                       syncdaemon_shares_interface_delete (SyncdaemonSharesInterface *interface, const gchar *share_id);
<rodrigo_> and these 2 for sharing with someone or deleting a share
<rodrigo_> to finish, I'll talk a little bit about libubuntuone, which was supposed to be a widget library for easy use of U1 features in GTK apps
<rodrigo_> there was a contacts picker (the one you see when you click on Ubuntu One->Share in Nautilus
<rodrigo_> and a music store widget
<rodrigo_> thanks to that music store widget, banshee plugin for the U1 music store was written by directhex in a few days
<rodrigo_> so, I think that's all, I'll leave the rest for questions, if there are any
<rodrigo_> hmm, no questions, is anyone listening :)
<rodrigo_> ah, a question:
<rodrigo_> <zinga49> QUESTION: so this will be available in maverick then?
<rodrigo_> zinga49, yes, it already is
<rodrigo_> what is not available in maverick is a better high level API, but it should probablt be (or part of it) for natty
<rodrigo_>  QUESTION: and to use it in pyhton i install the above 2 modules?
<rodrigo_> well, for only python, you don't need the -dev package, so gir1.0-syncdaemon-1.0 should be enough
<rodrigo_> rye (in #ubuntuone) had some code using the automatic Python bindings, so ask him for an example
<rodrigo_> so, with this, it should be easy to provide high level stuff integrating with U1
<rodrigo_> I already mentioned some simple examples, but I'm sure you can find lots of apps in Ubuntu that would make sense to have something like that
<rodrigo_> like publishing files, etc
<rodrigo_> f-spot, gnome-screenshot, etc
<rodrigo_> ok, so no more questions?
<rodrigo_> <ara> QUESTION: rodrigo_, is the client code in maverick already using your library?
<rodrigo_> ara, the C parts of it are, like nautilus plugin, tomboy (using a part of the API I didn't mention, which is for registering a user with U1) and the music store widget
<rodrigo_> the rest of the client code in maverick is either the daemon itself, which doesn't need this api
<rodrigo_> and u1-prefs, which doesn't use the DBus service
<rodrigo_> <ara> QUESTION: rodrigo_: so, no Python example code yet ;-)
<rodrigo_> ara, yes, ask rye in #ubuntuone, he wrote an app to automatically publish files, I think
<rodrigo_> also, worthy to say that this has been added in maverick, so the only place that I changed to use it was the nautilus plugin
<rodrigo_> which had a lots of complicated code to deal with the DBus stuff
<rodrigo_> and the music store widget, which only needed a couple of calls (mainly for tracking transfers)
<rodrigo_> so, the already existing code wasn't changed, but I would do asap if I had time :-)
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Hacking on 'testdrive' - Instructors: andreserl
<rodrigo_> ok, I think we're out of time
<RoAkSoAx> Alright :)
<RoAkSoAx> Hi everybody! Welcome to the Hacking on TestDrive Session.
<RoAkSoAx> My Name is Andres Rodriguez and I'm a community member. My areas of contribution are MOTU, the Server Team, and the Cluster Stack! (And now application
<RoAkSoAx> programming :))
<RoAkSoAx> I want to know who's here for the session so that I can begin
<RoAkSoAx> Ok, let's get started then
<RoAkSoAx> Unfortunately, due to some unexpected situations (Fumigation at my place, and Ubuntu won't connect to Wireless-N Router where I'm at), I won't be able to do
<RoAkSoAx> all I wanted to do today. Anyways, today's session is going to be:
<RoAkSoAx> 1. Introduction
<RoAkSoAx> 2. My Experience
<RoAkSoAx> 3. How to Contribute
<RoAkSoAx> 4. Questions
<RoAkSoAx> NOTE: I'll reply any of your questions at the end of the session.
<RoAkSoAx> Just before I begin, please install "quickly" given that it may take some time.
<RoAkSoAx> sudo apt-get install quickly
<RoAkSoAx> let me know when you have quickly installing
<RoAkSoAx> rooligan_: Ok, for those who don't know what quickly is. Quickly is a tool that allows the creation of Ubuntu Apps easily you can read more about it here: https://wiki.ubuntu.com/Quickly
<RoAkSoAx> == Introduction ==
<RoAkSoAx> TestDrive is a tool that was originally developed by Dustin Kirkland to test Ubuntu ISO images. He presented the tool at the Ubuntu Developer Summit in
<RoAkSoAx> Dallas last year. Back then, the tool was a shell script. Then, he decided to change it to a single file python script. Nowadays, and with the creation of
<RoAkSoAx> TestDrive PyGTK, it is a collection of classes/modules. It is not perfect, but it works.
<RoAkSoAx> Btw, I'm glad to say that TestDrive PyGTK was my GSoC2010 project for Ubuntu, and my first real experience with python and GTK.
<RoAkSoAx> , though I started working on
<RoAkSoAx> it way before the GSoC.
<RoAkSoAx> now, how many of you here have used or currently use TestDrive?
<RoAkSoAx> ok well, now we all know what TestDrive is: And App to test Ubuntu ISO images, but it is not limited to Ubuntu specific only
<RoAkSoAx> given that we can test other ISO's that are in our harddrive, or even in any other repository
<RoAkSoAx> So anywa,s I'd like now to tell you in a short summary my experience coding it :)
<RoAkSoAx> == My Experience with App Development for/in Ubuntu ==
<RoAkSoAx> First of all, I'd like to say that my experience developing TestDrive for Ubuntu was really fun and satisfactory.
<RoAkSoAx> And well it all started when I grabbed the TestDrive python script. The objectives were:
<RoAkSoAx> 1. Modify TestDrive in such a way that it would be easy to attach different fron-ends.
<RoAkSoAx> 2. Add the PyGTK Front-end.
<RoAkSoAx> The first, so called modularization, was to separate the python script's UI code with the "back-end's" code. This would be what we all call MVC. By
<RoAkSoAx> separating this code, I was making sure that I could re-use most of it when Implementing the Front-end.
<RoAkSoAx> Modularization, step 1: So, a class TestDrive was created to handle all the "back-end" work of testdrive, having an UI that just instances an object of the
<RoAkSoAx> class, and access this class' methods to do most of the work. At this point, I had separated TestDrive code in two, a binary (testdrive) and a module
<RoAkSoAx> (testdrive.py).
<RoAkSoAx> Modularization, step 2: Now, given that we use different virtualization methods and that it would be nice to add new ones, we also decided to separate the
<RoAkSoAx> virt method from the testdrive module. For this, we created three virt modules (kvm.py, vbox.py, parallels.py). These modules, do all the configuration
<RoAkSoAx> necessary to run an ISO in the VM, and return a command ready to launch the VM.
<RoAkSoAx> So, so far, we are learning that TestDrive test's ISO by running them in a VM, either using KVM, VirtualBox or Parallellels
<RoAkSoAx> the preferred method is, of course, KVM
<RoAkSoAx> So, what about the PyGTK. Well, after the first step of the modularization, I started working on the Front-end. before starting with it, I figured that it
<RoAkSoAx> would be a good idea to use quickly to create the front-end, and so I did. Quickly is such an amazing tool!! Anyways, I started the front-end with a single
<RoAkSoAx> list of ISOs, then turned into separated categories of ISO's, and so on.
<RoAkSoAx> Now, up to this point, we not only had a command line tool to test ISO, but a simple PyGTK tool with the same purpose
<RoAkSoAx> I faced one problem though! Which was being able to Sync and Run Multiple ISO/VM's at the same time. For that I implemented python threading for Syncing
<RoAkSoAx> ISO's, and that's when I also decided to go for the modularization of Virt Methods, to provide better threading support.
<RoAkSoAx> After this, I also implemented the posibility to add Other ISO's not in the Ubuntu repository. Of course, along all this I worked on other stuff such as
<RoAkSoAx> implementeing the preferences, improving the UI, improving the preferences methods and changed the configuration to configparser, logging capabilities, bug
<RoAkSoAx> fixing, etc etc.
<RoAkSoAx> so, TestDrive PyGTK ended up being a cool tool where I could launch multiple ISO in a VM, or sync them. I also have the possiblity to change preference
<RoAkSoAx> such as how much disk size per VM image, how much RAM to assign, How many CPUs, at all sort of that stuff
<RoAkSoAx> SO, to do all this I pretty much had to learn python and GTK from scratch; and in only three months I learned a lot!! and it was Super FUN. A cool tool that helped me in the process was Acire!!
<RoAkSoAx> I'm sure that all of you know what Acire is, if not... it is a toold that puts together lots of python snippets that can help any developer by showing them how to implement these snippets
<RoAkSoAx> So yes, this a kinda confusing sum up of how TestDrive PyGTK came to live... anyone has any questions so far?
<RoAkSoAx> Ok then
<RoAkSoAx> OK so now, you might wonder... how can I contribute ??
<RoAkSoAx> Well, there are many ways to contribute with TestDrive... In fact, couple people already contributed, and471_ is one, am I correct :)
<RoAkSoAx> anyways, to code testdrive I created a Blueprint to track all what was necessary. We had a session at UDS-M in Belgium where we talked about what were the features that ppl wanted to see in teh PyGTK
<RoAkSoAx> most of these features are detailed in:
<RoAkSoAx> https://blueprints.launchpad.net/ubuntu/+spec/desktop-maverick-testdrive-frontend-gsoc
<RoAkSoAx> If you can see in the section "Work items for ubuntu-later:"
<RoAkSoAx> all those work items are to be done
<RoAkSoAx> most of them is adding simple features or improvements
<RoAkSoAx> However, contributions are not only limited to do that
<RoAkSoAx> There're some other things to be done such as
<RoAkSoAx>  - Maintainance and improvements of other Virtualization Methods (VBox and Parallels) - Add new Virtualization Methods (Such as VMWare) - Various other improvements - PyQT4 Front-end
<RoAkSoAx> As I mentioned earlier, TestDrive can either work with KVM, Vbox and Parallels, being KVM the preferred method
<RoAkSoAx> but, I'm not a VBox user and there are lots of VBox users out there
<RoAkSoAx> that use TestDrive with VBox, but since I'm not a user
<RoAkSoAx> I can't always maintain the VBox (or Parallels code) as I can with KVM
<RoAkSoAx> so, we are always looking for people to work on VBox or Parallels, or even, to implement other virtualizations, such as VMWare
<RoAkSoAx> We actually have a bug report asking us to do that, but we (Dustin and me), prefer having someone contribute on that part
<RoAkSoAx> so if you are really interes in crontributed on that,and use VBox, Parallels, or VMWare... jsut ping me sometime
<RoAkSoAx> and you can get started :)
<RoAkSoAx> Now, one things that would be cool too is to have a PyQT4 front-end for Kubuntu
<RoAkSoAx> that would be great front-end to have for those users
<RoAkSoAx> so, there's another place where people who works with PyQT can contribute
<RoAkSoAx> and well, I'll guide you through the development if you wish
<RoAkSoAx> anywas, we also need testers to test and report bugs agains testdrive
<RoAkSoAx> to report any bugs that I might have missed
<RoAkSoAx> I know there are a few, which I'm already planing to address
<RoAkSoAx> but if someone wants to chip in
<RoAkSoAx> you are more than welcom :)
<RoAkSoAx> most of these are mainly improvements to the current code
<RoAkSoAx> however, if you have more ideas that you think might be interesting to have in TestDrive, please bring them on
<RoAkSoAx> well now we;ve been over a few things that it's needed to be done
<RoAkSoAx> but, if you'd like to contribute, how can you get started???
<RoAkSoAx> it is easy!!
<RoAkSoAx> I'll give you a guided tour through the code :)
<RoAkSoAx> first step is to get the source
<RoAkSoAx> so place yourself in whatever folder you like from your terminal
<RoAkSoAx> and get the latest branch:
<RoAkSoAx> bzr branch lp:testdrive
<RoAkSoAx> and then enter the created folder
<RoAkSoAx> cd testdrive
<RoAkSoAx> rooligan_: :)
<RoAkSoAx> anywas, do you all now have the branch?
<RoAkSoAx> ok while you get it, I'll continue with teh explanation
<RoAkSoAx> when I created the PyGTK with quickly, I did it as a separate project
<RoAkSoAx> and then I had to merge it altogether
<RoAkSoAx> the meging was quite easy
<RoAkSoAx> it was just a correct organization
<RoAkSoAx> of the code in the source directory
<RoAkSoAx> once that was done, everything is done quickly
<RoAkSoAx> :)
<RoAkSoAx> the code is somehow divided like this:
<RoAkSoAx> bin -> contains testdrive-gtk and testdrive binaries
<RoAkSoAx> testdrive -> contains the testdrive.py, and virt modules
<RoAkSoAx> testdrivegtk -> contains all the classes related to the gtk
<RoAkSoAx> data -> contains two directories, media and ui
<RoAkSoAx> media contains all the iamges
<RoAkSoAx> and ui contains the .glade and .xml files for the UI
<RoAkSoAx> so, how can I start working on them
<RoAkSoAx> it is really simple
<RoAkSoAx> first of all
<RoAkSoAx> lets set up our python path
<RoAkSoAx> we are placed somewhere here: '/home/<user>/<whatever>/testdrive'
<RoAkSoAx> so we will set it up like: export PYTHONPATH=/home/<user>/<whatever>/testdrive
<RoAkSoAx> or export PYTHONPATH=`pwd`
<RoAkSoAx> once that is done
<RoAkSoAx> do this "quickly run"
<RoAkSoAx> that should launch testdrive
<RoAkSoAx> does it? :)
<RoAkSoAx> ok so by doing quickly run from the source directory of testdrive's branch
<RoAkSoAx> it launched testdrive
<RoAkSoAx> how quick and easy is that
<RoAkSoAx> now, what if we wanna launch the command line app?
<RoAkSoAx> that';s more complicated: python bin/testdrive
<RoAkSoAx> but easy as well
<RoAkSoAx> so ok, now I want to do changes
<RoAkSoAx> lets do "quickly edit"
<RoAkSoAx> what this will do is open all related testdrive files in your default editor
<RoAkSoAx> should be gedit
<RoAkSoAx> but now, I want to do changes to the UI specifcally
<RoAkSoAx> well... "quickly design"
<RoAkSoAx> rooligan_: that means it does not support kvm... so probaly you'll need to isntall virtualbox
<RoAkSoAx> so well, I used 3 simple quickly commands
<RoAkSoAx> to get started
<RoAkSoAx> now, if I make any changes to any of the files
<RoAkSoAx> or UI
<RoAkSoAx> I simply do "quickly run" again to see the changes
<RoAkSoAx> but how can I see the diff
<RoAkSoAx> the way I do it is: bzr diff
<RoAkSoAx> or bzr status to see which files where modified
<RoAkSoAx> unfortunately I was planning to go a little bit more over this, but as per unexpected events I'm sshing into my VPS from a Windows  machine
<RoAkSoAx> anywas, it ios really simple to start hacking on testdrive
<RoAkSoAx> now you have the code layout
<RoAkSoAx> how to start running it
<RoAkSoAx> how to open all editable files
<RoAkSoAx> how to open the UI
<RoAkSoAx> in an easy way
<RoAkSoAx> all using quickly
<RoAkSoAx> how fun is that?? :)
<RoAkSoAx> Now, to finalize
<RoAkSoAx> == Questions ==
<RoAkSoAx> Anyone?
<RoAkSoAx> zinga49: shoot
<RoAkSoAx> zinga49: when I say "synced" I mean, obtain the Ubuntu ISO image from a given repository. For example, by default when ever I sync an ISO Image it will obtain, or download it from http://cdimage.ubuntu.com
<RoAkSoAx> and that's what the "Sync" button means at the main UI
<RoAkSoAx> In other words, download the ISO Image from the repository
<RoAkSoAx> zinga49: If it is already downloaded, it will update it, if there were any changes
<RoAkSoAx> off course, this is something that we have to decide to do
<RoAkSoAx> for example, in testdrive command line, what was done, was to synchronize (or download the changes) every time we were about to run an ISO
<RoAkSoAx> but it came to the point "What if I want to run yesterday's ISO and not Today's ISO"
<RoAkSoAx> so in the Front-end, we have the option to Sync, or to launch
<RoAkSoAx> Sync will obtain the latest ISO from the repo , which by default is the daily Ubuntu ISO (cdimage.ubuntu.com)
<RoAkSoAx> Anymore questions?
<RoAkSoAx> zinga49: not really. It is just peronal preference. In fact, quicly AFAIK defaults to gedit but if you set export EDITOR=vim, it should use vum as the editor
<RoAkSoAx> and so on
<RoAkSoAx> zinga49: and I do code using a combination of vim/gedit depending on how I feel like that day :)
<RoAkSoAx> ok then we have 3 more minutes
<RoAkSoAx> any other question?
<RoAkSoAx> Ok I guess not. thank you all :) Enjoy the App Dev Week, and ping me if you awnt to get involved with TestDrive
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Take control of your desktop with DBus - Instructors: alecu
<alecu> hello all
<alecu> my name is alecu, but some people know me as Alejandro J. Cura as well
<alecu> I'm a Canonical developer working on Ubuntu One
<alecu> and also a Python Argentina member
<alecu> today I'll be giving some tips on how to get started using DBus
<alecu> DBus is a way so programs can talk to programs
<alecu> it's composed of a daemon and many program speaking to that daemon
<alecu> and the daemon will route what one program is saying to some other programs that want to listen to that
<alecu> this way all the apps that make up your desktop can talk to each other, independently of the language they are coded on,
<alecu> and no matter if they are kde apps or gnome apps or system daemons.
<alecu> so, regarding what apps use dbus...
<alecu>  just a few I've been looking at:
<alecu>  upstart, gnome-display-manager, telepathy, networkmanager, pulseaudio, vlc
<alecu>  there are lots!
<alecu>  so, you can use dbus to export services that your app provides
<alecu>  and you can use dbus to use those services from other apps or scripts.
<alecu> d-feet is a great way to learn about dbus
<alecu>  let's all install it:
<alecu>  sudo apt-get install d-feet
<alecu>  and meanwhile you can all tell me what is your main development language.
<alecu> d-feet is a great way to learn about dbus
<alecu>   let's all install it:
<alecu>   sudo apt-get install d-feet
<alecu>   and meanwhile you can all tell me what is your main development language.
<alecu> so, let's open d-feet
<alecu>  go to file->connect to Session bus
<alecu>  on the right hand you'll see a lot of Bus Names
<alecu>  sorry
<alecu>  left hand
<alecu>  clicking on one of the bus names you'll see the paths exported by the objects on that bus
<alecu>  (I know I'm talking on the wrong channel, but I'm getting disconnected very often, and the nick registered on the main channel is only one)
<alecu>  each object may implement several interfaces
<alecu>  in the interfaces you'll find methods and signals
<alecu>  those are the bits that make up dbus:
<alecu>  Buses -> object paths -> interfaces -> [methods, signals, properties]
<alecu>  does it make sense?
<alecu>  let's try playing with some interface
<alecu>  so... make sure you have vlc installed, and fire it up
<alecu> In vlc the dbus control interface has to be manually activated from tools->preferences->show settings:All->Interface->control interface->D-Bus control interface
<alecu> (most other apps already have dbus plugged in, but vlc makes for a nicer experiment)
<alecu>  so, after restarting vlc (just close it and open it again), go to dfeet
<alecu>  bus: org.mpris.vlc -> path: /TrackList -> Interfaces -> org.freedesktop.MediaPlayer -> Methods -> AddTrack
<alecu>  so, double click on "AddTrack" in dfeet
<alecu>  and put: "http://upload.wikimedia.org/wikipedia/commons/7/79/Big_Buck_Bunny_small.ogv", True
<alecu>  in parameters
<alecu>  and click on "Execute"
<alecu>  it should start playing
<alecu>  then let's close that dialog
<alecu>  and go to the object path /Player
<alecu>  on the org.freedesktop.MediaPlayer interface we'll find
<alecu>  Pause
<alecu>  Play
<alecu>  PositionGet
<alecu>  PositionSet
<alecu>  let's play a bit with those
<alecu> well, this is what dbus is used for.
<alecu>  to let very different programs, coded in different languages, even belonging to different desktop environments talk to each other.
<alecu> (sorry, catching up with the logs)
<alecu> so...
<alecu> the common use case for dbus is to have two instances of the dbus daemon running
<alecu> one instance is the system bus: used for daemons that run as root or having to do privileged operations
<alecu> the other is the session bus, (well, one is started per logged in user)
<alecu> the apps that run as your unix user are all using that session bus
<alecu> (you can start up other daemon instances in order to run functional tests and so on)
<alecu> let's get back to the dbus parts
<alecu> we already said we have a bus, with a bus name
<alecu> and we have objects exported thru some object path
<alecu> and those objects implement some interfaces
<alecu> most of this is just for having some order
<alecu> there's nowhere set in stone how this should be partitioned. And you don't need to register anywhere in order to ask for a name to use here (unlike dnss or some other ipc systems)
<alecu> you just pick a few names, and you are ready to go.
<alecu> But it really makes sense to write some spec so other apps can easily use your services.
<alecu> For instance, for the vlc demo we were doing we were using the services in this spec: http://xmms2.org/wiki/MPRIS
<alecu> a few media playing apps developers wrote that spec so different remote control programs can control different media playing programs.
<alecu> any questions?
<ClassBot> MAfifi asked: Do all players provide such a specification?
<alecu> MAfifi, many players are moving to it. I'm not sure if all will
<alecu> MAfifi, anyway, not all dbus services are specced at all.
<alecu> MAfifi, I try to make a spec for the services I write, for instance the ubuntu-sso-client dbus service... let me fetch the link
<alecu> https://wiki.ubuntu.com/SingleSignOn/UbuntuSsoClient
<alecu> let's branch some sample code...
<alecu> bzr branch lp:~alecu/+junk/dbus-lessons
<alecu> in the first example, 01-call_method.py we'll see how we connect to a bus, and call a method on that bus
<alecu> I'm using the /org/gnome/PowerManager/Backlight dbus object, that exports a way to set the display brightness
<alecu> I know it works on my lenovo laptop, and I know it won't work on my old compaq one, so if it does not work for you, try adapting it to control vlc
<alecu> in this sample I'm using the dbus integration with the gtk main loop (the lower level gobject main loop in fact)
<alecu> dbus has integration with qt as well, and with twisted, and probably some other frameworks too.
<ClassBot> papibe asked: how do I see the sample code?
<alecu> papibe, try running this in a terminal:
<alecu>  bzr branch lp:~alecu/+junk/dbus-lessons
<alecu> papibe, it will fetch the sample code from its bazaar repository on launchpad
<alecu> so, the code gets at a bus, looks up an object in that bus given the object path
<alecu> and gets an interface implemented by that object
<alecu> then it starts calling the SetBrightness method in that interface
<alecu> and that's how you call a method provided by some other app.
<alecu> now, it may be the case that the app wants to tell you something
<alecu> for instance, a media player app may want to tell you that it has finished playing a file
<alecu> or perhaps you are listening on the bus for an instant messaging app and want to know when a message arrives...
<alecu> for this DBus provides Signals
<alecu> Signals are specified by the app providing a service, and are fired in response to some action happening in the app.
<alecu> your program or script may listen to some those signals.
<alecu> we can see that in the 02-listen_signal.py script
<alecu> in the line: iface.connect_to_signal("BrightnessChanged", brightness_changed_callback)
<alecu> we are hooking a function to a signal
<alecu> if I run that sample, I see the signal being fired when I change the brightness using my keyboard
<alecu> and finally, on 03-export_object.py we can see a sample of exporting a method and a signal on the bus
<alecu> we didn't got around to explaining Data Types on Dbus, but if this all was interesting, you may continue here: http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html
<ClassBot> MAfifi asked: How may I make my program emit a signal?
<alecu> MAfifi, great question
<alecu> MAfifi, your program can only emit signals that it implements itself
<alecu> MAfifi, it cannot fire signals implemented by other modules
<alecu> MAfifi, the way to fire the signals, is to just call the method where they are defined
<alecu> MAfifi, in the python dbus, a signal is emmited if the method decorated with @signal returns properly (ie, it does not fire an exception)
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
<alecu> MAfifi, thought the python method may be blank, in which case it will just work.
<alecu> I hope you liked this session, thanks all for attending.
<jcastro> thanks alecu!
<alecu> my mail is alecu@canonical.com or alecu@protocultura.net
<alecu> in case you have some other Q
<alecu> bye!
<jcastro> ok so we have a last minute change, due to Seif having to reschedule his class. So the session on Zeitgeist will be moved to tomorrow
<jcastro> please see the /topic for the session
<jcastro> so since this was kind of last minute, we're going to take a break
<jcastro> HOWEVER
<seiflotfy> jcastro, I can answer general zeitgeist questions
<jcastro> Jono is doing open Ubuntu Q+A if you want to participate there for this hour: http://www.ustream.tv/channel/at-home-with-jono-bacon
<jcastro> seiflotfy: sure!
<seiflotfy> jcastro, do i have the mic
<seiflotfy> ?
<jcastro> it's all yours
<seiflotfy> ok
<seiflotfy> so guys i will be doing a real tutorial tomorrow
<seiflotfy> today i will just fill the gap by explaining zeitgeist
<seiflotfy> and answering questions
<seiflotfy> so let me start
<seiflotfy> My name is Seif Lotfy
<seiflotfy> I am a GNOME member, and mostly known for being the initiator of the zeitgeist project
<seiflotfy> I am one of the lead developers and maintainers
<seiflotfy> we are 4 maintainers
<seiflotfy> Markus Korn (thekorn) is responsible for the QA
<seiflotfy> Mikkel Kamstrup (kamstrup) is the guy behind the architecture
<seiflotfy> and Siegfried Gevatter (RainCT) mostly DB work
<seiflotfy> however we all work on all aspects of zeitgeist
<seiflotfy> its just that these are the areas in which each developer proved himself very capable
<seiflotfy> so what is zeitgeist?
<seiflotfy> does any1 care to explain?
<seiflotfy> Zeitgeist is a service which logs the users's activities and events, anywhere from files opened to websites visited and conversations.
<seiflotfy> It makes this information readily available for other applications to use.
<seiflotfy> It is able to establish relationships between items based on similarity and usage patterns.
<seiflotfy> so its ur personal spyware :P
<seiflotfy> it is now part of unit
<seiflotfy> *unity
<seiflotfy> you can think of it as the gtk.RecentlyUsed
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Zeitgeist Q &amp\; A - Instructors: seiflotfy
<seiflotfy> but on steroids
<seiflotfy> so who has a question ?
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Zeitgeist Q and A - Instructors: seiflotfy
<seiflotfy> !q
<seiflotfy> ClassBot !q
<seiflotfy> how do i work the classbot
<seiflotfy> ?
<seiflotfy> ok got it
<seiflotfy> hmmm this class seems empty
<seiflotfy> sorry guys but the real talk is tomorrow
<seiflotfy> i will show you how to extend your applications to make use of zeitgeist
<ClassBot> titeuf_87 asked: How is privacy/security handled: will all apps be allowed to access everything by default? Or do you first have to allow them to?
<seiflotfy> titeuf_87, its a globael history
<seiflotfy> titeuf_87, zeitgeist allows applications to push data into it
<seiflotfy> once its in zeitgeist its available for everyone
<seiflotfy> so zeitgeist doesnt really look at what the applications are doing
<seiflotfy> but rather lets applications store their history into zeitgeist using a specific template
<seiflotfy> we also support blacklisting
<seiflotfy> so applications can tell zeitgeist "never log uri's with porn"
<seiflotfy> as well as registrations such as "Only totem is allowed to push events for media files"
<ClassBot> meebey asked: why did we have to wait for this amazing project to show up after all those years and what brought this project to life?
<seiflotfy> meebey, first thanks for the compliments
<seiflotfy> well there are many aspects to how it started
<seiflotfy> i used to work for an institute in germany that wrote similar software
<seiflotfy> and i also worked on Gimmie which sorted things based on time using gtk.RecentlyUsed
<seiflotfy> then Federico Mena came up with an Idea to write a Journal for GNOME
<seiflotfy> so i took the initiative to develop it
<seiflotfy> basically in my bedroom
<seiflotfy> then during the course of time aantn and RainCT started hacking
<seiflotfy> shortly afterwards thekorn and kamstrup started hacking on it too
<seiflotfy> and its from there where I personally consider zeitgeist being born (everything before that was just a working prototype)
<ClassBot> sinisterstuf asked: Is it obvious if a program is able to use zeitgeist or not without reading the source?
<seiflotfy> i dont get the question sinisterstuf
<ClassBot> zinga49 asked: do i get this right: a popular app (e.g. a game) could spy sensible data like browser history of thousands of users though?
<seiflotfy> zinga49, uhm yes but its possible over the firefox history too :)
<seiflotfy> zinga49, we actually have a an old sample code where we hooked into the firefox DB and sent everything to zeitgeist
<ClassBot> sinisterstuf asked: Well maybe I don't quite get it, what I mean is, if any program can read zeitgeist's journal of activities and stuff and do things with it, is there a way for the average user to know if a program is able to do that or not?
<seiflotfy> sinisterstuf, well the idea is to have zeitgeist integrated into the apps without popping out (ZEITGEIST IS LOGGING)
<seiflotfy> sinisterstuf, what we are adding is a zeitgeist-manager UI where u can see which applications are pushing information into Zeitgeist etc...
<seiflotfy> sinisterstuf, you can use GNOME Activity Journal to figure out what is being logged
<ClassBot> meebey asked: does zeitgeist have some kind of protocol / log that could be checked in order to find out which application has added or fetched information from/to zeitgeist?
<seiflotfy> meebey, well the log tells you who added info to zeitgeist (its usually the actor in our DB tables)
<ClassBot> sinisterstuf asked: I see. Do you aim to have zeitgeist integrated into EVERYTHING?
<seiflotfy> sinisterstuf, well its opensource
<seiflotfy> so 1) its transparent
<seiflotfy> 2) yes we would like to but its always an option to disallow applications from pushing info into zeitgeist
<seiflotfy> RainCT, can u write up a quick template that is sent to our blacklist manager to stop logging firefox history
<seiflotfy> this way we can show it to sinisterstuf
<ClassBot> meebey asked: well, say I want to debug or audit my application with zeitgeist, is there some log file that could be consulted to find out whats going on, besides the general information zeitgeist provides by it's database?
<seiflotfy> meebey, the more info you push into zeitgeist from you application the more u can use it for auditing
<seiflotfy> but i wouldnt recommend doing so
<ClassBot> zinga49 asked: will the blacklisting be possible for the user from a central place? so that the user has really control over every program. not just only if the program itself decides to let the user choose...
<seiflotfy> zinga49, yes its possible
<seiflotfy> we already support this over the engine
<seiflotfy> we just need a UI for it
<seiflotfy> but AFAIK m4n1sh (one of our new hackers) is working on the new blacklist stuff
<seiflotfy> and shortly after we will have a central UI to stop applications from logging
<seiflotfy> as well as stop zeitgeist completely from logging anything
<ClassBot> sinisterstuf asked: is there a zeitgeist 'journal' for each user or is it all lumped together in a common place?
<seiflotfy> sinisterstuf, per user
<seiflotfy> :)
<seiflotfy> if u want a log of several users you will need something called teamgeist (but this is a different story)
<seiflotfy> sinisterstuf, an example on how to make zeitgeist stop logging firefox is written here
<seiflotfy> http://paste.ubuntu.com/502775/
<seiflotfy> any other questions?
<ClassBot> sinisterstuf asked: could admin use this to check what people use their computers for the most to see what type of people use what apps and how much and to do what with? that way he would know what to focus on, which things are not as important what other apps he might want to installÃ¢ÂÂ¦ eg. for an internet cafe, library, or any company. (is that ethical, if the users don't knowÃ¢ÂÂ½)
<seiflotfy> sinisterstuf, its not ethical but on the other hand it does make people's life much easier
<seiflotfy> sinisterstuf, yes admins could do that
<seiflotfy> but hey
<seiflotfy> admins at your company can also read your mails
<seiflotfy> a quote from spiderman:
<seiflotfy>  Uncle Ben: Remember, with great power. comes great responsibility
<seiflotfy> so sinisterstuf you better hope your admin is a good guy
<ClassBot> nzmm asked: I have heard of teamgeist where does this fit in?
<seiflotfy> nzmm, teamgeist was an idea we had before guadec 2009
<seiflotfy> the guys from collabora helped us out make it possible
<seiflotfy> what it does is really simple
<seiflotfy> its a service that uses zeitgeist
<seiflotfy> and telepathy
<seiflotfy> and ALLOWS you to decide what "events" you want to share with whom
<seiflotfy> so lets say me and thekorn want to plan a trip
<seiflotfy> we decide to share "all events from firefox with the words BRAZIL or SPAIN"
<seiflotfy> and then anything i do on firefox with BRAZIL or SPAIN is shared wit him
<seiflotfy> so its a log for a whole team for a specific topic
<seiflotfy> it can be very useful for developer
<seiflotfy> knowing who is working on which file in realtime
<ClassBot> sinisterstuf asked: do you know anything about this reward system I heard about, I think it'd use zeitgeist. Based of rewards in games it let's your computer award you for your actinos, eg. you used GIMP 50 times you won the artist award, your screensaver has been on more than 50% of the time you've achieved the laziness award?
<seiflotfy> sinisterstuf, yes its called OMG
<seiflotfy> it was something initiated but now its being developed and maintained by m4n1sh
<seiflotfy> it will be using zeitgeist intensivly
<seiflotfy> it actually is done
<seiflotfy> but needs a UI to show the toprhies
<seiflotfy> i just never got around to do that
<ClassBot> sinisterstuf asked: is it available to be used/tested?
<seiflotfy> sure
<seiflotfy> lp:omg :)
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Custom widgets - Instructors: nzmm
<nzmm> hey folks!
<nzmm> my name is Matthew McGowan, I help out a bit with the Software Center UI
<nzmm> I am going to give a basic introduction on custom widgets in pygtk
<nzmm> I have notes up here:
<nzmm> http://nzmm.blogspot.com/2010/09/custom-widgets-notes-plain-text-version.html
<nzmm> if you would like to refer to them at a later date
<nzmm> so firstly why would we want to write our own widget?
<nzmm> with custom widgets you can potentially solve UI problems more elegantly or in more intersting ways
<nzmm> it adds flare to your application, a bit of bling perhaps
<nzmm> writing custom widgets is also a great way to get to know the gtk toolkit
<nzmm> but you need to be aware that a widget is a very user facing thing
<nzmm> so you need to ensure they are well tested and implement all the behaviours a user will expect from a widget, ie. keyboard shortcuts
<nzmm> Also, when it comes to colourising a custom widget you need to take care that you select appropriate colours that fit in with the widgets surroundings
<nzmm> and a big one that is easily overlooked is provided accessibility
<nzmm> *providing accessibility
<nzmm> for users who rely on apps such as the Orca screen-reader
<nzmm> so i hope with my chat, i will cover some of these basics
<nzmm> before you get started with a custom widget, get familiar with the gtk.Widget class
<nzmm> it provides a lot of methods, so it pays to know whats on offer, to avoid duplicating stuff in your own widget
<nzmm> also investigate other widgets, as their api may provide an insight into things you may need to consider writing your own widget
<nzmm> also you'll want to decide which widget you want to base your widget on
<nzmm> do you want to start with a gtk.EventBox or a gtk.DrawingArea or some other widget
<nzmm> !q
<ClassBot> sinisterstuf asked: what do I need in order to do this?
<nzmm> so i forgot to mention: to write a custom widget in pygtk, you dont need to install anything really, as the default Ubuntu install provides what you need out of the box
<nzmm> if you have bzr installed i have some sample code that shows the basics
<nzmm> bzr branch lp:~mmcg069/+junk/custom-widget-examples
<nzmm> or if bzr is a bit daunting, i have an example here: http://dl.dropbox.com/u/123544/custom-widget-1.py
<nzmm> so in this example a simple push-button type widget is written
<nzmm> the important parts are that we import gtk and cairo
<nzmm> gtk provides the 'windows'
<nzmm> cairo provides a the drawing operations
<nzmm> the method rounded_rect at the top of the file, is a helper method for drawing rounded rectangle
<nzmm> the guts of this example though is the class MyCustomWidget
<nzmm> notice that i have subclassed a gtk.EventBox
<nzmm> IMHO subclassing a gtk.EventBox is a great foundation for a custom widget
<nzmm> as the name suggests an EventBox allows you to be notified of events such as
<nzmm> button-presses, key-presses, motion, enter & leave events, focus events and many more
<nzmm> oh btw to run this file, simply > python custom-widget-1.py
<nzmm> the other great thing about EventBoxes is that with the method set_visible_window(True|False)
<nzmm> you can hide the EventBox 'background' window
<nzmm> this can be great for a number of reasons
<nzmm> a hidden background window can allow for a pseudo compositing effect
<nzmm> if the container you are putting your custom widget is a gradient or if you want to paint a shape to your custom widget that is non-rectangular
<nzmm> you can do so without unsightly little colour mismatches between the container widget and your custom widget
<nzmm> moving on
<nzmm> self.set_flags(gtk.CAN_FOCUS)
<nzmm> is important because this tells gtk that your widget wants to be in the focus-chain
<nzmm> the focus-chain it the order widgets are cycled through when you press Tab or Shift+Tab
<nzmm> self.set_size_request(36, 64)
<nzmm> requests a minimum size for your widget
<nzmm> in your own widget you'd want to calculate this based on the contents of your widget
<nzmm> its important to note that your widget can still grow to fill space, so keep that in mind
<nzmm> self.set_events(gtk.gdk.KEY_PRESS_MASK| ...
<nzmm> you need  to also specify which events you want your widget to be sensitive to
<ClassBot> gaberlunzie asked: how to peek at available methods in the Widget class?
<nzmm> a good way would be dir(Widget)
<nzmm> that would list methods etc
<ClassBot> sinisterstuf asked: Can you set a max size for the widget too?
<nzmm> tbh, you cant really enforce a max or min on a widget
<nzmm> the size allocated to a widget depends a lot on how other widgets surrounding it are behaving
<nzmm> so yo need to design your widget to handle different sizes as gracefully as possible
<nzmm> next, you want to connect to signals that are issues when events occur, such as expose
<nzmm> self.connect('expose-event', self._on_expose)
<nzmm> expose-event is an important one as it is issued when a redraw is required
<nzmm> your signal handler, in my case def _on_expose(self, widget, event):
<nzmm> is where you want to handle the drawing
<nzmm> drawing is where custom widgets get really fun
<nzmm> in my case i do my drawing with cairo
<nzmm>         # first we need to create a Cairo Context
<nzmm>         cr = widget.window.cairo_create()
<nzmm>         cr.rectangle(event.area)
<nzmm>         cr.clip()
<nzmm> the event.area is the area of the widget that needs a redraw
<nzmm> usually because the contents have been changed or resized
<nzmm> widget.allocation is the space your widget occupies in the window
<nzmm> its a gtk.gdk.Rectangle()
<nzmm> it offers an x, y coord
<nzmm>  and also the width and height dimensions
<nzmm> be aware that event.area and widget.allocation can differ
<nzmm> in this example we used fixed colours to the drawing, this most likely does not play well with gtk-themes
<nzmm> http://dl.dropbox.com/u/123544/custom-widget-2.py
<nzmm> in the above example however we prefer to use colours from gtk.Style
<nzmm> gtk.Style offers a palatte of colours derived from the current gtk-theme
<nzmm> for instance widget.style.mid[gkt.STATE_NORMAL]
<nzmm> will return the mid gtk.gdk.Color for your theme
<nzmm> bg = self.style.mid[self.state]
<nzmm> notice the self.state
<nzmm> the mid color selection offers a range of colours for each 'state'
<nzmm> states include gtk.STATE_PRELIGHT (onhover) gtk.STATE_ACTIVE (clicked) gtk.STATE_INSENSITIVE (inactive widget)
<nzmm> so mid will return slightly different colours depending on the state specified
<nzmm> to take advantage of this fact in your custom widget, you need to set the state depending on how the user is interacting with your widget
<nzmm>     def _on_enter(self, widget, event):
<nzmm>         # set state to enter. an expose event is generated
<nzmm>         self.set_state(gtk.STATE_PRELIGHT)
<nzmm>         return
<nzmm> the above code is the signal handler for the 'enter' event, i.e. when the user mouses over your widget
<nzmm> notice the set_state method
<nzmm> i set the state to gtk.STATE_PRELIGHT
<nzmm> this automatically triggers an expose event as well
<nzmm> resulting in a slightly different shade of colour when the user mouses over the widget
<nzmm> i am getting low on time so i want to move on to accessibility
<nzmm> http://dl.dropbox.com/u/123544/custom-widget-3.py
<nzmm> i changed the widget only slightly to provide some really basic accessibility information
<ClassBot> gaberlunzie asked: gtk.Style exempts cairo from being imported?
<nzmm> you can use both cairo drawing and gtk.STyle.paint_* methods in teh expose handler, for instance you can draw the rounded rectangle with cairo, the use gtk.Style.paint_layout to draw some text with the correct hinting etc
<nzmm> back to accessibility
<nzmm> accessibility allows you to provide additional contextual information about what your widget is for and how it behaves
<nzmm>         acc = self.get_accessible()
<nzmm>         # define an accessible name
<nzmm>         acc.set_name('Big accessible button')
<nzmm>         # define an accessible description
<nzmm>         acc.set_description('An example custom widget in gtk')
<nzmm>         # define the widgets role in terms of Atk Role Constants
<nzmm>         acc.set_role(atk.ROLE_PUSH_BUTTON)
<nzmm> these are definately the basic methods you want to include in your widget
<nzmm> its should be obvious what they provide in terms of accessibility info
<nzmm> this info is then consumed by apps such as Orca to aid some disabled users of your widget
<nzmm> you can test your app for accessibility using the application Accerciser, which is available fromt he repositories
<nzmm> looks like i am out of time
<nzmm> i hope that was helpful starter
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
#ubuntu-classroom 2010-09-30
<dado_> exit
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Catch that bug Quickly! - Debugging Quickly apps with pdb - Instructors: Abd4llA
<jcastro> ok about ready?
<jcastro> Day 4, keep up the energy!
<jcastro> take it away Abd4llA!
<Abd4llA> Thanx jcastro
<Abd4llA> Ok guys good afternoon
<Abd4llA> As you all know today we'll be talking about debuging python apps,
<Abd4llA> specially Quickly apps
<Abd4llA> Well there're tons of python debuggers out there
<Abd4llA> but I'd say in 90% of the cases, you'll be using "pdb"
<Abd4llA> pdb comes by default with the python installation
<Abd4llA> As its name shows, it stands for "Python DeBugger"
<Abd4llA> You can use pdb to track your program execution,
<Abd4llA> do post-mortum debugging
<Abd4llA> and pretty much anything a decent debugger should do :-)
<Abd4llA> So lets get rolling quickly with pdb
<Abd4llA> So to start with, lets see how a normal pdb session looks like
<Abd4llA> just in the terminal issue the command "pdb"
<Abd4llA> You'll see that it accepts normal scripts as an argument
<Abd4llA> so we can pretty much launch pdb normally
<Abd4llA> pdb <script.py>
<Abd4llA> that'll launch a pdb debug session for your script
<Abd4llA> starting at the first line, from there you can set your break points...etc then get rolling
<Abd4llA> or you can inject an explicit call to pdb from within your python script
<Abd4llA> so lets see how can we do that
<Abd4llA> First, as I said, this is about debugging quickly apps, but most of what we'll say today can be applied to any python scripts/programs
<Abd4llA> So, lets start by creating the sample quickly ubuntu-application template application
<Abd4llA> from your favourite workspace dir, issue create a quickly app by issuing the command
<Abd4llA> quickly create ubuntu-application DummyApp
<Abd4llA> And let me know what you see :) ?
<Abd4llA> Now as you see, this is the default template app for the ubuntu-application quickly template
<Abd4llA> It's pretty  dummy, so lets try adding some "yea, dummy" functionality
<Abd4llA> there u'll find a "save" item in the "file" menu
<Abd4llA> so lets call some function when we click save
<Abd4llA> close your DummyApp
<Abd4llA> then navigate to the dummyapp dir
<Abd4llA> there, issue the command:
<Abd4llA> quickly design
<Abd4llA> That'll launch "Glade"
<Abd4llA> now click on the file menu
<Abd4llA> and click on the "save"
<Abd4llA> in the properties panel on the right
<Abd4llA> click the "Signals" tab
<Abd4llA> You'll find a subitem called "activate" under "GtkMenuItem"
<Abd4llA> There we'll write down the name of the method to call when we click save
<Abd4llA> lets call it "save_me"
<Abd4llA> so write down "save_me" in the "Handler" field of the item "activate"
<Abd4llA> so
<Abd4llA> now make sure to save
<Abd4llA> ctrl+s
<Abd4llA> close your glade
<Abd4llA> now we need to write down that method
<Abd4llA> so in your terminal, issue the command
<Abd4llA> quickly edit
<Abd4llA> that'll open all your source files
<Abd4llA> in gedit
<Abd4llA> now go to the file dummyapp
<Abd4llA> That's our main file
<Abd4llA> we need to add our save_me method to the DummyappWindow class
<Abd4llA> so navigate there, maybe under the "on_destroy" method
<Abd4llA> add the following method
<Abd4llA> def save_me(self, widget, data=None):
<Abd4llA>     introduce_bug()
<Abd4llA> Now as you see, we're calling a method called introduce_bug
<Abd4llA> we'll add that function to helpers.py
<Abd4llA> so go to the top of the dummyapp file
<Abd4llA> and import it as follows
<Abd4llA> from dummyapp.helpers import introduce_bug
<Abd4llA> we'll write that function ourselves
<Abd4llA> Now navigate to helpers.py inside your gedit
<Abd4llA> and at the very bottom, write down that method
<Abd4llA> def introduce_bug():
<Abd4llA>     name = "bug"
<Abd4llA>     print "I am a " + name
<Abd4llA>     print "I am a healthy line"
<Abd4llA> then save your gedit
<Abd4llA> Keeping up so far?
<Abd4llA> Now save gedit, then close
<Abd4llA> then run our app by firing
<Abd4llA> quickly run
<Abd4llA> and click "save"
<Abd4llA> in your terminal you should see
<Abd4llA> I am a bug
<Abd4llA> I am a healthy line
<Abd4llA> Make sure your import line
<Abd4llA> is under the line
<Abd4llA> from dummyapp.helpers import get_builder
<Abd4llA> so at the end it'll look like
<Abd4llA> from dummyapp.helpers import get_builder
<Abd4llA> from dummyapp.helpers import introduce_bug
<Abd4llA> Now run again
<Abd4llA> quickly run
<Abd4llA> click save
<Abd4llA> test
<Abd4llA> all good ?
<Abd4llA> Now that's a bug over there
<Abd4llA> We need to hunt it down
<Abd4llA> there're several ways
<Abd4llA> but lets choose the easiest
<Abd4llA> from your command line
<Abd4llA> issue the command
<Abd4llA> pdb bin/dummyapp
<Abd4llA> Now we're starting a pdb session
<Abd4llA> it started at the first line of your script
<Abd4llA> pdb accepts commands
<Abd4llA> so issue
<Abd4llA> h
<Abd4llA> that should show the help
<Abd4llA> now we need to add some breakpoints
<Abd4llA> we know that the method save_me is the one that gets called when clicking save
<Abd4llA> so lets add a breakpoint to it
<Abd4llA> the comman b is used to add breakpoints
<Abd4llA> (Pdb) b dummyapp:134
<Abd4llA> this way we added a breakpoint to the file dummyapp
<Abd4llA> line number 134
<Abd4llA> you should match the line number of your def save_me
<Abd4llA> my method is defined at line 134
<Abd4llA> so now we have a breakpoint there
<Abd4llA> let's run the code !
<Abd4llA> c
<Abd4llA> that'll continue execution untill the first breakpoint
<Abd4llA> Good?
<Abd4llA> notice the command "c"
<Abd4llA> now we notice that it'll stop when it reads the function definition
<Abd4llA> that's not what we want
<Abd4llA> we wanna stop when it starts executing
<Abd4llA> so lets try that again
<Abd4llA> close the app
<Abd4llA> run it inside pdb
<Abd4llA> pdb bin/dummyapp
<Abd4llA> now this time, lets make the breakpoint at the introduce_bug() method call line
<Abd4llA> the first line of the "save_me" function
<Abd4llA> (Pdb) b dummyapp:135
<Abd4llA> now lets continue execution till first breakpoint
<Abd4llA> (Pdb) c
<Abd4llA> you'll see that the application shows
<Abd4llA> and now we need to click "file-> save"
<Abd4llA> there you'll see pdb stoping at the break point
<Abd4llA> Good ?
<Abd4llA> now lets try some pdb commands
<Abd4llA> (Pdb) l
<Abd4llA> that'll list the code
<Abd4llA> (Pdb) w
<Abd4llA> stack trace
<Abd4llA> Now we can either execute the next line using "n" or step into the method "introduce_bug"
<Abd4llA> using s
<Abd4llA> so lets see
<Abd4llA> (Pdb) s
<Abd4llA> we're there now
<Abd4llA> (Pdb) n
<Abd4llA> will go to the next line
<Abd4llA> (Pdb) l
<Abd4llA> list the code there
<Abd4llA> now I see that the "print "I am a " + name" line is the one that introduces a bug and I wanna skip it
<Abd4llA> (Pdb) j 50
<Abd4llA> That way we jumped to the next line
<Abd4llA> (Pdb) c
<Abd4llA> will continue execution without the buggy line and will print "I am a healthy line" only
<Abd4llA> Good ?
<Abd4llA> Lets try another way to trace that bug
<Abd4llA> close your session
<Abd4llA> and edit your code
<Abd4llA> quickly edit
<Abd4llA> go to dummyapp file
<Abd4llA> in save_me method
<Abd4llA> add the following line before the call to "introduce_bug"
<Abd4llA> import pdb; pdb.set_trace()
<Abd4llA> so the final method will be
<Abd4llA>     def save_me(self, widget, data=None):
<Abd4llA>         import pdb;pdb.set_trace()
<Abd4llA>         introduce_bug()
<Abd4llA> now run the app
<Abd4llA> quickly run
<Abd4llA> go to file->save
<Abd4llA> you'll see that a pdb session will start @ the termincal
<Abd4llA> *terminal
<Abd4llA> that's another way to launch ur pdb , from within the code
<Abd4llA> now type args
<Abd4llA> that prints the arguments
<Abd4llA> (Pdb) args
<Abd4llA> also there's u and d
<Abd4llA> (Pdb) u
<Abd4llA> that goes to the upper frame
<Abd4llA> (Pdb) d
<Abd4llA> That goes to the lower one
<Abd4llA> now
<Abd4llA> (Pdb) s
<Abd4llA> step into the introduce_bug method
<Abd4llA> (Pdb) n
<Abd4llA> now you can alter your name variable
<Abd4llA> (Pdb) name = "Not a bug"
<Abd4llA> That was a quick introduction for Pdb guys :)
<Abd4llA> So thanks alot guys , more time would've been convenient :)
<Abd4llA> but hopefully it was fun :-)
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Making your application translatable in Launchpad - Instructors: dpm
<dpm> Thanks Abd4llA, and hi everyone!
<dpm> Welcome to this session on setting up your project for translations in Launchpad.
<dpm> My name is David Planella and I'm the Ubuntu Translations Coordinator, where I work with our translations community to bring you a localized operating System.
<dpm> I also tend to help with any topics related to translations and Launchpad, and that's what we're going to talk about today :)
<dpm> That's a really exciting topic to me, as Launchpad makes it really easy to make your applications translatable and available to everyone in almost any language, and I hope you enjoy it as much as I do.
<dpm> Translators are really awesome people!
<dpm> Anyway, let's get started, shall we?
<dpm> = Assumptions =
<dpm> I will start with an application ready set up for translations, so I'm not going to go into much detail there.
<dpm> My intention is to focus in getting you started with exposing your project's translations to everyone for translation.
<dpm> In any case, if you've got questions on this, feel free to ask either during or at the end of the session, and I'll be more than happy to answer them
<dpm> We're going to be using these tools:
<dpm>     bzr
<dpm>     quickly
<dpm>     python-distutils-extra
<dpm> In particular quickly, which we'll use to start with a nearly ready-made project with translations set up
<dpm> (You can install it by running the 'sudo apt-get install quickly' command or you can get it from Applications > Ubuntu Software Center)
<dpm>  
<dpm> = Creating the project and setting it up for translations =
<dpm>  
<dpm> We'll use quickly to create a project called 'fooby', and then we'll set up the last touches needed to configure translations.
<dpm> So if you've got all those tools installed, you can simply fire up a terminal window (Applications > Accessories > Terminal) and run the following command:
<dpm>     quickly create ubuntu-application fooby
<dpm> This will create an application named 'fooby'
<dpm> and give you some information about it on the first run
<dpm> then change to the fooby folder:
<dpm>     cd fooby
<dpm> And finally run:
<dpm>     python setup.py build_i18n
<dpm> That should have finished the last bits to set up translations
<dpm> in particular it created the po folder to contain the translations template and the translations
<dpm> you can see the template:
<dpm>     ls po
<dpm> have a look at it:
<dpm>     gedit po/fooby.pot
<dpm> It's important to get a bit familiar with it, but you don't have to remember the whole format
<dpm> you should simply know what it is for now :)
<dpm> A few words on translation templates:
<dpm>  * Gettext: They follow the gettext format: http://is.gd/fC8p6
<dpm>  * Name: They are generally named after your project, with a .pot extension. E.g. fooby.pot
<dpm>  * One template per app: Generally applications need only one template
<dpm>  * Layout: They generally live in the po/ folder, along with the translations
<dpm>  * Content: They are text files which contain:
<dpm>     * A header with metadata
<dpm>     * A set of message pairs: msgid are the original strings extracted from the code and exposed to translators, and msgstr are the placeholders for the translations, which are always empty in the templates.
<dpm>  * Launchpad import: They are imported into Launchpad and exposed for translations for all languages in https://translations.launchpad.net/$YOUR_PROJECT
<dpm>  * Updates: You update the template whenever you have new strings in your app and you think they are stable for translation (generally shortly before release)
<dpm>  * Tools: you update templates with gettext based tools:
<dpm>     * generally intltool -> 'cd po && intltool-update -p'
<dpm>     * or increasingly python-distutils-extra for python projects -> 'python setup.py build_i18n -p'
<dpm> You don't have to remember all of this
<dpm> But at least you should know how that you must update the template from time to time
<dpm> and the command to do it
<dpm> You'll see that your project still does not contain any translations, but let me give you a quick overview, so you know what we're talking about:
<dpm> A few words on translations:
<dpm>  * Template-based: They are created from the template and share the same gettext format
<dpm>  * Name: They are named after the $CODE.po scheme, where $CODE is an ISO 639-2 code. E.g. ca.po for Catalan, de.po for German. Some have an optional country specifier. E.g. pt_BR.po (Portuguese from Brazil)
<dpm>  * Layout: they are all in the same directory as the POT template. So:
<dpm>     * po/fooby.pot
<dpm>     * po/ca.po
<dpm>     * po/pt_BR.po
<dpm>      * ...
<dpm>  * Creation: Launchpad creates them for you the minute someone translates the first message online
<dpm>  * Code integration: you can let Launchpad commit them to a branch of your choice or you can export a tarball containing them all
<dpm> Anyway, let's continue. Now that you've added the template to your code, you can commit it:
<dpm> You can run the following commands:
<dpm>     bzr add po
<dpm>     bzr commit -m 'Created my first ever awesome .pot template. Go translators, go!'
<dpm> And let's publish it in Launchpad (note that you'll have to change the Launchpad URL to your user name instead of 'dpm'):
<dpm>     bzr push lp:~dpm/fooby/translations
<dpm> Nothing particularly hard to understand on the naming scheme above: dpm is my user name, fooby is the project and translations is the branch name
<dpm> Ok, so that completed the first step!
<dpm> Next:
<dpm>  
<dpm> = Setting up code hosting =
<dpm>  
<dpm> We want our project to be available to everyone to translate, so we'll need to publish it in Launchpad.
<dpm> That's beyond the scope of this session, so we'll continue from the already registered fooby project in Launchpad:
<dpm>     https://code.launchpad.net/fooby
<dpm> In case you are interested, though, registering a new project in Launchpad is as easy as going to https://launchpad.net/projects/+new
<dpm> Some of the URLs will not allow you some of the pages due to permissions, so if you have your own project in Launchpad, just substitute the 'fooby' part in the URL with your project's Launchpad id
<dpm> The first thing we'll have to do in our project is registering a bzr branch,
<dpm>     so we'll simply go to the Code tab in Launchpad, choose the "Configure code hosting" link
<dpm> and then on the "Link to a Bazaar branch already on Launchpad" you can enter the branch we published earlier on (~dpm/fooby/translations)
<dpm> A shortcut is to simply go to:
<dpm> https://code.launchpad.net/fooby/trunk/+setbranch
<dpm> to do this
<dpm> So now we have all we need to start setting up translations.
<dpm> You see that all components in Launchpad are integrated, so you set up a branch to be linked to translations
<dpm> Just as a recap, you can see and explore the resulting code from here:
<dpm>     https://code.launchpad.net/fooby
<dpm> Feel free to browse it (http://bazaar.launchpad.net/~dpm/fooby/translations/files)
<dpm> or download it (bzr branch lp:fooby) and play with it
<dpm> Ok, so code hosting setup: (./) Finished!
<dpm>  
<dpm> = Setting up translations in Launchpad =
<dpm>  
<dpm> Now we come to the most interesting part
<dpm> 1. Telling Launchpad where translations are hosted
<dpm> The first step it to tell Launchpad that we want to host translations there.
<dpm> On your Launchpad's project, just click on the Translations tab, or go to this URL:
<dpm> (remember to change 'fooby' to your project's name)
<dpm>     https://translations.launchpad.net/fooby/+configure-translations
<dpm> Then choose the "Launchpad" option to tell Launchpad translations will be done there, and click on "Change"
<dpm> That was an easy one, wasn't it?
<dpm> 2. Configuring permissions
<dpm> Now we are going to tell Launchpad how we want our translations permissions to be (i.e. who and how can translate it),
<dpm> and which branch translators should focus on.
<dpm> Simply go to the Translations tab again and click on the "Change permissions link"
<dpm> Or here's the direct link: https://translations.launchpad.net/fooby/+settings :)
<dpm> I recommend the following setup:
<dpm>     Translations group: Launchpad Translators
<dpm>     Translations permissions policy: Structured
<dpm>     Translation focus: trunk (or choose your branch here)
<dpm> Assigning the translations to a translation group will make sure a team for each language will review translations before they are submitted, ensuring the quality of translations
<dpm> A translations group is a group of teams, one per language, that takes care of translations in their language
<dpm> They can be specific to a project or generic. I recommend the Launchpad Translators group because it contains a set of already established and experienced teams:
<dpm> https://translations.launchpad.net/+groups/launchpad-translators
<dpm> as per the Structured policy
<dpm> This gives you a good balance between openness and quality control:
<dpm> Only the team members of an established team will be able to translate your project
<dpm> And for languages without a team it will allow everyone to translate, facilitating the barrier of entry to translators at the expense of QA
<dpm> The other extremes are Open or Restricted
<dpm> You can learn more about these here:
<dpm>     https://help.launchpad.net/Translations/YourProject/PermissionPolicies
<dpm> It's the project maintainer's call, but I personally discourage them to use Open
<dpm> Ok, we're nearly there, next step:
<dpm> 3. Setting up what needs to be translated
<dpm> You need to also tell Launchpad what needs to be translated. That's again quite easy. On the Translations tab again, choose the trunk series and specify your branch there
<dpm> Direct link: https://launchpad.net/fooby/trunk/+linkbranch
<dpm> Another easy one
<dpm> 4. Configuring imports and exports
<dpm> That's for me the most interesting bit
<dpm> The settings on this section basically enable Launchpad to do the work of managing translations for you
<dpm> You can tell Launchpad to import your translation templates automatically whenever you do a commit
<dpm> So you don't have to upload them manually
<dpm> If you are migrating a project with existing translations, you can tell it to import them too
<dpm> And finally, you can let Launchpad commit translations automatically to a branch of your choice
<dpm> I find that just awesome
<dpm> So for the imports, on the Launchpad page, on the "Import translations from branch" section:
<dpm> I recommend choosing "Import template files" and then "Save settings"
<dpm> For exports: look at the "Export translations to branch" section and then click on the  "Choose exports branch" link
<dpm> So that was it!
<dpm> 4 easy steps that should not take you more than a few minutes to set up, and your app is ready for the world to translate!
<dpm> Just a few final words:
<dpm>  
<dpm> = Play with translations =
<dpm>  
<dpm> As a developer, it might be interesting to see how translators do their work.
<dpm> Exceptionally (remember how I advised not to use Open permissions, tough :) I've set the translations permissions on the fooby project to Open
<dpm> So you can submit translations
<dpm> and get a feel for the work that translators do
<dpm> As a developer, it will give you an understanding on how they work. It is always interesting to get to know other workflows
<dpm> and it's always good to have an insight on all areas of contribution related to your project
<dpm> You can start translating fooby here:
<dpm> 	https://translations.launchpad.net/fooby
<dpm>  
<dpm> = Summary =
<dpm>  
<dpm> Most of the steps described here today you'll only need to do once, unless you need to change the settings. They were:
<dpm>  1. Setting up code hosting (in case you hadn't already)
<dpm>  2. Setting up translations in Launchpad
<dpm>     2.1. Telling Launchpad that it's hosting your translations (https://translations.launchpad.net/fooby/+configure-translations)
<dpm>     2.2. Configuring permissions: recommended -> Structured, Launchpad Translators (https://translations.launchpad.net/fooby/+settings)
<dpm>     2.3. Setting up the translations branch (https://launchpad.net/fooby/trunk/+linkbranch)
<dpm>     2.4. Configuring imports and exports (https://translations.launchpad.net/fooby/trunk/+translations-settings)
<dpm> So really, once your project is set up for translation, the only things you'll have to remember are:
<dpm>   to update the template before a release,
<dpm>   announce to translators that they can start their work,
<dpm>   and merge the translations to your main branch.
<dpm> If you are using the same branch for translation imports and exports, you won't even have to do that!
<dpm> So here's a reminder on how to do these steps:
<dpm> Updating the translation template
<dpm> ---------------------------------
<dpm> python setup.py build_i18n -p                   # To update the template
<dpm> bzr commit -m"Updated translation template"     # Commit your local changes
<dpm> bzr push                                        # Push changes to the remote branch
<dpm>  
<dpm> Call for translations
<dpm> ---------------------
<dpm> Just send an e-mail to launchpad-translators(at)losts(dot)launchpad(dot)net or to the list where the coordination of your project's translation is happening
<dpm>  
<dpm> Just to finish, you'll find more information on the topics covered in this session here:
<dpm>  * https://help.launchpad.net/Translations/YourProject
<dpm>  * https://help.launchpad.net/Translations/YourProject/BestPractices
<dpm> So that was it! I hope you enjoyed it and that I can soon see your projects up for translation in Launchpad
<dpm> Does anyone have any questions?
<ClassBot> MAfifi asked: What about non-python based projects?
<dpm> The Launchpad part is the same for those. Let's take a C project, for example
<dpm> the only differences between languages, or rather between build systems, is how you update the template
<dpm> In a GNOME application in C using autotools, for example, you'd just go to the po folder
<dpm> and call intltool-update -p
<ClassBot> MAfifi asked: What if I want to submit a translation in a language no team exists for?
<dpm> It all depends on the permissions you've set up for your project
<dpm> With Open and Structured permissions, the translations would just be accepted
<dpm> With Restricted, they'd be marked as suggestions, but would not be included in the project
<dpm> until there is a team which reviews them
<dpm> As the maintainer, you can bypass that and do a manual upload of the translations for which there isn't a team
<dpm> But I'd rather avoid bypassing translation teams
<dpm> and try to find someone that can review the translations before them being accepted
<dpm> oh, MAfifi meant for translators
<dpm> As a translator, the same as above applies, only that you cannot bypass translation teams as a maintainer can do
<dpm> so for Structured, it there is not a team, you'd be able to submit translations, the same as in Open
<dpm> For Restricted, you'd be able to submit suggestions, which are recorded in Launchpad, but would not make it into the project until a team for the language is created
<dpm> Any more questions?
<ClassBot> apachelogger asked: how do I make my plasmoid translatable?
<dpm> nice question, I don't think I can answer in the last minute, but we can continue on #ubuntu-translators
<dpm> As an exchange, you get an intro:
<dpm> ok, bye everyone, I hope you enjoyed the talk. now let's leave the room for the always awesome apachelogger and his talk on "Widgetcraft <3"
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Widgetcraft <3 - Instructors: apachelogger
<apachelogger> Aloha!
<apachelogger> thank you dpm for your talk and the intro :)
<apachelogger> welcome to an intro on Widgetcraft (imagine scary music)
<apachelogger> ... also known as the art of creating Plasma Widgets (imagine not so scary music but thunder ;))
<apachelogger> My name is Harald Sitter, and I am opporunistic by design.
<apachelogger> First please make sure you have the dependencies: sudo apt-get install kdebase-workspace-bin kdebase-runtime
<apachelogger> Also you will need a common editor.
<apachelogger> There is a Plasma specific sort-of IDE in the works, but it has yet to see a release that I would call usable.
<apachelogger> Please write DONE in the -chat channel once you are done installing
<apachelogger> so I know when we can do fun things.
<apachelogger> any more people who are not DONE yet? ^^
<apachelogger> I think we can skip the intro and do useful things then ;)
<apachelogger> but first let me at least outline some basics
<apachelogger> Plasma is the technology underneath KDE's workspace components (mostly called desktop)
<apachelogger> it comes in currently (I think) 3 favors, proper desktop, netbook sort-of desktop and mobile (yes for mobile phones)
<apachelogger> Usually Plasma Widgets writen natively for Plasma are called Plasmoids.
<apachelogger> Plasma can also run Apple Dashboard widgets and Google Gadgets for examples... but only Plasmoids are the real deal ;)
<apachelogger> You can write them in either JavaScript or C++ or Ruby or Python.
<apachelogger> However only the former two are guaranteed to be available on every system, so I recommend those.
<apachelogger> Hence we will also use JavaScript today.
<apachelogger> Any questions thus far?
<apachelogger> Very well.
<apachelogger> coding \o/
<apachelogger> yay
<apachelogger> hooray
<apachelogger> woohoo
<apachelogger> :D
<apachelogger> A basic routine that you will almost always need when starting off with a new Plasmoid is the following:
<apachelogger> NAME=doctor-questionmark          # Set a shell variable
<apachelogger> mkdir -p $NAME/contents/code/     # Create everything up to the code dir.
<apachelogger> touch $NAME/metadata.desktop      # Create the metadata file, which contains name and description...
<apachelogger> touch $NAME/contents/code/main.js # Create main code file of the plasmoid.
<apachelogger> You can copy this verbatim into a terminal to get started with our little example.
<apachelogger> This will create the basic outline for any JavaScript based Plasmoid.
<apachelogger> For other languages it is basically the same, just that the file extension of the main.js would be different :)
<apachelogger> First let us set up the meta data. For that open the metadata.desktop file and fillit with content.
<apachelogger> You can copy the stuff from here: http://people.ubuntu.com/~apachelogger/uadw/09.10/doctor-questionmark/metadata.desktop
<apachelogger> As you can probably tell from looking at that file, the meta data bascially just defines name, comment, icon, author and other not all that useful information.
<apachelogger> BUT whenever you create a new plasmoid, do not forget to change the 'Name' and 'X-KDE-PluginInfo-Name' values
<apachelogger> those 2 get used to identify the plasmoid internally, so if you forget to change one it can easily happen that your plasmoid does not show up or loads inproperly etc. etc.
<apachelogger> Is everyone done with the metadata.desktop?
<apachelogger> Splendid.
<apachelogger> And you know what, that was already all the politics ;)
<apachelogger> We all know what comes after the politics... the code ;)
<apachelogger> So please save the file and close it.
<apachelogger> And open contents/code/main.js instead.
<apachelogger> This sweet apple pie of an empty file will soon contain our beautiful code, of which I am not yet sure what it will be...
<apachelogger> How about starting with a simple hello world?...
<apachelogger> I will indent code lines so they are easier visible for you.
<apachelogger>     // First create a layout we can stuff things into
<apachelogger>     layout = new LinearLayout(plasmoid);
<apachelogger> what is probably noteworthy at this point is that 'plasmoid' thing there, it is part of the initial environment we get in a plasmoid and by having it in brackets it becomes 'parent' of our layout
<apachelogger> the term parent here relates to live time mostly, if the parent of an object in a plasmoid explodes, all its children will too
<apachelogger>     // Then create a label to display our text
<apachelogger>     label = new Label(plasmoid);
<apachelogger> I hope until now it is still barable complicate
<apachelogger>     // Add the label to the layout
<apachelogger>     layout.addItem(label);
<apachelogger> Now here is an inherted goodness, since Plasmoids are based on KDE which is based on Qt we have cool layouting features, which means for simple things we do not have to worry about layout very much.
<apachelogger> We simply create such a layout and add items to it...
<apachelogger> Of course something is still missing for our hello world.
<apachelogger> Text ;)
<apachelogger>     // Set the text of our Label
<apachelogger>     label.text = 'Doctor ?';
<apachelogger>     // Done
<apachelogger> (for the record: I do like doctor who better than hello world ;))
<apachelogger> You can now run this using plasmoidviewer $NAME (if you still have your terminal open) or plasmoidviewer PATHTOPLASMOIDFOLDER
<apachelogger> Does everyone has a working plasmoid?
<apachelogger> Also, there is a new trick I would like you to tell about. If you are on KDE 4.5 (default for Kubuntu 10.10) you will have a new command called 'plasma-windowed' using this command you can run most Plasmoids just like any other application in a window, is that not superb?
<apachelogger> You can try that with our new plasmoid right now.
<apachelogger> Or if you have the facebook plasmoid, try that
<apachelogger> plasma-windowed facebook
<apachelogger> Pretty neat feature.
<apachelogger> So, lets build up on this example.
<apachelogger> How about a button? Buttons are cool!
<apachelogger> Just continue in the main.js
<apachelogger>     // Create a new button
<apachelogger>     button = new PushButton;
<apachelogger>     // Add the button to our layout
<apachelogger>     layout.addItem(button);
<apachelogger> I personally have made it a habit to immediately after creating add objects to a layout.
<apachelogger> Especially in large projects it can easily happen that you forget that and suddenly there is a button floating around somewhere where it does not belong
<apachelogger>     // Give the button some text
<apachelogger>     button.text = 'Do not EVER click me';
<apachelogger> *save* the file
<apachelogger> and try it again
<apachelogger> It looks a bit silly, does it not?
<apachelogger> The layout placed the button next to the text... not awesome at all... I would really like it to be below the text. Easy to do.
<apachelogger> We just tell our layout to align stuff vertically, rather than horizontally (which seems to be the default).
<apachelogger>     // Switch our layout to vertical alignment
<apachelogger>     layout.orientation = QtVertical;
<apachelogger> *save* and try again
 * apachelogger finds it much more attractive now
<apachelogger> everyone done?
<apachelogger> We are pretty fast today so I am pondering a coffe break... or maybe better not.
<apachelogger> Of course our button does not do anything (well, other then be there, sometimes that is already a lot ;))
<apachelogger> Now what could we do to improve the situation a bit?
<apachelogger> How about a nice image?
<apachelogger> There is nothing like a good picture to spice up things a bit :D
<apachelogger> First let us get the picture.
<apachelogger> For that we will create an own 'images' folder and place our image in there, so everything stays nicely structured.
<apachelogger> If you are still outside the doctor-questionmark folder in a terminal you can use the following command to do that:
<apachelogger> mkdir -p $NAME/contents/images/
<apachelogger> wget -O $NAME/contents/images/troll.png http://people.ubuntu.com/~apachelogger/uadw/09.10/data/troll.png
<apachelogger> If not, just go to your contents folder, create the images folder in there and download the picture http://people.ubuntu.com/~apachelogger/uadw/09.10/data/troll.png into that folder
<apachelogger> Now for the code:
<apachelogger>     // Labels can also contain images, so we will use a label again
<apachelogger>     troll = new Label(plasmoid);
<apachelogger>     // But this time we set an image. The image path is constructed automatically by us telling it in what directory it is and what name it has
<apachelogger>     troll.image = plasmoid.file("images", "troll.png");
<apachelogger> So, we do not only have a well structured folder setup, it also makes our code more readable.
<apachelogger> (also in case you should notice, I did intentionally not add the label to our layout, in case you have not, nevermind)
<apachelogger>     // So that our image fits in we need to tell the label to consume as much space as possible and necessary
<apachelogger>     troll.sizePolicy = QSizePolicy(QSizePolicyMaximum, QSizePolicyMaximum);
<apachelogger> Usually Plasmoids will try to consume as little space as possible, this of course is a problem with a big image because then it would get cut off.
<apachelogger> By telling our troll to try to use as much space as possible we can solve this 'problem'.
<apachelogger>     // We only want to show the image after the user dared pressing the button, so we set it not visible and also do not add it to our layout
<apachelogger>     troll.visible = false;
<apachelogger> Here is the reason I did not add the image to our layout.
<apachelogger> Instead the behaviour should be like this: user starts plasmoid, plasmoid looks nice, user is foolish enough to press button, troll comes up, user falls off chair.
<apachelogger> What is left to make that happen is making our button actually o things.
<apachelogger> An for that we will use a very cool feature of Qt calle signal an slot (only in a simpler version).
<apachelogger> The basic iea is that most objects in Qt emit a signal when certain things happen.
<apachelogger> Our button for example will emit one when it is clicked.
<apachelogger> And those signals can be attached to so-called slots, which are basically just functions.
<apachelogger> So we want that when the button is clicked a specific function is to be executed.
<apachelogger>     // First add a function to handle clicking on the button
<apachelogger>     function onClick()
<apachelogger>     {
<apachelogger>         // Once our button gets clicked we want to show an image.
<apachelogger>         troll.visible = true;
<apachelogger>         // We add the new image to our layout, so it gets properly aligned
<apachelogger>         layout.addItem(troll);
<apachelogger> (keep in mind, our layout is putting items below each other, so our troll will be appearing at the very bottom right now)
<apachelogger>         // To prevent problems we set the now useless button to not visible
<apachelogger>         button.visible = false;
<apachelogger>     }
<apachelogger> ^ do not forget this curly bracket there, to indicate the end of the function
<apachelogger>     // Now we just tell our button that once it was clicked it shall run our function
<apachelogger>     button.clicked.connect(onClick);
<apachelogger> *save* and run again
<apachelogger> Since bulldog98 just pointed out that the window does not resize...
<apachelogger> Yes, that is a bug (or maybe intentional) with plasmoidviewer, the plasmoid as seen in Plasma will resize properly. In fact if you resize the plasmoidviewer window the plasmoid will look just fine.
<apachelogger> Now since we are running out of time let us stop hacking and prepare a packge we can use to distribute our newly made Plasmoid.
<apachelogger> Well, package is maybe a bit of an overstatement, they really are just zip files with .plasmoid as file ending.
<apachelogger> The crucial thing that makes it work is the folder set up we used at the very beginning.
<apachelogger> So creating a packge we can share with people we want to scare is as easy as creating a zip.
<apachelogger> For example using the following command:
<apachelogger> cd $NAME &&
<apachelogger> zip -r ../$NAME.plasmoid . &&
<apachelogger> cd ..
<apachelogger> That again will only work if you still have the terminal with NAME set of course :)
<apachelogger> otherwise just create a zip of the content of our folder and change the file ending.
<apachelogger> It is however curcial that you only package the content, not the folder
<apachelogger> You can find a finished plasmoid and the code at http://people.ubuntu.com/~apachelogger/uadw/09.10/
<apachelogger> This .plasmoid file can either be installed via the Plasma GUI ways (i.e. like you would usually add a plasmoid) or by using the command line tool plasmapkg
<apachelogger> e.g.
<apachelogger> plasmapkg -i $NAME.plasmoid
<apachelogger> either way the plasmoid should then show up in your widgets list and be ready to use \o/
<apachelogger> So where to go from here?
<apachelogger> Obviously this was but a simple introduction to Plasmoid programming
<apachelogger> and also not very fancy I must say
<apachelogger> You can however try http://people.ubuntu.com/~apachelogger/udw/10.07/trollface-6/ this plasmoid.
<apachelogger> It basically does a very similar thing to ours but introduces fancy animations and a way to get rid of the image again.
<apachelogger> Also at http://people.ubuntu.com/~apachelogger/udw/10.07/videos/ I created some videos which show case some basic plasmoids.
<apachelogger> At this point I should mention that Amarok, the music player, also uses plasmoids, so it is not all that difficult to get the same plasmoid with no code changes into Amarok and Plasma at the same time (if that makes any sense)
<apachelogger> You can find a lot more information at the Plasma community page at http://community.kde.org/Plasma
<apachelogger> There are pointers to tutorials for all supported programming languages as well as ready to go examples.
<apachelogger> Also, if you want to pursue writing Plasmoids in JavaScript you will need the API reference at http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API
<apachelogger> JavaScript is cool for simple plasmoids, but should you feel too limited by it, you can try Ruby or Python, they are not more complicated but give you greater control.
<ClassBot> bulldog98 asked: can I simply convert your template to C++?
<apachelogger> That depends on what you mean by convert.
<apachelogger> You basically can use the very same program logic but you will have to adopt it to C++ code constraints.
<apachelogger> e.g. a Plasmoid in C++ is contained within at least one class
<apachelogger> Also you cannot do things like label.text = 'foo';
<apachelogger> Instead you will use setter methods, like label.setText("foo");
<apachelogger> So direct conversion is not possible, because the languages are just too difficult.
<apachelogger> Also if you need help or have further questions feel free to drop into the Plasma IRC channel #plasma
<apachelogger> That is it.
<apachelogger> Good luck with creating your brilliant Plasmoids and have fun with steveire who is going to tell you about a magical thing called grantlee in a bit :)
<apachelogger> I wonder what grantlee is anyway....
<steveire> Hehe, you will soon find out
<steveire> Hello everyone and welcome to my talk.
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Using Grantlee to create application themes - Instructors: steveire
<steveire> I am Stephen Kelly, lead developer of Grantlee and part of the KDE community, mostly working on kdepim. I am a full-time employed Qt consultant and I write and maintain Grantlee in my spare time
<steveire> So what is Grantlee ?
<steveire> I assume that any of you here attending the talk have done some googling to find out what it is and what it does, as the talk title is low on details.
<steveire> Grantlee is a string template system. Such systems are common in web frameworks See more here: http://en.wikipedia.org/wiki/Template_engine_%28web%29
<steveire> You can see in the comparison table at that link that Grantlee supports all features of most other comparable systems.
<steveire> The only missing feature is i18n support, which should be available in a few months. That is the only open bug against Grantlee :) https://bugs.kde.org/buglist.cgi?product=grantlee
<steveire> Grantlee is actually based on the design and syntax of the Django template system (but does not depend on Django itself)
<steveire> It is fully implemented in QtCore and QtScript, so it can be extended with C++ and with javascript
<steveire> It can even be used in gtk applications just by linking to QtCore and QtScript becuase Qt can run the gtk event loop
<steveire> Packages are available for Lucid and Maverick: http://packages.ubuntu.com/search?keywords=grantlee
<steveire> String template systems are used in web frameworks to create html markup to send to clients that request it. The template is a file containing the html that should be sent back to the browser, but with place holders for things like your username, your messages, the color that you have chosen in your profile etc.
<steveire> Websites often use such systems for scalability and code resuse
<steveire> On the desktop, we don't have web servers to generate html, but it is common for applications to create themed output using html. For example, Evolution email client can render the email viewer with different themes. This is done by generating different html with different css for each theme.
<steveire> KMail also allows theming using various styles.
<steveire> The problem with an approach like that is that the html is often hardcoded into the source code, making it difficult to change existing themes or add new themes.
<steveire> KMail had that exact problem, and in the past there were only 6 hardcoded themes available
<steveire> If a theme needed to be fixed or a new theme added, the application needed to be changed, compiled, packaged, and reach the distros before the fix became available to the users
<steveire> During Summer of Code 2010 Ronny Yabar ported KMail and Akregator the RSS feed reader to use Grantlee. http://ronnyml.wordpress.com/2010/08/26/gsoc-final-report-messageviewer-kmail-and-akregator-ported-to-grantlee/
<steveire> The project was a very useful step in the development of Grantlee becaus it shows what is possible, including sharing themes among users using GetHotNewStuff
<steveire> Soon it can be used to create distro specific themes, such as a theme for the fluffy kde distro
<steveire> With this change it becomes easier to fix existing themes if they are broken, and it becomes easier for third party developers to create and share themes without having to send them upstream and have them compiled into the application.
<steveire> kde-look.org can be used to share themes already: http://kde-look.org/index.php?xcontentmode=46&PHPSESSID=ee7d4bf311c5da8621c927303587bbc3
<steveire> There are not many available, but it shows the infrastucture is in place which is already to familiar to artists and users (opendesktop.org)
<steveire> As a side note I would also like to say that Grantlee can generate not only HTML, but can generate any kind of text based markup - even computer code.
<steveire> A developer could create templates for getting started creating plasmoids for example.
<steveire> In the Grantlee examples there is an application which can generate code for IDEs in C++ python and ruby languages: http://steveire.wordpress.com/2010/04/06/using-grantlee-for-code-generation/
<steveire> For application theming though, the more interesting use case is html generation.
<steveire> Another application in the Grantlee examples is the books example:  http://grantlee.org/apidox/examples.html
<steveire> We can get started by installing grantee through a package manager
<steveire> sudo aptitude install libgrantlee-dev
<steveire> After that we can download the grantlee source so that we can build the examples: apt-get source libgrantlee0
<steveire> Once that is finished we can start navigating to where the examples are
<steveire> cd grantlee-0.1.1/
<steveire> cd examples/
<steveire> cd books
<steveire> The books example is derived from the books example available in Qt: http://doc.trolltech.com/4.7/demos-books.html
<steveire> To build it we create a separate build directory.
<steveire> mkdir build
<steveire> cd build
<steveire> cmake ..
<steveire> make
<steveire> There is no need to install it
<steveire> The books example uses sqllite to manage a database of books. Grantlee makes it possible to create a html page from the table of data and theme it in any possible way.
<steveire> After it is build you can run the example by executing it on the command line
<steveire> ./books
<steveire> The top of the application shows the books in the database, and allows managing the authors, the genre, the rating etc.
<steveire> Near the bottom of the application you can choose a theme to use when exporting the books to a html file and an export button for doing the actual exporting.
<steveire> If you click the export button it will ask for a location to save the html file (default to ~/book_export.html)
<steveire> Try the export and open the file in a web browser. You will see the same data that is in the application now in the html file.
<steveire> Try changing some of the data, like the rating or a genre and export again. You can then refresh the browser to see an updated html page
<steveire> A html export feature like that is common in applications allowing you to export contacts for example or notes.
<steveire> KJots has that feature too and actually uses Grantlee already for the export.
<steveire> If you're not following along, in the screenshots you can see the generated output from a plain theme, a colored theme, and a theme that regroups the output by Author. You can also see I am not a talented artist :)
<steveire> Using the combobox in the application you can also try out the different available themes.
<steveire> The regrouping is possible because of a powerful system of tags and filters in the template system.
<steveire> Grantlee has all of the same features as Django templates have, so all of the same tags are available: http://docs.djangoproject.com/en/dev/ref/templates/builtins/
<steveire> Just so there is no misunderstanding, Grantlee does not depend on Django or on Python. Grantlee depends only on the Qt4 framework. All tags and filters are written in native Qt4 code.
<steveire> Just like Django, Grantlee can be extended by third partes by writing new tags and filters
<steveire> The tags and filters can't be implemented in python (yet), but can be implemented in either Qt C++ or in Javascript
<steveire> The wide range of tags available and the fact that there are many existing developers with Django experience means that really compelling themes can be created.
<steveire> So what does a theme file look like? There are some examples in the documentation and the links I have already given.
<steveire> We can walk through some of the features of theme files now: http://grantlee.org/apidox/for_themers.html
<steveire> The first example shows all the basics of template files.
<steveire> It is possible to make comments with {# comment tags #}
<steveire> It is possible to put placeholders into the template with {{ curly_braces }}
<steveire> And it is possible to have more complicated structures like {% if %} condtions and {% for %} loops.
<steveire> {% this %} is the extensible tag part of the template syntax
<steveire> The {% for %} tag is used to loop over the book objects in the book example. http://www.gitorious.org/grantlee/grantlee/blobs/master/examples/books/themes/simple.html
<steveire> In that template snippet, we have {% for book in books %}. books is a list of books from the database. Notice how the for loop is similiar to a python for loop, so it is familiar to people who have used python, and it is intuitive even for those that have not
<steveire> For each book, we create a html row with <tr> tags, and put attributes of the book into the placeholders, such as {{ book.title }} and {{ book.author }}
<steveire> This, as you would expect replaces the placeholders with the actual title and author for each row.
<steveire> In this case book is an object, and {{ book.title }} calls the title method on the book object and puts the returned value into the placeholder.
<steveire> Other structures apart from objects are supported, such as QHash (like a python dictionary) and QList (like a python list). For more details of what is possible see http://grantlee.org/apidox/for_app_dev.html
<steveire> For the advanced coders, there is now even greater flexibility in the types of objects Grantlee can handle : http://steveire.wordpress.com/2010/09/29/grantlee-pairs-up-with-the-other-template-system/
<steveire> Grantlee also supports advanced features like template including and inheriting. That allows sharing of snippets within a theme or with other themes.
<steveire> All of the themes in the books example share a common base template which sets up the structure of the output so that all the themes are consistent
<steveire> We can see that one in grantlee-0.1.1/examples/books/themes/base.html
<steveire> It defines a simple html structure with a html <head> element and a <body> element
<steveire> It also contains several elements I have not mentioned before: {% block %} elements
<steveire> block elements are the basis for the template inheritance and reuse system.
<steveire> The base template defines some placeholder blocks which the inheriting themes can fill, and reuse the rest
<steveire> http://www.gitorious.org/grantlee/grantlee/blobs/master/examples/books/themes/base.html
<steveire> Looking again to the simple theme : http://www.gitorious.org/grantlee/grantlee/blobs/master/examples/books/themes/simple.html
<steveire> At the top it declares that it extends the template called "base.html".
<steveire> In a complex system there could be many possible base templates to inherit from with a different structure in each.
<steveire> The simple theme too has some block elements.
<steveire> These ones are used to fill the place holders defined in the base.html
<steveire> Some of them also use the keyword {{ block.super }}
<steveire> This tells Grantlee that the block in the base template should be reused, not overridden
<steveire> So the "My Books" part of the header is defined in the base template, and the name of the theme is defined in simple.html, and they are combined into the title as you can see in the screenshot.
<steveire> A theme could of course decide not to use the {{ block.super }} keyword, and not get the "My Books" part.
<steveire> It is optional to override all or no blocks in the base template
<steveire> We can make some simple edits to the theme now.
<steveire> Start by editing the base.html so that the title line looks like {% block title_row %}<tr style="background-color:blue"><th>Author</th><th>Title</th><th>Genre</th><th>Rating</th></tr>{% endblock %}
<steveire> You can then re-export without rebuilding or even restarting the books application, refresh the browser and the displayed html will be updated wiht a blue background
<steveire> See the other theme files for more simple examples of changes that you can make to the generated output.
<steveire> Adding such a capability to an existing application is ver easy.
<steveire> It uses the Qt QVariant and QMetaType system and supports all the basic Qt types.
<steveire> It is actually quite similar to the way QtQuick QML is used.
<steveire> Apart from KMail and KJots it is also used in several other code generation projects, and in a proof of concept twitter application by Ryan Paul:  http://steveire.wordpress.com/2010/05/20/grantlee-in-use/
<steveire> That's all I have prepared. I hope it was informative for you and you can consider using Grantlee for your next application theming or code generation needs.
<steveire> The grantlee community hangs out in the #grantlee channel on IRC
<steveire> And is also reachable through the kdepim mailing list if you have any questions
<steveire> kde-pim@kde.org
<steveire> Some more useful links to get started on understanding and using Grantlee:  http://www.gitorious.org/grantlee/pages/Home http://steveire.wordpress.com/2009/06/27/some-clarifications-regarding-grantlee/ http://grantlee.org/apidox/ http://www.djangobook.com/en/2.0/chapter04/ http://steveire.wordpress.com/
<steveire> Any documentation relevant to Django is also relevant to Grantlee, so there are lots of ideas to find on the web :)
<steveire> Thanks for attending the talk. In a few minutes there will be a talk about enriching applications with zeitgeist data. Don't miss it :)
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Enriching applications with Zeitgeist data - Instructors: seiflotfy
<jcastro> ok, looks like Seif is having connection problems
<jcastro> We might need to bump this class until tomorrow, please stand by!
<jcastro> ok since Seif can't get online we'll take a break until the top of the hour
<jcastro> so smoke if you got em!
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Using Quickshot to collect screenshots" in multiple languages for s - Instructors: flan
<flan> Well, I guess that means it's time.
<flan> First time I've done anything like this, so please let me know if I'm getting off-topic.
<flan> Okay, so, this is a presentation on using Quickshot, a program designed to help you write better documentation by making it easier to get screenshots.
<flan> It's still not in Ubuntu's standard library, but it should be packaged and available by 11.04. For now, we have PPAs and Bazaar access.
<flan> We'll be using the latter of those options for today, if anyone wishes to follow along with the client itself.
<flan> To begin, you'll need to instal bzr, if you haven't done so already.
<flan> I'd imagine most of you have, for some reason or other.
<flan> If not, though, it's a simple matter of "sudo apt-get install bzr".
<flan> Around the 10th, Quickshot will be formally packaged into its final PPA form, but we're still working through last-minute changes and bug-fixes, so it's best to work with source right now.
<flan> I'm going to assume everyone's got bzr now.
<flan> If not, please stop me.
<flan> So the next step is to pull the client's source from Launchpad, where we're hosting it.
<flan> Oh, before that, I should mention who "we" are.
<flan> jenkins and I are Quickshot's principal authors.
<flan> Please feel free to ask us anything after the session is over.
<flan> To pull its source, use the command "bzr branch lp:quickshot".
<flan> This will create a quickshot/ directory under your current path.
<flan> You can delete it once this is done.
<flan> This lesson, I mean.
<flan> There's a lot of revision history, so it may take a minute or two.
<flan> I'll use that time to spam you with information about what Quickshot it.
<flan> is*
<flan> It's the screenshot-capturing tool created for the Ubuntu Manual project (http://ubuntu-manual.org/); it addresses a critical issue we encountered in preparation for 10.04: our inability to capture and catalogue thousands of screenshots in a limited timeframe.
<flan> We needed something that could ensure that we'd be able to capture screenshots in a consistent manner across languages, always have them available to drop into the documentation's build process, and allow for volunteers to help out with very little training.
<flan> Our solution was to create a client-server system that would centralise rules and data, which formed the basis of the original Quickshot: a bunch of simple PHP scripts, text files, and a monolithic Python client cobbled together in a couple of weeks.
<flan> The new version is far more robust.
<flan> The server is implemented using Pylons and has the ability to scale to any number of hosted projects and languages.
<flan> The client is Python with Glade, designed to work with any number of servers (and with plans for full internationalisation support for the next iteration).
<flan> There's a decoupled client library that allows anyone to programmatically interact with the server, to script screenshot captures as part of a controlled build process.
<flan> Contributor credit is logged on a per-project basis, so volunteers don't have to be anonymous if they don't want to be.
<flan> The server provides a means of allowing any number of owners to review and accept screenshots submitted by volunteers.
<flan> And progress reports are neatly broken up by language and stage, making gauging performance in large projects easy.
<flan> Initially, I'd like to have everyone play the role of a volunteer, capturing a screenshot or two to learn how the process works in case you want to deploy Quickshot to support your own projects and need to train users.
<flan> (If you never use it again, maybe you'll be able to mention it to someone who will need something like it)
<flan> After that, anyone who's interested will be invited to hold the role of owner over what we've done today, letting you see the other half of the system.
<flan> While we're waiting for any remaining pulls to finish, does anyone have any questions? I'll entertain them in either channel.
<flan> Okay, I'm going to continue.
<flan> Before I have any of you run the client, a disclaimer is in order: there is a lot of code and it has not been thoroughly peer-reviewed.
<flan> If you do not feel comfortable trusting that what you've just downloaded is safe, you are not obligated to execute it, and you can still benefit from this lesson.
<flan> If you're in the doesn't-fee-safe-running-unsigned-code group, please follow with the discussion and jump in again when we get to the server-management part.
<flan> feel*
<flan> For those willing to actively follow along, please let me know what you get when you type "echo $LANG".
<flan> I'll add your languages to the server so you don't get any "language not supported" messages.
<ClassBot> google-fu asked: I've tried Quickshot a while ago and from what I remember, in order to use the program you have to create a new user and log in to that user for the program to work. I find this thing annoying, is this still required?
<flan> No, not for this demonstration.
<flan> That's still a requirement for our parent project, the Ubuntu Manual Project.
<flan> But it's now fully optional, and can be toggled on a per-project basis.
<flan> Same with screen resolution.
<flan> We won't be changing any of that stuff today.
<ClassBot> TobiS asked: whats the line to pull Quickshot from the remote repository?
<flan> bzr branch lp:quickshot
<flan> Okay, I'm going to continue.
<flan> Please paste the following command: "wget http://flan.uguu.ca:5000/appdevweek/10-10/%5Bappdevweek%5D10-10.qsproj"
<flan> This will download a "qsproj" file, which is really just a chunk of text that tells Quickshot about a project. Live details are always pulled on connection.
<flan> When done, type "cd quickshot/source", followed by "bin/quickshot".
<flan> You will see some WNCK-related warnings. These are entirely benign, so don't worry about them.
<flan> Browse for the file you just downloaded in the "Local files" section of the Quickshot window, then click "Get started!"
<rooligan> Where to issue wget?
<flan> In any terminal.
<rooligan> In any directory?
<flan> Sorry. I should have been more clear.
<flan> Yeah. It just downloads a file.
<flan> You may wish to join #ubuntu-classroom-chat. There's more discussion going on there.
<flan> After a brief moment, you should see a list of six screenshots.
<flan> If you see a message about the connection to the server timing out, that's not entirely unexpected (the server we're using today is single-threaded). Just retry or click "Reload" when you see the empty list.
<flan> This presumes you've pointed Quickshot at the .qsproj file.
<flan> Just in case anyone missed that part.
<flan> You'll all also see another window in front of the list of screenshots. Feel free to enter any information you'd like, or use "anonymous@example.org" and leave the other fields blank.
<flan> This window will only appear once. If you wish to change your settings, you can access the window under the "Edit" menu.
<flan> Okay, now please resist the temptation to click anything.
<flan> And let me know if I'm going too quickly.
<flan> I'd like a volunteer who is using a non-English Ubuntu environment to help get us started.
<flan> So, serapophis has volunteered. Yay.
<flan> serapophis, please pick the 'gedit' screenshot by either double-clicking it or highlighting it and clicking 'Forward'.
<flan> You'll be presented with a list of steps on the left and a message on the right saying "No reference screenshot available"; the rest of you will see something similar soon.
<flan> Quickshot uses any accepted language's version of a given screenshot as a reference for future captures, but nothing's been accepted yet.
<flan> Once you're comfortable with what you've been asked to do, click "Capture".
<flan> At this point, I'd like to ask everyone else to either click the "Quickshot progress" link on their clients or visit http://flan.uguu.ca:5000/appdevweek/10-10
<flan> You'll all see three progress bars, one for 'en', which includes 'en_US' and 'en_GB', and one for the language of our brave volunteer. And daker's crazy language. Il est fou.
<flan> Quickshot automatically reduces languages into a parent if no specialization was declared.
<flan> If we created en_CA, Canadian screenshots would be captured independently of American ones.
<flan> This is for languages that have significant differences between dialects.
<flan> Okay, so, getting back on topic, serapophis, please foloow any on-screen instructions.
<flan> All you should see is a message telling you you have three seconds, after clicking 'OK', to give gedit focus.
<flan> It'll automatically look at the last-activated window and try to use that if you don't explicitly give focus to any window.
<flan> Please let us know once you're presented with a window that asks you to confirm that everything looks good.
<flan> The rest of you will be doing this soon.
<flan> Except you'll have the benefit of reference screenshots.
<flan> Okay, serapophis, just click 'Submit'.
<flan> Everyone else, reload the page I asked you to open.
<flan> You should see progress in the de_DE field.
<flan> ...Or maybe you won't.
<jenkins> i was about to say the same :)
<flan> Have you been returned to the screenshot list, serapophis?
<flan> Okay, it might just be taking a while to upload.
<flan> I guess I'll need to work on that. Sorry.
<flan> The interface is supposed to freeze during the upload process, but I figured it would be graceful.
<flan> Okay... I was able to upload an English one without issue...
<flan> serapophis, what sort of connection do you have?
<jenkins> i guess we can carry on with the en one I will try and work out what if it is just serapophis connection
<flan> 13:37 <+flan> Okay, so we're a little off from where we should have been, but  can I get everyone else to try taking a screenshot for gedit now?
<flan> You should now all see a reference screenshot on the right side of the window.
<flan> jenkins, please take the IRC screenshot so I can let them see it, too.
<jenkins> will do
<flan> If you click this reference screenshot, you'll see a full-size (but JPEG-compressed, for transmission speed purposes) version of what was captured.
<jenkins> done
<flan> Okay, for our German users, try capturing the IRC screenshot.
<flan> You'll now see what everyone else is seeing with Gedit.
<flan> Feel free to take whatever screenshots you want for the next couple of minutes.
<flan> In the meantime, I'd like everyone's OpenID. You should have one from Launchpad.
<flan> Mine is https://launchpad.net/~red-hamsterx ; yours will be similar, only with your name at the end.
<flan> The Quickshot server doesn't use passwords, opting instead for OpenID. The virtues of this system are the subject of another lesson, though.
<flan> Other OpenID providers are okay, too, of course; Launchpad's probably just something you've probably all used.
<flan> Okay, for anyone who's offered their OpenIDs, you can now log in at http://flan.uguu.ca:5000/appdevweek/10-10
<flan> The field's in the top right.
<flan> It should be the same process as with any other OpenID-enabled site.
<flan> You provide your URL, your provider tells Quickshot that you're really you, and you get access.
<flan> WARNING: Quickshot, like almost every program, has the ability to run arbitrary commands on your system. In a moment, your peers will be able to control the commands it runs. Please be sure to check the command to be executed before you capture a screenshot.
<flan> I don't think anyone here's malicious in the slightest, but it doesn't hurt to be paranoid.
<flan> Once you've logged in, you'll notice that there's now a new bar in the top right that says "Manage version". Each language will also be clickable.
<flan> First, click any language with progress. You'll notice that some screenshots are in the "pending" state, which means that they can be approved or rejected.
<flan> Please feel free to play around, but show a little restraint, since the server is, again, single-threaded, so you don't want to choke out anyone else.
<flan> Also, this is actually running on a home connection, so please refrain form clicking the 'download archive' links; I need my bandwidth for other things.
<flan> So, yeah, just click around.
<flan> Submit multiple versions of pending screenshots and see what happens.
<flan> This is what people who are managing Quickshot projects will see, allowing them to collaboratively decide what to accept and what to reject.
<flan> (We're very open to feedback on how to make it simpler, if there's room for improvement)
<flan> As you accept screenshots, the credit report on the project page will also be filled out.
<flan> Once you've played around with that stuff to your satisfaction, go back to http://flan.uguu.ca:5000/appdevweek/10-10 and click 'Manage version' in the upper right.
<flan> You can use this itnerface to add new languages (like fr_CA, for crazy Quebec types), change screenshot details, change the order of screenshots, and add new screenshots.
<flan> Your changes will be immediately reflected on every Quickshot client.
<flan> There's also a feature that allows to you translate a screenshot's steps, but we won't be playing with it today.
<flan> You'll notice that 'en' doesn't appear in this section.
<flan> That's because it's actually a property of the parent project, http://flan.uguu.ca:5000/appdevweek
<flan> This means that every Quickshot project that's a part of AppDevWeek needs to support English.
<flan> But de_DE and fr_FR are specific to this one week.
<flan> Oh. Please do not toggle the username or resolution settings.
<flan> We don't want to force anyone to create a new user account for this demonstration. That would just be mean.
<flan> Anyway, please feel free to keep playing with the system for the next little while (I'll leave the project active for a couple of hours).
<flan> I don't really have anything else to say or add, but I do hope you've found this informative and know that, yes, there is now a tool that exists to make putting screenshots into big documentation projects a not-so-daunting task.
<flan> It just involves getting a bunch of volunteers together.
<flan> We'll be launching production-ready versions of the client and server shortly after the next edition of the Ubuntu Manual is out, around the 10th of October.
<flan> The code, and a set-up guide for the server (and maybe a brief user guide for the client) will be available at http://quickshot.org.
<flan> If you have any questions, please ask either myself or jenkins.
<flan> If you want to know how something was built, please ask me.
<flan> If you want to report a bug or usability enhancement, please ask jenkins. (He's better at handling criticism. =P)
<flan> If you know of any projects that could benefit from Quickshot, please let them know about it,.
<jenkins> apport will still sent the logs to launchpad with out a hard crash iirc
<flan> And let them know what we can always be found in #ubuntu-manual.
<flan> that*
<flan> And now I clear the stage for the next session.
<flan> Thank you for your patience and interaction, everyone.
<flan> Okay, so I've got the channel to myself, to bend to my twisted, evil whims.
<flan> Excellent.
<flan> Now I just need some twisted, evil whims.
<flan> Anyone else want server access?
<flan> Just costs an OpenID URL.
<flan> (Your OpenID provider retains rights to your soul and banking information)
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
<rooligan> byebye
#ubuntu-classroom 2010-10-01
<jonasfa> where can I find this channel's history?
<jpds> !logs
<ubot2> For Ubuntu Classroom logs, please visit http://irclogs.ubuntu.com
<jonasfa> thank you very much :)
<akgraner> Two minutes til start time...
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: When and how to schedule releases using Launchpad - Instructors: mterry
<mterry> Looks like 14:00 UTC.  Welcome to the "When and how to schedule releases using Launchpad" talk!
<mterry> I've got some prepared notes that I'll go through, but feel free to ask questions in #ubuntu-classroom-chat
<mterry> First a quick background of who I am.  I'm Michael Terry, I work in the Desktop team at Canonical.  But more relevant for this talk, I've maintained several projects in the past.  I have maintained some small apps (xpad, gmult) as well as an app that has become more popular (deja-dup).
<mterry> So I'll talk a bit about release management, different ways of scheduling releases, and a bit about how to use Launchpad to help with that
<mterry> There are two common release strategies: feature based and time based.  I've used both, sometimes on the same project at different times.
<mterry> Feature based tends to be the strategy most application developers use when starting personal projects.  You're just hacking away by yourself until it's functional.  Then you release.
<mterry> Maybe next you get some bug reports or an idea for a feature, and you hack away again until that new feature is done or some common crash bug is fixed.  Then you release.
<mterry> This is a pretty common cycle and is very good for getting stuff out the door.  It's simple, easily understood, and only requires that you be able to decide what features or bugs a release will wait on.
<mterry> Of course, you need agreement about what the release criteria are, but I'll get to that later
<mterry> Another popular method is a time based release schedule.  This is where you say, I'm going to make a new release every month, or every 3 months, or whatever.
<mterry> This method is in vogue for many of the big open source projects, like Ubuntu, Fedora, and GNOME.
<mterry> It makes it easy to plan releases with lots of moving parts and developers, since the schedule and release criteria are obvious to everyone.
<mterry> Lots of joiners.  Were you all interested in this talk?  Should I briefly recap?
<mterry> OK, moving on until I see some complaints
<mterry> As for pros and cons...
<mterry> I find that when I'm using a feature based schedule, I have a habit of making changes until the last minute and potentially introducing bad bugs.  This tends to happen because the release can happen any time after the last feature gets committed
<mterry> That's when I end up making 'brown paper bag' followup bug fix releases (i.e. you were a brown paper bag over your head in shame).
<mterry> That's one benefit of the time based schedule: you can plan 'baking' time into your schedule and say, "no more feature work during the last month.  Just bug fixes."
<mterry> Of course, you can do this with feature releases too and just say that after the last feature is done, you'll just sit on the code for a month.  But in practice, I find that doesn't happen.
<mterry> But feature schedules are useful too.  I generally prefer feature based releases for the first 6 months or year of a project.  That's when the most churn happens and you have less users affected by potentially less careful releases.
<mterry> It lets you iterate very fast on often incomplete code.  I recommend it for most starting/small/personal projects.
<mterry> If you do choose a time based schedule, don't make it stressful one.  Most projects seem to use 6 months, and that's about right.  Maybe with monthly checkpoint releases.  And most of the feature work front-loaded.
<mterry> But whatever, it's a matter of personal preference and what works for you.  I've got a link to a really fascinating Ph.D paper studying how different projects have used different schedules, analyzing optimal cycle lengths for time based projects, and the like.  http://www.cyrius.com/publications/michlmayr-phd.html
<mterry> Any questions?  Or is 14:00 UTC too early?  :)
<mterry> I've used feature releases early on several of my projects then switched to time based as it became popular, more polished
<mterry> Time releases are very good for making sure regressions don't appear (easier for testers to plan on releases)
<mterry> And generally good for a project in 'maintenance mode'.  You can still add big features, it may just take more than one cycle to finish landing it
<mterry> Especially once you get more contributors than just yourself, it really helps to have a common schedule
<mterry> It can be frustrating as a maintainer to be holding a release for a feature from someone else in this inherently asynchronous development style that FOSS projects have
<mterry> With time releases, they either get it in on time or not, but the release can go forward
<mterry> Also, I highly recommend the Ph.D paper link I gave earlier if you're interested in this stuff.  It's very interesting reading (once you get to the findings part)
<mterry> OK, on to a quick introduction of Series and Milestones!
<mterry> However you decide to release, Launchpad has some simple tools to make keeping track of planned work.  Namely, Series and Milestones.
<mterry> Series are just separate 'branches' of development.  Say you release version 14 of your software and start work on version 15.  Now you need to be able to separate maintenance work on 14 from new feature work in 15.
<mterry> If a critical bug is found in 14, you want to be able to keep track of that fact and keep a snapshot of 14's code around to make it easy to make further bug fix releases from it.
<mterry> That's what Series do.  They're a place to keep code and bugs separate from other series.
<mterry> If you want to play around with Launchpad's series or milestones, open https://staging.launchpad.net/
<mterry> It's a testing version of launchpad where they throw away any modifications each day
<mterry> So you can screw around and create a project, add series and milestones, etc.
<mterry> Just to get a feel for it
<mterry> Anyway
<mterry> Milestones are just planned releases.  You may create a milestone for release 15 ahead of time and then you can mark bugs to be fixed by that release.  Milestones are associated with a particular series.
<mterry> I usually find it most convenient to keep a trunk series always around where I do development, and when I release a new stable version, to create a new series for its maintenance lifecycle.
<mterry> This is called a trailing series.  Each release gets spun off after I finish it in trunk.
<mterry> You can also have leading series, where you create a separate unique series for your next release ahead of time.
<mterry> I don't find this nearly as convenient, as a developer, but your mileage may vary
<mterry> You can also mark series as obsolete once you're really done with them (say, you've released a newer stable release)
<mterry> That way they won't show up in the UI.  Otherwise, you'd be drowning in series
<mterry> You can see an example of a more complicated series layout with my project deja-dup (https://launchpad.net/deja-dup/+series).  You can also see that I used to use feature releases until version 14, when I switched to track GNOME's time based releases.
<mterry> And right now, trunk is where the next version (18) is being developed
<mterry> If you're using feature releases, you don't *need* to take full advantage of milestones.  You really probably just care about the next unstable and next stable releases.  So one 'future' milestone fore each series is fine.
<mterry> But if you've got big plans and a whole project roadmap based around features (like 1.0 will have X, Y, and Z, but along the way, 0.5 will mean X is done, 0.7 will mean Y is done, etc), that can be useful
<mterry> The projects I've seen try to do that never hit their targets and always push features back.  Again, it's a lot more reliable to use time based releases, if you're going to be doing all that release planning overhead anyway.
<mterry> Features still get pushed back, but you didn't promise features, only a timely release.  ;)
<mterry> For time based releases, I like to set up all the releases ahead of time as milestones so it's easy to keep track.  I'll often assign bugs that I know I want to finish during this cycle to the last milestone, and adjust that milestone when I actually implement it to the actual release in which it got fixed.
<mterry> Milestone pages on Launchpad are very nice.  They tell you what bugs were/are targeted for the release and what their status is.  Let me dig up a URL
<mterry> https://launchpad.net/deja-dup/16/15.92
<mterry> So here you can see that there were 6 bugs I targeted for the release, the release notes, etc.  Also useful when planning a future milestone, so the whole team can see what bugs the maintainer wants to see fixed for that release
<mterry> For a nice overview of some of this same material, there's actually a nice LP help page:  https://help.launchpad.net/Projects/SeriesMilestonesReleases  It talks about leading/trailing series and how to set milestones up too.
<mterry> That's all the prepared material I had.  I've got *so* much time for your questions about the exciting field of release management!
<mterry> Join #ubuntu-classroom-chat and ask questions like "QUESTION: what's the meaning of life, the universe, and everything?"
<mterry> Again, I just want to pimp the case study done on several FOSS projects and their release methodologies.  It's fascinating stuff!  http://www.cyrius.com/publications/michlmayr-phd.html
<mterry> I'll hang around a bit, in case anyone wakes up.  If you see this talk in your chat logs later and want to talk release-shop, just grab me on IRC sometime or in person at UDS in Orlando
<mterry> jledbetter_ just reiterated in the chat room that coding up to release can be dangerous.  One way to mitigate that is automated tests.  Which is a whole 'nother talk.  But...
<mterry> If you do have test-driven coding, so that features and tests land at the same time, you can be slightly more confident with feature-releases
<mterry> Of course that requires good discipline, and even tiny changes that you don't think need a full test can break things unexpectedly right before a release
<mterry> One thing you could do if you really like feature releases is do a 'testing/alpha release' before each release to let people test it and report back
<mterry> But generally, smaller projects don't have enough of a community to do that.  So I'd say if you're project is small/new, just pump out dangerous feature releases while you are energized and coding like a monkey, until you stabilize, then use time based releases
<ClassBot> jledbetter_ asked: Just to be clear, I can do all kinds of experimentation with https://staging.launchpad.net/ and it'll go away nightly?
<mterry> jledbetter_, Yup.  It's pretty neat.  I don't know when the cutoff is.  00:00 UTC?  But it resyncs from the main instance every day or so
<mterry> It's also pretty slow...
<mterry> But it's a good way to experiment with some Launchpad button if you don't know what it will do first.  :)
<mterry> Alright, thanks everyone.  Hope it was useful!  I expect to see many more well-released projects keeping track of things using proper series and milestones!  :)
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Pollka and the Ubuntu Women Mentoring Partnerships - Instructors: elky, nigelb
<elky> Hi folks!
 * nigelb waves
<AlanBell> hi all
<elky> Some of you might remember earlier this year when the Ubuntu Women team ran some competitions.
<elky> These competitions involved voting, and that voting was collected by a little bit of php that I whipped up over the course of a few mornings.
<elky> This code is what has become Pollka, and which was also used recently by AlanBell for the Ubuntu-UK logo selectoin
<elky> Currently the code resides on Launchpad, https://launchpad.net/pollka
<elky> Pollka is a relatively new project and we only have a few active committers. The aim of making pollka a project is to facilitate mentoring, using launchpad tools, etc.
<AlanBell> ok, so pollka is a php application as elky said
<AlanBell> it stores some information in a database, we are using mysql, but other databases should also work or be fairly easy to plug in
<AlanBell> as it is a voting application on a set of images these also need to be stored somewhere, and we store them on the filesystem
<AlanBell> there are both full size images and thumbnails
<AlanBell> lets take a quick look at a running pollka instance
<AlanBell> http://pollka.libertus.co.uk/
<AlanBell> this is the voting system we used in the UK loco for our new logo
<AlanBell> we put up an assortment of design proposals and voted on the one we liked the best
<AlanBell> I had a bit of fun hacking about with the code, thus the options were "full of win" for pictures you like and "meh" for those you don't like
<AlanBell> part of the point of Pollka is a learning project to hack about with, not a shiny packaged solution where you don't look under the covers
<AlanBell> so installing Pollka starts with getting the code, it is stored on Launchpad in a bzr repository
<AlanBell> launchpad and Ubuntu work really really well together (unsurprisingly)
<AlanBell> so to get the code you would run
<AlanBell> bzr branch lp:pollka
<AlanBell> you might need to install bzr first with sudo apt-get install bzr
<AlanBell> another way to get the code is to use the most awesome groundcontrol project by doctormo
<AlanBell> this is also in the repositories so you can look up groundcontrol in the software centre
<AlanBell> then in /home/myname/Projects in nautilus you can get a project and it will download a copy of pollka for you
<AlanBell> the file db.sql in the repository is a kind of starting database structure
<AlanBell> you can import that into mysql to create a bunch of tables in the right places
<AlanBell> I installed phpmyadmin and imported it through that because I suck at command line stuff
<AlanBell> phpmyadmin is a web based interface to mysql and it makes things really easy
<AlanBell> lets see, I wonder if I can let you have a play with it . . .
<AlanBell> yes, OK
<AlanBell> so I am going to let you log on to my server (which is sitting on top of the bookshelf behind me)
<AlanBell> you will be logging in as the pollka user, so I don't think you will be able to damage anything other than the already closed logo vote
<AlanBell> http://pollka.libertus.co.uk/phpmyadmin
<AlanBell> username polka
<AlanBell> nope
<AlanBell> username is pollka
<AlanBell> password is dmQdLQwsbunjtqwj1
<AlanBell> you might want to copy and paste that one
<AlanBell> on the left you can click the pollka database and see the tables
<AlanBell> everyone there?
<AlanBell> right, everyone is poking about successfully
<AlanBell> if you click on the browse icon next to the conf table you can see various bits of configuration
<AlanBell> feel free to tweak bits, like the site status or the poll name
<AlanBell> have a look at what it dose
<AlanBell> does
<AlanBell> oh noes some hacker has hacked it :)
<AlanBell> have a look at the questions table
<AlanBell> here we list the options available
<AlanBell> I kinda misused the question_author field
<AlanBell> as my poll didn't really have different authors for the 'photos'
<AlanBell> I also hacked about with the image field because the thumbnails are .png files and you click to get the .svg which wasn't in the original poll design
<AlanBell> ok, prevotes
<AlanBell> so, flip back to the front of the site and cast your vote
<AlanBell> what this does is populate the prevote table with a random key and the options you selected
<AlanBell> you will then get an email (from me because of what is set in the conf table)
<AlanBell> on that email will be a link with the random token in it
<AlanBell> when you go to the token URL in the mail the token.php.active page will look up the votes in the prevote page and copy them to the votes table
<AlanBell> there is a certain amount of anonymisation, in the voter table we have the timestamps and IP addresses and email addresses, these don't link directly to the votes cast
<AlanBell> which is kinda good in some ways to voting geeks, but a bit of a drawback if you want to deal with someone who voted twice or something
<AlanBell> it does check on submit that the email is unique
<AlanBell> ok, lets go prod some code now
<AlanBell> https://code.launchpad.net/~pollka-devs/pollka/trunk
<elky> of course if you have ideas on how to improve this, we're happy to help you implement
<AlanBell> on that page you can see a summary of the bzr repostitory
<AlanBell> at the bottom you can see that 8 revisions have been made by different people
<AlanBell> bzr keeps all the versions in check and deals with branches and merges so you can have multiple people working on the code and they don't get in each others way too much
<AlanBell> as nigelb mentioned in the chat, to commit to the repository you need to be in the pollka-devs launchpad team
<AlanBell> anyone can read and take a branch of the repository though
<AlanBell> the great thing about bzr is that you don't have to be scared of breaking anything.
<AlanBell> you can poke about in the code, change things in a way that *you* like and it is easy to maintain your code or push it back to the core project if it is generally useful
<AlanBell> some of my modifications (such as the .png/.svg image pairs) are probably of little interest outside of this particular instance
<AlanBell> others however (like a security patch to prevent SQL injection hacks) are of general interest so got pushed back
<elky> QUESTION from daker: i see two conf keys, site_status and fave_status, what do they mean ?
<AlanBell> daker: the fave_status controls the second vote you have at the bottom
<AlanBell> so for each image you can give it +1 or +0
<elky> The site can be enabled or disabled for voting, thats site_status
<AlanBell> and then at the end you can give your absolute mostest favouritest picture an extra +1
<AlanBell> or turn that feature off
<AlanBell> http://bazaar.launchpad.net/~pollka-devs/pollka/trunk/files
<elky> the main pollka branch has a basic admin panel, i dunno if AlanBell's mutant does or not though
<AlanBell> my mutant has that removed
<AlanBell> good point though, the admin.php was there so you don't have to go tweak too much directly in mysql
<AlanBell> ok, so looking further into the repostory at the link above we can see the files that make up the application
<AlanBell> there is admin.php which is the admin console
<AlanBell> the main site is the index.php files (the site has two modes, index.php.active and index.php.inactive)
<AlanBell> there are the results pages
<AlanBell> http://pollka.libertus.co.uk/results.php
<AlanBell> a stylesheet which I tweaked to fit with the new ubuntu branding, I think the default pollka one is less ubuntuish
<AlanBell> and there are the token.php files for processing votes
<AlanBell> in the includes folders there are some other files including the one that connects the php files to the mysql database
<AlanBell> http://bazaar.launchpad.net/~pollka-devs/pollka/trunk/annotate/head:/includes/dbcon1234567890.php
<AlanBell> which includes the classic elky code "die('Could not connect to the database. No pony for you: ' . mysql_error());"
<AlanBell> it is also the file in which you edit to add the mysql username and password you want it to use when talking to the database
<AlanBell> http://bazaar.launchpad.net/~pollka-devs/pollka/trunk/annotate/head:/index.php.active
<AlanBell> that is the main file that does the work of presenting the list of options to the user
<AlanBell> the observant will spot several places where there are hard coded references to the original competition
<AlanBell> 38
<AlanBell>  $subject = "Your World Play Day 2010 Photo Competition Vote";
<AlanBell> for example
<AlanBell> these should all be recoded as stuff to go in the conf table
<elky> heh, i really should finish fixing all that some time
<AlanBell> there are plenty of things that need doing with this code, which is fine
<elky> (note, hardcoding is bad. this was done in a hurry :P)
<AlanBell> the project is now a mentoring and learning testbed
<AlanBell> or sandpit
<AlanBell> the project is kinda small, with little bugs here and there, ideal as a starter project to get to grips with php
<AlanBell> and bzr
<AlanBell> and relational databases
<AlanBell> and ubuntu packaging
<elky> we should probably close up the tutorial bit now and move on to explaining the UW mentoring partnership program
<AlanBell> and launchpad bug system
<AlanBell> yup
<AlanBell> so it is a lovely little project with lots of stuff to do on it
<AlanBell> started in the Ubuntu-Women project and it is now a mentoring subject for that project
<AlanBell> http://wiki.ubuntu-women.org/MentoringFAQ
<elky> Pollka is like a proof of concept project for the mentoring framework we're trying to morph ^that in to
<elky> https://blueprints.launchpad.net/ubuntu-women.org/+spec/community-n-ubuntu-women-mentor-partnerships
<elky> I'll be talking with people later this month at the Ubuntu Developer Summit on the topic of refining the mentoring partnershps blueprint
<elky> I'd love to see feed back from people on the wikipage linked from there. What do you want from mentoring, etc.
<elky> We're also open to hearing from other applications who may want to partner with us to provide clear pathways for the UW team to guide its members along.
<elky> Ok, any questions for the next 5 mins or so?
<AlanBell> where can we find out more elky?
<elky> sbout?
<AlanBell> pollka
<elky> pollka.net
<AlanBell> yay, a wiki, so anyone can contribute to the documentation as well as the code
<elky> thanks for helping host this session AlanBell. its been much more coherent than my cold-addled brain would have managed
<AlanBell> :)
<AlanBell> I will be changing the mysql password on that database later
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
<Braber01> QUESTION: where can I learn more about TCSH?
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Posting into social networks from your app - Instructors: kenvandine
<kenvandine> ok, so lets get started here
<kenvandine> I am Ken VanDine, an engineer on the Ubuntu Desktop team and a Gwibber developer.  Today we'll talk about desktop integration with social networks, by adding social features to desktop applications.
<kenvandine> an introduction to libgwibber
<kenvandine> What is libgwibber?
<kenvandine> libgwibber is a library to provide applications access to the gwibber desktop service.  It is very important to us to be able to integrate a wide variety of desktop applications with gwibber.  The end goal being as transparent as possible, and simplifying the social experence on the desktop.  We want the users to be able to easily interact with their friends via social networks while be contextually relevant.  For example w
<kenvandine> hen you are browsing photos of your kids 1st birthday party in shotwell, you might want to tag some of your friends that attended the party.  Instead of going to the facebook website, uploading photos and then tagging, you should be able to do it right there while you are already viewing or even while importing the photos from your camera.
<kenvandine> Let me give you a concrete example to help illustrate why you should care.
<kenvandine> *you* being an application developer
<kenvandine> Wouldn't this just rock?
<kenvandine>  * Plug in your camera
<kenvandine>  * shotwell (or your favorite photo library tool) pops up and prompts you to import photos
<kenvandine>  * You select the photos you want to import into your library
<kenvandine>  * Add comments below the previews
<kenvandine>  * Tag friends in the photos
<kenvandine>  * And choose to share or not automatically after importing (sharing being uploading to some default online album, like facebook)
<kenvandine> in that scenario, the user is already doing something with their photos, so it makes sense to integrate other things they might want to do in the work flow
<kenvandine> Ok, enough talking about why we want to do this... chances are if you are here you probably already understand.
<kenvandine> Lets talk about how you can use libgwibber in your application.
<kenvandine> Unfortunately the gtk-doc generated docs aren't very useful yet, and if someone wants to help get the annotations in the vala code to make it into the generated C code so gtk-doc can pick it up, please let me know :)
<kenvandine> we really need to figure out how to generate developer docs for the API for C, vala, mono and python
<kenvandine> tricky :)
<kenvandine> There is libgwibber, and libgwibber-gtk.  I think most people will just use libgwibber-gtk, which provides gtk widgets you can just drop into your application.
<kenvandine> Currently libgwibber-gtk only includes an Entry widget, which includes:
<kenvandine>  * text input box
<kenvandine>  * character counter
<kenvandine>  * account target bar with toggle buttons for accounts
<kenvandine>  * send button
<kenvandine>  * url shortening
<kenvandine>  * and online/offline detection
<kenvandine> to answer rooligan's question, libgwibber is written in vala which builds a shared library
<kenvandine> which works with C, and we include mono bindings and with introspection python
<kenvandine> moving on
<kenvandine> Screenshot of the entry widget in use:
<kenvandine> http://blogs.gnome.org/kenvandine/files/2010/08/libgwibber-entry-1.png
<kenvandine> that is just a simple gtk window with the entry widget
<kenvandine> This can be embedded anywhere you could put a VBox (Gwibber.Entry is based on Gtk.VBox).
<kenvandine> you'll notice it looks very similar to the input on the bottom of the gwibber client UI
<kenvandine> the goal has been to replace the python one with this one to consolidate the code base
<kenvandine> but it didn't play too well with the gwibber client for some reason, related to introspection and gtk
<kenvandine> it'll happen for gwibber 3.0 though
<kenvandine> lets look at some snippets of code
<kenvandine> embedding the gtk widget should be simple, and as we add more widgets we will make sure we keep it just as simple
<kenvandine> Vala:
<kenvandine> var entry = new Gwibber.Entry ();
<kenvandine> your_container.add (entry);
<kenvandine> C:
<kenvandine> include <gwibber-gtk.h>
<kenvandine> ...
<kenvandine> GwibberEntry* entry = gwibber_entry_new ();
<kenvandine> gtk_container_add ((GtkContainer*) your_container, (GtkWidget*) entry);
<kenvandine> and for getting the CFLAGS and all, if you are using autotools just added a pkgconfig check for gwibber-gtk
<kenvandine> Mono:
<kenvandine> Gwibber.Entry entry = new Gwibber.Entry ();
<kenvandine> YourContainer.Add (entry);
<kenvandine> and
<kenvandine> Python:
<kenvandine> from gi.repository import GwibberGtk
<kenvandine> ...
<kenvandine> entry = GwibberGtk.GwibberEntry()
<kenvandine> your_container.add(entry)
<kenvandine> in these examples, "your_container" could be anything gtk container
<kenvandine> a window, etc
<kenvandine> so could nest it in your app so it automatically shows/hides based on either what the user does or even if the gwibber service is available and configured
<kenvandine> so you could hide it if there are no accounts available
<kenvandine> this is what the MeMenu in Ubuntu does, that posting entry is only displayed if you have accounts configured in gwibber
<kenvandine> so users that don't use gwibber won't even see it
<kenvandine> libgwibber provides a signal to watch
<kenvandine> for some complete examples, you can look in the examples directory in a bzr checkout of lp:gwibber/libgwibber
<kenvandine> or
<kenvandine> http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/entry-vala.vala
<kenvandine> http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/entry-mono.cs
<kenvandine> http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/entry-c.c
<kenvandine> http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/entry-python.py
<kenvandine> hopefully this is helpful
<kenvandine> i think for most developers, embedding the entry widget will accomplish the goal
<kenvandine> and add value to your application as well as helping us make ubuntu more social
<kenvandine> for the natty cycle, we will be adding more widgets
<kenvandine> i hope pieces needed to add the experience i described earlier to shotwell
<kenvandine> we need image uploading added to gwibber and some sort of contact selector that aggregates sources for picking friends
<kenvandine> there will also be account/stream selector widgets as well as stream view widgets
<kenvandine> the stream view is what you see in the current gwibber client, where it renders the posts
<kenvandine> and the navigation on the left is the stream selector
<kenvandine> we'll make those into libgwibber-gtk widgets and then then client will just consume those widgets
<kenvandine> hopefully that will come with a fresh new look to the client :)
<kenvandine> now on to libgwibber
<kenvandine> If you want to use the gwibber service without using the Entry widget, you can use libgwibber for more direct access.
<kenvandine> i'll talk about a few of the most common tasks you might want in libgwibber
<kenvandine> Gwibber.Service object includes:
<kenvandine>  * version() # returns the version of the currently running gwibber-service
<kenvandine>  * refresh() # triggers a refresh
<kenvandine>  * quit() # shuts down gwibber-service
<kenvandine>  * send_message("Some string to post") # posts a message to all account that have send_enabled = True
<kenvandine>  * is_available # signal you can connect to so you can find out when the service comes online (sends a bool)
<kenvandine> Gwibber.Accounts object includes:
<kenvandine>  * list() # lists accounts
<kenvandine>  * send_enabled("account_id") # toggles send_enabled state of the given account
<kenvandine>  * lookup_by_id("account_id") # returns account attributes for a given account
<kenvandine>  * account_updated # signal which sends an account when it has been changed
<kenvandine> Gwibber.Service is about interacting with the service, making it do things for you for example
<kenvandine> Gwibber.Accounts is for retrieving or manipulating accounts
<kenvandine> for example, if you want to show/hide a posting widget (like the entry widget we talked about earlier)
<kenvandine> you would connect to the Gwibber.Service.is_available signal
<kenvandine> when you get a True from that signal, you would query Gwibber.Accounts.list() and find accounts that are enabled
<kenvandine> if there are any, then display it
<kenvandine> on the converse, after you show the entry
<kenvandine> if you get a False from Gwibber.Service.is_available, you can hide it
<kenvandine> or destroy
<kenvandine> whatever
<kenvandine> also, you could connect to the account_updated signal, so you can see when accounts change and hide/destroy when there are no longer any accounts enabled
<kenvandine> for example
<kenvandine> libgwibber uses GObject introspection for python support,  which is still quite new and some of the libgwibber methods don't behave well.  Fortunately the Gwibber.Service methods, which are generally what most application developers will want, work fine.  This will improve for natty.
<kenvandine> so for example if you use python and want to get a list of accounts, it will crash :/
<kenvandine> it isn't handling the conversion of the resulting data type
<kenvandine> a known problem area with python and gobject introspection
<kenvandine> however, all the methods interacting with the service work
<kenvandine> which is what you will most like care about
<kenvandine> Here are some examples:
<kenvandine> http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/example-vala.vala
<kenvandine> http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/example-mono.cs
<kenvandine> again, you can find those in a bzr checkout in the examples folder
<ClassBot> rooligan asked: For which programming language is libgwibber?
<kenvandine> whoops
<kenvandine> rooligan asked "How to install libgwibber?"
<kenvandine> libgwibber0 is included in maverick by default, to get the gtk widgets just install libgwibber-gtk0
<kenvandine> actually to build against it, you'll want libgwibber-gtk-dev or libgwibber-dev
<kenvandine> to use it with python you'll need gir1.0-gwibber-gtk-0.0 and/or gir1.0-gwibber-0.0
<kenvandine> for mono you'll need libgwibber-gtk0.0-cil-dev and/or libgwibber0.0-cil-dev
<kenvandine> any more questions?
<kenvandine> or does anyone have applications in mind they might want to hack on adding social features?
<kenvandine> i would love to find areas people are interested, especially if they might require adding functionality to gwibber/libgwibber that isn't already there
<kenvandine> or maybe if anyone wants to work on shotwell :)
<kenvandine> ok, no more questions then...
<kenvandine> i'll post the bulk of the content from here on my blog later today, which you can find on planet.ubuntu.com
<kenvandine> you can find me most anytime in #ubuntu-desktop
<kenvandine> please feel free to ping me anytime with questions or suggestions
<kenvandine> or if you want to contribute to gwibber, libgwibber or any other application
<kenvandine> thanks everyone for your time!
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Automating tasks with Launchpad, Tarmac and Source Package Recipes - Instructors: rockstar
<rockstar> Hi folks.  My name is Paul Hummer.  I'm a contributer to the Launchpad project, and I happen to also get paid for it, so that works out nicely.
<rockstar> First, give me a second to read about this new-fangled ClassBot thing.
<rockstar> Okay, let's get started.
<rockstar> Today, I'm going to talk to you about automating the really menial tasks that come as part of working on a free software project.s
<rockstar> The less time you spend working on menial things, the more time you can use to write code and do awesome things.
<rockstar> DISCLAIMER: Date math is hard. It turns out that I signed up for a time that overlaps when I want to eat.
<rockstar> This means that if I paused for a bit, it's because I'm attempting to force food into my mouth.  Feel free to ask questions during this time.  It makes me look not quite as bad.  :)
<rockstar> I'm assuming everyone here has a bit of understanding with regards to Launchpad.
<rockstar> If you don't have any idea what Launchpad is, well, you might be a little lost.
<rockstar> Some of the features of Launchpad that I'm going to talk about today are relatively new, and we still consider them either "in beta" or "we're just barely talking about making them."
<rockstar> Rest assured, those features are coming.
<rockstar> Does anyone here have a project they've got in mind as I talk about automating tasks with Launchpad?
<rockstar> (I ask because most of my projects already use a lot of these practices, so it's kinda hard to walk through the transition)
<rockstar> Okay, well, I guess we'll move ahead with a hypothetical project.
<rockstar> Let's say that Sarah Jane is an opportunistic hacker who used Quickly to set up her project.
<rockstar> She didn't realize that there would be so many contributors to her little project, but it becomes very popular.
<rockstar> Poor Sarah Jane spends more time reviewing code from merge proposals and merging the code than she does actually coding.
<rockstar> Sarah Jane will (not might) eventually get burned out playing gatekeeper.  She likes to code (and she's better at that anyway).
<rockstar> Code reviews themselves can't be automated.  They NEED a person to look at the code.
<rockstar> (This is because code is for people, not for computers.)
<rockstar> However, once the code has been approved by Sarah Jane, she doesn't want to futz with it anymore.
<rockstar> Sometimes she forgets to run the tests or check that the build is working before committing.
<rockstar> Side note: We live in a DVCS world. The days of having a broken trunk are over.  If your trunk is broken, you are doing it wrong.
<rockstar> Okay, so Sarah Jane has a list of reviews she needs to do.  She goes through, votes on them, and the ones that she approves can be set to "Approved."
<rockstar> Enter Tarmac, which you can find at http://launchpad.net/tarmac, with the code being found at lp:tarmac.
<rockstar> Tarmac is a really simple script that will automate merges for you.
<rockstar> QUESTION: Merges might still introduce a broken trunk, no?
<rockstar> No.  They shouldn't.  I will show you why.
<rockstar> Also, this ClassBot thing seems to be really helpful if you'll preface your questions with QUESTION.
<rockstar> So Sarah Jane sets up Tarmac to manage all the merges against lp:project.
<rockstar> When run manually, tarmac can be invoked like this: `tarmac land lp:project`
<rockstar> If you're going to manage multiple branches, you'll want to configure tarmac to know a bit more about the branches, which you can find out about in the documentation.
<rockstar> The docs can be found here: http://bazaar.launchpad.net/~rockstar/tarmac/main/annotate/head:/docs/introduction.txt
<rockstar> I have this on a cron job currently, and it runs every 5 minutes.
<rockstar> Tarmac self hosts itself too.
<rockstar> In this case, when Sarah Jane runs tarmac, it looks for all the branch merge proposals in a "Approved" status that ALSO have a commit message set, and will merge them all automatically, one by one.
<rockstar> But wait!  What if these merges cause breaks in the trunk?
<rockstar> Tarmac can be configured to run a command AFTER the merge but before a commit.
<rockstar> For instance, let's say you want to make sure `make` completes.  You can configure Tarmac to run make, and if everything is successful, it'll merge the branch.  Otherwise, it'll kick it out and comment on the merge proposal, saying something like "Dude, your branch is broken. Get your act together."
<rockstar> Tarmac itself has a small suite of tests that we never want to break, so when Tarmac does it's own merges, it makes sure to run the tests.  If the tests fail, the branch fails, and doesn't get merged.
<rockstar> Robots are MUCH better at doing these menial things than we are.  We get bored merging and make-ing and testing and all the things you have to do to maintain a pristine trunk.
<rockstar> There's also something else really awesome about this.
<rockstar> When I upgrade the Tarmac instance's OS from Lucid to Maverick, the tests underneath broke, so trunk was technically "broken"
<rockstar> Tarmac worked fine on Maverick, but the tests didn't.  This meant that no branches could be merged until the tests were fixed.
<rockstar> It's kind of a "Stop the line" situation.
<rockstar> Sarah Jane pointed Tarmac at her branches and then went back to coding and reviewing code.  Everything is automated.
<rockstar> CAVEAT: The system Tarmac uses to merge branches wasn't really meant for what Tarmac does to it.
<rockstar> Because of this, in the next little while, Launchpad will be gaining a feature called "merge queues."  Basically, when you're ready for the branch to be merged, you stick it in the queue.
<rockstar> Then tarmac just looks at the queue and merges that way.
<rockstar> This is what I'm currently spending my days working on, so I'm quite excited about the feature.
<rockstar> Okay, so tarmac is merging branches automatically.
<rockstar> How does Sarah Jane get her software into the hands of people that use it.
<rockstar> As a practice now, I personally NEVER do `make install` or `setup.py install` or whatever.  If it's not packaged, I'm not installing it.
<rockstar> So Sarah Jane needs to get it packaged.
<rockstar> Sarah Jane has some packaging data, but she doesn't want to keep that data in trunk, because it's very OS specific.
<rockstar> What she needs to do then is create a branch of trunk, and add the debian/ folder to that branch.
<rockstar> Has anyone here used the source package recipe feature in Launchpad?
<rockstar> Or maybe a better question, has anyone here even HEARD of the source package recipe feature in Launchpad?
 * rockstar fails
<rockstar> Source package recipes are "recipes" that allow you to say "hey, I have these branches that all need to go together.  Whatever working tree that makes needs to be made into a package."
<rockstar> So Sarah Jane can go to her trunk page and click the link that says "Create source package recipe."
<rockstar> She's then confronted with a bunch of options, including the ability to build her package every day (!).
<rockstar> At the bottom, she's given a default recipe, which is basically the trunk branch.
<rockstar> The trunk branch doesn't have the debian/ folder there, so we need to merge in Sarah Jane's packaging branch.
<rockstar> So the recipe will be something like this:
<rockstar> lp:project
<rockstar> merge lp:~sarah-jane/project/packaging
* You're now known as ubuntulog
<rockstar> The working tree that is created is then sent to the PPA builders.
<rockstar> Sarah Jane didn't necessarily want to build the package every day, but did want to build the package after Tarmac makes a merge run.
<rockstar> She can configure Tarmac to request a build of her package recipe after Tarmac merges all the branches from a single run of `tarmac land`
<rockstar> Oh snap.  I should mention that, as it currently stands, you'll need to be on the "edge" servers in order to create and edit source package recipes.  This is because they are still technically "beta."
<rockstar> So let's look at what Sarah Jane's little project is doing now.
<rockstar> Someone proposes a merge into her trunk branch.
<rockstar> Sarah Jane looks at the merge, and she's glad to have the patch.  She votes "Approve" and sets the merge proposal to "Approved."
<rockstar> 10 minutes later, when the tarmac cron job is invoked, Tarmac finds the approved merge and merges it.
<rockstar> It then runs all the tests to make sure that there's nothing fundamentally broken about the merge.
<rockstar> Tarmac is happy with the merge, and commits.
<rockstar> Tarmac continues on, merging and committing other approved merges.
<rockstar> After Tarmac is finished on the branch, it requests a build of Sarah Jane's source package recipe.
<rockstar> 30 minutes later, Bob gets an update alert for the new package that's available in Sarah Jane's PPA.
<rockstar> He installs the updated version and finds some new features in the app he's testing out.
<rockstar> So in a matter of a few hours, you have your bleeding edge features into the hands of your most loyal users, through a package management system that allows them to downgrade should they find a heinous bug.
<rockstar> And even when they do find a heinous bug, the update is only a few hours away from the approved merge.
<rockstar> Any questions?
<rockstar> Alright, thanks everyone!
<matti> I hope that people are sitting comfortably.
<matti> :-)
<matti> Hello everyone!
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Infinity and beyond - gentle introduction to Ruby - Instructors: matti
<matti> My name is Krzysztof Wilczynski
<matti> And I will talk today about Ruby.
<matti> A little bit about the history of the language, a little bit about community that surrounds it and a little bit about the language itself.
<matti> Yet, this talk is not really a complete language tutorial.
<matti> Please, feel free to ask any question as we go forward ;-)
<matti> What is Ruby?
<matti> Ruby is a modern general purpose language.
<matti> Fairly young too.
<matti> Ruby is often referred as "scripting language" - which to some extend is true, nevertheless it is a turing-complete full-blown programming language.
<matti> Written completely in C.
<matti> Ruby offers multiple you as the author to chose between functional, structural and object-oriented programming techniques.
<matti> This allow you to create from a very small script which you need to solve particular problem i.e. parse some log etc.
<matti> To a complex web applications interacting with multiple systems and providing extensive API etc.
<matti> Ruby has rapid development model and its relese cyclce is less strict and more relaxed that what some other languages have, for example Python.
<matti> As quite mature project right now, you can enjoy Ruby on multiple platforms even that its development is mainly on Linux.
<matti> There are version for UNIX, Mac OS X, BeOS even OS/2 and much more :)
<matti> Ruby is fully object-oriented and one of its principles is that everything is an object.
<matti> Including all the primitive types like Integer and String etc
<matti> We have automatic memory management and garbage collection (which uses a mark-and-sweep implementation of the garbage collector).
<matti> Ruby also offers exception handling, operator overloading.
<matti> By design Ruby does not allow for multiple inheritance -- like Java for example -- but this can be solved by using Mixins -- more about that later.
<matti> Another great principle that can be found in Ruby is minimalism -- code less do more.
<matti> And Ruby -- as well as other dynamic languages -- really allows you to save time and effort.
<matti> As a dynamic language, Ruby is interpreted during the run-time, therefore not compiled.
<matti> Being dynamic language, Ruby lacks strong types declaration in favour of duck-typing and there is not explicit scope declariation too.
<matti> Ruby is excellent at text processing thanks to build in support for regular expressions -- it is build into the language core, not as a separate library. This is similar to what Perl offers.
<matti> A little bit about Ruby's heritage, so we can understand the language better :)
<matti> Ruby was influenced by Perl -- idea for build-in regular expression engine and amazing flexibility, Lisp -- functional programming, Eiffel, Ada, Smalltalk -- most of Object-Oriented principles and closures and CLU -- iterators.
<matti> Thanks to all the wealth that Ruby inherited from other great languages, I sometimes say that "Ruby is Python for Perl developers".
<matti> As the author of Ruby describes it: "Ruby is simple in appearance, but is very complex inside, just like our human body."
<matti> Some other people have said similar things too :)
<matti> "Ruby > (Smalltalk + Perl) / 2" by Michael Neumann
<matti> "Ruby is two parts Perl, one part Python, and one part Smalltalk" by Colin Steele
<matti> So, how Ruby compares to other languages?
<matti> Quite often people refer to Ruby as being not "fast enough" or "slow" etc.
<matti> There is a grain of truth it this statement.
<matti> Ruby of course as dynamic language will always be slower than Java or C, for that matter.
<matti> Nevertheless the core of the language was written in C.
<matti> For example, Ruby does not pre-compile to byte code like Python does -- the famous .pyc files.
<matti> This is not entirely true -- but I will talk about that later.
<matti> Ruby was design to be used for scripting and small applications.
<matti> Which do not have long life-span in general.
<matti> This can be seen in the way how Ruby manages memory and how its gargabe collector works.
<matti> Quite similar to Perl in fact.
<matti> For anyone who is interested in some real tests considering Ruby's perfomance in terms of how Ruby stands next to other languages, please take a look on: http://shootout.alioth.debian.org/.
<matti> There is of course a flip side.
<matti> Speed vs Productivity -- the good old "apple vs oranges" problem, so to speak.
<matti> Ruby might not be the most perfoment langauge.
<matti> Or the easiet one.
<matti> Or the most popular one.
<matti> But most certainly it does contribute to the way how you and other people using it work.
<matti> Most often it will shorten the create-edit-compile-debug cycle.
<matti> Which allows people to create software quicker and with less hassle.
<matti> This is because Ruby is highly dynamic and has very open nature.
<matti> Yet, everything comes with the price -- dynamic languages can be unpredictable. This is also true for Python :)
<matti> Everything happens in the run-time, therefore you will find out about potential issues only when you application will stumble into them.
<matti> When many people look at Ruby for the very first time, they will most certainly notice its unique syntax.
<matti> Things like the BEGIN {} and END {} blocks also known from awk and Perl.
<matti> The infamous "begin" and "end" plus "do" and "end" which look like our good old friend Pascal a little :)
<matti> Actually, some people do not like that sort of thing, hence they think that Ruby is ugly :-(
<matti> We also have { } to denote code blocks which you have seen in C and Java and many others.
<matti> Among many things unique to Ruby few may stand-out.
<matti> One would be Ruby's license.
<matti> Ruby is a Free Software, with a GPL and Artistic License. Quite the same as Perl.
<matti> I was wondering myself whether Perl's influence on Ruby has anything to do with that :)
<matti> Another interesting principle that Ruby tends to follow is "POLS".
<matti> The "Principle of least surprise" -- aslo know as "LOLA" :-D or "Law of least astonishment".
<matti> What is basically means is simple in its nature: what you see and what you think your code will do and how it will behave is probably what you will get.
<matti> There are also the famouns method suffixes ? and !.
<matti> ? - is usually used for methods that test for something and/or for particular condition and they should return boolean (true/false) back to us.
<matti> ! - denotes a "destructive" method which will modify the content of the variable on which the method was called.
<matti> Ruby lacks ++ and -- for the pre and post incrementation of numeric values.
<matti> Therefore we have to use these operators explicitly: a = a + b or a += b.
<matti> That is the Ruby way.
<matti> Ruby will pass everything as reference to object, therefore there is no such thing as concept of Perl's scalar.
<matti> There is also the "splat" operator denoted as * which allows to work or lists (arrays) and pass variable length parameters to methods.
<matti> Ruby also has symbols -- an immutable strings that are initialized only once when defined. They are said to be frozen.
<matti> Quite useful when used in conjuction with associative arrays.
<matti> Ruby itself comes in different shapes and forms...
<matti> Most popular implementations of Ruby interpeter are:
<matti> MRI (for the 1.8 family) also know as "Matz's Ruby Interpreter"
<matti> It is the most stable version of Ruby sometimes called CRuby.
<matti> YARV (1.9 family) also known as "Yet another Ruby VM" and/or KRI "Koichi's Ruby Interpeter" after the author of new Ruby Virtual Machine implementation.
<matti> Going back to the Ruby perfomance here.
<matti> MRI vs YARV -- YARV optimizes a lot by compiling everything into internal byte-code - almost like Python and mentioned .pyc files (although, Ruby does not create .rbc files as a side effect :-]).
<matti> YARV also supports native operating-systems threads on the contrary to Green Threads that MRI has. Unfortunately, similarly to Python, YARV suffers from GIL issues :-(
<matti> There is also REE (based on MRI) "Ruby Enterprise Edition" maintained by a company called Phusion.
<matti> http://www.rubyenterpriseedition.com/ -- more about REE and Phusion and what they did to Ruby and its community.
<matti> JRuby -- an implementation of Ruby interpreter in Java http://jruby.org/
<matti> IronRuby -- Ruby for the .NET platform http://ironruby.net/
<matti> MacRuby - very cutting-edge version which has a lot of experimental features. Maintained mainly for Mac OS X. http://www.macruby.org/
<matti> Rubinius -- a completely different implementation of the Ruby Virtual Machine http://rubini.us/.
<matti> And there is also Cardinal which is a Ruby interpreter ported for the Parrot Virtual Machine http://cardinal2.rubyforge.org/
<matti> Little bit about the history of the language itself.
<matti> Ruby was born on the February 24, 1993 and it was created by Yukihiro Matsumoto.
<matti> http://deadbeef.info/tmp/talk/matz.jpg -- a picture of Yukihiro also known as Matz in the community.
<matti> As he puts it: "I wanted a scripting language that was more powerful than Perl, and more object-oriented than Python".
<matti> So in more or less chronological order:
<matti> 1993 - on February 24 the language was born and the first "Hello World" in Ruby was created
<matti> 1994 - in December the first alpha version was released to public
<matti> 1995 - in December the first public release version 0.95
<matti> 1996 - in December version 1.0 was released
<matti> 1999 - version 1.4 was released
<matti> By this time, Ruby was used mostly in Japan...
<matti> 2000 - the "Programming Ruby" book published and the comp.lang.ruby was created on Usenet -- after this Ruby gained more popularity outside Japan
<matti> 2001 - version 1.6 was released and the "Ruby in a Nutshell" book published
<matti> 2002 - the "Ruby Developer's Guide" book was published
<matti> 2007 - on December 26, YARV by Koichi Sasada was officially merged into main Ruby code tree making 1.9 faster and better
<matti> And as we can see... by the 2010 Ruby is very much alive and well :)
<matti> This nicely reflects the popularity of Ruby:
<matti> In terms of users...
<matti> 1993 - 1 -- before first public release of Ruby
<matti> Here, the only user was Matz :)
<matti> 1995 - 100  -- after first public release mainly local to Japan
<matti> 2000 - 10 000 -- after first book about Ruby was published
<matti> First book helped Ruby gain momentum...
<matti> Especially, after first translation to English was published.
<matti> 2005 - approximately 100 000 -- when Ruby On Rails was born by David Heinemeier Hansson
<matti> Now.
<matti> In 2005 when Ruby on Rails was introducted to the World.
<matti> Ruby suddenly picked up a lot of attention world-wide.
<matti> So then...
<matti> 2008 - approximately 1 000 000
<matti> 2013 - approximately 4 000 000 and more ... this is the estimation made by Gartner :)
<matti> I stronly believe that there is more than 4 mln Ruby users world-wide already.
<matti> We can also look at how popular Ruby is on some web sites used by many people on every-day basis.
<matti> Ruby is the most popular language on http://refactormycode.com/
<matti> Ruby is the most popular on http://snippets.dzone.com/, almost 2115 snippets to date!
<matti> Ruby was tagged 13994 times on Stack Overflow -- with Ruby on Rails being tagged 20766 times :)
<matti> Holding the 10th position on TIOBE Programming Community Index
<matti> Listed 10th on the Programming Language Popularity web site
<matti> Which is nice.
<matti> Since Ruby is quite young and might not be as established as other languages like Java, Python, etc.
<matti> Yet.
<matti> What makes Ruby so amazing.
<matti> Is of course the community.
<matti> All the people using it and behind it.
<matti> There is this famous acronym: "MINSWAN".
<matti> What it means is "Matz is nice, so we are nice". And it was first used by Dave Thomas, one of the Ruby hackers.
<matti> And this spirit is what drives Ruby community.
<matti> I would actually dare to say that Ruby community is a bit like a big family.
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
<matti> And most of the users are like a true care-bears.
<matti> Oh dear.
<matti> :)
<matti> I am half-way my talk and its already the time to end it.
<matti> Well.
<matti> I don't see anything else scheduled, so I will just keep on talking ;p
<matti> As I said, the Ruby community is very nice, friendly and open.
<matti> Even Matz is extremely open towards other ideas and especially towards other languages too.
<matti> He is a Python user for example :)
<matti> http://deadbeef.info/tmp/talk/matz_python.jpg
<matti> There are mailing lists to chose from. Official Forum.
<matti> Of course the IRC channels #ruby and #ruby-lang (including #rvm) on Freenode network.
<matti> There are some very nice and friendly people always keen to help.
<matti> So, please if you want to know something and/or you struggle with something by all means join these channels and ask for help :)
<matti> And... don't ask to ask, just ask :)
<matti> You can of course use Google too ;)
<matti> There are some conferences being organized now and again by Ruby community all 'round the World.
<matti> Most famous are:
<matti> Euruko is the biggest in Europe :) Yay!
<matti> "Ruby Conference" is the biggest in the USA.
<matti> And there is of course the BIGGEST conference called "Ruby Kaigi" held in Japan.
<matti> Ruby community welcomes everyone.
<matti> And every idea.
<matti> There is no such thing like "stupid question" or "dumb idea".
<matti> Ruby folks are forward-thinking and most of them are type of "doers".
<matti> What is very important.
<matti> What what makes me personally proud of being part of the community.
<matti> Is that Ruby does not discriminate and welcomes women!
<matti> And we have some amazing women in the community already.
<matti> Elise Huard -- http://jabberwocky.eu/
<matti> Sarah Mei -- http://www.sarahmei.com/
<matti> Sarah is a great coder and fantastic person looking after Ruby community in San Francisco USA :)
<matti> Now.
<matti> Who is using Ruby the most?
<matti> By the popularity of Ruby on Rais and similar projects.
<matti> This would be all the web developers.
<matti> They also have Sinatra, Camping and many others web frameworks made in Ruby to chose from.
<matti> But.
<matti> What is very nice.
<matti> Is that Ruby is gaining popularity among systems people.
<matti> Systems administrators in particular as a worthy replacement for Perl.
<matti> May system administrator have been using Perl for many years and they pick-up Ruby because of all the nice features it has, plus to them quite often it feels and looks like Perl
<matti> Well, Ruby was influenced by Perl :)
<matti> Projects like Puppet and Chef -- a configuration management and deployment systems greatly improve every-day life of a system administrator.
<matti> These projects push forward aspects of automation and instrumentation nowadays.
<matti> Also worth mentioning is mcollective.
<matti> Amazing project allowing for working with multiple systems and manage them from single node -- it uses meta-infomration provided by for example Puppet allowing for some amaznig things :)
<matti> There are scientists using Ruby too!
<matti> The Monterey Bay Aquarium Research Institute (MBARI) uses Ruby extensively.
<matti> Brent Roman who works there also provides patches that greatly speed-up Ruby and add more features :)
<matti> There is this standing joke in the community that Brent uses Ruby to drive these little sub-marines :P
<matti> I am not sure whether this is true or not ;p
<matti> Who is using Ruby in the "industry" so to speak :)
<matti> Multiple companies... like Amazon, BBC, Cisco Systems, IBM, Oracle, NASA, Siemens, Yahoo! and many more...
<matti> Also the well-known projects and web pages like http://twitter.com/, http://github.com/, http://slideshare.net/, http://www.scribd.com/, http://yellowpages.com/ (yes, them too :D), http://www.alistapart.com/, http://www.hulu.com/ and many more ;)
<matti> Let's talk about the every-day use of Ruby...
<matti> Installing Ruby is really easy.
<matti> Especially when your distribution provides binary packages -- like Ubuntu, Debian, Fedora and others.
<matti> If you need to be on the cutting-edge, a project called "Ruby Version Manager" (RVM) comes to the rescue :)
<matti> RVM was created by Wayne E. Seguin to solve problem of having multiple version of Ruby running multiple modules in the same time in production.
<matti> RVM allows you to do exactly that :)
<matti> Plus it is extremely easy to use.
<matti> Cross-platform -- available for Mac OS X, BSD family and more.
<matti> And it allows you to install all the required rubies without a need for an access to a super-user privileges.
<matti> Everything can be done as user (you) in your local home directory :)
<matti> I personally run RVM with few rubies on my notebook for development and testing ;)
<matti> krzysztof@samsung:~$ rvm list
<matti> ;]
<matti> rvm rubies
<matti> ree-1.8.7-2010.02 [ i386 ] ruby-1.8.7-p302 [ i386 ] ruby-1.9.2-p0 [ i386 ]
<matti> krzysztof@samsung:~$ ruby -v
<matti> ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
<matti> krzysztof@samsung:~$ rvm ree
<matti> krzysztof@samsung:~$ ruby -v
<matti> ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.02
<matti> Quick, nice and easy.
<matti> ;]
<matti> http://rvm.beginrescueend.com/ -- more about RVM :)
<matti> Ruby has many modules to chose from.
<matti> They are called "gems".
<matti> A gem is a special boundle.
<matti> More alike .deb package in Ubuntu or Debian.
<matti> Getting some numbers here...
<matti> Almost 17 000 gems in almost 25 GB worth of data hosted on http://rubygems.org/
<matti> Worth mentioning that on August 31st 2010, Ruby Gems passed the mark of 50th million gems downloaded
<matti> Well done for them!
<matti> :-)
<matti> Almost 9 000 gems on http://rubyforge.org/.
<matti> So there is plenty of modules to chose from in Ruby ;]
<matti> Meaning that you may save some time on development :)
<matti> Another interesting project which will help you out tremendously is "Bundler".
<matti> Bundler allows for stress-free deployment of Ruby application by including all the required and relevant gems together with it.
<matti> So, deployment of remote systems will be way less complex with Bundler.
<matti> This also add value when you want to upgrade existing application.
<matti> Definitely worth looking at :)
<matti> Many people ask about editors and IDEs ... which ones are the best for Ruby?
<matti> Well, there are quite a few out there.
<matti> To begin with we have Interactive Ruby (IRB).
<matti> Excellent for testing and quick proof-of-concept and quick prototyping.
<matti> Not really an editor. More alike command line interface (CLI) that Ruby offers -- similar to what you'll see after executing Python :)
<matti> We have well known VI and VIM -- oldie but goodie ... :)
<matti> Geany -- quite nice editor, I personally like it.
<matti> gedit and Kate -- part of Gnome and KDE.
<matti> gedit is very nice and often not really appreciated.
<rooligan> which editor do you use?
<matti> Especially for what this little editor can do.
<matti> rooligan: That depends.
<matti> rooligan: On my desktop at home and work I use Ruby.
<matti> Ops.
<matti> Hehe.
<matti> I mean I use Geany.
<matti> Sorry ;p
<rooligan> :D lol
<matti> With the dark colour scheme ;p
<matti> I can make a screen shot in a second.
<matti> On remote systems I prefer VIM over emacs for instance.
<matti> Some of my colleagues are using TextMate -- but that is OS X.
<rooligan> Textmate looks strange for me... without any buttons. Just the code and tabs
<matti> Indeed.
<matti> A lot of web developers working on OS X prefer it.
<matti> I am not an OS X user so I can't really tell whether it is "that awesome" as they describe it ;]
<matti> Hehe.
<matti> NetBeans can do Ruby too.
<matti> Some new kids on the block like Aptana and Redcar are nice.
<matti> I've seen people working with notepad.exe ;p
<rooligan> :O
<matti> Two commercial ones are hightly rated too: RubyMine and Komodo.
<matti> Right...
<matti> Ruby and the docummentation :)
<matti> For all the people who want to try it out.
<matti> Try Ruby is a nice alternative.
<matti> http://tryruby.org/
<matti> A wealth of examples can be found on "Programming Language Examples Alike Cookbook" http://pleac.sourceforge.net/.
<matti> For peolpe keen on learning about "The Ruby Way" and how to make their code more idiomatic.
<matti> I recommend Ruby Koans -- http://github.com/edgecase/ruby_koans
<matti> There is also help from the Ruby itself.
<matti> help -- in IRB.
<matti> And console command ri.
<matti> Both require Ruby Docummentation to be installed.
<matti> There is the Ruby Standard Library Documentation http://www.ruby-doc.org/ and http://www.ruby-doc.org/stdlib/
<matti> Programming Ruby The Pragmatic Programmer's Guide -- http://www.ruby-doc.org/docs/ProgrammingRuby/
<matti> Amazing introduction to the languge: Why's (poignant) Guide to Ruby -- http://viewsourcecode.org/why/
<matti> Ruby Programming -- http://en.wikibooks.org/wiki/Ruby_Programming
<matti> Some books that I can recommend:
<matti> "The Ruby Programming Language" by David Flanagan and Yukihiro Matsumoto
<matti> "Ruby In A Nutshell" by Yukihiro Matsumoto
<matti> "Programming Ruby: The Pragmatic Programmers' Guide" by Dave Thomas, Chad Fowler and Andy Hunt
<matti> "The Ruby Way" by Hal Fulton
<matti> "Ruby Developers Guide" by Lyle Johnson, Jonothon Ortiz, Robert Feldt and Michael Neumann
<rooligan> matti: What do you think about Python?
<matti> rooligan: Almost three years ago I was a heavy Python user.
<matti> rooligan: At some point I had to work more and more with Ruby.
<matti> rooligan: And this amazing spring day... a time for lovers...
<matti> rooligan: I have simple fallen in love with Ruby.
<matti> ;]
<rooligan> :)
<matti> rooligan: And since then... I work mainly with it on day-to-day basis.
<matti> I also work with other languages like Python (still have a lot of respect), Perl, Java and C.
<rooligan> but for Perl, Java and C you haven't respect?
<matti> I do.
<matti> Yet for instance I seldom use C nowadays.
<matti> When I do, it was usualy to extend Python and/or Ruby.
<matti> For the "extra speed" that C offers.
<matti> Perl mainly for small scripts and one-off one-liners.
<matti> Java because of the core application that may company develops,
<rooligan> I don't think C is much faster than Python. There is no notable difference.
<matti> rooligan: In terms of byte code execution, there isn't any.
<matti> rooligan: Yet quite often a pure-Python and/or pure-Ruby libraries are not performent enough.
<matti> rooligan: There is a factor of memory usage here too.
<matti> rooligan: Imagine... A YAML parser in pure-Ruby is way behind C implementation.
<matti> On that note.
<matti> Ruby MRI (1.8) tends to be a little bit slower than Python.
<matti> Ruby YARV (1.9) tends to match Python's speed and sometimes over-take it.
<matti> Yet MRI and YARV are not fully compatible with each other.
<matti> Goind back to finding-out things in Ruby.
<matti> If you don't have access to the web and/or documentation...
<matti> You can try to figure-out how to use some objects and classes by calling some of these methods:
<matti> .singleton_methods, .public_methods -- static class methods use with parameter false, .private_methods, .instance_methods -- instance methods, .class_variables, .instance_variables, .ancestors -- all modules included in this module.
<matti> They are sometimes very handy.
<matti> When it goes to coding, Ruby on that matter almost like Perl.
<matti> More than way one to solve a problem (more than one way to do this ...).
<matti> And the things like...
<matti> The "TABWTDI"  -- "There is a better way to do it"
<matti> The "TMTOWTDI" -- "There is more than one way to do it"
<matti> And also "The Ruby Way".
<matti> How you code is completely up-to-you as a developer.
<matti> Yet Ruby allows you to create both... amazing code... and ugly as hell code.
<matti> On the contrary to Python whom enforces some good coding practices more stronger.
<rooligan> matti: There is no language you can't write ugly code on ;)
<matti> Ruby has a lot of syntactic sugar in it....
<matti> rooligan: I agree :)
<matti> rooligan: Yet Ruby does not have this brilliant PEP8.
<matti> rooligan: Which would help people be more consistent etc.
<matti> Some sugar for instance: %w(a b c).join(',') vs %w(a b c) * ','
<rooligan> But most of Python programers don't know about PEP8 :(
<matti> There is more, and sadly allows for serious abouse in terms of code clarity etc.
<matti> rooligan: Hehe.
<rooligan> what would %w(a b c).join(',') do?
<matti> Try it :)
<matti> Either in IRB or in the Try Ruby ;]
<matti> The web site.
<matti> http://tryruby.org/
<matti> %w() is a short-hand way of creating array in Ruby.
<matti> Yet another Perl influence.
<rooligan> ok
<matti> .join will iterate over the list and join all the elements with ,.
<matti> (main):001:0> %w(a b c).join(',')
<matti> => "a,b,c"
<rooligan> I know join already from Python :)
<matti> ;]
<matti> rooligan: Ruby is very similar to Python :)
<rooligan> Is there a good online resource for learning Ruby?
<matti> Yes.
<matti> I pasted some of the good links.
<matti> + Try Ruby -- http://tryruby.org/
<matti> + Programming Language Examples Alike Cookbook -- http://pleac.sourceforge.net/
<matti> + Ruby Koans -- http://github.com/edgecase/ruby_koans
<matti> + Ruby Standard Library Documentation -- http://www.ruby-doc.org/ and http://www.ruby-doc.org/stdlib/
<matti> + Programming Ruby The Pragmatic Programmer's Guide -- http://www.ruby-doc.org/docs/ProgrammingRuby/
<matti> + Why's (poignant) Guide to Ruby -- http://viewsourcecode.org/why/
<matti> Why's (poignant) Guide to Ruby -- http://viewsourcecode.org/why/
<matti> + Ruby Programming -- http://en.wikibooks.org/wiki/Ruby_Programming
<matti> Is for absolute begginers.
<matti> If you know Python already.
<matti> You'll probably pick-up Ruby in no time.
<matti> Ruby is really easy to learn.
<matti> And I bet you, you'll appreciate Ruby Blocks straight-away.
<rooligan> That Why's poignant Guide is really good, much people say
<matti> Indeed.
<matti> _why -- guy who made it.
<matti> At some point left the community.
<matti> We do not know why.
<matti> He just went missing...
<matti> He deleted most of his work etc etc.
<matti> Yet, _why was a true genius.
<matti> Ruby gained a lot because of him.
<matti> Going back... not much of my talk have left ;]
<matti> Ruby projects tend to be hosted mainly on github.
<matti> And a lot of Ruby Hackers use git.
<matti> Which is like BitBucket for Python.
<matti> Some of the companies which offer project hosting for Ruby and/or Ruby on Rails.
<matti> Engine Yard -- http://www.engineyard.com/
<matti> Heroku -- http://heroku.com/
<matti> site5
<matti> bluehost
<matti> DreamHost
<matti> OVH -- if you want to maintain your own systems
<matti> Amazon EC2 -- worth mentioning are new micro-instances
<matti> Quickly about Ruby code and synatx :)
<matti> File extension .rb in most of the cases.
<matti> Typical hashbang is #!/usr/bin/ruby or better #!/usr/bin/env ruby
<matti> The code layout most likely will be done with two spaces for indentation -- a standard among Ruby projects.
<matti> Keywords and language elements will be separated by new lines and/or by semicolons.
<matti> Variables are separated by commas -- same rule applies to passing parameters to methods.
<matti> Most of the code can be short-handed to an in-line instruction i.e. puts "Hello, Bob" if name == "Bob" -- like in Perl :)
<matti> The new-linea and semicolons style sometimes is mixed.
<matti>         n = 1
<matti>         if n > 0
<matti>           puts "Yes"
<matti>         else; puts "No"; end
<matti> Comments...
<matti> # -- can be span across multiple lines
<matti> "=begin" and "=end" -- everything in-between these lines will be ignored by Ruby interpreter
<matti>         #
<matti>         # A comment ...
<matti>         #
<matti>         =begin
<matti>           A comment too ...
<matti>         =end
<matti> ;]
<matti> Now...
<matti> My talk goes deeper into some Ruby syntax.
<matti> But since I have already talked to much.
<matti> I will end it ;]
<matti> Thank you all for listening to me.
<matti> :)
<matti> I can tell you a little bit about syntax and why Ruby is so popular in terms of meta-programming (which is what makes it so great) when you folks are interested in that :)
<matti> But, by all means. Please give it a try and perhaps you will fall in love too, as I did ;]
<rooligan> :)
<matti> rooligan: Look at blocks in Ruby.
<matti> rooligan: And meta-programming in it.
<matti> rooligan: It is absolutely amazing what you can do.
<matti> rooligan: Plus, Ruby flexibility is great.
<matti> rooligan: Python for instance does not allow you to extend (monkey-patch) its primitive types.
<matti> rooligan: There is no limit to what you can do in Ruby.
<matti> rooligan: You can even remove/unset some of the core if you feel like so ;]
<matti> rooligan: Python community believes that this is really ugly, dangerous and you should not do it. Period.
<matti> Well, they do have a point... but so far Ruby is all good and well with it ;p
<matti> rooligan: For example...
<matti> krzysztof@samsung:~$ irb
<matti> Fri Oct 01 22:15:54 +0100 2010
<matti> (main):001:0> 'rooligan'.encrypt
<matti> NoMethodError: undefined method `encrypt' for "rooligan":String from (irb):1
<matti> (main):002:0>
<matti> Ha!
<matti> No method... yet! :)
<matti> Let's quickly extend the String class...
<matti> One of the primitive types in Ruby... Also full-blown objects.
<matti> (main):002:0> class String; def decrypt; tr 'b-za', 'a-z'; end; end
<matti> => nil
<matti> And...
<matti> (main):004:0> class String; def encrypt; tr 'a-z', 'b-za'; end; end
<matti> => nil
<matti> (main):005:0> 'rooligan'.encrypt
<matti> => "sppmjhbo"
<matti> ;]
<matti> TADA.wav
<matti> (main):006:0> 'rooligan'.encrypt.decrypt
<matti> => "rooligan"
<rooligan> :)
<matti> Anyway.
<matti> I have to stop talking ;p
<rooligan> ok
 * matti hugs rooligan 
<matti> :)
<rooligan> :)
<matti> rooligan: Pop-in #ruby and #ruby-lang ;p
<matti> I should actually say...
<matti> Come to the Dark Side.
<matti> ;p
<rooligan> :D
<rooligan> Ok, bb
#ubuntu-classroom 2010-10-02
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Beginners Team Dev Academy - Current Session: Introduction to Python: Part 3 - Instructors: pedro3005
<pedro3005> Why, hello everyone
<pedro3005> er.. is anybody out there?
<pedro3005> *tumbleweed rolls by*
<pedro3005> Alright, let's go on
 * pedro3005 checks logs
<pedro3005> Well, last time we were talking about lists
<pedro3005> a quick refresher to you guys
<pedro3005> numbers = [1, 2, 3, 4, 5]
<pedro3005> so we have various methods within lists to help us deal with them, as was explained
<pedro3005> http://docs.python.org/tutorial/datastructures.html#more-on-lists  you can see them here if you forgot
<pedro3005> (i know you did, don't lie)
<pedro3005> Well, anyway, today I would like to talk a bit more on list slicing
<pedro3005> We can get a specific element or number of elements from lists using that
<pedro3005> take the numbers list for example
<pedro3005> numbers[0] is 1
<pedro3005> we always start counting at 0
<pedro3005> numbers[1] is 2 and so forth
<pedro3005> we can use the colon to indicate more than 1 element
<pedro3005> say I want everything from the beginning to the 3rd element?
<pedro3005> numbers[0:3] will yield that
<pedro3005> a list with [1, 2, 3]
<pedro3005> I can use -1 to go back
<pedro3005> numbers[-1] is the first element of the list counting from right to left
<pedro3005> and I can also define the step with an extra colon
<pedro3005> for instance
<pedro3005> numbers[0:5:2] returns [1, 3, 5]
<pedro3005> because it grabs every other number from position 0 to element 5
<pedro3005> All of this list slicing also works with strings
<pedro3005> >>> "abcd"[0]
<pedro3005> 'a'
<ClassBot> Mohan_chml asked: Is there any difference in using for loop and slicing OR it is just code efficiency?
<pedro3005> it makes code smaller and neater
<pedro3005> and easier to understand too
<pedro3005> For dealing with strings, we have this method called split()
<pedro3005> it splits a string (returning a list of strings) by a certain character
<pedro3005> for instance, space
<pedro3005> "a b c d".split(" ") will return ['a', 'b', 'c', 'd']
<pedro3005> split() is the same as split(" ")
<pedro3005> you can also split by comma, for instance
<pedro3005> "a,b,c,d".split(",") will do the same
<pedro3005> the inverse of the split function is join
<ClassBot> Otto56 asked: Does split accept multiple seperator characters or does it then split on teh sequence / sub-string?
<pedro3005> No, your example would split by ":;"
<pedro3005> <Otto56> eg split(";:")
<pedro3005> err, I mean ";:"
<pedro3005> You can use regular expressions for what you want
<pedro3005> (but I don't know regexp :P)
<pedro3005> or you can call subsequent split methods
<pedro3005> wait.. no you can't
<pedro3005> never mind that
<pedro3005> As I was saying, the join function
<pedro3005> you call it with a string and a list and it will join each element of this list with a string between them
<pedro3005> let me exemplify
<pedro3005> ", ".join(['a', 'b', 'c', 'd'])
<pedro3005> that's pretty much it about join
<pedro3005> any questions?
<pedro3005> there are a whole bunch of string methods, and it's not my goal to go over each of them
<pedro3005> many are self-explanatory
<pedro3005> you have for instance str.startswith() and str.endswith()
<pedro3005> check the python docs for all
<pedro3005> http://docs.python.org/library/stdtypes.html#string-methods
<pedro3005> I would like to introduce a new concept here
<pedro3005> before we go on to more data structures, like dicts etc. it's important to learn functions
<pedro3005> All this time, we've been using various functions
<pedro3005> raw_input(), split(), they're all functions
<pedro3005> and we call functions sometimes with parameters, like split(" ")
<pedro3005> that's calling split with " " as argument
<pedro3005> We can define our own functions
<pedro3005> This is useful for a procedure that you're doing various times in your code
<pedro3005> to avoid writing the same thing over and over, you define a function
<pedro3005> for instance, let's define a function that prints a help message
<pedro3005> def print_help():
<pedro3005>     print "You're on your own"
<pedro3005> now that that's done, when you call print_help() it'll display that message
<pedro3005> you can add more print commands to it
<pedro3005> We also learned about boolean expressions, and we can make functions that answer boolean questions
<pedro3005> for instance, let's create a function that checks if a number is negative
<pedro3005> def is_negative(number):
<pedro3005>     if number < 0:
<pedro3005>         return True
<pedro3005>     return False
<pedro3005> let's analyze this
<pedro3005> the function is_negative accepts a parameter, called number
<pedro3005> if this number is smaller than 0, it returns True
<pedro3005> the thing is, when a function returns a value, it immediately stops executing and goes back to the main code
<pedro3005> so it wouldn't hit return False
<pedro3005> but if the if block was not run, that is, number > 0, it would just read return False
<pedro3005> ;)
<pedro3005> you could otherwise rewrite that function as
<pedro3005> def is_negative(number):
<pedro3005>     if number < 0:
<pedro3005>         return True
<pedro3005>     else:
<pedro3005>         return False
<pedro3005> but it's one line too big :)
<pedro3005> we can write functions that accept more than one parameters
<pedro3005> for instance, let's make a function that multiplies two values
<pedro3005> def mul(x, y):
<pedro3005>     return x * y
<pedro3005> but what if I wanted a function to double a number?
<pedro3005> I could try writing it as this (it is _WRONG_)
<pedro3005> def double(x):
<pedro3005>     x = 2 * x
<pedro3005> why is this wrong?
<pedro3005> because the variable we're dealing with inside the function is a copy of the variable you called the function with
<pedro3005> if we only alter the copy, it won't alter the original variable
<ClassBot> Otto56 asked: Is it possible to pass values in by reference?
<pedro3005> like in C? no
<pedro3005> we can make global variables
<pedro3005> can I brb for some minutes? family calls
<pedro3005> sorry everyone
<pedro3005> back
<pedro3005> For this problem, we have two solutions
<pedro3005> if we're dealing with a specific variable, we can make it global
<pedro3005> a = 2
<pedro3005> def double_a():
<pedro3005>     global a
<pedro3005>     a = a * 2
<pedro3005> Or, we can return the new value and set the old variable equal to that
<pedro3005> def double(x):
<pedro3005>     return 2 * x
<pedro3005> a = 4
<pedro3005> a = double(a)
<pedro3005> that would yield 8
<pedro3005> a function can return and accept any object
<pedro3005> and everything is an object
<pedro3005> you can for instance define a function that completes a sentence with the period, for instance
<pedro3005> err, too many for instance's
<pedro3005> but let's show that
<pedro3005> def complete_sentence(sentence):
<pedro3005>     if sentence.endswith("."):
<pedro3005>         return sentence
<pedro3005> return sentence + "."
<pedro3005> you could modify that function to check that the first letter is a capital letter etc
<pedro3005> (left as an exercise for the reader :P)
<pedro3005> a function can even accept another function as argument (do I hear some functional programming?)
<pedro3005> for instance, imagine we have functions that return some numeric value. e.x. minus_one(x), minus_two(x) ad infinitum. (what they do is fairly obvious, and so is the implementation)
<pedro3005> we want to make a generic function which calls it a number is negative and record the number of steps (for some freakish reason. my examples suck. sorry)
<pedro3005> give me a minute to write that
<pedro3005> >>> def call(f, x):
<pedro3005> ...     if x < 0:
<pedro3005> ...             return 0
<pedro3005> ...     steps = 0
<pedro3005> ...     while x:
<pedro3005> ...             x = f(x)
<pedro3005> ...             steps += 1
<pedro3005> ...     return steps
<pedro3005> ...
<pedro3005> let's analyze that step by step
<pedro3005> (day by day...)
<pedro3005> sorry, let's continue
<pedro3005> Well, if x is already smaller than 0 (negative), it took 0 steps, right?
<pedro3005> so we return that
<pedro3005> we continue the function (if it's positive) by initializing the number of steps at 0
<pedro3005> while x, that is, while x > 0
<pedro3005> hmmm
<pedro3005> maybe I should change that to while x >= 0
<pedro3005> yes
<pedro3005> >>> def call(f, x):
<pedro3005> ...     if x < 0:
<pedro3005> ...             return 0
<pedro3005> ...     steps = 0
<pedro3005> ...     while x >= 0:
<pedro3005> ...             x = f(x)
<pedro3005> ...             steps += 1
<pedro3005> ...     return steps
<pedro3005> ...
<pedro3005> that is correct now
<pedro3005> Same thing
<pedro3005> while x is bigger or equal to 0, that is, non-negative
<pedro3005> we run these steps
<pedro3005> first, we set x to be f(x), that is, we call the function upon x
<pedro3005> we raise the step count by 1 and continue iterating
<pedro3005> when it is done, we return steps
<pedro3005> so, consider we had the function minus_one() and the value 4
<pedro3005> call(minus_one, 4)
<pedro3005> returns 5, as expected
<pedro3005> we type minus_one like that, without parenthesis ()
<pedro3005> because we're not calling the function, we're passing it as argument
<pedro3005> python has the built-in function map() but we can rewrite it for fun
<pedro3005> one min
<pedro3005> >>> def new_map(f, values):
<pedro3005> ...     final = []
<pedro3005> ...     for x in values:
<pedro3005> ...             final.append(f(x))
<pedro3005> ...     return final
<pedro3005> ...
<pedro3005> so, what does this do?
<pedro3005> it accepts a list and calls the function f on each element of the list, returning a new list with the returned values
<pedro3005> >>> new_map(minus_one, [1, 2, 3])
<pedro3005> [0, 1, 2]
<pedro3005> (again, python already has the function map())
<ClassBot> Otto56 asked: What is the python terminology for this? I understand it as a function pointer or delegate
<pedro3005> hm.. I'm not aware of a specific terminology
<pedro3005> it's a function
<pedro3005> it's not a pointer to a function, it IS a function
<pedro3005> forget pointers :P
<pedro3005> (how I hate them)
<pedro3005> anyway
<pedro3005> We could write the map() function more easily using list comprehension, but I didn't go over that
<pedro3005> any questions? does everyone understand the functions?
<pedro3005> So let's go back to lists with list comprehension
<pedro3005> this is useful, I promise
<pedro3005> list comprehension is a method of constructing a new list by some iteration
<pedro3005> it's useful for instance to unpack strings
<pedro3005> let's say I want to get a string "abcd" and turn it into a list with each character, i.e. ['a', 'b', 'c', 'd']
<pedro3005> newlist = [x for x in "abcd"]
<pedro3005> but I can do things with this first x
<pedro3005> let's say I want to ensure that all characters are lower-case
<pedro3005> we have the function lower()
<pedro3005> newlist = [x.lower() for x in "AbcD"]
<pedro3005> or, imagine this
<pedro3005> we have a list of lists
<pedro3005> [[1, 2], [3, 4], [5, 6]]
<pedro3005> we want a simple list with all these values multiplied, as in, 1 * 2, 3 * 4, 5 * 6
<pedro3005> we can do that with:
<pedro3005> newlist = [x * y for x, y in oldlist]
<pedro3005> (given oldlist = [[1, 2], [3, 4], [5, 6]])
<pedro3005> we're unpacking each element of the list (another list)
<pedro3005> let me exemplify a simpler case
<pedro3005> imagine we have a = [1, 2]
<pedro3005> we can do
<pedro3005> x, y = a
<pedro3005> we are unpacking a
<pedro3005> x = 1, y = 2
<pedro3005> so, as I mentioned, we can rewrite the map function using list comprehensions
<pedro3005> def new_map(f, x):
<pedro3005>     return [f(x) for val in x]
<pedro3005> errrrr
<pedro3005> def new_map(f, values):
<pedro3005>     return [f(x) for x in values]
<pedro3005> we can use this to improvise multiple-argument maps
<pedro3005> for instance, the built-in function max() returns the max value of the list it is called with
<pedro3005> hmm, no , forget that
<pedro3005> hehe
<pedro3005> someone give me a function with two arguments :P
<pedro3005> ohh
<pedro3005> we have the cmp() function. it accepts two integers
<pedro3005> it returns negative if x < y, zero if x == y, and positive if x > y (given cmp(x, y))
<pedro3005> we can map that
<pedro3005> a = [[1, 2], [3, 3], [4, 3]]
<pedro3005> vals = [cmp(x, y) for x, y in a]
<pedro3005> >>> vals
<pedro3005> [-1, 0, 1]
<pedro3005> questions?
<pedro3005> we can add boolean expressions to list comprehensions
<pedro3005> say I want all positive values from a  list
<pedro3005> a = [1, 2, -5, 0, 4]
<pedro3005> newlist = [x for x in a if x > 0]
<pedro3005> we can use all sorts of expressions there
<pedro3005> for instance, we can call int() but only if it's a digit
<pedro3005> >>> a = ['a', "2", "c", "4"]
<pedro3005> >>> [int(x) for x in a if x.isdigit()]
<pedro3005> [2, 4]
<pedro3005> we can use this to strip out of a string all upper-case characters for instance
<pedro3005> message = "HELLO there MY friend"
<pedro3005> >>> [x for x in message.split() if not x.isupper()]
<pedro3005> ['there', 'friend']
<pedro3005> this one is a bit more complex so I'll go over it
<pedro3005> I wanted to separate message by each word it had, so I called message.split(). if you recall, that defaults to split(" "), that is, grab by each space
<pedro3005> so we're effectively getting each word
<pedro3005> if not x.isupper()  would be equal to saying  if x.isupper() == False
<pedro3005> but shorter and in my opinion clearer
<pedro3005> because it's closer to natural language
<pedro3005> Questions?
<pedro3005> Alright
<pedro3005> Now, as I promised last class, I will solve a couple problems
<pedro3005> first I must introduce a simple built-in function, range()
<pedro3005> it does arithmetic progressions
<pedro3005> >>> range(10)
<pedro3005> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
<pedro3005> range(10) means that stop = 10. it stops at 10 without including 10.  And it defaults to starting at 0, but you can specify
<pedro3005> >>> range(1, 10)
<pedro3005> [1, 2, 3, 4, 5, 6, 7, 8, 9]
<pedro3005> now we started at 1
<pedro3005> we can also specify the step
<pedro3005> >>> range(1, 10, 2)
<pedro3005> [1, 3, 5, 7, 9]
<pedro3005> picking every other number
<pedro3005> the step may be negative to count descending
<pedro3005> >>> range(10, 0, -1)
<pedro3005> [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
<pedro3005> What is this useful for, you ask
<pedro3005> well, many things
<pedro3005> let's take for instance this problem
<pedro3005> Add all the natural numbers below one thousand that are multiples of 3 or 5.
<pedro3005> well, we'll be working with the range of 1 - 1000 (we can skip 0, since it's not a multiple)
<pedro3005> let's ask ourselves, how can we translate "multiple of 3 or 5" to python?
<pedro3005> well, if x is a multiple of 3, when we divide x by 3 we get 0 rest
<pedro3005> right?
<pedro3005> so we use the % operator
<pedro3005> meaning that if x is a multiple of 3, x % 3 == 0
<pedro3005> now it's easy!
<pedro3005> first, we get a variable to store the sum
<pedro3005> value = 0
<pedro3005> for num in range(1, 1000):
<pedro3005>     if num % 3 == 0 or num % 5 == 0:
<pedro3005>         value += num
<pedro3005> after the loop is done, value will hold the sum of all the natural numbers below one thousand that are multiples of 3 or 5
<pedro3005> Questions?
<pedro3005> The old classic FizzBuzz (let's see if I have enough time)
<pedro3005> we must loop from 1 to 100, print Fizz for multiples of 3, Buzz for multiples of 5, and FizzBuzz if both
<pedro3005> for num in range(1, 101): # gotta account for 100
<pedro3005>     if num % 3 == 0:
<pedro3005> err, wait
<pedro3005> answer = ""
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||
<pedro3005> lol damn
<pedro3005> ok
<pedro3005> FizzBuzz is left as homework!
<pedro3005> :P
<pedro3005> I already gave a hint
<pedro3005> ;)
<nUboon2Age> For those interested, i started a home page for pedro3005's Intro to Python class:  https://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Development/Academy/IntroToPython
<nUboon2Age> pedro3005: question: in the above class you referred several times to f(), and you passed it in as an argument as: somefunc(f,x), but it was never defined.  is that a function defined by python or one that you would define (but you just didn't in these examples)?
<pedro3005> nUboon2Age, double(x): return x + x
<pedro3005> is x defined anywhere else in the code?
<nUboon2Age> sorry i'm still not understanding pedro3005
<pedro3005> nUboon2Age,
<pedro3005> >>> def double(x):
<pedro3005> ...     return x + x
<pedro3005> ...
<pedro3005> >>> double(2)
<pedro3005> 4
<pedro3005> x is not defined elsewhere, just in that function
<pedro3005> the variable x exists only in the double function, when it is called. x is a copy of whatever value was passed to it
<nUboon2Age> okay
<nUboon2Age> makes sense so far
<pedro3005> similarly, we can do this with functions
<pedro3005> for instance, a function that calls f on x (for example purposes)
<pedro3005> >>> def call(f, x):
<pedro3005> ...     f(x)
<pedro3005> ...
<pedro3005> >>> def p(x):
<pedro3005> ...     print x
<pedro3005> ...
<pedro3005> >>> call(p, "Hello world!")
<pedro3005> Hello world!
<nUboon2Age> oh, okay, i think i'm starting to get it.
<pedro3005> nUboon2Age, just start to think of things as objects
<pedro3005> a function is also an object
<pedro3005> so it can be passed around
<nUboon2Age> i'll go back and look at the prior examples to see if i understand them now.
<pedro3005> nUboon2Age, are you good with math?
<nUboon2Age> pedro3005: not great, just okay
<nUboon2Age> i think this is the line i was confused by:  x = f(x)
<nUboon2Age> i guess the f(x) was not explicitly defined in the example
<pedro3005> no, by that line we're calling the function that was passed to us
<pedro3005> we don't know what the function does
<pedro3005> we just expect it to return something
<pedro3005> and we set x to be that
<pedro3005> think of it like this
<pedro3005> on that example, we're dealing with numeric functions
<pedro3005> so they're supposed to take a number like 4 and return something like 3
<pedro3005> so imagine we have x = 4
<pedro3005> we want to call the function which does whatever and then set x to be that new value
<pedro3005> x = f(x)
<pedro3005> repeat this process until we get a negative value
<nUboon2Age> okay i got that.
<nUboon2Age> another thing that i was confused by was "return [f(x) for val in x]"  -- the 'for val in x' part isn't clear to me pedro3005
<pedro3005> nUboon2Age, it was a mistake by me
<nUboon2Age> oh, what was it supposed to say?
<pedro3005> return [f(x) for x in values]
<pedro3005> nUboon2Age, it kind of makes sense if you read it out loud. [f of x for (each) x in values]
<nUboon2Age> okay, could you break that down for me please pedro3005?
<nUboon2Age> so what would an example be pedro3005?
<pedro3005> grab each x inside values and add to the new list we're creating the return value of f(x)
<pedro3005> hm, for instance
<pedro3005> [x for x in [1, 2, 3]]
<pedro3005> that is simply [1, 2, 3]
<pedro3005> for each x in the old list, it puts x in the new list
<pedro3005> but imagine this
<pedro3005> [str(x) for x in [1, 2, 3]]
<pedro3005> that is ['1', '2', '3']
<pedro3005> for x in the old list, it puts string of x in the new list
<pedro3005> for each*
<pedro3005> similarly, we can do
<pedro3005> [x for x in [-1, 0, 1] if x > 0]
<nUboon2Age> does x mean each element in the array?
<pedro3005> for each x in the old list, put x in the new list if x is bigger than 0
<pedro3005> nUboon2Age, yes, we're iterating through it
<nUboon2Age> and x could be any label, not just x?
<nUboon2Age> [goomba for goomba in [-1,0,1]if goomba > 0] -- pedro3005?
<pedro3005> nUboon2Age, absolutely
<nUboon2Age> i'm closer but not quite there pedro3005
<pedro3005> nUboon2Age, do you understand for loops?
<nUboon2Age> yes
<nUboon2Age> the thing that is confusing me i think is
<nUboon2Age> the first x
<pedro3005> >>> a = [1, 2, 3, 4, 5]
<pedro3005> >>> new_a = []
<pedro3005> >>> for number in a:
<pedro3005> ...     new_a.append(number)
<pedro3005> ...
<pedro3005> >>> new_a
<pedro3005> [1, 2, 3, 4, 5]
<pedro3005> that is the same thing as saying new_a = [x for x in a]
<nUboon2Age> so i understand ... for x in[blah], but why the first x?
<pedro3005> nUboon2Age, well, again, read it out loud. for x in [blah]. imagine you're the interpreter. Okay, we've got that; for x in [blah]. but what do I do with it?
<nUboon2Age> oh, i'm starting to get it
<pedro3005> x for x in [blah]  -- okay, just return x.  [f(x) for x in [blah]] -- okay, call f() with x and return that
<nUboon2Age> pedro3005: are you saying that x for x in [blah] would just return x?
<pedro3005> nUboon2Age, well, it would grab each x in blah and return x to the new list
<nUboon2Age> pedro3005: so    z for x in [blah] would grab each x in blah and return z to the new list ?
<pedro3005> there are like, two dudes, one building the new list and the other dude tells the first one what to put in. you're that dude. so you read x for x, pick up 4 and just tell him: "4!". but if you read f(x), you call f with x, and get, for instance, 3. So you tell him "3!"
<pedro3005> nUboon2Age, no, that would be an error
<nUboon2Age> ?
<pedro3005> that wouldn't work
<nUboon2Age> do they have to be the same variable pedro3005?
<pedro3005> nUboon2Age, yes. read it: for each x in [blah], put z in the new list. that doesn't make sense, does it?
<pedro3005> list comprehension is a way of constructing a new list with a certain set of instructions
<nUboon2Age> pedro3005: unfortunately it makes sense to me ;-)
<pedro3005> nUboon2Age, well, be the interpreter: WTF is z?
<nUboon2Age> ;-)
<pedro3005> if you try that,  it would raise a WTFError
<nUboon2Age> i'd have to define it elsewhere i guess i was assuming
<pedro3005> well, actually a NameError
<pedro3005> NameError: name 'z' is not defined
<nUboon2Age> :-)
<pedro3005> nUboon2Age, the variable inside the list comprehension is temporary
<pedro3005> like uhm..
<nUboon2Age> hmmm... okay.
<pedro3005> imagine your mom tells you this: grab each thing in this box. if this thing is a spoon, put it in the kitchen. if it's a dead animal throw it away
<nUboon2Age> you gave me a good laugh there pedro3005
<pedro3005> what is 'thing'?
<nUboon2Age> okay so how would you write that in python?
<pedro3005> well, you're iterating over each item of the box and calling that 'thing'
<nUboon2Age> thing for thing in box[spoon,dead animal]?
<pedro3005> to_the_kitchen = [thing for thing in box if thing == spoon]
<pedro3005> remember, you're building a new list
<pedro3005> okay, I have a better example
<pedro3005> the box is full of apples and oranges
<nUboon2Age> to_the_kitchen = [thing for thing in box[spoon,dead animal] if thing == spoon]   pedro3005?
<pedro3005> your dad tells you: take two boxes, label them apples and the other oranges. grab each fruit in the old box. if it's an apple, put it in the apples box, and put it in the oranges box otherwise
<pedro3005> apples = [fruit for fruit in box if fruit == apple]  (this is an example, the variables box and apple are NOT defined, and thus would FAIL)
<pedro3005> oranges = [fruit for fruit in box if fruit == orange]
<nUboon2Age> okay, and if you were to complete the example to that it would not fail what would that look like?
<nUboon2Age> s/to/so
<pedro3005> >>> apple = "apple"
<pedro3005> >>> orange = "orange"
<pedro3005> >>> box = [apple, orange, orange, apple, orange, orange, apple, apple, apple, orange]
<pedro3005> >>> apples = [fruit for fruit in box if fruit == apple]
<pedro3005> >>> oranges = [fruit for fruit in box if fruit == orange]
<pedro3005> >>> apples
<pedro3005> ['apple', 'apple', 'apple', 'apple', 'apple']
<pedro3005> >>> oranges
<pedro3005> ['orange', 'orange', 'orange', 'orange', 'orange']
<nUboon2Age> okay i get that.  i'
<nUboon2Age> i'll save that example
<nUboon2Age> muchas gracias pedro3005
<pedro3005> nUboon2Age, :) now do homework :P
<nUboon2Age> pedro3005: first i have to get through the rest of the examples. ;-)
<pedro3005> nUboon2Age, and I will try to come up with better examples next time
<nUboon2Age> pedro3005: math examples sometimes elude me, so for me this example made more sense.
<pedro3005> nUboon2Age, yeah, sorry, I didn't think of those not good with abstract math
<nUboon2Age> pedro3005: is the word 'global' predefined in python?
<pedro3005> nUboon2Age, yes, it is a keyword
<pedro3005> nUboon2Age, don't worry too much about global though
<pedro3005> it's not very common to use
<pedro3005> normally you'll just pass variables back and forth
<nUboon2Age> in the above examples i didn't really understand what the map() is about pedro3005
<pedro3005> nUboon2Age, ah, a little relic from functional programming
<pedro3005> here's what it does
<pedro3005> it receives two parameters, a function and a list of values
<pedro3005> it returns a list with the returned value by calling this function with each value
<pedro3005> like, if you call map(x, [a, b, c]) it returns [x(a), x(b), x(c)]
<pedro3005> let me exemplify
<pedro3005> suppose you have a list ['1', '2', '3']
<pedro3005> call that list snums
<pedro3005> map(int, snums)
<pedro3005> this calls int() with each element of snums
<pedro3005> and returns a list substituting the value for the returned value of the function
<pedro3005> in this case [1, 2, 3]
<nUboon2Age> okay, that kinda makes sense.  i'll have to ponder it for a little while pedro3005
<nUboon2Age> okay i'm getting that now pedro3005
<pedro3005> nUboon2Age, these are not trivial concepts, so it's normal to take a while to comprehend
<nUboon2Age> one thing that i'm kinda surprised by is the seemingly large number of standard predefined functions.  i'm used to languages where there are not very many pedro3005
<pedro3005> nUboon2Age, well, there are mere programming languages, and there's python
<pedro3005> python is not a language, it's a lifestyle!
<pedro3005> :P
<pedro3005> python's standard library is ginormous
<pedro3005> So big my class won't go over a tiny fraction of it
<pedro3005> besides the built-in functions (the ones you can access without importing anything), which already are many, there are loads and loads of modules
<pedro3005> think of anything you can do with a computer
<pedro3005> python has a standard module for that
<pedro3005> nUboon2Age, in conclusion, python rocks, love it
<nUboon2Age> pedro3005: i'm happy to be learning python and it seems really fun, so thank you for your instruction. ;-)
<pedro3005> nUboon2Age, is it your first language?
<nUboon2Age> pedro3005: i've been away from programming for a little while, but
<nUboon2Age> basic was my first language, followed much latter by pascal, C, turbo pascal with objects, C++, all in school, and then i taught myself Java
<nUboon2Age> oh, and i had a little assembly too.
<pedro3005> ah, cool
<nUboon2Age> but i'm really rusty, so this is brushing my cobwebs off.  ;-)
<pedro3005> nUboon2Age, if you knew Java, classes shouldn't be too much of a problem
<nUboon2Age> a little shell programming (and a fair bit of DOS batch files) too
<nUboon2Age> pedro3005: yes, classes shouldn't be too bad.
<pedro3005> nUboon2Age, python classes can inherit from various other ones ;)
<nUboon2Age> i haven't gone as far as i'd like into OOP, so there may be some things that i'll need to wrestle with a bit.
<nUboon2Age> good point pedro3005
<pedro3005> nUboon2Age, I think the biggest problem with python is how slow it is
<nUboon2Age> pedro3005: yes that's an issue for every interpreted language.  but i'm pleasantly surprised how reasonable the speed is of python.
<nUboon2Age> oh, i forgot to mention i taught myself some perl too.
<pedro3005> nUboon2Age, oh, I'm a language whore too
<pedro3005> I go out learning a lot of different languages :P
#ubuntu-classroom 2010-10-03
<nUboon2Age> its kinda hard for me to keep them straight in my head sometimes pedro3005. :)
<pedro3005> nUboon2Age, yeah. but have you noticed they're kind of alike?
<nUboon2Age> i appreciate that python is different enough that i don't think i'll mix it up too badly.
<nUboon2Age> i've always avoided ecmascript because of it being just similar enough to java to get me confused.
<pedro3005> python is certainly peculiar in its way of requiring indenting
<nUboon2Age> i like that peculiarity. :)
<nUboon2Age> it helps me.
<nUboon2Age> pedro3005: at 18:35 GMT you wrote:  a = ['a', "2", "c", "4"]
<nUboon2Age> question: is it okay for the first element to only have single quotes, and the others to have double quotemarks?
<nUboon2Age> pedro3005: ^^^
<pedro3005> nUboon2Age, yes
<pedro3005> sorry, I was grabbing some food
<nUboon2Age> ty for the teaching pedro3005!
<pedro3005> nUboon2Age, my pleasure
<matti> pedro3005: Life style? ;]
<matti> pedro3005: Try Ruby ;p
 * matti pokes pedro3005 gently...
<pedro3005> matti, that sounded wrong..
<matti> pedro3005: The Ruby of the poke? ;]
<pedro3005> matti, poking :p
<matti> \o/ pedro3005 \o/ for the talk.
<matti> pedro3005: Mahh... Nobody's looking ;p
<matti> pedro3005: :D
<U_buntu> i have bash script issue i cannot figure out. can anyone help?
<nhandler> U_buntu: Try #ubuntu for support
<U_buntu> yea i wasn't getting any luck over there
#ubuntu-classroom 2011-09-27
<pai> i have maverick meerkat on acer aspire one 522 netbook. annoying problem is netbook's speakers, they stay on after i plug in headphone. model option has been edited in alsa-base.conf, but the problem's still there. any help?
#ubuntu-classroom 2011-09-28
<prism_> any one live
<Moayed> hi
<michael_mbp> hey
<michael_mbp> lo?
#ubuntu-classroom 2011-09-29
<gepatino> http://us.toshiba.com/computers/laptops/mini-notebook/NB500
<gepatino> sorry
<gepatino> wrong channel
#ubuntu-classroom 2011-09-30
<sj> hello there
<sj> anybody here knows if there is going to be a training session on package/packaging ? (https://wiki.ubuntu.com/Packaging/Training_
<sj> anytime soon
<helghareeb> and the rest comes
#ubuntu-classroom 2011-10-01
<sj> can anyone post the link, where it tells about the teachers and what all topics they will be teaching on/about? like php, wiki and so on?
<jmarsden> !classroom
<ubot2> The Ubuntu Classroom is a project which aims to tutor users about Ubuntu, Kubuntu and Xubuntu through biweekly sessions in #ubuntu-classroom - For more information visit https://wiki.ubuntu.com/Classroom
<jmarsden> shayonj: Upcoming Schedule: http://is.gd/8rtIi      and it is in the /topci of this channel.
<shayonj> jmarsden, oh okay. thank you
<jmarsden> shayonj: You're welcome.
<shayonj> jmarsden, do you if those lessons/teachings happen quite often ? As i see the last one was in 2010
<jmarsden> shayonj: Hmmm, no, there were sessions in here very recently...
<shayonj> jmarsden, i see. you know i really want attend those sessions. Anyways, i look around more for the updated list
<jmarsden> shayonj: I see entries from Sept 25 2011... just a week ago...
<shayonj> jmarsden, oh okay. sorry about. was reading it wrong. gotcha
<shayonj> jmarsden, thanks again :)
<jmarsden> shayonj: You're welcome.
#ubuntu-classroom 2012-09-25
<em> hey tammy
<em> i wonder when the next class is
<pleia2> em: the schedule is the link in the topic: http://is.gd/8rtIi and we also keep http://ubuntuclassroom.wordpress.com/ updated for other events that we're planning but aren't yet scheduled
<chraso> hi chennal, needs help on the following error while "apt-get update"
<chraso> Reading package lists... Done
<chraso> W: GPG error: http://packages.medibuntu.org lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2EBC26B60C5A2783
<em> pleia2: okay
#ubuntu-classroom 2012-09-27
<Droxp> SO? how do this work?
<pleia2> Droxp: the schedule is in the channel topic, nothing going on today, the next big event is next month: https://wiki.ubuntu.com/UbuntuOpenWeek
<pleia2> there may be some smaller events that get added between then and now, so always want to keep an eye on the schedule and http://ubuntuclassroom.wordpress.com/ for updates
<Droxp> thak you very much
<obounaim> pleia2, please add all the events to the Ubuntu classroom Google calender. Thanks in advance
<pleia2> obounaim: we do
<pleia2> we can't add open week yet because the schedule isn't done :)
<obounaim> pleia2, ok I understand.
<pleia2> the blog has updates as soon as we do calls for instructors, so it's always updated first
<obounaim> That's good I am subscribed to the blog using Google Reader
#ubuntu-classroom 2012-09-30
<pmac_starmobi> hi
#ubuntu-classroom 2013-09-24
<cjwelborn> #ubuntu-devel
#ubuntu-classroom 2013-09-25
<Guest48659> hi
<Ashif> hi
<Ashif> anybody there
#ubuntu-classroom 2013-09-28
<Audball> Hey, room... I need help installing a tar.gz file... I have it saved on my desktop..
