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
Moscow ML version 2.01 (January 2004) | |
Enter `quit();' to quit. | |
- load "Intmap"; | |
> val it = () : unit | |
- open Intmap; | |
> type 'a intmap = 'a intmap | |
val 'a numItems = fn : 'a intmap -> int | |
val ('a, 'b) foldr = fn : (int * 'a * 'b -> 'b) -> 'b -> 'a intmap -> 'b | |
val 'a insert = fn : 'a intmap * int * 'a -> 'a intmap | |
val 'a listItems = fn : 'a intmap -> (int * 'a) list |
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
- val zero = List.foldr (fn (k, m) => insert(m, k, Char.chr(k))) (empty()) (List.tabulate(256, fn(n) => n)); | |
> val zero = <intmap> : char intmap | |
- listItems zero;> val it = | |
[(0, #"\^@"), (1, #"\^A"), (2, #"\^B"), (3, #"\^C"), (4, #"\^D"), | |
(5, #"\^E"), (6, #"\^F"), (7, #"\a"), (8, #"\b"), (9, #"\t"), (10, #"\n"), | |
(11, #"\v"), (12, #"\f"), (13, #"\r"), (14, #"\^N"), (15, #"\^O"), | |
(16, #"\^P"), (17, #"\^Q"), (18, #"\^R"), (19, #"\^S"), (20, #"\^T"), | |
(21, #"\^U"), (22, #"\^V"), (23, #"\^W"), (24, #"\^X"), (25, #"\^Y"), | |
(26, #"\^Z"), (27, #"\^["), (28, #"\^\"), (29, #"\^]"), (30, #"\^^"), | |
(31, #"\^_"), (32, #" "), (33, #"!"), (34, #"\""), (35, #"#"), (36, #"$"), |
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 mpd | |
import curses | |
class Mjolnir(object): | |
'''Main Mjolnir class''' | |
def __init__(self, hostname, port): | |
'''Mjolnir constructor''' | |
self.__connected = False | |
self.__hostname = hostname | |
self.__port = 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
-module(gen_server_api). | |
-behaviour(gen_server). | |
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). | |
-export([start/0, f/0]). | |
start() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). | |
f() -> gen_server:call(?MODULE, f). |
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
Element groundLayer = getLayer(mapDocument, "ground"); | |
int groundOffset = getFirstGID(mapDocument, "ground"); | |
int[] groundGIDs = getGIDs(groundLayer); | |
for (int i = 0; i < groundGIDs.length; i++) { | |
int id = groundGIDs[i]; | |
if (id > 0) { | |
map.setTile(i % mapWidth, i / mapWidth, | |
(Image) tiles.get(id - groundOffset)); | |
} |
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
interface TileThingy { | |
public void doStuff(int i, int id, int offset); | |
} | |
void foreachTile(Element mapDocument, String layerName, TileThingy thingy) { | |
Element layer = getLayer(mapDocument, layerName); | |
int offset = getFirstGID(mapDocument, layerName); | |
int[] GIDs = getGIDs(layer); | |
for (int i = 0; i < GIDs.length; i++) { | |
int id = GIDs[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
class Players | |
@list = Array.[] | |
def addPlayer(player) | |
i = 0 | |
while i < @list.length | |
if player.ratio > @list[i] | |
@list.insert(i, player) | |
end | |
end |
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
(defmodule ping | |
(export (start 0) (stop 0) (init 0) (loop 0))) | |
(defun start () | |
(let ((pid (spawn #(ping init ())))) | |
(register 'ping pid))) | |
(defun stop () | |
(! 'ping 'stop)) |
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
-module(logger). | |
-export([log/1]). | |
log(Event) -> | |
link(whereis(logger)), | |
handle_log_stuff(Event). |
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
slapptop:~ > cat .lambdabot/online.rc | |
irc-connect EFNet irc.du.se 6667 lambdabot Lambda_Robots:_100%_Loyal | |
admin + EFNet:fabjan | |
join EFNet:#dv |
OlderNewer