[google-appengine] Debug log retention period

2009-06-15 Thread David Wilson

Hi there,

I seem to remember reading in the documentation that request logs are
kept around for 90 days. Does literally apply only to request logs?
Today on trying to determine what happened to a user, I received this
message while trying to search the debug logs:

   Last record searched: 06-12 11:33AM 56.977.

I'd very much like to keep my debug logs around for at least 30 days
(since this is the longest period over which a user account can remain
idle before changing state on my service). Do I need to download the
logs daily using appcfg to preserve them?

Is the debug retention period really only 24 hours?

Thanks,


David



-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to reference model property with a variable?

2009-06-06 Thread David Wilson

value = getattr(model_instance, property_name)

or

setattr(model_instance, property_name, value)


2009/6/6 Ethan Post post.et...@gmail.com:
 I want a method which takes a model object and a dictionary and adds a new
 record to the model using the the dictionary. The problem is I don't know
 how to refer to model.property using a variable. model(property) does not
 work.

 MyTable (db.model):
    location ...

 def Foo (p_model, p_dict):
    for i in p_dict:
   # Here is the tricky part, this does not work but you get the idea.
   p_model(i) = p_dict[i]

    p_model.put()

 def CallFoo:
    m = MyTable()
    d = {key_name:some_key_123,
   location:someplace}
    Foo(m, d)

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Gmail API?

2009-06-05 Thread David Wilson

If all you need is access to the user's address book, the Google
Contacts API works for that AFAIK:

http://code.google.com/apis/contacts/

2009/6/5 GenghisOne mdkach...@gmail.com:

 Is there an API for Gmail and if so is there some documentation that
 explains how to use it?

 Thx much.
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Port 8080

2009-06-05 Thread David Wilson

Are you running any kind of personal firewall product?

2009/6/5 andrijaperovic andrijapero...@gmail.com:

 Hi,

 I have downloaded the Java SDK and Eclipse plugin. I was following
 along with the tutorial for creating the guestbook application (or
 rather running the GuestbookServlet.java), but when I do Run-Debug as-
Web Application i get an error message saying that the port already
 has a bind. I changed the port number in the configurations and sure
 enough in the Eclipse console it says (The server is running at
 http://localhost:8090/). However, when I visit

 localhost:8090/guestbook

 I receive a 'Failed to connect to localhost:8090'. Does anyone know
 what might be the problem?
 Thanks.


 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Sender e-mail addresses travesty

2009-06-01 Thread David Wilson

Anyone?

I've now processed 33 signups using my personal e-mail address.

This-is-going-on-your-permanent-record'ly,


David

2009/5/31 David Wilson d...@botanicus.net:
 Hi there,

 I appear to have gotten myself thoroughly confused as to how I go
 about setting up extra sender addresses for an application. Back when
 I last looked at this, it was apparently as simple as inviting those
 extra addresses to develop the application, but now it seems I need
 SMS verification for each account.

 So I seem to have the choice of:

 1. Use some pokey unreliable external service.
 2. Reuse a completely irrelevant-but-nonetheless-authorized address
 from a previous application, much to the confusion of anyone who
 receives e-mail from my app.
 3. Use my own, personal, private e-mail address to send
 otherwise-completely-unrelated-to-me mail.
 4. Continue to borrow mobile phones from family members to authorize accounts.
 5. Beg on the group for an admin to 'sort me out' every time I have to do 
 this.

 These options universally suck, and I shouldn't have to choose between
 them. What am I missing, or are things really this bad?


 David

 --
 It is better to be wrong than to be vague.
  — Freeman Dyson




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Sender e-mail addresses travesty

2009-05-31 Thread David Wilson

Hi there,

I appear to have gotten myself thoroughly confused as to how I go
about setting up extra sender addresses for an application. Back when
I last looked at this, it was apparently as simple as inviting those
extra addresses to develop the application, but now it seems I need
SMS verification for each account.

So I seem to have the choice of:

1. Use some pokey unreliable external service.
2. Reuse a completely irrelevant-but-nonetheless-authorized address
from a previous application, much to the confusion of anyone who
receives e-mail from my app.
3. Use my own, personal, private e-mail address to send
otherwise-completely-unrelated-to-me mail.
4. Continue to borrow mobile phones from family members to authorize accounts.
5. Beg on the group for an admin to 'sort me out' every time I have to do this.

These options universally suck, and I shouldn't have to choose between
them. What am I missing, or are things really this bad?


David

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Why should I use self.response.out.write?

2009-05-30 Thread David Wilson

2009/5/29 Shedokan shedok...@gmail.com:

 TO make things faster I made two Classes:
 this one for the basic file or folder info:
 class Object(db.Model):
        name = db.StringProperty(multiline=False)
        path = db.StringProperty(multiline=False)
        type = db.StringProperty(multiline=False)
        info = db.StringProperty(multiline=False)

        created = db.DateTimeProperty(auto_now_add=True)
        changed = db.DateTimeProperty(auto_now_add=True)


 and this one for the content of the file:
 class ObjectContent(db.Model):
        name = db.StringProperty(multiline=False)
        path = db.StringProperty(multiline=False)

        contents = db.BlobProperty()

 That way when I'm getting only the files info i don't have to get all
 of it's content.
 And I am getting files like this:
 db.GqlQuery('SELECT * FROM Object WHERE name= :1 AND path= :
 2',name,path)

This makes use of a composite index when you don't need to. Index
access adds around 100ms extra to each Datastore access (see [0] and
[1] below). Instead of using an index on (path, name), you can use a
key_name composed of the path and name. Something like:

key_name = 'X' + path + name
object_entity = Object(key_name=key_name, ...)
content_entity  = ObjectContent(key_name=key_name, contents=contents)

db.put([ object_entity, content_entity ])

Then to query:

entity = ObjectContent.get_by_key_name(key_name)

Note prefixing the key_name with an 'X', to avoid an error if the path
starts with a number. You should also ensure that no distinct
combination of (path, name) will ever lead to the same key_name. If it
can in your application, separate the path and name with some
character that never appears in a path. This is to prevent ambiguous
key_names from being generated, e.g.:

path, name = '/my/site/', 'foo'
bad_key_name = '/my/site/foo' - ambiguous
better_key_name = '/my/site/|foo'

path, name = '/my/', 'site/foo'
bad_key_name = '/my/site/foo' - ambiguous
better_key_name = '/my/|site/foo'

You can save yet more time by fetching the Object and the
ObjectContent simultaneously:

object_entity, content_entity = db.get([
db.Key.from_path('Object', key_name),
db.Key.from_path('ObjectContent, key_name)
])


[0] 
http://code.google.com/status/appengine/detail/datastore/2009/05/23#ae-trust-detail-datastore-get-latency
[1] 
http://code.google.com/status/appengine/detail/datastore/2009/05/23#ae-trust-detail-datastore-query-latency



 and I list all files in a folder like this:
 db.GqlQuery('SELECT * FROM Object WHERE path= :1',path)

 if only I could select parts of the file and not all of the info like
 SQL:
 SELECT name, PATH from ...


 On 29 מאי, 17:19, David Wilson d...@botanicus.net wrote:
 Hey Shedokan,

 Are you fetching your files from Datastore in a batch, or one at a time?

    data = []
    for filename in ['a', 'b', 'c']:
       data.append(SomeModel.get_by_key_name(filename))

 Is significantly slower than:

    keys = [ db.Key.from_path('SomeModel', fn) for fn in [ 'a', 'b', 'c' ] ]
    data = db.get(keys)

 2009/5/29 Shedokan shedok...@gmail.com:





  Thanks, I am worried because I am trying to optimize my app to be
  almost as fast as the php version.

  usualy it takes 250ms for an ajax request(firebug) in the php version
  and 500ms in the python version so python is two times slower than the
  php version.
  but I guess it's because I have to store the files in the datastore
  and not in real directories.

  well thanks anyway.

  On 29 מאי, 04:32, David Wilson d...@botanicus.net wrote:
  Just assume that any string/list/hash/integer-related operations in
  Python are likely faster than you'll ever need them to be. The
  overhead for buffering the response is going to be tiny regardless of
  your application, since at most you're only talking about handling
  strings of up to 10mb (which is the request size limit).

  If there is anything with AppEngine you need to be careful of, it is
  use of Datastore, where reading/writing large numbers of entities will
  cost a lot of performance. Reducing your Datastore use by a single
  db.get() is equal to thousands of calls to self.response.out.write()

  $ python /usr/lib/python2.5/timeit.py -v -s 'from cStringIO import
  StringIO; out = StringIO()'  'out.write(123)'
  1 loops - 0.00373 secs
  10 loops - 0.0383 secs
  100 loops - 0.365 secs
  raw times: 0.358 0.358 0.357
  100 loops, best of 3: 0.357 usec per loop

  $ ae
  Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
  [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
  Type help, copyright, credits or license for more information.
  (AppEngineShell) import time
   t1 = time.time() ; db.get(db.Key.from_path('Foo', 1234)) ; print 
   (time.time()-t1)*1000

  12.839233

  David.

  2009/5/29 Shedokan shedok...@gmail.com:

   Thanks, but does self.response.out affects speed very much?
   I couldn't benchmark it, strange...

   On 28 מאי, 22

[google-appengine] Re: Why should I use self.response.out.write?

2009-05-30 Thread David Wilson

Correct.. fetching by key_name obviously will only work when you know
the exactly key you want. :) Otherwise it needs to be a Query.

2009/5/30 Shedokan shedok...@gmail.com:

 Thanks, I didn't think of that probably because I'm new to python.
 But if I would want to get all files and folders in a path then I woul
 get them by path and name instead of by key, right?

 On 30 מאי, 15:16, David Wilson d...@botanicus.net wrote:
 2009/5/29 Shedokan shedok...@gmail.com:





  TO make things faster I made two Classes:
  this one for the basic file or folder info:
  class Object(db.Model):
         name = db.StringProperty(multiline=False)
         path = db.StringProperty(multiline=False)
         type = db.StringProperty(multiline=False)
         info = db.StringProperty(multiline=False)

         created = db.DateTimeProperty(auto_now_add=True)
         changed = db.DateTimeProperty(auto_now_add=True)

  and this one for the content of the file:
  class ObjectContent(db.Model):
         name = db.StringProperty(multiline=False)
         path = db.StringProperty(multiline=False)

         contents = db.BlobProperty()

  That way when I'm getting only the files info i don't have to get all
  of it's content.
  And I am getting files like this:
  db.GqlQuery('SELECT * FROM Object WHERE name= :1 AND path= :
  2',name,path)

 This makes use of a composite index when you don't need to. Index
 access adds around 100ms extra to each Datastore access (see [0] and
 [1] below). Instead of using an index on (path, name), you can use a
 key_name composed of the path and name. Something like:

     key_name = 'X' + path + name
     object_entity = Object(key_name=key_name, ...)
     content_entity  = ObjectContent(key_name=key_name, contents=contents)

     db.put([ object_entity, content_entity ])

 Then to query:

     entity = ObjectContent.get_by_key_name(key_name)

 Note prefixing the key_name with an 'X', to avoid an error if the path
 starts with a number. You should also ensure that no distinct
 combination of (path, name) will ever lead to the same key_name. If it
 can in your application, separate the path and name with some
 character that never appears in a path. This is to prevent ambiguous
 key_names from being generated, e.g.:

     path, name = '/my/site/', 'foo'
     bad_key_name = '/my/site/foo' - ambiguous
     better_key_name = '/my/site/|foo'

     path, name = '/my/', 'site/foo'
     bad_key_name = '/my/site/foo' - ambiguous
     better_key_name = '/my/|site/foo'

 You can save yet more time by fetching the Object and the
 ObjectContent simultaneously:

     object_entity, content_entity = db.get([
         db.Key.from_path('Object', key_name),
         db.Key.from_path('ObjectContent, key_name)
     ])

 [0]http://code.google.com/status/appengine/detail/datastore/2009/05/23#a...
 [1]http://code.google.com/status/appengine/detail/datastore/2009/05/23#a...





  and I list all files in a folder like this:
  db.GqlQuery('SELECT * FROM Object WHERE path= :1',path)

  if only I could select parts of the file and not all of the info like
  SQL:
  SELECT name, PATH from ...

  On 29 מאי, 17:19, David Wilson d...@botanicus.net wrote:
  Hey Shedokan,

  Are you fetching your files from Datastore in a batch, or one at a time?

     data = []
     for filename in ['a', 'b', 'c']:
        data.append(SomeModel.get_by_key_name(filename))

  Is significantly slower than:

     keys = [ db.Key.from_path('SomeModel', fn) for fn in [ 'a', 'b', 'c' ] 
  ]
     data = db.get(keys)

  2009/5/29 Shedokan shedok...@gmail.com:

   Thanks, I am worried because I am trying to optimize my app to be
   almost as fast as the php version.

   usualy it takes 250ms for an ajax request(firebug) in the php version
   and 500ms in the python version so python is two times slower than the
   php version.
   but I guess it's because I have to store the files in the datastore
   and not in real directories.

   well thanks anyway.

   On 29 מאי, 04:32, David Wilson d...@botanicus.net wrote:
   Just assume that any string/list/hash/integer-related operations in
   Python are likely faster than you'll ever need them to be. The
   overhead for buffering the response is going to be tiny regardless of
   your application, since at most you're only talking about handling
   strings of up to 10mb (which is the request size limit).

   If there is anything with AppEngine you need to be careful of, it is
   use of Datastore, where reading/writing large numbers of entities will
   cost a lot of performance. Reducing your Datastore use by a single
   db.get() is equal to thousands of calls to self.response.out.write()

   $ python /usr/lib/python2.5/timeit.py -v -s 'from cStringIO import
   StringIO; out = StringIO()'  'out.write(123)'
   1 loops - 0.00373 secs
   10 loops - 0.0383 secs
   100 loops - 0.365 secs
   raw times: 0.358 0.358 0.357
   100 loops, best of 3: 0.357 usec per loop

   $ ae
   Python 2.5.1 (r251:54863, Feb

[google-appengine] Re: Why should I use self.response.out.write?

2009-05-29 Thread David Wilson

Hey Shedokan,

Are you fetching your files from Datastore in a batch, or one at a time?

   data = []
   for filename in ['a', 'b', 'c']:
  data.append(SomeModel.get_by_key_name(filename))

Is significantly slower than:

   keys = [ db.Key.from_path('SomeModel', fn) for fn in [ 'a', 'b', 'c' ] ]
   data = db.get(keys)


2009/5/29 Shedokan shedok...@gmail.com:

 Thanks, I am worried because I am trying to optimize my app to be
 almost as fast as the php version.

 usualy it takes 250ms for an ajax request(firebug) in the php version
 and 500ms in the python version so python is two times slower than the
 php version.
 but I guess it's because I have to store the files in the datastore
 and not in real directories.

 well thanks anyway.

 On 29 מאי, 04:32, David Wilson d...@botanicus.net wrote:
 Just assume that any string/list/hash/integer-related operations in
 Python are likely faster than you'll ever need them to be. The
 overhead for buffering the response is going to be tiny regardless of
 your application, since at most you're only talking about handling
 strings of up to 10mb (which is the request size limit).

 If there is anything with AppEngine you need to be careful of, it is
 use of Datastore, where reading/writing large numbers of entities will
 cost a lot of performance. Reducing your Datastore use by a single
 db.get() is equal to thousands of calls to self.response.out.write()

 $ python /usr/lib/python2.5/timeit.py -v -s 'from cStringIO import
 StringIO; out = StringIO()'  'out.write(123)'
 1 loops - 0.00373 secs
 10 loops - 0.0383 secs
 100 loops - 0.365 secs
 raw times: 0.358 0.358 0.357
 100 loops, best of 3: 0.357 usec per loop

 $ ae
 Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
 [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
 Type help, copyright, credits or license for more information.
 (AppEngineShell) import time
  t1 = time.time() ; db.get(db.Key.from_path('Foo', 1234)) ; print 
  (time.time()-t1)*1000

 12.839233

 David.

 2009/5/29 Shedokan shedok...@gmail.com:







  Thanks, but does self.response.out affects speed very much?
  I couldn't benchmark it, strange...

  On 28 מאי, 22:25, David Wilson d...@botanicus.net wrote:
  Using self.response.out will also delay sending your entire response
  until it is sure to succeed.

  If you start generating output using 'print', and then e.g. a
  Datastore request times out, or a bug in your code is triggered, you
  have no chance to display a friendly error message. Instead the user
  will get a half-rendered page with a stack trace embedded in it, or
  worse.

  David.

  2009/5/28 Shedokan shedok...@gmail.com:

   so I can't print binary data like Images?

   On 28 מאי, 21:03, 风笑雪 kea...@gmail.com wrote:
   Print is also OK, but you need handle header by yourself, and it can 
   only
   output 
   text.http://code.google.com/intl/en/appengine/docs/python/gettingstarted/h...

   print 'Content-Type: text/plain'
   print ''
   print 'Hello, world!'

   2009/5/29 Shedokan shedok...@gmail.com

I am wondering why should I use self.response.out.write and not print
everything.

because I am making this app where I have to output from a lot
ofdifferent functions and I am passing the object 'self' everywhere.

thanks.

  --
  It is better to be wrong than to be vague.
    — Freeman Dyson

 --
 It is better to be wrong than to be vague.
   — Freeman Dyson
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: time and date sync service in google cluster

2009-05-28 Thread David Wilson

Hey cryb,

Going by a *very* shoddy test a few months ago, _most_ nodes seem to
be within a second of each other, although I did get one or two
requests that were +/- 10 seconds off average. Based on that, it's
fair to expect around one second's accuracy most of the time.

In any case, I've since changed my own app's design such that it
doesn't have a reliance on accurate timing from AppEngine, and I
believe many designs can be changed similarly. If you need microsecond
accuracy, you're probably building on the wrong platform. :-)


David

2009/5/28 cryb cbuti...@gmail.com:

 Hello.
 Although it should be obvious, the Google cluster should provide a
 time and date synchronization service for all its nodes.
 I've done some search on the internet and I went through appengine
 docs, but I didn't find any reference that states this.
 I know that this should be common sense, but I just want to make sure.
 So my question is: does google cluster guarantees time and date sync
 among its nodes?
 I ask this because I need it for expiration primitives that won't work
 properly if such a service is not in place.
 Thanks.

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Why should I use self.response.out.write?

2009-05-28 Thread David Wilson

Using self.response.out will also delay sending your entire response
until it is sure to succeed.

If you start generating output using 'print', and then e.g. a
Datastore request times out, or a bug in your code is triggered, you
have no chance to display a friendly error message. Instead the user
will get a half-rendered page with a stack trace embedded in it, or
worse.


David.

2009/5/28 Shedokan shedok...@gmail.com:

 so I can't print binary data like Images?

 On 28 מאי, 21:03, 风笑雪 kea...@gmail.com wrote:
 Print is also OK, but you need handle header by yourself, and it can only
 output 
 text.http://code.google.com/intl/en/appengine/docs/python/gettingstarted/h...

 print 'Content-Type: text/plain'
 print ''
 print 'Hello, world!'

 2009/5/29 Shedokan shedok...@gmail.com



  I am wondering why should I use self.response.out.write and not print
  everything.

  because I am making this app where I have to output from a lot
  ofdifferent functions and I am passing the object 'self' everywhere.

  thanks.
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: gwave vs a waveform

2009-05-28 Thread David Wilson

It sounds like your product just got a whole load of free publicity,
if you play it right. :-)


David.

2009/5/28 Nash-t timna...@gmail.com:

 I'm not accusing anybody of anything but from what I can see of the
 new wave product, it looks a lot like my waveforms. They both are
 essentially enhanced structured email which allow collaborative work.
 Waveforms can also embed flash, docs, spreadsheets, twitter gadgets,
 videos, etc., and drag-n-drop is on my road map. San Mateo Waveforms
 runs on app engine and I wouldn't be surprised to find that google
 wave runs on app engine as well.

 smw.appspot.com
 http://tr.im/mGYd

 I am posting here because I want to get feedback from other app engine
 developers.  My ultimate goal with waveforms is to apply them to
 healthcare. (most hospitals around the world cannot afford expensive
 EMR solutions). What would you do if you were in my shoes?


 Thanks
 Tim Nash
 Lead Developer
 SanMateoWaveforms.com
 http://tr.im/mGYs
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Why should I use self.response.out.write?

2009-05-28 Thread David Wilson

Just assume that any string/list/hash/integer-related operations in
Python are likely faster than you'll ever need them to be. The
overhead for buffering the response is going to be tiny regardless of
your application, since at most you're only talking about handling
strings of up to 10mb (which is the request size limit).

If there is anything with AppEngine you need to be careful of, it is
use of Datastore, where reading/writing large numbers of entities will
cost a lot of performance. Reducing your Datastore use by a single
db.get() is equal to thousands of calls to self.response.out.write()

$ python /usr/lib/python2.5/timeit.py -v -s 'from cStringIO import
StringIO; out = StringIO()'  'out.write(123)'
1 loops - 0.00373 secs
10 loops - 0.0383 secs
100 loops - 0.365 secs
raw times: 0.358 0.358 0.357
100 loops, best of 3: 0.357 usec per loop

$ ae
Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type help, copyright, credits or license for more information.
(AppEngineShell)
 import time
 t1 = time.time() ; db.get(db.Key.from_path('Foo', 1234)) ; print 
 (time.time()-t1)*1000
12.839233


David.

2009/5/29 Shedokan shedok...@gmail.com:

 Thanks, but does self.response.out affects speed very much?
 I couldn't benchmark it, strange...


 On 28 מאי, 22:25, David Wilson d...@botanicus.net wrote:
 Using self.response.out will also delay sending your entire response
 until it is sure to succeed.

 If you start generating output using 'print', and then e.g. a
 Datastore request times out, or a bug in your code is triggered, you
 have no chance to display a friendly error message. Instead the user
 will get a half-rendered page with a stack trace embedded in it, or
 worse.

 David.

 2009/5/28 Shedokan shedok...@gmail.com:







  so I can't print binary data like Images?

  On 28 מאי, 21:03, 风笑雪 kea...@gmail.com wrote:
  Print is also OK, but you need handle header by yourself, and it can only
  output 
  text.http://code.google.com/intl/en/appengine/docs/python/gettingstarted/h...

  print 'Content-Type: text/plain'
  print ''
  print 'Hello, world!'

  2009/5/29 Shedokan shedok...@gmail.com

   I am wondering why should I use self.response.out.write and not print
   everything.

   because I am making this app where I have to output from a lot
   ofdifferent functions and I am passing the object 'self' everywhere.

   thanks.

 --
 It is better to be wrong than to be vague.
   — Freeman Dyson
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: How to Convert a time.struct_time into a db.DateTimeProperty field?

2009-05-27 Thread David Wilson

Hey Neal,

Try:

dt = datetime.datetime.fromtimestamp(time.mktime(struct_time))
your_model.your_dt = dt


David

2009/5/27 NealWalters nealwalt...@nealwalters.com:

 Also tried this:
 mytable1.eventStartedDateTime = time.mktime(fixdate(xmlDate))

 still gives error:

 Traceback (most recent call last):
  File DateConversion1.py, line 33, in module
    mytable1.eventStartedDateTime = time.mktime(fixdate(xmlDate))
  File c:\Program Files\Google\google_appengine\google\appengine\ext
 \db\__init__.py, line 396, in __set__
    value = self.validate(value)
  File c:\Program Files\Google\google_appengine\google\appengine\ext
 \db\__init__.py, line 1985, in validate
    (self.name, self.data_type.__name__))
 google.appengine.api.datastore_errors.BadValueError: Property
 eventStartedDateTime must be a datetime


 Neal
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Path from Key

2009-05-26 Thread David Wilson

Hey Colin,

I've been using this:

def key_to_path(model):
key = model.key()
output = []

while key:
name = key.name()
if name is None:
output.append(key.id())
else:
output.append(name)

output.append(key.kind())
key = key.parent()

output.reverse()
return output


2009/5/26 Nick Johnson (Google) nick.john...@google.com:

 Hi Colin,

 You're correct - there's currently no built-in method to do this, and
 recursively (or iteratively, with a stack) calling key.parent() is
 your best option.

 -Nick Johnson

 On Mon, May 25, 2009 at 3:17 AM, hawkett hawk...@gmail.com wrote:

 Hi,

   There is a method Key.from_path() - which lets you supply the path
 to construct the key.  Is there a way to retrieve the path from a key
 object? i.e. Key.path()?  If not, is there a way to determine the path
 from the key?  Is recursively calling Key.parent() until you get
 'None' the only way to do this?  It would be nice to make a single
 call to get a list of the keys to the parent.

   Thanks,

 Colin


 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Testing same-origin dependent apps in production.

2009-05-20 Thread David Wilson

For the archives, this simple mod_proxy setup appears to work perfectly:

VirtualHost staging:80
ServerName www-staging.domain.com
ProxyPassMatch (.*) http://staging.latest.appid.appspot.com$1
ProxyPassReverse / http://staging.latest.appid.appspot.com/
/VirtualHost


David

2009/5/19 David Wilson d...@botanicus.net:
 Hi there,

 I'm coming close to making my application live, and find myself
 worrying about how I'll safely roll out changes to it in the future.

 My problem is that I can't use *.appspot.com alternative version URLs
 for testing, since the application relies on setting cookies that
 another component within a subdomain of my main domain needs to
 authenticate browser clients, and also to allow cross-IFRAME
 communications with that subdomain (see
 http://en.wikipedia.org/wiki/Same_origin_policy ).

 My setup is such:

     www.domain.com - main application
     events1.domain.com - component requiring cookies and same-origin.

 Accessing an alternative version via appspot.com will fail, since from
 a browser's perspective, events1.domain.com lies in a different
 security zone to appspot.com.

 The only thing I can think of is it set up a proxy server within
 domain.com, say, www-dev.domain.com, which rewrites the Host: header
 and passes the request on the alternative version running inside
 appspot.com, but I've suspicions that this setup won't work for as yet
 undiscovered reasons.

 I can disable same origin restrictions on AJAX in Firefox using a
 special about:config option, but this doesn't apply to Internet
 Explorer, and it also doesn't apply to setting cookies.

 Ideas?


 David.

 --
 It is better to be wrong than to be vague.
  — Freeman Dyson




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Testing same-origin dependent apps in production.

2009-05-19 Thread David Wilson

Hi there,

I'm coming close to making my application live, and find myself
worrying about how I'll safely roll out changes to it in the future.

My problem is that I can't use *.appspot.com alternative version URLs
for testing, since the application relies on setting cookies that
another component within a subdomain of my main domain needs to
authenticate browser clients, and also to allow cross-IFRAME
communications with that subdomain (see
http://en.wikipedia.org/wiki/Same_origin_policy ).

My setup is such:

 www.domain.com - main application
 events1.domain.com - component requiring cookies and same-origin.

Accessing an alternative version via appspot.com will fail, since from
a browser's perspective, events1.domain.com lies in a different
security zone to appspot.com.

The only thing I can think of is it set up a proxy server within
domain.com, say, www-dev.domain.com, which rewrites the Host: header
and passes the request on the alternative version running inside
appspot.com, but I've suspicions that this setup won't work for as yet
undiscovered reasons.

I can disable same origin restrictions on AJAX in Firefox using a
special about:config option, but this doesn't apply to Internet
Explorer, and it also doesn't apply to setting cookies.

Ideas?


David.

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Google app engine issues

2009-05-15 Thread David Wilson

Hey Paul.

Are you authenticating, or querying the API anonymously? Anonymous
queries regularly get rate limit exceeed errors from AppEngine,
since Twitter limit IP addresses to 100 queries per hour, and
AppEngine urlfetch service only makes requests from a small set of
addresses.

The solution is to create Twitter account(s) for your application, or
if it is acting on behalf of specific Twitter users, add OAuth
consumer support to your code and have the users authorize your
application, so the queries are charged to their accounts instead.

If you are getting ApplicationError exceptions, well that is something
altogether different.


David

2009/5/14 Paul Kinlan paul.kin...@gmail.com:
 Hi Guys,

 My Site www.twollo.com is having some issues connection to Twitter.  It is
 hosted on the Google App Engine.  I am just emailing to ask is anyone else
 on the App engine experiencing problems connecting to Twitter?

 I have tested some of my other sites that use urllib on the Google App
 engine and all appear to be able to make successful http connections to
 other sites: such as yahoo etc.

 I have also tested some other Twitter Applications that I know that are
 hosted on the App Engine.  I am trying to isolate the problem, is it the App
 Engine end, is it Twitter (have they blocked Google) Any ideas are
 welcome?

 Hopefully it will right itself. :)

 Paul
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Application Identifiers

2009-05-13 Thread David Wilson

Hey Sri,

For whatever strange reason, App IDs that conflict with Gmail
usernames are reserved by default. That means if
legendofthefiveri...@gmail.com is somebody's e-mail address, you can't
use it for your appspot domain.


David

2009/5/12 Sri sri.pan...@gmail.com:

 Does GAE place any restrictions on app engine titles via some
 automatic algorithms?  I mean it may just be squatters doing what they
 do best, but does Google place any restrictions?  Like dictionary
 words or plurals of existing games etc?

 I am not looking for any rude or obscene words but when writing a game
 a lot of legend related titles seem to be taken.  Surely there cant
 be that many games out there on app engine right?

 cheers
 Sri
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: PyCrypto Access

2009-05-05 Thread David Wilson

Seems there is native code there for various ciphers and hashes. Just
include the Python parts of PyCrypto in your project. Try running:

[ x for x in sys.modules.keys() if 'ypt' in x ]

on http://shell.appspot.com


David

2009/5/5 Devel63 danstic...@gmail.com:

 What??  How does this reconcile with the 1.2.1 announcement:

    App Engine includes a custom version of the Python Cryptography
 Toolkit, also known as PyCrypto.
    The version included with App Engine is based on pycrypto 2.0.1.
 This is not the latest version, but
    should be largely compatible with more recent versions.

    http://code.google.com/appengine/docs/python/tools/libraries.html


 On May 5, 7:54 am, Nick Johnson (Google) nick.john...@google.com
 wrote:
 PyCrypto is a third-party library. If it is installed, it will be in
 your Python install's site-packages directory, not under the App
 Engine SDK.

 -Nick Johnson
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: sort on _key_ out of order

2009-04-18 Thread David Wilson


thanks! i missed that in the docs :)

I wasnt using a datetime just to save a bit of space, but i can see i
need to know to guarantee ordering, or if i want to do ordered paging
via key i would need to handle key creation myself to make sure they
are in order.

This becomes harder in one case for me as users can create designs
that need to be paged through in creation order. There will be too
much contention on a glodal counter for this, so i guess an offset
page on date is the best i can do for now. Or just not worry when some
'new designs' are out of order.



On Apr 18, 2:20 am, David Symonds dsymo...@gmail.com wrote:
 On Sat, Apr 18, 2009 at 3:21 PM, David Wilson

 david.wil...@entertainmentcloud.com wrote:
  Is this expected behaviour? and thus do i need to always give a
  key_name to guarantee order? this creates scaling issues for order
  counter (which is probably why its not in order in the backend :) )

 Keys are only guaranteed to be unique, not sequential or in order:
  http://code.google.com/appengine/docs/python/datastore/keysandentityg...

 What is wrong with giving your models a timestamp property (with
 auto_now_add=True), and sorting by that?

 Dave.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Suggestion: delete google-appengine group.

2009-04-17 Thread David Wilson

This might seem drastic, but it will solve the problem of lots of Java
and Python-specific stuff hitting this group.

I think it would be less of a crime if language-independent issues
were discussed in the Java/Python groups, rather than the other way
around, because in this solution, a pure-Java or pure-Python developer
can elect to halve (if not more) his incoming mail by simply not
subscribing to the other group.

In the current scheme, a pure-X developer is compelled subscribe to
the meta group, which will continue to suffer at increasing levels
from the current problem of mis-targeted mails. :)  (If I had to
guess, I'd say that mail volume to google-appengine is going to at
least double in the next 6 months due to the Java release).

Nip the problem in the butt!


David

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Suggestion: delete google-appengine group.

2009-04-17 Thread David Wilson

2009/4/17 David Wilson d...@botanicus.net:

 Nip the problem in the butt!

Hah, I meant bud. :)


David.

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Should I take my website somewhere else? - blocked in China

2009-04-08 Thread David Wilson

2009/4/8 Andy selforgani...@gmail.com:

 Perhaps psychiatric help would be a better option than disrupting
 Internet forum by openly acting out your Google employee fantasy.


Great idea, Andy! Now, how about giving all 6958 of our inboxes a
break from your ego, eh?

Thanks,


David.


 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 2 appengine accounts under same email woes, including login: admin problems

2009-04-06 Thread David Wilson

anyone looking at this please!

My app is ready to go live and we need admin rights :)


On Apr 1, 2:39 pm, David Wilson david.wil...@entertainmentcloud.com
wrote:
 scrap the last post, it turns out that a colleague had removed the
 admin requirement to the url path.

 After i put it back on and tried to access the path, i get a

 Error: Server Error
 The server encountered an error and could not complete your request.

 help!

 On Mar 31, 7:37 pm, David Wilson david.wil...@entertainmentcloud.com
 wrote:

  as a further note to this i have found that setting the application to
  use google apps authentication, lets me login to admin rights. using
  my email.

  On Mar 31, 7:16 pm, David Wilson david.wil...@entertainmentcloud.com
  wrote:

   Hi

   Im having some problems related to appengine admin access. This is
   complicated to explain, but here goes:

   (im using fake names here, the real domain is in my email address)

   I originally had a google appengine account under a google apps
   domain  mydomain.com

   Where I would sign into appegnine 
   likehttp://appengine.google.com/a/mydomain.com

   Using myn...@mydomain.com as the user name.

   I then didn’t use appengine for a long time, and in this time I
   created a google account under myn...@mydomain.com so I could use
   other services.

   I then came back to app engine and forgot that I needed to sign in
   using the way shown above, and signed in using my regular google
   account. This needed re-authenticating via sms (which I thought was
   odd, but figured it timed out due to lack of use).

   So now I seem to have 2 appengine accounts under the same email.

   But if I create a new application with the regular account, it dose
   not appear there, but in the apps account.

   BUT applications created in the apps account will not let me log using
   admin rights to any pages using login: admin

   Please help!

   David.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 2 appengine accounts under same email woes, including login: admin problems

2009-04-06 Thread David Wilson


i created a new apps login, and gave this admin rights to the app.

I then removed the original user from the app. But i still get a
server error when trying to navigate to the admin restricted content.

we have a lot of data in this app now so i dont really want to have to
start again.

not ideal!  _





On Apr 6, 11:38 am, David Wilson david.wil...@entertainmentcloud.com
wrote:
 hi thanks for the reply.

 no the account is set to use Google Apps accounts and was created
 using the correcthttp://appengine.google.com/a/mydomain.comlogin. so
 this seems like a related but different issue to me.

 i will try to give another google apps account member admin rights,
 and see if they can log in.

 and ill also add my issue to the post given above.

 On Apr 6, 10:55 am, Jeff S j...@google.com wrote:

  Hi David,

  Is the app you are trying to sign in to set to use Google Accounts
  (not Google Apps accounts)? If so, this is a known issue:

 http://code.google.com/p/googleappengine/issues/detail?id=428

  I think the simplest solution for now would be to create a different
  Google Account, one which is not associated with Google Apps, and add
  it as an admin for this app.

  Cheers,

  Jeff

  On Mar 31, 7:16 pm, David Wilson david.wil...@entertainmentcloud.com
  wrote:

   Hi

   Im having some problems related to appengine admin access. This is
   complicated to explain, but here goes:

   (im using fake names here, the real domain is in my email address)

   I originally had a google appengine account under a google apps
   domain  mydomain.com

   Where I would sign into appegnine 
   likehttp://appengine.google.com/a/mydomain.com

   Using myn...@mydomain.com as the user name.

   I then didn’t use appengine for a long time, and in this time I
   created a google account under myn...@mydomain.com so I could use
   other services.

   I then came back to app engine and forgot that I needed to sign in
   using the way shown above, and signed in using my regular google
   account. This needed re-authenticating via sms (which I thought was
   odd, but figured it timed out due to lack of use).

   So now I seem to have 2 appengine accounts under the same email.

   But if I create a new application with the regular account, it dose
   not appear there, but in the apps account.

   BUT applications created in the apps account will not let me log using
   admin rights to any pages using login: admin

   Please help!

   David.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 2 appengine accounts under same email woes, including login: admin problems

2009-04-06 Thread David Wilson


hi thanks for the reply.

no the account is set to use Google Apps accounts and was created
using the correct http://appengine.google.com/a/mydomain.com login. so
this seems like a related but different issue to me.

i will try to give another google apps account member admin rights,
and see if they can log in.

and ill also add my issue to the post given above.



On Apr 6, 10:55 am, Jeff S j...@google.com wrote:
 Hi David,

 Is the app you are trying to sign in to set to use Google Accounts
 (not Google Apps accounts)? If so, this is a known issue:

 http://code.google.com/p/googleappengine/issues/detail?id=428

 I think the simplest solution for now would be to create a different
 Google Account, one which is not associated with Google Apps, and add
 it as an admin for this app.

 Cheers,

 Jeff

 On Mar 31, 7:16 pm, David Wilson david.wil...@entertainmentcloud.com
 wrote:

  Hi

  Im having some problems related to appengine admin access. This is
  complicated to explain, but here goes:

  (im using fake names here, the real domain is in my email address)

  I originally had a google appengine account under a google apps
  domain  mydomain.com

  Where I would sign into appegnine 
  likehttp://appengine.google.com/a/mydomain.com

  Using myn...@mydomain.com as the user name.

  I then didn’t use appengine for a long time, and in this time I
  created a google account under myn...@mydomain.com so I could use
  other services.

  I then came back to app engine and forgot that I needed to sign in
  using the way shown above, and signed in using my regular google
  account. This needed re-authenticating via sms (which I thought was
  odd, but figured it timed out due to lack of use).

  So now I seem to have 2 appengine accounts under the same email.

  But if I create a new application with the regular account, it dose
  not appear there, but in the apps account.

  BUT applications created in the apps account will not let me log using
  admin rights to any pages using login: admin

  Please help!

  David.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Data Modeling and Efficiency Question

2009-04-06 Thread David Wilson


an ordered fetch via priority will index the data efficiently to fetch
the first 10 without going over the rest of the data. Then place the
result into memcache for subsequent requests, with a daily expiry
time.


On Apr 6, 8:51 pm, codingJoe coding...@gmail.com wrote:
 Forgot to ask, is there a better or more elegant way to design my app
 for that type a feature?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: SSL Socket connections

2009-04-04 Thread David Wilson

Hi Jeremy,

Since AppEngine doesn't yet support sockets of any kind, this is a non-starter.


David.

2009/4/3 jeremysomething jeremyschoenh...@gmail.com:

 Has anyone implemented a SSL/TLS client connection from their GAE app?

 There's this lib http://trevp.net/tlslite/

 Just curious if anyone has any advice or samples I could check out. I
 basically want to be able to connect to a remote SSL port with a given
 cert.. And then push a bunch of data..

 Thanks!

 //jeremy
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 2 appengine accounts under same email woes, including login: admin problems

2009-04-01 Thread David Wilson


scrap the last post, it turns out that a colleague had removed the
admin requirement to the url path.

After i put it back on and tried to access the path, i get a

Error: Server Error
The server encountered an error and could not complete your request.

help!




On Mar 31, 7:37 pm, David Wilson david.wil...@entertainmentcloud.com
wrote:
 as a further note to this i have found that setting the application to
 use google apps authentication, lets me login to admin rights. using
 my email.

 On Mar 31, 7:16 pm, David Wilson david.wil...@entertainmentcloud.com
 wrote:

  Hi

  Im having some problems related to appengine admin access. This is
  complicated to explain, but here goes:

  (im using fake names here, the real domain is in my email address)

  I originally had a google appengine account under a google apps
  domain  mydomain.com

  Where I would sign into appegnine 
  likehttp://appengine.google.com/a/mydomain.com

  Using myn...@mydomain.com as the user name.

  I then didn’t use appengine for a long time, and in this time I
  created a google account under myn...@mydomain.com so I could use
  other services.

  I then came back to app engine and forgot that I needed to sign in
  using the way shown above, and signed in using my regular google
  account. This needed re-authenticating via sms (which I thought was
  odd, but figured it timed out due to lack of use).

  So now I seem to have 2 appengine accounts under the same email.

  But if I create a new application with the regular account, it dose
  not appear there, but in the apps account.

  BUT applications created in the apps account will not let me log using
  admin rights to any pages using login: admin

  Please help!

  David.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: New Runtime Language Announced!

2009-04-01 Thread David Wilson


 finally!! my life is complete _


On Apr 1, 2:35 pm, Jeff S j...@google.com wrote:
 Hi all,

 I'm pleased as punch to share with you the details on the new runtime
 language available for App Engine. We announced it on our blog:

 http://googleappengine.blogspot.com/2009/04/brand-new-language-on-goo...

 From the blog post:

 
 It's been almost a year since we've launched App Engine with support
 for Python, and what a year it's been! We've gotten fantastic feedback
 from developers, and we've released loads of new features! When we
 launched, we promised support for another runtime language, and indeed
 this has been among the most requested features from our developers
 since day one.

 Well, we fed Google's new CADIE Strategic Decision Maker the App
 Engine issue tracker, our groups, and various blog posts around the
 internet to help select a new runtime language for App Engine. Today
 we're excited to officially announce support for FORTRAN 77!

 If you're an enterprise customer and want to take advantage of Google
 App Engine, but have a large and cumbersome legacy system, we want to
 make it easy for you to port to the cloud. By providing a Fortran 77
 runtime, along with a familiar, easy-to-use deployment mechanism, we
 hope to make this process efficient and straightforward.

 Want to give it a try? Download our SDK and deploy your application by
 mailing punch cards to:

 Google App Engine, C/O APPCFG
 1600 Amphitheatre Pkwy
 Mountain View, CA 94043

 and we'll take care of the rest! We welcome your feedback on our
 newest addition to the App Engine family--you can discuss it on our
 Google Group!
 

 So there you have it, let's discuss!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] 2 appengine accounts under same email woes, including login: admin problems

2009-03-31 Thread David Wilson

Hi


Im having some problems related to appengine admin access. This is
complicated to explain, but here goes:

(im using fake names here, the real domain is in my email address)

I originally had a google appengine account under a google apps
domain  mydomain.com

Where I would sign into appegnine like 
http://appengine.google.com/a/mydomain.com

Using myn...@mydomain.com as the user name.


I then didn’t use appengine for a long time, and in this time I
created a google account under myn...@mydomain.com so I could use
other services.

I then came back to app engine and forgot that I needed to sign in
using the way shown above, and signed in using my regular google
account. This needed re-authenticating via sms (which I thought was
odd, but figured it timed out due to lack of use).

So now I seem to have 2 appengine accounts under the same email.

But if I create a new application with the regular account, it dose
not appear there, but in the apps account.

BUT applications created in the apps account will not let me log using
admin rights to any pages using login: admin

Please help!

David.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 2 appengine accounts under same email woes, including login: admin problems

2009-03-31 Thread David Wilson


as a further note to this i have found that setting the application to
use google apps authentication, lets me login to admin rights. using
my email.





On Mar 31, 7:16 pm, David Wilson david.wil...@entertainmentcloud.com
wrote:
 Hi

 Im having some problems related to appengine admin access. This is
 complicated to explain, but here goes:

 (im using fake names here, the real domain is in my email address)

 I originally had a google appengine account under a google apps
 domain  mydomain.com

 Where I would sign into appegnine 
 likehttp://appengine.google.com/a/mydomain.com

 Using myn...@mydomain.com as the user name.

 I then didn’t use appengine for a long time, and in this time I
 created a google account under myn...@mydomain.com so I could use
 other services.

 I then came back to app engine and forgot that I needed to sign in
 using the way shown above, and signed in using my regular google
 account. This needed re-authenticating via sms (which I thought was
 odd, but figured it timed out due to lack of use).

 So now I seem to have 2 appengine accounts under the same email.

 But if I create a new application with the regular account, it dose
 not appear there, but in the apps account.

 BUT applications created in the apps account will not let me log using
 admin rights to any pages using login: admin

 Please help!

 David.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Sending Email

2009-03-28 Thread David Wilson

AFAIK AppEngine strips the display name part, annoyingly. This was
true a few months ago anyway.


David.

2009/3/28 Alkis Evlogimenos ('Αλκης Ευλογημένος) evlogime...@gmail.com:
 Try SchooGoo schoo...@shoogoo.com

 On Sat, Mar 28, 2009 at 5:46 AM, Wiiboy jordon...@gmail.com wrote:

 My domain is schoolgoo.com
 So I set up the user schoo...@schoolgoo.com.  I send it as
 schoo...@schoolgoo.com (It gives an error if I use
 schoo...@schoolgoo.com).  The sender then shows up as 'schoogoo'. I
 guess that's Ok, but SchooGoo would be better.




 --

 Alkis

 




-- 
It is better to be wrong than to be vague.
  -- Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-26 Thread David Wilson

Hey,

How about doing interactive login once during installation (e.g.
displaying a web browser control in your setup program), then using
this session to establish a shared secret between the machine and your
application. Something like:

secret = md5.md5(str(random.getrandbits(512)).hexdigest()

Then use that secret in the client to sign update requests:

sig = hmac.HMAC(key=secret, msg=str(nonce, current_ip, webcam_jpg)).hexdigest()

And passing that with the request. Store 'nonce' somewhere in
Datastore and the local machine, incrementing it once per request (and
at the server side, ensure the nonce never decrements - this is to
prevent replay attacks).



2009/3/26 r00723r0 r0072...@gmail.com:

 It seems odd, I know, but I'm not doing anything malicious. I am
 making a laptop recovery service. The client on the laptop must update
 the Google App Engine server with the laptop's IP every few minutes to
 the App Engine server can keep track of it. But I need to make sure
 what user is sending this IP information.

 This is where the trouble comes in. The client on the laptop that
 tries to give the server the IP needs to authenticate but cannot
 without a login page.

 On Mar 25, 8:50 pm, Steve Robillard steverobill...@gmail.com
 wrote:
 It might help to know why all the subterfuge what problem are you trying to
 solve? As a user I would be suspicious of any system that forwards me
 through a series of links and sends secret information. With all do respect
 it sounds like you are trying to proxy a limited resource or bypass a 3rd
 party subscription requirement.

 Steve

 -Original Message-
 From: google-appengine@googlegroups.com

 [mailto:google-appeng...@googlegroups.com] On Behalf Of r00723r0
 Sent: Wednesday, March 25, 2009 7:30 PM
 To: Google App Engine
 Subject: [google-appengine] Re: Manual Authentication

 I may have explained myself incorrectly. I need to log in from an invisible
 client without a web interface, and the login URL is unknown to the
 standalone client. The client needs to log in and send some data silently.

 The main problem is that the username and password are saved, so the user
 will not be manually logging in. Instead the client must be able to log in
 without a proprietary log in URL that Google provides.

 A possible solution:
 * The client connects to someapp.appspot.com/update/, which has only a login
 URL when a user is not logged in.
 * The client then connects to the URL and sends magical information to log
 in.
 * The login URL redirects back to the /update page, as it always does, and
 the Google App Engine program stores this visit as programmed.

 However, this solution is inelegant and annoying to program. Any better
 solutions?

 On Mar 25, 6:30 pm, Marzia Niccolai ma...@google.com wrote:
  Hi,

  Please see the information in our Google Accounts section which shows
  you how to request/require login and generate login/logout
  URLs:http://code.google.com/appengine/docs/python/users/

  -Marzia

  On Wed, Mar 25, 2009 at 11:43 AM, r00723r0 r0072...@gmail.com wrote:

   I am writing a laptop theft recovery service. The client requests /
   update on the Google App Engine server, with user credentials,
   through HTTPS every few minutes. The server stores the IP from which
   the request was made and the time the request was made in the user
   information database model. My question is as such: how do I
   authenticate the user in the Google App Engine server? The username
   and password are given through POST in the HTTP request but I'd
   still need a login URL which the client cannot generate.
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Manual Authentication

2009-03-26 Thread David Wilson

2009/3/26 dafire daf...@gmail.com:



 secret = md5.md5(str(random.getrandbits(512)).hexdigest()

 you could just use an uuid to get a unique id.

 import uuid
 secret = str(uuid.uuid4())

Handy tip, thanks :)


David

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Synchronized access to memcache

2009-03-25 Thread David Wilson

Hi Raghavv,

The memcache API provides the ability to atomically increment an
integer key, and return the old value. You can use this feature to
build an efficient circular buffer that supports hopefully consistent
updates. I started such a class here: http://www.pastie.org/427122
(note this code has at least one major bug, use it as a guide only!).

Note that the AppEngine documentation provides no guarantees about the
locality or consistency across multiple keys, so the approach I took
might not be valid.


David.

2009/3/25 ragh...@gmail.com ragh...@gmail.com:

 I am trying to create a 'user activity' queue in memcache. Example:

 User1 logged in at time t1
 User2 logged out at time t2
 User1 played poker at time t3
 User1 updated profile at time t4

 Data as in above example, is stored in memcache with key name =
 ActivityQueue

 At any given time, I need all the activities done in last 5 minutes. I
 have a choice of doing it in data-store but would like to avoid it due
 to performance reasons. I don't need persistence for this data.

 Unless updates to the ActivityQueue are synchronized, I will lose
 certain updated.

 Is there a way to synchronize updates to memcache? i.e. at any given
 time only one request can append to the queue. Anybody with better
 idea on how to do queuing?

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: memcache, What types can it contain?

2009-03-24 Thread David Wilson

Looks like you're trying to pickle a cStringIO object. That won't work.

Options are: find the code using cStringIO and convert to using
StringIO (I'm guessing this will work fine), or consider implementing
__getstate__ [1] instead.


David

[1] http://www.python.org/doc/2.5.2/lib/pickle-inst.html

2009/3/24 Lee Olayvar leeolay...@gmail.com:
 Can memcache store semi-complex object instances? Or is it basically limited
 to only simple data structures?

 Because at the moment, i have been unable to store a complex series of class
 instances into memcache. Resulting in an error involving Can't Pickle
 cStringIO.StringI.

 For the full error (mostly): http://dpaste.com/18449/

 Any comments would be appreciated, thanks,
 --
 Lee Olayvar

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Faster server-side json?

2009-03-24 Thread David Wilson

Just idly wondering,

Have you done any quantitative measurement of how bad simplejson is?
I can't imagine it being a large overhead, unless your application is
seriously optimized to extremes already.


David

2009/3/24 Andy Freeman ana...@earthlink.net:

 That's why issue 1174 requests the fastest possible json, not cjson.

 1174 actually requests multiple jsons, so folks can use what's best
 for their application.




 On Mar 23, 10:32 pm, Joseph Turian tur...@gmail.com wrote:
 I am the author of the blog post.

 bUpdate (20090324):/b According to a href=http://
 kbyanc.blogspot.com/2007/07/python-serializer-benchmarks.html
 rel=nofollowExtra Cheese/a, cjson 1.0.5 has an incompatibility
 with simplejson in processing slashes. A fix is available from a
 href=http://www.vazor.com/cjson.html; rel=nofollowMatt
 Billenstein/a. However, Dan Pascu, the author of cjson, deprecates
 Matt Billenstein's cjson 1.0.6 because Matt's patch parses the JSON
 twice, which makes it twice as slow. This will still be faster than
 all alternatives in certain circumstances. You will not find Matt's
 cjson on the cheeseshop, only on Matt's site.

 On Mar 23, 10:55 am, Andy Freeman ana...@earthlink.net wrote:



  According 
  tohttp://blog.metaoptimize.com/2009/03/22/fast-deserialization-in-python/
  , simplejson is significantly slower than cjson.

  I've created an issue requesting the fastest possible json 
  athttp://code.google.com/p/googleappengine/issues/detail?id=1174.- Hide 
  quoted text -

 - Show quoted text -
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Faster server-side json?

2009-03-24 Thread David Wilson

These aren't the kind of quantitative I meant. ;)

10 times nothing is still nothing. What kind of overhead, in terms of
time and CPU usage in a typical request in your application? It's just
a bunch of string manipulation, it should be really cheap compared to
even a single network/memcache/datastore access (seeing as CPU quota
seems to be based mainly on request duration).


2009/3/24 Andy Freeman ana...@earthlink.net:

 The referenced post has examples of simplejson taking 10x more time
 than cjson.  10x difference in a component is noticeable for some
 applications.

 It also shows that pickle is much slower and has 2x bigger output than
 json for objects.  (For strings, they all should be roughly the
 same.)

 I mention pickle because it's used by memcache.  Since both pickle and
 json should be very efficient for strings, it may make sense to
 memcache json output instead of objects.

 In addition, some people are using pickle to create datastore blobs.
 Perhaps json is a better choice.

 On Mar 24, 1:39 pm, David Wilson d...@botanicus.net wrote:
 Just idly wondering,

 Have you done any quantitative measurement of how bad simplejson is?
 I can't imagine it being a large overhead, unless your application is
 seriously optimized to extremes already.

 David

 2009/3/24 Andy Freeman ana...@earthlink.net:







  That's why issue 1174 requests the fastest possible json, not cjson.

  1174 actually requests multiple jsons, so folks can use what's best
  for their application.

  On Mar 23, 10:32 pm, Joseph Turian tur...@gmail.com wrote:
  I am the author of the blog post.

  bUpdate (20090324):/b According to a href=http://
  kbyanc.blogspot.com/2007/07/python-serializer-benchmarks.html
  rel=nofollowExtra Cheese/a, cjson 1.0.5 has an incompatibility
  with simplejson in processing slashes. A fix is available from a
  href=http://www.vazor.com/cjson.html; rel=nofollowMatt
  Billenstein/a. However, Dan Pascu, the author of cjson, deprecates
  Matt Billenstein's cjson 1.0.6 because Matt's patch parses the JSON
  twice, which makes it twice as slow. This will still be faster than
  all alternatives in certain circumstances. You will not find Matt's
  cjson on the cheeseshop, only on Matt's site.

  On Mar 23, 10:55 am, Andy Freeman ana...@earthlink.net wrote:

   According 
   tohttp://blog.metaoptimize.com/2009/03/22/fast-deserialization-in-python/
   , simplejson is significantly slower than cjson.

   I've created an issue requesting the fastest possible json 
   athttp://code.google.com/p/googleappengine/issues/detail?id=1174.-Hide 
   quoted text -

  - Show quoted text -

 --
 It is better to be wrong than to be vague.
   — Freeman Dyson- Hide quoted text -

 - Show quoted text -
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Parallel urlfetch utility class / function.

2009-03-18 Thread David Wilson

Hey Joe,

With the gdata package you can do something like this instead:


As usual, completely untested code, but looks about right..


from youtube import YouTubeVideoFeedFromString


def get_feeds_async(usernames):
fetcher = megafetch.Fetcher()
output = {}

def cb(username, result):
if isinstance(output, Exception):
logging.error('could not fetch: %s', output)
content = None
else:
content = YouTubeVideoFeedFromString(result.content)
output[username] = content

for username in usernames:
url = 'http://gdata.youtube.com/feeds/api/users/%s/uploads' %\
(username,)
fetcher.start(url, lambda result: cb(username, result))

fetcher.wait()
return output


feeds = get_feeds_async([ 'davemw', 'waverlyflams', 'googletechtalks',
  'TheOnion', 'winterelaxation' ])

# feeds is now a mapping of usernames to YouTubeVideoFeed instances,
or None if could not be fetched.


2009/3/18 Joe Bowman bowman.jos...@gmail.com:

 This may be a really dumb question, but.. I'm still learning so...

 Is there a way to do something other than a direct api call
 asynchronously? I'm writing a script that pulls from multiple sources,
 sometimes with higher level calls that use urlfetch, such as gdata.
 Since I'm attempting to pull from multiple sources, and sometimes
 multiple urls from each source, I'm trying to figure out if it's
 possible to run other methods at the same time.

 For example, I want to pull a youtube entry for several different
 authors. The youtube api doesn't allow multiple authors in a request
 (I have a enhancement request in for that though), so I need to do a
 yt_service.GetYouTubeVideoFeed() for each author, then splice them
 together into one feed. As I'm also working with Boss, and eventually
 Twitter, I'll have feeds to pull from those sources as well.

 My current application layout is using appengine-patch to provide
 django. I've set up a Boss and Youtube model with get methods that
 handle getting the data. So I can do something similar to:

 web_results = models.Boss.get(request.GET['term'], start=start)
 news_results = models.Boss.get(request.GET['term'], vertical=news,
 start=start)
 youtube = models.Youtube.get(request.GET['term'], start=start)

 Ideally, I'd like some of those models to be able to do asynchronous
 tasks within their get function, and then also, I'd like to run the
 above requests at the same, which should really speed the request up.


 On Mar 17, 9:20 am, Joe Bowman bowman.jos...@gmail.com wrote:
 Thanks,

 I'm going to give it a go for urlfetch calls for one project I'm
 working on this week.

 Not sure when I'd be able to include it in gaeutiltiies for cron and
 such, that project is currently lower on my priority list at the
 moment, but can't wait until I get a chance to play with it. Another
 idea I had for it is the ROTmodel (retry on timeout model) in the
 project, which could speed that process up.

 On Mar 17, 9:11 am, David Wilson d...@botanicus.net wrote:

  2009/3/16 Joe Bowman bowman.jos...@gmail.com:

   Wow that's great. The SDK might be problematic for you, as it appears
   to be very single threaded, I know for a fact it can't reply to
   requests to itself.

   Out of curiosity, are you still using base urlfetch, or is it your own
   creation? While when Google releases their scheduled tasks
   functionality it will be less of an issue, if your solution had the
   ability to fire off urlfetch calls and not wait for a response, it
   could be a perfect fit for the gaeutilities cron utility.

   Currently it grabs a list of tasks it's supposed to run on request,
   sets a timestamp, runs one, the compares now() to the timestamp and if
   the timedelta is more than 1 second, stops running tasks and finishes
   the request. It already appears your project would be perfect for
   running all necessary tasks at once, and the MIT License I believe is
   compatible with the BSD license I've released gaeutilities, so would
   you have any personal objection to me including it in gaeutilities at
   some point, with proper attribution of course?

  Sorry I missed this in the first reply - yeah work away! :)

  David

   If you haven't see that project, it's url 
   ishttp://gaeutilities.appspot.com/

   On Mar 16, 11:03 am, David Wilson d...@botanicus.net wrote:
   Joe,

   I've only tested it in production. ;)

   The code should work serially on the SDK, but I haven't tried yet.

   David.

   2009/3/16 Joe Bowman bowman.jos...@gmail.com:

Does the batch fetching working on live appengine applications, or
only on the SDK?

On Mar 16, 10:19 am, David Wilson d...@botanicus.net wrote:
I have no idea how definitive this is, but literally it means wall
clock time seems to be how CPU cost is measured. I guess this makes
sense for a few different reasons.

I found some internal function
google3.apphosting.runtime

[google-appengine] Re: A question for Jaiku's developers, if they're watching..

2009-03-16 Thread David Wilson

Thanks for that Dan.

I just noticed that quite surprisingly, time.sleep() works.


David.

2009/3/16 Dan Sanderson dansander...@google.com:
 The XMPP support mentioned on the roadmap does not include BOSH.
 -- Dan

 On Sun, Mar 15, 2009 at 6:14 PM, David Wilson d...@botanicus.net wrote:

 2009/3/15 thuan nunob...@gmail.com:
 
  I know the topic is more about microblogging services than xmpp, but
  by chance, have somebody achieved to install some comet/ajax push
  applications? The technique might be used to speed up message display
  for popular conversations as it is used for the chat function in
  google mail.

 Since there are no blocking / sleeping primitives in AppEngine, it's
 not really possible without spinning and burning a tonne of CPU, or
 making lots of requests. You really need an external component for it.

 Hopefully the AppEngine XMPP support that is on the roadmap will
 include support for BOSH (http://xmpp.org/extensions/xep-0124.html),
 which would solve the Comet problem beautifully. :)


 David

  
 



 --
 It is better to be wrong than to be vague.
  — Freeman Dyson




 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Parallel urlfetch utility class / function.

2009-03-16 Thread David Wilson

I've created a Google Code project to contain some batch utilities I'm
working on, based on async_apiproxy.py from pubsubhubbub[0]. The
project currently contains just a modified async_apiproxy.py that
doesn't require dummy google3 modules on the local machine, and a
megafetch.py, for batch-fetching URLs.

http://code.google.com/p/appengine-async-tools/


David

[0] 
http://code.google.com/p/pubsubhubbub/source/browse/trunk/hub/async_apiproxy.py

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Parallel urlfetch utility class / function.

2009-03-16 Thread David Wilson

It's completely undocumented (at this stage, anyway), but definitely
seems to work. A few notes I've come gathered:

 - CPU time quota appears to be calculated based on literal time,
rather than e.g. the UNIX concept of time spent in running state.

 - I can fetch 100 URLs in 1.3 seconds from a machine colocated in
Germany using the asynchronous API. I can't begin to imagine how slow
(and therefore expensive in monetary terms) this would be using the
standard API.

 - The user-specified callback function appears to be invoked in a
separate thread; the RPC isn't complete until this callback
completes. The callback thread is still subject to the request
deadline.

 - It's a standard interface, and seems to have no parallel
restrictions at least for urlfetch and Datastore. However, I imagine
that it's possible restrictions may be placed here at some later
stage, since you can burn a whole lot more AppEngine CPU more cheaply
using the async api.

 - It's standard only insomuch as you have to fiddle with
AppEngine-internal protocolbuffer definitions for each service type.
This mostly means copy-pasting the standard sync call code from the
SDK, and hacking it to use pubsubhubub's proxy code.

Per the last point, you might be better waiting for an officially
sanctioned API for doing this, albeit I doubt the protocolbuffer
definitions change all that often.

Thanks for Brett Slatkin  co. for doing the digging required to get
the async stuff working! :)


David.

2009/3/16 peterk peter.ke...@gmail.com:

 Very neat.. Thank you.

 Just to clarify, can we use this for all API calls? Datastore too? I
 didn't look very closely at the async proxy in pubsubhubub..

 Asynchronous calls available on all apis might give a lot to chew
 on.. :) It's been a while since I've worked with async function calls
 or threading, might have to dig up some old notes to see where I could
 extract gains from it in my app. Some common cases might be worth the
 community documenting for all to benefit from, too.

 On Mar 16, 1:26 pm, David Wilson d...@botanicus.net wrote:
 I've created a Google Code project to contain some batch utilities I'm
 working on, based on async_apiproxy.py from pubsubhubbub[0]. The
 project currently contains just a modified async_apiproxy.py that
 doesn't require dummy google3 modules on the local machine, and a
 megafetch.py, for batch-fetching URLs.

    http://code.google.com/p/appengine-async-tools/

 David

 [0]http://code.google.com/p/pubsubhubbub/source/browse/trunk/hub/async_a...

 --
 It is better to be wrong than to be vague.
   — Freeman Dyson
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Parallel urlfetch utility class / function.

2009-03-16 Thread David Wilson

I have no idea how definitive this is, but literally it means wall
clock time seems to be how CPU cost is measured. I guess this makes
sense for a few different reasons.

I found some internal function
google3.apphosting.runtime._apphosting_runtime___python__apiproxy.get_request_cpu_usage
with the docstring:

Returns the number of megacycles used so far by this request.
Does not include CPU used by API calls.

Calling it, then running time.sleep(5), then calling it again,
indicates thousands of megacycles used, yet in real terms the CPU was
probably doing nothing. I guess Datastore CPU, etc., is added on top
of this, but it seems to suggest to me that if you can drastically
reduce request time, quota usage should drop too.

I have yet to do any kind of rough measurements of Datastore CPU, so
I'm not sure how correct this all is.


David.

 - One of the guys on IRC suggested this means that per-request cost
is scaled during peak usage (and thus internal services running
slower).

2009/3/16 peterk peter.ke...@gmail.com:

 A couple of questions re. CPU usage..

 CPU time quota appears to be calculated based on literal time

 Can you clarify what you mean here? I presume each async request eats
 into your CPU budget. But you say:

 since you can burn a whole lot more AppEngine CPU more cheaply using
 the async api

 Can you clarify how that's the case?

 I would guess as long as you're being billed for the cpu-ms spent in
 your asynchronous calls, Google would let you hang yourself with them
 when it comes to billing.. :) so I presume they'd let you squeeze in
 as many as your original request, and its limit, will allow for?

 Thanks again.


 On Mar 16, 2:00 pm, David Wilson d...@botanicus.net wrote:
 It's completely undocumented (at this stage, anyway), but definitely
 seems to work. A few notes I've come gathered:

  - CPU time quota appears to be calculated based on literal time,
 rather than e.g. the UNIX concept of time spent in running state.

  - I can fetch 100 URLs in 1.3 seconds from a machine colocated in
 Germany using the asynchronous API. I can't begin to imagine how slow
 (and therefore expensive in monetary terms) this would be using the
 standard API.

  - The user-specified callback function appears to be invoked in a
 separate thread; the RPC isn't complete until this callback
 completes. The callback thread is still subject to the request
 deadline.

  - It's a standard interface, and seems to have no parallel
 restrictions at least for urlfetch and Datastore. However, I imagine
 that it's possible restrictions may be placed here at some later
 stage, since you can burn a whole lot more AppEngine CPU more cheaply
 using the async api.

  - It's standard only insomuch as you have to fiddle with
 AppEngine-internal protocolbuffer definitions for each service type.
 This mostly means copy-pasting the standard sync call code from the
 SDK, and hacking it to use pubsubhubub's proxy code.

 Per the last point, you might be better waiting for an officially
 sanctioned API for doing this, albeit I doubt the protocolbuffer
 definitions change all that often.

 Thanks for Brett Slatkin  co. for doing the digging required to get
 the async stuff working! :)

 David.

 2009/3/16 peterk peter.ke...@gmail.com:





  Very neat.. Thank you.

  Just to clarify, can we use this for all API calls? Datastore too? I
  didn't look very closely at the async proxy in pubsubhubub..

  Asynchronous calls available on all apis might give a lot to chew
  on.. :) It's been a while since I've worked with async function calls
  or threading, might have to dig up some old notes to see where I could
  extract gains from it in my app. Some common cases might be worth the
  community documenting for all to benefit from, too.

  On Mar 16, 1:26 pm, David Wilson d...@botanicus.net wrote:
  I've created a Google Code project to contain some batch utilities I'm
  working on, based on async_apiproxy.py from pubsubhubbub[0]. The
  project currently contains just a modified async_apiproxy.py that
  doesn't require dummy google3 modules on the local machine, and a
  megafetch.py, for batch-fetching URLs.

     http://code.google.com/p/appengine-async-tools/

  David

  [0]http://code.google.com/p/pubsubhubbub/source/browse/trunk/hub/async_a...

  --
  It is better to be wrong than to be vague.
    — Freeman Dyson

 --
 It is better to be wrong than to be vague.
   — Freeman Dyson
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Parallel urlfetch utility class / function.

2009-03-16 Thread David Wilson

Joe,

I've only tested it in production. ;)

The code should work serially on the SDK, but I haven't tried yet.


David.

2009/3/16 Joe Bowman bowman.jos...@gmail.com:

 Does the batch fetching working on live appengine applications, or
 only on the SDK?

 On Mar 16, 10:19 am, David Wilson d...@botanicus.net wrote:
 I have no idea how definitive this is, but literally it means wall
 clock time seems to be how CPU cost is measured. I guess this makes
 sense for a few different reasons.

 I found some internal function
 google3.apphosting.runtime._apphosting_runtime___python__apiproxy.get_request_cpu_usage
 with the docstring:

     Returns the number of megacycles used so far by this request.
     Does not include CPU used by API calls.

 Calling it, then running time.sleep(5), then calling it again,
 indicates thousands of megacycles used, yet in real terms the CPU was
 probably doing nothing. I guess Datastore CPU, etc., is added on top
 of this, but it seems to suggest to me that if you can drastically
 reduce request time, quota usage should drop too.

 I have yet to do any kind of rough measurements of Datastore CPU, so
 I'm not sure how correct this all is.

 David.

  - One of the guys on IRC suggested this means that per-request cost
 is scaled during peak usage (and thus internal services running
 slower).

 2009/3/16 peterk peter.ke...@gmail.com:





  A couple of questions re. CPU usage..

  CPU time quota appears to be calculated based on literal time

  Can you clarify what you mean here? I presume each async request eats
  into your CPU budget. But you say:

  since you can burn a whole lot more AppEngine CPU more cheaply using
  the async api

  Can you clarify how that's the case?

  I would guess as long as you're being billed for the cpu-ms spent in
  your asynchronous calls, Google would let you hang yourself with them
  when it comes to billing.. :) so I presume they'd let you squeeze in
  as many as your original request, and its limit, will allow for?

  Thanks again.

  On Mar 16, 2:00 pm, David Wilson d...@botanicus.net wrote:
  It's completely undocumented (at this stage, anyway), but definitely
  seems to work. A few notes I've come gathered:

   - CPU time quota appears to be calculated based on literal time,
  rather than e.g. the UNIX concept of time spent in running state.

   - I can fetch 100 URLs in 1.3 seconds from a machine colocated in
  Germany using the asynchronous API. I can't begin to imagine how slow
  (and therefore expensive in monetary terms) this would be using the
  standard API.

   - The user-specified callback function appears to be invoked in a
  separate thread; the RPC isn't complete until this callback
  completes. The callback thread is still subject to the request
  deadline.

   - It's a standard interface, and seems to have no parallel
  restrictions at least for urlfetch and Datastore. However, I imagine
  that it's possible restrictions may be placed here at some later
  stage, since you can burn a whole lot more AppEngine CPU more cheaply
  using the async api.

   - It's standard only insomuch as you have to fiddle with
  AppEngine-internal protocolbuffer definitions for each service type.
  This mostly means copy-pasting the standard sync call code from the
  SDK, and hacking it to use pubsubhubub's proxy code.

  Per the last point, you might be better waiting for an officially
  sanctioned API for doing this, albeit I doubt the protocolbuffer
  definitions change all that often.

  Thanks for Brett Slatkin  co. for doing the digging required to get
  the async stuff working! :)

  David.

  2009/3/16 peterk peter.ke...@gmail.com:

   Very neat.. Thank you.

   Just to clarify, can we use this for all API calls? Datastore too? I
   didn't look very closely at the async proxy in pubsubhubub..

   Asynchronous calls available on all apis might give a lot to chew
   on.. :) It's been a while since I've worked with async function calls
   or threading, might have to dig up some old notes to see where I could
   extract gains from it in my app. Some common cases might be worth the
   community documenting for all to benefit from, too.

   On Mar 16, 1:26 pm, David Wilson d...@botanicus.net wrote:
   I've created a Google Code project to contain some batch utilities I'm
   working on, based on async_apiproxy.py from pubsubhubbub[0]. The
   project currently contains just a modified async_apiproxy.py that
   doesn't require dummy google3 modules on the local machine, and a
   megafetch.py, for batch-fetching URLs.

      http://code.google.com/p/appengine-async-tools/

   David

   [0]http://code.google.com/p/pubsubhubbub/source/browse/trunk/hub/async_a...

   --
   It is better to be wrong than to be vague.
     — Freeman Dyson

  --
  It is better to be wrong than to be vague.
    — Freeman Dyson

 --
 It is better to be wrong than to be vague.
   — Freeman Dyson
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

[google-appengine] Re: Parallel urlfetch utility class / function.

2009-03-16 Thread David Wilson

I forgot to mention, AppEngine does not close the request until all
asynchronous requests have ended. This means it's not truly fire and
forget. Regardless of whether you're waiting for a response or not,
if a request is in progress, the HTTP response body is not returned to
the client.

I created a simple function this morning to call datastore_v3.Delete
on a set of key objects, it appeared to work but I didn't test beyond
ensuring the callback didn't receive an exception. Pretty untested
code here: http://pastie.org/417496.

For simple uses, it's probably not all that useful to call Datastore
asynchronously is all that useful anyway, since unlike urlfetch, you
can already minimize latency by making batch calls at the start/end of
your request for all the keys you want to load/save. It's possibly
useful to use it to concurrently commit a bunch of different
transactions, but the code for this is less trivial than the urlfetch
case. Probably best to see what the AppEngine team themselves provide
for this. ;)


David.

2009/3/16 bFlood bflood...@gmail.com:


 @joe - fire/forget - you can just skip the fetcher.wait() call (which
 call AsyncAPIProxy.wait). I'm not sure of you would need a valid
 callback but even if you did it could be a simple stub that does
 nothing.

 @david - have you made this work with datastore calls yet? having some
 issues trying to figure out how to set pbrequest/pbresponse variables

 cheers
 brian


 On Mar 16, 12:05 pm, Joe Bowman bowman.jos...@gmail.com wrote:
 Wow that's great. The SDK might be problematic for you, as it appears
 to be very single threaded, I know for a fact it can't reply to
 requests to itself.

 Out of curiosity, are you still using base urlfetch, or is it your own
 creation? While when Google releases their scheduled tasks
 functionality it will be less of an issue, if your solution had the
 ability to fire off urlfetch calls and not wait for a response, it
 could be a perfect fit for the gaeutilities cron utility.

 Currently it grabs a list of tasks it's supposed to run on request,
 sets a timestamp, runs one, the compares now() to the timestamp and if
 the timedelta is more than 1 second, stops running tasks and finishes
 the request. It already appears your project would be perfect for
 running all necessary tasks at once, and the MIT License I believe is
 compatible with the BSD license I've released gaeutilities, so would
 you have any personal objection to me including it in gaeutilities at
 some point, with proper attribution of course?

 If you haven't see that project, it's url ishttp://gaeutilities.appspot.com/

 On Mar 16, 11:03 am, David Wilson d...@botanicus.net wrote:

  Joe,

  I've only tested it in production. ;)

  The code should work serially on the SDK, but I haven't tried yet.

  David.

  2009/3/16 Joe Bowman bowman.jos...@gmail.com:

   Does the batch fetching working on live appengine applications, or
   only on the SDK?

   On Mar 16, 10:19 am, David Wilson d...@botanicus.net wrote:
   I have no idea how definitive this is, but literally it means wall
   clock time seems to be how CPU cost is measured. I guess this makes
   sense for a few different reasons.

   I found some internal function
   google3.apphosting.runtime._apphosting_runtime___python__apiproxy.get_requ
est_cpu_usage
   with the docstring:

       Returns the number of megacycles used so far by this request.
       Does not include CPU used by API calls.

   Calling it, then running time.sleep(5), then calling it again,
   indicates thousands of megacycles used, yet in real terms the CPU was
   probably doing nothing. I guess Datastore CPU, etc., is added on top
   of this, but it seems to suggest to me that if you can drastically
   reduce request time, quota usage should drop too.

   I have yet to do any kind of rough measurements of Datastore CPU, so
   I'm not sure how correct this all is.

   David.

    - One of the guys on IRC suggested this means that per-request cost
   is scaled during peak usage (and thus internal services running
   slower).

   2009/3/16 peterk peter.ke...@gmail.com:

A couple of questions re. CPU usage..

CPU time quota appears to be calculated based on literal time

Can you clarify what you mean here? I presume each async request eats
into your CPU budget. But you say:

since you can burn a whole lot more AppEngine CPU more cheaply using
the async api

Can you clarify how that's the case?

I would guess as long as you're being billed for the cpu-ms spent in
your asynchronous calls, Google would let you hang yourself with them
when it comes to billing.. :) so I presume they'd let you squeeze in
as many as your original request, and its limit, will allow for?

Thanks again.

On Mar 16, 2:00 pm, David Wilson d...@botanicus.net wrote:
It's completely undocumented (at this stage, anyway), but definitely
seems to work. A few notes I've come gathered:

 - CPU time quota

[google-appengine] Re: A question for Jaiku's developers, if they're watching..

2009-03-15 Thread David Wilson

2009/3/15 thuan nunob...@gmail.com:

 I know the topic is more about microblogging services than xmpp, but
 by chance, have somebody achieved to install some comet/ajax push
 applications? The technique might be used to speed up message display
 for popular conversations as it is used for the chat function in
 google mail.

Since there are no blocking / sleeping primitives in AppEngine, it's
not really possible without spinning and burning a tonne of CPU, or
making lots of requests. You really need an external component for it.

Hopefully the AppEngine XMPP support that is on the roadmap will
include support for BOSH (http://xmpp.org/extensions/xep-0124.html),
which would solve the Comet problem beautifully. :)


David

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: *** BigTable vs SQLite vs MySQL ***

2009-03-11 Thread David Wilson

http://lmgtfy.com/?q=appengine+datastore+documentationl=1

2009/3/11 Let Delete My Apps davide.rogn...@gmail.com:

 Ok :-)
 Where is your documentation?
 .
 .
 .
 On Mar 10, 4:07 am, Ryan Lamansky spam...@kardax.com wrote:
 The App Engine datastore is pretty slow for individual actions.  It's
 specialty is being able to do those things with 50,000 concurrent
 users.

 -Ryan

 On Mar 9, 4:32 pm, Let Delete My Apps davide.rogn...@gmail.com
 wrote:

  Back to the past:

   I planned to migrate a python app ... but my tests on google engine

  was really bad, compare to sqlite or mysql.

 http://groups.google.com/group/google-appengine/browse_thread/thread/...

  Now?
  Does the Comparison Table exists?

  --http://pyoohtml.appspot.com/let-delete-my-apps/home
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] FYI: accounting for batch Datastore and Memcache gets/puts.

2009-03-07 Thread David Wilson

Just a small note for anyone who might care: memcache.get_multi,
memcache.set_multi, db.put, and db.get all appear to count as a single
call in quota accounting. This isn't quite clear from the
documentation.

Additionally, batch DS fetches of 32 entities (by key) is only
marginally slower (at 100..199ms) to fetching 16 entities using the
same method (70..120ms). A fetch of a single entity is in the range
15..50ms.

A conclusion that can be drawn from this is: use batch operations at
all costs. If not for the obvious performance gains, then perhaps to
save on quota.


David.

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: HTTPS pages with some unencrypted information

2009-03-06 Thread David Wilson

2009/3/6 OliWeiD oliver.weimar.dr...@googlemail.com:

 Hi,

 I have setup some pages in app.yaml with secure: always and some few
 are getting the following warn message in e.g. Firefox (IE7 is
 similar):
 You have requested an encrypted page that contains some unencrypted
 information. Information that you see or enter on this page could
 easily be read by a third party.

 Is there a plug in or something to identify, which elements are
 unencrypted?

Firefox: right click the document background, choose View Page Info,
and choose the Media tab.  I think this shows everything except for
scripts, which you can install Firebug (and enable the Net panel) in
order to view.


 Or a list of hints to check?

 Thanks in advance

 Oliver W-D
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Windows 7 - can't run appengine sdk

2009-03-05 Thread David Wilson

Hi Chen,

Please post the full text of the traceback you received. Have you
tried reinstalling the SDK? Do you by any chance have a module called
appengine_rpc anywhere in your application, or sys.path?


David.

2009/3/5 Chen Harel chook.ha...@gmail.com:

 AttributeError: 'module' object has no attribute 'HttpRpcServer'

 I'm getting this error message while trying dev_appserver.py on a
 project that is working in vista
 (Although in vista I used 1.1.7 and now in Windows 7 I use 1.19)
 Python is 2.5.4 x64

 Please assist, what can cause this error
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] orkut signed POST request

2009-03-04 Thread David Wilson



Hello,

When making a orkut signed POST request to an app engine server, the
code running on the local dev server will always fail validation.
Where  as the identical code running live on appspot will pass the
validation process.

Now i understand there are a lot of possibilities here, but does
anyone have some insight to why this is?

I’m using code identical to what’s presented here:

http://code.google.com/apis/opensocial/articles/appengine-0.8.html#signing

Local development is run though a reverse ssh tunnel to a public
address on port 8090.

Thanks
David

(im going to cross post this in the orkut dev forum)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Slow speed on appspot.com with custom domain enabled

2009-02-28 Thread David Wilson

Hi Brandon,

I quickly checked this, and I'm not seeing the behavior you describe.

It's possible some DNS resolver in between you and the Internet
(perhaps a cheap home DSL router) has cached one set of resolved
addresses for one name, and another set for the other. Perhaps for
whatever reason one of those sets in your case is running slowly?
(maybe they've been recently taken out of service, or enter Google's
network via an interesting route)

Try running nslookup or host from the command line, to see if both
names resolve to ghs.google.com, or the same set of IP addresses.


David

PS: your custom domain is setup to use CNAME ghs.google.com, right?

2009/2/28 Brandon Thomson gra...@gmail.com:

 After some additional tests the connection appears to be rate-limited
 at 15.0Kb/s on Google's end (I tested from two different broadband
 providers, Verizon and Comcast).
 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Will datastore_admin.GetSchema() ever be reenabled?

2009-02-26 Thread David Wilson

Hi there,

I'm currently working on a Datastore synchronization tool (
http://code.google.com/p/appengine-sqlite-sync/ ), and was wondering
if it's likely GetSchema() will ever work again. I've seen some old
messages about it breaking the SDK viewer when running in production,
but nothing conclusive. Calling GetSchema(), either via the remote API
or from e.g. shell.appspot.com, raises an exception telling me the
application does not have permission to access the API.

Is it gone for good? Would be nice if my tool could run without having
a copy of the application's source code lying around. :)

Thanks,


David.

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Google login in a lightbox?

2009-02-14 Thread David Wilson
Just noticed herehttp://code.google.com/appengine/docs/revision_history.html
:

*2008-05-01*
Program policies
http://code.google.com/appengine/program_policies.htmlupdated to
clarify policy on complying with terms of service policies of
other Google services, e.g. framing the Google Accounts sign-in screen

I can't seem to find the relevant TOS document, but I guess it's
sufficiently implied from the changelog that they don't want people doing
this.


David.

2009/2/1 gops patelgo...@gmail.com:

 may be because clickjacking is more of a problem after login than
 before login

 On Jan 31, 10:27 pm, David Wilson d...@botanicus.net wrote:
 2009/1/18 emi420 emi...@proyecto83.com:



  I want to show the Google login form in a lightbox, like this:

 http://microbloog.appspot.com/

  It works, but isn't an elegant solution.

 Hi there,

 As much as I'm happy to hear this works because I've been wanting to
 use something like it myself, I'm surprised that it works at all. The
 problem is that a lot of security people recommend using
 frames-busting Javascript on login pages, etc., in order to avoid
 Clickjacking attacks.

 Does anyone know why this works for the Google login page? They are
 usually very security-concious about these things.

 David.



  Any suggestions?

  Thanks!

 --
 It is better to be wrong than to be vague.
   — Freeman Dyson
 




-- 
It is better to be wrong than to be vague.
 — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: pricing / additional app slots

2009-02-03 Thread David Wilson

2009/2/2 jeremy jeremy.a...@gmail.com:

 will additional app slots be part of the pricing model?
 


Why pay for something you can have for free? :-)

If you have exhausted the allocation of applications for your account,
possibly (like so many, it seems) by creating a bunch of test
applications, then you can follow this trick to get rid of them:

 * Create a new account.
 * Invite the new account to be developer for each application you want to shed.
 * Confirm all the invitations for the new account.
 * Log in as the new account, and remove your 'real' account from the
developer list for each application.
 * Log out, log back using your real account. Observe applications are
gone, and you can create more.

I think this trick is semi-officially sanctioned, so I doubt you'll
get kicked off the service for doing it (at least during the preview
period :).


David

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: pricing / additional app slots

2009-02-03 Thread David Wilson

2009/2/4 Barry Hunter barrybhun...@googlemail.com:

 2009/2/4 David Wilson d...@botanicus.net:

 2009/2/2 jeremy jeremy.a...@gmail.com:

 will additional app slots be part of the pricing model?
 


 Why pay for something you can have for free? :-)

 If you have exhausted the allocation of applications for your account,
 possibly (like so many, it seems) by creating a bunch of test
 applications, then you can follow this trick to get rid of them:

  * Create a new account.

 What if you only have one mobile phone number... :(


Hrm. I can say at least that you don't need a new phone number when
inviting a Google Apps account to develop. I have no idea about the
non-apps workflow.


David

  * Invite the new account to be developer for each application you want to 
 shed.
  * Confirm all the invitations for the new account.
  * Log in as the new account, and remove your 'real' account from the
 developer list for each application.
  * Log out, log back using your real account. Observe applications are
 gone, and you can create more.

 I think this trick is semi-officially sanctioned, so I doubt you'll
 get kicked off the service for doing it (at least during the preview
 period :).


 David

 --
 It is better to be wrong than to be vague.
  — Freeman Dyson

 




 --
 Barry

 - www.nearby.org.uk - www.geograph.org.uk -

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: Datastore timeouts and retries.

2009-01-10 Thread David Wilson

2009/1/10 djidjadji djidja...@gmail.com:

 Be aware that there are times that memcache is disabled. At certain
 maintenance activities memcache.get() always returns None and
 memcache.set() has no effect.
 And memcache will be cleared when maintenance is over and normal
 behavior has returned.

 Your application must be able to deal with this situation.

Indeed. My point was that this isn't really a workable alternative to
simply retrying the Datastore request.

Thanks,


David.


 2009/1/10 David Wilson d...@botanicus.net:
   * Somehow use memcache as an alternative.

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Datastore timeouts and retries.

2009-01-09 Thread David Wilson

Hi there,

Having got my application to a barely working state last week, I tried
to demonstrate it to a friend. Before he had even reached the main
page of the application, a Datastore timeout had occurred while
updating his session record. I talked to a few people about this, and
it seems when this occurs it is usually safe to retry the operation a
few times. I've been thinking about this issue a little since then,
and have reached the conclusion that my application code should not
need to be handling this explicitly at all. I considered the following
avenues for continuity in the face of a Datastore timeout:


   * Somehow use memcache as an alternative.

This assumes that during some future request, my code would eventually
retry the operation and it would succeed, and in the meantime,
memcache does not get flushed. Anywhere this kind of data needs
accessed, my code would need to explicitly check both memcache and the
datastore. Basically this seems like a dumb thing to attempt.


   * Use some alternative storage via urlfetch.

This seems pretty much insane.


   * Return a friendly error message

This seems premature unless we've already retried the operation a few times.


   * Retry the operation.

Leaving the fourth option, which seems to me, should be the default.
I've been trying to think of the downsides of wrapping or
monkey-patching the Datastore API to always automatically retry, and
I'm coming up blank. I can imagine there are cases when such automatic
behaviour might not be ideal, and so, perhaps providing an extra
parameter to get()/put()/Query.fetch() to disable it would work.

Any thoughts? It kinda sucks that user code needs to handle these
exceptions when the only real sane thing it can do is retry the
operation. As always, I'm probably missing something obvious. :)

Thanks,


David.

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Help! Locked out of my application.

2009-01-07 Thread David Wilson

Hi there,

The main application I've been working on has just disappeared from my
appspot.com dashboard. This may be related to deleting the Gmail
service from primary Google account. Can someone please fix? I'm smack
bang in the middle of this project! :)

If you can't figure out which application it is (should have been tied
to this e-mail address) can someone please mail me offlist?

Thanks,


David.

-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: SMS: through python AIM/gtalk libraries?

2009-01-04 Thread David Wilson

2009/1/1 mclovin hanoo...@gmail.com:

 I wanted to test out some SMS web app, where I can communicate w/ the
 application from my phone. I was wondering if the App Engine allows me
 to do this through the use of either AIM libraries or Gtalk Libraries
 written in python.

Hi there,

If you are willing to pay a small amount for SMS credit, BulkSMS
http://www.bulksms.co.uk/ support 2-way SMS that would easily
interoperate with AppEngine. A few years ago I also wrote a client
library for them, http://code.google.com/p/py-sms/, which would work
on AppEngine when using the appengine-monkey package.

BulkSMS supports delivery worldwide, and provides 2-way SMS using a
dynamically allocated sender number, which when replied to, causes
either an e-mail to be sent or an HTTP POST back to your web site.


David.


 Thanks

 




-- 
It is better to be wrong than to be vague.
  — Freeman Dyson

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] 'run_in_transaction' gives a 'KeyError: frame object at'

2008-11-07 Thread David Wilson (entertainment cloud)


Hi,

Some how I keep breaking the dev server datastore, so it gives this
error when try to 'put' anything in a transaction:

class Foo(db.Model):
pass

def trans():
foo = Foo()
foo.put()

class Test(webapp.RequestHandler):

def get(self):
db.run_in_transaction(trans)


File C:\Program Files\Google\google_appengine\google\appengine\ext\db
\__init__.py, line 618, in put
return datastore.Put(self._entity)
  File C:\Program Files\Google\google_appengine\google\appengine\api
\datastore.py, line 154, in Put
tx = _MaybeSetupTransaction(req, keys)
  File C:\Program Files\Google\google_appengine\google\appengine\api
\datastore.py, line 1479, in _MaybeSetupTransaction
tx = _txes[tx_key]
KeyError: frame object at 0x01EAF928

If I run the code not in a transaction it runs fine.

Anyone know what this is? Im running winxp latest api.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 'run_in_transaction' gives a 'KeyError: frame object at'

2008-11-07 Thread David Wilson (entertainment cloud)


after some more testing, it only happens in debug with psyco (1.6).

I've removed psyco for now and its all running fine.



On Nov 7, 3:11 pm, David Wilson (entertainment cloud)
[EMAIL PROTECTED] wrote:
 Hi,

 Some how I keep breaking the dev server datastore, so it gives this
 error when try to 'put' anything in a transaction:

 class Foo(db.Model):
     pass

 def trans():
     foo = Foo()
     foo.put()

 class Test(webapp.RequestHandler):

     def get(self):
         db.run_in_transaction(trans)

 File C:\Program Files\Google\google_appengine\google\appengine\ext\db
 \__init__.py, line 618, in put
     return datastore.Put(self._entity)
   File C:\Program Files\Google\google_appengine\google\appengine\api
 \datastore.py, line 154, in Put
     tx = _MaybeSetupTransaction(req, keys)
   File C:\Program Files\Google\google_appengine\google\appengine\api
 \datastore.py, line 1479, in _MaybeSetupTransaction
     tx = _txes[tx_key]
 KeyError: frame object at 0x01EAF928

 If I run the code not in a transaction it runs fine.

 Anyone know what this is? Im running winxp latest api.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: consistent order when sorting on values that are the same?

2008-10-14 Thread David Wilson (entertainment cloud)

as a note, its fine if it is 3,2,4. as long as its always 3,2,4.



On Oct 14, 3:00 pm, David Wilson (entertainment cloud)
[EMAIL PROTECTED] wrote:
 Another day, another question:

 Are fetch results returned in a consistent order when sorting on
 values that are the same.

 ie

 if my models have id 1..4 and values 1,2,2,3 and I perform a filtered
 fetch of value = 2. Will the models always be returned in the order
 id 2,3,4?

 im going to hit a problem if it undefined and could be 3,2,4.

 thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: datastore .order question

2008-10-13 Thread David Wilson (entertainment cloud)

ok, i wanted to be sure about this, as pulling all the records and
just returning one would have been a performance disaster for my app.

my question was raised because i was a little surprised to read that
offset queries still pull all the 'upto' offset out of the store.

does the same apply to Thing.all().filter('value '  x).get()  ?

and thus is it possible to page without pulling all the previous pages
data from the store each time?



On Oct 13, 1:01 pm, Sylvain [EMAIL PROTECTED] wrote:
 Only '1'

 http://code.google.com/appengine/docs/datastore/queryclass.html#Query...

 On 13 oct, 13:41, David Wilson (entertainment cloud)

 [EMAIL PROTECTED] wrote:
  Hi,

  class Thing(db.Model):

      value = db.IntegerProperty(required=True)

  datastore has 10 Things with value 1..10

  Question:

  How many records does the query Thing.all().order('-value').get() pull
  from the datastore?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] datastore .order question

2008-10-13 Thread David Wilson (entertainment cloud)

Hi,

class Thing(db.Model):

value = db.IntegerProperty(required=True)

datastore has 10 Things with value 1..10

Question:

How many records does the query Thing.all().order('-value').get() pull
from the datastore?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: datastore .order question

2008-10-13 Thread David Wilson (entertainment cloud)


good news all round :) thanks for clearing that up everyone.


On Oct 13, 7:05 pm, yejun [EMAIL PROTECTED] wrote:
 It will only pull unnecessary data when you use offset parameter in
 fetch(limit,offset=0). Because when you set an offset, the datastore
 still need to iterate all previous data before that offset.

 On Oct 13, 1:25 pm, David Wilson (entertainment cloud)

 [EMAIL PROTECTED] wrote:
  when you say the same is not true of filter, are you saying that

  Thing.all().filter('value '  5).get()

  will pull Things 1,2,3,4,5(like the offset issue) the records from the
  datastore, but just return Things 6 from the query.

  this seems wrong to me.

  The reason im making sure on this is that my Thing has a large Blob in
  it that i really need to make sure is not getting pulled apart from
  the ones im displaying at the time. Otherwise i will split up the
  model and put an id in the Thing to a new model ThingBlob.

  On Oct 13, 5:34 pm, Marzia Niccolai [EMAIL PROTECTED] wrote:

   Hi,

   The same is not true of filter().  Filter will start at the first value
   larger than x, and should be used if you want to paginate your records.

   Brett Slatkin's IO talk covers scalable pagination recipes, and I suggest
   checking it 
   out:http://sites.google.com/site/io/building-scalable-web-applications-wi...

   -Marzia

   On Mon, Oct 13, 2008 at 6:24 AM, David Wilson (entertainment cloud) 

   [EMAIL PROTECTED] wrote:

ok, i wanted to be sure about this, as pulling all the records and
just returning one would have been a performance disaster for my app.

my question was raised because i was a little surprised to read that
offset queries still pull all the 'upto' offset out of the store.

does the same apply to Thing.all().filter('value '  x).get()  ?

and thus is it possible to page without pulling all the previous pages
data from the store each time?

On Oct 13, 1:01 pm, Sylvain [EMAIL PROTECTED] wrote:
 Only '1'

http://code.google.com/appengine/docs/datastore/queryclass.html#Query...

 On 13 oct, 13:41, David Wilson (entertainment cloud)

 [EMAIL PROTECTED] wrote:
  Hi,

  class Thing(db.Model):

      value = db.IntegerProperty(required=True)

  datastore has 10 Things with value 1..10

  Question:

  How many records does the query Thing.all().order('-value').get() 
  pull
  from the datastore?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google App Engine group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---