The blog of a juvenile Geekus biologicus

How to load the PathwayCommons OWL file into a local QLever instance?


What are we talking about?

QLever (pronounced “clever”) is a graph database for RDF triplets supporting the SPARQL query language.

PathwayCommons is an initiative to gather multiple sources of metabolic pathways, from multiple databases, and merge them in a single entrypoint, using the standard BioPAX ontology. Pathway-Commons provides a compressed OWL file for each release, as well as an API.

What do we want to do?

The objective of this tutorial is to show how one can load the Pathway-Commons OWL file in a local QLever instance, for unlimited local SPARQL queries.

Read more ⟶

How to interface TidalCycle with LMMS via MIDI ?


TidalCycle is a livecoding environment enabling live performance of code-generated music. LMMS is a digital audio workstation software. Both are free-libre opensource softwares. TidalCycle typically use SuperCollider to generate audio based on the patterns of Tidal. We can also use any device that can handle MIDI input to generate sound from Tidal patterns.

Procedure

On SuperCollider window, open startup file (File > Open startup file), then add the following code:

MIDIClient.init;

In the section where SuperDirt server starts, add the following before the ~dirt.start command:

Read more ⟶

Tent Game in Answer Set Programming


The Tent game is a logic puzzle on a square or rectangular grid. Each grid cell can have a tree, a tent or stay empty. <Nourry (2024)>

The following rules must be respected:

  • Tent can be placed on empty cells.
  • Each tent is attached to a tree placed on an adjacent cell.
  • A tree cannot be attached to more than one tent.
  • Two tents cannot be placed on adjacent, nor diagonal cells.
  • The number of tents on each row and column is specified.
  • Some cells are not accessible, no tent can be pitched there. <“Fiche: Jeux de Réflexion - Tentes” (n.d.);Nourry (2024)>

The aim of this article is to propose a implementation of the Tent game in Answer Set Programming.

Read more ⟶

How to render pseudocode in Hugo with pseudocode.js


To render pseudocode in Hugo, you can use the pseudocode.js library.

Here is what I did to make this working on my blog.

Theme configuration

In your theme files, you will first need to add link to the library CDN.

<!-- in themes/<theme>/layouts/partials/pseucodode.html -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.js"
        integrity="sha512-EKW5YvKU3hpyyOcN6jQnAxO/L8gts+YdYV6Yymtl8pk9YlYFtqJgihORuRoBXK8/cOIlappdU6Ms8KdK6yBCgA=="
        crossorigin="anonymous" referrerpolicy="no-referrer">
</script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.css">
<script src="https://cdn.jsdelivr.net/npm/pseudocode@latest/build/pseudocode.min.js"></script>

And render all element with pseudocode HTMl class.

<!-- in themes/<theme>layouts/partials/pseudocode-render.html -->
<script>
    let pseudocodeElements = document.getElementsByClassName("pseudocode");
    for (let element of pseudocodeElements) {
        pseudocode.renderElement(element);
    }
</script>
<!-- in themes/<theme>/layouts/_default/baseof.html -->
<head>

    ...

    {{ if .Param "pseudocode" }}
      {{ partialCached "pseudocode" . }}
    {{ end }}
</head>

<body>
    
    ...

    <main>
        {{ block "main" . }}{{ end }}
        {{ if .Param "pseudocode" }}
            {{ partialCached "pseudocode-render" . }}
        {{ end }}
    <main>
</body>

Writing

Then, in your Markdown article, add the following in your frontmatter:

Read more ⟶

Unixfu


A bean for some useful UNIX command snippets.

Add two hours

This could be useful for nocmig fan, to ease the hour computation of a bird contact.

hour() {
    start=$1
    duration=$2
    IFS=":" read -r duration_hour duration_minute <<< $duration
    date -d "$start $(($duration_hour * 60 + $duration_minute)) minutes" +"%H:%M"
}
hour 17:00 5:43
22:43

WAV creation datetime

Here is a small snippet that demonstrates how to get the creation date-time of a WAV file with ffprobe

Read more ⟶