如何显示数组的变量?
码:
console.log(rooms);
for (var i in rooms) {
console.log(i);
}
Run Code Online (Sandbox Code Playgroud)
输出:
{ rooms:
[ { room: 'Raum 1', persons: 1 },
{ room: 'R2', persons: 2 },
{ room: 'R3', persons: 3 } ] }
rooms
Run Code Online (Sandbox Code Playgroud) 我想使用Bluemix Conversation 示例应用程序
并向其添加语音输入和输出.Bluemix TTS和STT还有其他示例应用程序可用.有哪些选项可以集成这三个功能,哪些是推荐给初学者的?
text-to-speech speech-to-text ibm-watson watson-conversation ibm-cloud
我需要 Accel 对象作为有效负载对象的一部分:
如何将 Accel 和 x,z,y 添加到有效负载(最好使用更改节点)?
我已经尝试过这个:
msg.payload.Accel['x'] = 1;
return msg;
Run Code Online (Sandbox Code Playgroud)
并得到一个错误:
"TypeError: Cannot set property 'x' of undefined"
Run Code Online (Sandbox Code Playgroud) 我有一个定义5个服务的docker-compose.yaml文件:
跑步了
docker-compose -f docker-compose.yaml up -d
Run Code Online (Sandbox Code Playgroud)
命令结果:
Creating network "hlf_byfn" with the default driver
Creating peer1.org1.example.com ...
Creating peer0.org2.example.com ...
Creating peer1.org2.example.com ...
Creating orderer.example.com ...
Creating peer0.org1.example.com ...
Creating peer0.org2.example.com
Creating peer1.org1.example.com
Creating peer1.org2.example.com
Creating orderer.example.com
Creating orderer.example.com ... error
ERROR: for orderer.example.com Cannot create container for service orderer.example.com: Conflict. The container name "/orderer.example.com" is already in use by container "d6621116cf0d1ab108277893178ba29aCreating peer0.org1.example.com ... error
ERROR: for peer0.org1.example.com Cannot create container for service peer0.org1.example.com: …Run Code Online (Sandbox Code Playgroud) 我在Node.js中使用startsWith遇到错误
脚本sw.js
//startswith
var str = 'Sein oder nicht sein, dass ist hier die Frage'; console.log(str.startsWith('Sein oder'));
// true
console.log(str.startsWith('nicht sein'));
// false
console.log(str.startsWith('nicht sein', 10));
// true
Run Code Online (Sandbox Code Playgroud)
脚本输出:
/Users/.../sw.js:2
= 'Sein oder nicht sein, dass ist hier die Frage'; console.log(str.startsWith
^
TypeError: undefined is not a function
at Object.<anonymous> (/Users/.../sw.js:2:76)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Run Code Online (Sandbox Code Playgroud)
节点版本(不确定是否相关)
node -v
v0.12.8
Run Code Online (Sandbox Code Playgroud) 说明:https : //github.com/watson-developer-cloud/ios-sdk
错误:
*** Skipped downloading ios-sdk.framework binary due to the error:
"Bad credentials"
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
Run Code Online (Sandbox Code Playgroud)