V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  kamilic  ›  全部回复第 11 页 / 共 11 页
回复总数  216
1 ... 2  3  4  5  6  7  8  9  10  11  
https://item.jd.com/11116026.html
不那么学术的话,这本书也说得挺好的
2020-03-28 14:20:31 +08:00
回复了 22yune 创建的主题 程序员 计算机中 为何可以时间换空间或空间换时间?
我的理解是这样的。
计算机完成一个纯计算任务,用到的资源无非只有存储空间和 CPU 资源使用时间。
你也只能在这两者中倒腾了。。。

给出一个纯计算任务,如果直接使用 CPU 计算,则要用到 CPU 时间去处理任务,但它没有用到存储空间。
如果你事先计算好了,直接在内存去找就行了,这样没有利用到 CPU 时间就能完成任务。

前提:
不要考虑说你的时间也是时间。
也不要考虑说 CPU 运行过程中会载入内存的代码段,以及读内存需要 CPU 参与这些事。

我们只讨论这个任务结果在计算机部件中的存在。
2020-03-23 12:03:23 +08:00
回复了 50vip 创建的主题 分享创造 面试:如何实现一个模板引擎?
可以考虑用 lit-html 啊,也是差不多的书写方式。
但是他们有类似 v-dom diff 和 patch 的效果(虽然内部实现不是 vdom )
也挺厉害的
2020-03-05 10:31:05 +08:00
回复了 wildlynx 创建的主题 问与答 市面上有无“NAS,路由器,网络机顶盒”三合一的产品?
买个箱子装一起
2020-01-12 19:16:22 +08:00
回复了 0gys 创建的主题 生活 祝大家的另一半像雪花一样扑过来
广州没有雪
汤达人
2019-11-28 14:41:52 +08:00
回复了 qiayue 创建的主题 推广 [特价][抽奖]赣南脐橙 5 斤试吃装包邮只要 28 元
吃个橙
2019-08-23 13:25:08 +08:00
回复了 VDimos 创建的主题 程序员 这样的想法可行不?
flutter?
2019-07-18 10:02:21 +08:00
回复了 chashao 创建的主题 问与答 一道 promise 的题目,求大佬解答
??不支持 md 的?
2019-07-18 10:01:28 +08:00
回复了 chashao 创建的主题 问与答 一道 promise 的题目,求大佬解答
```javascript
class Scheduler {
constructor() {
this.__maxQueueSize = 2;
this.__runningJobs = [];
this.__pendingQueue = [];
}

get isJobsFull() {
return this.__maxQueueSize <= this.__runningJobs.length;
}

static jobWrapper(promiseCreator) {
Scheduler.__jobId += 1;
const id = Scheduler.__jobId;
const wrappedPromise = promiseCreator().then((result) => {
return {
id,
result
};
});
wrappedPromise.__jobId = id;
return wrappedPromise;
}

removeFinishedJob(id) {
console.log(`remove ${id}`);
this.__runningJobs = this.__runningJobs.reduce((curr, job) => {
if (job.__jobId !== id) {
curr.push(job);
}
return curr;
}, []);
console.log(this.__runningJobs);
}

async add(promiseCreator) {
if (!this.isJobsFull) {
const job = Scheduler.jobWrapper(promiseCreator);
this.__runningJobs.push(job);
const {result, id} = await job;
this.removeFinishedJob(id);
return result;
} else {
this.__pendingQueue.unshift(promiseCreator);
await Promise.race(this.__runningJobs);
if (this.__pendingQueue.length > 0) {
return this.add(this.__pendingQueue.pop());
}
}
}
}

Scheduler.__jobId = 0;
```

昨晚一时兴起写了一下,希望对你有帮助。。
没得选 家就在一线
而且并不是某村村民
2019-05-24 11:01:45 +08:00
回复了 kassol 创建的主题 全球工单系统 淘宝 npm 镜像源貌似挂了
又挂了
2019-04-07 14:37:51 +08:00
回复了 gazce 创建的主题 Apple 就在刚刚,终于打通了 apple 的客服电话。
@BenX AC+ 可以退吗? 我前几天打过电话给客服,他们说服务类的不能退
2018-09-03 11:37:00 +08:00
回复了 wujinglun 创建的主题 程序员 想知道有多少人北上广深港澳的本地人是做 IT 这行的
为什么总觉得土著就是有钱的呢
1 ... 2  3  4  5  6  7  8  9  10  11  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   929 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 33ms · UTC 21:10 · PVG 05:10 · LAX 14:10 · JFK 17:10
Developed with CodeLauncher
♥ Do have faith in what you're doing.