问题列表 - 第39104页

我无法访问某些GData Contacts属性,例如性别

这是代码:

def fetch_feed(self):
        client = gdata.contacts.service.ContactsService()
        client.ClientLogin(username, password) #Will change to AuthSub later.
        query = gdata.contacts.service.ContactsQuery()
        query.max_results = 3000
        feed = client.GetContactsFeed(query.ToUri())
        memcache.set('feed',feed, 3600)
        return feed

feed = self.fetch_feed()
self.PrintFeed(feed)

def PrintFeed(self, feed):
        for entry in feed.entry:
            print entry.* #example... i can access properties such as entry.title, entry.id, entry.updated, but can't access a whole lot more.
Run Code Online (Sandbox Code Playgroud)

我做错了什么,或者我根本不做什么?我在Apps API论坛上发布了相同的问题,只是为了澄清事情.

编辑 这是我正在导入的内容:

from google.appengine.api import memcache, users
from google.appengine.ext import db, webapp
from google.appengine.ext.webapp import util
import atom
import atom.url
import datetime …
Run Code Online (Sandbox Code Playgroud)

python google-app-engine gdata-api google-contacts-api

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

类连续数据

我有一个C++类,它有四个私有浮点数和一堆非静态公共函数来操作这些数据.

是保证,还是可能的,四个花车是连续的,没有填充.这将使类成为四个浮点数的大小,并且它的地址将是第一个浮点数的地址.

c++ class

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

强名称密钥密码存储在哪里?

我通常不打算签署我的.NET程序集,所以除了它的基本机制之外我不太了解.对于我正在进行的小项目,有必要签名,我创建了一个用密码保护的新密钥.

我希望在重新编译程序集的某个时间点提示输入此密码,但在创建密钥文件后,我从未需要在任何地方输入密码.这似乎首先打破了密码保护密钥的目的.

我想密码是在某个地方缓存的,但在哪里?它是在某种私人存储?如果我给其他人我的整个解决方案目录中包含密钥文件,他们会被提示输入我输入的密码,还是他们能够在没有密码的情况下签署程序集?

互联网上有很多关于强名称密钥和使用它们的文章,但由于一些奇怪的原因,它们都掩盖了Visual Studio实际使用密码的方式.

更新: 重新启动Visual Studio(和Windows)无效,因此缓存似乎是持久的.删除.suo文件不会改变签名程序集不需要密码的事实.

.net visual-studio

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

在Windows登录上运行bat

当用户登录时,批处理需要执行Java程序.如何防止命令提示符显示在桌面上?

@echo off或cmd/C不起作用

java windows

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

将未知数量的字符串传递给java中的函数的最佳方法是什么?

我想将不同数量的字符串传递给java中的函数,它假设是过滤查询的字符串,它可能是2-4个字符串.

你认为最好的方法是什么?

a)使用不同数量的参数为相同的函数创建重载?b)创建一个字符串数组的新实例并将其传递给函数?

任何其他优先方式?

谢谢

java string

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

缩进Xcode中的连续行

我可以使用Xcode的自动缩进来缩进延续线吗?

我想要:

BOOL someLongVariableName = someLongValue
    | someOtherLongValue
    | moreLongValues

BOOL someOtherLongVariableName =
    someEvenLongerValue;

[someLongVariableName
    performSomeAction:someLongArgument]
Run Code Online (Sandbox Code Playgroud)

我目前得到:

BOOL someLongVariableName = someLongValue
| someOtherLongValue
| moreLongValues

BOOL someOtherLongVariableName =
someEvenLongerValue;

[someLongVariableName
 performSomeAction:someLongArgument]
Run Code Online (Sandbox Code Playgroud)

要明确:

  • 我使用显式换行而不是自动换行.
  • 我希望在编辑时和按下返回后立即缩进,而不是在运行外部程序(如uncrustify)之后.

xcode indentation

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

open("http://www.google.com")失败但wget有效

开放失败:

irb(main):001:0> require 'open-uri'
=> true
irb(main):002:0> open("http://www.google.com")
RuntimeError: Non-HTTP proxy URI: 
    from /usr/lib/ruby/1.8/open-uri.rb:203:in `open_http'
    from /usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'
    from /usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
    from /usr/lib/ruby/1.8/open-uri.rb:162:in `catch'
    from /usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
    from /usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
    from /usr/lib/ruby/1.8/open-uri.rb:518:in `open'
    from /usr/lib/ruby/1.8/open-uri.rb:30:in `open'
    from (irb):2
Run Code Online (Sandbox Code Playgroud)

但是,wget()有效......

root@pierr-desktop:/work/web/yy# wget www.google.com
--2010-11-14 20:00:39--  http://www.google.com/
Resolving www.google.com... 72.14.203.104, 72.14.203.99
Connecting to www.google.com|72.14.203.104|:80... connected.
HTTP request sent, awaiting response... 302 Found
......... 

2010-11-14 20:00:40 (47.7 KB/s) - `index.html' saved [9097]
Run Code Online (Sandbox Code Playgroud)

我是否必须设置代理但我不知道正确的代理信息..

ruby open-uri wget

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

导入登录的用户disqus注释

我已经为mysite和着名的disqus评论系统建立了一个openid登录系统.

如何集成这两者,即在disqus注释系统中检索登录的用户信息,防止用户在同一站点上输入两次其他详细信息,否则将使用简化登录任务.

是否有任何api用于disqus,以便我可以自动填写用户信息?

像这样的东西是django_template:

{%if requet.user.is_active %}
  <!--Check if any user is logged in and if someone is then add this in the html output:-->
  var disqus_email = {{ user.email }};
  var disqus_name = {{ user.username }};
  <!--Or as in my case if active user have an openid-->
  var disqus_openid = {{ user.openid }};
{% endif %}
Run Code Online (Sandbox Code Playgroud)

有一个类似的帖子:Disqus和检索登录用户但看着响应我决定为我的问题开始一个新问题.

javascript openid authentication django disqus

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

代码中的GradientDrawable

我可以使用以下XML

<shape android:shape="rectangle" xmlns...">
     <gradient
         android:startColor="#255779"
         android:centerColor="#3e7492"
         android:endColor="#a6c0cd"
         android:angle="90"/>

    <stroke android:width="1dp" android:color="#0d202e"/>
</shape>
Run Code Online (Sandbox Code Playgroud)

渐变很好

我正在尝试使用代码(没有XML)做同样的事情

int colors[] = { 0xff255779 , 0xff3e7492, 0xffa6c0cd };

GradientDrawable g = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, colors);

setBackgroundDrawable(g);

渐变DOES出现但它与XML中的那个不一样,我的意思是颜色相同但渐变不相同,我认为它与xml中的开始,中间,结束颜色有关

我该如何添加一个笔画

任何帮助将不胜感激

android

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

应该组合方法中的多个Try/Catch块

看看我的方法,我不确定我必须使用三个单独的try/catch块.我应该使用唯一的方法吗?什么是好习惯?

public void save(Object object, File file) {    

        BufferedWriter writter = null;

        try {
            writter = new BufferedWriter(new FileWriter(file));
        } catch (IOException e) {
            e.printStackTrace();
        }

        Dictionary dictionary = (Dictionary)object; 
        ArrayList<Card> cardList = dictionary.getCardList();
        for (Card card: cardList) {
            String line = card.getForeignWord() + " / " + card.getNativeWord();
            try {
                writter.write(line);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        try {
            writter.flush();
            writter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
Run Code Online (Sandbox Code Playgroud)

java

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