Crell/ApiProblem – a simple implementation of the api-problem specification

I’ve been working with REST/RESTful APIs for a while now.  They are usually a lot better than the SOAP or XML-RPC stuff we had before.  But they are also not perfect.  Error handling and reporting is a common area between many implementations that needs more attention and consistency.  Turns out, there is, I’ve just somehow never heard of it – RFC7807 defines “Problem Details for HTTP APIs”.

I’ll need to look more into this and see if and how it is better than a variety of things I’m using now.  Gladly, there is even a PHP library to help with that – Crell/ApiProblem:

This library provides a simple and straightforward implementation of the IETF Problem Details for HTTP APIs, RFC 7807.

RFC 7807 is a simple specification for formatting error responses from RESTful APIs on the web. This library provides a simple and convenient way to interact with that specification. It supports generating and parsing RFC 7807 messages, in both JSON and XML variants.

sr.ht (“sir hat”) – open source software suite for managing your software development projects

sr.ht – pronounced “sir hat” – is a new competitor in the world of GitHub, BitBucket, and GitLab.  Much like all of these, you can either self-hosted it or use a managed service.  It might not yet be as fancy, polished, and cool (I think they need a better name and the domain) as its competitors, but there are a couple of reasons that might make a difference when making a choice:

  1. Open Source.  From a quick look, sr.ht is distributed under the GNU Afero GPL.
  2. Modular.  The suite consists of the following components:
    1. git – git repository hosting service
    2. build – continuous integration service
    3. lists – mailing lists service
    4. todo – ticketing system / bug tracker
    5. dispatch – task dispatcher and integration service
    6. man – markdown and git-based wiki service
    7. meta – account management service

 

The History of Unix, Rob Pike

Rob Pike talks about the history of Unix and his quite remarkable career.  And here’s my favorite quote from the video, referring to “The Unix Programming Environment” book:

It is amazing to me that the book that came out in the late 1983 is still technically relevant today.  It’s insane!

Specification gaming examples in AI

Here’s a super fun list of things that artificial intelligence figured out by gaming the rules, like inconsistent and incomplete specifications, bugs, and other bits that humans frequently assume and ignore.

Some examples to get you started are:

  • Aircraft landing: evolved algorithm for landing aircraft exploited overflow errors in the physics simulator by creating large forces that were estimated to be zero, resulting in a perfect score.
  • Block moving: a robotic arm trained to slide a block to a target position on a table achieves the goal by moving the table itself.
  • Data ordering patterns: neural nets evolved to classify edible and poisonous mushrooms took advantage of the data being presented in alternating order, and didn’t actually learn any features of the input images.
  • Road runner: agent kills itself at the end of level 1 to avoid losing in level 2.
  • Ruler detector: AI trained to classify skin lesions as potentially cancerous learns that lesions photographed next to a ruler are more likely to be malignant.
  • Tetris: agent pauses the game indefinitely to avoid losing.

This is truly thinking outside the box!

On submitting trivial patches

Hacker News points to this Linux kernel patch, done by a 4-year old.  With some assistance, of course, but still impressive.  And while the story is cute, the comments are even better.  In particular, a link to this email from Linus Torvalds, talking about the importance of the small and trivial contributions.

To me, the biggest thing with small patches is not necessarily the patch itself. I think that much more important than the patch is the fact that people get used to the notion that they can change the kernel – not just on an intellectual level (“I understand that the GPL means that I have the right to change my kernel”), but on a more practical level (“Hey, I did that small change”).