Skip to content

Instantly share code, notes, and snippets.

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define RESULT_PASS "PASS"
#define RESULT_FAIL "FAIL"
@novns
novns / spg.mod
Last active January 8, 2020 03:49
The early spirograph program in Modula-2 from 1987
MODULE Spg;
FROM IO IMPORT WrStr, WrLn, RdCard, RdInt, RdKey;
FROM MATHLIB IMPORT Cos, Sin;
FROM Graph IMPORT SetVideoMode, Line;
FROM Lib IMPORT Sound, NoSound, Delay;
CONST pi= 3.14159265358979;
-O2
Module Error RunTime MFLOPS
(usec)
1 4.0146e-13 0.0035 3963.5648
2 -1.4166e-13 0.0028 2521.1473
3 4.7184e-14 0.0033 5210.9214
4 -1.2557e-13 0.0031 4877.5376
5 -1.3800e-13 0.0060 4813.8351
6 3.2380e-13 0.0058 5013.7635
@novns
novns / log.c
Created March 24, 2019 19:13
Simple logging functions
#include <errno.h>
#include <stdarg.h>
#include <time.h>
#include "log.h"
#define DATETIME_BUF_SIZE 20
@novns
novns / test_accel.vala
Created January 20, 2019 23:26
Accelerator test
public class MyWindow: Gtk.Window {
public MyWindow() {
this.set_default_size(500, 500);
var main_box = new Gtk.VBox(false, 0);
this.add(main_box);
// Menubar
var menubar = new Gtk.MenuBar();
main_box.pack_start(menubar, false, false, 0);