20190304

2019-8 Readings of the week

NOTE: The themes are varied, and some links below are affiliate links. Software engineering, formal methods, fraud, Scala. Expect a similar wide range in the future as well. You can check all my weekly readings by checking the tag here . You can also get these as a weekly newsletter by subscribing here.

Messaging startup Slack is secretly an acronym for...

No spoilers, you'll need to click. It may or may not surprise you

Beautiful, Simple, Testable Functional Effects for Scala

Next thing I write in a functional style in Scala, it will be using Zio for sure. This was a follow-up to a talk given at Skills Matter, and shortly followed by a podcast interview in Scala Love. Haven't watched the talk yet, but the podcast was good.

Apple highlights best photos shot on iPhone around the world

They look good. And that may be an understatement.

Formally Specifying UIs

If you've been following my readings of the week you'll know I've been converted into a fan of formal methods. And alloy is pretty cool.

Building the Hangman Game using ZIO

An approachable example (in addition to the details in the post above by John himself) based in a talk John gave, detailed by Abhishek Srivastava.

Revolut insiders reveal the human cost of a fintech unicorn's wild rise

This week the CFO of Revolut resigned his position, after (possibly) an investigation about fraud. That was an amber flag, but reading how Revolut's CEO treats employees... As a worker in the same space (tech) that's a red. I had been using Revolut for more than a year (before I used Monzo) and I'll be using N26 as soon as I get my card. By enrolling by the N26 link here I think I get some kind of affiliate return, I'm not sure.

The hard part in becoming a command line wizard

In the end, it's the hard part in becoming a wizard in anything. Math, programming, playing the ukulele.

Casper’s clever little nightlight

I don't read many hardware breakdowns, but somehow I clicked on this one and now I want one of these nightlights.

📚 The Storytelling Animal: How Stories Make Us Human

I was attracted to the premise of this book, but it felt pretty underwhelming. It has pretty high reviews, so it may have been just me.

Newsletter?

These weekly posts are also available as a newsletter. These days (since RSS went into limbo) most of my regular information comes from several newsletters I’m subscribed to, instead of me going directly to a blog. If this is also your case, subscribe by clicking here.
Written by Ruben Berenguel

20190226

2019-7 Readings of the week

NOTE: The themes are varied, and some links below are affiliate links. Formal methods, Scala, productivity. Expect a similar wide range in the future as well. You can check all my weekly readings by checking the tag here . You can also get these as a weekly newsletter by subscribing here.


Solving Knights and Knaves with Alloy

Once you start your journey down the formal methods rabbit hole (which I started with TLA+) you can never stop. This is a very good introduction to Alloy, a modelling language which seems well suited for data structure descriptions (not procedural/step-time models)

Seeking the Productive Life: Some Details of My Personal Infrastructure

As much as I don't like Stephen Wolfram, his obsessive take on being productive echoes mine. And that worries me.

Encryption Key Hierarchies in Alloy

Next after the intro above, this is a short post about how you would set up a reasonable hierarchy of keys in an organisation. Something like "Infrastructure team owns infrastructure keys, developers own GitHub" but with more layers. Then you can automatically check somebody has access to stuff, etc. Neat.

Is your Scala object always a singleton?

The guys at SoftwareMill (excellent technical blog and people) stumbled upon this. The kind of bug that could defeat you, but they succeeded, and documented it for the rest of us.

Proving Games are Winnable with Alloy

And the final instalment in this week's formal method extravaganza, how to prove a randomised game (say, Zelda) can be winnable using Alloy.

Don't Let the Internet Dupe you, Event Sourcing is Hard

Yep, can totally agree, I've hit some of the roadblocks and fun moments the author shares. As usual, some HackerNews comments can be enlightening.

On Being A Senior Engineer

There are many definitions of what being senior is, but you can't go wrong trying to follow these suggestions

Hold the front pages: meet the endpaper enthusiasts

I'm pretty sure you didn't know there are collectors of endpaper.

Beating hash tables with trees? The ART-ful radix trie

A synopsis of a data structure paper, about ART radix tries. They are kind-of-like tries, but try to use less memory.

Scala pattern matching: apply the unapply

In case you didn't know how pattern matching works (hint: unapply), this post will tell you.

buffer-expose emacs package

A package released late last week, it helps you navigate your open buffers in a visual way. Pretty neat, and even with my usual 20+ buffers seems to work seamlessly.

Newsletter?

These weekly posts are also available as a newsletter. These days (since RSS went into limbo) most of my regular information comes from several newsletters I’m subscribed to, instead of me going directly to a blog. If this is also your case, subscribe by clicking here.
Written by Ruben Berenguel

20190219

Apache Hive and java.lang.ClassCastException on start

Photo by Annie Spratt on Unsplash

A couple of days ago I installed Hive from Homebrew on my Mac. Sadly, when I tried to run the hive command, I got the weird-looking error

Exception in thread "main" java.lang.ClassCastException: 
  class jdk.internal.loader.ClassLoaders$AppClassLoader 
   cannot be cast to 
  class java.net.URLClassLoader 
  (jdk.internal.loader.ClassLoaders$AppClassLoader 
    and 
  java.net.URLClassLoader are in module java.base of loader 'bootstrap')

That looked like a JVM incompatibility, so I switched from GraalVM (the one I use by default) to Java 8 (I have aliases jgrce, jgree, j8 and j11 to switch JVMs). Still, the same error regardless. Weird. Maybe Java 11 (the other JVM I have installed)? Nope, same error.

A quick Googling confirmed that this was related to Hive picking up Java 11, but only working with 7, 8 or 9 (not sure about 9). This in turn is due to the Hive boot scripts looking for the latest JRE which is at least 7, like the hive command here:

JAVA_HOME="$(/usr/libexec/java_home --version 1.7+)" \ 
HIVE_HOME="/usr/local/Cellar/hive/3.1.1/libexec" exec \
"/usr/local/Cellar/hive/3.1.1/libexec/bin/hive" "$@"

This will pick 11, which no longer has URLClassLoader (I think this was changed in Java 9). So, won't start.

Sadly the only reasonable fix is modifying the scripts after installation, unless you want to just uninstall Java > 1.8. For me this was not an option, so I just modified the scripts by removing the JAVA_HOME condition (since I set my JAVA_HOME globally when I switch between JVMs). And crossing fingers to remember I did so next time I upgrade HomeBrew.

Written by Ruben Berenguel