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
let fact n | |
let rec fact_ite n t = | |
if n = 0 then t | |
else fact_ite (n-1) (n*t);; | |
in | |
fact_ite n 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
#include <stdio.h> /* Standard input/output definitions */ | |
#include <string.h> /* String function definitions */ | |
#include <unistd.h> /* UNIX standard function definitions */ | |
#include <fcntl.h> /* File control definitions */ | |
#include <errno.h> /* Error number definitions */ | |
#include <termios.h> /* POSIX terminal control definitions */ | |
/* | |
* 'open_port()' - Open serial port 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
#!/usr/bin/ruby | |
require "rexml/parsers/streamparser" | |
require "rexml/parsers/baseparser" | |
require "rexml/streamlistener" | |
class JPS2TextListener | |
include REXML::StreamListener | |
def initialize |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import xml.parsers.expat | |
import codecs | |
import sys | |
nextaction = None | |
current = None |
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
(asdf:load-system :usocket) | |
(defun daytime-client (host) | |
(usocket:with-client-socket (socket stream host 13) | |
(read-line stream nil nil))) |
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
(asdf:load-system :usocket) | |
(load "/usr/share/common-lisp/source/usocket/usocket.lisp") | |
(defun tcp-handler (stream) | |
(multiple-value-bind (sec min hr date mon yr day daylight zone) | |
(get-decoded-time) | |
(format stream "~D-~D-~D ~D:~D:~D~%" yr mon date hr min sec))) | |
(usocket:socket-server "127.0.0.1" 9090 #'tcp-handler) |
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
/* | |
gl.js | |
Grid Locator Calcuration Library | |
version 1.0 | |
Copyright (C) 2013 Keisuke Nakao (chome@argv.org) | |
This library is free software: you can redistribute is and/or modify | |
it under the terms of the GNU General Public Licenses as published by |
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
#!/usr/bin/python | |
import socket | |
from datetime import datetime | |
HOST='' | |
PORT=8014 | |
sock = socket.socket(socket.AF_INET|socket.AF_INET6, socket.SOCK_STREAM) | |
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
sock.bind((HOST, PORT)) |
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
#!/usr/bin/python | |
buzz = lambda x:[(lambda _x: "" if _x%5 else "Buzz")(x), x] | |
fizz = lambda x: (x[0] if x[0]=='Buzz' else x[1]) if x[1]%3 else "Fizz" + x[0] | |
for i in range(1,100): | |
print fizz(buzz(i)) |
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
import Gnuplot | |
data = Gnuplot.Data( ((1,1),(2,2),(3,3)), with_='lp', title='test plot') | |
g = Gnuplot.Gnuplot() | |
# Plot on display | |
g.plot(data) | |
# Hardcopy | |
g.hardcopy('plot.ps', 'postscript') |
OlderNewer