[google-appengine] Re: A newbie python question for dictionary

2009-04-06 Thread Tom M.

Google search "sort dict site:python.org"

On Apr 6, 8:55 am, arnie  wrote:
> Please do not look as a non google app engine question
> I have a very simple python problem
> There is a dictionary called d as given below:
> d['Apple'] = '123'
> d['banana'] = '234'
> d['act'] = '565656'
> I have to sort this dictionary based on keys such that the
> dictionary's key come in ascending order
> Can anybody help?
> Thanks
> Arnie
--~--~-~--~~~---~--~~
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: Bad Gateway errors at the worst of times

2009-03-28 Thread Tom M.

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

Is it suggested that I hit the winebythebar.appspot.com domain instead
of www.winebythebar.com?


On Mar 28, 8:51 am, Tom  wrote:
> I get sporadic Bad Gateway errors that seem to come in clumps. (One
> "clump" was bad enough that at least a few users of my Android phone
> app have uninstalled.) What sort of details do I need to get in order
> to figure out the cause?
>
> I see no info in the GAE server logs. (I assume because the request
> isn't even getting that far?)
>
> For my requests I'm simply sending a MultipartEntity w/ StringBody
> parts on the Android phone.
--~--~-~--~~~---~--~~
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: Does TOS allow multiple versions of one app that do different things?

2009-03-26 Thread Tom M.

A very clever solution.

On Mar 26, 6:31 pm, cz  wrote:
> Awesome, thanks Jeff. I think doing it this way would make my app use
> less resources in general which is good for everybody.
> - Claude
>
> On Mar 26, 2:25 pm, Jeff S  wrote:
>
> > Hi Claude,
>
> > On Mar 25, 8:27 pm, cz  wrote:
>
> > > The reason I ask this is for the following scenario:
> > > My main app uses Django 1.x and has fairly low, but quite useful ;),
> > > traffic thus often requiring a cold start. It incurs significant
> > > startup time and so the initial requests are quite slow. The pages
> > > also contain lots of images uploaded by users which in turn are
> > > initially very slow to serve up.
> > > What I'd like to do is use a lighter weight framework just to serve
> > > images and other pseudo-static content. It would be fairly
> > > straightforward to simply create a special version of the app that
> > > when installed has direct access to the same datastore and can be very
> > > fast. This wouldn't ever be set as the default version of course, but
> > > would still be 'a part of' the default app and it would be using the
> > > same quota bank and hopefully wouldn't be a violation of the TOS.
> > > Anways, after reading the TOS I couldn't find an answer to this.
>
> > > So, in case none of this makes much sense the gist of the question is
> > > can I have two versions of the app live at the same time (only one
> > > being the default)?
> > > Say my app id is 'foo'. I upload 'foo' version 5 and then I also
> > > upload a 'foo' version 6 with a different main.py and code that is
> > > optimized for a specific kind of content (eg. images, no templates).
> > > Version 5 is set as the default but generates pages with image urls
> > > that point to version 6.
>
> > This would be fine since you are talking about using two versions
> > under the same app ID. Quotas are applied based on the app ID (not
> > further down on the version level), so sending traffic to multiple
> > versions would be pulling from the same quota pool.
>
> > Good question,
>
> > Jeff
>
> > > Can I do this under the TOS and still be a good GAE citizen?
>
> > > thanks,
> > > - Claude
>
>
--~--~-~--~~~---~--~~
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: Can Appengine provide Browser information..?

2009-03-26 Thread Tom M.

Very helpful.

Are there any suggested "best practices" for determining how to
display a page? For example, in displaying a wine bottle I'd like to
have a mobile friendly page and a full page for online visitors. Do I
just switch off of the HTTP_USER_AGENT?

Guidance much appreciated!


On Mar 16, 9:05 am, Joe Bowman  wrote:
> import os
>
> os.environ['REMOTE_ADDR'] is the IP
> os.environ['HTTP_USER_AGENT'] is the user agent
>
> I'm sure there's more, those are the two I needed when I created the
> sessions utility.
>
> Note: I've found that they don't always populate, more than likely a
> perbrowserissue. I was confused to see REMOTE_ADDR not always
> populate.
>
> On Mar 15, 12:06 pm, xml2jsonp  wrote:
>
> > Using JavaScript:
>
> > if (/msie/.test(navigator.userAgent.toLowerCase())
> > && !/opera/.test(navigator.userAgent.toLowerCase())) {
> > [...]
>
> > On Mar 15, 7:56 am, jago  wrote:
>
> > > Hi,
>
> > > Can I write some Python code that creates an HTML which prints if the
> > > client is running Firefox or IE ?
>
>
--~--~-~--~~~---~--~~
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: NeedIndexError help

2009-03-04 Thread Tom M.

Wow I'm discovering the pain of inequality searches.  If I have
ten fields and want to search any inequality on just one of them,
index.yaml needs to include every permutation of field names?


On Mar 4, 9:23 am, Tom  wrote:
> I am running into my first NeedIndexError after uploading to the live
> server.
>
> class Wine(db.Model):
>   bottlename = db.StringProperty()
>   bottlerating = db.FloatProperty(default=0.0)
>
> query = db.Query(Wine)
> query.filter('bottlename =', 'CAVIT')
> query.filter('bottlerating >=', 2.0)
> query.count()
>
> I get the NeedIndexError on the count() call.  Are entries needed in
> index.yaml for this? What should the entry be?  My queries always work
> locally and even changing to db.GqlQuery() doesn't write anything into
> the index.yaml as autogenerated.
>
> Any help for me?
--~--~-~--~~~---~--~~
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: Annoucement: you may now purchase additional computing resources

2009-02-24 Thread Tom M.

Fantastic!  While personally I hope not to have to shell out too much
coin, I'll contribute my $0.02 now and then. ;-)

I can quite sincerely thank Google for teaching this "old dog" new
tricks.  I have an application (Wine by the Bar) that runs on the
Android phone and is backed by GAE.  Throw in Google maps, products,
picasa, blogspot, youtube and there are no boundaries to what is
possible.

Here's to hoping that I never have to play in anyone else's cloud!
Thanks Google!

On Feb 24, 4:30 pm, Jeff S  wrote:
> Hi all,
>
> We've just announced that it is now possible to purchase additional
> quota for your application. To borrow from our blog post,
>
> """
> We're psyched to announce that developers can now purchase additional
> computing resources on App Engine, enabling apps to scale beyond our
> free quotas. This has been our most requested improvement to App
> Engine and we're thrilled to deliver it, as promised.
>
> You can now set a daily budget for your app that represents the
> maximum amount you're willing to pay for computing resources each day.
> You allocate this budget across CPU, bandwidth, storage, and email,
> and you pay for only what your app consumes beyond the free
> thresholds...
> """
>
> More details are available at the following locations:
>
> Blog 
> post:http://googleappengine.blogspot.com/2009/02/new-grow-your-app-beyond-...
>
> Updated quota documentation 
> page:http://code.google.com/appengine/docs/quotas.html
>
> Documentation on purchasing additional 
> quota:http://code.google.com/appengine/docs/billing.html
>
> Billing FAQs:http://code.google.com/appengine/kb/billing.html
>
> Questions? Comments? :-)
>
> Happy coding,
>
> Jeff
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---