20180415

How does the 'in' keyword work in Python?

A subtitle to this post could be More yak shaving

A few days go I played a bit with a naive implementation of Bloom filters in Python. I wanted to time them against just checking whether a field is in a set/collection. I found something slightly puzzling: it looked like in worked too fast for smaller lists. And I wondered: maybe small lists are special internally, and allow for really fast lookups? Maybe they have some internal index? This raised the question: how does in find stuff in sequences?
Written by Ruben Berenguel

20180325

Coursier resolution failing with HTTP method 416 in sbt

Or, how I made my first contribution to coursier
[trace] Stack trace suppressed: run last service/*:update for the full output.
[error] (service/*:update) coursier.ResolutionException: 1 download error
[error]     Caught java.io.IOException: 
    Server returned HTTP response code: 416 for URL: 
    https://repo1.maven.org/maven2/org/graylog2/gelfj/1.1.14/gelfj-1.1.14.jar 
    (Server returned HTTP response code: 416 for URL: 
https://repo1.maven.org/maven2/org/graylog2/gelfj/1.1.14/gelfj-1.1.14.jar) 
    while downloading 
    https://repo1.maven.org/maven2/org/graylog2/gelfj/1.1.14/gelfj-1.1.14.jar
I ran into this problem with sbt dependency resolution around 7 weeks ago. I was in a hurry, so I commented out the offending import (since it was not in the subproject I was working on, so was not needed for the run I was in) sent my commit to the heavens and CircleCI was happy.

I was not happy though. For the next weeks (sounds like a lot, but it was more like 2 commits), every time I had to work on this project I was commenting the import to get it to compile/run/test. Until I was fed up enough to check what the problem was.
Written by Ruben Berenguel

20180309

Book Review: Work Clean

Down into some net rabbit hole, I stumbled upon a review of Work Clean. I chuckled: a productivity book, philosophizing about how cook’s approach to preparation (mise en place) would fix all our problems? Bring it on, I have a long commute.

Actually, I found the book surprisingly good if you stick to the practical side and discard the hyperbole. As an occasional home cook with a big dose of planning and OCD built into me, I got the point.

Here I’ll share some of the key takeaways I got. I recommend you get the book, by the way.
Written by Ruben Berenguel