amd

Are Asynchronous Modules Always Asynchronous?

泪湿孤枕 提交于 2019-12-11 14:29:35
问题 When multiple JavaScript modules are define()'d using AMD and concatenated into a single file, are those modules still considered asynchronous? 回答1: Yes, they are still considered async. While the module itself doesn't have to be loaded from disk, the modules do need to be executed and there is a call back made. Because you can combine SOME modules into a single file doesn't mean you have to combine all -- nor does RequireJS assume all there. It will run what it can from your preload and

How to know which Dojo AMD require clause with no name?

烂漫一生 提交于 2019-12-11 14:16:13
问题 I have a question on Dojo declaration. I noticed in the AMD declaration for required library for dojo that some library does not have declared name in the funciton parameter. How do you know which one has no parameter? For example: For selector query, I saw an example which does not give name for dojo/NodeList-dom and dojo ready. require(["dojo/query", "dojo/dom-class", "dojo/on", "dojo/NodeList-dom", "dojo/domReady!"], function(query, domClass, on) { Is it just optional to give them names?

mismatched anonymous define() module typescript with AMD and export module

痴心易碎 提交于 2019-12-11 12:52:39
问题 I am trying to create an application using Typescript(1.7.5) and AMD module. I have added reference to r.js and requirejs.js. below is my TS code: export module TestNs { export class TestClass { public fn(): void{ debugger; } } } here is my aspx page to call "fn()": <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TypeScriptPage.aspx.cs" Inherits="WebApplication1.TypeScriptPage" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <

How to include 3rd party scripts with requirejs

倖福魔咒の 提交于 2019-12-11 10:55:12
问题 I'm trying out AMD-way of handling scipts and my choise fell upon requirejs. In this project I use MDL (front-end framework; for those who haven't heard of it think of it as bootstrap 3) which should be included as: <link rel="stylesheet" href="/bower_components/material-design-lite/material.min.css"> <script src="/bower_components/material-design-lite/material.min.js"></script> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> I am not interested in js

Wait for async completion before returning

£可爱£侵袭症+ 提交于 2019-12-11 09:20:13
问题 This code returns a config object, and eventually populates it with knockout observables. define("config", [], function () { var config = {}; $.ajax({ url: "api/Config", success: function (result) { for (pname in result) config[pname] = ko.observable(result[pname]); }, }); return config; }); It works in terms of populating the config object with settings, but it doesn't finish until after one of my views has applied bindings, and this causes problems at runtime. How would you set this up to

What are the requirements for using `shfl` operations on AMD GPU using HIP C++?

不羁的心 提交于 2019-12-11 07:23:55
问题 There is AMD HIP C++ which is very similar to CUDA C++. Also AMD created Hipify to convert CUDA C++ to HIP C++ (Portable C++ Code) which can be executed on both nVidia GPU and AMD GPU: https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP There are requirements to use shfl operations on nVidia GPU: https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/tree/master/samples/2_Cookbook/4_shfl#requirement-for-nvidia requirement for nvidia please make sure you have a 3.0 or higher compute

Using moment.js with typescript and “module”: “amd”

北城余情 提交于 2019-12-11 06:25:28
问题 I'm trying to use moment.js from typescript 2.1.5 I installed moment with npm : npm install moment --save-dev The d.ts file is included with moment.js so no install via @typings is required but when I compile my project I get the following error : error TS2307: Cannot find module 'moment'. Here is a simple test I made to repro the issue. repro.ts file import * as moment from "moment"; const date = moment().format("YYYY"); console.log(date); tsconfig.json file : { "compilerOptions": { "module"

Optimize/build modules under parallel directories using the same config file in RequireJS

ⅰ亾dé卋堺 提交于 2019-12-11 03:02:06
问题 I have a feeling that the title just might not be explanatory :) Setup Suppose that I have the following structure: where app.js files are main bootstrapping/entry modules for the applications that look like this: app01 require.config({}); require([ 'app/component1.js' ], function(component){ // do something with component1 }); app02 require.config({}); require([ 'app/component2.js' ], function(component){ // do something with component2 }); which both work with appropriate index.html files.

RequireJS - How to configure Underscore before it's loaded by Backbone?

戏子无情 提交于 2019-12-11 00:02:48
问题 I'd like to know how to load Underscore and Backbone using RequireJS and be able to configure Underscore before it's passed to Backbone. I've seen this popular question on StackOverflow about this similar topic, but I haven't been able to figure out how to get Underscore to be configured for both of the following situations: Underscore is required by itself Underscore is loaded by Backbone So my question is the following: How can I configure Underscore using RequireJS when required by itself,

What level of the cache does PREFETCHT2 fetch into?

旧街凉风 提交于 2019-12-10 23:32:35
问题 The documnation for PREFETCHT2, which is prefetch with T2 hint, says (emphasis mine): T0 (temporal data)—prefetch data into all levels of the cache hierarchy. T1 (temporal data with respect to first level cache misses)—prefetch data into level 2 cache and higher. T2 (temporal data with respect to second level cache misses)—prefetch data into level 3 cache and higher, or an implementation-specific choice. NTA (non-temporal data with respect to all cache levels)—prefetch data into non-temporal