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 "tco.h" | |
#include <stdlib.h> | |
#include <stdarg.h> | |
conscell cons_f(void *car, void *cdr) | |
{ | |
conscell ret = malloc(sizeof(struct conscell_str)); | |
ret->car = car; | |
ret->cdr = cdr; |
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
; global registers: | |
; r0 - no man's land | |
; r1 - return address | |
; X (r26,r27) - frame pointer | |
;function frame: | |
;--------------------------- | |
; return address | |
; arg0 | |
; ... |
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
#define THREAD(thread_id, fun, ...) \ | |
__extension__ pthread_create(thread_id, NULL, ({ \ | |
void *func() { \ | |
fun(__VA_ARGS__); \ | |
return NULL; \ | |
} \ | |
func;\ | |
}), 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
[youtube] CWG5oZB593w: Downloading webpage | |
[youtube] CWG5oZB593w: Downloading video info webpage | |
[info] Available formats for CWG5oZB593w: | |
format code extension resolution note | |
249 webm audio only DASH audio 53k , opus @ 50k, 7.95MiB | |
250 webm audio only DASH audio 69k , opus @ 70k, 9.97MiB | |
171 webm audio only DASH audio 125k , vorbis@128k, 17.30MiB | |
140 m4a audio only DASH audio 129k , m4a_dash container, mp4a.40.2@128k, 21.23MiB | |
251 webm audio only DASH audio 132k , opus @160k, 18.76MiB | |
160 mp4 256x144 144p 112k , avc1.4d400c, 25fps, video only, 9.43MiB |
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
--[[ | |
Copyright (C) 2017 AMM | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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 "murmur3.rkt") | |
(require data/bit-vector) | |
(require racket/serialize) | |
(provide make-bloom-filter make-recommended-bloom-filter bloom-filter-recommender bloom-filter-member? bloom-filter-batch-member? bloom-filter-add! false-positive-rate ) | |
(define (murmur-int x seed) (murmur-hash (integer->integer-bytes x 8 false false) seed)) | |
(define (h1 x) (murmur-int x 583)) | |
(define (h2 x) (murmur-int x 2387)) |
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
local mp = require 'mp' | |
local msg = require 'mp.msg' | |
local time_saved = 0 -- TODO keep running system total | |
local last_time = 0 -- FIXME reset this on on_load? | |
local last_speed = 1 -- FIXME not necessarily true, set this for real on on_load | |
local last_tick_time = 0 |
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
-- placed in .config/mpv/user-builtins/ | |
local msg = require 'mp.msg' | |
local function ping() | |
msg.error("PONG") | |
end | |
return { | |
ping = ping, |
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
-- youtube-quality.lua | |
-- | |
-- Change youtube video quality on the fly. | |
-- | |
-- Diplays a menu that lets you switch to different ytdl-format settings while | |
-- you're in the middle of a video (just like you were using the web player). | |
-- | |
-- Bound to ctrl-f by default. | |
local mp = require 'mp' |
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
(query-exec (sqldb-param) | |
(prepared (string* "INSERT OR REPLACE INTO TagCardinalities (a,b,cardinality)" | |
" SELECT min($1,t.tag_id),max($1,t.tag_id),ifnull(sub.cnt,0) " | |
" FROM Tags t LEFT JOIN" | |
"(SELECT tag_id, COUNT(*) as cnt FROM FileTags WHERE file_id IN " | |
"(SELECT file_id FROM FileTags WHERE tag_id=$1)" | |
"GROUP BY tag_id) AS sub" | |
"ON t.tag_id = sub.tag_id")) | |
a-id))) |
OlderNewer