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
AVERTISSEMENT. | |
Ce petit traité est extrait d’un ouvrage plus étendu, entrepris autrefois sans avoir consulté mes forces, & abandonné depuis long-tems. Des divers morceaux qu’on pouvoit tirer de ce qui étoit fait, celui-ci est le plus considérable, & m’a paru le moins indigne d’être offert au public. Le reste n’est déja plus. | |
DU | |
CONTRACT SOCIAL ; | |
OU, |
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
// Download files from a codeBoot VM from a browser console | |
// https://stackoverflow.com/a/18197341 | |
function download(filename, text) { | |
var element = document.createElement('a'); | |
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
element.setAttribute('download', filename); | |
element.style.display = 'none'; | |
document.body.appendChild(element); |
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
BEGIN { | |
FIELDWIDTHS="6 5 5 4 2 4 4 8 8 8 6 6" | |
} | |
{ | |
if ($1 == "ATOM ") | |
{ | |
if (($4 == " A") || ($4 == " G") || ($4 == " C") || ($4 == " U")) | |
{ | |
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
(import :std/misc/string) | |
(def IANA-registered-schemes | |
["aaa://" | |
"aaas://" | |
"about://" | |
"acap://" | |
"acct://" | |
"acr://" | |
"adiumxtra://" |
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
(import (for-syntax :std/stxutil)) | |
(defsyntax (describe stx) | |
(syntax-case stx () | |
((macro thing) | |
(with-syntax ((thing-doc (format-id #'macro "%%doc%%~a" #'thing))) | |
#'(displayln thing-doc))))) | |
(defsyntax (doc stx) |
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
import ast | |
t = ast.parse(""" | |
def my_func(n): | |
return n | |
x = 0 | |
x += 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
import os | |
from ast import parse, Assign, Name, Num, Str, \ | |
FunctionDef, arguments, arg, Return, Tuple, \ | |
If, Compare, NameConstant, BoolOp, And, Or, \ | |
Gt, GtE, Lt, LtE, Eq, NotEq, BinOp, Call, \ | |
Add, Sub, Expr | |
def py2scm(source): | |
parse_tree = parse(source) |
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
;; cb.ss | |
(defstruct ugly-struct (a b c)) | |
(defstruct wonderful-struct (a b c)) | |
(defmethod {:wr wonderful-struct} | |
(lambda (self we obj) | |
(with ((wonderful-struct a b c) self) | |
(##wr-str we "🦄<") | |
(##wr-str we " 🌈🌈🌈 ") | |
(##wr-str we (string-append |
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 "~~lib/_asm#.scm") | |
(include "~~lib/_x86#.scm") | |
(include "~~lib/_codegen#.scm") | |
;; Convert a u8vector containing machine code into a | |
;; Scheme procedure taking 0 to 3 arguments. Calling | |
;; the Scheme procedure will execute the machine code | |
;; using the C calling convention. | |
(define (u8vector->procedure code) |
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
;; https://gitter.im/gambit/gambit/archives/2017/10/14 | |
;; Marc Feeley @feeley Oct 14 2017 02:15 UTC | |
;; @ober A bit of a hack... | |
(define (peek addr) | |
(##u8vector-ref 0 (- (+ addr 1) 8))) | |
(define (copy-mem addr len) | |
(let ((v (make-u8vector len))) | |
(let loop ((i 0)) | |
(if (< i len) |
NewerOlder