小编Ale*_*lex的帖子

对所有与会者使用Say动词

我正在建立一个非常简单的电话会议系统,用户输入PIN并连接到与之相关的会议.我也正在设置它,所以他们在进入房间之前记录他们的名字.

我的计划是获取录制URL,然后获取参与者列表并对每个呼叫者进行REST API调用,将其调用修改为Say"Now enter",然后播放录制URL.我想我不得不把它们送回房间,我不确定.

我认为修改每个电话会将他们带出会议室,这并不理想.是否有更简单的方法将Say/Play用于REST API内置的会议的所有成员?

twilio

7
推荐指数
1
解决办法
2618
查看次数

无法通过WWW加载电影

我正在尝试通过网址加载视频,但我仍然遇到同样的错误.我正在使用Unity 5.3和http://docs.unity3d.com/ScriptReference/WWW-movie.html中的示例代码(由于当前示例未编译,因此进行了大量修改).

using UnityEngine;
using System.Collections;

// Make sure we have gui texture and audio source
[RequireComponent (typeof(GUITexture))]
[RequireComponent (typeof(AudioSource))]
public class TestMovie : MonoBehaviour {

    string url = "http://www.unity3d.com/webplayers/Movie/sample.ogg";
    WWW www;

    void Start () {
        // Start download
        www = new WWW(url);

        StartCoroutine(PlayMovie());
    }

    IEnumerator PlayMovie(){
        MovieTexture movieTexture = www.movie;

        // Make sure the movie is ready to start before we start playing
        while (!movieTexture.isReadyToPlay){
            yield return 0;
        }

        GUITexture gt = gameObject.GetComponent<GUITexture>();

        // Initialize gui texture …
Run Code Online (Sandbox Code Playgroud)

unity-game-engine fmod

7
推荐指数
1
解决办法
4594
查看次数

数据库/集合任意但具体的顺序

我想创建一个具有特定顺序的数据库(我正在使用mongodb)集合,该集合也可以重新排列.例如,如果我有

[A,B,C,D,E]
Run Code Online (Sandbox Code Playgroud)

我可以将E移到第三个位置,顺序就是

[A,B,E,C,D]
Run Code Online (Sandbox Code Playgroud)

我想尽可能少地更改对象,因此在每个对象上放置一个索引将不起作用(因为我需要更改所有后续元素的索引以进行简单的移动).

我还可以像链接列表一样创建对象,因此每个对象都具有前一个和下一个对象的id.示例更改将如下所示.

["A":{prev:null, next:"B"},
"B":{prev:"A", next:"C"},
"C":{prev:"B", next:"D"},
"D":{prev:"C", next:"E"},
"E":{prev:"D", next:null}]
Run Code Online (Sandbox Code Playgroud)

会变成

["A":{prev:null, next:"B"},
"B":{prev:"A", next:"E"},
"C":{prev:"E", next:"D"},
"D":{prev:"C", next:null},
"E":{prev:"B", next:"C"}]
Run Code Online (Sandbox Code Playgroud)

对于任何大小的集合,这最多可以更改5个对象.更改可以表示为一个更新的对象,并使用一些逻辑来确定需要更新的其他对象.这是可行的,但我想知道是否有比这更好的方法.有没有更简单的方法来跟踪任意列表的顺序?

database collections mongodb

5
推荐指数
1
解决办法
871
查看次数

来自多个身份提供商的Node.js Passport SAML

我已经将Passport-SAML实施到我的网站中,现在我的任务是将我们的网站与另外两个身份提供商连接起来.在我的代码中,它似乎只使用SamlStrategy的最新定义.如何设置Passport以允许同一策略的多个不同实现?

我的实现看起来像这样:

passport.use(new SamlStrategy(
    {
        path: '/saml',
        entryPoint: "https://idp.identityprovider.net/idp/profile/SAML2/Redirect/SSO",
        issuer: 'https://www.serviceprovider.com/saml',
        identifierFormat: 'urn:domain:safemls:nameid-format:loginid'
    },
    function(profile, done) {
        console.log("SamlStrategy done", profile)
        User.findOne({email:profile.Email}, function(err, user) {
            if (err) {
                return done(err);
            }
            if(!user) return done(null, false, {message: 'No account associated with this email.'})
            return done(null, user);
        });
    }
));
Run Code Online (Sandbox Code Playgroud)

node.js saml-2.0 passport.js

4
推荐指数
1
解决办法
4222
查看次数

Cocos2d-iphone - Sphero集成

我正在尝试将Sphero连接到我正在构建的Cocos2d游戏中.Sphero有一些很好的文档和示例,我可以运行示例代码.我从一个cocos2d项目开始,并添加了Sphero框架.我无法得到球的基本命令.我相信问题在于这个功能:

-(void)setupRobotConnection 
{
    /*Try to connect to the robot*/
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleRobotOnline) name:RKDeviceConnectionOnlineNotification object:nil];

    if ([[RKRobotProvider sharedRobotProvider] isRobotUnderControl]) 
         [[RKRobotProvider sharedRobotProvider] openRobotConnection];        

}
Run Code Online (Sandbox Code Playgroud)

(其余代码在链接处)我相信它与NSNotificationCenter有关.我从CCLayerColor调用此代码,而不是像演示那样调用UIViewController.我收到此错误:

2012-08-25 01:54:19.738 bgmmo[1414:2d07] ERROR - opening session failed as protocol com.orbotix.robotprotocol is not declared in Info.plist
Run Code Online (Sandbox Code Playgroud)

(这在Sphero IOS论坛中得到了回答)

objective-c uiviewcontroller cocos2d-iphone ios sphero-api

3
推荐指数
1
解决办法
633
查看次数

Android - Sphero - CalledFromWrongThreadException

我正在制作一款使用Sphero机器人球的游戏.当游戏启动/恢复时,它会检查配对或连接的球.如果蓝牙关闭,或者没有球配对,它会隐藏连接窗口.如果有球配对但未连接,则进入此功能.

// If the user clicked a Sphero and it failed to connect, this event will be fired
@Override
public void onRobotConnectionFailed(Robot robot) {
    Log.d("activity", "onRobotConnectionFailed");
    removeConnectionView();
}
Run Code Online (Sandbox Code Playgroud)

它在以下方法中崩溃.

private void removeConnectionView() {
    mFrameLayout.removeView(mSpheroConnectionView);
    mSpheroConnectionView = null;
}
Run Code Online (Sandbox Code Playgroud)

此功能适用于其他可能的结果.这是错误.

Thread [<14> Thread-2606] (Suspended (exception ViewRootImpl$CalledFromWrongThreadException))   
<VM does not provide monitor information>   
ViewRootImpl.checkThread() line: 5031   
ViewRootImpl.invalidateChildInParent(int[], Rect) line: 998 
FrameLayout(ViewGroup).invalidateChild(View, Rect) line: 4358   
ImageView(View).invalidate(boolean) line: 10565 
ImageView(View).invalidate() line: 10520    
ImageView.invalidateDrawable(Drawable) line: 202    
XDrawable(Drawable).invalidateSelf() line: 382  
XDrawable(Drawable).setVisible(boolean, boolean) line: 578  
ImageView.onDetachedFromWindow() line: …
Run Code Online (Sandbox Code Playgroud)

android sphero-api

1
推荐指数
1
解决办法
327
查看次数