=== abiss is now known as abiss27 === callaghan_ is now known as callaghan [15:55] Allright, we're about to start the 3rd day of Ubuntu App Developer Week, is everyone ready? [16:00] All right, let's get started! [16:00] Welcome to the 3rd day of Ubuntu App Developer Week === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: App Developer Week - Current Session: Unity Mail: Webmail Notification on Your Desktop - Instructors: mitya57 [16:01] Logs for this session will be available at http://irclogs.ubuntu.com/2011/09/07/%23ubuntu-classroom.html following the conclusion of the session. [16:01] Our first speaker has developed a really slick app to check your webmail directly from your desktop. Welcome Dmitry Shachnev who's going to tell us all about Unity Mail! [16:01] mitya57, I'll leave the room for you now [16:01] So, let's start [16:01] I'm Dmitry Shachnev, currently student at Moscow University [16:02] I am developer of Unity Mail, [16:02] ReText (retext.sf.net), [16:02] TQ Educational suite (tq-suite.sf.net) and some other things [16:03] Since my first distro was Mandriva, I'm also known as Mandriver [16:03] Unity Mail is an application that displays unread messages count on your Launcher, [16:04] as well as Notify-OSD notifications [16:04] and mail subjects in Messaging Menu (this is currently only for Oneiric) [16:05] It works with any IMAP4 or IMAP4-SSL server, not only with GMail as some people think [16:05] It also support multiple accounts [16:05] *supports === Lethalman_ is now known as Lethalman [16:06] It's written in Python and uses GObject-Introspection, [16:06] I'll say more about this later [16:07] Three days ago I released the new version, 0.8 [16:07] (the Natty backport will come soon, too) [16:07] It has Messaging Menu integration and new configuration dialog [16:08] Screenshot: http://ubuntuone.com/4VNpTopZZxmGN2fyXY4ZmD [16:08] It's also the first release working on Oneiric [16:08] So, now about used technologies [16:09] GObject-Introspection (http://live.gnome.org/GObjectIntrospection) is a new GNOME framework [16:10] for accessing C-language API in many languages, [16:10] such as Python, Vala, and so on [16:11] In Ubuntu, Python bindings are provided by python-gobject package [16:12] The most known component is Gtk API, [16:12] which allows working with both Gtk2 and Gtk3 [16:12] It's recommended alternative for PyGtk, [16:13] read more about porting here: http://live.gnome.org/PyGObject/IntrospectionPorting [16:13] But there are many other bindings, [16:14] You can use any API provided by gir1.2-* packages [16:14] Here is Unity Mail's import string: [16:14] from gi.repository import GObject, GLib, Gtk, Unity, Notify, Indicate [16:15] The last three are Ubuntu-specific technologies, so let's speak more [16:15] about them [16:16] Unity Launcher API provides a way to set a count badge or a progress-bar [16:17] for a specific .desktop file [16:17] https://wiki.ubuntu.com/Unity/LauncherAPI [16:17] This page contains an overview and code examples for Python and Vala [16:18] Indicate API [16:18] It provides a way to add an indicator to your panel, or integrate [16:19] with existing menu (Messaging Menu in my case) === ejat is now known as fenris === fenris is now known as Guest40004 [16:20] I used this page as a documentation: [16:20] http://www.kryogenix.org/days/2011/01/16/working-with-the-ubuntu-messaging-menu === Guest40004 is now known as ejat [16:21] Note that UM doesn't make that envelope blue or green, it just add some items [16:21] If you want to add your items to Messaging Menu, [16:22] you'll need to set up a server (basically the container connected to a .desktop file_ [16:22] and any number of clients (entries) [16:23] Each entry can contain a time (which'll be displayed like "30 min" or "2 h") [16:23] or just a number (count), i.e you can add a client titled "Inbox" with a mails count [16:24] Time in UM case [16:24] Then, Notify API [16:24] You SHOULD NOT use pynotify because it is based on Gtk2 and is deprecated [16:25] Gir-Notify usage is very simple, like this: [16:25] Notify.init('unity-mail') [16:26] Notify.Notification.new(title, message, icon).show() [16:26] You can see more advanced-usage examples in 'tests' directory [16:26] of libnotify tarball [16:27] And there is one another important component - GNOME Keyring [16:28] Currently there's no Gir for it - wait a moment, I'll find a bug about that [16:29] It's https://bugs.launchpad.net/ubuntu/+source/libgnome-keyring/+bug/802173 [16:29] and https://bugzilla.gnome.org/show_bug.cgi?id=598414 for upstream [16:29] so we use python-gnomekeyring binding, [16:30] which is the only reason for us not moving to Python3 [16:30] Also, it adds a Gtk2 dependency, so I really don't like it [16:31] You can read more about it here: [16:31] http://blogs.codecommunity.org/mindbending/bending-gnome-keyring-with-python-part-1/ [16:32] Credits to Andre Ryser who added GNOME Keyring support to UM [16:32] Now a bit about translations [16:32] UM uses gettext for translations and Launchpad for hosting them [16:33] Also, it uses desktop2gettext script to generate .po (source) files from .desktop files [16:33] (There are actually 2 desktop files used in UM: [16:34] The main, that displays in Launcher, and another one which is copied to your [16:34] ~/.config/autostart/ directory and is used for auto-starting Unity Mail) [16:35] http://bazaar.launchpad.net/~chromium-team/chromium-browser/chromium-translations-tools.head/view/head:/desktop2gettext.py [16:35] (Originally it was developed for Chromium) [16:35] More about gettext: http://docs.python.org/library/gettext.html [16:36] More about using Launchpad for translating your project: https://help.launchpad.net/Translations/YourProject [16:37] There were even 2 sessions about this in previous AppDeveloperWeek [16:38] And also we use Bazaar for hosting code. [16:39] Now - some future plans for Unity Mail [16:39] You know why Unity Mail is better than other mailing clients [16:40] (like Thunderbird and Evolution) [16:40] First, it's written especially for WebMail services [16:41] When you click it's icon your mail is opened in a web browser [16:41] It uses GMail links by default, but you can set your own in the new configuration dialog [16:41] You can even set a custom command by starting the URL with 'Exec:' [16:42] dpm, I plan to release 1.0 firstly [16:42] dpm asked: have you thought about submitting Unity Mail for inclusion in Ubuntu? [16:42] And I'll release it when there will be a gir for gnomekeyring [16:43] and I'll be able to use Py3K [16:43] So, some ideas for future versions: [16:44] - More configuration options, like disabling Messaging Menu [16:44] or even Unity Launcher :) [16:44] - "Mark all as read" option [16:45] - (I don't yet know if it's possible) - Opening a mail when you click on it in the Messaging Menu [16:46] - And it really needs a new icon, maybe someone will help me with it? [16:47] So, I think, that's all [16:47] Please ask your questions [16:50] There are 10 minutes remaining in the current session. [16:51] gnomie asked: if i decided to give UM a try, will it conflict with thunderbird (which is already set up)? [16:51] gnomie no, it won't === jelmer_ is now known as jelmer [16:52] If I have another five minutes, I'll advertise my another app - ReText editor [16:53] It's an editor for markup languages, such as Markdown and reStructuredText [16:53] It allows you to control all your formatting and storing documents in plain text files [16:53] But it supports export to ODT, PDF, HTML and whatever you want via plugins [16:54] Also it can upload documents to Google Docs [16:55] And it supports tabs, which is very useful feature [16:55] Screenshot: https://sourceforge.net/p/retext/screenshot/retext.png [16:55] Web-site: http://retext.sourceforge.net/ [16:55] There are 5 minutes remaining in the current session. [16:55] It's available in my PPA, too (ppa:mitya57) [16:59] thanks mitya57 for a great session! [16:59] So, good bye (= [17:00] Next up, Jelmer Vernooij will tell us all about using Launchpad for creating build recipes to rapidly get your packages to users === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: App Developer Week - Current Session: Launchpad Daily Builds and Rapid Feedback: Writing Recipe Builds - Instructors: jelmer [17:00] Logs for this session will be available at http://irclogs.ubuntu.com/2011/09/07/%23ubuntu-classroom.html following the conclusion of the session. [17:01] Hello! [17:02] My name is Jelmer Vernooij. I currently work in the Bazaar team at Canonical, and before that I worked on Launchpad. [17:02] This app developer week session is going to be about source package recipe builds. [17:02] I am going to assume that everybody here is familiar with at least basic Debian packaging. If you are not, the Ubuntu packaging guide is a great start. See http://developer.ubuntu.com/packaging/html/ [17:03] You should also have some familiarity with a distributed version control system. Recipe builds on Launchpad use Bazaar. A quick introduction about Bazaar can be found at http://doc.bazaar.canonical.com/latest/en/mini-tutorial/ [17:03] Please do interrupt me with questions if you have any. [17:04] Today we are going to create a basic recipe for a small project. I have a project in mind (pydoctor), but if somebody has other suggestions I am also happy to do another project (nothing like living on the edge and doing this live). [17:04] Does anybody have a suggestion for a project that doesn't take too long to build? [17:05] Source package recipes are, like cooking recipes, a description of a set of ingredients (branches in this case) and a description of how to meld them together. [17:06] The result of a recipe is usually a Debian source package. [17:07] You can write and build recipes locally by installing the "builder" plugin for Bazaar ("apt-get install bzr-builder"). This is quite convenient when writing and testing recipes. [17:08] Launchpad can also build recipes for you, and can directly upload the resulting source package to a PPA. [17:08] It can do this a single time, or you can have it build the recipe daily (as long as one of the branches involved in the recipe has changed). [17:09] This makes it very easy to do daily builds of a project, because Launchpad can automatically grab the source code out of the upstream version control system, as long as Launchpad can import from the upstream version control system. [17:11] Once a recipe has been set up your PPA will automatically receive new packages, fresh from trunk, every day. [17:11] Does anybody have a suggestion of a project we should create a recipe for? [17:14] I guess not, so let's go with pydoctor (a API documentation generator for Python). [17:14] Every recipe has a "base" branch> This is usually the trunk of the upstream project you're building. [17:14] In our case, it would be lp:pydoctor [17:16] The upstream project does not contain any Debian packaging metadata, so we will also have to merge that in. [17:17] There happens to be a Debian package for pydoctor, so I have created an import of the Debian packaging branch on launchpad - https://code.launchpad.net/~jelmer/pydoctor/unstable [17:17] The last thing to consider is the version string. As we create the source package from multiple branches, we don't want to just use the version in the last changelog entry of the packaging branch. [17:18] If we did, that would mean that if the upstream branch changed and a new source package would be built, that source package would have the same version string (but different contents). [17:19] To work around this, bzr-builder will automatically add a new dummy changelog entry indicating that a recipe build has been done, with a new version. [17:20] TO give you a concrete example, let's look at the pydoctor recipe: https://code.launchpad.net/~jelmer/+recipe/pydoctor-daily [17:20] You can see the recipe text at the bottom of the page below "Recipe contents" [17:21] As you can see, the first line describes the version string that will be added to the changelog. [17:22] The second line contains the "base" branch, in this case lp:pydoctor [17:22] and the third line specifies that the lp:~jelmer/pydoctor/unstable branch should be merged and can be identified by the string "debian". [17:23] The version string will be "0.3+bzr" followed by the last revision number of the base branch, then a tilde and then the revision number of the packaging branch. [17:23] You can see how the identifier for the third line comes in handy here. [17:25] "merge" isn't the only supported command; other options are "nest" and "nest-part". There also more variables available to use in the version string, such as {time} which will contain the current time. See https://help.launchpad.net/Packaging/SourceBuilds/Recipes for a full list. [17:26] if you put the contents of the recipe in a local file, you should be able to build it with bzr-builder. [17:26] For example, if you name this file "pydoctor.recipe" you can use: [17:26] $ bzr dailydeb pydoctor.recipe build-pydoctor [17:26] this will create a source package in the build-pydoctor directory. [17:28] It is generally a good idea to test recipes locally first before adding them to Launchpad. That way you don't have to wait for a slot in the build queue, and you save build resources on Launchpad. [17:30] Did that work for everybody? [17:35] once you have a working recipe, you can register it on Launchpad by clicking the "Create packaging recipe" link on the branch page of one of the branches involved. [17:36] There you'll have the chance to specify when the recipe should be built, what its instructions are, and what PPA should be targetted. [17:38] It is possible to specify what Ubuntu releases a recipe should be built for. Of course, you will need to make sure that all of the build dependencies of your package are available in those releases (or your PPA dependencies). [17:38] After you have created a recipe, the page should look roughly like the one for my pydoctor recipe (https://code.launchpad.net/~jelmer/+recipe/pydoctor-daily) [17:39] If you have indicated that a recipe should be built daily, it will usually be built quickly after you update one of its branches. [17:40] Are there any questions so far? [17:47] As I mentioned earlier, more information can be found on the Launchpad help pages: https://help.launchpad.net/Packaging/SourceBuilds [17:48] There is also a list of existing recipes that are in use on Launchpad, https://code.launchpad.net/+daily-builds [17:49] as you can see, we have about 400 that build on a daily basis [17:50] That's about all I had. If you have questions about recipes, please ask them now or otherwise you can always find me on this network under the nickname "jelmer" [17:50] If you don't feel comfortable with recipe builds just yet, I can also recommend Matthew Revell's video cast about source package recipe builds. [17:50] http://www.youtube.com/watch?v=_bG-SXNX9Ww [17:51] There are 10 minutes remaining in the current session. [17:52] Thanks for your attention, happy hacking! [17:55] There are 5 minutes remaining in the current session. === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: App Developer Week - Current Session: Using the Ubuntu One APIs for Your Apps: An Overview - Instructors: aquarius_ [18:00] Logs for this session will be available at http://irclogs.ubuntu.com/2011/09/07/%23ubuntu-classroom.html following the conclusion of the session. [18:01] Hi, all! [18:01] I'm Stuart Langridge, from the Ubuntu One team, and I'm here to talk about our app developer programme. [18:01] Do please ask questions throughout the talk: in the #ubuntu-classroom-chat channel, write QUESTION: here is my question [18:02] We want to make it possible, and easy, for you to add the cloud to your apps and to make new apps for the cloud [18:03] This is your personal cloud we're talking about here; your data. Not an enterprise cloud sort of thing :) [18:03] So we do all the heavy lifting, and your users (and you!) get the benefits. [18:03] Imagine, for example, you've made a recipe manager application. [18:04] So you can type in all the recipes you like to cook, and you've got a permanent record of them. [18:04] (For me, that would be: get a pizza base; put pepperoni on it. I reckon you can think of better recipes than that.) [18:04] (and: actual recipes, for nice food. Not, like, Launchpad recipes. :) [18:05] Don't really want to take your laptop into the kitchen, though, of course. [18:05] So, build a mobile app which you sign into with Ubuntu One, and have that show all your recipes too. [18:05] And a web app which you sign into with Ubuntu One, so that you can look up recipes while you're at a friend's house. [18:06] So you've got your stuff, wherever you are, whichever device you're on. Ubuntu, Android, iOS, Windows, webOS, whichever you want, your data's in your personal cloud and so it's everywhere for you. [18:06] This is the sort of thing that we want to make easy; giving your users and you quick access to the Ubuntu One technology. [18:07] Mobile access to your data; web app access to your data; saving files direct into Ubuntu One; publishing files and photos from all your apps; adding playlists to the Ubuntu One music streaming app; streaming the user's own music into a game you've written. [18:07] This stuff is all being heavily worked on right now as we speak. [18:07] So this talk won't be too detailed with specifics, because they might change. [18:08] But I'm more than happy to answer questions and so on! And I can probably tell you what I think the specifics are, if they're not already documented at https://one.ubuntu.com/developer/ :) [18:08] I want to give you a flavour of what will soon be possible, and answer questions, and give some pointers, and get your thoughts. [18:09] infodroid asked: you didn't mention desktop access to data... this is the primary use case i am looking at: seamless synchronisation of the user's app on the desktop [18:09] oops :) [18:09] I didn't deliberately leave it out! [18:09] desktop access to data is absolutely part of this [18:09] so you can sync a desktop app's data to other desktops, totally [18:10] and then you get to build web apps or mobile apps or both as well which also share the same data [18:10] Also, this is App Developer Week, so I can talk about what the components we're working on are and then admire all the cool ways you all come up with for snapping them together, rather than waiting for marketing to come up with a "product" for you to use :) [18:11] So, some components that can be snapped together. [18:11] You'll be able to sign in to a web application with Ubuntu One. [18:11] This means that you don't have to manage your own identity system, think about password renewal, all that. [18:11] This is just like "sign in with Facebook" or "sign in with Twitter"; it's OpenID-based, and lets your users sign in to a web app and you'll know their Ubuntu identity. [18:13] infodroid asked: I have reviewd the online docs for API Docs > Data > Store data. However it is not clear what language bindings are available to use. [18:15] infodroid, there are lots, depending on what you're trying to do [18:15] but I know that the developer site doesn't yet talk about bindings [18:16] I'm working on that :) [18:16] Once you've signed in to an app with Ubuntu One, that app can ask for permission to work with your data. [18:16] This lets you, developers, build applications that work on the desktop, on the web, on mobile phones. [18:16] The recipe manager example I mentioned above is one sort of thing you could do, there [18:16] Your users use the nice recipe manager app on Ubuntu, which you've built with Quickly or whatever you prefer [18:16] And then they can go to yourrecipemanager.com and sign in with Ubuntu One [18:16] yourrecipemanager.com then asks them for permission to access their "recipes" database [18:18] and can then show them all their recipes on the web! [18:18] Your app (yourrecipemanager.com) does this via OAuth; it goes through the standard OAuth dance to get an OAuth token which can be used to access the user's recipes data [18:18] And your users can be happy that it's secure, because yourrecipemanager.com will only have access to their recipes data; it can't read their contacts or their credit card info. [18:18] tomalan asked: Is Ubuntu One also available on other Linux Desktop Distros, like Fedora? [18:19] Certainly some people have done some work to package Ubuntu One for other distros [18:19] I think there's an ITP for Debian [18:19] and we've been pinged on #ubuntuone by people interested in putting Ubuntu One on Fedora and Arch [18:20] I don't remember the details, though, so I'm not sure what stage those bits of work are at [18:20] so, I was talking about apps working with your data [18:20] But you can imagine sharing other sorts of data between applications. [18:21] Imagine, for example, an achievements system. [18:21] You write a few games; some on the web, some on mobile phones, some on the Ubuntu desktop, some on Windows. [18:21] And every time the user achieves something in a game, you save that achievement to that user's "achievements" database. [18:22] On Ubuntu, you'd save that "trophy" into a file, and Ubuntu One will take care of synchronising that into the cloud. [18:22] On the web, your game's backend can use the REST API for file access: see https://one.ubuntu.com/developer/store_files/cloud [18:22] On Android or iOS or webOS or Blackberry or Meego or Windows Phone 7 you can do exactly the same thing; every language has an HTTP access library! [18:23] You could even write your own wrapper library for PHP or Rails or Flash or whatever you prefer (and then tell me about it so I can point to the documentation for it!) [18:23] At that point, all your games save achievements to the same place, so all your games can show you the achievements you've won in any game [18:23] And, as before, you can set up yourachievements.com where a user can log in and see all their achievements. [18:23] kermit66676 asked: So, the methods listed on the API documentation pages are all HTTP methods for the one.ubuntu.com server? [18:24] I think the API docs list all the public documented committed-to APIs [18:24] but I'd be interested to hear if there's something the docs don't cover [18:24] paglia_s asked: i'm realizing an implementation of Ubuntu One apis written in php and i've seen that apis are quite slow. Do you plan to improve speed? [18:25] paglia_s, hiya! [18:25] paglia_s, yes, we're working on that, definitely [18:25] and we're also interested in how people are using the APIs [18:26] so that we may be able to add ones which more closely return the information you want === yofel_ is now known as yofel [18:27] There's loads of stuff you can do with shared data. [18:27] But Ubuntu One's not just about data. [18:27] Take the music streaming service, for example. [18:27] You can currently stream music to Android and iPhone, and you'll be able to add that music to the cloud from Ubuntu and Windows. [18:27] Maybe you want to be able to stream music back to your Ubuntu machine without syncing it, or your Mac, or your Palm Pre, or your LG mobile phone, or your toaster. [18:28] So, just use the music streaming API, which is again a simple REST HTTP API, or help people to get at their music by showing them our HTML5 web player for streaming music. [18:28] But there's more interesting ideas around music streaming than just "listen to the music". [18:28] Playlists, for example. The Ubuntu One Streaming apps on Android and iPhone know how to create playlists. [18:29] But how they do that is not a secret. Your playlists are just stored in your cloud databases. [18:29] So, why not sync your playlists from Banshee or Rhythmbox or Amarok or Exaile or Quod Libet or iTunes or Windows Media Player? [18:29] (insert your choice of player here :)) [18:29] Copy the playlists from your media player into desktopcouch on Ubuntu or into the cloud directly with u1couch on Windows or the Mac or anywhere else, in the correct format, and those playlists will instantly show up on your phone! [18:30] A simple example of this is https://code.launchpad.net/~sil/%2Bjunk/m3u2u1ms/ which is a quick script I wrote to take an m3u playlist and store it in desktopcouch on Ubuntu. [18:30] So you can make your Banshee playlists available to the Ubuntu One app on your Android phone by exporting them as m3u and then importing them with the script. [18:30] And of course if you sync your playlists from your media player to Ubuntu One, then you can sync them back from Ubuntu One to your media player. [18:30] What this means is that if you've got two machines -- let's say, a desktop and a netbook -- then creating a playlist on your desktop will automatically also make it appear on your netbook. [18:30] And your netbook can either sync all your music that you store in Ubuntu One (if it's got enough space) or stream that music directly from Ubuntu One without ever syncing it locally. [18:30] Your music, everywhere; but importantly, not just your music but your playlists and scores and ratings and everything. [18:31] If you're interested in bringing this to your music player, let me know and I can help; ask questions now :-) [18:32] paglia_s asked: do you plan to add support for notes, too? Will this support also images/video...? [18:33] paglia_s, I'm not sure what you mean by "support for notes"? [18:35] paglia_s, you already can edit notes synced from tomboy on the website [18:37] jsjgruber_test asked: ​ I can't synchronize my desktopcouch database -- because of 503 service unavailable returns, and I hear that the servers are being worked on for this. Any news about when they will be able to handle the load? [18:38] jsjgruber_test, we're working on that, as you know, but I don't have an answer fo when that work will be completed [18:38] kermit66676 asked: yes, have there been any intentions of making an Ubuntu One gallery viewable online from a Shotwell photo collection? [18:39] kermit66676, interesting idea! If you were thinking of displaying that sort of thing on a website, the rest files API would be a good starting point [18:39] we've had a few ideas ourselves in that sort of area too :) [18:40] so, I was talking about music :) [18:40] Tighter integration is great, here; what we want to do is to make it easy for you all to build the stuff that you want on top of Ubuntu One. [18:40] So if you want to have your Amarok playlists available for streaming, it should be possible to do. [18:40] I rather like the idea of playing a Flash game on the web and having the background music be the most appropriate music chosen from *my* music collection. That'd be cool. [18:40] Ubuntu One also, as you know, does file sync. [18:40] :-) [18:40] But just syncing files is already taken care of by Ubuntu One itself, on Ubuntu and Windows. [18:41] What's more interesting is working with those files. [18:41] So, for example, imagine being able to instantly, one-click-ly, publish a file from your application to a public URL and then tweet that URL. [18:41] Instant get-this-out-there-ness from your apps. [18:41] The screenshot tool Shutter, for example, can do this already; PrtSc to take a screenshot, then "Export > Ubuntu One". [18:41] They did a bunch of hard work to do that, and I massively applaud them; nice one Shutter team! [18:41] Based on what they did, that's the sort of thing that should be easier to do. [18:41] So there are easy-to-use APIs so your apps can do the same. Imagine quickly sharing your newly created image or document or recipe with the world. [18:41] Your app could have a button to "store all my files in the cloud", or "publish all my files when I save them", or "automatically share files that are part of Project X with my boss". [18:43] More to the point, you can work with files directly *in* the cloud. [18:43] So a backup program, for example, could back up your files straight into Ubuntu One and not sync them to your local machines. [18:43] That's exactly what Deja Dup, by the great mterry, does; one of its backup options is "Ubuntu One". So to make sure you've got backups of your machine, just start Deja Dup (which is in Ubuntu 11.10), choose "Ubuntu One" for backups, and that's it; you're done. [18:43] You'll never lose data again; yay for backups! [18:44] Enabling that sort of work in *your* apps is exactly what the Ubuntu One app dev programme is all about; making it easy to add your users' personal cloud to what your app does. [18:44] And of course being able to save things in and out of the cloud means that you can get an Ubuntu One sync solution on other platforms. [18:44] So you could work with your files from your non-Android mobile phone (we've already got Ubuntu One files available in the Android Market, and it's also on Launchpad if you want to look at how it works). [18:44] Build a fuse or gvfs backend for Ubuntu or Fedora or SuSE or Arch Linux. Build a WebDAV server which works with Ubuntu One and mount your Ubuntu One storage as a remote folder on your Mac. [18:45] And web apps can work with your cloud too, for files as well as data. [18:45] Imagine, say, a torrent client, running on the web, which can download something like a movie or music from legittorrents.info and save it directly into your cloud storage. [18:45] So you see an album you want on that torrent site (say, Ghosts I by Nine Inch Nails) and go tell this web torrent client about it (and you've signed in to that web torrent client with Ubuntu One) [18:45] And the website then downloads that NIN album directly into your personal cloud -- which of course makes it available for streaming direct to your phone. [18:45] You could do that with videos as well: choose a torrentable video (say, Beyond the Game, the documentary about World of Warcraft) and download that directly into your cloud, if someone built the web torrent client. [18:45] (Of course, that would be cooler if Ubuntu One offered a video streaming service as well as music streaming, wouldn't it. Hm... ;-) [18:45] But it's not just about your content for yourself; think about sharing. [18:45] Ubuntu One lets you share a folder with people. This would be great for distribution. [18:45] Imagine that you publish an online magazine. [18:45] So, you create a folder on your desktop, and put issues of the magazine in it. [18:46] Then, you put a button on your website saying "Sign in with Ubuntu One to get our magazine". [18:46] When someone signs in, your website connects to the Ubuntu One files API, with your private OAuth token, and adds that signed-in user to the list of people that your magazine folder is shared with. [18:46] Then, whenever your magazine has a new issue, you just drop it into that folder on your desktop. [18:46] (Or even upload it to Ubuntu One directly through the website.) [18:46] All the subscribed people will get the new issue instantly, on all the machines they want it on, and in the cloud. [18:46] You could distribute anything like this. Imagine a podcast, or chapters of a novel. [18:46] It would also work for paid-for content; when someone pays, have your code share a folder with them, and put their paid-for stuff in that folder. That's all doable through the files API. [18:46] We've built the files API itself (an HTTP-based REST API) and also some wrappers for it to make it easier to use in your apps from Python and the like (and we're continuing to enhance it, and this is another place you can contribute; let me know what you want the Files API to do!) [18:47] infodroid asked: i hear that couchdb as a backend for a desktop app is really slow. is this true? are there any strategies to get around this? [18:47] infodroid, we're working on ways to make synced data a better experience for developers [18:48] (In fact I've been in a meeting room today talking about it :)) [18:48] so stay in touch with what we're up to and if you're having problems, be assured that things will get better [18:49] at the moment using couchdb is problematic, we agree; for some people it works fine but there are issues [18:49] we're still working out what it's best to do about that [18:50] There are 10 minutes remaining in the current session. [18:50] staying in touch with what's going on can be done by following the blog (http://voices.canonical.com/ubuntuone/) and we're on twitter as well :) [18:51] and you can hang out in #ubuntuone too; we're a friendly bunch [18:51] and I'm always happy to have someone buy me a beer ;) (Or just drop me an email or ping me on irc to chat about what you're trying to do or hoping to do. I like talking about this stuff, as you may have noticed.) [18:52] OK, I've talked about a blizzard of ideas that'll be made possible, and shown you almost no code. [18:52] However, code is nothing without documentation, and that's really important. [18:52] So, as I mentioned earlier, you want https://one.ubuntu.com/developer [18:52] There you can find documentation for the files and music APIs, and for how to create and manage your Ubuntu One account. [18:52] So there's documentation for all this stuff so all of you clever people can build things that I haven't even dreamed of. [18:52] So, what I'd like to know is: what are your cool ideas? What help do you need from me in making them happen? What do you want to use Ubuntu One for in your apps and your scripts and your work? [18:52] as I say, drop me a line, ping me on irc, tweet at me or at U1 or hang out on irc and tell me what you want to get done, and we can talk about how to do it [18:53] I've got a few minutes fo questions now before you get to hear cool stuff about unity :) [18:55] There are 5 minutes remaining in the current session. [18:55] kermit66676, syncing your shotwell structures is a really interesting idea [18:56] you should already be able to sync the photos themselves -- simply mark the folde with them in as synced with Ubuntu One, and they'll be on all your machines [18:57] syncing shotwell's preferences and so on is more interesting, because it depends how they're stored [18:57] catch up with me another time (I have to leave at the end of this talk :( ) and we can talk it over? [18:58] ok, thanks all! === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: App Developer Week - Current Session: Supercharging Your Apps with Unity Launcher Integration - Instructors: DBO [19:00] Logs for this session will be available at http://irclogs.ubuntu.com/2011/09/07/%23ubuntu-classroom.html following the conclusion of the session. [19:02] Hi everyone, my name is Jason Smith, I am a developer from the Canonical Desktop Experience team (DX for short) [19:02] I'll be giving a talk on supercharging applications with unity launcher integration for the next hour or so [19:03] anyone reading along should feel free to ask questions as they pop into their heads [19:03] First I want to start off by making sure everyone is familiar with the general terminology I am going to be using through this talk [19:04] Unity is (of course) the new shell being developed on top of GNOME for Ubuntu 11.04 and newer [19:04] the Launcher refers to the bar full of icons on the left side of the screen during usage of Unity [19:05] what we have found over the course of the last year is that application developers have desired a better way to display tiny pieces of information to users without doing rather drastic things like popping up alert boxes [19:06] many application authors have resorted to doing things like changing the title of their application to indicate new messages, urgency, or task progress [19:06] so we decided to make those three things in particular an explicit and consistent API for usage with the Unity Launcher [19:08] this API has been included in a library called libunity, and is available in the Ubuntu main repositories, you can also find its source code here: https://launchpad.net/libunity [19:08] Libunity will allow application developers to convey tiny bits of information about their application (or actually any application) they wish with very little work [19:08] we'll look at this piece by piece [19:09] I'll be using Vala as code snippets, but python and C bindings are also available (or anything else that supports GIR) [19:10] The first thing we do with libunity is get a LauncherEntry object [19:10] LauncherEntry objects serve as a control center for a single item on the launcher. They are asyncronous and currently one way (can be used to push information but not to inspect remote state) [19:11] LauncherEntry objects are keyed on the desktop file, so to create an entry for banshee, we would do: [19:11] var launcher_entry = Unity.LauncherEntry.get_for_desktop_file ("banshee.desktop"); [19:12] the resulting launcher_entry will be remotely watched and tracked by the Unity Launcher as soon as it is created [19:12] (there is a caveat here that you must have a running main loop for any communication to work, otherwise it will queue until you run your main loop) [19:13] you may create as many launcher entry objects as you like, for as many different applications as you like in a single program. This is useful for creating applications to bridge public API's between two different programs (say skype where we dont have source code access) [19:14] now that we have a LauncherEntry, we can do 4 different, useful things with it [19:14] 1) Mark or unmark the application as urgent [19:15] 2) Set a count on the object (useful for unread messages) [19:15] 3) Set a progress on the object [19:15] 4) Add quicklist menu items to the object [19:15] Each of these is very simple, so we will just go through them in order, at the end I will post the entire source code for the example program [19:16] Setting our launcher_entry as urgent is as easy as "launcher_entry.urgent = true" [19:17] this state will be immediately communicated over dbus to unity where it will be reflected on the launcher [19:17] setting this back to false will reset the state [19:17] mhr3 asked: aren't there other methods to mark app urgent? shouldn't those be used instead? [19:17] Yes, there are other methods for marking an application as urgent [19:18] these methods are based on window hints applied to the xproperties of a related window [19:18] while these methods are quite useful, and should be preferred when the make sense [19:18] there are some cases where they dont, such as when an application that has no mapped windows still wishes to be marked urgent [19:19] Ubuntu One is an example of such an application [19:19] it will mark itself urgent when the user runs out of space, even though it has no mapped windows [19:20] kermit66676 asked: so there has to exist an .desktop file somewhere? That file has to be included in a deb package by convention? [19:21] In short yes, there must be a desktop file somewhere. This is what the unity launcher considers an "application" [19:21] However, that file does not have to be added by a deb package [19:21] there was a bug last cycle where the daemon responsible for matching wouldn't seen manually added desktop files [19:22] but that has been fixed now [19:22] Libunity also allows users to set a count and a progress very simply, the api is almost identical for this so we'll just do them together [19:23] launcher_entry.count = 1; [19:23] launcher_entry.count_visible = true; [19:23] these two lines of code set the count to 1, then instruct the launcher to actually display the count. The count and its display are decoupled so it can be turned on and off as needed [19:23] similarly, progress can be done as: [19:24] launcher_entry.progress = 0.0; [19:24] launcher_entry.progress_visible = true; [19:24] again, the progress is set to 0, and then made visible [19:25] Trevinho asked: is actually impossible to check if a launcher entry is actually shown in the unity bar and maybe notified when it is there... Is this something planned (or that I can do :) )? [19:25] Currently there is no method for checking the contents of the launcher, this is a planned feature we feel desperately needs fixing :) [19:26] and yes Trevinho, this is certainly something you could do :) [19:26] ask me in #ayatana later and I will help you with the dbus work if needed [19:26] The last major item libunity allows developers to modify the launcher with is the addition of new quicklist items === Ron is now known as Guest738 [19:27] these are done using the dbusmenu library, which has been covered in previous sessions and is fairly well documented, so I will only deal with the basic coupling code required for libunity [19:27] first we need to create a quicklist [19:28] some example code looks a bit like: [19:28] var ql = new Dbusmenu.Menuitem (); [19:28] var item1 = new Dbusmenu.Menuitem (); [19:28] item1.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Item 1"); [19:28] var item2 = new Dbusmenu.Menuitem (); [19:28] item2.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Item 2"); [19:28] ql.child_append (item1); [19:28] ql.child_append (item2); [19:28] this will create a quicklist, called ql, containing two label items [19:28] those items have signals on them you can subscribe to in order to get information about when they are clicked :) [19:28] adding them to the launcher is then as easy as: [19:29] launcher_entry.quicklist = ql; [19:29] This concludes the basic usage of libunity [19:29] unfortunately there are some limitations currently [19:29] and they mostly deal with applications wishing to use concurrent libunity connections [19:30] First, an application wishing to show a state on the launcher MUST remain active. The launcher watches the application on the session bus, and when it dies it reverts any changes it has made to the launcher icons state [19:31] so progress, count, urgent, and menu items all go away if you application dies [19:31] Second, state is currently last write overwrites previous data for multiple connections [19:32] this is very limiting and needs to be fixed, but people should be aware of it in the mean time :) [19:32] mhr3 asked: what is undone when the process which changed something on the launcher disappears? [19:33] The changes go away :) I think I was slow to answer this but if I wasn't clear, yeah, the changes just get reverted :) [19:34] mhr3 asked: any plans with the DockManager spec? :) [19:34] DockManager is a beautiful specification, and I really deeply regret we dont support it [19:34] its very comprehensive and covers a lot of corner cases pretty well [19:35] the one major advantage I think the libunity implementation covers better is it allows multiple consumers AND multiple subscribers [19:35] so you could, in theory, have many docks all listening to the same signals from applications [19:35] this was a shortcoming of dock manager (if I recall correctly) [19:36] kermit66676 asked: how come the Dbusmenu code is not masked using something more intuitive, such as ql = new Unity.Quicklist()? That would make it independent of the underlying technology (even though it might never change to something else). [19:36] I think the thought process is that dbusmenu is used in more places that just libunity (in the indicators for example), so making it a consistent API across the entire ecosystem was important [19:36] oh I forgot to pastebin the program :) [19:37] here we are: http://paste2.org/p/1636674 [19:39] As libunity grows, I hope we can see it used more consistently across the ubuntu desktop. Items in the desktop switcher, nautilus, and maybe the dash will see increased usage of these signals and display the same hints [19:40] anyhow, unless there are more questions, that is about all I got [19:44] rsajdok asked: Why did you choose value instead python? [19:44] Vala is just the language I used in the example [19:44] its all gobject introspection [19:44] so you can use python too [19:45] I picked vala here just because thats what my test program is written in and I didn't feel like re-writing it :) [19:51] There are 10 minutes remaining in the current session. [19:55] There are 5 minutes remaining in the current session. === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: App Developer Week - Current Session: Hello Vala: An Introduction to the Vala Language - Instructors: Lethalman, juergbi [20:00] Logs for this session will be available at http://irclogs.ubuntu.com/2011/09/07/%23ubuntu-classroom.html following the conclusion of the session. [20:01] alright :) [20:01] hi all, I'm Luca Bruno and I contribute to the Vala project [20:01] juergbi is the project leader [20:01] vala is a new programming language with C#-like syntax that compiles to C and targets the GObject type system [20:02] I'm going to introduce the basics and the features of the vala language [20:02] the homepage can be found at https://live.gnome.org/Vala [20:02] you can get the vala compiler with "apt-get install valac", this is likely going to install at least vala 0.12 on an up-to-date system [20:03] so what's good with vala... :) [20:03] vala has syntax support for most of GLib/GObject features like classes/interfaces, properties, RTTI, virtual methods, signals, GValue and GVariant boxing/unboxing, error handling and optionally GIO features like GAsync and GDBus [20:03] it also provides generics, closures, delegates, contract programming, duck typing and some other cool stuff without any additional run-time! [20:04] https://live.gnome.org/Vala/Documentation#Projects_Developed_in_Vala [20:04] these are some applications written in vala [20:04] so, let's start by taking a look at the hello world: http://paste.debian.net/127646/ [20:05] you can compile it with "valac hello.vala" then run it with "./hello" [20:05] args is the well known array of strings passed to the command line [20:05] string[] denotes an array of strings, while "print" refers to "GLib.print" which is static method mapped to g_print() [20:06] in vala you can have namespaces, and GLib is the default namespace [20:06] for reference, the online documentation for GLib can be found here: http://valadoc.org/glib-2.0/GLib.html [20:07] the main() static method is the entry point for applications, it will be executed first [20:07] at the very basics you might want to see what happens behind the scenes... if you want to see the generated C code, compile with "valac -C hello.vala" then read "hello.c" [20:07] vala has most of the basic glib types like int, bool, int16, uint16, float, double, string, structs, enums, flags, classes, interfaces and so on [20:08] so let's take a look at the next example: http://paste.debian.net/127644/ [20:08] we're defining the "Foo" class that extends the "Object" class [20:08] then the "bar" property of type int with automatic getter and setter (you can also define custom getter and setter) [20:08] we have a constructor which takes an int value and sets the bar property, "this" refers to the instance of the class [20:09] in main() we create a new Foo instance and assign it to the local variable foo [20:09] the "var" keyword is meant to exploit type inference, so the type of foo is Foo... useful when you're lazy at writing long types ;) [20:09] you can find other examples of type inference in vala here: https://live.gnome.org/Vala/Tutorial#Type_Inference [20:10] for completeness let me say that the print() method supports printf-like format (man sprintf), so that you can format the arguments to the output very easily [20:10] the first important thing to notice is that we don't manually manage the foo variable lifetime in the example, instead vala does manage it [20:10] vala has automatic memory management using reference counting when possible, so you don't have to manually call ref() or unref() functions for gobjects [20:11] in this case, the foo variable is automatically unref()'d once it goes out of the scope [20:11] for more information about the memory model see both http://developer.gnome.org/gobject/stable/gobject-memory.html#gobject-memory-refcount and https://live.gnome.org/Vala/ReferenceHandling [20:12] what's special in this example is that Foo is a registered GObject class in C and bar is a regular GObject property [20:12] so, if you tell valac to autogenerate the header (valac -H sample.h sample.vala), C applications can use the class directly [20:13] in general, vala performs very well in the interoperability area [20:13] vala can talk to C using vala bindings (.vapi files) without additional run-time [20:13] that is, vala calls C functions directly without the need of any FFI [20:14] in fact .vapi files are just descriptions of the API of C libraries [20:14] e.g. in order to use a foreign package called gtk+-2.0.vapi that is installed in your system, just use valac --pkg gtk+-2.0 yourprogram.vala so that vala compiles your program against gtk+-2.0 and you can use the gtk symbols [20:15] a .vapi file has the same syntax of a .vala file, thus easy to write manually, see json-1.0.vapi (short enough for a pastebin) for example: http://paste.debian.net/127656/ [20:15] don't worry, bindings can also be autogenerated from GIR files ;) (http://live.gnome.org/GObjectIntrospection) [20:16] to generate a somelib.vapi from a gir it's as simple as doing vapigen --library somelib SomeLib-1.0.gir [20:16] that's a little different than python or javascript or... as it's compile-time stuff [20:16] anyway, vala itself ships with many bindings, you can see the docs at http://valadoc.org/ [20:17] ok some more about interoperability then we talk about some cool features :) [20:17] vala is able to autogenerate well-annotated GIR files to be used from other languages like python, javascript, etc. [20:18] that means higher level languages can talk to vala just immediately (just two steps without writing any GI annotation like in C) [20:18] let's see for example: https://live.gnome.org/Vala/SharedLibSample#Calling_vala_functions_using_introspection [20:19] what we do is first creating a test_shared.so library and tell valac to generate testShared-0.1.gir for us [20:19] once you got a gir we're done, it's only a matter of generating a typelib using the GI compiler [20:19] !y [20:19] shazzner77 asked: weird question, but I have a microcontroller that can be programmed in C. Can I use Vala for this? [20:20] that's an hard question as it highly depends on the microcontroller [20:20] most of microcontroller have different C dialects [20:21] but you can use the posix profile to generate non-glib code somehow, but it's mostly an experimental feature... it's usable to some sort though [20:21] so, let's talk about error handling [20:21] vala features error handling on top of GError, with the well known try/catch/finally syntax [20:22] in other words, you can catch errors thrown by C methods... eek! that sounds weird ;) [20:22] this is a simple example: http://paste.debian.net/128329/ [20:22] in the example we try to read a file, if the file doesn't exist (FileError.NOENT) we keep throwing the error, for any other error we abort the program with GLib.error() [20:23] errors in glib are propagated using GError, so vala autogenerates the necessary code to handle that gracefully [20:23] you can define your own error types using "errordomain" like this: http://paste.debian.net/128714/ [20:24] so, this is already a lot of nice features, but that's not all about it! [20:24] some cool stuff about vala is the syntax support for async operations, closures and dbus client/server [20:24] it is possible to define GIO-style async methods and calling other async methods very easily [20:24] an async method returns immediately giving control back to the caller, and when the job is completed a callback is fired [20:25] take a look at the first example here: http://live.gnome.org/Vala/AsyncSamples [20:25] the "async" keyword in front of list_dir() marks it as being a GIO-style coroutine [20:25] yield dir.enumerate_children_async() will pause the method, then it will be resumed once there's a result... that's amazingly simple [20:26] (in the meantime, thanks to nemequ for doing a great work in -chat :P) [20:26] also notice in the main() method (which is not an async method) that we used a closure to be notified when list_dir() completes its job [20:26] list_dir.begin() will initiate the async operation, then when the job is complete we free the resources with list_dir.end() [20:27] closures are an important feature of vala compared to raw C [20:27] a closure (or lambda expression, or ...) is a method created on-the-fly that shares the scope of the parent method (main() in this case) [20:27] this is very very useful for callbacks for which you need to pass user data [20:27] in fact, in the example the "loop" variable is used within the closure, but it's defined outside the closure [20:27] the general syntax for defining lambda expressions is (param1, param2, ...) => { ... body here ... } [20:28] the types of param1, param2, ... automatically match the parameters of the target type [20:28] in this case the target type is AsyncReadyCallback which is a delegate type (i.e. a type that accepts methods) [20:28] here's the definition of AsyncReadyCallback: http://www.valadoc.org/gio-2.0/GLib.AsyncReadyCallback.html [20:29] it takes two parameters, an Object and an AsyncResult... that's why we used (obj,res) => { ... } in the example [20:30] kermit66676 asked: I noticed there is no #include directive when using a library in Vala - doesn't that make things messy in bigger applications with a lot of packages - you have to watch out not to repeat class names from some other libraries? Or use namespaces all the time... [20:30] if I understood the question correctly... when you compile a project you feed to valac all the .vala files at once [20:30] valac file1.vala file2.vala ... [20:30] for what concerns collision with existing names, yes namespaces are used for that [20:31] but applications or libraries written in vala usually have their own namespace, that's the best practice [20:31] mjaga asked: is valac part of the gcc family? [20:32] no it isn't, it's a self-hosted compiler on its own [20:32] but valac uses the C compiler as it produces C code [20:32] it's very slim and compiles fast, most of the time spent on compiling is usually due to the C compiler [20:33] vala lets the underlying C compiler optimize things... [20:33] so... the async stuff is very powerful when combined with dbus :) [20:34] we can call dbus methods (well, a property in this case) in a such simple way: http://paste.debian.net/128341/ [20:34] methods of UPower would have suspended your workstation, so :P [20:35] the interface in the example is a way for vala to generate proxy calls to the dbus interface [20:35] the "can_hibernate" property is mapped to the dbus property org.freedesktop.UPower.CanHibernate [20:35] what we do here is starting the async upower_query() operation, which will asynchronously connect to the system bus and request a proxy for UPower [20:35] afterwards we request the value of the "can_hibernate" property... bool.to_string() is an helper method defined by vala, you know what it does :) [20:36] vala automatically does dbus serialization of values when doing dbus stuff (the bool property in this case), even for the most complex types [20:36] this is about client code, but you can write dbus servers by just writing normal class methods [20:36] take for example this server code: http://paste.debian.net/128754/ [20:37] and the following client snippet to query the server: http://paste.debian.net/128756/ [20:37] compile the server with "valac dbusserver.vala --pkg gio-2.0" and the client with "valac dbusclient.vala --pkg gio-2.0" [20:37] so you can start the server with ./dbusserver and then invoke the client multiple times with ./dbusclient [20:38] if everything goes well, on the client you should see a counter increasing on each call [20:40] notice: as said in -chat not _all_ of the complex types, there might be some bug/limitation but you can use GLib.Variant manually as well [20:40] in this case we assumed the client didn't know the server codebase, otherwise we could share the same interface definition and let the server class implement it [20:42] server side we do some other stuff for acquiring the name, registering a callback when it's available [20:43] so, this vala integration is very important as our desktops are leading toward async and dbus more and more [20:43] there are several projects that massively use such advanced features of vala successfully [20:43] after this low level stuff we can take a look at some GUI with GTK+: http://live.gnome.org/Vala/GTKSample [20:43] reference docs for gtk3 can be found here: http://valadoc.org/gtk+-3.0/index.htm [20:43] the "using Gtk;" statement on the top means that the Gtk namespace is merged in the file [20:44] therefore we can use "new Window ()" instead of "new Gtk.Window ()", and so on [20:44] also notice window.title = "First GTK+ Program"; [20:44] window.title is a gobject property, we saw them in the first hello world example [20:44] in this case vala will generate the C code for calling gtk_window_set_title (GTK_WINDOW (window), "First GTK+ Program") properly [20:44] in the example we can also see the button.clicked.connect() call: it's used to connect to the "GtkButton::clicked" signal! [20:45] the first argument is the callback that will be fired when the signal is emitted [20:45] you can also specify a method (static method or instance method) as the signal callback, not only a closure [20:45] I've written an equivalent code here without the use of a closure: http://paste.debian.net/128743/ [20:45] yeah, it's more typing without closures ;) [20:46] as you can see writing gui with vala is very simple, and you can take advantage of async operations for doing I/O without blocking the GUI! [20:46] so now we're connecting to a signal, but in vala defining signals is as easy as putting a "signal" keyword in front of a method declaration [20:46] an example of signal definition can be found here: https://live.gnome.org/Vala/Tutorial#Signals [20:47] in that code we defined a full gobject signal named "sig_1" with an int parameter... like properties, signals can be used from C as well as higher level languages [20:47] and emitting the signal is as simple as calling a normal method: t1.sig_1 (5) [20:48] ok now let's talk a little about generics [20:48] generics in vala are similar to C# or Java generics [20:48] they are used to restrict the type of data that is contained in a class, both at compile-time and at run-time (no type erasure) [20:48] for example let's use GList, which is a glib structure for doubly linked lists: http://paste.debian.net/128737/ [20:49] the type List will define a list whose elements are of type string [20:49] then we append to strings to the list, and print them [20:49] the foreach statement is another neat feature of vala, allowing to iterate through the elements of a collection [20:49] the syntax is simple: foreach (element_type variable_name in container_expression) { ... } [20:50] in this case we used "var" as element type to exploit the type inference [20:50] roughly speaking, in this case vala will infer the element type from the generic type of the container which is "string" [20:50] There are 10 minutes remaining in the current session. [20:50] mhr3 asked: there's this nice syntax to read/write gobject properties, are there any plans to have similar support for widget style properties? [20:51] well, not that I know of [20:51] anyway while the properties defined in a class are known at compile-time, not necessarily style properties (or child properties...) are known at compile-time [20:52] so it may lack some type checking... if you have a clear idea you can feature request it :) [20:53] you can also define your own complex types using generics like the first example here: https://live.gnome.org/Vala/Tutorial#Generics [20:54] glib offers several data structures already, but there's also libgee that provides a collection library that is written in vala and widely used [20:54] libgee is more vala-friendly and has data structures such as TreeMap, PriorityQueue, HashSet, HashMultiMap, etc. [20:54] the reference docs for libgee can be found here: http://valadoc.org/libgee-0.7/index.htm [20:55] ok... we're almost done :) [20:55] vala comes with libvala, which is a library for parsing and analyzing the vala code and generating code... [20:55] There are 5 minutes remaining in the current session. [20:55] despite the libvala API is not stable, there are many users of it like IDEs, documentation tools, code generators, etc. [20:56] for generating documentation for you projects you can use valadoc: https://live.gnome.org/Valadoc [20:56] there're lots of other neat features like lock statement, inheritance, virtual/abstract methods and properties, etc. that we didn't mention... [20:57] or experimental features like chained expressions: foo < bar < baz < mama [20:57] or regex literals like in perl: /.../ will create a GLib.Regex [20:57] if you want to know more the tutorial at https://live.gnome.org/Vala/Tutorial is a good start... and the community is wide and very active ;) [20:58] ok that's all, thanks everyone :) [20:59] ok suggested from -chat to mention our community is on the mailing list vala-list@gnome.org and on #vala on irc.gimp.org [21:00] Logs for this session will be available at http://irclogs.ubuntu.com/2011/09/07/%23ubuntu-classroom.html === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||