Introducing gRPC

何为 RPC

RPC(Remote Procedure Call),远程过程调用,它是一种通过网络从远程计算机程序上请求服务,而不需要了解底层网络技术的协议。RPC 协议假定某些传输协议的存在,如 TCP 或 UDP,为通信程序之间携带信息数据。在 OSI 网络通信模型中,RPC 跨越了传输层和应用层。RPC 使得开发包括网络分布式多程序在内的应用程序更加容易。

Capacitated Facility Location Problem

本次算法项目中,我们被要求解决一个“仓库选址问题”。在该问题中,我们被给定了一定数量的顾客和一定数量的仓库。每个顾客到不同的仓库有不同的服务成本,同时每个仓库也有最小的经营成本(这意味着一旦仓库服务了顾客,其就会产生一个额外的成本)。我们的目标是寻找到一个顾客分配方案,使得总的服务成本(包含经营成本)最少。

FLP 是一个经典的 NP 难问题,CFLP 也一样。由于 NP 难问题夸张的求解时间复杂度,我们不能够寻求一个常规的,最优的方案来求解。相对的,我们只能够构建一个能够收敛到近似全局最优的启发式算法来获得一个近似解。

在本次项目中,我们选择了 爬山算法(Hill Climbing Algorithm))遗传算法(Genetic Algorithm) 作为我们的代码实现,并通过对比来寻求二者间的差异。

代码仓库

Leetcode 526. Beautiful Arrangement

题目

526. Beautiful Arrangement

  • Difficulty: Middle
  • Total Accepted: 31,338
  • Total Submissions: 59,005

Leetcode 945. Minimum Increment to Make Array Unique

题目

945. Minimum Increment to Make Array Unique

  • Difficulty: Middle
  • Total Accepted: 5,139
  • Total Submissions: 12,879

Leetcode 948. Bag of Tokens

题目

948. Bag of Tokens

  • Difficulty: Middle
  • Total Accepted: 3,132
  • Total Submissions: 8,230

Leetcode 188. Best Time to Buy and Sell Stock

本题有四个不同难度的版本:

下面分题进行讲解:

121. Best Time to Buy and Sell Stock

  • Difficulty: Easy
  • Total Accepted: 379.2K
  • Total Submissions: 843.6K

Say you have an array for which the ith element is the price of a given stock on day i.

If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit.

Note that you cannot sell a stock before you buy one.

Let's have a cup of Gin.go

最终制品:CloudGo-IO,是一个在 CloudGo 的基础上开发的基于 Gin 框架开发的简单的 WEB 服务程序,支持静态文件服务、JavaScript 请求响应、模板输出、表单处理等功能。具体来讲,我们实现了一个拥有美观界面的支持用户注册和信息查看的网页。用户可以在其上登录他们的信息,然后通过相应的页面查看(表格太丑,做了些样式)。支持多个用户信息的存储和访问。支持用户查重、信息查重、信息格式查错。

下面我将带你走进 Gin 的神奇世界!

Leetcode 140. Word Break

题目

本题有两个不同难度的版本:139. Word Break 和 140. Word Break II。

139. Word Break

  • Difficulty: Medium
  • Total Accepted: 263K
  • Total Submissions: 798K

Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words.

Note:

The same word in the dictionary may be reused multiple times in the segmentation.
You may assume the dictionary does not contain duplicate words.

Example 1:

Input: s = "leetcode", wordDict = ["leet", "code"]
Output: true
Explanation: Return true because "leetcode" can be segmented as "leet code".

Example 2:

Input: s = "applepenapple", wordDict = ["apple", "pen"]
Output: true
Explanation: Return true because "applepenapple" can be segmented as "apple pen apple".
             Note that you are allowed to reuse a dictionary word.

Example 3:

Input: s = "catsandog", wordDict = ["cats", "dog", "sand", "and", "cat"]
Output: false

Leetcode 32. Longest Valid Parentheses

题目

32. Longest Valid Parentheses

  • Difficulty: Hard
  • Total Accepted: 152.4K
  • Total Submissions: 632.8K

Setup ethereum on your Mac

你适合使用本教程吗?

本教程将带领你从零开始在 MacOS 上搭建一个以太坊环境,并且设置一个你自己的私有节点,然后完成挖矿和交易。在它上面,你可以测试你的智能合约代码,或是干任何你想做的事情~在最后,我们也会带领你在上面撰写一个你自己的智能合约,并尝试运行它。

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×