Skip to content

Instantly share code, notes, and snippets.

def test1() :
tasks = []
for i in range(10) :
newtask = lambda : i*i
tasks.append( newtask )
for t in tasks :
print(t())
def make_lambda(i) :
return lambda : i*i
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:thr='http://purl.org/syndication/thread/1.0'>
<id>tag:blogger.com,1999:blog-8009078492424186690.archive</id>
<updated>2008-09-10T10:44:09.799-07:00</updated>
<title type='text'>testaadf</title>
<link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.blogger.com/feeds/8009078492424186690/archive'/>
<link rel='alternate' type='text/html' href='http://tesafsdfa.blogspot.com/'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8009078492424186690/archive'/>
<author>
<name>大鳥</name>
<uri>http://www.blogger.com/profile/03316886314546031469</uri>
-module(tcp_bridge).
-export([start/3]).
start(IP, Port, LocalPort) ->
{ok, ListenSocket} = gen_tcp:listen( LocalPort, [list, inet, {packet, raw}] ),
spawn( fun() -> listen_loop(ListenSocket, IP, Port) end ).
listen_loop(ListenSocket, IP, Port) ->
{ok, LocalSocket} = gen_tcp:accept(ListenSocket),
{ok, RemoteSocket} = gen_tcp:connect(IP, Port, [list, inet, {packet, raw}], 3000),