This file contains 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> | |
#define I(n) for(int i=0; i<n; i++) | |
#define J(n) for(int j=0; j<n; j++) | |
#define O(str) printf(str) | |
#define Oc(c) putc(c, stdout) | |
#define M(x,y,c) m[y][x]=c; | |
int main() { | |
char c; char m[22][10]; |
This file contains 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
{ | |
parserClass="com.x1010data.intellik.parser.KParser" | |
extends="com.intellij.extapi.psi.ASTWrapperPsiElement" | |
psiClassPrefix="K" | |
psiImplClassSuffix="Impl" | |
psiPackage="com.x1010data.intellik.psi" | |
psiImplPackage="com.x1010data.intellik.psi.impl" | |
elementTypeHolderClass="com.x1010data.intellik.psi.KTypes" |
This file contains 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 <SoftwareSerial.h> | |
#include <LedControl.h> | |
#include <Key.h> | |
#include <Keypad.h> | |
const byte rows = 4; | |
const byte cols = 4; |
This file contains 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
/ grammar combinators in K | |
/ for longer description (in python), see: | |
/ http://tangentstorm.github.io/draft/wejalboot.py.html | |
/ -- misc helper functions ------------------------------------ | |
join:{[sep;strs] / join strs with 'sep' as delimiter | |
(#sep) _ ,/ sep,' strs} |
This file contains 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
""" | |
>>> ebnf_sc.scan('x = A | b') | |
[('x', 'IDENT', 0), ('=', '=', 2), ('A', 'IDENT', 4), ('|', '|', 6), ('b', 'IDENT', 8)] | |
""" | |
from collections import namedtuple | |
from warnings import warn | |
import string | |
def T(tag, doc, args): | |
"""Creates a new tuple type.""" |
This file contains 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
def read_ints(): | |
i = 0 | |
while True: | |
s = input('enter number[%i]:' % i) | |
try: | |
yield int(s); i+=1 | |
except ValueError: | |
if s == "": return | |
else: print "ignoring invalid number" |
This file contains 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
a:3 3#0; b:.[a; 1 1;+;1]; c:a+2; d:(c,'a,'c); e:(a,'b,'a); `0:".O "[d,e,d] |
This file contains 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
""" | |
usage: thing.py t a g s -- machine names | |
""" | |
import sys | |
# get the tags and machine names, each separated by spaces. | |
# the two groups are separated by -- | |
args = sys.argv[1:] | |
This file contains 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
/ ansi color palette: | |
p: ("#000"; "#800"; "#008"; "#880"; "#008"; "#808"; "#088"; "#ccc") | |
p:p,("#888"; "#f00"; "#00f"; "#0f0"; "#ff0"; "#f0f"; "#00f"; "#fff") | |
ansi:p | |
/ draw boxes of the given size: | |
boxes: {(;ansi; x # ,,/x #' !16)}[8] | |
/ background noise, so you can see the black box :) |
This file contains 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
/ script to expose an apparent bug in kona when combining | |
/ higher-order verbs. | |
/ j-style "monadic fork": our first higher order verb. | |
mf: {[f;g;h] { g[f[x]; h[x]] }} | |
/ cheq = check equality of two strings. (or complain if mismatched) | |
cheq: { :[ x~y; echo "."; echo "\nfailed: (", x, ") ~ (", y, ")\n"] } | |