Canonical Voices

Michael Hall

KDE Neon developer Harald Sitter was able to package up the KDE calculator, kcalc, in a snap that weighs in at a mere 320KB! How did he do it?

KCalc and KDE Frameworks snaps

Like most applications in KDE, kcalc depends on several KDE Frameworks (though not all), sets of libraries and services that provide the common functionality and shared UI/UX found in KDE and it’s suite of applications. This means that, while kcalc is itself a small application, it’s dependency chain is not. In the past, any KDE application snap had to include many megabytes of platforms dependencies, even for the smallest app.

Recently I introduced the new “content” interface that has been added to snapd. I used this interface to share plugin code with a text editor, but Harald has taken it even further and created a KDE Frameworks snap that can share the entire platform with applications that are built on it!

While still in the very early stages of development, this approach will allow the KDE project to deliver all of their applications as independent snaps, while still letting them all share the one common set of Frameworks that they depend on. The end result will be that you, the user, will get the very latest stable (or development!) version of the KDE platform and applications, direct from KDE themselves, even if you’re on a stable/LTS release of your distro.

If you are running a snap-capable distro, you can try these experimental packages yourself by downloading kde-frameworks-5_5.26_amd64.snap and kcalc_0_amd64.snap from Neon’s build servers, and installing them with “snap install –devmode –force-dangerous <snap_file>”. To learn more about how he did this, and to help him build more KDE application snaps, you can find Harald as <sitter> on #kde-neon on Freenode IRC.

Read more
Daniel Holbach

Working with a new technology often brings you to see things in a new light and re-think previous habits. Especially when it challenges the status quo and expectations of years of traditional use. Snaps are no exception in this regard. As one example twenty years ago we simply didn’t have today’s confinement technologies.

Luckily is using snapcraft a real joy: you write one declarative file, define your snap’s parts, make use of snapcraft‘s many plugins and if really necessary, you write a quick and simple plugin using Python to run your custom build.

Many of the first issues new snaps ran into were solved by improvements and new features in snapd and snapcraft. If you are still seeing a problem with your snap, we want you to get in touch. We are all interested in seeing more software as snaps, so let’s work together on them!

Enter the Sandpit

I mentioned it in my last announcement of the last Snappy Playpen event already, but as we saw many new snaps being added there in the last days, I wanted to mention it again. We started a new initiative called the Sandpit.

It’s a place where you can easily

  • list a snap you are working on and are looking for some help
  • find out at a glance if your favourite piece of software is already being snapped

It’s a very light-weight process: simply edit a wiki and get in touch with whoever’s working on the snap. The list grew quite quickly, so there’s loads of opportunities to find like-minded snap authors and get snaps online together.

You can find many of the people listed on the Sandpit wiki either in #snappy on Freenode or on Gitter. Just ask around and somebody will help.

Happy snapping everyone!

Read more
Daniel Holbach

Learning to snap with codelabs

The background

I always felt that learning something new, especially new concepts and workflows usually works best if you see it first-hand and get to do things yourself. If you experience directly how your actions influence the system you're working with, the new connections in your brain form much more quickly. Didier and I talked a while about how to introduce the processes and ideas behind snapd and snapcraft to a new audience, particularly at a workshop or a meet-up and we found we were of the same opinion.

Didier put quite a bit of work into solving the infrastructure question. We re-used the work which was put into Codelabs already, so adding a new codelab merely became a question of creating a Google Doc and adding it using a management command. It works nicely, the UI is simple and easy to understand and lets you focus on the content at hand. It was a lot of fun to work on the content and refine the individual steps in a self-teaching workshop style. Thanks a lot everyone for the reviews!

It's now available for everyone

After some discussion it became clear that a very fitting way for the codelabs to go out would be to ship them as a snap themselves. It's beautifully simple to get started:

$ sudo snap install snap-codelabs

All you need to do afterwards is point your browser to http://localhost:8123/ - that's all. You will be greeted with something like this:

From thereon you can quickly start your snap adventure and get up and running in no time. It's a step-by-step workshop and you always know how much more time you need to complete it.

Expect more codelabs to be added soon. If you have feedback, please let us know here.

Have fun and when you're done with your first codelab, let us know in the comments!

Read more
kevin gunn

OK, I’m really overdue on posting something about this as I’ve had _something_ running on the dragonboard 410c for a while. If you don’t know about dragonboard you can check out dragonboard from 96boards .

So dragonboard is targeted to be a supported reference board by our Snappy team and they’re in the process of pushing out beta images to play with in the 16 series. I had been concerned that we I was going to have to go and build the graphics drivers into our Ubuntu core snap. When I started I wasn’t even sure of the state of the freedreno drivers vs closed source vendor drivers. But as luck would have it, someone quite recently had turned on the gallium drivers to be built and package as part of the Ubuntu distro, which means I got the freedreno drivers with no effort! Lots of love to Rob Clark for all the work he’s done on freedreno (if your interested in learning more  check out freedreno on github ).

So getting a devmode mir snap demo up and running was relatively painless. However, I do want to say I found a little difference in my runs amd64 VM vs the native arm64. This resulted in some tweaks to the mir interface in snapd (which had already landed and should be in the next snapd release). Also, never use setterm when developing with Mir, that create all sorts of chaos for me 🙂 I had used setterm for convenience to prevent the screen from blanking, ended up causing failures when I was working on making sure the mir snaps could run confined.

If you follow the good ol’ mir snaps wiki, you can easily duplicate this – running the mir snaps fully confined on dragonboard core snap. Also, I wanted to point out again there are other Qt demos you can try besides the clock app – simply modify the helper file in the client example (client-start) to be something besides “clock”, for example “maroon” or “samegame”. You can do this with an HDMI monitor and mouse attached  like in this  video of various Qt apps as mir-client snaps running on dragonboard . Still need to investigate some mouse oddities that seem to only occur with apps other than clock.

And lastly, I got new toy over the weekend. I ordered a 7″ touch screen from adafruit. Here’s a quick video of the 7″ display attached. I need to tinker with it to see about getting the touch to work, but it was nice to just hook it together and the display come up.

Read more
Dustin Kirkland

A couple of weeks ago, I delivered a talk at the Container Camp UK 2016.  It was an brilliant event, on a beautiful stage at Picturehouse Central in Picadilly Circus in London.

You're welcome to view the slides or download them as a PDF, or watch my talk below.

And for the techies who want to skip the slide fluff and get their hands dirty, setup your OpenStack and LXD and start streamlining your HPC workloads using this guide.


Read more
Alan Griffiths


A feature added to the lp:miral trunk yesterday is making life a lot easier for developers working on MirAL based servers, and the toolkit extensions that support Mir. The feature is:

miral-shell --window-management-trace

Actually, the –window-management-trace switch will work with any MirAL base server (so miral-kiosk and egmde support it too).

What this does is cause the server to log every interaction with the window management policy – all the notifications it receives and all the calls it makes to the tools as a result.

This means that it is easy to find out that, for example, a “modal” gtk based dialog window is being created without specifying a parent. (Which is why the behaviour isn’t quite as expected – Mir servers will treat it as non-modal.)

To use this feature before the next MirAL release you do need build it yourself, but this only takes a minute (depending on your kit).It really is the easiest way to see exactly what is going on and why.

Read more
Alan Griffiths

MirAL hits the Yakkety archives

Just a quick note: thanks to the efforts of my colleague Larry Price, libmiral is now available from the yakkety archive.

This means that if you’re running Ubuntu 16.10 you can install MirAL using apt and don’t need to build it yourself. Here’s what’s available:

  • libmiral-dev Developer files for the Mir ABI-stable abstraction layer
  • libmiral1 Display server for Ubuntu – ABI preserving abstraction layer
  • miral-doc API documentation for MirAL
  • miral-examples Display server for Ubuntu – demonstration programs

For example, before building egmde you just need to do this:

$ sudo apt install libmiral-dev

You can also install and run the miral-shell program with:

$ sudo apt install miral-examples
$ miral-shell

If you want to run X11 applications under miral-shell on X11 then you can do that too:

$ sudo apt install xmir
$ miral-shell&
$ Xmir -rootless :1&
$ DISPLAY=:1 gedit

Read more
Colin Watson

Beta test: new package picker

If you are a member of Launchpad’s beta testers team, you’ll now have a slightly different interface for selecting source packages in the Launchpad web interface, and we’d like to know if it goes wrong for you.

One of our longer-standing bugs has been #42298 (“package picker lists unpublished (invalid) packages”).  When selecting a package – for example, when filing a bug against Ubuntu, or if you select “Also affects distribution/package” on a bug – and using the “Choose…” link to pop up a picker widget, the resulting package picker has historically offered all possible source package names (or sometimes all possible source and binary package names) that Launchpad knows about, without much regard for whether they make sense in context.  For example, packages that were removed in Ubuntu 5.10, or packages that only exists in Debian, would be offered in search results, and to make matters worse search results were often ordered alphabetically by name rather than by relevance.  There was some work on this problem back in 2011 or so, but it suffered from performance problems and was never widely enabled.

We’ve now resurrected that work from 2011, fixed the performance problems, and converted all relevant views to use it.  You should now see something like this:

New package picker, showing search results for "pass"

Exact matches on either source or binary package names always come first, and we try to order other matches in a reasonable way as well.  The disclosure triangles alongside each package allow you to check for more details before you make a selection.

Please report any bugs you find with this new feature.  If all goes well, we’ll enable this for all users soon.

Update: as of 2016-09-22, this feature is enabled for all Launchpad users.

Read more
Daniel Holbach

For a few weeks we have been running the Snappy Playpen as a pet/research project already. Many great things have happened since then:

  • With the Playpen we now have a repository of great best-practice examples.
  • We brought together a lot of people who are excited about snaps, who worked together, collaborated, wrote plugins together and improved snapcraft and friends.
  • A number of cloud parts were put together by the team as well.
  • We landed quite a few high-quality snaps in the store.
  • We had lots of fun.

Opening the Sandpit

With our next Snappy Playpen event tomorrow, 20th September 2016, we want to extend the scheme. We are opening the Sandpit part of the Playpen!

One thing we realised in the last weeks is that we treated the Playpen more and more like a place where well-working, tested and well-understood snaps go to inspire people who are new to snapping software. What we saw as well was that lots of fellow snappers kept their half-done snaps on their hard-disk instead of sharing them and giving others the chance to finish them or get involved in fixing. Time to change that, time for the Sandpit!

In the Sandpit things can get messy, but you get to explore and play around. It’s fun. Naturally things need to be light-weight, which is why we organise the Sandpit on just a simple wiki page. The way it works is that if you have a half-finished snap, you simply push it to a repo, add your name and the link to the wiki, so others get a chance to take a look and work together with you on it.

Tomorrow, 20th September 2016, we are going to get together again and help each other snapping, clean up old bits, fix things, explain, hang out and have a good time. If you want to join, you’re welcome. We’re on Gitter and on IRC.

  • WHEN: 2016-09-20
  • WHAT: Snappy Playpen event – opening the Sandpit
  • WHERE: Gitter and on IRC

Added bonus

As an added bonus, we are going to invite Michael Vogt, one of the core developers of snapd to the Ubuntu Community Q&A tomorrow. Join us at 15:00 UTC tomorrow on and ask all the questions you always had!

See you tomorrow!

Read more

Es tan fácil, y sale tan bien, que este plato es casi como un comodín.

Es tapa de asado al horno.

La tapa de asado es un corte que está al lado del costillar (arriba, adelante) y es más barato que el asado, el vacío, la paleta, etc, y es 100% carne (no huesos).

No se usa mucho porque como no tiene grasa dentro de la carne, tiende a salir un poco dura. Por otro lado, tiene grasa afuera, que le da un gustito muy rico, pero que al mismo tiempo uno puede sacar totalmente si quiere una preparación bien magra.

La forma de preparar este corte, que recomiendo porque me funciona siempre, es muy sencilla.

Poné papel metalizado en la mesada, y apoyá la tapa de asado arriba. Condimentala de un lado, dala vuelta y condimentala del otro. Yo le pongo sal gruesa, pimienta, y chimichurri deshidratado (directamente, sin hidratarlo previamente), pero podés ponerle lo que quieras: ajo, ají molido, orégano, mostaza (¡queda muy bien!), y muchos etcéteras más; no recomiendo ponerle verduras, porque salen medio "hervidas".

Envolvé la carne condimentada con el papel de aluminio que quedó abajo de la carne, y con otro que le pongas por arriba. Le podés poner más, si te quedaron agujeros: la idea es que no pierda líquido.

Luego, meté la carne envuelta en el horno, en una asadera, y dejala dos o tres horas a fuego bajo. Sí, tarda en cocinarse, pero lo que te lleva a vos son 5 minutos. Es buena idea ponerle un poco de agua a la asadera, para que si se escapan jugos de la carne (¡porque no la envolviste bien!) no se quemen en la asadera y hagan humo o tiren olor.

A mí me gusta acompañar este plato con cebollas al horno. De nuevo, muy fácil, las pelás y cortás en trozos grandes (te podría decir que alrededor de 25-30 cm3, pero quizás es más útil si te digo que las dejes más o menos del tamaño de una nuez grande. Las tirás en una asadera, un poco de aceite por arriba, y listo. Yo las salpimento cuando ya están casi hechas, para que no larguen mucho líquido (de nuevo, condimentar a gusto). Me gusta sacarlas cuando ya se empezaron a quemar, :)

Read more
liam zheng

北京时间9月7日下午1点,Ubuntu作为技术合作伙伴应邀参加亚马逊AWS黑客松活动,Ubuntu Core作为大赛多个技术开发主题之一,成为备受开发者的青睐的开发任务。Ubuntu Core为IoT(物联网)而生,拥有众多新特性以及配备不可获取的安全机制,并且事务性系统升级则是确保IoT(物联网)的高效稳定。

北京时间9月7日下午1点,Ubuntu作为技术合作伙伴应邀参加亚马逊AWS黑客松活动,Ubuntu Core作为大赛多个技术开发主题之一,成为备受开发者的青睐的开发任务。Ubuntu Core为IoT(物联网)而生,拥有众多新特性以及配备不可获取的安全机制,并且事务性系统升级则是确保IoT(物联网)的高效稳定。由于客观原因,大赛时长比普通的黑客松活动稍短,这也给开发者增加了挑战的难度,不过开发者们还是在有限的时间里面交出了满意的答卷。

Ubuntu Core作为将设备彼此连接的重要系统平台,给与设备和设备间创造了无限的可能性,连接至云端则是打通设备与设备间的最后一道障碍。AWS 黑客松活动期间,共有19支参赛队伍中有技术控、设计达人、资深开发者、学生、以及创业团队。在短短的20小时,活动现场有2支小组完成了Ubuntu Core的挑战项目。








项目介绍:3D打印一直是创客、开发者所热衷的创新技术,当3D打印通过装有Ubuntu Core的Bubblegum-96开发板连接到公有云服务后将开创一键上传、自动切片、自动打印的创新应用。而Ubuntu Core则是为3D打印作业的稳定提供了保障。同时,本项目也会有snap格式应用。

除了以上完成项目开发的团队外,还有几个未完成Ubuntu Core任务的团队,相信在赛后开发团队将继续完善他们的项目,将Ubuntu Core带到更多的应用领域。Ubuntu Core的创新之旅才刚刚开始,未完待续。




Read more
kevin gunn

So first, if you didn’t catch it, series 16 Ubuntu Core beta images are available here

I just verified the Mir snaps are functioning and made some small updates to match here

One of which being a command line switch for installing the snaps locally… –dangerous, what a great flag name 🙂

Also, I made some updates to the snaps themselves to check for the architecture from $SNAP_ARCH and then set up all the correct paths. So this means the scripts will work properly on the various archs without having to tinker. I’ve also changed the mir-client snap specifically to pull the demos from the archive, this way you’ll also get the right binary for the right arch as well.



Read more
Daniel Holbach

Are you interested in snapping software and need help?


There’s a lot of good reasons for snapping software:

  • You get software out to millions of users: Ubuntu (snapd installed by default since Ubuntu 16.04 LTS), snapd available too on Arch, Debian, Gentoo, Fedora, openSUSE, openembedded, yocto and OpenWRT.
  • You get to define the experience: ship the stack the way you tested it. Just one simple test-scenario for you.
  • Building a snap is simple (one piece of YAML controls the build), publishing is instantaneous (one command to run, automatic review).
  • Multiple release channels in the store.

If you’re intrigued but need help to get started, tomorrow is a great time for this, as we’re going to have another Snappy Playpen event.

Tomorrow (13th Sept 2016) we are going to hang out on Gitter and IRC and will be there to answer your questions, work on snaps together and have fun!

In the Snappy Playpen project we are collecting best-practices and work on getting snaps out there together. We’re a friendly bunch and look forward to meeting you!

Read more

Click Hooks

After being asked about what I like about Click hooks I thought it would be nice to write up a little bit of the why behind them in a blog post. The precursor to this story is that I told Colin Watson that he was wrong to build hooks like this; he kindly corrected me and helped me fix my code to match but I still wasn't convinced. Now today I see some of the wisdom in the Click hook design and I'm happy to share it.

The standard way to think about hooks is as a way to react to the changes to the system. If a new application is installed then the hook gets information about the application and responds to the new data. This is how most libraries work with providing signals about the data that they maintain, and we apply that same logic to thinking about filesystem hooks. But filesystem hooks are different because the coherent state is harder to query. In your library you might respond the signal for a few things, but in many code paths the chances are you'll just go through the list of original objects to do operations. With filesystem hooks that complete state is almost never used, only the caches are that are created by the hooks themselves.

Click hooks work by creating a directory of symbolic links that matches the current state of the system, and then asks you to ensure your cache matches that state of the system. This seems inefficient because you have to determine which parts of your cache need to change, which get removed and which get added. But it results in better software because your software, including your hooks, has errors in it. I'm sorry to be the first one to tell you, but there are bugs. If your software is 99% correct, there is still something it is doing wrong. When you have delta updates that update the cache that error compounds and never gets completely corrected with each update because the complete state is never examined. So slowly the quality of your cache gets worse, not awful, but worse. By transferring the current system state to the cache each time you get the error rate of your software in the cache, but you don't get the compounded error rate of each delta. This adds up.

The design of the hooks system in Click might feel wrong as you start to implement one, but I think that after you create a few hooks you'll find there is wisdom in it. And as you use other hook systems in other platforms think about checking the system state to ensure you're always creating the best cache possible, even if the hook system there didn't force you to do it.

Read more
Colin Watson

We just rolled out a new feature for Launchpad’s Git repository hosting: Git-based merge proposals can now be linked to Launchpad bugs.  This can be done manually from the web UI for the merge proposal, but normally you should just mention the Launchpad bug in the commit message of one of the commits you want to merge.  The required commit message text to link to bugs #XXX and #YYY looks like this:


This is the same form used for Launchpad bug references in debian/changelog files in source packages, and the general approach of mentioning bugs in commit messages is similar to that of various other hosting sites.

Bugs are not automatically closed when merge proposals land, because the policy for when that should happen varies from project to project: for example, projects often only close bugs when they make releases, or when their code is deployed to production sites.

Users familiar with Bazaar on Launchpad should note that the model for Git bug linking is slightly different: bugs are linked to merge proposals rather than to individual branches.  This difference is mainly because individual branches within a Git repository are often much more ephemeral than Bazaar branches.

Documentation is here, along with other details of Launchpad’s Git hosting.

Read more

I currently write a lot of python and C++. Although I religiously unit test my C++ code, I’m a bit ashamed to say that I haven’t had much experience with python unit testing until recently. You know how it is - python is one of those interpreted languages, you mostly use it to do quick hacks, it doesn’t need tests. Until you’ve written your entire D-Bus service using python, and every time you make a code change a literal python appears on the screen to crash your computer. So I’ve started writing a bunch of tests and found (as expected) a tangled mess of dependencies and system calls.

In many C-like languages, you can fix most of your dependency problems with The Big Three: mocks, fakes, and stubs. A fake is an actual implementation of an interface used for non-production environments, a stub is an implementation of an interface returning a pre-conceived result, and a mock is a wrapper around an interface allowing a programmer to accurately map what actions were performed on the object. In C-like languages, you use dependency injection to give our classes fakes, mocks, or stubs instead of real objects during testing.

The good news is that we can also use dependency injection in python! However, I found that relying solely on dependency injection would pile on more dependencies than I wanted and was not going to work to cover all my system calls. But python is a dynamic language. In python, you can literally change the definition of a class inside of another class. We call this operation patch and you can use it extensively in testing to do some pretty cool stuff.

Code Under Test

Let’s define some code to test. For all of these examples, I’ll be using python3.5.2 with the unittest and unittest.mock libs on Ubuntu 16.10. You can the final versions of these code samples on github.

from random import randint

class WorkerStrikeException(Exception):

class Worker(object):
    A Worker will work a full 40 hour week and then go on strike. Each time
    a Worker works, they work a random amount of time between 1 and 40.
    def __init__(self):
        self.hours_worked = 0

    def work(self):
        timesheet = randint(1, 40)
        self.hours_worked += timesheet
        if self.hours_worked > 40:
            raise WorkerStrikeException("This worker is picketing")

        return timesheet

class Boss(object):
    A Boss makes profit using workers. Bosses squeeze 1000 monies out of a
    Worker for each hour worked. Workers on strike are instantly replaced.
    def __init__(self, worker):
        self.worker = worker
        self.profit = 0

    def make_profit(self):
            self.profit +=*1000
        except WorkerStrikeException as e:
            print("%s" % e)
            self.worker = Worker()
            self.profit +=*1000
            return self.profit

These are two simple classes (and a custom Exception) that we’ll use to demonstrate unit testing in python. The first class, Worker, will work a maximum of 40 hours per week before picketing it’s corporation. Each time work is called, the Worker will work a random number of hours. The Boss class takes in a Worker object, which it uses as it performs make_profit. The profit is determined by the number of hours worked multiplied by 1000. When the worker starts picketing, the Boss will hire a new Worker to take their place. So it goes.

Mocking the Worker Class

Our goal is to fully test the Boss class. We’ve left ourselves a dependency to inject in the __init__ method, so we could start there. We’ll mock the Worker and pass it into the Boss initializer. We’ll then set up the method to always return a known number so we can test the functionality of make_profit.

import unittest.mock
from unittest import TestCase

from corp import work  # your impl file

class BossTest(TestCase):
    def test_profit_adds_up(self):
        worker = unittest.mock.create_autospec(work.Worker) = 8
        boss = work.Boss(worker)
        self.assertEqual(boss.make_profit(), 8000)
        self.assertEqual(boss.make_profit(), 16000) = 10
        self.assertEqual(boss.make_profit(), 26000)[

if __name__ == '__main__':

To run this test, use the command python3 -m test, where test is the name of your test file without the .py.

One curiosity here is unittest.mock.create_autospec. Python will also let you directly create a Mock, which will absorb all attribute calls regardless of whether they are defined, and MagicMock, which is like Mock except it also mocks magic methods. create_autospec will create a mock with all of the defined attributes of the given class (in our case work.Worker), and raise an Exception when the attribute is not defined on the specced class. This is really handy, and eliminates the possibility of tests “accidentally passing” because they are calling default attributes defined by the generic Mock or MagicMock initializers.

We set the return value of the work function with return_value, and we can change it on a whim if we so desire. We then use assertEqual to verify the numbers are crunching as expected. One further thing I’ve shown here is assert_has_calls, a mock assertion to verify that work was called 3 times on our mock method.

You may also note that we subclassed TestCase to enable running this class as part of our unit testing framework with the special __main__ method definition at the bottom of the file.

Patching the Worker Class

Although our first test demonstrates how to make_profit with a happy worker, we also need to verify how the Boss handles workers on strike. Unforunately, the Boss class creates his own Worker internally after learning they can’t trust the Worker we gave them in the initializer. We want to create consistent tests, so we can’t rely on the random numbers generated by randint in This means we can’t just depend on dependency injection to make these tests pass!

At this point we have two options: we can patch the Worker class or we can patch the randint function. Why not both! As luck would have it, there are a few ways to use patch, and we can explore a couple of these ways in our two example tests.

We’ll patch the randint function using a method decorator. Our intent is to make randint return a static number every time, and then verify that profits keep booming even as we push workers past their limit.

@unittest.mock.patch('', return_value=20)
def test_profit_adds_up_despite_turnover(self, randint):
    boss = work.Boss(work.Worker())
    self.assertEqual(boss.make_profit(), 20000)
    self.assertEqual(boss.make_profit(), 40000)
    self.assertEqual(boss.make_profit(), 60000)
    self.assertEqual(boss.make_profit(), 80000)

    randint.assert_has_calls([, 40),, 40),, 40),, 40)

When calling patch, you must describe the namespace relative to the module you’re importing. In our case, we’re using randint in the module, so we use We define the return_value of randint to simply be 20. A fine number of hours per day to work an employee, according to the Boss. patch will inject a parameter into the test representing an automatically created mock that will be used in the patch, and we use that to assert that our calls were all made the way we expected.

Since we know the inner workings of the Worker class, we know that this test exercised our code by surpassing a 40-hour work week for our poor Worker and causing the WorkerStrikeException to be raised. In doing so, we’re depending on the Worker/Boss implementation to stay in-sync, which is a dangerous assumption. Let’s explore patching the Worker class instead.

To spice things up, we’ll use the ContextManager syntax when we patch the Worker class. We’ll create one mock Worker outside of the context to use for dependency injection, and we’ll use this mock to raise the WorkerStrikeException as a side effect of work being called too many times. Then we’ll patch the Worker class for newly created instances to return a known timesheet.

def test_profit_adds_up_despite_strikes(self):
    worker = unittest.mock.create_autospec(work.Worker) = 12
    boss = work.Boss(worker)

    with unittest.mock.patch('') as MockWorker:
        scrub = MockWorker.return_value = 4

        self.assertEqual(boss.make_profit(), 12000)
        self.assertEqual(boss.make_profit(), 24000) = work.WorkerStrikeException('Faking a strike!')
        self.assertEqual(boss.make_profit(), 28000)
        self.assertEqual(boss.make_profit(), 32000)[

After the first Worker throws a WorkerStrikeException, the second Worker (scrub) comes in to replace them. In patching the Worker, we are able to more accurately describe the behavior of Boss regardless of the implementation details behind Worker.

A Non-Political Conclusion

I’m not saying this is the best way to go about unit testing in python, but it is an option that should help you get started unit testing legacy code. There are certainly those who see this level of micromanaging mocks and objects as tedious, but there is be benefit to defining the way a class acts under exact circumstances. This was a contrived example, and your code may be a little bit harder to wrap with tests.

Now you can go get Hooked on Pythonics!

Read more

Muchas, muchas películas vistas. Sumatoria evidente de viajes largos y algunos tiempos tranquilos.

  • 7 cajas: +0. Muy buena la forma en que está filmada y contada la peli. La historia está bien, entretiene.
  • Autómata: +1. Todo lo que "I, robot" no nos dió. Muy buena la peli en sí, pero muy bien manejado el tema conceptual.
  • Avengers: Age of Ultron: -0. Una sucesión rápida de trompadas entre malos y buenos, lo mismo que la transformers 5 o 7, ya no me acuerdo...
  • Birdman or (The Unexpected Virtue of Ignorance): +1. Super rara a nivel historia, forma de filmar, y actuaciones. Pero buenísima.
  • Camp X-Ray: +1. Aunque un poco lenta por partes, muy buena historia, muy buenas actuaciones, y te deja pensando...
  • Dracula Untold: +0. Me gustó la historia, el por qué, el como. Tiene algunas partes rebuscadas y un final medio meh, pero está buena.
  • Focus: +0. Divertida, bastante pasable tieniendo en cuenta que es la típica película del estafador que estafa al estafador que estafa al estafador que estafa al estafador que estafa al estafador.
  • Inside Out: +0. Como escuché por ahí, empezaron con que los juguetes tenían emociones, los autos tenían emociones, etc, etc, y terminaron con que las emociones tienen emociones :p. Divertida, para niños, bien.
  • Interstellar: +0. Muy buena en algunas partes, un poco floja en otras, en promedio no es la película del siglo pero está buena (incluso siendo tan larga). Eso sí, a nivel visual: impecable!
  • Into the Woods: -0. La colección de actores y las referencias a tanta historia conocida no llega a compensar que es un musical :/
  • Mad Max: Fury Road: -0. No encontré nada para destacarle como más o menos bueno :/. Me aburrió.
  • Mission: Impossible - Rogue Nation: +0. La ví hace mucho! Recuerdo que estaba bien, pero como todas las Misión Imposible, tampoco la peli del año...
  • Mortdecai: +1. Espionaje inglés en plan chiste, me divirtió mucho.
  • Relatos salvajes: +0. Serie de relatos disconexos, algunos mejores que otros (algunos muy buenos! otros más o menos);
  • Suicide Squad: -0. Bastantes momentos interesantes, pero nada con suficiente peso específico para que se salve la película en su todo.
  • Terminator Genisys: +0. Interesante si te gusta Terminator, tiene muchos guiños, y hace la peli pasable y divertida, aunque le falte un montón.
  • The Book of Life: +1. Muy buena película, animación, y todo. La volví a bajCOMPRAR en castellano así la disfrutaban los chicos, también!
  • The Congress: +0. Recontra super volada en la construcción de la película en sí, pero con una historia y actuaciones muy piolas.
  • The Giver: +0. Interesante la historia a nivel descripción de la sociedad y cómo la linea entre utopía y distopía es tan sutil.
  • The Hunger Games: +0. Al final no era una peli de "adolescentes corriendo en la selva" como siempre imaginé y por eso no la veía (gracias Javi por convencerme de que valía la pena); es interesante todo el trasfondo sociológico y humano.
  • The Imitation Game: +0. La historia bien, y la actuación de Cumberbatch es soberbia... pero la peli me pareció contada para un nene de 15 años :/
  • The Judge: +1. Gran película, con increíbles actuaciones (Robert Duvall está ESPLENDIDO), y una gran historia también.
  • The Maze Runner: -0. Interesante las partes relacionadas con la sociología del "vivir en una isla", pero no mucho más.
  • The Scribbler: -0. Tiene sus partes interesantes a nivel psicología berreta, pero en general es mala.
  • Tomorrowland: +1. Excelente película, divertida, dinámica, contada muy bien, y encima dejando algo para pensar.

También buena cantidad de cosas nuevas para ver :)

  • ARQ (2016; Sci-Fi) Trapped in a lab and stuck in a time loop, a disoriented couple fends off masked raiders while harboring a new energy source that could save humanity. [D: Tony Elliott; A: Robbie Amell, Rachael Taylor, Gray Powell]
  • Arrival (2016; Drama, Mystery, Sci-Fi, Thriller) When mysterious spacecraft touch down across the globe, an elite team - lead by expert linguist Louise Banks - are brought together to investigate. As mankind teeters on the verge of global war, Banks and the team race against time for answers - and to find them, she will take a chance that could threaten her life, and quite possibly humanity. [D: Denis Villeneuve; A: Amy Adams, Jeremy Renner, Forest Whitaker]
  • Complete Unknown (2016; Drama, Mystery, Thriller) This shape-shifting tale of the perils and pleasures of self-reinvention begins at a dinner party, when Tom's (Michael Shannon) co-worker arrives with an intriguing date named Alice (Rachel Weisz). Tom is convinced he knows her, but she refuses to acknowledge their history. And when Alice makes a hasty exit, Tom sets off after her. What follows is an all-night odyssey shared by two people, one needing to change his life, the other questioning how to stop changing. [D: Joshua Marston; A: Rachel Weisz, Michael Shannon, Kathy Bates]
  • Embers (2015; Drama, Sci-Fi) In a dystopian future, an unidentified virus of some kind, has caused a neurological disease of global proportions and has infected the majority of the Earth's population. As we observe the lives of several people who still remain relatively unharmed by this illness, we understand their struggle to hopelessly attach to their former way of life, where even the simplest things, require great effort to be accomplished. With varying degrees of memory loss, the need to move on with their lives becomes an arduous task, a fierce battle with the inevitable... [D: Claire Carré; A: Jason Ritter, Iva Gocheva, Greta Fernández]
  • Marauders (2016; Action, Crime, Thriller) When a bank is hit by a brutal heist, all evidence points to the owner and his high-powered clients. But as a group of FBI agents dig deeper into the case - and the deadly heists continue - it becomes clear that a larger conspiracy is at play. [D: Steven C. Miller; A: Bruce Willis, Christopher Meloni, Dave Bautista]
  • Rogue One: A Star Wars Story (2016; Action, Adventure, Sci-Fi) Jyn Erso, a Rebellion soldier and criminal, is about to experience her biggest challenge yet when Mon Mothma sets her out on a mission to steal the plans for the Death Star. With help from the Rebels, a master swordsman, and non-allied forces, Jyn will be in for something bigger than she thinks. [D: Gareth Edwards; A: Riz Ahmed, Felicity Jones, Mads Mikkelsen]
  • The 9th Life of Louis Drax (2016; Mystery, Thriller) The story begins on Louis Drax's 9th birthday, when a lifetime of curious mishaps culminates in the boy's near-fatal fall. Desperate to reveal the strange circumstances behind the young boy's accident and dark coincidences that have plagued his entire life, Dr. Allan Pascal (Dornan) is drawn into a thrilling mystery that explores the nature of the sixth sense, testing the boundaries of fantasy and reality. [D: Alexandre Aja; A: Jamie Dornan, Aiden Longworth, Sarah Gadon]
  • The Hunger Games: Catching Fire (2013; Action, Adventure, Mystery, Sci-Fi, Thriller) Twelve months after winning the 74th Hunger Games, Katniss Everdeen and her partner Peeta Mellark must go on what is known as the Victor's Tour, wherein they visit all the districts, but before leaving, Katniss is visited by President Snow who fears that Katniss defied him a year ago during the games when she chose to die with Peeta. With both Katniss and Peeta declared the winners, it is fueling a possible uprising. He tells Katniss that while on tour she better try to make sure that she puts out the flames or else everyone she cares about will be in danger. [D: Francis Lawrence; A: Jennifer Lawrence, Liam Hemsworth, Jack Quaid]
  • The Hunger Games: Mockingjay - Part 1 (2014; Action, Drama, Sci-Fi, Thriller, War) With the Games destroyed, Katniss Everdeen, along with Gale, Finnick and Beetee, end up in the so thought "destroyed" District 13. Under the leadership of President Coin and the advice of her friends, Katniss becomes the "Mockingjay", the symbol of rebellion for the districts of Panem. [D: Francis Lawrence; A: Jennifer Lawrence, Josh Hutcherson, Liam Hemsworth]
  • The Hunger Games: Mockingjay - Part 2 (2015; Sci-Fi, Thriller, War) After young Katniss Everdeen agrees to be the symbol of rebellion, the Mockingjay, she tries to return Peeta to his normal state, tries to get to the Capitol, and tries to deal with the battles coming her way...but all for her main goal; assassinating President Snow and returning peace to the Districts of Panem. As her squad starts to get smaller and smaller, will she make it to the Capitol? Will she get revenge on Snow? Or will her target change? Will she be with her "Star-Crossed Lover", Peeta? Or her long time friend, Gale? Deaths, Bombs, Bows and Arrows, A Love Triangle, Hope. What will happen? [D: Francis Lawrence; A: Jennifer Lawrence, Josh Hutcherson, Liam Hemsworth]
  • The Accountant (2016; Crime, Drama, Thriller) Christian Wolff is a math savante with more affinity for numbers than people. Behind the cover of a small-town CPA office, he works as a freelance accountant for some of the world's most dangerous criminal organizations. With the Treasury Department's Crime Enforcement Division, run by Ray King, starting to close in, Christian takes on a legitimate client: a state-of-the-art robotics company where an accounting clerk has discovered a discrepancy involving millions of dollars. But as Christian uncooks the books and gets closer to the truth, it is the body count that starts to rise. [D: Gavin O'Connor; A: Ben Affleck, Anna Kendrick, Jon Bernthal]
  • The Magnificent Seven (2016; Action, Western) Director Antoine Fuqua brings his modern vision to a classic story in The Magnificent Seven. With the town of Rose Creek under the deadly control of industrialist Bartholomew Bogue, the desperate townspeople employ protection from seven outlaws, bounty hunters, gamblers and hired guns. As they prepare the town for the violent showdown that they know is coming, these seven mercenaries find themselves fighting for more than money. [D: Antoine Fuqua; A: Denzel Washington, Chris Pratt, Ethan Hawke]
  • Urge (2016; Thriller) A weekend getaway takes a dangerous turn when a mysterious nightclub owner (Pierce Brosnan) introduces a group of friends to a new designer drug. Stripped of their inhibitions, they start living out their wildest fantasies - but what starts out as a fun night of partying quickly turns deadly, as the island paradise deteriorates into a tropical madhouse. URGE also stars Justin Chatwin, Ashley Greene, Alexis Knapp, Bar Paly, Chris Geere, Nick Thune, Tommy Yoo, and Danny Masterson. [D: Aaron Kaufman; A: Pierce Brosnan, Justin Chatwin, Danny Masterson]
  • Welcome to Happiness (2015; Comedy, Drama, Fantasy) Woody (Kyle Gallner), a children's author, rents a strange apartment from his landlord, Moses (Nick Offerman). There's a magical door in Woody's closet that allows those who go through it to erase mistakes from their past. While he was once happy to facilitate the passage of the random strangers summoned to his apartment, Woody soon begins to question why he himself is not allowed to go through. [D: Oliver Thompson; A: Kyle Gallner, Olivia Thirlby, Nick Offerman]
  • Wonder Woman (2017; Action, Adventure, Fantasy, Sci-Fi) Before she was Wonder Woman, she was Diana, princess of the Amazons, trained to be an unconquerable warrior. Raised on a sheltered island paradise, when an American pilot crashes on their shores and tells of a massive conflict raging in the outside world, Diana leaves her home, convinced she can stop the threat. Fighting alongside man in a war to end all wars, Diana will discover her full powers and her true destiny. [D: Patty Jenkins; A: Gal Gadot, Chris Pine, Robin Wright]
  • Girl on a Bicycle (2013; Comedy, Drama, Romance) Paolo (Vincenzo Amato), an Italian who drives a Paris tour bus, has just proposed to his true love, the German stewardess, Greta (Nora Tschirner), when the young French beauty, Cécile (Louise Monot) pulls up beside his bus on her bicycle - and, in short order, Paolo, following some very bad advice from his friend, Derek (Paddy Considine), finds himself with a German fiancée, a French "wife", two Australian children who call him "Papa", and his life upside-down. [D: Jeremy Leven; A: Nora Tschirner, Vincenzo Amato, Louise Monot]
  • Kong: Skull Island (2017; Action, Adventure, Fantasy, Sci-Fi) An action/adventure story centered on King Kong's origins. [D: Jordan Vogt-Roberts; A: Tom Hiddleston, Brie Larson, Toby Kebbell]
  • Learning to Drive (2014; Comedy, Drama, Romance) Wendy (Patrician Clarkson), a self-absorbed New York book critic, is shocked to reality by the sudden end of her marriage. Always dependent on her husband for driving, she must now learn to take the wheel on her own. Her instructor Darwan (Ben Kingsley) is a Sikh Indian who watches with alarm as his pupil falls apart at the seams. He himself is contemplating an arranged marriage with a woman he has never met. As these two lives intersect, both will change in unpredictable ways. [D: Isabel Coixet; A: Patricia Clarkson, Ben Kingsley, Jake Weber]
  • The Reality of Truth (2016; Documentary) This highly controversial documentary explores the relationship between, Spirituality, Religion, and Psychedelics. Lead by "Zappy" Zapolin, the film explores the many myths about reality, and includes first of its kind interviews with top spiritual gurus, celebrities, and people of all faiths, about this intriguing connection, and their personal experiences with spirituality and transcendence. Throughout history human beings have searched for gateways to spirituality that have included meditation, prayer, and natural substances. The Judeo Christian religions, Vedic traditions, and Shamanistic rituals, all incorporate techniques focused on transcending. Today scientists are able to measure the effects, real and perceived, on the human brain and mind. By exploring how to use the current knowledge and techniques available to society, we can tap into true spirituality, and awakening. The awareness created by the film worldwide is meant to break through the "illusion of reality," and allow viewers to move forward toward a more meaningful and peaceful future. The filmmakers are conducting interviews with today's thought leaders from around the globe, while capturing the culture and energy of some of the most spiritual places on earth, including Maui, Peru, Rome, and Fairfield Iowa. [D: Laurent Levy, Mike Zapolin; A: Tim Booth, Deepak Chopra, Peter Coyote]

Finalmente, el conteo de pendientes por fecha:

(Sep-2010)    1
(Dic-2010)    1
(Abr-2011)   17   4
(Ago-2011)   11  11   4
(Ene-2012)   17  17  11   3
(Jul-2012)   15  15  14  11
(Nov-2012)   11  11  11  11   6
(Feb-2013)   16  15  14  14   8   2
(Jun-2013)   18  16  15  15  15  11   2
(Sep-2013)   18  18  18  18  17  16   8
(Dic-2013)       14  14  12  12  12  12   4
(Abr-2014)            9   9   8   8   8   3
(Jul-2014)               10  10  10  10  10   5   1
(Nov-2014)                   24  22  22  22  22   7
(Feb-2015)                       13  13  13  13  10
(Jun-2015)                           16  16  15  13
(Dic-2015)                               21  19  19
(May-2016)                                   26  25
(Sep-2016)                                       19
Total:      125 121 110 103 100  94  91  89 100  94

Read more
Benjamin Zeller

Releasing the 4.1.0 Ubuntu SDK IDE

We are happy to announce the release of the Ubuntu SDK IDE 4.1.0 for the Trusty, Xenial and Yakkety Ubuntu series.

The testing phase took longer than we have expected but finally we are ready. To compensate this delay we have even upgraded the IDE to the most recent 4.1.0 QtCreator.

Based on QtCreator 4.1.0

We have based the new IDE on the most recent QtCreator upstream release, which brings a lot of new features and fixes. To see whats new there just check out:

LXD based backend

The click chroot based builders are now deprecated. LXD allows us to download and use pre built SDK images instead of having to bootstrap them every time a new build target is created.  These LXD containers are used to run the applications from the IDE. Which means that the host machine of the SDK IDE does not need any runtime dependencies.

Get started

It is good to know that all existing schroot based builders will not be used by the IDE anymore. The click chroots will remain on the host but will be decoupled from the Ubuntu SDK IDE. If they are not required otherwise just remove them using the Ubuntu dialog in Tools->Options.

If the beta IDE was used already make sure to recreate all containers, there were some bugs in the images that we do not fix automatically.

To get the new IDE use:

sudo add-apt-repository ppa:ubuntu-sdk-team/ppa

sudo apt update && sudo apt install ubuntu-sdk-ide

Check our first blog post about the LXD based IDE for more detailed instructions:

Read more

The Internet of Things (IoT) has the potential to become a $4-11 trillion market by 2025, contributing 11% to the global economy, according to a McKinsey Global Institute report, The Internet of Things: Mapping the value beyond the hype.

IoT is about connecting sensors and devices to the Internet, collecting their data and automating processes and decision-making. It touches almost every industry and will soon be in your house, your office, your company, your city, your country and your planet.

IoT, however, does face a host of issues—lack of standards being a big one. Remember the days when there was no standard USB phone charger and every phone manufacturer chose its “own standard”? The Internet and mobile have evolved rapidly because they are built on open standards and often open source standards. IoT is being held back due to the lack of standards. Devices are generating data in proprietary ways, which can’t be easily shared with other devices. Hence, no synergetic actions can be taken.

Security is another issue. In mid-2015, a connected car got hacked and the two hackers were able to take full control of the car—the steering, brakes and even its engine. With everything becoming connected through IoT, security will be key for IoT to be successful in the long term. IoT will continue to require better security solutions than what is currently available. The best way to secure a system is to allow anybody to inspect the code and contribute a patch. Closed source is just hiding problems, not making solutions more secure. Through open source more eyes can look at the code and solve any security issues.

IoT is currently a collection of technical solutions for an unvalidated set of customer problems. Years ago people would ask: “Why do I need a smartphone?” Angry Birds, WhatsApp, Pokémon GO, and many other apps have had an enormous effect on what we do with a phone. Most of us only make calls a fraction of the time we spend on our phones.

We don’t know what an Angry Birds or Pokémon GO equivalent for a fridge, a robot, a drone, a router, etc, looks like. However, by providing an app-based infrastructure, we make it easy for software developers to create apps that can derive much more value from any smart device.

App stores on devices will help us find the IoT Pokémon GO for lots of new smart devices. By open sourcing the technology to app-enable any type of smart device, we are accelerating this discovery process. Any enterprise will be able to run its own app store.

Today we can start IoT-enabling devices around us but managing large deployments of devices is hard.

You can’t go to a PC model where you are expected to take actions, like cleaning up disk space, to keep things going smoothly. Devices that are connected to the Internet will need software upgrades when security bugs are discovered. You will not want these upgrades to fail and stop the device from working. Even if the device is cheap, digging a hole in the street to get a device out of the ground or getting scaffolding to get if off the roof means the price of the device will be irrelevant if a software update fails.

By open sourcing a solution for transactional updates, any update that fails can be easily rolled back to the last working version. This will allow any developer, device manufacturer and enterprise to focus their efforts on solving real customer problems and not reinventing the wheel.

To give you an example, today every large building has IP (Internet protocol) security cameras. The only intelligence these cameras have is that they can sense motion. They will send everything they see to a central system where somebody needs to check the streams manually. All data will be recorded but finding that one image that matters is still really hard.

By app-enabling IP security cameras and providing them with trained artificial intelligence (AI) models, IP cameras will be able to recognise the person, animal or object in front of them. A rabbit on the grass can be ignored. An unknown person in the middle of the night generates a potential security alert. A known criminal with a weapon will make sure the police gets automatically warned.

IoT will initially be used to reduce costs. Smart meters will negotiate with power generation companies when electricity is cheapest. Home appliances like washing and drying machines will choose the most economical times to wash and dry your clothes. Your house will know you are home and it will make sure the temperature and ambiance is just the way you like it. Your house will not waste energy on warming or cooling when you are not home. In the office technicians will come and fix the copier before it breaks. Industrial 3D (three-dimensional) printers will print substitution parts when they are needed.

The mid- and long-term IoT future will, however, bring more change. Autonomous cars will be rented, not owned. Owning a car means you have it parked 95% of the time. If the same car can be used to transport many people on the same day, personal transport-as-a-service will cost a fraction of the cost of owning a car. You also won’t need city parking.

Vending machines can have app stores, iris scanners, touch screens, and more. All of a sudden you can use a vending machine to make an international money transfer to family on the other side of the world. An app-enabled MRI (magnetic resonance imaging) scanner will look for thousands of symptoms categorized by the health risks based on your DNA profile.

Automatic sewing robots will make personalised clothes that you can try on before they exist via digital mirrors and augmented reality. Your city will pick up your garbage when it is full and you will only pay for what you waste, all done by autonomous trucks.

When the world was affected by the Y2K (Year 2000) problem, India was safe as it didn’t have a lot of the legacy mainframes and mini computers which were affected. India has the same advantage today with IoT. The country doesn’t have many IoT deployments, so it can choose the right approach before any deployment happens.

India is able to choose open source and open standards when deploying IoT. This will give India huge advantages today and help prevent future problems. India has one of the most tech-savvy populations. Cheap hardware like Raspberry Pi will allow Indian start-ups and enterprises to dream up new IoT solutions without breaking the bank.

By using open source IoT app standards, Indian entrepreneurs will be able to sell their IoT apps globally. App store customers can run these apps on any type of enterprise or industrial hardware. India’s software industry is uniquely positioned to benefit from IoT. India can combine low-cost, innovation and revenue generation in any future IoT solution. IoT is the next big thing, and India should do everything possible to drive it.

This was published at Mint Newspaper

Read more
Victor Palau

In order to test k8s you can always deploy a single-node setup locally using minikube, however it is a bit limited if you want to test interactions that require your services to be externally accessible from a mobile or web front-end.

For this reason, I created a basic k8s setup for a Core OS single node in Azure using . Once I did this, I decided to automate its deployment via script.

It requires a Core OS instance running, then connect to it and:

git clone k8
cd k8
./ [myip-address] –> ip associated to eth, you can find it using ifconfig

This will deploy k8 into a single node, it sets up kubectl in the node and deploys skydns add on.

It also includes a busybox node file that can be deployed by:

kubectl create -f files/busybox

This might come useful to debug issues with the set up. To execute commands in busybox run:
kubectl exec busybox — [command]

The script and config files can be access at

If you hit any issues while deploying k8s in a single node a few things worth checking are:

sudo systemctl status etcd
sudo systemctl status flanneld
sudo systemctl status docker

Also it is worth checking what docker containers are running and if necessarily check the logs

docker ps -a
docker logs [container-id]

Read more