This file contains hidden or 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 python3 | |
# -*- python -*- | |
# | |
# SYNOPSIS | |
# | |
# equiv -- checks if integral c expressions are equivalent | |
# | |
# EXAMPLES | |
# | |
# $ equiv '(gn1 & 1) || (gn1 != gn2)' '(gn1 & 1) | (gn1 ^ gn2)' |
This file contains hidden or 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
#!/bin/sh | |
# replacement for c++ command | |
# | |
# we assume you run the following beforehand | |
# | |
# sudo chmod 1777 /opt | |
# cd /opt | |
# git clone https://github.com/jart/cosmopolitan cosmo | |
# cd cosmo | |
# make -j |
This file contains hidden or 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
;;; text2math.el --- keyboard shortcuts for converting to math charsets | |
;; Copyright (C) 2022 Justine Alexandra Roberts Tunney | |
;; License: ISC | |
;; Author: Justine Tunney <[email protected]> | |
;; Version: 0.1 | |
;; URL: http://github.com/jart/justinemacs | |
;; | |
;; Permission to use, copy, modify, and/or distribute this software for | |
;; any purpose with or without fee is hereby granted, provided that the |
This file contains hidden or 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
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ | |
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ | |
╞══════════════════════════════════════════════════════════════════════════════╡ | |
│ Copyright 2022 Justine Alexandra Roberts Tunney │ | |
│ │ | |
│ Permission to use, copy, modify, and/or distribute this software for │ | |
│ any purpose with or without fee is hereby granted, provided that the │ | |
│ above copyright notice and this permission notice appear in all copies. │ | |
│ │ | |
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ |
This file contains hidden or 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
re = require "re" | |
sqlite3 = require "lsqlite3" | |
reNumberPath = re.compile[[^/([0-9][0-9]*)$]] | |
function SetupSql() | |
if not db then | |
db = sqlite3.open('redbean.sqlite3') | |
db:busy_timeout(1000) | |
db:exec[[PRAGMA journal_mode=WAL]] |
This file contains hidden or 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
/* | |
redbean: kernel requirements | |
x86-64 linux system five abi | |
rax name rdi rsi rdx r10 r8 r9 | |
----- -------------- ------------------------ --------------------------- ------------------------------ -------------------------- ------------------------ --------------- | |
0x000 read unsigned int fd char *buf size_t count - - - | |
0x003 close unsigned int fd - - - - - | |
0x005 fstat unsigned int fd struct stat - - - - | |
0x007 poll struct pollfd *ufds unsigned int nfds int timeout - |
This file contains hidden or 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
/** | |
* Example of how AVX512's FPGA-like VPTERNLOG instruction could | |
* be used to implement the other instructions in the x86 isa. | |
* Here we implement MMX PADDB. Due to the way we need to reshape | |
* the data, VPTERNLOG is probably most useful for huge datasets. | |
*/ | |
uint64_t vpternlog(uint64_t a, uint64_t b, uint64_t c, uint64_t t) { | |
int i; | |
uint64_t r; |
This file contains hidden or 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
/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ | |
│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ | |
╞══════════════════════════════════════════════════════════════════════════════╡ | |
│ Copyright 2020 Justine Alexandra Roberts Tunney │ | |
│ │ | |
│ Permission to use, copy, modify, and/or distribute this software for │ | |
│ any purpose with or without fee is hereby granted, provided that the │ | |
│ above copyright notice and this permission notice appear in all copies. │ | |
│ │ | |
│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ |
This file contains hidden or 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
RMS NOTATION TUTORIAL | |
BEHAVIOR | |
=: write-only | |
+: read/writeable | |
&: earlyclobber (impacts register sharing, defensive copying, etc.) | |
%: commutative | |
,: groups alternative constraints | |
?: discourages group of constraints |
This file contains hidden or 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
#!/bin/sh | |
fricas -nosman <<EOF | |
E := [_ | |
-- Standard Illumination Model for Computers_ | |
--_ | |
-- Is defined as a system of linear equations, where negative_ | |
-- colors don't exist and is solved by computing the point at_ | |
-- which they all intersect the one which needs to be defined_ | |
-- as the Planckian locus of the illuminant._ |