Skip to content

Instantly share code, notes, and snippets.

@yqthu
yqthu / slideslive-dl.sh
Created November 14, 2020 01:18
Download video from slideslive with youtube-dl
#! /bin/bash
# Usage example: ./slideslive-dl.sh https://slideslive.com/38939181/daga-data-augmentation-with-a-generation-approach-for-lowresource-tagging-tasks
[[ -z $1 ]] || ./youtube-dl https://01.cdn.yoda.slideslive.com/$(curl https://ben.slideslive.com/player/$(echo $1 | cut -d/ -f4) | jq -r .video_service_id)/master.mpd -o $(echo $1 | cut -d/ -f5)
@yqthu
yqthu / peterson.smv
Created October 24, 2020 13:30
Peterson's algorithm is not starvation-free?
MODULE Process (other_flag, turn)
VAR
pc : {idle, request, critical, release};
flag : boolean;
ASSIGN
init (pc) := idle;
next (pc) :=
case
pc = idle : {idle, request};
pc = request & other_flag & turn : request;