Skip to content

Instantly share code, notes, and snippets.

#define __STDC_CONSTANT_MACROS
#include <stdint.h>
#include <inttypes.h>
#include <windows.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C"
{
@Lovesan
Lovesan / fftutorial.cs
Created February 3, 2017 23:32
FFmpeg & SDL2 - play audio & video
#define __STDC_CONSTANT_MACROS
#include <stdint.h>
#include <inttypes.h>
#include <windows.h>
#include <stdio.h>
extern "C"
{
#include <libavfilter/avfilter.h>
(defconstant +byte-count+ (* 2 1024 1024 1024))
(defconstant +page-size+ 4096)
(defconstant +page-count+ (/ +byte-count+ +page-size+))
(defvar *a* (make-array +byte-count+ :element-type '(unsigned-byte 8)))
(dotimes (i +page-count+) (incf (elt *a* (* i +page-size+))))
private def metaExists(id: Id[DocumentMeta]): Rx[Boolean] = {
metaDir.fileExists(id.value) mapToRx {
case Failure(_) => false
case Success(exists) => exists
}
}
private def dataExists(id: Id[DocumentMeta]): Rx[Boolean] = {
dir.fileExists(id.value) mapToRx {
case Failure(_) => false
@Lovesan
Lovesan / pegc.lisp
Created November 2, 2011 10:39
simple parser combinator library
(in-package :cl-user)
(defpackage #:peg-combinators
(:use #:cl)
(:nicknames #:pegc)
(:export
#:defparser
#:defrule
#:result
(in-package #:cl-user)
(defpackage #:rwa-contest
(:use #:cl)
(:export
#:address
#:address-value
#:book
#:parse-ranges
#:parse-ips