This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define (chain arg0 . lambdas) | |
(let loop ((arg arg0) (lambdas lambdas)) | |
(if (empty? lambdas) | |
arg | |
(loop ((car lambdas) arg) (cdr lambdas))))) | |
; example usage | |
(define (add1 n) (+ 1 n)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
#use Date::Manip; | |
use Time::Piece; | |
use POSIX; | |
my %gaaps; | |
my %qtys; | |
my $start_date = "2019-04-06"; | |
my $pracc; # the default account we want to print |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Started 20-Jan-2018 | |
* You probably need the clock running at 8MHz | |
*/ | |
#include <Arduino.h> | |
#if defined(__AVR_ATtiny85__) | |
#define F_CPU 8000000UL | |
constexpr int buzzer = PB1; | |
constexpr int btn = PB4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
constexpr auto spk = A0; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(spk, OUTPUT); | |
} | |
void tn(unsigned long f) { | |
tone(spk, f); | |
delay(300); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!PS-Adobe-3.0 | |
%%Creator: groff version 1.22.3 | |
%%CreationDate: Sun Sep 30 11:28:49 2018 | |
%%DocumentNeededResources: font Times-Roman | |
%%DocumentSuppliedResources: procset grops 1.22 3 | |
%%Pages: 1 | |
%%PageOrder: Ascend | |
%%DocumentMedia: Default 595 842 0 () () | |
%%Orientation: Portrait | |
%%EndComments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;(load "mass.scm") | |
(require-extension anaphora) | |
(require-extension holes) | |
(require-extension s) | |
(require-extension srfi-69) | |
(define program "MOV a 3 | |
ADD a a -1 | |
JNE 1 a 1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://www.linuxquestions.org/questions/programming-9/deleting-a-directory-using-c-in-linux-248696/ | |
// remove directory recursively | |
// include dirent.h sys/types.h | |
int rmdir(const char *dirname) | |
{ | |
DIR *dir; | |
struct dirent *entry; | |
char path[PATH_MAX]; | |
if (path == NULL) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require (planet dyoo/while-loop:1:=1)) ; while / break / continue | |
(require data/queue) | |
(define-syntax-rule (defq var queuer) | |
(begin | |
(define var (make-queue)) | |
(define (queuer lst) (enqueue! var lst)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(define-syntax for-next | |
(syntax-rules () | |
((_ var lo hi body ...) | |
(let loop ((var lo)) | |
body ... | |
(when (< var hi) | |
(loop (+ 1 var))))))) | |
;; Example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{ | |
#include <string> | |
#include <variant> | |
typedef std::variant<std::string, double> value_t; | |
#define YYSTYPE value_t | |
extern YYSTYPE yylval; | |
int yylex(); | |
void yyerror(char const *s); | |
int main(); | |
%} |