Python 提供了两个基本的 socket 模块:
Socket
它提供了标准的BSD Socket API。SocketServer
它提供了服务器重心,可以简化网络服务器的开发。
下面讲解下 Socket模块功能。
import scala.actors.Actor | |
import scala.actors.Actor._ | |
import scala.actors.remote.RemoteActor | |
import scala.actors.OutputChannel | |
import scala.util.Random | |
case class Status(x: String, a: Int, b: Int) | |
case class Guess(gameID: Int, x: String) | |
case class GameID(gameID: Int) |
#!/bin/bash | |
QUERY=query.json | |
time curl -i -XPOST \ | |
-o output.log \ | |
--data "@$QUERY" \ | |
-H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
http://127.0.0.1:7474/db/data/transaction/commit |
4 # number of states | |
START | |
COLD | |
HOT | |
END | |
3 # size of vocab | |
1 | |
2 | |
3 |
The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.
#!/bin/bash | |
export GO_VERSION=1.10 | |
export GO_DOWNLOAD_URL=https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz | |
export GOPATH=/usr/local/lib/go | |
export GOROOT=/usr/local/go | |
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin | |
sudo mkdir ${GOPATH} | |
sudo chown ${USER} -R ${GOPATH} |