Skip to content

Instantly share code, notes, and snippets.

View leto's full-sized avatar
🐉
The Blocks Must Flow

Duke Leto leto

🐉
The Blocks Must Flow
View GitHub Profile
@leto
leto / NaN madness
Created August 28, 2009 10:25
NaN spec in ieee754-2008
8. Infinity, NaNs, and sign bit 8.0
8.1 Infinity arithmetic
Infinity arithmetic shall be construed as the limiting case of real arithmetic with operands of arbitrarily large
magnitude, when such a limit exists. Infinities shall be interpreted in the affine sense, that is, –∞< (every finite number) < +∞.
Operations on infinite operands are usually exact and therefore signal no exceptions. The exceptions that do
pertain to infinities are signaled only when:
∞ is an invalid operand (see 9.2),
∞ is created from finite operands by overflow (see 9.4) or division by zero (see 9.3), remainder(subnormal, ∞) signals underflow,
nextAfter(x, ∞) signals underflow and inexact if the result would be subnormal,
cxgn=# select now()-query_start, current_query from pg_stat_activity where usename = 'web_usr' and current_query not like '<IDLE>%';
?column? | current_query
-----------------+---------------------------------------------------------------------------------------------
00:00:31.513223 | select distinct stock_id FROM public.stockprop
: JOIN public.stock USING (stock_id)
: JOIN public.cvterm ON cvterm.cvterm_id = stockprop.type_id
: JOIN phenome.allele on allele.allele_id = (cast(stockprop.value as numeric ) )
: WHERE cvterm.name = $1 AND locus_id = $2 AND allele.obsolete = $3
00:00:39.178288 | select distinct stock_id FROM public.stockprop
: JOIN public.stock USING (stock_id)
@cotto
cotto / goto_value.m0
Created June 9, 2011 15:59
m0 gotos as values
.version 0
.chunk "hello"
.constants
0 "at start"
1 "at end: goto worked!"
2 "at end: goto failed :("
.metadata
.bytecode
set_imm I0, 0, 0
set_imm S0, 0, 0
@jessevondoom
jessevondoom / gist:1017117
Created June 9, 2011 16:31
Quickly grabs a list of all files from a repo, queues them in an array, then mirrors the repo locally via PHP copy
$repo = json_decode(file_get_contents('https://github.com/api/v2/json/blob/all/cashmusic/DIY/master'));
$files = array_keys((array)$repo->blobs);
foreach ($files as $file) {
$path = pathinfo($file);
if (!is_dir('./source/'.$path['dirname'])) mkdir('./source/'.$path['dirname'],0777,true);
copy('https://raw.github.com/cashmusic/DIY/master/'.$file,'./source/'.$file);
}
@an0maly
an0maly / gist:1081878
Created July 14, 2011 03:14
panda doesn't build with rakudo
bkurle@lapple-too ~/src/panda $ sh bootstrap.sh
--2011-07-13 19:53:33-- http://feather.perl6.nl:3000/list
Resolving feather.perl6.nl... 2a02:2308:10::f:1, 193.200.132.135
Connecting to feather.perl6.nl|2a02:2308:10::f:1|:3000... failed: No route to host.
Connecting to feather.perl6.nl|193.200.132.135|:3000... connected.
HTTP request sent, awaiting response... 302 Found
Location: projects.json [following]
--2011-07-13 19:53:34-- http://feather.perl6.nl:3000/projects.json
Connecting to feather.perl6.nl|193.200.132.135|:3000... connected.
HTTP request sent, awaiting response... 200 OK
@leto
leto / gist:1795079
Created February 11, 2012 01:43
CASH Music High-Level Volunteer Document

A free and open toolbox for artist empowerment.

Licenses and Freedom

Affero GNU Public License (AGPL) with a few bundled dependencies which are MIT/BSD. This is mostly free software, with a sprinking of open source. Enjoy it's freedom-creating powers.

@michaelgwelch
michaelgwelch / link_story2.user.js
Created March 24, 2012 16:13
A greasemonkey script that creates a link from commit to story on pivotal tracker
@cotto
cotto / questions.txt
Created May 2, 2012 22:52
m0 memory questions
per-callframe constants segment layout:
constants segment starts with a list of fixed-width pointers. I/N entries are stored directly. S/P entries are pointers to later in the constants segment
The data segment has a couple options. It can be appended after the constants segment (either on the next page or immediately after), with the constants data being marked read-only. Alternately, it can just be another segment attached to a special register.
If callframes are analogous to subs, the constants and data segment can be analogous to lexical data.
If callframes are analogous to subs, how will recursion work?
* clone a callframe (when? before entering ( -> no state) or after entering (less waste, leftover state))
* need to work out calling conventions
#!/usr/bin/perl
# Usage: upgrade-cpan.pl 5.14.0 | sort -u | cpanm
use strict;
use File::Find::Rule;
use JSON;
my $old = shift;
my @files = File::Find::Rule->file->name('install.json')->in("$ENV{HOME}/perl5/perlbrew/perls/perl-$old/lib/site_perl/$old");
for my $file (@files) {
@davelab6
davelab6 / fontforge-features.txt
Created July 20, 2012 11:28
FontForge Feature List
[IN PROGRESS - J HANNA] Mac Feature: Make transparent PNG icons in menus not crash FontForge
Mac Feature: Apply all fixes in https://github.com/ummels/homebrew/commit/a68fd6b241306d563c3600403e6e7eb56abe0921 to the git master.
HUGE Feature: Make the Python object environment compatible with RoboFab.
Huge feature: add an automatic bug reporting tool that gets source code line number traces from a crash and submits them to a crash mailing list automatically
Big feature: Make key bindings interactive, so when the user clicks and holds on a menu item and the presses a key chord, that key chord is bound to that menu item, and stored in the current theme file