Showing posts with label tip. Show all posts
Showing posts with label tip. Show all posts

Sep 5, 2010

Best practice to import libraries or frameworks in App engine

Usual procedure is to paste the library in your application's path then upload it with your application using appcfg - update.
This works but sometimes we have to deal with huge libraries consisting of hundreds of python files that sometimes exceed the upper limit of 1000 files / application limit or reduce the number of available files for your application. Also maintaining  those files becomes a nightmare.
So what is the proper way ? :

May 13, 2010

Google Maps API quotas and App Engine

There is a lot of talk in various forums that I follow about Maps API quota limits.
To summarize: there is a limit of  2500 requests per day per requesting IP (see: http://code.google.com/apis/maps/faq.html) , if your application issues those requests from any server you can reach this limit quite fast. The situation is much worst if your application is based in GAE then it has to share those quotas with any other application in GAE that happens to use the same  API since all those applications are served from a limited number of google IP's making the API useless.
So far so bad except ...  there is a solution, delegate the job to the client using JSON & JS. This way :
a) quotas are calculated against your user's IP and more probably than not he will never exceed those.
b) you offload some workload from your server.
c) save some bandwidth.
Practically  I can't see a scenario where we can't use client side, since whatever we do we have to use the results only in connection with a Google map according to Maps TOS para 10.12 (unless of course you opt for the premier edition).

Aug 30, 2009

Google Maps API V3

I was doing some work with  Google Maps API V3 during last couple of weeks,
and here are some of my experience with this version.

  • Very small footprint and quite fast.
  • Although in Beta I think it is quite stable to be used in production - if of course you are ready to follow with latest developments and fixings.
  • A small but annoying bug I discovered (for which I filled a ticket : http://code.google.com/p/gmaps-api-issues/issues/detail?id=1643 along with a work around)
  • A tip : Since there is no way to hide-show the zoom - pan and Map type selection controls through api you have do it by writing some javascript 
        var housediv=yourmapObject.getDiv();
        if (housediv.childNodes[3]) { 
            housediv.childNodes[3].className = myClass 
            housediv.childNodes[4].className = myClass 
        } 
         // if exist 
        //controls reside in childnode[3] and [4] of container div 
        //rest is done with CSS class where you can hide-show or change the opacity

Aug 16, 2009

Be careful with Yaml editing

The other day I have almost erased an application of mine in App Engine the only thing that saved my day is that I was working on a version.
So how this happened to me ?
Well you edit your yaml file which probably have been copy/pasted from some other application , you read it, you are satisfied with what you see and you decide to upload on the spot so here we are: appcfg ... and presto your old application is gone coz you forgot to save this yaml which looked good to your eyes.
You see appcfg does not read through your own eyes it prefers its own devices which can read a complete different story than yours.