Howto Multiply Great Numbers
超级大数的乘法 我的问题是把两个特别大的数字相乘 比如$1234\times5678$ 小学乘法需要逐个数字互相相乘 用时是$O(n^2)$的 这是显然的 基本操作是较小数字的乘法 比如上面例子中每个数字互相乘 就是十以内乘法 是较小数字的乘法 一个比较快的算法大体思路如下 第一先变换 把两个数字的每一位看成一个数组的元素 例如num.split('') 然后把这些数组做某个变换 变成...
超级大数的乘法 我的问题是把两个特别大的数字相乘 比如$1234\times5678$ 小学乘法需要逐个数字互相相乘 用时是$O(n^2)$的 这是显然的 基本操作是较小数字的乘法 比如上面例子中每个数字互相乘 就是十以内乘法 是较小数字的乘法 一个比较快的算法大体思路如下 第一先变换 把两个数字的每一位看成一个数组的元素 例如num.split('') 然后把这些数组做某个变换 变成...
THIS IS A WORK IN PROGRESS search PATTERN in files but exclude files whose path matches EXCLUDE_PATH_PATTERN ! means exclude, -g option expects GLOB not regex. $ rg hello -g !*node_modules*
THIS IS A WORK IN PROGRESS fetch a huge code base partially reference git clone ssh://git@example.com/.git --depth 1 --branch release use the following command to further fetch all history but...
THIS IS A WORK IN PROGRESS 这本书确实没有讲到事件循环 线程和锁 使用锁元语来完成并发程序的同步和互斥需求,很容易出错,不讨论了。 函数式编程 用不可变的状态,其他的跟下面的CSP 几乎一模一样,不讨论了。 Clojure 都是语言特性,不讨论了 Actor actor 是一种由运行时维护的实体,actor 之间可以发送消息,消息是一种不可变的数据...
THIS IS A WORK IN PROGRESS 少做工 更优算法 利用领域知识减少做工 last N digits of fibonacci sequence is cyclic, thus one can calculate last N digits of the Xth number in the sequence with manageable time and ...
THIS IS A WORK IN PROGRESS 你说一下什么叫做强缓存和协商缓存 其实本来不存在强缓存和协商缓存的概念。所有的缓存系统都有几个关键属性 缓存的元数据是多少 一般情况下缓存的键就是网址。但是也可以用Vary 标头字段来注明你需要额外的键,例如Vary: Accept-Language 就表示需要把网址和Accept-Language 标头作为缓存的键。 另外还需...
placeholder for images https://placehold.co/600x400/f00/0f0?text=libq%20debug\ngreen%20on%20red copy a directory and its git history This article outlines the cherry-picking approach. Cr...
THIS IS A WORK-IN-PROGRESS This post will be a summary of programming assignments of this free course on edx. These programming assignments builds a compiler for the COOL programming. This languag...
if statements Wrap boolean expressions with [ ]. Use (( )) and == to compare numbers. Use = to compare strings. There must be a space after [ of (( and before ] or )). if echo "$str" | grep -q ...
THIS IS A WORK-IN-PROGRESS This free online course explains inner-workings of various distributed systems. Frangipani Frangipani implements a shard storage among computers. There is Frangipani s...