View 01-tasks
// this is the embedded DSL
tasks! {
heap h;
task {
loop {
wait for AbsDiff(1, 2);
[3] = h[&1] - h[&2];
if (h[&3] > 0) {
View codl-pep.rst

PEP: 9999 Title: Add Lab to colorsys Author: C Jones <code@calebjones.net>

codl

Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 28-Nov-2017 Python-Version: 3.7 Post-History: 30-Aug-2002

View table.py
from collections import defaultdict
class Table:
def __init__(self):
self.items = []
self.indices = {}
@staticmethod
def _get_key(item, key):
View bytecode
def fib(n):
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a
Then, using dis.dis(fib)
CPython bytecode:
2 0 LOAD_CONST 3 ((0, 1))
View bfmemo.py
import itertools
import time
COUNTS_SUMMING = {0: [[]]}
def counts_summing(n):
if n not in COUNTS_SUMMING:
sums = []
for first in range(1, n+1):
for rest in counts_summing(n - first):
sums.append([first] + rest)
View kanye-anime.csv
User Kanye Anime Comment
SufjanStevens Late Registration good
joaquin 808s bad
pedroteixeira MBDTF good
Tahloolah MBDTF good
ligeti MBDTF N/A Q2) My Beautiful Dark Twisted Fantasy
Ziven001 Yeezus good
CrimeFuck College Dropout good
shaded_fox Late Registration good
Cian 808s good
View philosophers.c
/* Compile as gcc philosophers.c -pthread */
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
pthread_mutex_t fork_ = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t knife = PTHREAD_MUTEX_INITIALIZER;
void *socrates(void *nothing) {
View driverstation.html
<html>
<head>
<meta charset="utf8"/>
<title>Driver Station</title>
</head>
<body>
<img src="http://10.10.76.17:5807/?action=stream" width="480" height="360" class="flip"/>
<img src="http://10.10.76.19:5809/?action=stream" width="480" height="360" class="flip"/>
<style>.flip { transform: rotate(180deg); }</style>
</body>
View mandelbrot.laz
(let! *width* 128)
(let! *height* 128)
(struct cplx
real imag)
(let! real cplx/real)
(let! imag cplx/imag)
(defn (c/+ a b)
View exception.c
#include <iso646.h>
#include <setjmp.h>
#include <stdio.h>
// Exception Macros
int _exn_handler_idx = 0;
jmp_buf _exn_handlers[1024];