Toit: Infinite resilient application loops (try “catch”)

Toit is a modern high-level language designed specifically for microcontrollers. I’m spending some time at work making use of it these days, and as it’s a younger language, there are not as many resources out there in comparison to others.

In Toit, you could write a very simple hello world application with the following code…

main:
    print "Hello world"Code language: PHP (php)

Say you wanted to get a new name from an external package to say hello to, you might do the following, which would call the method names.next, which can return a string, and print it to the user.

import somePackage show names

main:
    print "Hello world $names.next"Code language: JavaScript (javascript)

To do this in a loop every second, your code might look something like this…

import somePackage show names

main:
    while true:
        print "Hello world $names.next"
        sleep --ms=500Code language: JavaScript (javascript)

If you wanted two separate tasks running with their own control flows, you might make use of tasks, and a second loop.

Read more

Visualizing Wikibase connections, using wikibase.world queries

This entry is part 1 of 3 in the series Wikibase ecosystem

Over the past week I have spent some time writing some code to start running a little bot on the wikibase.world project, aimed at expanding the number of Wikibases that are collected there, and automating collection of some of the data that can easily be automated.

Over the past week, the bot has imported 650 Wikibase installs that increases the total to 784, and active to 755.

I mainly wanted to do this to try and visualize “federation” or rather, links between Wikibases that are currently occurring, hence creating P55 (links to Wikibase) and P56 (linked from Wikibase).

251 Wikibases seem to link to each other, and Wikidata is very clearly at the centre of that web.

Read more

READ FIRST: Installing kubuntu-desktop on WSL2

This post is meant as a warning, DONT DO IT, without some research first.

But if you end up here, you have likely already made the mistake ;)

It in this case is, “this” is…

sudo apt install kubuntu-desktop

Before you attempt this, do some reasearch, head the warning, and be casefull (maybe even backup your disk so you can undo the mess if you make it ;).

If you have already done this and partially bricked your Ubuntu installation, don’t worry, you can fix it!

Symptoms

  • apt, dpkg, service commands and more basically unresponsive and hanging
  • Extremely slow boot times
  • System never seems to entirely boot correctly
  • sudo su etc might also not work

Read more