Rubenerd logo

Rubenerd



jOOQ SQL for Java

The jOOQ framework is pretty cool; it makes SQL look and work like Java.

This is an example from their page in raw SQL:

  SELECT AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, COUNT(*)
    FROM AUTHOR
    JOIN BOOK ON AUTHOR.ID = BOOK.AUTHOR_ID
   WHERE BOOK.LANGUAGE = 'DE'
     AND BOOK.PUBLISHED > DATE '2008-01-01'
GROUP BY AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME
  HAVING COUNT(*) > 5
ORDER BY AUTHOR.LAST_NAME ASC NULLS FIRST
   LIMIT 2
  OFFSET 1

And jOOQ-ified:

create.select(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, count())
  .from(AUTHOR)
  .join(BOOK).on(AUTHOR.ID.equal(BOOK.AUTHOR_ID))
  .where(BOOK.LANGUAGE.eq("DE"))
  .and(BOOK.PUBLISHED.gt(date("2008-01-01")))
  .groupBy(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
  .having(count().gt(5))
  .orderBy(AUTHOR.LAST_NAME.asc().nullsFirst())
  .limit(2)
  .offset(1)

Syntax highlighting would have made this better. But you get the jist.

At this stage, I’d normally comment about my brief history in Java. I’d mention that I did work as a Java developer in an enterprise setting briefly, and save from a severe bout of CamelCaseItis, it wasn’t altogether bad. Maybe something here about Scala and jRuby. I’d then identify my SQL as being tolerable, but enough to be dangerous. Finally, I’d mention this project being kinda cool, and its chaining of methods reminding me a bit of Ruby, followed with a pun about ActiveRecord.

But I won’d do that this time.


GitHub supported manifest files

GitHub has the concept of a dependency graph you can view in a public or private repo, to view relationships between dependencies and be alerted to security issues. According to one of my public repos, emphasis added:

To enable the dependency graph, your repository must define dependencies in one of the supported manifest file types, like package.json or Gemfile.

Interesting, I wonder what other manifest files are supported? Let’s click the link and find out:

To enable the dependency graph for your project, your repository must define Ruby or JavaScript dependencies in either a Gemfile or package.json file.

Huh, that was it?

The issue is like and either are not equivalent. The word like in this context suggests a partial subset; you wouldn’t say there are two condiment choices, like mustard and tomato sauce.

We have both kinds, country and western!


Sunrise, by everyone

Kagamine Len figure by Tony Taka

I thought the title for that Norah Jones song sounded familiar. This is a list of all the artists in my iTunes library that have songs called Sunrise:

Pictured above is the Tony Taka figure of Kagamine Len from Vocaloid I still badly want, but it’d run counter to my decluttering efforts. He isn’t any of the above people, therefore his inclusion in this post is entirely pointless.

You know what else runs counter? A for loop. I’ll step down now.


Yearly archives in GoHugo

You can now browse posts here by year again, which is kinda cool. The links are now in the sidebar and archive pages. For those reading this via RSS, these are the browsable years:

2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004

I wish I did some tricked out Go to make this possible, but I just created a year taxonomy in Hugo. In my config.yaml, which I use instead of TOML, like a gentleman:

taxonomies:
  category: "category"
  tag: "tag"
  year: "year"

And in the frontmatter for typical blog posts:

title: "Yearly archives in GoHugo"
date:  "2018-01-07T10:51:23+11:00"
year:  "2018"

The illustrious Edgar F. Codd and Raymond F. Boyce would scoff at this, but works and is very fast.

Which reminds me, consider this another shameless plug for Hugo. I loved using Jekyll, but it took forever to parse and generate thousands of posts. Hugo is orders of magnitude faster; this is not an exaggeration! Also, if you haven’t tried static site generation for your blog, please do.


Not attributing motives or histories to people

I didn’t mention it in my welcome to 2018 post, but another goal I had for this year was to try to stop attributing motives or histories to people I don’t know. It was informed by a couple of incidents Clara and I had with random people last year:

  • A woman screamed “AM I ALLOWED TO FUCKING SIT DOWN?” at us when we walked between her and the train station seat she’d decided to sit on. I would have apologised under normal circumstances, but she was so rude and loud I blurted out “you just did” and moved on.

  • A week later, another woman on a ferry shouted “no no No NO!” at us as we were about to sit down, as if something terrible was about to happen. I’m sensing a theme here. Turns out, she just wanted our seats, and abruptly pushed us off it. I made a note of raising my eyebrows at her when she disembarked.

These people were inconsiderate, graceless, selfish, the adjectives continue.

Regardless of whether you subscribe to Sam Harris’s thesis that free will is an illusion, we’re all the product of our circumstances. Everything that has happened to us, from experiences all the way to our body chemistry, informs the person we are now. More than that, it is who we are now.

I don’t know what happened to those people. Maybe the first at the station had just lost her child, and she was distraught. Maybe the second had just got a clean bill of health from her oncologist, and she wanted a ferry ride with her husband to celebrate. They could have had hard, miserable lives, and the sight of seeing a guy cut them off or deprive them of something was either deserving of scorn, or just another thing that went wrong for them.

If that’s the case, what reason do I have to judge them?

I can think of only two reasons:

  • Our social compact is we tolerate each other in public. Kindness is a plus, but it’s not demanded. When people act like the above, they’re violating this.

  • If I’m expending all this energy trying to empathise with how people got to where they are, why don’t they ever reciprocate? As examples, what if that woman screaming at us thought one of us may have extreme anxiety, and screams could cause a panic attack? What if Clara had just had a clean bill of health from her oncologist?

I’m not sure how to reconcile these conflicting thoughts. So in the meantime, I’m just going to try harder to not attribute motives or history myself.


HP battery recall

HP have announced they’re doing a battery recall:

In January 2018 [..] HP announced a worldwide voluntary safety recall and replacement program [..] These batteries have the potential to overheat, posing a fire and burn hazard to customers.

The affected models are:

HP Probook 64x (G2 and G3), HP ProBook 65x (G2 and G3), HP x360 310 G2, HP ENVY m6, HP Pavilion x360, HP 11 notebook computers and HP ZBook (17 G3, 17 G4, and Studio G3) mobile workstations sold worldwide from December 2015 through December 2017. They were also sold as accessories or provided as replacements through HP or an authorized HP Service Provider.

I’m still amazed this doesn’t happen more frequently, given how much lithium is in circulation now in all our laptops and phones. To function in the modern economy, you need to have a dangerous element in your bag and pocket.


The daily bird, via @sjdorst

Steven Dorst, writer of the eponymously URL’d blog and @sjdorst on The Twitters – whom you should be following – send this to me last week:

Given your love of birds (from blog post) check out https://freethoughtblogs.com/affinity/author/caine/ …. Nice bird pictures daily - and other stuff!

Thank you! There are some great photos here; this recent one of a Lady Bullfinch by Giliell is among my favourites. The image is copyrighted, so including a lower resolution image for the purposes of review, please go to the source to see the full version.

Photo of a Lady Bullfinch by Giliell

The FtB network is a beautiful, and increasingly necessary bastion of rationality online. I’d subscribed to their master feed in my old blog aggregator, but for some reason it didn’t survive the move to my self hosted TinyTinyRSS install. Resubscribed.


Fate/Grand Order yukata figs

One unintended side effect of ridding myself of things is I’m now wary of procuring more. Everything I buy now has to be deliberate, considered, and necessary; lest it become something else taking up precious mental and physical space that needs to be carted around, sold, or disposed of at some point.

Damn it, Type-Moon! Mashu’s yukata even has the Chaldea logo on it!

Fate/Grand Order is the first, and so far only, mobile game I’ve ever been able to get into. And it may be an obsession. For reference, the characters above are Mashu, Nero Claudius, and Jeanne d’Arc, linked to the wonderfully useful Grand Order fan wiki.


12TB drives are now a thing

Photo of the Seagate 12TB drives now on the market

It seems like only yesterday we were learning of Seagate’s shingled solution to get to 8TB. Watch their YouTube video explaining how it works, it’s fascinating. Then conventional 8TB and 10TB drives came around. Now doing some window shopping I found out you can get 12TB drives.

In case you didn’t read that, I said you can now get 12 friggen terabytes. Okay I didn’t say that specifically, but my shock and awe stands. Or drives, in this case. Glaven.

My big use case at home is consolidation; over the last few years I’ve been trying to pare back everything, not least my HP Microserver NAS farm. Multiple machines are noisy, hot, suck extra juice, take more time to maintain, and need networking; though nothing IB can’t handle.

I’ve already consolidated a 4x 3TB ZFS RAID-Z for a mirrored pair of 8TB HGSTs, in part thanks to the wonders of the H265 codec and xz. That was a lot of acronyms and abbreviations. I’m still trying to decide whether to fill the remaining two drive slots with more 8TBs, or whether I suck it up and get 10TBs.

Now I’m thinking I’ll need to snag me a pair of 12TB HGSTs once they’re available. So much for my hypothetical modular Mac budget!


Baked Australia

It’s going to be really, really hot in Australia this weekend. This is our little continent on Saturday according to the Bureau of Meteorology:

Map of Australia for Saturday with temperatures above 40 degrees over large parts

And specifically New South Wales on Sunday, where this site and I are currently located:

Map of New South Wales for Sunday with temperatures above 40 degrees over large parts

South Australia and Victoria have issued severe fire warnings.

Please be safe everyone.