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
-module(palindrome). | |
-export([palindrome_check/1, server/1, serve/1]). | |
-export([server_of_clients/0, serve_client/0]). | |
-export([servers_of_clients/0,servers_balancer/3,many_serve_client/1]). | |
rem_punct(String) -> lists:filter(fun (Ch) -> | |
not(lists:member(Ch,"\"\'\t\n ")) | |
end, | |
String). |
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
"""Transducers in Python | |
http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming | |
""" | |
from functools import reduce | |
def compose(*fs): | |
"""Compose functions right to left. |
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 minimal Forth compiler in C | |
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com | |
* Release 2014-04-04 | |
* | |
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial | |
* | |
* PUBLIC DOMAIN | |
* |
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
require 'socket' | |
module EventEmitter | |
def _callbacks | |
@_callbacks ||= Hash.new { |h, k| h[k] = [] } | |
end | |
def on(type, &blk) | |
_callbacks[type] << blk | |
self |