This week I discovered Jan Axelson. She’s a tech writer and her website is here: http://janaxelson.com/.
I have ordered four of her books:
This week I discovered Jan Axelson. She’s a tech writer and her website is here: http://janaxelson.com/.
I have ordered four of her books:
I’m reading Pro Git and I learned that GitHub maintains a list of .gitignore templates. Those might come in handy.
I have been chatting on IRC about how I’m learning git so I can use submodules and my friend @indigo wants to know my use case, so this post makes some effort to explain that with reference to one specific example.
I have a web framework/toolkit I am experimenting with called Mudball which is here: https://github.com/jj5/mudball
I use Mudball in (some of) my web projects, for example: https://github.com/jj5/www.jjlab.net
In the main project (in this case www.jjlab.net) I have a copy of Mudball in the ext/mudball directory. At the moment ext/mudball is setup as a git submodule.
I open the main project in my IDE (or text editor) and I want to be able to work on both the main application and the web framework/toolkit at the same time. Then when I’m done with some changes I want to run my `gui` script (it stands for “git update interactive”, not “graphical user interface”) which will increment my version numbers in inc/version.php and ext/mudball/inc/version.php and then add/commit/push any changes in both the main project and the web framework/toolkit.
The code for the `gui` command is here: kickass-libexec/bin/lx-gui.sh, it mostly just defers to lx_vcs_sync() which is here: kickass-libexec/src/2-module/vcs/vcs.sh.
The code which updates the version numbers is here: kickass-libexec/bin/lx-version-increment-patch.sh, it mostly just defers to other modules which are here: kickass-libexec/bin/libexec/version-increment-patch.php and here: kickass-libexec/bin/libexec/inc/version.php.
I have been using a similar setup for a long time with Subversion which uses the svn:externals facility (in place of git submodules) and I have a few scripts which help me manage that. My main tooling for this is known as svnman which is a bunch of scripts I wrote myself: Svnman.
Instead of passing positional arguments to constructors (or functions), instead pass a list of value objects. The type of the value object will tell you the type of the value, so you don’t need to worry about the position. This is a super powerful means of supporting back-compat within your code base so you can move ahead at speed. Having value objects instead of simple types (bools, ints, floats, strings, etc) might have performance implications, but it also can be quite handy. So far so good for my use cases.
This post is part of my video blog and you can find more information about this video over here.
You can support this channel on Patreon: patreon.com/JohnElliotV
This is the inaugural Mini Project! I introduced the Mini Projects recently. They are developed and published by Silicon Chip magazine, and sponsored by Jaycar Electronics (which is an Austrlaian electronics store, similar to Radio Shack in the USA, hopefully it doesn’t end up suffering the same fate.)
In this project, codenamed JMP001, we develop a USB keyboard which can send interesting and unusual symbols (which aren’t usually available on a keyboard) to a Windows computer using the alt-codes that it supports in a typical codepage.
For this first Mini Project I felt it was important to actually buy my components from Jaycar which I did for roughly eighty Australian dollary doos. Approximately US$50. The parts I ordered were these:
Belatedly I did also search for rubber feet.
There was quite a lot that went into the production of this video, and we accumulated a lot of links. Those are here:
In the end this first project was relatively successful, and we did get it to work fairly well on one of my Windows computers. As for the rest you can find out for youself in the video!
Thanks very much for watching! And please remember to hit like and subscribe! :)
Following is a product I use picked at random from my collection which may appear in my videos. Clicking through on this to find and click on the green affiliate links before purchasing from eBay or AliExpress is a great way to support the channel at no cost to you. Thanks!
Yum Cha HSC8 6-4A Ferrule Crimper Kit notes |
Let’s go shopping!
This is a note for Future John about how to report a recent coredump (with debugging symbols) on Debian:
DEBUGINFOD_URLS="https://debuginfod.debian.net" coredumpctl gdb
Then bt is a magical gdb command to run to give you the call stack of the thread which… failed?
I was having a problem in WordPress for my blog where the title contained duplicate values, like “John’s blogJohn’s blog”.
The fix for me was to edit wp-content/themes/twentyeleven/header.php and disable a bit of the output, as shown below. I basically just added an if ( false ) to disable the code which caused the duplicate content.
This seems to effectively mean that Yoast SEO is in charge of the titles now. You can configure separately the homepage, posts, and pages titles in the Yoast SEO settings. I configure mine in Yoast SEO Settings / Content Types like this:
<title>
<?php
// Print the <title> tag based on what is being viewed.
global $page, $paged;
wp_title( '|', true, 'right' );
// 2024-07-14 jj5 - OLD: I removed this because wp_title() (above) does everything that needs to be done.
if ( false ) {
// Add the site name.
bloginfo( 'name' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) ) {
echo " | $site_description";
}
// Add a page number if necessary:
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
/* translators: %s: Page number. */
echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) ) );
}
}
?>
</title>
I added RSS capabilities for InTheLabWithJayJay.com. You can subscribe to the whole thing, or just one channel, or just one show, or just one feature… it was difficulty to create the UI to support that without overcomplicating things. I made the link on the RSS icon support different feed depending on which page you are on.
I just spent two whole days refactoring and improving my jjlab.net website.
One thing I had to think very carefully about for my modeling was the class/instance distinction for various things, you can see my notes below.
So channels have shows, and shows have features.
A series has segments, and segments have a video.
A series is an instance of a show, and a segment is an instance of a feature.
Everything is easy when you know how!
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:
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.