求解a^n
次方,正常求解需要O(n)时间,若n很大,则需要更快速的算法
快速幂
基础:任何一个数都可以用二进制表示
若需求3^11
,可将指数进行一个logN
的变换,11 = 2^3 + 2^1 + 2^0
,只需算3^8,3^2,3^1
,再将其相乘。
因为ES6的兴起,很多新特性在浏览器中实现不了,甚至低版本的node也不能实现,所以需要一个node版本管理工具,nvm不支持windows,但nvm-windows支持,也持续在更新。
内容寻址文件系统
1 | git add |
新建git-credentials文件touch ~/git-credentials
, window中为用户文件夹下新建git-credentials文件
编辑git-credentials文件vim gitgit-credentials
, 添加https://{用户名}:{密码}@github.com
使得git-credentials生效
执行git config --global credential.helper store
查看~/.gitconfig文件变化
多了如下代码:
1 | [credential] |
校园网git push
推送时出现1
2
3
4
5
6
7
8
9
10
11ssh_dispatch_run_fatal: Connection to 192.30.255.112: Software caused connection abort
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: ssh_dispatch_run_fatal: Connection to 192.30.255.112: Software caused connection abort
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.