上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页
摘要: jQuery统一了不同浏览器之间的DOM操作的差异 1. jQuery === $ // true 1.1 $(x) //将x转换为jQuery对象,便于调用jQuery提供的API 1.2 方便操作DOM,支持链式写法,消除各浏览器差异性,一套代码即可 2. $(function () {...} 阅读全文
posted @ 2018-05-04 09:18 Rocin 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 优点: 1. 在异步执行的流程中,把执行代码和处理结果的代码清晰地分离(因为Promise对象有链式写法,有then和catch) 2. 组合使用Promise,就可以把很多异步任务以并行和串行的方式组合起来执行。 例子1. 生成一个0 2之间的随机数,如果小于1,则等待一段时间后返回成功,否则返回 阅读全文
posted @ 2018-05-02 11:57 Rocin 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1. 查找节点 方法1. document.querySelector, document.querySelectorAll 方法2. document.getElementById, document.getElementsByClassName 2. 更新节点 前提是拿到要修改的DOM 方法1. 阅读全文
posted @ 2018-04-30 22:02 Rocin 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 分为10位数字(ten digit)和13位(thirteen digit)数字 1. Unix, Python为10 2. JavaScript为13位 10位的单位是秒,13位的是毫秒,一般开发默认单位为秒 阅读全文
posted @ 2018-04-29 23:19 Rocin 阅读(11121) 评论(0) 推荐(0) 编辑
摘要: 问题: map parseInt 因为map()接收三个参数,parseInt()接收两个参数,所以map的第三个参数被parseInt忽略了。 现在来分析下程序,假如现在执行arr的第一个元素,即'1';对应到map参数可知,此时传入map的第一个参数即为被传递的元素'1';第二个参数即为其索引0 阅读全文
posted @ 2018-04-29 20:01 Rocin 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 同步和异步关注的是消息通信机制,阻塞/非阻塞是程序在等待调用结果(消息,返回值)时的状态 阅读全文
posted @ 2018-04-25 20:12 Rocin 阅读(691) 评论(0) 推荐(0) 编辑
摘要: 留坑 参考: 1. https://en.wikipedia.org/wiki/Coroutine 2. https://zh.wikipedia.org/wiki/%E5%8D%8F%E7%A8%8B 3. http://www.cnblogs.com/xybaby/p/6323358.html 阅读全文
posted @ 2018-04-25 09:57 Rocin 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 1. 参考: 1. https://en.wikipedia.org/wiki/Callback_(computer_programming) 2. https://developer.mozilla.org/en US/docs/Glossary/Callback_function 3. http 阅读全文
posted @ 2018-04-24 14:16 Rocin 阅读(1455) 评论(0) 推荐(0) 编辑
摘要: 多进程(multiprocessing) 参考: 1. https://docs.python.org/3.6/library/multiprocessing.html 1. 多进程概念 multiprocessing is a package that supports spawning proc 阅读全文
posted @ 2018-04-23 22:07 Rocin 阅读(990) 评论(0) 推荐(0) 编辑
摘要: 1. 缓冲区(此处用阻塞队列充当),解决消费者和生产者强耦合问题。(生产者和消费者不直接通信) 2. 通过平衡生产者线程和消费者线程,来提高程序整体处理数据速度。 3. 在并发编程中该模式能解决大多数并发问题。 4. 例子1. 生产者生产一次,每个消费者消费一次 5. 例子2. 生产者和消费者动态生 阅读全文
posted @ 2018-04-23 21:45 Rocin 阅读(520) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 27 下一页