/srv/irclogs.ubuntu.com/2010/03/05/#ubuntu-classroom.txt

=== Jamie is now known as Guest22062
=== ecanto_ is now known as ecanto
kayveI am having a hard time knowing how to proceed with the installation of this facility called libdap which is a data transfer add on for Matlab06:05
persiakayve: Have you tried asking in #ubuntu?06:18
=== screen-x is now known as popey
=== popey_ is now known as popey
=== txwikinger2 is now known as txwikinger
=== mohi_away is now known as mohi1
mhall119|worknice14:08
cjohnstonhey mhall119|work14:30
cjohnstondid you see the identi.ca and twitter accounts?14:31
=== Quintasan_ is now known as Quintasan
mhall119|worknope14:45
mhall119|workwhat are they?14:45
mhall119|work@ubuntuclassroom?14:46
cjohnstonyes15:09
cjohnstonmhall119|work: http://chrisjohnston.org/2010/ubuntu-classroom-identi-ca-twitter15:09
=== ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - http://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Event: Ubuntu Opportunistic Developer Week - Current Session: Testdrive - Dustin Kirkland - Instructor: kirkland || Questions in #ubuntu-classroom-chat
kirklandhowdy all16:01
kirklandanyone here to hear about Testdrive for the Opportunistic Developer Week?16:01
kirklandalrighty16:02
kirklandcouple people, good enough for me16:02
kirklandso my name is Dustin Kirkland, an Ubuntu Core Developer on the Server Team16:02
kirklandin particular, I look after Ubuntu's virtualization and cloud computing packages16:02
kirklandbut I'd also like to think of myself as an opportunistic developer too ;-)16:03
kirklandthis session is about Testdrive, which I hope is interesting to you for two reasons ...16:03
kirkland1) it was totally developed opportunistically ;-)16:03
kirkland2) it can be used to help you test/develop your own opportunistic apps16:03
kirklandso who here has some helper scripts that they wrote or borrowed from someone else, living in their $HOME/bin dir?16:04
kirklandwell, those are often good targets of opportunity for sharing, IMHO16:04
kirklandand that's sort of how Testdrive came about16:04
kirklandkvm is a really powerful program16:05
kirklandwith lots and lots and lots of options16:05
kirklandhttp://manpages.ubuntu.com/manpages/lucid/en/man1/kvm.1.html16:05
kirklandbut i tended to use the same ones over and over again16:05
kirklandfor a few reasons ...16:05
kirklandthey made my VMs run faster, better, etc.16:05
kirklandso i wrote a little shell script i called mykvm that added those options automatically for me16:06
kirklandas turned out, though, this could be really useful for other people16:06
kirklandparticularly people who don't terribly want to learn lots and lots about virtualization and kvm16:07
kirklandbut just want to quickly launch a throwaway VM16:07
kirklandperhaps boot a live cd in a vm, test something, then discard it16:07
kirklandabout the same time, lots and lots of people started complaining about karmic16:07
kirkland"omg the colors are ugly... this is broken... that is broken... etc. etc. etc."16:07
kirklandbut this stuff had been in the pipeline for months16:08
kirklandanyone of those very vocal individuals could have tried Ubuntu any time in the last 6 months16:08
kirklandreported bugs16:08
kirklandand perhaps gotten some of them fixed16:08
kirklandso Testdrive was born16:08
kirklandas a way to "testdrive" the latest daily Ubuntu ISOs16:09
kirklandusing rsync/zsync to incrementally download the day's image16:09
kirklandrun it in a vm16:09
kirklandperhaps install, perhaps not16:09
kirklandand throw it away when done!16:09
kirklandwhat started out as a way to scratch my own itch ended up helping lots of people16:10
kirklandand solving a different problem16:10
kirklandand after Lucid releases, you'll be able to continue testdriving MM, OO, PP, etc. while still running Lucid ;-)16:10
kirklandso there's a couple of steps along the way ...16:11
kirklandof course i created a project and a team in Launchpad16:11
kirklandhttp://launchpad.net/testdrive16:11
kirklandhttp://launchpad.net/~testdrive16:11
kirklandloaded the source code up into bzr16:11
kirklandpushed to a public branch, GPLv316:11
kirklandpackaged it (this is important if you want people to install your program!)16:11
kirklandpushed to PPAs (backported to Hardy, Intrepid, Jaunty, Karmic, Lucid)16:12
kirklandand eventually got it into Ubuntu universe for Lucid16:12
kirkland(PPAs for the rest)16:12
kirklandnow, shortly after I released the initial version working with KVM, people came along and said16:12
kirkland"I like it, but I can't use KVM ..."16:12
kirklandand thus it grew arms and legs16:13
kirklandto use VirtualBox and Parallels16:13
kirklandand there's a VMWare patch under development16:13
kirklandthis is community driven efforts, now16:13
kirklandwith people like popey and others contributing bugs, features, patches, fixes, etc.16:14
kirklandso that's a bit about the history of the development of testdrive so far16:14
kirklandi see a question ....16:14
kirkland<tgalati4> QUESTION: What % of Karmic bugs were hardware support vs strictly software?16:14
kirklandI have no idea what the percentage is, but I'll address the spirit of your question ....16:15
kirklandobviously there are limitations to what can be tested in a VM16:15
kirklandbut there are tons of things that still can be tested in a VM!16:15
kirklandactually, when I demo'd testdrive at UDS Dallas, sconklin of the Ubuntu kernel team said ...16:16
kirkland"crap dude, if this testdrive thing takes off, people aren't going to test on their real hardware as much any more"16:16
kirklandi reckon that's true to some extent16:16
kirklandso at the end of running testdrive, there's now a question that ask you:16:16
kirklandLaunch USB Startup Disk Creator for further testing of this ISO? [y/N]16:17
kirkland:-)  which was sconklin's suggestion16:17
kirkland<enli_> QUESTION: "...testdriving MM, OO, PP etc." what those stand for?16:17
kirklandMM, OO, PP are whatever the releases after Lucid Lynx might be ;-)16:17
kirklandmultimorphing minataur16:18
kirklandum16:18
kirklandmeh, whatever mark comes up with :-)16:18
kirkland<tgalati4> QUESTION: How successful is a VM for testing strictly hardware bugs?16:19
kirklanda VM can be used for some things16:19
kirklandlike USB devices16:19
kirklandyou can "passthrough" USB devices to VMs16:19
kirklandlike a web cam16:19
kirklandor a 3G modem16:19
kirklandi often pass my Palm Pre cell phone through to a vm16:20
kirklandso ... using Testdrive to do your development/testing ...16:20
kirklandif you're already on Lucid, it's just "sudo apt-get install testdrive"16:20
kirklandif you're on Jaunty/Karmic, grab it from the PPA at http://launchpad.net/testdrive16:21
kirklandif you're on Hardy/Intrepid, well, it'll work, but there's a few limitations16:21
kirklandbasically, the linux virtualization stack has evolved rapidly in the last ~1 year16:21
kirklandso ... get testdrive installed16:22
kirklandyou'll need run either kvm or virtualbox16:22
kirklandi tend to recommend kvm if you have hardware that can run kvm16:22
kirklandand fall back to VB only if you have to16:22
kirklandonce testdrive is installed, you can run either from the command line or from the Applications -> System Tools -> Testdrive menu16:23
kirklandif you run with no options, you should be prompted with a menu of Ubuntu releases16:23
kirklandthis is just a concise list of perhaps the most popular ISOs16:23
kirkland(arguably)16:23
kirklandyou can choose one of these16:23
kirklandor enter your own url16:24
kirklandactually, from the command line, you can use:16:24
kirklandtestdrive -u any_iso16:24
kirklandwhere any_iso can be a local path16:24
kirklandor http, ftp, or rsync16:24
kirklandand it doesn't have to be ubuntu16:24
kirklandit can be debian, fedora, windows, whatever16:24
kirklandwell, i don't much about windows16:25
kirklandbut it should theoretically work :-)16:25
kirkland<tgalati4> QUESTION: How much RAM is recommended for VM to use testdrive?16:25
kirklandif you have >1G of memory, testdrive will give 512M to the guest16:26
kirklandelse if you have > 750MB, testdrive will give 384M to the guest16:26
kirklandelse it will give 256M to the guest16:26
kirklandwhich is basically what's required to run a live cd iso16:26
kirklandso i'd say you need >256M of memory :-)16:27
kirklandactually, this was one of the first reasons i created that old mykvm script16:27
kirklandkvm defaults to 128M of memory16:27
kirklandwhich ain't much :-)16:27
kirklandi *always* gave my VM's 512M16:27
kirklandso i created a bash alias, which eventually turned into a script to add virtio networking and virtio disk16:28
kirklandoh, another thing about the evolution of that code ...16:28
kirklandit started out as shell script16:28
kirklandwhich is fine and dandy for prototyping16:28
kirklandbut if you want to do something more complex16:28
kirklandand you want to work with other people on the code16:28
kirklandie, "collaborate"16:28
kirklandshell can be difficult ;-)16:29
kirklandso I re-wrote it in python16:29
kirklandi'm sure you've heard a lot about python this week16:29
kirklandi'm no expert, but it's easy to learn, and a very friendly language16:29
kirkland<w1nGNUtz> QUESTION: What exactly do you expect users to test?16:29
kirklandwell, it's both a test and a development tool, actually16:29
kirklandfrom a test perspective ...16:30
kirklandsome of you probably saw the new ubuntu theme posts this week?16:30
kirklandnew colors and windows and stuff like that?16:30
kirklandgreat for testdriving16:30
kirklandor perhaps packages in ppas16:31
kirklandthat you're not willing to put on your primary desktop16:31
kirklandwhich might even be running Lucid, as in my case16:31
kirklandthere's some stuff that even core developers are risk adverse too :-)16:31
kirklandbut  you can also install to the vm's disk16:32
kirklandreboot the vm, etc.16:32
kirklandwe use that for server testing all the time16:32
kirklandi'd say software wise, you should be able to test almost anything16:32
kirklandyou know, the stuff people are going to complain about after release :-)16:32
kirklandits actually *really* easy to test it now, before release, in a vm16:32
kirkland<w1nGNUtz> kirkland: I thought testdrive was meant to test hardware, drivers and other stuff16:33
kirklandnot really ....16:33
kirklandare you thinking of checkbox?16:33
kirkland<tgalati4> QUESTION: When updating a testdrive snapshot, is the entire distro downloaded or diff files?16:33
kirklandtestdrive tries its best to download incrementally16:33
kirklandif the url is a rsync:// url (all of the ones in the default menu are), it uses rsync against the iso16:34
kirklandwhich can really improve your download by incrementally downloading the parts of the iso that have changed16:34
kirklandif you use http or ftp, it tries to use zsync16:34
kirklandwhich requires a zsync file on the server end16:34
kirklandubuntu images are typically published with a zsync file16:34
kirklandbut if you're pulling images from else, they may or may not be there16:35
kirkland<w1nGNUtz> kirkland: as a programmer i thought it would have some automated tests included in testdrive, like in grid computing, use users' computing power to run more tests quickier.. I didn't realize it would be used to test virtually anything.16:35
kirklandpossibly a flaw in the naming of the package ...16:35
kirklandit's really meant as an easy way to "take the next ubuntu release out for a test drive"16:35
kirklandin the same way you might roll up to the chevy dealership and ask to take the new Corvette out for a spin ;-)16:36
kirklandso from a development perspective, i often use testdrive for a pristine environment16:36
kirklandof course there are other ways of doing this16:36
kirklandchroots, etc.16:37
kirklandbut for various reasons, a VM can be advantageous16:37
kirklandit more closely mimics the end user's environment16:37
kirkland<yellabelly24> QUESTION: How much KVM do we need to know? Can you recommend a quick start guide for KVM?16:37
kirklandto use testdrive?  none at all, hopefully16:37
kirklandthat's the goal of testdrive, to mask the creation and tear down of the VM from you entirely16:38
kirklandyou just tell testdrive where your target ISO is, and it puts that into a VM for you to play with16:38
kirklandif you want to learn about KVM, well that's a different story16:38
kirkland:-)16:38
kirklandhttps://help.ubuntu.com/community/KVM16:39
kirklandthat's as good of a starter as anywhere16:39
kirklandhttp://manpages.ubuntu.com/manpages/lucid/en/man1/kvm.1.html16:39
kirklandmanpages are good too16:39
kirklandbut, for instance ...16:39
kirklandi'm testdriving an iso right now16:39
kirklandps -ef | grep kvm16:39
kirklandkirkland 31434 31433 78 10:38 pts/11   00:00:54 kvm -m 1024 -cdrom /home/kirkland/.cache/testdrive/iso/lucid-desktop-amd64.iso -drive file=/home/kirkland/.cache/testdrive/img/testdrive-disk-Aw769k.img,if=virtio,index=0,boot=on -usb -usbdevice tablet -net nic,model=virtio -net user -soundhw es137016:40
kirklandif you know the kvm magic, you could easily construct that line yourself16:40
kirkland-m 1024 -> give the vm a gig of memory16:40
kirkland-cdrom is the path to the locally cachced iso image16:40
kirkland-drive ...virtio... loads a virtio disk16:40
kirklandwhich is really fast, by the way16:40
kirklandthis is a sparse qcow2 image16:40
kirklandcreated by kvm-img create -f qcow216:41
kirklandwhich testdrive also did for you16:41
kirkland-usbdevice tablet improves the mouse experience, letting you move in and out of the window a bit better16:41
kirklandvirtio networking16:41
kirklandand a sound card, so that you can hear the vm's sound16:41
kirklandthere's similar work done for virtualbox too16:41
kirklandmakes the experience similar16:42
kirkland<enli_> QUESTION: When somebody has installed with Testdrive to virtual HDD and there is a new image available. So is that possible to extract the image and place binaries at their respective locations without going through the whole setup thing again? (probably stupid but sounds good to me)16:42
kirklandhmm, it would be much better to just boot the existing installed virtual HDD and sudo apt-get dist-upgrade ;-)16:42
kirkland<tgalati4> QUESTION: Can testdrive be used for testing/benchmarking server edition and server applications?16:43
kirklandabsolutely!16:43
kirklandwell, testing16:43
kirklandbenchmarking is a little tougher in a vm16:43
kirklandthough it can be done, with certain caveats16:43
kirkland<tgalati4> QUESTION: For instance, if I want to test apps from Hardy to Lucid?16:44
kirklandwell, a couple of things ...16:44
kirklandyou could start by testdriving a Hardy server iso16:44
kirklandinstall to the virtual hard disk, add your apps16:44
kirklandverify that they install there16:44
kirklandthen live upgrade from Hardy -> Lucid in the vm16:44
kirkland(that'll take a while, depending on your bandwidth)16:44
kirklandthen see if your apps are still working as they were in Hardy16:45
kirklandoh, and you could save your hardy image off to the side16:45
kirklandor use qemu snapshot16:45
kirklandso that you can roll back and forth16:45
kirkland<tgalati4> Almost like cloud computing.16:46
kirklandwell, similar, i suppose16:46
kirklandin that cloud computing builds on virtualization16:46
=== w1nGNUtz is now known as w1ngnutt
kirklandUbuntu Enterprise Cloud is really just a collection of KVM vm's16:46
kirkland(and a lot of management software that makes that work)16:46
=== w1ngnutt is now known as w1ngnut
kirklandstuff much more complicated than testdrive, I assure you ;-)16:47
kirklandand it's good for that16:47
kirklandso you can branch the testdrive source code very easily16:47
kirklandbzr branch lp:testdrive16:47
kirklandit's just a relatively simple python script16:47
kirklandyou're welcome to hack on it, submit bugs, and branches and patches :-)16:48
kirklandscratch your itch16:48
kirklandor model your own project on bits and pieces of testdrive if you like16:48
kirkland<yellabelly24> QUESTION: Can you save state in a snapshot? (like a suspend/hibernate)16:48
kirklandyou sure can!16:48
kirklandhere's how ...16:48
kirklandif you're running a kvm16:48
kirklandclick inside of it16:49
kirklandand press16:49
kirklandctrl-alt-216:49
kirklandthis will put you into the qemu monitor16:49
kirklandit's like a little shell running below the vm16:49
kirklandyou can talk to the hypervisor here16:49
kirklandin there, type:16:50
kirklandsavevm /tmp/path_to_snapshot.img16:50
=== w1ngnut is now known as w1ngnutt
kirklandthis will take a few minutes to complete16:50
kirklandwell, depending on the size of your memory and delta from the last state16:50
kirkland<tgalati4> QUESTION: I want to experiment with XEN VM on one of my machines.  Will testdrive work with XEN?16:51
kirklandnot currently16:51
kirklandno plans to do so (by me)16:52
kirklandgood patches accepted :-)16:52
kirkland<quappa1> QUESTION: (not a question) you should also advertise Testdrive to developers as a way to test their apps on OLDER releases which many end users use :)16:52
kirklandthanks16:52
=== w1ngnutt is now known as w1ngnutz
kirklandguys, i think that's about all from me16:53
kirklandscratch your itch ;-)16:53
=== 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: Ubuntu Opportunistic Developer Week - Current Session: Creating a PyKDE app - Rich Johnson - Instructor: nixternal || Questions in #ubuntu-classroom-chat
=== 92AAABJ1O is now known as pleia2
=== yofel_ is now known as yofel
=== 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
=== riot_le is now known as Guest43732
sebsebsebHi18:50
=== 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: Ubuntu Opportunistic Developer Week - Current Session: SHOWCASE: Lernid - Jono Bacon - Instructor: jono || Questions in #ubuntu-classroom-chat
=== felipeborges_ is now known as felipeborges
=== jono_ is now known as jono
jonoahh!19:02
jonohey all!19:02
jonosorry some nick problems there19:02
jonoI am a numpty!19:02
jonook folks, if in Lernid and on Lucid - click Event -> Tweet this session :)19:03
jonook lets get started19:03
jonohow is everyone today?!19:03
jonohi all! my name is Jono Bacon and I am the Ubuntu Community Manager19:04
jonowelcome to my Lernid showcase session19:04
jonothe aim of this session is to tell the story behind Lernid, to explain how it came about, what technical decisions were made to produce it and to help provide some background that might help you good folks make your own apps19:04
jonoso, what is Lernid?19:04
jonomany of you are using Lernid to connect to this and other online learning sessions, but for some of you, you will have no idea what Lernid is19:05
jonowho is using Lernid to view this now?19:05
jonogive me a o/ in the chat channel if you19:05
jonoare19:05
jonosweet! :)19:06
jonothat makes me smile19:06
jonook, in a nutshell, Lernid is an online learning to tool that helps people have an interactive experience when participating in online learning events - the homepage for Lernid is at https://wiki.ubuntu.com/Lernid19:06
jonoclick the Session tab to see the web pages as I post them19:07
jonoabout 3 1/2 years ago when I joined Canonical as the Ubuntu Community Manager, I was trying to think of ways in which we could spread best practise - methods in which we could help more people in the community learn the skills and processes to join us to make Ubuntu better19:07
jonoto do this I created Ubuntu Open Week: a set of IRC tuition sessions in which people joined #ubuntu-classroom and #ubuntu-classroom-chat - I asked a bunch of my fellow community members to deliver sessions in #ubuntu-classroom and questions could be asked in #ubuntu-classroom-chat19:07
jonoit went down really well and lots of new folks joined our community19:07
jonowe then created Ubuntu Developer Week: a similar event but more specifically aimed at technical topics and packaging work in Ubuntu19:08
jono<tgalati4> QUESTION: How much beer did it cost you?19:08
jononone :)19:08
jono<tgalati4> QUESTION: How much beer did it cost you?19:08
jonooops19:08
jonowe have done this every cycle for three years, but a few things niggled me about it - namely:19:08
jono(1) IRC is complex for a lot of new users - you need to know how to what an IRC client is, how to connect and which channels to join19:09
jono(2) the times are a pain to convert to your loca timezone - we provided the times in UTC - a universal time standard for confusing everyone about what UTC actually is :P19:09
jono(3) IRC is very static - it is just text, and delivering other content, particularly visual content is difficult19:09
jonofor a little while I was thinking it could be cool to have a simple Python app that solved these problems and at the last Ubuntu Developer Summit I shared my idea for this app in a session19:10
jonoon the flight back from Dallas to California I decided to start writing it, created a first version and blogged it at http://www.jonobacon.org/2009/11/25/introducing-lernid/19:10
jonoI created Lernid using Quickly, and this first cut literally just solved the problem (1) above - it provided a window divided into three sessions where you could see the web page for the event and two embedded chat channels - one for #ubuntu-classroom (in the interface as Classroom) and one for #ubuntu-classroom-chat (in the interface as Chatroom)19:11
jonothis early version already made it really easy to connect - when you connect in Lernid you see the connect dialog as in http://farm5.static.flickr.com/4059/4409336396_dfe1636ae3_o.jpg19:11
jonowhat this does it grab a .lernid config file from the server (currently set to jonobacon.org) and this config file has a series of details about a given event - this includes:19:12
jono * the name of the event19:12
jono * a link to an ical file which contains the details about each event19:13
jono * the start and end times for the event19:13
jono* the classroom IRC channel19:13
jono * the chat IRC channel19:13
jonoand.....19:13
jono*drum roll*19:13
jono * a webpage that describes the event19:13
jonothis config file is downloaded using the urllib python module and then the config is parsed using the ConfigParser python module - this then gives us some data about the event and tells us which IRC channels to connect to19:14
jonothe window was divided into the three areas and embedded three webkit widgets - this is a module you can use to display web pages19:14
jonoat first I embedded the freenode web IRC interface and pointed it at the relevant IRC channels19:15
jonothe next step was to provide support to display the scheduled set of events in Lernid - such as in http://farm5.static.flickr.com/4003/4409336490_ba709363d3_o.jpg19:15
jonoto do this I created a Google Calendar for the events and added a bunch of events and then used the urllib Python module to download the ical file and the vobject Python library to parse it and grab the interesting bits of data - vobject is a great way to grab data out of calendar feeds19:15
jonoI then used the time and datetime Python modules to convert the events (which had their times specified in UTC) and convert them to the local timezone (in my case GMT-8) - I then created a gtk.TreeView widget to display this list of events, complete with the local timezone times19:16
jonothis instantly made Lernid a useful app - now you could connect to an event by simply selecting it from a combo box, see the IRC channels instantly and see what events were schedule with your local timezone applied19:17
jonoI then added notification bubble support so a little notify-osd bubble pops up when an event is starting and 10mins before an event started19:17
jonoto do this I used the pynotify Python module and set the times for when the bubbles should pop using the idle_time() function in PyGTK - this lets you schedule something to happen19:18
jonothe next step in my head was to add support for slides19:18
jonomy thinking was that if we could deliver slides in a session it could really raise the interactivity of a given session19:19
jonoI was really keen to make it really simple for session leaders to provide slides, so I wanted them to be able to provide a .pdf19:19
jonothen ideally Lernid could display the slides one at a time19:19
jonothe way this works is that a slide can be triggered in lernid by the session leader typing in [SLIDE 1]19:20
jonothis will then display the very first slide19:20
jonothe session leader then just specifies the slide number and slides appear in real-time in Lernid19:20
jonofor this to work, a 'Slides' line is added to the ical feed19:20
jonothis points to a location where the pdf lives19:20
jonoplease folks, don't flood -chat19:21
jonoI will wait until the spamming stops19:21
jonoso the slides are on a server, we then use the urllib module to download the slides and the poppler module takes the pdf and breaks them into a collection of .jpg files - I then added a listener to the IRC window that listens for the [SLIDE] line and displays the relavent .jpg in the window19:23
jonosimple as that19:23
jonoI forgot to mention that in the meantime I wanted to make the IRC panes a lot more native - embedded freenode webchat pages sucked19:24
jonoso, I had a chat with the telepathy folks (they make the telepathy framework which powers empathy and is seen as the next gen GNOME messaging backend) and they have IRC support19:24
jonoso I used this module to have a native widget - telepathy dealt with making the connection and getting the content, and then I just displayed it in the widget19:25
jonoat this point I kicked out a release and people started using Lernid for actual events19:25
jonoI then wanted to have real-time webpages load19:26
jonowe already had an embedded web browser, so I just added a listener for websites that start in http19:26
jonothis would then grab the URL and feed it to the webkit based webbrowser19:26
jonoI added an additional combo box and reload and back buttons to allow people to look at previous pages and controls them a little19:27
jonowith this, I kicked out a release19:27
jonoI now considered Lernid mostly completed for what I wanted19:27
jonothe next step was to make it available in everyone's language19:27
jonoDavid Planella on my team helped add support for translations to the code, and when this support is in there, translators across the internet can use rosetta to translate the app and the translations are automatically imported into Lernid19:28
jonoI added this functionality and tweeted a call for translators19:28
jonowithin a few hours it was fully translated into 16 languages19:29
jonoyou can see the list of translations at https://translations.edge.launchpad.net/lernid19:29
jonoRosetta is an absolutely stunning tool for this - any app can benefit from this - you add support for translations and then open it up to a bunch of people who have never needed to or want to write code, but love to translate19:30
jonoDavid gave a session a few days back on how to hot rod your app for translations, so I recommend you check out the log19:30
jononow the project was moving along swiftly19:30
jonopeople were really interested in it and it was used for real events19:31
jonowe then had a patch to add a terminal view - http://farm5.static.flickr.com/4049/4409336512_cc6c658a6e_o.jpg19:31
jonowith Lernid being used a lot for computer-related events, it made sense19:31
jonothe terminal is embedded using the python-vte module19:31
jonoit is really simple to use - there is a great example in Acire if you want to use it19:32
jonomore details on Acire and Python Snippets are at https://wiki.ubuntu.com/PythonSnippets19:32
jonoat this point I was busy with a few other tools and I had got Lernid to the point where I wanted it, so it was time for me to do the right thing and hand over leadership of the project to someone else19:32
jonoI am a firm believer that good leaders step down when they know they cannot commit the time needed, so I evaluated the Lernid developer community and there was a clear candidate for a replacement19:33
jonoMichael Budde19:33
jonombudde to us all19:33
jonothat man is a total, total rock star19:33
jonohe brought so much quality and value to Lernid, and taken much of my shonky code and written it right :)19:34
jonombudde has brought a new level of detail and polish to the app and done a great job19:34
jonoif you would like to contribute to Lernid, be sure to ping him, I am sure he would love to talk to you19:34
jonothe final feature I asked mbudde to add for the current release which I didn't have time to work on due to travel is the tweeting feature found in the event menu - http://farm5.static.flickr.com/4013/4408570373_367df728da_o.jpg19:35
jonoI had this idea that when a session is running there should be a one click way to tweet, dent, Facebook it etc19:35
jonofortunately, Lucid ships with the rocking Gwibber API19:35
jonothis makes microblogging from your app *really* simple19:36
jonoagain, there is a snippet that explains how to do this in Acire - see https://wiki.ubuntu.com/PythonSnippets for details19:36
jonoit is literally about three lines of Python19:36
jonothis is a great way to spread the word about events and much more19:36
jonoso there we have it, that is the story of Lernid - I hope it provided some useful tips and insight on making an app, scratching an itch and sharing some cool Python modules you may have not heard of19:37
jonoany questions?19:37
jono<quappa1> QUESTION: is lernid used outside of Ubuntu Weeks?19:38
jonoquappa1, it sure can be, and is :)19:38
jono<mhall119> QUESTION: for Lernid, how much did you use Glade,and how much GUI code did you have to write yourself?19:38
jonomhall119: it uses Glade extensively - some GUI code that needs to be written (such as the treeviews) is in there19:39
jono<w1ngnutz> QUESTION: Does Learnid have special tools to session leaders?19:39
jonow1ngnutz, not yet, but it is planned I believe19:39
jono<w1ngnutz> QUESTION: PLans to add audio and video?19:40
jonow1ngnutz, no idea, I think it is technically possible, but incredibly complex19:40
jonoin my view, Lernid is awesome because it is low bandwidth19:41
jonoso people in developing nations as an example, can connect19:41
jono<tgalati4> Does acire have a simple text search to look for say "gwibber" in python-snippets?19:41
jononot yet, it is planned - but it does list snippets by category19:42
jono<raven_99> QUESTION: How long is development time for an app such as this? In other words, how long did it take for you to push it for widespread use following the time you started writing it on the plane?19:42
jonoraven_99, I wrote the first cut in a few days19:42
jonoto get it to where it is - I would say a few months of spare time work19:42
jononot a lot of time by any stretch19:42
jono<KennethP88> QUESTION: How many coding hours (roughly) are spent on Lernid so far?19:43
jonodifficult to tell, I would say up until the point where slides were added (including slides) - probably about 20 hours19:43
jono<tgalati4> QUESTION: How many lines of code in Lernid so far?19:43
jonono idea, mbudde can let you know that19:43
jono<w1ngnutz> QUESTION: you have more ideas for e-learning/e-teaching stuff like this?19:43
jonow1ngnutz, indeed, but most of my key ideas are now in Lernid19:44
jonoone of the challenges that Lernid will face is that it is a haven for ideas, but we should never comprimise the simplicity of Lernid19:44
jonothe whole point is that it is really easy to use19:44
jono:)19:44
jonobefore I finish19:46
jonoone final thing19:46
jonowhen I announced Ubuntu Opportunistic Developer Week, I announced a challenge too19:46
jonohttp://www.jonobacon.org/2010/02/25/the-grand-app-writing-challenge/19:47
jonothe basic goal is to write some apps this week and I am writing up a blog entry to report progress19:47
jonoI am writing this blog today, so if you have app you wrote this week that you want features, email me ASAP with the details19:47
jonojono AT ubuntu DOT com19:47
jonoI am writing the blog in the next few hours19:47
jono<titeuf_87> QUESTION: did you get a lot of entries already?19:48
jonoyep, some great entries :)19:48
jonoand finally, don't forget that a great place to join the opportunistic developer community in Ubuntu in #ubuntu-app-devel on freenode19:48
jonocome and join us, unlock your creativity with writing cool apps and have lots of fun too :)19:48
jonook, folks, thanks for joining me!19:48
jonohave a wonderful weekend!19:49
=== 14WAABV0A is now known as hatalar205
=== 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: Ubuntu Opportunistic Developer Week - Current Session: Web browsing and rapid UI with WebKit - Ryan Paul - Instructor: segphault || Questions in #ubuntu-classroom-chat
seg|arsHello!20:01
seg|arsI'm going to be discussing application development with WebKit20:01
seg|arsFor those who don't already know, WebKit is an HTML rendering engine that is developed by Apple. It was originally based on KDE's KHTML renderer20:02
seg|arsWebKit is lightweight and easy to embed, which makes it useful for integrating HTML rendering capabilities into conventional desktop applications20:02
seg|arsThere is a Gtk+ variant of WebKit that uses Cairo for drawing and can be used seamlessly in standard Gtk+ and GNOME programs20:03
seg|arsIt's really easy to use if you want to display a web page in your application20:04
seg|arsbut it's also increasingly useful for building rich user interfaces20:04
seg|arsIf you want to present content in more dynamic way in your application, HTML can sometimes be a very compelling shortcut20:05
seg|arsMaking a custom Gtk+ widget can be hard, but writing HTML is very easy20:05
seg|arsGwibber, my open source microblogging client, uses WebKit and HTML for several aspects of its user interface20:06
seg|arshttp://s3.amazonaws.com/scrnshots.com/screenshots/225884/gwibber-230png20:06
seg|arsThe main message stream in Gwibber is rendered with HTML, allowing us to have sophisticated theming20:07
seg|arsBut that's not the only part that's HTML. The new sidebar and the target bar at the bottom of the window are also rendered with WebKit20:07
seg|arsWebKit supports some really sophisticated CSS features that make it conducive to interface design20:08
seg|arsFor example, it supports CSS gradients, transparency, reflections, and even animated transitions20:09
seg|arsYou can see several of those features in the previous screenshot20:09
seg|arsThe Gtk+ port of WebKit is maintained by the WebKitGtk+ developers: http://webkitgtk.org/20:11
seg|arsthe port is under very heavy active development and is gaining new features with every release20:11
seg|arsSome of the key stakeholders in the porting effort recently gathered for a hackfest where they worked on some key improvements20:12
seg|arsYou can find more details about the hackfest here: http://arstechnica.com/open-source/news/2010/01/webkitgtk-hackfest-improves-html-renderer-for-gnome-apps.ars20:12
seg|arsThey are adding a lot of great HTML5 features, such as HTML5 video playback via GStreamer.20:13
seg|arsYou can use WebKitGtk+ in several different programming languages thanks to the availability of bindings20:14
seg|arsPython is my programming language of choice, so that's what we will be using for the code examples during this session20:14
seg|arsThe Python bindings are available through the PyWebKitGtk project: http://code.google.com/p/pywebkitgtk/20:15
seg|arsThe lead developer behind that project recently halted activate maintenance, so those bindings will not be used much in the future20:16
seg|arsPyGi, which provides Python bindings to Gtk+ libraries through GObject-introspection, will be used in the future20:16
seg|arsPyGi is already largely usable, but it wasn't quite mature enough yet for us to use in an LTS release20:16
seg|arsAs such, Gwibber still uses the conventional PyWebKitGtk+ bindings in Lucid but will be using PyGi in the next major release20:17
seg|arsFortunately, it's not that difficult to switch from one to the other. In fact, you can write code that supports both, as I will demonstrate later20:17
seg|arsIn our first code example, you can see how to instantiate a WebKit widget and embed it into a Gtk+ application: http://gist.github.com/32307720:18
seg|arsThe line "web = webkit.WebView()" will create the WebKit renderer20:19
seg|arsYou can use the WebView widget's "open" method to cause it to load a web page20:19
seg|arsin the example, the WebView is embedded in a ScrolledWindow so that the user can scroll around the content20:20
seg|arsNotice the gtk.gdk.threads_init() call at the beginning of the script. You need to do that *before* you instantiate a WebView, otherwise the program will crash20:20
seg|arsThat code snippet is all you need if you just want to embed a web page in your application20:21
seg|arsBut there are also many cases where you want to generate the HTML yourself, like we do in Gwibber20:21
seg|arsto make the WebKit renderer display your own HTML, you use the load_html_string method.20:21
seg|arsweb = webkit.WebView(); web.load_html_string("<p>test</p>", "file:///")20:22
seg|arsThe first parameter is an HTML string that you want to display in the renderer20:22
seg|arsThe second parameter is the base path that you want to use for the html content20:22
seg|arsspecifying a specific base path can be useful if you want to include images or other content in the html using relative paths20:23
seg|arsWhen you use WebKit to make a user interface, there are several tricks that you can use to make the experience more seamless20:23
seg|arsThis code example demonstrates several of those tricks: http://gist.github.com/32308020:23
seg|arsBy default, an image that is embedded in a WebView widget can be dragged around the screen and out of the program20:24
seg|arsYou can actually see this in action if you open up the software center and start dragging the big icons in the main pane20:24
seg|arsThat's obviously an undesirable behavior in a regular user interface20:24
seg|arsFortunately, WebKit has a custom CSS attribute for controlling that behavior20:24
seg|arsif you set "-webkit-user-drag: none;" on your images, they will not be draggable20:25
seg|arswe had to do that to avoid issues in the Gwibber navigation bar20:25
seg|arsAnother similar issue is that all content in a WebView is selectable, just like text content in a browser20:25
seg|arsthat might not be desirable on something like a button label20:26
seg|arswhen you want to inhibit text selection of content in a WebView, you can apply "-webkit-user-select: none" in the css20:26
seg|arsYou can see both of those in the code example that I pasted20:27
seg|arsIf you run that code, it will display a button with a shiny gradient and an icon20:27
seg|arsThe user-select and user-drag CSS attributes are used to make it so that the icon can't be dragged or text-selected20:27
seg|arsWhen you use WebKit in a Gtk+ application, you will probably want to make it use colors from the user's Gtk+ theme20:29
seg|arswe do that for the navigation elements in Gwibber so that they fit better with the rest of the program20:29
seg|arsfor example, it's really important to make sure that the background of the web page matches the color of the user's gtk window background20:29
seg|arsYou can see how to do that in the last code example20:29
seg|arsIn the HTML, we use string interpolation so we can programmatically set a custom value for the page "background" attribute20:30
seg|arsIn the Python part of the code, you can see a line where we get the background color and assign it to the "bgcolor" variable20:30
seg|arsYou can extract style information from any gtk widget by using w.get_style()20:31
seg|arsto get the background, we do "w.get_style().bg[gtk.STATE_NORMAL]"20:31
seg|arsThe state part tells Gtk+ what state you want to get the color from20:31
seg|arsif you wanted to get the selection color, for example, you could use gtk.STATE_SELECTED20:31
seg|arsIn addition to "bg" you can also get the foreground ("fg") and text colors ("text")20:32
seg|arsQUESTION: What does WebView refer to exactly? Rendering of any url, or any piece of html code? I'm confused.20:32
seg|arsThe WebView is a WebKit rendering widget. It's like an HTML renderer that you can plop into a Gtk+ application20:33
seg|arsyou can use it to load either a remote url or to display any specified html content20:33
seg|arsok, back to the color setting20:34
seg|arsIn the code example, we use "%s" as a placeholder in the html code to denote the place where we are going to insert the color data20:34
seg|arswhen we apply the html, we use "html % bgcolor", which will replace that "%s" with the actual value of the bgcolor variable20:35
seg|arsif you were going to programmatically set multiple values in various places in the html, you can use a more sophisticated approach like Python's string "Format" method. It will let you do more complex interpolation and value replacement20:36
seg|arsIn Gwibber, we needed even more control over the html20:36
seg|arswe use a template engine called Mako that lets you generate HTML with bits of code interspersed20:36
seg|arsYou can learn more about Mako here: http://www.makotemplates.org/20:36
seg|arsMako is really great for theming because you can create a set of programmable templates that can be inherited and overridden20:37
seg|arsIn Gwibber, we supply a base template that defines functions for rendering all of the items in the message stream. Each theme inherits that base template and overrides parts of it to create their own desired look and feel20:37
seg|arsThis is what the Gwibber base template looks like: http://bazaar.launchpad.net/~gwibber-committers/gwibber/trunk/annotate/head%3A/ui/templates/base.mako20:38
seg|arsYou can also do some programming in the HTML itself20:39
seg|arsin Gwibber, for example, we use the jquery library to make it so that the user can expand grouped messages. It has a nice animated transition20:39
seg|arsUsing jquery in embedded HTML can be really useful for building a rich UI20:39
seg|arsOne of the big challenges of using an embedded HTML renderer in a Gtk+ application is facilitating communication between the contents of the HTML and the outside program20:40
seg|arsyou want your program to be able to respond to click events inside of the html20:40
seg|arsIn our code example (http://gist.github.com/323080) we use navigation events to do that20:41
seg|arsYou can see that the button in the html is wrapped in an "a" tag that points to "program:/test" as its URL20:41
seg|arsWhat I tend to do when I want to detect a click event in WebKit is intercept all navigation events and filter the ones that have a pre-determined prefix20:42
seg|arsin the code example, the on_click_link function gets bound to the "navigation-requested" event20:42
seg|arsweb.connect("navigation-requested", on_click_link)20:43
seg|arswhat this means is that any time something causes a navigation action in the WebView, like if somebody clicks a link, that Python function will be called20:43
seg|arsIn the Python function, we analyze the URI to see if it starts with "program:/"20:44
seg|arswhen it does, we look at what the rest of it says and then we perform whatever action20:44
seg|arsyou could have a set of if/elif checks on the value of the rest of the URI after "program:/" to determine exactly what the program should do20:44
seg|arsfor example, in Gwibber, clicking the reply icon in a message bubble will load the url "gwibber:/reply?msg=${msgid}"20:45
seg|arsThe template library is used to replace the ${msgid} part with the actual id of the individual message20:46
seg|arswhen the user clicks that icon, the python side of the program will detect it and then execute gwibber's reply function with the specified id value as a parameter20:47
seg|arsQUESTION: navigation-requested is a webkit event, right?20:47
seg|arsyes, navigation-requested is a webkit event20:47
seg|arsBy default, if you don't set a function to the navigation-requested signal, clicking a link will cause the url to load inside of the WebView20:47
seg|arsin most cases where we are using WebKit for a user interface, we want to capture those clicks to perform an event and we want regular links to load in the user's external browser20:48
seg|arsYou can see that in action in the code example. When the URI doesn't match "program:/" or anything else we are tracking, we just pass the whole thing to python's "webbrowser.open" method so that it will launch in the user's browser20:49
seg|arsAs you can see, using WebKit makes interaction a little bit more complex, but you get a tremendous amount of control over how content is presented20:50
seg|arsand it's great for rapid development because it's often easier to write HTML than to build a real Gtk+ UI20:50
seg|arsnow for some questions before we finish up20:50
seg|arsQUESTION: How do I refresh a webkit display?  Say a website pane that displays the weather.20:50
seg|arsThe WebView has a reload method that you can use to get it to refresh the current contents20:51
seg|arsIf you wanted to do it on an interval, you would use something like gtk.timeout_add20:51
seg|arsand then you could just call the refresh every time the timeout hits20:51
seg|arsIf you are setting the HTML yourself, refreshing will cause the contents to disappear20:52
seg|arsso if you are using your own html, you just have to set the content with load_html_string every time you want to refresh it20:52
seg|arsQUESTION: can you embed JS too? You mentioned JQuery, what about JS?20:53
seg|arsYes, it works just like JavaScript in a regular web page20:54
seg|arsif you are generating your own html, you can include a script block that defines JavaScript functions20:54
seg|arsyou can also externally cause the WebView to run any arbitrary JavaScript code by using the "execute_script" method20:54
seg|arsif you pass it javascript code in a string, it will just work20:54
seg|arsYou can seen an example of how I use JavaScript with Mako in the Gwibber navigation bar: http://bazaar.launchpad.net/~gwibber-committers/gwibber/trunk/annotate/head%3A/ui/templates/navigation.mako20:55
seg|arsQUESTION: In Gwibber for example, how do you attach the latest content? Reload everything or you just add the new info to the end? Is the 2nd option possible?20:56
seg|arsIn Gwibber, we regenerate the entire stream. We do that primarily because we need to update the timestamps in addition to adding new messages20:56
seg|arsif you wanted to just add a new bit of content at the top, for example, you could actually do that with javascript20:57
seg|arsin the very early days of gwibber, we would take the message data and convert it into a json string which was then passed to a JavaScript function in the HTML20:57
seg|arsthe JavaScript function would process the json, generate the HTML for the message blocks, and then inject that directly into the page20:57
seg|arsThat approach proved to be a bit difficult and slow with highly complex data, but I think it would probably work better now20:58
seg|arsWebKitGtk+ was quite brittle a few years ago when I first started using it20:58
seg|arsit's a lot more robust today and it's javascript handling is more reliable20:58
seg|arsQUESTION: Since all these frameworks are undergoing rapid development, how do I keep my new application from breaking in a month?20:58
seg|arsthat can be very difficult. One of the biggest problems we have had in Gwibber is that WebKitGtk+ is a moving target and different versions render things in slightly different ways20:59
seg|arsif you are going to be targeting a wide range of distros including some with very old webkit, you will need to keep the html VERY simple and avoid using scripting20:59
seg|arsit has stabilized a lot, so it's not as much of a problem as it used to be20:59
=== 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
=== Edwin_ach is now known as Edwin_ACH
Edwin_ACHhi jcastro do you know if there is exist a irc log about past classes?21:19
ausimageyes21:19
ausimagethere are linked from the schedule21:20
Edwin_ACHthanx ausimage!! Where can I find them?21:20
ausimagehttps://wiki.ubuntu.com/UbuntuOpportunisticDeveloperWeek21:20
ausimageclick on the session and it takes you to a log21:20
Edwin_ACHthank you ausimage!!! I have found them :)21:22
ausimagecool21:22
Edwin_ACHthank you for the links ausimage!!!22:55
ausimagenp22:55
Edwin_ACHfor people like you, Ubuntu is going on growing!!! :)22:55
Edwin_ACHbye...22:55
ausimage:D22:55
=== ecanto_ is now known as ecanto

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!