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(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), |
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
<?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> |
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
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 |
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(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), |
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
set ramDiskImgDir=C:\RamDiskImg | |
md %ramDiskImgDir%\ChromeUserData | |
xcopy /s /y /k "R:\ChromeUserData\Local State" %ramDiskImgDir%\ChromeUserData\ | |
xcopy /y /k R:\ChromeUserData\Default\*.* %ramDiskImgDir%\ChromeUserData\Default\ | |
xcopy /s /y /k "R:\ChromeUserData\Default\Plugin Data\*.*" "%ramDiskImgDir%\ChromeUserData\Default\Plugin Data\" |
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
xcopy /s /y /k C:\RamDiskImg\*.* R:\ |
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 Tester | |
def +(v) # OK | |
end | |
def abc=(v) # OK | |
end | |
def +=(v) # Syntax Error | |
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
import Data.Word(Word8) | |
import Data.Char(chr) | |
data BFData = BFData { | |
curr :: Word8, | |
left :: [Word8], | |
right :: [Word8] | |
} deriving(Show) | |
data BFState = BFState { |
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 Control.Monad.State | |
import Data.Word(Word8) | |
import Data.Char(chr) | |
data BFState = BFState { | |
dataLeft :: [Word8], | |
dataRight :: [Word8], | |
codeLeft :: [Char], | |
codeRight :: [Char], | |
bfOutput :: [Char] |
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
data BFState = BFState { | |
dataLeft :: [Word8], | |
dataRight :: [Word8], | |
codeLeft :: [Char], | |
codeRight :: [Char], | |
bfOutput :: [Char] | |
} | |
fwdCode, backCode :: State BFState () | |
fwdCode = modify $ \s@(BFState{codeLeft=ls, codeRight=r:rs}) -> s{codeLeft=r:ls, codeRight=rs} |
OlderNewer