Docsify画图建模Mermaid插件支持
先上图
没有 OS X 平板(iPad 是 ios 系统)这个问题一直困扰着我.
正所谓,工欲善其事必先利其器.
新键盘入手,HHKB Professional 2 Type-S
通过侦听显示器亮度,或根据当地时间,实现自动换肤换色。
项目主页:https://plugins.gitbook.com/plugin/donate
Config:
{
"plugins": ["donate"],
"pluginsConfig": {
"donate": {
"wechat": "例:/images/qr.png",
"alipay": "http://blog.willin.wang/static/images/qr.png",
"title": "默认空",
"button": "默认值:Donate",
"alipayText": "默认值:支付宝捐赠",
"wechatText": "默认值:微信捐赠"
}
}
}
问题:
判断一个数(x)是否为 2 的 N 次幂,如果是,返回是 2^n 中的 n,如果不是返回 false
约束: x <= 2^800
不用说,递归肯定是最 sb 的版本:
function power2sb(x, n) {
n = n || 0;
if (x === 1) {
return n;
}
if (x < 1) {
return false;
}
return power2sb(x / 2, n + 1);
}
结果测试:
console.log(power2sb(4)); // 2
console.log(power2sb(5)); // false
console.log(power2sb(65536)); // 16
console.log(power2sb(Math.pow(2, 52) + 1)); // false
console.log(power2sb(Math.pow(2, 53) + 1)); // false 实际结果:53
这是对Hexo 文章计数插件的一次更新.
效果可参考本站.
原题地址: https://leetcode.com/problems/single-number/
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong.