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
#include <stdio.h> | |
struct node { | |
int value; | |
struct node *next; | |
}; | |
void uniquify_head(struct node *head) | |
{ | |
struct node *node = head; |
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
R_LIBS=~/programs/rpkg |
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
signature TREE = | |
sig | |
type 'a tree | |
type 'a many | |
datatype 'a split = Pure of 'a | Many of 'a tree many | |
val pure : 'a -> 'a tree | |
val many : 'a tree many -> 'a tree | |
val rev : 'a tree -> 'a tree |
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
<stevie> Hi, I am having trouble with this statistics problem: | |
http://dpaste.com/267R2R4 - Would anyone be able to help push me in | |
the right direction? [18:37] | |
<indomitable> stevie, I'm going to recommend reading two chapters in secondary | |
school statistics [18:38] | |
<indomitable> This is basic stuff | |
<unyu> indomitable: All the more reason for you to help him. Do you want to be | |
asked hard questions? | |
<unyu> stevie: Let's work with one bolt at a time, and only then figure out | |
how to combine the information from all 25 bolts. [18:44] |
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
datatype bin = Leaf | Node of bin * bin | |
datatype rose = T of rose list | |
fun forth Leaf = nil | |
| forth (Node (a, b)) = T (forth a) :: forth b | |
fun back nil = Leaf | |
| back (T a :: b) = Node (back a, back b) |
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
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
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
#define NRDRS 5 | |
#define NWRTS 2 | |
#define MAXRDRS 100 | |
#define MAXRDRQ 20 | |
#define MAXWRRQ 20 | |
chan readrequest = [MAXRDRQ] of { chan } | |
chan writerequest = [MAXWRRQ] of { chan } | |
chan finished = [MAXRDRQ+MAXWRRQ] of { mtype } |
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
#include "semaphore.hdr" | |
#define NR 9 | |
#define NE 3 | |
#define TE 10 | |
Semaphore ss, rs, es1, es2, mut | |
byte rc = NR, ec = NE | |
proctype Reindeer(byte id) { |
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
#define pairs 5 | |
#include "semaphore.h" | |
mtype = { male, female } | |
Semaphore mutex, convo1, convo2 | |
Semaphore queue[3] | |
byte count[3] | |
inline male_dance() { |
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
mtype = { left, right } | |
inline shift(source, target) { | |
/* select who goes */ | |
if | |
:: side[0] == source -> pick = 0 | |
:: side[1] == source -> pick = 1 | |
:: side[2] == source -> pick = 2 | |
:: side[3] == source -> pick = 3 | |
fi |