- message.scm -- guile implementation
- message.c -- c implementation
Run test.sh to run both implementations.
If "Aborted..." shows up means there has been inconsistent results.
$outpath = (Join-Path "$env:USERPROFILE" "Downloads" "yt-dlp.exe") | |
try { | |
Invoke-WebRequest "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" -OutFile "$outpath" | |
echo "update success: $outpath" | |
} catch { | |
echo "update fail: $outpath" | |
} |
#include <signal.h> | |
#include <time.h> | |
#include <stdio.h> | |
#include <signal.h> | |
void sh(int sig) | |
{ | |
for (double f = 0; f < 10; f += 0.5) { | |
printf(" f = %g\n", f); | |
usleep(100000); |
#!/bin/bash | |
f=my-vault.kdbx | |
a=~/Sync | |
b=~/Dropbox | |
rsync -uc $a/$f $b/$f | |
rsync -uc $b/$f $a/$f |
#include <ncurses.h> | |
#include <panel.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#include <locale.h> | |
#define WIDTH 80 | |
#define HEIGHT 20 | |
#define MAXTAB 10 |
(import (ice-9 regex) | |
(ice-9 rdelim)) | |
(define (grep ps . fns) | |
(define re (make-regexp ps)) | |
(define (grep-int p r) | |
(let ((l (read-line p))) | |
(if (not (eof-object? l)) | |
(begin | |
(if (regexp-match? (regexp-exec r l)) |
(use-modules (srfi srfi-1) | |
(ice-9 threads) | |
(ice-9 futures)) | |
(define (matrix-transpose a) | |
;; ((a1 a2 ... ax) ((a1 b1 c1) | |
;; (b1 b2 ... bx) => (a2 b2 c2) | |
;; (c1 c2 ... cx)) (a3 b3 c3)) | |
(let A ((a' a) (b '())) | |
(if (fold (lambda (a b) (if b b (null? a))) #f a') |
(use-modules (ice-9 threads)) | |
(define mtx (make-mutex)) | |
(define cv (make-condition-variable)) | |
(define v 0) | |
(lock-mutex mtx) ;; Lock first to declare master thread | |
(define t | |
(call-with-new-thread |
#include <stdio.h> | |
void clean_eof_array(int eof_i, FILE **farr, int size) { | |
fclose(farr[eof_i]); | |
farr[eof_i] = NULL; | |
for (int i = eof_i + 1; i < size && farr[i] != NULL; i++) { | |
farr[i - 1] = farr[i]; | |
farr[i] = NULL; | |
} | |
} |
all: readword | |
readword: readword.o | |
ld -o $@ $^ | |
readword.o: readword.asm | |
nasm -felf64 -o $@ $^ |