This is my Personal Knowledge Management
- Technical Debt
- Workflow
- Efficiency Tools
You can filter out the top nodes by tag “top-node” and the backlink at the bottom of the article for a better view.
This is my Personal Knowledge Management
You can filter out the top nodes by tag “top-node” and the backlink at the bottom of the article for a better view.
<dependencies> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.4</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> <version>4.4</version> </dependency> </dependencies> CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost uploadFile = new HttpPost("..."); MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.addTextBody("field1", "yes", ContentType.TEXT_PLAIN); // This attaches the file to the POST: File f = new File("[/path/to/upload]"); builder.addBinaryBody( "file", new FileInputStream(f), ContentType.APPLICATION_OCTET_STREAM, f.getName() ); HttpEntity multipart = builder.build(); uploadFile.setEntity(multipart); CloseableHttpResponse response = httpClient.execute(uploadFile); HttpEntity responseEntity = response.getEntity(); 4.0 版本需要按照下面...
pom.xml 文件中需要增加一些包。 <repositories> <repository> <id>opencv</id> <url>https://mvnrepository.com/artifact/org.openpnp/opencv</url> </repository> <repository> <id>djl.ai</id> <url>https://oss.sonatype.org/content/repositories/snapshots/</url> </repository> </repositories> <dependencies> <!-- DJL Core API --> <dependency> <groupId>ai.djl</groupId> <artifactId>api</artifactId> <version>${djl.version}</version> </dependency> <!-- DJL PyTorch Engine --> <dependency> <groupId>ai.djl.pytorch</groupId> <artifactId>pytorch-engine</artifactId> <version>${djl.version}</version> </dependency> <!-- DJL PyTorch Model Zoo --> <dependency> <groupId>ai.djl.pytorch</groupId> <artifactId>pytorch-model-zoo</artifactId> <version>${djl.version}</version> </dependency> <!-- DJL Basic Dataset --> <dependency> <groupId>ai.djl</groupId> <artifactId>basicdataset</artifactId> <version>${djl.version}</version> </dependency> <!-- DJL Image Processing --> <dependency>...
给定的 Lamport 时间戳 \(L(a)\) 和 \(L(b)\) 并且 \(L(a) < L(b)\),我们推断不出 \(a \rightarrow b\) 或者 \(a || b\).1 要区分平行的这些事件,需要 vertor clocks: 假定分布式系统中有 \(n\) 个节点,\(N = \langle N_{1},...
Definition 最弱的广播类型称为先进先出(FIFO)广播。在这个模型中,由同一节点发送的信息按照发送的顺序传递。例如下图中,\(m_{1}\) 必须在 \(m_{3}\) 之...
Definition 总秩序广播(total order broadcast),有时也被称为原子广播(atomic broadcast)。FIFO broadcast 和 Causal broadcast 允许不同的节点以不同...
Remote Procedure Call Remote Procedure Call (RPC) 使得调用远程函数就像调用本地函数一样,这样就不需要关心资源的具体问题,实际上 RPC 是将方法调用转换成了网络通信。但是遇到通信失败怎...
The Happens-before relation An event is something happening at one node (sending or receiving a message, or a local execution step). event \(a\) happens before event \(b\), written \(a \rightarrow b\). 那么在分布式,有三种情况,满足其中一条,则 \(a\) 是发生在 \(b\) 之前: \(a\) 和 \(b\) 发生在相同节...
Definition Causal broadcast 算法有点类似于 FIFO broadcast: 每条被广播的消息附上的不是一个序列号,而是一个整数的向量。这种算法有时被称为向量时钟算法,向量时钟...
Lamport clocks algorithm Lamport clocks in words Figure 1: lamport-example-simple 每个节点都维护一个计数器 \(t\),每一个当前节点事件 \(e\) 发生时,自增 1。 增长后的值设为 \(L(e)\) 发送消息时附带上当前的计数 \(t\) 消息...
Figure 1: node-state-transitions-in-raft 一个节点有三种状态:leader,candidate 和 follower。当一个节点第一次运行,或者崩溃后恢复时,处于 follower 的状态并且等待其...