17 Jul 2018

feedPlanet Debian

Gunnar Wolf: A very nice side-project that has come to fruition: Fresh from the 1960s, my father's travel memories

So... Everybody I've interacted with along the last couple of weeks knows I'm basically just too busy. If I'm not tied up with stuff regarding my privacy/anonymity project at the university, I am trying to get the DebConf scheduling, or trying to catch up with my perpetual enemy, mail backlog. Of course, there's also my dayjob - Yes, it's vacation time, but I'm a sysadmin, and it's not like I want to give software updates much of a vacation! Of course, my family goes to Argentina for a couple of weeks while I go to DebConf, so there's quite a bit of work in that sphere as well, and... And... And... Meh, many other things better left unaccounted for ☺
But there's one big extra I was working on, somewhat secretly, over the last two months. I didn't want to openly spill the beans on it until it was delivered in hand to its recipient.
Which happened this last weekend. So, here it is!

During the late 1960s, my father studied his PhD in Israel and had a posdoctoral stay in Sweden. During that time, he traveled through the world during his vacations as much as he could - This book collects his travels through Ethiopia (including what today is Eritrea), Kenya, Uganda, Rwanda, Burundi, Turkey, Afghanistan, Pakistan, Czechoslovakia, Sweden, Norway, Iceland and India. As he took those trips, he wrote chronicles about them, and sent them to Mexico's then-most-important newspaper (Excélsior), which published each of them in four to six parts (except for the Czechoslovakia one, which is a single page, devoted to understanding Prague two years after the Soviet repression and occupation).

I did this work starting from the yellow-to-brown and quite brittle copies of the newspaper he kept stored in a set of folders. I had the help of a digitalization professional that often works for the University, but still did a couple of cleanup and QA reads (and still, found typos... In the first printed page, in the first title! :-/ ). The text? Amazing. I thoroughly enjoyed it. He wrote the chronicles being between 23 and 27 years old, but the text flows quick and easy, delightful, as if coming from a professional writer. If you can read Spanish, I am sure you will enjoy the read:

Chronicles of a backpacker in a more naïve world

Why am I publishing this now, amid the work craze I've run into? Because my father is turning 75 year old next weekend. We rushed the mini-party for him (including the book-as-a-present) as we wanted my kids to deliver the present, and they are now in a plane to South America.

The book run I did was quite limited - Just 30 items, to give away to family and close friends. I can, of course, print more on demand. But I want to take this work to a publisher - There are many reasons I believe these youth chronicles are of general interest.

Attachment Size
libro_bwolf.jpg 64.11 KB
portada.jpg 368.39 KB
cronicas_de_un_mochilero.pdf 25.3 MB

17 Jul 2018 12:03am GMT

16 Jul 2018

feedPlanet Debian

Russ Allbery: Review: Effective Python

Review: Effective Python, by Brett Slatkin

Publisher: Addison-Wesley
Copyright: 2015
ISBN: 0-13-403428-7
Format: Trade paperback
Pages: 216

I'm still looking for a programming language book that's as good as Joshua Bloch's Effective Java, which goes beyond its surface mission to provide valuable and deep advice about how to think about software construction and interface design. Effective Python is, sadly, not that book. It settles for being a more pedestrian guide to useful or tricky corners of Python, with a bit of style guide attached (although not as much as I wanted).

Usually I read books like this as part of learning a language, but in this case I'd done some early experimenting with Python and have been using it extensively for my job for about the past four years. I was therefore already familiar with the basics and with some coding style rules, which made this book less useful. This is more of an intermediate than a beginner's book, but if you're familiar with list and hash comprehensions, closures, standard method decorators, context managers, and the global interpreter lock (about my level of experience when I started reading), at least half of this book will be obvious and familiar material.

The most useful part of the book for me was a deep look at Python's object system, including some fully-worked examples of mix-ins, metaclasses, and descriptors. This material was new to me and a bit different than the approach to similar problems in other programming languages I know. I think this is one of the most complex and hard-to-understand parts of Python and will probably use this as a reference the next time I have to deal with complex class machinery. (That said, this is also the part of Python that I think is the hardest to read and understand, so most programs are better off avoiding it.) The description of generators and coroutines was also excellent, and although the basic concepts will be familiar to most people who have done parallelism in other languages, Slatkin's treatment of parallelism and its (severe) limitations in Python was valuable.

But there were also a lot of things that I was surprised weren't covered. Some of these are due to the author deciding to limit the scope to the standard library, so testing only covers unittest and not the (IMO far more useful) pytest third-party module. Some are gaps in the language that the author can't fix (Python's documentation situation for user-written modules is sad). But there was essentially nothing here about distutils or how to publish modules properly, almost nothing about good namespace design and when to put code into __init__.py (a topic crying out for some opinionated recommendations), and an odd lack of mention of any static analysis or linting tools. Most books of this type I've read are noticeably more comprehensive and have a larger focus on how to share your code with others.

Slatkin doesn't even offer much of a style guide, which is usually standard in a book of this sort. He does steer the reader away from a few features (such as else with for loops) and preaches the merits of decomposition and small functions, among other useful tidbits. But it falls well short of Damian Conway's excellent guide for Perl, Perl Best Practices.

Anyone who already knows Python will be wondering how Slatkin handles the conflict between Python 2 and Python 3. The answer is that it mostly doesn't matter, since Slatkin spends little time on the parts of the language that differ. In the few places it matters, Effective Python discusses Python 3 first and then mentions the differences or gaps in Python 2. But there's no general discussion about differences between Python 2 and 3, nor is there any guide to updating your own programs or attempting to be compatible with both versions. That's one of the more common real-world problems in Python at the moment, and was even more so when this book was originally written, so it's an odd omission.

Addison-Wesley did a good job on the printing, including a nice, subtle use of color that made the physical book enjoyable to read. But the downside is that this book has a surprisingly expensive retail ($40 USD) for a fairly thin trade paperback. At the time of this writing, Amazon has it on sale at 64% off, which takes the cost down to about the right territory for what you get.

I'm not sorry I read this, and I learned a few things from it despite having used Python fairly steadily for the last few years. But it's nowhere near good enough to recommend to every Python programmer, and with a bit of willingness to search out on-line articles and study high-quality code bases, you can skip this book entirely and never miss it. I found it oddly unopinionated and unsatisfying in the places where I wish Python had more structure or stronger conventions. This is particularly strange given that it was written by a Google staff engineer and Google has a quite comprehensive and far more opinionated coding style guide for Python.

If you want to dig into some of Python's class and object features or see a detailed example of how to effectively use coroutines, Effective Python is a useful guide. Otherwise, you'll probably learn some things from this book, but it's not going to significantly change how you approach the language.

Rating: 6 out of 10

16 Jul 2018 1:25am GMT

15 Jul 2018

feedPlanet Debian

Dirk Eddelbuettel: RcppClassic 0.9.11

A new maintenance release, now at version 0.9.11, of the RcppClassic package arrived earlier today on CRAN. This package provides a maintained version of the otherwise deprecated initial Rcpp API which no new projects should use as the normal Rcpp API is so much better.

Per another request from CRAN, we updated the source code in four places to no longer use dynamic exceptions specification. This is something C++11 deprecated, and g++-7 and above now complain about each use. No other changes were made.

CRANberries also reports the changes relative to the previous release.

Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

15 Jul 2018 11:44pm GMT