Petri nets - Chapter 2: Why?
2024-02-11

A simple tutorial on Petri nets, chapter 2: Why?

Read more
Petri nets - Chapter 1: What?
2022-12-02

A simple tutorial on Petri nets, chapter 1: What?

Read more
À propos d'un passage au contrôle continu intégral
2021-07-22

Ce billet présente pourquoi et comment, en 2020-2021, je suis passé au contrôle continu intégral pour mon cours de programmation en C, en première année de Licence informatique.

Read more
Pelican articles out of BibTeX files
2021-05-10 (edited 2024-04-06)

This post is outdated because I’m not using BibTeX files anymore for my website. But it’s content remains valid.

I’ve moved to Pelican to generate my website. My home-brewed generator needed some updates in order to work with Python 3 and new versions of some packages, so …

Read more
Simple 2-factors authentication for your SSH/GPG keys
2020-10-07

SSH and GPG/PGP private keys are stored encrypted with a passphrase. Using a Yubikey or similar devices, it is easy to have a 2-factors encryption.

The Yubikey can be configured to store a static password: it behaves as a keyboard that types the same password each time it is …

Read more
Assess C exams automatically
2020-07-04

This is the third post of a series of three. I’ve showed how I randomise AMC exams, how I randomise C code to ask questions about it, and now I present how I automatically assess students programs.

DISCLAMER: don’t expect a magic solution to this long standing problem …

Read more
Randomized C assessments with AMC
2020-06-29

In a previous post I’ve explained how I randomise an AMC exam by generating LaTeX source to be included by AMC during the compilation. Here, I show how I reuse this idea to assess students understanding of a randomised C program.

With respect to the previous post, there are …

Read more
Randomized assessments with AMC & Python
2020-06-26

I’ve been using AMC for years now, it’s definitely a very good tool that saves me hours of work on large groups of students. Exam after exam, I’ve improved the way the questions are randomised, with all randomisation computed in LaTeX directly, using pgf/tikz as explained …

Read more
Using a database to store benchmarks logs
2016-12-10

For my benchmarks, I used to store logs of every executions into CSV files that I had to aggregate for analysis. I’ve decided to switch to a database. It is simpler and globally more efficient.

Discussion

My benchmarks are usually organised as follows:

Read more
Time Petri nets with SNAKES
2016-04-25

In this quite old paper, it was shown how to extend SNAKES to model and execute time Petri nets (Merlin & Farber’s version, that with clocks on transitions). The code originally written in 2008 is broken because of slight changes in SNAKES. This post is both an update and a …

Read more
Model-checking with ABCD and Neco
2016-01-06

ABCD is a modelling language that brings together process algebras and Python programming with a Petri net semantics. A compiler for ABCD is shipped with SNAKES, a description of the language and its semantics can be found in my habilitation thesis (section 3.3). On the other hand, Neco, with …

Read more
SNAKES at PETRI NETS 2015
2015-06-24

A tool paper about SNAKES has been accepted at the PETRI NETS conference 2015, I’ll add it soon to the list of my publications. Additionally, I was pleased to discover that Robert Lorenz was giving an invited talk and that the theory he has presented is implemented using SNAKES …

Read more
Automating write-back to Python shelve
2015-06-01

Module shelve is great but it only save objects when they are explicitly assigned to a shelf. This may be error prone as for instance in:

>>> db = shelve.open("shelf.db")
>>> db["foo"] = []
>>> db["foo"].append("hello")
>>> db["foo"]
[]

Calling append on the object does not lead to modify the …

Read more
Watching filesystem updates with gevent
2015-05-28

Many systems allow to monitor changes on a filesystem, but I could not find any that is both portable and compatible with gevent. For instance, watchdog is portable on Windows, Linux and MacOS, but it uses threads and does not work together with gevent. On the other hand, gevent_inotifyx, as …

Read more
Generating pronounceable passwords in Python
2015-05-07

To generate human-readable and pronounceable passwords, I usually rely on apg or pwgen, but I needed a solution that can be used from a Python program, which should be portable so that I can’t rely on the presence of apg or pwgen on the computer.

First, we need to …

Read more
Another SNAKES repository
2015-03-21

SNAKES is hosted on GitHub. It now has another address, on a GitLab instance freshly installed at IBISC lab: https://forge.ibisc.univ-evry.fr/fpom/snakes.

I’ll maintain both synchronised, so that visitors have the choice of their preferred interface.

On my way to host SNAKES and change from …

Read more
Functional Python to feed your SNAKES
2014-03-05

When you learn programming, you’re usually told that side-effects are not good. This is particularly true for the Petri nets annotations in SNAKES.

Consider this first example:

from snakes.nets import *

class BadRange (object) :
    def __init__ (self, *args) :
        self.v = range(*args)
    def done (self) :
        return not self.v …
Read more
SNAKES poster
2013-12-16

I have prepared a poster to present SNAKES, click on the image below to get a PDF version. Feel free to display it if you use SNAKES and want to support it.

Read more
Parsley really rocks!
2013-12-06

We have seen how to use Parsley to parse BibTeX, but now we need to parse the LaTeX code inside the BibTeX entries and convert it to something else: plain text or, here, Markdown. Here again, Parsley appears to be really handy.

Of course, only LaTeX can actually parse full …

Read more
Parsley rocks!
2013-12-05

Times ago I’ve been impressed by this video about Parsley, demonstrating a very convincing parsing tool.

Yesterday, I needed to parse some BibTeX. After testing several packages without being really convinced, I decided to give Parsley a try.

My need is actually to parse only a restricted version of …

Read more
From string formatting to parsing
2009-05-12

With Python’s string formatting operator, you can do:

>>> format = "I'd like to eat %u %s of spam with %u eggs"
>>> data = (3, "pounds", 10)
>>> text = format % data
>>> text
"I'd like to eat 3 pounds of spam with 10 eggs"

But how to perform the reverse operation: given …

Read more
Copy a Python dict with updates
2009-05-12

For my first post: a small trick I’ve recently discovered.

Suppose you have a dict that you want to copy while changing the values of some keys. A single instruction can do it:

new = dict(old, a=1, b=2, c=3)

This is equivalent to:

new = old.copy …
Read more