Skip to content

Instantly share code, notes, and snippets.

View stuartpb's full-sized avatar

Stuart P. Bentley stuartpb

View GitHub Profile

Lost from https://blogs.msdn.microsoft.com/ericgu/2004/01/12/minus-100-points/

When I switched over the C# compiler team, I had hoped that I would be able to give some insight into how the design team works, what decisions we make, etc. Language design is a very esoteric field, and there's not a lot written about it (though “Design and evolution of C++“ is a pretty good read). I had hoped that I would be able to do this with concrete examples, as that makes it much easier.

I've been watching for candidate topics to write about, but haven't yet come up with any good ones. One of the problems is that features have a tendency to morph in design (and in whether they'll make it into Whidbey) as time goes by, and it would be bad for me to say, “we're talking about doing“ and then have us decide it wasn't a good idea. Or, for us to decide that doesn't fit into our schedule, or it would break existing code, or any of the other reasons that might cause us to pull a feature. We're generally not comfortable re

Lost from https://blogs.msdn.microsoft.com/ericgu/2004/01/12/minus-100-points/

When I switched over the C# compiler team, I had hoped that I would be able to give some insight into how the design team works, what decisions we make, etc. Language design is a very esoteric field, and there's not a lot written about it (though “Design and evolution of C++“ is a pretty good read). I had hoped that I would be able to do this with concrete examples, as that makes it much easier.

I've been watching for candidate topics to write about, but haven't yet come up with any good ones. One of the problems is that features have a tendency to morph in design (and in whether they'll make it into Whidbey) as time goes by, and it would be bad for me to say, “we're talking about doing“ and then have us decide it wasn't a good idea. Or, for us to decide that doesn't fit into our schedule, or it would break existing code, or any of the other reasons that might cause us to pull a feature. We're generally not comfortable re

@stuartpb
stuartpb / statement.md
Last active November 16, 2019 03:33
David Holmes opening statement

STATEMENT OF

DAVID A. HOLMES
U.S. EMBASSY KYIV, DEPARTMENT OF STATE

BEFORE THE

/tmp/.mount_Slic3rC132Lw/usr/bin/slic3r.wrapper: line 125: 32119 Aborted (core dumped) LD_LIBRARY_PATH="" zenity --question --title="$TITLE" --text="$TEXT" 2> /dev/null
/tmp/.mount_Slic3rC132Lw/usr/bin/slic3r.wrapper: line 125: 32124 Aborted (core dumped) LD_LIBRARY_PATH="" zenity --question --title="$TITLE" --text="$TEXT" 2> /dev/null
Creating main frame...
(slic3r.pl:32083): Gtk-CRITICAL **: 11:28:34.612: IA__gtk_color_button_set_color: assertion 'color != NULL' failed
** (slic3r.pl:32083): WARNING **: 11:28:34.869: Pixbuf theme: Cannot load pixmap file /usr/share/themes/Adwaita/gtk-2.0/assets/treeview-separator-ltr.png: Couldn’t recognize the image file format for file “/usr/share/themes/Adwaita/gtk-2.0/assets/treeview-separator-ltr.png”
(slic3r.pl:32083): GdkPixbuf-CRITICAL **: 11:28:34.869: gdk_pixbuf_get_width: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

Keybase proof

I hereby claim:

  • I am stuartpb on github.
  • I am stuartpb (https://keybase.io/stuartpb) on keybase.
  • I have a public key whose fingerprint is 03A0 8855 B413 1748 7D1E 6690 FF04 2AE3 ECE2 8BA9

To claim this, I am signing this object:

@stuartpb
stuartpb / comment.md
Created August 17, 2016 17:18
Original version of markusfisch/ShaderEditor#10#issuecomment-240450626

What that means is, while a mediump can contain a value up to 1024 without losing integral precision (the next increment it will be able to represent is 1026), it can only represent fractions of any granularity for much smaller ranges - from 513 to 1024, it'd be wholes, 256 to 512 it'd be halves, 128 to 256 quarters, 64 to 128 eighths, 32 to 16 the largest fractions would be sixteenths. Only values absolutely smaller than 8 are precise to the 1/32, smaller than 4 1/64, smaller than 2 1/128, and only fractions below a whole are precise to 1/256 (2^-8) - fractions of precision 2^-9 or 2^-10 only being under a half and a quarter, respectively (and fractions beyond that having no guarantees of precision per the spec). (Conversely, 1026 to 2048 will jump by twos, 2052 to 4096 by fours, 4104 to 8192 by eights, and 8208 to 16384 by sixteens.)

(FAKE EDIT: I just checked the OP, and what I'm about to describe doesn't quite match its figures, though that could just be because I'm bad at estimating framerates.

@stuartpb
stuartpb / simplifyMLZPath.js
Last active May 5, 2020 21:08
JavaScript to simplify uniform SVG paths
// run on http://mourner.github.io/simplify-js/
var tolerance = 5;
function simplifyMLZPath(path) {
var polys = JSON.parse('[['+path
.replace(/[LM](\d+(?:\.\d+)?),(\d+(?:\.\d+)?)/g,'{"x":$1,"y":$2},')
.replace(/,Z/g,'],[')
.slice(0,-2)+']');
var segments = [];
@stuartpb
stuartpb / mkimgarpi.sh
Created October 2, 2015 23:56
Script to make a new Arch Linux for Raspberry Pi image
#!/bin/bash
# Packages required
# dosfstools parted
# Can be run on any Linux system
echo "creating image to fit on 1Gb card"
dd if=/dev/zero of=arch-rpi.img bs=1M count=925
echo "Partitioning"