问:
Google Python gdata Library Installation Failing
[Note, I have removed some information, such as my username, and the
IDs to my spreadsheets]
Hi! I'm on a mac, and I'm trying my best to install gdata for google python.
Before I go on, I'm using this tutorial here:
http://code.google.com/apis/gdata/articles/python_client_lib.html
I have python version: 2.6.1, so I skipped to installing dependencies as instructed.

Terminal looked like:

```<code>Last login: Sat Jan  1 11:28:47 on ttys000
Users-MacBook-Pro:~ user$ python -V
Python 2.6.1
Users-MacBook-Pro:~ user$
</code>```

I fired up the python interpreter and tried importing xml tree.
Nothing happened, so I tried importing banannas.
Terminal looked like:

```<code>Last login: Sat Jan  1 11:30:26 on ttys000
Users-MacBook-Pro:~ user$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.etree import ElementTree
>>> from ninjas import banannas

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ninjas
</code>```

This makes me mostly sure I have xmltree, though I do not remember
ever having installed it.
At this point, I downloaded the gdata library, and my mac
automagically decompressed it.
I then ran the install command, and ran the test commands. My terminal looked like this:

``` Last login: Sat Jan  1 11:31:21 on ttys000
    Users-MacBook-Pro:~ user$ cd /Users/User/Downloads/gdata-2-1.0.13
    Users-MacBook-Pro:gdata-2-1.0.13 user$ ./setup.py install
    /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
    distutils/dist.py:266: UserWarning: Unknown distribution option:
    'install_requires'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/atom
    copying src/atom/__init__.py -> build/lib/atom
    copying src/atom/auth.py -> build/lib/atom
    copying src/atom/client.py -> build/lib/atom
    copying src/atom/core.py -> build/lib/atom
    copying src/atom/data.py -> build/lib/atom
    copying src/atom/http.py -> build/lib/atom
    copying src/atom/http_core.py -> build/lib/atom
    copying src/atom/http_interface.py -> build/lib/atom
    copying src/atom/mock_http.py -> build/lib/atom
    copying src/atom/mock_http_core.py -> build/lib/atom
    copying src/atom/mock_service.py -> build/lib/atom
    copying src/atom/service.py -> build/lib/atom
    copying src/atom/token_store.py -> build/lib/atom
    copying src/atom/url.py -> build/lib/atom
    creating build/lib/gdata
    copying src/gdata/__init__.py -> build/lib/gdata
    copying src/gdata/apps_property.py -> build/lib/gdata
    copying src/gdata/auth.py -> build/lib/gdata
    copying src/gdata/client.py -> build/lib/gdata
    copying src/gdata/core.py -> build/lib/gdata
    copying src/gdata/data.py -> build/lib/gdata
    copying src/gdata/gauth.py -> build/lib/gdata
   --Various copying, migration, and creation printouts exactly the same to the above and below, asides from path, removed to save space--
    migration
    copying src/gdata/apps/migration/service.py -> build/lib/gdata/apps/
    migration
    creating build/lib/gdata/apps/organization
    copying src/gdata/apps/organization/__init__.py -> build/lib/gdata/
    apps/organization
    copying src/gdata/apps/organization/service.py -> build/lib/gdata/apps/
    organization
    creating build/lib/gdata/base
    copying src/gdata/base/__init__.py -> build/lib/gdata/base
    copying src/gdata/base/service.py -> build/lib/gdata/base
    creating build/lib/gdata/blogger
    copying src/gdata/blogger/__init__.py -> build/lib/gdata/blogger
    copying src/gdata/blogger/client.py -> build/lib/gdata/blogger
    copying src/gdata/blogger/data.py -> build/lib/gdata/blogger
    copying src/gdata/blogger/service.py -> build/lib/gdata/blogger
    creating build/lib/gdata/books
    copying src/gdata/books/__init__.py -> build/lib/gdata/books
    copying src/gdata/books/data.py -> build/lib/gdata/books
    copying src/gdata/books/service.py -> build/lib/gdata/books
    creating build/lib/gdata/calendar
    copying src/gdata/calendar/__init__.py -> build/lib/gdata/calendar
    copying src/gdata/calendar/data.py -> build/lib/gdata/calendar
    copying src/gdata/calendar/service.py -> build/lib/gdata/calendar
    creating build/lib/gdata/calendar_resource
    copying src/gdata/calendar_resource/__init__.py -> build/lib/gdata/
    calendar_resource
    copying src/gdata/calendar_resource/client.py -> build/lib/gdata/
    calendar_resource
    copying src/gdata/calendar_resource/data.py -> build/lib/gdata/
    calendar_resource
    creating build/lib/gdata/codesearch
    copying src/gdata/codesearch/__init__.py -> build/lib/gdata/codesearch
    copying src/gdata/codesearch/service.py -> build/lib/gdata/codesearch
    creating build/lib/gdata/contacts
    copying src/gdata/contacts/__init__.py -> build/lib/gdata/contacts
    copying src/gdata/contacts/client.py -> build/lib/gdata/contacts
    copying src/gdata/contacts/data.py -> build/lib/gdata/contacts
    copying src/gdata/contacts/service.py -> build/lib/gdata/contacts
    creating build/lib/gdata/docs
    copying src/gdata/docs/__init__.py -> build/lib/gdata/docs
    copying src/gdata/docs/client.py -> build/lib/gdata/docs
    copying src/gdata/docs/data.py -> build/lib/gdata/docs
    copying src/gdata/docs/service.py -> build/lib/gdata/docs
    creating build/lib/gdata/dublincore
    copying src/gdata/dublincore/__init__.py -> build/lib/gdata/dublincore
    copying src/gdata/dublincore/data.py -> build/lib/gdata/dublincore
    creating build/lib/gdata/exif
    copying src/gdata/exif/__init__.py -> build/lib/gdata/exif
    creating build/lib/gdata/finance
    copying src/gdata/finance/__init__.py -> build/lib/gdata/finance
    copying src/gdata/finance/data.py -> build/lib/gdata/finance
    copying src/gdata/finance/service.py -> build/lib/gdata/finance
    creating build/lib/gdata/geo
    copying src/gdata/geo/__init__.py -> build/lib/gdata/geo
    copying src/gdata/geo/data.py -> build/lib/gdata/geo
    creating build/lib/gdata/health
    copying src/gdata/health/__init__.py -> build/lib/gdata/health
    copying src/gdata/health/service.py -> build/lib/gdata/health
    creating build/lib/gdata/maps
    copying src/gdata/maps/__init__.py -> build/lib/gdata/maps
    copying src/gdata/maps/client.py -> build/lib/gdata/maps
    copying src/gdata/maps/data.py -> build/lib/gdata/maps
    creating build/lib/gdata/media
    copying src/gdata/media/__init__.py -> build/lib/gdata/media
    copying src/gdata/media/data.py -> build/lib/gdata/media
    creating build/lib/gdata/notebook
    copying src/gdata/notebook/__init__.py -> build/lib/gdata/notebook
    copying src/gdata/notebook/data.py -> build/lib/gdata/notebook
    creating build/lib/gdata/oauth
    copying src/gdata/oauth/__init__.py -> build/lib/gdata/oauth
    copying src/gdata/oauth/rsa.py -> build/lib/gdata/oauth
    creating build/lib/gdata/opensearch
    copying src/gdata/opensearch/__init__.py -> build/lib/gdata/opensearch
    copying src/gdata/opensearch/data.py -> build/lib/gdata/opensearch
    creating build/lib/gdata/photos
    copying src/gdata/photos/__init__.py -> build/lib/gdata/photos
    copying src/gdata/photos/service.py -> build/lib/gdata/photos
    creating build/lib/gdata/projecthosting
    copying src/gdata/projecthosting/__init__.py -> build/lib/gdata/
    projecthosting
    copying src/gdata/projecthosting/client.py -> build/lib/gdata/
    projecthosting
    copying src/gdata/projecthosting/data.py -> build/lib/gdata/
    projecthosting
    creating build/lib/gdata/sites
    copying src/gdata/sites/__init__.py -> build/lib/gdata/sites
    copying src/gdata/sites/client.py -> build/lib/gdata/sites
    copying src/gdata/sites/data.py -> build/lib/gdata/sites
    creating build/lib/gdata/spreadsheet
    copying src/gdata/spreadsheet/__init__.py -> build/lib/gdata/
    spreadsheet
    copying src/gdata/spreadsheet/service.py -> build/lib/gdata/
    spreadsheet
    copying src/gdata/spreadsheet/text_db.py -> build/lib/gdata/
    spreadsheet
    creating build/lib/gdata/spreadsheets
    copying src/gdata/spreadsheets/__init__.py -> build/lib/gdata/
    spreadsheets
    copying src/gdata/spreadsheets/client.py -> build/lib/gdata/
    spreadsheets
    copying src/gdata/spreadsheets/data.py -> build/lib/gdata/spreadsheets
    creating build/lib/gdata/tlslite
    copying src/gdata/tlslite/__init__.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/api.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/BaseDB.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/Checker.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/constants.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/errors.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/FileObject.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/HandshakeSettings.py -> build/lib/gdata/
    tlslite
    copying src/gdata/tlslite/mathtls.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/messages.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/Session.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/SessionCache.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/SharedKeyDB.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/TLSConnection.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/TLSRecordLayer.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/VerifierDB.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/X509.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/X509CertChain.py -> build/lib/gdata/tlslite
    creating build/lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/__init__.py -> build/lib/gdata/
    tlslite/integration
    copying src/gdata/tlslite/integration/AsyncStateMachine.py -> build/
    lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/ClientHelper.py -> build/lib/
    gdata/tlslite/integration
    copying src/gdata/tlslite/integration/HTTPTLSConnection.py -> build/
    lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/IMAP4_TLS.py -> build/lib/gdata/
    tlslite/integration
    copying src/gdata/tlslite/integration/IntegrationHelper.py -> build/
    lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/POP3_TLS.py -> build/lib/gdata/
    tlslite/integration
    copying src/gdata/tlslite/integration/SMTP_TLS.py -> build/lib/gdata/
    tlslite/integration
    copying src/gdata/tlslite/integration/TLSAsyncDispatcherMixIn.py ->
    build/lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/TLSSocketServerMixIn.py -> build/
    lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/TLSTwistedProtocolWrapper.py ->
    build/lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/XMLRPCTransport.py -> build/lib/
    gdata/tlslite/integration
    creating build/lib/gdata/tlslite/utils
    copying src/gdata/tlslite/utils/__init__.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/AES.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/ASN1Parser.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/cipherfactory.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/codec.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/compat.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/Cryptlib_AES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/Cryptlib_RC4.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/Cryptlib_TripleDES.py -> build/lib/
    gdata/tlslite/utils
    copying src/gdata/tlslite/utils/cryptomath.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/dateFuncs.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/hmac.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/jython_compat.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/keyfactory.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/OpenSSL_AES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/OpenSSL_RC4.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/OpenSSL_RSAKey.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/OpenSSL_TripleDES.py -> build/lib/
    gdata/tlslite/utils
    copying src/gdata/tlslite/utils/PyCrypto_AES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/PyCrypto_RC4.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/PyCrypto_RSAKey.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/PyCrypto_TripleDES.py -> build/lib/
    gdata/tlslite/utils
    copying src/gdata/tlslite/utils/Python_AES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/Python_RC4.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/Python_RSAKey.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/RC4.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/rijndael.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/RSAKey.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/TripleDES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/xmltools.py -> build/lib/gdata/tlslite/
    utils
    creating build/lib/gdata/webmastertools
    copying src/gdata/webmastertools/__init__.py -> build/lib/gdata/
    webmastertools
    copying src/gdata/webmastertools/data.py -> build/lib/gdata/
    webmastertools
    copying src/gdata/webmastertools/service.py -> build/lib/gdata/
    webmastertools
    creating build/lib/gdata/youtube
    copying src/gdata/youtube/__init__.py -> build/lib/gdata/youtube
    copying src/gdata/youtube/client.py -> build/lib/gdata/youtube
    copying src/gdata/youtube/data.py -> build/lib/gdata/youtube
    copying src/gdata/youtube/service.py -> build/lib/gdata/youtube
    running install_lib
    running install_egg_info
    Removing /Library/Python/2.6/site-packages/gdata-2.0.13-py2.6.egg-info
    Writing /Library/Python/2.6/site-packages/gdata-2.0.13-py2.6.egg-info
    Users-MacBook-Pro:gdata-2-1.0.13 user$
    I then ran the first test mentioned:
    Last login: Sat Jan  1 11:38:03 on ttys000
    Users-MacBook-Pro:~ user$ ./tests/run_data_tests.py
    -bash: ./tests/run_data_tests.py: No such file or directory
    Users-MacBook-Pro:~ user$ cd /Users/user/Downloads/gdata-2-1.0.13
    Users-MacBook-Pro:gdata-2-1.0.13 user$ ./tests/run_data_tests.py
    Running all tests in module gdata_test
    .....................
    ----------------------------------------------------------------------
    Ran 21 tests in 0.085s
    OK
    Running all tests in module atom_test
    ...............................................
    ----------------------------------------------------------------------
    Ran 47 tests in 0.019s
    OK
    Running all tests in module atom_tests.url_test
    ....
    ----------------------------------------------------------------------
    Ran 4 tests in 0.001s
    OK
    Running all tests in module atom_tests.http_interface_test
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.000s
    OK
    Running all tests in module atom_tests.mock_http_test
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.729s
    OK
    Running all tests in module atom_tests.core_test
    ................
    ----------------------------------------------------------------------
    Ran 16 tests in 0.008s
    OK
    Running all tests in module atom_tests.token_store_test
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.001s
    OK
    Running all tests in module gdata_tests.client_test
    ...............
    ----------------------------------------------------------------------
    Ran 15 tests in 0.006s
    OK
    Running all tests in module gdata_tests.apps_test
    ...............................................
    ----------------------------------------------------------------------
    Ran 47 tests in 0.028s
    OK
    Running all tests in module gdata_tests.apps.emailsettings.data_test
    .................................
    ----------------------------------------------------------------------
    Ran 33 tests in 0.009s
    OK
    Running all tests in module gdata_tests.auth_test
    .............................
    ----------------------------------------------------------------------
    Ran 29 tests in 0.109s
    OK
    Running all tests in module gdata_tests.base_test
    .....................
    ----------------------------------------------------------------------
    Ran 21 tests in 0.028s
    OK
    Running all tests in module gdata_tests.books_test
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.001s
    OK
    Running all tests in module gdata_tests.calendar_test
    ............................................................
    ----------------------------------------------------------------------
    Ran 60 tests in 0.361s
    OK
    Running all tests in module gdata_tests.docs_test
    ....F...
    ======================================================================
    FAIL: testToAndFromStringWithData
    (gdata_tests.docs_test.DocumentListEntryTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/user/Downloads/gdata-2-1.0.13/tests/gdata_tests/
    docs_test.py", line 39, in testToAndFromStringWithData
        'spreadsheet%3Asupercalifragilisticexpealidocious')
    AssertionError: 'https://docs.google.com/feeds/documents/private/full/
    spreadsheet%3Asupercalifragilisticexpealidocious' != 'http://
    docs.google.com/feeds/documents/private/full/spreadsheet
    %3Asupercalifragilisticexpealidocious'
    ----------------------------------------------------------------------
    Ran 8 tests in 0.012s
    FAILED (failures=1)
    Running all tests in module gdata_tests.health_test
    ...............
    ----------------------------------------------------------------------
    Ran 15 tests in 0.195s
    OK
    Running all tests in module gdata_tests.spreadsheet_test
    ...........
    ----------------------------------------------------------------------
    Ran 11 tests in 0.012s
    OK
    Running all tests in module gdata_tests.photos_test
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.007s
    OK
    Running all tests in module gdata_tests.codesearch_test
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.004s
    OK
    Running all tests in module gdata_tests.contacts_test
    .......
    ----------------------------------------------------------------------
    Ran 7 tests in 0.009s
    OK
    Running all tests in module gdata_tests.youtube_test
    ................
    ----------------------------------------------------------------------
    Ran 16 tests in 0.019s
    OK
    Running all tests in module gdata_tests.blogger_test
    ......
    ----------------------------------------------------------------------
    Ran 6 tests in 0.002s
    OK
    Running all tests in module gdata_tests.webmastertools_test
    .............................
    ----------------------------------------------------------------------
    Ran 29 tests in 0.016s
    OK
    Running all tests in module gdata_tests.calendar_resource.data_test
    ..
    ----------------------------------------------------------------------
    Ran 2 tests in 0.003s
    OK
    Running all tests in module gdata_tests.oauth.data_test
    ............../Library/Python/2.6/site-packages/gdata/oauth/
    __init__.py:16: DeprecationWarning: BaseException.message has been
    deprecated as of Python 2.6
      self.message = message
    .........................
    ----------------------------------------------------------------------
    Ran 39 tests in 0.038s
    OK
    Users-MacBook-Pro:gdata-2-1.0.13 user$
    Worried by the FAILURE up there, I ran the next test mentioned:
    Last login: Sat Jan  1 11:42:38 on ttys000
    Users-MacBook-Pro:~ user$ cd /Users/user/Downloads/gdata-2-1.0.13
    Users-MacBook-Pro:gdata-2-1.0.13 user$ ./samples/docs/docs_example.py
    NOTE: Please run these tests only with a test account.
    Please enter your username: User
    Password:
    Document List Sample
    1) List your documents.
    2) Search your documents.
    3) Upload a document.
    4) Download a document.
    5) List a document's permissions.
    6) Add/change a document's permissions.
    7) Exit.
    > 1

    Retrieve (all/document/folder/presentation/spreadsheet/pdf):
    Enter a category: spreadsheets
    No entries in feed.
    TITLE              TYPE         RESOURCE ID
    Document List Sample
    1) List your documents.
    2) Search your documents.
    3) Upload a document.
    4) Download a document.
    5) List a document's permissions.
    6) Add/change a document's permissions.
    7) Exit.
    > 1

    Retrieve (all/document/folder/presentation/spreadsheet/pdf):
    Enter a category: all
    TITLE              TYPE         RESOURCE ID
    Whirld             spreadsheet  spreadsheet:--removed ID--
    Whirld Stats       spreadsheet  spreadsheet:--removed ID--
    Document List Sample
    1) List your documents.
    2) Search your documents.
    3) Upload a document.
    4) Download a document.
    5) List a document's permissions.
    6) Add/change a document's permissions.
    7) Exit.
```

<p>Everything <em>seemed</em> okay, other than the mysterious failure, so I
tried to run some code, just to see if I could get as far as to
initialize a DocsService: </p>

```import cgi
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import gdata.docs
import gdata.docs.service
class MainPage(webapp.RequestHandler):
    def post(self):
        self.Test = self.request.get('Test')
        self.respond(bool(1))
    def get(self):
        self.respond(bool(0))
    def respond(self,isPost):
        if isPost:
                self.response.out.write("""Greetings. The value of Test is""" +
self.Test)
        else:
                self.response.out.write("""ERROR -- Post data not given!""")
        #gd_client = gdata.docs.service.DocsService(source='[removed]')
        self.response.out.write("""Hahahahaha""")
application = webapp.WSGIApplication([  ('/', MainPage) ], debug=True)
#Run the basic code:
def main():
    run_wsgi_app(application)
if __name__ == "__main__":
    main()
```

<p>However, when launching that code from the google app engine, and then
viewing it in safari, I am greeted to: </p>

```Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 3245, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 3186, in _Dispatch
    base_env_dict=env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 531, in Dispatch
    base_env_dict=base_env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2410, in Dispatch
    self._module_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2320, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2216, in
ExecuteOrImportScript
    exec module_code in script_module.__dict__
  File "/Users/user/Documents/Web Projects/Python/HelloWorld/
HelloWorld.py", line 4, in <module>
    import gdata.docs
ImportError: No module named gdata.docs
```

I'm not sure what's going wrong here, but any help would be deeply
appreciated.

答:
```<code>sudo mv /usr/local/lib/python2.6/dist-packages/* /usr/lib/python2.6/dist-packages
</code>```

Body:
[Note, I have removed some information, such as my username, and the
IDs to my spreadsheets]
Hi! I'm on a mac, and I'm trying my best to install gdata for google python.
Before I go on, I'm using this tutorial here:
http://code.google.com/apis/gdata/articles/python_client_lib.html
I have python version: 2.6.1, so I skipped to installing dependencies as instructed.

Terminal looked like:

Last login: Sat Jan  1 11:28:47 on ttys000
Users-MacBook-Pro:~ user$ python -V
Python 2.6.1
Users-MacBook-Pro:~ user$

I fired up the python interpreter and tried importing xml tree.
Nothing happened, so I tried importing banannas.
Terminal looked like:

Last login: Sat Jan  1 11:30:26 on ttys000
Users-MacBook-Pro:~ user$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.etree import ElementTree
>>> from ninjas import banannas

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ninjas

This makes me mostly sure I have xmltree, though I do not remember
ever having installed it.
At this point, I downloaded the gdata library, and my mac
automagically decompressed it.
I then ran the install command, and ran the test commands. My terminal looked like this:

 Last login: Sat Jan  1 11:31:21 on ttys000
    Users-MacBook-Pro:~ user$ cd /Users/User/Downloads/gdata-2-1.0.13
    Users-MacBook-Pro:gdata-2-1.0.13 user$ ./setup.py install
    /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
    distutils/dist.py:266: UserWarning: Unknown distribution option:
    'install_requires'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/atom
    copying src/atom/__init__.py -> build/lib/atom
    copying src/atom/auth.py -> build/lib/atom
    copying src/atom/client.py -> build/lib/atom
    copying src/atom/core.py -> build/lib/atom
    copying src/atom/data.py -> build/lib/atom
    copying src/atom/http.py -> build/lib/atom
    copying src/atom/http_core.py -> build/lib/atom
    copying src/atom/http_interface.py -> build/lib/atom
    copying src/atom/mock_http.py -> build/lib/atom
    copying src/atom/mock_http_core.py -> build/lib/atom
    copying src/atom/mock_service.py -> build/lib/atom
    copying src/atom/service.py -> build/lib/atom
    copying src/atom/token_store.py -> build/lib/atom
    copying src/atom/url.py -> build/lib/atom
    creating build/lib/gdata
    copying src/gdata/__init__.py -> build/lib/gdata
    copying src/gdata/apps_property.py -> build/lib/gdata
    copying src/gdata/auth.py -> build/lib/gdata
    copying src/gdata/client.py -> build/lib/gdata
    copying src/gdata/core.py -> build/lib/gdata
    copying src/gdata/data.py -> build/lib/gdata
    copying src/gdata/gauth.py -> build/lib/gdata
   --Various copying, migration, and creation printouts exactly the same to the above and below, asides from path, removed to save space--
    migration
    copying src/gdata/apps/migration/service.py -> build/lib/gdata/apps/
    migration
    creating build/lib/gdata/apps/organization
    copying src/gdata/apps/organization/__init__.py -> build/lib/gdata/
    apps/organization
    copying src/gdata/apps/organization/service.py -> build/lib/gdata/apps/
    organization
    creating build/lib/gdata/base
    copying src/gdata/base/__init__.py -> build/lib/gdata/base
    copying src/gdata/base/service.py -> build/lib/gdata/base
    creating build/lib/gdata/blogger
    copying src/gdata/blogger/__init__.py -> build/lib/gdata/blogger
    copying src/gdata/blogger/client.py -> build/lib/gdata/blogger
    copying src/gdata/blogger/data.py -> build/lib/gdata/blogger
    copying src/gdata/blogger/service.py -> build/lib/gdata/blogger
    creating build/lib/gdata/books
    copying src/gdata/books/__init__.py -> build/lib/gdata/books
    copying src/gdata/books/data.py -> build/lib/gdata/books
    copying src/gdata/books/service.py -> build/lib/gdata/books
    creating build/lib/gdata/calendar
    copying src/gdata/calendar/__init__.py -> build/lib/gdata/calendar
    copying src/gdata/calendar/data.py -> build/lib/gdata/calendar
    copying src/gdata/calendar/service.py -> build/lib/gdata/calendar
    creating build/lib/gdata/calendar_resource
    copying src/gdata/calendar_resource/__init__.py -> build/lib/gdata/
    calendar_resource
    copying src/gdata/calendar_resource/client.py -> build/lib/gdata/
    calendar_resource
    copying src/gdata/calendar_resource/data.py -> build/lib/gdata/
    calendar_resource
    creating build/lib/gdata/codesearch
    copying src/gdata/codesearch/__init__.py -> build/lib/gdata/codesearch
    copying src/gdata/codesearch/service.py -> build/lib/gdata/codesearch
    creating build/lib/gdata/contacts
    copying src/gdata/contacts/__init__.py -> build/lib/gdata/contacts
    copying src/gdata/contacts/client.py -> build/lib/gdata/contacts
    copying src/gdata/contacts/data.py -> build/lib/gdata/contacts
    copying src/gdata/contacts/service.py -> build/lib/gdata/contacts
    creating build/lib/gdata/docs
    copying src/gdata/docs/__init__.py -> build/lib/gdata/docs
    copying src/gdata/docs/client.py -> build/lib/gdata/docs
    copying src/gdata/docs/data.py -> build/lib/gdata/docs
    copying src/gdata/docs/service.py -> build/lib/gdata/docs
    creating build/lib/gdata/dublincore
    copying src/gdata/dublincore/__init__.py -> build/lib/gdata/dublincore
    copying src/gdata/dublincore/data.py -> build/lib/gdata/dublincore
    creating build/lib/gdata/exif
    copying src/gdata/exif/__init__.py -> build/lib/gdata/exif
    creating build/lib/gdata/finance
    copying src/gdata/finance/__init__.py -> build/lib/gdata/finance
    copying src/gdata/finance/data.py -> build/lib/gdata/finance
    copying src/gdata/finance/service.py -> build/lib/gdata/finance
    creating build/lib/gdata/geo
    copying src/gdata/geo/__init__.py -> build/lib/gdata/geo
    copying src/gdata/geo/data.py -> build/lib/gdata/geo
    creating build/lib/gdata/health
    copying src/gdata/health/__init__.py -> build/lib/gdata/health
    copying src/gdata/health/service.py -> build/lib/gdata/health
    creating build/lib/gdata/maps
    copying src/gdata/maps/__init__.py -> build/lib/gdata/maps
    copying src/gdata/maps/client.py -> build/lib/gdata/maps
    copying src/gdata/maps/data.py -> build/lib/gdata/maps
    creating build/lib/gdata/media
    copying src/gdata/media/__init__.py -> build/lib/gdata/media
    copying src/gdata/media/data.py -> build/lib/gdata/media
    creating build/lib/gdata/notebook
    copying src/gdata/notebook/__init__.py -> build/lib/gdata/notebook
    copying src/gdata/notebook/data.py -> build/lib/gdata/notebook
    creating build/lib/gdata/oauth
    copying src/gdata/oauth/__init__.py -> build/lib/gdata/oauth
    copying src/gdata/oauth/rsa.py -> build/lib/gdata/oauth
    creating build/lib/gdata/opensearch
    copying src/gdata/opensearch/__init__.py -> build/lib/gdata/opensearch
    copying src/gdata/opensearch/data.py -> build/lib/gdata/opensearch
    creating build/lib/gdata/photos
    copying src/gdata/photos/__init__.py -> build/lib/gdata/photos
    copying src/gdata/photos/service.py -> build/lib/gdata/photos
    creating build/lib/gdata/projecthosting
    copying src/gdata/projecthosting/__init__.py -> build/lib/gdata/
    projecthosting
    copying src/gdata/projecthosting/client.py -> build/lib/gdata/
    projecthosting
    copying src/gdata/projecthosting/data.py -> build/lib/gdata/
    projecthosting
    creating build/lib/gdata/sites
    copying src/gdata/sites/__init__.py -> build/lib/gdata/sites
    copying src/gdata/sites/client.py -> build/lib/gdata/sites
    copying src/gdata/sites/data.py -> build/lib/gdata/sites
    creating build/lib/gdata/spreadsheet
    copying src/gdata/spreadsheet/__init__.py -> build/lib/gdata/
    spreadsheet
    copying src/gdata/spreadsheet/service.py -> build/lib/gdata/
    spreadsheet
    copying src/gdata/spreadsheet/text_db.py -> build/lib/gdata/
    spreadsheet
    creating build/lib/gdata/spreadsheets
    copying src/gdata/spreadsheets/__init__.py -> build/lib/gdata/
    spreadsheets
    copying src/gdata/spreadsheets/client.py -> build/lib/gdata/
    spreadsheets
    copying src/gdata/spreadsheets/data.py -> build/lib/gdata/spreadsheets
    creating build/lib/gdata/tlslite
    copying src/gdata/tlslite/__init__.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/api.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/BaseDB.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/Checker.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/constants.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/errors.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/FileObject.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/HandshakeSettings.py -> build/lib/gdata/
    tlslite
    copying src/gdata/tlslite/mathtls.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/messages.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/Session.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/SessionCache.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/SharedKeyDB.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/TLSConnection.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/TLSRecordLayer.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/VerifierDB.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/X509.py -> build/lib/gdata/tlslite
    copying src/gdata/tlslite/X509CertChain.py -> build/lib/gdata/tlslite
    creating build/lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/__init__.py -> build/lib/gdata/
    tlslite/integration
    copying src/gdata/tlslite/integration/AsyncStateMachine.py -> build/
    lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/ClientHelper.py -> build/lib/
    gdata/tlslite/integration
    copying src/gdata/tlslite/integration/HTTPTLSConnection.py -> build/
    lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/IMAP4_TLS.py -> build/lib/gdata/
    tlslite/integration
    copying src/gdata/tlslite/integration/IntegrationHelper.py -> build/
    lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/POP3_TLS.py -> build/lib/gdata/
    tlslite/integration
    copying src/gdata/tlslite/integration/SMTP_TLS.py -> build/lib/gdata/
    tlslite/integration
    copying src/gdata/tlslite/integration/TLSAsyncDispatcherMixIn.py ->
    build/lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/TLSSocketServerMixIn.py -> build/
    lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/TLSTwistedProtocolWrapper.py ->
    build/lib/gdata/tlslite/integration
    copying src/gdata/tlslite/integration/XMLRPCTransport.py -> build/lib/
    gdata/tlslite/integration
    creating build/lib/gdata/tlslite/utils
    copying src/gdata/tlslite/utils/__init__.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/AES.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/ASN1Parser.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/cipherfactory.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/codec.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/compat.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/Cryptlib_AES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/Cryptlib_RC4.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/Cryptlib_TripleDES.py -> build/lib/
    gdata/tlslite/utils
    copying src/gdata/tlslite/utils/cryptomath.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/dateFuncs.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/hmac.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/jython_compat.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/keyfactory.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/OpenSSL_AES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/OpenSSL_RC4.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/OpenSSL_RSAKey.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/OpenSSL_TripleDES.py -> build/lib/
    gdata/tlslite/utils
    copying src/gdata/tlslite/utils/PyCrypto_AES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/PyCrypto_RC4.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/PyCrypto_RSAKey.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/PyCrypto_TripleDES.py -> build/lib/
    gdata/tlslite/utils
    copying src/gdata/tlslite/utils/Python_AES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/Python_RC4.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/Python_RSAKey.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/RC4.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/rijndael.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/RSAKey.py -> build/lib/gdata/tlslite/
    utils
    copying src/gdata/tlslite/utils/TripleDES.py -> build/lib/gdata/
    tlslite/utils
    copying src/gdata/tlslite/utils/xmltools.py -> build/lib/gdata/tlslite/
    utils
    creating build/lib/gdata/webmastertools
    copying src/gdata/webmastertools/__init__.py -> build/lib/gdata/
    webmastertools
    copying src/gdata/webmastertools/data.py -> build/lib/gdata/
    webmastertools
    copying src/gdata/webmastertools/service.py -> build/lib/gdata/
    webmastertools
    creating build/lib/gdata/youtube
    copying src/gdata/youtube/__init__.py -> build/lib/gdata/youtube
    copying src/gdata/youtube/client.py -> build/lib/gdata/youtube
    copying src/gdata/youtube/data.py -> build/lib/gdata/youtube
    copying src/gdata/youtube/service.py -> build/lib/gdata/youtube
    running install_lib
    running install_egg_info
    Removing /Library/Python/2.6/site-packages/gdata-2.0.13-py2.6.egg-info
    Writing /Library/Python/2.6/site-packages/gdata-2.0.13-py2.6.egg-info
    Users-MacBook-Pro:gdata-2-1.0.13 user$
    I then ran the first test mentioned:
    Last login: Sat Jan  1 11:38:03 on ttys000
    Users-MacBook-Pro:~ user$ ./tests/run_data_tests.py
    -bash: ./tests/run_data_tests.py: No such file or directory
    Users-MacBook-Pro:~ user$ cd /Users/user/Downloads/gdata-2-1.0.13
    Users-MacBook-Pro:gdata-2-1.0.13 user$ ./tests/run_data_tests.py
    Running all tests in module gdata_test
    .....................
    ----------------------------------------------------------------------
    Ran 21 tests in 0.085s
    OK
    Running all tests in module atom_test
    ...............................................
    ----------------------------------------------------------------------
    Ran 47 tests in 0.019s
    OK
    Running all tests in module atom_tests.url_test
    ....
    ----------------------------------------------------------------------
    Ran 4 tests in 0.001s
    OK
    Running all tests in module atom_tests.http_interface_test
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.000s
    OK
    Running all tests in module atom_tests.mock_http_test
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.729s
    OK
    Running all tests in module atom_tests.core_test
    ................
    ----------------------------------------------------------------------
    Ran 16 tests in 0.008s
    OK
    Running all tests in module atom_tests.token_store_test
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.001s
    OK
    Running all tests in module gdata_tests.client_test
    ...............
    ----------------------------------------------------------------------
    Ran 15 tests in 0.006s
    OK
    Running all tests in module gdata_tests.apps_test
    ...............................................
    ----------------------------------------------------------------------
    Ran 47 tests in 0.028s
    OK
    Running all tests in module gdata_tests.apps.emailsettings.data_test
    .................................
    ----------------------------------------------------------------------
    Ran 33 tests in 0.009s
    OK
    Running all tests in module gdata_tests.auth_test
    .............................
    ----------------------------------------------------------------------
    Ran 29 tests in 0.109s
    OK
    Running all tests in module gdata_tests.base_test
    .....................
    ----------------------------------------------------------------------
    Ran 21 tests in 0.028s
    OK
    Running all tests in module gdata_tests.books_test
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.001s
    OK
    Running all tests in module gdata_tests.calendar_test
    ............................................................
    ----------------------------------------------------------------------
    Ran 60 tests in 0.361s
    OK
    Running all tests in module gdata_tests.docs_test
    ....F...
    ======================================================================
    FAIL: testToAndFromStringWithData
    (gdata_tests.docs_test.DocumentListEntryTest)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/user/Downloads/gdata-2-1.0.13/tests/gdata_tests/
    docs_test.py", line 39, in testToAndFromStringWithData
        'spreadsheet%3Asupercalifragilisticexpealidocious')
    AssertionError: 'https://docs.google.com/feeds/documents/private/full/
    spreadsheet%3Asupercalifragilisticexpealidocious' != 'http://
    docs.google.com/feeds/documents/private/full/spreadsheet
    %3Asupercalifragilisticexpealidocious'
    ----------------------------------------------------------------------
    Ran 8 tests in 0.012s
    FAILED (failures=1)
    Running all tests in module gdata_tests.health_test
    ...............
    ----------------------------------------------------------------------
    Ran 15 tests in 0.195s
    OK
    Running all tests in module gdata_tests.spreadsheet_test
    ...........
    ----------------------------------------------------------------------
    Ran 11 tests in 0.012s
    OK
    Running all tests in module gdata_tests.photos_test
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.007s
    OK
    Running all tests in module gdata_tests.codesearch_test
    .
    ----------------------------------------------------------------------
    Ran 1 test in 0.004s
    OK
    Running all tests in module gdata_tests.contacts_test
    .......
    ----------------------------------------------------------------------
    Ran 7 tests in 0.009s
    OK
    Running all tests in module gdata_tests.youtube_test
    ................
    ----------------------------------------------------------------------
    Ran 16 tests in 0.019s
    OK
    Running all tests in module gdata_tests.blogger_test
    ......
    ----------------------------------------------------------------------
    Ran 6 tests in 0.002s
    OK
    Running all tests in module gdata_tests.webmastertools_test
    .............................
    ----------------------------------------------------------------------
    Ran 29 tests in 0.016s
    OK
    Running all tests in module gdata_tests.calendar_resource.data_test
    ..
    ----------------------------------------------------------------------
    Ran 2 tests in 0.003s
    OK
    Running all tests in module gdata_tests.oauth.data_test
    ............../Library/Python/2.6/site-packages/gdata/oauth/
    __init__.py:16: DeprecationWarning: BaseException.message has been
    deprecated as of Python 2.6
      self.message = message
    .........................
    ----------------------------------------------------------------------
    Ran 39 tests in 0.038s
    OK
    Users-MacBook-Pro:gdata-2-1.0.13 user$
    Worried by the FAILURE up there, I ran the next test mentioned:
    Last login: Sat Jan  1 11:42:38 on ttys000
    Users-MacBook-Pro:~ user$ cd /Users/user/Downloads/gdata-2-1.0.13
    Users-MacBook-Pro:gdata-2-1.0.13 user$ ./samples/docs/docs_example.py
    NOTE: Please run these tests only with a test account.
    Please enter your username: User
    Password:
    Document List Sample
    1) List your documents.
    2) Search your documents.
    3) Upload a document.
    4) Download a document.
    5) List a document's permissions.
    6) Add/change a document's permissions.
    7) Exit.
    > 1

    Retrieve (all/document/folder/presentation/spreadsheet/pdf):
    Enter a category: spreadsheets
    No entries in feed.
    TITLE              TYPE         RESOURCE ID
    Document List Sample
    1) List your documents.
    2) Search your documents.
    3) Upload a document.
    4) Download a document.
    5) List a document's permissions.
    6) Add/change a document's permissions.
    7) Exit.
    > 1

    Retrieve (all/document/folder/presentation/spreadsheet/pdf):
    Enter a category: all
    TITLE              TYPE         RESOURCE ID
    Whirld             spreadsheet  spreadsheet:--removed ID--
    Whirld Stats       spreadsheet  spreadsheet:--removed ID--
    Document List Sample
    1) List your documents.
    2) Search your documents.
    3) Upload a document.
    4) Download a document.
    5) List a document's permissions.
    6) Add/change a document's permissions.
    7) Exit.

Everything seemed okay, other than the mysterious failure, so I
tried to run some code, just to see if I could get as far as to
initialize a DocsService:

import cgi
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import gdata.docs
import gdata.docs.service
class MainPage(webapp.RequestHandler):
    def post(self):
        self.Test = self.request.get('Test')
        self.respond(bool(1))
    def get(self):
        self.respond(bool(0))
    def respond(self,isPost):
        if isPost:
                self.response.out.write("""Greetings. The value of Test is""" +
self.Test)
        else:
                self.response.out.write("""ERROR -- Post data not given!""")
        #gd_client = gdata.docs.service.DocsService(source='[removed]')
        self.response.out.write("""Hahahahaha""")
application = webapp.WSGIApplication([  ('/', MainPage) ], debug=True)
#Run the basic code:
def main():
    run_wsgi_app(application)
if __name__ == "__main__":
    main()

However, when launching that code from the google app engine, and then
viewing it in safari, I am greeted to:

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 3245, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 3186, in _Dispatch
    base_env_dict=env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 531, in Dispatch
    base_env_dict=base_env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2410, in Dispatch
    self._module_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2320, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver.py", line 2216, in
ExecuteOrImportScript
    exec module_code in script_module.__dict__
  File "/Users/user/Documents/Web Projects/Python/HelloWorld/
HelloWorld.py", line 4, in <module>
    import gdata.docs
ImportError: No module named gdata.docs

I'm not sure what's going wrong here, but any help would be deeply
appreciated.


来源: stackexchange

问:
base64 as textbox background?
I have a textbox that has an image linked as it's background.

I'd like to use the base64 version of this image.

I used a very simple windows -form- to ensure the code for enacting the base64 is working correctly, it did.

The part I'm having issue with is linking it in xaml in a wpf style gui.

```<code><TextBox Name="OutTBox" Grid.Column="0" Grid.ColumnSpan="7" Grid.Row="4" Grid.RowSpan="6" Margin="20,5,20,20" Foreground="#FF8CFF8C" IsReadOnly="True" >
   <TextBox.Background>
       <ImageBrush ImageSource="C:\background.jpg" Stretch="UniformToFill"/>
   </TextBox.Background>
</TextBox>
</code>```

So here is the base64 language I used for the windows form:

```<code>Add-Type -AssemblyName PresentationFramework

# Setup the XAML
[xml]$script:xaml = '<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    Title="base64 image demo" Height="350" Width="650" Background="Black">
<Grid>
    <Image Name="thisistheimage"  Stretch="UniformToFill" />
</Grid>
</Window>'

# Create the form and set variables
$script:form = [Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $xaml))
$xaml.SelectNodes("//*[@Name]") | ForEach-Object { Set-Variable -Name ($_.Name) -Value $form.FindName($_.Name) -Scope Script }

# here's the base64 string

$base64 = "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"

# Create a streaming image by streaming the base64 string to a bitmap streamsource
$bitmap = New-Object System.Windows.Media.Imaging.BitmapImage
$bitmap.BeginInit()
$bitmap.StreamSource = [System.IO.MemoryStream][System.Convert]::FromBase64String($base64)
$bitmap.EndInit()

# Freeze() prevents memory leaks.
$bitmap.Freeze()

# Set source here. Take note in the XAML as to where the variable name was taken.
$thisistheimage.source = $bitmap

# Show form
$null = $form.ShowDialog()
</code>```

I'd give you my actual image but it's over 5k lines long. It only takes a fraction of a second to load.
To be clear the base64 will load in the Xaml. I removed the textbox from those grid coords and replaced it with the base64 and it loads fine. just can't seem to work the two together.

Thanks!

答:
I've never used powershell, but it should be as simple as this:</p>

```<code>$brush = New-Object System.Windows.Media.ImageBrush
$brush.ImageSource = $bitmap

$thetextbox.Background = $brush
</code>```

ContentLicense: CC BY-SA 3.0

Title: base64 as textbox background?

Body:
I have a textbox that has an image linked as it's background.

I'd like to use the base64 version of this image.

I used a very simple windows -form- to ensure the code for enacting the base64 is working correctly, it did.

The part I'm having issue with is linking it in xaml in a wpf style gui.

<TextBox Name="OutTBox" Grid.Column="0" Grid.ColumnSpan="7" Grid.Row="4" Grid.RowSpan="6" Margin="20,5,20,20" Foreground="#FF8CFF8C" IsReadOnly="True" >
   <TextBox.Background>
       <ImageBrush ImageSource="C:\background.jpg" Stretch="UniformToFill"/>
   </TextBox.Background>
</TextBox>

So here is the base64 language I used for the windows form:

Add-Type -AssemblyName PresentationFramework

# Setup the XAML
[xml]$script:xaml = '<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    Title="base64 image demo" Height="350" Width="650" Background="Black">
<Grid>
    <Image Name="thisistheimage"  Stretch="UniformToFill" />
</Grid>
</Window>'

# Create the form and set variables
$script:form = [Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $xaml))
$xaml.SelectNodes("//*[@Name]") | ForEach-Object { Set-Variable -Name ($_.Name) -Value $form.FindName($_.Name) -Scope Script }

# here's the base64 string

$base64 = "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"

# Create a streaming image by streaming the base64 string to a bitmap streamsource
$bitmap = New-Object System.Windows.Media.Imaging.BitmapImage
$bitmap.BeginInit()
$bitmap.StreamSource = [System.IO.MemoryStream][System.Convert]::FromBase64String($base64)
$bitmap.EndInit()

# Freeze() prevents memory leaks.
$bitmap.Freeze()

# Set source here. Take note in the XAML as to where the variable name was taken.
$thisistheimage.source = $bitmap

# Show form
$null = $form.ShowDialog()

I'd give you my actual image but it's over 5k lines long. It only takes a fraction of a second to load.
To be clear the base64 will load in the Xaml. I removed the textbox from those grid coords and replaced it with the base64 and it loads fine. just can't seem to work the two together.

Thanks!

Body:
I've never used powershell, but it should be as simple as this:

$brush = New-Object System.Windows.Media.ImageBrush
$brush.ImageSource = $bitmap

$thetextbox.Background = $brush


问:
Mongodb text index - better scoring?
I have an index in MongoDB which covers name and email.
This works, and I can query it with:

```<code>const c = await Contact.
      find({ $text: { $search: search } }, { score: { $meta: "textScore" } })
.sort({ score: { $meta: "textScore" } })
.skip(skip)
.limit(20);
</code>```

But, the results are somewhat odd, yet logical.

e.g.

if I search for "Roger Johan"
It will start listing both people called Roger and Johan, which is logical.
but, it would have been less odd if it ranked "Roger Johansson" highest as that is a match on both Roger and Johan%

Is there any way to tune this?

I know I can regex match on partial, but that instead fails on things like:
data: Roger T. Johansson
query: Roger Johansson

Is there any fancy trick to combine parts of these two options?

答:
If you apply search by phrase it will be able to find Roger Johan, but it won't work if you will try to search for Rog or Johan.

To make it work with partial matches on the first word we created additional field with prefixes for the word, i.g. ["Rog", "Roge"] and included this field into text index.

Having that implemented search will be able to find searches for Rog as well as Roger Johan.

If you need to search last name Johan you can also include another property with prefixes ["Joh", "Joha", "Johan", "Johans", "Johanss", "Johansso"] and give it lower (or higher, depending on how you want results to appear) rank. Or you can include all prefixes to the same array property if the rank should be same.

Just to be clear, you do need to use phrase search, i.e.: "\"Roger Johan"\".

Title: Mongodb text index - better scoring?

Body:
I have an index in MongoDB which covers name and email.
This works, and I can query it with:

const c = await Contact.
      find({ $text: { $search: search } }, { score: { $meta: "textScore" } })
.sort({ score: { $meta: "textScore" } })
.skip(skip)
.limit(20);

But, the results are somewhat odd, yet logical.

e.g.

if I search for "Roger Johan"
It will start listing both people called Roger and Johan, which is logical.
but, it would have been less odd if it ranked "Roger Johansson" highest as that is a match on both Roger and Johan%

Is there any way to tune this?

I know I can regex match on partial, but that instead fails on things like:
data: Roger T. Johansson
query: Roger Johansson

Is there any fancy trick to combine parts of these two options?


问:
Find Max Line Count for Unity UI.Text
I'm trying to determine the max line count of a UI.Text with VerticalOverflow set to truncate so that the line count can be used later. So far I came up this code which obviously is rather unpractical and perhaps even dangerous:

```<code>/// <summary>
///     Returns the max visible line count of a UI.Text component. The text's vertical
///     overflow must be set to truncate or this method will return 0.
/// </summary>
/// <param name="text"></param>
/// <returns></returns>
public static int GetMaxLineCount(Text text)
{
    if (text == null || text.verticalOverflow != VerticalWrapMode.Truncate) return 0;
    var textBackup = text.text;
    var lineCount = 0;
    text.text = "";
    while (true)
    {
        text.text += "\n";
        Canvas.ForceUpdateCanvases();
        var nextLineCount = text.cachedTextGenerator.lineCount;
        if (lineCount == nextLineCount) break;
        lineCount = nextLineCount;
    }
    text.text = textBackup;
    return lineCount;
}
</code>```

Is there any better way to (pre)determine the max line count of a UI.Text component (before text is truncated at the bottom)?

答:
You can try using something like this

TextGenerator textGenenerator = new TextGenerator();
 TextGenerationSettings generationSettings =
 text.GetGenerationSettings(text.rectTransform.rect.size);
 float height = textGenenerator.GetPreferredHeight(newText, generationSettings);

You can read more about it here https://docs.unity3d.com/ScriptReference/TextGenerator.html

---Note related to your code---

You call Canvas.ForceUpdateCanvases() which would make a lot of calls for updating only one Text and having bad inspector settings when running that code you could end up in infinite loop if Text allows for infinite rows.

Title: Find Max Line Count for Unity UI.Text

Body:
I'm trying to determine the max line count of a UI.Text with VerticalOverflow set to truncate so that the line count can be used later. So far I came up this code which obviously is rather unpractical and perhaps even dangerous:

///
///     Returns the max visible line count of a UI.Text component. The text's vertical
///     overflow must be set to truncate or this method will return 0.
///
/// <param name="text"></param>
/// <returns></returns>
public static int GetMaxLineCount(Text text)
{
    if (text == null || text.verticalOverflow != VerticalWrapMode.Truncate) return 0;
    var textBackup = text.text;
    var lineCount = 0;
    text.text = "";
    while (true)
    {
        text.text += "\n";
        Canvas.ForceUpdateCanvases();
        var nextLineCount = text.cachedTextGenerator.lineCount;
        if (lineCount == nextLineCount) break;
        lineCount = nextLineCount;
    }
    text.text = textBackup;
    return lineCount;
}

Is there any better way to (pre)determine the max line count of a UI.Text component (before text is truncated at the bottom)?


问:
MERGE EXCEL ROWS BASED ON REFERENCE COLUMN VALUE
I want to merge different rows in column B based on a referring value from column A and copy the result to column C.

Input:

```<code>CODE    NAME
110001  Baroda House
110001  Bengali Market
110002  Bhagat Singh Market
110002  Connaught Place
125051  Constitution House
125051  Election Commission
125051  Janpath
125051  Krishi Bhawan
125051  Lady Harding Medical College
</code>```

Expected Output:

```<code>CODE    NAME                ;MERGED
110001  Baroda House        ;Baroda House,Bengali Market
110001  Bengali Market      ;Baroda House,Bengali Market
110002  Bhagat Singh Market ;Bhagat Singh Market,Connaught Place
110002  Connaught Place     ;Bhagat Singh Market,Connaught Place
125051  Constitution House  ;Constitution House,Election Commission,Janpath,Krishi Bhawan,Lady Harding Medical College
125051  Election Commission ;Constitution House,Election Commission,Janpath,Krishi Bhawan,Lady Harding Medical College
125051  Janpath             ;Constitution House,Election Commission,Janpath,Krishi Bhawan,Lady Harding Medical College
125051  Krishi Bhawan       ;Constitution House,Election Commission,Janpath,Krishi Bhawan,Lady Harding Medical College
</code>```

I tried with the macro given here, but its not working:
Copying from reference column based on neighboring cell value

Can anybody help me. The xlsx file has 114000 rows.Thanks in advance.

答:
The following code should do the trick:</p>

```<code>Sub foo()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
    If ws.Name <> "Sheet3" Then 'if statement to exclude this sheet, add more if any need excluding
        LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row 'get the last row with data
        Repeated = 1
        For i = 2 To LastRow 'loop through rows
            Newvalue = ws.Cells(i, 1).Value 'get the code to compare
            For x = 2 To LastRow 'loop again for comparison
                If ws.Cells(x, 1).Value = Newvalue Then
                    Merged = Merged & "; " & ws.Cells(x, 2).Value 'if values match then get the merged value
                    Repeated = Repeated + 1 'Increment if match found
                    ID = ws.Cells(x, 1).Value
                End If
            Next x
            ws.Cells(i, 3).Value = Merged 'enter the value on column C
            ws.Cells(i, 4).Value = ID & " repeated " & Repeated - 1 & " times."
            Merged = "" 'Clear the variable for next loop
            Repeated = 1 'clear variable ready for next loop
        Next i
    End If
Next
End Sub
</code>```

Body:
I want to merge different rows in column B based on a referring value from column A and copy the result to column C.

Input:

CODE    NAME
110001  Baroda House
110001  Bengali Market
110002  Bhagat Singh Market
110002  Connaught Place
125051  Constitution House
125051  Election Commission
125051  Janpath
125051  Krishi Bhawan
125051  Lady Harding Medical College

Expected Output:

CODE    NAME                ;MERGED
110001  Baroda House        ;Baroda House,Bengali Market
110001  Bengali Market      ;Baroda House,Bengali Market
110002  Bhagat Singh Market ;Bhagat Singh Market,Connaught Place
110002  Connaught Place     ;Bhagat Singh Market,Connaught Place
125051  Constitution House  ;Constitution House,Election Commission,Janpath,Krishi Bhawan,Lady Harding Medical College
125051  Election Commission ;Constitution House,Election Commission,Janpath,Krishi Bhawan,Lady Harding Medical College
125051  Janpath             ;Constitution House,Election Commission,Janpath,Krishi Bhawan,Lady Harding Medical College
125051  Krishi Bhawan       ;Constitution House,Election Commission,Janpath,Krishi Bhawan,Lady Harding Medical College

I tried with the macro given here, but its not working:
Copying from reference column based on neighboring cell value

Can anybody help me. The xlsx file has 114000 rows.Thanks in advance.

Body:
The following code should do the trick:

Sub foo()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
    If ws.Name <> "Sheet3" Then 'if statement to exclude this sheet, add more if any need excluding
        LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row 'get the last row with data
        Repeated = 1
        For i = 2 To LastRow 'loop through rows
            Newvalue = ws.Cells(i, 1).Value 'get the code to compare
            For x = 2 To LastRow 'loop again for comparison
                If ws.Cells(x, 1).Value = Newvalue Then
                    Merged = Merged & "; " & ws.Cells(x, 2).Value 'if values match then get the merged value
                    Repeated = Repeated + 1 'Increment if match found
                    ID = ws.Cells(x, 1).Value
                End If
            Next x
            ws.Cells(i, 3).Value = Merged 'enter the value on column C
            ws.Cells(i, 4).Value = ID & " repeated " & Repeated - 1 & " times."
            Merged = "" 'Clear the variable for next loop
            Repeated = 1 'clear variable ready for next loop
        Next i
    End If
Next
End Sub


问:
I don't have Razor Editor(even though I installed mvc 3.0)
I installed mvc 3.0 in my VS 2010 and I can make and run 3.0 application but I don't get intellisense or highlighting.

It seems that I am missing the razor editor

http://blogs.jetbrains.com/dotnet/wp-content/uploads/2010/11/snaghtml1f47de61.png

http://blogs.jetbrains.com/dotnet/2010/11/razor-intellisense-and-resharper/

Where can I download this so I can get it to work?

答: This is not something you can download separately. It is part of the ASP.NET MVC 3.0 package. If you have downloaded it and installed it and it is still not working it is probably because it has conflicts with some other plugins you might be using such as Resharper. You may try uninstalling all third party plugins and then reinstall MVC 3.0 to see if the issue is fixed. Also you may try to reset Visual Studio environment with devenv /resetsettings. And IIRC there were issues with Intellisense and the C# 5.0 async CTP so if youhave this installed try removing it as well.

ContentLicense: CC BY-SA 2.5


问:
XPath to select elements based on class
How do I effectively use the :not to select elements in a situation like below:

```<code><div class="parent">
    <div class="a b c"/>
    <div class="a"/>
</div>
</code>```

I need to select the div with just class 'a' and exclude the div with classes 'a', 'b' and 'c'.
 Thing is the number of div's with the class that I need varies for every load of page and so would have to use logic of finding div's with class 'a' and not having class 'b' and 'c'

答:
You can follow the below example code in java.</p>

```<code>WebElement elm = driver.findElement(By.className("parent"));
WebElement el = elm.findElement(By.xpath("//div[@class='a' and not(@class='a b c')]"));
el.click();
</code>```

Title: XPath to select elements based on class

Body:
How do I effectively use the :not to select elements in a situation like below:

I need to select the div with just class 'a' and exclude the div with classes 'a', 'b' and 'c'.
 Thing is the number of div's with the class that I need varies for every load of page and so would have to use logic of finding div's with class 'a' and not having class 'b' and 'c'

Body:
You can follow the below example code in java.

WebElement elm = driver.findElement(By.className("parent"));
WebElement el = elm.findElement(By.xpath("//div[@class='a' and not(@class='a b c')]"));
el.click();


问:
dask groupby apply then merge back to dataframe
I would I go about creating a new column that is the result of a groupby and apply of another column while keeping the order of the dataframe (or at least be able to sort it back).

example:
I want to normalize a signal column by group

```<code>import dask
import numpy as np
import pandas as pd
from dask import dataframe

def normalize(x):
    return ((x - x.mean())/x.std())

data = np.vstack([np.arange(2000), np.random.random(2000), np.round(np.linspace(0, 10, 2000))]).T
df = dataframe.from_array(data, columns=['index', 'signal', 'id_group'], chunksize=100)
df = df.set_index('index')

normalized_signal =  df.groupby('id_group').signal.apply(normalize, meta=pd.Series(name='normalized_signal_by_group'))
normalized_signal.compute()
</code>```

I do get the right series, but the index is shuffled.
I do I get this series back in the dataframe?

I tried

```<code>df['normalized_signal'] = normalized_signal
df.compute()
</code>```

but I get

ValueError: Not all divisions are known, can't align partitions. Please use set_index to set the index.

I also tried a merge, but my final dataframe ends up shuffled with no easy way to resort along the index

```<code>df2 = df.merge(normalized_signal.to_frame(), left_index=True, right_index=True, how='left')
df2.compute()
</code>```

It works when I compute the series than sort_index() in pandas but that doesn't seem efficient.

```<code>df3 = df.merge(normalized_signal.to_frame().compute().sort_index(), left_index=True, right_index=True, how='left')
df3.compute()
</code>```

The equivalent pandas way is :

```<code>df4 = df.compute()
df4['normalized_signal_by_group'] = df4.groupby('id_group').signal.transform(normalize)
df4
</code>```

答:
Unfortunately transform is not implemented in dask yet. My (ugly) workaround is:

```<code>import numpy as np
import pandas as pd
import dask.dataframe as dd

pd.options.mode.chained_assignment = None

def normalize(x):
    return ((x - x.mean())/x.std())

def dask_norm(gp):
    gp["norm_signal"] = normalize(gp["signal"].values)
    return(gp.as_matrix())

data = np.vstack([np.arange(2000), np.random.random(2000), np.round(np.linspace(0, 10, 2000))]).T
df = dd.from_array(data, columns=['index', 'signal', 'id_group'], chunksize=100)
df1 = df.groupby("id_group").apply(dask_norm, meta=pd.Series(name="a") )
df2 = df1.to_frame().compute()
df3 = pd.concat([pd.DataFrame(a) for a in df2.a.values])
df3.columns = ["index", "signal", "id_group", "normalized_signal_by_group"]
df3.sort_values("index", inplace=True)
</code>```

Body:
I would I go about creating a new column that is the result of a groupby and apply of another column while keeping the order of the dataframe (or at least be able to sort it back).

example:
I want to normalize a signal column by group

import dask
import numpy as np
import pandas as pd
from dask import dataframe

def normalize(x):
    return ((x - x.mean())/x.std())

data = np.vstack([np.arange(2000), np.random.random(2000), np.round(np.linspace(0, 10, 2000))]).T
df = dataframe.from_array(data, columns=['index', 'signal', 'id_group'], chunksize=100)
df = df.set_index('index')

normalized_signal =  df.groupby('id_group').signal.apply(normalize, meta=pd.Series(name='normalized_signal_by_group'))
normalized_signal.compute()

I do get the right series, but the index is shuffled.
I do I get this series back in the dataframe?

I tried

df['normalized_signal'] = normalized_signal
df.compute()

but I get

ValueError: Not all divisions are known, can't align partitions. Please use set_index to set the index.

I also tried a merge, but my final dataframe ends up shuffled with no easy way to resort along the index

df2 = df.merge(normalized_signal.to_frame(), left_index=True, right_index=True, how='left')
df2.compute()

It works when I compute the series than sort_index() in pandas but that doesn't seem efficient.

df3 = df.merge(normalized_signal.to_frame().compute().sort_index(), left_index=True, right_index=True, how='left')
df3.compute()

The equivalent pandas way is :

df4 = df.compute()
df4['normalized_signal_by_group'] = df4.groupby('id_group').signal.transform(normalize)
df4

Body:
Unfortunately transform is not implemented in dask yet. My (ugly) workaround is:

import numpy as np
import pandas as pd
import dask.dataframe as dd

pd.options.mode.chained_assignment = None

def normalize(x):
    return ((x - x.mean())/x.std())

def dask_norm(gp):
    gp["norm_signal"] = normalize(gp["signal"].values)
    return(gp.as_matrix())

data = np.vstack([np.arange(2000), np.random.random(2000), np.round(np.linspace(0, 10, 2000))]).T
df = dd.from_array(data, columns=['index', 'signal', 'id_group'], chunksize=100)
df1 = df.groupby("id_group").apply(dask_norm, meta=pd.Series(name="a") )
df2 = df1.to_frame().compute()
df3 = pd.concat([pd.DataFrame(a) for a in df2.a.values])
df3.columns = ["index", "signal", "id_group", "normalized_signal_by_group"]
df3.sort_values("index", inplace=True)


问:
writing applcation using fabric client and fabric ca client SDK for Hyperledger
I am following the below link to learn how to build the Blockchain application using fabric client and fabric ca client.

http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html

When I follow the tutorial I am able to get the required output.

But my doubt is, in invoke.js we have the below line which is used to setup the fabric network.

My doubt is that the network would have setup already with peer, orderer and channels. So in code each and every time should we again setup the network to query or invoke the ledger?

We have already configured the network is there a way that we can get the channel and query/invoke ledger?

If below is the case then tomorrow if there is some change in the network like one more peer is added then should we include that peer in the code?

```<code>var channel = fabric_client.newChannel('mychannel');
var peer = fabric_client.newPeer('grpc://localhost:7051');
channel.addPeer(peer);
var order = fabric_client.newOrderer('grpc://localhost:7050')
channel.addOrderer(order);
</code>```

答:
should we again setup the network to query or invoke the ledger?

If you shutdwon your PC yes, instead, no.

We have already configured the network is there a way that we can get
  the channel and query/invoke ledger?

Yes, there are specific methods as invokeChaincode for it. You have the documentatio about the SDKs here.

If below is the case then tomorrow if there is some change in the
  network like one more peer is added then should we include that peer
  in the code?

Yes, you should add it to the code.

Body:
I am following the below link to learn how to build the Blockchain application using fabric client and fabric ca client.

http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html

When I follow the tutorial I am able to get the required output.

But my doubt is, in invoke.js we have the below line which is used to setup the fabric network.

My doubt is that the network would have setup already with peer, orderer and channels. So in code each and every time should we again setup the network to query or invoke the ledger?

We have already configured the network is there a way that we can get the channel and query/invoke ledger?

If below is the case then tomorrow if there is some change in the network like one more peer is added then should we include that peer in the code?

var channel = fabric_client.newChannel('mychannel');
var peer = fabric_client.newPeer('grpc://localhost:7051');
channel.addPeer(peer);
var order = fabric_client.newOrderer('grpc://localhost:7050')
channel.addOrderer(order);


问:
Retrigger event after clicking away
I have this code that prevents a click event first time I click and resolve second time. But if I click on item 2 and back on item 1 it does not prevent the click event. I want It to start over if I click outside of an item.

JS

```<code>   $('.dropdown').each(function () {

        $(this).find('a').on('click.menuClick', function (e) {

            e.preventDefault();

            $(this).parent().addClass('dropDownClass');
            $(this).off("click.menuClick");

        });
    });
</code>```

html

```<code><ul class="dropdown">
  <li><a href="#">item 1</a></li>
  <li><a href="#">item 2</a></li>
</ul>
</code>```

Here is a fiddle
https://jsfiddle.net/gt1zhcyc/4/

答:
There's a very simple logic around this: instead of relying on .on() and .off() to bind/unbind your custom namespaced click event, you can use .on() + storing the clicked state in the .data() object for your anchor element.

Let's say we store your clicked state with the key of hasClicked in the element. When your  element is clicked, you simply check if .data('hasClicked') is falsy: it will evaluate to false when it is undefined, or it has been set to false. If it is falsy, you set it to true, which stores the state that "Hey, I've been clicked on once before!". Here, you can also reset the clicked state of its siblings:

```<code>if (!$(this).data('hasClicked')) {
  // Store state
  $(this).data('hasClicked', true);

  // Remove clicked state other anchor elements that is not self
  $(this).closest('.dropdown').find('a')
    .not(this)
    .data('hasClicked', false);

  // ...
} else {
  // Clicked the second time, we reset the clicked state
  $(this).data('hasClicked', false);

  // ...
}
</code>```

The second trick you want to bring out is clicking outside these elements to reset the clicked state. You can simply rely on event bubbling: when a click event is fired from your link, you stop it from propagating up to the document. Meanwhile, you set up an identical listener on the document object to catch the click event (which must have emitted outside your anchor element). When this event is caught, you forcibly reset all the clicked states back to false:

```<code>$(document).on('click.menuClick', function(e) {
    $('.dropdown a').data('hasClicked', false);
});
</code>```

The logic below encompasses the answer described above, by combining both logic:

$(function() {
  // Listen to click event on
  $('.dropdown a').on('click.menuClick', function(e) {

    // TODO: Remove this, only for testing
    e.preventDefault();

    // Prevent click event from bubbling
    e.stopPropagation();

    // Check if element has been clicked before
    // If never clicked before, we prevent action and store state
    if (!$(this).data('hasClicked')) {
      // Store state
      $(this).data('hasClicked', true);
      $(this).addClass('hasClicked');
      console.log('Clicked the first time');

      // Remove clicked state other anchor elements that is not self
      $(this).closest('.dropdown').find('a')
        .not(this)
        .data('hasClicked', false)
        .removeClass('hasClicked');
    } else {
      $(this).data('hasClicked', false).removeClass('hasClicked');
      console.log('Second clikc, already clicked once');
    }

  });

  // Listen to bubbling click event on document
  $(document).on('click.menuClick', function(e) {
    $('.dropdown a').data('hasClicked', false).removeClass('hasClicked');
    console.log('Click detected outside, resetting hasClicked state');
  });

});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.hasClicked {
  color: red;
}</code>```

item 1

item 2

```

Title: Retrigger event after clicking away

Body:
I have this code that prevents a click event first time I click and resolve second time. But if I click on item 2 and back on item 1 it does not prevent the click event. I want It to start over if I click outside of an item.

JS

   $('.dropdown').each(function () {

        $(this).find('a').on('click.menuClick', function (e) {

            e.preventDefault();

            $(this).parent().addClass('dropDownClass');
            $(this).off("click.menuClick");

        });
    });

html

item 1

item 2

Here is a fiddle
https://jsfiddle.net/gt1zhcyc/4/

Body:
There's a very simple logic around this: instead of relying on .on() and .off() to bind/unbind your custom namespaced click event, you can use .on() + storing the clicked state in the .data() object for your anchor element.

Let's say we store your clicked state with the key of hasClicked in the element. When your <a> element is clicked, you simply check if .data('hasClicked') is falsy: it will evaluate to false when it is undefined, or it has been set to false. If it is falsy, you set it to true, which stores the state that "Hey, I've been clicked on once before!". Here, you can also reset the clicked state of its siblings:

if (!$(this).data('hasClicked')) {
  // Store state
  $(this).data('hasClicked', true);

  // Remove clicked state other anchor elements that is not self
  $(this).closest('.dropdown').find('a')
    .not(this)
    .data('hasClicked', false);

  // ...
} else {
  // Clicked the second time, we reset the clicked state
  $(this).data('hasClicked', false);

  // ...
}

The second trick you want to bring out is clicking outside these elements to reset the clicked state. You can simply rely on event bubbling: when a click event is fired from your link, you stop it from propagating up to the document. Meanwhile, you set up an identical listener on the document object to catch the click event (which must have emitted outside your anchor element). When this event is caught, you forcibly reset all the clicked states back to false:

$(document).on('click.menuClick', function(e) {
    $('.dropdown a').data('hasClicked', false);
});

The logic below encompasses the answer described above, by combining both logic:

$(function() {
  // Listen to click event on <a>
  $('.dropdown a').on('click.menuClick', function(e) {

    // TODO: Remove this, only for testing
    e.preventDefault();

    // Prevent click event from bubbling
    e.stopPropagation();

    // Check if element has been clicked before
    // If never clicked before, we prevent action and store state
    if (!$(this).data('hasClicked')) {
      // Store state
      $(this).data('hasClicked', true);
      $(this).addClass('hasClicked');
      console.log('Clicked the first time');

      // Remove clicked state other anchor elements that is not self
      $(this).closest('.dropdown').find('a')
        .not(this)
        .data('hasClicked', false)
        .removeClass('hasClicked');
    } else {
      $(this).data('hasClicked', false).removeClass('hasClicked');
      console.log('Second clikc, already clicked once');
    }

  });

  // Listen to bubbling click event on document
  $(document).on('click.menuClick', function(e) {
    $('.dropdown a').data('hasClicked', false).removeClass('hasClicked');
    console.log('Click detected outside, resetting hasClicked state');
  });

});

.hasClicked {
  color: red;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul class="dropdown">
  <li><a href="google.com">item 1</a></li>
  <li><a href="yahoo.com">item 2</a></li>
</ul>


问:
Android Device Chooser -- device not showing up
I'm using Eclipse + ADT, and my physical device (listed below) is unlisted on Android Device Chooser. I have updated Eclipse and all of the Android packages. My phone is running Android OS 1.6, which corresponds to the target version listed in the Eclipse Project.

Also, the reason I decided to try testing on a real device is because the emulator doesn't seem to be working right anymore when I run my project. The emulator launches, but the program never does. Any ideas?

(using windows 7/t-mobile mytouch 3g)

答: One thing to do is swap cables.  I was using one that was only capable of charging!</p>


问:
How to enumerate an enum with String type?
```<code>enum Suit: String {
    case spades = "♠"
    case hearts = "♥"
    case diamonds = "♦"
    case clubs = "♣"
}
</code>```

For example, how can I do something like:

```<code>for suit in Suit {
    // do something with suit
    print(suit.rawValue)
}
</code>```

Resulting example:

```<code>♠
♥
♦
♣
</code>```

答:
You can try to enumerate like this</p>

```<code>enum Planet: String {
    case Mercury
    case Venus
    case Earth
    case Mars

    static var enumerate: [Planet] {
        var a: [Planet] = []
        switch Planet.Mercury {
            case .Mercury: a.append(.Mercury); fallthrough
            case .Venus: a.append(.Venus); fallthrough
            case .Earth: a.append(.Earth); fallthrough
            case .Mars: a.append(.Mars)
        }
    return a
    }
}

Planet.enumerate // [Mercury, Venus, Earth, Mars]
</code>```

Body:
enum Suit: String {
    case spades = "♠"
    case hearts = "♥"
    case diamonds = "♦"
    case clubs = "♣"
}

For example, how can I do something like:

for suit in Suit {
    // do something with suit
    print(suit.rawValue)
}

Resulting example:

♠
♥
♦
♣

Body:
You can try to enumerate like this

enum Planet: String {
    case Mercury
    case Venus
    case Earth
    case Mars

    static var enumerate: [Planet] {
        var a: [Planet] = []
        switch Planet.Mercury {
            case .Mercury: a.append(.Mercury); fallthrough
            case .Venus: a.append(.Venus); fallthrough
            case .Earth: a.append(.Earth); fallthrough
            case .Mars: a.append(.Mars)
        }
    return a
    }
}

Planet.enumerate // [Mercury, Venus, Earth, Mars]

ContentLicense: CC BY-SA 4.0


问:
PaginationAndSortingRepository returning empty
I am working on a application where I need to display some screens with pagination. I started with PaginationAndSortingRepository of Spring Data JPA .All seemed to work fine but when I executed the code I could not get the Data ,it returned empty without any error on eclipse console .

Below is my code for controller :-

```<code>@RequestMapping(value="/monatsultimodata" , method=RequestMethod.Get)
public List<Monatsultimo> getData(Pageable pageable){
List<Monatsultimo> dataList = null ;
try{
dataList= monatsultimoservice.getData(pageable)
}catch(Exception e){
e.printStackTrace();
}
return dataList;
}
</code>```

Below is my service code :-

```<code>public List<Monatsultimo> getData(Pageable pageable){
List<Monatsultimo> tableData = new AarrayList();
monatsultimorepo.findAll(pageable)
return tableData;
}
</code>```

Below is my repository code :-

```<code>@Repository
public interface MonatsultimoRepo extends
PagingAndSortingRepository<MonatSultimo, Integer>{
}
</code>```

Below is my application.yaml file

```<code>    jpa:
        properties:
            hibernate:
                format_sql: true
                show_sql: true
                type: 'debug'
                use_sql_comments: true
                ddl-auto:update
server:
        port: 9000

security:
    basic:
        enabled: false
</code>```

URL I am using to hit the Rest Service - localhhost:9000/Add to dictionary?page=0&size=25

everything goes right ,,till the time it return with no data .Please help me with this ,I have been struggling with it since days .

Thanks in advance ..

答:
Hi to provide paging within your spring application I would apply the following changes:

Controller

```<code>import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.RequestParam;

@RequestMapping(value="/monatsultimodata", method=RequestMethod.Get)
public List<Monatsultimo> getData(final @RequestParam("page") int page,
       final @RequestParam("size") int size)
{
       List<Monatsultimo> dataList = null;

       try
       {
           dataList = monatsultimoservice.getData(new PageRequest(page, size));
       } catch(Exception e)
       {
           // Recommended output to a logger.
           e.printStackTrace();
       }
       return dataList;
}
</code>```

Service

The returned page object contains information such as total pages count - page reference.

```<code>import org.springframework.data.domain.Page;

public List<Monatsultimo> getData(final Pageable pageable)
{
    Page<Monatsultimo> page = monatsultimorepo.findAll(pageable);
    return page.getContent();
}
</code>```

Everything else will remain the same.

Body:
I am working on a application where I need to display some screens with pagination. I started with PaginationAndSortingRepository of Spring Data JPA .All seemed to work fine but when I executed the code I could not get the Data ,it returned empty without any error on eclipse console .

Below is my code for controller :-

@RequestMapping(value="/monatsultimodata" , method=RequestMethod.Get)
public List<Monatsultimo> getData(Pageable pageable){
List<Monatsultimo> dataList = null ;
try{
dataList= monatsultimoservice.getData(pageable)
}catch(Exception e){
e.printStackTrace();
}
return dataList;
}

Below is my service code :-

public List<Monatsultimo> getData(Pageable pageable){
List<Monatsultimo> tableData = new AarrayList();
monatsultimorepo.findAll(pageable)
return tableData;
}

Below is my repository code :-

@Repository
public interface MonatsultimoRepo extends
PagingAndSortingRepository<MonatSultimo, Integer>{
}

Below is my application.yaml file

    jpa:
        properties:
            hibernate:
                format_sql: true
                show_sql: true
                type: 'debug'
                use_sql_comments: true
                ddl-auto:update
server:
        port: 9000

security:
    basic:
        enabled: false

URL I am using to hit the Rest Service - localhhost:9000/Add to dictionary?page=0&size=25

everything goes right ,,till the time it return with no data .Please help me with this ,I have been struggling with it since days .

Thanks in advance ..

Body:
Hi to provide paging within your spring application I would apply the following changes:

Controller

import org.springframework.data.domain.PageRequest;
import org.springframework.web.bind.annotation.RequestParam;

@RequestMapping(value="/monatsultimodata", method=RequestMethod.Get)
public List<Monatsultimo> getData(final @RequestParam("page") int page,
       final @RequestParam("size") int size)
{
       List<Monatsultimo> dataList = null;

       try
       {
           dataList = monatsultimoservice.getData(new PageRequest(page, size));
       } catch(Exception e)
       {
           // Recommended output to a logger.
           e.printStackTrace();
       }
       return dataList;
}

Service

The returned page object contains information such as total pages count - page reference.

import org.springframework.data.domain.Page;

public List<Monatsultimo> getData(final Pageable pageable)
{
    Page<Monatsultimo> page = monatsultimorepo.findAll(pageable);
    return page.getContent();
}

Everything else will remain the same.


问:
Neo4J: How do I check each disjoint subgraph in a Neo4J query?
After I query through my database using Neo4J, I get a bunch of disjoint subgraphs like 'islands of nodes'.

What I want though is to get the most recent node for each 'island' (I have date values on each node).

How do I go about doing that?

答:
Firstly you need to calculate yours islands like you said.
To di it yYou can check the neo4j-graph-algo with the procedure algo.unionFind : https://neo4j-contrib.github.io/neo4j-graph-algorithms/#_community_detection_connected_components

Then for each of your island, you have to order the nodes and take the first one.