=== Jamie is now known as Guest22062 === ecanto_ is now known as ecanto [06:05] I 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 Matlab [06:18] kayve: Have you tried asking in #ubuntu? === 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 [14:08] nice [14:30] hey mhall119|work [14:31] did you see the identi.ca and twitter accounts? === Quintasan_ is now known as Quintasan [14:45] nope [14:45] what are they? [14:46] @ubuntuclassroom? [15:09] yes [15:09] mhall119|work: http://chrisjohnston.org/2010/ubuntu-classroom-identi-ca-twitter === 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 [16:01] howdy all [16:01] anyone here to hear about Testdrive for the Opportunistic Developer Week? [16:02] alrighty [16:02] couple people, good enough for me [16:02] so my name is Dustin Kirkland, an Ubuntu Core Developer on the Server Team [16:02] in particular, I look after Ubuntu's virtualization and cloud computing packages [16:03] but I'd also like to think of myself as an opportunistic developer too ;-) [16:03] this session is about Testdrive, which I hope is interesting to you for two reasons ... [16:03] 1) it was totally developed opportunistically ;-) [16:03] 2) it can be used to help you test/develop your own opportunistic apps [16:04] so who here has some helper scripts that they wrote or borrowed from someone else, living in their $HOME/bin dir? [16:04] well, those are often good targets of opportunity for sharing, IMHO [16:04] and that's sort of how Testdrive came about [16:05] kvm is a really powerful program [16:05] with lots and lots and lots of options [16:05] http://manpages.ubuntu.com/manpages/lucid/en/man1/kvm.1.html [16:05] but i tended to use the same ones over and over again [16:05] for a few reasons ... [16:05] they made my VMs run faster, better, etc. [16:06] so i wrote a little shell script i called mykvm that added those options automatically for me [16:06] as turned out, though, this could be really useful for other people [16:07] particularly people who don't terribly want to learn lots and lots about virtualization and kvm [16:07] but just want to quickly launch a throwaway VM [16:07] perhaps boot a live cd in a vm, test something, then discard it [16:07] about the same time, lots and lots of people started complaining about karmic [16:07] "omg the colors are ugly... this is broken... that is broken... etc. etc. etc." [16:08] but this stuff had been in the pipeline for months [16:08] anyone of those very vocal individuals could have tried Ubuntu any time in the last 6 months [16:08] reported bugs [16:08] and perhaps gotten some of them fixed [16:08] so Testdrive was born [16:09] as a way to "testdrive" the latest daily Ubuntu ISOs [16:09] using rsync/zsync to incrementally download the day's image [16:09] run it in a vm [16:09] perhaps install, perhaps not [16:09] and throw it away when done! [16:10] what started out as a way to scratch my own itch ended up helping lots of people [16:10] and solving a different problem [16:10] and after Lucid releases, you'll be able to continue testdriving MM, OO, PP, etc. while still running Lucid ;-) [16:11] so there's a couple of steps along the way ... [16:11] of course i created a project and a team in Launchpad [16:11] http://launchpad.net/testdrive [16:11] http://launchpad.net/~testdrive [16:11] loaded the source code up into bzr [16:11] pushed to a public branch, GPLv3 [16:11] packaged it (this is important if you want people to install your program!) [16:12] pushed to PPAs (backported to Hardy, Intrepid, Jaunty, Karmic, Lucid) [16:12] and eventually got it into Ubuntu universe for Lucid [16:12] (PPAs for the rest) [16:12] now, shortly after I released the initial version working with KVM, people came along and said [16:12] "I like it, but I can't use KVM ..." [16:13] and thus it grew arms and legs [16:13] to use VirtualBox and Parallels [16:13] and there's a VMWare patch under development [16:13] this is community driven efforts, now [16:14] with people like popey and others contributing bugs, features, patches, fixes, etc. [16:14] so that's a bit about the history of the development of testdrive so far [16:14] i see a question .... [16:14] QUESTION: What % of Karmic bugs were hardware support vs strictly software? [16:15] I have no idea what the percentage is, but I'll address the spirit of your question .... [16:15] obviously there are limitations to what can be tested in a VM [16:15] but there are tons of things that still can be tested in a VM! [16:16] actually, when I demo'd testdrive at UDS Dallas, sconklin of the Ubuntu kernel team said ... [16:16] "crap dude, if this testdrive thing takes off, people aren't going to test on their real hardware as much any more" [16:16] i reckon that's true to some extent [16:16] so at the end of running testdrive, there's now a question that ask you: [16:17] Launch USB Startup Disk Creator for further testing of this ISO? [y/N] [16:17] :-) which was sconklin's suggestion [16:17] QUESTION: "...testdriving MM, OO, PP etc." what those stand for? [16:17] MM, OO, PP are whatever the releases after Lucid Lynx might be ;-) [16:18] multimorphing minataur [16:18] um [16:18] meh, whatever mark comes up with :-) [16:19] QUESTION: How successful is a VM for testing strictly hardware bugs? [16:19] a VM can be used for some things [16:19] like USB devices [16:19] you can "passthrough" USB devices to VMs [16:19] like a web cam [16:19] or a 3G modem [16:20] i often pass my Palm Pre cell phone through to a vm [16:20] so ... using Testdrive to do your development/testing ... [16:20] if you're already on Lucid, it's just "sudo apt-get install testdrive" [16:21] if you're on Jaunty/Karmic, grab it from the PPA at http://launchpad.net/testdrive [16:21] if you're on Hardy/Intrepid, well, it'll work, but there's a few limitations [16:21] basically, the linux virtualization stack has evolved rapidly in the last ~1 year [16:22] so ... get testdrive installed [16:22] you'll need run either kvm or virtualbox [16:22] i tend to recommend kvm if you have hardware that can run kvm [16:22] and fall back to VB only if you have to [16:23] once testdrive is installed, you can run either from the command line or from the Applications -> System Tools -> Testdrive menu [16:23] if you run with no options, you should be prompted with a menu of Ubuntu releases [16:23] this is just a concise list of perhaps the most popular ISOs [16:23] (arguably) [16:23] you can choose one of these [16:24] or enter your own url [16:24] actually, from the command line, you can use: [16:24] testdrive -u any_iso [16:24] where any_iso can be a local path [16:24] or http, ftp, or rsync [16:24] and it doesn't have to be ubuntu [16:24] it can be debian, fedora, windows, whatever [16:25] well, i don't much about windows [16:25] but it should theoretically work :-) [16:25] QUESTION: How much RAM is recommended for VM to use testdrive? [16:26] if you have >1G of memory, testdrive will give 512M to the guest [16:26] else if you have > 750MB, testdrive will give 384M to the guest [16:26] else it will give 256M to the guest [16:26] which is basically what's required to run a live cd iso [16:27] so i'd say you need >256M of memory :-) [16:27] actually, this was one of the first reasons i created that old mykvm script [16:27] kvm defaults to 128M of memory [16:27] which ain't much :-) [16:27] i *always* gave my VM's 512M [16:28] so i created a bash alias, which eventually turned into a script to add virtio networking and virtio disk [16:28] oh, another thing about the evolution of that code ... [16:28] it started out as shell script [16:28] which is fine and dandy for prototyping [16:28] but if you want to do something more complex [16:28] and you want to work with other people on the code [16:28] ie, "collaborate" [16:29] shell can be difficult ;-) [16:29] so I re-wrote it in python [16:29] i'm sure you've heard a lot about python this week [16:29] i'm no expert, but it's easy to learn, and a very friendly language [16:29] QUESTION: What exactly do you expect users to test? [16:29] well, it's both a test and a development tool, actually [16:30] from a test perspective ... [16:30] some of you probably saw the new ubuntu theme posts this week? [16:30] new colors and windows and stuff like that? [16:30] great for testdriving [16:31] or perhaps packages in ppas [16:31] that you're not willing to put on your primary desktop [16:31] which might even be running Lucid, as in my case [16:31] there's some stuff that even core developers are risk adverse too :-) [16:32] but you can also install to the vm's disk [16:32] reboot the vm, etc. [16:32] we use that for server testing all the time [16:32] i'd say software wise, you should be able to test almost anything [16:32] you know, the stuff people are going to complain about after release :-) [16:32] its actually *really* easy to test it now, before release, in a vm [16:33] kirkland: I thought testdrive was meant to test hardware, drivers and other stuff [16:33] not really .... [16:33] are you thinking of checkbox? [16:33] QUESTION: When updating a testdrive snapshot, is the entire distro downloaded or diff files? [16:33] testdrive tries its best to download incrementally [16:34] if the url is a rsync:// url (all of the ones in the default menu are), it uses rsync against the iso [16:34] which can really improve your download by incrementally downloading the parts of the iso that have changed [16:34] if you use http or ftp, it tries to use zsync [16:34] which requires a zsync file on the server end [16:34] ubuntu images are typically published with a zsync file [16:35] but if you're pulling images from else, they may or may not be there [16:35] 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] possibly a flaw in the naming of the package ... [16:35] it's really meant as an easy way to "take the next ubuntu release out for a test drive" [16:36] in the same way you might roll up to the chevy dealership and ask to take the new Corvette out for a spin ;-) [16:36] so from a development perspective, i often use testdrive for a pristine environment [16:36] of course there are other ways of doing this [16:37] chroots, etc. [16:37] but for various reasons, a VM can be advantageous [16:37] it more closely mimics the end user's environment [16:37] QUESTION: How much KVM do we need to know? Can you recommend a quick start guide for KVM? [16:37] to use testdrive? none at all, hopefully [16:38] that's the goal of testdrive, to mask the creation and tear down of the VM from you entirely [16:38] you just tell testdrive where your target ISO is, and it puts that into a VM for you to play with [16:38] if you want to learn about KVM, well that's a different story [16:38] :-) [16:39] https://help.ubuntu.com/community/KVM [16:39] that's as good of a starter as anywhere [16:39] http://manpages.ubuntu.com/manpages/lucid/en/man1/kvm.1.html [16:39] manpages are good too [16:39] but, for instance ... [16:39] i'm testdriving an iso right now [16:39] ps -ef | grep kvm [16:40] kirkland 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 es1370 [16:40] if you know the kvm magic, you could easily construct that line yourself [16:40] -m 1024 -> give the vm a gig of memory [16:40] -cdrom is the path to the locally cachced iso image [16:40] -drive ...virtio... loads a virtio disk [16:40] which is really fast, by the way [16:40] this is a sparse qcow2 image [16:41] created by kvm-img create -f qcow2 [16:41] which testdrive also did for you [16:41] -usbdevice tablet improves the mouse experience, letting you move in and out of the window a bit better [16:41] virtio networking [16:41] and a sound card, so that you can hear the vm's sound [16:41] there's similar work done for virtualbox too [16:42] makes the experience similar [16:42] 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] hmm, it would be much better to just boot the existing installed virtual HDD and sudo apt-get dist-upgrade ;-) [16:43] QUESTION: Can testdrive be used for testing/benchmarking server edition and server applications? [16:43] absolutely! [16:43] well, testing [16:43] benchmarking is a little tougher in a vm [16:43] though it can be done, with certain caveats [16:44] QUESTION: For instance, if I want to test apps from Hardy to Lucid? [16:44] well, a couple of things ... [16:44] you could start by testdriving a Hardy server iso [16:44] install to the virtual hard disk, add your apps [16:44] verify that they install there [16:44] then live upgrade from Hardy -> Lucid in the vm [16:44] (that'll take a while, depending on your bandwidth) [16:45] then see if your apps are still working as they were in Hardy [16:45] oh, and you could save your hardy image off to the side [16:45] or use qemu snapshot [16:45] so that you can roll back and forth [16:46] Almost like cloud computing. [16:46] well, similar, i suppose [16:46] in that cloud computing builds on virtualization === w1nGNUtz is now known as w1ngnutt [16:46] Ubuntu Enterprise Cloud is really just a collection of KVM vm's [16:46] (and a lot of management software that makes that work) === w1ngnutt is now known as w1ngnut [16:47] stuff much more complicated than testdrive, I assure you ;-) [16:47] and it's good for that [16:47] so you can branch the testdrive source code very easily [16:47] bzr branch lp:testdrive [16:47] it's just a relatively simple python script [16:48] you're welcome to hack on it, submit bugs, and branches and patches :-) [16:48] scratch your itch [16:48] or model your own project on bits and pieces of testdrive if you like [16:48] QUESTION: Can you save state in a snapshot? (like a suspend/hibernate) [16:48] you sure can! [16:48] here's how ... [16:48] if you're running a kvm [16:49] click inside of it [16:49] and press [16:49] ctrl-alt-2 [16:49] this will put you into the qemu monitor [16:49] it's like a little shell running below the vm [16:49] you can talk to the hypervisor here [16:50] in there, type: [16:50] savevm /tmp/path_to_snapshot.img === w1ngnut is now known as w1ngnutt [16:50] this will take a few minutes to complete [16:50] well, depending on the size of your memory and delta from the last state [16:51] QUESTION: I want to experiment with XEN VM on one of my machines. Will testdrive work with XEN? [16:51] not currently [16:52] no plans to do so (by me) [16:52] good patches accepted :-) [16:52] 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] thanks === w1ngnutt is now known as w1ngnutz [16:53] guys, i think that's about all from me [16:53] scratch your itch ;-) === 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 [18:50] Hi === 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 [19:02] ahh! [19:02] hey all! [19:02] sorry some nick problems there [19:02] I am a numpty! [19:03] ok folks, if in Lernid and on Lucid - click Event -> Tweet this session :) [19:03] ok lets get started [19:03] how is everyone today?! [19:04] hi all! my name is Jono Bacon and I am the Ubuntu Community Manager [19:04] welcome to my Lernid showcase session [19:04] the 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 apps [19:04] so, what is Lernid? [19:05] many 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 is [19:05] who is using Lernid to view this now? [19:05] give me a o/ in the chat channel if you [19:05] are [19:06] sweet! :) [19:06] that makes me smile [19:06] ok, 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/Lernid [19:07] click the Session tab to see the web pages as I post them [19:07] about 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 better [19:07] to 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-chat [19:07] it went down really well and lots of new folks joined our community [19:08] we then created Ubuntu Developer Week: a similar event but more specifically aimed at technical topics and packaging work in Ubuntu [19:08] QUESTION: How much beer did it cost you? [19:08] none :) [19:08] QUESTION: How much beer did it cost you? [19:08] oops [19:08] we have done this every cycle for three years, but a few things niggled me about it - namely: [19:09] (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 join [19:09] (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 :P [19:09] (3) IRC is very static - it is just text, and delivering other content, particularly visual content is difficult [19:10] for 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 session [19:10] on 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:11] I 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] this 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.jpg [19:12] what 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] * the name of the event [19:13] * a link to an ical file which contains the details about each event [19:13] * the start and end times for the event [19:13] * the classroom IRC channel [19:13] * the chat IRC channel [19:13] and..... [19:13] *drum roll* [19:13] * a webpage that describes the event [19:14] this 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 to [19:14] the window was divided into the three areas and embedded three webkit widgets - this is a module you can use to display web pages [19:15] at first I embedded the freenode web IRC interface and pointed it at the relevant IRC channels [19:15] the 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.jpg [19:15] to 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 feeds [19:16] I 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 times [19:17] this 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 applied [19:17] I then added notification bubble support so a little notify-osd bubble pops up when an event is starting and 10mins before an event started [19:18] to 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 happen [19:18] the next step in my head was to add support for slides [19:19] my thinking was that if we could deliver slides in a session it could really raise the interactivity of a given session [19:19] I was really keen to make it really simple for session leaders to provide slides, so I wanted them to be able to provide a .pdf [19:19] then ideally Lernid could display the slides one at a time [19:20] the way this works is that a slide can be triggered in lernid by the session leader typing in [SLIDE 1] [19:20] this will then display the very first slide [19:20] the session leader then just specifies the slide number and slides appear in real-time in Lernid [19:20] for this to work, a 'Slides' line is added to the ical feed [19:20] this points to a location where the pdf lives [19:21] please folks, don't flood -chat [19:21] I will wait until the spamming stops [19:23] so 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 window [19:23] simple as that [19:24] I forgot to mention that in the meantime I wanted to make the IRC panes a lot more native - embedded freenode webchat pages sucked [19:24] so, 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 support [19:25] so 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 widget [19:25] at this point I kicked out a release and people started using Lernid for actual events [19:26] I then wanted to have real-time webpages load [19:26] we already had an embedded web browser, so I just added a listener for websites that start in http [19:26] this would then grab the URL and feed it to the webkit based webbrowser [19:27] I added an additional combo box and reload and back buttons to allow people to look at previous pages and controls them a little [19:27] with this, I kicked out a release [19:27] I now considered Lernid mostly completed for what I wanted [19:27] the next step was to make it available in everyone's language [19:28] David 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 Lernid [19:28] I added this functionality and tweeted a call for translators [19:29] within a few hours it was fully translated into 16 languages [19:29] you can see the list of translations at https://translations.edge.launchpad.net/lernid [19:30] Rosetta 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 translate [19:30] David gave a session a few days back on how to hot rod your app for translations, so I recommend you check out the log [19:30] now the project was moving along swiftly [19:31] people were really interested in it and it was used for real events [19:31] we then had a patch to add a terminal view - http://farm5.static.flickr.com/4049/4409336512_cc6c658a6e_o.jpg [19:31] with Lernid being used a lot for computer-related events, it made sense [19:31] the terminal is embedded using the python-vte module [19:32] it is really simple to use - there is a great example in Acire if you want to use it [19:32] more details on Acire and Python Snippets are at https://wiki.ubuntu.com/PythonSnippets [19:32] at 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 else [19:33] I 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 replacement [19:33] Michael Budde [19:33] mbudde to us all [19:33] that man is a total, total rock star [19:34] he brought so much quality and value to Lernid, and taken much of my shonky code and written it right :) [19:34] mbudde has brought a new level of detail and polish to the app and done a great job [19:34] if you would like to contribute to Lernid, be sure to ping him, I am sure he would love to talk to you [19:35] the 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.jpg [19:35] I had this idea that when a session is running there should be a one click way to tweet, dent, Facebook it etc [19:35] fortunately, Lucid ships with the rocking Gwibber API [19:36] this makes microblogging from your app *really* simple [19:36] again, there is a snippet that explains how to do this in Acire - see https://wiki.ubuntu.com/PythonSnippets for details [19:36] it is literally about three lines of Python [19:36] this is a great way to spread the word about events and much more [19:37] so 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 of [19:37] any questions? [19:38] QUESTION: is lernid used outside of Ubuntu Weeks? [19:38] quappa1, it sure can be, and is :) [19:38] QUESTION: for Lernid, how much did you use Glade,and how much GUI code did you have to write yourself? [19:39] mhall119: it uses Glade extensively - some GUI code that needs to be written (such as the treeviews) is in there [19:39] QUESTION: Does Learnid have special tools to session leaders? [19:39] w1ngnutz, not yet, but it is planned I believe [19:40] QUESTION: PLans to add audio and video? [19:40] w1ngnutz, no idea, I think it is technically possible, but incredibly complex [19:41] in my view, Lernid is awesome because it is low bandwidth [19:41] so people in developing nations as an example, can connect [19:41] Does acire have a simple text search to look for say "gwibber" in python-snippets? [19:42] not yet, it is planned - but it does list snippets by category [19:42] 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] raven_99, I wrote the first cut in a few days [19:42] to get it to where it is - I would say a few months of spare time work [19:42] not a lot of time by any stretch [19:43] QUESTION: How many coding hours (roughly) are spent on Lernid so far? [19:43] difficult to tell, I would say up until the point where slides were added (including slides) - probably about 20 hours [19:43] QUESTION: How many lines of code in Lernid so far? [19:43] no idea, mbudde can let you know that [19:43] QUESTION: you have more ideas for e-learning/e-teaching stuff like this? [19:44] w1ngnutz, indeed, but most of my key ideas are now in Lernid [19:44] one of the challenges that Lernid will face is that it is a haven for ideas, but we should never comprimise the simplicity of Lernid [19:44] the whole point is that it is really easy to use [19:44] :) [19:46] before I finish [19:46] one final thing [19:46] when I announced Ubuntu Opportunistic Developer Week, I announced a challenge too [19:47] http://www.jonobacon.org/2010/02/25/the-grand-app-writing-challenge/ [19:47] the basic goal is to write some apps this week and I am writing up a blog entry to report progress [19:47] I am writing this blog today, so if you have app you wrote this week that you want features, email me ASAP with the details [19:47] jono AT ubuntu DOT com [19:47] I am writing the blog in the next few hours [19:48] QUESTION: did you get a lot of entries already? [19:48] yep, some great entries :) [19:48] and finally, don't forget that a great place to join the opportunistic developer community in Ubuntu in #ubuntu-app-devel on freenode [19:48] come and join us, unlock your creativity with writing cool apps and have lots of fun too :) [19:48] ok, folks, thanks for joining me! [19:49] have a wonderful weekend! === 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 [20:01] Hello! [20:01] I'm going to be discussing application development with WebKit [20:02] For 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 renderer [20:02] WebKit is lightweight and easy to embed, which makes it useful for integrating HTML rendering capabilities into conventional desktop applications [20:03] There is a Gtk+ variant of WebKit that uses Cairo for drawing and can be used seamlessly in standard Gtk+ and GNOME programs [20:04] It's really easy to use if you want to display a web page in your application [20:04] but it's also increasingly useful for building rich user interfaces [20:05] If you want to present content in more dynamic way in your application, HTML can sometimes be a very compelling shortcut [20:05] Making a custom Gtk+ widget can be hard, but writing HTML is very easy [20:06] Gwibber, my open source microblogging client, uses WebKit and HTML for several aspects of its user interface [20:06] http://s3.amazonaws.com/scrnshots.com/screenshots/225884/gwibber-230png [20:07] The main message stream in Gwibber is rendered with HTML, allowing us to have sophisticated theming [20:07] But 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 WebKit [20:08] WebKit supports some really sophisticated CSS features that make it conducive to interface design [20:09] For example, it supports CSS gradients, transparency, reflections, and even animated transitions [20:09] You can see several of those features in the previous screenshot [20:11] The Gtk+ port of WebKit is maintained by the WebKitGtk+ developers: http://webkitgtk.org/ [20:11] the port is under very heavy active development and is gaining new features with every release [20:12] Some of the key stakeholders in the porting effort recently gathered for a hackfest where they worked on some key improvements [20:12] You can find more details about the hackfest here: http://arstechnica.com/open-source/news/2010/01/webkitgtk-hackfest-improves-html-renderer-for-gnome-apps.ars [20:13] They are adding a lot of great HTML5 features, such as HTML5 video playback via GStreamer. [20:14] You can use WebKitGtk+ in several different programming languages thanks to the availability of bindings [20:14] Python is my programming language of choice, so that's what we will be using for the code examples during this session [20:15] The Python bindings are available through the PyWebKitGtk project: http://code.google.com/p/pywebkitgtk/ [20:16] The lead developer behind that project recently halted activate maintenance, so those bindings will not be used much in the future [20:16] PyGi, which provides Python bindings to Gtk+ libraries through GObject-introspection, will be used in the future [20:16] PyGi is already largely usable, but it wasn't quite mature enough yet for us to use in an LTS release [20:17] As such, Gwibber still uses the conventional PyWebKitGtk+ bindings in Lucid but will be using PyGi in the next major release [20:17] Fortunately, 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 later [20:18] In our first code example, you can see how to instantiate a WebKit widget and embed it into a Gtk+ application: http://gist.github.com/323077 [20:19] The line "web = webkit.WebView()" will create the WebKit renderer [20:19] You can use the WebView widget's "open" method to cause it to load a web page [20:20] in the example, the WebView is embedded in a ScrolledWindow so that the user can scroll around the content [20:20] Notice 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 crash [20:21] That code snippet is all you need if you just want to embed a web page in your application [20:21] But there are also many cases where you want to generate the HTML yourself, like we do in Gwibber [20:21] to make the WebKit renderer display your own HTML, you use the load_html_string method. [20:22] web = webkit.WebView(); web.load_html_string("

test

", "file:///") [20:22] The first parameter is an HTML string that you want to display in the renderer [20:22] The second parameter is the base path that you want to use for the html content [20:23] specifying a specific base path can be useful if you want to include images or other content in the html using relative paths [20:23] When you use WebKit to make a user interface, there are several tricks that you can use to make the experience more seamless [20:23] This code example demonstrates several of those tricks: http://gist.github.com/323080 [20:24] By default, an image that is embedded in a WebView widget can be dragged around the screen and out of the program [20:24] You can actually see this in action if you open up the software center and start dragging the big icons in the main pane [20:24] That's obviously an undesirable behavior in a regular user interface [20:24] Fortunately, WebKit has a custom CSS attribute for controlling that behavior [20:25] if you set "-webkit-user-drag: none;" on your images, they will not be draggable [20:25] we had to do that to avoid issues in the Gwibber navigation bar [20:25] Another similar issue is that all content in a WebView is selectable, just like text content in a browser [20:26] that might not be desirable on something like a button label [20:26] when you want to inhibit text selection of content in a WebView, you can apply "-webkit-user-select: none" in the css [20:27] You can see both of those in the code example that I pasted [20:27] If you run that code, it will display a button with a shiny gradient and an icon [20:27] The user-select and user-drag CSS attributes are used to make it so that the icon can't be dragged or text-selected [20:29] When you use WebKit in a Gtk+ application, you will probably want to make it use colors from the user's Gtk+ theme [20:29] we do that for the navigation elements in Gwibber so that they fit better with the rest of the program [20:29] for example, it's really important to make sure that the background of the web page matches the color of the user's gtk window background [20:29] You can see how to do that in the last code example [20:30] In the HTML, we use string interpolation so we can programmatically set a custom value for the page "background" attribute [20:30] In the Python part of the code, you can see a line where we get the background color and assign it to the "bgcolor" variable [20:31] You can extract style information from any gtk widget by using w.get_style() [20:31] to get the background, we do "w.get_style().bg[gtk.STATE_NORMAL]" [20:31] The state part tells Gtk+ what state you want to get the color from [20:31] if you wanted to get the selection color, for example, you could use gtk.STATE_SELECTED [20:32] In addition to "bg" you can also get the foreground ("fg") and text colors ("text") [20:32] QUESTION: What does WebView refer to exactly? Rendering of any url, or any piece of html code? I'm confused. [20:33] The WebView is a WebKit rendering widget. It's like an HTML renderer that you can plop into a Gtk+ application [20:33] you can use it to load either a remote url or to display any specified html content [20:34] ok, back to the color setting [20:34] In 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 data [20:35] when we apply the html, we use "html % bgcolor", which will replace that "%s" with the actual value of the bgcolor variable [20:36] if 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 replacement [20:36] In Gwibber, we needed even more control over the html [20:36] we use a template engine called Mako that lets you generate HTML with bits of code interspersed [20:36] You can learn more about Mako here: http://www.makotemplates.org/ [20:37] Mako is really great for theming because you can create a set of programmable templates that can be inherited and overridden [20:37] In 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 feel [20:38] This is what the Gwibber base template looks like: http://bazaar.launchpad.net/~gwibber-committers/gwibber/trunk/annotate/head%3A/ui/templates/base.mako [20:39] You can also do some programming in the HTML itself [20:39] in Gwibber, for example, we use the jquery library to make it so that the user can expand grouped messages. It has a nice animated transition [20:39] Using jquery in embedded HTML can be really useful for building a rich UI [20:40] One 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 program [20:40] you want your program to be able to respond to click events inside of the html [20:41] In our code example (http://gist.github.com/323080) we use navigation events to do that [20:41] You can see that the button in the html is wrapped in an "a" tag that points to "program:/test" as its URL [20:42] What 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 prefix [20:42] in the code example, the on_click_link function gets bound to the "navigation-requested" event [20:43] web.connect("navigation-requested", on_click_link) [20:43] what 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 called [20:44] In the Python function, we analyze the URI to see if it starts with "program:/" [20:44] when it does, we look at what the rest of it says and then we perform whatever action [20:44] you 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 do [20:45] for example, in Gwibber, clicking the reply icon in a message bubble will load the url "gwibber:/reply?msg=${msgid}" [20:46] The template library is used to replace the ${msgid} part with the actual id of the individual message [20:47] when 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 parameter [20:47] QUESTION: navigation-requested is a webkit event, right? [20:47] yes, navigation-requested is a webkit event [20:47] By 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 WebView [20:48] in 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 browser [20:49] You 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 browser [20:50] As you can see, using WebKit makes interaction a little bit more complex, but you get a tremendous amount of control over how content is presented [20:50] and it's great for rapid development because it's often easier to write HTML than to build a real Gtk+ UI [20:50] now for some questions before we finish up [20:50] QUESTION: How do I refresh a webkit display? Say a website pane that displays the weather. [20:51] The WebView has a reload method that you can use to get it to refresh the current contents [20:51] If you wanted to do it on an interval, you would use something like gtk.timeout_add [20:51] and then you could just call the refresh every time the timeout hits [20:52] If you are setting the HTML yourself, refreshing will cause the contents to disappear [20:52] so if you are using your own html, you just have to set the content with load_html_string every time you want to refresh it [20:53] QUESTION: can you embed JS too? You mentioned JQuery, what about JS? [20:54] Yes, it works just like JavaScript in a regular web page [20:54] if you are generating your own html, you can include a script block that defines JavaScript functions [20:54] you can also externally cause the WebView to run any arbitrary JavaScript code by using the "execute_script" method [20:54] if you pass it javascript code in a string, it will just work [20:55] You 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.mako [20:56] QUESTION: 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] In Gwibber, we regenerate the entire stream. We do that primarily because we need to update the timestamps in addition to adding new messages [20:57] if you wanted to just add a new bit of content at the top, for example, you could actually do that with javascript [20:57] in 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 HTML [20:57] the JavaScript function would process the json, generate the HTML for the message blocks, and then inject that directly into the page [20:58] That approach proved to be a bit difficult and slow with highly complex data, but I think it would probably work better now [20:58] WebKitGtk+ was quite brittle a few years ago when I first started using it [20:58] it's a lot more robust today and it's javascript handling is more reliable [20:58] QUESTION: Since all these frameworks are undergoing rapid development, how do I keep my new application from breaking in a month? [20:59] that 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 ways [20:59] if 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 scripting [20:59] it has stabilized a lot, so it's not as much of a problem as it used to be === 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 [21:19] hi jcastro do you know if there is exist a irc log about past classes? [21:19] yes [21:20] there are linked from the schedule [21:20] thanx ausimage!! Where can I find them? [21:20] https://wiki.ubuntu.com/UbuntuOpportunisticDeveloperWeek [21:20] click on the session and it takes you to a log [21:22] thank you ausimage!!! I have found them :) [21:22] cool [22:55] thank you for the links ausimage!!! [22:55] np [22:55] for people like you, Ubuntu is going on growing!!! :) [22:55] bye... [22:55] :D === ecanto_ is now known as ecanto