/srv/irclogs.ubuntu.com/2011/09/05/#ubuntu-classroom.txt

=== ghostcube_ is now known as ghostcube
conscioususer(ping)09:15
delcoyotepong09:30
=== _jmp__ is now known as _jmp_
rodemirequit14:23
=== raju1 is now known as genupulas
=== Guest47819 is now known as tviking
dpmhi all, is everyone ready for the first day of Ubuntu App Developer Week?15:54
jmlYes!15:54
dpm:)15:54
Andy80yess :)15:55
tvikingYep!!15:55
=== dmitry is now known as Guest95437
dpmawesome :)15:56
dpmLet's give a warm welcome to Jonathan Lange (jml), who'll be opening the UADW with a talk about the app developer strategy for Ubuntu15:59
jmlHello and welcome to App Developer Week!15:59
jmlAs dpm said, my name's Jonathan Lange.15:59
jmlI work at Canonical.15:59
jmlFor most of the last five years I've been working on Launchpad, but recently I've started working on the Ubuntu developer programme15:59
jmlWhich has been really fun.15:59
jmlWe believe that to get Ubuntu from 20 million to 200 million users, we need more and better apps on Ubuntu16:00
jmlAnd in fact, more than that, that we need a thriving ecosystem of applications on Ubuntu16:00
dpmskype:johnoxton.co.uk16:00
dpmskype:elachuni16:00
jmlTwo simple goals:16:00
jml1. More and better apps on Ubuntu16:00
jmldpm: hello :)16:00
jml2. Thriving ecosystem16:00
=== 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: Making Ubuntu a Target for App Developers - Instructors: jml
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/09/05/%23ubuntu-classroom.html following the conclusion of the session.16:00
jml*ahem*16:01
jmlI guess I started early16:01
jmlanyway, for those that turned up late, my name is Jonathan Lange and I work at Canonical trying to make it possible to have many more and better apps on Ubuntu16:01
jmlso we can get a heap more users :)16:02
jmlTo get more and better apps, we need to have more developers -- the kind who are writing apps for Windows, OS X, iOS and Android -- to think of Ubuntu as a platform to develop for.16:02
jmlThere are a lot of bits to that.16:02
jmlOne is actually making some place that app developers can go to in order to learn how to develop for Ubuntu16:02
=== david is now known as Guest1487
jmlA bunch of folk at Canonical are working on that now, and you'll see their results on developer.ubuntu.com in the next few weeks.16:02
jmlAlso, on Thursday, there's a talk about how they are doing the work16:03
jmlsee the schedule in the topic for more details16:03
jml(btw, ask questions on #ubuntu-classroom-chat and I'll answer at the end of the talk)16:03
jmlAnother part is actually *defining* some sort of platform for developers to target.16:03
jmlWhich is really, really hard.16:03
jmlPart of the glory of Linux is that there are so many choices at practically every level of the stack.16:04
jmlRoll your own daemon? Use upstart? Use launchd? Use systemd?16:04
jmlWant a GUI? Use Qt or GTK+? Is that Qt with QML or standard Qt? PyGTK or PyGI?16:04
jmlOh, you want an IDE? What, isn't vim good enough for you? Well, I guess there's umm...16:04
jmlEclipse, and Anjuta maybe.16:04
jmlLots and lots of choices.16:04
jmlAlso, neither Ubuntu nor Canonical really has any control over them16:04
jmlWe "just" import the best open source software and integrate it really well.16:05
jmlSo that's a really tough problem, and if you've got any great ideas I'd love to hear them. :)16:05
jmlHmm. This is getting rambly.16:05
jmlTime for a list16:05
jmlTo make Ubuntu a proper, first-class developer platform, we need three things:16:06
jmla) a place -- developer.ubuntu.com16:06
jmlb) a definition -- ???16:06
jmlc) a channel16:06
jmlBy "channel", I mean a smooth, short, safe path from developers to their users and back again.16:06
jmlAt one end of the path is a developer who has just released a gold version of their app (or game or what-have-you)16:06
jmlAt the other end is a user who has just installed that app and is happily running it for the first time16:06
jmlAs a developer, I want to get from the first end to the second end as quickly as possible16:07
jmlThis is for two reasons16:07
jmlThe first is that a large part of the reason I write software is to have people _enjoy_ it. They can't do that until it's installed and running on their system.16:07
jmlTrue fact.16:07
jmlThe second is that they probably won't give me any money until then, and I need money to fund my software writing habit.16:07
jmlAs a user, I want the same things, sort of.16:07
jmlI want to get the latest apps and the latest updates for apps as soon as they are available. I don't want to wait.16:08
jmlAlso, if I have to pay for software, then I want it to be smooth, easy and safe, and I most definitely want it to go to the right person.16:08
jmlAnd it's around this channel that a lot of exciting work is taking place16:08
jmlTrying to make it smoother, shorter & safer both ways.16:09
jmlLet's be more specific16:09
jmlAt the user end, we have the Software Center.16:09
jml<https://wiki.ubuntu.com/SoftwareCenter>16:09
jmlThere are a bunch of people working on this (mvo, tremolux, achuni, noodles, mpt, etc.)16:09
jmlAnd it's a huge part of what we need to make Ubuntu a more attractive target for developers.16:09
jmlIf people can't figure out how to find the app they want, install it and run it, then there's no point in writing apps that they want, is there?16:10
jmlThere's also a bunch of associated stuff like ratings and reviews that fit in here.16:10
jmlOn the other end, the developer end, things are (to me) a little more interesting16:10
jmlFirst up, Ubuntu's release cycle means that it takes between three to nine months to go from "released application" to "application in released Ubuntu"16:10
jmlAnd if the Software Center only has apps that are in the released Ubuntu, that means 3-9 months before I can get *any* feedback from users16:11
jmlWhich is rubbish.16:11
jml(Well, thinking only as a developer who wants people using their app. The full picture is somewhat more nuanced.)16:11
jmlLuckily, there are ways to get applications into the Software Center more quickly than that.16:11
jmlIf it's a paid app, then they can be submitted through <http://myapps.developer.ubuntu.com>.16:11
jmlThat can be if they're libre or proprietary. We don't care, as long as they are charged.16:11
jmlMore info tomorrow at 1900 UTC.16:12
jmlIf it's a free, libre app, then they can be submitted through the Ubuntu Application Review board16:12
jmlI don't have a URL for that -- they are elusive folk16:12
jml(maybe someone else here does?)16:12
jmlBut you can get more info tomorrow at 2000 UTC16:12
jmlAll of this gets us the "short" part of that "smooth, short, safe" path I talked about16:13
jml<davidcalle> url for ARB -- https://wiki.ubuntu.com/AppReviews16:13
jmlBut before *any* software can be installed from the Ubuntu Software Center, it has to be packaged.16:14
jmlAnd frankly, many developers have neither the time nor the inclination to do so.16:14
ClassBotali1234 asked: What about unpaid, proprietary apps?16:14
jmlali1234: They are a special case, and generally the authors of those have to speak directly to Canonical. I *think* (but am not 100% sure) that Skype is an example of this.16:15
ClassBotAndy80 asked: are you already in touch with Rovio guys? I'd like to have Angry Birds in Ubuntu. I can ask one of them if you want or make them and Canonical be in touch.16:15
jmlAndy80: thanks. I'm pretty sure that Canonical has already been in touch with them. That'd be a great question to ask John Pugh in his session on Friday.16:16
jmlali1234: I think the partner repo is the current mechanism for getting unpaid, proprietary apps into Ubuntu16:16
jmlali1234: and if there are plans to change that, no one has told me.16:16
jmlfwiw, Canonical's interest is in paid stuff, because we keep some of that money, and libre stuff, because we love open source and think it's vital to a sustainable platform.16:17
jml(he says, very broadly, as an informed engineer who doesn't make business decisions)16:18
jmlanyway, where was I16:18
jmlpackaging!16:18
jmlLots of developers never ever want to do it.16:18
jmlThe Angry Birds guys, for example, probably never want to read the Debian policy manual16:19
jml(which has twelve chapters and seven appendices, just so you know)16:19
jmlThis makes that "smooth, short, safe" path I mentioned earlier a lot more rough and full of potholes16:19
jmlMost of the work that I am doing currently is in making that smoother.16:19
jmlI've been taking the great work that james_w has done on pkgme (http://pkgme.net)16:20
jmland have been making it automatically package binary tarballs16:20
jmlsince that's what we're getting when most people submit their apps to us16:21
jmlWe've got the proof-of-concept done16:21
jml... and written up a spec: https://wiki.ubuntu.com/AutomagicBinaryPackaging16:21
jmlAnd achuni's team have started adding hooks into myapps.developer.ubuntu.com16:21
jmlso the idea will be that people can submit binary tarball over the web, and then they'll be automatically packaged, put into a PPA and queued for testing16:22
jmlwithout the developer having to know anything about it16:22
jmlpkgme is pretty generic, so we're also hoping (slightly longer range) to allow more "backends" than just binary tarball16:23
jmlPython apps, Ruby apps, HTML 5 apps etc.16:23
jmlfor commercial apps, there's currently a very short turn-around time to getting them reviewed & approved16:23
jmlfor gratis+libre apps, it's a bit longer, but the ARB is working on that.16:24
jml(More info tomorrow at 2000 UTC w/ stgraber)16:24
jmlThere's a whole bunch of questions that will need to be answered16:24
jmlA big one is safety16:25
* jml decides about answering questions16:25
jmlOK. But I really want to talk about safety and other controversial subjects :)16:26
ClassBotAndy80 asked: to make developers life easier, what do you think about preparing a better documentation for "Ubuntu API" ? I make you a clear example: without the suggestion from Andrea Azzarone I would never know that there was an "EmptyTrash" d-bus method exposed by Nautilus 3 :P luckly he told me about it and I was able to work on a bug in few hours.16:26
jmlAndy80: heck yes.16:26
jmlAndy80: we're hoping to start that sort of documentation with developer.ubuntu.com in the next few weeks16:26
jmlAndy80: there are some things that make it complicated though16:26
jml1. We have to make opinionated choices about what to document16:27
jmle.g. the ayatana notification bubble thingy is an obvious thing to document and call part of the "Ubuntu API"16:27
jmlbut when we pick Nautilus, we're implicitly saying that KDE isn't part of that Ubuntu API16:28
jmlwhich is maybe fair enough16:28
jmlthe more options we provide, the more documentation we need to write *and* the more confusing that documentation becomes16:28
jml2. There's a *lot* of stuff to document16:28
jmlSo it's going to have to be a Canonical + community effort. It's just too big a challenge.16:29
jml3. It's got to be well coordinated and curated16:29
jmlThe last thing we want is a wiki full of docs that are of dubious quality & currency, and aren't findable. We want something that's better than MSDN, the Java docs, Android docs etc.16:30
jml4. It's hard to guarantee such an API long term16:30
jmlsince we don't write the libraries, often.16:31
=== Kroosec is now known as Mipixal
jmlAs an example, my friend & colleague ev has been porting a bunch of stuff from PyGTK to PyGI recently16:31
jmlnot because he wants to, or because it's fun, or even because it will provide a better user experience16:31
jmlit's because PyGTK isn't supported any more for GTK3+ and PyGI is.16:32
jmlThat's a change in API that's beyond our control16:32
jmlOk, and last one...16:32
jml5. To document something you have to figure it out16:33
jmland that can often take some time. e.g. rickspencer3's recent posts to planet about how to copy and paste in GTK+ apps, or drag and drop.16:33
jmlAndy80: so yes, we'd love to do it, and in a few weeks when the new d.u.c is up, that will be the very beginning.16:34
jmland we'll need your help.16:34
jmlOK.16:34
jmlSo we talked about how we're smoothing the path from user to developer by automatically packaging16:34
jmlAnd how we're shortening it by enabling app authors to get their app onto stable versions of Ubuntu16:35
jmlthrough either the ARB or myapps.developer.ubuntu.com16:35
jmlI want to say a very little about how we're going to make it safe(r)16:35
jmlHmm.16:35
jmlHow do I put this16:35
jmlIf there's one thing we can learn from Windows, it's that it is a bad idea to let people download random crap from the Internet and then run it.16:36
=== AMedOs_ is now known as AMedOs
jmlAnd if we allow app authors to just write stuff and get it into the software center, then we have that problem16:36
jml"Review" and "testing" can't be the answer16:37
jmlSome random website I looked at, which is therefore totally trustworthy, said that the iPhone app store gets over 1000 new apps submitted per day16:37
jmlI want Ubuntu to be that popular for app authors16:38
jmlBut I also want Ubuntu to be the stable, trusty, well-integrated system that I know and love today.16:38
jmlthere's always going to be a lot of tension here16:39
jmlbut there's some technical stuff we can do to reduce that tension16:39
jmlwhich is application isolation16:39
jmlWhat we'd like to do (and this is all very vague atm) is have some way of automatically (maybe?) wrapping applications up in some sort of container so we can trust them to not do damage to the system16:40
jmlEither accidentally or intentionally16:40
jml(actually, "accidentally" is probably the best thing to aim for. It's almost impossible to stop someone messing with your computer deliberately if you are running their code and they want it badly enough)16:40
jmlArkose (https://launchpad.net/arkose) by stgraber has made some great strides here16:41
jmlI'm looking forward to playing with it (shamefully, I haven't yet), and maybe integrating it into pkgme or something similar16:41
jmlWhich would go some way to making that path safer.16:41
ClassBotAndy80 asked: don't you think that "isolating" apps could make applications only compatible with Ubuntu? For example if someone makes an application that works on 99% distro BUT it requires more coding to be compatible with Ubuntu, the developer would say: ok.. I don't release it for Ubuntu.16:42
jmlAndy80: hmm. possibly.16:42
jmlAndy80: I think there are a couple of things that would help there.16:43
jmlfirst is that no one seems to have a problem with open source apps running uncontained16:43
jmlbecause there's a chance to figure out what they are doing16:43
jmland so, I doubt anyone would push too hard for a mandatory containment policy for open source apps16:43
jmlsecond, I think we can make it very little work16:44
jmljust specifying what the app needs.16:44
jmlthird, to some extent, if you want to write a desktop app for linux *and* you want users, you probably want to make it work for Ubuntu16:45
jmlbut we can't rely on that.16:45
jmlfourth, I hope that the benefits would be really obvious and that the idea wouldn't be too unfamiliar.16:46
jmlI don't have an iPhone, but my Android phone has already made this concept pretty familiar to me.16:46
ClassBotMipixal asked: Isn't  AppArmor an answer to wrapping applications ?16:46
jmlMipixal: yes. Or rather, it's part of the answer.16:46
jmlMipixal: the security folks I've spoken seem to be leaning towards some combination of AppArmor and Arkose16:47
jmlspoken *to*, rather16:47
jmlhmm.16:47
jmlI think that's pretty much it.16:48
jmlThe idea is that with all of these pieces in place -- software center, developer portal, a defined platform, automagic packaging, safe mechanisms for distributing new apps & paying developers -- then Ubuntu becomes something that developers can seriously start to target16:48
jmlAny more questions?16:48
ClassBotmohammedalieng asked: what about making an Ubuntu IDE, that's the default IDE for creating Ubuntu apps ?16:49
jmlThere isn't currently a default IDE.16:49
jmlIt would be a great thing to have something that is to Ubuntu what Xcode is to OS X16:50
jmlHowever, I'm not going to write one :)16:50
jmlAnd I don't know of anyone with serious plans along these lines.16:50
ClassBotThere are 10 minutes remaining in the current session.16:50
jmlI would suggest that the best place to start is by making one of the existing IDEs better.16:50
jmlRight, eclipse would be a great place to start.16:51
ClassBotsamtay asked: What about adding a donate button on open source projects in Ubuntu Software Center?16:51
jml+1 We want that so badly.16:51
jmlBut I don't know where it sits on the roadmap16:51
ClassBotali1234 asked: What is the revenue split for paid apps?16:51
jmlCanonical passes on 80% to the application author.16:52
jmlI guess one thing I'd add, reminded by bUbu87's comment16:53
jmlis that if we want way more apps16:53
jmlwe need way more developers16:53
jmland they will probably be people who are new to Ubuntu and the UNIX way of doing things16:53
jmlpeople who look at me funny when I say I use emacs16:54
jmland make jokes about whether I bang rocks together to make fire also16:54
jmlso part of who we're trying to appeal to now are the developers who are not yet using or even thinking of Ubuntu16:55
jmlAnyway, that's it from me.16:55
jmlOh. Crap.16:55
jmlOne more thing16:55
ClassBotThere are 5 minutes remaining in the current session.16:55
jmlIf you want, you can sell your libre application on the software center16:55
jmlrickspencer3 is doing this with photobomb16:55
jmlthe code is fully available, there's a public ppa16:56
jmland that's one hack you can do if you want donations16:56
jmlOK. That's really it.16:56
jmlCiao16:56
jml[]16:56
=== 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: Introducing Bazaar Explorer: Version Control for your Apps - Instructors: Riddell
dpmThanks jml for a great session!17:00
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/09/05/%23ubuntu-classroom.html following the conclusion of the session.17:00
dpmNext up is Jonathan Riddell, the Kubuntu rockstar who's on his way of becoming a bzr rockstar this cycle too17:01
Riddellgood day everyone17:01
RiddellI'm going to give an introduction to Bazaar Explorer17:02
Riddelland convince you it's a developer tool everyone should use17:02
Riddellyou can follow along by following the images at http://ec2-184-72-177-203.compute-1.amazonaws.com/owncloud/17:02
Riddellaccess with guest/guest17:02
RiddellBazaar is the world's finest revision control system17:03
Riddellif you're coding on files, or even have any non coding files you should use it to keep track of them17:03
Riddellit's fully distributed so you can use it to collaborate with others very easily17:03
Riddellyou don't need a fancy server to use it, it works locally fine17:04
Riddellbut it's also easy to put on a server, http or ssh is all you need17:04
Riddellif you don't want it distributed you don't have to17:04
Riddelland it's designed to be easy to use for people familiar with CVS or Subversion17:04
Riddellit gives the full power of tools like git but it's understandable to people other than Linus17:05
Riddellit's used everywhere in ubuntu17:05
Riddellto store all our packaging and code17:05
Riddelland it's used in large projects like mysql17:05
Riddellmost people will be familiar with Bazaar through bzr, the command line interface17:06
Riddellcommand line interfaces are great for those of use who are comfortable with command lines17:06
Riddellbut as Ubuntu spreads out amongst non-geeks we need it to be available to everyone17:07
Riddelland besides sometimes GUIs are just better even for hardcore geeks17:07
Riddellso Bazaar Explorer is the GUI for Bazaar17:07
Riddellwell I should say it's /a/ GUI for Bazaar17:07
Riddellbut it is by far the most complete17:07
Riddellbulldog98 asked: what toolkit is it written in?17:08
Riddellit's written in Qt with Python17:08
Riddellan excellent choice for writing any GUI application17:08
RiddellQt means its cross platform so it runs anywhere17:09
RiddellPython means its easy to fix and improve17:09
Riddellyou can install it from any package manager17:09
Riddellsudo apt-get install bzr-explorer   will do it17:09
Riddelland run it from the application menu where it's listed as Bazaar Explorer17:10
Riddellor from a command line as:  bzr explorer17:10
Riddellwhen you start it, it'll look like the image 01 on that owncloud server or http://www.flickr.com/photos/jriddell/6116796188/in/photostream17:11
Riddellactually if you've never used Bazaar before it'll probably prompt you for your name and e-mail first17:11
ClassBotbulldog98 asked: what toolkit is it written in?17:13
ClassBotbulldog98 asked: why does the oneiric package depends on tango? Can’t oxygen be used?17:13
Riddellhmm, this bot is fiddly17:13
Riddellit uses Tango icons, there's not currently an option to use Oxygen icons I'm afraid17:13
Riddellfixes welcome :)17:13
Riddelllet's use bzr explorer to get some code17:14
Riddellhttp://www.flickr.com/photos/jriddell/6116252311/in/photostream  shows us going to the "Get project sources from elsewhere" tab17:14
RiddellI want to branch a project to make a change to it17:15
Riddellso I click on the Branch button and enter into the address box  lp:ubuntu-cdimage17:15
Riddellhttp://www.flickr.com/photos/jriddell/6116802008/in/photostream17:15
Riddellyou can host Bazaar branches anywhere but one of the most common places to do so is in Launchpad17:15
Riddellwhich hosts any free software project for free, how very generous17:16
RiddellLaunchpad branches have a nice shortcut to their location which is  lp:17:16
Riddelland in this case I'm wanting the trunk from the ubuntu-cdimage project17:16
Riddellso I tell it to branch that code17:16
Riddellhttp://www.flickr.com/photos/jriddell/6116257777/in/photostream17:17
Riddellah but wait, what's this, which I like to initialise a shared repository?17:17
Riddellbzr is so good at making branches that it's common to make a new branch for any notable change17:17
Riddellthen you can edit the branch with out worrying about mistakes17:18
Riddelland merge it into the main branch when you're happy17:18
Riddellthis leaves a load of branch directories around on your hard disk17:18
Riddellwhich might be wasteful of disk space17:18
Riddellso a shared repository will share all the history which is the same in your branches17:19
Riddellso yes we do want to make the shared repository17:19
Riddella new dialogue box pops up http://www.flickr.com/photos/jriddell/6116801334/in/photostream/17:19
Riddellwe let it do its initialisation then we get the branch we want http://www.flickr.com/photos/jriddell/6116800620/in/photostream/17:20
Riddellan voila, bzr explorer is ready to work on this branch http://www.flickr.com/photos/jriddell/6116800344/in/photostream/17:20
Riddell<bulldog98> I can’t see a pic in the owncloud server17:20
Riddellwell just use the flickr images, they're the same17:21
Riddellif you look in a file manager it will have made a ubuntu-cdimage/ directory and within it a trunk/ directory17:21
Riddellthe ubuntu-cdimage/ directory is our shared repository and the trunk/ directory is our branch we just made17:22
Riddellin the bottom right of Bazaar Explorer is the working tree, you can open files from there to edit them if you wish17:23
Riddellor open the whole directory in a file manager or an IDE17:23
Riddelltoday I'm going to add a new Ubuntu flavour17:23
RiddellBazaarbuntu!17:23
Riddellit's going to be the distro to take over the world17:23
Riddellso I'll edit the file in ubuntu-cdimage to start making those CD images http://www.flickr.com/photos/jriddell/6116800100/in/photostream/17:24
Riddellhaving made the edit the Bazaar Explorer page will refresh to note that I have changes17:25
Riddell(if it doesn't automatically refresh then you have a version without my automatic refresh patch, you can click the "refresh" button)17:25
Riddellif I want to see my changes I can click on Diff  http://www.flickr.com/photos/jriddell/6116255747/in/photostream/17:25
Riddelland if I want to save the change to the Bazaar repository I can click on commit  http://www.flickr.com/photos/jriddell/6116804398/in/photostream17:26
Riddellthis will save the change to my local branch17:27
Riddellbut now I want to publish the change to the wider world so I need to push it to another location which is publically available17:27
Riddellhttp://www.flickr.com/photos/jriddell/6116803820/in/photostream/17:27
Riddellthere I'm pushing it to a branch on Launchpad17:27
Riddellso now anyone can see my branch on the web https://code.launchpad.net/~jr/+junk/bazaarbuntu17:29
Riddelland anyone can download it or review the change17:29
RiddellBazaar Explorer can access most of the functions of bzr, such as looking at the log of commits17:29
Riddellhttp://www.flickr.com/photos/jriddell/6116803174/in/photostream/17:29
Riddellhttp://www.flickr.com/photos/jriddell/6116258943/in/photostream/17:30
Riddellinfact it can access all the functions of bzr because if there's a bzr command without a gui you can use the "All" option to run it17:30
Riddellif I want to make more complex changes I probably want to make a new local branch http://www.flickr.com/photos/jriddell/6116802386/in/photostream/17:31
Riddelland work on that, then merge it in to trunk when I'm happy17:32
Riddellof course you don't always care about having branches17:33
Riddellyou might prefer to work more like subversion or cvs where you just checkout directly from the server17:34
Riddelland commit directly back17:34
RiddellBazaar and Bazaar Explorer support this17:34
Riddellback on the welcome page i click Checkout http://www.flickr.com/photos/jriddell/611679888417:34
Riddellhere I checkout the ubuntu seeds17:35
RiddellI make my change (adding bzr-explorer)17:35
Riddelland commit directly back http://www.flickr.com/photos/jriddell/6116798624/17:35
Riddellthat's working with existing projects17:35
Riddellbut we are App Developers and we want to make our own projects!17:36
Riddellthe Welcome page has a "Start a new Project" tab17:36
Riddellhttp://www.flickr.com/photos/jriddell/611679836417:36
RiddellI initialise a new project17:37
Riddellthere's a few options for what sort of branch you want, Feature Branches is the best sort for most cases17:37
Riddellthat'll make a shared repository and a trunk branch inside it17:37
Riddellhttp://www.flickr.com/photos/jriddell/611679806417:38
Riddellthis takes us to a new page which lists the available branches17:38
Riddellfrom here we can open a branch or make a new one17:38
Riddellas a new project working on trunk is expected so we can add our files http://www.flickr.com/photos/jriddell/611625421117:39
Riddelland commit them http://www.flickr.com/photos/jriddell/611625392717:39
Riddellhttp://www.flickr.com/photos/jriddell/611679712017:39
Riddelland if I wanted I could push it to Launchpad or anywhere else17:39
Riddell<trinikrono> bazaar explorer is awesome!17:40
Riddellwhy thank you trinikrono, free hugs to you17:40
Riddellnow I said that Bazaar is used throughtout Ubuntu17:40
Riddellwe now have (almost) every ubuntu package kept in a Bazaar branch17:41
Riddellso you can use Bazaar Explorer to branch any Ubuntu package if you feel the need to fix it or otherwise look at the source code17:41
Riddellhttp://www.flickr.com/photos/jriddell/611679688017:41
Riddellhere I'm getting the code to Ubuntu's choqok package17:42
Riddellby branching   ubuntu:choqok17:42
Riddellwhich gives me the code to work on http://www.flickr.com/photos/jriddell/611679660817:42
ClassBotbUbu87 asked: so upstream development just maps to pull requests on the package's launchpad branch?17:42
RiddellbUbu87: you're talking about the Ubuntu package branches?  Those are imports of packages in Ubuntu so they're not the upstream development branch17:43
Riddellso if you want to fix a problem which is specific to ubuntu then use those17:43
Riddellif it's a general problem in the program then use the normal upstream code whereeever that is kept17:44
RiddellBazaar Explorer is a nice GUI which works along with your IDE or file manager/text editor for working with code in Bazaar branches17:45
Riddellthere is a half way between the GUI and command line interfaces17:45
Riddellwhich is to launch QBzr commands directly from the command line17:46
Riddellso if you're into using command lines but want an easier way to, say, browse a branch history you can run17:46
Riddellbzr qlog17:46
Riddellinstead of bzr log17:46
Riddellwhich will give you a GUi to look at the log17:46
RiddellI use this a lot whenever the history is more complex than straight commits17:47
Riddellthe same goes for   bzr qcommit  or bzr qbranch17:48
Riddellit's a nice alternative for when the command line is showing its limitations17:48
ClassBotdpm asked: are there Bazaar Explorer packages for platforms other than Ubuntu? (e.g. Win, Mac...)17:48
Riddellif you install Bazaaron Windows the installer comes with explorer17:49
Riddellsame for Mac I'm sure17:49
Riddellso it's actually the main UI for non-Linux users17:49
Riddellwhich is why if you follow the Take the Tour link on http://bazaar.canonical.com/en/  it shows you Bazaar Explorer17:50
Riddellthat's all I have prepared, any other questions?17:50
ClassBotThere are 10 minutes remaining in the current session.17:50
ClassBotbulldog98 asked: will there be a port to freedesktop icon usage?17:51
RiddellI see this is an important issue for you :)17:51
RiddellI think when Bazaar Explorer was started Tango was the obvious choice17:52
Riddellsince then Oxygen has come along and the freedesktop icon standard is more available17:52
Riddellbut I don't think freedesktop icons are built into Qt so there's a little bit of code needed there17:52
Riddelldo file a bug if it's something you want done and hopefully we'll get round to iy17:53
Riddellit17:53
ClassBotdpm asked: apart from Bazaar Explorer, are there other recommended graphical tools? I.e. I know there's qbzr and bzr-gtk, but I don't know if picking one over the other is a matter of choice or whether there is a recommended one to use17:53
Riddellqbzr is the GUi for individual commands17:53
Riddelle.g.  bzr qlog17:53
Riddellwhen you ask Bazaar Explorer to show you the branch log it will run  QBzr's qlog17:54
Riddellyou can also tell Bazaar Explorer to run bzr-gtk commands instead of QBzr if you really want17:54
Riddellbut QBzr is generally better maintained and is the default17:54
Riddellthe other main graphical tool is Loggerhead which is the web UI17:55
ClassBotThere are 5 minutes remaining in the current session.17:55
Riddellelite Bazaar hackers recently changed that from spitting out HTML directly to spitting out JSON so it's now a lot more flexible as a way of making UIs17:55
Riddelle.g. Launchpad can now show you a recent changes diff for merge proposals17:56
Riddellthere's some other UIs such as my own Dolphin Bazaar plugin for KDE's file manager17:56
Riddelland there's even some experimental integration with Qt Creator17:56
ClassBotbulldog98 asked: is there a graphical way to see my bazaar config, eg what bazaar plugins are run after a commit (cia-client?)17:57
RiddellThe settings menu lets you change your Bazaar config17:57
Riddellbut it doesn't do everything from a GUI17:58
RiddellUser Configuration has your user setup17:58
Riddellbut stuff like cia plugin config can only be done with editing a text file for now (Settings -> Locations)17:58
RiddellBazaar Explorer is extendable so it should be possible for the bzr-cia plugin to add that17:59
ClassBotMipixal asked: What about Bazaar branches that are mirrored from other sources (not hosted on Launchpad). Does pushing commits make them available only on Launchpad or to original sources  too ?17:59
Riddellit depends where you push them18:00
Riddellif you push them back to where you got it from then it'll be available in the same place18:00
Riddellif you push it to Launchpad it'll be available on Launchpad18:00
Riddellthere's no fixed tie in between bzr and Launchpad18:00
Riddellit's just that Launchpad has been designed to work very well with Bazaar18:00
=== 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: Your App and Launchpad best practices - Instructors: jderose
Riddelltime up!18:00
dpmThanks Riddell for a really awesome session - even with pictures!18:00
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/09/05/%23ubuntu-classroom.html following the conclusion of the session.18:00
dpmNext up is Jason DeRose, of Novacut fame, who'll be talking about how to make the best use of Launchpad for your project18:01
dpmjderose, the floor is yours!18:01
jderosedpm: thanks!18:01
jderoseHello everyone!  My name is Jason Gerard DeRose.18:01
jderoseTrue story: I include my middle name so I'm not confused with the Jason DeRose who is a reporter for NPR :P18:02
jderoseI'm the lead Novacut developer: https://wiki.ubuntu.com/Novacut18:02
jderoseThe Novacut project uses Launchpad extensively.18:02
jderoseI also think Novacut uses Launchpad rather well, thanks to rockstar (aka Paul Hummer): https://launchpad.net/~rockstar18:02
jderoseAbout 8 months ago, rockstar was kind enough to spend a few hours schooling me on Launchpad best practices.18:02
jderoserockstar gave me an opinionated recipe that allowed Novacut to use Launchpad well from the start.18:03
jderoseSo that's what this session is about: Launchpad best practices, boiled down into a step-by-step recipe that you can use in your own project.18:03
jderoserockstar's advice is too good not to share, plus I'm going to share some of my own lessons.18:03
jderoseI have the session split into 3 sections:18:03
jderose(1) Why host your upstream app on Launchpad?18:04
jderose(2) Setting up your app on Launchpad18:04
jderose(3) Using Launchpad to engage developers18:04
jderosePlease feel free to ask questions at any time in #ubuntu-classroom-chat, plus I'll have some time at the end devoted to questions.18:04
jderoseOkay, here we go!18:04
jderose== Why host your upstream app on Launchpad? ==18:04
jderoseQuestion: why host on Launchpad instead of, say, github?18:05
jderoseAnswer: PPAs, Daily Builds, and tens of millions of Ubuntu users!18:05
jderoseI'm a firm believer in getting reality checks from your target users as often as possible.18:05
jderoseYou don't want to do too much development before getting that software into your target users hands.18:05
jderoseOtherwise you're almost certain to get off track.18:06
jderoseAnd assuming your target user isn't "geeky developers", it needs to be easy for your users to install your app and get updates.18:06
jderosePPAs (Personal Package Archives) are fantastic for this.18:06
jderosePPAs are easy enough to add that I think whoever your target user is, a decent percentage will be comfortable adding your PPA and using your app that way.18:06
jderoseFor example, Novacut has a Stable Releases PPA where we publish our monthly releases:18:07
jderosehttps://launchpad.net/~novacut/+archive/stable18:07
jderoseNovacut also has a Daily Builds PPA where we publish automated daily builds of all our components:18:07
jderosehttps://launchpad.net/~novacut/+archive/daily18:07
jderoseWe do our daily builds using the amazing and totally fantastic Source Package Recipes!18:08
jderoseWhich are a relatively new Launchpad feature: https://help.launchpad.net/Packaging/SourceBuilds18:08
jderoseFor example, this is the recipe for the dmedia daily build:18:08
jderosehttps://code.launchpad.net/~novacut/+recipe/dmedia-daily18:08
jderoseNow you don't need (nor want) your entire user base using your daily builds.  You just need a representative sample.18:09
jderoseAnd, again, I feel PPAs are easy enough to add to the software center that you get that representative sample18:09
jderoseDaily builds are also a great convenience for developers and in my experience are quite effective developer outreach.18:10
jderoseDaily builds also help keep your trunk in a high-quality, releasable state.18:10
jderoseThanks to something I learned from Barry Warsaw during the previous Ubuntu App Developer Week, we even run our Python unit tests during the daily builds.18:10
jderose(See the IRC logs: https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/RockSolidPython)18:10
jderose== Setting up your app on Launchpad ==18:11
jderoseI'm going to walk you through setting up a project, a team, and PPAs for your app.18:11
jderoseI recommend you walk through these steps with me using the Launchpad sandbox: https://qastaging.launchpad.net/18:11
ClassBotpaglia_s asked: do you advise launchpad for project not related to Ubuntu? Why to use it instead of github for example for my new web app?18:12
jderosepaglia_s: well, i'd say it depends first of all on whether you like using bzr + Launchpad or git + Github18:12
jderoseobviously a webapp doesn't benefit from daily builds18:13
jderoseone think i well say about launchpad is i think it has a better team workflow than anything else right now18:13
jderosepersonally, i'd use launchpad, but that's because git kinda drives me crazy :P18:14
jderosenot that git isn't a fantastic tool, mind you18:14
jderoseokay...18:14
jderoseI recommend you walk through these steps with me using the Launchpad sandbox: https://qastaging.launchpad.net/18:14
jderoseChanges in the sandbox aren't permanent, don't affect the "real" Launchpad.18:14
jderoseOne quick digression: when you do this for real, take the time to pick a good name for your app!18:15
jderosePick a name that is easy to spell, easy to remember.18:15
jderosePick a name that you can build a strong brand around!18:15
jderoseBut in the sandbox, you'll just have to pick a project & group name that doesn't exist yet.18:15
jderoseWe wont judge anyone based on bad app names in the sandbox :P18:15
jderoseFor my example, I'm going to use one of *my* personal favorite projects on Launchpad.18:15
jderoseBut granted, I'm rather biased :-D18:15
jderose** Step1, register a project: https://qastaging.launchpad.net/projects/+new18:16
jderose// Name: Novacut18:16
jderose// URL: novacut18:16
jderose// Title: Novacut Video Editor18:16
jderose// Summary: Novacut is a collaborative video editor...18:16
jderoseNow something to point out about these fields is that you cannot change the URL after you create the project.18:16
jderoseThe URL is really your app name, as far as Launchpad goes, and so this is permanent.18:16
jderoseThe Name, Title, and Summary fields can all be changed.18:17
jderoseIf possible, I recommend the URL (Launchpad name) be what you use to namespace your app everywhere.18:17
jderoseFor example, "novacut" is the name of the Novacut Python package, and its Debian source package.18:17
jderoseOkay, now click "Continue" and Launchpad will likely show you a list of similar sounding projects, to help make sure the same project doesn't get registered twice.18:17
jderoseIf this happens, click "No, this is a new project".18:17
jderoseNow you'll be at the "Step 2 (of 2) Registration details" page.18:17
jderoseThe only thing you must do here is indicate the license(s) your software uses.18:18
jderoseLaunchpad provides free project hosting for open-source software, but not for proprietary software.18:18
jderose(Although there is paid hosting available for proprietary software.)18:18
jderoseWhen in doubt, I go with GNU GPL v3, but that's just me ;)18:18
jderoseAnyway, pick at least one license, and the click "Complete Registration".18:19
jderose** Step2, register a team: https://qastaging.launchpad.net/people/+newteam18:19
jderose// Name: novacut18:19
jderose// Display Name: Novacut Dev18:19
jderoseOn the team page, the "Name" is the Launchpad name of the team, the thing that can't be changed.18:19
jderoseThe team will be the owner of the PPAs you use for your app, and that's why you want a team name that matches the project name (more on that in a moment).18:20
jderoseLeave the rest of the fields as they are, and then click on "Create Team".18:20
jderose** Step3, create PPAs18:20
jderoseYou'll create two PPAs, one for daily builds and another for stable releases.18:21
jderoseOn the page for the team you just created, you'll see a "Personal package archives" section.18:21
jderoseClick "Create a new PPA":18:21
jderose// URL: daily18:21
jderose// Display name: Novacut Daily Builds18:21
jderoseCheck "I have read and accepted the PPA Terms of Use", and the click "Activate".18:22
jderoseYou'll be at the page for the PPA you just created.  Click "Overview" to go back to the team page.18:22
jderoseClick on "Create a new PPA" again, this time you'll create the stable releases PPA:18:22
jderose// URL: stable18:22
jderose// Display name: Novacut Stable Release18:22
jderoseAnd then click on "Activate".18:22
jderoseNow the shortcut-URI used to add a PPA into the Ubuntu Software Center is:18:23
jderoseppa:team-name/ppa-name18:23
jderoseThat's the reason I recommend you create a team with the same name as the project... consistent, easy to remember branding.18:23
jderoseSo in the Novacut example, we have two PPAs:18:24
jderoseppa:novacut/daily18:24
jderoseppa:novacut/stable18:24
jderoseIn terms of spreading awareness of these PPAs, it's good that their ppa:novacut/* instead of ppa:jasons-awesome-team/*18:25
jderose:-D18:25
jderoseI've seen the "daily" and "stable" PPA names used a lot on Launchpad, and I'm personally on a mission to have more projects adopt the convention.18:25
jderoseThe reason is it makes Launchpad easier to use, and I believe strengthens it as an ecosystem.18:25
jderoseSay you learn about PPAs via Novacut, but then get interested in the "foo" project.18:26
jderoseWouldn't it be nice if there were familiar ppa:foo/daily and ppa:foo/stable PPAs?18:26
jderose## So in summary... ##18:27
jderoseCreate a project: https://launchpad.net/novacut18:27
jderoseCreate a team with the same name: https://launchpad.net/~novacut18:27
jderoseCreate daily PPA like ppa:novacut/daily18:27
jderoseCreate a stable PPA like ppa:novacut/stable18:27
jderoseSo I pause a moment... does anyone have any questions before we switch gears a bit?18:28
jderoseokay, moving on...18:28
jderose== Using Launchpad to engage developers ==18:29
jderoseNow this last section is really all rockstar's advice.18:29
jderoseI could have called this section "day to day Launchpad workflow"...18:29
jderoseBut as long as you're developing out in the open, it might as well have the side effect of attracting new developers!18:29
jderose** Plan releases using bugs and milestones18:30
jderoseNovacut does monthly release of all our components, and each month has a corresponding milestone in Launchpad.18:30
jderoseFor example, the 11.09 `novacut` milestone: https://launchpad.net/novacut/+milestone/11.0918:30
jderoseOr the 11.09 `microfiber` milestone: https://launchpad.net/microfiber18:30
jderoseBased on rockstar's advice, we plan our features using bugs rather than blueprints.18:31
jderose(rockstar said that aside from planning Ubuntu Developer Summits, blueprints aren't used that much.)18:31
jderoserockstar didn't go into all the details as to why he recommended using bugs over blueprints, but i trust him on this... plus18:32
jderosein my experience bugs seems more "actionable" than blueprints... and i'm an action oriented person, so i like that :)18:32
jderoseAt the start of each monthly cycle, we have an idea of what bugs we'd like to land in that release, and they're targeted to that milestone.18:33
jderoseWhen release day comes, bugs that haven't landed just get re-targeted to the next milestone.18:33
jderoseI usually target what I consider the highest priority bugs to the current milestone, and lower priority to the next.18:33
ClassBotOdd-rationale asked: Is that retargeting automatic?18:34
jderoseOdd-rationale: no, it isn't, at least not through the web interface... you can do it through the launchpad API, although I haven't played with this myself18:34
jderosethis is something i'd like to see improved in launchpad... more automation through the web interface, especially along these best practice workflows18:35
jderoseThe milestone gives interested people a way to see what's going on in the near term, where they might get involved should the be interested.18:36
jderoseThere are also several people that follow the progress by subscribing to the bug mail.18:36
jderoseWhich I was rather surprised by, actually... but it means there are some people that know the software quite well, even though they've never tackled a bug or code review18:38
jderosewhich is awesome :)18:38
jderose** Have a ready supply of Bite Size bugs18:38
jderose"Bite size" bugs are small features or fixes that should be rather easy for a new developer to take on.18:38
jderoseI recommend following the same convention that Ubuntu does and tagging these bugs "bitesize".18:38
jderoseFor example: https://bugs.launchpad.net/novacut/+bugs?field.tag=bitesize18:39
jderoseI've also started putting [BiteSize] in the bug summary.18:39
jderoseAfter my experience the last year mentoring on bitesize bugs, I'd say the most important thing is just to get people through the bzr + Launchpad workflow steps.18:40
jderosePeople might be new to these tools, so you want the actual bug to be very simple.18:40
jderoseIn my experience, you'll get a lot better response if you promote new bitesize bugs as you file them, for example on Twitter, Google+, etc18:40
jderoseNow bitesize bug are interesting critters in that you never know what bug someone will bite on :)18:41
jderosePeople will surprise you18:41
jderoseBut this also means... if a bitesize but is blocking other work, you don't want to let it sit out there for too long18:42
jderoseAt least in my experience, if someone is going to take on a bitsize bug, they usually do so shortly after it's filed18:42
jderoseSo if it's been a week or more, don't feel bad about doing the bitsize bug yourself to keep the pace high18:43
jderose** Do code reviews18:43
jderoseI think bzr + Launchpad provide a fantastic team workflow, and part of that workflow are code reviews.18:43
jderoseIn my mind, the most import part of doing code reviews is to make sure that at least 2 people are familiar with every bit of code.18:43
jderoseYes, bugs may be found, design issues might be critiqued.18:44
jderoseBut more often, it's just one developer explaining the change to another.18:44
jderoseCode reviews are also a way to get new developers engaged in the project.18:44
jderoseIn my personal experience, new devs have started with bitesize bugs more often than code reviews, but the code reviews are priceless all the same.18:44
jderoseAlso, Launchpad is quite generous with Karma for code reviews... and people like that :)18:45
jderoseLike with bitesize bugs, you'll get a more responses on your code reviews if you promote them on Twitter, Google+, etc18:46
jderose** Make sure your Launchpad project page is useful!18:46
ClassBotpaglia_s asked: i've noticed that launchpad is quit slow loading pages... there are plan to improve the load time?18:46
jderosepaglia_s: well, i'm not a launchpad developer, so i can't answer definitively... but i know performance improvements are always a priority18:47
jderosebut i do agree that slow load times are the biggest problem with launchpad18:48
jderoseoverall things seemed to have improved a lot over say the past year18:48
jderosebut sometime it still feels to slow18:48
jderose** Make sure your Launchpad project page is useful!18:48
jderoseThe "Description" field is a good place to put links to useful things.18:49
jderoseI think you would always link to your Daily and Stable PPAs from here, and also have a link to bitesize bugs and active-reviews.18:49
jderoseTo use my favorite example again: https://launchpad.net/novacut18:49
jderoseAlso, if there is developer or user documentation on the web, please link to that also!18:49
jderoseThis is a place where my favorite project gets and F right now :(18:49
jderoseA place we need to improve, and are working on it18:50
jderose== Okay, Questions? ==18:50
ClassBotThere are 10 minutes remaining in the current session.18:50
ClassBotOdd-rationale asked: Can you explain what is a code review? Is it like a merge request?18:51
jderoseOdd-rationale: yeah, exactly... i mean a merge request, should have made that clear18:51
jderosenow, rockstar had great advice here for me:18:51
jderoseeven if you made the merge request, and it's for your project, try to get someone from the community to approve the merge18:52
jderoseobviously you don't need permission to merge into your own project :)18:52
jderosebut this is an opportunity to build knowledge of the code :)18:53
jderosebut like bitesize bugs... i wouldn't let reviews block you for too long18:53
jderoseif no one is interested after a few weeks, just self approve it :)18:54
jderosealthough these days there are enough novacut regulars that i pester one of them into doing the review if no newcomers have taken interest18:54
jderoseany other questions?18:54
ClassBotThere are 5 minutes remaining in the current session.18:55
jderoseBTW, the merge request + review is a big part of why I think launchpad has such an effective team workflow18:56
jderoseAnd one last thing, if anyone has any questions about any of this later, you can always find me in #novacut :-D18:56
jderoseAnd rockstar generally lurks in #novacut too, so you can go to the source18:56
jderoseWell, the time is running down.... I'll try to think of something awesome to say...18:57
jderoseAnd in the mean time, I hope everyone has a great App Developer Week! There is always so much to learn... and great people to meet18:58
jderoseawesome thing: let's turn the design rigor up to 11 and make apps that exceed everything else in the industry... because that sounds more fun than playing catch up :-D18:59
=== 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: Getting Started With Python: a Hello World App - Instructors: AlanBell
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/09/05/%23ubuntu-classroom.html following the conclusion of the session.19:00
AlanBellgood morning/afternoon/evening all19:01
AlanBellwelcome to this Application Developer week session on Python19:01
AlanBellso after jderose turning things up to 11 we are going to go back and start with 1 2 319:02
AlanBellThis session is an introduction to Python from the very very beginning, I going to do my best to assume no prior knowledge at all.19:02
AlanBelljust so I can see who is here say hi in the #ubuntu-classroom-chat channel o/19:02
AlanBellgreat, I love to have an audience :)19:03
AlanBellso Python is a programming language, but not a scary hard one.19:03
AlanBellPython is kind of like BASIC, except you don't have to be embarrassed about saying you are a Python programmer!19:03
AlanBellwe are going to write a computer program, which is a set of instructions to the computer to tell it to do some interesting stuff for us.19:04
AlanBellLets get set up first, we are going to need a text editor to write the instructions in and a terminal to tell the computer to do the instructions.19:04
AlanBellhopefully you will find them next to each other in the Applications-Accessories menu19:05
AlanBellor if you are using unity hit the super key and type gedit and return for the editor19:05
AlanBelland terminal for the terminal19:05
AlanBellthey are also somewhere to be found in the apps lens, but that is another story altogether19:06
AlanBellso open both of them now and get comfortable with the three windows on screen, IRC, terminal and gedit19:06
AlanBellare we sitting comfortably?19:06
AlanBellplain old text editor is perfect, none of your fancy IDEs for this session19:07
AlanBellTraditionally the first program you should write in any language is one to get the computer to say hello to the world! so lets do that.19:08
AlanBellin the text editor type the following:19:08
AlanBellprint "Hello, World!"19:08
AlanBellthat is it, your first program, now lets save it and run it (I did tell you it looked like BASIC)19:09
AlanBellfile-save as and call it hello.py19:09
AlanBellthis will save it into your home directory by default, fine for now, but you would probably want to be a bit more organised when doing something serious19:09
AlanBellfeel free to be more organised right now if you like :)19:10
AlanBellok, now in the terminal lets run the program19:10
AlanBellpython hello.py19:10
AlanBelldid it say hello to you?19:10
AlanBellas I saved it in the home directory and terminal starts there by default it should just work, if you are putting things in folders you might need to navigate to it with the cd command or specify the path to the program19:12
AlanBellok, so that was running the program by running python then the name of our application, but we can do it a different way, by telling Ubuntu that our program is executable19:13
AlanBellWhat we are going to do now is try to make our program directly executable, in the terminal we are going to CHange the MODe of the program to tell Ubuntu that it is eXecutable19:13
AlanBellso at the $ prompt of the terminal type:19:13
AlanBellchmod +x hello.py19:13
AlanBellnow we can try to run it19:14
AlanBellagain at the $ prompt19:14
AlanBell./hello.py19:14
AlanBelloh noes!!!19:14
AlanBellWarning: unknown mime-type for "Hello, World!" -- using "application/octet-stream"19:14
AlanBelleveryone get that?19:14
AlanBellubuntu doesn't know how to run this application yet, we need to add some extra magic at the top of our program to help it understand what to do with it.19:16
AlanBellback in the editor, above the print "Hello, World!" add the following line19:16
AlanBell#!/usr/bin/env python19:16
AlanBellso the /usr/bin/env bit is some magic that helps it find stuff, and the thing it needs to run this application is python19:16
AlanBellnow you should be able to save that and flip back to the terminal and run your program19:16
AlanBell./hello.py19:17
AlanBellthat should now run :)19:17
AlanBellas has been pointed out in python 3 you need to put brackets round the string so19:18
AlanBellprint ("hello world")19:18
=== mohammed is now known as Guest99895
AlanBellwhich works in all versions of python19:19
AlanBellOK, lets go on to the next concept, giving our program some structure19:20
AlanBellback to the editor, and between the two lines we have already add a new line19:20
AlanBellwhile 2+2==4:19:20
AlanBelland on the next line put four spaces before the print ("Hello, World!")19:20
AlanBelland save that19:20
ClassBotMoshanator asked: can i just ./hello.py?19:21
ClassBotlunzie asked: ​ are the quote brackets proper form?19:21
AlanBellthe brackets round the quotes are better form as they work on python 319:21
AlanBellso the while statement we added starts a loop, in this instance it will carry on until 2+2 is equal to something other than 419:22
AlanBellthe double equals means "is equal to" a single equals is used to assign a value to something (more on that later)19:22
AlanBellthe colon at the end is an important part of the while statement19:23
AlanBellThere is no "until" "wend" "end while" type statement at the end, as you might expect to find in lesser languages :)19:23
=== yofel_ is now known as yofel
AlanBellthe indentation of the print statement is not just cosmetic and for our benefit19:23
AlanBellthe indentation level is part of the language, when the indentation stops that is the end of the loop (or other structure that you might expect to have an end)19:23
AlanBellthis means that python always looks neat and tidy (or it doesn't work)19:24
AlanBellAlways use four spaces to indent, not three, not five and certainly not a tab.19:24
AlanBellOther indentations will work, but if you ever have to work with anyone else you must always be using the same indentation, so we all get in the habit of using four spaces.19:24
AlanBellin gedit you can set it up to use 4 spaces instead of a tab19:24
AlanBelledit-preferences, on the editor tab choose tab width 4 and insert spaces instead of tabs19:25
AlanBellmany other editors and IDEs have a similar option19:25
AlanBellLets run our new program, just save it in the editor and run it again in the terminal with ./hello.py19:25
AlanBelland that is 4 spaces per level of indentation you want so if you have a loop in a loop then the inner one will be 8 spaces indented19:26
AlanBellnow we can wait for 2+2 to be something other than 419:26
* AlanBell taps fingers19:26
AlanBellor, if you are in a hurry, you can press ctrl+c19:27
AlanBellok, so ctrl+c is handy for breaking in to an out-of-control python program19:28
AlanBellyou can do other fun stuff with the print statement, if you change it to read:19:28
AlanBell    print "Ubuntu totally rocks!   ",19:28
AlanBelland run it again (note the comma at the end)19:28
AlanBell    print ("Ubuntu totally rocks!   "),  <- for the python 3 contingent I should think19:29
AlanBellit should fill the terminal with text19:30
AlanBellthe comma prevents it doing a newline19:30
AlanBellctrl+c again to break out of it19:31
AlanBelllets do something different now19:31
AlanBellin the terminal, type python at the $ prompt and hit return19:31
AlanBellyou should have a >>> prompt and a cursor19:31
AlanBellthis is the interactive python console19:32
AlanBellyou can type print("hello") here if you want19:32
AlanBellor do some maths like:19:32
AlanBellprint 2**100019:32
AlanBellwhich will show you the result of 2 multiplied by itself a thousand times19:32
AlanBellpython is kinda good at maths19:33
AlanBellyou don't need the print statement here either19:33
AlanBellso 2**1000 should work in python 2.7 or 319:33
AlanBellyou could even try 2**100000 it won't take long, and you can always stop it with ctrl+c19:34
AlanBellwhile we are on the subject of maths, lets get the value of pi19:35
AlanBellprint pi won't do anything useful (but feel free to try it)19:36
AlanBellwe need more maths ability than the python language has built in19:36
AlanBellso we need to get a library of specialist maths stuff, so type19:37
AlanBellimport math19:37
AlanBellit will look like it did nothing, but don't worry19:37
AlanBellnow type19:37
AlanBellmath.pi19:37
AlanBell>>> import math19:37
AlanBell>>> math.pi19:37
AlanBell3.14159265358979319:37
AlanBellSo we have seen here how to import a library of functions to do something, and called one of the functions from the library (to return the value of pi)19:38
AlanBellok, so what is in the math package, apart from pi?19:39
AlanBelltry typing dir(math) at the python console19:39
AlanBell['__doc__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'hypot', 'isinf', 'isnan', 'ldexp', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']19:39
AlanBellyou can also look at http://docs.python.org/library/math.html19:40
ClassBotcallaghan asked: Is there a way to see which functions are in the imported library?19:40
AlanBellyes :)19:40
AlanBelland to get more descriptive help on each one try help(math)19:41
AlanBellso dir() lists the names and help() lists names, parameters and a little bit of help text19:41
ClassBotTheOpenSourcerer asked: is help() a python function useful for anything else?19:43
AlanBelltry help(help)19:43
AlanBellit is a function that could be used, I can't off hand think of any particularly useful use of it other than for getting help19:44
ClassBotMipixal asked: Your favourite IDE for dev with Python, on bigger projects. (In before IDE flame wars :p )19:44
AlanBellhonestly my favourite is gedit19:45
AlanBellI have used eclipse and pydev19:45
AlanBelland I liked stani's python editor (SPE) for a bit19:45
AlanBellbut all I really want is a text editor with syntax highlighting19:46
AlanBelland normally several terminal windows open across a couple of monitors19:46
AlanBellAll this command line stuff is all very well, but we want to do applications that have pretty windows and stuff!19:46
AlanBellIn the interactive console type or paste the following19:47
AlanBellimport gtk19:47
AlanBellwhich will load a library full of stuff to do with the gtk toolkit that powers the gnome desktop19:47
AlanBellnow type19:47
AlanBellfoo=gtk.Window(gtk.WINDOW_TOPLEVEL)19:47
AlanBellthat assigns a window object to a variable called foo19:47
AlanBell(the name doesn't matter, the single equals does)19:47
AlanBellbut nothing  much seems to have happened yet, so type:19:48
AlanBellfoo.show()19:48
AlanBellyay, a real live little window should be on screen now!19:48
AlanBelllets see what we can do to it with dir(foo)19:49
AlanBellquite a lot! lets try:19:49
AlanBellfoo.set_title("my little window")19:49
AlanBellgo ahead and change the title a few times19:49
AlanBellso if you type "foo.show"19:50
AlanBell<built-in method show of gtk.Window object at 0x140f2d0>19:50
ClassBotThere are 10 minutes remaining in the current session.19:50
AlanBellyou get printed out a reference to where the code for the show function is19:51
AlanBellyou need to do foo.show() to actually call the function19:51
ClassBotahayzen asked: In gedit is there anyway of adding code completion for python programming, like pydev in eclipse, via a plugin?19:51
ClassBotteemperor asked: is there any naming convention in python? (because of set_title)19:51
AlanBellahayzen: I believe there are some plugins for that, last time I tried one it was rubbish though19:52
AlanBellif anyone has any good ones I would be interested to know of them19:53
AlanBellteemperor: http://www.python.org/dev/peps/pep-0008/ here is the python style guide19:53
AlanBellmany projects have their own more detailed conventions for object names19:54
AlanBelleveryone agrees on the indentation levels though :)19:54
ClassBotAlliancemd asked: In a program changelog I saw a developer saying that he ported the code from python to java to make it faster and he said "because java is sometimes x10-x100 times faster than python". We know that java is very slow, does python have this big impact on speed?19:54
AlanBellthis is a myth19:55
ClassBotThere are 5 minutes remaining in the current session.19:55
AlanBellsometimes java does take a while to start if it has to launch a JVM, this gave applets a reputation for being slow19:55
AlanBellonce up and running it is not particularly slow19:56
AlanBellunless you are doing something massively time sensitive (where every nanosecond counts) then any language will do any task19:56
AlanBellthe performance problem is never the language, it is always the algorithm19:57
AlanBellnormally rewriting code so that it does fewer disk or database accesses will speed it up thousands of times more than changing the language it is implemented in19:57
ClassBotAlliancemd asked: What do u think of PyQt? Is it that good how people say?19:58
ClassBotmohammedalieng asked: what about python performance compared to Java ?19:58
ClassBotcallaghan asked: will there be a follow-up lesson, or where should unexperienced python-devs go from here?19:58
AlanBellnot played with Qt much19:59
AlanBellthere are some great books19:59
AlanBellsnake wrangling for kids is excellent19:59
AlanBelland the dive into python book is in the repos, you can install it from software centre20:00
AlanBellI believe there are other python classes in this channel so check the schedule20:00
ClassBotLogs for this session will be available at http://irclogs.ubuntu.com/2011/09/05/%23ubuntu-classroom.html20:00
AlanBellok, think I am out of time20:00
AlanBellthanks everyone o/20:00
=== 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 ||
Alliancemdthe schedule: https://wiki.ubuntu.com/UbuntuAppDeveloperWeek20:01

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