amd

How to disable AMD on 4 files and load them in order with webpack

删除回忆录丶 提交于 2019-12-25 09:01:58
问题 I need to disable AMD on 4 files and load video.js first before loading the other 3 files, because they depend on it. When I tried doing it in webpack.config.js like so: const path = require('path') const webpack = require('webpack') module.exports = { entry: './src/main.js', output: { path: __dirname + '/public', filename: 'bundle.js' }, devServer: { inline: true, contentBase: './src', port: 3333 }, plugins: [ new webpack.DefinePlugin({ 'process.env': { 'NODE_ENV': JSON.stringify('production

How to include legacy module in Dojo AMD

天大地大妈咪最大 提交于 2019-12-24 15:24:56
问题 I'm trying to migrate an application from dojo 1.6 to version 1.9.1, and I've a legacy module that I didn't want to migrate yet (it's pretty complex and will take me some time to understand). The Dojo docs indicate you can load legacy modules along with AMD modules, but when I try, I'm getting a "dojo.provide is not a function" when the loader tries to load the legacy module. My script: require([..., "agsjs/dijit/TOC","dojo/domReady!"], function(..., TOC) { on(map,'layers-add-result',function

Uncaught TypeError: Cannot set property '[any AMD]' of undefined

ε祈祈猫儿з 提交于 2019-12-24 09:33:55
问题 Example scrollmagic module, but it happens with others too. I suspect it is for Babel but not sure. How can we reproduce this bug? Git clone https://github.com/zurb/foundation-zurb-template projectname Install: npm install gsap --save-dev bower install scrollmagic --save-dev Add text line config.yml: "node_modules/gsap/src/uncompressed/TweenMax.js" "bower_components/scrollmagic/scrollmagic/uncompressed/ScrollMagic.js" "bower_components/scrollmagic/scrollmagic/uncompressed/plugins/animation

Why did Meltdown and Spectre bugs go undiscovered for so long?

我的未来我决定 提交于 2019-12-24 08:38:46
问题 Why did Meltdown and Spectre bugs go undiscovered for so long? Nearly 20 years these bugs have been present in the CPU's why wasn't this discovered sooner given the serious implications for all computers using these processors? 回答1: The answer is quite simple: modern CPUs have few billions transistors. For example, the latest Intel Skylake architecture has ~2 billion. Each transistor might have a state which influence the state of other transistors (i.e. those transistors are connected

Updating Dojo provide

ε祈祈猫儿з 提交于 2019-12-24 02:06:11
问题 I am using Dojo 1.9 for a project, but I don't understand the correct alternative of dojo.provide in the AMD style as compared to the legacy style. I was reading this documentation page. So apparanently this is how the old syntax maps to the new one: OLD dojo.provide("acme.Dialog"); dojo.require("dijit._Widget"); dojo.require("dojo.date"); CODE HERE NEW define(["dijit/_Widget", "dojo/date"], function(_Widget, date){ .... CODE HERE return MyWidget; }); I am not sure what exactly am I returning

Pulling in sinon submodules in browser with AMD and webpack

假装没事ソ 提交于 2019-12-24 00:38:41
问题 I'm running into the same problem described in this question. Basically sinon only pulls in all required submodules if you're using node. If you try to use it in the browser with AMD (I'm using webpack) apparently you have to manually include lib/spy.js . I have a webpack module that currently exports sinon: exports.sinon = require('sinon'); How would I modify that to roll in spy.js ? I think this is more of a CommonJS syntax question than anything. 回答1: The following seems to work: exports

JS3 -- 模块(cmd amd)

浪尽此生 提交于 2019-12-23 21:23:34
Amd和Cmd的代表分别是require.js以及sea.js AMD (amd 提前读取并加载(前置读取并加载)) 是 RequireJS 在推广过程中对模块定义的规范化产出。https://github.com/amdjs/amdjs-api/wiki/AMD CMD (cmd 提前读取后加载) 是 SeaJS 在推广过程中对模块定义的规范化产出。https://github.com/seajs/seajs/issues/242 (NodeJS是CommonJS规范的实现,webpack 也是以CommonJS的形式来书写。) 1.cmd 提前读取后加载,而是在需要时加载 “懒加载”==as lazy as possible 2.一个模块就是一个文件(崇尚简单) 参考: js模块化编程之彻底弄懂CommonJS和AMD/CMD! 【面试系列】之一:关于Cmd和Amd AMD 和 CMD 的区别有哪些? SeaJS与RequireJS最大的区别 原生js window 好像没有define方法,这应该是SeaJS框架里的 你要用首先要导入SeaJS包 以妓会友,评赞走起 来源: https://www.cnblogs.com/lgyong/p/8586283.html

Dojo custom build getting browser errors due to missing resources

佐手、 提交于 2019-12-23 19:27:54
问题 I've been struggling with learning the AMD based Dojo build system. So far I haven't been able to get a build that is usable without getting load errors in the browser (FF). I have questions about how to manage the build. My build profile file has a packages section. What I specify there seems to directly correlate to those same package directories being written into the destination directory. This seems appropriate. However, I also have a layers section that is trying to merge just the

How to run Python on AMD GPU?

混江龙づ霸主 提交于 2019-12-22 13:53:05
问题 We are currently trying to optimize a system in which there are at least 12 variables. Total comibination of these variable is over 1 billion. This is not deep learning or machine learning or Tensorflow or whatsoever but arbitrary calculation on time series data. We have implemented our code in Python and successfully run it on CPU. We also tried multiprocessing which also works well but we need faster computation since calculation takes weeks. We have a GPU system consisting of 6 AMD GPUs.

Importing TypeScript Module located in path lower than current path throws Scope Error

こ雲淡風輕ζ 提交于 2019-12-22 07:36:29
问题 In an attempt to put together an AMD-friendly TypeScript application skeleton, I've run into a snag: I can't seem to drop down from my current path to import a module in another directory. I can import modules that are above, but below throws an error: TypeScript Error: The name ''../core/View'' does not exist in the current scope Here the is the structure of my (very basic) app: app/ - core/ - View.ts - views/ - HomeView.ts - Application.ts In my Application.ts file, I can successfully