小编Jay*_*odi的帖子

从谷歌加上获取个人资料图片

我使用django应用程序的谷歌应用程序引擎.我一直在使用谷歌的用户api登录我的网站,并从中获取当前的用户电子邮件地址,但我必须获得在Google Plus帐户上发布的个人资料图片.

我正在使用他们的个人资料照片,

<img src="https://plus.google.com/s2/photos/profile/<user_id>?sz=100" width="100" height="100">
Run Code Online (Sandbox Code Playgroud)

在谷歌api.

用户类也提供user_id但我无法使用它获取他们的个人资料图片user_id.

用户类的<user_id>和user_id Google API是不同的.

如何在我的应用程序中获取个人资料图片?

django google-app-engine google-profiles-api

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

如何使用增量备份

我在远程服务器上有一个mysql数据库,偶尔会更新一次,我通常做的是将它传输到我的语言环境机器

mysql -u root -padmin databasename > backup.sql
Run Code Online (Sandbox Code Playgroud)

然后在我本地机器的工作台上,我只删除旧数据库并导入这个新数据库.

我通常这样做是因为每月更新一次.所以我没有被打扰.但是现在数据已经变得非常大了,我再也买不起了.我只是觉得有一个更好的方法,所以我看了增量备份,但我不太明白.在我的情况下,我将如何使用增量备份?那么在远程服务器中我只备份远程数据库中的最新更改然后导入到我的本地数据库?

mysql

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

Thread.Sleep()Android UI

我正在研究Android的记忆游戏,我遇到了问题.当用户点击第二张图像时 - 如果图像不相同,我希望第二张图像显示1,2秒.

我试过的是睡1-2秒.激活第二个图像后的UI线程 - 但这似乎不起作用 - 第二个图像似乎没有显示!(仅显示第一张图片)

这是我的代码:

public void whenTapedImage(View v, int position)
{
    i++;
    ImageView imgV=(ImageView)v;
    if(i%2!=0)
    {
        firstClick=position;
        imgV.setImageResource(im.images.get(firstClick));           
    }
    else
    {   
        secondClick=position;
        imgV.setImageResource(im.images.get(secondClick));                      
        try {
            Thread.currentThread().sleep(1000);
            if(!(im.images.get(firstClick).equals(im.images.get(secondClick))))
            {
                Toast.makeText(easyGame.this, "Try Again!", Toast.LENGTH_SHORT).show();
                im.notifyDataSetChanged();
                gridview.setAdapter(im);
                gridview.invalidate();
                aux=player1Turn;
                player1Turn=player2Turn;
                player2Turn=aux;
            }
            else{
                done=done+2;
                ImageAdapter.keepVisibleViews.add(firstClick);
                ImageAdapter.keepVisibleViews.add(secondClick);
                if(player1Turn==true)
                {
                    player1Score++;
                    String score=Integer.toString(player1Score);
                    score1.setText(score);
                }
                if(player2Turn==true)
                {
                    player2Score++;
                    String score=Integer.toString(player2Score);
                    score2.setText(score);
                }
            }   
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }   
    }           
}
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

user-interface multithreading android

2
推荐指数
2
解决办法
2万
查看次数