amd

When designing a JS library should I make it RequireJS/AMD compatible or not?

倖福魔咒の 提交于 2019-11-30 08:58:13
If I'm making a JavaScript library for general use, how should I handle RequireJS support? As far as I can tell, making your code compliant with RequireJS more or less makes it impossible to use without RequireJS. So why would I do that? How do people without Require use this code? Is there a way to support both without forking / branching? Should I provide the shim code? Do I understand this correctly? explunit If you're only dealing with browser (not node.js), it's only a handful of lines to make the library support both AMD and non-AMD. For example, here is the file from jQuery that does it

Does AMD's OpenCL offer something similar to CUDA's GPUDirect?

点点圈 提交于 2019-11-30 07:06:20
NVIDIA offers GPUDirect to reduce memory transfer overheads. I'm wondering if there is a similar concept for AMD/ATI? Specifically: 1) Do AMD GPUs avoid the second memory transfer when interfacing with network cards, as described here . In case the graphic is lost at some point, here is a description of the impact of GPUDirect on getting data from a GPU on one machine to be transferred across a network interface: With GPUDirect, GPU memory goes to Host memory then straight to the network interface card. Without GPUDirect, GPU memory goes to Host memory in one address space, then the CPU has to

前端模块化入门

允我心安 提交于 2019-11-30 06:27:47
1,了解到前端模块化:从《编写可维护的JavaScript-3》书籍中了解到模块化的概念和AMD模块的冻冻,但是不理解。 2,参考:https://blog.csdn.net/qq_35697034/article/details/78297756总算明白什么是ADM模块的概念: 一提到模块化,常说到CommonJS和AMD。这俩主要是个什么东西呢,记住是模块化的标准规范即可。而RequireJS就是AMD规范的最好实现。就像ECMAScript和JavaScript的关系是,前者是后者的规格,后者是前者的一种实现。我们只需要知道,实现CommonJS规范的API是同步加载模块的,而实现AMD规范的API是则是异步加载模块,异步加载即非阻塞加载,更加适合浏览器端。官方文档对RequireJS的描述: RequireJS 是一个JavaScript模块加载器。它非常适合在浏览器中使用,但它也可以用在其他脚本环境, 就像 Rhino and Node.使用RequireJS加载模块化脚本将提高代码的加载速度和质量。 3,做了个样例:参考:https://www.jb51.net/article/119496.htm,但是没有运行成功。 4,不打算进行模块化编程,因为还没有意识到使用的必要。先使用单全局变量的方式。 来源: https://www.cnblogs.com/lirenhe

TypeScript: compiling removes unreferenced imports

陌路散爱 提交于 2019-11-30 04:15:48
In our project we're using RequireJS as our module loader. Some of our modules will influence global libraries, and hence won't be directly used within the module they are referenced in. Example: define(['definitely/goingto/usethis/','just/referencingthis/forpackaging'], function(useThis) { useThis.likeIPromised(); // the following call can only be made when the second required file is available someGlobalAvailableVariable.someMethod(); }); This works as expected when writing my modules in JavaScript. However, we're translating our project step by step to TypeScript. Given the example above,

requireJS学习笔记

一曲冷凌霜 提交于 2019-11-30 00:54:50
一、为什么要使用require.js? 1、在大型项目中,往往一个页面需要加载很多个js文件,而页面加载的时候,浏览器会停止网页渲染,因此加载文件越多,导致网页失去响应的时间就会越长; 2、其次,由于js文件之间存在依赖关系,因此必须严格保证加载顺序(比如上例的1.js要在2.js的前面),依赖性最大的模块一定要放到最后加载,当依赖关系很复杂的时候,代码的编写和维护都会变得困难。 所以,在开发大型Javascript应用程序的时候,就必须引入模块化机制。关于前端模块化的前世今生,可以参考此博客: https://www.cnblogs.com/scq000/p/10647128.html 二、require.js能干什么? 1、 RequireJS 是遵循AMD规范的模块化工具, 在导入模块的时候,会先加载对应的依赖模块,然后再执行接下来的代码,同时AMD模块可以并行加载所有依赖模块,从而很好地提高页面加载性能: 2、管理模块之间的依赖性,便于代码的编写和维护。 RequireJS的基本思想是,通过define方法,将代码定义为模块;通过require方法,实现代码的模块加载。 三、require.js的加载: <script src="js/require.js"></script> 引用js的过程,为了避免网页失去响应,我们可以将代码卸载网页底部进行加载,也可以采用异步加载

电脑主板分类

半世苍凉 提交于 2019-11-29 21:43:27
一、芯片组   主板芯片组主要有两大阵营Intel和AMD,Intel和AMD处理器所用的主板是不同的,因此在购买时,一定要根据处理器来选择主板,他们的判别方法很简单,通过外观就行,Intel主板CPU插槽有金属阵脚,而AMD主板则是一堆小孔。 1,Intel   Intel主板芯片组有四个等级,X/Z/B/H。    X字母开头:最高级,用来搭配高端CPU,一般CPU型号后缀有“X”字母。比如X299主板,那么就可以搭配i9-7960X或者i7-7800X。    Z字母开头:次高端,Z字母开头的主板都支持超频,搭配的CPU一般带有“K”字母后缀,比如Z370主板,就能搭配i5-8600K或者i7-8700K。    B字母开头:中端主流,这种主板不支持超频,B开头的主板性价比最高,主要搭配不带K字母后缀的CPU,比如B360,就能使用i3-8100、i5-8500、i7-8700。    H字母开头:入门级,不支持超频,价格非常便宜,当然,H字母开头不代表都是低端产品,比如H310和H370,第二个数字越高,规格就越高,H370就相当于不能超频的Z370主板。 2,AMD   AMD主板芯片组有三个等级,X/B/A。    X字母开头:最高级,支持自适应动态扩频超频,和Intel一样,也是搭配AMD中代“X”字母后缀的处理器。    B字母开头:中端主流,可以超频

How much speed is gained with RequireJS/AMD in JS? [closed]

血红的双手。 提交于 2019-11-29 20:27:46
How much faster is requireJS actually, on a large website? Has anyone done any tests on the speed of large websites that use asynchronous loading vs not? For instance, using Backbone with a lot of views (> 100), is it better to simply have a views object that gets loaded with all the views at once and is then always available, or should they all be loaded asynchronously as needed? Also, are there any differences for these considerations for mobile vs desktop? I've heard that you want to limit the number of requests on mobile instead of the size. I don't believe that the intent of require.js is

Why do we need a Single Page Application? [closed]

余生颓废 提交于 2019-11-29 19:05:53
The Single Page Application (SPA) has come to us. A lot of new things come with it as well, like Routing, Page life cycle at client side, MVC pattern, MVVM pattern, MV* pattern,... and some of Javascript patterns also come to us like AMD pattern , Singleton , Facade ,.. A lot of SPA frameworks and libraries also were developed. We can find out some of its on the internet. They are AngularJs , Reactjs , BackboneJs , DurandalJs ,.. and a lot of third party components to make the Javascript coding more easy like RequireJs , Amplifyjs , BreezeJs ... But I just think why do we need the SPA? Because

How to refer to Typescript enum in d.ts file, when using AMD?

不羁的心 提交于 2019-11-29 18:03:09
问题 I want to define a typescript interface to represent, say, an error. Something like this: enum MessageLevel { Unknown, Fatal, Critical, Error, Warning, Info, Debug } interface IMyMessage { name: string; level: MessageLevel; message: string; } This works fine as far as it goes. However, now (perhaps) I want to declare that interface in a .d.ts file so others can use it for typing. But I don't want to define the enum in the .d.ts file, since that would be implementation and not simple typing

图拉丁装机

时光毁灭记忆、已成空白 提交于 2019-11-29 16:53:30
一、CPU 生产CPU的厂家,主要有英特尔和AMD。 1、英特尔CPU 酷睿:面向普通消费级用户 至强:面向企业级用户,一般用于组件服务器 凌动:移动设备、高能效小服务器 酷睿CPU等级:i3、i5、i7、i9、酷睿x 2、AMD CPU 锐龙:面向普通消费级用户 CPU等级:r3、r5、r7、r9、线程撕裂者 3、CPU型号 4、Mac查看CPU型号 sysctl machdep.cpu.brand_string machdep.cpu.brand_string: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz 5、CPU参数 几个重要参数:插槽类型、架构、核心数、频率、热功耗设计 插槽类型决定CPU可以插在哪个主板上。 架构 - 核心代号,越先进,工作效率越高。 架构 - 制作工艺,越小越好,晶体管越小,CPU内可放入的晶体管就越多。14nm的制作工艺要比32nm的先进。 核心数越多,运算速度越快。一般来说,1个核心只有一个线程,如果使用超线程技术,1个核心可以有2个线程。 频率 - 基础频率,也叫主频,是CPU在正常工作时的频率,频率越高越好。 频率 - 睿频频率,是CPU在超负荷执行任务时的频率,频率越高越好。 二、主板 主板的一线品牌:华硕、技嘉、微星、华擎。 主版的版型:超大主板、大主板、小主板、mini主板