Feed aggregator

Matthias Klumpp: Why are AppStream metainfo files XML data?

Planet Ubuntu - Tue, 04/26/2016 - 09:20

This is a question raised quite quite often, the last time in a blogpost by Thomas, so I thought it is a good idea to give a slightly longer explanation (and also create an article to link to…).

There are basically three reasons for using XML as the default format for metainfo files:

1. XML is easily forward/backward compatible, while YAML is not

This is a matter of extending the AppStream metainfo files with new entries, or adapt existing entries to new needs.

Take this example XML line for defining an icon for an application:

<icon type="cached">foobar.png</icon>

and now the equivalent YAML:

Icons: cached: foobar.png

Now consider we want to add a width and height property to the icons, because we started to allow more than one icon size. Easy for the XML:

<icon type="cached" width="128" height="128">foobar.png</icon>

This line of XML can be read correctly by both old parsers, which will just see the icon as before without reading the size information, and new parsers, which can make use of the additional information if they want. The change is both forward and backward compatible.

This looks differently with the YAML file. The “foobar.png” is a string-type, and parsers will expect a string as value for the cached key, while we would need a dictionary there to include the additional width/height information:

Icons: cached: name: foobar.png width: 128 height: 128

The change shown above will break existing parsers though. Of course, we could add a cached2 key, but that would require people to write two entries, to keep compatibility with older parsers:

Icons: cached: foobar.png cached2: name: foobar.png width: 128 height: 128

Less than ideal.

While there are ways to break compatibility in XML documents too, as well as ways to design YAML documents in a way which minimizes the risk of breaking compatibility later, keeping the format future-proof is far easier with XML compared to YAML (and sometimes simply not possible with YAML documents). This makes XML a good choice for this usecase, since we can not do transitions with thousands of independent upstream projects easily, and need to care about backwards compatibility.

2. Translating YAML is not much fun

A property of AppStream metainfo files is that they can be easily translated into multiple languages. For that, tools like intltool and itstool exist to aid with translating XML using Gettext files. This can be done at project build-time, keeping a clean, minimal XML file, or before, storing the translated strings directly in the XML document. Generally, YAML files can be translated too. Take the following example (shamelessly copied from Dolphin):

<summary>File Manager</summary> <summary xml:lang="bs">Upravitelj datoteka</summary> <summary xml:lang="cs">Správce souborů</summary> <summary xml:lang="da">Filhåndtering</summary>

This would become something like this in YAML:

Summary: C: File Manager bs: Upravitelj datoteka cs: Správce souborů da: Filhåndtering

Looks manageable, right? Now, AppStream also covers long descriptions, where individual paragraphs can be translated by the translators. This looks like this in XML:

<description>   <p>Dolphin is a lightweight file manager. It has been designed with ease of use and simplicity in mind, while still allowing flexibility and customisation. This means that you can do your file management exactly the way you want to do it.</p>   <p xml:lang="de">Dolphin ist ein schlankes Programm zur Dateiverwaltung. Es wurde mit dem Ziel entwickelt, einfach in der Anwendung, dabei aber auch flexibel und anpassungsfähig zu sein. Sie können daher Ihre Dateiverwaltungsaufgaben genau nach Ihren Bedürfnissen ausführen.</p>   <p>Features:</p>   <p xml:lang="de">Funktionen:</p>   <p xml:lang="es">Características:</p>   <ul>     <li>Navigation (or breadcrumb) bar for URLs, allowing you to quickly navigate through the hierarchy of files and folders.</li>     <li xml:lang="de">Navigationsleiste für Adressen (auch editierbar), mit der Sie schnell durch die Hierarchie der Dateien und Ordner navigieren können.</li>     <li xml:lang="es">barra de navegación (o de ruta completa) para URL que permite navegar rápidamente a través de la jerarquía de archivos y carpetas.</li>     <li>Supports several different kinds of view styles and properties and allows you to configure the view exactly how you want it.</li>     ....   </ul> </description>

Now, how would you represent this in YAML? Since we need to preserve the paragraph and enumeration markup somehow, and creating a large chain of YAML dictionaries is not really a sane option, the only choices would be:

  • Embed the HTML markup in the file, and risk non-careful translators breaking the markup by e.g. not closing tags.
  • Use Markdown, and risk people not writing the markup correctly when translating a really long string in Gettext.

In both cases, we would loose the ability to translate individual paragraphs, which also means that as soon as the developer changes the original text in YAML, translators would need to translate the whole bunch again, which is inconvenient.

On top of that, there are no tools to translate YAML properly that I am aware of, so we would need to write those too.

3. Allowing XML and YAML makes a confusing story and adds complexity

While adding YAML as a format would not be too hard, given that we already support it for DEP-11 distro metadata (Debian uses this), it would make the business of creating metainfo files more confusing. At time, we have a clear story: Write the XML, store it in /usr/share/metainfo, use standard tools to translate the translatable entries. Adding YAML to the mix adds an additional choice that needs to be supported for eternity and also has the problems mentioned above.

I wanted to add YAML as format for AppStream, and we discussed this at the hackfest as well, but in the end I think it isn’t worth the pain of supporting it for upstream projects (remember, someone needs to maintain the parsers and specification too and keep XML and YAML in sync and updated). Don’t get me wrong, I love YAML, but for translated metadata which needs a guarantee on format stability it is not the ideal choice.

So yeah, XML isn’t fun to write by hand. But for this case, XML is a good choice.

Oli Warner: Our doctors are striking for patients, not money

Planet Ubuntu - Tue, 04/26/2016 - 08:18

My better half is a junior doctor. She works insanely long hours and cares completely for her patients. When you can see how much it costs somebody as conscientious as she is to walk out on strike, it's all the more frustrating that press coverage so spotty, confusing and often insulting.

The underlying issue is so simple: There aren't enough doctors.

Ignore everything you've been told. The situation in the NHS is simple to explain:

  • Doctors are a finite resource. We have 55,000 doctors in training in the NHS in England.
  • These 55,000 only barely cover existing shifts for full service regular 9-5ish Monday to Friday and emergency care 24/7. In many smaller hospitals there are already dangerous rota gaps from understaffing, but they just scrape by.

The contract being imposed in August —the one doctors are striking against— was designed to make it affordable and legally possible for hospitals to spread these 55,000 doctors from 5 days full service, to 7 days full service.

You can't safely do 7 days work with 5 days people.

The Government's maths to make this "work": you take some doctors from midweek and move them to the weekend. That's what this contract allows, one way or the other. Fewer doctors in the week, and dangerously long shifts to cover the existing workload with fewer concurrent staff.

And that isn't safe. The level of cover in some places is already dangerous. You can't spread doctors any thinner and expect anything but a diminished service. The NHS needs more doctors, not the same number spread over more days. And that's the only thing you need to consider when you're wondering why doctors are striking and whose fault that is.

That's not to say that there aren't also other issues here. There are and they are significant but all of that can be boiled into the same argument. The NHS is already haemorrhaging doctors to countries with better working conditions and the cost to become a doctor here is huge. While we need the number of 55,000 junior doctors to grow substantially, everything about this contract and the treatment of existing doctors up to now will mean it likely shrinks away.

I don't want to conflate the issue. Your doctors aren't striking over a 30% pay cut or additional weekends they'll be pulled in for, they're striking because they're being told that starting August they will be doing unsafe amount of work with a unsafe number of doctors. The rest is just distracting gravy.

This contract is dangerous to patients, present and future. It must be resisted.

Forums Council: Forum Staff Additions

Planet Ubuntu - Tue, 04/26/2016 - 08:02

A healthy team is able to renew itself and integrate new members. It is always a refreshing and exciting process, to look for new people to add to a team.

The following Ubuntu Forums users have accepted to be part of the Staff team, which now consists of 21 Moderators, 3 Super-Moderators and 5 Admins. In addition, 4 forums users have Moderator status in a specific sub-forum (UWN, Catalan and Argentina LoCo teams forums we host). You can find a complete list of the forums leaders here.

The new Forums Moderators are :

Congratulations from the Ubuntu Forums Council.


Rhonda D&#39;Vine: Prince

Planet Ubuntu - Tue, 04/26/2016 - 05:32

Last week we lost another great musician, song writer, artist. It's painful to realise that more and more of the people you grew up with aren't there anymore. We lost Prince, TAFKAP, Symbol, Prince. He wrote a lot of great music, even some you wouldn't attribute to him, like Sinead O'Connor's Nothing Compares To You, Bangles' Manic Monday or Chaka Khan's I Feel For You. But I actually would like to share some songs that are also performed by himself, so without further ado here are the songs:

Rest in peace, Prince. And you, enjoy.

/music | permanent link | Comments: 0 |

Dustin Kirkland: Keep OpenStack Weird

Planet Ubuntu - Mon, 04/25/2016 - 21:39


The OpenStack Summit in Austin has already kicked off, and this time, Ubuntu is the official lanyard sponsor at OpenStack Summit Austin.

The sponsorship contract for the OpenStack Summit explicitly states that only the official lanyard sponsor may distribute lanyards. Whilst we understand the reason that clause is there, we don't agree with it. It just doesn't seem very "open" nor in the spirit of OpenStack.

Freedom of choice is an important aspect of all open source communities and one that we certainly champion, so attendees should be free to wear whatever branded lanyard they want with pride at the OpenStack Summit in Austin and we at Canonical will celebrate it.  My hometown here, Austin, prides itself on diversity, where we like to Keep Austin Weird!


So please -- partners, customers, competitors, other OpenStack Sponsors: if you want to distribute your own lanyards then please go ahead safe in the knowledge that Canonical will not complain to the conference organizers.  Let's Keep OpenStack (a little bit) Weird, too!



See you there!
:-Dustin

Ubuntu Weekly Newsletter Issue 463

The Fridge - Mon, 04/25/2016 - 16:40

St&eacute;phane Graber: LXD 2.0: Live migration [9/12]

Planet Ubuntu - Mon, 04/25/2016 - 13:25

This is the ninth blog post in this series about LXD 2.0.

Introduction

One of the very exciting feature of LXD 2.0, albeit experimental, is the support for container checkpoint and restore.

Simply put, checkpoint/restore means that the running container state can be serialized down to disk and then restored, either on the same host as a stateful snapshot of the container or on another host which equates to live migration.

Requirements

To have access to container live migration and stateful snapshots, you need the following:

  • A very recent Linux kernel, 4.4 or higher.
  • CRIU 2.0, possibly with some cherry-picked commits depending on your exact kernel configuration.
  • Run LXD directly on the host. It’s not possible to use those features with container nesting.
  • For migration, the target machine must at least implement the instruction set of the source, the target kernel must at least offer the same syscalls as the source and any kernel filesystem which was mounted on the source must also be mountable on the target.

All the needed dependencies are provided by Ubuntu 16.04 LTS, in which case, all you need to do is install CRIU itself:

apt install criu Using the thing Stateful snapshots

A normal container snapshot looks like:

stgraber@dakara:~$ lxc snapshot c1 first stgraber@dakara:~$ lxc info c1 | grep first first (taken at 2016/04/25 19:35 UTC) (stateless)

A stateful snapshot instead looks like:

stgraber@dakara:~$ lxc snapshot c1 second --stateful stgraber@dakara:~$ lxc info c1 | grep second second (taken at 2016/04/25 19:36 UTC) (stateful)

This means that all the container runtime state was serialized to disk and included as part of the snapshot. Restoring one such snapshot is done as you would a stateless one:

stgraber@dakara:~$ lxc restore c1 second stgraber@dakara:~$ Stateful stop/start

Say you want to reboot your server for a kernel update or similar maintenance. Rather than have to wait for all the containers to start from scratch after reboot, you can do:

stgraber@dakara:~$ lxc stop c1 --stateful

The container state will be written to disk and then picked up the next time you start it.

You can even look at what the state looks like:

root@dakara:~# tree /var/lib/lxd/containers/c1/rootfs/state/ /var/lib/lxd/containers/c1/rootfs/state/ ├── cgroup.img ├── core-101.img ├── core-102.img ├── core-107.img ├── core-108.img ├── core-109.img ├── core-113.img ├── core-114.img ├── core-122.img ├── core-125.img ├── core-126.img ├── core-127.img ├── core-183.img ├── core-1.img ├── core-245.img ├── core-246.img ├── core-50.img ├── core-52.img ├── core-95.img ├── core-96.img ├── core-97.img ├── core-98.img ├── dump.log ├── eventfd.img ├── eventpoll.img ├── fdinfo-10.img ├── fdinfo-11.img ├── fdinfo-12.img ├── fdinfo-13.img ├── fdinfo-14.img ├── fdinfo-2.img ├── fdinfo-3.img ├── fdinfo-4.img ├── fdinfo-5.img ├── fdinfo-6.img ├── fdinfo-7.img ├── fdinfo-8.img ├── fdinfo-9.img ├── fifo-data.img ├── fifo.img ├── filelocks.img ├── fs-101.img ├── fs-113.img ├── fs-122.img ├── fs-183.img ├── fs-1.img ├── fs-245.img ├── fs-246.img ├── fs-50.img ├── fs-52.img ├── fs-95.img ├── fs-96.img ├── fs-97.img ├── fs-98.img ├── ids-101.img ├── ids-113.img ├── ids-122.img ├── ids-183.img ├── ids-1.img ├── ids-245.img ├── ids-246.img ├── ids-50.img ├── ids-52.img ├── ids-95.img ├── ids-96.img ├── ids-97.img ├── ids-98.img ├── ifaddr-9.img ├── inetsk.img ├── inotify.img ├── inventory.img ├── ip6tables-9.img ├── ipcns-var-10.img ├── iptables-9.img ├── mm-101.img ├── mm-113.img ├── mm-122.img ├── mm-183.img ├── mm-1.img ├── mm-245.img ├── mm-246.img ├── mm-50.img ├── mm-52.img ├── mm-95.img ├── mm-96.img ├── mm-97.img ├── mm-98.img ├── mountpoints-12.img ├── netdev-9.img ├── netlinksk.img ├── netns-9.img ├── netns-ct-9.img ├── netns-exp-9.img ├── packetsk.img ├── pagemap-101.img ├── pagemap-113.img ├── pagemap-122.img ├── pagemap-183.img ├── pagemap-1.img ├── pagemap-245.img ├── pagemap-246.img ├── pagemap-50.img ├── pagemap-52.img ├── pagemap-95.img ├── pagemap-96.img ├── pagemap-97.img ├── pagemap-98.img ├── pages-10.img ├── pages-11.img ├── pages-12.img ├── pages-13.img ├── pages-1.img ├── pages-2.img ├── pages-3.img ├── pages-4.img ├── pages-5.img ├── pages-6.img ├── pages-7.img ├── pages-8.img ├── pages-9.img ├── pipes-data.img ├── pipes.img ├── pstree.img ├── reg-files.img ├── remap-fpath.img ├── route6-9.img ├── route-9.img ├── rule-9.img ├── seccomp.img ├── sigacts-101.img ├── sigacts-113.img ├── sigacts-122.img ├── sigacts-183.img ├── sigacts-1.img ├── sigacts-245.img ├── sigacts-246.img ├── sigacts-50.img ├── sigacts-52.img ├── sigacts-95.img ├── sigacts-96.img ├── sigacts-97.img ├── sigacts-98.img ├── signalfd.img ├── stats-dump ├── timerfd.img ├── tmpfs-dev-104.tar.gz.img ├── tmpfs-dev-109.tar.gz.img ├── tmpfs-dev-110.tar.gz.img ├── tmpfs-dev-112.tar.gz.img ├── tmpfs-dev-114.tar.gz.img ├── tty.info ├── unixsk.img ├── userns-13.img └── utsns-11.img 0 directories, 154 files

Restoring the container can be done with a simple:

stgraber@dakara:~$ lxc start c1 Live migration

Live migration is basically the same as the stateful stop/start above, except that the container directory and configuration happens to be moved to another machine too.

stgraber@dakara:~$ lxc list c1 +------+---------+-----------------------+----------------------------------------------+------------+-----------+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | +------+---------+-----------------------+----------------------------------------------+------------+-----------+ | c1 | RUNNING | 10.178.150.197 (eth0) | 2001:470:b368:4242:216:3eff:fe19:27b0 (eth0) | PERSISTENT | 2 | +------+---------+-----------------------+----------------------------------------------+------------+-----------+ stgraber@dakara:~$ lxc list s-tollana: +------+-------+------+------+------+-----------+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | +------+-------+------+------+------+-----------+ stgraber@dakara:~$ lxc move c1 s-tollana: stgraber@dakara:~$ lxc list c1 +------+-------+------+------+------+-----------+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | +------+-------+------+------+------+-----------+ stgraber@dakara:~$ lxc list s-tollana: +------+---------+-----------------------+----------------------------------------------+------------+-----------+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | +------+---------+-----------------------+----------------------------------------------+------------+-----------+ | c1 | RUNNING | 10.178.150.197 (eth0) | 2001:470:b368:4242:216:3eff:fe19:27b0 (eth0) | PERSISTENT | 2 | +------+---------+-----------------------+----------------------------------------------+------------+-----------+ Limitations

As I said before, checkpoint/restore of containers is still pretty new and we’re still very much working on this feature, fixing issues as we are made aware of them. We do need more people trying this feature and sending us feedback, I would however not recommend using this in production just yet.

The current list of issues we’re tracking is available on Launchpad.

We expect a basic Ubuntu container with a few services to work properly with CRIU in Ubuntu 16.04. However more complex containers, using device passthrough, complex network services or special storage configurations are likely to fail.

Whenever possible, CRIU will fail at dump time, rather than at restore time. In such cases, the source container will keep running, the snapshot or migration will simply fail and a log file will be generated for debugging.

In rare cases, CRIU fails to restore the container, in which case the source container will still be around but will be stopped and will have to be manually restarted.

Sending bug reports

We’re tracking bugs related to checkpoint/restore against the CRIU Ubuntu package on Launchpad. Most of the work to fix those bugs will then happen upstream either on CRIU itself or the Linux kernel, but it’s easier for us to track things this way.

To file a new bug report, head here.

Please make sure to include:

  • The command you ran and the error message as displayed to you
  • Output of “lxc info” (*)
  • Output of “lxc info <container name>”
  • Output of “lxc config show –expanded <container name>”
  • Output of “dmesg” (*)
  • Output of “/proc/self/mountinfo” (*)
  • Output of “lxc exec <container name> — cat /proc/self/mountinfo”
  • Output of “uname -a” (*)
  • The content of /var/log/lxd.log (*)
  • The content of /etc/default/lxd-bridge (*)
  • A tarball of /var/log/lxd/<container name>/ (*)

If reporting a migration bug as opposed to a stateful snapshot or stateful stop bug, please include the data for both the source and target for any of the above which has been marked with a (*).

Extra information

The CRIU website can be found at: https://criu.org

The main LXD website is at: https://linuxcontainers.org/lxd
Development happens on Github at: https://github.com/lxc/lxd
Mailing-list support happens on: https://lists.linuxcontainers.org
IRC support happens in: #lxcontainers on irc.freenode.net
Try LXD online: https://linuxcontainers.org/lxd/try-it

Stuart Langridge: The wisest words spoken

Planet Ubuntu - Mon, 04/25/2016 - 01:09
If all the world’s a stage
Then light my way
Because out, out your brief candle is not
Four centuries past, yet I still cannot grasp
That undiscovered country that makes words immortal
If the good that men do is interred with their bones
Then this precious stone is a beauty too rich
Methinks it’s a jewel in the ear of us all
As the wisest words spoken are spoken by fools

from This Gives Life To Thee, performed by Akala, Nitin Sawhney, and Dane Hurst, as part of the BBC’s Shakespeare Live! From the RSC, 23rd April 2016.

Sam Hewitt: Lenovo ThinkPad T460s Review

Planet Ubuntu - Sun, 04/24/2016 - 22:00

To replace my aging and broken ThinkPad E Series (the cheaper and plastic-er ThinkPad), getting the latest and greatest in ThinkPad was decidedly the best course to go. After much deliberation, the T460s was my choice. So after a couple weeks with it, here is my review.

It's definitely a ThinkPad

The T460s like all ThinkPads is an understated, matte black box with minimal branding. To give this box some toughness, Lenovo uses a combination of magnesium-alloy for the chassis plus carbon-fibre-reinforced plastic to surround the display for the lid, all of which feels very nice. The T460s is also much thinner and lighter than most of the other laptops Lenovo's ThinkPad lineup (save the X1 series) at 1.88 cm (0.74 in) tall and weighing just 1.36 kg (3.0 lb).

Performance & Hardware

While this model is configured with a dual-core Intel Skylake Core i5 chip at 2.80 GHz, it is configurable up to a Core i7, also dual-core, at 3.40 GHz, which isn't spectacular but is comparable with many other laptops in this class.

Fortunately, the magnesium case isn't a unibody design and the innards are easily accessible by unscrewing a few Phillips screws in the base. Memory-wise, the T460s comes with either 4GB or 8GB integrated with the motherboard, but there is a single slot for up to 16GB of additional DDR4 RAM which allows for some upgradeability. The same goes for the removable solid-state (and only solid-state) drive.

All this makes the T460s very quick to boot, but not necessarily a powerhouse. For me, it has enough performance for most tasks –it handles my graphics workload without a hitch.

Battery Life, Heat & Noise

The thinness of the T460s comes with a trade-off: you lose the swappable battery you find on most ThinkPads which is a good trade-off in my view. Instead the T460s has two 3-cell internal batteries (23Wh & 26Wh each) which gives it a purported max 10.5 hours of battery life however under pretty intensive use I've gotten more in the range of 7-8 hours.

While it's plugged-in and charging the underside of the T460s does get a little warm, but not significantly, which is likely a side effect of the laptop being thin and it using its metal enclosure to passively disperse heat.

Speaking of heat: fans. It has one, but not so you'd notice. Most of the time the T460s is dead silent thanks to its SSD and passive cooling, even on the rare occasion when the fan is running, it's so quiet you'd never know.

Ports & Connectivity

Keeping with ThinkPads' usefulness, Lenovo has crammed a tonne of ports into the sides of the T460s. The left hosts a single USB 3.0 port, a headphone jack and an SD card slot –the AC adapter plugs into this side as well. On right side you'll find 2 more USB 3.0 ports one of which is powered, HDMI out, a Mini DisplayPort, GigaBit Ethernet, a Kensington lock slot plus a SIM card & Smart card reader slot (regardless if you have either of those options).

You also get the usual assortment of the latest connectivity hardware in this Thinkpad: Intel 802.11ac wireless, Bluetooth 4.1 and optionally a WWAN module, with all the latest wireless standards.

Display

The display is a 14" IPS non-touch display at 1920x1080, but you can upgrade to a 2K (2560x1440) display with or without multi-touch.

Even at lowest configuration (1080p) the display is great, it's sufficiently bright and crisp with 250 nits and a 700:1 contrast ratio. Nearly all sane viewing angles are covered, as well a few insane ones since the display can open to a full 180° –why one would do this is beyond me– and the hinge its on is very rigid.

Keyboard & Input

The chiclet-style keyboard is an excellent typing experience, as you would expect from a ThinkPad, with ample travel on each key and a satisfying click. There are a few nice details like LED indicators for the FnLock and CapsLock keys as well as the Mute key, and I've opted to have the entire keyboard LED backlit as well. My only keyboard grievance is the Windows-specific keys in the function row, instead of more generic items –alas, this is a symptom of the Microsoft monopoly.

Now the touchpad in this ThinkPad isn't best-in-class, but it's sufficiently large and sports multitouch support –software-permitting–. But many ThinkPad users, like myself, go in for the requisite TrackPoint and if you like it, then great, if not, it's never in the way and if anything the addition buttons above the trackpad are still useful regardless if you use the nub. And in my view the little bit of red among all the black is a nice aesthetic touch.

Aside from the keyboard, nub and touchpad, the only other things on this side of the T460s are the power button and a fingerprint reader (which I haven't used, more on that later).

Camera & Audio

The 720p camera is a pretty standard webcam, which is paired with a dual-array microphone. The speakers, however, leave a bit to be desired. They're pretty much devoid of bass and at higher volumes things start to sound tinny. Also, being on the bottom of the laptop they will be slightly muffled if you happen to have the T460s on your lap or another soft surface. So stick to hard surfaces for the best sound or pack some headphones.

(One audio-related annoyance that I can't really fault Lenovo for overlooking is that at some volumes certain frequencies will vibrate the anti-static plastic tape that is on the inside of the laptop covering parts of the motherboard. That's my theory at least, I haven't removed the tape to test it.)

Does it run Linux?

Since I and probably many of you care about Linux support, I'm glad to say it does. However, since the T460s is brand new hardware, there may be issues running distros that ship older kernels (but I haven't tested that so don't hold me to it). But I'm all about using the latest and greatest, and Ubuntu 16.04 installs and works without a hitch. Driver-wise, the only thing that has no support at all is the fingerprint reader –which is no big loss– but everything else works great. That being said, that painlessness is due to the fact that Ubuntu ships proprietary drivers, if you care about that sort of thing.

The T460s comes with Windows 10, obviously, which is authenticated for Secure Boot (no entering license keys!) so you shouldn't have a problem reinstalling Windows 10 if you chose to do so.

Bottom Line

If you like the ThinkPad aesthetic (as I do) and don't mind the battery losses in exchange for a new thinner body and are looking for a great (Linux) laptop, then I'd very much recommend the T460s. The drawbacks it does have, lie mostly in with its mediocre speakers.

In my view, the best ThinkPads are and always will be machines for getting stuff done without compromising performance, durability or productivity. If you'd prefer a laptop with a flashier design and higher specs for the sake of higher specs, or if you value things like brushed aluminum and pounding bass, look elsewhere. But know that none of those other laptops are a ThinkPad.

  • Hardware & Design9
  • Keyboard10
  • Touchpad8
  • Display9
  • Speakers7
  • Battery8
  • Heat & Noise8
  • Performance8
  • Linux Compatibility10

Svetlana Belkin: Ubuntu 16.04

Planet Ubuntu - Sun, 04/24/2016 - 14:15

A few days ago, the next  (long term support) release of Ubuntu was released code named Xenial Xerus.  Like many, I decided to upgrade, no, not like the last four times where I upgraded directly.  This time I decided to freshly install Ubuntu 16.04 because I started to run into the whole  “problems on top of problems” issue.  My other excuse was to see if  can write a pair of  scripts that can automate the backup/restore process. Which I was able to with the help of a fellow friend of mine: Simon Quigley.

I used 16.04 for maybe a week before the release to test out the script and to also test out the system.  I hate to say this but I don’t really see or feel a difference between the last LTS and this one.  Perhaps, I didn’t explore it enough because I didn’t have time or maybe I’m still a basic end-user.  The only two differences I that noted was that fact that my favorite IRC client, X-chat, isn’t the repos but I can understand that since it’s not being maintained anymore and the other difference is that the file manger got a makeover for external drivers (now listed as “Other Locations”).

Because of the difference that X-chat isn’t in the repos, I decided to switch to Irssi.   Also, I will kick off a new series of post titled, “What I use on Ubuntu”, and they will explain what programs I use and how I use them.

Aurélien Gâteau: Reordering a Qt Quick ListView via drag'n'drop - part 1

Planet Ubuntu - Sun, 04/24/2016 - 09:28

It is common in user interfaces to provide the user with a list of elements which can be reordered by dragging them around. Displaying a list of elements with Qt Quick is easy, thanks to the ListView component. Giving the user the ability to reorder them is less straightforward. This 3 article series presents one way to implement this.

The goal of this first article is to create a list which can be used like this:

Architecture

The approach I used was to do all the work in a DraggableItem, leaving the ListView untouched. DraggableItem is used as the delegate of the ListView, and wraps the real QML item responsible for showing the details of the list element.

Lets start with main.qml. Nothing fancy at the beginning, we create a Window and a ListModel defining our elements:

import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 Window { visible: true width: 500 height: 400 ListModel { id: myModel ListElement { text: "The Phantom Menace" } ListElement { text: "Attack of the Clones" } ListElement { text: "Revenge of the Siths" } ListElement { text: "A New Hope" } ListElement { text: "The Empire Strikes Back" } ListElement { text: "Return of the Jedi" } ListElement { text: "The Force Awakens" } }

Now comes the main Item. It contains a ColumnLayout which holds a Rectangle faking a toolbar and our ListView, wrapped in a ScrollView:

Item { id: mainContent anchors.fill: parent ColumnLayout { anchors.fill: parent spacing: 0 Rectangle { color: "lightblue" height: 50 Layout.fillWidth: true Text { anchors.centerIn: parent text: "A fake toolbar" } } ScrollView { Layout.fillWidth: true Layout.fillHeight: true ListView { id: listView model: myModel delegate: DraggableItem { Rectangle { height: textLabel.height * 2 width: listView.width color: "white" Text { id: textLabel anchors.centerIn: parent text: model.text } // Bottom line border Rectangle { anchors { left: parent.left right: parent.right bottom: parent.bottom } height: 1 color: "lightgrey" } } draggedItemParent: mainContent onMoveItemRequested: { myModel.move(from, to, 1); } } } }

We can see DraggableItem used as a delegate of the ListView. Its API is simple: it wraps another item which shows the content (here it is a rectangle with a text and a one-pixel border at the bottom).

DraggableItem has one property: draggedItemParent, which defines which item becomes the parent of our content item while it is being dragged around. Setting this to the main content of your window gives a more natural feeling when you drag the item below or above the ListView: the item is not clipped to its view and appears on top of the other UI elements.

It also has a signal: moveItemRequested, which is emitted when the user dragged an item from one place to another. In this example we use ListModel.move to react to this but if you use a custom model you could call any other method.

DraggableItem implementation

DraggableItem contains a contentItemWrapper item, which is the parent of the DraggableItem child. When we start dragging, contentItemWrapper is reparented to the item specified in the draggedItemParent property of DraggableItem.

This is the beginning of DraggableItem.qml, it shows how contentItem is wrapped inside contentItemWrapper:

import QtQuick 2.0 Item { id: root default property Item contentItem // This item will become the parent of the dragged item during the drag operation property Item draggedItemParent signal moveItemRequested(int from, int to) width: contentItem.width height: contentItem.height // Make contentItem a child of contentItemWrapper onContentItemChanged: { contentItem.parent = contentItemWrapper; } Rectangle { id: contentItemWrapper anchors.fill: parent

Lets finish the definition of contentItemWrapper and continue with the code necessary to start the drag:

// Drag.active: dragArea.drag.active Drag.hotSpot { x: contentItem.width / 2 y: contentItem.height / 2 } MouseArea { id: dragArea anchors.fill: parent drag.target: parent // Keep the dragged item at the same X position. Nice for lists, but not mandatory drag.axis: Drag.YAxis // Disable smoothed so that the Item pixel from where we started the drag remains // under the mouse cursor drag.smoothed: false onReleased: { if (drag.active) { emitMoveItemRequested(); } } } } states: [ State { when: dragArea.drag.active name: "dragging" ParentChange { target: contentItemWrapper parent: draggedItemParent } PropertyChanges { target: contentItemWrapper opacity: 0.9 anchors.fill: undefined width: contentItem.width height: contentItem.height } PropertyChanges { target: root height: 0 } } ]

A few things are worth noting here:

To create a draggable area, we use a MouseArea with the drag.target property set to the Item we want to drag.

In contentItemWrapper, we set Drag.active to dragArea.drag.active. If we did not do this, we would still be able to drag our Item, but DropArea would not notice it moving hover them (DropArea.containsDrag would remain false). We also define Drag.hotspot to the center of the dragged item. The hotspot is the coordinate within the dragged item which is used by DropArea to determine if a dragged item is over them.

When we start dragging, we change to the "dragging" state. In this state contentItemWrapper is reparented to draggedItemParent and the DraggableItem height is reduced to 0, completely hiding it.

Unless you associate data to your drag, for example to implement dragging from an application to another, the DropArea won't emit the dropped signal. This is why we trigger the move in the handler of the MouseArea released signal.

Dropping

Now that we have the "drag" part, we need to take care of the "drop" part.

Each DraggableItem contains a DropArea which is the same size as the DraggableItem and is positioned between its DraggableItem and the one next to it. This way when the user drops an item on a DropArea, we know we have to insert the dragged item after the item which owns the DropArea.

There is a special case though: we also want the user to be able to drop an item before the first item. To handle this, the first DraggableItem of the list is going to be special: it will have another DropArea, with its vertical center aligned to the top edge of the DraggableItem.

This diagram should make it clearer:

As you can see, "Item 0" has two DropArea, whereas the other items only have one. Here is the code which adds the DropAreas:

Loader { id: topDropAreaLoader active: model.index === 0 anchors { left: parent.left right: parent.right bottom: root.verticalCenter } height: contentItem.height sourceComponent: Component { DraggableItemDropArea { dropIndex: 0 } } } DraggableItemDropArea { anchors { left: parent.left right: parent.right top: root.verticalCenter } height: contentItem.height dropIndex: model.index + 1 }

We use a Loader to create the special DropArea for the first item of the list. DraggableItemDropArea is just a DropArea with a dropIndex property and a Rectangle to show a drop indicator. Before showing its code, lets finish the code of DraggableItem. The only remaining part is the function responsible for emitting the moveItemRequested signal:

function emitMoveItemRequested() { var dropArea = contentItemWrapper.Drag.target; if (!dropArea) { return; } var dropIndex = dropArea.dropIndex; // If the target item is below us, then decrement dropIndex because the target item is // going to move up when our item leaves its place if (model.index < dropIndex) { dropIndex--; } if (model.index === dropIndex) { return; } root.moveItemRequested(model.index, dropIndex); }

That's it for DraggableItem.

DraggableItemDropArea

Not much complexity here, we will actually remove this component later in the series. Here is the code:

import QtQuick 2.0 DropArea { id: root property int dropIndex Rectangle { id: dropIndicator anchors { left: parent.left right: parent.right top: dropIndex === 0 ? parent.verticalCenter : undefined bottom: dropIndex === 0 ? undefined : parent.verticalCenter } height: 2 opacity: root.containsDrag ? 0.8 : 0.0 color: "red" } }

DraggableItemDropArea adds a dropIndex property and a Rectangle to draw the 2 pixel red line indicating where the item is going to be dropped, with a small hack to position the Rectangle correctly for the special case of the top DropArea of the first DraggableItem.

That's it for this first article in the series. You can find the source code in the associated GitHub repository, under the "1-base" tag. You can now continue to the next article of the series.

Lubuntu Blog: Ubuntu 16.04 LTS on the Raspberry Pi 2!

Planet Ubuntu - Sun, 04/24/2016 - 06:18
The Raspberry Pi 2 version of Lubuntu has been updated to Lubuntu 16.04 LTS. Now it’s available at the downloads section. Grab it while it’s hot!

Paul White: Some thoughts about Xenial development, an annoying bug and Yakkety Yak

Planet Ubuntu - Sun, 04/24/2016 - 04:28
Xenial development

Having recently relieved myself of various Ubuntu related commitments I've now become somewhat of a "floating contributor." Over the last few months I've spent a lot of time submitting and commenting on bug reports, testing ISOs and generally keeping abreast of what has been happening amongst various Ubuntu flavours especially Xubuntu. I continue to be very impressed by the hard work and enthusiasm of the "flavour" development teams who are of course all  unpaid volunteers.

Xubuntu 16.04 LTSDuring the latter stages of the Xenial development cycle I tried to bring certain bugs to the attention of the developers and also provided the Xubuntu team with feedback about bugs specific to their flavour. I wish I could have done a lot more but I do have other interests and commitments especially at weekends when the sun is shining and I decide I'd rather be outdoors.

An annoying Ubuntu bug

Back in May 2015, Charles Profitt wrote a blog post entitled "Ubuntu Trash Bug", in which he stated that he would not upgrade to Ubuntu 15.04 because a bug bothered him so much.

I recently remembered reading his post and thought that after working with the development version of Ubuntu 16.04 LTS for several months I've also seen a number of trivial bugs that have also bothered me greatly. They've been reported on Launchpad, added to the ISO Tracker numerous times yet Xenial Xerus has been released with a number of these bugs still very evident.

For me, the most annoying bug in Ubuntu Xenial Xerus is bug #1521302 where gnome terminal windows that have been maximised in a Unity session cannot be restored to their original size. As a keen user of the command line I really hope that this bug, which of course is affecting many more users now that 16.04 has been released, will be fixed by the time of the first point release later in the year. Sadly the bug report is starting to attract adverse comments from users who just wish to express their opinion about the general usability, as they see it, of the latest release.

My recommended alternative for now is terminator which isn't affected by this bug.

Yakkety Yak

I'm sure that I was not alone in thinking that that next release of Ubuntu might be called Yakkety Yak but then thought that there's no way that Mark Shuttleworth would ever chose such an obvious codename. Of course I was wrong.

However, Yakkety Yak, or however you might want to spell it, will always remind me of this:


Daniel Pocock: LinuxWochen, MiniDebConf Vienna and Linux Presentation Day

Planet Ubuntu - Sat, 04/23/2016 - 23:23

Over the coming week, there are a vast number of free software events taking place around the world.

I'll be at the LinuxWochen Vienna and MiniDebConf Vienna, the events run over four days from Thursday, 28 April to Sunday, 1 May.

At MiniDebConf Vienna, I'll be giving a talk on Saturday (schedule not finalized yet) about our progress with free Real-Time Communications (RTC) and welcoming 13 new GSoC students (and their mentors) working on this topic under the Debian umbrella.

On Sunday, Iain Learmonth and I will be collaborating on a workshop/demonstration on Software Defined Radio from the perspective of ham radio and the Debian Ham Radio Pure Blend. If you want to be an active participant, an easy way to get involved is to bring an RTL-SDR dongle. It is highly recommended that instead of buying any cheap generic dongle, you buy one with a high quality temperature compensated crystal oscillator (TXCO), such as those promoted by RTL-SDR.com.

Saturday, 30 April is also Linux Presentation Day in many places. There is an event in Switzerland organized by the local local FSFE group in Basel.

DebConf16 is only a couple of months away now, Registration is still open and the team are keenly looking for additional sponsors. Sponsors are a vital part of such a large event, if your employer or any other organization you know benefits from Debian, please encourage them to contribute.

Scott Kitterman: Computer System Security Policy Debate (Follow-up)

Planet Ubuntu - Sat, 04/23/2016 - 15:12

As a follow-up to my recent post on the debate in the US over new encryption restrictions, I thought a short addition might be relevant.  This continues.

There was a recent Congressional hearing on the topic that featured mostly what you would expect.  Police always want access to any possible source of evidence and the tech industry tries to explain that the risks associated with mandates to do so are excessive with grandstanding legislators sprinkled throughout.   What I found interesting (and I use that word with some trepidation as it is still a multi-hour video of a Congressional hearing) is that there was rather less grandstanding and and less absolutism from some parties than I was expecting.

There is overwhelming consensus that these requirements [for exceptional access] are incompatible with good security engineering practice

Dr. Matthew Blaze

The challenge is that political people see everything as a political/policy issue, but this isn’t that kind of issue.  I get particularly frustrated when I read ignorant ramblings like this that dismiss the overwhelming consensus of the people that actually understand what needs to be done as emotional, hysterical obstructionism.  Contrary to what seems to be that author’s point, constructive dialogue and understanding values does nothing to change the technical risks of mandating exceptional access.  Of course the opponents of Feinstein-Burr decry it as technologically illiterate, it is technologically illiterate.

This doesn’t quite rise to the level of that time the Indiana state legislature considered legislating a new value (or in fact multiple values) for the mathematical constant Pi, but it is in the same legislative domain.

Salih Emin: How to search – install – remove, Snap packages in Ubuntu

Planet Ubuntu - Fri, 04/22/2016 - 12:02
In this short video tutorial, we will see how to use the new Snap package manager to search and install/remove Snap packages and some useful commands.

Jonathan Riddell: kver’s definition of anarchy

Planet Ubuntu - Thu, 04/21/2016 - 15:12

This amused me

Possible differences/anarchy may include:

  • Strange chewing noises if inserting a disc.
  • Never finding the correct orientation of USB plugs.
  • Your machine mysteriously moving several inches if you leave the room briefly.
  • Your printer demanding white ink to operate.
  • Small house pets may go missing, tufts of fur in keyboard.
  • Growling noises if holding the power button down.
  • Kate highlighting the PHP ‘die’ command in bold, regardless of setting.
by

Sean Davis: Xubuntu 16.04 LTS “Xenial Xerus” Released

Planet Ubuntu - Thu, 04/21/2016 - 14:48
Here we are again, folks. After six more months of development (two years since the last LTS), we’ve got another fantastic release — Xubuntu 16.04 LTS “Xenial Xerus”! I wanted to find a nice squirrel quote, but it seems most folks have a horrific dislike for the little critters. — Myself, after looking up squirrel […]

Jono Bacon: Dan Ariely on Building More Human Technology, Data, Artificial Intelligence, and More

Planet Ubuntu - Thu, 04/21/2016 - 13:59

Behavioral economics is an exciting skeleton on which to build human systems such as technology and communities.

One of the leading minds in behavioral economics is Dan Ariely, New York Times best-selling author of Predictably Irrational, The Upside Of Irrationality, and frequent TED speaker.

I recently interviewed Dan for my Forbes column to explore how behavioral economics is playing a role in technology, data, artificial intelligence, and preventing online abuse. Predictably, his insight was irrationally interesting. OK, that was a stretch.

Read the piece here

Lubuntu Blog: Lubuntu 16.04 Xenial Xerus LTS released

Planet Ubuntu - Thu, 04/21/2016 - 11:30
Thanks to all the hard work from our contributors, Lubuntu 16.04 LTS has been released! With the codename Xenial Xerus, Lubuntu 16.04 LTS is the 10th release of Lubuntu, and the second long term support release. Lubuntu 16.04 LTS will be supported until April 2019, with three years of support. What is Lubuntu? Lubuntu is […]

Pages

Subscribe to Ubuntu Arizona LoCo Team aggregator