Homework

This is a part of the homework feature of my blog, which is an ongoing conversation with my mate S.F.

Hey mate. Lovely to see you again, as always.

I ended up getting these cards printed at clickmedia.com.au to take with me on Wednesday to ElectroneX:

John's business card for In The Lab With Jay

I mentioned Iain McGilchrist, he’s a psychiatrist who dabbles in philosophy. I think he has a really excellent and interesting view of things. It’s hard to summarise his position but he is very interested in the difference in perceptive capabilities of the left and right hemispheres of the brain. He has a YouTube channel over here: @DrIainMcGilchrist and if you search for him you will find many a fascinating interview.

You told me to check out Succession (TV series).

I found the Four Corners video you mentioned, over here: Self-defence or genocide? Asking Israel’s powerful voices about Gaza | Four Corners.

I mentioned Eben Moglen, who has a website over here: moglen.law.columbia.edu. I find Eben inspirational. He’s always talking in grandiose eloquence about the importance of free software, if you search for him on YouTube you are bound to find something of interest.

I mentioned Annie Jacobsen, she’s a pretty interesting cat. She has written a number of books on conspiracy-theory-like topics. I recently read her book Nuclear War: A Scenario.

I have a note here that says “positive view on nihilism” but I forget what that was about. Something I wanted to tell you, now lost to time. But searching for ‘positive view on nihilism’ turns up a bunch of interesting results! (Oh. Wait. Found it! It’s a video I wanted you to see: Optimistic Nihilism.)

Oh, another note I don’t remember: “void of ‘huh'”. I assume we were being hilarious.

There is an urban myth that the first human projectile that made it into space was a manhole cover from nuclear testing facilities for Operation Plumbbob in 1957. I dunno if it’s true, but it’s a good story!

Channel News: Announcing Mini Projects | In The Lab With Jay Jay

This post is part of my video blog: In The Lab With Jay Jay.

You can support this channel on Patreon: https://www.patreon.com/JohnElliotV

In this video I announce the new Mini Projects. These are a new feature of Silicon Chip magazine sponsored by Jaycar. Each month two or three Mini Projects get published in Silicon Chip, and we will be building those projects together on the channel each month!

If you’re interested in Silicon Chip magazine (it’s really good!) then I would certainly encourage you to subscribe.

In this video I misspoke and said this was the “May 2004” issue of the magazine, but of course it is the “May 2024” issue of the magazine! Unfortunately I missed that errata during editing and didn’t include a title clip correction.

I don’t understand what happened that caused that video corruption we saw earlier in the video. I suspect the workstation I was using to record the video had some other processing task which interfered with its recording speed or something? Hopefully this is not an ongoing problem. It’s not a problem I have seen before.

Update: ElectroneX has now been and gone and my write up about the day is over here: My day at ElectroneX with my friend. I got my photo with Dave Jones!

Fixing compile_commands.json for VS Code and Linux kernel sources

I have my Linux kernel sources setup like this:

-------------------
Fri Jun 14 00:35:24 [bash:5.2.15 jobs:0 error:0 time:2449]
jj5@virtuoso:/home/jj5/repo/git/git.kernel.org/torvalds-linux
$ git remote show origin
* remote origin
  Fetch URL: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  Push  URL: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (local out of date)
-------------------

The scripts/clang-tools/gen_compile_commands.py runs just fine:

-------------------
Fri Jun 14 00:35:28 [bash:5.2.15 jobs:0 error:0 time:2453]
jj5@virtuoso:/home/jj5/repo/git/git.kernel.org/torvalds-linux
$ scripts/clang-tools/gen_compile_commands.py 
-------------------

But there is a problem with some unknown clang options, as you can see here:

Problems with clang commands in VS Code

So I wrote this collection of sed scripts to delete the problematic options:

-------------------
Fri Jun 14 00:11:28 [bash:5.2.15 jobs:0 error:0 time:1013]
jj5@virtuoso:/home/jj5/repo/git/git.kernel.org/torvalds-linux
$ cat jj5/fix-commands.sh 
#!/bin/bash

main() {

  set -euo pipefail;

  cd "$( dirname "$0" )";

  cd ..;

  local file="compile_commands.json";

  sed -i 's/-mpreferred-stack-boundary=3//g' "$file"
  sed -i 's/-mfunction-return=thunk-extern//g' "$file"
  sed -i 's/-mindirect-branch=thunk-extern//g' "$file"
  sed -i 's/-mindirect-branch-register//g' "$file"
  sed -i 's/-fno-allow-store-data-races//g' "$file"
  sed -i 's/-fconserve-stack//g' "$file"
  sed -i 's/-mrecord-mcount//g' "$file"

}

main "$@";
-------------------

Bug fixed! Thanks to my mates on IRC for helping me fix this one. This clangd extension for VS Code seems to work really well.

p.s. another possible solution is here.