amd

How do AMD loaders work under the hood?

筅森魡賤 提交于 2019-11-27 14:48:26
问题 So I've been using require.js for while now, but I realized that I actually don't know how it works under the hood. It says that it's an AMD loader. I do understand that CommonJS is synchronous, which means that it blocks execution of other codes while it's being loaded. On the other hand, AMD is asynchronous. This is where I get confused. When I define a module, it has to load a,b,c in order to execute the callback. How does asynchronous work here? Isn't it synchronous when it has to load

【番外】一个新手如何选购配件比价到完成电脑组装

ε祈祈猫儿з 提交于 2019-11-27 12:15:48
2019年的国庆7天就剩今天最后一天了,作为假期的完结我也决定仪式感地总结一下之前电脑组装过程。说明一下北桥苏尽管是和电脑打交道但对电脑硬件的认知少之又少,还有现在的名字(北桥苏)来源就是以前主板芯片组的一员----北桥,只是在后面强行加了一个苏字。因为随着技术迭代,北桥也退出了芯片组逐渐被整合进CPU,所以也算留念才起的名。这篇文章是面向选购新手,所以那些像B站里的职业UP或数码界高手可以略略略哦,看到我有不妥的地方可以留言指正,参考网站:http://www.zol.com.cn/。 购买前 买前可以确定自己组装用来做什么,一般可以分三种:1.普通办公看电影小游戏;2.能畅玩3A单机大作; 3.视频剪辑特效渲染工作。如果是第一次组装,最好就选第一种就算翻车损失也小,但是可以在选购主板和电源注意一下就可以,这个后面说。并且个人建议第一次最好全部购买新配件,比起二手成功概率高更能让你深入研究。还有CPU全新与二手其实价格相差不大,毕竟这种配件是没有假货很保值。用途确定了,可以用笔或表格列一个清单,CPU,主板,内存条,硬盘,显卡,电源,机箱,风扇,外设(可以除外)。后面可以留空,也可以在网上查询别人的硬件搭配清单,根据他们的硬件购买,只要看清楚他们针对的用途是什么就可以,但是关于硬件的参数也有必要了解一下,也能利于后期硬件升级。 硬件参数 1. CPU

20190808面试记录

守給你的承諾、 提交于 2019-11-27 07:10:15
Angular的核心? 组件,指令,服务,依赖注入 性能优化? 1、减少http请求(图片压缩合并,css压缩合并,js文件压缩合并) 2、检查是否有重定向问题 3、检查是否一个列表有多次请求问题 4、减少DOM数量 5、延迟加载 6、提前加载 7、能用css做的尽量不要用js去做,能有原生写的尽量不引用外部插件 8、减少cookie的使用 9、尽量不用iframe 10、前端和后台协调,使用相应资源的压缩 11、根据需求使用ajax缓存 12、减少dom操作 13、减量不嵌套循环 14、css放head尽量不使用@import,因为@import是同步操作,只有把对应的样式导入后,才会继续向下加载,而link是异步的操作 15、css设置定位后最好设置z-index改变盒子的层级 16、使用window.requestAnimationFrame代替传统的定时器动画,如果可以使用setTimeout代替的setInterval就尽量不用setInterval 17、script标签放在底部加载 18、绑定多个事件的时候可以使用事件委托,减少循环给元素绑定事件 19、减少flash的使用 20、合理利用本地缓存 21、尽量给动画设置单独的一个图层(避免重绘和回流) AMD和CMD的标准?现阶段使用的都是什么标准? AMD 是 RequireJS 在推广过程中对模块定义的规范化产出。

How to disable the warning 'define' is not defined using JSHint and RequireJS

不羁的心 提交于 2019-11-27 02:59:51
I uses RequireJS AMD in my project. When i run jshint on my project, it throws error like In AMD Scripts 'define' is not defined. In Mocha test cases 'describe' is not defined. 'it' is not defined. How to remove this warning in jshint? Just to expand a bit, here's a .jshintrc setup for Mocha: { .... "globals" : { /* MOCHA */ "describe" : false, "it" : false, "before" : false, "beforeEach" : false, "after" : false, "afterEach" : false } } From the JSHint Docs - the false (the default) means the variable is read-only. If you are defining globals only for a specific file, you can do this: /

supporting both CommonJS and AMD

£可爱£侵袭症+ 提交于 2019-11-27 02:50:57
Is there a way to create a javascript micro-library (a library that has no dependencies), that support all of the following module formats: Asynchronous Module Definition CommonJS exposing the library's exports as a global namespace object (no loader) Here is a list of various cross-compatible module formats . I suspect that the one you're looking for is what they're calling " commonjsStrict.js " Yes, and I owe this answer to ded and his awesome modules: (function(name, definition) { if (typeof module != 'undefined') module.exports = definition(); else if (typeof define == 'function' && typeof

AMD 和 CMD 的区别有哪些?

≡放荡痞女 提交于 2019-11-27 02:11:18
AMD 规范在这里: https:// github.com/amdjs/amdjs- api/wiki/AMD CMD 规范在这里: https:// github.com/seajs/seajs/ issues/242 AMD 是 RequireJS 在推广过程中对模块定义的规范化产出。 CMD 是 SeaJS 在推广过程中对模块定义的规范化产出。 类似的还有 CommonJS Modules/2.0 规范,是 BravoJS 在推广过程中对模块定义的规范化产出。 还有不少⋯⋯ 这些规范的目的都是为了 JavaScript 的模块化开发,特别是在浏览器端的。 目前这些规范的实现都能达成浏览器端模块化开发的目的。 区别: 1. 对于依赖的模块,AMD 是提前执行,CMD 是延迟执行。不过 RequireJS 从 2.0 开始,也改成可以延迟执行(根据写法不同,处理方式不同)。CMD 推崇 as lazy as possible. 2. CMD 推崇依赖就近,AMD 推崇依赖前置。看代码: // CMD define(function(require, exports, module) { var a = require('./a') a.doSomething() // 此处略去 100 行 var b = require('./b') // 依赖可以就近书写 b

Is it possible to run CUDA on AMD GPUs?

淺唱寂寞╮ 提交于 2019-11-27 00:16:30
问题 I'd like to extend my skill set into GPU computing. I am familiar with raytracing and realtime graphics(OpenGL), but the next generation of graphics and high performance computing seems to be in GPU computing or something like it. I currently use an AMD HD 7870 graphics card on my home computer. Could I write CUDA code for this? (my intuition is no, but since Nvidia released the compiler binaries I might be wrong). A second more general question is, Where do I start with GPU computing? I'm

Webpack ProvidePlugin vs externals?

a 夏天 提交于 2019-11-26 23:20:42
I'm exploring the idea of using Webpack with Backbone.js . I've followed the quick start guide and has a general idea of how Webpack works, but I'm unclear on how to load dependency library like jquery / backbone / underscore. Should they be loaded externally with <script> or is this something Webpack can handle like RequireJS's shim? According to the webpack doc: shimming modules , ProvidePlugin and externals seem to be related to this (so is bundle! loader somewhere) but I cannot figure out when to use which. Thanks It's both possible: You can include libraries with a <script> (i. e. to use

Is LFENCE serializing on AMD processors?

江枫思渺然 提交于 2019-11-26 23:16:25
In recent Intel ISA documents the lfence instruction has been defined as serializing the instruction stream (preventing out-of-order execution across it). In particular, the description of the instruction includes this line: Specifically, LFENCE does not execute until all prior instructions have completed locally, and no later instruction begins execution until LFENCE completes. Note that this applies to all instructions, not just memory load instructions, making lfence more than just a memory ordering fence. Although this now appears in the ISA documentation, it isn't clear if it is

Android Studio - How Can I Make an AVD With ARM Instead of HAXM?

蓝咒 提交于 2019-11-26 22:20:35
I'm new to Android Studio. My computer doesn't support HAXM so it won't let me install that to use for virtualization. In some similar questions on this website people mention setting up a virtual device with an ARM instead of HAXM. How can I do this? In the AVD manager all of the premade hardware profiles use HAXM, and when I click "New Hardware Profile" I don't see any option to use ARM. I looked in the SDK Manager and for API 22 I have installed "ARM EABI v7a System Image" and "Google APIs ARM EABI v7a System Image", are those what I need? How can I create a custom virtual phone with ARM,