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
#!/usr/bin/sbcl --script | |
(defparameter routes `((A B C) | |
(B A C D) | |
(C A B D E) | |
(D B C E) | |
(E))) | |
(defparameter start 'A) | |
(defparameter finish 'E) |
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
import java.util.*; | |
import java.util.function.Consumer; | |
public class Puzzle { | |
static record Move(int pos1, int pos2, int score) { | |
@Override | |
public String toString() { | |
return String.format("%d <-> %d", pos1, pos2); | |
} | |
} |
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
package main | |
import ( | |
"bufio" | |
"bytes" | |
"crypto/sha1" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/http" |
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
import ( | |
"flag" | |
"log" | |
"net/http" | |
) | |
var addr = flag.String("-h", ":8080", "host:port") | |
var dir = flag.String("-d", ".", "directory to serve") |
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
#!/usr/bin/python | |
from __future__ import print_function | |
import sys, xml.parsers.expat, sys | |
import pystache | |
if len(sys.argv) != 3: | |
print('usage: convopml.py <opml file> <html file>', file = sys.stderr) | |
sys.exit(2) |
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
#!/usr/bin/python | |
# create the union of a set of mozilla bookmarks files | |
# usage: ./beq.py bookmarks-20110501.html bookmarks-20120101.html > bookmarks.html | |
# | |
# license: the code is in the public domain | |
from bs4 import BeautifulSoup | |
from jinja2 import Template | |
import sys |
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
/* | |
An Amazing sentence in English from | |
https://plus.google.com/photos/117176908342196183611/albums/5812811361700087857/5812811362489240738 | |
> I do not know where family doctors acquired illegibly | |
> perplexing handwriting; nevertheless, extraordinary | |
> pharmaceutical intellectuality counterbalancing | |
> indecipherability transendentalizes intercommunication's | |
> incomprehensibleness |
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
// the smiley program demonstrated by Russ Cox at http://research.swtch.com/acme | |
// it shows that the plan9 compiler http://plan9.bell-labs.com/sys/doc/comp.html fully supports UTF-8 | |
// i tried to compile it with a recent version of the plan9 compiler running on vmware but it failed. | |
// it seems that older versions of the compiler supported sizeof(void) == 0 | |
// anyway you get the idea | |
#include <u.h> | |
#include <libc.h> |
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
/* | |
A simple Go program, http://golang.org, i wrote to demonstrate the | |
language. It converts chess FEN notation to images or html tables. | |
Uses the public domain pieces from http://www.crockford.com/chess/pieces.html | |
The program is small in size but not in functionality. It includes | |
http client and server, html templates, image processing, strings, io | |
and demonstrates the expressiveness of Go | |
See http://blog.golang.org/2011/12/from-zero-to-go-launching-on-google.html |
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
package main | |
/* | |
Implements a key-value REST web service in go (http://golang.org) | |
It uses | |
github.com/bmizerany/pat A sinatra style pattern muxer | |
github.com/bmizerany/pq A pure Go postgres driver | |
The urls are |