我是新手写Alexa的技能,想写一个技巧来存储说话者的话.
例如,如果我说'Alexa,保存{无论我说什么}',它应该保存一些字符串中的单词.
根据我的理解,意图模式应该是这样的
{
intents:[
"intent" : "SaveIntent"
]
}
Run Code Online (Sandbox Code Playgroud)
和话语一样
SaveIntent save
SaveIntent store
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我如何存储'{无论我说什么}'?
我正在使用Resource Manger API在Azure中创建Application Insight资源.步骤如下:
然后我在美国东部的位置创建了Insights组件,该组件失败了.以下错误.但是,如果我在美国中部位置创建组件(与包含资源组的位置不同),则成功.
"error": {
"code": "MissingRegistrationForLocation",
"message": "The subscription is not registered for the resource type 'components' in the location 'southcentralus'. Please re-register for this provider in order to have access to this location."
}
Run Code Online (Sandbox Code Playgroud)我必须/1/dir/{imgID}使用变量来调用api:多次(平均50次)imgID.
在node.js中,我可以使用Async.js库.我可以在Angular端使用这个库吗?如果是,那么请告诉我一些可能性如何,如果没有,那么给我一些替代的想法,以便我可以在AngularJS中使用它?
我已经配置了gradle build来使用我们公司的nexus repo,但maven似乎无法正确授权 - 我不断获得如erros
Failed to get resource: HEAD. [HTTP HTTP/1.1 401 Authorization Required: https://maven.gooddata.com/nexus/content/repositories/gooddata/org/codehaus/groovy/groovy-all/2.0.4/groovy-all-2.0.4.pom]
Run Code Online (Sandbox Code Playgroud)
奇怪的是,部署到相同的nexus repo(通过mavenDeployer)可以无缝地工作.
以下是与maven repo配置相关的构建脚本的一部分(maven_user和maven_password在〜/ .gradle/gradle.properties中定义).
apply plugin: 'maven'
ext {
repos = [
my : "<my_repo_url>",
my_snapshot : "<my_snapshots_repo_url>"
]
}
repositories {
mavenLocal()
maven {
url repos.my
credentials {
username = maven_user
password = maven_password
}
}
maven {
url repos.my_snapshot
credentials {
userName = maven_user
password = maven_password
}
}
mavenCentral()
maven { url "http://repository.codehaus.org/" }
maven { url "http://sardine.googlecode.com/svn/maven" }
maven …Run Code Online (Sandbox Code Playgroud) 我正在玩html5新规格,恰好是网络摄像头的功能.
按照本教程.我收到以下错误:
Native web camera streaming (getUserMedia) is not supported in this browser.
Run Code Online (Sandbox Code Playgroud)
这个if语句采用了以下内容:
if (navigator.getUserMedia)
Run Code Online (Sandbox Code Playgroud)
现在,我确信在我的浏览器中启用了navigator.getUserMedia,因为这些示例在这里完美运行
所以,我修改了if中的代码,具有以下内容:
if (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia)
Run Code Online (Sandbox Code Playgroud)
但现在,我收到一个javascript错误:
Uncaught TypeError: Object #<Navigator> has no method 'getUserMedia'
Run Code Online (Sandbox Code Playgroud)
在这一行:
navigator.getUserMedia('video', successCallback, errorCallback);
Run Code Online (Sandbox Code Playgroud)
这真的没有意义!它正在我发布的最后一个链接上工作!
有任何想法吗?
提前致谢.
测试该函数的正确方法是什么,不返回或返回NaN.考虑:
require('assert');
var functionUnderTest = function() {
return NaN;
}
// mocha test for above function
describe('Function returning NaN', function() {
it('shall return NaN', function() {
assert.equal(functionUnderTest(), NaN); // AssertionError: NaN == NaN
assert.notEqual(functionUnderTest(), NaN); // No AssertionError
});
});Run Code Online (Sandbox Code Playgroud)
我特别想测试该函数不返回NaN.我知道IEEE754指定类型NaN ==="数字"并且它不等于它自己(或任何其他数字)并且Javascript实现了浮点数,就像IEEE754定义它们一样.
但是如何测试该函数会返回还是不返回NaN?
我的app.js文件中有这个简单的代码:
(function(){
var app = angular.module('searchHotels', []);
app.controller = ("PlaceController", function(){
this.place = shop;
});
var shop = {
name: 'supermarket',
distance: 100
};
})();
Run Code Online (Sandbox Code Playgroud)
这是index.html文件的代码:
<!doctype.html>
<html ng-app="searchHotels">
<head>
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
<div ng-controller="PlaceController as placeC">
<h3> {{placeC.place.name}} </h3>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在输出中,我的{{placC.place.name}}表达式不会被它要显示的数据所取代.它只输出" {{placeC.place.name}} "本身.我在这里错过了什么?谢谢!
javascript ×3
angularjs ×2
alexa-skill ×1
amazon ×1
asynchronous ×1
azure ×1
gradle ×1
html5 ×1
maven ×1
unit-testing ×1