=== Mrokii_ is now known as Mrokii === zumbi is now known as _ === _ is now known as Guest45422 === zumbi_ is now known as zumbi [12:01] where can I find this channel's history? [12:01] !logs [12:01] For Ubuntu Classroom logs, please visit http://irclogs.ubuntu.com [12:02] thank you very much :) [14:58] Two minutes til start time... === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: When and how to schedule releases using Launchpad - Instructors: mterry [15:00] Looks like 14:00 UTC. Welcome to the "When and how to schedule releases using Launchpad" talk! [15:01] I've got some prepared notes that I'll go through, but feel free to ask questions in #ubuntu-classroom-chat [15:01] First a quick background of who I am. I'm Michael Terry, I work in the Desktop team at Canonical. But more relevant for this talk, I've maintained several projects in the past. I have maintained some small apps (xpad, gmult) as well as an app that has become more popular (deja-dup). [15:01] So I'll talk a bit about release management, different ways of scheduling releases, and a bit about how to use Launchpad to help with that [15:02] There are two common release strategies: feature based and time based. I've used both, sometimes on the same project at different times. [15:02] Feature based tends to be the strategy most application developers use when starting personal projects. You're just hacking away by yourself until it's functional. Then you release. [15:03] Maybe next you get some bug reports or an idea for a feature, and you hack away again until that new feature is done or some common crash bug is fixed. Then you release. [15:03] This is a pretty common cycle and is very good for getting stuff out the door. It's simple, easily understood, and only requires that you be able to decide what features or bugs a release will wait on. [15:03] Of course, you need agreement about what the release criteria are, but I'll get to that later [15:04] Another popular method is a time based release schedule. This is where you say, I'm going to make a new release every month, or every 3 months, or whatever. [15:04] This method is in vogue for many of the big open source projects, like Ubuntu, Fedora, and GNOME. [15:05] It makes it easy to plan releases with lots of moving parts and developers, since the schedule and release criteria are obvious to everyone. [15:05] Lots of joiners. Were you all interested in this talk? Should I briefly recap? [15:06] OK, moving on until I see some complaints [15:06] As for pros and cons... [15:06] I find that when I'm using a feature based schedule, I have a habit of making changes until the last minute and potentially introducing bad bugs. This tends to happen because the release can happen any time after the last feature gets committed [15:07] That's when I end up making 'brown paper bag' followup bug fix releases (i.e. you were a brown paper bag over your head in shame). [15:07] That's one benefit of the time based schedule: you can plan 'baking' time into your schedule and say, "no more feature work during the last month. Just bug fixes." [15:08] Of course, you can do this with feature releases too and just say that after the last feature is done, you'll just sit on the code for a month. But in practice, I find that doesn't happen. [15:08] But feature schedules are useful too. I generally prefer feature based releases for the first 6 months or year of a project. That's when the most churn happens and you have less users affected by potentially less careful releases. [15:09] It lets you iterate very fast on often incomplete code. I recommend it for most starting/small/personal projects. [15:10] If you do choose a time based schedule, don't make it stressful one. Most projects seem to use 6 months, and that's about right. Maybe with monthly checkpoint releases. And most of the feature work front-loaded. [15:11] But whatever, it's a matter of personal preference and what works for you. I've got a link to a really fascinating Ph.D paper studying how different projects have used different schedules, analyzing optimal cycle lengths for time based projects, and the like. http://www.cyrius.com/publications/michlmayr-phd.html [15:11] Any questions? Or is 14:00 UTC too early? :) [15:13] I've used feature releases early on several of my projects then switched to time based as it became popular, more polished [15:13] Time releases are very good for making sure regressions don't appear (easier for testers to plan on releases) [15:14] And generally good for a project in 'maintenance mode'. You can still add big features, it may just take more than one cycle to finish landing it [15:14] Especially once you get more contributors than just yourself, it really helps to have a common schedule [15:15] It can be frustrating as a maintainer to be holding a release for a feature from someone else in this inherently asynchronous development style that FOSS projects have [15:15] With time releases, they either get it in on time or not, but the release can go forward [15:16] Also, I highly recommend the Ph.D paper link I gave earlier if you're interested in this stuff. It's very interesting reading (once you get to the findings part) [15:17] OK, on to a quick introduction of Series and Milestones! [15:17] However you decide to release, Launchpad has some simple tools to make keeping track of planned work. Namely, Series and Milestones. [15:18] Series are just separate 'branches' of development. Say you release version 14 of your software and start work on version 15. Now you need to be able to separate maintenance work on 14 from new feature work in 15. [15:18] If a critical bug is found in 14, you want to be able to keep track of that fact and keep a snapshot of 14's code around to make it easy to make further bug fix releases from it. [15:19] That's what Series do. They're a place to keep code and bugs separate from other series. [15:19] If you want to play around with Launchpad's series or milestones, open https://staging.launchpad.net/ [15:19] It's a testing version of launchpad where they throw away any modifications each day [15:20] So you can screw around and create a project, add series and milestones, etc. [15:20] Just to get a feel for it [15:20] Anyway [15:20] Milestones are just planned releases. You may create a milestone for release 15 ahead of time and then you can mark bugs to be fixed by that release. Milestones are associated with a particular series. [15:21] I usually find it most convenient to keep a trunk series always around where I do development, and when I release a new stable version, to create a new series for its maintenance lifecycle. [15:21] This is called a trailing series. Each release gets spun off after I finish it in trunk. [15:22] You can also have leading series, where you create a separate unique series for your next release ahead of time. [15:22] I don't find this nearly as convenient, as a developer, but your mileage may vary [15:23] You can also mark series as obsolete once you're really done with them (say, you've released a newer stable release) [15:23] That way they won't show up in the UI. Otherwise, you'd be drowning in series [15:24] You can see an example of a more complicated series layout with my project deja-dup (https://launchpad.net/deja-dup/+series). You can also see that I used to use feature releases until version 14, when I switched to track GNOME's time based releases. [15:24] And right now, trunk is where the next version (18) is being developed [15:25] If you're using feature releases, you don't *need* to take full advantage of milestones. You really probably just care about the next unstable and next stable releases. So one 'future' milestone fore each series is fine. [15:26] But if you've got big plans and a whole project roadmap based around features (like 1.0 will have X, Y, and Z, but along the way, 0.5 will mean X is done, 0.7 will mean Y is done, etc), that can be useful [15:27] The projects I've seen try to do that never hit their targets and always push features back. Again, it's a lot more reliable to use time based releases, if you're going to be doing all that release planning overhead anyway. [15:27] Features still get pushed back, but you didn't promise features, only a timely release. ;) [15:28] For time based releases, I like to set up all the releases ahead of time as milestones so it's easy to keep track. I'll often assign bugs that I know I want to finish during this cycle to the last milestone, and adjust that milestone when I actually implement it to the actual release in which it got fixed. [15:28] Milestone pages on Launchpad are very nice. They tell you what bugs were/are targeted for the release and what their status is. Let me dig up a URL [15:28] https://launchpad.net/deja-dup/16/15.92 [15:29] So here you can see that there were 6 bugs I targeted for the release, the release notes, etc. Also useful when planning a future milestone, so the whole team can see what bugs the maintainer wants to see fixed for that release [15:30] For a nice overview of some of this same material, there's actually a nice LP help page: https://help.launchpad.net/Projects/SeriesMilestonesReleases It talks about leading/trailing series and how to set milestones up too. [15:31] That's all the prepared material I had. I've got *so* much time for your questions about the exciting field of release management! [15:32] Join #ubuntu-classroom-chat and ask questions like "QUESTION: what's the meaning of life, the universe, and everything?" [15:33] Again, I just want to pimp the case study done on several FOSS projects and their release methodologies. It's fascinating stuff! http://www.cyrius.com/publications/michlmayr-phd.html [15:34] I'll hang around a bit, in case anyone wakes up. If you see this talk in your chat logs later and want to talk release-shop, just grab me on IRC sometime or in person at UDS in Orlando [15:39] jledbetter_ just reiterated in the chat room that coding up to release can be dangerous. One way to mitigate that is automated tests. Which is a whole 'nother talk. But... [15:39] If you do have test-driven coding, so that features and tests land at the same time, you can be slightly more confident with feature-releases [15:40] Of course that requires good discipline, and even tiny changes that you don't think need a full test can break things unexpectedly right before a release [15:41] One thing you could do if you really like feature releases is do a 'testing/alpha release' before each release to let people test it and report back [15:42] But generally, smaller projects don't have enough of a community to do that. So I'd say if you're project is small/new, just pump out dangerous feature releases while you are energized and coding like a monkey, until you stabilize, then use time based releases [15:46] jledbetter_ asked: Just to be clear, I can do all kinds of experimentation with https://staging.launchpad.net/ and it'll go away nightly? [15:47] jledbetter_, Yup. It's pretty neat. I don't know when the cutoff is. 00:00 UTC? But it resyncs from the main instance every day or so [15:47] It's also pretty slow... [15:48] But it's a good way to experiment with some Launchpad button if you don't know what it will do first. :) [15:52] Alright, thanks everyone. Hope it was useful! I expect to see many more well-released projects keeping track of things using proper series and milestones! :) === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Pollka and the Ubuntu Women Mentoring Partnerships - Instructors: elky, nigelb [16:01] Hi folks! [16:02] * nigelb waves [16:03] hi all [16:05] Some of you might remember earlier this year when the Ubuntu Women team ran some competitions. [16:06] These competitions involved voting, and that voting was collected by a little bit of php that I whipped up over the course of a few mornings. [16:07] This code is what has become Pollka, and which was also used recently by AlanBell for the Ubuntu-UK logo selectoin [16:08] Currently the code resides on Launchpad, https://launchpad.net/pollka [16:09] Pollka is a relatively new project and we only have a few active committers. The aim of making pollka a project is to facilitate mentoring, using launchpad tools, etc. [16:11] ok, so pollka is a php application as elky said [16:11] it stores some information in a database, we are using mysql, but other databases should also work or be fairly easy to plug in [16:12] as it is a voting application on a set of images these also need to be stored somewhere, and we store them on the filesystem [16:12] there are both full size images and thumbnails [16:12] lets take a quick look at a running pollka instance [16:12] http://pollka.libertus.co.uk/ [16:12] this is the voting system we used in the UK loco for our new logo [16:13] we put up an assortment of design proposals and voted on the one we liked the best [16:13] I had a bit of fun hacking about with the code, thus the options were "full of win" for pictures you like and "meh" for those you don't like [16:14] part of the point of Pollka is a learning project to hack about with, not a shiny packaged solution where you don't look under the covers [16:14] so installing Pollka starts with getting the code, it is stored on Launchpad in a bzr repository [16:14] launchpad and Ubuntu work really really well together (unsurprisingly) [16:15] so to get the code you would run [16:15] bzr branch lp:pollka [16:15] you might need to install bzr first with sudo apt-get install bzr [16:16] another way to get the code is to use the most awesome groundcontrol project by doctormo [16:16] this is also in the repositories so you can look up groundcontrol in the software centre [16:17] then in /home/myname/Projects in nautilus you can get a project and it will download a copy of pollka for you [16:18] the file db.sql in the repository is a kind of starting database structure [16:18] you can import that into mysql to create a bunch of tables in the right places [16:18] I installed phpmyadmin and imported it through that because I suck at command line stuff [16:19] phpmyadmin is a web based interface to mysql and it makes things really easy [16:19] lets see, I wonder if I can let you have a play with it . . . [16:20] yes, OK [16:20] so I am going to let you log on to my server (which is sitting on top of the bookshelf behind me) [16:21] you will be logging in as the pollka user, so I don't think you will be able to damage anything other than the already closed logo vote [16:21] http://pollka.libertus.co.uk/phpmyadmin [16:21] username polka [16:21] nope [16:21] username is pollka [16:21] password is dmQdLQwsbunjtqwj1 [16:21] you might want to copy and paste that one [16:22] on the left you can click the pollka database and see the tables [16:22] everyone there? [16:23] right, everyone is poking about successfully [16:24] if you click on the browse icon next to the conf table you can see various bits of configuration [16:24] feel free to tweak bits, like the site status or the poll name [16:25] have a look at what it dose [16:25] does [16:25] oh noes some hacker has hacked it :) [16:26] have a look at the questions table [16:26] here we list the options available [16:26] I kinda misused the question_author field [16:27] as my poll didn't really have different authors for the 'photos' [16:27] I also hacked about with the image field because the thumbnails are .png files and you click to get the .svg which wasn't in the original poll design [16:28] ok, prevotes [16:28] so, flip back to the front of the site and cast your vote [16:28] what this does is populate the prevote table with a random key and the options you selected [16:29] you will then get an email (from me because of what is set in the conf table) [16:29] on that email will be a link with the random token in it [16:30] when you go to the token URL in the mail the token.php.active page will look up the votes in the prevote page and copy them to the votes table [16:31] there is a certain amount of anonymisation, in the voter table we have the timestamps and IP addresses and email addresses, these don't link directly to the votes cast [16:31] which is kinda good in some ways to voting geeks, but a bit of a drawback if you want to deal with someone who voted twice or something [16:32] it does check on submit that the email is unique [16:33] ok, lets go prod some code now [16:33] https://code.launchpad.net/~pollka-devs/pollka/trunk [16:33] of course if you have ideas on how to improve this, we're happy to help you implement [16:34] on that page you can see a summary of the bzr repostitory [16:34] at the bottom you can see that 8 revisions have been made by different people [16:34] bzr keeps all the versions in check and deals with branches and merges so you can have multiple people working on the code and they don't get in each others way too much [16:35] as nigelb mentioned in the chat, to commit to the repository you need to be in the pollka-devs launchpad team [16:35] anyone can read and take a branch of the repository though [16:36] the great thing about bzr is that you don't have to be scared of breaking anything. [16:37] you can poke about in the code, change things in a way that *you* like and it is easy to maintain your code or push it back to the core project if it is generally useful [16:37] some of my modifications (such as the .png/.svg image pairs) are probably of little interest outside of this particular instance [16:38] others however (like a security patch to prevent SQL injection hacks) are of general interest so got pushed back [16:38] QUESTION from daker: i see two conf keys, site_status and fave_status, what do they mean ? [16:39] daker: the fave_status controls the second vote you have at the bottom [16:39] so for each image you can give it +1 or +0 [16:39] The site can be enabled or disabled for voting, thats site_status [16:39] and then at the end you can give your absolute mostest favouritest picture an extra +1 [16:39] or turn that feature off [16:40] http://bazaar.launchpad.net/~pollka-devs/pollka/trunk/files [16:40] the main pollka branch has a basic admin panel, i dunno if AlanBell's mutant does or not though [16:40] my mutant has that removed [16:41] good point though, the admin.php was there so you don't have to go tweak too much directly in mysql [16:42] ok, so looking further into the repostory at the link above we can see the files that make up the application [16:42] there is admin.php which is the admin console [16:43] the main site is the index.php files (the site has two modes, index.php.active and index.php.inactive) [16:43] there are the results pages [16:43] http://pollka.libertus.co.uk/results.php [16:44] a stylesheet which I tweaked to fit with the new ubuntu branding, I think the default pollka one is less ubuntuish [16:44] and there are the token.php files for processing votes [16:45] in the includes folders there are some other files including the one that connects the php files to the mysql database [16:45] http://bazaar.launchpad.net/~pollka-devs/pollka/trunk/annotate/head:/includes/dbcon1234567890.php [16:45] which includes the classic elky code "die('Could not connect to the database. No pony for you: ' . mysql_error());" [16:46] it is also the file in which you edit to add the mysql username and password you want it to use when talking to the database [16:47] http://bazaar.launchpad.net/~pollka-devs/pollka/trunk/annotate/head:/index.php.active [16:47] that is the main file that does the work of presenting the list of options to the user [16:48] the observant will spot several places where there are hard coded references to the original competition [16:48] 38 [16:48] $subject = "Your World Play Day 2010 Photo Competition Vote"; [16:48] for example [16:48] these should all be recoded as stuff to go in the conf table [16:48] heh, i really should finish fixing all that some time [16:48] there are plenty of things that need doing with this code, which is fine [16:49] (note, hardcoding is bad. this was done in a hurry :P) [16:49] the project is now a mentoring and learning testbed [16:49] or sandpit [16:50] the project is kinda small, with little bugs here and there, ideal as a starter project to get to grips with php [16:50] and bzr [16:50] and relational databases [16:50] and ubuntu packaging [16:50] we should probably close up the tutorial bit now and move on to explaining the UW mentoring partnership program [16:50] and launchpad bug system [16:50] yup [16:50] so it is a lovely little project with lots of stuff to do on it [16:51] started in the Ubuntu-Women project and it is now a mentoring subject for that project [16:51] http://wiki.ubuntu-women.org/MentoringFAQ [16:52] Pollka is like a proof of concept project for the mentoring framework we're trying to morph ^that in to [16:52] https://blueprints.launchpad.net/ubuntu-women.org/+spec/community-n-ubuntu-women-mentor-partnerships [16:53] I'll be talking with people later this month at the Ubuntu Developer Summit on the topic of refining the mentoring partnershps blueprint [16:54] I'd love to see feed back from people on the wikipage linked from there. What do you want from mentoring, etc. [16:54] We're also open to hearing from other applications who may want to partner with us to provide clear pathways for the UW team to guide its members along. [16:56] Ok, any questions for the next 5 mins or so? [16:57] where can we find out more elky? [16:57] sbout? [16:57] pollka [16:57] pollka.net [16:58] yay, a wiki, so anyone can contribute to the documentation as well as the code [16:58] thanks for helping host this session AlanBell. its been much more coherent than my cold-addled brain would have managed [16:58] :) [16:59] I will be changing the mysql password on that database later === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || [17:20] QUESTION: where can I learn more about TCSH? === MSK61 is now known as MAfifi === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Posting into social networks from your app - Instructors: kenvandine [18:02] ok, so lets get started here [18:03] I am Ken VanDine, an engineer on the Ubuntu Desktop team and a Gwibber developer. Today we'll talk about desktop integration with social networks, by adding social features to desktop applications. [18:04] an introduction to libgwibber [18:04] What is libgwibber? [18:04] libgwibber is a library to provide applications access to the gwibber desktop service. It is very important to us to be able to integrate a wide variety of desktop applications with gwibber. The end goal being as transparent as possible, and simplifying the social experence on the desktop. We want the users to be able to easily interact with their friends via social networks while be contextually relevant. For example w [18:04] hen you are browsing photos of your kids 1st birthday party in shotwell, you might want to tag some of your friends that attended the party. Instead of going to the facebook website, uploading photos and then tagging, you should be able to do it right there while you are already viewing or even while importing the photos from your camera. [18:05] Let me give you a concrete example to help illustrate why you should care. [18:05] *you* being an application developer [18:05] Wouldn't this just rock? [18:05] * Plug in your camera [18:06] * shotwell (or your favorite photo library tool) pops up and prompts you to import photos [18:06] * You select the photos you want to import into your library [18:06] * Add comments below the previews [18:06] * Tag friends in the photos [18:06] * And choose to share or not automatically after importing (sharing being uploading to some default online album, like facebook) [18:07] in that scenario, the user is already doing something with their photos, so it makes sense to integrate other things they might want to do in the work flow [18:08] Ok, enough talking about why we want to do this... chances are if you are here you probably already understand. [18:08] Lets talk about how you can use libgwibber in your application. [18:08] Unfortunately the gtk-doc generated docs aren't very useful yet, and if someone wants to help get the annotations in the vala code to make it into the generated C code so gtk-doc can pick it up, please let me know :) [18:09] we really need to figure out how to generate developer docs for the API for C, vala, mono and python [18:09] tricky :) [18:10] There is libgwibber, and libgwibber-gtk. I think most people will just use libgwibber-gtk, which provides gtk widgets you can just drop into your application. [18:10] Currently libgwibber-gtk only includes an Entry widget, which includes: [18:11] * text input box [18:11] * character counter [18:11] * account target bar with toggle buttons for accounts [18:11] * send button [18:11] * url shortening [18:11] * and online/offline detection [18:11] to answer rooligan's question, libgwibber is written in vala which builds a shared library [18:12] which works with C, and we include mono bindings and with introspection python [18:12] moving on [18:12] Screenshot of the entry widget in use: [18:12] http://blogs.gnome.org/kenvandine/files/2010/08/libgwibber-entry-1.png [18:13] that is just a simple gtk window with the entry widget [18:14] This can be embedded anywhere you could put a VBox (Gwibber.Entry is based on Gtk.VBox). [18:15] you'll notice it looks very similar to the input on the bottom of the gwibber client UI [18:15] the goal has been to replace the python one with this one to consolidate the code base [18:16] but it didn't play too well with the gwibber client for some reason, related to introspection and gtk [18:16] it'll happen for gwibber 3.0 though [18:17] lets look at some snippets of code [18:17] embedding the gtk widget should be simple, and as we add more widgets we will make sure we keep it just as simple [18:17] Vala: [18:17] var entry = new Gwibber.Entry (); [18:17] your_container.add (entry); [18:18] C: [18:18] include [18:18] ... [18:18] GwibberEntry* entry = gwibber_entry_new (); [18:18] gtk_container_add ((GtkContainer*) your_container, (GtkWidget*) entry); === harrisonk is now known as harrisonk_away [18:19] and for getting the CFLAGS and all, if you are using autotools just added a pkgconfig check for gwibber-gtk [18:19] Mono: [18:19] Gwibber.Entry entry = new Gwibber.Entry (); [18:19] YourContainer.Add (entry); [18:19] and [18:19] Python: [18:19] from gi.repository import GwibberGtk [18:19] ... [18:19] entry = GwibberGtk.GwibberEntry() [18:19] your_container.add(entry) [18:20] in these examples, "your_container" could be anything gtk container [18:20] a window, etc [18:21] so could nest it in your app so it automatically shows/hides based on either what the user does or even if the gwibber service is available and configured [18:21] so you could hide it if there are no accounts available [18:22] this is what the MeMenu in Ubuntu does, that posting entry is only displayed if you have accounts configured in gwibber [18:22] so users that don't use gwibber won't even see it [18:22] libgwibber provides a signal to watch [18:23] for some complete examples, you can look in the examples directory in a bzr checkout of lp:gwibber/libgwibber [18:23] or [18:23] http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/entry-vala.vala [18:23] http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/entry-mono.cs [18:23] http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/entry-c.c [18:23] http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/entry-python.py [18:24] hopefully this is helpful [18:24] i think for most developers, embedding the entry widget will accomplish the goal [18:25] and add value to your application as well as helping us make ubuntu more social [18:25] for the natty cycle, we will be adding more widgets [18:25] i hope pieces needed to add the experience i described earlier to shotwell [18:26] we need image uploading added to gwibber and some sort of contact selector that aggregates sources for picking friends [18:26] there will also be account/stream selector widgets as well as stream view widgets [18:27] the stream view is what you see in the current gwibber client, where it renders the posts [18:27] and the navigation on the left is the stream selector [18:27] we'll make those into libgwibber-gtk widgets and then then client will just consume those widgets [18:28] hopefully that will come with a fresh new look to the client :) [18:29] now on to libgwibber [18:29] If you want to use the gwibber service without using the Entry widget, you can use libgwibber for more direct access. [18:30] i'll talk about a few of the most common tasks you might want in libgwibber [18:30] Gwibber.Service object includes: [18:31] * version() # returns the version of the currently running gwibber-service [18:31] * refresh() # triggers a refresh [18:31] * quit() # shuts down gwibber-service [18:31] * send_message("Some string to post") # posts a message to all account that have send_enabled = True [18:31] * is_available # signal you can connect to so you can find out when the service comes online (sends a bool) [18:32] Gwibber.Accounts object includes: [18:32] * list() # lists accounts [18:32] * send_enabled("account_id") # toggles send_enabled state of the given account [18:32] * lookup_by_id("account_id") # returns account attributes for a given account [18:32] * account_updated # signal which sends an account when it has been changed [18:33] Gwibber.Service is about interacting with the service, making it do things for you for example [18:34] Gwibber.Accounts is for retrieving or manipulating accounts [18:35] for example, if you want to show/hide a posting widget (like the entry widget we talked about earlier) [18:35] you would connect to the Gwibber.Service.is_available signal [18:35] when you get a True from that signal, you would query Gwibber.Accounts.list() and find accounts that are enabled [18:36] if there are any, then display it [18:36] on the converse, after you show the entry [18:36] if you get a False from Gwibber.Service.is_available, you can hide it [18:36] or destroy [18:36] whatever [18:37] also, you could connect to the account_updated signal, so you can see when accounts change and hide/destroy when there are no longer any accounts enabled [18:37] for example [18:37] libgwibber uses GObject introspection for python support, which is still quite new and some of the libgwibber methods don't behave well. Fortunately the Gwibber.Service methods, which are generally what most application developers will want, work fine. This will improve for natty. [18:38] so for example if you use python and want to get a list of accounts, it will crash :/ [18:38] it isn't handling the conversion of the resulting data type [18:39] a known problem area with python and gobject introspection [18:39] however, all the methods interacting with the service work [18:39] which is what you will most like care about [18:40] Here are some examples: [18:40] http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/example-vala.vala [18:40] http://bazaar.launchpad.net/~gwibber-committers/gwibber/libgwibber/annotate/head%3A/examples/example-mono.cs [18:40] again, you can find those in a bzr checkout in the examples folder [18:40] rooligan asked: For which programming language is libgwibber? [18:40] whoops [18:41] rooligan asked "How to install libgwibber?" [18:41] libgwibber0 is included in maverick by default, to get the gtk widgets just install libgwibber-gtk0 [18:42] actually to build against it, you'll want libgwibber-gtk-dev or libgwibber-dev [18:43] to use it with python you'll need gir1.0-gwibber-gtk-0.0 and/or gir1.0-gwibber-0.0 [18:43] for mono you'll need libgwibber-gtk0.0-cil-dev and/or libgwibber0.0-cil-dev [18:44] any more questions? [18:44] or does anyone have applications in mind they might want to hack on adding social features? [18:45] i would love to find areas people are interested, especially if they might require adding functionality to gwibber/libgwibber that isn't already there [18:45] or maybe if anyone wants to work on shotwell :) [18:47] ok, no more questions then... [18:47] i'll post the bulk of the content from here on my blog later today, which you can find on planet.ubuntu.com [18:48] you can find me most anytime in #ubuntu-desktop [18:48] please feel free to ping me anytime with questions or suggestions [18:49] or if you want to contribute to gwibber, libgwibber or any other application [18:50] thanks everyone for your time! === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Automating tasks with Launchpad, Tarmac and Source Package Recipes - Instructors: rockstar [19:02] Hi folks. My name is Paul Hummer. I'm a contributer to the Launchpad project, and I happen to also get paid for it, so that works out nicely. [19:02] First, give me a second to read about this new-fangled ClassBot thing. [19:03] Okay, let's get started. [19:03] Today, I'm going to talk to you about automating the really menial tasks that come as part of working on a free software project.s [19:04] The less time you spend working on menial things, the more time you can use to write code and do awesome things. [19:04] DISCLAIMER: Date math is hard. It turns out that I signed up for a time that overlaps when I want to eat. [19:04] This means that if I paused for a bit, it's because I'm attempting to force food into my mouth. Feel free to ask questions during this time. It makes me look not quite as bad. :) [19:06] I'm assuming everyone here has a bit of understanding with regards to Launchpad. [19:06] If you don't have any idea what Launchpad is, well, you might be a little lost. [19:07] Some of the features of Launchpad that I'm going to talk about today are relatively new, and we still consider them either "in beta" or "we're just barely talking about making them." [19:07] Rest assured, those features are coming. [19:08] Does anyone here have a project they've got in mind as I talk about automating tasks with Launchpad? [19:09] (I ask because most of my projects already use a lot of these practices, so it's kinda hard to walk through the transition) [19:10] Okay, well, I guess we'll move ahead with a hypothetical project. [19:12] Let's say that Sarah Jane is an opportunistic hacker who used Quickly to set up her project. [19:13] She didn't realize that there would be so many contributors to her little project, but it becomes very popular. [19:13] Poor Sarah Jane spends more time reviewing code from merge proposals and merging the code than she does actually coding. [19:14] Sarah Jane will (not might) eventually get burned out playing gatekeeper. She likes to code (and she's better at that anyway). [19:14] Code reviews themselves can't be automated. They NEED a person to look at the code. [19:15] (This is because code is for people, not for computers.) [19:15] However, once the code has been approved by Sarah Jane, she doesn't want to futz with it anymore. [19:16] Sometimes she forgets to run the tests or check that the build is working before committing. [19:16] Side note: We live in a DVCS world. The days of having a broken trunk are over. If your trunk is broken, you are doing it wrong. [19:17] Okay, so Sarah Jane has a list of reviews she needs to do. She goes through, votes on them, and the ones that she approves can be set to "Approved." [19:18] Enter Tarmac, which you can find at http://launchpad.net/tarmac, with the code being found at lp:tarmac. [19:18] Tarmac is a really simple script that will automate merges for you. [19:19] QUESTION: Merges might still introduce a broken trunk, no? [19:19] No. They shouldn't. I will show you why. [19:19] Also, this ClassBot thing seems to be really helpful if you'll preface your questions with QUESTION. [19:20] So Sarah Jane sets up Tarmac to manage all the merges against lp:project. [19:21] When run manually, tarmac can be invoked like this: `tarmac land lp:project` [19:22] If you're going to manage multiple branches, you'll want to configure tarmac to know a bit more about the branches, which you can find out about in the documentation. [19:23] The docs can be found here: http://bazaar.launchpad.net/~rockstar/tarmac/main/annotate/head:/docs/introduction.txt [19:24] I have this on a cron job currently, and it runs every 5 minutes. [19:24] Tarmac self hosts itself too. [19:25] In this case, when Sarah Jane runs tarmac, it looks for all the branch merge proposals in a "Approved" status that ALSO have a commit message set, and will merge them all automatically, one by one. [19:25] But wait! What if these merges cause breaks in the trunk? [19:25] Tarmac can be configured to run a command AFTER the merge but before a commit. [19:26] For instance, let's say you want to make sure `make` completes. You can configure Tarmac to run make, and if everything is successful, it'll merge the branch. Otherwise, it'll kick it out and comment on the merge proposal, saying something like "Dude, your branch is broken. Get your act together." === zumbi_ is now known as zumbi [19:27] Tarmac itself has a small suite of tests that we never want to break, so when Tarmac does it's own merges, it makes sure to run the tests. If the tests fail, the branch fails, and doesn't get merged. [19:28] Robots are MUCH better at doing these menial things than we are. We get bored merging and make-ing and testing and all the things you have to do to maintain a pristine trunk. [19:28] There's also something else really awesome about this. [19:29] When I upgrade the Tarmac instance's OS from Lucid to Maverick, the tests underneath broke, so trunk was technically "broken" [19:30] Tarmac worked fine on Maverick, but the tests didn't. This meant that no branches could be merged until the tests were fixed. [19:30] It's kind of a "Stop the line" situation. [19:30] Sarah Jane pointed Tarmac at her branches and then went back to coding and reviewing code. Everything is automated. [19:31] CAVEAT: The system Tarmac uses to merge branches wasn't really meant for what Tarmac does to it. [19:31] Because of this, in the next little while, Launchpad will be gaining a feature called "merge queues." Basically, when you're ready for the branch to be merged, you stick it in the queue. [19:32] Then tarmac just looks at the queue and merges that way. [19:32] This is what I'm currently spending my days working on, so I'm quite excited about the feature. [19:33] Okay, so tarmac is merging branches automatically. [19:33] How does Sarah Jane get her software into the hands of people that use it. [19:33] As a practice now, I personally NEVER do `make install` or `setup.py install` or whatever. If it's not packaged, I'm not installing it. [19:34] So Sarah Jane needs to get it packaged. [19:35] Sarah Jane has some packaging data, but she doesn't want to keep that data in trunk, because it's very OS specific. [19:36] What she needs to do then is create a branch of trunk, and add the debian/ folder to that branch. [19:36] Has anyone here used the source package recipe feature in Launchpad? [19:36] Or maybe a better question, has anyone here even HEARD of the source package recipe feature in Launchpad? [19:37] * rockstar fails [19:38] Source package recipes are "recipes" that allow you to say "hey, I have these branches that all need to go together. Whatever working tree that makes needs to be made into a package." [19:39] So Sarah Jane can go to her trunk page and click the link that says "Create source package recipe." [19:39] She's then confronted with a bunch of options, including the ability to build her package every day (!). [19:39] At the bottom, she's given a default recipe, which is basically the trunk branch. [19:40] The trunk branch doesn't have the debian/ folder there, so we need to merge in Sarah Jane's packaging branch. [19:40] So the recipe will be something like this: [19:40] lp:project [19:40] merge lp:~sarah-jane/project/packaging === You're now known as ubuntulog [19:41] The working tree that is created is then sent to the PPA builders. [19:41] Sarah Jane didn't necessarily want to build the package every day, but did want to build the package after Tarmac makes a merge run. [19:43] She can configure Tarmac to request a build of her package recipe after Tarmac merges all the branches from a single run of `tarmac land` [19:43] Oh snap. I should mention that, as it currently stands, you'll need to be on the "edge" servers in order to create and edit source package recipes. This is because they are still technically "beta." [19:45] So let's look at what Sarah Jane's little project is doing now. [19:45] Someone proposes a merge into her trunk branch. [19:46] Sarah Jane looks at the merge, and she's glad to have the patch. She votes "Approve" and sets the merge proposal to "Approved." [19:46] 10 minutes later, when the tarmac cron job is invoked, Tarmac finds the approved merge and merges it. [19:46] It then runs all the tests to make sure that there's nothing fundamentally broken about the merge. [19:46] Tarmac is happy with the merge, and commits. [19:47] Tarmac continues on, merging and committing other approved merges. [19:48] After Tarmac is finished on the branch, it requests a build of Sarah Jane's source package recipe. [19:48] 30 minutes later, Bob gets an update alert for the new package that's available in Sarah Jane's PPA. [19:49] He installs the updated version and finds some new features in the app he's testing out. [19:50] So in a matter of a few hours, you have your bleeding edge features into the hands of your most loyal users, through a package management system that allows them to downgrade should they find a heinous bug. [19:50] And even when they do find a heinous bug, the update is only a few hours away from the approved merge. [19:50] Any questions? [19:52] Alright, thanks everyone! [19:58] I hope that people are sitting comfortably. [19:58] :-) [20:00] Hello everyone! === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Infinity and beyond - gentle introduction to Ruby - Instructors: matti [20:00] My name is Krzysztof Wilczynski [20:00] And I will talk today about Ruby. [20:01] A little bit about the history of the language, a little bit about community that surrounds it and a little bit about the language itself. [20:01] Yet, this talk is not really a complete language tutorial. [20:02] Please, feel free to ask any question as we go forward ;-) [20:02] What is Ruby? [20:03] Ruby is a modern general purpose language. [20:03] Fairly young too. [20:03] Ruby is often referred as "scripting language" - which to some extend is true, nevertheless it is a turing-complete full-blown programming language. [20:03] Written completely in C. [20:04] Ruby offers multiple you as the author to chose between functional, structural and object-oriented programming techniques. [20:05] This allow you to create from a very small script which you need to solve particular problem i.e. parse some log etc. [20:05] To a complex web applications interacting with multiple systems and providing extensive API etc. [20:06] Ruby has rapid development model and its relese cyclce is less strict and more relaxed that what some other languages have, for example Python. [20:07] As quite mature project right now, you can enjoy Ruby on multiple platforms even that its development is mainly on Linux. [20:07] There are version for UNIX, Mac OS X, BeOS even OS/2 and much more :) [20:08] Ruby is fully object-oriented and one of its principles is that everything is an object. [20:08] Including all the primitive types like Integer and String etc [20:09] We have automatic memory management and garbage collection (which uses a mark-and-sweep implementation of the garbage collector). [20:10] Ruby also offers exception handling, operator overloading. [20:10] By design Ruby does not allow for multiple inheritance -- like Java for example -- but this can be solved by using Mixins -- more about that later. [20:11] Another great principle that can be found in Ruby is minimalism -- code less do more. [20:12] And Ruby -- as well as other dynamic languages -- really allows you to save time and effort. [20:13] As a dynamic language, Ruby is interpreted during the run-time, therefore not compiled. [20:13] Being dynamic language, Ruby lacks strong types declaration in favour of duck-typing and there is not explicit scope declariation too. [20:14] Ruby is excellent at text processing thanks to build in support for regular expressions -- it is build into the language core, not as a separate library. This is similar to what Perl offers. [20:15] A little bit about Ruby's heritage, so we can understand the language better :) [20:16] Ruby was influenced by Perl -- idea for build-in regular expression engine and amazing flexibility, Lisp -- functional programming, Eiffel, Ada, Smalltalk -- most of Object-Oriented principles and closures and CLU -- iterators. [20:18] Thanks to all the wealth that Ruby inherited from other great languages, I sometimes say that "Ruby is Python for Perl developers". [20:18] As the author of Ruby describes it: "Ruby is simple in appearance, but is very complex inside, just like our human body." [20:18] Some other people have said similar things too :) [20:19] "Ruby > (Smalltalk + Perl) / 2" by Michael Neumann [20:19] "Ruby is two parts Perl, one part Python, and one part Smalltalk" by Colin Steele [20:19] So, how Ruby compares to other languages? [20:20] Quite often people refer to Ruby as being not "fast enough" or "slow" etc. [20:20] There is a grain of truth it this statement. [20:20] Ruby of course as dynamic language will always be slower than Java or C, for that matter. [20:21] Nevertheless the core of the language was written in C. [20:22] For example, Ruby does not pre-compile to byte code like Python does -- the famous .pyc files. [20:22] This is not entirely true -- but I will talk about that later. [20:23] Ruby was design to be used for scripting and small applications. [20:23] Which do not have long life-span in general. [20:23] This can be seen in the way how Ruby manages memory and how its gargabe collector works. [20:23] Quite similar to Perl in fact. [20:25] For anyone who is interested in some real tests considering Ruby's perfomance in terms of how Ruby stands next to other languages, please take a look on: http://shootout.alioth.debian.org/. [20:25] There is of course a flip side. [20:25] Speed vs Productivity -- the good old "apple vs oranges" problem, so to speak. [20:26] Ruby might not be the most perfoment langauge. [20:26] Or the easiet one. [20:26] Or the most popular one. [20:26] But most certainly it does contribute to the way how you and other people using it work. [20:26] Most often it will shorten the create-edit-compile-debug cycle. [20:27] Which allows people to create software quicker and with less hassle. [20:28] This is because Ruby is highly dynamic and has very open nature. [20:28] Yet, everything comes with the price -- dynamic languages can be unpredictable. This is also true for Python :) [20:29] Everything happens in the run-time, therefore you will find out about potential issues only when you application will stumble into them. [20:30] When many people look at Ruby for the very first time, they will most certainly notice its unique syntax. [20:31] Things like the BEGIN {} and END {} blocks also known from awk and Perl. [20:31] The infamous "begin" and "end" plus "do" and "end" which look like our good old friend Pascal a little :) [20:32] Actually, some people do not like that sort of thing, hence they think that Ruby is ugly :-( [20:32] We also have { } to denote code blocks which you have seen in C and Java and many others. [20:33] Among many things unique to Ruby few may stand-out. [20:33] One would be Ruby's license. [20:34] Ruby is a Free Software, with a GPL and Artistic License. Quite the same as Perl. [20:34] I was wondering myself whether Perl's influence on Ruby has anything to do with that :) [20:34] Another interesting principle that Ruby tends to follow is "POLS". [20:35] The "Principle of least surprise" -- aslo know as "LOLA" :-D or "Law of least astonishment". [20:35] What is basically means is simple in its nature: what you see and what you think your code will do and how it will behave is probably what you will get. [20:36] There are also the famouns method suffixes ? and !. [20:37] ? - is usually used for methods that test for something and/or for particular condition and they should return boolean (true/false) back to us. [20:37] ! - denotes a "destructive" method which will modify the content of the variable on which the method was called. [20:38] Ruby lacks ++ and -- for the pre and post incrementation of numeric values. [20:39] Therefore we have to use these operators explicitly: a = a + b or a += b. [20:39] That is the Ruby way. [20:39] Ruby will pass everything as reference to object, therefore there is no such thing as concept of Perl's scalar. [20:41] There is also the "splat" operator denoted as * which allows to work or lists (arrays) and pass variable length parameters to methods. [20:41] Ruby also has symbols -- an immutable strings that are initialized only once when defined. They are said to be frozen. [20:42] Quite useful when used in conjuction with associative arrays. [20:42] Ruby itself comes in different shapes and forms... [20:42] Most popular implementations of Ruby interpeter are: [20:43] MRI (for the 1.8 family) also know as "Matz's Ruby Interpreter" [20:43] It is the most stable version of Ruby sometimes called CRuby. [20:44] YARV (1.9 family) also known as "Yet another Ruby VM" and/or KRI "Koichi's Ruby Interpeter" after the author of new Ruby Virtual Machine implementation. [20:44] Going back to the Ruby perfomance here. [20:45] MRI vs YARV -- YARV optimizes a lot by compiling everything into internal byte-code - almost like Python and mentioned .pyc files (although, Ruby does not create .rbc files as a side effect :-]). [20:46] YARV also supports native operating-systems threads on the contrary to Green Threads that MRI has. Unfortunately, similarly to Python, YARV suffers from GIL issues :-( [20:47] There is also REE (based on MRI) "Ruby Enterprise Edition" maintained by a company called Phusion. [20:47] http://www.rubyenterpriseedition.com/ -- more about REE and Phusion and what they did to Ruby and its community. [20:48] JRuby -- an implementation of Ruby interpreter in Java http://jruby.org/ [20:48] IronRuby -- Ruby for the .NET platform http://ironruby.net/ [20:49] MacRuby - very cutting-edge version which has a lot of experimental features. Maintained mainly for Mac OS X. http://www.macruby.org/ [20:49] Rubinius -- a completely different implementation of the Ruby Virtual Machine http://rubini.us/. [20:50] And there is also Cardinal which is a Ruby interpreter ported for the Parrot Virtual Machine http://cardinal2.rubyforge.org/ [20:50] Little bit about the history of the language itself. [20:51] Ruby was born on the February 24, 1993 and it was created by Yukihiro Matsumoto. [20:51] http://deadbeef.info/tmp/talk/matz.jpg -- a picture of Yukihiro also known as Matz in the community. [20:51] As he puts it: "I wanted a scripting language that was more powerful than Perl, and more object-oriented than Python". [20:52] So in more or less chronological order: [20:52] 1993 - on February 24 the language was born and the first "Hello World" in Ruby was created [20:52] 1994 - in December the first alpha version was released to public [20:52] 1995 - in December the first public release version 0.95 [20:52] 1996 - in December version 1.0 was released [20:53] 1999 - version 1.4 was released [20:53] By this time, Ruby was used mostly in Japan... [20:53] 2000 - the "Programming Ruby" book published and the comp.lang.ruby was created on Usenet -- after this Ruby gained more popularity outside Japan [20:53] 2001 - version 1.6 was released and the "Ruby in a Nutshell" book published [20:53] 2002 - the "Ruby Developer's Guide" book was published [20:53] 2007 - on December 26, YARV by Koichi Sasada was officially merged into main Ruby code tree making 1.9 faster and better [20:54] And as we can see... by the 2010 Ruby is very much alive and well :) [20:54] This nicely reflects the popularity of Ruby: [20:54] In terms of users... [20:54] 1993 - 1 -- before first public release of Ruby [20:54] Here, the only user was Matz :) [20:54] 1995 - 100 -- after first public release mainly local to Japan [20:55] 2000 - 10 000 -- after first book about Ruby was published [20:55] First book helped Ruby gain momentum... [20:55] Especially, after first translation to English was published. [20:55] 2005 - approximately 100 000 -- when Ruby On Rails was born by David Heinemeier Hansson [20:55] Now. [20:55] In 2005 when Ruby on Rails was introducted to the World. [20:56] Ruby suddenly picked up a lot of attention world-wide. [20:56] So then... [20:56] 2008 - approximately 1 000 000 [20:56] 2013 - approximately 4 000 000 and more ... this is the estimation made by Gartner :) [20:56] I stronly believe that there is more than 4 mln Ruby users world-wide already. [20:57] We can also look at how popular Ruby is on some web sites used by many people on every-day basis. [20:57] Ruby is the most popular language on http://refactormycode.com/ [20:57] Ruby is the most popular on http://snippets.dzone.com/, almost 2115 snippets to date! [20:57] Ruby was tagged 13994 times on Stack Overflow -- with Ruby on Rails being tagged 20766 times :) [20:57] Holding the 10th position on TIOBE Programming Community Index [20:58] Listed 10th on the Programming Language Popularity web site [20:58] Which is nice. [20:58] Since Ruby is quite young and might not be as established as other languages like Java, Python, etc. [20:58] Yet. [20:58] What makes Ruby so amazing. [20:58] Is of course the community. [20:59] All the people using it and behind it. [20:59] There is this famous acronym: "MINSWAN". [20:59] What it means is "Matz is nice, so we are nice". And it was first used by Dave Thomas, one of the Ruby hackers. [21:00] And this spirit is what drives Ruby community. [21:00] I would actually dare to say that Ruby community is a bit like a big family. === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || [21:00] And most of the users are like a true care-bears. [21:00] Oh dear. [21:01] :) [21:01] I am half-way my talk and its already the time to end it. [21:01] Well. [21:01] I don't see anything else scheduled, so I will just keep on talking ;p [21:02] As I said, the Ruby community is very nice, friendly and open. [21:02] Even Matz is extremely open towards other ideas and especially towards other languages too. [21:02] He is a Python user for example :) [21:02] http://deadbeef.info/tmp/talk/matz_python.jpg [21:03] There are mailing lists to chose from. Official Forum. [21:03] Of course the IRC channels #ruby and #ruby-lang (including #rvm) on Freenode network. [21:04] There are some very nice and friendly people always keen to help. [21:04] So, please if you want to know something and/or you struggle with something by all means join these channels and ask for help :) [21:04] And... don't ask to ask, just ask :) [21:05] You can of course use Google too ;) [21:05] There are some conferences being organized now and again by Ruby community all 'round the World. [21:05] Most famous are: [21:05] Euruko is the biggest in Europe :) Yay! [21:06] "Ruby Conference" is the biggest in the USA. [21:06] And there is of course the BIGGEST conference called "Ruby Kaigi" held in Japan. [21:06] Ruby community welcomes everyone. [21:06] And every idea. [21:07] There is no such thing like "stupid question" or "dumb idea". [21:07] Ruby folks are forward-thinking and most of them are type of "doers". [21:07] What is very important. [21:07] What what makes me personally proud of being part of the community. [21:08] Is that Ruby does not discriminate and welcomes women! [21:08] And we have some amazing women in the community already. [21:08] Elise Huard -- http://jabberwocky.eu/ [21:08] Sarah Mei -- http://www.sarahmei.com/ [21:08] Sarah is a great coder and fantastic person looking after Ruby community in San Francisco USA :) [21:09] Now. [21:09] Who is using Ruby the most? [21:09] By the popularity of Ruby on Rais and similar projects. [21:09] This would be all the web developers. [21:10] They also have Sinatra, Camping and many others web frameworks made in Ruby to chose from. [21:10] But. [21:10] What is very nice. [21:10] Is that Ruby is gaining popularity among systems people. [21:10] Systems administrators in particular as a worthy replacement for Perl. [21:11] May system administrator have been using Perl for many years and they pick-up Ruby because of all the nice features it has, plus to them quite often it feels and looks like Perl [21:11] Well, Ruby was influenced by Perl :) [21:13] Projects like Puppet and Chef -- a configuration management and deployment systems greatly improve every-day life of a system administrator. [21:13] These projects push forward aspects of automation and instrumentation nowadays. [21:13] Also worth mentioning is mcollective. [21:14] Amazing project allowing for working with multiple systems and manage them from single node -- it uses meta-infomration provided by for example Puppet allowing for some amaznig things :) [21:14] There are scientists using Ruby too! [21:15] The Monterey Bay Aquarium Research Institute (MBARI) uses Ruby extensively. [21:15] Brent Roman who works there also provides patches that greatly speed-up Ruby and add more features :) [21:15] There is this standing joke in the community that Brent uses Ruby to drive these little sub-marines :P [21:16] I am not sure whether this is true or not ;p [21:16] Who is using Ruby in the "industry" so to speak :) [21:17] Multiple companies... like Amazon, BBC, Cisco Systems, IBM, Oracle, NASA, Siemens, Yahoo! and many more... [21:18] Also the well-known projects and web pages like http://twitter.com/, http://github.com/, http://slideshare.net/, http://www.scribd.com/, http://yellowpages.com/ (yes, them too :D), http://www.alistapart.com/, http://www.hulu.com/ and many more ;) [21:19] Let's talk about the every-day use of Ruby... [21:19] Installing Ruby is really easy. [21:19] Especially when your distribution provides binary packages -- like Ubuntu, Debian, Fedora and others. [21:20] If you need to be on the cutting-edge, a project called "Ruby Version Manager" (RVM) comes to the rescue :) [21:20] RVM was created by Wayne E. Seguin to solve problem of having multiple version of Ruby running multiple modules in the same time in production. [21:21] RVM allows you to do exactly that :) [21:21] Plus it is extremely easy to use. [21:21] Cross-platform -- available for Mac OS X, BSD family and more. [21:22] And it allows you to install all the required rubies without a need for an access to a super-user privileges. [21:22] Everything can be done as user (you) in your local home directory :) [21:23] I personally run RVM with few rubies on my notebook for development and testing ;) [21:23] krzysztof@samsung:~$ rvm list [21:23] ;] [21:23] rvm rubies [21:23] ree-1.8.7-2010.02 [ i386 ] ruby-1.8.7-p302 [ i386 ] ruby-1.9.2-p0 [ i386 ] [21:23] krzysztof@samsung:~$ ruby -v [21:23] ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux] [21:23] krzysztof@samsung:~$ rvm ree [21:23] krzysztof@samsung:~$ ruby -v [21:23] ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.02 [21:24] Quick, nice and easy. [21:24] ;] [21:24] http://rvm.beginrescueend.com/ -- more about RVM :) [21:24] Ruby has many modules to chose from. [21:24] They are called "gems". [21:25] A gem is a special boundle. [21:25] More alike .deb package in Ubuntu or Debian. [21:25] Getting some numbers here... [21:25] Almost 17 000 gems in almost 25 GB worth of data hosted on http://rubygems.org/ [21:26] Worth mentioning that on August 31st 2010, Ruby Gems passed the mark of 50th million gems downloaded [21:26] Well done for them! [21:26] :-) [21:26] Almost 9 000 gems on http://rubyforge.org/. [21:27] So there is plenty of modules to chose from in Ruby ;] [21:27] Meaning that you may save some time on development :) [21:28] Another interesting project which will help you out tremendously is "Bundler". [21:28] Bundler allows for stress-free deployment of Ruby application by including all the required and relevant gems together with it. [21:29] So, deployment of remote systems will be way less complex with Bundler. [21:29] This also add value when you want to upgrade existing application. [21:29] Definitely worth looking at :) [21:30] Many people ask about editors and IDEs ... which ones are the best for Ruby? [21:30] Well, there are quite a few out there. [21:31] To begin with we have Interactive Ruby (IRB). [21:31] Excellent for testing and quick proof-of-concept and quick prototyping. [21:31] Not really an editor. More alike command line interface (CLI) that Ruby offers -- similar to what you'll see after executing Python :) [21:32] We have well known VI and VIM -- oldie but goodie ... :) [21:32] Geany -- quite nice editor, I personally like it. [21:32] gedit and Kate -- part of Gnome and KDE. [21:32] gedit is very nice and often not really appreciated. [21:32] which editor do you use? [21:33] Especially for what this little editor can do. [21:33] rooligan: That depends. [21:33] rooligan: On my desktop at home and work I use Ruby. [21:33] Ops. [21:33] Hehe. [21:33] I mean I use Geany. [21:33] Sorry ;p [21:33] :D lol [21:33] With the dark colour scheme ;p [21:33] I can make a screen shot in a second. [21:34] On remote systems I prefer VIM over emacs for instance. [21:34] Some of my colleagues are using TextMate -- but that is OS X. [21:35] Textmate looks strange for me... without any buttons. Just the code and tabs [21:37] Indeed. [21:37] A lot of web developers working on OS X prefer it. [21:37] I am not an OS X user so I can't really tell whether it is "that awesome" as they describe it ;] [21:38] Hehe. [21:38] NetBeans can do Ruby too. [21:38] Some new kids on the block like Aptana and Redcar are nice. [21:38] I've seen people working with notepad.exe ;p [21:39] :O [21:39] Two commercial ones are hightly rated too: RubyMine and Komodo. [21:39] Right... [21:39] Ruby and the docummentation :) [21:39] For all the people who want to try it out. [21:40] Try Ruby is a nice alternative. [21:40] http://tryruby.org/ [21:40] A wealth of examples can be found on "Programming Language Examples Alike Cookbook" http://pleac.sourceforge.net/. [21:41] For peolpe keen on learning about "The Ruby Way" and how to make their code more idiomatic. [21:41] I recommend Ruby Koans -- http://github.com/edgecase/ruby_koans [21:41] There is also help from the Ruby itself. [21:41] help -- in IRB. [21:42] And console command ri. [21:42] Both require Ruby Docummentation to be installed. [21:42] There is the Ruby Standard Library Documentation http://www.ruby-doc.org/ and http://www.ruby-doc.org/stdlib/ [21:42] Programming Ruby The Pragmatic Programmer's Guide -- http://www.ruby-doc.org/docs/ProgrammingRuby/ [21:43] Amazing introduction to the languge: Why's (poignant) Guide to Ruby -- http://viewsourcecode.org/why/ [21:43] Ruby Programming -- http://en.wikibooks.org/wiki/Ruby_Programming [21:43] Some books that I can recommend: [21:43] "The Ruby Programming Language" by David Flanagan and Yukihiro Matsumoto [21:43] "Ruby In A Nutshell" by Yukihiro Matsumoto [21:43] "Programming Ruby: The Pragmatic Programmers' Guide" by Dave Thomas, Chad Fowler and Andy Hunt [21:43] "The Ruby Way" by Hal Fulton [21:44] "Ruby Developers Guide" by Lyle Johnson, Jonothon Ortiz, Robert Feldt and Michael Neumann [21:44] matti: What do you think about Python? [21:44] rooligan: Almost three years ago I was a heavy Python user. [21:44] rooligan: At some point I had to work more and more with Ruby. [21:45] rooligan: And this amazing spring day... a time for lovers... [21:45] rooligan: I have simple fallen in love with Ruby. [21:45] ;] [21:45] :) [21:45] rooligan: And since then... I work mainly with it on day-to-day basis. [21:46] I also work with other languages like Python (still have a lot of respect), Perl, Java and C. [21:46] but for Perl, Java and C you haven't respect? [21:46] I do. [21:47] Yet for instance I seldom use C nowadays. [21:47] When I do, it was usualy to extend Python and/or Ruby. [21:47] For the "extra speed" that C offers. [21:47] Perl mainly for small scripts and one-off one-liners. [21:47] Java because of the core application that may company develops, [21:47] I don't think C is much faster than Python. There is no notable difference. [21:48] rooligan: In terms of byte code execution, there isn't any. [21:48] rooligan: Yet quite often a pure-Python and/or pure-Ruby libraries are not performent enough. [21:48] rooligan: There is a factor of memory usage here too. [21:49] rooligan: Imagine... A YAML parser in pure-Ruby is way behind C implementation. [21:49] On that note. [21:49] Ruby MRI (1.8) tends to be a little bit slower than Python. [21:50] Ruby YARV (1.9) tends to match Python's speed and sometimes over-take it. [21:50] Yet MRI and YARV are not fully compatible with each other. [21:51] Goind back to finding-out things in Ruby. [21:51] If you don't have access to the web and/or documentation... [21:51] You can try to figure-out how to use some objects and classes by calling some of these methods: [21:52] .singleton_methods, .public_methods -- static class methods use with parameter false, .private_methods, .instance_methods -- instance methods, .class_variables, .instance_variables, .ancestors -- all modules included in this module. [21:52] They are sometimes very handy. [21:53] When it goes to coding, Ruby on that matter almost like Perl. [21:53] More than way one to solve a problem (more than one way to do this ...). [21:53] And the things like... [21:53] The "TABWTDI" -- "There is a better way to do it" [21:53] The "TMTOWTDI" -- "There is more than one way to do it" [21:53] And also "The Ruby Way". [21:53] How you code is completely up-to-you as a developer. [21:54] Yet Ruby allows you to create both... amazing code... and ugly as hell code. [21:54] On the contrary to Python whom enforces some good coding practices more stronger. [21:54] matti: There is no language you can't write ugly code on ;) [21:55] Ruby has a lot of syntactic sugar in it.... [21:55] rooligan: I agree :) [21:55] rooligan: Yet Ruby does not have this brilliant PEP8. [21:55] rooligan: Which would help people be more consistent etc. [21:56] Some sugar for instance: %w(a b c).join(',') vs %w(a b c) * ',' [21:56] But most of Python programers don't know about PEP8 :( [21:56] There is more, and sadly allows for serious abouse in terms of code clarity etc. [21:56] rooligan: Hehe. [21:57] what would %w(a b c).join(',') do? [21:57] Try it :) [21:57] Either in IRB or in the Try Ruby ;] [21:57] The web site. [21:57] http://tryruby.org/ [21:59] %w() is a short-hand way of creating array in Ruby. [21:59] Yet another Perl influence. [22:00] ok [22:00] .join will iterate over the list and join all the elements with ,. [22:00] (main):001:0> %w(a b c).join(',') [22:00] => "a,b,c" [22:00] I know join already from Python :) [22:00] ;] [22:00] rooligan: Ruby is very similar to Python :) [22:01] Is there a good online resource for learning Ruby? [22:01] Yes. [22:01] I pasted some of the good links. [22:02] + Try Ruby -- http://tryruby.org/ [22:02] + Programming Language Examples Alike Cookbook -- http://pleac.sourceforge.net/ [22:02] + Ruby Koans -- http://github.com/edgecase/ruby_koans [22:02] + Ruby Standard Library Documentation -- http://www.ruby-doc.org/ and http://www.ruby-doc.org/stdlib/ [22:02] + Programming Ruby The Pragmatic Programmer's Guide -- http://www.ruby-doc.org/docs/ProgrammingRuby/ [22:02] + Why's (poignant) Guide to Ruby -- http://viewsourcecode.org/why/ [22:02] Why's (poignant) Guide to Ruby -- http://viewsourcecode.org/why/ [22:02] + Ruby Programming -- http://en.wikibooks.org/wiki/Ruby_Programming [22:02] Is for absolute begginers. [22:02] If you know Python already. [22:03] You'll probably pick-up Ruby in no time. [22:03] Ruby is really easy to learn. [22:03] And I bet you, you'll appreciate Ruby Blocks straight-away. [22:03] That Why's poignant Guide is really good, much people say [22:04] Indeed. [22:04] _why -- guy who made it. [22:04] At some point left the community. [22:04] We do not know why. [22:04] He just went missing... [22:04] He deleted most of his work etc etc. [22:04] Yet, _why was a true genius. [22:05] Ruby gained a lot because of him. [22:05] Going back... not much of my talk have left ;] [22:06] Ruby projects tend to be hosted mainly on github. [22:06] And a lot of Ruby Hackers use git. [22:06] Which is like BitBucket for Python. [22:06] Some of the companies which offer project hosting for Ruby and/or Ruby on Rails. [22:06] Engine Yard -- http://www.engineyard.com/ [22:06] Heroku -- http://heroku.com/ [22:06] site5 [22:06] bluehost [22:07] DreamHost [22:07] OVH -- if you want to maintain your own systems [22:07] Amazon EC2 -- worth mentioning are new micro-instances [22:07] Quickly about Ruby code and synatx :) [22:07] File extension .rb in most of the cases. [22:07] Typical hashbang is #!/usr/bin/ruby or better #!/usr/bin/env ruby [22:08] The code layout most likely will be done with two spaces for indentation -- a standard among Ruby projects. [22:08] Keywords and language elements will be separated by new lines and/or by semicolons. [22:08] Variables are separated by commas -- same rule applies to passing parameters to methods. [22:09] Most of the code can be short-handed to an in-line instruction i.e. puts "Hello, Bob" if name == "Bob" -- like in Perl :) [22:09] The new-linea and semicolons style sometimes is mixed. [22:09] n = 1 [22:09] if n > 0 [22:09] puts "Yes" [22:09] else; puts "No"; end [22:09] Comments... [22:09] # -- can be span across multiple lines [22:09] "=begin" and "=end" -- everything in-between these lines will be ignored by Ruby interpreter [22:09] # [22:09] # A comment ... [22:09] # [22:09] =begin [22:09] A comment too ... [22:10] =end [22:10] ;] [22:10] Now... [22:10] My talk goes deeper into some Ruby syntax. [22:10] But since I have already talked to much. [22:10] I will end it ;] [22:10] Thank you all for listening to me. [22:11] :) [22:11] I can tell you a little bit about syntax and why Ruby is so popular in terms of meta-programming (which is what makes it so great) when you folks are interested in that :) [22:12] But, by all means. Please give it a try and perhaps you will fall in love too, as I did ;] [22:13] :) [22:13] rooligan: Look at blocks in Ruby. [22:13] rooligan: And meta-programming in it. [22:13] rooligan: It is absolutely amazing what you can do. [22:13] rooligan: Plus, Ruby flexibility is great. [22:14] rooligan: Python for instance does not allow you to extend (monkey-patch) its primitive types. [22:14] rooligan: There is no limit to what you can do in Ruby. [22:14] rooligan: You can even remove/unset some of the core if you feel like so ;] [22:15] rooligan: Python community believes that this is really ugly, dangerous and you should not do it. Period. [22:15] Well, they do have a point... but so far Ruby is all good and well with it ;p [22:15] rooligan: For example... [22:16] krzysztof@samsung:~$ irb [22:16] Fri Oct 01 22:15:54 +0100 2010 [22:16] (main):001:0> 'rooligan'.encrypt [22:16] NoMethodError: undefined method `encrypt' for "rooligan":String from (irb):1 [22:16] (main):002:0> [22:16] Ha! [22:16] No method... yet! :) [22:16] Let's quickly extend the String class... [22:16] One of the primitive types in Ruby... Also full-blown objects. [22:16] (main):002:0> class String; def decrypt; tr 'b-za', 'a-z'; end; end [22:16] => nil [22:17] And... [22:17] (main):004:0> class String; def encrypt; tr 'a-z', 'b-za'; end; end [22:17] => nil [22:17] (main):005:0> 'rooligan'.encrypt [22:17] => "sppmjhbo" [22:17] ;] [22:17] TADA.wav [22:17] (main):006:0> 'rooligan'.encrypt.decrypt [22:17] => "rooligan" [22:17] :) [22:17] Anyway. [22:18] I have to stop talking ;p [22:18] ok [22:18] * matti hugs rooligan [22:18] :) [22:18] :) [22:19] rooligan: Pop-in #ruby and #ruby-lang ;p [22:19] I should actually say... [22:19] Come to the Dark Side. [22:19] ;p [22:19] :D [22:20] Ok, bb === kdrx-[-_-]\ is now known as kuadrosx === yofel_ is now known as yofel === kdrsx is now known as kuadrosx