#ubuntu-classroom 2007-04-10
<Longinius> Howdy, folks....  Anyone home?
<Longinius> Is this the place to ask how to open an archive (.tgz) file?
<jrib> Longinius: just double-click on it
<jrib> Longinius: you'll get faster answers in #ubuntu normally since there are fewer people who keep an eye on this room
<nalioth> come on, jrib you LIVE here   :D
* Starting logfile irclogs/ubuntu-classroom.log
* Starting logfile irclogs/ubuntu-classroom.log
#ubuntu-classroom 2007-04-11
<freacky22527> http://plein-argent.ifrance.com/
<freacky22527> le monde va mal...
<freacky22527> <fluoblack> rpm deb, kif kif
#ubuntu-classroom 2007-04-12
<Longinius> Howdy, y'all.
<Longinius> Is this a good place to ask an absolute noob question?
<tonyyarusso> could be
<tonyyarusso> try
#ubuntu-classroom 2007-04-13
<jrib> foug: hello
<foug> jrib: yo
<foug> sorry, real new to this
<jrib> foug: you are using Ubuntu?  (not kubuntu, xubuntu)
<foug> yes
<jrib> join me on this page: 4-38-64-246-st.albyny.adelphia.net]  has quit [Read error: 54  (Connection reset
<jrib> erm
<jrib> https://help.ubuntu.com/community/Repositories/Ubuntu
<foug> k i'm there, i've added a few repositories but i guess vlc wasn't in any of them
<jrib> foug: ok, pastebin your current sources.list please
<jrib> !pastebin
<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)
<foug> syntax?
<foug> k it's pasted
<jrib> k, now give us the url
<foug> http://paste.ubuntu-nl.org/15294/
<jrib> foug: that looks broken
<foug> o
<jrib> I'm going to give you a link for you to create a new one:
<jrib> !easysource | foug
<ubotu> foug: source-o-matic is a webpage where you can (re)generate your sources.list - http://www.ubuntu-nl.org/source-o-matic
<foug> k want em to paste them in here
<jrib> foug: right, replace what you currently have witht he new one you get on the website
<foug> they are the same, did you say they looked broken since they didn't have main reisted and what not at the end?
<jrib> foug: yes
<jrib> and you only had 4 urls, none of them official repos
<foug> sorry, didn't know oyu needed that
<jrib> foug: yeah, the whole file
<foug> well, they have main main-all and different things at the end of them, i think they are correct
<jrib> foug: k, but show me :)
<foug> deb http://us.archive.ubuntu.com/ubuntu edgy main restricted
<foug> deb http://us.archive.ubuntu.com/ubuntu edgy-updates main restricted
<foug> deb http://security.ubuntu.com/ubuntu edgy-security main restricted
<foug> is what i got from your site, it's only 3
<foug> and they don't look like the ones in synaptic
<jrib> foug: make sure you check "Ubuntu community supported packages" too
<foug> i think it is, in synaptic right?
<jrib> foug: I mean on the web page
<jrib> source-o-matic
<foug> o yea it was, sorry
<foug> yea
<jrib> ok, so then you press "Create sources.list"
<foug> aye, i did
<foug> it brings up the text file where i pasted the 3 ones from
<jrib> foug: but there are more than those right?
<foug> the community suppported packages are the same as my ubuntu ones
<foug> nope
<foug> there's deb-src of the same thing
<jrib> ok, hold on let me just pastebin a sources.list
<jrib> http://paste.ubuntu-nl.org/15296/
<jrib> run this command: gksudo gedit /etc/apt/sources.list
<foug> that's what mine looks like, exactly
<jrib> ok
<foug> k it's open
<jrib> run this command: gksudo gedit /etc/apt/sources.list
<foug> done
<jrib> then delete everything you see and replace it with the one I pasted
<jrib> if you have some of those third party repos like for Listen, you can keep those at the bottom
<foug> delete everything?
<foug> do i paste all 23 lines from your link?
<jrib> foug: yes
<foug> k done, save and exit?
<jrib> yes
<foug> done
<jrib> then run:  sudo apt-get update
<foug> done
<jrib> now try to install vlc:  sudo aptitude install vlc
<foug> E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
<foug> E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
<foug> were the last two lines, but there was a bunch more
<jrib> foug: close synaptic if you have it open
<foug> nice it worked!
<foug> would oyu be interested in helping me with a few other problems? ;x
<jrib> foug: if I know how
<foug> well, first, my taskbar is always expanded even though I have it checked. And when I click and drag my windows, a big black grid shows up. I changed something with grep-editor i think to get rid of window effects when I minimize them and such but then it gave me a grid
<jrib> yeah, you can't get rid of the minimization animation without getting that grid
<jrib> I don't know about the taskbar thing.  Give #ubuntu a try on these
<foug> do tell :) let me change my thing in grep real quick
<foug> i have been, so such luck yet
<jrib> gconf-editor you mean
<foug> word
<foug> k, changed it back to normal
<jrib> NewbieBaba: hi
<NewbieBaba> jrib : slm
<jrib> NewbieBaba: is Ubuntu on a different computer than the one you are on now?
<NewbieBaba> no :/
<NewbieBaba> on the same computer that im on
<NewbieBaba> im on WinXp atm
<emoney> Hi.  I'm having some difficultly getting WPA encryption working with Ubuntu.  Could someone please help me out to point me in the right direction?
<foug> jrib: do you know how to take awya the minimize effects?
<jrib> foug: only with that reduced_resources thing
<foug> darn
<jrib> !wireless > emoney    (emoney, see the private message from ubotu)
<jrib> emoney: try #ubuntu
<emoney> thanks
<jrib> NewbieBaba: ok, have you checked whether the partition that your /home in Ubuntu is on has free space?
<NewbieBaba> the story is ; i installed ubuntu on that computer n then i had that "your session...." error. n then i removed partitation of Ubuntu n resize them n then i tried to re-install it with Live Cd n then it gave me same error :S
<jrib> NewbieBaba: ok, are you comfortable using the command line?
<NewbieBaba> yea
<NewbieBaba> i can run Fail-Safe terminal
<jrib> NewbieBaba: well the first thing to do is to check your disk space.  Run 'df -h' and see how much free space is left
<NewbieBaba> it says %74 in use
<jrib> NewbieBaba: does the same thing happen if you create a new user?
<NewbieBaba> "/" %74 in use
<NewbieBaba> "tmp"
<NewbieBaba> %3
<NewbieBaba> u know it logs as "ubuntu" when u try to install it
<NewbieBaba> i created new user
<NewbieBaba> with sudo useradd username
<jrib> NewbieBaba: oh, this happens on the actual live cd?  not on an installed ubuntu?
<NewbieBaba> no
<jrib> no what?
<NewbieBaba> im saying im tryin to re-install it
<NewbieBaba> its like
<foug> jrib: how would i go about installing gaim 1.4.0? is there an easy command i can put in for it?
<NewbieBaba> i'll just install it now
<NewbieBaba> but im having that problem
<NewbieBaba> Your session only lasted less than 10 seconds. If you have not logged out yourself, this could mean that there is some installation problem or that you may be out of disk space. Try logging in with one of the failsafe sessions to see if you can fix this problem.
<NewbieBaba> This is the content of ~/.xsessions file:
<jrib> foug: not really, you just get what is in the repositories
<jrib> NewbieBaba: why are you reinstalling?
<NewbieBaba> i already removed it
<NewbieBaba> :/
<NewbieBaba> bc i thought i needed more space
<NewbieBaba> so i removed the parts of Linux system
<NewbieBaba> n then i made new parts in HDD
<NewbieBaba> now tryin to install it n im gettin that error
<jrib> NewbieBaba: well if the install cd is giving you strange errors like that, I would just try the alternate cd.  You won't need to get into X that way
<jrib> !alternate
<NewbieBaba> tried 5 times already :(
<ubotu> The Alternate CD (available as of Dapper) is the classical text-mode installation CD. Use it if you wish to upgrade via CD, or for an "expert" mode install. For normal installs, use the Desktop CD, which is also a "Live" CD.
<jrib> NewbieBaba: you tried the alternate cd?  What went wrong then?
<NewbieBaba> i dont know really
<NewbieBaba> i told you the story :/
<NewbieBaba> i had that error n i removed ubuntu
<NewbieBaba> i resized the parts of hdd
<NewbieBaba> n tried to re-install
<NewbieBaba> n same thing happens
<jrib> NewbieBaba: right, now I am suggesting that you try to install using the alternate cd, not the Desktop cd
<NewbieBaba> i burnt 5 CD of the iso file of ubuntu610
<NewbieBaba> o
<NewbieBaba> how can i get alternate cd :/
<NewbieBaba> or how can i make it
<jrib> NewbieBaba: releases.ubuntu.com will have .iso's
<NewbieBaba> which section ?
<NewbieBaba> i saw a tree of links
<voidmage> I had to use the alternate cd too because the desktop cd wouldn't install grub right on my setup
<voidmage> I have three PATA drives with windows on them
<voidmage> and then two new SATA drives i put ubuntu on
<jrib> NewbieBaba: click on the version of ubuntu you want
<NewbieBaba> thanks jrib
<NewbieBaba> another 700 mb
<NewbieBaba> :)
<NewbieBaba> ahh
<NewbieBaba> hope it'll fix my problem
<NewbieBaba> jrib, as u see im newbie on linux, which Linux should i use ? which one is better ?
<jrib> NewbieBaba: I think Ubuntu is really great of course
<NewbieBaba> and what should i install on them like(automatix, etc.)
<NewbieBaba> i like Automatix2
<NewbieBaba> n theres also EasyUbuntu
<NewbieBaba> which one u preffer?
<jrib> NewbieBaba: I'd recommend staying away from automatix and similar things.  The best thing to do it to take a couple of minutes to read how to install thinks yourself.  You shouldn't need to install too many things outside of the repositories anyway
<jrib> s/thinks/things
<NewbieBaba> true
<NewbieBaba> can i play Windows games on Linux ?
<NewbieBaba> like WOW
<jrib> NewbieBaba: that one I believe you can.  I don't know anything about it though.  You'll want to look into wine and cedega
<NewbieBaba> and i also had GAIM problem.. i logged in everything was good n GAIM closed suddenly..
<jrib> NewbieBaba: msn?
<NewbieBaba> yea
<NewbieBaba> i tried to use AMSN
<NewbieBaba> it wanted to make me install TSL or something like that
<NewbieBaba> even if i chose everything on the list
<jrib> yeah gaim and msn don't work that well in my experience
<NewbieBaba> it doesnt connect
<NewbieBaba> how can i run MSN on linux then ? :/
<NewbieBaba> sorry if i am bothering u baba :(
<jrib> NewbieBaba: try #ubuntu, maybe someone has had a similar experience.  I don't actually use msn so I can't really help
<NewbieBaba> ok tyt
<NewbieBaba> i wanted to ask if u're playin any Windows game but i bet you dont have time for games :P
<jrib> NewbieBaba: nope, I gave up games when I switched to Linux :)
<jrib> NewbieBaba: http://www.ubuntugames.org/  in portuguese but you should be able to make things out
<NewbieBaba> i like online games :P
<NewbieBaba> MMORPG
<NewbieBaba> %90 to Ubuntu :)
<NewbieBaba> jrib what about Beryl ?
<jrib> NewbieBaba: #ubuntu-effects can help with that
<NewbieBaba> ty :)
<NewbieBaba> i was just wondering if u prefer that one
<NewbieBaba> i want the best ubuntu system u know, themes, effects, etc things..
<jrib> NewbieBaba: compiz and beryl are merging soon so it doesn't really matter.  At the moment beryl has more features and some claim compiz is more stable though I haven't really noticed that
<NewbieBaba> oo thats good if they're merging :)
<NewbieBaba> more new features for us :D
<nothlit> theres amsn and mercury
<nothlit> bittlbee
<NewbieBaba> %70 left -.-
<nothlit> Battle for wesnoth is like age of empires
<nothlit> https://help.ubuntu.com/community/Games http://doc.gwos.org/index.php/Main_Page look at the games sections
<NewbieBaba> jrib : cya around man thank you for taking your time with my newbie questions
<NewbieBaba> late...
<Sakabatou> Guys, asus wl 138g, only with ndiswrapper ?
<Sakabatou> The lack of support of it its driving me crazy, feeling tempted to buy a RAlink
<bodhi_zazen> Hello classroom :)
#ubuntu-classroom 2007-04-14
<Generation> ok here
<jrib> Generation: hello
<Generation> jrib, hey
<Generation> Im such a noob
<Generation> in all things
<jrib> Generation: ok, what are you trying to do exactly?  Are you just curious about what is in there?
<Generation> I want to really learn the command line
<jrib> it's ok, it's just new to you.  Everyone started that way
<Generation> So I am trying to get into files to explore
<jrib> !cli | Generation
<ubotu> Generation: The linux terminal or command-line interface is very powerful. Open a terminal via Applications -> Accessories -> Terminal (Gnome) or K-menu -> System -> Konsole (KDE).  Manuals: https://help.ubuntu.com/community/BasicCommands
<jrib> Generation: the link at the bottom of that page, to linuxcommand.org is excellent
<jrib> Generation: but lets figure out what's going wrong with what you are doing now
<Generation> ok
<jrib> Generation: ok, so I can know where you are at, what does this command return:  pwd
<Generation> its says home and professor
<bodhi_zazen> LOL
<jrib> Generation: it's best if you just copy and paste exactly what it says
<kbrooks> Generation, He wants you to copy and paste what it says.
<bodhi_zazen> do you mind if I insert a link ?
<kbrooks> bodhi_zazen, go on... but it better be good.
<Generation> man I am so lost lol
<bodhi_zazen> http://doc.gwos.org/index.php/CommandLineBeginners
<Generation> it wont let me copy it
<jrib> Generation: right click > copy
<Generation> ctrl c wont work in command line
<Generation> ok
<Generation> /home/professor
<jrib> Generation: if you want to use the keyboard, you can use ctrl-shift-c
<Generation> ohhhhhh ok
<jrib> Generation: also, you Linux lets you just highlight something to copy it and then use middle click to paste it somewhere else, really convenient
<Generation> ok
<jrib> Generation: ok, so what did you do last time to try to get to "games"?
<Generation> well it is a file folder
<Generation> called Thief deadly shadows
<jrib> Generation: is it on your Desktop?
<Generation> no
<jrib> Generation: ok, what do you want to do with it?  Is this a windows game?
<Generation> Yea IT is
<Generation> I just wanted to open it up and see what is in side
<jrib> ok
<jrib> so where is it located?
<Generation> ok if I type in "ls" it shows up
<jrib> ok, so now you should be able to type this:  cd Thief
<jrib> and then press the TAB button twice and it should complete the rest
<Generation> ok here is an example
<Generation> I have a books called oriellys
<Generation> and if I do cd I cant get into them
<Generation> nope didnt work
<jrib> what does it say when you try?
<Generation> nothing
<Generation> command not reconized
<jrib> Generation: paste the command you used
<Generation> ok
<Generation> ok wait I got it
<Generation> got into file
<Generation> cool
<jrib> k
<Generation> ok
<Generation> my next question is this
<Generation> How do I go into a program, like a game, and change something
<Generation> I have this game on linux
<Generation> racing game and I want to change the time limit of the race so I can beat it
<Generation> lol
<jrib> haha
<Generation> How  do I get into the txt file
<Generation> and how do I change it
<jrib> Generation: depends how the time limit is set.  If it is some kind of setting, you can edit the configuration files for the game.  These are probably somewhere in /etc or if it's something your user can configure they might be in ~/.name_of_game where "~" means "/home/professor"
<jrib> if it's hard coded, then you would have to edit the source code...
<jrib> Generation: what game by the way?
<Generation> ok that is another thing, sorry I am throwing quesitons at you
<Generation> Trigger
<Generation> I beat it once
<Generation> and I want to see what I can do with everything else
<Generation> I tried the "find" still nothing
<jrib> Oh I like this game, let me see...
<Generation> and where is a good place to get linux games, most of them are sinple
<jrib> Generation: I'm guessing somewhere in /usr/share/trigger-data
<jrib> Generation: yeah, for example /usr/share/trigger-data/maps/desertstorm/storm.level is an xml file with what seems to be some time info
<jrib> "targettime"
<jrib> hmm trigger just locked up X for me on feisty, and since there is some strange bug in feisty I was trying not to reboot... I may not return :)  Any last minute questions?
<Generation> yea
<Generation> I got in
<Generation> and there is no xml file
<Generation> to
<Generation> edit and when I find it how do I edit it
<jrib> storm.level is the file
<jrib> I would make a backup copy first and then edit like this: gksudo gedit /usr/share/trigger-data/maps/desertstorm/storm.level
<Generation> ok
<Generation> thanks man
<Generation> it has been fun
<Generation> ok got a quick question, my graphics are going real slow
<Generation> like bit by bit
<Generation> how do I fix that
<jrib> what kind of video card do you have?
<Generation> ati
<Generation> it worked fine before
<jrib> !ati | Generation
<ubotu> Generation: To install the Ati/NVidia drivers for your video card, see https://help.ubuntu.com/community/BinaryDriverHowto
<Generation> I must of did something
<Generation> I got wine working last night
<Generation> was so excited
<Generation> How do I reload drivers for ati card
<jrib> Generation: you'll have to follow the guide on the wiki, I've never had the pleasure of setting up an ati card on linux
<Generation> slol
<Generation> ok thanks
<Generation> have a good onne
<jrib> Generation: or try asking in #ubuntu, if the wiki doesn't help
<jrib> you too
<Generation> thanks
<Lbawinowns> Hi!
<Lbawinowns> So jrib, what field in what application?
<jrib> Lbawinowns: ok, lets take a step back
<Lbawinowns> Ok
<jrib> Lbawinowns: you have formatted the partition as ext3 using gparted?
<Lbawinowns> I think so, I unmounted it with gparted and then i took format to ext3
<jrib> Lbawinowns: ok, now open up fstab with:  gksudo gedit /etc/fstab
<jrib> paste the line for /dev/hda2 here
<Lbawinowns> I think i get some error
<Lbawinowns> it says:
<Lbawinowns> (gedit:15392): GnomeUI-WARNING **: While connecting to session manager:
<Lbawinowns> Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed.
<nalioth> Lbawinowns: you'll always see that sort of stuff when using the terminal
<Lbawinowns> Ok, should I use other?
<jrib> Lbawinowns: gedit doesn't open?
<Lbawinowns> No
<Lbawinowns> wait, i think it's alredy open
<Lbawinowns> #Added by diskmounter utility
<Lbawinowns> /dev/hda2 /media/hda2 ntfs ro,user,fmask=0111,dmask=0000 0 0
<Lbawinowns> sorry, it was alerdy open
<jrib> Lbawinowns: ok, change it to: /dev/hda2 /media/hda2 ext3 defaults 0 2
<Lbawinowns> all those lines?
<jrib> Lbawinowns: just the one for /dev/hda2
<Lbawinowns> should i save it?
<jrib> yep
<Lbawinowns> OK done
<jrib> sudo mount -a
<Lbawinowns> should i write in terminal?
<jrib> right
<Lbawinowns> hmm... nothing happens, is that right?
<jrib> yep, now see if you can write in /media/hda2
<Lbawinowns> Nope I can't, but it is a folder called lost+found there witha red cross in top right of it
<jrib> oh right we need to setup permissions.  Are you familiar with permissions?
<Lbawinowns> hmm... not when it comes to linu
<jrib> !permissions | Lbawinowns
<ubotu> Lbawinowns: The files and directories on an Ubuntu system are organized according to a standard, see http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard - file permissions are explained at https://help.ubuntu.com/community/FilePermissions - All filenames and directory names (and many other things) are case sensitive in Linux
<jrib> take a coupl of minutes to read through that second link, ask here if you aren't sure what to do afterwards
<Lbawinowns> Thanks :)
<Lbawinowns> hmm... should i give /media/hda2 permission rwx?
<jrib> Lbawinowns: well it depends how you want to set it up
<jrib> Lbawinowns: you can give just your user the ability to write or you can give everyone that ability or you can setup a group so that only users in that group can do it
<Lbawinowns> what does the user@host mean?
<jrib> Lbawinowns: that's just what you see at your command line, you see your_username@your_hostname
<Lbawinowns> hmm, 755 seems reasonable :), i can do it all while  other users can run and read, right?
<Lbawinowns> so if i write in terminal "/media/hda2 chmod 755" Will it result in that I can write to that partition?
<Lbawinowns> lol i tried, and it just says that /media/hda2 is a catlouge XD
<Lbawinowns> erm, jrib, I hope I'm not impatient. But can you assist me?
<jrib> Lbawinowns: now that I have you hooked, each additional help will be $5 :)  j/k, what's up?
<Lbawinowns> Well, /media/hda2 chmod 755 doesnt do anything, it probably has a good reason for it tough :p
<jrib> Lbawinowns: sudo chmod 755 /media/hda2
<jrib> but then you will want to be the owner of /media/hda2, so you should also do:  sudo chown -R $USER: /media/hda2
<Lbawinowns> Haha you're such a nice person jrib :D, and smart!
<Lbawinowns> I don't know what keeps up your aiding spirit. But I guess some people just are noble :)
<sorcerer> wat happens in this room
<NewbieBaba> jrib baba r u there ?
<jrib> NewbieBaba: I am, but it is best if you just ask in #ubuntu, plenty of people can help there
<NewbieBaba> well
<NewbieBaba> hi jrib :D
<jrib> hi again
<NewbieBaba> u should remember me from last days i had problem with Live cd n downloaded the alternate cd as u said
<NewbieBaba> i tried to install it n then yea i did i guess
<NewbieBaba> n desktop didnt show up
<NewbieBaba> it says Ubuntu 6.10 ubuntu -- ubuntu login :
<NewbieBaba> after i log
<jrib> right, you went straight to a login prompt
<jrib> no errors right?
<NewbieBaba> username@ubuntu:~$
<NewbieBaba> yea
<NewbieBaba> n then i did
<NewbieBaba> apt-cache policy ubuntu-desktop | grep -i installe
<NewbieBaba> apt-cache policy ubuntu-desktop | grep -i installed
<NewbieBaba> nothing show up
<NewbieBaba> i think nothing will show up with that command anyway
<jrib> ok, you are going to get a quick irssi primer so we can talk while you are on ubuntu, ok?
<jrib> or do you know how to use irssi?
<NewbieBaba> no :/
<NewbieBaba> i dunno what is irssi either
<jrib> ok, first when you press ctrl-alt-f2  you will get a new login prompt
<NewbieBaba> tty2
<NewbieBaba> or something
<NewbieBaba> yea?
<jrib> right, and ctrl-alt-f1 brings you back to tty1
<NewbieBaba> yea
<jrib> ok, so when you get on ubuntu, install irssi with this command:  sudo apt-get install irssi
<jrib> hopefully that will work...
<NewbieBaba> baba i cant get on ubuntu
<jrib> you can do this at the command line you are in
<NewbieBaba> o
<jrib> the user@ubuntu$ thing
<jrib> ok, then this is how you use irssi:
<NewbieBaba> so i'll use that command on my command line "sudo apt-get install irssi"
<jrib> yes
<NewbieBaba> no NET connection needed right?
<jrib> yes, you need internet
<NewbieBaba> its like something coming with my install files
<NewbieBaba> :/
<jrib> NewbieBaba: does ubuntu have no net access?
<NewbieBaba> baba i cant use Desktop of ubuntu
<NewbieBaba> it makes me go that command line
<NewbieBaba> when i reboot my computer
<NewbieBaba> i can never get on Desktop
<NewbieBaba> i can only get on that command line
<NewbieBaba> its like
<jrib> NewbieBaba: that's ok, you probably still have access to the internet on the command line, assuming ubuntu set it up correctly
<NewbieBaba> Starting Up...
<NewbieBaba> o
<NewbieBaba> ok i'll try
<jrib> if not, you'll find out when you issue the install command.  Make sure you copy any errors you get
<NewbieBaba> should i use "apt-cache policy.." again ?
<jrib> nah
<NewbieBaba> ok only sudo apt-get install irssi
<NewbieBaba> then
<jrib> I'll tell you how to start irssi in a second, let me create a new user
<tester> ok
<jrib> so to start irssi, you can issue this command:  irssi -c irc.ubuntu.com
<NewbieBaba> is it like a chat program that i can use ?
<jrib> NewbieBaba: then once irssi starts and is connected, you can join this channel with:  /join #ubuntu-classroom
<NewbieBaba> ok
<NewbieBaba> goin to try that
<NewbieBaba> bbl baba
* jrib needs to find who decided to remove irssi from a default install...
<NewbieBaba> no im still on XP :(
<NewbieBaba> jrib : i think that command line doesnt support NET connection thing
<jrib> NewbieBaba: what error did you get
<NewbieBaba> E : couldnt find package
<NewbieBaba> sudo apt-get install irssi
<NewbieBaba> thats the command right ?
<jrib> yes
<jrib> NewbieBaba: do you remember which option you chose when you loaded the install disk?
<NewbieBaba> i tried all options
<NewbieBaba> all way makes me go that command line
<NewbieBaba> no desktop
<NewbieBaba> i'll try to explain like its like Windows
<NewbieBaba> i install Windows n a desktop shows up right ?
<NewbieBaba> that desktop doesnt show up
<NewbieBaba> i see only CMD
<jrib> I understand
<NewbieBaba> like i should start "setup"
<jrib> NewbieBaba: ok, on your next reboot we are going to try two things
<NewbieBaba> ok <3
<jrib> first, we'll see if you have internet access, enter this command:  ping www.google.com
<NewbieBaba> ok
<jrib> If it keeps throwing out output, then you are connected to the internet.  To stop it, you press ctrl-c
<NewbieBaba> k
<NewbieBaba> now im goin ?
<jrib> not yet
<NewbieBaba> roger :D
<NewbieBaba> if i have net connection i am able to get irssi yea?
<jrib> NewbieBaba: yes
<NewbieBaba> if not ?
<jrib> you are in for many reboots :)
<NewbieBaba> :D
<jrib> ok, then you can try this: sudo sed -i 's/^# deb/deb/' /etc/apt/sources.list && sudo apt-get update && sudo apt-get install ubuntu-desktop
<NewbieBaba> lalalal
<NewbieBaba> on the same command line ?
<jrib> yes
<NewbieBaba> ok
<jrib> ok, see you in a bit
<NewbieBaba> cya
<jrib> I wonder if he is stuck pinging google
<NewbieBaba> jrib : i love u man something finally happpen :D
<NewbieBaba> but..
<NewbieBaba> yea i dont have net connection on command line
<NewbieBaba> after i see that i type that command that u just gave me
<NewbieBaba> it wanted to make me put a CD
<NewbieBaba> i put Alternate CD
<NewbieBaba> n it installed too many things
<NewbieBaba> after %100 it said
<NewbieBaba> Failed to fetch cdroom : ...... /pool/main/s/shared.mime.info/shared-mime-info-0.18_0ubuntu1_i386.deb MD5Sum
<NewbieBaba> E : Unable to fetch some archives,maybe run apt-get update or try with --fix-missing?
<jrib> NewbieBaba: ok, so I guess it didn't continue to install ubuntu-desktop?
<NewbieBaba> it wanted to me put cd rom :/
<jrib> NewbieBaba: did you put it in?
<NewbieBaba> yea that Alternate CD
<jrib> ok, so on reboot it still takes you to command line?
<NewbieBaba> yea
<jrib> NewbieBaba: were you able to ping google?
<NewbieBaba> unknown host
<NewbieBaba> no connection :)
<jrib> ok, we'll just use the cd then
<NewbieBaba> i did ?
<NewbieBaba> <NewbieBaba> i put Alternate CD
<NewbieBaba> <NewbieBaba> n it installed too many things
<jrib> but we'll fix it so it doesn't try to connect to the net
<jrib> here is what you do:
<jrib> sudo mv /etc/apt/sources.list /etc/apt/sources.list.backup && sudo touch /etc/apt/sources.list && sudo apt-get update
<jrib> then put the alternate cd in your drive
<jrib> then do this command:  sudo apt-cdrom add && sudo apt-get update && sudo apt-get install ubuntu-desktop
<NewbieBaba> n then i'll throw the computer from window
<NewbieBaba> :D
<jrib> heh :)
<NewbieBaba> it will stop me bothering u sorry man :/
<jrib> it's ok, I'm reading stuff at the same time
<NewbieBaba> ok so im goin to do those things now yea?
<jrib> yep, this should work
<NewbieBaba> ok bbl :D
<NewbieBaba> <3
<NewbieBaba> here i am jrib i know u were waiting for me ^^
<NewbieBaba> why those developers of Ubuntu make an Easy install thing.. ahh
<NewbieBaba> w/e i did everything that u told me
<NewbieBaba> theres still no desktop
<jrib> NewbieBaba: did you get any errors?
<NewbieBaba> hmm
<NewbieBaba> Failed to fetch cdrom :
<NewbieBaba> ..../pool/main/s/shared-mime-info/shared-mime-info_0.18_Oubuntu1_i386.deb
<NewbieBaba> MD5Sum
<NewbieBaba> E: Unable to fetch some archives, maybe run apt-get update or try with --fixmissing?
<jrib> NewbieBaba: did you verify the cd?  It should be an option when you boot from the cd
<NewbieBaba> yea its the exact cd
<NewbieBaba> o wait
<NewbieBaba> should i reboot comp with the CD?
<NewbieBaba> Alternate CD i mean
<jrib> yes, and then look for the option that lets you verify the cd
<NewbieBaba> ok probably i'll see a window of setup options
<NewbieBaba> which one should i chose ?
<NewbieBaba> or i wont?
<jrib> NewbieBaba: when you boot from the cd, you get a list of options
<NewbieBaba> yea
<jrib> I think there is an option that says something similar to "verify the cd"
<NewbieBaba> hmm
<NewbieBaba> n then?
<jrib> see if it is verified
<NewbieBaba> ok
<NewbieBaba> cya in a bit
<NewbieBaba> the List "Install in text mode
<NewbieBaba> Install in oem mode
<NewbieBaba> Install a command-line system
<NewbieBaba> Check cd for defects..
<NewbieBaba> nothing about verifying CD
<NewbieBaba> :/
<NewbieBaba> jrib
<jrib> NewbieBaba: "check cd for defects" sorry
<NewbieBaba> :D
<NewbieBaba> ok
<NewbieBaba> yea i was thinkin about to choose that one
<NewbieBaba> well w/e
<NewbieBaba> brb:D
<NewbieBaba> k jrib
<jrib> NewbieBaba: what did it say?
<NewbieBaba> the error im gettin "./pool/main/l......  file failed the MD5 Checksum...."
<NewbieBaba> want to me burn one more Alternate CD?
<jrib> NewbieBaba: then you need to burn a new cd, yeah.  Burn it slow at like 2x
<NewbieBaba> ok
<NewbieBaba> 4x also cool yea?
<jrib> NewbieBaba: ok
<NewbieBaba> well burning
<NewbieBaba> why those developers wont make the installation easy as Windows of Ubuntu?
<NewbieBaba> just curious
<NewbieBaba> lol
<jrib> NewbieBaba: it usually is, you are probably just having problems because of the bad burn
<NewbieBaba> hmm
<jrib> you should be able to just install and then go straight to the Desktop
<NewbieBaba> why do i need Alternate CD what is it for ?
<jrib> NewbieBaba: well the normal installer sometimes has problems on some hardware, so the alternate install is there as a backup
<NewbieBaba> kk
<NewbieBaba> if i solve those problems n able to get on Ubuntu i'll name my son as ur name :D
<NewbieBaba> i have nothin to pay to u to taking ur time with my problems hehe
<jrib> NewbieBaba: heh, name him "ubuntu" :)
<NewbieBaba> Ubuntu means 'I am what I am because of who we all are'
<NewbieBaba> is that ?
<NewbieBaba> lol
<jrib> yeah
<NewbieBaba> as South Africa ppl things : compassionate,merciful,benevolent
<NewbieBaba> nice name isnt it :D
<NewbieBaba> kk goin to install that CD jrib
<NewbieBaba> which option i'll choose
<NewbieBaba> in text mode
<NewbieBaba> oem mode
<NewbieBaba> command-line
<jrib> NewbieBaba: k, use "in text mode"
<NewbieBaba> ok ty
<NewbieBaba> hope cya with irssi :)
<NewbieBaba> jrib that doesnt work :(
<jrib> NewbieBaba: what happens
<NewbieBaba> umm
<NewbieBaba> i burnt new cd
<NewbieBaba> booted with that cd
<NewbieBaba> installed in text mode
<NewbieBaba> it wanted to me reboot computer
<NewbieBaba> so i did
<NewbieBaba> n then i came to CMD line again
<jrib> no errors?
<NewbieBaba> hmm
<NewbieBaba> yea while setup i got an error like some archives cant install
<jrib> did you verify the new cd?
<NewbieBaba> nope
<NewbieBaba> ok i'll
<NewbieBaba> if its bad record
<NewbieBaba> what will i do?
<NewbieBaba> one more new cd ?
<NewbieBaba> no.. :(
<NewbieBaba> no error while burning cd
<NewbieBaba> do u think should i re-download it ?
<NewbieBaba> it will take 4 hours for me :S
<jrib> ok lets check the .iso you downloaded first then
<jrib> !verify
<ubotu> To verify your Ubuntu ISO image (or other files for which an MD5 checksum is provided), see http://help.ubuntu.com/community/VerifyIsoHowto or http://www.linuxquestions.org/linux/answers/LQ_ISO/Checking_the_md5sum_in_Windows
<NewbieBaba> which link should i go to?
<jrib> second
<NewbieBaba> what is "\path\to\cddir"
<NewbieBaba> system cant find the way of folder
<NewbieBaba> if i use that with "cd"
<NewbieBaba> jrib :)
<jrib> NewbieBaba: it is the path to wherever your .iso is
<NewbieBaba> its in D:\Yedekler\
<NewbieBaba> so ?
<NewbieBaba> :S
<jrib> so instead of typing \path\to\cddir type D:\Yedekler\
<NewbieBaba> md5sum -c filename.md5
<NewbieBaba> ubuntu-6.10-alternate-i386.iso is file name
<NewbieBaba> when i replace filename with ubuntu-6.10-alternate-i386.iso
<NewbieBaba> it says no such file or directory
<NewbieBaba> jrib
<jrib> oh you need to download the .md5 file
<jrib> one sec
<jrib> http://releases.ubuntu.com/6.10/MD5SUMS
<NewbieBaba> 549ef19097b10ac9237c08f6dc6084c6  ubuntu-6.10-alternate-i386.iso
<NewbieBaba> want to me save that page as something.md5 ?
<NewbieBaba> or what
<NewbieBaba> jrib :/
<jrib> NewbieBaba: yes
<NewbieBaba> huh?
<jrib> save the file and then that is file you pass to md5sum -c
<jrib> save it in the same place as your .iso
<NewbieBaba> save as TXT?
<NewbieBaba> it wont let me to save as .md5 :/
<NewbieBaba> No such file or directory
<NewbieBaba> da
<NewbieBaba> wow im tryin to install ubuntu for 4 hours already i could installd 100 x XP till now :D
<NewbieBaba> please baba if i cant solve that problem i'll cry
<NewbieBaba> jrib
<jrib> NewbieBaba: save as txt
<NewbieBaba> done
<NewbieBaba> n then?
<jrib> run the md5sum command
<NewbieBaba> ubuntu-6.10-alternate-i386: FAILED md5sum WARNING : 1 of 1 computed checksum did NOT match
<NewbieBaba> jrib
<jrib> NewbieBaba: well that's good, at least now we know why it isn't working.  But now you need to download again
<jrib> after you download again, check the md5sum
<NewbieBaba> ahhhhhhhhhh
<NewbieBaba> i'll throw that s..t from the window now
<NewbieBaba> can u give me the exact link to download the file please ?
<jrib> NewbieBaba: heh, leave it downloading and go for a walk so you can relax a bit :)  I would be a little frustrated too
<jrib> http://releases.ubuntu.com/6.10/ubuntu-6.10-alternate-i386.iso
<NewbieBaba> %1 baba -.-
<NewbieBaba> ahh well
<NewbieBaba> im goin out
<NewbieBaba> like u said (LOL)
<NewbieBaba> cya soon baba
<jrib> bye
<NewbieBaba> thank you for everything
<jrib> you're welcome
<NewbieBaba> peace..
<NewbieBaba> hey
<NewbieBaba> jrib r u awake ? :)
<jrib> NewbieBaba: hi
<NewbieBaba> :) hows u baba
<NewbieBaba> baba = a saying in Turkish like "buddy"
<jrib> ah, good to know
<NewbieBaba> well baba i DL/ed it again n burnt a cd (after checking with md5sum). i installed it in Text mode. finally desktop show up
<NewbieBaba> but!... after i log nothing happens
<NewbieBaba> i think still some files are missing
<jrib> haha, of course.  Because taht would be too easy!
<jrib> ok, but you got a nice colorful login screen right?
<NewbieBaba> ok what now baba! :D
<NewbieBaba> yea the orange one
<NewbieBaba>  slm xD
<NewbieBaba> that one
<jrib> ok, when you login what happens exactly
<NewbieBaba> nothing :)
<jrib> so you stay at the login screen?
<NewbieBaba> it passes login secreen
<NewbieBaba> n then nothing
<NewbieBaba> nope
<jrib> so you have a solid color on the screen?
<NewbieBaba> only orange window
<NewbieBaba> yea exactly
<NewbieBaba> actually nothing happened after installing in text mode so i tried those command that u teachd me
<jrib> ok, no internet though?
<NewbieBaba> so finally i got on login window(with desktop)
<NewbieBaba> yea no internet
<jrib> how do you connect to the internet?
<NewbieBaba> with DSL modem
<NewbieBaba> Eth.
<jrib> hmm ok, no experience with those
<jrib> NewbieBaba: so when you see that solid color screen, does it just stay there until you reboot?
<NewbieBaba> yea
<NewbieBaba> i tried to relog
<NewbieBaba> like pressing "ctrl+alt+backspace"
<NewbieBaba> its still same
<jrib> by "still same" you mean the screen stayed there right?
<NewbieBaba> yea
<jrib> hmm weird, what video card do you have?
<NewbieBaba> ATI EAX550
<NewbieBaba> remember i installed it before everything was fine..
<jrib> NewbieBaba: you had ubuntu edgy eft installed before without problems and you didn't need to do any strange configuration?
<NewbieBaba> baba i used 2 cd to get on that desktop i want to tell u that i am missing some files for desktop i guess
<jrib> NewbieBaba: I don't understand what you mean
<NewbieBaba> yea i didnt need anything to do before
<NewbieBaba> ok look
<NewbieBaba> i installed in text mode
<NewbieBaba> n then i got on command line again
<NewbieBaba> n then i type those commands
<NewbieBaba> sudo apt-cdroom add && sudo apt-get update && sudo apt-get install ubuntu-desktop
<NewbieBaba> n then it gave me an error like
<NewbieBaba> Failed to fetch cdrom : .../pool/main/e/ekiga/ekiga_2.0.3-0ubuntu3_i386.deb
<jrib> you verified this cd?
<NewbieBaba> yea
<NewbieBaba> it said OK
<NewbieBaba> n then that error >.<
<jrib> if it gave you that error when you tried to verify it, there is probably something wrong
<NewbieBaba> can u tell me how can i get that file from other cd to copy where should i copy it to
<NewbieBaba> i verified it
<NewbieBaba> nothing was wrong
<NewbieBaba> after installing
<NewbieBaba> n that command "sudo apt-cdroom ...."
<NewbieBaba> it gave me that error
<jrib> NewbieBaba: ok, if you do 'apt-cache policy ubuntu-desktop' now it says it is installed?
<NewbieBaba> " apt-cache policy ubuntu-desktop | grep -i installed "
<NewbieBaba> i tried that one
<NewbieBaba> nothing showed up
<jrib> did you try it after installing ubuntu-desktop?
<NewbieBaba> yea nothing showed up
<NewbieBaba> either nothing happen
<jrib> NewbieBaba: is your ubuntu in english?
<NewbieBaba> Turkish
<NewbieBaba> does it matter?
<jrib> ah ok, just do "apt-cache policy ubuntu-desktop"
<NewbieBaba> ok
<NewbieBaba> i'll
<NewbieBaba> bbl
<jrib> yes, because it will say "installed" in turkish
<NewbieBaba> :D
<NewbieBaba> o
<NewbieBaba> ok baba
<NewbieBaba> jrib : Installed : (none) Candidate : 1.30 Version Table 1.30 0  500 Cdrom://Ubuntu 6.10 _Edgy Eft_ Release edgy/main packages
<NewbieBaba> :/
<jrib> NewbieBaba: ok, so now when you do 'sudo apt-get install ubuntu-desktop' you must get some errors.  Can you copy down the important ones? or save them to a file and then grab them later when you are on windows
<NewbieBaba> how to save in a text file or something ?
<jrib> NewbieBaba: sudo echo hi && sudo apt-get install ubuntu-desktop &> ~/errors
<jrib> oh, actually you don't need that hi part... just do:  sudo apt-get install ubuntu-desktop &> ~/errors
<NewbieBaba> ok
<NewbieBaba> goin..
<jrib> erm, never mind.  You *do* need the hi part!
<NewbieBaba> :D
<NewbieBaba> k
<NewbieBaba> k jrib i'll type u the error im gettin
<NewbieBaba> Failed to fetch cdrom : [Ubuntu 6.10 _Edgy Eft_ - Release.. 20061025.1] /pool/main/e/ekiga_2.0.3-0ubuntu3_1386.deb
<NewbieBaba> E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
<jrib> it's a problem with the cd then
<NewbieBaba> man im just tryin to say if i had problem with an XP cd (if any file doesnt work) i was using any other cd for that file u know what i am saying ? i have 3 different cd so i think i can copy that file from other cd's..
<NewbieBaba> help me with that maybe it'll help to my problem
<jrib> ok, maybe you can go to packages.ubuntu.com and download the .deb package for _edgy's_ ekiga and drop it in /var/cache/apt/archives/
<jrib> but it's unlikely this is the only problem
<NewbieBaba> worth a try! why not yea?
<NewbieBaba> :)
<NewbieBaba> C:\Downloads>md5sum -c md5sums.txt
<NewbieBaba> ubuntu-6.10-alternate-i386.iso: OK
<jrib> right, and then you need to check the burn too
<NewbieBaba> i burnt it in 4x mode
<NewbieBaba> i have no less selection than that one
<NewbieBaba> btw can u help me to find ekiga_2.0.3-0ubuntu3_1386.deb :/
<jrib> "check cd for defects" when you boot from the cd, you ran this too?
<NewbieBaba> yea
<jrib> NewbieBaba: packages.ubuntu.com, then just search for ekiga in edgy.  There is a search box on the page
<NewbieBaba> it passed
<NewbieBaba> usr/bin/ekiga						    gnome/ekiga
<NewbieBaba> usr/share/menu/ekiga					    gnome/ekiga
<NewbieBaba> which one ?
<jrib> http://packages.ubuntu.com/edgy/gnome/ekiga
<jrib> at the bottom, click on i386
<jrib> hope that works, but try #ubuntu if not.  I'll be afk for a bit
<NewbieBaba> how to drop it in /var/cache/apt/archives/
<jrib> !ext3
<ubotu> ext3 is the default filesystem on Ubuntu, and the most popular on Linux. You can read/write from Windows to ext3 via http://www.fs-driver.org
<NewbieBaba> ty
#ubuntu-classroom 2007-04-15
<t> j #fbi-oe
<t> debug
<NewbieBaba> jrib baba!
<NewbieBaba> :)
<NewbieBaba> im on ubuntu lalalala
<NewbieBaba> i solve the problem somehow lol
<jrib> NewbieBaba: cool, but how?
<NewbieBaba> umm
<NewbieBaba> i dunno how to explain
<NewbieBaba> im so excited atm
<NewbieBaba> heh
<NewbieBaba> i'll make ur fun-site :D
<jrib> NewbieBaba: ok, well glad to hear you got it working
<NewbieBaba> hmm i'll still need your helps baba i know u'll help me <3
<NewbieBaba> thanks for everything
<NewbieBaba> btw.. do u ever sleep ? :/
<jrib> hopefully you have a lot of frustration kharma now so the rest of ubuntu should be a breeze
<NewbieBaba> u work too much
<jrib> NewbieBaba: I do, but whenever I'm on the computer I keep irc in the corner and glance every once in a while when I need a break from waht I am doing
<NewbieBaba> :) sweet
<NewbieBaba> u're so helpfull i hope u get whatever u earn..
<NewbieBaba> as a pray.. :)
<NewbieBaba> jrib theres something showed up "Software updates" n found 175 updates im updating everything is that ok? i quick check the list nothing seems wrong
<jrib> NewbieBaba: yep, that should be ok
<NewbieBaba> jrib : if i use CTRL+ALT+BACKSPACE does it mean restart?
<jrib> NewbieBaba: it will restart X, make sure you save everything you are working on
<NewbieBaba> so i dont need reboot computer?
<NewbieBaba> w/e cool thanks!...
<NewbieBaba> <3
#ubuntu-classroom 2008-04-07
<zasf> where can I ask if I need help on packaging?
<pleia2> zasf: #ubuntu-motu
<zasf> thanks
#ubuntu-classroom 2008-04-08
<Syntux> wohaaa! why would propel fail to execute a native query when the very same query works fine on the console eh!
<Syntux> oopss, wrong channel
<Syntux> not again
<m1r> hello
<m1r> anyone around ?
#ubuntu-classroom 2008-04-09
<evegav_> wenas tardes
<evegav_> t
#ubuntu-classroom 2008-04-11
<miguel__> holas
<miguel__> esta activo este canal????????
<rzr> miguel__: this channel's lang is usually english
<rzr> is http://packages.ubuntu.com down ?
#ubuntu-classroom 2008-04-12
<GunbladeIV> hello mypapit
<mypapit> hello GunbladeIV
<GunbladeIV> :)
 * mypapit just newbie
<GunbladeIV> how are you?
<mypapit> u gonna teach today?
 * mypapit attending ubuntu class, coz /me is a complete n00bs
<GunbladeIV> <-- me too.. but your nick sounds like the owner of blog.mypapit.net which is a great blog
<GunbladeIV> i learn a lot from that blog
<GunbladeIV> :D
<mypapit> no no no
<GunbladeIV> no? you are not the owner?
<mypapit> i only know how to use mouse and move it around
<GunbladeIV> i see.. i dun even have mouse
<mypapit> then i click it on an application
<GunbladeIV> only touch pad
<mypapit> when the application starts, i clapped my hand in joy!
<GunbladeIV> hahaha
<mypapit> exciting experience for me
<GunbladeIV> yeah.. for newbies like us...
<GunbladeIV> should be an exciting experience when the application run with no errors
#ubuntu-classroom 2008-04-13
<visualdeception> has anyone heard if we are having a meeting today??
<visualdeception> i'll take that as a no
<Heartsbane> I guess I was 1 hour late myself
<Heartsbane> but I had a excuse :)
#ubuntu-classroom 2009-04-06
<amar> I have installed Jaunty Beta .. Suggest a nice and stable Download Manager with resume download support.. in vista I was using FDM ...
<Mamarok> amar: support for Jaunty is in #ubuntu+1
<amar> ok
<eddie1> helo kan enege  iemand my help
#ubuntu-classroom 2009-04-09
<Plague> hi all
<jimjeeves>      /msg nickserv set hidemail on
<k-s> hello
<Plague> hi
<deto> hi
<james_w> hi everyone
<Tumie> hi
<darkwise> hi
<RainCT> hi
<james_w> who's here for the packaging training session?
<deto> me
<Plague> hi, me i quess
<jimjeeves> I am
<JanTar> ye, me too
<piti> is that now ?
<blfgomes> I am
<Tumie> me too
<dave_sn> here
<james_w> wow, large crowd :-)
<james_w> so, I'm down to do a 15 minute session on bzr-builddeb
<lfelipe> hey
<james_w> this is a tool that I wrote to help with building packages from bzr branches
<james_w> is everyone interested in that?
<jimjeeves> yes
<Rafik> sure
<Rail> yes :)
<psicus78> yes
<darkwise> sure
<james_w> we can use the rest of the time after for general questiong
<deto> yep
<james_w> excellent
<dave_sn> yes
<james_w> so, first things first, why don't you all install the "bzr-builddeb" package while I talk a little about it
<james_w> is there anyone that doesn't know what bzr is?
<k-s> sure
<Tumie> i don't know bzr
<james_w> ok, let's start there
<james_w> bzr (http://bazaar-vcs.org/) is a version control system
<james_w> this allows you to keep snapshots of your work, and then to look back over them
<james_w> bzr is a very good one :-)
<james_w> in particular it is a "distributed" version control system
<james_w> what this means is that all of us are collaborating on a project, then we each get a "branch" of the project
<james_w> in that branch we work on the things that we are interested in
<james_w> so you can implement one feature, while I am working on another, and someone else is fixing bugs
<james_w> then we can all "merge" from each other, and bzr will use the historical information that we store to integrate all our work
<james_w> it isn't always possible to do this without human intervention, so it will sometimes ask us to help out
<james_w> so using this for developing Ubuntu can be very useful
<james_w> you can grab a branch of the package that you want to work on, and make your changes. You can then ask for a review, and if the reviewer asks you to change a few things then you can do so and ask again for review
<james_w> you can keep doing it until the reviewer is happy
<james_w> they can then take your branch and merge it to the main branch for the package
<james_w> so, lets have a look at what this might look like
<james_w> I maintain a site called "package-import.ubuntu.com" currently
<james_w> http://package-import.ubuntu.com/
<james_w> on there is a branch of every source package in Ubuntu
<james_w> we are working to make these available on launchpad
<james_w> you should all have "bzr" installed now if you installed "bzr-builddeb"
<james_w> you can check that by running "bzr help" at the command line
<james_w> so, to get ourselves a branch of a package we use the "bzr branch" command
<james_w> so everyone try:
<james_w> bzr branch http://package-import.canonical.com/s/ssss/jaunty
<james_w> that gets us a branch that corresponds to what is in the "ssss" package in Jaunty
<james_w> once that completes you should have a "jaunty" directory in your current directory
<james_w> everyone got that?
<HerbY_NL> yes
<Tumie> jes
<burun0> yes
<Tumie> *yes
<shankhs> ya
<jimjeeves> yes
<darkwise> yes
<Rafik> yes
<james_w> excellent :-)
<jimjeeves>     *
<jimjeeves>       /ignore #ubuntu-classroom CRAP NOTICES SNOTES CTCPS JOINS PARTS QUITS KICKS MODES WALLOPS NICKS DCC DCCMSGS CLIENTNOTICES CLIENTCRAP CLIENTERRORS HILIGHTS
<james_w> so, lets check we can build it
<james_w> if you "cd jaunty" and then run "bzr builddeb"
<james_w> it should build the package for you
<psicus78> i didn't got it
<james_w> psicus78: did you run the "bzr branch" command? Did it give you an error?
<shankhs> me too its giving error
<psicus78> (14:09:55) james_w: you should all have "bzr" installed now if you installed "bzr-builddeb" nothing more after this
<HerbY_NL> here also error
<RainCT> dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting.    - this one?
<shankhs> bzr: ERROR: unknown command "builddeb"
<jimjeeves> yes
<james_w> shankhs: it seems you don't have the "bzr-builddeb" package installed
<dave_sn> what if we're on hardy
<shankhs> james_w: ok
<james_w> psicus78: I will PM you the text in between
<plars> dpkg-checkbuilddeps: Unmet build dependencies: libgmp3-dev xmltoman quilt (>= 0.40)
<jimjeeves> I also get "dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting."
<psicus78> james_w: i didn't receive the message where you say what to branch
<psicus78> james_w: ok
<Tumie> bzr: ERROR: The build failed.
<james_w> ok
<blfgomes> sudo apt-get install libgmp3-dev xmltoman quilt
<james_w> so we don't have the "Build-Depends" installed
<HerbY_NL> to correct error: sudo apt-get install debhelper
<james_w> you can either do what blfgomes has suggested
<james_w> or use "apt-get build-dep ssss"
<HerbY_NL> package build ok after rest install
<blfgomes> cool, didn't know that one :)
<james_w> or you could just build a source package with "bzr builddeb -S"
<james_w> that will show the mechanism, but won't involve the extra packages
<james_w> ok, so that's 15 minutes
<posingaspopular>  bzr branch
<posingaspopular> bzr: ERROR: command 'branch' requires argument FROM_LOCATION
<james_w> I can show you a bit more of this, or we can move on to Q+A
<james_w> posingaspopular: you need "bzr branch http://package-import.ubuntu.com/s/ssss/jaunty"
<posingaspopular> thanks
<jimjeeves> Ok, "bzr builddeb" has worked for me now.
<james_w> excellent
<jimjeeves> it would be quite good for me to see more of this, pleas
<darkwise> james_w: " I can show you a bit more of this"  => +1
<james_w> ok, another 15 minutes of bzr-builddeb?
<shankhs> darkwise: +1
<jimjeeves> yes please
<james_w> I'm here to serve you people :-)
<blfgomes> it didn't work for me
<shankhs> james_w: ya
<james_w> blfgomes: did you get an error?
<blfgomes> gpg: skipped "James Westby <jw+debian@jameswestby.net>": secret key not available
<blfgomes> gpg: [stdin]: clearsign failed: secret key not available
<james_w> ah
<Rail> it worked actually :)
<james_w> so
<james_w> this is a common issue, not just with bzr-builddeb
<blfgomes> Rail: it actually said "bzr: ERROR: The build failed." at the end
<james_w> "debian/changelog" says that I changed the package, so it wants me to sign it, but you aren't me, and you don't have my secret key, so you can't
<james_w> so really at this point you want to build it without signing it
<james_w> you can do that with "bzr bd -S -- -uc -us" on Jaunty
<james_w> err, "bzr bd -- -uc -us" to build the binary package as you were doing, sorry
<Rail> ...or ignore thas message
<blfgomes> james_w, I can see why that happened... I just don't get why I'm the only one that got this error
<james_w> those on Intrepid or earlier won't have seen that
<blfgomes> oh, alright
<j1mc> i got an error, debuild: fatal error at line 1329:
<j1mc> dpkg-buildpackage -rfakeroot -D -us -uc failed
<james_w> blfgomes: it seems you are the only one running Jaunty :-)
<blfgomes> that explains it
<Tumie> i only have errors..
<james_w> j1mc: is there another error in the output?
<james_w> I haven't seen "-D" before
<fabiodmt> quit
<james_w> I'm not sure where that came from
<psicus78> I'm running jaunty and it ran fine with uc and us options
<shankhs> how to install bzr-builddeb?( i tried sudo apt-get install bzr-builddeb it didnt work)
<j1mc> ah, there are some unmet build dependencies.  i'll grab them
<Tumie> input: bzr builddeb output: bzr: ERROR: The build failed.
<james_w> Tumie: can you pastebin the whole output of the command please?
<Tumie> http://paste.ubuntu.com/147630/
<james_w> shankhs: it should do, it is in the repositories, did it say it didn't exist, or that it couldn't be installed?
<Rail> james_w: what's the magic of upstream tarball retrieving? debian/watch?
<james_w> Rail: in this case it uses "apt-get", it can also use debian/watch, yes
<shankhs> james_w: Couldn't find package bzr-buliddeb
<RainCT> shankhs: typo in there :)
<james_w> shankhs: ah, make sure you typed "sudo apt-get install bzr-builddeb"
<james_w> I realise it's not the easiest thing to type :-)
<j1mc> i'm good now.  :)
<posingaspopular> error: http://paste.ubuntu.com/147631/
<shankhs> james_w: thankhs
<shankhs> james_w: :)
<james_w> Tumie: ah, you need to install the "quilt" package, sorry. That is one of the build-dependencies, but you also need it to build the source package
<james_w> posingaspopular: you too
<posingaspopular> thanks :P
<Tumie> how to build the source package ?
<james_w> ok, anyone not managed to get it to build yet?
 * j1mc is ok
<james_w> Tumie: you did it :-) it was "bzr builddeb -S"
<Tumie> ok
<Rail> james_w: what's the preferred method of versioning packages: keeping the whole sources + debian dir or just debian and use --merge?
<shankhs> james_w: Where can I find the log of "bzr builddeb"?
<Rail> (for non-native packages of course)
<posingaspopular> k it build properly
<james_w> Rail: my preferred method is the whole source, some people prefer the latter. I prefer the former as it is not working against the version control system. With the latter you sometimes have to do things by hand that bzr could automate for you
<james_w> Rail: good question though
<james_w> shankhs: it doesn't save a log of its own operation
<james_w> ok, those who have built it, you can look at the history
<darkwise> james_w : can we install  builddeb if we're not on a debian like Linux ?
<shankhs> james_w: OK
<james_w> try "bzr log", or install "bzr-gtk" and look at "bzr viz", or if you prefer Qt then install "qbzr" and look at "bzr qlog"
<james_w> you can see there a summary of changes made to the package, and you can get diffs between versions easily
<posingaspopular> win 12
<james_w> darkwise: you can, though it's not packaged anywhere else. It also depends on various tools that will only normally exist on a Debian like distro, so you would have to install them too
<darkwise> james_w : thanks
<sky_walkie> I've got this:
<sky_walkie> dpkg-checkbuilddeps: Unmet build dependencies: debhelper (>= 5.0) libgmp3-dev xmltoman quilt (>= 0.40)
<sky_walkie> dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting.
<sky_walkie> dpkg-buildpackage: warning: (Use -d flag to override.)
<sky_walkie> debuild: fatal error at line 1329:
<sky_walkie> dpkg-buildpackage -rfakeroot -D -us -uc failed
<sky_walkie> bzr: ERROR: The build failed.
<sky_walkie> which probably means install that stuff to get things working ?
<posingaspopular> sky_walkie: sudo apt-get install libgmp3-dev xmltoman quilt
<Rafik> yes
<sky_walkie> thanks
<Rail> james_w: you mentioned "bzr could automate". What kind of automation you mean?
<pollywog> is there a metapackage that will install everything we need?
<james_w> Rail: say when you package a new upstream release. If you have patches to the upstream software then it can be tedious to go through each, check if it has been fully applied upstream, and resolve conflicts where necessary. bzr was built to do that sort of thing, so it's a lot easier.
<blfgomes> pollywog: apt-get build-dep ssss
<pollywog> ty
<Rail> james_w: you mean when upstream uses bzr?
<sky_walkie> well now I've got this error:
<sky_walkie> dpkg-buildpackage: warning: (Use -d flag to override.)
<sky_walkie> debuild: fatal error at line 1329:
<sky_walkie> dpkg-buildpackage -rfakeroot -D -us -uc failed
<sky_walkie> bzr: ERROR: The build failed.
<sky_walkie> so I've used -d option
<sky_walkie> and got this:
<sky_walkie> make: dh_testdir: Command not found
<sky_walkie> make: *** [clean-patched] Error 127
<sky_walkie> dpkg-buildpackage: failure: fakeroot debian/rules clean gave error exit status 2
<sky_walkie> debuild: fatal error at line 1329:
<sky_walkie> dpkg-buildpackage -rfakeroot -d -us -uc failed
<sky_walkie> bzr: ERROR: The build failed.
<Rail> sky_walkie: pastebin is great ;)
<james_w> Rail: it doesn't really matter. bzr-builddeb also allows you to package a new upstream from a tarball almost as if it was a branch.
<james_w> sky_walkie: ah, you also need to install "debhelper"
<sky_walkie> ok
<Rail> james_w: ah, ok, I need to refresh my bzr-builddeb knowledge :)
<james_w> Rail: yeah, that sort of stuff is just coming together. I need to iron out the kinks and document it better
<james_w> ok, does anyone have any questions?
<blfgomes> james_w: you said you planned to make every source package available on launchpad. How will that work?
<james_w> I'm happy to answer general packaging questions
<psicus78> james_w: I have one
<james_w> so if you are stuck on something then speak up
<j1mc> james_w: so bzr builddeb just grabs the tarball via the url of the upstream source package, and builds it for you?  is this done primarily for testing purposes?  you then need to update the changelog and stuff, right?
<frogfoot> How do I make the debian/rules file?
<frogfoot> the default one does not always work
<james_w> blfgomes: launchpad has a code hosting service for bzr, and one of the launchpad developers is currently working on making it support package branches well (not in terms of storage as such, but in terms of UI)
<james_w> blfgomes: once that is done we will migrate the branches to being stored on launchpad
<sky_walkie> <james_w> thanks no I've deb package
<sky_walkie> now
<james_w> sky_walkie: excellent
<blfgomes> james_w: oh, I thought you were trying to persuade developers to use bzr :)
<james_w> j1mc: it builds whatever is in the branch, but we also require a tarball to get the source package correct, so we automate fetching that where possible. The normal packaging tasks of updating changelog etc. are still pretty much the same
<RachedTN> james_w: when I try this command :  sudo bzr branch http://package-import.canonical.com/s/ssss/jaunty   I get this error : bzr: ERROR: Unknown branch format: 'Bazaar Branch Format 7 (needs bzr 1.6)\n'
<sky_walkie> so if I understand well, this is related to packages localted in bazaar only
<james_w> psicus78: shoot
<psicus78> james_w: j1mc asked the question I wanted to ask :)
<james_w> RachedTN: ah, you don't have a new enough bzr installed. I forgot about that requirement, sorry. There is a PPA with backports available if you like.
<pollywog> is bzr better than the traditional tools such as pbuilder or are they used for different things?
<james_w> blfgomes: I am :-)
<menesis> I have more than a hundred packages of zope modules. If I were to turn them into bzr-builddeb debian/-only branches and put into Launchpad, do I have to create a project for each of them?
<james_w> sky_walkie: bzr-builddeb is for use with bzr branches, yes, (though it works on SVN as well if you have bzr-svn installed)
<RachedTN> james_w: yes, I like to add it, could you please tell me :)
<james_w> pollywog: these are used for different things. You can make bzr-builddeb run pbuilder if you like
<james_w> RachedTN: there are links from "https://launchpad.net/bzr"
<sky_walkie> so if I've my onw bazaar configured with some source code than this bzr appz will do the rest to build ubuntu package
<james_w> menesis: not necessarily, you could put them all under one project
<RachedTN> thanks james_w and keep the good work man, it's reallly helpful and beautiful too :)
<james_w> frogfoot: hi, the debian/rules file is hard to create automatically. The default one from dh-make is primarily designed for packages that have a ./configure script and Makefile. If you don't have those then you need to tweak those lines to what is equivalent for your package.
<james_w> frogfoot: if you have an example package then I can give some more direct suggestions
<Rail> james_w: another one: I use quilt and debian/patches for "true" packaging :). Is there any way to automate preparation of patches?
<Rail> quilt add file file file; quilt refresh is boring :)
<james_w> sky_walkie: if you already have the packaging done, then yes it can build you the packages. It doesn't make writing the packaging any easier though, sorry :-)
<james_w> Rail: I agree :-). There is nothing like that yet, I would like to add it, but I'm not too sure what it should look like.
<james_w> Rail: you might be interested in http://vcs-pkg.org/ which aims to discuss that sort of thing
<Rail> james_w: thanks a lot
<psicus78> james_w: why do I get output files both in build-area and in the directory on top of jaunty?
<james_w> psicus78: it's a bit unfortunate, but necessary. It needs a temporary directory to do the work so that it doesn't mangle any of your precious files, so it uses build-area for that
<james_w> you should be able to delete it with no ill-effects
<james_w> it could use a real tempdir that it deletes before finishing, but it is sometimes useful to be able to look inside that directory, so it uses build-area to make that easy
<psicus78> ah ok, no problems, just asking...I thought the good files were those in build area... :)
<psicus78> are they always the same?
<james_w> as a last step it tries to copy them from build-area to .., so they should be
<james_w> it doesn't always work as we would like though :-)
<psicus78> james_w: ok, last question
<psicus78> just to understand if I figured out correctly. When I branch I get only debian dir and some other files
<psicus78> are those the ones that I patched to build the package?
<psicus78> namely, the files that differs from upstream?
<james_w> nope, with "ssss" you should have got all the files from the upstream as well
<james_w> it's just a small package :-)
<psicus78> ah, ok...so why does it get the orig.tar.gz?
<psicus78> I mean when you run bzr-builddeb
<james_w> because if you are building a source package as well it needs the actual .orig.tar.gz to produce a correct package
<james_w> due to the way that debian source packages work, just having the files isn't quite enough
<psicus78> fine
<james_w> it doesn't always need it though, so it could optimise by only fetching it when necessary
<psicus78> do you get any warning if the orig has changed? or just can't happen?
<psicus78> this lead to another question, when is the package updated on the site you maintain?
<psicus78> is it linked to upstream automatically?
<blfgomes> james_w: so the only reason we need the .orig.tar.gz is to build a source package as well? Could we tell bzr-builddeb to only build the .deb?
<jimjeeves> All: I have to go (lunchbreak's over).   james_w: Thanks, very informative.
<james_w> blfgomes: that's not currently possible
<james_w> psicus78: the orig.tar.gz isn't supposed to ever change unless the upstream version number changed
<pollywog> could checkinstall be used to build just a deb ?
<james_w> psicus78: if you were to edit the .orig.tar.gz on disk then I don't think you would get an error, but you would if you tried to upload to the archive
<pollywog> I am not sure whether checkinstall is still maintained
<james_w> psicus78: the branches on that site aren't linked to upstream. They are linked to the packages in the archive. So when a developer uploads a new version it appears there.
<james_w> psicus78: I however do plan to link it to upstream, and then provide reports when there is a new upstream and whether there are any conflicts, and then perhaps whether it builds, installs etc.
<psicus78> james_w: ok, I think I understood
<james_w> psicus78: that's a little way off though :-)
<psicus78> james_w: that would be cool
<james_w> pollywog: checkinstall can be used to build a .deb, yes. However, a .deb does not an Ubuntu package make.
<RachedTN> So, for people running hardy heron, you 'll notice that when you ï»¿try this command :  sudo bzr branch http://package-import.canonical.com/s/ssss/jaunty   I get this error : bzr: ERROR: Unknown branch format: 'Bazaar Branch Format 7 (needs bzr 1.6)\n'   , the solution is to remove bzr just installed using this command : apt-get remove --purge ï»¿bzr builddeb  , than download bzr 1.6 from : https://edge.launchpad.net/ubuntu/+source/bzr/1.6.1-1 
<james_w> it will give you something that you can install, but there is a bit more to the process than that, so I would be distrustful of the things that it produces
<psicus78> james_w: so, when a new upstream is released, which is the workflow to update the package?
<james_w> pollywog: it would also never be accepted in to Ubuntu proper, as we require proper source packages for that
<james_w> psicus78: take a look at "bzr help merge-upstream", that aims to automate some parts of it
<pollywog> james_w: yes I understand it would not be a proper package
<Rail> james_w: where (and when) bzr-builddeb stores the "pristine-tar" information?
<psicus78> RachedTN: It is easier to add this repo https://edge.launchpad.net/~bzr/+archive/ppa
<psicus78> james_w: thanks!
<james_w> Rail: during the "merge-upstream" command ahtat I just mentioned. It stores it in a "revision property". It will then use it when building the package. That's also something new to Jaunty
<RachedTN> hanks psicus78, I am a little bit addicted to the " coomand line" :P
<menesis> james_w: the ssss package does not have Vcs-Bzr: field in debian/control. But if it had, what does the field mean? Does it help package a new upstream snapshot, or it is the url of a packaging branch?
<james_w> menesis: it's the URL of the packaging branch
<psicus78> RachedTN: that's fine! :)
<james_w> menesis: the "debcheckout" tool from the "devscripts" package can grab you the branch from Vcs-Bzr for any package that has that info
<james_w> ok, that's all for today people. Thanks for all the great questions
<james_w> if you have more there are always lots of helpful people in #ubuntu-motu
<psicus78> james_w: thank!
<Rail> james_w: thank you very much, bzr-builddeb rocks ;)
<pollywog> james_w:  thanks
<blfgomes> james_w: thank you for the class!
<menesis> ok
<james_w> in one week + 6 hours we will have the incredible didrocks presenting "How to update a package", I hope to see you all there
<Ryback_> james_w: Thanks for the class, it was good to know bzr-builddeb.
<RachedTN> certainly, I will not miss it ;)
<Ryback_> james_w: I'll see that one too :-)
<james_w> excellent
<bdilly> yeah, really nice
<james_w> thank you all
<k-s> yeah!
<james_w> time to find some lunch
<lfelipe> cheers
<RachedTN> thank you james_w, see you soon  :)
<dave_sn> Thanks!
<sky_walkie> thanks james_w for your time today, how we hear from you soon on another session
<sky_walkie> hope
* pleia2 changed the topic of #ubuntu-classroom to: Ubuntu Classroom || https://wiki.ubuntu.com/Classroom || https://lists.ubuntu.com/mailman/listinfo/ubuntu-classroom | Upcoming: 10 Apr @ 00:00 UTC: Q&A Session: Linux Permissions | Run 'date -u' in a terminal to find out the UTC time
<Frater> hy, someone knows a link to get sources to ubuntu ?
<bodhi_zazen> lo everyone
<bodhi_zazen> to ssh into the shared session : http://paste.ubuntu.com/147955/
<bodhi_zazen> we can use this shared session to demonstrate permissions and acl if you wish
<bodhi_zazen> If people know how to do this, please assist others if needed in a private /msg :0
#ubuntu-classroom 2009-04-10
<bodhi_zazen> Are we ready to start ?
 * Snova is here
<bodhi_zazen> weee hooo
 * tim_sharitt is ready
<bodhi_zazen> first, sorry about the confusion re time and date
<bodhi_zazen> again, I will do these Q&A sessions every 2 weeks or so
<bodhi_zazen> I was asked to cover permissions today and to make it interesting will add in sticky bits and acl :)
 * RachedTN is ready too :)
<bodhi_zazen> This is a good time to mention the shared ssh session
<bodhi_zazen> http://paste.ubuntu.com/147955/
<bodhi_zazen> we can use that for a hands on demo
<bodhi_zazen> but if you are interested , please ssh in when you get a chance
<bodhi_zazen> so you are ready to go when we start
 * Geek`N`Proud thought he'd stick around
<Pretto> 404
<bodhi_zazen> if you need help, ask and someone will answer in a PM
<Daisuke-Ido> The requested URL /beginners/ufbt-guest was not found on this server.
<bodhi_zazen> http://paste.ubuntu.com/147955/
<WastePotato> Am I late?
<Snova> No.
<WastePotato> Ok.
<bodhi_zazen> Ah, my mistake, lol
<bodhi_zazen> http://bodhizazen.net/ufbt/ufbt-guest
 * bodhi_zazen bad
<WastePotato> Yay. SSHing into bodhi_zazen's computer. \o/
<bodhi_zazen> sweet :)
<Snova> Or as close to it as you'll ever get...
<bodhi_zazen> OK, lets start with the basics
<bodhi_zazen> permissions often frustrate new users
<bodhi_zazen> and it is a BIG change if you come from Windows
<Daisuke-Ido> i'm going to pop back over to gnome
<bodhi_zazen> Every file and directory has an owner (the one who made it), a group, and "other"
<bodhi_zazen> permission are rwx - read, write, and execute
<bodhi_zazen> and so are listed with ls -l
<bodhi_zazen> as 3 sets :
<bodhi_zazen> rwxrwxrwx
<bodhi_zazen> for owner:group:other
<bodhi_zazen> a - means you do not have the permission
<bodhi_zazen> so r--r--r-- is read only
<bodhi_zazen> You can also see permissions graphically by right clicking a file
<bodhi_zazen> and selecting the permissions tab
<bodhi_zazen> To change permissions from the command line you can use "octals"
<bodhi_zazen> which are listed here : http://www.zzee.com/solutions/linux-permissions.shtml
<bodhi_zazen> or if you can not use the octals, use +rwx
<bodhi_zazen> so, with the chmod command
<bodhi_zazen> chmod o+rwx foo
<bodhi_zazen> chmod g+r foo
<bodhi_zazen> chomd 755 foo
<bodhi_zazen> you change the group with chown or chgrp
<bodhi_zazen> chown owner:group foo
<bodhi_zazen> chown owner.group foo
<bodhi_zazen> period works as well as a : , although it id depreciated >:)
<bodhi_zazen> With the gui tools use the pull down menu
<bodhi_zazen> The thing that is odd, directories
<bodhi_zazen> you need to set the x to list the contents of a directory
<bodhi_zazen> chmod a+x bar
<bodhi_zazen> allows people to ls bar
<bodhi_zazen> again see http://www.zzee.com/solutions/linux-permissions.shtml
<bodhi_zazen> Questions about basic permissions ?
<bodhi_zazen> otherwise I am going to move on to sticky bits >:)
<bodhi_zazen> Sticky bits are not hard to understand, but they are odd
<bodhi_zazen> They are also called SUID and SGID
<bodhi_zazen> if you have an executable file or binary
<bodhi_zazen> and you suid it, it runs with the permissions of the OWNER of the file, not the user who runs the script / binary
<bodhi_zazen> so ...
<bodhi_zazen> if the file is owned by root
<bodhi_zazen> and you then chmod 755
<bodhi_zazen> anyone can run the file
<bodhi_zazen> if you run the script as a use, the process has permissions of the user who called it
<bodhi_zazen> If, however, you chmod u+s foo
<bodhi_zazen> now anyone can run the script and , as it is owned by root, it runs as if root called the script
<bodhi_zazen> no password is required
<bodhi_zazen> do no do this
<bodhi_zazen> any script to be run by root should be owned by root and, IMO, called with sudo
<bodhi_zazen> same thing applies to SGID
<bodhi_zazen> if the SGID bit is set, the script runs with permissions of the group that owns the file
<bodhi_zazen> with me so far ?
<bodhi_zazen> One last bit, +t
<bodhi_zazen> +t is the "sticky bit"
<Spreadsheet> Can I talk?
<bodhi_zazen> in the past it meant keep the script in memory
<bodhi_zazen> Spreadsheet: yes
<bodhi_zazen> anyone can break in at any time
<Spreadsheet> Ok, I have a question
<bodhi_zazen> this is an open session
<bodhi_zazen> please :)
<Spreadsheet> This is sorta related to the topic
<Spreadsheet> Sometimes i use chown, and it doesn't work
<Spreadsheet> Then i use it a couple more times and it does work...
<Spreadsheet> Is this a bug?
<pleia2> :)
<bodhi_zazen> You can not chown a file or directory you do not own
<bodhi_zazen> hey pleia2 :)
<Spreadsheet> bodhi_zazen: All of the files on this comp belong to me...
<bodhi_zazen> this makes sense in that a user can not chown a file owned by root
<Spreadsheet> Oh wait
<Pretto> never happened to me :D
<bodhi_zazen> LMAO Spreadsheet
<Spreadsheet> Ok, the file is owned by root
<Spreadsheet> So then I use sudo
<bodhi_zazen> to change a file woned by root you need sudo
<bodhi_zazen> but you should not change ownership or permisssions of system files
<Spreadsheet> It's not a system file
<bodhi_zazen> sudo -e /etc/fstab for example
<Spreadsheet>  /var/www/
<bodhi_zazen> yea, that *should* be owned by www-data
<Spreadsheet> ehh... go on
<bodhi_zazen> so, add your user to www-data
<bodhi_zazen> :)
<bodhi_zazen> OK, we were talking sticky bits
<bodhi_zazen> the most common use of a sticky bit is on a directory
<bodhi_zazen> if a sticky pit is set on a shared directory (one with say permissions of 777)
<bodhi_zazen> users can not delete file they do not own
<bodhi_zazen> even though group or other permissions may allow rw access to a file
<bodhi_zazen> There is a very nice review of sticy bits here : http://lokams.blogspot.com/2008/03/about-suid-sgid-and-sticky-bit.html
<bodhi_zazen> and here : http://www.linuxdevcenter.com/pub/a/linux/lpt/22_06.html
<bodhi_zazen> questions ?
<bodhi_zazen> Otherwise I am going to talk about acl , or access control lists
<bodhi_zazen> Please, all questions are welcome and it gets boring seeing a wall of bodhi.zazen speaking >:)
<Snova> Might want to go into setuid/setgid (though that'd be another wall :P)
<Snova> Oh wait
 * Snova wasn't here
<Snova> Well, in that case, what does the sticky bit do on a file?
<bodhi_zazen> lol Snova :)
<bodhi_zazen> you mean the -t on a file ?
<bodhi_zazen> or the SUID
<Snova> Sticky bit... no idea what "-t" means. :P
<bodhi_zazen> lol
<bodhi_zazen> Snova: take a look at this linky : http://lokams.blogspot.com/2008/03/about-suid-sgid-and-sticky-bit.html
<Spreadsheet> g2g
<bodhi_zazen> I covered the topic just previous and do not want to repeat it ;)
<bodhi_zazen> OK , acl stands for access control list
<bodhi_zazen> the idea of an acl list comes into play when you have many, perhaps hundreds of users on a system
<bodhi_zazen> and so then the "other" permissions get messy
<bodhi_zazen> you do not want to create hundreds of groups for all the various user shares
<bodhi_zazen> enter acl
<bodhi_zazen> acl allows a user to set permissions on a file or directory for each user on the system
<bodhi_zazen> acl is the backbone of SELinux, and if you understand acl you understand a lot about SELinux
<bodhi_zazen> acl is installed by default on Ubuntu, but you need to "activate" it
<bodhi_zazen> it is an option when you mount a file system
<bodhi_zazen> so you
<bodhi_zazen> mount /dev/sdxy /media/foo -o acl
<bodhi_zazen> Or add acl to /etc/fstab in the options column
<Pretto> so, acl is just for "others" right?
<bodhi_zazen> yes and no Pretto
<bodhi_zazen> I will demo it in a sec ...
<bodhi_zazen> acl is a command line tool
<bodhi_zazen> although there is a very nice gui tool, Eiciel
<bodhi_zazen> http://www.linux.com/feature/138169
<bodhi_zazen> Eiciel is in the Ubuntu repos , but I could not integrate it with Nautilus as in that link
<bodhi_zazen> after you install it it is in the menu under System
<bodhi_zazen> want to see acl in action ?
 * jgoguen nods
<Pretto> yeap
<bodhi_zazen> OK, everyone ssh into the shared session ?
<bodhi_zazen> let me show a few things ...
<bodhi_zazen> OK, permissions of new files are govened by umask
<bodhi_zazen> so as you can see , the group is govened by the primary or effective group
<bodhi_zazen> Now lest change groups for a sec
<bodhi_zazen> the command was newgrp and it spawns a new shell
<Pretto> :D
<bodhi_zazen> do you see how that changed the group of the new file ?
<bodhi_zazen> OK, so if I want a shared directory , I would now need to chmod all those files
<bodhi_zazen> chomd -R 770 MAD
<bodhi_zazen> or worse, chmod -R 777 MAD
<bodhi_zazen> or chgrp and then chown, you get the idea
<bodhi_zazen> now let us use ACL
<bodhi_zazen> See the +s in the permissions ?
<bodhi_zazen> the sgid is set
<bodhi_zazen> Do you see how the sgid bit made the file "file.admin" owned by the group guru ?
<bodhi_zazen> >:)
<bodhi_zazen> OK, now acl ...
<bodhi_zazen> You list the access list with getfacl file
<bodhi_zazen> we set the acl with setfacl
<bodhi_zazen> This changed the behavior of the directory, we set the defaults with -d and the options with -m and long handed rwx permissions
<jgoguen> bodhi_zazen: so the default ACL entries will override the existing user/group/other permissions?
<bodhi_zazen> yes jgoguen
<bodhi_zazen> with that last command , I over rode the sgid we set
<bodhi_zazen> the directory is not owned by admin
<bodhi_zazen> default:group:admin:rwx
<bodhi_zazen> watch
<bodhi_zazen> hmm ,not what I expcected, lol
<Pretto> hhehhehhe. .weird
<Pretto> so the + means that MAD has an acl?
<bodhi_zazen> yes Pretto
<bodhi_zazen> see how acl changed the group of "file" made by root ?
<bodhi_zazen> from root.root to root.guru ?
<bodhi_zazen> OK, now lest add a user
<bodhi_zazen> see, now I added in the user, bodhi, who has rwx to the file MAD/file.guru
<bodhi_zazen> user:bodhi:rwx
<bodhi_zazen> and on
<bodhi_zazen> Obviously acl is a bit complex
<bodhi_zazen> and I will not claim to be an expert
<bodhi_zazen> :)
<bodhi_zazen> oops, apparmor is preventing me from showing you more with acl at the moment
<bodhi_zazen> lol
<bodhi_zazen> see : http://www.suse.de/~agruen/acl/linux-acls/online/
<bodhi_zazen> for more info on acl
<bodhi_zazen> and man acl
<bodhi_zazen> and Eiciel
<bodhi_zazen> Eiciel gives you a gui tool to manage acl
<bodhi_zazen> Sorry if I rambled on too long about permissions
<bodhi_zazen> :)
<bodhi_zazen> we have 10 min left
<bodhi_zazen> questions ?
<bodhi_zazen> you like the shared ssh session ?
<bodhi_zazen> I can demo apparmor if you want :)
<bodhi_zazen> See how the /tmp directory has +t set ?
<bodhi_zazen> you should now know what that means :)
<bodhi_zazen> you should now understand why root kits search for files with the suid bit set
<jgoguen> bodhi_zazen: back to setuid/setgid...should setgid necessarily be avoided the same as setuid?
<bodhi_zazen> probably jgoguen
<bodhi_zazen> although it is not working as I expected
<bodhi_zazen> if you need to run a script as root, use sudo
<bodhi_zazen> If you need to give a user limited root access, use sudo and configure with visudo >:)
<bodhi_zazen> Ah, apparmor is restricting me from further demos :)
<bodhi_zazen> you will have to check out suid on your own , lol
<jgoguen> I was thinking more along the lines of having a script write to a log file...but I suppose ACL would also handle that quite nicely :)
<bodhi_zazen> acl FTW :)
<bodhi_zazen> Once you learn acl , and you have a multiuser system, you will make good use of it
<bodhi_zazen> acl does not make sense, however, on a single user system
<Pretto> thank you for your explanations bodhi_zazen
<bodhi_zazen> np Pretto :)
<bodhi_zazen> thank you for coming
<bodhi_zazen> anyone have a suggestion for next time ?
<bodhi_zazen> In the long run, we will bring up a moodle site and content will be available for review pre and post sessions
<bodhi_zazen> the BT is working on it
<bodhi_zazen> If you have suggestions, add it here
<bodhi_zazen> https://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Education/Proposals
<bodhi_zazen> thank you everyone for coming
<bodhi_zazen> please spread the word
<bodhi_zazen> you should all have been disconnected from the shared session as I closed it :)
<bodhi_zazen> see you again in 2 weeks
<jgoguen> \o/ ty bodhi_zazen
<bodhi_zazen> you are most welcome jgoguen
<bodhi_zazen> I hope I learned you something
<WastePotato> I always miss it. ):
<DasEi> ermm, you're just done now ?
<WastePotato> ?
<WastePotato> I had a shower.
<DasEi> root@jaunty64:~# date -u
<DasEi> Fr 10. Apr 00:05:07 UTC 2009
<DasEi> root@jaunty64:~#
<WastePotato> Wut/
<DasEi> gnarf...
<WastePotato> Hey bodhi_zazen, what was that thing on your shell with the quote and and the calendar? I want it. o:
<WastePotato> DasEi: Oh I get it.
<DasEi> I recently got a email saying friday, 00.00 utc.. two thirds of every meeting slip through the time-gap
<WastePotato> Daylight savings time, maybe?
<DasEi> WastePotato: on a linux-trml? , lol; WastePotato
<WastePotato> Hmm.
<DasEi> sad enough, and I even was on and checked time before-- lets all go home and cry then ;-)
<WastePotato> Wait a sec.
<DasEi> sure
<DasEi> any of the others, did someone log that seession ?
<WastePotato> http://pastebin.com/f153ef8b5 ('pastebin - collaborative debugging tool')
<WastePotato> It's the best I can do. ):
<WastePotato> Damn. I really need to sort out my log folder.
<DasEi> WastePotato: very nice thank you, no I can rest in peace in again
<WastePotato> DasEi And all of the stuff that happened in his ssh session is here: http://pastebin.com/m1aa9b669 ('pastebin - collaborative debugging tool')
<DasEi> so permissions, nothing completly new to me, though always nice to rexerise; funny, the date I got was european - one day
<DasEi> WastePotato: did you want me to wait for the log or still something else ?
<WastePotato> Eh?
<WastePotato> The channel log and the ssh log are all that I have/
<WastePotato> Does anyone want me to paste the log on the site?
<WastePotato> !log
<ubot2> Channel logs can be found at Channel logs can be found at http://irclogs.ubuntu.com/ - See also !OpenWeek - See also !OpenWeek
<WastePotato> ):
<DasEi> WastePotato: that was very nice, I just refelcted your upper Wait a sec, gripping acl rightnow:)
<DasEi> reflected*
<WastePotato> Oh. :)
<DasEi> is there anyone around practising some ssh with me tomorrow/saturday..  whenever ?
<DasEi> enough to read and try myself for now, see you around and thanks again
<schwinn434> looking for #ubuntuforums-beginners something like this, any help would be appreciated
<schwinn434> can't get the exact chat room name correctly
<nhandler> schwinn434: It is #ubuntuforums-beginners, I don't know why it isn't working for you
#ubuntu-classroom 2009-04-12
<G__81> hi i am interested in taking some sessions i have already done few in fedora. can i join this group ?
<Mamarok> G__81: anybody can attend, check the schedule in the topic
<Mamarok> first link
<G__81> Mamarok, ok so i can take up some lessons too ?
<G__81> take up some sessions ?
<Mamarok> G__81: there is a schedule and a mailing list you might want to join, check the first link in the Topic
<G__81> yeah i am checking it
<Kamchadal> Ð¿ÑÐ¸Ð²ÐµÑ
#ubuntu-classroom 2010-04-13
<haythm> hi all
<parani> hi classbot
<parani> hi ghostcube
<ghostcube> hi :)
<parani> can any1 reply here???????
<parani> hi ghost can u tel somthing about gimp in ubuntu???
<ghostcube> woah not really, havent used gimp since years
<parani> tel somthing about using gtalk in ubuntu
<ghostcube> :) i use skype so far lol never used gtalk we dont get together :)
<parani> ok gtg
#ubuntu-classroom 2010-04-14
<Abdu_l> Hallo!!
<Abdu_l> What do i really need to get started with ubuntu development?
<jpds> Abdu_l: See: https://wiki.ubuntu.com/UbuntuDevelopment
<Abdu_l> How do i get someone to assist me step by step on getting started?
<persia> Abd_I: the best way is usually to join one of the more focused development team channels, and ask "How can I help".
#ubuntu-classroom 2010-04-15
<larka06> Hello everyone
<larka06> I do not think anyone is home today. I see the schedule is tomorrow. bye
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - http://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Event: Packaging Training Session - Current Session: Fixing an Ubuntu bug with bzr - Instructor: james_w || Questions in #ubuntu-classroom-chat
<james_w> hi
<james_w> Who is here for the packaging training session?
<james_w> I'll wait a couple more minutes for people to join
<james_w> right, hello everyone
<james_w> most of the names that just joined I recognise, so I won't take it too slowly today
<james_w> this is all a bit last-minute though, so I don't have anything prepared
<james_w> so I'm happy to answer any questions you have
<james_w> right, so a quick introduction
<james_w> you can now use bzr for doing a lot of packaging work, instead of having to learn how to generate debdiffs and the like
<james_w> debdiffs are ok, they have some disadvantages, but the main thing is that they aren't something used in other projects
<james_w> bzr is a version control system, and so is probably more familiar to newcomers
<james_w> so, if you want to make use of it, please install bzr and bzr-builddeb if you don't already have them installed
<james_w> bzr-builddeb is a plugin for bzr that knows about packaging stuff
<james_w> once you have those, then you can run
<james_w> bzr branch lp:ubuntu/<source package name>
<james_w> to get the current source of any package in ubuntu as a bzr branch
<james_w> there is also lp:ubuntu/karmic/source etc. as well
<james_w> you can run bzr log and bzr annotate and the like to see how the package evolved over time
<james_w> that gets useful when debugging etc.
<james_w> now, you can build a package by using "bzr builddeb" from one of these branches
<james_w> "bzr bd" for short
<james_w> to build a source package use "bzr bd -S"
<james_w> <joaopinto> QUESTION: is there a specific bzr revision for each different version commited to the archives ?
<james_w> yes
<james_w> grab a branch of a package you know and have a look
<james_w> or click around on launchpad
<james_w> https://launchpad.net/ubuntu/+source/package
<james_w> and then click on "Branches" and you can browse them online
<james_w> <blueyed> Question: Would it make sense to automatically handle "-v" when doing "bzr builddeb -S" (so that it auto-adds the last uploaded version with it)?
<james_w> that would be cool
<james_w> however, you can't do it automatically
<james_w> without querying something remote to find out what the current version is, and I don't want building a package to require that
<james_w> so, we currently require a human to tell us what value to use
<james_w> what I would like to do is have a flag to say "this is a merge from Debian", so use -vlast-ubuntu-version and -sa if needed
<james_w> the main thing stopping me is that I can't come up with a good name for that flag ;-)
<james_w> so, once you have built the package with your changes and tested it, you can commit
<james_w> how do you get someone to upload that for you?
<james_w> to do that you should propose the branch for merging on launchpad
<james_w> first, push it to your namespace on launchpad
<james_w> bzr push lp:~LP-ID/ubuntu/lucid/package/some-descriptive-name
<james_w> then open up the branch page on launchpad and click "Propose for merging"
<james_w> explain what you have done and click "Propose"
<james_w> a couple of timesavers here:
<james_w> bzr lp-open
<james_w> running that after you pushed will open your browser at the right page
<james_w> bzr lp-propose
<james_w> instead of clicking around on the webapp this will let you type your description in to your editor, like when you commit, and then make the merge proposal for you
<james_w> someone will review your changes and vote on them
<james_w> if they would like you to fix something then you can just make the changes locally, "bzr commit", "bzr push" and then comment on the merge proposal to say you have done it
<james_w> once they are happy they will upload it for you
<james_w> <joaopinto> QUESTION:  Are there branches for Debian packages (lp:debian/package) ?
<james_w> indeed
<james_w> you can find any debian package that way as well
<james_w> the history isn't nearly as complete for Debian packages, but it will improve from here on out
<james_w> so, what can you do with the Debian branches?
<james_w> diff between Ubuntu and Debian when investigating something
<james_w> merge from Debian to pull in their changes
<james_w> cherry-pick from them when near release time and you just want part of their changes
<james_w> use the branches to generate a diff to send back to them
<james_w> let's look at merging
<james_w> from a copy of an ubuntu branch you can run
<james_w> bzr merge-package lp:debian/sid/package
<james_w> to merge from the sid version of the package
<james_w> this may give you conflicts, which you can resolve
<james_w> run "bzr diff" if you want to check the changes that are being pulled in
<james_w> then commit when you are happy
<james_w> running
<james_w> bzr diff --old lp:debian/sid/package
<james_w> will tell you the current diff from Debian, so you can see if there is anything that should be submitted back
<james_w> again you can push this up and request the merge
<james_w> <blueyed> QUESTION: re auto-using "-v" with "bzr bd", couldn't you use the last tag from mark-uploaded? Does mark-uploaded do anything besides creating a tag only?
<james_w> first, no, mark-uploaded is just creating a tag
<james_w> in maverick you will just be able to run "bzr tag" thanks to jelmer
<james_w> as for using the last tag from mark-uploaded that's an interesting idea, but I'm not sure if it would be reliable enough
<james_w> might be worth a go
<james_w> I'd be happy to help you implement it if you like
<james_w> <ckorn42> QUESTION: so no more debdiffs ?
<james_w> you don't have to use debdiffs to get sponsored any more
<james_w> they may have their use from time to time
<james_w> any more questions before I move on?
<james_w> <joaopinto> QUESTION: are there branchs for PPAs  ?
<james_w> only if you make them
<james_w> you can branch from Ubuntu, make your changes, and then push it
<james_w> uploading the source package to your PPA
<james_w> they aren't created automatically or anything though
<james_w> <blueyed> QUESTION: more bzr related. Is it possible to get the "diff" after a merge annotated? When diffing, you see what's added, but not from what particular merged revision.
<james_w> I don't think that's possible
<james_w> ask in #bzr
<james_w> <blueyed> QUESTION: branches for PPA: is there planned anything to get them created automatically?
<james_w> no
<james_w> there's not a lot of payoff there
<james_w> and you can just use bzr to manage the PPAs
<james_w> right, we've looked at merging from Debian
<james_w> let's look briefly at merging from upstream
<james_w> this is based around the inventively named "bzr merge-upstream" command
<james_w> from one of the branches we got earlier we can merge a new upstream release by passing it the URL of the tarball of the new upstream release (or a local path if you have already downloaded it)
<james_w> and the version number that is assigned to this release
<james_w> bzr merge-upstream --version 1.2 http://example.org/foo-1.2.tar.gz
<james_w> works with tar.gz tar.bz2 .zip and a couple more
<james_w> again it will leave you with a diff to review and any conflicts to fix up
<james_w> I plan to make it use uscan, so that you don't even have to tell it that stuff if you have a watch file
<james_w> "bzr merge-upstream" would just find everything out and do the obvious thing for you
<james_w> I think this is one of the coolest things
<james_w> and I plan to add more things as cool as that and build on top of it
<james_w> so, what else do we have planned?
<james_w> work is currently underway to add support in Launchpad for building from branches
<james_w> that means you will be able to go from the branch you just pushed up to a package in your PPA without building and uploading it
<james_w> we will probably extend that to Ubuntu itself once we are happy with it
<james_w> this will allow us to do lots of great things
<james_w> daily builds will be just a few clicks
<james_w> it will be easy for people to find a patch upsteam, stick it in to bzr, and put it in their PPA for people on the bug to test
<james_w> like, one command easy if someone wants to automate that
<james_w> and building on top of bzr makes it easier for an Ubuntu developer to hoover up such patches after testing and merge them all together
<james_w> <mhall119> QUESTION: are you doing anything with ground control to get these features in that?
<james_w> not yet
<james_w> but I want to have some of that stuff
<james_w> there's a possible SoC project to lay the groundwork for that
<james_w> we're not /quite/ at the point where we can have something as slick as groundcontrol, but very close
<james_w> and because we are just using bzr, launchpad etc. it should be easy to modify groundcontrol to do packages as well as projects
<james_w> right, any more questions for the last 10 minutes
<james_w> right, some cool stuff
<james_w> bzr gannotate or the qt equivalent when you find a bad line of code can tell you when it was changed, regardless of whether upstream debian or ubuntu changed it
<james_w> assuming that it's v3 quilt right now
<james_w> and you can then go from that to the diff of the revision that uploaded it, so see the rationale in the changelog
<ClassBot> There are are 10 minutes remaining in the current session.
<james_w> and if you want to revert it, it's one bzr command, rather than doing it by hand, or trying to generate a patch to reverse-apply
<james_w> similar with cherry picking
<james_w> you can grab the changes in the last debian upload and pull them in to your tree
<james_w> bzr merge -c 1 lp:debian/sid/package
<james_w> then use "bzr revert" and "bzr shelve --destroy" to remove the parts you don't want
<james_w> and keep only the parts you do
<james_w> you don't need to rely on Merge-o-Matic to have the merge ready for you to apply
<james_w> you can merge from testing, unstable, experimental as you like
<james_w> or the branch of anyone else in the same way
<james_w> you have a version control system so you can just "bzr revert" if you get in to a strange situation, rather than having to blow away your workspace and unpack the source package again like you had to sometimes before
<james_w> and plenty more as well
<james_w> there's loads of opportunity for automating tasks and the like now, so if you have an idea for something like that I would be happy to help you implement it
<james_w> and I'm keen that the tools are usable, so if you find something that is too hard or doesn't make sense, please file a bug
<james_w> any last questions?
<ClassBot> There are are 5 minutes remaining in the current session.
<james_w> ok, let's call it a day and go make lucid even better :-)
<james_w> thanks all
* ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - http://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi
<mhall119> james_w: are you still around?
<james_w> yeah
#ubuntu-classroom 2010-04-18
<revenger98> hola
#ubuntu-classroom 2011-04-11
<g4ur4v> hello peeple...!
<Martiini> anyone use Twitter ??
<bugo> when this stuff starts?
<nigelb> 3.5 hours to go.
<nigelb> err 2.5
<shadowking> der r still 4 hrs to start
<shadowking> can anyone tell me wht tools will b reuired during dis session
<techbreak> hi, this is the place where class will go on right ?
<crazedpsyc1> yep, in approx 20 minutes the first one starts
<techbreak> how long to go yet ?
<techbreak> crazedpsyc1: cool thanks :)
<risky> hello world
<lithpr> howdy
<akzfowl> hey everybody
<Upirate> hello guys, what is going on?
<Upirate> has the class started yet?
<c2tarun> Upirate: Nope, still one hour left
<Upirate> thanks, c2tarun:
<Guest1225> class started ?
<shadowking> still waiting 4 it guest
<Guest1225> shadowking: ok :)
<shadowking> its gonna start in abt 45 min
<Guest1225> 45 min ? or 4 to 5 min ?
<Guest1225> shadowking:
<shadowking> "45" mins
<Guest1225> shadowking:  ok :)
<deuxpi> you can all follow "ubuntuclassroom" on identi.ca for the announcements :)
<shadowking> n twitter too
<shadowking> i guess m gonaa go n take a nap till it starts
<shadowking> :P
<shadowking> just half n hr more
<crazedpsyc> I thought it was starting 44 min ago
<Arcidias> *no daylight saving time
<Arcidias> that means it will start in 15 minutes
<nigelb> 15 mins to go people!
<rigved> cool
<crazedpsyc> i must have calculated the absense of DST the wrong way...
<Arcidias> I did it, too
<crazedpsyc> will the actual class be mirrored on twitter and identica, or just announcements
<nigelb> Just the announcements
<crazedpsyc> ok
<Bannaz> hey everyone
<g4ur4v> hi
<Bannaz> hey there
<crazedpsyc> hello
<Arcidias> I'm sure there'll be logs later
<Bannaz> are you all waiting for a class??
<Arcidias> yep
<Arcidias> 10 minutes to go
<deuxpi> crazedpsyc: the session logs will be at http://irclogs.ubuntu.com/2011/04/11/%23ubuntu-classroom.html
<dArKd3ViL_> yes
<Bannaz> so the class is gonna be here?!!
<Arcidias> duh
<Andy80> #ubuntu-classroom-chat
<Bannaz> lol
<c2tarun> Bannaz: eveyone thinks so ;)
<Bannaz> alright
<Andy80> sorry ;)
<Bannaz> hmm
<Bannaz> then we'll never know
<nigelb> ok, guys, please take chatter to #ubuntu-classroom-chat
<Bannaz> its a web chat ...how am I supposed to take a class here ?
<Arcidias> the speaker of the session talks here
<deuxpi> Bannaz: you follow in #ubuntu-classroom, and you may ask questions in here
<Arcidias> you ask your questions in ubuntu-classroom-chat
<goliath_> hi
<Arcidias> hi
<antonioJASR> hi
<goliath_> how can I search for chanel that in their names have freelance?
<cnd> Hi! I'm Chase Douglas, and I've been working on bringing multitouch input to X.org, moving the uTouch st
<cnd> ugh
<cnd> oh google calendar
<cnd> always in the way with your pop ups
<Jrsquee> haha
<Error404NotFound> I am here from twitter after hearing about uTouch :)
<dholbach> WELCOME EVERYBODY TO UBUNTU APP DEVELOPER WEEK!
<dholbach>  I'll just do a very quick intro and then quickly pass on the mic
<dholbach>  all the info you need should be on https://wiki.ubuntu.com/UbuntuAppDeveloperWeek - which session is next, what it is about, etc
<dholbach>  also will we put logs of the sessions that happened on there, so if you couldn't make it, you can still read up on the session afterwards
<dholbach> if you want to chat about what's going on or ask questions, please head to #ubuntu-classroom-chat
<dholbach> if you have questions, please prefix them with 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: Enabling Multitouch and Gestures Using uTouch - Instructors: cnd, bregma
<dholbach> for example:         QUESTION: What is a great device to try out multitouch with?
<dholbach> etc
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/11/%23ubuntu-classroom.html following the conclusion of the session.
<dholbach> without further ado, I'll clear the stage for Chase Douglas and Stephen Webb
<dholbach> they'll talk about Enabling Multitouch and Gestures Using uTouch
<cnd> Hi! I'm Chase Douglas, and I've been working on bringing multitouch input to X.org, making the uTouch stack use the new X MT work, and making improvements throughout the stack from the kernel to the toolkits
<bregma> I'm Stephen Webb, I designed the geis API used in utouch
<bregma> we're dividing the session into two parts
<bregma> forst, I'll discuss gestures and utouch overall
<bregma> then Chase will chime with multi-touch
<bregma> first off, I'd like to clarify what we mean when we say "gestures"
<bregma> there are fancy complex gestures like spirals and zorros made with the mouse
<bregma> we refer to those as 'stroke gestures'
<bregma> Those are not the gestures we are handling in uTouch.
<bregma> They lack the discoverability and generality for general-purpose gestures.
<bregma> The uTouch stack currently recognizes what we call 'gesture primitives'.
<bregma> These are "drag", "pinch/expand", "rotate", "tap", and "touch".
<bregma> The first three correspond to the linear transformations of "translate", "scale", "rotate".
<bregma> The last is similar to mouse-down and mouse-up events, and a "tap" is like a single mouse click.
<bregma> It is possible to build stroke gestures from these primitives if that's what you want.
<bregma> we have also been discussing the use of a 'gesture langue' to do just that
<bregma> The current focus in uTouch is on multi-touch gestures.
<bregma> A gesture appears to an application as a stream of events.
<bregma> Each event is a snapshot in time of the current status of the gesture,
<bregma> including properties such as velocity, change in radius, and finger positions if available
<bregma> There is a lot of hardware with a wide range of capabilities, including the number of touches supported.
<bregma> Not all multi-touch devices provide all the information required for all gestures.
<bregma> For example, some common notebook touchpads provide only the bounding box of the multiple touches, which is inadquate to determine rotation angles.
<bregma> So, the uTouch stack consists of three basic layers
<bregma> (1) the input layer (evdev in the kernel, through the /dev/input interface, and the mtdev userspace library to homogenize input)
<bregma> (2) the gesture recognition engine, utouch-grail
<bregma> (3) the application programming interface, utouch-geis
<bregma> it's a little more complex than that in implementation, but that's the basic structure.
<bregma> a very rough diagram: <https://docs.google.com/drawings/edit?id=1isTrkSWDH7OWKLi_aialasw9xjb0pziK9yjKUR1yt9c&hl=en&authkey=CLiA9fEG>
<bregma> In maverick and natty, grail runs in the X server so it has easy access to
<bregma> window geometry.
<bregma> the latest versions of grail are using XInput 2.1 to get full multi-touch support
<bregma> the geis API currently connects to grail over a private X connection
<bregma> applications and libraries using geis do not need to know this
<bregma> in oneiric, grail will probably move into the compiz process as the X server gets replaced by "something else"
<bregma> included as part of the uTouch stack are a set of diagnostic tools
<bregma> gesturetest (which talks to the X server directly)
<bregma> grail-gesture (which runs grail directly)
<bregma> geistest (built on the API)
<bregma> and others are already available, like xinput and lsinput, for examining hardware traits
<bregma> the single programmable access to uTouch is through the GEIS API
<bregma> API docs are available online at <http://people.canonical.com/~stephenwebb/geis-v2-api/> or in the linutouch-geis-doc package
<bregma> the simplified interface was developed first and is sufficient for very basic gesture operations
<bregma> te advanced interface was developed in response to initial feedback from developers and
<bregma> ives finer control ofver the types of gestures reported and how the data are reported
<bregma> the simplified interface requires a connection to grail (an "instance") for each window, and a list of gestures of interest
<bregma> all feedback is through callbacks
<bregma> en example of using the simplified interface is here: <http://pastebin.com/ju1Tgq4N>
<bregma> the advanced interface requires only a single connection to grail and set of subscriptions
<bregma> each filtering on window, gestures, and input device attributes
<bregma> feedback is through event delivery or, optionally, callbacks
<bregma> example code using the advanced interface can be found at <http://people.canonical.com/~stephenwebb/geis-v2-api/geis2_8c-example.html>
<bregma> the advanced API is required for handling upcoming work on "gesture languages"
<bregma> I believe these examples should be fairly self-explanatory, I'm going to gloss over them because we have a lot of ground to cover
<bregma> there are some easier ways to take advantage of uTouch without programming to geis
<bregma> first, there is libgrip, an add-on for GTK-based applications
<bregma> it features a singleton GestureManager that a widget registers with and receives callbacks from
<bregma> examples of libgrip use include the eog and evince packages found in the utouch PPA at https://launchpad.net/~utouch-team/+archive/utouch
<bregma> future work also includes Qt and native python bindings
<bregma> Qt has agreed to integrate utouch-geis into their gesture infrastructure
<bregma> Python bindings for utouch-geis will be available in the utouch PPA soo and should be available with oneiric
<bregma> we also have ginn, which can be used to retrofit utouch gestures into applications that were not programmed to accept them
<bregma> ginn ses utouch-geis to subscribe to gestures and converts them into keystrokes or mouse movements and reinjects them into the application's input stream
<bregma> it uses an XML file, /etc/ginn/wishes.xml, to define the set of conversion rules for each application
<bregma> ginn ships with natty today
<ClassBot> pecisk asked: what do you mean with uTouch going included in compiz? Shouldn't it left seperated?
<bregma> utouch-grail, the recognition engine, needs to know about window geometry and ordering
<bregma> the easiest way to do that is to stick it some place that already has the information, like the X server
<bregma> except the X server isn't really where it belongs
<bregma> so, compiz for those desktops that use compiz (like Unity), and we'll try to come up with alternate solutions for others
<ClassBot> tomeu asked: what are the native python bindings for? isn't enough to access that functionality through pyqt, pygobject, etc?
<bregma> the utouch-geis library is not gobject-based
<bregma> it's as lightweight as possible so it can be included anywhere, like games
<bregma> there are already pygobject bindings for libgrip
<cnd> ok, so we're out of questions on the gestures for now
<cnd> so I'm going to start talking about raw multitouch events
<cnd> over this past cycle for natty, we've been working hard to bring real multitouch input through the X server
<cnd> in 11.04 we'll be the first linux distro with multitouch support!
<cnd> but it's just the ground work for now
<cnd> and it's not quite finalized yet
<cnd> so it's considered a prototype, or pre-release for now
<cnd> but we do have some support for developers who want to write applications to take advantage of the new functionality
<cnd> there are two layers you can develop at
<cnd> you can develop at the XInput level, which we don't recommend for now but does provide some extra functionality
<cnd> or you can develop using the Qt touch framework
<cnd> first, I'll go over the XInput work just to give some background
<cnd> XInput is an extension to the X server
<cnd> X is almost 30 years old now
<cnd> and no one was trying to integrate multitouch with X way back when it was created :)
<cnd> over time, the X Input extension has grown to allow for various input related functionality
<cnd> at first it allowed for multiple mice and keyboards to be used at the same time
<cnd> this allows you to control the cursor with your trackpad and your usb mouse without having to toggle one or the other
<cnd> then, support was added for grouping keyboards and mice, and for creating more than one cursor on the screen
<cnd> you can try this out with the xinput command line utility, it's kinda fun to have multiple cursors :)
<cnd> now, we're extending XInput to version 2.1 to add multitouch support
<cnd> here's the link to the current protocol document that's in development: http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XI2proto.txt?h=inputproto-2.1-devel
<cnd> I don't recommend trying to understand it though :)
<cnd> so I'll just skip over it for now and hit a few key points
<cnd> first, there's a touch "lifetime"
<cnd> every touch has an event stream associated with it
<cnd> when the touch begins, a TouchBegin event is generated
<cnd> when the touch changes in any way, i.e. it moved, or the pressure changed, a TouchUpdate event is sent
<cnd> when the touch leaves the touch surface, a TouchEnd event is sent
<cnd> the second major point about touch input is that there are two classes of devices that affect how touch events are handled
<cnd> direct touch devices are basically touchscreens
<cnd> where you touch on the surface is where the touch events are sent
<cnd> so if you touch with one finger over the terminal, and you touch another finger over the web browser
<cnd> then each application will receive the touch event for their respective touches
<cnd> in contrast, there are dependent touch devices
<cnd> these comprise trackpads and devices like the Apple Magic Mouse
<cnd> when you touch the surface of these devices, the touches are sent to the window that is under the cursor on the screen
<cnd> Lastly, there's a layer of mouse event emulation for direct touch devices
<cnd> if your application subscribes to mouse events and not touch events, and someone touches your application using a touchscreen
<cnd> a mouse event stream is generated
<cnd> the primary mouse button is "pressed" when you touch the screen
<cnd> and the cursor moves with your finger
<cnd> and then the primary mouse button is "released" when the touch ends
<cnd> this allows us to add touch capabilities to new applications while not breaking mouse usage for older applications
<cnd> That's enough for now about X though
<cnd> I want to move on to Qt
<cnd> in 11.04, we will also have a pre-release addition to the Qt framework that will support multitouch
<cnd> if you have a multitouch device and want to test it out, install qt4-demos
<cnd> then try out the applications in /usr/lib/qt4/examples/touch/
<cnd> there's four examples: dials, fingerpaint, knobs, and pinchzoom
<cnd> I like fingerpaint the most :)
<cnd> note that with the Qt framework, a trackpad device does not emit touch events by default until two or more fingers are touching the surface
<cnd> here's a link to the documentation for reference: http://doc.qt.nokia.com/latest/qtouchevent.html
<cnd> If you want to take a look at an example source code file for handling multitouch data,  see http://doc.qt.nokia.com/latest/touch-fingerpaint-scribblearea-cpp.html
<cnd> this is the fingerpaint application source code for the canvas area
<cnd> if you scroll down near the bottom you'll see the ScribbleArea::event() function
<cnd> this is where the multitouch events are received
<cnd> in Qt, touches sent to a widget are grouped together
<cnd> so once you get a touch event, you can get a list of all the touch points
<cnd> and then you can iterate over them to find which of the touchpoints have changed
<cnd> this is what the fingerpaint application does
<cnd> with that, I'll move on from qt to get to some more stuff :)
<cnd> there's also a niche library called libavg
<cnd> this library is often used for games
<cnd> and there are a handful of multitouch games available for it
<cnd> they are all written in python, so it's a very accessible library
<cnd> I won't spend any more time on it today, but you can try one of the games in natty by installing empcommand
<cnd> it's a multitouch version of missile command :)
<cnd> there are more games to try out in the libavg ppa
<cnd> hmm... seems they aren't there yet
<cnd> we'll get them uploaded soon though :)
<cnd> lastly, I wanted to mention a few advanced things you can do with the XInput 2.1 extension
<cnd> the first is that you can do touch "grabs"
<cnd> this allows one application to control the event stream of touch events before they reach the destination application
<cnd> second, though this won't be available until ubuntu 11.10, an application can "observe" touches
<cnd> this may allow for ripple effects in compiz when you touch the screen, for example
<ClassBot> There are 10 minutes remaining in the current session.
<cnd> lastly, you can receive "unowned" events, which allow applications to peek at events
<cnd> for more details, see the XInput 2.1 spec
<cnd> with that, I'll open it up for questions :)
<ClassBot> rydberg asked: what can you do with multitouch that you cannot do with single touch?
<cnd> too many things :)
<cnd> obviously all the multitouch gestures are available only with multitouch
<cnd> but there are other possibilities
<cnd> one can envision something like a conference table where the table is a big multitouch screen
<cnd> each participant in the conference may interact with the table
<cnd> there are also possibilities with object manipulation
<cnd> for 3d applications
<cnd> we're focusing on enabling all these, so we're hoping others have good ideas too :)
<ClassBot> pecisk asked: what kind of licensing uTouch have?
<cnd> uTouch is licensed under GPL v3
<ClassBot> crazedpsyc asked: do you think multitouch will ever be added to compiz? If compiz did it I'm sure the animations (eg squishing a window) would be amazing
<cnd> natty already brings multitouch gestures to unity
<cnd> which is based on compiz as the window manager
<cnd> for example, if you touch with three fingers over a window, you'll see the resize handles
<cnd> let me find a picture
<cnd> http://www.omgubuntu.co.uk/2011/03/unity-love-handles-resizing-in-ubuntu-just-got-sexy/
<ClassBot> There are 5 minutes remaining in the current session.
<cnd> we plan on adding more functionality in further releases too
<bregma> we do have plans for a compiz plugin to expose multi-touch and gesture data directly
<cnd> compiz support will also allow for something microsoft has termed "no touch left behind"
<cnd> http://venturebeat.com/2009/05/11/with-surfaces-new-features-microsoft-wants-to-leave-no-touch-behind/
<cnd> where there is feedback to provide the user with context about where a touch occurred
<cnd> and what action it performed
<cnd> btw, I realized I messed up on the licensing question :)
<cnd> it's LGPL v3
<cnd> the parts that are in the X.org server, such as the XInput 2.1 multitouch extension are under the X licensing (MIT/X11/BSD)
<cnd> I think we're out of time now
<cnd> so I want to thank everyone for participating!
<cnd> come find us in #ubuntu-touch!
* 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: GObject Introspection: The New Way For Developing GNOME Apps in Python, JavaScript and Others - Instructors: tomeu
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/11/%23ubuntu-classroom.html following the conclusion of the session.
<tomeu> Hi, I'm a GNOME developer working at Collabora.
<tomeu> During the past few years it has been evident that trying to keep the GNOME APIs available to languages other than C required more resources than were available.
<tomeu> If you were working on a Python app using GNOME stuff, you probably realized about that.
<tomeu> GObject Introspection's main goal is to radically lower the amount of effort required to do that.
<tomeu> Feel free to make questions at any point, I will address them as I see them fitting in the plan of the talk.
<tomeu> == The problem ==
<tomeu> Before introspection was available for GObject-based APIs, bindings maintainers had to produce C code that would bridge between the host language and each C API that would be made accessible.
<tomeu> There were code generators that saved a lot of time, but still, corner cases had to be handled manually and the generated code had to be maintained.
<tomeu> The total amount of work required to keep the C APIs callable from other languages was a factor of the size of the APIs, the number of languages that would be able to call into them, and the distros where such bindings had to be packaged.
<tomeu> As you can see, the amount of work to be done was growing very quickly, far faster than resource availability in a mature project such as GNOME.
<tomeu> == The solution ==
<tomeu> The reason why bindings weren't able to generate code that wouldn't need manual modifications is that by scanning the C sources there's only so much information available.
<tomeu> There is critical information that bindings need that was only available in natural-language API documentation or in the code itself.
<tomeu> Some bindings allowed this information to be manually added and fed to the generator, but it meant that each binding had to write that extra information by themselves, maintain it, etc.
<tomeu> Based on that experience, it turned out to be clear that the extra information required to call the C API had to be added to the API sources themselves, so all bindings could benefit. This extra information is added in what we call "annotations" and we'll get into a bit of detail later.
<tomeu> But that's not enough to reduce the workload at the distro level, if each binding had to generate code based on that extra information, distros would still need to package each binding for each API and each language.
<tomeu> This is the reason why all the introspection information needs to be available at runtime, so a system which has bindings for, say Python, can call some new C API without having to write, package and deploy specific software for it.
<tomeu> So introspection information is available at runtime with acceptable performance, it is compiled into "typelibs": tightly packed files that can be mmapped and queried with low overhead.
<tomeu> == Workflow changes ==
<tomeu> ASCII art overview of GI's architecture: http://live.gnome.org/GObjectIntrospection/Architecture
<tomeu> (I'm going to go through it, so I recommend to give it a look now)
<tomeu> When building a shared library, g-ir-scanner is called which will scan the source code, query GType for some more bits of info, and produce a XML file with the .gir suffix.
<tomeu> The .gir file is then compiled into a typelib, with the .typelib suffix.
<tomeu> The typelib is distributed along with the shared library and the .gir file is distributed with the header files.
<tomeu> When an application that uses introspection is running, the introspection bindings for its programming language will use the information in the typelib to find out how it should call the C API, being helped by the GType system and by libraries such as libffi.
<tomeu> Now I'm going to make a pause until someone says in #*-chat that I'm not going too fast :)
<tomeu> == Annotations ==
<tomeu> The needed information that is missing in the signature of the C API includes mainly:
<tomeu> * details about the contents of collections (element-type),
<tomeu> * memory management expectations (transfer xxx),
<tomeu> * which functions are convenience API for C users and should not be exposed (skip),
<tomeu> * scope of callbacks (scope),
<tomeu> * auxiliar arguments (closure) (array length=2),
<tomeu> * is NULL accepted as an input argument (allow-none),
<tomeu> * and more.
<tomeu> For more details: http://live.gnome.org/GObjectIntrospection/Annotations
<tomeu> Example from GTK:
<tomeu> --------------------- 8< -----------------
<tomeu> /**
<tomeu>  * gtk_tree_model_filter_new:
<tomeu>  * @child_model: A #GtkTreeModel.
<tomeu>  * @root: (allow-none): A #GtkTreePath or %NULL.
<tomeu>  *
<tomeu>  * Creates a new #GtkTreeModel, with @child_model as the child_model
<tomeu>  * and @root as the virtual root.
<tomeu>  *
<tomeu>  * Return value: (transfer full): A new #GtkTreeModel.
<tomeu>  */
<tomeu> GtkTreeModel *
<tomeu> gtk_tree_model_filter_new (GtkTreeModel *child_model,
<tomeu>                            GtkTreePath  *root)
<tomeu> --------------------- 8< -----------------
<tomeu> == Other benefits ==
<tomeu> Having available all the required information at runtime means that bindings can decide more freely when to allocate resources such as datas structures and function stubs, this allows bindings to address long-time issues such as slow startup and high memory usage.
<tomeu> Another consequence of bindings calling the C APIs as exposed by upstream means that documentation can be generated directly from the introspectable information, without any per-API work.
<tomeu> By lowering the barrier to expose APIs to other languages, more applications are being made extensible through the use of plugins.
<tomeu> Libpeas helps your application to expose some extension points that can be used by plugins written in C, JavaScript and Python. It is already being used by Totem, GEdit, Vinagre, Eye of GNOME, etc
<tomeu> == Changes for library authors ==
<tomeu> Library authors that wish their API was available to other languages need to mainly do these three things:
<tomeu> * mark all the API that cannot be called from other languages with (skip) so it doesn't appear in the typelib,
<tomeu> that API could be considered as a convenience for C users
<tomeu> * make sure all the functionality is available to bindings (by adding overlapping API),
<tomeu> * modify their build system to generate and install the .gir and .typelib files (http://live.gnome.org/GObjectIntrospection/AutotoolsIntegration),
<tomeu> * add annotations as mentioned before.
<tomeu> In practical terms and for existing libraries, it uses to be better if people trying to use your API are the ones that submit patches adding annotations as they have a more readily available way to check for their correctness.
<tomeu> But for the author of the API it should be generally obvious which annotations are needed provided some exposure to how bindings use the introspected information.
<tomeu> == Changes for application authors ==
<tomeu> Application authors need to be aware that, until the whole callable API becomes used through introspection by applications, they cannot expect for the annotations to be perfect.
<tomeu> So instead of waiting for introspection to "mature", consider starting right now and get involved upstream by pointing out issues and proposing annotations and alternative API when needed.
<tomeu> For now, may be best to look at the .gir to figure out how to call something, if the C docs aren't enough.
<tomeu> In the future there will be documentation generated for each language from the .gir files, but nobody has got anything usable yet.
<tomeu> so I don't have any more text to copy&paste, I will gladly answer any questions
<ClassBot> crazedpsyc asked: is this available for languages other than C?
<tomeu> no, it would be really hard depending on the particular language
<tomeu> and the turnout would be smaller because platform code tends to be written in C in the GObject world
<ClassBot> patrickd asked: Are there examples any where of getting started using these bindings in say, something like python?
<tomeu> we have some material at http://live.gnome.org/PyGObject/IntrospectionPorting
<tomeu> but tomorrow you will get a session here by pitti just about python and introspection
<tomeu> this was intended to present the basic concepts, tomorrow will be more about practical stuff
<ClassBot> abhinav81 asked: so a language binding (say python) for a library ultimately calls the C API ?
<tomeu> yes, there will be some glue code in python that will be calling the same API that C programs use
<tomeu> PyGObject uses libffi directly, there's another alternative implementation that uses python's ctypes (which in turn also uses libffi)
<tomeu> we also have an experimental branch of pygobject by jdahlin that uses LLVM to generate wrappers
<tomeu> I know python best, but I guess other languages will have other mechanisms to call into C code at runtime
<ClassBot> chadadavis asked: is the plan to currently move everything to PyGI then? What types of applications would be better off staying with PyGTK?
<tomeu> at this moment, pygtk won't be updated to support gtk3
<tomeu> also, pygobject+introspection doesn't support gtk2
<tomeu> so my recommendation is to do what most GNOME apps do: branch and keep a maintenance branch which still uses pygtk/gtk2, and move master to introspection and gtk3
<ClassBot> geojorg asked: What is the current status of PyGI in Python 3 ?
<tomeu> haven't been personally involved on that, but I think someone at the last hackfest rebased the python3 branch
<tomeu> I think fedora is aiming for gtk3+python3 for their next release
<tomeu> I will hang around for a while in case there's some more questions before the next talk starts
<ClassBot> JanC asked: how similar are code for PyGtk & PyGI (and thus how much work is it to port an application and keep parallel branches)?
<tomeu> IMO is not that dissimilar, you have some tips about porting here:http://live.gnome.org/PyGObject/IntrospectionPorting
<tomeu> and you can get an idea of the kind of transformations needed by reading this script: http://git.gnome.org/browse/pygobject/tree/pygi-convert.sh
<tomeu> you may find that the changes between gtk2 and gtk3 are more worrying, depending on how much of the API your app uses
<ClassBot> pecisk asked: is the any deadlines when all base apps should be correctly supported by g-i?
<tomeu> you say you meant base libs, so the deadline was GNOME 3 for all libraries in GNOME
<tomeu> no doubt some libraries will have better annotations than others
<tomeu> as I said before, the quality of their introspection support depends greatly on the contributions from application authors, which went on submitting annotations for the API that their app uses
<ClassBot> crazedpsyc asked: can I get PyGI in maverick? how?
<tomeu> I have heard you can, but I'm not sure how (I don't use ubuntu)
<tomeu> but even then, maverick has gtk2 afaik, so I would recommend to try to move to natty for development
<tomeu> gtk2 lacks a lot of annotations because the focus has been on gtk3
<tomeu> there may exist a PPA, not sure
<tomeu> == Where to go from here? ==
<tomeu> http://live.gnome.org/GObjectIntrospection
<tomeu> In GIMPNet: #introspection, #python, #javascript, ...
<tomeu> Thanks for the attention and the questions, I also have to thank Martin Pitt for passing me his notes on GI
<tomeu> as said, he will be giving tomorrow a session focused on python and introspection
<tomeu> laszlok: QUESTION: is there a bug report or a wiki page about the status of generating documentation for the new API?
<tomeu> let me get some links for you
<tomeu> http://blog.tomeuvizoso.net/2011/02/generating-api-docs-from-gir-files.html
<tomeu> https://bugzilla.gnome.org/show_bug.cgi?id=625494
<ClassBot> There are 10 minutes remaining in the current session.
<ClassBot> laszlok asked: is there a bug report or a wiki page about the status of generating documentation for the new API?
<tomeu> http://live.gnome.org/Hackfests/Introspection2011#line-19
<ClassBot> There are 5 minutes remaining in the current session.
<dpm> hey, hello everyone!
<dpm> thanks for joining in this session on how to internationalize your applications
* 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 English to any language: internationalizing your apps - Instructors: dpm
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/11/%23ubuntu-classroom.html following the conclusion of the session.
<dpm> ok, now that classbot is done...
<dpm> first of all, thanks to tomeu for a great session
<dpm> And now let's get started with translations
<dpm> First the introductions
<dpm> I'm David Planella, and I work in the Community team at Canonical as the Ubuntu Translations Coordinator
<dpm> Usually I work more on the community side of things, with the always awesome Ubuntu translation teams
<dpm> But today I've put my developer hat to show you how easy it is to get your app ready to speak a multitude of languages
<dpm> and set up so that the community can translate it.
<dpm> Regardless of the programming language, the process of adding internationalization support to an application is not only fairly easy
<dpm> but also, on a high level view, the same for all programming languages.
<dpm> This means that after this session you should have a pretty good overview on what it takes to make your application translatable
<dpm> and you can apply this to any programming language, slightly adapting the syntax, of course.
<dpm> In order for you to see how it all fits together, I've based the talk on a common framework that can get you quickstarted in just a few minutes
<dpm> I've used the Python programming language and Quickly
<dpm> https://wiki.ubuntu.com/Quickly
<dpm> Let's start with some background concepts to make it easier to understand the steps we'll be doing later on
<dpm> So let's have a quick look at the main players involved in the internationalization game:
<dpm>  
<dpm> Background Concepts
<dpm> ===================
<dpm>  
<dpm> GNU Gettext
<dpm> -----------
<dpm> Gettext is the underlying and most widely used technology to enable translations of Open Source projects.
<dpm> It defines a standard format of translation files translators can do their work with (PO files, more on them in a minute)
<dpm> and lets applications load those translations compiled in a binary format (MO files) at runtime.
<dpm> It has implementations for many programming languages, and amongst them, of course, Python.
<dpm> You'll find that the comprehensive gettext manual at http://www.gnu.org/software/gettext/manual/gettext.html can be a very useful reference,
<dpm> The Python implementation of the gettext API is what we'll use to internationalize our project with Quickly today.
<dpm> Needless to say, it also comes with some nifty documentation at http://docs.python.org/library/gettext.html
<dpm> * {i} In short, gettext does all the heavy lifting involved in exposing your application for translation and loading the translations for the end user
<dpm>  
<dpm> intltool
<dpm> --------
<dpm> Intltool is a higher level tool that adds functionality to gettext by allowing the extraction of translatable strings from a variety of file formats
<dpm> It has also become a standard tool when implementing internationalization for OSS projects.
<dpm> Nearly all (if not all) GNOME projects, for example, use intltool.
<dpm> * {i} intltool handles the translations of things such as the desktop shortcut of your application
<dpm>  
<dpm> python-distutils-extra
<dpm> ----------------------
<dpm> Python-distutils-extra is a python package that makes it easy to integrate themable icons, documentation and gettext based translations in your python install and build tools, and it's basically an enhancement to python-distutils.
<dpm> The project's page is at http://www.glatzor.de/projects/python-distutils-extra/
<dpm> * /!\ Note that this tool is Python-specific. I'm mentioning it here because we're going to be talking of a practical example with Python. If your application were a C application you'd probably use autotool rules to achieve the same result
<dpm>  
<dpm> The three above technologies (gettext, intltool, python-distutils-extra) are transparently used by Quickly, so we won't get into much more detail for now.
<dpm> I just want you to get an idea of what we're talking about
<dpm> There are also more aspects involved in internationalizing applications, such as font rendering, input methods, etc., but this should get you started for now.
<dpm>  
<dpm> Quickly
<dpm> -------
<dpm> I'll be very brief here and let you figure out more on quickly as we go along
<dpm> For now, it will suffice give you a teaser and tell you that it is the tool which brings back the fun in writing applications! ;-)
<dpm>  
<dpm> Finally, a tool that is not strictly needed for internationalization (or the shorter form: i18n), but that can help you build an active translation community around your project
<dpm> which will be the next step after your project adds i18n support
<dpm>  
<dpm> Launchpad Translations
<dpm> ----------------------
<dpm> Launchpad Translations (https://translations.launchpad.net/) is the collaborative online tool which allows translation communities to be brought together and translate applications online through its web UI.
<dpm> Apart from the very polished UI to provide translations, it has other nice features such as message sharing across project series (translate one message in a series and it instantly propagates to all other shared series),
<dpm> global suggestions (suggestions of translations across _all_ projects in Launchpad), automatic imports of translations and automatic commits to bzr branches, several levels of permissions, and a huge translator base.
<dpm> On the right hand side of the URL I gave you you can see that there are quite a lot of projects using Launchpad to make translations easy both for developers and translators.
<dpm> Bear with me: we're nearly there - let's also quickly trow in and review a couple of concepts related to the gettext technology
<dpm>  
<dpm> Gettext: MO files
<dpm> -----------------
<dpm> The message catalog, or MO file (for Machine Object) is the binary file that is actually used to load translations in a running system.
<dpm> It is created from a textual PO (more on that in a bit), which is used as the source, generally by a tool called msgfmt.
<dpm> Message catalogs are used for performance reasons, as they are implemented as a binary hash table that is much more efficient to look up at runtime than textual PO files
<dpm> * {i} .mo files are the binary files installed in the system where the application loads the translations from, using gettext
<dpm>  
<dpm> Gettext: PO files
<dpm> -----------------
<dpm> PO file stands for Portable Object file, and are the textual files translators work with to provide translations. They are plain text files with a special format:
<dpm>   msgid "English message"
<dpm>   msgstr "TraducciÃ³ al catalÃ " <- Translated string
<dpm> (message pairs containing the original messages from the application, and its corresponding translation)
<dpm> You can see an example of a PO file here:
<dpm> http://bazaar.launchpad.net/~synaptic-developers/synaptic/trunk/view/head:/po/zh_CN.po
<dpm> * {i} Translators provide translations in PO files. If they use an online translation system they won't directly work with them, but your project sources will still contain them
<dpm> * {i} In each application source tree there is generally a PO file per language, named after the language code. E.g. ca.po, de.po, zh_CN.po, etc.
<dpm>  
<dpm> Gettext: POT files
<dpm> ------------------
<dpm> Once your project has added i18n support, you'll need to give translators an updated list of translatable messages they can start translating.
<dpm> You'll also need to update this list whenever you add new messages to your application.
<dpm> You achieve that through POT files, or simply templates in l10n (localization) slang (Portable Object Template).
<dpm> They are textual files with the same format as PO files,
<dpm> but they are empty of translations and are used as a template or stencil to create PO files from.
<dpm> * {i} There are special tools to update templates. Generally intltool is used, often called from a build system rule or a higher level tool such as python-distutils-extra
<dpm>  
<dpm> Gettext: Translation domain
<dpm> ---------------------------
<dpm> The translation domain is a unique string identifier assigned by the programmer in the code (usually in the build system)
<dpm> and used by the gettext functions to locate the message catalog where translations will be loaded from.
<dpm> The general form to compute the catalogâs location is:
<dpm>     locale_dir/locale_code/LC_category/domain_name.mo
<dpm> which in Ubuntu expand generally to /usr/share/locale/locale_code/LC_MESSAGES/domain_name.mo
<dpm> The locale_code part refers to the language code for the particular language. As an example, when using Nautilus in a Catalan locale with Ubuntu,
<dpm> the gettext functions will look for the message catalogue at:
<dpm>     /usr/share/locale-langpack/ca/LC_MESSAGES/nautilus.mo
<dpm> That's where the translations for your application will be installed and searched for
<dpm> Note that for your app this location might be slightly different:
<dpm>      /usr/share/locale/ca/LC_MESSAGES/myapp.mo
<dpm> * {i}The corresponding translation template should have the same translation domain in its filename, e.g. nautilus.pot.
<dpm> * {i} The translation domain must be unique across all applications and packages. I.e. something generic like messages.pot wonât work.
<dpm>  
<dpm> Ok, done with the concepts, let's get down to work and to questions
<dpm> Generic Steps to Internationalize an Application
<dpm> ================================================
<dpm> * Integrate gettext into the application. Initialize gettext in your main function, most especially the translation domain
<dpm> * Integrate gettext into the build system. There are generally gettext rules in the most common build systems. Use them.
<dpm> * Mark translatable messages. Use the _() gettext call to mark all translatable messages in your application
<dpm> * Care for your translation community. Not necessarily a step related to adding i18n support, but you'll want an active and healthy translation community around your project. Keep the templates with translatable messages up to date. Announce these updates and give translators time to do their work before a release. Be responsive to feedback.
<dpm>  
<dpm> Hands-on: creating an internationalized app
<dpm> ===========================================
<dpm> Ok, enough theory, let's have a go at using quickly to create your first internationalized application
<dpm> You can install Quickly on any recent Ubuntu release by simply firing up a terminal and executing:
<dpm>     sudo apt-get install quickly
<dpm> Once you've done that, you can run quickly to create your first project:
<dpm>     quickly create ubuntu-application awesometranslations
<dpm> (if you like, substitute 'awesometranslations' by your favourite project name)
<dpm> We've just told Quickly to use the ubuntu-application template, and to call what is created "awesometranslations"
<dpm> you should probably have an open dialog from your new app in front of you.
<dpm> Quickly has created all that for you!
<dpm> You can close the dialog to continue
<dpm> What Quickly did was to copy over basically a sample application, and do some text switcheroos to customize the app
<dpm> What you could see there was the ui containing some text that needs translation.
<dpm> To start making change to your app, go to the directory where it's stored. Generally by simply running
<dpm>     cd awesometranslation
<dpm> You can then edit your code with $ quickly edit, change the UI with $ quickly glade, and try your changes with $ quickly run
<dpm> You can save your change with $ quickly save
<dpm> Finally, to package, share, release your apps so that other will be, with the following commands (not all are necessary): $ quickly package / $ quickly share / $ quickly release
<dpm> As it stands now, the application has nearly all you need to make it translatable
<dpm> which is the great thing about quickly
<dpm> From now on, while I'll let you play and investigate the application you've created, we'll be looking at the one I created for the purpose of this session
<dpm> and I'll show you the i18n bits
<dpm> so that you can add them to your existing applications if you want
<dpm> For new applications, I'd simply recommend you to use quickly
<dpm> and start from there
<dpm> which will set up everything for you, so that you can forget about it and concentrate on all those new cool functions your new app is going to provide :-)
<dpm> So let's have a look at:
<dpm> http://bazaar.launchpad.net/~dpm/+junk/awesometranslations/files
<dpm> Notice that we could just call the session finished at this point, as quickly did all the job for us :)
<dpm> Also notice how easy it is. I've just created and pushed the application to Launchpad a few minutes ago
<dpm> Remember we were talking about PO and POT files?
<dpm> They are right there, under the po/ folder:
<dpm> http://bazaar.launchpad.net/~dpm/+junk/awesometranslations/files/head:/po/
<dpm> the po/ folder could be called something else, but it is customary to call it like that, as some tools rely on this convention
<dpm> Notice the .pot file called the same name as your app
<dpm> and an example translation file (ca.po) submitted by a translator
<dpm> Now to the interesting bits:
<dpm> Remember the generic steps for internationalization we were talking about earlier on?
<dpm> * Initializing gettext:
<dpm> http://bazaar.launchpad.net/~dpm/+junk/awesometranslations/view/head:/awesometranslations/__init__.py#L8
<dpm> so here we include the gettext module
<dpm> and we define a function called simply _()
<dpm> And finally we define the translation domain
<dpm> which will be the name of the .mo file installed in the system and the name of the .pot file
<dpm> * Integrating gettext in the build system:
<dpm> http://bazaar.launchpad.net/~dpm/+junk/awesometranslations/view/head:/setup.py#L13
<dpm> Here the integration happens automagically by using python-distutils-extra
<dpm> C programs using autotools might need a more complex integration
<dpm> * Mark translatable messages:
<dpm> http://bazaar.launchpad.net/~dpm/+junk/awesometranslations/view/head:/awesometranslations/__init__.py#L23
<dpm> For every message you want to expose for translation, you simply have to wrap it in the _() function, e.g. _("Translatable message here")
<dpm> And that's basically it, really
<dpm> easy, isn't it?
<dpm> ok, so we're running out of time, let's see if there are questions!
<ClassBot> There are 10 minutes remaining in the current session.
<ClassBot> bdfhjk asked: What is the best way to translate QT application? Gettext or QTLinquist?
<dpm> bdfhjk asked: What is the best way to translate QT application? Gettext or QTLinquist?
<dpm> Tough question :)
<dpm> Both Gettext and QT Linguist are excellent i18n frameworks
<dpm> With similar functionality
<dpm> But I would personally use gettext
<dpm> Because it is framework-agnostic and used by the vast majority of Open Source projects
<dpm> Not only that, but most online translation tools rely on gettext
<dpm> KDE itself uses gettext, for example
<ClassBot> bulldog98_konv asked: whatâs the difference between GNOMEs and KDEs handling of translations in code?
<dpm> Not much really
<dpm> As I said, both KDE and GNOME use gettext
<dpm> The majority of GNOME is written in C, and KDE in C++
<dpm> I gather that in KDE they wrap Qt Linguist calls through kdelib to actually use gettext to load the actual translations
<ClassBot> bdfhjk asked: Is Gettext working in windows?
<ClassBot> There are 5 minutes remaining in the current session.
<dpm> Yes, gettext works in any platform where glibc can run, including Windows
<dpm> There is still time to answer one last question if you've got one
<dpm> Ok, so I think I'll use the last minutes to thank everyone for their participation, and remind you that if you've got any questions on translations, feel free to ping me any time!
<dpm> I usually hang out on #ubuntu-devel
<dpm> Now time for KDE/Kubuntu rockstar apachelogger, whol'll tell you about the secret art of writing plasma widgets
<apachelogger> thank you dpm :)
<dpm> the floor is yours!
<apachelogger> salut, bonjour and welcome to an introduction to Widgetcraft oh my :)
<apachelogger> ...also known as the art of creating Plasma Widgets.
<apachelogger> my name is Harald Sitter and I am developer of KDEish things
<apachelogger> for this session you will need a couple of packages and any handy editor you like
* 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: The Art of Creating Plasma Widgets - Instructors: apachelogger
<apachelogger> sudo apt-get install kdebase-workspace-bin kdebase-runtime plasma-dataengines-workspace
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/11/%23ubuntu-classroom.html following the conclusion of the session.
<apachelogger> this comand will make sure you get the packages necessary
<apachelogger> if the editor can do syntax highlighting for javascript it would be good :)
<apachelogger> meanwhile I am going to talk a bit about the technology we are going to work with
<apachelogger> plasma is the technology most people refer to as "the KDE desktop"
<apachelogger> or "the KDE workspace" if you will
<apachelogger> Plasma is just about everything you see when you log into a newly installed KDE system (such as Kubuntu ;))
<apachelogger> it is the wallpaper, and the panel at the bottom, and every icon and element within that panel and so on
<apachelogger> it comes in many amazing favors and creating new ones is not all that difficult
<apachelogger> by favors I mean specific versions of plasma for different form factors (i.e. devices)
<apachelogger> currently there are plasma versions for desktop system, netbook systems, mobile devices (such as phones) and even tablets
<apachelogger> although the latter 2 are actually more like tech previews and not terribly usable at this time
<apachelogger> plasma widgets are widgets for plasma (surprise ;))
<apachelogger> they are also called plasmoids... in particular plasma widget usually means a widget that can run in plasma
<apachelogger> this includes apple dashboard widgets, google gadgets and native plasma widgets
<apachelogger> those native widgets are the ones called plasmiods
<apachelogger> plamoids make best usage of plasma's abilities and can be writen in javascript (including qml in KDE 4.6+), c++, ruby and python
<apachelogger> however only javascript and c++ are builtin (thus always available)
<apachelogger> so, usually you want to use on of those
<apachelogger> personally I would even go as far as saying that javascript is the weapon of choice unless you have good reasons to choose anoter language
<apachelogger> the reason for this is that javascript is of course easier to deploy (as it does not need compliation compared to c++) and is always available on every plasma system (unlike ruby and python)
<apachelogger> we also use javscript in this session ;)
<apachelogger> plasmoids are distributed as so called "plasmagik packages" (what a name!)
<apachelogger> they essentially contain one metadata file to describe the plasmoid at hand as well as code, images and other magic files
<apachelogger> for more information have a look at http://community.kde.org/Plasma/Package
<apachelogger> QUESTION: can we use Qt/C++
<apachelogger> as explained, one can use C++, however there is no particular gain from this for the usual plasmoid
<apachelogger> as the javascript API iis very powerful
<apachelogger> If there are no moar questions we can move on to hacking
<apachelogger> a common step when creating a new plasmoid is setting up the folder structure, for this you can use this magic command sequence of mine:
<apachelogger> NAME=dont-blink                   # 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> this will create a bare setup for a new plasmoid
<apachelogger> in the folder dont-blink
<apachelogger> QUESTION: can we create plasmoids in Ubuntu/Gnome and of course, test it on Kubuntu?
<apachelogger> yes
<apachelogger> testing can be done in gnome too
<apachelogger> however unfortunately at this point there is no actual widget integration, so the plasmoids will only work in KDE with Plasma
<apachelogger> movig on
<apachelogger> first we will need to setup our metadata file
<apachelogger> http://people.ubuntu.com/~apachelogger/uadw/04.11/dont-blink/metadata.desktop
<apachelogger> is a good starting point
<apachelogger> I believe the file is pretty easy to understand, it simply defines the general properties of our plasmoid
<apachelogger> name, license, author, version etc.
<apachelogger> usually you will want to change at least Name and X-KDE-PluginInfo-Name
<apachelogger> now we can already get our hands dirty
<apachelogger> Pleaes open the contents/code/main.js code file in your editor.
<apachelogger> let's start with a semi-helloworld thing :)
<apachelogger>     // First create a layout we can stuff things into
<apachelogger>     layout = new LinearLayout(plasmoid);
<apachelogger> layouts are very handy as we can put just about anything in there and they will automagically figure out how to align stuff
<apachelogger> (well, almost automagically ;))
<apachelogger>     // Then create a label to display our text
<apachelogger>     label = new Label(plasmoid);
<apachelogger>     // Add the label to the layout
<apachelogger>     layout.addItem(label);
<apachelogger>     // Set the text of our Label
<apachelogger>     label.text = 'Don\'t Even Blink';
<apachelogger>     // Done
<apachelogger> not terribly difficult, right? :)
<apachelogger> you can now run this using plasmoidviewer . or plasmoidviewer PATHTOTHEPLASMOID (depending on where you are in a terminal right now).
<apachelogger> this works on both KDE and GNOME
<apachelogger> and XFCE and ....
<apachelogger> plasmoidviewer is a very nice app to test plasmiods as you do not need to install the plasmoid to test it
<apachelogger> Here is a trick. If you have KDE 4.5 (default on 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 brilliant?
<apachelogger> for example you can try that on our new plasmoid
<apachelogger> or if you have the facebook plasmoid installed, you can try it with that
<apachelogger> very handy to run plasmoids as sort-of real applications
<apachelogger> I hope everyone got our first code working by now
<apachelogger> maybe let us continue with a buttons
<apachelogger> buttons are cool
<apachelogger> oh, in case you have not noticed, code lines are always indeted by 4 characters for your reading pleasure
<apachelogger>     // Create a new button
<apachelogger>     button = new PushButton;
<apachelogger>     // Add the button to our layout
<apachelogger>     layout.addItem(button);
<apachelogger>     // Give the button some text
<apachelogger>     button.text = 'Do not EVER click me';
<apachelogger> if you try the plasmoid now you will notice quite the sillyness
<apachelogger> the layout placed the button next to the text
<apachelogger> not so awesome :(
<apachelogger> and apachelogger claimed layouts are awesome -.-
<apachelogger> oh well
<apachelogger> easily fixable
<apachelogger> the problem is that the layout by default tries to place things next to each other rather than align them vertically
<apachelogger>     // Switch our layout to vertical alignment
<apachelogger>     layout.orientation = QtVertical;
<apachelogger> now this should look *much* better
<apachelogger> well
<apachelogger> our button does not do anythign yet
<apachelogger> that is a bit boring I might say ... and useless
<apachelogger> hwo about adding an image into the mix ? ;)
<apachelogger> QUESTION: why is it QtVertical? and not just Vertical like other widgets?
<apachelogger> QtVertical is actually coming from Qt and not from Plasma, as to avoid name clashes in the future I suppose it got prefixed with Qt ;)
<apachelogger> generally speaking layout orientation in C++ Qt is also an enum in the Qt namespace, so it looks pretty much the same
<apachelogger> but now for our image
<apachelogger> if you still have the same terminal you created the bare folder structure in you can use the following:
<apachelogger> mkdir -p $NAME/contents/images/
<apachelogger> wget -O $NAME/contents/images/troll.png http://people.ubuntu.com/~apachelogger/uadw/04.11/dont-blink/contents/images/troll.png
<apachelogger> otherwise jsut navigate to your plasmoid folder, go to contents and create an images folder, then download http://people.ubuntu.com/~apachelogger/uadw/04.11/dont-blink/contents/images/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 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>     // 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> that will not actually do anything
<apachelogger> as the troll is set to invisible by default
<apachelogger> we only show it once the user clicked on the button
<apachelogger> so this leads us to a very interesting part of Plasma in specific and Qt in particular
<apachelogger> connecting a state change on one thing to an action
<apachelogger> usually in Qt we call this the signal and slot system
<apachelogger> in javascript plasmoids we have almost the same thing, in fact it is even simpler than in standard c++
<apachelogger> so
<apachelogger> let us try that
<apachelogger>     // First add a function to handle clicking on the button
<apachelogger>     function onClick()
<apachelogger>     {
<apachelogger> within that function we put our logic for changing the visibility of our troll
<apachelogger>         // Either the troll is shown or it is not...
<apachelogger>         // If it is visible -> hide it
<apachelogger>         if (troll.visible) {
<apachelogger> ah, this is getting complicated
<apachelogger> lets stop here for a bit
<apachelogger> so, our troll can be visible and invisible and we change this via .visible and we read it via .visible
<apachelogger> this might be a bit confusing for those of us who drive ourselfs crazy with C++ ;)
<apachelogger> however, it is really something very Qt
<apachelogger> Qt adds property functionality to objects, which is really what we are seeing here
<apachelogger> our label has a property visibile
<apachelogger> and this property has a "setter" and a "getter"
<apachelogger> depending on the context we can therefore use .visible as getter or setter
<apachelogger> very handy :D
<apachelogger> (as we will have some QML sessions later this week ... this is also how QML elements work for the better part ;))
<apachelogger> now, moving on...
<apachelogger> we were writing our onClick function, in particular the logic for when the troll is already visible
<apachelogger>             // Make it invisible
<apachelogger>             troll.visible = false;
<apachelogger>             // And remove it from the layout, so that it does not take up space
<apachelogger>             layout.removeItem(troll);
<apachelogger> I think changing the visibility should be clear now ... but that removing there is a bit confusing
<apachelogger> apachelogger apparently did not prepare very well :P
<apachelogger> so let me show you the rest of the onClick function and explain this afterwards
<apachelogger>         } else { // If it is not visible -> show it
<apachelogger>             // Once our button gets clicked we want to show an image.
<apachelogger>             troll.visible = true;
<apachelogger>             // Finally we add the new image to our layout, so it gets properly aligned
<apachelogger>             layout.addItem(troll);
<apachelogger>         }
<apachelogger>     }
<apachelogger> so, depending on the state of visibility we simply do inverted actions
<apachelogger> possibly you noticed earlier on that we did not add the troll to our layout
<apachelogger> this was very intentional
<apachelogger> as soon as you add something to your layout it will usually consume space
<apachelogger> visible or not
<apachelogger> so, whenver our troll is not visible it also must not be part of the layout
<apachelogger> hence the logic in our onClick
<apachelogger> if visible -> make invisbile and remove from layout || if invisible -> make visible and add to layout
<apachelogger> the daring programmer will now try this and complain that it is not working
<apachelogger> oh my
<apachelogger> we did not yet define that onClick should do something upon button click
<apachelogger>     // Now we just tell our button that once it was clicked it shall run our function
<apachelogger>     button.clicked.connect(onClick);
<apachelogger> well then
<apachelogger> for me it works \o/
<apachelogger> very useful plasmoid we created there :D
<apachelogger> you can find a version of this I created earlier here : http://people.ubuntu.com/~apachelogger/uadw/04.11/dont-blink/
<apachelogger> it also contains additional magic that should trigger a notification on click and display your location as detected by gps or ip lookup ;)
<apachelogger> now that we have a wonderful plasmoid we will need to package it properly
<apachelogger> as mentioned earlier, plasmoids are distributed in super cool special packages
<apachelogger> although....
<apachelogger> actually they are just zip files with .plasmoid as suffix
<apachelogger> so let us create such a nice package from our plasmoid
<apachelogger> if you are still in the same terminal we started off with, the following should do the job:
<apachelogger> cd $NAME &&
<apachelogger> zip -r ../$NAME.plasmoid . &&
<apachelogger> cd ..
<apachelogger> $NAME is simply the name of our plasmoid, so you can easy enough create the zip manually too :)
<apachelogger> please note that plasma does expect the contents and metadata to be in the top level of the zip though, so you must not package the plasmoid directory (in our case dont-blink) but only the files
<apachelogger> that is really what that fancy zip command there does
<apachelogger> Once you have your plasmoid you can install it using the regular graphical ways on your plasma version or by using the command line tool plasmapkg.
<apachelogger> plasmapkg -i $NAME.plasmoid
<apachelogger> now the plasmoid should show up in your widget listing.
<apachelogger> consequently you should be able to use plasmoidviewer $NAME and plasma-windowed $NAME to view the plasmoid without plasma
<apachelogger> QUESTION: are there any particular style guidelines for writing code for plasmoids beyond what you have shown us? for those that are used to MVC kinda stuff
<apachelogger> not really
<apachelogger> if you are using C++ you can do just about anything ... in the future the javascript plasmoids will use QML quite a bit (you will hear about QML later this week)
<ClassBot> There are 10 minutes remaining in the current session.
<apachelogger> QML usually wants people to use Qt's Model/View system (which is pretty close to MVC)
<apachelogger> especially if you are working with lists of course :)
<apachelogger> QUESTION: will it be possible to compress the package with bzip2 in the futur?
<apachelogger> not planned in particular, but if you ask in #plasma I am sure someone could tell you whether that would be desirable
<apachelogger> as plasmoids are usually atomic it does not make much a difference though
<apachelogger> any other questions?
<apachelogger> if not, then let me give you some additonal resources where you can find handy super nice things :)
<apachelogger> Where the Plasma community collects its information: http://community.kde.org/Plasma
<apachelogger> General tutorials on JavaScript Plasmoids: http://techbase.kde.org/Development/Tutorials/Plasma#Plasma_Programming_with_JavaScript
<apachelogger> Plasma and KDE development examples: http://quickgit.kde.org/?p=kdeexamples.git&a=summary
<apachelogger> Some general guidelines for Plasmoid programming: http://community.kde.org/Plasma/PlasmoidGuidelines
<apachelogger> Information on Plasma packages: http://community.kde.org/Plasma/Package
<apachelogger> AND
<apachelogger> last, but not least
<apachelogger> *super important*
<apachelogger> the JavaScript API: http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API
<apachelogger> if you compare this API to what you can do in C++ you will notice that the JavaScript API is really sufficient for most things :)
<apachelogger> On IRC you can get help in #plasma most of the time
<apachelogger> Good luck with creating your brilliant Plasmoids :)
<apachelogger> you can find me in just about every KDE and Kubuntu IRC channel after the sessions if you have any additional questions
<ClassBot> There are 5 minutes remaining in the current session.
<apachelogger> if you are interested in KDE software development I'd like to direct your attention to the KDE development session tomorrow, the various QML sessions and my talk on multimedia in Qt and KDE on friday :)
<apachelogger> thanks everyone for joining and have a nice day
<barry> welcome to "rock solid python development with unittest/doctest".  today i'm going to give a brief introduction to unit- and doc- testing your python applications, and hooking these into the debian packaging infrastructure.
<barry> raise your hand if you're already unashamedly obsessed with testing :)
* 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: Rock solid Python development with unittest/doctest - Instructors: barry
<barry> since it would take way more than one hour, i'm not going to give a deep background on testing, or the python testing culture, or python testing tools.  there are a ton of references out there.  two resources i'll give right up front are the testing-in-python mailing list <http://tinyurl.com/2bl2gk> and the python testing tools taxonomy <http://tinyurl.com/msya4>.  python has a *very* rich testing culture, and i encourage you to explore
<barry> it!
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/11/%23ubuntu-classroom.html following the conclusion of the session.
<barry> sorry, i'm going to start over because of the classbot delay...
<barry> welcome to "rock solid python development with unittest/doctest".  today i'm going to give a brief introduction to unit- and doc- testing your python applications, and hooking these into the debian packaging infrastructure.
<barry> raise your hand if you're already unashamedly obsessed with testing :)
<barry> since it would take way more than one hour, i'm not going to give a deep background on testing, or the python testing culture, or python testing tools.  there are a ton of references out there.  two resources i'll give right up front are the testing-in-python mailing list <http://tinyurl.com/2bl2gk> and the python testing tools taxonomy <http://tinyurl.com/msya4>.  python has a *very* rich testing culture, and i encourage you to explore
<barry> it!
<barry> there's a lot you can do right out of the box, and that's where we'll start.  michael foord is hopefully here today too; he's the author of unittest2, a standalone version of all the wizzy new unittest stuff in python2.7
<barry> for now, we'll keep things pretty simple, and the examples should run in python2.6 or python2.7 with nothing extra needed.
<barry> for those of you with bazaar, the example branch can be downloaded with this command: bzr branch lp:~barry/+junk/adw
<barry> if you can't check out the branch, you can view it online here:
<barry> http://bazaar.launchpad.net/~barry/+junk/adw/files
<barry> i'll pause for a few moments so that you can grab the branch or open up your browser
<barry> here's a quick overview of what we'll be looking at: a quick intro to unittesting, a quick intro to doctesting, hooking them together in a setup.py, hooking them into your debian packaging.
<barry> let's first look at a simple unittest.  if you've downloaded the branch referenced above, you should open the file adw/tests/test_adding.py in your editor.
<barry> http://bazaar.launchpad.net/~barry/+junk/adw/view/head:/adw/tests/test_adding.py
<barry> the adw package is really stupid.  it has one function which adds two integers together and returns the results.  i won't talk much about test driven development (tdd) here, but i highly encourage you to read up on that and to practice tdd diligently!  these tests were developed using tdd.
<barry> anyway, looking at test_adding.py, you can see one test class, called TestAdding.  there are some other boilerplate stuff in test_adding.py that you can mostly ignore.  the TestAdding class has one method, test_add_two_numbers().  this method is a unittest.  you'll notice that it calls the add_two_numbers() function (called the "system under test" or sut), and asserts that the return value is equal to 20.  pretty simple.
<barry> look below that at the test_suite() function.  this is mostly boilerplate used to get your unittest to run.  the function creates a TestSuite object and adds the TestAdding class to it.  python's unittest infrastructure will automatically run all test_*() methods in the test classes in your suite.
<barry> let's run the tests.  type this at your shell prompt:
<barry> $ python setup.py test
<barry> (without the $ of course)
<barry> the first time you do this, your package will get built, then you'll see a little bit of verbose output you can ignore, and finally you'll see that two tests were run.  ignore the README.txt doctest for the moment.
<barry> if you want to see what a failing test looks like, uncomment the test_add_two_numbers_FAIL() method and run `python setup.py test` again.  be sure to comment that back out afterward though! :)
<barry> everybody with me so far?  i'll pause for a few minutes to see if there are any questions up to now
<barry> !q
<barry> so, obviously the more complicated your library is, the more test methods, test classes, and test_*.py files you'll have.  i probably won't have time to talk about test coverage much, but there are excellent tools for reporting on how much of your code is covered by tests.  you obviously want to aim for 100% coverage.
<barry> okay, let's switch gears and look at a doctest now.  go ahead and open adw/docs/README.txt
<barry> http://bazaar.launchpad.net/~barry/+junk/adw/view/head:/adw/docs/README.txt
<barry> doctests are *testable documentation*.  the emphasis is on the documentation aspects of these files, and in fact there are excellent resources for turning doctests into actual documentation, e.g. http://packages.python.org/flufl.i18n/
<barry> doctests are written using restructured text, which is a very nice plain text human readable format.  the key thing for testing is to notice the last three lines of the file.  see the two lines that start with >>>
<barry> (aside: sphinx is the tool to turn rest documention into html, pdf, etc.)
<barry> and it's very well integrated with setup.py and the python package infrastructure
<barry> that's a python interpreter prompt, and doctests work by executing all the code in your file that start with the prompt.  any code that returns or prints some output is compared with text that follows the prompt.  if the text is equivalent, then the test passes, otherwise it fails.
<barry> oh, i should mention.  "doctests" can mean one of two things.  you can actually have testable sections in your docstrings, or you can have separate file doctests.  by personal preference, i always use the latter
<barry> btw, the use of doctests is somewhat controversial in the python world.  i personally love them, others hate them, but i think everyone agrees they do not replace unittests, but i think they are an excellent complement.  anyway, if we have time at the end we can debate that :)
<barry> !q
<barry> in this example, add_two_numbers() is called with two integers, and it returns the sum.  if you were to type the very same code at the python interpreter, you'd get 12 returned too.  doctest knows this and compares the output
<barry> run `python setup.py test` again and look carefully at the output.  you'll see that the README.txt doctest was run and passed.  if you change that 12 to a 13, you'll see what a failure looks like (be sure to change it back afterward!)
<barry> i'll pause for a few minutes to let folks catch up
<ClassBot> RawChid asked: So doctest is one way to do uittesting in Python?
<barry> RawChid: i'd say one way to do *testing*, which i'm personally a big fan of.  i love writing documentation first because it ensures that i can explain what i'm doing.  if i can't explain it, i probably don't understand it.  but for really thorough testing, you must add unittests.  e.g. you typically do not want to do corner case and error cases in doctests.
<barry> although the heretic in me says you should try :)
<barry> unfortunately, python's unittest framework does not run doctests automatically.  if you look in the adw/tests directory, you'll see a file called test_documentation.py.  you don't need to study this much right now, and you are free to copy this into your own projects.  it's just a little boiler plate to hook up doctests with the rest of your test suite.  it looks for files inside docs/ directories that end in .txt or .rst (the reST
<barry> standard extension) and adds them to the test suite.  once you have test_documentation.py, you never need to touch it.  just add more .txt and .rst files to your docs directories, and it will work automatically.
<barry> http://bazaar.launchpad.net/~barry/+junk/adw/view/head:/adw/tests/test_documentation.py
<ClassBot> tronda asked: Is doctest somewhat similar to the BDD movement?
<barry> tronda: probably related.  i don't know too much of the details but i think there are better tools for doing bdd in python
<barry> voidspace might know more about that
<barry> everybody with me so far?
<barry> time to switch gears a little.  how do you hook up your unittests and doctests to your setup.py file so that you also can run `python setup.py test`?  open up setup.py in your editor and we'll take a look
<barry> http://bazaar.launchpad.net/~barry/+junk/adw/view/head:/setup.py
<barry> notice first that setup.py imports distribute_setup and then makes a function call.  you'll see the file distribute_setup.py in the branch's top level directory.  this means my package uses *distribute* which is the successor to setuptools.  i highly recommend it, but if you don't know what that is, you can just cargo cult this bit.
<barry> anyway, the setup.py is fairly simple.  you'll just notice one thing in the second to last line.  it sets `test_suite` to `adw.tests`.  the value is a python package path and it references the directory adw/tests.  this is how you hook up your test suite to setup.py.  when you run `python setup.py test` it looks at this test_suite key, and runs all the files that look like test_*.py
<barry> voidspace mentions in #u-c-c that we're pretty sure this is a setuptools extension to the standard distutils setup.py.  so it'll probably work for either setuptools or distribute
<barry> we have two of those of course!  test_adding.py and test_documentation.py, and the testing infrastructure automatically finds these, and makes the appropriate calls to find what tests to run.  so that little test_suite='adw.tests' line is all you need to hook your tests into setup.py
<barry> so far so good.  now let's look at how to hook your python test suite into your debian packaging so that your tests always run when your package is built.  if you're not into debian packaging you can ignore the next couple of minutes.
<barry> open up debian/rules in your editor.
<barry> http://bazaar.launchpad.net/~barry/+junk/adw/view/head:/debian/rules
<barry> first thing to notice is that my package uses dh_python2, which is the new goodness replacing python-central and python-support.  i highly recommend it as it can make your debian packaging of python code really really easy.  you can see there's not much to my rules file.
<barry> i won't go into dh_python2 much right now, but you can look at the debian wiki for more details http://wiki.debian.org/Python
<barry> for today's class, there are really three parts to take a look at.  the first is the PYTHON2 line.  what this does is ensure that your tests will be run against all supported versions of python (2.x) on your system, not just python2.6 or python2.7.  the commented out line for PYTHON3 will do something similar for python3
<barry> (e.g. line 3)
<barry> remember that ubuntu 11.04 supports both python2.6 and 2.7
<barry> aside: it is possible to write your package for both python2 and python3, and to run all the tests into both.  we won't have time to talk about that today though.
<barry> so the next thing to look at is the line that starts `test-python%`.  this is a wildcard rule that is used to run the setup.py test suite with every supported version of python2 on your system.  you'll notice the -vv which just increases the verbosity.
<barry> (e.g. line 9)
<barry> override_dh_auto_test line then expands the PYTHON2 variable to include all the supported versions of python2, and it runs the test-python% wildcard rule for each of these.  thus this hooks in the setup.py tests for all versions of python2.  the override is currently needed because dh_auto_test doesn't know about `python setup.py test` yet.
<barry> i won't go into the specifics of packaging building right now, but i've done a build locally, and the results are available here: http://pastebin.ubuntu.com/592711/
<ClassBot> eolo999 asked: I'm very comfortable with nosetests; is there a particular reason why you left it out from the session?
<barry> scroll down to line 251 and you'll see the test suite getting run for python2.7.  scroll down to line 268 and you'll see it getting run for python2.6.  the nice thing about this is that if you get a failure in either test suite, your package build will also fail.  this is a great way to ensure really high quality (i.e. rock solid :) python applications in ubuntu.
<ClassBot> jderose asked: I got the impression that setuptools wasn't well maintained lately, wasn't regarded as the way forward, esp with Python3 - is that true, WWBWD? :)
<barry> eolo999: mostly just to keep things simple.  voidspace in #u-c-c says that the main advantage of nosetests is the test runner, so it you can basically use all the techniques here with nose
<barry> i'm pretty sure that the future plans voidspace has for unittest2 include integrating nose more as a plugin than as a separate tool
<barry> btw, that's about all the canned stuff i have prepared, so i welcome questions from here on out
<barry> just ask them in #ubuntu-classroom-chat and we'll post the answers here
<barry> jderose: i'd say that's correct, though setuptools does get occasional new releases.  distribute is the maintained successor to setuptools, but for python3 distutils2 will be the way forward
<barry> i admit that it's all very confusing :)
<barry> but my recommendation would be: use distribute for python2 stuff, and for python3 stuff if you want the same code base to be compatible with 2.x and 3.x (i.e. via 2to3).  this is a great way to support both versions of python
<barry> oh yes, distutils2 will be called 'packaging' in python 3.3 and it will come in the stdlib
<barry> from #u-c-c:
<barry> <voidspace> barry is correct, I have plans for unittest to become more
<barry>             extensible (plugins) that should allow nose to become much simpler
<barry>             and be implemented as plugins for unittest
<barry> <voidspace> at the moment nose is convoluted and painful to maintain because
<barry>             unittest itself is not easy to extend
<barry>  
<barry> also lvh mentions trial, which is twisted's test runner.  for mailman3 i use zc.testing which is zope's test runner
<barry> so yeah, there are lots of testing tools out there :)
<barry> !q
<barry> <jderose> QUESTION: so is it okay/encouraged to run your python tests in PPA
<barry>           builds, say for daily recipes and whatnot?
<barry> jderose: i don't recall a discussion about it one way or the other.  personally, i would enable tests for all package builds, just to ensure that what you deploy has not regressed.
<barry> however, you do need to be careful that your test suite can *run* in a ppa environment
<barry> this may not always be the case.  some test suites require resources that are not available on the buildds.  those tests would obviously cause problems when your ppa were built
<barry> in those cases, it may be best to have more than one "layer" of tests.  one that gives good coverage and high confidence against regressions, but requires no expensive or external resources.  and a full test suite you can run locally with whatever crazy stuff you need
<barry> mocks might be a good answer to help with that
<barry> qwebirc57920: ppa == personal package archive
<barry> https://help.launchpad.net/Packaging/PPA
<barry> QUESTION: How do I know what resources are available on the
<barry>              buildds?
<barry> yeah, good question :)  ask on #launchpad or launchpad-dev, or just try it and see what fails ;)  there should be better documentation about that on help.l.net
<barry> <jderose> QUESTION: so if `test` requires a lot more dependencies than
<barry>           `install`, should we just put those all in Build-Depends?  when will
<barry>           we get Test-Depends?  :)
<barry> jderose: excellent question.  for now, i recommend build-depends
<barry> <tronda> Question: In the Java space there's a lot of mocking
<barry>          tools/libraries. Any need for that in Python - if so - which are the
<barry>          recommended ones?
<barry> voidspace can tell you how many mock libraries are available in python!  answer is *lots*
<barry> btw, please note that there are tools (such as pkgme and stdeb) that can debianize your setup.py based python project.  they do a pretty good job, though i'm not sure they turn test-requires into build-depends.
<barry> <jderose> QUESTION: you mentioned "layering" tests into light/heavy - what a
<barry>           good way of doing that?
<barry>  
<barry> jderose: i think this depends on the test runner you use.  python's stdlib for example uses -u flag to specify additional resources to enable (e.g. largefile).  most test runners have some way of specifying a subset of all tests to run and what i would do is in your debian/rules file, file the right arguments to your test runner to run the tests you can or want to run
<barry> note that in my debian/rules file, i set it up to run 'python setup.py test -vv' but really, it can run any command with any set of options
<barry> <chadadavis> QUESTION: to different doc tests share a common environment /
<barry>              namespace? Can I make them explicitly separate / explicitly
<barry>              shared?
<barry>  
<barry> chadadavis: all the doctests in a single file or docstring share the same namespace.  one of the criticisms of doctests is that it builds up state as it goes so it can sometimes be difficult if a test later in the file fails, to determine what earlier state caused the failure.
<barry> i think that just means you have to be careful, and also, keep your doctests focussed
<barry> not too big
<barry> you really just have to understand when and where each tool (unittest or doctest) is appropriate
<barry> voidspace also points out that every line in a doctest gets executed, even if there are failures (though i *think* there's a fail to cause it to bail on the first failure)
<barry> i'll just say that that can be an advantage or disadvantage depending on what you like and what you're trying to do :)
<barry> looks like we have a few minutes left.  are there any other questions?
<ClassBot> There are 10 minutes remaining in the current session.
<akgraner> <jderose> QUESTION - what's the status of 3to2?  write Python3 is so wonderful, i'd rather go that way than 2to3
<barry> i'll just say again what an excellent resource the testing-in-python mailing list is.  i highly recommend you join!
<barry> voidspace answers this as well as i could:
<barry> <voidspace> jderose: packaging (distutils2) is now using 3to2 rather than 2to3
<barry> <voidspace> jderose: so although I've not used it myself, it must be in a
<barry>             pretty good state  [16:53]
<barry>  
<barry> i've also not used 3to2 myself
<barry> much
<barry> fwiw, if you look at my test_documentation.py file, you'll see how you can do setups and teardowns for doctests
<barry> it also does fun stuff like set __future__ flags for the doctest namespace
<barry> voidspace says in #u-c-c that sphinx has support for doctests through its doctest:: directive
<ClassBot> There are 5 minutes remaining in the current session.
<barry> well, time is almost up, so let me thank you all for attending!  i know there was a lot of material and i blew through it pretty fast
<barry> in closing, i'll say that while we can all debate this or that detail of testing, there's no debate that testing is awesome and we all should do more of it!
<barry> big thanks to my colleague voidspace for helping out!
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/11/%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 ||
<wcampusano> .
#ubuntu-classroom 2011-04-12
<abm> hi
<abm> time
<dpm> Ubuntu App Developer Week - Day 2 starting in ~10 minutes! :-)
<pitti> ClassBot: good day to you!
<cdbs> hi pitti
 * cdbs was waiting for this session for a really really long time
<dpm> Welcome everyone to a new and exciting day of the Ubuntu App Developer Week!
<dpm> Lots of interesting sessions lined up for today
<dpm> Bringing you the best content from the best speakers
* 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: PyGTK is dead, long live PyGI! Using gobject-introspection in Python - Instructors: pitti
<dpm> Check out http://ubuntu-news.org/2011/04/12/off-to-a-great-start-ubuntu-app-developer-week-day-1/ if you missed any of the sessions yesterday
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<dpm> Next up is Martin Pitt, one of the persons who know Ubuntu and its technologies inside out
<dpm> He's going to be talking about porting your old PyGTK applications to the new PyGI framework,
<dpm> so that they can make use of all the awesomeness of introspection.
<dpm> Let's hand him the mike...
 * pitti clears throat
<pitti> Hello everyone! I am Martin Pitt from the Canonical Ubuntu Desktop Team.
<pitti> Python is a very important and popular language in Ubuntu, we have a lot of applications written in Python for GTK and Qt/KDE. Most prominent examples are our installer Ubiquity, Software Center, our driver installer "Jockey", and our bug/crash reporting system "Apport" (shameless plug!).
<pitti> By way of Quickly we also encourage application developers to use Python and GTK, as these allow you to write GUI applications both conveniently, fast, and still rather robust.
<pitti> So far the package of choice for that has been PyGTK, a manually maintained Python binding for GTK, ATK, Pango, Glade, and a few other things. However, a few months ago, with the advent of GTK3, PyGTK was declared dead, so it's time to bring the banner of the great new world of its successor -- gobject-introspection -- to the world!
<pitti> Tomeu Vizoso already explained what gobject-introspection (commonly abbreviated "GI") is, why we need it, and how library developers can use it to provide a machine readable and complete API/ABI description. So I'll just do a very brief summary here.
<pitti> I'll concentrate on the app developer side, i. e. how to use GI typelibs in Python.
<pitti> Porting existing PyGTK2 code is a topic that will keep many of us busy in the next months, so I'll explain the process and common pitfalls with that.
<pitti> Finally I'll give some pointers to documentation, and will be available for some Q&A.
<pitti> Everyone ready to dive in? Please let me know (here or in #-chat) when I become too fast. If I am being totally unclear, please yell and I'll handle that immediately. If you just have a followup question, let's handle these at the end.
<pitti> == Quick recap: What is GI? ==
<pitti> So far a lot of energy was spent to write so-called "bindings", i. e. glue code which exposes an existing API such as GTK for a target language: PyGTK, libnotify-cil, or Vala's .vapi files.
<pitti> This both leads to a combinatorial explosion (libraries times languages), as well as many bindings which don't exist at all, or being of low quality. In addition it is also an almost insurmountable barrier for introducing new languages, as they would need a lot of bindings before they become useful.
<pitti> GI is a set of tools to generate a machine parseable and complete API/ABI description of a library, and a library (libgirepository) which can then be used by a language compiler/interpreter to automatically provide a binding for this library.
<pitti> With GI you can then use every library which ships a typelib in every language which has GI support.
<pitti> GI ABI/API descriptions come in two forms:
<pitti>  * An XML file, called the "GIR" (GI repository). These are mainly interesting for developers if they need to look up a particular detail of e. g. a method argument or an enum value. These are not actually used at runtime (as XML would be too costly to interpret every time), and thus they are shipped in the library's -dev package in Ubuntu and Debian. For example, libgtk2.0-dev ships
<pitti> /usr/share/gir-1.0/Gdk-2.0.gir.
<pitti>  * A compiled binary form for efficient access, called the "typelib". These are the files that language bindings actually use. Ubuntu/Debian ship them in separate packages named gir<GI_ABI_version>-<libraryname>-<library_ABI_version>, for example, gir1.2-gtk-2.0 ships /usr/lib/girepository-1.0/Gdk-2.0.typelib.
<pitti> (Yes, it's confusing that the gir1.2-* package does _not_ actually ship the .gir file; don't ask me why they were named "gir-", not "typelib-").
<pitti> == How does it work in Python? ==
<pitti> pygobject is the piece of software which provides Python access to GI (amongst other things, like providing the glib and GObject bindings).
<pitti> The package name in Ubuntu/Debian is "python-gobject", and it should already be installed on all but the most manually trimmed down installations.
<pitti> Initial GI support was added to pygobject in version 2.19.0 (August 2009), but the entire GI/pygobject/annotations stack really only stabilized in the last couple of months, so that in practice you will need at least pygobject 2.28 and the corresponding latest upstream releases of GTK and other libraries you want to use.
<pitti> This means that you can only really use this with distros which are less than about three months old. For Debian/Ubuntu this means you'll need to use the current development versions, i. e. Ubuntu Natty (beta-1) or Debian experimental (most of this wasn't uploaded to unstable yet after the squeeze release).
<pitti> pygobject provides a "gi.repository" module namespace which generates virtual Python modules from installed typelibs on the fly.
<pitti> For example, if you install gir1.2-gtk-2.0 (it's already installed by default in Ubuntu Natty), you can do:
<pitti>   $ python -c 'from gi.repository import Gtk; print Gtk'
<pitti>   <gi.module.DynamicModule 'Gtk' from '/usr/lib/girepository-1.0/Gtk-2.0.typelib'>
<pitti> and use it just like any other Python module.
<pitti> I bet that this first example comes as an absolutely unexpected surprise to you:
<pitti>   $ python -c 'from gi.repository import Gtk; Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, "Hello World").run()'
 * pitti gives everyone a minute to try this
<pitti> Let's look at the corresponding C declaration:
<pitti>   GtkWidget* gtk_message_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...);
<pitti> and the C call:
<pitti>   GtkMessageDialog* msg = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "Hello World");
<pitti>   msg.run()
<pitti> So what do we see here?
<pitti> (1) The C API by and large remains valid in Python (and other languages using the GI bindings), in particular the structure, order, and data types of arguments.
<pitti> There are a few exceptions which are mostly due to the different way Python works, and in some cases to make it easier to write code in Python. I'll speak about details below. But this means that you can (and should) use the normal API documentation for the C API of the library. devhelp is your friend!
<pitti> (2) As Python is a proper object oriented language, pygobject (and in fact the GI typelib already) expose a GObject API as proper classes, objects, methods, and attributes.
<pitti> I. e. in Python you write
<pitti>   b = Gtk.Button(...)
<pitti>   b.set_label("foo")
<pitti> instead of the C gobject syntax
<pitti>   GtkWidget* b = gtk_button_new(...);
<pitti>   gtk_button_set_label(b, "foo");
<pitti> The class names in the typelib (and thus in Python) are derived from the actual class names stated in the C library (like "GtkButton"), except that the common namespace prefix ("Gtk" here) is stripped, as it becomes the name of the module.
<pitti> (3) Global constants would be a heavy namespace clutter in Python, and thus pygobject exposes them in a namespaced fashion as well.
<pitti> I. e. if the MessageDialog constructor expects a constant of type "GtkMessageType", then by above namespace split this becomes a Python class "Gtk.MessageType" with the individual constants as attributes, e. g. Gtk.MessageType.INFO.
<pitti> (This is actually something that pygtk gets quite wrong, the constant names are quite arbitrary there)
<pitti> (4) Data types are converted in a rather obvious fashion. E. g. when the C API expects an int* array pointer, you can supply a normal Python array [0, 1, 2]. A Python string "foo" will match a gchar*, Pythons None matches NULL, etc.
<pitti> So the GObject API actually translates quite naturally into a real OO language like Python, and after some time of getting used to above transformation rules, you should have no trouble translating the C API documentation into their Python equivalents.
<pitti> When in doubt, you can always look for the precise names, data types, etc. in the .gir instead, which shows the API broken by class, method, enum, etc, with the exact names and namespaces as they are exposed in Python.
<pitti> s I mentioned above, this is in no way restricted to GTK, GNOME, or UI. For example, if you handle any kind of hardware and hotplugging, you almost certainly want to query udev, which provides a nice glib integration (with signals) through the gudev library.
<pitti> This example lists all block devices (i. e. hard drives, USB sticks, etc.):
<pitti> (You need to install the gir1.2-gudev-1.0 package for this)
<pitti> $ python
<pitti> >>> from gi.repository import GUdev
<pitti> >>> c = GUdev.Client()
<pitti> >>> for dev in c.query_by_subsystem("block"):
<pitti> ...     print dev.get_device_file()
<pitti> ...
<pitti> /dev/sda
<pitti> /dev/sda1
<pitti> /dev/sda2
<pitti> [...]
<pitti> See http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/GUdevClient.html#g-udev-client-query-by-subsystem for the corresponding C API.
<pitti> GI is not even restricted to GObject, you can annotate any non-OO function based API with it. E. g. there is already a /usr/share/gir-1.0/xlib-2.0.gir (although it's horribly incomplete). These will behave as normal functions in Python (or other languages) as well.
<pitti> == Other API differences ==
<pitti> I said above in (1) that the structure of method arguments is by and large the same in C and in GI/Python. There are some notable exceptions which you must be aware of.
<pitti> === Constructors ===
<pitti> The biggest one is constructors. There is actually two ways of calling one:
<pitti>  * Use the real constructor implementation from the library. Unlike in normal Python you need to explicitly specify the constructor name:
<pitti>    Gtk.Button.new()
<pitti>    Gtk.Button.new_with_label("foo")
<pitti>  * Use the standard GObject constructor and pass in the initial property values as named arguments:
<pitti>    Gtk.Button(label="foo", use_underline=True)
<pitti> The second is actually the recommended one, as it makes the meaning of the arguments more explicit, and also underlines the GObject best practice that a constructor should do nothing more than to initialize properties. But otherwise it's pretty much a matter of taste which one you use.
<pitti> === Passing arrays ===
<pitti> Unlike C, higher level languages know how long an array is, while in the C API you need to specify that explicitly, either by terminating them with NULL or explicitly giving the length of the array in a separate argument.
<pitti> Which one is used is already specified in the annotations and thus in the typelib, so Python can automatically provide the right format without the developer needing to append an extra "None" or a separate len(my_array) argument.
<pitti> For example, in C you have
<pitti>    gtk_icon_theme_set_search_path (GtkIconTheme *icon_theme, const gchar *path[], gint n_elements)
<pitti> In Python you can just call this as
<pitti>    my_icon_theme.set_search_path(['/foo', '/bar'])
<pitti> and don't need to worry about the array size.
<pitti> === Output arguments ===
<pitti> C functions can't return more than one argument, so they often use pointers which the function then fills out. Conversely, Python doesn't know about pointers, but can easily return more than one value as a tuple.
<pitti> The annotations already describe which arguments are "out" arguments, so in Python they become part of the return tuple: first one is the "real" return value, and then all out arguments in the same order as they appear in the declaration. For example:
<pitti>   GdkWindow* gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask)
<pitti> In Python you would call this like
<pitti>   (ptr_window, x, y, mask) = mywindow.get_pointer()
<pitti> === GDestroyNotify ===
<pitti> Some GLib/GTK functions take a callback method and an extra "user_data" argument that is passed to the callback.
<pitti> In C they often also take a "GDestroyNotify" function which is run once all callbacks are done, in order to free the memory of user_data.
<pitti> As Python has automatic memory management, pygobject will take care of all this by itself, so you simply don't specify the GDestroyNotify argument.
<pitti> For example:
<pitti>     void gtk_enumerate_printers (GtkPrinterFunc func, gpointer user_data, GDestroyNotify destroy, gboolean wait)
<pitti> In Python you call this as
<pitti>    Gtk.enumerate_printers(my_callback, my_user_data, True)
<pitti> === Non-introspectable functions/methods ===
<pitti> When you work with PyGI for a longer time, you'll inevitably stumble over a method that simply doesn't exist in the bindings. These usually are marked with introspectable="0" in the GIR.
<pitti> In the best case this is because there are some missing annotations in the library which don't have a safe default, so GI disables these to prevent crashes. They usually come along with a corresponding warning message from g-ir-scanner, and it's usually quite easy to fix these.
<pitti> So please do file upstream bugs against the relevant library when you find these
<pitti> Another common case are functions which take a variable number of arguments, such as gtk_cell_area_add_with_properties().
<pitti> Varargs cannot be handled safely by libgirepository. In these cases there are often alternatives available (such as gtk_cell_area_cell_set_property()). For other cases libraries now often have a ..._v() counterpart which takes a list instead of variable arguments.
<pitti> == Overrides ==
<pitti> A specialty of pygobject is the possibility of replacing functions, methods, or classes of the introspected library with custom code, called "overrides".
<pitti> As the goal is to stay very close to the original API, they should be used and written sparsely, though.
<pitti> One major use case is to provide replacements for unintrospectable methods. For example, Gtk.Menu.popup() is not introspectable in GTK, but the GTK override implements this method in terms of Gtk.Menu.popup_for_device(), so in this case the override actually helps to get closer to the original API again.
<pitti> Another important case is automatic data type conversion, most prominently to allow passing unicode objects to methods which expect an UTF-8 encoded gchar*. This also actually helps to prevent workarounds in application code and maintain a clean API.
<pitti> Thirdly, overrides are useful if they help to massively ease development. For example it is quite laborious to do GDBus calls or GVariant constructions with the native Gio/GLib API.
<pitti> pygobject offers convenience overrides to make these a lot simpler and more Pythonic, but of course without actually breaking the original API.
<pitti> Overrides are shipped in /usr/share/pyshared/gi/overrides/, and should be quite easy to understand.
<pitti> e. g. in /usr/share/pyshared/gi/overrides/Gtk.py you see the "def popup()" method for Menu that I mentioned above
<pitti> In general you should not even be required to know about it, as most of them really just fix stuff to work as expected.
<pitti> But for the GDBus/GVariant cases it is useful to know them, as you can safe yourself a ton of extra work
<pitti> == Migrating pygtk2 code ==
<pitti> A big task that we in Ubuntu already started in the Natty cycle, and which will continue to keep us and all other PyGTK app developers busy for a while is to port PyGTK2 applications to GTK3 and PyGI.
<pitti> Note that this is really two migrations in one step, but is recommended as GTK2 still has a lot of breakage with PyGI, although I did a fair amount of work to backport fixes from GTK3 (the six applications that we ported in Natty run with PyGI and GTK2, after all).
<pitti> The GTK2 â GTK3 specifics are documented at http://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html and I don't want to cover them here.
<pitti> If we compare the PyGTK vs. PyGI code for a "Hello" message box, we see that it's actually very similar in structure:
<pitti>   $ python -c 'from gi.repository import Gtk; Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, "Hello World").run()'
<pitti> (^ pygi)
<pitti>   $ python -c 'import gtk; gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, "Hello World").run()'
<pitti> (^ pygtk)
<pitti> So PyGTK also already did the representation of the C functions as proper classes and methods, thus if you port from PyGTK instead of from C, it'll be a lot easier.
<pitti> === Step 1: The Great Renaming ===
<pitti> The biggest part in terms of volume of code changed is basically just a renaming exercise.
<pitti> E. g. "gtk.*" now becomes "Gtk.*", and "gtk.MESSAGE_INFO" becomes "Gtk.MessageType.INFO".
<pitti> Likewise, the imports need to be updated: "import gtk" becomes "from gi.repository import Gtk".
<pitti> Fortunately this is is a mechanical task which can be automated. The pygobject git tree has a script "pygi-conver.sh" which is a long list of perl -pe 's/old/new/' string replacements. You can get it from http://git.gnome.org/browse/pygobject/tree/pygi-convert.sh.
<pitti> It's really blunt, but surprisingly effective, and for small applications chances are that it will already produce something which actually runs.
<pitti> Note that this script is in no way finished, and should be considered a collaborative effort amongst porters. So if you have something which should be added there, please don't hesitate to open a bug or ping me or someone else on IRC (see below). We pygobject devs will be happy to improve the script.
<pitti> When you just run pygi-convert.sh in your project tree, it will work on all *.py files.
<pitti> If you have other Python code there which is named differently (such as bin/myprogram), you should run it once more with all these file names as argument.
<pitti> === Step 2: Wash, rinse, repeat ===
<pitti> Once the mechanical renamings are out of the way, the tedious and laborious part starts. As Python does not have a concept of "compile-time check" and can't even check that called methods exist or that you pass the right number of parameters, you now have to enter a loop of "start your program", "click around until it breaks", "fix it", "goto 1".
<pitti> The necessary changes here are really hard to generalize, as they highly depend on what your program actually does, and this will also involve the GTK 2 â 3 parts.
<pitti> One thing that comes up a lot are pack_start()/pack_end() calls.
<pitti> In PyGTK they have default values for "expand", "start", and "padding", but as GTK does not have them, you won't have them in PyGI either.
<pitti> There even was a patch once for providing an override for them, but it was rejected as it would cement the API incompatibility.
<pitti> ted as it would cement the API incompatibility.
<pitti> One thing you need to be aware of is that you can't do a migration halfway: If you try to import both "gtk" and "gi.repository.Gtk" hell will break lose and you'll get nothing but program hangs and crashes, as you are trying to work with the same library in two different ways.
<pitti> You can mix static and GI bindings of _different_ libraries, such as using dbus-python and GTI-GI.
<pitti> erm, Gtk-GI, sorry
<pitti> === Step 3: Packaging changes ===
<pitti> After you have your code running with PyGI and committed it to your branch and released it, you need to update the dependencies of your distro package for PyGI.
<pitti> This section will be Debian/Ubuntu specific due to the involved package names, sorry. It is not be fundamentally different on other distros, though.
<pitti> You should grep your code for "gi.repository" and collect a list of all imported typelibs, and then translate them into the appropriate package name.
<pitti> For example, if you import "Gtk, Notify, Gudev" you need to add package dependencies to gir1.2-gtk-3.0, gir1.2-notify-0.7, and gir1.2-gudev-1.0.
<pitti> At the same time you should drop the old static bindings, like python-gtk2, python-notify, etc.
<pitti> Finally you should also bump the version of the python-gobject dependency to (>= 2.28) to ensure that you run with a reasonably bug free PyGI.
<pitti> == RTFM & Links ==
<pitti> I'd like to give a list of useful links for this topic here.
<pitti> This has a good general overview about GI's architecture, annotations, etc:
<pitti>     https://live.gnome.org/GObjectIntrospection
<pitti> The interview with Jon Palmieri and Tomeu Vizoso is also an interesting read about its state:
<pitti>     http://www.gnomejournal.org/article/118/pygtk-gobject-and-gnome-3
<pitti> The GI/PyGI developers hang out on IRC here:
<pitti>     #introspection / #python on irc.gnome.org
<pitti> pygobject's git tree has a very comprehensive demo showing off pretty much all available GTK widgets in PyGI:
<pitti>     http://git.gnome.org/browse/pygobject/tree/demos/gtk-demo
<pitti> Description of the Python overrides for much easier GVariant and GDBus support
<pitti>     http://www.piware.de/2011/01/na-zdravi-pygi/
<pitti> Examples of previously done pygtk â pyGI ports:
<pitti>    Apport: http://bazaar.launchpad.net/~apport-hackers/apport/trunk/revision/1801
<pitti>    Jockey: http://bazaar.launchpad.net/~jockey-hackers/jockey/trunk/revision/679
<pitti>    gtimelog: http://bazaar.launchpad.net/~pitti/gtimelog/pygi/revision/181
<pitti>    system-config-printer (work in progress): http://git.fedorahosted.org/git/?p=system-config-printer.git;a=shortlog;h=refs/heads/pygi
<pitti>    The gtimelog one is interesting because it makes the code work with *both* PyGTK and PyGI, whichever is available.
<pitti> finally, I plan to turn this talk into a proper wiki page below https://live.gnome.org/GObjectIntrospection, so that it's more useful for posterity
<pitti> == Q & A ==
<pitti> Thanks everyone for your attention! I'm happy to answer questions now.
<ClassBot> toabctl asked: why is it git1.2 but girepository-1.0?
<pitti> 1.0 is the ABI version of libgirepository, i. e. the client side library for gjs, pygojbect, etc. to create bindings
<pitti> 1.2 is the binary format version for the .typelibs
<ClassBot> toabctl asked: what about structs like eg GDate/GDateTime?
<pitti> these actually do get exported
<pitti> have a look at /usr/share/gir-1.0/GLib-2.0.gir
<pitti>     <record name="DateTime" c:type="GDateTime" ...
<pitti>     <record name="Date" c:type="GDate">
<pitti>       <field name="julian_days" writable="1" bits="32">
<pitti>         <type name="guint" c:type="guint"/>
<pitti>       </field>
<pitti> etc.
<pitti> so as long as they are relatively simple, they do work
<ClassBot> JanC asked: does GI support named parameters & default values, so that in Python method/function calls we can leave some parameters out?
<pitti> not right now
<pitti> I hear that there is a plan to support default values which are specified in the C code/annotations themselves
<pitti> but otherwise you'll need an override for cases where it makes sens
<pitti> e
<ClassBot> rr0hit asked: the hello world example in pygi gives me error: TypeError: __init__() takes at most 5 arguments (6 given) . What am I doing wrong
<pitti> rr0hit: I suppose you are using Ubuntu 10.10?
<pitti> as I said above, I'm afraid this is all pretty new, and you need 11.04 beta
<ClassBot> crazedpsyc asked: why did pygtk not work out well? wxpython seems just fine, and it is a C wrapper as well.
<pitti> well, it did work well for years
<pitti> but as I said, someone would need to maintain it, and port it to GTK3, and keep that up to date, etc.
<pitti> and provide missing bindings for all other GNOMEish libraries (which were often missing)
<ClassBot> chadadavis asked: If other distros are not using the latest GI yet, is Ubuntu planning to maintain their own GI-ported version of all these apps?
<pitti> no, that would be quite crazy
<ClassBot> There are 10 minutes remaining in the current session.
<pitti> so far we just ported a lot of our Ubuntu specific stuff
<pitti> and I ported gtimelog, but proposed that upstream first
<pitti> so likewise, if we port upstream software, we do that upstream
<pitti> e. g. GNOME will certainly appreciate these patches, it's a GNOME goal to port their pygtk stack, etc.
<pitti> not sure if that answered chadadavis question?
<ClassBot> toabctl asked: how can i create a instance of GDate/GDatetime with python? and how to map these types to the python types(datetime.date/datetime.datetime) ?
<pitti> $ python -c 'from gi.repository import GLib; GLib.Date()'
<pitti> etc.
<pitti> (not really tested much)
<pitti> but that's the idea
<pitti> note that structs have always been a bit fiddly, as often GI doesn't have enough type information about members
<pitti> so this only works for simple structs
<pitti> the more complex ones should be turned into proper GObjects (that was necessary and done in GTK3 in some cases)
<pitti> the most common case is probably the Events struct, which works good enough
<ClassBot> zinga60 asked: can I use Python introspection like dir() for the dynamically created modules?
<pitti> not right now, I'm afraid
<pitti> it is possible in principle, the typelib has all necessary information
<pitti> but it doesn't work right now
<ClassBot> zinga60 asked: so as a beginner with gtk, etc. (without the need of porting from pygtk to pygi) I should use the official C API docs (to look up function signatures, etc.) and the gir-xml files to see the corresponding Python name spaces?
<pitti> usually the C API docs (libgtk-3-doc etc.) should suffice
<pitti> with the appropriate transformation rules that I mentioned above
<ClassBot> There are 5 minutes remaining in the current session.
<pitti> so usually you should be able to easily derive the according Python call
<pitti> if not, you can look in the gir, but I seldomly found that necessary myself
<pitti> out of questions :)
<pitti> so, thanks everyone!
<pitti> I hang out in #ubuntu-desktop, #ubuntu-devel, and also #python/#introspection on the GNOME IRC, so feel free to ask me there later
<pitti> dpm: clearing the floor then
<pitti> for manish_
<dpm> thanks a lot for a great session pitti!
<dpm> excellent participation as well
<dpm> Next up are m4n1sh (or m4n1sh_) and seiflotfy from the Zeitgeist project, who are going to talk about integrating Zeitgeist to your application
* 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 API & Zeigeist Application Integration - Instructors: m4n1sh, seiflofty
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<m4n1sh> Hello everyone
<m4n1sh> My name is Manish Sinha
<m4n1sh> and seiflotfy is Seif Lotfy
<m4n1sh> we both work in Zeitgeist team
<m4n1sh> I am just giving a small introduction
<m4n1sh> Seif is the founder of Zeitgeist
<m4n1sh> and I work on integration and some engine work
<m4n1sh> Let us start seiflotfy :)
<m4n1sh> first a basic introduction
<m4n1sh> Zeitgeist is an event logger
<m4n1sh> which logs the events which happens on your computer
<m4n1sh> events can be opening files
<m4n1sh> closing files
<m4n1sh> creating files
<m4n1sh> connecting to internet
<m4n1sh> receiving a call
<m4n1sh> all the event logging doesnt happen automagically
* 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 API & Zeigeist Application Integration - Instructors: m4n1sh, seiflofty, manish
<m4n1sh> zeitgeist is a daemon running on your computer
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<m4n1sh> whose work is to get events
<m4n1sh> means log them
<m4n1sh> when some application sends the data to it
<m4n1sh> and applications can also query events from the daemon
<m4n1sh> it is like a event store
<m4n1sh> when we talk about integration, we mean creating small plugins/extensions/addons/addins which sends the relevant events to the daemon
<m4n1sh> so basically it is the plugins which push data
<m4n1sh> all the plugins which push events are called dataproviders
<m4n1sh> their work is to only push data
<m4n1sh> like whenever you open a note, a tomboy extension tells zeitgeist that the user opened the note
<m4n1sh> this extension is called an Event
<m4n1sh> the most important part of Zeitgeist is called an event
<m4n1sh> event is a packet of information which tells the daemon of "What happened"
<m4n1sh> take the literal meaning of event
<m4n1sh> each event instance has metadata contained with it
<m4n1sh> like timestamp
<m4n1sh> what happened
<m4n1sh> how it happened
<m4n1sh> any payload
<m4n1sh> which application was involved in the event etc
<m4n1sh> zeitgeist runs as a daemon and exposes an API via DBus
<m4n1sh> DBus is an interprocess communication software
<m4n1sh> it helps applications talk to each other
<m4n1sh> to inspect the zeitgeist API
<m4n1sh> you can install d-feet from the repositories
<m4n1sh> and open it
<m4n1sh> and search for zeitgeist
<m4n1sh> you will get something like this
<m4n1sh> http://i.imgur.com/DKx0G.png
<m4n1sh> the zeitgeist API looks like this
<m4n1sh> http://zeitgeist-project.com/docs/0.5.2/dbus_api.html#org-gnome-zeitgeist-log
<m4n1sh> let us start with the basic building block of zeitgeist
<m4n1sh> an Event
<m4n1sh> how event looks like is given here
<m4n1sh> http://zeitgeist-project.com/docs/0.6/dbus_api.html#index-0
<m4n1sh> the first thing is an event Id
<m4n1sh> which recognizes it uniquely
<m4n1sh> 2nd is Timestamp telling when it happened
<m4n1sh> 3rd is interpretation
<m4n1sh> which means
<m4n1sh> âwhat happenedâ
<m4n1sh> 4th is Manifestation
<m4n1sh> which means
<m4n1sh> âhow did this happenâ
<m4n1sh> then we have an actor which looks like application://tomboy.desktop
<m4n1sh> which tells which application was involved in the event
<m4n1sh> this is the metadata for an event
<m4n1sh> each event can then contain something called as Subject
<m4n1sh> each event can have more than one subject
<m4n1sh> now we should go to what is subject contained of
<m4n1sh> URI which is something like file:///tmp/my.txt
<m4n1sh> Interpretation - the abstract notion of what the subject
<m4n1sh> Manifestation - the abstract notion of how the subject is stored or available
<m4n1sh> like the subject is stored as a File
<m4n1sh> Origin - the URI where the user accessed the subject from
<m4n1sh> Mimetype
<m4n1sh> which is something like text/plain
<m4n1sh> image/png
<m4n1sh> Text - a descriptive explanation
<m4n1sh> Storage - how it is stored
<m4n1sh> I know all these were a bit boring, but it is important for a developer to understand what an event actually is
<m4n1sh> to access Zeitgeist API
<m4n1sh> you have Python bindings
<m4n1sh> C/Vala bindings
<m4n1sh> C# bindings
<m4n1sh> so you can choose your language
<m4n1sh> if you are working on a application which needs zeitgeist integration and it is coded in Python then you can use the python binding of zeitgeist
<m4n1sh> you lets move to the API
<m4n1sh> this is the API
<m4n1sh> http://zeitgeist-project.com/docs/0.5.2/dbus_api.html#org-gnome-zeitgeist-log
<m4n1sh> lets not go so deep in the API
<m4n1sh> only a few methods
<m4n1sh> like InsertEvents
<m4n1sh> which inserts events in the daemon
<m4n1sh> GetEvents - which gets events from the  daemon when you specify the event ids
<m4n1sh> And 3rd
<m4n1sh> FindEventIds - you can search for events
<m4n1sh> and get back the event Ids
<m4n1sh> FindEvents - you can search for events, and get the actual events instead of just the ID
<m4n1sh> when searching for an event you use the event template
<m4n1sh> it is like a pattern
<m4n1sh> the best part is that event template are events themselves
<m4n1sh> they are represented the same way
<m4n1sh> let me take you people to an example which will clear all the doubts
<m4n1sh> we will take a working example
<m4n1sh> our example uses python API
<m4n1sh> git.gnome.org/browse/rhythmbox/tree/plugins/rbzeitgeist/rbzeitgeist/__init__.py
<m4n1sh> please open this file
<m4n1sh> now I am teaching how to push events
<m4n1sh> not pulling
<m4n1sh> check line 36 and 37 of the link I have
<m4n1sh> *gave
<m4n1sh> from zeitgeist.client import ZeitgeistClient
<m4n1sh> from zeitgeist.datamodel import Event, Subject, Interpretation, Manifestation
<m4n1sh> we imported Evebt, Subject, Manifestation and Interpretation
<m4n1sh> now we have to determine the Interpretation for Event and Subject
<m4n1sh> similarly Manifestation for Event and Subject
<m4n1sh> Event Interpretation is either LEAVE_EVENT or ACCESS_EVENT
<m4n1sh> which means "what happened"
<m4n1sh> ACCESS_EVENT means that the track started
<m4n1sh> we are at the start of the event
<m4n1sh> means we started playing the track
<m4n1sh> LEAVE_EVENT means we left the track
<m4n1sh> means track finished
<m4n1sh> Event Manifestation: USER_ACTIVITY/SCHEDULED_ACTIVITY : 120/122 - "how did this happen"
<m4n1sh> How did it happen?
<m4n1sh> It happened via User Activity or Scheduled Activity
<m4n1sh> UserActivity means that the user himself pressed Next track
<m4n1sh> Scheduled means the next track in the queue started itself
<m4n1sh> check line 120  and 122
<m4n1sh> the list of interprerations is here http://zeitgeist-project.com/docs/0.6/ontology.html#symbol-interpretation
<m4n1sh> and list of Manifestation http://zeitgeist-project.com/docs/0.6/ontology.html#symbol-manifestation
<m4n1sh> please choose one from these list
<m4n1sh> next is Subject Interpration
<m4n1sh> Subject Interpretation: AUDIO : 135 - "what is this"
<m4n1sh> check line 135
<m4n1sh> What is this? It is Audio :)
<ClassBot> akshatj asked: Are there guides available on how to write a dataprovider or plugin?
<m4n1sh> akshatj: there are definitive guide. This session is meant for that :)
<m4n1sh> next is Subject Manifestation
<m4n1sh> check line 62
<m4n1sh> Manifestion for subject asks
<m4n1sh> "how does this item exist"
<m4n1sh> it exists as FILE_DATA_OBJECT
<m4n1sh> all these values are from the list of Manifestation
<m4n1sh> I will give you people one more example to study yourself
<m4n1sh> It is EOG Plugin
<m4n1sh> the file is
<m4n1sh> http://bazaar.launchpad.net/~zeitgeist-dataproviders/zeitgeist-dataproviders/trunk/view/head:/eog/zeitgeist_plugin.py
<m4n1sh> Hints are
<m4n1sh> Event Interpretation: MODIFY_EVENT/LEAVE_EVENT : 69/87 - "what happened"
<m4n1sh> Event Manifestation: USER_ACTIVITY : 70/88 - "how did this happen"
<m4n1sh> Subject Interpretation: IMAGE : 61 - "what is this"
<m4n1sh> Subject Manifestation: FILE_DATA_OBJECT : 62 - "how does this item exist"
<m4n1sh> Keep the questions coming people
<m4n1sh> More examples
<m4n1sh> Tomboy:
<m4n1sh> http://bazaar.launchpad.net/~zeitgeist-dataproviders/zeitgeist-dataproviders/trunk/files/head:/tomboy/
<m4n1sh> Banshee: https://gitorious.org/banshee-community-extensions/banshee-community-extensions/blobs/master/src/ZeitgeistDataprovider/Banshee.ZeitgeistDataprovider/ZeitgeistDataprovider.cs
<m4n1sh> I would also like to defuse a few myths
<m4n1sh> Zeitgeist is not a file search engine
<m4n1sh> it does not track files
<m4n1sh> there can be events for zeitgeist which might not need a file
<m4n1sh> like you got disconnected from internet
<m4n1sh> or you recieved a call
<m4n1sh> I would like to recieve some feedback from you people before I advance to next part of the session
<m4n1sh> you can keep them coming on -chat channel
<m4n1sh> moving to next part
<m4n1sh> we have to search for events
<m4n1sh> for searching for events
<m4n1sh> we can look at the method
<m4n1sh> FindEvents
<m4n1sh> it contains
<ClassBot> murphy asked: Can you please give an example of some context sensitive situation Zeitgeist helps with?
<m4n1sh> murphy: as seiflotfy gave you the link on -chat
<m4n1sh> http://www.youtube.com/watch?v=U6YOvVaRWh4
<m4n1sh> this is an example
<m4n1sh> it contains
<m4n1sh> time_range
<m4n1sh> which tells you the range of time when you want to search
<m4n1sh> like you want to search for events only between today and 3 days back
<m4n1sh> event_templates
<m4n1sh> you can create event instances and pass it
<m4n1sh> the daemon will compare these templates to the stored events
<m4n1sh> and provide you with the results
<m4n1sh> storage_state
<m4n1sh> it is
<m4n1sh> Enumeration class defining the possible values for the storage state of an event subject.
<m4n1sh> http://zeitgeist-project.com/docs/0.5.2/datamodel.html#zeitgeist.datamodel.StorageState
<m4n1sh> contains 3 values
<m4n1sh> StorageState.NotAvailable
<m4n1sh> The storage medium of the events subjects must not be available to the user. (Integer value: 0)
<m4n1sh> StorageState.Available
<m4n1sh> The storage medium of all event subjects must be immediately available to the user. (Integer value: 1)
<m4n1sh> StorageState.Any
<m4n1sh> The event subjects may or may not be available. (Integer value: 2)
<m4n1sh> then we have
<m4n1sh> num_events
<m4n1sh> maximal amount of returned events
<m4n1sh> last one is
<m4n1sh> order
<m4n1sh> which asks in which order the results have to be returned
<m4n1sh> result type is an enumration
<m4n1sh> http://zeitgeist-project.com/docs/0.5.2/datamodel.html#zeitgeist.datamodel.ResultType
<m4n1sh> it has many values
<m4n1sh> have a look
<m4n1sh> this contains the full list of events
<m4n1sh> http://zeitgeist-project.com/docs/0.5.2/dbus_api.html#org-gnome-zeitgeist-log
<m4n1sh> now we have an example of how we can pull the events
<m4n1sh> we have a gedit plugin
<m4n1sh> here
<m4n1sh> http://paste.ubuntu.com/593228/
<m4n1sh> written by seiflotfy and others
<m4n1sh> seiflotfy: can you explain this
<seiflotfy> sure
<seiflotfy> so
<seiflotfy> template = Event()
<seiflotfy>         template.actor = "application://gedit.desktop"
<seiflotfy> here you can see an Event being created
<seiflotfy> and the actor of the event is being set to "gedit"
<seiflotfy> we then ask Zeitgeist for
<seiflotfy> "Get me most used files with gedit"
<seiflotfy> this will look like this
<seiflotfy>             CLIENT.find_events_for_templates([template], handle_most, num_events = 100, result_type = ResultType.MostUsed)
<seiflotfy> where handle_most is a method for the callback
<seiflotfy> and then you get the "most used" files with gedit
* 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 API & Zeigeist Application Integration - Instructors: m4n1sh, seiflofty, manish, seiflotfy
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<seiflotfy> the whole code can be found http://paste.ubuntu.com/593238/
<m4n1sh> if you people want a documentation of zeitgeist for mono/C# it can be found here
<m4n1sh> http://launchpad.net/zeitgeist-sharp/0.1/0.1.0.1/+download/zeitgeist-sharp-0.1-api-doc.tar.gz
<m4n1sh> and for C/Vala library
<m4n1sh> documentation is here http://people.canonical.com/~kamstrup/projects/libzeitgeist/doc
<ClassBot> akshatj asked: So, dataprovider is used for pushing data to zg and plugin is used for pulling from it?
<m4n1sh> akshatj: dataprovider is out term for those plugins which only push events to the daemon
<m4n1sh> they dont pull
<m4n1sh> dataproviders are a subset of plugins
<m4n1sh> we have many dataproviders already
<m4n1sh> they are hosted here
<m4n1sh> https://launchpad.net/zeitgeist-dataproviders
<m4n1sh> you can see the list here
<m4n1sh> http://bazaar.launchpad.net/~libzeitgeist-developers/libzeitgeist/trunk/files
<m4n1sh> sorry
<m4n1sh> wrong link
<m4n1sh> http://bazaar.launchpad.net/~zeitgeist-dataproviders/zeitgeist-dataproviders/trunk/files
<m4n1sh> like
<m4n1sh> bzr, chrome, emacs, eog, firefox, chrome, geany, gedit, rhythmbox, telepathy, tomboy
<m4n1sh> vim xchat
<m4n1sh> banshee
<m4n1sh> banshee is upstream
<m4n1sh> not in this repo
<m4n1sh> we need more dataproviders
<m4n1sh> to make more sensible logging
<m4n1sh> or say more detailed logging
<m4n1sh> then we can have plugins which pull information
<m4n1sh> example.. I can show a snapshot
<m4n1sh> of how gedit source code you checked actually looks like
<m4n1sh> http://wiki.zeitgeist-project.com/images/2/2b/GEditOpenZeitgeist.png
<m4n1sh> if you use synapse
<m4n1sh> it shows results from zeitgeist
<m4n1sh> it asks zeitgeist for info
<m4n1sh> <psusi> asked : this may be a silly question but, what is the purpose of zietguiest, and how is it different than syslog?
<m4n1sh> syslog logs system events
<m4n1sh> it does not log that you opened a file
<m4n1sh> syslog contains things like
<m4n1sh> Apr 12 23:17:01 Foo CRON[4852]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
<m4n1sh> how much sense did it make to you :)
<m4n1sh> it stores info in unstructured format
<m4n1sh> does not have any dedicated API (as far as I know)
<m4n1sh> so what all you can do via Zeitgeist
<m4n1sh> you can have a complete list
<m4n1sh> of which file you opened when, closed when, saved when
<m4n1sh> started from when it was created
<m4n1sh> you can  have a list of all the calls you recieved via empathy
<m4n1sh> when you recieved, when you dropped
<m4n1sh> when you got a call
<m4n1sh> the whole list
<m4n1sh> we people are still working in that area
<m4n1sh> we have telepathy  work in progress
<m4n1sh> we need to integrate it even more
<m4n1sh> you can even list down all recent used files
<m4n1sh> sort them based on
<m4n1sh> 1) Application
<m4n1sh> 2) Which all were related to file creation
<m4n1sh> 3) Time Range
<m4n1sh> etc etc
<m4n1sh> <psusi> Windows has a logging facility that was originally an attempt to store more structured log data that could be better parsed.  Is that about the same idea here?  So the idea is to replace .xsession-errors with a more structured log system?
<m4n1sh> psusi asked this question
<m4n1sh> I don't remember if windows had such a thing
<m4n1sh> I think it is there somewhere in Control Panel
<m4n1sh> I dont think anyone uses it
<m4n1sh> it is about Logs
<m4n1sh> same like we have in Linux
<m4n1sh> syslog, messages, kern.log etc
<m4n1sh> but zeitgeist is meant not only for storing data
<ClassBot> There are 10 minutes remaining in the current session.
<m4n1sh> but having a nice API such that any application can get back the data
<m4n1sh> Zeitgeist is a thing under development
<m4n1sh> and its development is very fast
<m4n1sh> we all are learning a lot
<m4n1sh> so if you want to learn a lot, you can come to our channel #zeitgeist
<m4n1sh> try out some examples
<m4n1sh> and get your hands dirty
<m4n1sh> I am always there after 16UTC on that channel by this same nick
<ClassBot> murphy asked: So if I copied a file to a server using nautilus I would be able to discover which server and what I copied a few days later (assuming nautilus informed zg)? Stuff for which there is usually no log... What about bash?
<m4n1sh> murphy: sadly bash events are not logged now
<m4n1sh> since we use GtkRecentManager for logging where plugins are not available
<m4n1sh> it is fallback logging
<m4n1sh> AFAIK bash doesnt inform GtkRecentManager
<m4n1sh> so it is not logged
<m4n1sh> we need a dataprovider for bash too
<m4n1sh> wrt nautilus
<m4n1sh> the source file is surely logged
<m4n1sh> nautilus does inform zeitgeist
<m4n1sh> using GtkRecentManager
<m4n1sh> and it gets logged to zeitgeist
<m4n1sh> you can come to know about it
<m4n1sh> wrt to "which server" depends on the URI
<m4n1sh> which is stored
<ClassBot> zinga60 asked: how does the zeitgeist daemon store the events? in some db I guess? is it going to be more slow with more and more data providers and the longer the daemon runs (over months/years)?
<m4n1sh> zinga60: events are stored in sqlite database in ~/.local/share/zeitgeist/activity.sqlite
<m4n1sh> please dont try to open it maually
<m4n1sh> it is locked by the daemon
<m4n1sh> it *might* become slow and slow as millions of events fill up
<m4n1sh> but it will take lot of time
<m4n1sh> dataproviders dont make it slow
<ClassBot> There are 5 minutes remaining in the current session.
<m4n1sh> as dataproviders run with the application
<m4n1sh> daemon can run for months and years
<m4n1sh> it is perfectly fine for it to work for long time
<m4n1sh> it doesnt leak memory
<m4n1sh> if it leaks memory, please inform us on #zeitgeist
<m4n1sh> <psusi> yea, sounds like what MS originally intended the windows logging service to be, but it never really caught on and so nobody uses it today... only they had it apply to both system logging and user application logging.  Zeitgeist has no intention of handling syslog events as well?  Only desktop events?  Or will there be a version on the system dbus as well as the session?
<m4n1sh> we handle mostly desktop events
<m4n1sh> which helps the *user*
<m4n1sh> our area of focus is desktop events
<seiflotfy> depends what apps push into it
<m4n1sh> even though zeitgeist can log any event
<m4n1sh> even system events
<seiflotfy> exactly
<m4n1sh> a user doesnt care much about  system events
<seiflotfy> ubuntu one uses zeitgeist to log sync events
<m4n1sh> :)
<m4n1sh> closing time
<m4n1sh> please join us at #zeitgeist channel
<m4n1sh> we are happy to mentor  anyone who wants to work with us
<m4n1sh> zeitgeist team is an extremely rocking and close-knit team
<m4n1sh> if you join us, you will really enjoy
<m4n1sh> take my word :)
<seiflotfy> we have a list of things we need to get done
<seiflotfy> so feel free to join
<m4n1sh> <psusi> so there is no instance running on the system wide dbus?
<m4n1sh> zeitgeist runs as SessionBus which is user based
<m4n1sh> instead of SystemBus which is system wide
<m4n1sh> makes sense to run on per user basis
<m4n1sh> we have many many more things to do
<m4n1sh> lots of applications needs to be touched
<m4n1sh> we have a rush of adrenalin whenever we get something done :)
<m4n1sh> just for info.. if anyone of you know django we have a good work for you :)
<m4n1sh> feel free to poke me
<m4n1sh> esp if you know django-piston then you can start contributing to us very easily
* 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: GStreamer+Python: Multimedia Swiss Army Machete - Instructors: jderose
<dpm> thanks seiflotfy and m4n1sh for a great session! Next up: jderose will tell us all about using python and gstreamer in many interesting ways :)
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<m4n1sh> Thanks everyone
<jderose> okay, should i start?
<nigelb> yes :)
<jderose> Hi everyone, hope you're having a great Ubuntu App Developer Week so far!
<jderose> Okay, lets get started...
<jderose> I have a short prepared intro to get you pumped up about GStreamer + Python.
<jderose> Then we'll spend rest of the hour getting our hands dirty with real code, and I'll do my best to answer all of your questions.
<jderose> During the intro, why don't you make sure the packages needed for the code examples are installed:
<jderose> sudo apt-get install gstreamer0.10-tools python-gst0.10 gstreamer0.10-plugins-good
<jderose> Aside from `gstreamer0.10-tools`, you probably already have the rest installed, but it's good to make sure we're on the same page package-wise.
<jderose> I'm running Natty, but the examples should work fine under Maverick and Lucid too, and even older release.
<jderose> == INTRO ==
<jderose> First, I'm going to share why I think GStreamer is *the* multimedia framework, is going to totally dominate in *everything* from simple playback to big production video editing.
<jderose> I hope you're a bit surprised as to why I think this, because it's exciting, and I want to get you exited!
<jderose> If I don't surprise you, then I assume you're already as excited as I am :)
<jderose> Second, I'm going to share why I think Python is *the* language for building GStreamer apps, and correct some misconceptions I frequently hear about Python threading and GStreamer.
<jderose> -- Why GStreamer? --
<jderose> Ah, I should introduce myself.  My name is Jason Gerard DeRose, and I started writing pygst apps 7 years ago, back when gstreamer0.8 was the hot newness.
<jderose> So I have a longtime love affair with GStreamer.
<jderose> But recently I had to pick the multimedia framework for Novacut, my distributed (ala bzr/git/hg) video editor project.
<jderose> Novacut isn't just a project, it's a startup, so I needed to pick something that makes good longterm strategic sense.
<jderose> GStreamer was my gut feeling, but I played devils advocate with myself and looked at a number of other options.
<jderose> I looked most seriously at Media Lovin' Toolkit (MLT), as Jonathan Thomas originally was using GStreamer + Gnonlin for OpenShot, and then switched to MLT out of frustration.
<jderose> I believe Jonathan pointed out some legitimate weaknesses in Gnonlin, and the OpenShot development pace has been impressively quick, so you can't argue with that.
<jderose> However, I still chose GStreamer without hesitation.  Why?
 * jderose makes "drumroll" sounds...
<jderose> * GStreamer is on the Kindle
<jderose> * GStreamer is on the Nokia N900
<jderose> * GStreamer is on webos phones and tablets
<jderose> * GStreamer is what's getting attention from those wonderful Linaro folks
<jderose> * GStreamer is on every Ubuntu desktop, along with most other desktop Linux distros
<jderose> In short, I choose GStreamer because of it's economy of scale.
<jderose> GStreamer is already running on everything from small to medium, and although running it at industrial scale (big) might not be that common right now... it's inevitable.
<jderose> And doesn't that sound strikingly similar to something?
<jderose> It does to me: the Linux kernel, running on everything from smart phones to supercomputers, everything from consumer grade to pro grade.
<jderose> Once you reach that economy of scale, you're pretty unbeatable.  And I believe that over the past several years GStreamer has reached that tipping point.
<jderose> Nonlinear editing is easily exercising 90% of the same code paths as playback.
<jderose> And from a business perspective, I'd choose something where I knew that 90% would be getting serious investment across the industry...
<jderose> even if the other 10% might currently have some shortcomings compared to other options.
<jderose> I believe Edward Hervey has built an excellent foundation in Gnonlin.  It just needs more developers, more apps uses it, more users abusing it.
<jderose> -- Why Python? --
<jderose> Why not? GStreamer gives you a lot of power, you can build arbitrarily complex pipelines.
<jderose> And that's exactly the place when a simple, clear language like Python is perfect.
<jderose> You want to be able to iterate quite, and write tons of tests without a lot of friction.
<jderose> Now if you want to write new GStreamer plugins (say some new video filter), those should of course be written in C.
<jderose> But the job of assembling a GStreamer Pipeline can get surprisingly complex, and that's a great place for Python.
<jderose> Q: But wont Python make my GStreamer application slow because Python only allows on thread to run at once because of the Global Interpreter Lock (GIL)?
<jderose> A: No :)
<jderose> The Python GIL means only one thread at a time can *manipulate Python state*.
<jderose> But an arbitrary number of threads can run at once assuming those threads are't manipulating Python state (aka pretty much everything GStreamer does).
<jderose> So repeat after me:
<jderose> "Python wont make my GStreamer application slow, because after I assemble and start the pipeline, Python just sits there waiting for signals from GStreamer, and GStreamer with exactly the same performance it would have it the pipeline were assembled and started in C!"
<jderose> :)
<jderose> == LEARNING BY DOING ==
<jderose> okay, is everyone ready to play with some code?
<jderose> anyone needs a moment to catch up, at any point, please say so in #ubuntu-classroom-chat, which is also where you ask questions
<jderose> QUESTION: So, that's because the threads are just running code from an external lib, then, rather then Python code?
<jderose> chadadavis: basically, yes.
<jderose> gstreamer can/will create quite a few different threads, say for video playback
<jderose> and unless you wrote gstreamer plugins in python (which is possible, and handy for prototyping)
<jderose> python wont actually be doing anything in any of those threads
<jderose> python will just be sitting idle waiting for events from gstreamer
<jderose> the normal way to use gstreamer is all asyncronous
<jderose> okay, do doing stuff with multimedia, you always need a test video to work with:
<jderose> http://cdn.novacut.com/jorge.ogv
<jderose> :)
<jderose> everyone go ahead and grab the example code here:
<jderose> bzr branch lp:~jderose/+junk/machete
<jderose> or you can browse it here - http://bazaar.launchpad.net/~jderose/+junk/machete/files
<jderose> i didn't quite have time to get all the minimal python examples together i wanted, so i'm ganna wing it a bit, but thats okay :)
<jderose> gstreamer is a graph based pipeline, very genric at it's core
<jderose> the `gst-launch-0.10` command is very handy for quickly testing a pipeline, so lets look at ex1-audio-flac.sh - http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex1-audio-flac.sh
<jderose> i know, not python yet, but this is a good way to see what gstreamer is going conceptually :)
<jderose> so the first element in this pipeline is `filesrc`... which reads from a file, in this case "jorge.ogv"
<jderose> the next element is `oggdemux`... ogg is a containing that can contain many different types of data inside: theroa video, vp8 video, vorbis audio, flac audio, etc
<jderose> so a demuxer will take a container as split out individual elementary streams
<jderose> in this example, were just going to split out the vorbis audio, transcode to flac
<jderose> now gst-launch has some magic it dose behind the scences, so it's a bit more complex from python, where you're doing everything very explicity
<jderose> now, let me introduce you to handy cool you'll use all the time if you do much with gstreamer
<jderose> in a terminal, run:
<jderose> gst-inspect-0.10 vorbisdec
<jderose> sudo apt-get install gstreamer0.10-tools
<jderose> you might have to install that ^^^
<jderose> that work for everyone?
<jderose> if you scroll up in the output, you'll see something like this:
<jderose>   SINK template: 'sink'
<jderose>     Availability: Always
<jderose>     Capabilities:
<jderose>       audio/x-vorbis
<jderose> vorbisdec can receive 'audio/x-vorbis', only
<jderose> gstreamer has "caps" (capabilities) that describe what an element can consume (at its src pads), and what an element can produce (at its sink pads)
<jderose> so when you assemble and start a pipeline, the elements do some pretty amazing dynamic negotiation
<jderose> okay, back to example - http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex1-audio-flac.sh
<jderose> the `audiorate` rate element will duplicate or drop samples in order to make the buffer timestamps match whatever the global clock of the pipeline is
<jderose> it can also correct badly constructed files, or deal with issues where on formats idea of time is different than anothers
<jderose> this stuff gets trick to make work all the time because so many of the media files in the wild are often slightly broken, don't comply with a spec totally
<jderose> `audioconvert`, okay, now we go back to gst-inspect-0.10
<jderose> gst-inspect-0.10 vorbisdec
<jderose>   SRC template: 'src'
<jderose>     Availability: Always
<jderose>     Capabilities:
<jderose>       audio/x-raw-float
<jderose>                    rate: [ 1, 2147483647 ]
<jderose>                channels: [ 1, 256 ]
<jderose>              endianness: 1234
<jderose>                   width: 32
<jderose> gst-inspect-0.10 flacenc
<jderose>   SINK template: 'sink'
<jderose>     Availability: Always
<jderose>     Capabilities:
<jderose>       audio/x-raw-int
<jderose>              endianness: 1234
<jderose>                  signed: true
<jderose>                   width: 8
<jderose>                   depth: 8
<jderose>                    rate: [ 1, 655350 ]
<jderose>                channels: [ 1, 8 ]
<jderose> so vorbisdec produces audio/x-raw-float, but flacenc consumes audio/x-raw-int
<jderose> you might try removing the `audioconvert` from that pipeline, and you'll see that things wont work
<jderose> so audioconvert sees that on one side there is audio/x-raw-flow, the other audio/x-raw-int, and it converts between the two
<jderose> make sense?
<jderose> http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py
<jderose> i didn't have time to trim this down, but here we go
<jderose> http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py#L236
<jderose> look at the AudioTranscoder class
<jderose> this is a common pattern in pygst
<jderose> there is a step you need, like trancoding audio, and you want it to me reusuable
<jderose> so you but the only process into a gst.Bin, and use that element abstractly
<jderose> very handy
<jderose> gst.element_factory_make('queue')
<jderose> this deserves special mention
<jderose> when you have something like a jorge.ogv, which has audio and video, you need to use queues like this:
<jderose> audio side: demux => inq => dec => enc => outq => mux
<jderose> video side: audio side: demux => inq => dec => enc => outq => mux
<jderose> this is because the audio and video are interleaved in the container, and if you don't do this, things will just hang because there wont be exactly enough to keep all the consumers happy
<jderose> -- Getting Signals/Events from pygst --
<jderose> http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py#L308
<jderose> chadadavis: QUESTION: So, a queue can be a mux or a demux, How does it know what's what?
<jderose> will, a queue itself is neither, a queue is a type of gstreamer element
<jderose> gst-inspect-0.10 queue
<jderose> a queue just means that buffers can be added before the last was consumed
<jderose> most of the gstreamer elements are 1-to-1: consume a buffer, do stuff, produce a buffer
<jderose> self.bus = self.pipeline.get_bus()
<jderose> you get messages from pygst using a "bus"
<jderose> this is quite nice because it takes care of a threading issue that can be a pain...
<jderose> messages from the bus are only emitted in the main thread
<jderose> so your UI code can always safely manipulate the UI state based on the signal
<jderose> self.bus.connect('message::eos', self.on_eos)
<jderose> this signal is fired when the pipeline has completed, when say an entire file has been transcoded, rendered, played back, etc
<jderose> self.bus.connect('message::error', self.on_error)
<jderose> and this one when gstreamer encounters an error.... any time you build a pipeline, you'll probably have those two signals
<jderose> at least those two, that is
<jderose> http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py#L331
<jderose> a Pipeline is sort of the main containing for all the gstreamer elements you chain together
<ClassBot> There are 10 minutes remaining in the current session.
<jderose> so any element that is linked into the chain *must* be in the pipeline
<jderose> murphy: QUESTION: what about progress events?
<jderose> good question :)
<jderose> so gstreamer doesn't have intrinsic progress events
<jderose> so what you do is great a gobject timeout that fires every 1 second or whatever
<jderose> and then you query gstreamer to figure out where it is the the pipeline
<jderose> you would to this for a seek bar for audio/video playback
<jderose> or to get progress for transcoding
<jderose> http://bazaar.launchpad.net/~jderose/+junk/machete/view/head:/ex2-transcode.py#L348
<jderose> i know the times about up, but i want to talk about states a bit
<jderose> gst.STATE_NULL - no resources have been alocated at all
<jderose> gst.STATE_READY - plugins are ready, but they haven't actually touched any data, allocated buffers
<jderose> gst.STATE_PAUSED - the first buffers have been consumed, pipeline is negotiated
<ClassBot> There are 5 minutes remaining in the current session.
<jderose> gst.STATE_PLAYING - the loop is running, all the elements are consuming, producing, doing their thing
<jderose> so to query the pipeline at all, it must be in at least gst.STATE_PAUSED
<jderose> well, that's about time
<jderose> sorry if this was a bit rough - this is my first time doing a session like this :)
<jderose> i'm going to continue to work on that example repo, make it more useful
<jderose> so thanks everyone, and enjoy all the rest of the sessions! :)
* 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: KDE Development Intro: Q+A - Instructors: apachelogger
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<dpm> hey everyone, we're up for a slight change of schedule on the next session
<dpm> First of all a big applause to jderose for a great session
<dpm> Originally we scheduled a talk on writing KDE applications with KdeAppTemplate
<dpm> but the speaker could not make it this time
<dpm> however...
<dpm> fear not, we've got some cool KDE topics as a replacement for you
<dpm> Please welcome apachelogger and Riddell, who are going to do a quick intro and Q+A session on how to get started with KDE development
<dpm> All yours apachelogger and Riddell!
<apachelogger> thank you dpm
<apachelogger> hi everyone
<dpm> (And everyone, line up your questions on #ubuntu-classroom-chat!)
<apachelogger> so, this session is highly dependent on your questions, the more you ask the better :)
<apachelogger> One of the best resources for KDE development related topics is the KDE techbase
<apachelogger> http://techbase.kde.org/
<apachelogger> you can find just about anything there
<ClassBot> dpm asked: which tools do you recommend for getting started developing KDE applications?
<apachelogger> It really depends on what you personally prefer. If you like IDEs there are 2 KDE (and Qt) centric ones. Namely KDevelop and QtCreator.
<apachelogger> They are both very powerful and easy to use.
<apachelogger> Of course you can also use any editor and command line tools :)
<ClassBot> bulldog98_konv asked: whom to poke to get help?
<apachelogger> No one :P
<apachelogger> Usually it is best to just go to #kde-devel and ask your question
<Riddell> kate is great for development without being filled with options
<apachelogger> Most of the time someone will be around to answer it.
<Riddell> the kde-devel mailing list is also good for questions
<apachelogger> If that fails there is also a mailing list kde-devel@kde.org :)
<Riddell> if you already have some code then reviewboard.kde.org is the place to post it to get feedback
<ClassBot> styx_ asked: Which language is recommended? Can i use java?
<apachelogger> Good question indeed. As with Qt itself, one can write applications in a number of languages.
<apachelogger> C++ being the (most) native language, but also Ruby, Python and C# are options
<apachelogger> There used to be Java bindings but I think they disappeared (actually I believe they are just unmaintained, so if someone wants to pick that up... I am sure there are plenty of people who would love to write KDE magic in Java :))
<Riddell> I'm a big fan of Python
<Riddell> PyQt is well maintained and supported, PyKDE is popular and easy to use
<Riddell> and none of the caring about memory stuff you get in C++
<Riddell> although it can be easier to trip yourself up since there's no compiler to check all the syntax
<apachelogger> Also a number of Kubuntu and KDE tools are written in PyKDE.
<apachelogger> Like the Kubuntu installer, or the KDE print applet
<ClassBot> bulldog98_konv asked: is kparts recomended for a new application or should I try not to use them?
<apachelogger> That is a very good question indeed. For all those that do not know what a kpart is .... simply put it is a GUI plugin
<Riddell> Nokia dropped funding for the Java bindings so they're unmaintained indeed
<apachelogger> For example the HTML view frame of Konqueror is a KPart and as such could be easily integrated into any application (without build time dependency on it).
<apachelogger> So, while KParts are very powerful, as they move a couple of build time decisions to runtime, they are also a bit of a complicated thing.
<apachelogger> My advise is to think carefully about the advantages.
<apachelogger> If you have none, you should not use a kpart.
<Riddell> most applications don't need KParts, I remember when I was developing Umbrello we'd get occational suggestions to turn it into a KPart but nobody could tell us why it was just a buzz word
<apachelogger> yeah
<Riddell> but they're great for e.g. rekonq where you can embed okular to read PDFs or Calligra where you can embed a spreadsheet in a word processing document
<apachelogger> Creating a kpart is pretty easy, so turning things into a kpart as a use case arises is mostly no problem (given appropriate code design ;))
<ClassBot> bulldog98_konv asked: is it also possible to develop in JavaScript like Plasmoids?
<apachelogger> I do not think you can write actual applications in javascript (not yet).
<Riddell> you can consider QML a form of javascript and write in that
<apachelogger> However, as Qt recently grew new GUI magic called QML (which is based on JavasScript) it is entirely possible that in the not too far future you can indeed create apps using javascript.
<apachelogger> At this point if you were using QML you would not have the desktop integration advantages that KDE has over Qt-only software.
<apachelogger> though, generally you can do it already as Riddell suggested
<ClassBot> sera10 asked: what is the state of QT/KDE integration into the Gnome desktop? (gstreamer, notifications, unity, ...)
<apachelogger> Now, this might sounds silly ... but it is spelled Qt, and pronnouced "cute" :)
<apachelogger> Qt (and thus KDE) can visually integrate into GNOME/GTK+ such as that you would not notice they are not actually GTK applications
<apachelogger> http://labs.qt.nokia.com/2008/09/05/qgtkstyle-now-part-of-qt/
<Riddell> that's a nice feature of Qt, it goes out of its way to integrate with gnome.  I wish the equivalent was true with GTK
<apachelogger> KDE and Canonical are working together on the notification API, unfortunately GNOME itself is not contributing to the effort (not yet anyway).
<apachelogger> sera10: I hope this answers the question more or less, if not please ask more precisely :)
<ClassBot> dpm asked: we've heard a lot about introspection in the GNOME world in this App Developer Week (GObject Introspection, PyGI, etc.). Is there any similar move planned in the KDE world?
<Riddell> KDE's Plasma team created the status notifier spec to replace the old systray protocol, that got adopted by Canonical for Unity where it's called app indicators
<Riddell> Canonical also worked on the dbus menu spec which it helped bring to KDE, so that's some nice cross desktop work
<apachelogger> I am not particularly aware of what GObject Introspection is
<apachelogger> Riddell: do you know?
<Riddell> gstreamer is a library for audio and video, nothing directly to do with the desktop, it's used by gnome applications and is a backend to Qt's multimedia API Phonon, so that's shared too
<apachelogger> Ah, so regarding GObject introspection :D ... https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/GObjectIntrospection
<Riddell> notifications have had a shared spec for a while, canonical changed that a bit by removing action from it which has since been picked up by KDE so its notifications work when running on unity
<apachelogger> reading the first 3 lines I can say, KDE has sort of such a thing
<Riddell> Qt has had introspection for over 15 years, I'm glad that gtk is catching up :)
<apachelogger> it is called smoke and basically responsible for generating almost all available KDE language bindings
<Riddell> when you compile Qt code the classes get read through a programme called moc which adds introspection, signals/slots and other handy features
<apachelogger> http://quickgit.kde.org/?p=smokegen.git&a=summary <-- smoke is actually based on C++, thus faster than runtime introspection which is what QObjects (the Qt object type) have
<ClassBot> dpm asked: what are the main technologies I should know about if I want to get started developing in KDE?
<apachelogger> You will of course have to know the language you want to program in :)
<apachelogger> Additionally some basic stuff about Qt (such as signals and slots).
<apachelogger> http://doc.qt.nokia.com/4.7/signalsandslots.html
<apachelogger> Other than that I can't think of much you would need to know really.
<apachelogger> Riddell: anything you would like to add?
<Riddell> well it depends on what you want to code of course
<Riddell> if you want to code plasmoids then you need to know the plasma widgets
<Riddell> if you're using traditional widgets you want to know about designer to create the UI and the main classes from QtCore and QtGUI to do stuff with them
<Riddell> then you probably want to look at some of the KDE classes which add and improve on the Qt ones
<Riddell> Qt has many good tutorials on its docs site and there's plenty of KDE ones on techbase
<ClassBot> sera10 asked: How should I make an app that integrates in both the KDE and the Gnome environment, regarding menu integration, notifications, default applications registered with mime-types, etc. ?
<apachelogger> Depends on the menu you mean, if you mean the application menus, then that is actually a specification from freedesktop.org and implemented in both KDE and GNOME alike, so as long as you obey the spec you are good.
<apachelogger> http://standards.freedesktop.org/desktop-entry-spec/latest/
<apachelogger> If you mean the in-application menu (which for example is dragged out of the application in Unity, then you need to be in luck currently. Generally on Ubuntu all GTK apps can do that in KDE and all Qt apps (including KDE ones) can do it in Unity.
<apachelogger> On other distributions it might or might not work equally well.
<apachelogger> default applications registered with mimetypes is part of the aforementioned desktop entry spec (in addition KDE has an overriding initial priority system, as KDE in general supports a couple more keys outlined by this specification)
<apachelogger> Any more questions?
<apachelogger> Very useful resources for development using the KDE platform: tutorials: http://techbase.kde.org/Development/Tutorials the API documentat: http://api.kde.org/ Qt documentation and examples: http://doc.qt.nokia.com/4.7/index.html
<Riddell> KDE is an exciting community to be in just now, you can read on planet.kde.org about Plasma Active which is the new inititive to take KDE software to all sorts of devices
<Riddell> and with innovative technologies like Nepomuk and Akonadi finally coming to fruition there's a lot of nice features becoming available and useable
<Riddell> and it's pleasingly stable to use as a developer and user, no rewrites are happening underneith you
<ClassBot> sera10 asked: regarding Nepomuk, is there a standard spec for search in the works?
<apachelogger> I do not think so.
<apachelogger> I would imagine breaking search API down to a common denominator would be rather crippling, usually if you want to do search in an application you do not only want to search some random file on the user's file system
<apachelogger> at least I could not imagine a use case for that :)
<ClassBot> bulldog98_konv asked: whatâs about the exapmels module?
<apachelogger> I suppose you mean http://quickgit.kde.org/?p=kdeexamples.git&a=summary
<apachelogger> which is indeed a very great resource of examples regarding KDE and KDE related technologies.
<ClassBot> There are 10 minutes remaining in the current session.
<apachelogger> like attica, which is a library for the open collaboration service
<apachelogger> http://freedesktop.org/wiki/Specifications/open-collaboration-services
<apachelogger> And as I mentioned earlier, the KDE techbase simply contains everything you would want to know.
<apachelogger> For example how to contribute to the KDE community: http://techbase.kde.org/Contribute
<apachelogger> Which is a worthwhile effort really :)
<apachelogger> With 6 minutes left in this session.... any final questions?
<ClassBot> bulldog98_konv asked: is DesktopSummit worth coming to learn about KDE and KDE programming?
<apachelogger> maybe
<ClassBot> There are 5 minutes remaining in the current session.
<apachelogger> There are 2 days of talks, which are worthwhile if you already have an idea about Qt and KDE
<Riddell> desktop summit is more about getting involved in the community, knowing who all the faces are, and working on ideas for future development
<apachelogger> going there without knowing anything about it is probably a waste of time though .... except you are bound to meet interesting, nice and possibly even famous people (somtimes they are even all 3 of them, such as Riddell :*)
 * Riddell bats eyelids at apachelogger 
<apachelogger> Well.
<apachelogger> Thanks everyone for coming and have fun developing awesome new KDE software :D
<Riddell> I belive m_conley is up in a few minutes
<Riddell> Thunderbird + Unity = Awesome, and How JCStypes Lets You Get to the Candy
<apachelogger> Next up is Mike Conley telling us about Thunderbird and Unity and how the combination of them results in pure awesomeness :)
* 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: Thunderbird + Unity = Awesome, and How JCStypes Lets You Get to the Candy - Instructors: m_conley
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<m_conley> hey everybody!
<m_conley> My name is Mike Conley, and I work for Mozilla as a developer on the Thunderbird e-mail client.  I was hired about 3 months ago, so I'm still learning my way around the Thunderbird codebase, but I think I'm starting to get the hang of it.
<m_conley> I've never given one of these sessions before, so I'm just going to play it by ear.  I have my talk more or less planned, but I might run short, seeing as I don't really know how much written material fits into an hour.
<m_conley> So please, feel free to ask questions if you have any in #ubuntu-classroom-chat.  I'll try to answer as many as I can.
<m_conley> Also, let me know if I'm going too fast or too slow.  I'll adjust my speed accordingly.  :D
<m_conley> First, I'm going to talk about what I've been working on over the past few months.  Second, I'm going to show you some of the code I've written, and walk you through how it more or less works.  Then I'll try to answer any questions you all might have.
<m_conley> == INTRO ==
<m_conley> So, over the past 3 months, I've been working on ways for Thunderbird to integrate nicely into the shiny new Ubuntu Unity interface.  There are three integration points that I've been working on:
<m_conley> 1)  The Messaging Menu:  we want quick access to compose and address book functions here, as well as indications for when new messages arrive.
<m_conley> 2)  The Unity Launcher:  we want to display the number of new, unread messages overtop of the Thunderbird icon in the launcher.
<m_conley> 3)  Ubuntu One:  we want Ubuntu One contacts synchronization support baked into Thunderbird
<m_conley> For additional reading, here's a blog post discussing my work for #1 and #2, in case you want to know a little more about those projects:  http://mikeconley.ca/blog/2011/01/11/starting-work-on-mozilla-thunderbird/
<m_conley> #3 is a relatively new project, and I only mention it for buzz.  :)  I won't be covering it today.
<m_conley> #1 and #2 are the furthest along, and the ones I want to focus on today.  Extensions to integrate those features are available in Mozilla Labs for you to try if you'd like:  http://mzl.la/unitylauncher  http://mzl.la/messagingmenu .
<m_conley> Note that both require Thunderbird 3.3, and assume that you're running Ubuntu Natty.  Instructions for installing Thunderbird 3.3 are here:  http://www.liberiangeek.net/2011/03/install-latest-version-thunderbird-ubuntu-10-10-maverick-meerkat/
<m_conley> (I know the instructions are for Maverick, but they'll work in Natty too, once you get to the Software Center)
<m_conley> Before I continue, it's possible that some of you might not know what an extension for Thunderbird is made up of.  I'm going to go through that real quick.
<m_conley> == What is a Thunderbird Extension Made Of? ==
<m_conley> I'm going to blast through this.  More deep, detailed documentation is available here:  Thunderbird extensions: https://developer.mozilla.org/en/Extensions/Thunderbird
<m_conley> It might surprise you to know that large parts of Thunderbird are written in Javascript and a mark-up language called XUL (which is strikingly similar to HTML), and styled with CSS.
<m_conley> The Javascript/XUL/CSS is then executed/rendered by the C++ engine (called "Gecko"), and boom:  Thunderbird.
<m_conley> Imagine my surprise when I opened up the Thunderbird source code and saw Javascript staring back at me.  :D  Not what I expected.
<m_conley> Thunderbird extensions also use Javascript, XUL and CSS.  This means that if you have web development skills, chances are you can build a Thunderbird extension.
<m_conley> It's also possible to add C++ code to an extension to access more low-level libraries (such as libunity, or libindicate-gtk).  That's how I started with my Messaging Menu and Unity Launcher extensions - I wrote chunks of C++, and launched them from the Javascript portion of my extension.
<m_conley> As far as I knew, this was the only way to do things:  I mean, how else am I supposed to talk to C libraries from a Thunderbird extension?
<m_conley> == Introducing:  JS-Ctypes ==
<m_conley> And here is where JS-Ctypes comes in: https://developer.mozilla.org/en/js-ctypes
<m_conley> JS-Ctypes allows add-on developers to access and call C libraries from within the safety of Javascript.  And of course, this is Chrome-level Javascript - not the Javascript that is executed on webpages.
<m_conley> Don't worry - we're not letting web-site owners access system libraries here - we don't want an ActiveX fiasco. :p
<m_conley> So now I'm going to show you how I interact with the Unity Launcher.  First, note the Unity Launcher API here: https://wiki.ubuntu.com/Unity/LauncherAPI .  I used the Python example as a skeleton in order to set up the way my Javascript implementation works.
<m_conley> The basic idea is, get the launcher entry for a particular application, set properties on it (like the count), and make sure those properties are visible (set count_visible to true).  That's all it takes to get the count up on the Launcher icon.
<m_conley> So, next I'm going to show you some of the code I wrote...
<m_conley> This is UnityLauncherLib.jsm:  http://www.pastie.org/1785131
<m_conley> (Note the .jsm extension - this is a Javascript Module.  See https://developer.mozilla.org/en/JavaScript_code_modules/Using)
<m_conley> UnityLauncherLib.jsm is responsible for wrapping up all of the C library stuff for me.  The init and shutdown function do (as you've probably gathered) the set-up and teardowns for the library connection.
<m_conley> You can look at that stuff later - what I'm interested in showing you starts on line 71 (the _declare function).
<m_conley> The first thing you need to do when working with JS-Ctypes is to declare the types you're working with. Using library calls like unity_launcher_entry_get_for_desktop_file and unity_launcher_entry_set_count means manipulating UnityLauncherEntry objects.  We have to tell JS-Ctypes about those objects in order to manipulate them - the same way you'd declare a struct or class in a C++ header.
<m_conley> But that'd mean declaring every single member of every single object that we'd have to manipulate, right?
<m_conley> Wrong!
<m_conley> The good news is that, with the way the Unity Launcher API is set up, I just have to pass a pointer to a UnityLauncherEntry to various functions.  I don't need to do any direct manipulation of the UnityLauncherEntry - I just pass it around.
<m_conley> So on line 73 of http://www.pastie.org/1785131, I declare an empty StructType called UnityLauncherEntry, and then a pointer type called UnityLauncherEntryRef.  UnityLauncherEntryRef is all I'll be passing around.  I suppose I also could have also used the type ctypes.voidptr_t.  That probably would work too.
<m_conley> Ok, now I can declare the various functions I'm going to use, like unity_launcher_entry_set_count.  Line 91 is where I declare that function.
<m_conley> The structure for that declaration is: I provide the name of the function call, the type of function (we're not on Windows, so it's default_abi), the return type (void), and then the argument types (UnityLauncherEntryRef and an unsigned integer).
<m_conley> The following is then possible inside Javascript:
<m_conley> mLauncher = UnityLauncherLib.ULEntryGetForDesktopFile("/usr/share/applications/thunderbird.desktop");
<m_conley> UnityLauncherLib.ULEntrySetCount(mLauncher, 1234);
<m_conley> UnityLauncherLib.ULEntrySetCountVisible(mLauncher, true);
<m_conley> And that would display a count of 1234 overtop of the Thunderbird icon in the Unity launcher.
<m_conley> Similar manipulation can be done to show a progress bar over the Unity launcher icon.  It's easy to imagine a progress bar to show how far along inbox syncing is.
<m_conley> And that's how I can interact with things like the Unity Launcher from the safety of Javascript.
<m_conley> Any questions so far?
<m_conley> Am I going too fast?  Am I breezing past things that you all want to talk about?
<m_conley> No?
<m_conley> Ok.  :)
<m_conley> So that's an example of how I can interact with things like the Unity Launcher from the safety of Javascript.
<m_conley> So we can call C function from within Javascript - but can we call Javascript functions from C?  Yes we can!
<m_conley> When indicators in the Messaging Menu are clicked, we want a callback function to be run.  In C/C++ this is done by using g_signal_connect to connect a function to the "user-display" event for an indicator.
<m_conley> I was able to use JS-Ctypes to wrap several GObject functions, including g_signal_connect (which is actually just a macro wrapping g_signal_connect_data).  Here's the GObjectLib.jsm file:  http://www.pastie.org/1787573
<m_conley> Once again, the interesting stuff is in _declare.  On line 42, I am able to define what the structure of a callback function looks like, and I use that in the definition of GSignalConnectData.
<m_conley> So, in my Messaging Menu extension code, with my GObjectLib loaded, I'm able to do this:
<m_conley> var myCallback = function myCallback(aInstance, aTimestamp, aUserData) {
<m_conley>   alert("Hello, callback world!");
<m_conley> }
<m_conley> myCallbackFunction = GObjectLib.GCallbackFunction(myCallback);
<m_conley> GObjectLib.GSignalConnect(indicator, "user-display", myCallbackFunction, null);
<m_conley> Where "indicator" is some indicator that's been spawned using a wrapped indicate_indicator_new.  (See http://www.pastie.org/1787649)
<m_conley> Now, when that indicator is clicked, the Javascript callback will be fired, and we'll get our alert box.
<m_conley> This is pretty powerful stuff.  You get the full power of the system libraries, while staying within the managed environment of Javascript.
<m_conley> So that's how I'm using JS-Ctypes.
<m_conley> I suppose I'll talk about my work integrating with Ubuntu One next.
<m_conley> So, a bunch of you probably know this already, but Canonical offers a service called Ubuntu One
<m_conley> Among other things, Ubuntu One offers contacts synchronization support
<m_conley> Currently, Thunderbird allows users to connect to LDAP address books, and local storage address books.  On OSX, there's a system address book that we also connect to.
<m_conley> I'm working on adding an Ubuntu One Contacts address book to Thunderbird, to show the contacts that are stored via the Ubuntu One service
<m_conley> So, imagine this:
<m_conley> You've been using Thunderbird for a while now on your laptop, and you've built up quite a large address book, with all of your friends and workmates organized into their groups
<m_conley> and then you go and drop your laptop into a lake
<m_conley> Thankfully, once we've got Ubuntu One contacts support baked in, all you'd need to do is log into your Ubuntu One account on your new computer (because you'd probably get a new computer after that...)
<m_conley> magic synchronization happens, and bam:  your contacts are back in Thunderbird.
<m_conley> The other nice thing about Ubuntu One contacts, is that it's built for *sharing*
<m_conley> and by sharing, I mean, sharing between applications
<m_conley> Evolution, for example, has the option of storing contacts via the Ubuntu One contacts synchronization service
<m_conley> If you want to migrate from Evolution to Thunderbird, you just need to make sure all of your contacts are synchronized, and that's it.
<m_conley> Thunderbird will start up, find your Evolution contacts, and away you go.
<m_conley> So that's what I'm working on, for Thunderbird + Unity integration
<m_conley> Going back to JS-Ctypes - this doesn't just work in Thunderbird
<m_conley> it works in Firefox as well
<m_conley> In fact, JS-Ctypes has been shipping in Firefox for quite a while.  So, some pretty powerful extensions are now possible.
<m_conley> Imagine, for example, connecting the download manager to an Arduino via JS-Ctypes
<m_conley> You could get a big light to flash once all of your downloads are completed.
<m_conley> That's just off of the top of my head.
<m_conley> So, I guess I'll go into the declaration of types for a little bit.
<m_conley> So, JS-Ctypes wraps up the platform-specific fuzziness of types, and gives you a set of platform agnostic ones:  for example:
<m_conley> ctypes.unsigned_int is your basic unsigned integer.  Cross-plat.
<m_conley> Similarly, ctypes.unsigned_char is your basic unsigned_char.
<m_conley> You can declare entire objects with JS-Ctypes too, for example:
<m_conley> Suppose we're attempting to work with a C library that manipulates a struct called Person, with a Name and an Age
<m_conley> we can define this using:
<m_conley> var Person = new ctypes.StructType("Person", [{'name': ctypes.unsigned_char.ptr}, {'age': ctypes.unsigned_int}]);
<m_conley> We could then pass that structure to the library, and it'll treat it just like it would if it was called from C or C++
<m_conley> Of course, once we start dealing C / C++ libraries, we get back into the issue of memory management
<m_conley> In my Indicator library, for example, I create indicators using indicate_indicator_new
<m_conley> After instantiation, I'm responsible for freeing that memory.  I therefore had to wrap g_object_unref in my GObjectLib
<m_conley> and it works as you'd expect - I pass it a pointer to something I've allocated for (using the handy ctypes.voidptr_t - which is the equivalent of void *), and it'll do the rest.
<m_conley> It's also important to close the connections to the libraries once you're finished with them
<m_conley> For example, if I open up libgobject, like so:  lib = ctypes.open("libgobject-2.0.so"), I have to close it via lib.close().
<m_conley> It's again worth emphasizing that JS-Ctypes is cross-platform.  That means that you can connect to Windows libraries and OSX libraries as well.
<m_conley> I don't use OSX myself, and I don't imagine most of you either (this *is* #ubuntu-classroom afterall), but I thought this was kind of neat:
<m_conley> https://developer.mozilla.org/en/js-ctypes/Examples/Add_to_iPhoto
<m_conley> This example is for a Firefox extension that adds a context menu item to images
<ClassBot> There are 10 minutes remaining in the current session.
<m_conley> The extension makes it so that right clicking on an image gives you the option to send that image directly to the built in photo program.
<m_conley> Something similar could be done with F-Spot, for example - though you might not need JS-Ctypes to do it.  I'm not familiar enough with the F-Spot API (if it has one) to say for certain.
<m_conley> So that's my talk.  I'll stick around for the next 10 minutes to answer any questions you might have.  Thanks for listening/reading!
<ClassBot> There are 5 minutes remaining in the current session.
<m_conley> Alright, I'll assume there aren't any questions.  Thanks for listening everyone!  Enjoy the rest of the talks!
* 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: Story: Unity, hacking on a real-world app - Instructors: Trevinho
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<Trevinho> Hi all!
<Trevinho> I'm Marco Trevisan, also known in the Ubuntu Community as TreviÃ±o or 3v1n0
<Trevinho> just for giving few informations about me, I'm a 25 years old student in Computer Science and I'm an Ubuntu user since the release of (K)ubuntu Breezy Badger (well, I started as a kubuntu user in fact)
<Trevinho> My first approaches to the hUbuntu core were done as a 3rd party packager: I started packagin a lot of extra software in my "3v1n0" repository
<Trevinho> that was also for a certain period of time the main community reference for the ubuntu Compiz (Fusion) packages and loader scripts.
<Trevinho> In recent times I've been involved in projects like Openmoko, Freesmartphone and SHR (www.openmoko.org, www.freesmartphone.org, www.shr-project.org, all related to the free phone development), Enlightenment (http://enlightenment.org with some elementary widget library work), Vala (the new GObject based language).
<Trevinho> Few months ago when Unity was announced to be the future of Ubuntu, also for the "standard" distribution, I was so excited since for me it was the first great step that ubuntu was doing for becoming something of really different, but using an open way.
<Trevinho> This decision surely shown a great courage of the "Ubuntu headquarters", but I found that it have to be supported by the community to become real
<Trevinho> Now, Unity of course can't be considered just as the simple "lp:"unity" branch that basically includes the Compiz plugin that is able to creat the deskopt environment that we all known as "unity"
<Trevinho> Unity is more
<Trevinho> unity is a new ecosystem made of many applications and libraries which cooperates in various ways allowing to get what you see as an "united" interface.
<Trevinho> Also if it should be quite known, the unity architecture is based basically on:
<Trevinho>  * Compiz, which is the basic windows manager upon the unity interface is built
<Trevinho>  * unity-window-decorator, the windows decorator based on libmetacity
<Trevinho>  * libindicator, which is a library that factorizes some common features of an indicator, allowing to load one or a set of indicators into the unity panel
<Trevinho> * BAMF, the Application Matching Framework which allows to associate each window to an application witha related .desktop file (if it exists)
<Trevinho> Going more in the deep you can see unity (the compiz plugin) as the painter of the items that its sub-libraries and services allows to manage and connect
<Trevinho> If you look at the main parts of the unity interface you can consider the Panel, the Launcher and the Dash
<Trevinho> The Panel is, in the current implementation, basically fully populated by indicators; excluding the window title and controls, in fact, that bar is populated with (when installed):
<Trevinho> libappmenu (indicator-appmenu, the indicator showing the menu)
<Trevinho> libapplication (the indicator which loads and shows all the libappindicator's)
<Trevinho> libsoundmenu (indicator-sound)
<Trevinho>  libnetworkmenu (indicator-network)
<Trevinho> libmessaging (indicator-messages)
<Trevinho> libdatetime (indicator-datetime)
<Trevinho> libme (indicator-me)
<Trevinho> libsession (indicator-session)
<Trevinho> The unity-panel-service (see unity/services) is the daemon which loads the indicators and tells to the unity pllugin tho to show them.
<Trevinho> the unity Launcher is used for showing the icons used both for loading the dash lenses and the new application instances by type
<Trevinho> Its role is quite easy to understand, but its implmenetation is quite complex due to the fact that in the X11 system there's not a direct link between an XWindow and a desktop file, or between more windows (of the same level / hierarchy) coming from the same application.
<Trevinho> Here's where BAMF comes.
<Trevinho> That framework has been written to export any window to an higher level and to associate them to a desktop file and a "dummy" application object.
<Trevinho> All the informations that BAMF catches and organizes are finally exported via DBus to be used bu the unity launcher to understand what is happening in the desktop and to draw/manage correctly the launcher items/icons
<Trevinho> Finally the dash is the place where any unity loaded lens is shown, but I won't go more in deep here since there are some other sessions related to it.
<Trevinho> Now, to go back to my story which entitled the session, I've to say that I'm an advanced PC user and so I need that the tools I use are able to do what I expect from them; that's why every time I find and interesting project that needs some tuning I work on it to get what I'm missing...
<Trevinho> That's in practice my application of the Eric S. Raymond famous motto Â«Every good work of software starts by scratching a developer's personal itchÂ» that he states in "The Cathedral and the Bazaar".
<Trevinho> Few montsh ago, my first "unity" related "itch" appeared when I found this article by OMGubuntu ( http://go.3v1n0.net/eMRF4l ) showing a way to customiz the ubuntu clock panel applet.
<Trevinho> Since I was (as I still am) a great fan of the application indicators, also in Maverick I always used the indicator-applet-complete gnome-panel applet, to reduce to the minimum the usage of the other gnome applets.
<Trevinho> So, when I found this nice trick, I looked a way to get it working in indicator-datetime too... I knew that indicator-datetime would be the future, so I decided to improve it.
<Trevinho> I never hacked the sources of an Ubuntu internal project (excluding patches), so I had to learn something about it
<Trevinho> I generally I don't use too much IRC or mailing lists, until I don't need to do that (for issues, or for RFCs), so I started my work by my own
<Trevinho> So, the basic of bazaar usage are here: http://go.3v1n0.net/fDRS9Q and I guess that everyone here knows how to use it
<Trevinho> So after branching it, I just had to work on it... And the hack I wanted to do was very easy so in few hours everything was on my branch at http://go.3v1n0.net/gwJkLo
<Trevinho> For you informations, thanks to this clock-label-improvements for indicator-datetime
<Trevinho> you can use any date/time style, included the ones you find in the OMGubuntu! article posted before with commands like:
<Trevinho> gsettings set org.ayatana.indicator.datetime time-format "'custom'"
<Trevinho> gsettings set org.ayatana.indicator.datetime custom-time-format "'%a <b>%I:%M %p</b>'"
<Trevinho> However, after this hack... I found the process of the ubuntu development very quick and open to the community
<Trevinho> so I decided to continue in my path working on other things that I missed in "my" ubuntu....
<Trevinho> A great itch I had about indicator-sound was that I wasn't able to see in aprecise way the new volume level of my system when using the scrolling hweel over the indicator icon to adjust the volume.
<Trevinho> That was a very common operation for me and since indicators doesn't support, by design, any form of tooltips
<Trevinho> I decided to implement it using a particular way, following what has already been done for the volume keys...
<Trevinho> Basically I made possible to show a notify-osd bubble showing the new volume level
<Trevinho> when a scroll-event was registerd over the indicator-sound icon; more informations about this implementation are available at the merge proposal: http://go.3v1n0.net/gNy0Qj
<Trevinho> All this work lead to me to a greater work
<Trevinho> which made me understand a lot of the unity infrastructure related to ubuntu indicators
<Trevinho> or better, an ubuntu AppIndicator
<ClassBot> There are 10 minutes remaining in the current session.
<Trevinho> Ok I'm back
<Trevinho> sorry I had a network outage
<Trevinho> and I wasn't able to get the permission to write back :P
<ClassBot> jsjgruber89 asked: How do libapplication and unity-panel-service determine what to load?
<Trevinho> Well, libappapplication is used by applications that want to add an AppIndicator
<Trevinho> unity-panel-service is a service as the name states, that waits incoming DBus calls. These calls are perfomed by libappindicators
<ClassBot> There are 5 minutes remaining in the current session.
<Trevinho> However going back to the story.... I was telling about the libappindicator work I did...
<Trevinho> Practically I added support for developers to catch the "scroll" events over an appindicator icont too.
<Trevinho> But this work was quite complex as you can read in this bug report I did: https://bugs.launchpad.net/indicator-application/+bug/708180
<Trevinho> because an indicator-application is really a set of indicators
<Trevinho> and there is a mix of DBus signals and methods and glib signals to perform operations from the lower level (the libindicator) to the higher one (the unity panel)
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/12/%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 ||
<Trevinho> So, the hour is finished, but I'll use bit of extra time to end the story :P
<Trevinho> so, to make the long story short, Afther this first bounch of patches I continued with some others more unity related
<Trevinho> work with some patches
<Trevinho> to improve its look like
<Trevinho> https://code.launchpad.net/~3v1n0/unity/fading-title (which cuts long window titles with fading, that then I've made also for metacity)
<Trevinho> And the intellihide / autohide support https://code.launchpad.net/~3v1n0/unity/autohide-intellihide
<Trevinho> However, I guess that you can read more about these patches in launchpad
<Trevinho> the important thing that I want to explain is how to get there... The first part is study the sources and army yourself with the grep and few others development tools like gedit and some gedit-plugins you like
<Trevinho> for managing the sources I've mostly used plain bazaar with the bzr-gtk plugin
<Trevinho> to use tools like "bzr glog", "bzr gcommit", "bzr gdiff" (and so on) commands which could speed up your sources versioning process
<Trevinho> Basically when you want to hack to an ubuntu project all you need to do is
<Trevinho> * branch it wit bzr branch lp:<project_name>
<Trevinho> * work on it with your tools
<Trevinho> when you're ready just push it as  a your branch of that project with
<Trevinho> bzr push lp:~YourLPname/<project_name>/<branch-name>
<Trevinho> So you need to do a merge proposal
<Trevinho> And you can do it with launchpad powerful merging tools
<Trevinho> this is the key moment.
<Trevinho> I've to say that in my experience the reviewers were always very fast to approve, and I got very few corrections (just typos), but it could happen that you get rejected or you need to rewrite something
<Trevinho> however the ubuntu developers are and I guess that will always be very open to the community contributions
<Trevinho> especially with unity coming, that is the creation of something new from the basis.
<Trevinho> About contacting the developers, I'd suggest you to use the launchpad mails or the ayatana ML if you need to do augmented discussions, but for a very fast communication
<Trevinho> it's better to use new channels as are the microblogs like twitter or identi.ca
<Trevinho> many ubuntu developers are there (see https://twitter.com/list/3v1n0/ubuntu) and I think that it's the better way to keep them in touch.
<Trevinho> Finally I remember you that if you want to start to work in Unity and related projects
<Trevinho> the best way is to start from the bitesize bugs: https://wiki.ubuntu.com/Unity/Bitesize
<Trevinho> read that wiki and the many castrojo's blogs about them go get started
<Trevinho> and join the ubuntu development!
<Trevinho> If there are no more questions (don't use the ClassBot, but just post them in #ubuntu-classroom-chat), I thank you all for the attention and who gave me this opportunity
<Trevinho> Sorry for the network issues and my time overrun...
<Trevinho> :)
<Trevinho> Ok... Good bye all so :)
#ubuntu-classroom 2011-04-13
<dpm> The next day of App Developer Week is starting in ~20 minutes!
<dpm> Everyone ready? :-)
<jryannel> I'm ready. kind of ;)
<dpm> ah, hi jryannel, welcome! :-)
<jryannel> thx
<nigelb> jryannel: could you also join #ubuntu-classroom-backstage ? :)
<dpm> How's everyone?
<dpm> Are you all ready for some more development goodness on Ubuntu App Developer Week?
<dpm> Ok, let's start the day with one of the newest and coolest technologies in Free Software today:
<dpm> Qt Quick, and in particular the QML language
* 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: Qt Quick: QML the Language - Instructors: jryannel
<dpm> jryannel, from the makers of Qt knows all about it and will be thrilled to tell you
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/13/%23ubuntu-classroom.html following the conclusion of the session.
<jryannel> Ok. Hi I'm jryannel from QtDF acting as Training Manager. This is my first irc training session so bear with me
<jryannel> I want to give short intro to Qt Quick's QML language and how to use it
<jryannel> First things first
<jryannel> You need Qt + Qt Creator, easiest
<jryannel> install - QtSDK (http://labs.qt.nokia.com/2011/04/06/qt-sdk-1-1-rc-released/)
<jryannel> or on ubuntu search for apt-cache search qt4; apt-cache search creator
<jryannel> To run QtQuick you need Qt 4.7.0 or better, latest is Qt 4.7.3
<jryannel> or grab it from gitorious
<jryannel> So what is Qt Quick?
<jryannel> It's based on GraphicsView as 2.5d canvas API with graphics items
<jryannel> the graphicsview was developed in c++ and creating rich ui takes a long time
<jryannel> So our developers came up with a declarative way.
<jryannel> It looks like CSS  or JSON
<jryannel> import QtQuick 1.0
<jryannel> Rectangle {
<jryannel>     width: 360
<jryannel>     height: 360
<jryannel> }
<jryannel> First you import QtQuick module with major and minor version than you define a root element.
<jryannel> In this case a rectangle with a width of 360 and height of 360.
<jryannel> But live is easier if I don't type a book here;
<jryannel> Please visit: http://developer.qt.nokia.com/wiki/Qt_Quick_Tutorial_Basics
<jryannel> I will walk you through this and then another example
<jryannel> the qmlviewer is the declarative runner for developing purposes
<jryannel> it has many options, which you can ask with --help
<jryannel> It comes with Qt (in the bin folder)
<jryannel> qmlviewer main.qml will interpret the qml file and show the ui
<jryannel> The qmlviewer is made with the Qt Declarative module
<jryannel> a C++ module. You can write your own declarative viewer
<jryannel> see here how: http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeview.html#details
<jryannel> It's 3 lines of code
<jryannel> QDeclarativeView *view = new QDeclarativeView;
<jryannel>  view->setSource(QUrl::fromLocalFile("myqmlfile.qml"));
<jryannel>  view->show();
<jryannel> That's in essence it the qmlviewer, which interprets the qml file.
<jryannel> But back to the qml side of coding
<jryannel> width : 300 means a property binding
<jryannel> It's different from assignment. It's kind of a contract.
<jryannel> So you can write "width:  2 * height"
<jryannel> with this width is always 2 times the height.
<jryannel> When the height changes the right side will be re-evaluated and assigned to the left
<jryannel> Another aspect width:  2 * height" shows:
<jryannel> JavaScript. Every right side can contain any kind of javascript code
<jryannel> A good javascript tutorial is at
<jryannel> https://developer.mozilla.org/en/JavaScript
<jryannel> Qt Quick is finally a declartive UI (QML) with C++ backend and JavaScript enhanced
<jryannel> Let's jump to "Composition of Components" on the wiki page I posted earlier
<jryannel> You can nest qml elements
<jryannel> A element has a name and propertis and child elments, like HTMl has
<jryannel> (I hope someone is correcting my spelling mistakes later :) )
<jryannel> 1
<jryannel> 2
<jryannel> 3
<jryannel> 4
<jryannel> 5
<jryannel> 6
<jryannel> 7
<jryannel> 8
<jryannel> 9
<jryannel> 10
<jryannel> 11
<jryannel> 12
<jryannel> 13
<jryannel> 14
<jryannel> 15
<jryannel> 16
<jryannel> 17
<jryannel> 18
<jryannel> / File: BasicSteps_2.qml
<jryannel> import Qt 4.7
<jryannel> Â 
<jryannel> Rectangle {
<jryannel> Â Â Â Â width: 300
<jryannel> Â Â Â Â height: 300
<jryannel> Â Â Â Â color: "#FFF8DC"Â Â Â  // cornsilk
<jryannel> Â 
<jryannel> Â Â Â Â Image {
<jryannel> Â Â Â Â Â Â Â Â x: 10; y: 45
<jryannel> Â Â Â Â Â Â Â Â source: "voringsfossen1.jpg"
<jryannel> Â Â Â Â }
<jryannel> Â 
<jryannel> Â Â Â Â Text {
<jryannel> Â Â Â Â Â Â Â Â x: 10; y: 265
<jryannel> Â Â Â Â Â Â Â Â text: "Voringsfossen"
<jryannel> Â Â Â Â }
<jryannel> }
<jryannel> ohh, sorry
<jryannel> so we have a rectangle with an image and text child
<jryannel> The child elements have a corrdinate system relative to the parents
<jryannel> so a x:10, means 10 px relative to parent.
<jryannel> E.g. all elements are derived from the Item element: http://doc.qt.nokia.com/4.7-snapshot/qml-item.html
<jryannel> You find an overview about which items are available here: http://doc.qt.nokia.com/4.7-snapshot/qmlbasicelements.html
<jryannel> so when you write "x:10" you actually overwrite the default property value (in this case "x:0").
<jryannel> For example if you don't  specify a width or height to an element, it will be invisible!
<jryannel> Let's come back to "http://developer.qt.nokia.com/wiki/Qt_Quick_Tutorial_Basics" -> Custom Properties
<jryannel> besides the default properties you can add own properties.
<jryannel> E.g. "property int frameSize: 300"
<jryannel> which data types are supported? See here: http://doc.qt.nokia.com/4.7-snapshot/qdeclarativebasictypes.html
<jryannel> Can I add own data types. Sure. You can extend Qt Quick from the C++ side: http://doc.qt.nokia.com/4.7-snapshot/qml-extending.html
<jryannel> Even you can write own elements. E.g. a chart type or everything what can be painted.
<jryannel> Besides visual items you can also use non-visual items, e.g. timer (http://doc.qt.nokia.com/4.7-snapshot/qml-timer.html)
<jryannel> And you can also push QObjects from the c++ world into Qt Quick, e.g. for example for a D-Bus binding, or...
<jryannel> Now visit shortly http://doc.qt.nokia.com/4.7-snapshot/qml-tutorial1.html for another start into qt quick
<jryannel> It's just another hello world in qt quick
<jryannel> In Qt Creator our ide you can create a qt quick project with "New Project" -> "Qt Quick UI"
<jryannel> If you choose Qt Quick Application, it will generate a C++ qml viewer for you additional
<jryannel> So just copy the helloworld from (http://doc.qt.nokia.com/4.7-snapshot/qml-tutorial1.html) in your new project and run the project (no need for compilation)
<jryannel> Qt Creator (http://doc.qt.nokia.com/qtcreator-snapshot/index.html) is very much keyboard driven
<jryannel> It has also support got git, mercurial and I think svn and some other version control systems
<jryannel> Also for pastebin. Which I need to remember to use more
<jryannel> Here is a list of shortcuts: http://doc.qt.nokia.com/qtcreator-snapshot/creator-keyboard-shortcuts.html
<jryannel> One of our partners has created a reference card: http://www.kdab.com/index.php?option=com_content&view=article&id=126
<jryannel> for Qt Creator.
<jryannel> But now back to qml...
<jryannel> http://doc.qt.nokia.com/4.7-snapshot/qml-tutorial2.html shows how to create a custom qml component
<jryannel> A component is a piece of qml code in a separate qml file
<jryannel> E.g. if you want create your own button you write a "Button.qml" file
<jryannel> Inside would be possible a Rectangle a Mousearea (which receives mouse clicks).
<jryannel> In the example tutorial they create a Cell in a "Cell.qml" file
<jryannel> The signal keyword allows to emit signal from a qml element. Just by calling the function name
<jryannel> The id property is a special property. It allows to identify an element inside a qml file ...
<jryannel> ... but also across other qml files.
<jryannel> As a convention I always give my root element the "id: root"
<jryannel> I give application wide used components a nice name so that I can reference them from other qml files.
<jryannel> When referencing an id from another qml file you make yourself depending. So think about if you really want to be dependent on the other qml (component).
<jryannel> Id's are only known to the qml runtime when the qml file is actually loaded
<jryannel> Have a look at the "The main QML file" section
<jryannel> There we use the "Cell.qml" component with a simple call to "Cell".
<jryannel> Any qml file (with upper-camelcase" ) in the same folder can be used directly. (Others need to imported)
<jryannel> "onClicked: helloText" - is a handler to the signal clicked() from Cell.qml
<jryannel> Great. We can make some rectangles and text and place them somewhere so what?
<jryannel> With a little bit of C++ and some motivated developers you can make something more ...
<jryannel> ... see here http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/
<jryannel> Jens presents the desktop components (a little bit more complicated Cell.qml with some C++ backend)
<jryannel> It's a research project (that's why it's on labs). But I think they will be happy about feewdback
<jryannel> But in general Qt Quick is a very much design driven easy to code ui language. Where the heavy lifting is done in C++
<jryannel> It's very flexible. With flexibility also comes a price
<jryannel> There are many solutions to the same problem. So you need a good practice to master the different elements and C++ extension possibilities to come to a good solution
<jryannel> Not every solution is simple and beautiful
<ClassBot> There are 10 minutes remaining in the current session.
<jryannel> http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeexamples.html here you find more examples
<jryannel> Tomorrow we will go into the dynamic side of Qt Quick. Animations - States - Transitions
<jryannel> You can find learning material (e.g. videos and whole courses) here: http://qt.nokia.com/developer/learning/elearning
<jryannel> I hope I haven't confused you all to much. Qml is simple
<jryannel> Elements, Properties, Child Elements,
<jryannel> Property Binding
<jryannel> and JavaScript + C++ for application logic.
<jryannel> Take care.
<jryannel> Python and Qt Quick. Yes
<jryannel> There is PyQt and PySide
<jryannel> checkout: http://developer.qt.nokia.com/wiki/Category:LanguageBindings::PySide
<ClassBot> There are 5 minutes remaining in the current session.
<jryannel> Sorry question was: Can I use Qt Quick with a python backend instead of C++?
* 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: Make your applications work in the cloud with Ubuntu One - Instructors: aquarius
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/13/%23ubuntu-classroom.html following the conclusion of the session.
<aquarius> Hi, all!
<aquarius> I'm Stuart Langridge, from the Ubuntu One team, and I'm here to talk about our upcoming app developer programme.
<aquarius> Do please ask questions throughout the talk: in the #ubuntu-classroom-chat channel, write QUESTION: here is my question
<aquarius> and so, on with the show. :)
<aquarius> Up until now, your ability as developers to do cool things with Ubuntu One has been limited.
<aquarius> But I'm going to change all that.
<aquarius> We want to make it possible, and easy, for you to add the cloud to your apps and to make new apps for the cloud
<aquarius> So we do all the heavy lifting, and your users (and you!) get the benefits.
<aquarius> Imagine, for example, you've made a recipe manager application.
<aquarius> So you can type in all the recipes you like to cook, and you've got a permanent record of them.
<aquarius> (For me, that would be: get a pizza base; put pepperoni on it. You'll be better at that than me.)
<aquarius> Don't really want to take your laptop into the kitchen, though, of course.
<aquarius> So, build a mobile app which you sign into with Ubuntu One, and have that show all your recipes too.
<aquarius> And a web app which you sign into with Ubuntu One, so that you can look up recipes while you're at a friend's house.
<aquarius> This is the sort of thing that we want to make easy; giving your users and you quick access to the Ubuntu One technology.
<aquarius> Mobile access to your data; web app access to your data; saving files direct into Ubuntu One; publishing files and photos from all your apps; adding playlists to the Ubuntu One music streaming app; streaming the user's own music into a game you've written.
<aquarius> Bringing all that stuff into apps on Ubuntu; Quickly apps or Qt Quick apps or Flash apps or C apps or JavaScript apps or Air apps or whatever you want to develop.
<aquarius> We give you the APIs to do it; you build cool stuff. Deal? Deal.
<aquarius> This stuff is all being heavily worked on right now as we speak.
<aquarius> So this talk won't be too detailed with specifics, because they might change.
<aquarius> I want to give you a flavour of what will soon be possible, and answer questions, and give some pointers, and get your thoughts.
<aquarius> Also, this is App Developer Week, so I can talk about what the components we're working on are and then admire all the cool ways you all come up with for snapping them together, rather than waiting for marketing to come up with a "product" for you to use :)
<aquarius> So, some components that can be snapped together.
<aquarius> You'll be able to sign in to a web application with Ubuntu One.
<aquarius> This means that you don't have to manage your own identity system, think about password renewal, all that.
<aquarius> And that's the hard annoying part of running web apps; working out what to do if a user forgets their password, etc, etc. "Enter the name of your first pet", etc.
<aquarius> This is just like "sign in with Facebook" or "sign in with Twitter"; it's OpenID-based, and lets your users sign in to a web app and you'll know their Ubuntu identity.
<aquarius> Once you've signed in to an app with Ubuntu One, that app can ask for permission to work with your data.
<aquarius> This lets you, developers, build applications that work on the desktop, on the web, on mobile phones.
<aquarius> The recipe manager example I mentioned above is one sort of thing you could do, there
<aquarius> Your users use the nice recipe manager app on Ubuntu, which you've built with Quickly or whatever you prefer
<aquarius> (QML, now that you're all experts in it :))
<aquarius> And then they can go to yourrecipemanager.com and sign in with Ubuntu One
<aquarius> yourrecipemanager.com then asks them for permission to access their "recipes" database
<aquarius> and can then show them all their recipes on the web!
<aquarius> Your app (yourrecipemanager.com) does this via OAuth; it goes through the standard OAuth dance to get an OAuth token which can be used to access the user's recipes CouchDB database
<aquarius> And your users can be happy that it's secure, because yourrecipemanager.com will only have access to their recipes database; it can't read their contacts, or their files, or their credit card info.
<aquarius> So, this gives you the chance to build a brilliant Ubuntu app and yet still extend that app out to other platforms, for people who end up sometimes being away from their Ubuntu machine
<aquarius> so they can use the website when they're at work, and the Ubuntu app when they're at home
<aquarius> But you can imagine sharing other sorts of data between applications.
<aquarius> Imagine, for example, an achievements system.
<aquarius> You write a few games; some on the web, some on mobile phones, some on the Ubuntu desktop, some on Windows.
<aquarius> And every time the user achieves something in a game, you save that achievement to that user's "achievements" database.
<aquarius> ("100 levels completed!", or perhaps "100 enemies killed" if it's that sort of game...)
<aquarius> On Ubuntu, you'd save it into desktopcouch, and Ubuntu One will take care of synchronising that into the cloud.
<aquarius> On Android, your game would include the DroidCouch library which gives you simple access to save data directly into the user's personal cloud databases.
<aquarius> On the web, your game's backend could use the u1couch Python library to do the same thing, save directly into the cloud, or you could just use the underlying REST API (which is just standard CouchDB with OAuth signing; u1couch is just a wrapper)
<aquarius> The u1couch library is at https://launchpad.net/ubuntuone-couch for people who want to play with it.
<aquarius> it's Python, but it provides a good example of how to take a request to Ubuntu One, discover the user's Ubuntu One tokens, and maek requests using them
<aquarius> Or you could write your own wrapper library for PHP or Rails or Flash or whatever you prefer (and then tell me about it so I can point to the documentation for it!)
<aquarius> (feel free to use u1couch as a basis, or develop your own if you prefer)
<aquarius> At that point, all your games save achievements to the same place, so all your games can show you the achievements you've won in any game
<aquarius> And, as before, you can set up yourachievements.com where a user can log in and see all their achievements.
<aquarius> There's loads of stuff you can do with shared data.
<aquarius> The idea here is that all your stuff is everywhere -- more importantly, all your users' stuff is everywhere.
<aquarius> So they get the benefit of all their machines sharing the same information.
<aquarius> win an achievement in a game on your Ubuntu laptop, and your Ubuntu netbook also knows you've won that achievement, and which level you got up to
<aquarius> and so does your port of the game to a tablet or a web app or whichever other platform you want.
<aquarius> and you, developer with limited time, can concentrate on the stuff you're interested in -- making your app, your game, your program -- be great, and just not have to worry about all this data storage stuff.
<aquarius> your apps look better because they handle all this, and you don't have to worry about how to do it. :)
<aquarius> But Ubuntu One's not just about data.
<aquarius> Take the music streaming service, for example.
<aquarius> You can currently stream music to Android and iPhone, and you'll be able to add that music to the cloud from Ubuntu and Windows.
<aquarius> any music your users have got, that they've purchased from U1 or from elsewhere or ripped from their own CDs or whatever, they sync with U1, and then they can stream it to their mobiles.
<aquarius> Maybe you want to be able to stream music back to your Ubuntu machine without syncing it, or your Mac, or your Palm Pre, or your LG mobile phone, or your toaster.
<aquarius> So, just use the music streaming API, which is a simple REST HTTP API, based on the Subsonic API, or help people to get at their music by showing them our HTML5 web player for streaming music.
<aquarius> But there's more interesting ideas around music streaming than just "listen to the music".
<aquarius> Playlists, for example. The Ubuntu One Streaming apps on Android and iPhone know how to create playlists.
<aquarius> But how they do that is not a secret. Your playlists are just stored in your cloud databases.
<aquarius> So, why not sync your playlists from Banshee or Rhythmbox or Amarok or Exaile or Quod Libet or iTunes or Windows Media Player?
<aquarius> (or whichever music player you use yourself. :))
<aquarius> Copy the playlists from your media player into desktopcouch on Ubuntu or into the cloud directly with u1couch on Windows or the Mac or anywhere else, in the correct format, and those playlists will instantly show up on your phone!
<aquarius> A simple example of this is https://code.launchpad.net/~sil/%2Bjunk/m3u2u1ms/ which is a quick script I wrote to take an m3u playlist and store it in desktopcouch on Ubuntu.
<aquarius> the whole script is about 200 lines, so as you can see this isn't hard
<aquarius> it just walks through an m3u file, finds a reference to all the songs in it, and creates that as a U1 playlist
<aquarius> So you can make your Banshee playlists available to the Ubuntu One app on your Android phone by exporting them as m3u and then importing them with the script.
<aquarius> Tighter integration is great, here; what we want to do is to make it easy for you all to build the stuff that you want on top of Ubuntu One.
<aquarius> So if you want to have your Amarok playlists available for streaming, it should be possible to do.
<aquarius> I rather like the idea of playing a Flash game on the web and having the background music be the most appropriate music chosen from *my* music collection. That'd be cool.
<aquarius> Ubuntu One also, as you know, does file sync.
<aquarius> But just syncing files is already taken care of by Ubuntu One itself, on Ubuntu and Windows.
<aquarius> What's more interesting is working with those files.
<aquarius> So, for example, imagine being able to instantly, one-click-ly, publish a file from your application to a public URL and then tweet that URL.
<aquarius> Instant get-this-out-there-ness from your apps.
<aquarius> The screenshot tool Shutter, for example, can do this already; PrtSc to take a screenshot, then "Export > Ubuntu One".
<aquarius> They did a bunch of hard work to do that, and I massively applaud them; nice one Shutter team!
<aquarius> Based on what they did, that's the sort of thing that should be easier to do.
<aquarius> The shutter team built U1 publishing into their app, and it was harder than it should have been because the APIs were very much in flux, and they weren't very well documented
<aquarius> and we recognised that that needs fixing :)
<aquarius> So there will be easy-to-use APIs so your apps can do the same. Imagine quickly sharing your newly created image or document or recipe with the world.
<aquarius> Your app could have a button to "store all my files in the cloud", or "publish all my files when I save them", or "automatically share files that are part of Project X with my boss".
<aquarius> More to the point, you'll be able to work with files directly *in* the cloud.
<aquarius> So a backup program, for example, could back up your files straight into Ubuntu One and not sync them to your local machines.
<aquarius> that makes it easy for your app's files to be saved away from the local machine if that's what you want
<aquarius> which is ideal if you're a backup program, as mentioned
<aquarius> so your users can just say "yeah, save this straight into my online storage, I don't need it locally"
<aquarius> And of course being able to save things in and out of the cloud means that you can get an Ubuntu One sync solution on other platforms.
<aquarius> So you could work with your files from your non-Android mobile phone (we've already got the great mkarnicki working on that for Android!)
<aquarius> Build a fuse or gvfs backend for Ubuntu or Fedora or SuSE or Arch Linux. Build a WebDAV server which works with Ubuntu One and mount your Ubuntu One storage as a remote folder on your Mac.
<aquarius> so if you prefer to think of your online storage as a drive, rather than something which files are synced to, you can make that happen for yourself and for your users if you want to
<aquarius> And web apps can work with your cloud too, for files as well as data.
<aquarius> Imagine, say, a torrent client, running on the web, which can download something like a movie or music from legittorrents.info and save it directly into your cloud storage.
<aquarius> So you see an album you want on that torrent site (say, Ghosts I by Nine Inch Nails) and go tell this web torrent client about it (and you've signed in to that web torrent client with Ubuntu One)
<aquarius> And the website then downloads that NIN album directly into your personal cloud -- which of course makes it available for streaming direct to your phone.
<aquarius> You could do that with videos as well: choose a torrentable video (say, Beyond the Game, the documentary about World of Warcraft) and download that directly into your cloud, if someone built the web torrent client.
<aquarius> (Of course, that would be cooler if Ubuntu One offered a video streaming service as well as music streaming, wouldn't it. Hm... ;-)
<aquarius> But it's not just about your content for yourself; think about sharing.
<aquarius> Ubuntu One lets you share a folder with people. This would be great for distribution.
<aquarius> Imagine that you publish an online magazine.
<aquarius> So, you create a folder on your desktop, and put issues of the magazine in it.
<aquarius> Then, you put a button on your website saying "Sign in with Ubuntu One to get our magazine".
<aquarius> When someone signs in, your website connects to the Ubuntu One files API, with your private OAuth token, and adds that signed-in user to the list of people that your magazine folder is shared with.
<aquarius> Then, whenever your magazine has a new issue, you just drop it into that folder on your desktop.
<aquarius> (Or even upload it to Ubuntu One directly through the website.)
<aquarius> All the subscribed people will get the new issue instantly, on all the machines they want it on, and in the cloud.
<aquarius> No-one has to do anything. No polling of RSS feeds, no bandwidth use by your website
<aquarius> You could build a cool Ubuntu app for your readers which would see that a new issue of the magazine has arrived on the machine and lets them read it
<aquarius> You could distribute anything like this. Imagine a podcast, or chapters of a novel.
<aquarius> It would also work for paid-for content; when someone pays, have your code share a folder with them, and put their paid-for stuff in that folder. That's all doable through the files API.
<ClassBot> There are 10 minutes remaining in the current session.
<aquarius> We're building the files API itself (an HTTP-based REST API) and also some wrappers for it to make it easier to use in your apps from Python and the like.
<aquarius> OK, I've talked about a blizzard of ideas that'll be made possible, and shown you almost no code.
<aquarius> Which is because, as mentioned at the beginning, a lot of this code is currently being written and tested as part of the 11.04 release :)
<aquarius> However, code is nothing without documentation, and that's really important.
<aquarius> My main task for this cycle is to build documentation for all of this stuff; how to use Ubuntu One and all the APIs we provide in the cloud, on Android, on Windows, on iOS, on Ubuntu.
<aquarius> So there'll be documentation for all this stuff so all of you clever people can build things that I haven't even dreamed of.
<aquarius> We did some user research (thanks ivanka and the user research team!) on which sites have great API documentation and which don't, so we have an idea of good directions to go in.
<aquarius> And I'm working away feverishly on getting an alpha version out!
<aquarius> So, what I'd like to know is: what are your cool ideas? What help do you need from me in making them happen? What do you want to use Ubuntu One for in your apps and your scripts and your work?
<aquarius> and I've got about five minutes left, I think, so I'm happy to answer questions if anyone has any
<aquarius> otherwise, thanks for listening and I can hand over to alecu who is going to talk about DBus :)
<alecu> hello all
<ClassBot> There are 5 minutes remaining in the current session.
<alecu> let's wait a couple more minutes and then we'll start
<ClassBot> chadadavis asked: What's the best way to stay up to date on the API documentation status?
<aquarius> chadadavis, watch the U1 blog where we'll announce that the developer site is available
<alecu> hello all
* 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 easily with DBus - Instructors: alecu
<alecu> My name is alecu, some people also call me "Alejandro J. Cura"
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/13/%23ubuntu-classroom.html following the conclusion of the session.
<alecu> I'm a developer on the Ubuntu One team, currently working on the desktop side of Ubuntu One.
<alecu> For the past year or so I've been using DBus a lot to do bits and pieces of my work, so I'd like to share a bit of that during this session.
<alecu> As you all probably know, DBus is a way for applications to request services from other applications.
<alecu> For instance, Ubuntu One asks the gnome-keyring daemon for passwords.
<alecu> Or the sound menu asks the music players to start playing or to change tracks.
<alecu> so, let's dive into an example...
<alecu> for this we need to have d-feet installed
<alecu> sudo apt-get install d-feet
<alecu> so, everybody has d-feet installed by now?
<alecu> open it, and let's browse the Dbus bus a bit
<alecu> go to File -> Connect to Session
<alecu> and we will be able to explore the Session Bus
<alecu> on the left we have a list of Bus Names. It's common for each application that's providing a service to use one, but some apps export more than one Bus Name.
<alecu> clicking on one of the Bus Names, we'll see a list of Object Paths on the right
<alecu> it's very common for one application to export more than one Object Path
<alecu> if you click on one Bus Name and no object paths appear, that means that the application is not providing introspection data, and that means that we'll need to ask the app developers for more info on how to use those services thru dbus.
<alecu> but the common case is to have both introspection data and some dbus documentation...
<alecu> let's look at one example
<alecu> let's open banshee, or some rhythmbox
<alecu> when we run banshee, we'll see on d-feet that a new "Bus Name" was published to provide services to other apps
<alecu> try clicking on d-feet on it: org.bansheeproject.Banshee
<alecu> on the right hand we'll see a few Object Paths
<alecu> let's open /org/mpris/MediaPlayer2
<alecu> and open the "org.mpris.MediaPlayer2.Player" interface
<alecu> Inside that interface we'll see a list of Methods, Properties and Signals
<alecu> let's try one Method: play
<alecu> sorry, Play()
<alecu> double click on it, and a new small window opens "Execute D-Bus Method"
<alecu> just click on Execute
<alecu> banshee should start playing
<alecu> (if it does not, try making it play some song by hand, then pausing it thru d-feet)
<alecu> and then try playing with the other methods
<alecu> for instance, Seek takes a parameter, try 30000000
<alecu> or -30000000
<ClassBot> chadadavis asked: there are a few 'play' methods under other object paths. Why are there so many? What's the difference, in the case of banshee here?
<alecu> chadadavis, you mean Play and PlayPause?
<alecu> I think Play always plays, but PlayPause is like a toggle.
<alecu> chadadavis, the thing is that I don't know exactly how that works, and since it won't be documented in a DBus browser like d-feet we need to find some spec
<alecu> and I was just pointing all of you to this example, because there's a lovely documentation for this interface, and it's common to many-many media players.
<alecu> it's http://xmms2.org/wiki/MPRIS
<alecu> and for the work I've been doing for the gnome-keyring and kwallet, I've been using the "Secrets Service API" http://people.collabora.co.uk/~stefw/secret-service/
<alecu> so you'll probably need some similar docs for the service you are trying to use
<alecu> or just use an explorer like d-feet to experiment with the interface you want.
<alecu> So, after finding some service that you want to use, and some docs on it, you'll want to use DBus from your own application.
<alecu> I've mostly used python for this, but I understand that other bindings are similar.
<alecu> Here's a few examples I've made, so we can go over:
<alecu> bzr branch lp:~alecu/+junk/dbus-lessons
<ClassBot> crazedpsyc asked: if credentials are transported through DBus, can't I, or anyone else see them by using something like dbus-monitor?
<alecu> crazedpsyc, there is one instance of DBus running for the system, and an instance per user that's logged in.
<alecu> crazedpsyc, DBus connections are always local, and are either in the context of your computer or your session.
<alecu> crazedpsyc, there are security rules on the system DBus, so apps are limited on what they can listen to.
<alecu> crazedpsyc, for the session DBus I haven't seen any security restrictions, so afaict any app can listen for all the Dbus traffic for every other app.
<alecu> crazedpsyc, that includes listening for the same logged in user credentials, but any X window app can capture all keystrokes anyway, so there's no point in securing that.
<alecu> crazedpsyc, makes sense?
<alecu> crazedpsyc, we can discuss this on much detail later, since app sandboxing is an issue I find very interesting to work on.
<alecu> anyway, let's go back to the samples
<alecu> let's look at the first one: 01-call_method.py
<alecu> DBus usually has to work together with the main loop of your application
<alecu> usually it's the gtk or kde main loop, and DBus supports it.
<alecu> But you can also use the twisted reactor as a main loop, and we'll be able to integrate that as well.
<alecu> in this example I'm using the gobject main loop, as used by gtk.
<alecu> this line joins dbus with the loop: "DBusGMainLoop(set_as_default=True)"
<alecu> and on the following lines we get at the "Session Bus", get an object from it using a "Bus Name" and an "Object Path"
<alecu> and we get an "Interface" from that object.
<alecu> as you can see, it all matches what we are able to see on d-feet.
<alecu> once we get an Interface, we can call on the Methods on it, and access its Properties
<alecu> in this example I'm just changing the brightness of my laptop display, and depending on your hardware it might not work.
<alecu> So I'll ask you all for homework to modify it so it changes the volume of the music player.
<ClassBot> psusi asked: What is the use of naming the Interface of an object separtely from the name of the object itself?  Can this be used to publish versioned interfaces to, for instance, add a new argument to a signal without breaking applications that depend on the interface without the argument?
<alecu> psusi, exactly. We can add more than one interface for an object, to group interfaces per intent, so for instance the MPRIS spec separates the methods in the Player from the Playlist interfaces, and also as you very correctly point out to create a new interface and not break compatibility with older interfaces.
<alecu> Ok, let's look a bit further into arguments for the Methods
<alecu> since DBus is language agnostic, it defines a way to specify the types of the arguments and return values of DBus Methods
<alecu> each language binding will try to match it to native types. For instance the python binding will usually transform DBus byte arrays into python strings
<alecu> (python 2 strings, that is :-) )
<alecu> so Dbus has a way of specifying a small string that will act as the signature for the types in a DBus method call
<alecu> for instance let's browse with d-feet the org.mpris.MediaPlayer2.Playlists interface
<alecu> the GetPlaylists method has a very complicated signature
<alecu> Uint32 index, Uint32 maxcount, String order, Boolean reverse_order
<alecu> in dbus you'll usually see this as "uusb"
<alecu> and the return value for that method is array of [struct of (object path, string, string)]
<alecu> you'll see it defined as "a(oss)"
<alecu> for a complete reference of this, and much more, try this tutorial: http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html#data-types
<alecu> we'll need to define strings similar to this when we export our own objects on DBus as services
<alecu> so let's look at example 03-export_object.py
<ClassBot> There are 10 minutes remaining in the current session.
<alecu> in this example I'm exporting a DBus object on a given "Bus Name" and with a given "Object Path"
<alecu> and when I run the example, I can use d-feet to call the example_method. Go ahead, try it.
<alecu> In addition to the Method, I'm also exporting a "Signal"
<alecu> Signals work backwards
<alecu> Usually a dbus client calls a method.
<alecu> But the clients subscribe to signals, and the dbus service calls them.
<alecu> We can see how to subscribe to a signal in example 2
<alecu> in 02-listen_signal.py we connect to the bus, and using a "Bus Name", an "Object Path" and an "Interface", we connect a function of our code to a DBus signal.
<ClassBot> There are 5 minutes remaining in the current session.
<alecu> in this example I also use the BackLight, but as homework as well you may change listen to media player signals as well.
<alecu> ok, this was a brief overview of how to use DBus in your code.
<alecu> I hope you follow the examples and start using DBus to take control of all the apps in your desktop.
<alecu> Let's do a bit of Q/A if we have a bit more time.
<alecu> And don't hesitate to ask me more questions by mail if you have any problems when working with DBus.
<alecu> and please let me know what you ended up doing with DBus! :-)
<ClassBot> chadadavis asked: so, when you setup a signal for others to subscribe to, you're responsible for sending them? Can you chain signals, with intermediate changes, to provide variations of existing signals from other services?
* 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: TouchÃ©gg: Bringing Multitouch Gestures to your Desktop - Instructors: JoseExposito
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/13/%23ubuntu-classroom.html following the conclusion of the session.
<JoseExposito> Hello everyone!
<JoseExposito> Thank you very much for joining in this session
<JoseExposito> I'm JosÃ© ExpÃ³sito and I'm the developer of TouchÃ©gg (https://code.google.com/p/touchegg/)
<JoseExposito> I'm an independent developper that tries to add more multitouch capabilities to Ubuntu/Linux desktops
<JoseExposito> and I'll try to explain what is TouchÃ©gg, how it works
<JoseExposito> how you can add multitouch support to your computer
<JoseExposito> and what technologies it uses.
<JoseExposito> And of course I will leave at the final of the session a bit of time for questions.
<JoseExposito> Ok, there we go :)
<JoseExposito>  
<JoseExposito> [+] Introduction to TouchÃ©gg: what is it and features
<JoseExposito>  
<JoseExposito> If you have a touch screen or a trackpad with multitouch capabilities
<JoseExposito> probably you know the options that this devices offers in others platforms
<JoseExposito> like MacOS or Windows
<JoseExposito> but we are Ubuntu/Linux users, we can't use this devices?
<JoseExposito> Yes, we can use the maximum capabilities of this kind of devices with TouchÃ©gg
<JoseExposito> and of course thanks to the work of the uTouch guys.
<JoseExposito> So, what is TouchÃ©gg?
<JoseExposito> TouchÃ©gg is a program that offer just that
<JoseExposito> the option to squeeze your trackpad or your touch screen capabilities.
<JoseExposito> You can think in your touch screen or trackpad like
<JoseExposito> a device that allows you to make a number of predefined gestures
<JoseExposito> for example drag two fingers, pinch with five fingers or tap with four finger.
<JoseExposito> Normally, making this gestures, one expects to see that the computer reacts to them and takes some action
<JoseExposito> for example, if you drag two fingers over a PDF,
<JoseExposito> you expect that the text begin to scroll or if you pinch three fingers over a window,
<JoseExposito> you expect that the windows become to resize.
<JoseExposito> TouchÃ©gg makes exactly this, is responsible of recognize this multitouch gestures
<JoseExposito> and make a configurable action.
<JoseExposito> In adition, TouchÃ©gg has a GUI (graphical user interface)
<JoseExposito> that allow you to configure this gestures and action in a very simple way
<JoseExposito> you can see here an screenshot:
<JoseExposito> https://lh3.googleusercontent.com/_ReRtolbPWnI/TXpw1FD8jAI/AAAAAAAAAGs/g2d7SUaCPow/touchegg-gui-kde1.png
<JoseExposito> Ok, but what gestures it support?
<JoseExposito> These gestures can be divided in four big families:
<JoseExposito> Tap: A tap gesture is, at this name suggests, a âclickâ over your trackpad with one to five fingers.
<JoseExposito> Drag: Again the name is self-descriptive
<JoseExposito> to make this gesture you only need to move two
<JoseExposito> to five fingers over your trackpad.
<JoseExposito> In addition this gesture allow to define directions,
<JoseExposito> ie drag three fingers up, for example to maximize a window
<JoseExposito> or drag three fingers down, for example to minimize a window.
<JoseExposito> Pinch: Pinch is... a pinch!
<JoseExposito> You just only have to imagine the tipical gesture
<JoseExposito> that you can make in you smartphone to zoom the window...
<JoseExposito> If you have one, my phone still have keys ;)
<JoseExposito> In the future this gesture will allow directions (in and out)
<JoseExposito> like the drag gesture
<JoseExposito> for example to integrate TouchÃ©gg with your favorite photo viewer
<JoseExposito> to zoom in or zoom out your photos.
<JoseExposito> Tap&hold: This is a composite gesture with a tap and a drag
<JoseExposito> I think that everyone has used it for example to select text
<JoseExposito> but of course TouchÃ©gg allows to personalize this gesture with any action and use it with up to five fingers.
<JoseExposito> In the future, I hope that when Natty will be ready, TouchÃ©gg will support more gestures, such as âRotateâ or âDouble Tapâ.
<JoseExposito> And what about the actions?
<JoseExposito> TouchÃ©gg allow you to make 14 differents actions
<JoseExposito> that you can be associe to the gestures
<JoseExposito> This is the full list:
<JoseExposito> MOUSE_CLICK â This action allows you to emulate the mouse
<JoseExposito> Tipically are assigned to a one, two and three fingers tap to make left, right and middle mouse click respectively
<JoseExposito> but of course you can assign this action to any gesture
<JoseExposito> VERTICAL_SCROLL and HORIZONTAL_SCROLL â As the name suggest
<JoseExposito> these actions allows you to make a scroll, like with your mouse wheel. Tipically asigned to the two fingers drag gesture
<JoseExposito> MINIMIZE_WINDOW â To minimize the window under cursor.
<JoseExposito> MAXIMIZE_RESTORE_WINDOW â To maximize the window under the cursor or, if is already maximized, to restore it.
<JoseExposito> CLOSE_WINDOW â To close the window under the cursor.
<JoseExposito> MOVE_WINDOW â Allows you to move a window across the screen.
<JoseExposito> RESIZE_WINDOW â To change the size of the window under the cursor, should be used with a pinch gesture.
<JoseExposito> SHOW_DESKTOP â In the first execution shows the desktop, in the second execution restores all windows.
<JoseExposito> CHANGE_DESKTOP and CHANGE_VIEWPORT â These actions allows you to change between virtual desktops
<JoseExposito> the difference is that some window managers, like Compiz uses by default âviewportsâ and other like KWin uses âvirtual desktopsâ
<JoseExposito> SEND_KEYS â Probably one of the most versatile actions
<JoseExposito> allows you to assign a shortcut to a gesture for example to use Compiz effects or any specifies application shortcut.
<JoseExposito> RUN_COMMAND â Another of the most versatile actions
<JoseExposito> This actions allows you to run a command making a gesture, not only useful to run applications, using dbus or custom scrips this action can be really useful.
<JoseExposito> DRAG_AND_DROP â Allows you to emulate the classical one finger tap hold gesture
<JoseExposito> for example to select text but also with the mouse right or middle button.
<JoseExposito> With this combination of gestures and actions
<JoseExposito> you can get all the capabilities of your trackpad
<JoseExposito> with the more classical and basic gestures
<JoseExposito> like make a right buttons click tapping with two fingers
<JoseExposito> or other more advanced like resize a window pinching with three fingers,
<JoseExposito> use the âExposseâ Compiz effect dragging four fingers up
<JoseExposito> move a windows making a tap&hold gesture with two fingers
<JoseExposito> or zooming your photos making a double tap with five fingers...
<JoseExposito> And make this is very easy, you only need to select the gesture and their associated action in the TouchÃ©gg-GUI.
<JoseExposito> I recomend you to try TouchÃ©gg, especially in Natty
<JoseExposito> where the uTouch team guys have done an excellent job with the multitouch support
<JoseExposito> but if you are fearful, you can see TouchÃ©gg in action in this video:
<JoseExposito> http://www.youtube.com/watch?v=1Ek4QaFQ1qo
<JoseExposito> Common, go to see the video!
<JoseExposito> Ok, and this is all?
<JoseExposito> No :P
<JoseExposito> In my humble opinion, the multitouch interface is the future
<JoseExposito> but for the moment not all applications have support for this gestures
<JoseExposito> This suppose a problem, imagine that you want to zoom your photos making a two fingers pinch gesture
<JoseExposito> but in adition you want to zoom a web page making also a two fingers pinch
<JoseExposito> Well, in this moment probably you think
<JoseExposito> no problem, I can go to the TouchÃ©gg-GUI and assign the shorcut to this gesture
<JoseExposito> but...
<JoseExposito> OMG, the shorcut is different in your photo viewer and in your web explorer!
<JoseExposito> For this reason TouchÃ©gg incorporates a new feature in the next version
<JoseExposito> a new option that allow you to assing diferent actions for different applications
<JoseExposito> Thus now you can assing a different shortcut to the two fingers pinch gesture
<JoseExposito> in your photo viewer and in your web browser
<JoseExposito> With this new option, TouchÃ©gg lets you to add a multitouch layer easyly in your desktop.
<JoseExposito> And basically this is TouchÃ©gg and these are their options
<JoseExposito> In conclusion, the main idea is that you have global gestures
<JoseExposito> application specific gestures
<JoseExposito>  and actions that should be executed with these gestures
<JoseExposito> and TouchÃ©gg brings you the option to manage all with a simple and intuitive graphical user interface.
<JoseExposito>  
<JoseExposito> [+] Technologies used to develop TouchÃ©gg: uTouch-GEIS and Qt
<JoseExposito>  
<JoseExposito> For now we have talked about what is TouchÃ©gg and what it makes but no about how it makes that
<JoseExposito> This part is more technical that the previous part and probably will be more interesting for developers
<JoseExposito> anyway I'll try to make it easy to understand and funny as possible for the non-developers attendees
<JoseExposito> TouchÃ©gg is developed in C++ and it uses two mainly tecnologies: Qt and uTouch-GEIS.
<JoseExposito> First I'm going to talk briefly about Qt
<JoseExposito> becouse I think that is a very popular workspace and many people will know it
<JoseExposito> Many people thinks that Qt is only a framework to build graphical interfaces
<JoseExposito> and of course, TouchÃ©gg-GUI uses Qt to make one, but Qt is more than this
<JoseExposito> Qt have many classes that facilitates programming, like work with XML, threads, sockets, dbus, etc, etc
<JoseExposito> And the better is that is multiplatform and binaries generated using this technology are small and fast!
<JoseExposito> Talk about the advantages of Qt probably need other complete conference, in fact this year Qt is the issue of many conferences, so I'm going to talk about uTouch-GEIS.
<JoseExposito> In Ubuntu 10.10 Canonical made an important contribution to the open source comunity with uTouch
<JoseExposito> a complete framework composed by many differents tools to bringing Linux multitouch support.
<JoseExposito> TouchÃ©gg uses uTouch-GEIS, that is an API that makes very easy to developers get the produced gestures in the multitouch devices.
<JoseExposito> Now in Ubuntu 11.04 Natty, the new multitouch support is awesome
<JoseExposito> the uTouch-team has done an excellent job. I can't talk about the technical part of uTouch-GEIS
<JoseExposito> anyway you can see an excellent explanation about it here:
<JoseExposito> https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/Multitouch
<JoseExposito> For developers uTouch-GEIS bring two differents interfaces, one simplified and other more complex
<JoseExposito> For the objetives of TouchÃ©gg, the simpified interface is more than sufficient, you can see a little example code here:
<JoseExposito> https://bugs.launchpad.net/utouch-geis/+bug/754135/+attachment/2004778/+files/test.cpp
<JoseExposito> And ofcourse the TouchÃ©gg source code:
<JoseExposito> https://code.google.com/p/touchegg/source/browse/#svn%2Ftouchegg%2Fsrc%2Ftouchegg
<JoseExposito> I think that for a C or C++ developer beging to use uTouch is really easy and in adition the documentation is excellent:
<JoseExposito> http://people.canonical.com/~stephenwebb/geis-v2-api/
<ClassBot> There are 10 minutes remaining in the current session.
<JoseExposito> And well, this is all, you can make now questions
<JoseExposito> and remember that you can contact with me to make more questions, report a bug or request new features for TouchÃ©gg here:
<JoseExposito> https://code.google.com/p/touchegg/issues/list
<ClassBot> There are 5 minutes remaining in the current session.
<ClassBot> alecu asked: what API are you using to get the multi touch events?
<ClassBot> alecu asked: I'm developing a game that will use multitouch directly, so will it be possible to disable TouchEgg events for one specific window?
* 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: Unity: Integrating with Launcher and Places - Instructors: kamstrup
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/13/%23ubuntu-classroom.html following the conclusion of the session.
<kamstrup> Hi all!
<kamstrup> So I guess I am up now
<kamstrup> My name is Mikkel Kamstrup Erlandsen and i work for Canonical on the DX team
<kamstrup> In my spare time I also dabble with software, namely Zeitgeist and search engines
<kamstrup> On the DX team I am working on all the backend and infrastructure stuff
<kamstrup> so not so much all the fancy graphics you see in Unity
<kamstrup> but all that goes on beneath it :-)
<kamstrup> In particular relevant for this session libunity
<kamstrup> libunity is a library with the purpose of instrumenting and integrating with Unity
<kamstrup> For the Natty cycle you'll be able to integrate with the Launcher and the Places/Lenses
<kamstrup> (btw for this session I'll call it Places - but in the Oneriric cycle we'll officially change to Lenses)
<kamstrup> (it's just that "places" is in my muscle memory right now :-))
<kamstrup> One big caveat emptor before we proceed too far
<kamstrup> libunity does not currently have API or ABI stability guarantees
<kamstrup> we will work on that - promised - but we also want to ensure that the API is really really nice before we freeze it
<kamstrup> and in fact
<kamstrup> I can already guarantee that there will be slight changes when we begin the Oneiric cycle
<kamstrup> but that said
<kamstrup> You can already take libunity for a spin and do some pretty impressive stuff with it
<kamstrup> fx. both the Apps and Files places are implemented with libunity
<kamstrup> there's no "priviledged" Unity API for those two buggers
<kamstrup> anyone here will be able to do exactly what they do
<kamstrup> Before we start talking about the places let's talk about the Launcher integration
<kamstrup> The Launcher integration is a lot simpler than the places
<kamstrup> So enough with the intro talk
<kamstrup> --------------------
<kamstrup> The Unity Launcher
<kamstrup> The simplest way you can integrate with the launcher is via what is called "static quicklists"
<kamstrup> https://wiki.ubuntu.com/Unity/LauncherAPI#Static%20Quicklist%20entries
<kamstrup> If you follow that link you'll see a snippet from a normal .desktop file
<kamstrup> If you take a normal .desktop file and add [Foo Shortcut Group] entries to it like shown
<kamstrup> you can add quicklist right there
<kamstrup> Look at your own /usr/share/applications/evolution.desktop for a live example
<kamstrup> What static quicklist elements can basically do is launch an executable
<kamstrup> so very simple
<kamstrup> no programming required
<kamstrup> If you want to get a bit more power
<kamstrup> you need to use libunity
<kamstrup> More specifically the LauncherEntry API
<kamstrup> For the sake of the examples we'll use Python examples today, but you can also code in Vala, C
<kamstrup> (or C++ if you manually write the C calls out)
<kamstrup> You'll see the API here http://developer.ubuntu.com/api/ubuntu-11.04/GIR/python/Unity-3.0.html#Unity.LauncherEntry
<kamstrup> it may deserve mention that we are starting to push up Python docs for the libs generated via GObject Introspection to http://developer.ubuntu.com/api/
<kamstrup> Anyway
<kamstrup> Looking at the LauncherEntry docs you'll see that it only has static constructors - not conventional constructors
<kamstrup> that's because you always get a "singleton" back for the particular app
<kamstrup> Let me find an example
<kamstrup> Here http://bazaar.launchpad.net/~unity-team/libunity/trunk/view/head:/examples/launcher.py
<kamstrup> You can set 3 main properties on the launcher entry
<kamstrup> A "count" that will be displayed as a number on the top part of the tile
<kamstrup> you may have seen this on apps like Evolution displaying the number of unread mails this way
<kamstrup> Then you can add a progress bar
<kamstrup> the values for progress must be between 0 and 1
<kamstrup> (and it's a float)
<kamstrup> You can also set the urgency hint
<kamstrup> Some may know that an "urgency hint" is something you normally have on X11 windows
<kamstrup> it makes the WM flash the window icon
<kamstrup> the difference here is that the libunity urgency doesn't require a window on the screen in order to mark an app as requiring attention
<kamstrup> this can be useful for background processes like Ubuntu One or others that need to draw your attention to their icon when they don't have a window on screen somewhere
<kamstrup> The last part of the LauncherEntry API is that you can set a "dynamic quicklist"
<kamstrup> The dynamic quicklists differ from the static ones in that you can build and update them programmatically at runtime
<kamstrup> You simply have access to a libdbusmenu DbusmenuMenuItem instance that you can populate how you like
<kamstrup> ok
<kamstrup> any questions on the laucnher api before we move on?
<kamstrup> ------------
<kamstrup> so now to Places
<kamstrup> As said before the situation here is slightly regretable
<kamstrup> It's known both as Lenses and Places in Natty
<kamstrup> For Oneiric we'll change to Lenses only
<kamstrup> (also in the all the public APIs)
<kamstrup> but for now let me call them Places
<kamstrup> Places run outside the core Unity process
<kamstrup> Think of them very much like remote database that provides data for Unity to render
<kamstrup> if you've worked with modern web development frameworks or MVC in UIs think that the place provides the *model* and Unity is a generic View
<kamstrup> Of course we have the standard Apps and Files places
<kamstrup> they are not very good beginner examples unfortunately
<kamstrup> but there are a few simple examples to start from that lots of ppl have found instructive
<kamstrup> If we stick to the Python example again
<kamstrup> you can check it out from lp:~unity-team/unity-place-sample/unity-place-python
<kamstrup> or for now just browse it online at http://bazaar.launchpad.net/~unity-team/unity-place-sample/unity-place-python/files
<kamstrup> First look at python.place
<kamstrup> All places register themselves to unity via a .place file
<kamstrup> installed under /usr/share/unity/places
<kamstrup> in a .place file you specify some contact info for Unity to find you on dbus
<kamstrup> Then each place has one or more PlaceEntries
<kamstrup> A placeentry is prettymuch what maps to an icon in the launcher
<kamstrup> You'll probably have the Apps and Files entries in your launcher at the bottom
<kamstrup> For each entry you want to expose from your place's process you need a [Entry:Foo] line in the .place file
<kamstrup> The only place that actually has more than one place entry is the Apps place
<kamstrup> although the second one is hidden
<kamstrup> Try looking at /usr/share/unity/places/applications.place
<kamstrup> you'll see that [Entry:Runner] has ShowEntry=false and ShowGlobal=false
<kamstrup> First ShowEntry=false tells unity to not put a tile in the launcher bar for this place entry
<kamstrup> the ShowGlobal=false clause tells Unity to not include this entry's results when searching from the Dash
<kamstrup> aka home screen
<kamstrup> (the one you get when you hit <super>)
<kamstrup> There is in fact a spec for these .place files
<kamstrup> Check https://wiki.ubuntu.com/Unity/Lenses#Registration
<kamstrup> You'll also note that you can define a keyboard shortcut for you place
<kamstrup> And now we're talking about this
<kamstrup> A general best-practice is to *not* include your search results in the Dash
<kamstrup> that is please set ShowGlobal=false
<kamstrup> When I write my code I am as excited as anyone to get people using it
<kamstrup> but people really want a fast Dash
<kamstrup> and if we have Dash searches laucnhing off 3 http requests, 5 disk searches, and whatnot for each letter typed...
<kamstrup> so if you want to integrate with the Dash results make sure your results are:
<kamstrup> 1) almost always relevant
<kamstrup> 2) Super snappy
<kamstrup> 3) Doesn't use to many resources to compute
<kamstrup> and 1) is probably the key point
<kamstrup> So most places would just have their tile in the launcher and a keyboard shortcut
<kamstrup> Ok back to the code
<kamstrup> In the .place file you specify the dbus contact details for your place daemon
<kamstrup> this means that Unity will start your daemon via dbus activation
<kamstrup> no need to start it yourself on login or anything
<kamstrup> this way unity has a chance of not starting all daemons at once when you log in
<kamstrup> which would run the risk of hogging your disk
<kamstrup> ok
<kamstrup> now look at http://bazaar.launchpad.net/~unity-team/unity-place-sample/unity-place-python/view/head:/unity-place-python.py
<kamstrup> This is the code for the sample place daemon
<kamstrup> There are 3 concepts you need to know about when writing a place dameon
<kamstrup> that is 1) results 2) groups 3) sections
<kamstrup> each of these three have a Dee.Model associated with them
<kamstrup> Dee.Model is implement by a library called libdee which we use for almost all of the data sharing behind Unity
<kamstrup> Dee.Model is like a table that is shared between multiple processes
<kamstrup> if any one changes, adds, or removes from the model all the other processes watching that model will be notified of what's changed
<kamstrup> pretty powerful stuff
<kamstrup> this allows us to do a kind of "distributed MVC"
<kamstrup> so in one we have the place daemon that updates the results Dee.Model and Unity is watching that same model, updating the View whenever it changes
<kamstrup> So obviously the results_model contains all the search results
<kamstrup> then we have a sections_model
<kamstrup> the sections partition the results into disjoint logical components
<kamstrup> A sections should represent a "browsable" subset of the result space
<kamstrup> If you consider the space of all apps then the sections could be Video, Audio, Games, Office
<kamstrup> etc
<kamstrup> The sections contribute the elements of the dropdown embedded in the search bar
<kamstrup> you can also access the sections of a place via the right-click context menu on a place entry in the laucncher
<kamstrup> then there a groups
<kamstrup> the groups partition the visible result set into meaning subgroups
<kamstrup> If you are watching all hits from a file search the groups could be Today, Yesterdat, Last Week, Last Month, ... etc
<kamstrup> the groups_model and results_model both have a _global_ counterparts
<kamstrup> the global models are the ones used for searching from the dash
<kamstrup> (so you normally don't need those)
<kamstrup> btw
<kamstrup> the API docs for Dee.Model are here http://developer.ubuntu.com/api/ubuntu-11.04/GIR/python/Dee-0.5.html#Dee.Model
<kamstrup> The API docs for Dee are not fully true though
<kamstrup> it has been augmented with some Python sweetness
<kamstrup> There is currenlty no easy way to document this Python magic, but you can find a demo of the Python magic for Dee.Model here http://bazaar.launchpad.net/~unity-team/dee/trunk/view/head:/examples/pythontricks.py
<kamstrup> You can also find the docs for what exactly the columns are in all the different models on https://wiki.ubuntu.com/Unity/Lenses#Results%20Model
<kamstrup> One last thing I want to mention is "Activation"
<kamstrup> So places require special callbacks when activating some special results
<kamstrup> Fx.
<kamstrup> the apps place returns Apps Available for Download that open in the Software Center when you click the,m
<kamstrup> this is achieved via the Activation API
<kamstrup> you basically register a handler for a regex matching URIs or mimetypes
<ClassBot> There are 10 minutes remaining in the current session.
<kamstrup> then when unity tries to laucnh a it it looks for any places registered for launchoing that hit
<kamstrup> and does a Dbus callback to the place daemon giving it the URI to activate
<kamstrup> the place daemon then responds whether Unity should hide the Dash as a response or if the Dash should still be shown
<kamstrup> in case for Apps Availabale for Download we ask Unity to hide the dash
<kamstrup> (so we can load S-C)
<kamstrup> but if we fx. wanted to implemen
<kamstrup> implement
<kamstrup> a file browser fx
<kamstrup> then we could ask unity to keep the dash on screen, and then just clear our results_model and repopulate it with the contents of the clicked directory
<kamstrup> I guess I'll leave the rest for your own exploration
<kamstrup> So if anyone has questions don't hold back
<kamstrup> if that's not the case then let me take 2 minutes to talk about "renderers"
<kamstrup> if you browse https://wiki.ubuntu.com/Unity/Lenses#Renderers
<kamstrup> you'll see that we have a concept called renderers which you can specify in various places in the API
<ClassBot> There are 5 minutes remaining in the current session.
<ClassBot> tronda asked: How much focus is the Python based API getting?
<kamstrup> Almost as much as the C/Vala API
<kamstrup> we really want it to be a 1st class experience
<kamstrup> and honestly i almost think that the Python API is better than the Vala/C api right now :-O)
<ClassBot> tronda asked: Any plans to get browser to work with the libunity for web applications?
<kamstrup> not short term
<kamstrup> there are some far out plans, but nothing to hold your breath for :-)
<ClassBot> tronda asked: If working with a web service which is potentially slow - would one use Tracker/Zeitgest to index content. Any help from Unity to make this simpler?
<kamstrup> Because the place daemon is another process than Unity it's not super critical if web services are slow
<kamstrup> so I'd say "don't worry in most cases"
<ClassBot> alecu asked: when a lens adds item, I see that it can add a url to get the item picture from it, like the books lens does with book covers. Will this be standard?
<kamstrup> yes, yes it will
* 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: Tracking Source Code History with Bazaar - Instructors: jelmer
<kamstrup> i believe that you can simply insert a URL as icon and Unity will try and load it
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/13/%23ubuntu-classroom.html following the conclusion of the session.
<jelmer> hello
<jelmer> I'll be talking to you today about Bazaar, the version control system.
<jelmer> My name is Jelmer Vernooij and I'm one of the Bazaar hackers. I'll quickly go over what Bazaar is and some of the basics before briefly discussing some of the more advanced features that I think might be interesting to app developers.
<jelmer> Please ask questions, and if there are other features you're interested in and would like me to cover, please mention so. I'm more than happy to cover other Bazaar-related topics instead.
<jelmer> Bazaar is version control system, which can track the changes of your source code over time. You might be familiar with other version control systems such Subversion, CVS, Perforce or Visual Sourcesafe.
<jelmer> Like many current generation version control systems, such as Git or Mercurial, Bazaar is distributed. This means that somebody who checks out the source code gets a full copy of the history on their local machine rather than having a central location with the full history and requiring all changes to happen on that central server.
<jelmer> Every clone of your source history will have a hidden .bzr/ subdirectory which contains Bazaar metadata. You can use the bzr command to inspect and add to the history of your tree.
<jelmer> To version a tree using Bazaar, run "bzr init" in the root followed by "bzr add" to add the files you would like Bazaar to track. When you're happy, run "bzr commit" to store the first revision of your tree.
<jelmer> Bazaar will ask you for a description of your changes. Later on, when you've changed files you can run "bzr commit" again to store those changes as a new revision.
<jelmer> This creates a series of revisions, named a branch.
<jelmer> Let's try this with a simple hello world program:
<jelmer> $ mkdir hello
<jelmer> $ cd hello
<jelmer> $ bzr init
<jelmer> Bazaar should now tell you that it's created a branch and what file format it used.
<jelmer> After you've done this you should see a .bzr/ meta directory if you run "ls -a".
<jelmer> Now, create a file and tell Bazaar to track its history. I'm creating hello.sh which simply prints "Hello, World" on standard out.
<jelmer> $ bzr add hello.sh
<jelmer> You can now use "bzr commit" to store this as your first revision.
<jelmer> are there any questions so far ? Am going too fast, should I skip the basics?
<jelmer> Sorry, s/Am/Am I/
<jelmer> $ bzr commit
<jelmer> This will launch your editor and allow you to specify a message describing your changes. Since this is our original commit, I usually just type "Initial commit"
<jelmer> To look at the history of your source code later, you can use various bzr subcommands. Mostly commonly used are "bzr log", "bzr diff", "bzr cat" and the graphical "bzr qlog" (a QT revision browser) and "bzr viz" (a GTK+ revision browser).
<jelmer> If you change your file again you can run "bzr commit" to store your new changes.
<jelmer> "bzr log" should show you two revisions at this point.
<jelmer> To share code, you can push your branch somewhere using the "bzr push" command, pull in new changes from somebody else using the "bzr pull" command or create a clone of a branch found elsewhere using "bzr branch".
<jelmer> Bazaar allows you to push over the HTTP, SSH, SFTP and FTP transports as well as to local paths.
<jelmer> "bzr push" and "bzr pull" only allow you to add new revisions to existing history. If two branches have different changes, then you can use "bzr merge" to merge the two branches. If you merge somebody else's branch then their changes will be merged into your local tree. When you're happy with the way the trees were merged, you can run "bzr commit" to create a new revision that joins the changes.
<jelmer> Bazaar integrates with various other Ubuntu related tools. For example, Launchpad uses Bazaar as its version control system. You can push branches to Launchpad so others can access them.
<jelmer> Launchpad can also import branches from other version control systems like Git, Subversion, Mercurial or CVS for you. Launchpad will automatically add links on a branch page for bugs that have been marked as fixed by that branch.  You can use a shorthand ("lp:") to address Launchpad from within Bazaar.
<jelmer> Let's try to push the branch we created earlier to Launchpad. Assuming you're already logged in to Launchpad you can run "bzr push lp:~YOURNAME/+junk/hello".
<jelmer> Where YOURNAME is your Launchpad user name. If you get an error about logging in, you need to tell Bazaar about your Launchpad id by running "bzr lp-login".
<jelmer> This will create a branch named hello in your area of Launchpad that's not tied to a particular project. Use "bzr lp-open" to see Launchpad's page for your newly created branch.
<jelmer> QUESTION: So, you generally don't push from your working directory to someone else's, but rather to a common directory that you use for accumulating and tracking versions?
<jelmer> There is no right answer to this, but usually you push to a central location, where all developers pull in new upstream changes from that central location and their branches eventually get merged into the upstream location again.
<jelmer> For more information on the possible workflows, see this wiki page: http://wiki.bazaar.canonical.com/Workflows
<jelmer> What works best for you depends on the goals of your project, the number of developers, etc.
<jelmer> For example, in Bazaar we have a robot that is the only one with write access to our main branch. When a developer makes a change they push their branch to Launchpad, send an email to the robot and the robot will merge their branch, run the testsuite and only push to the main branch if all tests passed.
<jelmer> QUESTION: what does the --use-existing mean? when you bzr push --use-existing lp:~YOURNAME/=junk
<jelmer> --use-existing means that Bazaar will push to a location, even if that location is a directory with existing files. You shouldn't have to use it for Launchpad
<jelmer> To clone an existing branch on Launchpad, you can use "bzr branch" as I mentioned earlier. For example, you can make a clone of pydoctor project by running "bzr branch lp:pydoctor pydoctor".
<jelmer> There are several useful plugins available for Bazaar. If you're a web developer, you might want to have a look at bzr-upload. If you are doing Ubuntu or Debian packaging you might be interested in the bzr-builddeb plugin.
<jelmer> "bzr plugins" will print a list of plugins you currently have installed.
<jelmer> For a full list of the available plugins, have a look at this page: http://wiki.bazaar.canonical.com/BzrPlugins
<jelmer> The most commonly used ones are also packaged separately in Ubuntu.
<jelmer> You might in particular be interested in the bzr-gtk or qbzr plugins, which provide a graphical interface on top of Bazaar.
<jelmer> ("bzr-gtk" and "qbzr" are also the names of their respective packages in Ubuntu)
<jelmer> E.g. qbzr provides the "bzr qlog" command I mentioned earlier which allows you to browse history. Another useful command is "bzr qannotate" which will show you for each line in a file in which revision it was last modified, as well as the author of that revision and the message associated with that revision.
<jelmer> As I mentioned earlier, Launchpad can import revision history from other version control systems. It has upstream imports of a lot of upstream projects.
<jelmer> For example, lp:bzr is the upstream Bazaar source code, and lp:samba is the upstream Samba source code (Samba's source code is maintained in Git).
<jelmer> Launchpad also has branches for all source packages in Ubuntu. If you have a recent version of Bazaar installed, you can check out these branches by using "bzr branch ubuntu:PACKAGENAME"
<jelmer> One of the latest cool features of Launchpad are source recipes. Recipes are simple scripts of a couple of lines that can combine branches and build Debian source packages from them.
<jelmer> Launchpad can regularly (usually once a day, if one of the branches changed) build recipes for you. This is really useful if you want to regularly build Ubuntu packages of revisions of your application. It allows users to easily run the latest revision of your application.
<jelmer> The recipes are built at most once a day, when one of the branches in the recipe changes.
<jelmer> The resulting packages end up in a PPA.
<jelmer> Let's have a look at a recipe for the pydoctor tool - https://code.launchpad.net/~jelmer/+recipe/pydoctor-daily
<jelmer> At the bottom of the page you can see that this recipe combines two branches:
<jelmer> lp:pydoctor, which contains the upstream source code and  lp:~jelmer/pydoctor/unstable which contains packaging metadata.
<jelmer> This recipe is built daily without any intervention from anybody other than new revisions being pushed to Launchpad. As you can see, the last time it was built was on March 21, when Michael Hudson (the developer of pydoctor) made a change to the upstream branch. This caused a new package to be built into my PPA.
<jelmer> Packaging is outside of the scope of this session, as are recipes, but if you're interested I'd recommend watching Matthew Revell's screencast that explains recipes in more detail.
<jelmer> http://blog.launchpad.net/cool-new-stuff/source-package-recipes
<jelmer> Speaking about documentation... Bazaar has a lot of good user documentation, most of which can be found on our web site: http://doc.bazaar.canonical.com/bzr.dev/en/
<jelmer> Is there anything else you would like me to cover?
<jelmer> If you're already using Bazaar, is there anything that you find problematic? Perhaps I can give hints to improve your workflow.
<jelmer> QUESTION: how would i "bzr push" behind a proxy/firewall?
<jelmer> That's a good question. For just pushing over HTTP (which we support too, but which is not supported by Launchpad), you can set the http_proxy environment variable.
<ClassBot> There are 10 minutes remaining in the current session.
<jelmer> Looking at the docs quickly I can't find any details on using SSH over a proxy.
<jelmer> You should be able to use corkscrew, see http://www.omappedia.org/wiki/Using_bzr_and_launchpad_behind_a_proxy for details.
<jelmer> Are there any other questions?
<jelmer> QUESTION: outside of hosting sites like launchpad, how does one traditionally send a merge request? Is there a way to link repositories? Or do you just simply pull from it and see?
<jelmer> You can either just ask the person that you would like to do the merge informally. ("I have fixed bug X and my branch is at location http://..../, please merge"); or you can send them an email that contains the changes ("bzr send --mail-to=their-email-address")
<ClassBot> There are 5 minutes remaining in the current session.
<jelmer> Only one minute remaining.. thanks for attending. If you have any further questions, don't hesitate to ask in #bzr
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/13/%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 2011-04-14
<Skilly>  p
<ilias> hi
<ilias> anyone?
<ilias> help
<ilias> cuc
<P05TMAN> Hello
<dpm> hello everyone, Ubuntu App Developer Week is starting in a few minutes!
<c2tarun> hellp dpm
<c2tarun> hello :)
<yofel> o/
<c2tarun> yofel: surprise to see you here :/
<yofel> :P
<dpm> :)
 * DraZoro says hi all 
<c2tarun> I think its time :/
<c2tarun> !time
<dpm> let's wait for a few minutes for the first speaker to turn up...
<TheEvilPhoenix> c2tarun:  uh... lol?
<jryannel> sorry I'm late
<TheEvilPhoenix> !time
<TheEvilPhoenix> :P
<dpm> jryannel, no worries
<dpm> Everyone welcome the first speaker of today. It's Qt's jryannel, who's going to talk about Qt Quick: Elements/Animations/States
<c2tarun> jryannel: hello :)
<jryannel> Hi all,
<jryannel> Before we do, plase download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-composing-uis.pdf
<TheEvilPhoenix> wait a sec, why hasnt Classbot +m'd the place yet?  shouldn't it be doing that?
<jryannel> Can I continue?
<jryannel> There are also the examples/labs available at: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/addons/addon-qml-composing-uis.zip
<jryannel> This is part of our Qt Quick Essentials Training Material. Available to download from: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition
<jryannel> We skip the first slides (we covered it roughtly yesterday) and go ahead to slide 21 (Anchors)
<jryannel> We learned yesterday we can position elements by x, y and width/height.
<jryannel> Often we want to layout elements
<jryannel> this is done with anchors
<jryannel> A anchors is another contract
<jryannel> It says roughly this element shall always be on the left site of the other element
<jryannel> anchors.left: other.left
<jryannel> So also when you move one element the other will always follow
<jryannel> You have top/bottom/left/right anchors
<jryannel> and also horizontalCenter/verticalCenter
<jryannel> Slide 22:Anchors
<jryannel> This is an example how to use anchors
<jryannel> remember you can reference other elements by id
<jryannel> anchors.centerIn: rectangle1
<jryannel> centerIn centers rectangle1 in this element (width and height is not changed)
<jryannel> We jump to slide 25: Margins
* 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: Qt Quick: Elements/Animations/States - Instructors: jryannel
<jryannel> An anchors fixes on eelement to another element.
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
<jryannel> For reference: We use the slides at: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition
<jryannel> Called; Composing User Interfaces
<jryannel> We are on slide 25
<jryannel> A margin provides some space between the anchoring
<jryannel> Slide: 26
<jryannel> Here we see a rectangle containing 2 elements (image + text)
<jryannel> image and text shall be vertical centered and have some spacing between
<jryannel> The image is anchored on the left side of the parent's left side
<jryannel> and has on the left side 1/16th of space of the width of the parent
<jryannel> and sure the image is vertical centered
<jryannel> similar applies to the text. But instead of anchored to the parent it's anchored to the image
<jryannel> The anchors.baseline is important for text to anchors according to the textbaseline
<jryannel> Anchors are also described in more detail at: http://doc.qt.nokia.com/4.7-snapshot/qml-anchor-layout.html#anchor-layout
<jryannel> So besides of positioning elements by x,y we can also anchors them with margins.
<jryannel> Often you want to anchor element in a row or column or a grid. For this we have spezialised elements
<jryannel> They are called Column, Row, Grid
<jryannel> They are helper elements to avoid writing common code
<jryannel> See http://doc.qt.nokia.com/4.7-snapshot/qml-positioners.html for more information
<jryannel> anchors can be used to produce very powerful ui and also felxible from the screen dimensions
<jryannel> Okay. Let's go to the next module. We jump over module user interaction and go direct to states
<jryannel> Please download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-states-transitions.pdf
<jryannel> A state describes your ui in different "phases"
<jryannel> E.g. in simple terms it defines how properties values shall be in these different phases
<jryannel> If you problem downloading: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition
<jryannel> Then choose: States and Transitions
<jryannel> So think about a stop and a go light. Both are represented by a rectangle
<jryannel> See 6
<jryannel> Slide Nr. 6
<jryannel> in a "go" state we want one rectangle green in the "stop" state we want the other rectangle red.
<jryannel> Slide: 7
<jryannel> We describe the states with the states property.
<jryannel> Which is an array of State elements
<jryannel> a property array is marked with [ ]
<jryannel> state go has the name "go" and state "stop" is names stop.
<jryannel> Both describe changes to properties to elements declared earlier
<jryannel> "stop" state changes the color of stop_light to red
<jryannel> and go_light's color to "black"
<jryannel> How to switch between the states?
<jryannel> use the state property and assign the state name
<jryannel> Slide: 8
<jryannel> Setting the State
<jryannel> each element has a state property and a states property
<jryannel> states is the array of states and state contains the name of the current state.
<jryannel> onClicked: parent.state == "stop" ? parent.state = "go" : parent.state = "stop"
<jryannel> onClicked is a clicked handler from the mousearea.
<jryannel> A mousearea is an area which received mouse clicks, presses, releases...
<jryannel> we first ask for the current state and if it's "stop" we change it to "go".
<jryannel> Qt Quick recognizes the change and updates the ui based on the state
<jryannel> very simple
<jryannel> We jump to slide: 12
<jryannel> Another example, little bit more complicated.
<jryannel> Qe have a text in a rectangle
<jryannel> Additional we have a image (clear_button) which is clickable through the mousearea.
<jryannel> When the image is clicked the text of the text_field is set to ""
<jryannel> Slide: 13
<jryannel> we define 2 states "with text" and "without text"
<jryannel> "with text" shall be active when the text_field is NOT empty
<jryannel> the "without text" shall be active when text_field is empty
<jryannel> Based on the property change notification which allows the property binding "when" is evaluated everytime the text changes
<jryannel> Side note: A text element will only accept input when it's focused.
<jryannel> This can be done by clicking in the TextInput or requesting focus with "focus : true"
<jryannel> When going from one state to another we have a state transition
<jryannel> State A -> (Transition) -> State B
<jryannel> Slide: 16 (Transition)
<jryannel> The red button changes it's color to black via a transition.
<jryannel> This transition in this case shall be a color animation.
<jryannel> (Same applies to the black/green button our go button)
<jryannel> Slide: 17
<jryannel> Remember we have the states "go" and "stop" in an earlier example
<jryannel> We add transitions with the transitions [ ] array property
<jryannel> Each Transition element describes a transition from one state to another state
<jryannel> from, to describe when transition is called
<jryannel> Inside we use an animation (more about animations later)
<jryannel> so States -> Transitions -> Animations
<jryannel> We will see animations can also be used standalone and in other situations.
<jryannel> Let's leave this module and go to: QML Animations
<jryannel> Please download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-animations.pdf
<jryannel> I hope you all have flatrates :_)
<jryannel> An animation generally describes a property change according to a easing curve and duration.
<jryannel> So instead for example an elements position shall be changes from x:0 to x:100 it shall not go immediately
<jryannel> It should go in a defined way from 0 to 100 in maybe 1second and first a little bit faster and then slower.
<ClassBot> There are 10 minutes remaining in the current session.
<jryannel> Slide: 6 in the qml-animations.pdf titled "Number Animations"
<jryannel> We have in general NumberAnimation, ColorAnimations, RotationAnimations and PropertyAnimations
<jryannel> We use here: NumberAnimation on x { .... }
<jryannel> Means it will animate x from 0 to 150 in 1 sec (1000msecs)
<jryannel> This will done automatically when the component (qml file) is loaded
<jryannel> Slide 8: PropertAnimations
<jryannel> Here we use an animation as a standalone animation. We need to specify the target and which properties we want to animate. with running: true you specify it shall run when the component is loaded.
<ClassBot> There are 5 minutes remaining in the current session.
<jryannel> If you would give the animation an id (e.g. id: anim ) you could also start it with anim.start()
<jryannel> You can find more about Animations and Transitions at: http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeanimation.html
<jryannel> I think this it it for now. I will make a 10min break and be back with the next session
<jryannel> Thanks for listening :)
* 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: Qt Quick: Rapid prototyping - Instructors: jryannel
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
<jryannel> Before I continue on rapid prototyping... some remarks to animations
<jryannel> There are several ways to use animtions:
<jryannel> * Animation on <property>
<jryannel> * Animation { } // standalone
<jryannel> * Animation during a state transition
<jryannel> * Behavior on <property> // when property changes than always with the specified animation
<jryannel> You can nest animations with ParallelAnimation and Sequential Animation.
<jryannel> There is also a PauseAnimation, which waits some time before continue with the next animation in a group
<jryannel> IMPORTANT!!: If an element is anchored for example on the left and right, x can't be animated!!
<jryannel> anchoring is stronger!!
<jryannel> if an element is anchored on left and right, sure y can be animated and also the height. but not the width and x
<jryannel> All of this is available as a 5 1/2 hour talk here: http://qt.nokia.com/developer/learning/online/training/training-day-at-developer-days-2010
<jryannel> Just make yourself a nice video evening instead of watching lord of the rings
<jryannel> Coming to "Qt Quick Prototyping"
<jryannel> Please have a look at: http://qt.nokia.com/developer/learning/online/talks/developerdays2010/tech-talks/qt-quick-rapid-user-interface-prototyping
<jryannel> Sorry I planned to have a screen sharing available. I hope at least some of you can watch the video
<jryannel> Anyway I will explain about the thoughts behind...
<jryannel> Qt Quick was designed to bridge the gap between "designers" and "developers"
<jryannel> In a normal design driven project you have
<jryannel> designers, which think about the user interaction, graphics and nowadays animation (e.g. motions)
<jryannel> Then they use tools like Flash or paper or PhotoShop to sketch the ui.
<jryannel> Present beautiful design to their bosses and then ...
<jryannel> They throw these design to the c++ developer and ask them to implement this.
<jryannel> Sure the result will be miles away from the the sketch. It's a different technology maybe even different HW on embedded
<jryannel> Qt Quick allows designers early on to work with the same technologies as all the other developers
<jryannel> Sure these kind of designers should now how to work e.g. with HTML/JavaScript of Flash/ActionScript. For them it's pretty easy to come to Qt Quick
<jryannel> The result is that at any time developers and designers work on the same code base and it's easy to sketch a first ui prototype ...
<jryannel> and then the prototype goes over nicely into production code
<jryannel> By this you can shorten the time to market but also ensure the that the UI is really that what someone asked for. Pixelperfect
<jryannel> Qt Quick is fast to code. So that you can create many different prototypes easily and then just ask you users, which one they like best
<jryannel> Another aspect id that the ui code is cleanly seprated from the c++ code.
<jryannel> This allows you to unit test your models and business logic and heavy lifting...
<jryannel> and push a simple and clean qml API towards the ui developers
<jryannel> Qt Creator contains a design mode, which allows you to drag-n-drop ui elements (and your custom components) on a surface to sketch your ui
<jryannel> When you are in a qml file hit the button on the left "Design"
<jryannel> in Qt Creator
<jryannel> Here you can create a first sketch. But finally you want to switch to your code (editor) to make the more complicated stuff
<jryannel> So an interaction designer creates "wireframes" e.g. like on http://balsamiq.com/
<jryannel> A graphics designer makes nice graphics to the wireframe, e.g. with photoshop, gimp, inkscape, ...
<jryannel> A motion designer thinks about how ui elements should be animated.
<jryannel> This is currently how I see designers. I'm not a designer I'm a programmer and I always wondered how they work
<jryannel> We have material for designers ready at: http://qt.nokia.com/developer/learning/online/training/materials/qt-quick-for-designers
<jryannel> Especially module 6 talks about the different designer roles.
<jryannel> If you target a UI different from a standard desktop UI you want to have a design affine person in your team.
<jryannel> Especially with Qt Quick. This makes it really efficient.
<jryannel> If you target a standard desktop UI you want to create a set of standard UI elements or use/extend the elements produce by the Qt Components project
<jryannel> See https://qt.gitorious.org/qt-components
<jryannel> I posted this link already yesterday: http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/
<jryannel> When I prototype a UI I always start with rectangles
<jryannel> I normally use black background and white borders.
<jryannel> Just make sure you get the dimensions right. Maybe add some text to label an element
<jryannel> Then concentrate on the application logic
<jryannel> E.g. when I press here what should be happen?
<jryannel> At then end you look into the animations.
<jryannel> When something changes, then how. Should it fade (animation on opacity), should it fly in (animation on x)
<jryannel> Should it fly and fade (parallel animation on opacity and x)
<jryannel> You should extract components early on (e.g. mybutton, mytextedit, mycheckbox, etc...
<jryannel> Then you concentrate on the more details and bring in the graphics, colors, gradients, etc...
<jryannel> Make sure you get the structure right. give application wide used elements a good id.
<jryannel> Mark internal properties with '_<property-name>
<jryannel> Try to avoid to be to dependent on your c++ backend, I use a bool _debug property to guard sometimes those dependencies
<jryannel> Try not to create a reusable component which can be reused in all projects in the future.
<jryannel> Designers think more in reuse by copy. Just make the element work for your needs. Qt Quick can be fast adapted anyway
<jryannel> I guess that's it is for now. Any questions?
<jryannel> Take care and hope you enjoined this lengthy talk :)
<jryannel> Ohh, one link at the end
<jryannel> https://gitorious.org/qtmediahub, a XMBC (MediaCenter) clone in qt
<jryannel> And https://gitorious.org/qmlshowcase.
<jryannel> qmlshowcase was produced for a customer in one afternoon! Check it out
<ClassBot> There are 10 minutes remaining in the current session.
<ClassBot> There are 5 minutes remaining in the current session.
<dpm> Thanks jryannel for this Qt Quick marathon as a great starter for the day! Next up: mterry will tell us about Rapid Application Development with a tool you can never get enough of: Quickly!
<mterry> yay
<mterry> Just real quick: I have notes here if you're interested: https://wiki.ubuntu.com/Quickly/AppDeveloperWeek11.04
<mterry> I'll add a link to the meeting logs there after the fact too
<mterry> So, I'm Michael Terry, a maintainer of Quickly
<mterry> https://wiki.ubuntu.com/Quickly
<mterry> Quickly is a template-based system for writing applications
<mterry> quickly, easily, and hopefully fun
<mterry> At it's heart, it's just a system of templates with boilerplate code and a few commands
<mterry> But all the templates are currently Ubuntu-focused, so that's where it gets the most attention
<mterry> Each template makes opinionated choices for you, so the app author can just focus on writing their app
* 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: Rapid App Development with Quickly - Instructors: mterry
<mterry> We try to give him/her the recommended technologies by default
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
<mterry> oh, whoops
<mterry> well, the logs might not have that starting part
<mterry> Quickly in Ubuntu 10.10 has three templates: ubuntu-application, ubuntu-cli, and ubuntu-pygame
<mterry> In Ubuntu 11.04, we're adding a new template, ubuntu-flash-game
<mterry> A new command "submitubuntu" which helps get your app into the Software Center
<mterry> And we've redesigned the project layouts a bit
<mterry> I'll note when I'm talking if something applies only to the 11.04 version or not
<mterry> If anyone has any questions as I go through this, please let me know in the classroom
<mterry> classroom-chat that is
<mterry> So today, I'm just going to give a bit of an overview for how to use Quickly
<mterry> And what it can do
<mterry> It's simple enough to get started.  Just "sudo apt-get install quickly"
<mterry> This will install a bunch of packages, which are development tools and documentation
<mterry> But most importantly, it will install Quickly  :)
<mterry> Now I'll show you how to create a little throw-away app we can practice on here
<mterry> "quickly create ubuntu-application test-project"
<mterry> This will create a new directory "test-project", put a lot of boilerplate in there, and open your new project
<mterry> You'll see that a window and some widgets and dialogs have been created for you
<mterry> That's part of the boilerplate I mentioned before
<mterry> You can customize this as much as you want, but Quickly gives you something to hit the ground running with
<mterry> Now you want to enter your project directory: "cd test-project"
<mterry> And here, if you typed "quickly tutorial" you would get a nice tutorial about how to make changes in the project you've just created
<mterry> That's a good command to note for later
<mterry> But I'm going to move on and explain some of that myself
<mterry> Though the tutorial is valuable, and you should consider running through it later
<mterry> So the first thing you're likely to want to change is how the app looks
<mterry> In your project directory, you can type "quickly design"
<mterry> And Glade will open up
<mterry> Glade is a tool that lets you edit GTK interfaces by clicking around
<mterry> Kinda like Visual Basic, but without any of the code elements
<mterry> Glade by itself doesn't integrate with code
<mterry> But Quickly matches them up for you
 * mterry pauses for a sec, any questions?
<mterry> OK, so let's talk a bit about Glade.  If you're not familiar with it, it can be a bit intimidating
<mterry> You've got your "tool palette" of widgets on the left
<mterry> The middle is where you see what you're building
<mterry> And the right is where you can select widgets from the widget tree or edit the currently selected widget
<mterry> If you just click directly in the middle on the widget you want, it will be selected
<mterry> Or if you find it in the widget tree in the upper right
<mterry> In GTK, widgets are layed out in boxes, either horizontal (HBox) or vertical (VBox)
<mterry> So you first create a box, then add widgets to it.  And you can next boxes for more complicated layouts
<mterry> Once you add a widget to a box, you can change its position in the box by going to the Packing tab in its properties box in the bottom right
<mterry> There you'll also be able to change how any widget is given space
<mterry> You can see the Expand and Fill properties
<mterry> Most things start taking up all the space they can, but that's not always the effect you want
<mterry> Those are common properties to adjust to get the layout you want
<mterry> Another thing to note is that when adding icons or menu items, you often want to use stock items where possible.  That will use the correctly themed icon and automatically add translated text where appropriate
<mterry> Speaking of translations, you can choose translation options for any label in the properties box (like whether it is translated or to leave comments for the translator)
<mterry> OK, enough Glade
<mterry> You can play with it as needed and just remember that you can always Undo any mistake you make or don't know how to correct  :)
<mterry> So remember, "quickly design" to edit your UI
<mterry> You can make new dialogs inside Glade, but it's better to let Quickly make them for you, so that they are hooked up correctly in code
<mterry> So let's say you want to add a cool new dialog.  You can type the following: "quickly add dialog save-dialog" (for a fictional Save dialog you wanted to add)
<mterry> After you do this, you should probably close Glade and re-open it with "quickly design"
<mterry> Now Glade will see your new dialog and you can edit it as you like
<mterry> Specifics and code examples of adding dialogs are also in the "quickly tutorial" tutorial
<mterry> But I'll be brief here
<mterry> From your main window, you need to import the new code module that Quickly made: "from project_name.DialogName import DialogName"
<mterry> So for this project, that would actually be "from test_project.SaveDialog import SaveDialog"
<mterry> Then you use normal GTK code to run it and check the result:
<mterry> d = DialogName()
<mterry> response = d.run()
<mterry> if response == gtk.RESPONSE_OK:
<mterry>   #do your stuff
<mterry> d.destroy()
<mterry> And that's it!
<mterry> Pretty simple to make a dialog
<mterry> Now, if you want to respond to what the user does, you're going to need to listen to GTK signals
<mterry> Real briefly, when the user does something like click a button, GTK emits a signal that you can respond to, like "clicked"
<mterry> Important signals that you may care about are that buttons emit the "clicked" signal, menu items emit the "activated" signal
<mterry> It's really easy to handle these signals
<mterry> Let's say you want to handle a menu item press in your main window
<mterry> You first note what the menu item is called in Glade
<mterry> You can check this from the widget tree in the upper right
<mterry> Remember that name
<mterry> Now in the code, you can add a new function named like:
<mterry> def on_menuitem1_activated(self, widget, data=None):
<mterry> and inside that function, add the code that should happen when the menu item is pressed
<mterry> Quickly already provides some code for common menu items like Quit and About, but not all of the default menu items have code already
<mterry> In Ubuntu 10.10, you'll also need to go into Glade and point it at your new function
<mterry> There is a "Signals" tab in the bottom right
<mterry> And go there and enter the name of the function you just created next to the "clicked" signal
<mterry> In Ubuntu 11.04, Quickly can do this for you, as long as you name it like above: on_WIDGET_SIGNAL
<mterry> So a "clicked" signal on "button1" would be on_button1_clicked
 * mterry pauses for a sec.  Any questions?
<ClassBot> hobbsc asked: Is quickly generating gtk2 or 3?
<mterry> hobbsc, GTK 2 for now.  I'd like to move it to 3 next cycle
<mterry> But in keeping with using the recommended tools, GTK 2 is still the default toolkit for Ubuntu 11.04
<mterry> I believe Ubuntu will be ported to 3 next cycle, so Quickly should move along with it
<mterry> OK.  So if you want to edit the code that Quickly makes
<mterry> incorrect, asked about PyGI vs PyGTK
<mterry> PyGTK won't support GTK 3, so we'd have to move to PyGI at the same time.  Quickly doesn't currently use PyGI
<mterry> So if you want to edit the code, you can just open up the test_project folder in your project and look at all the code.  Or run "quickly edit"
<mterry> You'll see for example that your main TestProjectWindow class has a function "finish_initializing".  This is the recommended hook for inserting your own startup code
<mterry> In Ubuntu 11.04, there will be a test_project_lib folder that contains code that Quickly "owns" and it isn't recommended you touch it.  But you can take or leave the code there yourself.  There will be one entry point in the main TestProjectWindow class that you control
<mterry> So let me talk about debugging real briefly
<mterry> The usual recommended method is just adding print statements and seeing what effect that has.  :)
<mterry> It's quick, dirty, and easy
<mterry> If you are interested in more comprehensive debugging, especially if you want to be able to ask your users for log files, you can use the logging framework
<mterry> The sample code Quickly makes does that, so you can see code examples
<mterry> It by default won't spit out messages unless you're running your app in verbose mode
<mterry> Or if you're debugging something very complicated, you can use pdb, which is a python debugger
<mterry> It's a bit difficult to use, so I just recommend using print statements
<mterry> Oh, I forgot!  If you want to run your app after you close it, use "quickly run"
<mterry> And "quickly help" should give you a list of commands
<mterry> So now we come to the exciting stuff.  So far, Quickly has just been a jump-start to your app development
<mterry> But it also integrates with Launchpad to help you publish, share, and maintain your software
<mterry> For example, it keeps your code in bzr and you can save your changes with "quickly save"
<mterry> Or if you have a Launchpad project, it can upload tarballs and make announcements
<ClassBot> crazedpsyc asked: When might logging be better than print statements? I think printing some error messages that identify the line of code that has the problem and what the problem is is much more useful, because users usually don't bother to find and read log files
<mterry> crazedpsyc, for errors that you "expect" to see in the field like a file that didn't open or an unexpected corner of your code
<mterry> I would recommend logging
<mterry> I think print statements are most useful just for yourself when you're hunting down some problem
<mterry> So that is, your app should probably ship with just logging lines
<mterry> But when I'm futzing with it, I like to add print lines to find where the problem is
<mterry> So let's talk a bit about packaging
<mterry> This is something that is normally difficult to do, but Quickly tries to make easy
<mterry> You have different "levels" of complexity here.  You can create a local Ubuntu package, you can share your package with testers, you can publish a new final version of your package, or you can even put your package in the Software Center
<mterry> Let's start simple
<mterry> "quickly package" will package up your current code and create a .deb file for you
<mterry> But before you do that, actually, it's probably a good idea to set up some metadata
<mterry> You can open the setup.py file that Quickly made for you: "gedit setup.py"
<mterry> Near the bottom are some fields like author name, etc
<mterry> You also probably want to edit the AUTHORS file and put your name and email there
<mterry> And if you had a particular license in mind besides GPL-3, you can run "quickly license BSD" or whatever license you like
<mterry> GPL-3 is the default though
<mterry> You may also want to edit test-project.desktop.in and change the application properties so it shows up in the right application category in the menus
<mterry> You can see a list of the correct categories here: http://standards.freedesktop.org/menu-spec/latest/apa.html
<mterry> OK, now that we did all that bookkeeping, you can make your package
<mterry> You could have made it before too, Quickly will just fill in bogus info for you
<mterry> But it's better to have it all nice and correct :)
<mterry> So now after a "quickly package" you'll have a .deb file
<mterry> You can double click on this in the file manager and install it into your system for testing
<mterry> And you can share that .deb via email or a web site for a small number of people
<mterry> But if you want wider testing
<mterry> You may want to consider creating a PPA
<mterry> PPAs are a little bit more involvement for you, but it makes it so much easier to test your app that it's probably worth it for you in order to have more testers
<mterry> So Launchpad has some good documentation on what you need to do here, https://help.launchpad.net/Packaging/PPA
<mterry> But you'll need an SSH key and a GPG key
<mterry> https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair
<mterry> https://help.launchpad.net/YourAccount/ImportingYourPGPKey
<mterry> Those are a couple more Launchpad help pages for how to make those
<mterry> Once Launchpad knows about you and you've created the PPA, you're ready to tell Quickly
<mterry> You should set DEBEMAIL and DEBFULLNAME environment variables for the benefit of "quickly package".  This will note that you were the one that created the package, otherwise Launchpad won't accept it
<mterry> So set them like:
<mterry> export DEBEMAIL="oliver.twist@example.com"
<mterry> export DEBFULLNAME="Oliver Twist"
<mterry> If you put those lines in your ~/.bashrc file, they will be set up for you every time you log in
<mterry> OK, now you're all set
<mterry> So if you enter "quickly share --ppa testing" it will create a new in-progress package with a version like 0.1~public1 and push it to the PPA you specify on the command line
<mterry> So if you have a testing PPA, which is recommended, you can easily get feedback by sharing a new package every now and then
<mterry> If you want to actually make a full release, you can do "quickly release --ppa release" and Quickly will increment the number for you and push it to the the PPA you specify
<mterry> Just like the share command
<mterry> By default, Quickly will pick YEAR.MONTH versioning
<mterry> But you can specify the version you want to the release command
<mterry> Run "quickly help release" for details
<mterry> And now finally, there is a new command in Ubuntu 11.04 that lets you prepare an upload for acceptance into the Ubuntu Software Center
<mterry> "quickly submitubuntu"
<mterry> This creates and publishes a package to a PPA just as quickly release does
<mterry> So you can pass --ppa and such
<mterry> The package will have files installed into /opt as required
<mterry> The package will also have special metadata that is used by the Software Center (like where the screenshot lives and such)
<mterry> (See https://wiki.ubuntu.com/AppReviews for how to get approved)
<mterry> You can create the same kind of package without uploading it by using "quickly package --extras"
<mterry> This will generate the /opt packaging and such for you to test with
<ClassBot> There are 10 minutes remaining in the current session.
<mterry> incorrect mentioned integration with Eclipse
<mterry> That is something I'd like to see happen too, but we haven't focused on that yet
<mterry> Also integration with Anjuta and any other IDEs out there
<mterry> We'd like to make it easy for that to happen
<mterry> But we figured most programmers are familiar with the command line so we haven't rushed to IDE interaction
<mterry> Again, the current set of templates (ubuntu-application, ubuntu-cli, ubuntu-pygame, and ubuntu-flash-game) are just what we've done
<mterry> But it's hopefully easy to make a template of your own
<mterry> See "quickly quickly"
<mterry> And we'd love any help!  :)
<mterry> I also recommend trying out the ubuntu-pygame template: "quickly create ubuntu-pygame test-game"
<mterry> It's very neat
<ClassBot> crazedpsyc asked: wouldn't that (IDE integration) be something for the IDE developers themselves to do? They could just run os.popen("quickly [...]") right?
<mterry> crazedpsyc, yes, ideally.  There's nothing quite stopping them from doing it.
<mterry> crazedpsyc, but since we care more than the Eclipse developers probably do about it, it likely won't happen until we make it happen  :)
<mterry> And since we haven't actually done the work for even one IDE yet, there may be hidden gotchas in adding support
<mterry> So it would be good for us to try making one ourselves, so we can make it super easy to do from the Quickly side
<mterry> But we'd definitely work with any IDE developers that were intereste
<mterry> d
<ClassBot> There are 5 minutes remaining in the current session.
<mterry> That's all I had.  Hopefully Quickly is fun and easy to mess around with
<mterry> We hang out in #quickly and #ubuntu-app-devel channels on Freenode
<mterry> If there are any questions you have after this, feel free to poke me there
<mterry> Oh, and if I'm not around in the channel, rickspencer3 and didrocks are experts too
<mterry> And the original Quickly devs
<mterry> (they are the originals I meant)
* 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: Getting Your App in the Distro: The Application Review Process - Instructors: allison
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the 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: Getting Your App in the Distro: The Application Review Process - Instructors: allison
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the 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: Getting Your App in the Distro: The Application Review Process - Instructors: allison_
<dpm> Thanks a lot mterry for a great session, and let's clear the floor for allison_, Ubuntu's Technical Architect, who's going to tell us how to get your applications into Ubuntu
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
<dpm> allison_, all yours!
<dpm> (let's wait for a sec while we sort out some IRC issues)
* 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: Getting Your App in the Distro: The Application Review Process - Instructors: allison_, wendar
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
<wendar> Hi all.
<wendar> mterry has given an excellent session on Quickly. This session is a "next step".
<wendar> Once you have an application packaged, there are a few ways to get it into Ubuntu.
<wendar> I'll be going over one of those ways, through the Application Review Board.
<wendar> The basic idea is to make it very quick and easy to get lightweight applications into Ubuntu.
<wendar> You can submit them today, and have them available to download in a couple of weeks, instead of waiting for the next release of Ubuntu.
<wendar> The first step is to submit a ticket to the review board.
<wendar> They need a few essential details for the proposal.
<wendar> Some are obvious: the name of the project, your name, and how to contact you.
<wendar> We also ask for you to have already set up your project in a PPA.
<wendar> That can catch a lot of common errors, so it's as helpful for you as it is for the reviewers.
<wendar> One thing that submitters often miss is a description of the project and what it does.
<wendar> You've probably been working on your app for months, but it's brand-new to the reviewers, so it's helpful to guide them to understanding what's wonderful about the app.
<wendar> It's worth taking a look at the submission guide, it has a good example of what to include in the proposal.
<wendar> https://wiki.ubuntu.com/AppReviewBoard/Submissions/Request
<wendar> The next step is the initial review. One of the reviewers will volunteer as "shepherd" for your proposal.
<wendar> Your shepherd will read through your code and the packaging, and may offer suggestions on improvements, or help you find more details on the requirements for apps.
<wendar> You and the sheperd may repeat a few rounds of changes and releasing a new version into your PPA.
<wendar> In some cases the shepherd may recommend that your app is too big, too complex, or too important for the Application Review Board process and will ask you to take it to the full revue process for inclusion in Ubuntu's universe repository.
<wendar> In most cases, you and the shepherd will work together and bring your app to a point where it's ready for a final review.
<wendar> In the final review, the shepherd will recommend your app in one of the App Review Board meetings.
<wendar> These happen every two weeks on the #ubuntu-meeting channel.
<wendar> You can find the next meeting listed on https://wiki.ubuntu.com/AppReviewBoard/Agenda
<wendar> or on the Ubuntu Fridge calendar.
<wendar> The board will vote on your app, and accept it for inclusion, recommend changes, or (in very rare cases) reject it.
<wendar> If they ask for changes, you'll just work with your shepherd to get those made, and bring the app back in the next meeting.
<wendar> Once your app is accepted, there's a little bit of work needed to set up screenshots for the app.
<wendar> This is a bit of a hassle right now, but soon there will be a web form to submit your screenshots.
<wendar> After the screenshots are set up, the review board will launch your app in the extras repository.
<wendar> Extras is turned on for everyone in Maverick and Natty, so your app will be immediately available in the Software Center, and other package management tools.
<wendar> That's pretty much it. We've tried to make the process quite simple.
<wendar> Are there any questions?
<wendar> Or, any steps you'd like to go through in more detail?
<ClassBot> titeuf_87 asked: the apps for purchase in the software center, are they submitted this way too?
<wendar> At the moment, apps for purchase are handled manually.
<wendar> They will soon have a web interface for submissions.
<wendar> The same web interface that App Review Board apps will use for screenshots.
<wendar> We'll try that out for a bit, and if it looks good, will start using that same web interface for all the App Review Board apps.
<ClassBot> dpm asked: who can review an app? Only those who are Review Board members?
<wendar> The proposals are all in a public queue, so anyone can review them.
<wendar> It's very welcome to have people trying out the apps and commenting on the tickets while they're under review.
<wendar> Only the Review Board members vote in the final review, but in our vote we'll consider all the feedback we get.
<wendar> Reviewing and trying out other developer's apps is a great way to build up experience for your own apps.
<wendar> Any more questions?
<ClassBot> dpm asked: if I'm an app developer and I want to go through the App Review Process, where should I first start? What's the place where I find the documentation?
<ClassBot> There are 10 minutes remaining in the current session.
<wendar> We've got a wiki page to help walk developers through the steps.
<wendar> https://wiki.ubuntu.com/AppReviewBoard/Submissions
<wendar> You can always go back there for more information.
<wendar> A few tips to send you on your way:
<wendar> The basic idea for this process is that it's a good fit for lightweight applications.
<wendar> Games, small single-purpose apps.
<wendar> If you're writing a large or complext application, it's probably not right for this process.
<ClassBot> There are 5 minutes remaining in the current session.
<wendar> Libraries to be used by other applications also don't fit here.
<wendar> But, for anything that doesn't fit in the App Review process, there's always the usual process.
<wendar> And, the advantage of the usual process is that once you get into universe, your package will be updated and maintained by MOTU.
<wendar> That's all, thanks everybody!
<dpm> Great, thanks a lot wendar for this clear overview on the App Review process. There is now no excuse for getting your applications into Ubuntu!
<dpm> Next up is tedg_, the person who knows all about indicators, and who'll be thrilled to tell you how to add them to your applications
* 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: Adding Indicator Support to Your Apps - Instructors: tedg
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
<tedg> Voice?
<tedg> Woot!
<tedg> Thanks Pendulum!
<tedg> Hey everyone, sorry about the delay.
<tedg> So my name is Ted Gould and I work with application indicators.
<tedg> Application indicators are menus that appear in the Unity panel and represent various applications.
<tedg> These, in general, shouldn't be used just because your project's logo is so cool.  Users. hate. that.
<tedg> But, it's more designed as a feature for long running applications, those that are more services to users, to expose that functionality.
<tedg> A good example of this would be Tomboy, so you can use your notes all the time and keep it running.
<tedg> Which is definitely useful.
<tedg> There's a set of design guidelines for using the app indicators.
<tedg> And that is here: https://wiki.ubuntu.com/CustomStatusMenuDesignGuidelines
<tedg> It goes through the various features and what the layout should be.
<tedg> If you've got any questions whether or not something should be an appindicator, that'd be a good place to get started.
<tedg> I'm not going to dwell on that though, as this is Dev week, so let's assume that you're application *really* needs an appindicator :-)
<tedg> For most applications that involves using libappindicator
<tedg> It's a small library that makes it easy to create application indicators.
<tedg> The LP page for it is here: https://launchpad.net/libappindicator
<tedg> You can browse through the source code if you'd like.
<tedg> But I think that examples are a bit more interesting.
<tedg> We've put together a few: https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Porting%20Guide%20for%20Applications
<tedg> libappindicator uses the GObject Introspection framework so that it can be accesses from any language that support it.
<tedg> That includes languages like Javascript and Python.
<tedg> But there are others as well.
<tedg> We also have direct Python bindings, though those will probably be dropped as soon as the GObject Introspection ones start to mature.
<tedg> I expect the API to stay very much the same though.
<tedg> So as we start to look at some of the examples (your language of choice) we start to see what you can do with libappindicator.
<tedg> You need to provide a few things starting out.
<tedg> The first is a name.  The idea is that this is a unique string, usually the package name is good.  Though any unique string will work.
<tedg> If you want to have more than one for some reason, each of them should be unique.  "my-project-left" "my-project-right"
<tedg> You also need to provide an icon name, which is the name of the icon in the icon theme.
<tedg> For many projects this is the main icon for the project, though it could be anything really.
<tedg> You also need to provide a category.  This is mostly use for sorting the indicators, so that similar things end up next to each other.
<tedg> The next thing that needs to happen is you need to build a menu for that app indicator.
<tedg> You can do this in GTK+ and libappindicator will take care of making sure that gets translated over the bus.
<tedg> You can also attach to the normal GTK signals and those will be synthesized from the DBus signals as well.
<tedg> I'm not going to go much into building menus, the examples there all have ways to do it.
<tedg> You should look at GTK resources like http://gtk.org/documentation.html to learn more about that.
<tedg> This is all that is needed for a basic application indicator -- but you shouldn't stop there!
<tedg> There are some other features that can really improve your application indicator.
<tedg> One of those is providing an accessible name for the icon.
<tedg> Users who are disabled can't tell what the icon is, so a screenreader need some information to learn about the icon.  This is the accessible label.
<tedg> It's important for making your application work well for everyone.
<tedg> You can also put a label next to your application indicator.
<tedg> For instance, indicator-weather uses this to put the current temperature on the unity panel.
<tedg> In general, we recommend that you provide a way to disable the label feature as it can be disruptive to some users.
<tedg> There are definitely use cases for small strings though, and this provides a way to do those.
<tedg> Also, Application Indicators provide a built in attention state.
<tedg> The idea here is that you could pre-configure the attention icon and then just toggle between the attention and the normal icon when the state in the application changes.
<tedg> For instance if there was inclement weather or if the application lost a network connection.
<tedg> From the developer's perspective this is just "another icon" but it can provide an easy to implement experience.
<tedg> Since you can always query the state in the program, you don't have to keep track of which icon is being shown and you can set it all once in the initialization of the program.
<tedg> There is also a few little things in the API, like being able to get mouse wheel events that can be fun.
<tedg> It's good to remember that it's nearly impossible for anyone other than power users to realize the mouse wheel behavior.
<tedg> But that can be a fun feature to provide those users with something extra.
<tedg> That's the basics of implementing an app indicator, let me take a little break for questions before I go on.
<tedg> Any questions?
<tedg> Okay, seeing none, I'll assume I was perfectly clear ;-)
<tedg> An advanced topic that I'd like to cover is fallbacks.
<tedg> One thing that application developers told us is that they don't want to build applications that can only run on Unity.
<tedg> But, they don't want working with everyone else to be a lot of work either.
<tedg> So we built in fallbacks into libappindicator so that you don't have to worry about that.
<tedg> What the basic fallback is using GtkStatusIcon to create a systray icon.
<tedg> This icon can then be shown in environments not currently using the KSNI interface.
<tedg> This would include XFCE, GNOME Shell or GNU Step.
<tedg> What will happen is that the same icons will be shown in the systray as you specified to libappindicator.
<tedg> When you click on the icon, the menu will be shown.
<tedg> In a nutshell, it should be roughly the same as what happens on the unity panel.
<tedg> Some application authors might not want that though.
<tedg> They may want to take advantage of environment specific features.
<tedg> Or they could just want to fallback to a different interface all together.
<tedg> To account for that the AppIndicator object is subclassable with two overridable functions: fallback and unfallback.
<tedg> fallback() gets called when libappindicator determines that there is no KSNI interface to connect to.
<tedg> If that interface comes up in the mean time, it'll call unfallback.
<tedg> This takes care of cases where the KSNI interface may crash or start up in a different order than is normally expected.
<tedg> This can be pretty straightforward, if you're planning on doing this I'd look to the fallback functions that are in the libappindicator codebase for implementing GtkStatusIcon and base your's on those.
<tedg> They provide all the basic functionality, and can be extended.
<tedg> So does anyone have questions on fallbacks?
<tedg> Seeing none, I'll continue on.
<tedg> So the last thing I wanted to talk about is the future of application indicators.
<tedg> But, it's not very exciting :-)
<tedg> We've got plans to clean up the API some to make the introspection better.
<tedg> And mostly maintenance task surrounding that.
<tedg> We expect that application indicator should stay stable at least through the 12.04 release which will hopefully be an LTS.
<tedg> We do expect to drop the custom Python bindings for a GObject Introspected version.
<tedg> We hope to do the same with the C# bindings, but it's less clear when the GObject Introspection interface will be complete there.
<tedg> So that's mostly what I had hoped to cover in today's session.
<tedg> Is there anything else you guys would like me to talk about?
<tedg> Okay, I'll call it a wrap then.
<tedg> Thanks everyone!
<tedg> dpm, Who's up next?
<ClassBot> There are 10 minutes remaining in the current session.
<dpm> ok, thanks tedg for a great talk
<dpm> Next in a few minutes is Launchpad rockstar henninge, from the former Launchpad Translations team, who is going to talk about how you can make your application talk any language. Don't miss that one!
<ClassBot> There are 5 minutes remaining in the current 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: Using Launchpad to Get Your Application Translated - Instructors: henninge
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session.
<henninge> Hello and welcome to this session on "Using Launchpad to get your application translated".
<henninge> This session is about how Launchpad can help you to get your application translated and includes a hands-on demonstration of the setup needed to get you going.
<henninge> It is not about making your application translatable. David Planella gave a presentation on that on Monday and I encourage you to read the session log if you have not already done so.[1] I will paste the URL at the end.
<henninge> Feel free to interrupt and ask questions any time but we also have a lot of ground to cover.
<henninge> David explained a lot about the basic concepts and software needed to get your application internationalized. I will only repeat a little of that here as a summary to make sure we are all on the same page.
<henninge> I have often seen people come to Launchpad Translations wanting to translate their application saying "I don't know anything about translations or gettext." I have to tell them that, sorry, even as a maintainer they will have to be familiar with the gettext system in general and how it makes your application appear in different languages.
<henninge> On the other hand, let me quote from the gettext manual:
<henninge> "As a maintainer, you do not have to take on your shoulders the responsibility of checking if the translations are adequate or complete, and should avoid diving into linguistic matters. Translation teams drive themselves and are fully responsible of their linguistic choices for the Translation Project. Keep in mind that translator teams are not driven by maintainers. You can help by carefully redirecting all communications and re
<henninge> ports from users about linguistic matters to the appropriate translation team, or explain users how to reach or join their team." [2]
<henninge> What is true for the GNU Translation Project is also true for the translations teams working on translations in Launchpad. Your responsibilty is to provide them with the English strings they need to translate and to publish their translations with your application as often as possible. Translators don't like doing translations only to find out they never make it to the application users.
<henninge> Launchpad Translations is there to help you with that responsibility.
<henninge> Demo project and staging server
<henninge> ------------------------------------------------
<henninge> For this session I will be using a fictional project called 'mytranslatable' on our demo server 'staging'. You will notice that all URLs contain 'staging' but apart from that they are identical to the real Launchpad. Similar for the URLs to Bazaar branches which contain an extra '//staging/' component that needs to be left out for the live code hosting server.
<henninge> In order for all of you to be able to follow along, 'mytranslatable' is owned by an open team I created so anybody in that team can see the configuration pages. Go and join that team now but please don't change any settings on 'mytranslatable' because that would cause confusion. (No damage, though, because this is just the staging server.)
<henninge> https://staging.launchpad.net/~mytranslatable-maintainers/+join
<henninge> Alternatively you can create your own project on staging and follow along with that. In that case you need to replace 'mytranslatable' with the name of your project in all URLs.
<henninge> Please be aware that the staging server is a bit slower and more like to time out. Please be patient.
<henninge> I don't see anybody joining the team yet. Please be aware that a lot of the URLs I'll be posting won't be accessible unless you  are in that team
<henninge> or maybe everybody wants to create their own projects ... ;)
<henninge> OK, let's dive in with some basic concepts you should be familiar with.
<henninge> Marking strings as translatable
<henninge> ---------------------------------------------
<henninge> To be able to extract translatable strings for translation they must be marked in the source code. This is done by applying the 'gettext()' function which is usually aliased to _() for brevity.
<henninge> Oh, I forgot
<henninge> The source tree to the demo project is found here:
<henninge> http://people.canonical.com/mytranslatable.tar.gz
<henninge> Here is the source code of the two source files in that project:
<henninge> http://paste.ubuntu.com/593926/
<henninge> http://paste.ubuntu.com/593927/
<henninge> You will notice the 'textdomain' call which sets the translation domain for your application. This is later used in the global translations database on the user's system (usually in /usr/share/locale) to identify your application's translations. It must therefore be unique and that's why it is often identical to the name of the application istself.
<henninge> For other file types that may contain translatable strings in your project, other ways of marking and extraction will exist. The intltool package (which extends gettext) that David also mentioned is able to deal with a lot more types than plain gettext is. [3]
<henninge> PO templates and PO files
<henninge> --------------------------------------
<henninge> When gettext extracts translatable strings from the source code they are placed in a PO template file. It is called a 'template' because really PO files contain the actual translations and a 'template' looks just like such a file but without any translations filled in.
<henninge> Here is an example from our two example source files.
<henninge> http://paste.ubuntu.com/593932/
<henninge> *Without* Lauchpad translations, translators would take this file, fill out the empty translations (msgstr) and adapt the header information (ALL THE CAPITALS) to produce a PO file for their language. This file they'd submit back to your project for inclusion in the source tree.
<henninge> *With* Launchpad Translations you need to get this file into Launchpad so that translators can translate it *in* Launchpad Translations. When it is time to create a new release for your project, you can just pull out the translations as PO files and put them in your tree.  Launchpad helps you with that, too.
<henninge> PO files are kept in a subdirectory called 'po' on your project. That is also where the template file will be created.
<henninge> Creating the template is best done using intltool. If you have followed David's session on Monday using quickly, you can simply do 'quickly build_i18n' and it will build your template in the 'po' subdirectory.
<henninge> Otherwise you will have to manually configure your project for intltool. To configure your project for intltool you need to create two files.
<henninge> 1. po/POTFILES.in contains a list of the source files that translatable strings will be extracted from.
<henninge> 2. po/Makevars contains some variables for the build process. intltool will look here and in other places to find the translation domain to use. If your project uses Automake or Autoconf intltool will scan those files as well but that is out of scope here.
<henninge> Here are the the files for our example:
<henninge> http://paste.ubuntu.com/594052/
<henninge> http://paste.ubuntu.com/594054/
<henninge> Now you need to go into the 'po' directory and run 'intltool-update -p' which tells intltool to create a new template. I get an error message in the run about a newline in a file name but it seems to work fine. You end up with a file called 'mytranslatable.pot'.
<henninge> Everybody following along? This was mostly repetition, we will now move over to Launchpad.
<henninge> Set up a project in Launchpad
<henninge> --------------------------------------------
<henninge> Before we can push our source tree with the template we need a project that it can be associated with. A project is created here:
<henninge> https://staging.launchpad.net/projects/+new
<henninge> Let's assume you created a project called 'mytranslatable', then it's home page will be here:
<henninge> https://staging.launchpad.net/mytranslatable/
<henninge> I actually created that project on staging, so you can go to that URL and have a look.
<henninge> Once the project is created, you need to configure it for translations. Click on 'Configure translations' on the right hand side of the projects home page and it'll take you there.
<henninge> https://staging.launchpad.net/mytranslatable/+configure-translations
<henninge> Choose these settings:
<henninge>   Type of service: Launchpad
<henninge>   Translation focus: trunk
<henninge>   Translation group: Launchpad Translators (We'll talk about that in a bit)
<henninge>   Translation permission policy: Structured
<henninge> Next we need a branch to import to. From the projects home page click 'Configure project' branch.
<henninge> https://staging.launchpad.net/mytranslatable/trunk/+setbranch
<henninge> Chose 'Create a new, empty branch ...' and enter the Branch name as 'trunk'.
<henninge> Since I already did that, the current branch is already filled out in the top input field.
<henninge> Finally we need to tell Launchpad to import the translation template from this branch. For this we go to the Translations page of the trunk series. From the project homepage go to the 'Translations' tab at the top of the page. There under 'Set up translations for a series' click on 'automatic import'. This will take you here:
<henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+translations-settings
<henninge> This page should mention the branch we just created as 'lp://staging/mytranslatable'. Under Import settings chose 'Import template files' and save the settings.
<henninge> Now the project is ready to receive the template.
<henninge> Getting the PO template into Launchpad
<henninge> -------------------------------------------------------
<henninge> This is done by creating a bazaar branch containing the template file. The branch we just created in Launchpad is just an empty directory so far that we need to fill.
<henninge> If you used quickly it already created a branch for you. Otherwise create the branch by calling 'bzr init' in the projects root directory.
<henninge> I will do that now here on my machine and paste the output.
<henninge> [~/canonical/playground]
<henninge> henning@hobbes:$ cd mytranslatable
<henninge> [~/canonical/playground/mytranslatable]
<henninge> henning@hobbes:$ bzr init
<henninge> Created a standalone tree (format: 2a)
<henninge> Now add the files to the branch by calling 'bzr add'. It automatically adds all files that were not in the branch yet. Make sure your template is among them.
<henninge> Again, doing it locally now.
<henninge> [~/canonical/playground/mytranslatable]
<henninge> henning@hobbes:$ bzr add
<henninge> adding po
<henninge> adding src
<henninge> adding po/Makevars
<henninge> adding po/POTFILES.in
<henninge> adding po/mytranslatble.pot
<henninge> adding src/main.c
<henninge> adding src/main.py
<henninge> Now commit those changes to the branch.
<henninge> [~/canonical/playground/mytranslatable]
<henninge> henning@hobbes:$ bzr commit -m "Initial commit."
<henninge> Committing to: /home/henning/canonical/playground/mytranslatable/
<henninge> added po
<henninge> added src
<henninge> added po/Makevars
<henninge> added po/POTFILES.in
<henninge> added po/mytranslatble.pot
<henninge> added src/main.c
<henninge> added src/main.py
<henninge> Committed revision 1.
<henninge> Finally push it to the branch we created on Launchpad. We need to tell bzr not to complain about the already existing directory on Launchpad. Also it is nice to remember where we pushed to so that that information can be ommitted in the future.
<henninge> [~/canonical/playground/mytranslatable]
<henninge> henning@hobbes:$ bzr push --remember --use-existing-dir lp://staging/mytranslatable
<henninge> Host key fingerprint is 9d:38:3a:63:b1:d5:6f:c4:44:67:53:49:2e:ee:fc:89
<henninge> Created new branch.
<henninge> You can look at the branch on Launchpad now and see that push is being processed.
<henninge> https://code.staging.launchpad.net/~mytranslatable-maintainers/mytranslatable/trunk
<henninge> It says "Updating branch..."
<henninge> This is almost it.
<henninge> We'll have to wait a little for the branch to be procecssed and the template to be imported.
<henninge> You can see it happening in the import queue of the project series.
<henninge> https://translations.staging.launchpad.net/project-no1/trunk/+imports
<henninge> oops, wrong URL.
<henninge> I was trying this out earlier today.
<henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+imports
<henninge> Yeah, empty queue is correct. ;-)
<henninge> The branch has been processed and you can now actually browse the code on Launchpad.
<henninge> Click 'Browse the code' on the branch page.
<henninge> http://bazaar.staging.launchpad.net/~mytranslatable-maintainers/mytranslatable/trunk/files
<henninge> While we are waiting for the import to be processed, let's talk about the next step.
<henninge> Finding translators
<henninge> --------------------------
<henninge> So, who will do the translations?
<henninge> You remember that during the configuration we chose 'Launchpad Translators' as the translation group for the project. A translation group assigns translation teams to languages. Together with the the 'Structure' translation permission that we specfied this means that only members of those teams are allowed to actually add and/or approve translations. This restriction is there to ensure that translations are of good quality.
<henninge> sorry, that is 'Structured'
<henninge> The Launchpad Tranlators group has translation teams assigned for 42 languages. You should familiarize yourself with their policies and ask them to start translating your project. You can find all information about Launchpad Translators here:
<henninge> https://translations.launchpad.net/+groups/launchpad-translators
<henninge> (Not a staging URL on purpose)
<henninge> Of course it is possible to start your own translation group and assign translation teams yourself.
<henninge> But that will make you responsible to find translators yourself and organize them. This is the hard part about translation applications.
<henninge> s/translation/translating/
<henninge> Another option would be not to choose a translation group at all and leave the permissions "Open" so that anyone can translate.
<henninge> The problem here is that nobody feels responsible for the translations and experience has shown that "Open" permissions lead to bad quality translations.
<henninge> Ah, the template has been extracted from the branch and placed in the queue.
<henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+imports
<henninge> It is automatically 'Approved' as is the case with imports from branches.
<henninge> Now the import script will pick it up.
<henninge> Already happened!
<henninge> (reload the queue page)
<henninge> Once the template is imported, you can go to its overview page in Launchpad.
<henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+pots/mytranslatable
<henninge> uh-oh, wrong link.
<henninge> But you can get there from the queue ...
<henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+pots/mytranslatble
<henninge> yeah, my bad typing
<henninge> You will notice that no or just a few languages will be displayed. Don't worry about that. Every Launchpad user will only see those untranslated languages that they have configured as their preferred languages. So a Chinese translator will see Chinese in the listing and be able to click on it to start translating. Once the first string is translated to a language, that language will be visible for all in the template. You can cha
<henninge> nge your language preferences here:
<henninge> https://translations.staging.launchpad.net/people/+me/+editlanguages
<henninge> So, the template is in place, we have translators translating it, what is missing?
<henninge> Retrieving translations
<henninge> --------------------------------
<henninge> One last step remains. How do you benefit from all the translation work done in Launchpad?
<henninge> Remember the settings for branch synchronization? There is a second colmun on that page.
<henninge> https://translations.staging.launchpad.net/mytranslatable/trunk/+translations-settings
<henninge> Click on 'choose a target branch'. You can now select the same branch that was used to synchronize the template from. Make sure that you have *not* selected 'Import templates and translation files' in the left column of the settings page because that would create an unwanted loop.
<henninge> Doing that now ...
<henninge> Now the settings page says "Exporting translations to branch: lp://staging/mytranslatable"
<henninge> The PO files with the translations will be exported daily (if they have changed) to your branch from where you can retrieve them with "bzr pull" or "bzr merge".
<ClassBot> There are 10 minutes remaining in the current session.
<henninge> They will be placed in the 'po' directory of your branch from where you can process them to MO files which you can distribute with your application.
<henninge> I cannot demonstrate that here because the export will only happen in a few hours but we can check back tomorrow.
<henninge> I'll do some translations that can be exported.
<henninge> So, this is it.
<henninge> Your created a template of English strings to be translated.
<henninge> You created a project in Launchpad and configured it for translations.
<henninge> You created a branch with the source code and the template and pushed that to Launchpad.
<henninge> You asked the translators to start translating.
<henninge> You are able to retrieve the translations back into your source tree for distribution.
<henninge> I hope you could follow along.
<henninge> There is help on https://help.launchpad.net/Translations/
<henninge> A good starting point is here: https://help.launchpad.net/Translations/YourProject/BestPractices
<henninge> Which will guide you through the process, similar to what I just did.
<henninge> Questions?
<ClassBot> There are 5 minutes remaining in the current session.
<henninge> Ok, here are the promised links ;)
<henninge> Links
<henninge> -------
<henninge> [1] David's session log:
<henninge> https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/InternationalizingApps
<henninge> [2] Gettext manual, The Maintainer's View
<henninge> http://www.gnu.org/software/gettext/manual/gettext.html#Maintainers
<henninge> [3] Intltool
<henninge> https://launchpad.net/intltool
<henninge> (apt-get install intltool ; man intltool)
<henninge> Thank you for reading. Good night. ;-)
<dpm> Thanks a lot henninge, and with this we wrap up day 4 of Ubuntu App Developer Week! See you tomorrow with lots more of great content!
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%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 2011-04-15
 * obengdako is away: Away obengdako is idling about
 * obengdako is back (gone 00:00:06)
 * soreau is wondering: why some clients allow away/back messages
 * obengdako i allowed mine to do so soreau 
<soreau> obengdako: They are really useless and annoying messages
<obengdako> soreau, i know i just wanted to let those i chat with know when i've stepped away from the pc
<soreau> Hint: No one cares if you are there or not
<soreau> They certainly dont need message to proclaim absence or presence. If you are talking, they will know you you are at your computer
<Pendulum> obengdako: it's considered rude to do public away messages like that
<Pendulum> please don't do them
<Pendulum> if you set normal /away then people can use /whois to see if you're around or not
<Pendulum> (or if they PM you, they'll get a message that you're away)
<soreau> Yes, that is much more concise way of putting it
<obengdako> Pendulum, oh really then i'll disable
<obengdako> Pendulum, so i use the command "/away" instead?
<Pendulum> yep
<Pendulum>  /away <your reason>
<soreau> and /back
<Pendulum> (or just /away)
 * obengdako is away: trying the away feature
<JanC> the problem is not with 1 person doing them, but everybody starts to use those messages after some time 90% of the traffic in the channel is only that  ;)
<soreau> Right, and its useless messages no one needs to read
 * obengdako is back (gone 00:00:29)
<obengdako> okay but it still shows up in the channel Pendulum
<JanC> obengdako: seems like you have a script or alias or something that overrides teh default /away
<Pendulum> obengdako: what IRC client do you use?
<obengdako> xchat Pendulum
<obengdako> i changed some of the away settings
<obengdako> okay now it is working Pendulum i changed the announce away setting
<obengdako> now i'm away
<obengdako> hehe
<Pendulum> thanks!
<soreau> Cool
<obengdako> check my whois and tell me if i did it right
<obengdako> and what is my reason
<obengdako> Pendulum, please check my status and my reason i want to be sure those interested can tell i'm away
<soreau> * [obengdako] is away (hehe)
<Pendulum> obengdako: got the same thing as soreau
<Pendulum> thank you for fixing it so it doesn't announce
<obengdako> okay thanks Pendulum soreau
<soreau> no problem
<JanC> BTW: in xchat you can right-click a nick to see the away message
<obengdako> lol
<obengdako> so no one really uses away here in irc even when they are away?
<friez_> Hi
<dpm> The last Ubuntu App Developer Week day is starting in ~10 minutes \o/
<zenzedoon> salut a tous
<zenzedoon> hello all
<jryannel> Hi
<ghost69> hi
<dpm> Ok everyone, welcome to the last day of an Ubuntu App Developer Week packed with interesting content and speakers!
<dpm> Let's welcome jryannel once more, who is going to talk about how to extend Qt Quick with C++
* 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: Qt Quick: Extend with C++ - Instructors: jryannel
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/15/%23ubuntu-classroom.html following the conclusion of the session.
<jryannel> Hi, I'm from QtDF my name is Juergen Bocklage-Ryannel
<jryannel> I'm mainly doing training and training material
<jryannel> today I would like to talk about Qt Quick and how you can extend it with c++
<jryannel> For all of you who don't know Qt Quick...
<jryannel> it's a declarative language build on top of Qt C++ to create great user interfaces
<jryannel> I prepared a small project for today
<jryannel> please download it from: https://github.com/jryannel/ubuntu-qtquick-webinar
<jryannel> I will try to guide you through the project. While you are downloading I will tell you something about Qt Quick and C++
<jryannel> Don't worry if you can't download you will also understand without
<jryannel> Qt Quick is based on a Qt module called QtDeclarative
<ClassBot> saimanoj asked: how to download the project?
<jryannel> Please go to: https://github.com/jryannel/ubuntu-qtquick-webinar
<jryannel> you need to have git installed
<jryannel> or grab the zip file under downloads
<jryannel> QtDeclarative uses our graphicsview (a 2.5d canvas based on graphics items)
<jryannel> QtDeclarative is a ui runtime
<jryannel> it contains an QtDeclarativeEngine which will interpret your qml file
<jryannel> and a QtDeclarativeView which will paint the items
<jryannel> If you open the project (QtCreator ->Open Project) QmlCppExample.pro in
<jryannel> ubuntu-qtquick-webinar/QmlCppExample source tree
<jryannel> You will see the project files.
<jryannel> Please open the QmlCppExample.pro file
<jryannel> in the .pro file I added "QT += gui declarative"
<jryannel> This is to make the project aware we want to use the QtDeclarative modue
<jryannel> Now we can use the module in the main.cpp
<jryannel> Please open the main.cpp file
<jryannel> There we create a view "QDeclarativeView view;" and set the
<jryannel> qml source with "view.setSource(QUrl::fromLocalFile("main.qml"));"
<jryannel> As usual in qt you need also call show " view.show();"
<jryannel> You will find the main.qml file in "Other Files" in Qt Creator
<jryannel> It's a simple Rectangle with a blue color and a MoouseArea, which doesn't do anything currently
<jryannel> Just try to run the project
<jryannel> for people which don't use qt creator...
<jryannel> qmake; make; ./QmlExampleCpp
<jryannel> You need to have Qt 4.7 installed and in you rpath
<jryannel> If you get an error running the project in creator, you need to uncheck the shadow build
<jryannel> This is on the side-bar under the Projects tab
<jryannel> Just uncheck there "Shadow build"
<jryannel> If you run the project, you see a blue window, which is our blue Rectangle
<jryannel> In our project we would like now to change the color from c++ side
<jryannel> You need to uncomment the code between  //1{ ... //1} markers
<jryannel> in main.cpp and main.qml
<jryannel> Also comment the code between //{0 markers in qml
<jryannel> in main.cpp the line "view.rootContext()->setContextProperty("value", QColor("green"));"
<jryannel> pushes a property "value" into our rectangle with the value of the color green
<jryannel> We access the value in our qml file with "color: value"
<jryannel> This right side value actually comes form the c++ side.
<jryannel> So far so easy
<jryannel> Now we want to push something more complicated into our declarative environment,
<jryannel> a QObject which has a value, which again is a color.
<jryannel> Please comment the code between //{1 markers and uncomment the //{2 markers
<jryannel> in main.cpp and main.qml
<jryannel> We have a class derived from QObject called ValueObject which contains a value property
<jryannel> If you look up the valueobject.h file you can see how you declare properties for qml
<jryannel> You have a setValue(...) a value() method and
<jryannel> a valueChanged() signal
<jryannel> all 3 are required for a read/write property
<jryannel> We make them aware to the object as property with...
<jryannel> Q_PROPERTY(QColor value READ value WRITE setValue NOTIFY valueChanged)
<jryannel> This says, make a property of type QColor named color ...
<jryannel> the read method is the value() method,
<jryannel> the write method is the setValue(...) method
<jryannel> and to notify qml about changes use the valueChanged() signal
<jryannel> All methods are pretty simple, the only one worth mentioning is... setValue(...)
<jryannel> Please have a look in the valueobject.cpp file for the setValue implementation
<jryannel>     if(_value != value) {
<jryannel>         _value = value;
<jryannel>         emit valueChanged();
<jryannel>     }
<jryannel> The if ( ... ) is a guard to avoid loops.
<jryannel> Only if the value has really changed you should emit the changed signal. You need to obey this rule, otherwise you can get infinite change loops
<jryannel> So now we have q ValueObject with a value property ready to be used in qml
<jryannel> In main.cpp we create a object of this value with: "ValueObject* value = new ValueObject(QApplication::instance());"
<jryannel> and push it into qml with "view.rootContext()->setContextProperty("valueObject", value);"
<jryannel> This says, make our value object known to qml as "valueObject"
<jryannel> So we can use it now in our main.qml file
<jryannel> "color: valueObject.value"
<jryannel> You should see a blue rectangle. You can change the color simple by changing the color in valueobject.cpp (look for  _value(Qt::blue)
<jryannel> Another way to change it is inside qml. Here we use the mouse area
<jryannel> "onClicked: valueObject.value = "yellow"" will make our valueObject color property change to yellow
<jryannel> This change is cascaded to our rectangle
<jryannel> remember we have our rectangles color bound to "color: valueObject.value"
<jryannel> So when you click on the rectangle the onClicked handler is called and the color should change to yellow
<jryannel> I hope you can still follow me :)
<jryannel> Next case would be we would instead of a simple property, we want to create a new qml element.
<jryannel> We want to have a ValueObject element in qml, where we can get the color value from.
<jryannel> For this please comment the //{2 marker code and uncomment the //3{ markers code
<jryannel> So instead to push an object, we want to register a new type to qml.
<jryannel> Look in the main.cpp file...
<jryannel> Here we find: "qmlRegisterType<ValueObject>("Application", 1, 0, "ValueElement");"
<jryannel> This line says, register the type ValueObject under the module name "Application" in version 1.0 as ValueElement element
<jryannel> So now we have in a module Application a new qml element calles ValueElement
<jryannel> Let's see how we can use it: open the main.qml file
<jryannel> The line "import Application 1.0" imports our new module
<jryannel> which we registered with the qmlRegisterType from c++ code
<jryannel> Sure you can have many elements inside one module.
<jryannel> We use the new element with "ValueElement { id: valueElement }"
<jryannel> Our new element is now accessible under the id: valueElement.
<jryannel> As this is a new element you can create as many of them as you want
<jryannel> with "color: valueElement.value" we access the color of our new element, by the id
<jryannel> and in our mouse area we can change the color using "onClicked: valueElement.value = "red""
<jryannel> I hope you get the idea
<jryannel> Jus to recap...
<jryannel> You can push simple properties into qml, complex properties (e.g. objects)
<jryannel> and also new elements.
<jryannel> But this is just the start...
<jryannel> You can create own elements which can paint, for example an ellipse
<jryannel> For this you would need to derive a class from QDeclarativeItem
<jryannel> But I think we are running out of time to show this here...
<jryannel> So I post some links with comments
<jryannel> have a look at :http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition for the "Training Module Integrating QML with C++ from"
<jryannel> This explains how to create a simple ellipse item and adds on this more complicated stuff, e.g creating other types, using enums, ...
<jryannel> You you want to learn more about what we did currently please read: Qt Declarative Binding
<jryannel> http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html
<jryannel> and Extending QML Functionalities using C++
<jryannel> http://doc.qt.nokia.com/4.7-snapshot/qml-extending.html
<jryannel> You can also create qml modules as plugins
<jryannel> This is explained in the training module, but also in QDeclarativeExtensionPlugin Class Reference
<jryannel> http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeextensionplugin.html#details
<jryannel> If you want to mix traditional widget code and qml please look at: Integrating QML Code with Existing Qt UI Code
<jryannel> http://doc.qt.nokia.com/4.7-snapshot/qml-integration.html
<jryannel> If you want to see how the Qt developers have written their declarative items, checkout the qt source code and navigate to: /src/declarative/graphicsitems/
<jryannel> There you find the code for the Item qml element in "qdeclarativeitem.h"
<jryannel> And for the Rectangle element in "qdeclarativerectangle_p.h"
<jryannel> Please note the rectangle has a _p in the name, which declares it as private. So you can't derive from it in c++.
<jryannel> Only the QDeclarativeItem class is meant to be derived
<jryannel> I would recommend you checkout the Example: Minehunt
<jryannel> http://doc.qt.nokia.com/4.7-snapshot/demos-declarative-minehunt.html
<jryannel> This shows how to make a minehunt game in qml, where the game logic is in C++
<jryannel> You find other examples at: More Examples:
<jryannel> http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeexamples.html
<jryannel> From the DevDays 2010 in Munich we have also a video, which explains QtQuick and C++ very nicely: TechTalk Developer Days 2010
<jryannel> http://qt.nokia.com/developer/learning/online/talks/developerdays2010/tech-talks/qt-quick-for-c-developers
<jryannel> This closes my talk on Extending Qt Quick with C++.
<jryannel> I hope some of you where able to compile the example and get an idea about how qml and C++ can work together.
<jryannel> Remember you can use JavaScript in QML, but you should not make to much use of it for performance reasons.
<jryannel> But this truly depends where you run your code.
<jryannel> A tip at the end, you can also embed qml files as resource files in your executable.
<jryannel> By this deployment get's much easier
<jryannel> I would like to see how someone uses Qt Quick with a WebFramework like Rails or Django
<jryannel> QtQuick is network transparent so you can load qml files form a server or let them dynamically generate by a webframework :)
<jryannel> Okay take care and I leave the stage for the next session. Bye!
* 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: Phonon: Multimedia in Qt - Instructors: apachelogger
<dpm> You'll know him not only for his good looks and legendary coding skills, but also for having rocked this AppDeveloper Week: there he is - KDE/Kubuntu developer apachelogger talking about how to write a multimedia app in virtually no time!
<dpm> apachelogger, let's roll!
<apachelogger> :D
<apachelogger> thanks dpm
<apachelogger> bonjour, ahoy and welcome everyone!
<apachelogger> ...for the third time this week ;)
<apachelogger> Today's special on the menu: Phonon, the most awesome terrific super cool magical unicorn multimedia abstraction library ever!
<apachelogger> First let's get dependencies sorted out as we will have a bit of coding later on.
<apachelogger> If you like GStreamer you might want to use this command:
<apachelogger> sudo apt-get install phonon-backend-gstreamer libphonon-dev qt4-qmake libqt4-dev build-essential
<apachelogger> If you like VLC you might however want this one:
<apachelogger> sudo apt-get install phonon-backend-vlc libphonon-dev qt4-qmake libqt4-dev build-essential
<apachelogger> If you have a very old version of Ubuntu OR like xine:
<apachelogger> sudo apt-get install phonon-backend-xine libphonon-dev qt4-qmake libqt4-dev build-essential
<apachelogger> At any rate a simple text editor will suffice for the editing part ... it is all nicely prepared for copy and paste :D
<apachelogger> Should there be any questions, please just drop your QUESTION: in #ubuntu-classroom-chat at any point.
<apachelogger> But enough of that nonesense.
<apachelogger> Let us talk about Phonon \o/
<apachelogger> Phonon is a multimedia abstraction library powered by pluggable backend components, adapting the Phonon API to specific multimedia frameworks/libraries.
<apachelogger> ^ I actually made that description up just 5 minutes ago, though it captures Phonon pretty well, plus it got buzz word factor ;)
<apachelogger> Primarily Phonon is an abstraction layer between multimedia consuming applications (such as music players, games or sound notification systems) and a specific multimedia library (GStreamer, VLC, Xine, Helix, QuickTime, DirectShow, Microsoft Media Foundation, etc.)
<apachelogger> Possibly the fact that I listed 7 of such libraries and yet could not resist appending an 'etc' might give you an idea of why exactly abstraction makes sense.
<apachelogger> Who seriously would want to maintain good multimedia experience on >3 operating systems?
<apachelogger> Well, the Phonon team, obviously ;)
<apachelogger> Especially in a Qt context you really do not want to make your application depend on one of those 300^31000 libraries for multimedia, or  implement your own abstraction system just to become portable to all platforms (read: operating systems) that you might have time to implement support for. Instead we could just do it once ... in Phonon.
<apachelogger> Additionally. If one of these libraries decides to change their API, why would every Qt application developer need to spend their Monday afternoon changing their code to suite the new API?
<apachelogger> If we just as well could do it once ... in Phonon.
<apachelogger> I suppose highlighting all the advantages and disadvantages of abstraction is a bit of apointless exercise, so I better stop now.
<apachelogger> Actually.
<apachelogger> Do not let me blind you... Phonon is not the solution to every problem in computer science. It is abstraction after all.
<apachelogger> If you have a look at the Wikipedia artcile on abstraction you will probably read something like "using a common denominator".
<apachelogger> This implies being more limited. As always ... the general is less specific than the specific ;)
<apachelogger> Due to the given constraints of abstraction Phonon does not try "to do it all".
<apachelogger> It does not strive to support every possible use case that might or might not exist for a multimedia library.
<apachelogger> Instead we are focusing on the (actually very small) number of key features that are of use to the greatest possible amount of application developers.
<apachelogger> Phonon tries to provide the common set of features you will require in your off the shelf media-enabled applications.
<apachelogger> This ranes from simple (non 3 dimensional) games to video and music players.
<apachelogger> In particular, if you have a look at the Phonon API
<apachelogger>  (i) http://doc.qt.nokia.com/latest/phonon-overview.html
<apachelogger> you will hopefully notice that the core set of features of the key classes are actually able to cover jsut about everything most multimedia applications will ever want to do.
<apachelogger> This of course primarily is playback.
<apachelogger> More precisely: simple playback in the manner of just needing to throw a URL at Phonon and it will try to do something meaningful.
<apachelogger> More advanced features are usually bound to the availability of support in the underlying libraries and thus more dynamic (they might be there, or not, or partially etc.).
<apachelogger> That way it is possible to implement a common denominator and at the same time stay powerful enough to enable terrific media-centric applications such as good looking video players.
<apachelogger> ....talking about video player...
<apachelogger> I think it is about time to start doing some coding, because I am getting bored writing all that stuff and would like to copy and paste a bit more ;)
<apachelogger> At FOSDEM I boldly claimed that I could do a video player with 3 lines of Phonon specific code in C++. Whether that is any useful is a question that shall remain unanswered.
<apachelogger> It is however perfect to grasp the basic concept, even if I do not know any application that would only need 3 lines as you usually want to do more engaging things anyway. But oh well... :)
<apachelogger> You can get a template for this from
<apachelogger>  (i) http://people.ubuntu.com/~apachelogger/uadw/04.11/phonon-template.tar.gz
<apachelogger> Simple extract it somewhere.
<apachelogger> Inside you can find a main.cpp, a qmake build file and a video and audio file (or so I hope).
<apachelogger> The code I will present goes into the main.cpp in the main function in between the 2 statements that are already there. Includes are also there, so if all goes well you should be able to build this stuff right away.
<apachelogger> Talking about building, you can do that by running
<apachelogger> qmake .
<apachelogger> and
<apachelogger> make
<apachelogger> and then
<apachelogger> ./demo
<apachelogger> to run the application.
<apachelogger> Right then.
<apachelogger> Let us start with a simple audio player.
<apachelogger> The first thing you always need when working with phonon is a media object.
<apachelogger> With Phonon you build a thing we call the media graph, which at its root has the media object.
<apachelogger> To the media object you can attach various outputs (AudioOutput, VideoWidget ...) and even 'inject' effects between the media object and the outputs.
<apachelogger> Very easy to understand I shall hope.
<apachelogger> The media object is like the heart of every media graph. It controls what file you are currently playing, if you are playing at all, at what time the media is ....
<apachelogger> And the best thing about the media object is, that it is insanely easy to create ;)
<apachelogger>  (i) Code samples is always indented with 4 spaces
<apachelogger>     MediaObject mo;
<apachelogger> That did not hurt at all, right?
<apachelogger> Now let us also add an AudioOutput while we are at it...
<apachelogger>     AudioOutput ao;
<apachelogger> You can have many of these media objects, each doing a different thing. For example if you are creating a game, you might want to have a media object (thus graph) for background music and another media object for event sounds (like when a pony rides through the screen).
<apachelogger> Due to this we will need to tell our media object that it should be connected to our audio output. Otherwise there will be probably no sound... wouldn't be much of an audio player then ;)
<apachelogger> Doing this is very easy, we just call Phonon::createPath(a,b)
<apachelogger> like this:
<apachelogger>     createPath(&mo, &ao);
<apachelogger> Now that we have a media object and an audio output and have told the media object to spit out audio via the audio output, we only need to set a source and ask our nice media object to start playing the source.
<apachelogger> As the template already includes some music (in particular Amarok's first run jingle in case anyone is interested) you can use the following:
<apachelogger>     mo.setCurrentSource(MediaSource("./first_run_jingle.ogg"));
<apachelogger>     mo.play();
<apachelogger> Putting the pieces together you should have something like this in your main.cpp:
<apachelogger>     MediaObject mo;
<apachelogger>     AudioOutput ao;
<apachelogger>     createPath(&mo, &ao);
<apachelogger>     mo.setCurrentSource(MediaSource("./first_run_jingle.ogg"));
<apachelogger>     mo.play();
<apachelogger> You can compile it using the commands mentioned earlier
<apachelogger> qmake . && make
<apachelogger> If all goes well you shoudl be able to run ./demo and hear music. I at least do \o/
<apachelogger> Now let us dive into video playback. But I must warn you, it is going to be just as difficult as audio! :O
<apachelogger> First we create a video widget (which is about the video version of audiooutput), then attach our media object to it.
<apachelogger>     VideoWidget vw;
<apachelogger>     createPath(&mo, &vw);
<apachelogger> Should you have worked with Qt before you will probably expect that VideoWidget is a QWidget and needs to be shown explicitly... and you are right.
<apachelogger> Simply add
<apachelogger>     vw.show();
<apachelogger> So that is 3 more lines to get video.
<apachelogger> Of course the amarok jingle is only audio, so that source is not going to be any good. I just get a black video window :(
<apachelogger> But fear not, your well prepared instructor has thought of this problem and also bundled a video into the template :P
<apachelogger> Simply exchange the previous line where we setCurrentSource() with this one:
<apachelogger>     mo.setCurrentSource(MediaSource("./konqi_ad1.ogg"));
<apachelogger> Again run
<apachelogger> make
<apachelogger> and ./demo should now show a video window with a rather old advertisment for the KDE Desktop \o/
<apachelogger> But what is this? We are far away from 3 lines of code! Oh noes!
<apachelogger> Maybe I was too daring, claiming such a silly thing :/
<apachelogger> Or not... :P
<apachelogger> Please remove all that plunder we carefully pasted into the main.cpp and let us start from scratch.
<apachelogger> Let us think about this again.
<apachelogger> We want a video player, we want it to play a video, and we want it to show a video.....
<apachelogger> maybe we should do it just like that.
<apachelogger>     VideoPlayer vp;
<apachelogger>     vp.play(MediaSource("./konqi_ad1.ogg"));
<apachelogger>     vp.show();
<apachelogger> Voila! A video player (with audio) in 3 lines of code :P
<apachelogger> aha!
<apachelogger> akshatj_ just complained that I cheated by hardcoding the URL.
<apachelogger> I suppose it depends on the POV, I could add Qt magic to get a file open dialog or something and it still would be only 3 lines of phonon specific code ;)
<apachelogger> Which was my original scope for the mission.
<apachelogger> Well.
<apachelogger> Qt to the resuce.
<apachelogger> Let us be user friendly here.
<apachelogger> Exchange our previous hardcoded media source with
<apachelogger>     MediaSource(QFileDialog::getOpenFileName())
<apachelogger> So that our vp.play warps into:
<apachelogger>     vp.play(MediaSource(QFileDialog::getOpenFileName()));
<apachelogger> There. Still 3 lines and even with a file selector dialog at start up :)
 * apachelogger hopes akshatj_ is happy now :)
<apachelogger> Just to go one step further. In the future you will also be able to create a video player without any code *at all*. In about 30 seconds.
<apachelogger>  (i) http://www.youtube.com/watch?v=HrMSIrhFYlY
<apachelogger> I hope I was able to interest you in Phonon and would be super happy to see your amazing new applications become even more amazing through superb multimedia :)
<apachelogger> More information on Phonon is avilable in the Qt documentation
<apachelogger>  (i) http://doc.qt.nokia.com/latest/phonon-overview.html
<apachelogger> As well as an overview of the in Qt included classes:
<apachelogger>  (i) http://doc.qt.nokia.com/latest/phonon-module.html
<ClassBot> There are 10 minutes remaining in the current session.
<apachelogger> ClassBot: Thank you, you are the sweetest :)
<apachelogger> If there should be any questions, you now have <10 minutes to get them answered....
<apachelogger> Meanwhile I can also tell you a bit about future developments in Phonon. One of the amazing new things we will see appearing in (stable) Phonon hopefully before 2012 is audio and video capturing.
<apachelogger> I have been playing around with this a couple of months ago and it is really easy to use and enables the creation of real fun applications I believe.
<apachelogger> Also, so Google and KDE will, we will get superb QML support and simple encoding capabilities.
<ClassBot> There are 5 minutes remaining in the current session.
<apachelogger> It would also appear that there are rumors that a new version of the VLC backend component is just around the corner (but don't tell anyone ;))
 * apachelogger is out of things ot tell and his fingers hurt
<apachelogger> I think we can wrap this up.
<apachelogger> Thanks for reading and have a nice day :)
<apachelogger> o/
<ronoc> right
<ronoc> hello folks
<ronoc> so the plan for this session is to discuss integrating with the sound menu
* 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: Integrating music applications with the Sound Menu - Instructors: ronoc
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/15/%23ubuntu-classroom.html following the conclusion of the session.
<ronoc> firstly I would like to point out that early in the O cycle we will make available via libunity the ability to integrate with the menu
<ronoc> this will mean developers will not need to worry about mpris interfaces and will just need to use this api
<ronoc> Can I ask which of you here are interested in implementing a compliant player from scratch ?
<ronoc> right so nobody so far, for Maverick we used libindicate for registration with the menu
<ronoc> i reworked this during the natty cycle so as a compliant mpris interface was all that was needed to integrate with the menu
<ronoc> but there is abit more involved than just raising an mpris interface
<ronoc> mpt went to great lengths to define a preferred workflow with players and the menu so as players can optin or opt out of the menu through their own UI
<ronoc> more info on all of this can be found on the wiki (wiki.ubuntu.com/SoundMenu)
<ronoc> each player should allow the user to to have the option to opt in or opt out. The functionality behind all of this is in the indicator-sound's gsettings
<ronoc> again info on all of this can be found on that wiki page
<ronoc> also there is a mailing list which you should join if you are developer interested in this
 * ronoc digs up the lp page
<ronoc> https://launchpad.net/~indicator-sound-developers
<ronoc> I use this to announce to devs about upcoming changes
<ronoc> I feel though after this cycle must of the architecture is settled
<ronoc> so no major changes planned for now
<ronoc> back to what I was saying previously, one of my main reasons for moving away from libindicate and using a strictly dbus registration mechanism
<ronoc> was to reduce / remove any i-s related dependency for clients
<ronoc> i-s = indicator-sound
<ronoc> clients = players = banshee, rhythmbox etc
<ronoc> by doing this it means that players like spotify work seemlessly without any i-s specific work by the spotify team
<ronoc> furthermore the change to use gsettings as a way of recording blacklisted applications or applications which have previously registered means that the menu dynamically updates when some change has been wrote to the i-s gsettings
<ronoc> this did happen before with the maverick version
<ronoc> any questions anyone
<ronoc> anything in particular you would like me to go through ?
<ronoc> ok, so for clients,the main thing is to raise an mpris interface with the desktop entry properly filled in
<ronoc> the mechanism works so as when an mpris interface appears on the bus the service attempts to load the desktop file defined on the root mpris interface for the client
<ronoc> if all is good , then the player is inserted in the menu
<ronoc> the mpris people have been very supportive in redefining the spec over the last year which has really made this all work nicely
<ronoc> whether you support the playlist interface or not is determined by the service at start up by querying the interfaces listed by your player
<ronoc> if the service finds a playlist interface then its exposes the relevant dbusmenu items
<ronoc> any questions anyone ?
<ronoc> we had a scrub bar at one point but it was removed due to design clutter which in retrospect was a good call by mpt
<ronoc> the back end for pulse has been totally refactored this cycle and pretty confident that it should work well now (before it was a bit of fudge due to time restrictions)
<ronoc> also this cycle I introduce the voip slider
<ronoc> next cycle we will do work which allows for the voip slider to be added for applications that are not just necessarily voip apps
<ronoc> so gnome-sound-recorder running will trigger the appearance of the voip slider
<ronoc> i have done the work for this in a branch but won't merge until the O cycle begins
<ronoc> what else ?
<ronoc> i feel though now ( a year down the road)
<ronoc> the code and the architecture of the i-s is pretty stable/completed
<ronoc> obviously new features require new code but as the spec stands I have all angles covered
<ronoc> is there anything people would like to see added ?
<ronoc> I suppose 7pm in Europe on Friday isn't the best idea
<ronoc> although there must be some Americans here full of beans
<ronoc> As I expressed earlier one of the main reasons for the reworking of the registration architecture was to allow players to easily integrate
<ronoc> there are still some players though that do not integrate
<ronoc> totem being one
<ronoc> which I have not got around to writing
<ronoc> nothing ubuntu specific is required anymore just a compliant mpris interface
<ronoc> !q any questions
 * ronoc is getting the hang of using the classbot
 * ronoc waits for some interaction
<ronoc> don't really know what else really needs to be covered ...
<ronoc> Any question guys, please ping me
 * ronoc enjoy Richard Skelton's latest release on type
<ClassBot> There are 10 minutes remaining in the current session.
<ClassBot> There are 5 minutes remaining in the current session.
<ronoc> Ok folks all done here I think
<ronoc> Good weekend all
<james_w> thanks ronoc
<ronoc> Cheer james_w
<ronoc> cheers even
* 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: pkgme: Automating The Packaging Of Your Project  - Instructors: james_w
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/15/%23ubuntu-classroom.html following the conclusion of the session.
<james_w> hi everyone
<james_w> My name is James Westby
<james_w> I'm here to talk to you about pkgme
<james_w> who has a cool application that they would love to make available to people on Ubuntu?
<james_w> who doesn't know how to go about packaging their application?
<james_w> who knows, but doesn't want to be bothered with that?
<james_w> if that is you then pkgme may just be the tool for you
<james_w> pkgme's job is to take a look at your project and generate you some packaging for it that will likely work
<james_w> it's not going to be packaging that is perfect, but it should at least be enough for you to put your application in an PPA and get people testing it
<james_w> and you can then improve it as needed to suit your use
<james_w> so, how does pkgme work? Is it magic?
<james_w> no, it's not magic, it just has a few principles that it uses to make decisions
<james_w> firstly, you probably wrote your application using some standard technologies/layout
<james_w> e.g. you might have used autotools and so have a ./configure file
<james_w> or you might have used python and so have a setup.py
<james_w> or it might be a KDE application, a rails application, a cmake application, a vala application etc.
<james_w> pkgme doesn't care what you used, as long as it has heard of it
<james_w> pkgme has the concept of a "backend", which is a set of scripts that know how to deal with each of those classes
<james_w> so the first thing it does is look at your project and decide which class it falls in to
<james_w> if it is a python application with a setup.py then it will activate the backend that it has for that
<james_w> if you are unlucky then it either won't be able to tell which class your application falls in to, or it won't have a backend for your class
<james_w> if it's the former then you can file a bug on pkgme and we will fix it
<james_w> if it is the latter then you can help by contributing the backend for that class. It's pretty easy, and we'll look in more detail at that later
<ClassBot> akshatj_ asked: So that means no messing around with /debian, pkgme does the dirty job for you?
<james_w> yep, that's its aim
<ClassBot> chadadavis asked: So, others can provide other backends, for say Perl modules ?
<james_w> exactly, we'll look at how to do this later, it's pretty easy, and the more backends there are the better
<james_w> you could even write a backend for the exact way that you write projects if you like
<james_w> but if you stick to something common, like perl, then the aim is to have the backend already there, so you don't have to care about any of this
<james_w> so once pkgme has decided which backend it will use for your project it goes ahead and writes out the debian/ directory with the needed files
<james_w> let's take a look at it in action
<james_w> so, pkgme itself isn't yet packaged, so we can test it out on itself
<james_w> the first thing you need to do is install python-virtualenv, as we'll need that package
<james_w> then you should run
<james_w> bzr branch lp:pkgme
<james_w> to get the code
<james_w> once that is done then run
<james_w> virtualenv virtualenv
<james_w> (yes that is repeated)
<james_w> that will create you a python "virtualenv" in a directory of the same name. We'll do this so that we don't interfere with the rest of your system while we are testing this
<james_w> then run
<james_w> cd pkgme
<james_w> and you can look around the code
<james_w> next run
<james_w> source ../virtualenv/bin/activate
<james_w> this activates the virtualenv that you just created
<james_w> then run
<james_w> python setup.py install
<james_w> once that completes the setup is over, and we can start to test pkgme
<james_w> pkgme works on the project that it finds in the current directory
<james_w> and we are currently in the directory of pkgme
<james_w> so it will work on itself here
<james_w> if you run
<james_w> PKGME_BACKEND_PATHS=pkgme/backends/ pkgme
<james_w> it will think for a moment and then finish, and you will find a shiny new "debian" directory that wasn't there before, and it contains the packaging that pkgme just created for itself
<james_w> is it any good though
<james_w> ?
<james_w> to try it out you can run "debuild -b -uc -us"
<james_w> that will build the package, and here it spits out a .deb file that you could install
<james_w> at this point you could build a source package and upload it to your PPA for others to try
<james_w> now, pkgme is quite a young project, so this was a bit of a hassle, but soon it will be packaged and ready to go
<james_w> and you would have just run
<james_w> sudo apt-get install pkgme
<james_w> pkgme
<james_w> and it would have given you the packaging
<james_w> we will likely add a mode to put the result in your ppa too
<james_w> so it would be one command to install pkgme, and then one command to get your shiny new application in to a PPA so that people can use it easily
<james_w> I think that's pretty cool, I don't know about you
<james_w> we could even have a button on launchpad to do it all for you, so you would commit your code to bzr, push it to launchpad, and click the button
<james_w> it doesn't get much easier than that, does it?
<james_w> now, what happens if it doesn't work, or the packaging doesn't work quite right?
<james_w> often this will be because you have done something that doesn't quite line up with the standard way of doing things in your class of project
<james_w> because this is your project you may be able to easily change that
<james_w> plus there will be a way eventually for you to customise the packaging in certain ways for when you can't really change to match the standards
<james_w> but we want to learn more about those cases before we decide how to implement that
<james_w> so give it a try on your own projects and let us know how it goes
<james_w> there is a #pkgme irc channel that you can join
<james_w> or there is a mailing list as part of the https://launchpad.net/~pkgme-devs team
<james_w> so, any questions at this point?
<ClassBot> chadadavis asked: This reminds me of Launchpad recipes. Are there plans to develop these in parallel. It would be cool if I could use pkgme locally to test things and then let launchpad recipes take care of daily builds.
<james_w> funny, I worked on Launchpad recipes too :-)
<james_w> I would like to have them working together, but it's very early days
<james_w> recipes are great, but they still require someone to create the packaging
<james_w> having a launchpad feature to run pkgme and put the result in a branch, and then create a recipe to build it every day would be great
<james_w> I'm pretty sure I can convince the Launchpad developers to implement it if we can show the pkgme works well for a lot of people, so I'd love your help to make sure it does
<ClassBot> stefano-palazzo asked: is there an example hello world program in Python, with all of the setup.py business set up, that I can download?
<james_w> I don't know actually
<james_w> I think if you use quickly it creates one for you
<james_w> http://packages.python.org/an_example_pypi_project/setuptools.html might be of help
<ClassBot> akshatj asked: Would it have user input for descriptions? The current automatically generated ones are horrible
<james_w> you are right, they are horrible :-)
<james_w> I would like to have the ability to specify them somehow, but we haven't decided how that should work yet
<james_w> if you have an opinion then please let us know
<james_w> the mailing list I mentioned at https://launchpad.net/~pkgme-devs would be a great place to do that
<james_w> so, has anyone tried pkgme on their own projects yet?
<james_w> if you do
<james_w> ls pkgme/backends
<james_w> you will see that there are currently only "python" and "vala" backends implemented
<james_w> chances are that your needs aren't covered by those two
<james_w> we would love you to help by contributing a backend
<james_w> they are easy to write, but it's hard for us to know each language/project class well enough to write them ourselves
<james_w> you don't need to know anything about packaging to write one, we take care of all those parts :-)
<james_w> what do you do if you want to write a new one?
<james_w> take a look at http://pkgme.net/doc/backends/index.html
<james_w> you can start right now in fact
<james_w> bzr mkdir pkgme/backends/mybackend
<james_w> the first thing we write is a "want" script
<james_w> this is used to decide if your backend can handle a particular project
<james_w> in this script you take a look at the files in the current working directory and decide if you know what to do with them
<james_w> so, if you want to do a perl backend, then it will likely do something like
<james_w> if [ -f "Makefile.PL" ]; then
<james_w>     echo 20
<james_w> fi
<james_w> if you want to a a java/Ant backend then you would do something like
<james_w> if [ -f "build.xml" ]; then
<james_w>    echo 20
<james_w> fi
<james_w> I don't really know, whereas you do, which is the point of this backend split in pkgme :-)
<ClassBot> chadadavis asked: Now, if I want to make a backend, it will have certain dependencies, specific to it. So, will the backends be packaged separately. E.g a Perl backend might require many perl modules that others dont' need to install pkgme.
<james_w> good question.
<james_w> it probably makes sense to package them separately, and have a metapackage that pulls in all/most of them by default
<james_w> right, back to our backend
<james_w> the way pkgme interacts with a backend is to ask it a bunch of questions, each of them to get one piece of information about the project
<james_w> what is its name?
<james_w> what version is it?
<james_w> what dependencies does it have?
<james_w> what is its description?
<james_w> the backend is supposed to make its best attempt to answer, but if it can't answer a certain question then pkgme will try and cope
<james_w> how does it ask these questions?
<james_w> take a look at the vala backend
<ClassBot> There are 10 minutes remaining in the current session.
<james_w> you will see a bunch of files with names like "package_name"
<james_w> they will be run by pkgme to get the information
<james_w> so you can create pkgme/backends/mybackend/package_name and echo "myproject" in there, and pkgme will use that as the name
<james_w> obviously a backend would usually look at the project files in the current directory to find out the name
<james_w> see the bottom of http://pkgme.net/doc/backends/index.html for the information that pkgme might ask about
<james_w> the scripts you should create are named the same
<james_w> as I'm almost out of time, I'll leave it there
<james_w> any further questions
<james_w> after the session if you have questions then there is the #pkgme irc channel
<james_w> and the mailing list at https://launchpad.net/~pkgme-devs
<james_w> spend one hour writing a pkgme backend, and never have to care about packaging again! :-)
<ClassBot> There are 5 minutes remaining in the current session.
<james_w> thanks everyone!
<james_w> please help it succeed by testing and giving feedback, and contributing backends
<james_w> it won't succeed otherwise, and you'll be back to creating packaging yourself for all your applications :-)
<jcastro> alright, thanks james!
<james_w> now for some unity!
* 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: Unity Technical Q&A - Instructors: DBO, jcastro
<jcastro> ok so does the bot kick in or what?
<jcastro> oh well that answers that!
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/15/%23ubuntu-classroom.html following the conclusion of the session.
<jcastro> welcome everyone to the Unity developer Q+A with me and Jason Smith
<DBO> Howdy folks!
<jcastro> I'll be fielding the questions
<jcastro> and then Jason will answer them
<DBO> like a boss
<jcastro> so while you think of questions, jason why don't you tell us about some of the cool things you can do in Unity.
<DBO> So some of our favorite new features in Unity this cycle are lenses, and the new libunity launcher API, I will touch on lenses first
<DBO> Lenses are bits of pluggable UI used to mash up websites and other applications into the dash
<jcastro> For example: http://i.imgur.com/yNjY0.jpg
<DBO> creating a lense (like the one shown above) takes very little time :)
<ClassBot> james_w asked: what is the dee thing that I keep hearing about?
<DBO> libdee is a low level dbus based library that is used to keep tables of data in sync between two remote objects
<DBO> basically libdee provides a stable and fast data model over dbus that abstracts away the annoying syncronization issues
<DBO> libdee is used in unity to keep places daemon result data up to date in the dash's lenses
<DBO> I hope that answers your question
<DBO> another piece of API we have created this time around is the libunity launcher API
<DBO> this API allows you to modify existing launcher icons in a very simple manner. Currently it supports adding progress bars, count tags, and setting urgency hints to a launcher icon
<jcastro> Here's an example of Thunderbird integrating with Unity via the launcher API: http://vimeo.com/21027015
<DBO> Additionally through libunity, application authors are able to add quicklists to their applications, extending existing functionality and providing more right click options
<jcastro> http://ubunturocking.wordpress.com/2011/04/12/dynamic-quicklists-in-unity/
<jcastro> here's an example of how app authors can generate quicklists from their applications
<ClassBot> saimanoj12 asked: Why are these links not clickable?
<DBO> because your IRC client has failed you?
<jcastro> :)
<DBO> honestly I dont know :)
<ClassBot> MeanEYE asked: Will there be a possibility to add more than one progress bar to dash using API?
<DBO> Currently this is not possible
<DBO> I am not aware of any plans to expand this functionality either
<DBO> I think the general idea is to keep the design as simple as possible. We dont directly indicate what the progress bars are for, therefor having two would not directly inform you which progress bar belongs to which task
<ClassBot> MeanEYE asked: Did you plan on adding emblems to counters? For example email client could display how many messages needs to be send and how many unread. This can get UI a bit clunky, maybe putting those in tooltip.
<DBO> We already do that
<DBO> libunity::LauncherEntry has a count member variable, that when set results in a count being displayed on the launcher
<ClassBot> crazedpsyc asked: in his session, kamstrup said progress bars and badges are being, or have already been removed because the design team voted against them. Is this true?
<DBO> Progress bars have been kept, badges were removed, count is still present
<DBO> and being able to set urgency status was also added at the same time
<ClassBot> MeanEYE asked: Did you consider making minimum width of indicator items? For example bluetooth icon is always narrow which can be a pain to click if you are using touchpad or something like that.
<DBO> Yeah, that bug has reported to Neil, a fix should arrive on your system soon :)
<ClassBot> stefano-palazzo asked: Are there plans to implement counts et al for Places this cycle?
<DBO> Currently there are no plans to implement this, it would require changes to the libunity protocol and we are well passed freeze for that. On a design end I am not sure they want to see counts there anyhow
<DBO> Though I can see where you might want them, we'll see where next cycle goes :)
<ClassBot> crazedpsyc asked: Does the dash file search use tracker? Or what?
<DBO> It uses zeitgeist actually, we dont currently use tracker and dont have any plans to in the future (so far)
<DBO> Though there are obvious issues with zeitgeist right now (sometimes the results are less than optimal) and we are hoping to resolve that in the future
<ClassBot> MeanEYE asked: How well Unity supports multiple-displays?
<jcastro> I use unity in twinview
<jcastro> it's an area we spent some time on
<jcastro> what happens currently is the extra monitor also has a panel
<jcastro> and the appmenu and indicators also show up there
<jcastro> in the past the menus and stuff were on the other monitor
<jcastro> so it made it a loooooong journey to the menu when using a mouse
<jcastro> now each panel gets a menubar
<jcastro> I think it's much better than what we had in gnome 2
<jcastro> since we now have a panel that isn't so crufty
<jcastro> when you plug in an external monitor it doesn't jumble your indicators anymore
<ClassBot> crazedpsyc asked: Are there any plans to at least have the option of a moveable launcher (maybe drag, or just align-to-edge)?
<DBO> Currently there are no plans to implement a movable launcher
<DBO> however we have talked about the need to support RTL languages
<DBO> and this would likely require the ability to place the launcher on the right
<DBO> combine this with the newly landed edge reveal option
<DBO> and we will see what the future holds :)
<ClassBot> MeanEYE asked: Global menu seems slow when it comes to drawing. Also it fails to draw menu items with custom widgets in it. Are there plans to fix this?
<DBO> The biggest issue with this is that the widgets have to be communicated over dbus
<DBO> while dbus is flexible, we have not fully implemented everything you can dream up yet (obviously)
<DBO> most of the normal cases, and even some of the more abnormal ones have been covered
<DBO> as time goes on I hope this support will grow and continue
<ClassBot> saimanoj12 asked: Is unity same as gnome3?
<DBO> Unity is based on top of a mixture of GNOME 2 and GNOME 3 technologies right now
<DBO> while it uses gdk/glib and gtk from GNOME 2, it also uses gdbus and dconf, which are largely used within GNOME 3
<DBO> when GNOME 3 lands in full next cycle, we will be ready to adapt to any new technology changes
<DBO> we will be migrating all of our GTK/GDK code over to GNOME 3.0 technologies for Oneiric :)
<ClassBot> crazedpsyc asked: What language(s) [is/are] the launcher specifically written in? What modules or libraries does it use?
<DBO> The launcher, dash, and panel are all written in C++
<DBO> we use a base opengl library called nux to provide widgets
<DBO> nux is also C++ based
<DBO> our places (the files and applications place) are written in vala
<DBO> some third party places (the reddit place and askubuntu) are written using python
<ClassBot> Titeuf_87 asked: currently I see three different kind of scrollbars: does the new kind of "small" scrollbar need to be implemented on a per-app basis?
<DBO> It is implemented by the theme engine actually
<DBO> currently we are using a whitelist to enable it in well tested applications where we are sure it does not cause bugs
<DBO> I am not sure if the whitelist will remain through until release, or if we will see a global enablement
<DBO> Obviously we see considerable value in having a consistent visual look across all scrollbars
<ClassBot> MeanEYE asked: At the moment Unity is not allowing amount of window shadow to be changed. Is this on purpose?
<DBO> I think this is largely due to missing support
<DBO> we just didn't have time to turn this into a configurable size option
<ClassBot> gmb2001 asked: I've noticed today that when double clicking the globalmenu that the window restores from being maximized, but off to the right. Is this a known bug?
<DBO> It is now!
<DBO> I haven't heard that reported before
<DBO> I will make sure sam gets the message :)
<ClassBot> MeanEYE asked: Can we expect PPA or something like that for Unity in Natty during the Oneric development cycle?
<DBO> I am not sure to be honest
<DBO> we have always maintained a daily PPA
<DBO> and I imagine weekly releases will be available for Natty until library version delta's become too big
<DBO> and we are no longer able to support Natty
<jcastro> FYI: https://launchpad.net/~unity/+archive/daily
<DBO> (that will happen probably in the first couple months)
<DBO> once we port to GTK 3, it will be much harder to backport
<ClassBot> crazedpsyc asked: What library did Unity's launcher use to get an average color out of each icon? I tried to do something like this but it resulted in most of my buttons being black or grungy
<DBO> So I wrote that actually :)
<DBO> The original algorithm I wrote for Docky, we them ported that over for usage in Unity
<DBO> it basically loops over each pixel and adds up the R/G/B and biases against desaturated pixels (and obviously gives little weight to transparent pixels too)
<ClassBot> MeanEYE asked: Have you considered a development model for Unity that resembles one of Google Chrome, having stable and development branch, releasing as often as possible?
<DBO> we have been doing weekly releases for the passed 6 months
<DBO> I am not sure we are going to move a chrome-esque development model
<DBO> I actually rather doubt it
<ClassBot> MeanEYE asked: Few days ago I tested Unity on my laptop connected to WiFi. Whenever I clicked "start" button (or whatever you call it) I noticed few seconds before shell became responsible again. Will there be an option for us to disable lenses and how does Unity handle lenses that require internet on disconected machine.
<DBO> Lenses are totally async (they are different processes) and should not cause the shell to freeze while waiting on a lense
<DBO> if you are experiencing a freezing type issue, there is a fix for these kinds of issues going into todays compiz release
<DBO> you may wish to check that out :)
<DBO> if that doesn't help, we love bug reports (well not really, but we read and respond to them)
<ClassBot> davidcalle asked: Are you planning a way to bookmark some searches in lenses?
<DBO> No, but as a personal note, I think its an awesome idea
<ClassBot> Titeuf_87 asked: are lenses a bit comparable to what was the deskbar-applet in older versions of Gnome?
<jcastro> sort of
<jcastro> they are searchable and stuff
<jcastro> I think they're more equivalent to firefox custom search things
<jcastro> but at the OS level
<jcastro> so like you know how some websites let you install their search engine in firefox
<jcastro> lenses are kind of like that
<jcastro> so I can just hit the windows key, type "rick roll" and the youtube lens would return a list of videos to me
<jcastro> what makes lenses more powerful is that we can also connect to applications.
<jcastro> so we can search things on your PC for you as well as the web
<ClassBot> MeanEYE asked: What's the reason behind making Launcher menu with custom graphics and not using system menu style?
<DBO> Short answer: that is how design wanted it
<DBO> Long answer: we wanted something that was flexible, fast, and would look exactly how we wanted it to
<DBO> (not a very long, long answer)
<ClassBot> crazedpsyc asked: Will the top panel ever get the option to autohide? I have all my AWNs autohidden or over windows because my screen is so small vertically...
<DBO> so the awesome thing about Unity is how much vertical it saves you without having to resort to autohiding
<DBO> by embedding the decorations into the panel when a window is maximized, you gain as much vertical space as you would from an autohiding panel
<DBO> combine this with the global menus, and you gain 24 more pixels or so on top of that
<DBO> but
<DBO> no, we dont have any plans to autohide the panel
<ClassBot> MeanEYE asked: At the moment if you highlight an item in dash using your keyboard and then move your mouse over a different item bot of them will be highlighted in the same way. Will this change, since it can bring confusion?!
<DBO> Yes that is a bug
<DBO> we will fix it (I hope) for natty
<ClassBot> soreau asked: What should we tell users that just want their old compiz+gnome-panel back? Is there a non-unity session selectable from gdm?
<DBO> there is an ubuntu classic session in gdm
<DBO> those users will be well serviced by that!
<ClassBot> soreau asked: Is there a way to select non-unity session by default?
<DBO> after you select the classic session once it will remain the default from then on
<ClassBot> MeanEYE asked: Now that Unity is Compiz based, will Canonical pay more attention to default eye candy? (more of a general question actually)
<DBO> yes, the compiz defaults will be under constant review and scrutiny
<DBO> this cycle we have made as many changes as possible that we thought would improve the user experience
<ClassBot> There are 10 minutes remaining in the current session.
<DBO> Now that you all have voice
<DBO> let the free for all begin!
<ClassBot> stefano-palazzo asked: we can assume that LibreOffice will be integrating its menu into the panel before the release, yes? How hard is it for a big app, especially if it's not written using GTK, to make its menu compatible with Unity?
<DBO> Its in universe, but it's not shipped by default
<DBO> probably ready for 11.10
<DBO> like with any application that doesn't use the standard toolkit, it can be difficult to fully integrate with the OS
<ClassBot> htorque asked: the lenses and the workspace switcher seem to be quite important launcher items. why are they placed at the lower end of the launcher, where they are likely to get folded/expanded off-screen instead of having them at the top (or even movable)?
<DBO> As important as they are, we feel they are not as important as your favorite applications
<DBO> However, I think that considering the folding behavior, this will be an area of attention in the next cycle
<DBO> finding a way to make sure lenses and workspace switcher are as easy to access as anything else
<ClassBot> crazedpsyc_ asked: But will GTK apps automatically use the global menu?
<DBO> yes, unless they do something really strange
<ClassBot> soreau asked: What is the key purpose behind lenses?
<DBO> lenses are designed to give access to applications, files, and web resources inside of the Unity shell
<DBO> lenses are extensible, which is quite nice for third party developers
<ClassBot> There are 5 minutes remaining in the current session.
<DBO> they basically serve to replace the existing gnome menus
<DBO> (and much more)
<ClassBot> MeanEYE asked: Can we expect an option to hide unusable items from Launcher?
<DBO> Not this cycle, maybe next
<DBO> we'll see :)
<ClassBot> maxb asked: Is more configurability (especially of auto-hide / edge-reveal timeouts) in the short term plan?
<DBO> Edge reveal timeout may receive some tweaking this cycle, which may result in an option popping up in CCSM, we'll see
<DBO> we are not planning on adding options explicitly however
<jcastro> ok, that's about all the time we have
<jcastro> whew, we really went through a ton of options.
<jcastro> I mean questions.
<jcastro> thanks everyone for asking so many questions!
<jcastro> and now we're on to lightning talks!
<mhall119> okay, so for anyone who's not familiar with what a lightning talk is
<mhall119> it's a very quick presentation, where the speakers only have about 5 minutes to say everything they have to say
<mhall119> they've become quite popular at conventions
<mhall119> for this session, we have people who are going to give a quick overview of some program they are involved in, so you can see what small projects are out there that you might want to get involved in
<mhall119> as always, you can ask questions in -classroom-chat
* 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: Lightning Talks - Instructors: stefano-palazzo, duanedesign, davidc3, kirkland, MeanEYE, muesli, nhandler
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/15/%23ubuntu-classroom.html following the conclusion of the session.
<mhall119> but remember, they only have 5 minutes, so don't expect them to answer everything
<mhall119> so, without wasting any more of their preciouos time
<mhall119> our first speaker is sefano-palazzo, talking about StackExchange App
<stefano-palazzo> Hello, I'm Stefano - I'll be talking about StackExchange
<stefano-palazzo> Stack Exchange is a network of question and answer websites
<stefano-palazzo> it includes sites like http://stackoverflow.com, http://serverfault.com, and of course
<stefano-palazzo> http://askubuntu.com - the best place to ask questions and get answers about Ubuntu
<stefano-palazzo> I've also written the Ask Ubuntu Lens for Unity,
<stefano-palazzo> http://askubuntu.com/questions/31712
<stefano-palazzo> The Lens is designed to work with Ask Ubuntu, but it also supports every other Stack Exchange site
<stefano-palazzo> If you're interested in geographic information systems, guitars, maths, star trek, ... there's probably a site for you.
<stefano-palazzo> If you're running Natty Narwhal, you can add our Team's PPA to install the lens: https://launchpad.net/askubuntu-lens
<stefano-palazzo> It also contains stack applet; A little, App Indicator sized utility that keeps you up to date with your profile on any stackexchange site - if you're already an Ask Ubuntu user
<stefano-palazzo> It's written by George Edison, and, if you're interested in what's happening in your Stack Exchange account, this app is for you
<stefano-palazzo> And if you don't know what Stack Exchange or Ask Ubuntu are,
<stefano-palazzo> I urge you to check them out. They're the best place on the web if you just want to get an answer to your question. Jorge has recorded a screen cast providing a gentle introduction:
<stefano-palazzo> http://blip.tv/file/4909346
<stefano-palazzo> That's about all I've got - if you're interested, join Ask Ubuntu (you don't need to register an account). And if you want to talk to me about developing Apps that integrate with Stack Exchange sites, I'm often in #ayatana, or the Ask Ubuntu chat at http://chat.askubuntu.com
<stefano-palazzo> thank you very much for your time :)
<ClassBot> mhall119 asked: does it search every stackexchage site by default, or do you have to enable the ones you're interested in?
<stefano-palazzo> It searches Ask Ubuntu by default, but if you want to search on any other site, you can use special modifers. A typical search might be "@guitars telecaster sustain", or "@programming open source license"
<ClassBot> MeanEYE asked: Will your lense be integrated with default Ubuntu installation?
<stefano-palazzo> the modifier is the first part of the site's URL, what ever comes before .com
<stefano-palazzo> No, then lens will not be part of the default installation, it will in all likelihood appear in the Independend category of the software centre
<mhall119> alright, thanks stefano-palazzo!
<mhall119> next up is duanedesign with CLI Companion
<mhall119> take it away duanedesign
<mhall119> okay, we'll try him again later
<mhall119> davidc3 is next with Unity Book Lens
<mhall119> davidc3: ready?
<davidc3> Yes :)
<mhall119> the floor is yours
<davidc3> Hello, I'm David and I'm going to introduce you to my pet project: the Books Lens.
<davidc3> There are a lot of free online libraries, such as Google Books or Project Gutenberg, and as a heavy books reader, I wanted to find a way to search them all at once.
<davidc3> More precisely, my goal was to reduce the time from searching to reading:
<davidc3> To put it another way: type, click, read a book. Like any document on your computer.
<davidc3> The project started when I found stefano-palazzo's first commits for the askubuntu lens. It presented me a simple way to get results from the Internet displayed in Unity, in Python.
<davidc3> Why in Python? Because I'm not a developer, because I didn't know any more code than a few terminal tricks and because "everyone" says Python is easy...
<davidc3> So it was time to get my hands dirty and I started to blindly modify some values and experiment on stefano's code :)
<davidc3> I also found the Google Books JSON API documentation to be very helpful.
<davidc3> By the way, an API is a set of rules to ask other services questions and to interprate the answers and JSON is a language easy to interprate in Python.
<davidc3> A few hours later, I had a working lens! You could search every books indexed by Google, and authors, and subjects! The power of Google in the palm of my hand! http://img39.imageshack.us/img39/8454/screenshot4xn.png
<davidc3> But... my web browser was just a click away and it could do all of this much faster and better...
<davidc3> So, it was time to had features:
<davidc3> The first one is called "Focused Author". When you get search results, the lens uses the first author it finds, and presents other books from her or him.
<davidc3> It does work on most searches and find authors from Sophocles http://img861.imageshack.us/img861/7618/screenshotss.png
<davidc3> ...to Jono Bacon! http://img200.imageshack.us/img200/7219/screenshot1sf.png :)
<davidc3> Another feature is a localization trick: the lens finds out your session's language and tries to present you books in your language first.
<davidc3> What's coming next:
<davidc3> * More focus on free books! (the actual "Free Books" search is clunky, but it will eventually be default).
<davidc3> For now, most of the time, instead of: "Type, click'n'read", it's: type, click and "an Amazon link, really?"
<davidc3> * Search in Project Gutenberg and Forgotten Books (with help from Blekko, a really nice search engine)
<davidc3> * Special searches, like "50's sci-fi"!
<davidc3> * Smart pre-population via Zeitgeist: you are looking at a web page or some other document, then open the lens: without needing you to type anything, it finds out what you are doing on your computer (using the title of the most recently accessed document) and present you related books.
<davidc3> How you can help:
<davidc3> Add the PPA: https://launchpad.net/~davidc3/+archive/books-lens
<davidc3> Try it and report bugs: https://bugs.launchpad.net/unity-books-lens
<davidc3> That's all, if you want to talk to me about this project, I'm often in #ayatana (nick davidcalle), thank you for your time! :)
<davidc3> Any questions?
<ClassBot> MeanEYE asked: After finding a book using Unity, will default book reader application open or just URL?
<davidc3> For now, just URL, but the ultimate goal is to open it in the appropriate reader.
<davidc3> Or device!
<davidc3> Project Gutenberg makes it very easy to download things in kindle format, for example.
<davidc3> More questions?
<mhall119> alright, thanks davidc3, I'm sure i will get less work done in Natty now ;)
<mhall119> up next is kirkland and Bikeshed
<davidc3> Thanks mhall119 :)
<kirkland> mhall119: thanks
<kirkland> right, so Bikeshed ...
<kirkland> Bikeshed was the answer to a problem I've struggled with for some time now
<kirkland> I had a growing number of really cool, convenient scripts stacking up in my own ~/bin directory
<kirkland> many of which might be useful to other people
<kirkland> and so I tried to contribute them to upstream projects
<kirkland> but many of these upstream projects were old, or stagnant;  others were new and active, but just uninterested
<kirkland> more importantly, the actual implementation of a few them them were debated endlessly
<kirkland> this gave rise to the Bikeshed project
<kirkland> where the term "bikeshedding" has become very commonly used in modern open source development circles
<kirkland> http://en.wikipedia.org/wiki/Parkinson%27s_Law_of_Triviality
<kirkland> ^ if you don't know what it means to "bikeshed"
<kirkland> so anyway, I created the "Bikeshed" project in Launchpad, as a breeding ground for new/interesting/even-trivial-but-helpful scripts and programs
<kirkland> it's sort of an incubator
<kirkland> or even an orphanage
<kirkland> a place I often put things that other people might use, until it finds a more permanent home
<kirkland> some of the things to land in Bikeshed ...
<kirkland> most recently, "apply-patch"
<kirkland> which is a wrapper for patch, that can retrieve patches via URL, and automatically detects the strip-level
<kirkland> bzrp is a wrapper for bzr, that puts the output through a pager if it's more than one screen (sort of like git does automatically)
<kirkland> col1 .. col9 is a really slick wrapper that does the equivalent of "awk -F"$something" '{print $N}'
<kirkland> dman remotely retrivies manpages from manpages.ubuntu.com
<kirkland> wifi-status is a watch wrapper that monitors your wireless connection in real time
<kirkland> and so on
<kirkland> a few things have "graduated" out of bikeshed to be projects of their own
<kirkland> ssh-import-id $LAUNCHPAD_USER is a cool tool that securely retrieves a public SSH key from Launchpad and installs it to the authorized_keys file of the system
<kirkland> (really useful in cloud computing circles)
<kirkland> and the errno utility was one of the proverbial straw that broke the camels back, and inspired me to create bikeshed
<kirkland> errno searches Linux error numbers, names, and descriptions
<kirkland> there's a few more
<kirkland> but I should probably save a few minutes for quesitons
<kirkland> questions, even
<kirkland> my classbot fu is out of date
<ClassBot> MeanEYE asked: Do you have any graphical part of application which can help us easily install/remove scripts?
<kirkland> MeanEYE: hmm, currently every thing is command line only
<kirkland> MeanEYE: and bikeshed itself is kind of a mish-mash of random scripts
<ClassBot> davidc3 asked: Do all the scripts have man or help? And do you have some wiki page where we can learn a bit more about them??
<kirkland> MeanEYE: part of the process of "graduating" a script out of bikeshed means making it into its own package/project, which is then installable from the Ubuntu Software Center
<kirkland> davidc3: absolutely!  every script/program MUST have a manpage to land in bikeshed :-)  it's my most important requirement
<kirkland> davidc3: the best place to learn is http://blog.dustinkirkland.com/search/label/Bikeshed
<mhall119> alright, thanks kirkland!
<kirkland> mhall119: thank you!
<mhall119> so everyone dig around in your ~/bin and see what you can toss in the shed
<mhall119> Up next is MeanEYE with his app: Sunflower FM!
<MeanEYE> Oh, is it me already. Great!
<MeanEYE> Hello everyone.
<MeanEYE> My name is Mladen, although using my nick is just fine.
<MeanEYE> I'll use this short time span to present you with Sunflower.
<MeanEYE> Sunflower is twin-panel file manager based on GTK+.
<MeanEYE> Idea is to create keyboard driven file manager that seamlessly integrates into Gnome desktop environment (and Unity of course).
<MeanEYE> So, without dragging this more than I should... I'd like to give you a few screenshots of my little program in action.
<MeanEYE> http://img231.imageshack.us/img231/2310/screenshot3vk.png
<MeanEYE> http://img560.imageshack.us/img560/834/screenshot1pl.png
<MeanEYE> http://img855.imageshack.us/img855/3793/screenshotvw.png
<MeanEYE> I tried to be creative and add many options but at the same time keep user interface clean and organized.
<MeanEYE> I believe many of you already used some twin-panel file manager like Total Commander, Gnome-Commander, Midnight Commander, etc.
<MeanEYE> Since I like talking with people, feel free to ask questions.
<MeanEYE> For impatient people you can download it from: http://code.google.com/p/sunflower-fm/
<ClassBot> mhall119 asked: You said it's keyboard controlled, does that mean everything had a keyboard shortcut?
<MeanEYE> Yes, not everything but most commonly things do have them. Those that don't have shortcuts can be accessed using a keyboard.
<MeanEYE> One nice example of this is when you are working with files and you need a terminal in that very directory, all you need to do is hit CTRL+Z and program will open terminal with that path.
<MeanEYE> Program is also multi-threaded so if you have more than one core on your processor program will use this.
<ClassBot> mhall119 asked: Is this in Universe or a PPA?
<MeanEYE> No, not at the moment. It's still in early alpha stage.
<MeanEYE> Although there are some people who are using it heavily without any issues.
<mhall119> okay, if anybody has any further questions for MeanEYE, feel free to ask
<mhall119> but now it's time for us to move on to muesli and Tomahawk Player
<MeanEYE> If someone is willing to join and help package it or translate it, just refer to that link I gave you and I'll help!
<MeanEYE> Ok, thanks every one!
<muesli> Good evening! My name's Chris, I'm the lead developer of a young project called Tomahawk, a "social" music player written in C++ / Qt4
<muesli> I know what you're thinking "great, exactly what the world needed, yet another music player", but bear with me for a second. Tomahawk handles your music collection differently than any of the players that you have used so far
<muesli> Tomahawk allows you to connect to your friends' music collections via Jabber or Twitter - it simply re-uses your social graphs and tries to find contacts that are currently running Tomahawk. Once you're connected, you can stream all their music and even play your friends' playlists
<muesli> Whenever you load a playlist, Tomahawk automatically determines the best source for each of the playlist's tracks: If you have a copy of the track locally it'll prefer that, otherwise the track will get streamed from one of your friends - on demand and automatically. It just plays
<muesli> But what if you load a playlist and none of your friends is currently online - and you don't have a local copy of a track either?
<muesli> Tomahawk tries to help out and will also find music all over the internet for you. It is extensible by so-called resolvers, which are little plugins or scripts running in the background. They try to find a streamable url for any song you wanna listen to
<muesli> Whether it is available on Spotify, Youtube or found on an MP3 blog by Skreemr. It just finds it and plays it
<ClassBot> There are 10 minutes remaining in the current session.
<muesli> We go even beyond that and try to utilize existing metadata from public APIs (like Echonest or Last.fm). Tomahawk can automatically prefill your playlists by a variety of criteria, so you'll always find a set of tracks that fit your current mood
<muesli> Join us on channel #tomahawk and we'll get you started with not only Ubuntu packages, but also Win32 and OS X binaries
<muesli> Check out our blog for a few how-to and demo videos: http://tomahawk-player.org/blog/tips_tricks/stations and follow the project on GitHub: https://github.com/tomahawk-player/tomahawk
<ClassBot> mhall119 asked: How does it know which of your friends is using it?
<muesli> That depends on the connectivity (called SIP) plugin you're using. When it comes to Jabber, it'll use a specific resource, so it can identify other Tomahawks in your contact list.
<muesli> The Twitter plugin will look for an invite message, which you can either send to all your followers or just a handful of people
<ClassBot> mhall119 asked: Have you considered the legal impact (copyright) of streaming music to your friends?
<muesli> Yes, we have thought and written about this situation here: http://tomahawk-player.org/legal
<ClassBot> james_w asked: does it stream music over twitter?
<muesli> No, it won't use Jabber or Twitter to stream the music. Those protocols are only used to initiate a connection. From there on it's a direct connection between two Tomahawks.
<mhall119> thanks muesli, this certainly is a new take on music players!
<muesli> Thanks for your time, hope to see you on #tomahawk
<mhall119> alright everybody, wrapping up this session and this week is nhandler and our very own lovable, huggable, perl-icious ClassBot!
<nhandler> Hello everyone. ClassBot is an IRC bot I wrote a while ago to help with running classroom sessions in #ubuntu-classroom
<nhandler> We had a brief lightning talk at UDS given by cjohnston, but no IRC talk was ever given
<nhandler> Some information about ClassBot is available here: https://wiki.ubuntu.com/Classroom/ClassBot
<nhandler> As you probably have seen, classbot has been working tirelessly this past week to ensure the /topic stays updated and that instructors get voiced and devoiced
<nhandler> All of this information comes from of Classroom calendar: http://people.ubuntu.com/~nhandler/classroom.html
<nhandler> ClassBot also helps instructors keep track of questions. You can currently get the next question (if you are an instructor or helper) with: /msg classbot !q
<nhandler> You can then choose to have the question go to the classroom (!y) or reject it with (!n [optional comment]).
<nhandler> One probably lesser known feature of ClassBot is that it is responsible for keeping the classroom identi.ca feed up-to-date: http://identi.ca/ubuntuclassroom . You can subscribe to that feed to always know when a session is goin on.
<ClassBot> mhall119 asked: When will the OOP re-write be ready?\
<nhandler> mhall119 is asking about a major re-write I am doing to make it easier to add a few features to ClassBot. I've gotten a bit behind due to some real life work, but I hope to start working again after the second week in May. It should be done and ready to launch in #ubuntu-classroom at the end of May.
<ClassBot> MeanEYE asked: Does it respond to CTCP. Might be handy so you don't have to switch tabs when getting next question and similar. :D
<nhandler> MeanEYE: Switching tabs all depends on your IRC client. For example, I have my client set to show PMs in the current window (rather than creating a new query window).
<nhandler> CTCP messages would be a bit inappropriate to use for something like this.
<nhandler> So in short, it does not currently respond to them and it probably will not gain that feature.
<ClassBot> MeanEYE asked: Did you consider making classroom topic to be displayed before other information? In many clients you have to scroll to find the rest of the text.
<nhandler> If by Classroom topic you mean the current session information, I believe we decided to put it on the end to ensure that the information at the beginning always shows up and won't get cut-off due to a lot of instructors and a long session title/event name. So yes, we considered it, but we decided on the current layout (note that it is easily configurable though)
<ClassBot> There are 5 minutes remaining in the current session.
<nhandler> Any more questions?
<nhandler> If you ever have any issues using classbot during a session, I encourage you to stop by #ubuntu-classroom-backstage or ask one of the people listed on the calendar as a helper. They will usually be able to help you or point you in the right direction
<nhandler> Finally, if anyone is interested, here is an old set of slides I prepared to explain classbot: http://people.ubuntu.com/~nhandler/myslides/
<nhandler> Well, this conlcudes my lightning talk, the lightning talk session, and Ubuntu App Developer Week.
<nhandler> I hope everyone has enjoyed the lineup of sessions and learned a lot
<nhandler> If you ever wish to lead a session (or have a suggestion for a session you would like to see), please do not hesitate to email ubuntu-classroom@lists.ubuntu.com or stop by #ubuntu-classroom-backstage
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/15/%23ubuntu-classroom.html
<nhandler> Finally if you missed a session, logs are available on the wiki: https://wiki.ubuntu.com/UbuntuAppDeveloperWeek
<nhandler> Thanks for coming 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 ||
#ubuntu-classroom 2011-04-16
<Piromania666> so i installed ubuntu-server for learning purposes, and one thing i can't figure out is after installing sudo apt-get install ubuntu-desktop and trying to startx, i get a screenInit failed for driver
<Piromania666> any ideas?
<sor4you> oh wow is this like to learn ubuntu?
<sor4you> has anyone here heard of nixie
<sor4you> the linux girl
<serfus> sor4you, this is a classroom
<serfus> sor4you, read more at https://wiki.ubuntu.com/Classroom
<sor4you> so what are we doing in class today?
<Pendulum> sor4you: there are no classes today, you can see the schedule on the link serfus provided
<sor4you> can i pick ur brain pendulum?
<sor4you> can we chat?
<sor4you> would anyone like to chat with me?
<serfus> sor4you, people are up for a chat in #ubuntu-offtopic
<sor4you> ok
<sor4you> thank you
<Pendulum> also, if there's a loco channel for the loco near you, it would be another place for a chat
<oopss> how to set gnome3 in ubuntu 10.04?
#ubuntu-classroom 2011-04-17
<Awolf_> greets
#ubuntu-classroom 2012-04-09
<osagiesammy_> how do i start an ubuntu usergroup in my area?
#ubuntu-classroom 2012-04-11
* 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 || Current Session: Lernid Application Testing for 12.04 - Instructors: jsjgruber
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2012/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<jsjgruber> OK, we'll begin in a minute.
<jsjgruber> First, please get your system up to date using the update-manager, or
<jsjgruber> by running the following in a terminal.
<jsjgruber> sudo apt-get update && sudo apt-get upgrade
<jsjgruber> Please speak up in #ubuntu-classroom-chat when you are upgraded.
<jsjgruber> .
<jsjgruber> While we are waiting, let me mention that Ubuntu Open Week is happening
<jsjgruber> from May 2 to May 4. App Developer week is happening April 17 - 19, and
<jsjgruber> there's an Ubuntu Algorithm session this coming Friday. Please
<jsjgruber> consider joining us.
<jsjgruber> Who is with us this evening?
<pleia2> o/
<JoseeAntonioR> o/
<jsjgruber> JoseeAntonioR, the problem is that we will be using apt-get to install the new version. I guess we can just to the update and try to just install lernid without everything else. I don't think it matters that not everything else is updated if the ISO you are using is just a few days or even weeks old.
<jsjgruber> Please feel free to speak up here if you want.
<jsjgruber> First on our agenda is testing a new ubuntu version of lernid for precise. If
<jsjgruber> you aren't yet running precise, but are using natty or oneiric,
<jsjgruber> please follow us through the first couple of steps and we'll see
<jsjgruber> if we can  test an even newer lernid package in a while.
<jsjgruber> If it's only the three of us, though we should be all set.
<jsjgruber> It's easier to test software that's already in Ubuntu, but I don't like
<jsjgruber> to have software there that already hasn't been tested from somewhere else
<jsjgruber> by at least a few people.
<jsjgruber> Therefore we will be using a lernid version built for Ubuntu that's in one of my
<jsjgruber> repositories. If we are successful we will propose it for merging with
<jsjgruber> ubuntu within a couple of days. Before we install the new ubuntu lernid version
<jsjgruber> let's make sure we have some software that will make switching versions much
<jsjgruber> easier. Although much of this can be done using the Ubuntu Software Center
<jsjgruber> let's start a terminal and do this that way. It will be handy to start Lernid
<jsjgruber> from a terminal later anyway so we can look for any error messages.
<jsjgruber> We can use a lernid terminal window for this, too, but I think both of you might be using terminal windows, anyway, no?
<pleia2> yep
<JoseeAntonioR> Yes
<jsjgruber> ok
<jsjgruber> sudo apt-get install python-software-properties ppa-purge
<jsjgruber> We'll use these for switching to the new ppa and its software, and then for going back.
<JoseeAntonioR> Unable to locate package ppa-purge
<pleia2> it's in universe, so you'll need that enabled
<JoseeAntonioR> Great to mention that, I'll do it now
<jsjgruber> Yep, I think I had to enable universe every time I used an ISO
<jsjgruber> We'll need universe for lernid, anyway, that's where it lives.
<pleia2> done
<JoseeAntonioR> I'll be ready in 2 means
<JoseeAntonioR> mins*
<jsjgruber> Cool, JoseeAntonioR
<JoseeAntonioR> Done
<jsjgruber> great, now--
<jsjgruber> sudo add-apt-repository ppa:jsjgruber/test-lernid-ppa
<JoseeAntonioR> done, and installing lernid.
<jsjgruber> You may have to do a sudo apt-get update first, I'm not sure, but that's the idea
<pleia2> yeah
<jsjgruber> I tried it and you do have to do sudo apt-get update and then can do sudo apt-get install lernid and get the new version.
<jsjgruber> pleia2, did it work for you? We are looking for version 0.8.2.2ubuntu2.
<pleia2> Setting up lernid (0.8.2.2ubuntu2~testlernidppa2) ...
<jsjgruber> excellent, pleia2
<JoseeAntonioR> That's the one I got
<jsjgruber> great
<jsjgruber> It's time to start lernid up. I'd suggest starting it from your terminal window with the -v option so you can keep an eye
<pleia2> just one -v ?
<jsjgruber> on the output for errors like Tracebacks. Just one -v is what I usually use.
<pleia2> defaulting to the spanish classroom
<JoseeAntonioR> Exactly
<jsjgruber> Once you select the english one it should default to that, as you suggested.
<jsjgruber> Well, sort of.
<pleia2> looks good so far
<jsjgruber> Are you both  connected with the new Lernid, now?
<pleia2> yes :)
<jsjgruber> JoseAntonioR, are you with us on lernid?
<pleia2> talking over in -chat
<JoseeAntonioR> Yep, I am
<JoseeAntonioR> Great, so instructors+helpers+voiced will be.
<jsjgruber> JoseeAntonioR, JoseAntonioR you should see pleia2 be added to our event's instructors in the schedule. Do you see 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 || Current Session: Lernid Application Testing for 12.04 - Instructors: jsjgruber, pleia2
<pleia2> yep :)
<JoseeAntonioR> jsjgruber: Yep, I do
<pleia2> hehe, Classbot saw the change too
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2012/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<jsjgruber> I was wondering what happened. I couldn't test with classbot.
<pleia2> I have a test classbot running with the same code, we can talk later about getting you more access
<jsjgruber> lernid doesn't react with a session change unless the session uid changes or the end time comes.
<jsjgruber> pleia2, excellent
<jsjgruber> http://launchpad.net/lernid is the site for lernid. This should bring it up in the session tab.
<JoseeAntonioR> Well, for me it brings the Classroom wiki
<jsjgruber> did it come up?
<pleia2> yep
<JoseeAntonioR> Yep
<jsjgruber> good. I'll bring up a slide.
<jsjgruber> [slidefile https://sites.google.com/site/gruberdocuments/engineering-docs/lernid-test-slides.pdf 2]
<JoseeAntonioR> Yep, slides working. I see Lernid Test, page 2
<jsjgruber> A simple slide should come up next to the lernid web page.
<pleia2> yep (and oops, I totally didn't get back to you about providing sample slides, sorry!)
* 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 || Current Session: Lernid Application Testing for 12.04 - Instructors: jsjgruber, pleia2, JoseeAntonioR
<jsjgruber> [slide 4
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2012/04/12/%23ubuntu-classroom.html following the conclusion of the session.
<jsjgruber> [slide 4]
<JoseeAntonioR> Great, works fine.
<jsjgruber> Anybody see any problems? Anything show up in the terminal window?
<pleia2> nope, and it was even clever enough to open the slides in my already running chrome session
<pleia2> Created new window in existing browser session.
<pleia2> :D
<JoseeAntonioR> I got some errors now, when clicking the Open in External Window button
<pleia2> (when I clicked "open in external browser:)
<jsjgruber> That's been a feature since last August, actually. I don't think many instructors use slides.
<jsjgruber> What errors?
<JoseeAntonioR> http://paste.ubuntu.com/925690
<jsjgruber> That's ok. That's a known precise problem happening down in the guts. Doesn't seem to cause a problem other than the error messages.
<jsjgruber> Anything else?
<JoseeAntonioR> Can I test something?
<jsjgruber> ok
<JoseeAntonioR_> Abc
<JoseeAntonioR> Yep, doesn't bold unregistered voiced
<pleia2> "Slides have been downloaded" note is lingering on the bottom left
<jsjgruber> yep, it's particular. That's why it's important to track schedule changes.
<jsjgruber> pleia2, I think that may be fixed in the next upstream version. Ready to try it?
<pleia2> sure
<jsjgruber> JoseeAntonioR, you ready to try the next lernid version?
<JoseeAntonioR> Yep, I am :)
<jsjgruber> let's quick out of lernid and we'll remove the old ppa, then we'll add a new one.
<jsjgruber> To bring your system back the way it was--go back to a terminal and
<jsjgruber> type:
<jsjgruber> sudo purge-ppa ppa:jsjgruber/test-lernid-ppa
<jsjgruber> after quitting lernid
<pleia2> ppa-purge
<jsjgruber> Sorry, ppa-purge!
<jsjgruber> Thanks.
<JoseeAntonioR> ok, done
<pleia2> done
<jsjgruber> this time I'm the one who's behind.
<jsjgruber> ok, i'm done too.
<pleia2> :)
<jsjgruber> sudo add-apt-repository ppa:jsjgruber/lernid-proposed
<jsjgruber> sudo apt-get update
<jsjgruber> then sudo apt-get install lernid and we'll see what version you get.
<JoseeAntonioR> 0.8.4~lp1+230+268+201204111733~precise1
<jsjgruber> yes, JoseeAntonioR.
<pleia2> 0.8.4~lp1+230+268+201204111733~precise1
<jsjgruber> excellent. Let's start the new lernid
<pleia2> oh dear, it just crashed
<JoseeAntonioR> with the -v option?
<JoseeAntonioR> I launched it, not from terminal, and crashed
<pleia2> I'll pastebin
<JoseeAntonioR> also launched from terminal, and crashed
<pleia2> http://paste.ubuntu.com/925697/
<JoseeAntonioR> http://paste.ubuntu.com/925699/
<pleia2> at least it's consistent :)
<jsjgruber> same one. It is in the remember the classroom patch. Let me think if we can finesse this so we can test some more rather than giving up
<JoseeAntonioR> Ok
<jsjgruber> Can we use an editor like vi on  ~/.cache/lernid/config    ?
<pleia2> yeah
<JoseeAntonioR> ok, I'm on it
<jsjgruber> we need to add the line:
<jsjgruber> event = "#ubuntu-classroom -- In English"
<pleia2> yay, no crash :)
#ubuntu-classroom 2012-04-12
<jsjgruber> Obviously, I need to add a line for conversion from a config without the line.
<Guest92332> what...
<JoseeAntonioE> Urgh
<jsjgruber> JoseeAntonioR1, having trouble?
<JoseeAntonioR1> jsjgruber Had some troubles with my nick
<jsjgruber> What happened?
<JoseeAntonioR1> jsjgruber My main nick just changed to a Guest nick, even if I'm using a different one in Lernid
<jsjgruber> So you are using xchat or something, and it's nick changed when you started up lernid?
<JoseeAntonioR1> jsjgruber Pidgin, to be exact
<jsjgruber> Were you signing on with exactly the same nick?
<JoseeAntonioR1> Nope, but with the same NickServ account
<JoseeAntonioR1> I think I have logged in with it around 5 times in the last few mins
<JoseeAntonioR1> I'll ask freenode staff for what can I do
<jsjgruber> lernid tries its best to get you the nick you asked for.
<JoseeAntonioR1> jsjgruber I asked for JoseAntonioR, this is a freenode issue :)
<jsjgruber> and JoseAntonioR is the master nick, or one of the subordinate ones? (excuse my lack of knowledge the terminalogy etc.)
<JoseeAntonioR> JoseeAntonioR, with double e, is the main one :)
<jsjgruber> so is JoseAntonioR registered as subordinate to JoseeAntonioR and JoseAntonioR is the one you were trying to sign on with?
<pleia2> it's just some nickserv setting, unrelated to lernid
<JoseeAntonioR> Yep, that's it pleia2.
<jsjgruber> ok. well lernid has had a lot of work in how it signs on with this release we are testing. Let' me know if you need details.
<jsjgruber> Should we go on?
<pleia2> yep
<JoseeAntonioR> yes :)
<jsjgruber> testing a proposed version of Lernid with lot's of bug fixes and
<jsjgruber> a few new features. Thanks to coalwater (Mohammed AbuShady) for several
<jsjgruber> of the bug fixes.
<jsjgruber> We have a couple of things to try again, here. Pleia2, would you mind
<jsjgruber> adding a fake name to the list of instructors
<jsjgruber> We can watch the schedule change like before.
<pleia2> ok, done
<jsjgruber> I got it, did you guys?
<pleia2> yep
<JoseeAntonioR> Yep, I did
<pleia2> I'm going to remove it before classbot catches on and tweets again
<jsjgruber> ok
<jsjgruber> I'll add the slide again.
<jsjgruber> [slidefile https://sites.google.com/site/gruberdocuments/engineering-docs/lernid-test-slides.pdf 3]
<pleia2> loaded up slides, on page 3
<JoseeAntonioR> works perfectly
<jsjgruber> great.
<jsjgruber> Please click on the buttons under the schedule and under the slide to see
<jsjgruber> that they do what they say they do.
<pleia2> clipboard yes, browser yest
<pleia2> -t
<pleia2> and slides opened in my browser
<jsjgruber> excellent, pleia2-lernid
<ClassBot> There are 10 minutes remaining in the current session.
<jsjgruber> Let's wait for JoseeAntonioR
<jsjgruber> Actually, pleia2, would you mind opening the terminal tab and trying man lernid and man lernid-config ?
<jsjgruber> JoseeAntonioR, would you try that, too?
<pleia2> sure
<pleia2> elizabeth@r5k6:~$ man lernid-config
<pleia2> No manual entry for lernid-config
<pleia2> the lernid man page looks good though
<pleia2> ah, lernid-classroom ?
<jsjgruber> oh bother -- lernid-classroom
<pleia2> there we go :)
<JoseeAntonioR> Ok, I've got a manual for lernid-classroom
<jsjgruber> very good. If you quit lernid, and then start it again, it should offer as the default
<jsjgruber> the same classroom as you selected last time, and the window should be
<jsjgruber> the same size.
<JoseeAntonioR> jsjgruber Yes, that's it
<ClassBot> There are 5 minutes remaining in the current session.
<pleia2> seems right
<JoseeAntonioR> It maintains the size and event
<jsjgruber> excellent. If you scroll back in the logs, you see lines for the logs kept of classes
<jsjgruber> in our classrooms. Please click on one of these and see if your browser
<jsjgruber> opens up a log in your browser.
<JoseeAntonioR> Hmm, I can't see any logs
<jsjgruber> Should be lines in bold saying IRC log for UTC ...   you may have to scroll the schedule back to see it
<JoseeAntonioR> although, I can't scroll, just moving the bar, it's the VMs issue
<jsjgruber> Ah
<pleia2> hmm
<pleia2> I quit lernid so there is no backscroll
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2012/04/12/%23ubuntu-classroom.html
<pleia2> oops, ran out of daylight
* 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 ||
<JoseeAntonioR> I also quit and reopened
<jsjgruber> this is the last thing to try, I'll give you directions to go back when' you're ready
<pleia2> I need to run off in a couple minutes
<pleia2> (ubuntu hour + debian dinner for the evening)
<jsjgruber> Here's the command to go back:
<jsjgruber> sudo purge-ppa ppa:jsjgruber/lernid-proposed
<jsjgruber> just like the last one
<pleia2> ok
<JoseeAntonioR> ppa-purge
<jsjgruber> pleia2, thanks so much for staying with us. JoseeAntonioR, thank you very much for helping me out.
<jsjgruber> did either of you see the irc log lines before we quit?
<JoseeAntonioR> I couldn't scroll
<pleia2> thanks jsjgruber!
<JoseeAntonioR> thanks to you, jsjgruber, making a great job with Lernid
<JoseeAntonioR> I'm happy everything went as expected :)
<jsjgruber> oh well. That's great, though. Thanks much to both of you. I'll stick around a bit in casethere's a problem going back to the old lernid version
<jsjgruber> my pleasure, JoseeAntonioR
<jsjgruber-x-p> pleia2, thanks for helping me out yesterday. I hope your evening went well. Sorry to delay you.
<jsjgruber-x-p> I've proposed the Ubuntu changes for merging into Precise
<pleia2> jsjgruber-x-p: ok great :)
<pleia2> there is a regular classroom session tomorrow during which I can run lernid on my precise machine and see how it goes
<jsjgruber-x-p> very good, which version will you try?
<pleia2> which do you recommend?
<jsjgruber-x-p> I guess for safety sake, the Ubuntu one. I don't want one that isn't working to go into the Precise release
<jsjgruber-x-p> Still, I'm feeling pretty confident after last night's test. Finding that preferences bug was great--I've recreated 0.8.4 with a patch for that.
<pleia2> jsjgruber-x-p: by "the ubuntu one" you mean the current one in the repository?
<pleia2> (sorry, ended up in a meeting :))
<jsjgruber-x-p> let me get the ppa name again...
<jsjgruber-x-p> The one in ppa:jsjgruber/test-lernid-ppa , which was the first one we tested last night.
<jsjgruber-x-p> The second one, the more advanced one, is meant for eventual upstream release.
<pleia2> ok, I'll use ppa:jsjgruber/test-lernid-ppa
<pleia2> thanks :)
<jsjgruber-x-p> thank you
#ubuntu-classroom 2012-04-13
<Lilian> test
<bdfhjk> test passed
<khler_marcus> when does the workshop begin
<bdfhjk> in 40 minutes
<khler_marcus> oh, ok
<khler_marcus> thanks
* 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 || Current Session: Ubuntu Algorithm Class - Instructors: bdfhjk
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2012/04/13/%23ubuntu-classroom.html following the conclusion of the session.
<bdfhjk> Welcome in the first Ubuntu Algorithm Classes!
<bdfhjk> Please donât be afraid to ask questions.
<bdfhjk> if something isn't clear
<bdfhjk> I like active participants and questions are the important part of classes.
<bdfhjk> Classes will be splitted into 3 topics.
<bdfhjk> During first 20 minutes, I will talk about binary search, one of the basic algorithms.
<bdfhjk> Next 20 minutes we will spend on learning hashing methods, a more advanced topic.
<bdfhjk> Then, we are changing topic to introduction to artificial intelligence and usage of FANN library in practise
<bdfhjk> Letâs start with simple example.
<bdfhjk> Your friend has chosen randomly a number between 0 and 100. You have to guess it. If you tell him a number and this number isnât same as his one, he tells you if the number you tried is greater or lower than his one
<bdfhjk> How many questions do You have to ask to guess your friendâs number in the worst case?
<khler_marcus> 50
<Lilian> no
<bdfhjk> that isn't correct
<obounaim> log 100
<aANKOo> 100 ?
<Lilian> log100
<Lerhond> 100, if you're an idiot
<bdfhjk> The correct answer is 7. Each correct, smart question will reduce the set of possible answers to a half.
<bdfhjk> so, In general case, we need only log2K  questions to guess
<Lilian> 100* log 100
<khler_marcus> such an small number? how could this be
<bdfhjk> where k is the upperbound limit to number
<bdfhjk> This is an idea of binary search
<bdfhjk> We can use it to solve each problem, where it is easy to test, if correct answer is below tested value or above it.
<bdfhjk> Every time we ask about state of the element in the middle
<bdfhjk> Depending on in which half the correct value is, we call this algorithm recursively in suitable range of initial set
<bdfhjk> How it work?
<bdfhjk> Below Iâm presenting algorithm
<bdfhjk> int p := 0 (number of first element)
<bdfhjk> int k := n-1 (number of last element)
<bdfhjk> while(p<k) {
<bdfhjk>     int sr = (p+k)/2;
<bdfhjk>     if (try(sr) = success) p := sr;
<bdfhjk>         else k := sr-1;
<bdfhjk>     if (k-p = 1 && try(p+1) = success) p++;
<bdfhjk>     else k--;
<bdfhjk> }
<bdfhjk> Please pay attention to line
<bdfhjk> if (k-p = 1 && try(p+1) = success) p++; else k--;
<bdfhjk> This fragment prevents the infinite loop
<bdfhjk> It is clear now, how it work?
<bdfhjk> On notes, we have also a another algorithm
<bdfhjk> Shorter, but may be more difficult fo understand
<bdfhjk> where we can forget about infinite loop
<bdfhjk> This algorithm work, when value is an integer
<bdfhjk> so what if this is a float number?
<Lilian> harder to find
<bdfhjk> If You plan to use binary search to find a float variable
<bdfhjk> choose an EPS value, a very small number (typical 0,000001) and break loop when k-p < EPS
<khler_marcus> so sometimes it is impossible?
<bdfhjk> it depend, if we can ask questions
<bdfhjk> "One the which side of number x is answer"
<bdfhjk> if we can ask this type of questions
<bdfhjk> then it is always possible
<bdfhjk> if answer is a float
<bdfhjk> then we can reduce set of possible answer
<bdfhjk> for example
<bdfhjk> 0-1
<bdfhjk> 0 - 0.5
<bdfhjk> 0 - 0.25
<bdfhjk> ....
<bdfhjk> 0.1345 - 0.1346
<bdfhjk> and then we know
<bdfhjk> that the correct answer is about 0.1345
<bdfhjk> I hope that is clear enought
<bdfhjk> it is a simple algorithm
<bdfhjk> but need some time to understand how it work
<bdfhjk> In the notes, I wrote about some practical usages of binary search
<bdfhjk> Often on job interviews for programming, one of questions is to write binary search pseudocode
<bdfhjk> and one of the common errors is infinite loop
<bdfhjk> I saw, that we have questions on discussion room
<bdfhjk> I wrote code as pseudocode
<bdfhjk> it is used only in books or lecutres
<bdfhjk> to present idea independent of language
<ClassBot> jsjgruber-l84-p asked: Where will we find the ntes?
<bdfhjk> https://docs.google.com/document/d/1CHU5TgXegp6IkRQhx7ok9HFNMPVONiWojbkIgfdFJrQ/edit
<bdfhjk> here
<ClassBot> raju asked: where we can use this / area of usage ? I am pretty new to this
<bdfhjk> Please look at notes
<bdfhjk> We can use this in finding value in sorted set
<bdfhjk> but not only
<bdfhjk> for example I often use binary search method in debugging
<bdfhjk> trying to find where I have a bug
<bdfhjk> I put assertsa
<bdfhjk> 'asserts
<bdfhjk> always in the middle of code, where I may find my bug
<ClassBot> khler_marcus asked: Works this with characters too?
<bdfhjk> Yes, it work for integers, floats, chars
<bdfhjk> and any datatype
<bdfhjk> with '>' operator - which we can compare, that the first is below/under the second
<bdfhjk> I think that is all about binary search
<bdfhjk> Do You have any questions?
<bdfhjk> I don't see
<bdfhjk> so
<bdfhjk> The second topic is hashing methods
<bdfhjk> In hashing, we are going to reduce amount of data (something like compressing it), in a determinist way
<bdfhjk> We assume, that each equal part of data always have equal hash
<bdfhjk> There is no return way. We canât revert hashing.
<bdfhjk> We lose our initial data, but we gain something more useful in some cases.
<bdfhjk> A hash is usually a number like 1231432241
<bdfhjk> The most important thing is, that we can compare hashes and if they are equal - we know, that corresponding data is equal.
<bdfhjk> There is a small issue, which I describe later
<bdfhjk> but in the most cases we can assume that
<bdfhjk> We may use hashing in many areas, but today we limit it to hashing words / sequence of chars . Also we may store different information in hashes.
<bdfhjk> I will present hashes, which store information about letters and their position in word - so we will be able to compare words
<ClassBot> raju asked: if we got enough time please explain more about bug finding by using this .
<bdfhjk> I will answer this question after classes
<bdfhjk> so please stay online here
<bdfhjk> " QUESTION : " We lose our initial data, but we gain something more useful in some cases" If we are losting the data means its loss only na , please explain more ,"
<bdfhjk> To make it more visual
<bdfhjk> think about beautiful landscape
<bdfhjk> You can make a photo
<bdfhjk> one or two
<bdfhjk> then look at both
<bdfhjk> and say - that is the same place
<bdfhjk> but in photo
<bdfhjk> you will lose the real beauty, that can not be captured
<bdfhjk> but your photo is smaller than landscape
<bdfhjk> and You are able to put it in the pocket
<bdfhjk> or share with friends
<bdfhjk> so You losed some 'data'
<bdfhjk> but gained some capabilities
<bdfhjk> We have a few possible ways to implement hashes. I will teach you about one of the most popular storing information about position of chars and their type.
<bdfhjk> Words are combinations of chars, each char is represented by a small number (ASCII code).
<bdfhjk> Our hash is defined as s[i] + s[i+1]*p^1 + s[i+2]*p^2 + ... + s[j]*p^(j-i)
<bdfhjk> where s is the array which contain word
<bdfhjk> and every element in it is a char
<bdfhjk> noted as number in ASCII code
<bdfhjk> p is a small prime number
<bdfhjk> q is a big prime number
<bdfhjk> It is quite complicated, why they should be a prime number
<bdfhjk> I encourage you to think about it, but now Iâm only saying, it reduces the probability of collision.
<bdfhjk> What is the collision?
<bdfhjk> Sometimes, two different parts of data can be represented by the same hash, and we may think, that parts are the same
<bdfhjk> Is said, that we define hash as
<bdfhjk> s[i] + s[i+1]*p^1 + s[i+2]*p^2 + ... + s[j]*p^(j-i)
<bdfhjk> but this may be a very large number
<bdfhjk> so we will store and calculate it modulo q
<raju> ooooooooooooyyyyyyyyyyyyyyyyyy
<bdfhjk> q is a large prime number
<raju> bdfhjk:  sorry for mis type
<bdfhjk> The greater q, the more potential hashes we can use
<bdfhjk> but also we need more memory to store it
<bdfhjk> I ussualy use q = 10^9+33
<bdfhjk> we have only 1/q chance for that (if we choose q = 10^9+33, then we may have one collision per 10^9+33 comparation - it is small enough to forget about it in the most cases)
<bdfhjk> two hashes are identical and parts of data are different
<bdfhjk> Now, how to use it in practise
<bdfhjk> For example, we have 10^6 big words, and we want to be able to fast compare lexicographically two of it in logarithmic time of length. We want to figure, which is bigger. That is useful eg. in sorting.
<bdfhjk> The first step is preprocessing - calculate hashes for each suffix
<bdfhjk> when we know value of hash for each suffix, we can use the formula h(s[i..j]) = (h(i) - p^(j-i+1)*h(j+1)) mod q to calculate hash of fragment starting at char number i, and ending at char number j
<bdfhjk> It is clear, why this formula work?
<gang65> not really
<gang65> could you please explain this formula?
<ClassBot> obounaim asked: what is q?
<bdfhjk> sorry not this question
<ClassBot> jsjgruber-l84-p asked: what do you mean by suffix, here?
<bdfhjk> suffix is a last part of word, beginning at specified position
<bdfhjk> for example
<bdfhjk> word: algorithm
<bdfhjk> sufix
<bdfhjk> m
<bdfhjk> hm
<bdfhjk> thm
<bdfhjk> gorithm
<bdfhjk> and algorthm as the longest suffix
<ClassBot> fasked asked: Why we calculate j+1 at finish, but not j
<bdfhjk> That isn't true
<bdfhjk> We calculate hash for part i..j inclusive
<bdfhjk> but we store in h[i] hash for suffix starting on ith position
<bdfhjk> so if we want suffix for i..j
<bdfhjk> then from suffix i
<bdfhjk> we must deduct suffix j+1
<bdfhjk> and we have i..j
<bdfhjk> because suffix from i
<bdfhjk> we can denote as
<bdfhjk> i..j + (j+1)..end
<bdfhjk> We also multiply the j+1-th suffix
<bdfhjk> by p^(j-i+1)
<bdfhjk> because we removing chars at positions starting (j-i+1) after
<bdfhjk> i
<ClassBot> Lilian asked: Can you explain if this is the only formula for hashes or we can create one ourselves(but the main idea it to calculate everywhere the hash the same way)? ;)
<bdfhjk> No
<bdfhjk> We can create our formula
<bdfhjk> It depend, what informations we want to store
<bdfhjk> for example
<bdfhjk> if we are interested only in number of chars
<bdfhjk> then we can simply add numbers of chars
<bdfhjk> then words abc and cba
<bdfhjk> will have the same hash
<ClassBot> There are 10 minutes remaining in the current session.
<bdfhjk> or for example use prefix than suffix
<ClassBot> jsjgruber-l84-p asked: Does the suffix hash arithmetic work while it is all modulo q?
<bdfhjk> Yes, we can multiply add and deduct in modulo arithmetic
<bdfhjk> we can also divide, but we must use fermat's lemat
<bdfhjk> I can say more after the classes
<bdfhjk> about dividing hashes
<bdfhjk> and for calculating p^x
<bdfhjk> we can use fast_binary_power algorithm
<ClassBot> fasked asked: everything which allows to access data for O(1) is hash function, isn't it?
<bdfhjk> The definition of hash isn't strict
<bdfhjk> Always, when we store informations with data loss, we can say about hashing
<bdfhjk> when we only reduce size without data losss
<bdfhjk> 'loss
<bdfhjk> then we only making a compression
<bdfhjk> Ok
<bdfhjk> so to continue
<bdfhjk> to compare two words, we use binary search to find first char, where there is a difference between two words.
<bdfhjk> and to test, it two parts of word are the same
<bdfhjk> we test it's hash
<bdfhjk> which can be done in O(1)
<bdfhjk> so overall to compare lexicographically two words
<bdfhjk> we need O(log s) time
<bdfhjk> where s is a size of the smallest word
<bdfhjk> Do You have any questions about hashing methods?
<ClassBot> gang65 asked: What will happen if we use too small p number  (ex. 7), for formula: s[i] + s[i+1]*p^1 + s[i+2]*p^2 + ... + s[j]*p^(j-i)
<bdfhjk> if we store chars as numbers in ASCII code
<FeSludge> is hashing different than comparing the ASCII value of the characters?
<bdfhjk> then they will may be between <65.97>
<bdfhjk> If I remember this numbers correctly
<bdfhjk> but at least > 50
<bdfhjk> I often use p=13
<bdfhjk> becasue if this number is prime
<bdfhjk> then our hashes always will be different
<bdfhjk> because if we split they into prime factors
<bdfhjk> always will be different number of p there
<bdfhjk> FeSludge : I don't understand your question, could You clarify?
<bdfhjk> hashing allow us to make it faster
<bdfhjk> Finally, the last but not the least topic : Introduction to the artificial intelligence
<bdfhjk> This is not such a difficult subject (in practise usage), as it might seem at first time
<bdfhjk> Artificial intelligence can be used in a simple way to identify the language of the text
<bdfhjk> We can also guess the complicated patterns with a small number of possible outcomes
<bdfhjk> I present, how to make the first mentioned task
<bdfhjk> Firstly we must define the input and output of artificial neural network (ANN)
<bdfhjk> The input can be for example the number of occurrences of a each character type in the text, so we have 26 input neurons
<bdfhjk> Output neurons can be languages, that we are going to detect
<bdfhjk> These data can be easily counted by a simple program and saved to a file
<bdfhjk> Next step is to create the ANN - artificial neural network
<bdfhjk> This can be done using FANN library, by calling
<bdfhjk> struct fann *ann = fann_create(1, 0.7, 3, 26, 13, 3);
<bdfhjk> where:
<bdfhjk> 1 - connection rate (we arenât pay attention to this argument now, for our purposes it should be 1)
<bdfhjk> 0.7 - learning rate - defines how aggressive will be the learning algorithm. It depends on our learning data, for this example 0.7 is a good value for relative small amount of training data.
<bdfhjk> 26, 13, 3 - our layers.  First layer is the input. The last one is the output.
<bdfhjk> What is a (lucky) number 13?
<bdfhjk> This is the number of neurons in the hidden, middle layer.
<bdfhjk> In every problem, we must guess, what will be the best amount of hidden neurons  - there isnât any strict rule. For some problems it is useful to make 2,3 or more hidden layers.
<bdfhjk> The next step is to train our ANN using pregenerated file
<bdfhjk> fann_train_on_file(ann, "frequencies.data", 200, 10, 0.0001);
<bdfhjk> First two arguments are easy to guess
<bdfhjk> Thrid represents the maximal number of epochs - how many times we âfeedâ our ANN using data from file
<bdfhjk> Fourth is only for debugging, after how many epochs we want to see report at console.
<bdfhjk> The last one represent, what is maximal acceptable error on test data, so we can exit training after reaching it.
<bdfhjk> At this state we have operational ANN
<bdfhjk> ready for usage
<bdfhjk> If we want to detect language of text, we must only :
<bdfhjk> 1. Generate frequencies in this text
<bdfhjk> float frequencies[26];
<bdfhjk> generate_frequencies(argv[1], frequencies);
<bdfhjk> this function read input text and count frequencies of each char
<bdfhjk> 2. Run our ANN on this data
<bdfhjk> float *output = fann_run(ann, frequencies);
<bdfhjk> 3. Print the best answer
<bdfhjk> printf max{output}
<bdfhjk> what represent the biggest number from output values in output layer
<bdfhjk> remind: each value represents one language
<bdfhjk> in output layer
<bdfhjk> And that is all
<bdfhjk> Do You have any questions about the last part of classes?
<ClassBot> Lilian asked: printf max{output} - Python?
<bdfhjk> no, I wrote in pseudocode here
<Lilian> ow, thx
<bdfhjk> in c++ we must iterate all answers
<bdfhjk> and pick the bigger
<bdfhjk> language with the bigger probability
<bdfhjk> any other questions?
<bdfhjk> At the end, I want to say some words about Ubuntu Algorithm Team
<bdfhjk> Our main goal is to help programmers in problems related with algorithms
<bdfhjk> You can use our launchpad page https://launchpad.net/algorithms-headquarter to post your problems (as bugs)
<bdfhjk> Thanks everyone for participation!
<yoyoo> We thank you.
<ClassBot> jsjgruber-l84-p asked: So frequencies.data might contain something one line per language containing the frequecy of occurance of each letter?
<bdfhjk> an example frequencies.data:
<Lilian> bdfhjk: what do you mean by "problems"? Pseudo implementation of algorithms?
<bdfhjk> 12 26 3
<bdfhjk> 0.103 0.016 0.054 0.060 0.113 0.010 0.010 0.048 0.056
<bdfhjk> 0.003 0.010 0.035 0.014 0.065 0.075 0.013 0.000 0.051
<bdfhjk> 0.083 0.111 0.030 0.008 0.019 0.000 0.016 0.000
<bdfhjk> 1 0 0
<bdfhjk> 0.076 0.010 0.022 0.039 0.151 0.013 0.009 0.009 0.081
<bdfhjk> 0.001 0.000 0.058 0.024 0.074 0.061 0.030 0.011 0.069
<bdfhjk> 0.100 0.074 0.059 0.015 0.000 0.009 0.003 0.003
<bdfhjk> 0 1 0
<bdfhjk> ...
<bdfhjk> You can refer on fann article
<bdfhjk> linked in notes
<ClassBot> fasked asked: We can post any problems or only discussed here to launchpad?
<bdfhjk> Becasue we don't have many problems on launchpad, I allow to ask any question now
<bdfhjk> If in the future it change, then I inform about this
<bdfhjk> generally
<bdfhjk> answers is for all algorthim-related questions
<bdfhjk> bugs in for problems related with concrete program/application
<bdfhjk> by problems
<bdfhjk> I mean task
<bdfhjk> trouble
<bdfhjk> issue
<bdfhjk> the thing, which we want to do
<bdfhjk> Here I used pseudocode
<bdfhjk> to describe algorithms
<bdfhjk> sometime I mix it with c++
<bdfhjk> but all should be affordable
<bdfhjk> if not, please ask
<bdfhjk> http://www.surveymonkey.com/s/MQK9SKP
<bdfhjk> here is a link to survey
<bdfhjk> please share your thoughts
<bdfhjk> about classes
<ClassBot> There are 5 minutes remaining in the current session.
<bdfhjk> now we have 5 minutes for any questions
<bdfhjk> not necessary related with today's topics
<bdfhjk> I remember, that I had to answer some questions
<bdfhjk> please remind them
<fasked> Which topics you want to discuss in the future?
<bdfhjk> I have some proposition, not decided yet
<bdfhjk> one of them are matrix
<bdfhjk> how to calc sum i=0 to n=10^18
<Lerhond> interval trees!
<bdfhjk> 3^i (i+1)(i+2)
<bdfhjk> Please send your ideas in survey
<bdfhjk> online judge
<bdfhjk> You can train coding today's algorithms
<bdfhjk> solving tasks in online judge
<fasked> bdfhjk: thanks for class
<bdfhjk> for each topic we prepared tasks
<bdfhjk> so if You want to train
<bdfhjk> try solve they
<bdfhjk> some are easy, some are hard
<bdfhjk> binary search while debugging
<bdfhjk> suppose
<bdfhjk> You have a program
<ClassBot> Logs for this session will be available at http://irclogs.ubuntu.com/2012/04/13/%23ubuntu-classroom.html
<bdfhjk> which crashes at some point
* 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 ||
<bdfhjk> then to figure where it crashed
<bdfhjk> You place a line
<bdfhjk> like printf("Here I'm still alive");
<bdfhjk> and run your program
<bdfhjk> if You see this message
<bdfhjk> than you know - program isn't crashed before this line
<bdfhjk> in another case
<bdfhjk> You know, that bug is after this line
<bdfhjk> so you can ask questions like in binary search
<Lilian> bdfhjk: b-tree or fractral-tree ? :)
<bdfhjk> and every time place this line in the middle of unreliable code
<bdfhjk> Lilian: b-trees are interesting
<bdfhjk> but I think
<Lilian> fractal*
<bdfhjk> are not often used
<bdfhjk> are used primarily to read from disk
<bdfhjk> find an information in 3 or 4 asks
<Lilian> from a big database...
<bdfhjk> yes
<bdfhjk> If You are interested
<bdfhjk> please read about it in Cormen book
<bdfhjk> Introduction to Algorithms, Second Edition (9780262032933): Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein: Books.
<Lilian> bdfhjk: nice, thx
<bdfhjk> there are very well described
<Lilian> bdfhjk: I went to a job interview and I was attacked with a bunch of algorithms to explain...
<bdfhjk> algorithms are very useful
#ubuntu-classroom 2013-04-09
<mustafakyr> Is there anyone who works on beaglebone
<mustafakyr> I am trying to start a skeleton os.
<IdleOne> there is a #beaglebone
<IdleOne> I have no idea what beaglebone is though
<mustafakyr> thanks
<IdleOne> welcome
#ubuntu-classroom 2014-04-10
<steven__> problem understanding how to correct a syntax error.
<steven__> bash: /home/steven/.bashrc: line 110: syntax error: unexpected end of file
<steven__>  I'm a user of applications and not up on terminal technology
<chinmaya> what is ubuntu classroom/
<chinmaya> ?
#ubuntu-classroom 2014-04-13
<RoninOs_> Hello evry body!!!
#ubuntu-classroom 2015-04-08
<cr|imp> no one in here!
<cr|imp> when do the class starts?
