[google-appengine] Re: Long key_name design question?

2008-10-02 Thread yejun
On Oct 2, 2:31 pm, Bill <[EMAIL PROTECTED]> wrote: > Seems like the SHA hashes are overkill. Collisions have been found for both sha0 and md5. I guess the minimal usable hash function is sha1 for now. In python hashlib uses openssl which should be reasonable fast. --~--~-~--~~---

[google-appengine] Re: Long key_name design question?

2008-10-02 Thread yejun
that > all had the same hash (such that the lookups would be linear instead > of constant), but I'm much more concerned about minimizing my CPU > burder on all requests :) > > On Oct 2, 1:09 pm, yejun <[EMAIL PROTECTED]> wrote: > > > On Oct 2, 2:31 pm, Bill <

[google-appengine] Re: Long key_name design question?

2008-10-02 Thread yejun
ging the fact that the secure hashes are written in C > would definitely improve things. > > Do you have a link to any info about the S3 hash problem?  A quick > search didn't turn anything up. > > On Oct 2, 3:28 pm, yejun <[EMAIL PROTECTED]> wrote: > > > The pr

[google-appengine] Re: Long key_name design question?

2008-10-02 Thread yejun
I just tested this on GAE. import hashlib hashlib.sha224("Nobody inspects the spammish repetition").hexdigest() They are working properly. On Oct 2, 8:14 pm, ryan <[EMAIL PROTECTED]> wrote: > unfortunately, app engine doesn't support native (ie C-based) python > modules: > > http://code.google.

[google-appengine] Re: How to get ReferenceProperty's key without causing a 'get'

2008-10-02 Thread yejun
I think you shouldn't define a post field in comment at all. Simply make post as parent of comment when storing data. On Oct 2, 6:40 pm, Rafe <[EMAIL PROTECTED]> wrote: >   Folks, > >   There have been a number of people asking on the forums what the > correct way to get the key of a ReferencePro

[google-appengine] Re: How to get ReferenceProperty's key without causing a 'get'

2008-10-02 Thread yejun
Then you can use parent_key() method to access key directly. On Oct 2, 7:40 pm, yejun <[EMAIL PROTECTED]> wrote: > I think you shouldn't define a post field in comment at all. Simply > make post as parent of comment when storing data. > > On Oct 2, 6:40 pm, Rafe &l

[google-appengine] Re: Datastore is slow on queries involving many entities, but a smallish dataset

2009-12-01 Thread yejun
Does MessageS have a relation? Maybe those related field being converted to separated queries because there's no table join. In JPA you can specify those fields as Lazy fetch to avoid that. On Dec 1, 4:55 am, Eric Rannaud wrote: > Athttp://www.911pagers.org/, a relatively simple query such > ash

[google-appengine] Re: Datastore is slow on queries involving many entities, but a smallish dataset

2009-12-01 Thread yejun
On Dec 1, 4:55 am, Eric Rannaud wrote: > Athttp://www.911pagers.org/, a relatively simple query such > ashttp://www.911pagers.org/#rangeId0-128, which does: > >     SELECT * FROM MessageS where id >= 0 && id < 128 order by id > > and fetches 128 entities, takes anywhere between 1s and 4s, usual

[google-appengine] Re: Datastore is slow on queries involving many entities, but a smallish dataset

2009-12-01 Thread yejun
Did you enable auto index in datastore-indexes.xml and generated datastore-indexes-auto.xml is correct? On Dec 1, 6:33 pm, Eric Rannaud wrote: > On Tue, Dec 1, 2009 at 3:21 PM, yejun wrote: > >> id is not the primary key of MessageS, but a 'long' field, _unique_ in > &

[google-appengine] Re: Datastore is slow on queries involving many entities, but a smallish dataset

2009-12-01 Thread yejun
You still need to enable auto index. http://code.google.com/appengine/docs/java/config/indexconfig.html On Dec 1, 7:32 pm, Eric Rannaud wrote: > On Tue, Dec 1, 2009 at 4:21 PM, yejun wrote: > > Did you enable auto index in datastore-indexes.xml and generated > > datastore-inde

[google-appengine] Re: Can We use Unicode in Custom Tags?

2008-10-08 Thread yejun
Maybe you can try this. import sys reload(sys) sys.setdefaultencoding('utf-8') On Oct 7, 9:18 am, Gmail <[EMAIL PROTECTED]> wrote: > Current I Try to Use django's Custom Tags, > It is usful,I like it. > > but when i try to render something Unicode , > I got UnicodeDecodeError. > > This is my Ta

[google-appengine] Re: Still having trouble with high-cpu warnings for thumbnails.

2008-10-08 Thread yejun
The default cache setting is no-cache, the browser will revalidate the same image ever time the image being displayed. You may try to set this explicitly to a week. self.response.headers['Cache-Control'] = 'public, max-age=63' On Sep 24, 10:59 pm, iceanfire <[EMAIL PROTECTED]> wrote: > I'm st

[google-appengine] Re: Simple Graphics App

2008-10-09 Thread yejun
I think what Op want is a standalone .Net application with gdata. Maybe he can also use GAE as a rpc server to store some data. On Oct 9, 3:28 pm, Davide Rognoni <[EMAIL PROTECTED]> wrote: > IE or Linux: "Mono is a cross platform, open source .NET development > framework."http://www.mono-project.

[google-appengine] Re: datastore transaction question

2008-10-09 Thread yejun
Maybe you can store money and ownership relation in a single entity group. ListProperty only works with key value not reference, so they won't be dereferenced automatically. If you want to access partial information about thing without pulling the blob value, you need to make a separated kind in d

[google-appengine] Re: Modeling mutual references

2008-10-09 Thread yejun
You don't have to give class for ReferenceProperty. first = db.ReferenceProperty() On Oct 9, 6:53 pm, acuth <[EMAIL PROTECTED]> wrote: > Is it possible to have two models reference each other? I can't get > this to work and haven't been able to find this limitation in the > documentation. As a si

[google-appengine] Re: unique identifier for server process

2008-10-09 Thread yejun
Or create an empty datastore object. Its id will be globally unique. On Oct 9, 12:30 pm, Tony Arkles <[EMAIL PROTECTED]> wrote: > I just used a random number within an import (since imports only > happen once per instance, it should persist for the lifetime of the > process) > > On Oct 9, 12:56 a

[google-appengine] Re: 1000 file limit

2008-10-10 Thread yejun
Why not serve file from S3 directly? On Oct 10, 1:38 pm, "Venkatesh Rangarajan" <[EMAIL PROTECTED]> wrote: > Phtq, > > Its better if you host your static files in Amazon S3. > > You can create a new subdomain...say media..com on S3 > > And when in appengine, you reference that file, all you have

[google-appengine] Re: datastore transaction question

2008-10-10 Thread yejun
I found an old thread on this topic. http://groups.google.com/group/google-appengine/browse_thread/thread/ba1c22b37581/8722ed96f11f0c17 It seems eventual consistency is the only practical option. On Oct 9, 1:04 pm, David <[EMAIL PROTECTED]> wrote: > Hi, a question for all you datastore gurus:

[google-appengine] Re: 1000 file limit

2008-10-10 Thread yejun
> ads and any other functionality you want. > > Rgds, > Venkatesh > > On Fri, Oct 10, 2008 at 12:05 PM, yejun <[EMAIL PROTECTED]> wrote: > > > Why not serve file from S3 directly? > > > On Oct 10, 1:38 pm, "Venkatesh Rangarajan" > > <[EMAIL PROTE

[google-appengine] Redirect isn't working

2008-10-10 Thread yejun
I was testing OpenID consumer example for appengine. http://code.google.com/p/google-app-engine-samples/ It seems redirect to openid server only work inside SDK environment not on GAE. The GAE front server simple display a 302 page with a link to page itself. I also tried self.redirect(url), whi

[google-appengine] Re: Redirect isn't working

2008-10-10 Thread yejun
est that follow_redirects > can be used to fix it? > > On Sat, Oct 11, 2008 at 12:15 AM, yejun <[EMAIL PROTECTED]> wrote: > > > I was testing OpenID consumer example for appengine. > >http://code.google.com/p/google-app-engine-samples/ > > > It seems redirect

[google-appengine] Re: Polymorphism: one-to-many relation how to store and retrieve efficiently

2008-10-13 Thread yejun
his method we have 2 objects for every Shape that we use. > > Is there another method to prevent this entity-index-limit? > > 2008/10/13 djidjadji <[EMAIL PROTECTED]>: > > > But this will give you VERY large entity groups and that is not very > > eff

[google-appengine] Re: Polymorphism: one-to-many relation how to store and retrieve efficiently

2008-10-13 Thread yejun
Using parent = or ancestor is probably faster because the locality of datastore. On Oct 13, 4:30 am, djidjadji <[EMAIL PROTECTED]> wrote: > Hello, > > I'm looking for a way to store and retrieve a polymorphic one-to-many > relation. > The test case I used is for a drawing on a page to contain di

[google-appengine] Re: datastore .order question

2008-10-13 Thread yejun
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 t

[google-appengine] Re: BaseModel IndexError: list index out of range

2008-10-13 Thread yejun
Model can't be in your root directory. On Oct 13, 1:03 pm, ghostrocket <[EMAIL PROTECTED]> wrote: > this is the issue: > > line  51 of appengine_dango/models.py is: > > self.app_label = model_module.__name__.split('.')[-2] > > i'm not sure why we need the ".split('.')[-2]" but my model_module is

[google-appengine] Re: Why my website is speeder using www. than without ?!?

2008-10-13 Thread yejun
That's because manatlan.com is mapped only 2 static ips, www.manatlan.com is mapped to entire ghs google servers. On Oct 13, 2:44 pm, manatlan <[EMAIL PROTECTED]> wrote: > Since some times, my website seems really down ... > when i usehttp://manatlan.com... it can make 5 minutes to response. > a

[google-appengine] Re: Getting 'UnicodeDecodeError'. Please help

2008-10-14 Thread yejun
iso8859-1 should be able to decode any char, but I guess there's a bug in code which caused implicit unicode conversion. On Oct 14, 12:44 am, Nishu <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to develop a screen scraping application using the google > Webapp framework. The application par

[google-appengine] Re: Getting 'UnicodeDecodeError'. Please help

2008-10-14 Thread yejun
inal problem. > > Thanks > Nishant > > On Oct 14, 12:13 pm, yejun <[EMAIL PROTECTED]> wrote: > > > iso8859-1 should be able to decode any char, but I guess there's a bug > > in code which caused implicit unicode conversion. > > > On Oct 14, 12:4

[google-appengine] Any efficient way to implement a DELETE statement?

2008-10-22 Thread yejun
The model is very simple here. class table(db.Model) atime=db.DateTimeProperty(auto_now=True) data=db.BlobProperty() I want to have function simply delete data older than a certain time. Is it safe to use just db.delete(table.all().filter('atime <', expire_time).fetch(100)) or do I hav

[google-appengine] Re: ReferenceProperty collection query object available in Django?

2008-10-22 Thread yejun
The document actually says query iterator is batched already. http://code.google.com/appengine/docs/datastore/queryclass.html On Oct 22, 6:31 pm, Alexander Kojevnikov <[EMAIL PROTECTED]> wrote: > Alex, > > Django really doesn't care if it's a query object or not. As long as > it's a valid iterato

[google-appengine] Re: cherrypy application hosting

2008-10-23 Thread yejun
Cherrypy 3.0 can run on app engine without modification. Here is a hello example from http://boodebr.org/main/python/cherrypy-under-google-appserver I modified it a little bit so the cherrypy application will be cached by app engine. import cherrypy import wsgiref.handlers class Root: @cherr

[google-appengine] Re: Any efficient way to implement a DELETE statement?

2008-10-23 Thread yejun
t, because same entry need to be fetch twice, one for query and one for verifying inside transaction. On Oct 23, 6:09 pm, Jeff S <[EMAIL PROTECTED]> wrote: > Hi yejun, > > I didn't see any immediate problems with the first approach which you > listed, I agree it will be mor

[google-appengine] Re: Per Session Datastore

2008-10-23 Thread yejun
I wrote a patch to enable beaker session work on webapp. You can get code here. http://appengine-cookbook.appspot.com/recipe/add-session-support-to-webapp/ On Sep 25, 1:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > First post related to my first ever app, so watch out. > > I've had a

[google-appengine] Re: querying across different entity types

2008-10-24 Thread yejun
Schedule.gql("WHERE stopRef IN :1", Stop.gql("WHERE routeRef in :1", Route.gql("WHERE name = 'Broad Street'").fetch(1000)).fetch(1000)).fetch(1000) On Oct 24, 2:03 pm, darren <[EMAIL PROTECTED]> wrote: > Hi, I saw a similar thread on this, but I'm still uncertain on the > best way to query entiti

[google-appengine] Re: counting

2008-10-24 Thread yejun
His problem is a count needed for every single user. So a single change will cause a massive update on all count. On a traditional database it is the position on the index. On Oct 24, 5:33 pm, Sylvain <[EMAIL PROTECTED]> wrote: > Sorry, I don't understand exactly the problem but if you want to ha

[google-appengine] Re: Datastore Entity

2008-10-24 Thread yejun
I think you mean kind. Newkind = type("KindName", (db.model,), dict(p1=db.Property(), p2...)) On Oct 24, 5:45 pm, Koren <[EMAIL PROTECTED]> wrote: > hi, > > is it possible to create a datastore entity at runtime? > i have the situation that i need to create new Entities (and not > records) durin

[google-appengine] Re: Datastore Entity

2008-10-25 Thread yejun
I think this should work as well. I only tried db.Model though. On Oct 25, 3:36 am, Koren <[EMAIL PROTECTED]> wrote: > Thanks! > so can i do soemthing like: > Newkind = type("KindName", (db.expando,)) > > obj1 = KindName() > > ? > > On Oct 25, 12:14 a

[google-appengine] Re: Datastore Entity

2008-10-25 Thread yejun
36 am, Koren <[EMAIL PROTECTED]> wrote: > Thanks! > so can i do soemthing like: > Newkind = type("KindName", (db.expando,)) > > obj1 = KindName() > > ? > > On Oct 25, 12:14 am, yejun <[EMAIL PROTECTED]> wrote: > > > I think you mean

[google-appengine] Re: Using Model.get_or_insert to create unique values for entities

2008-10-26 Thread yejun
There is no reason to store uid twice if it is equal to key name minus a prefix. You uid will just be user.key().name()[4:] If you change uid in datastore, the get_or_insert_by_uid will stop working as well. On Oct 25, 12:30 pm, Alexis Bellido <[EMAIL PROTECTED]> wrote: > Hello everybody, I neede

[google-appengine] Re: Using Model.get_or_insert to create unique values for entities

2008-10-27 Thread yejun
The new object's key path will get longer and longer and eventually over the limit. Also you need to know all its previous keys to be able to retrieve it by key name. I think the best practice to change primal key is create an intermediate transaction log object which belongs to old entity group

[google-appengine] Re: key().id() upper bound

2008-10-27 Thread yejun
You can at least use iso-8859-1 encoding to use 256 of it. On Oct 24, 11:09 pm, jeremy <[EMAIL PROTECTED]> wrote: > for what it's worth - the behind the scenes str->unicode conversion > which the api performs does indeed make it impossible to use the full > 8*500 bits afforded a StringProperty...

[google-appengine] Re: File download from datastore

2008-10-27 Thread yejun
Check section 4 of rfc 2184. It seems you need to specify the encoding type on the value it self, because Content-Disposition itself only support us ascii encoding. http://www.ietf.org/rfc/rfc2183 http://www.ietf.org/rfc/rfc2184 On Oct 27, 10:08 pm, Sergey Klevtsov <[EMAIL PROTECTED]> wrote: >

[google-appengine] Re: File download from datastore

2008-10-27 Thread yejun
I just tested rfc 2184. It seems only firefox support it. On Oct 27, 10:24 pm, yejun <[EMAIL PROTECTED]> wrote: > Check section 4 of rfc 2184. It seems you need to specify the encoding > type on the value it self, because Content-Disposition itself only > support us ascii enc

[google-appengine] Re: Will there ever be a DictProperty in datastore?

2008-10-28 Thread yejun
Dict is not indexable. On Oct 28, 5:11 pm, luismgz <[EMAIL PROTECTED]> wrote: > Is there any reason for not having implemented a DictProperty in > datastore? > Are there plans to implement it? > I believe it would be great to have native dictionaries in datastore, > and that it would simplify a l

[google-appengine] Re: Django + GAE

2008-10-29 Thread yejun
All of them are monkey patchs, which means it may break when you do an upgrade. For simple project I think the buildin webapp frameworks should works as well. On Oct 29, 12:24 pm, Daniel Larkin <[EMAIL PROTECTED]> wrote: > Hi all, > > I'd like to use Django on GAE for a small project. Ideally I'd

[google-appengine] Re: Filter by first letter? LIKE Statements?

2008-10-29 Thread yejun
http://code.google.com/appengine/docs/datastore/queriesandindexes.html Read the first tip section. On Oct 29, 6:38 pm, Kenchu <[EMAIL PROTECTED]> wrote: > How do you filter things by for example their first letter? Take this > model for example: > > class Song(db.Model): >   title = db.StringPro

[google-appengine] Re: Will there ever be a DictProperty in datastore?

2008-10-30 Thread yejun
There's a difference between property and datastore type. On Oct 30, 4:30 pm, luismgz <[EMAIL PROTECTED]> wrote: > There are other options too, such as pickling a dictionary into a blob > property, or saving its string representation into a StringProperty > and then use eval() to get it back "ali

[google-appengine] Re: Modeling Hierarchical Data

2008-10-31 Thread yejun
I think I have read somewhere in documents, the entity groups size need to keep small. On Oct 31, 6:34 am, Anthony <[EMAIL PROTECTED]> wrote: > Store all the parent ids as a hierarchy in a string... > > h="id1/id2/" > h="id1/id2/id3" > h="id1/id2/id3/id4" > h="id5/" > h="id5/id6" > > You can then

[google-appengine] Re: Writing binary data in the HTTP response

2008-10-31 Thread yejun
I tried your code. No error whatsoever and working as expected. On Oct 31, 12:33 pm, Sito <[EMAIL PROTECTED]> wrote: > Hi all, > > I can't find a way to write arbitrary binary data in my response. I > have a big list of ints that I would like to serve in a response as > compact as possible. For t

[google-appengine] Re: Possible bug in urlfetch_stub.py

2008-11-01 Thread yejun
Http PUT usually is used to push a file like object not key/value pairs. On Nov 1, 4:24 am, Paul <[EMAIL PROTECTED]> wrote: > The following are lines 134 and 135 of urlfetch_stub.py: > > if method == 'POST' and payload: >    adjusted_headers['Content-Type'] = 'application/x-www-form- > urlencoded

[google-appengine] Re: patterns for expiration settings for static files

2008-11-01 Thread yejun
Current static file/dir expiration doesn't work very well because there's no Last Modified http header. On Nov 1, 5:00 am, dobee <[EMAIL PROTECTED]> wrote: > thx a lot > > just for the records: you dont need default_expiration but the > static_files directive, the specific url needs to be first >

[google-appengine] Re: Datastore API - max. keyname length ?

2008-11-01 Thread yejun
500 unicode I think. On Nov 1, 1:39 pm, Roberto Saccon <[EMAIL PROTECTED]> wrote: > When I define datastore entities with a given keyname, what is the > max. size of such a keyname ? > > regards > Roberto --~--~-~--~~~---~--~~ You received this message because you

[google-appengine] Re: Set "content-type" and "content-encoding" for files served statically???

2008-11-01 Thread yejun
Set static file in app.yaml. GAE does not allow setting content- encoding for both static and dynamic files. handlers: - url: /favicon\.ico static_files: static/favicon.ico mime_type: image/vnd.microsoft.icon upload: static/favicon.ico On Nov 1, 6:01 am, jago <[EMAIL PROTECTED]> wrote: >

[google-appengine] Re: App Engine 'session' questions

2008-11-01 Thread yejun
1MB per variable. On Nov 1, 10:50 pm, Alexander Kojevnikov <[EMAIL PROTECTED]> wrote: > > as for interpreter memory, i don't believe we've published any hard > > limits. the interpreter will raise a MemoryError if you run out of > > memory, though, so like with caching, you could try measuring it

[google-appengine] Re: counter use pattern

2008-11-01 Thread yejun
The initialization code seems very light, only 3 object creation and 4 object attributes assignment without touch both memcache and datastore. I think your code is correct, a local singleton map shouldn't be needed. On Nov 1, 9:39 pm, josh l <[EMAIL PROTECTED]> wrote: > Bill, > > Thanks for the r

[google-appengine] Re: Confusions on transactions and concurrent writes to entity groups

2008-11-01 Thread yejun
It is not really a lock. The first finished put will win, the other concurrent puts will fail and retry. On Oct 31, 8:37 pm, jeremy <[EMAIL PROTECTED]> wrote: > "All writes are transactional." > > Does this mean updating values on a single entity will lock the entire > group when put() is called?

[google-appengine] Re: counter use pattern

2008-11-02 Thread yejun
I found a bug in that code. If you do an increment after memcache exhaustion and without read value, it will reset value to 0. On Nov 2, 1:11 am, Bill <[EMAIL PROTECTED]> wrote: > > As I see it, any code that uses your new counter object will need to > > deal with instantiating it somewhere > ..

[google-appengine] Re: counter use pattern

2008-11-02 Thread yejun
I found another bug. Counter.get_count tests whether self.memcached.count is None, however self.memcached.count will never return None. On Nov 2, 1:11 am, Bill <[EMAIL PROTECTED]> wrote: > > As I see it, any code that uses your new counter object will need to > > deal with instantiating it somew

[google-appengine] Re: How query reference property?

2008-11-02 Thread yejun
You can't query on reference's property. On Nov 1, 11:31 pm, "Rodrigo Lopes" <[EMAIL PROTECTED]> wrote: > Hi there! I'm new to python and app engine, I need some help with this: > > *class* Profile (db.Model): >     name = db.StringProperty() >     backup_date = db.DateProperty() > > *class* BoxI

[google-appengine] Data view disappeared after I changed model

2008-11-02 Thread yejun
After I changed a BlobProperty to TextProperty, all tables disappeared from data view of admin console. I can still query data from code though. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Google App Engine" gr

[google-appengine] Re: more complicated counters/ratings (sorting?)

2008-11-02 Thread yejun
Everytime a user rates a product, you update average rating for that product as well. Unless there's more than dozen user need to rate a single product simultaneously, you don't need shard the count at all. On Nov 2, 5:33 pm, "Jay Freeman \(saurik\)" <[EMAIL PROTECTED]> wrote: > Ok, so I've watch

[google-appengine] Re: pages displaying after logout

2008-11-03 Thread yejun
Use HTTP headers Pragma: no-cache Cache-Control: no-store, no-cache, must-revalidate, max-age=0 And browser will not store POST request. On Nov 3, 3:33 am, saurabh <[EMAIL PROTECTED]> wrote: > Hi, > >    i am developing an application in cherrypy. I am new to > python . i got a problem that

[google-appengine] Re: External Storage Options?

2008-11-03 Thread yejun
You can use amazon S3 storage for now which support query string authorization. I believe google will offer large file storage in the near future. On Nov 3, 11:19 am, jivany <[EMAIL PROTECTED]> wrote: > Part of me thinks this is a stupid question and I'm over-complicating > the solution but... >

[google-appengine] Re: JSONP Gateway

2008-11-03 Thread yejun
I think JSON only use utf-8 encoding. On Nov 3, 2:22 pm, Sylvain <[EMAIL PROTECTED]> wrote: > I think that the current encoding is set to : "ISO-8859-1" and the > "response" is "UTF-8". > > So if i change my default browser encoding to UTF-8, all accented > chars are well displayed. > > Regards >

[google-appengine] Re: External Storage Options?

2008-11-03 Thread yejun
; the request is from a validated GAE user, but that should be simple > enough for you to figure out without posting the information in a > group which is indexed by search engines allowing people to easily > bypass whatever you put in place. > > On Nov 3, 12:28 pm, yejun <[EMAIL PRO

[google-appengine] Re: App Engine vs. Python vs. OOP terminology?

2008-11-03 Thread yejun
One thing really puzzles me in python if you change a class definition after you create an instance of that class, how should the instance behavior. It seems python instance will make their own copy of class attributes only on write. On Nov 3, 11:40 am, pr3d4t0r <[EMAIL PROTECTED]> wrote: > On No

[google-appengine] Re: counter use pattern

2008-11-03 Thread yejun
I fixed some problem in my copy of bill's code. You can find here. http://github.com/yejun/sharded_counter/tree/master/counter.py It is very hard to simulate a real contention incidence, so my code isn't tested. The problem in bill's code is that his memcache class is completely b

[google-appengine] Re: counter use pattern

2008-11-03 Thread yejun
> To solve this, I'm also > planning to destroy and recreate the memcache object upon successful > datastore write (and associated memcache delay being reset to zero). You shouldn't do this. It the completely negates the reason why you use this counter class. If you just need a counter for a loca

[google-appengine] Re: counter use pattern

2008-11-03 Thread yejun
used here is to improve write concurrency. On Nov 3, 3:43 pm, josh l <[EMAIL PROTECTED]> wrote: > Yejun, > > Thanks for the updated code example.  Since a counter is such a common > need, I think it might be helpful if we all worked together on the > same codebase, rather than

[google-appengine] Re: External Storage Options?

2008-11-03 Thread yejun
y domain). I've been looking at the Account > Authentication API (http://code.google.com/apis/accounts/) but I'm not > sure if this would allow my remote server to automatically > authenticate each request for an image. > > Jeff > > On Nov 3, 2:53 pm, yejun <[EMAIL PROTE

[google-appengine] Re: counter use pattern

2008-11-03 Thread yejun
second seems have the similar reliability to me. On Nov 3, 4:32 pm, josh l <[EMAIL PROTECTED]> wrote: > Yejun, > > I've been told that the memcached framework on GAE uses a first- > created, first-deleted algorithm, and that we have finite (a few > hundred megs, but maybe ev

[google-appengine] Re: counter use pattern

2008-11-03 Thread yejun
al time per request.  I believe I can drastically shorten this time > by not attempting to write to the datastore as often, and having the > counter use just memcache most of the time for increments.  I can't > imagine I am the only person to think of this? > >   -Josh >

[google-appengine] Re: counter use pattern

2008-11-03 Thread yejun
he app requirement is for multiple counter > incrememts/request, except with my counter example (far) above. > >   -Josh > > On Nov 3, 2:17 pm, yejun <[EMAIL PROTECTED]> wrote: > > > I am not say they are same.  But you are degrading a 100% reliable > > solution

[google-appengine] Re: Changing overriding the method(HTTP verb) of the request by extending RequestHandler

2008-11-03 Thread yejun
Or you can modify self class MyRequestHandler(webapp.RequestHandler): def initialize(self, request, response): m = request.get('_method') if m: self.__dict__[request.method] = self.__dict__[m] webapp.RequestHandler.initialize(self, request, response) On N

[google-appengine] Re: Permanent Unique User Identifier

2008-11-03 Thread yejun
Allow multiple email address per user. On Nov 3, 5:46 pm, Ryan Lamansky <[EMAIL PROTECTED]> wrote: > Is there a good way to establish a permanent unique user identifier? > > All we have now is the email address.  If the user changes this, they > lose access to all content they're associated with.

[google-appengine] Re: Permanent Unique User Identifier

2008-11-03 Thread yejun
Why not just let user choose a user name? On Nov 3, 10:35 pm, Ryan Lamansky <[EMAIL PROTECTED]> wrote: > Mahmoud: The problem is that won't recognize if the user changes their > email address; it'll create a new entity and the user will lose > everything. > > y

[google-appengine] Re: more complicated counters/ratings (sorting?)

2008-11-04 Thread yejun
You keep total rating values and number of users rated both in two shard counters which are not belong to your product entity group. Then update your average rating for your product's entity group periodically like once every 100 request or 1000 request depends on your need. So the concurrency lev

[google-appengine] Re: more complicated counters/ratings (sorting?)

2008-11-04 Thread yejun
uot;. I can easily see how > you don't need a transaction to sum the shards into the total, but you > definitely need a transaction to add the new rating and add its weight to > the shard. -J > > -- > From: "yejun" <[EMAI

[google-appengine] Re: GAE vs. EC2

2008-11-04 Thread yejun
I feel this comparison is similar to raw meat vs cooked dinner. On Nov 4, 12:31 pm, sal <[EMAIL PROTECTED]> wrote: > Just curious to hear some opinions on this - especially from anyone > who has experience with Amazon's EC2 as well as GAE. > > I just read a blog saying you can be up and running w

[google-appengine] Re: more complicated counters/ratings (sorting?)

2008-11-04 Thread yejun
ally have anything he's counting (just button > pushes), but if it were blog posts or comments then those items need to be > in the same entity group so you can update the shard's count and add the > post as a single, atomic transaction. > > -J > > ---

[google-appengine] Re: GAE vs. EC2

2008-11-04 Thread yejun
n be > invalidated at-random, as well as the memcache... and we're limited to > using a sortof limited Datastore, rather than the full RDBMS you could > have in an EC2 image)  Maybe a bit like a free dinner without a fork? > =) > > On Nov 4, 1:19 pm, yejun <[EMAIL PROTECT

[google-appengine] Re: GAE vs. EC2

2008-11-04 Thread yejun
e, possibly... > > >> > > > But assume that someone signs up for EC2, and just chooses an > >> existing > >> > > > image with Python in it.  Really there isn't much cooking involved > >> > > > correct?  You should have a work

[google-appengine] Re: GAE vs. EC2

2008-11-04 Thread yejun
On EC2 you can make your own image, but that's not the point. I believe no one in their right mind would use a public image for their production system, it is just not safe by any means. You need to do a lot more than by lanching an image. You need to manage them just like a real operating system

[google-appengine] Re: user login problem

2008-11-04 Thread yejun
Naked domain is no longer supported by google. I think you'd better redirect anyone use naked domain to www. On Nov 4, 3:13 pm, Richie <[EMAIL PROTECTED]> wrote: > Hello, > > my application ishttp://www.eaglefeed.me > > Login from there works like a charme, but login fromhttp://eaglefeed.me > doe

[google-appengine] Re: Indexing does not work

2008-11-04 Thread yejun
Only compound queries need index. Single column properties are already implicitly indexed. On Nov 4, 2:54 pm, Richie <[EMAIL PROTECTED]> wrote: > Hello, > > my user base is increasing that's why I wanted to index my tables. > > index.yaml is not updated automatically on my windows machine (I trie

[google-appengine] Re: GAE vs. EC2

2008-11-04 Thread yejun
invalidated at-random, as well as the memcache... and we're limited to > using a sortof limited Datastore, rather than the full RDBMS you could > have in an EC2 image)  Maybe a bit like a free dinner without a fork? > =) > > On Nov 4, 1:19 pm, yejun <[EMAIL PROTECTED]&g

[google-appengine] Re: user login problem

2008-11-04 Thread yejun
Richie <[EMAIL PROTECTED]> wrote: > do you have any information on how to do this? > > Richie > > On 4 Nov., 21:14, yejun <[EMAIL PROTECTED]> wrote: > > > Naked domain is no longer supported by google. I think you'd better > > redirect anyone use naked

[google-appengine] Re: Help: Problem using WSGIApplication to automatically generate error page

2008-11-04 Thread yejun
Put get=poest in your not_found handler. On Nov 4, 7:57 pm, Alok <[EMAIL PROTECTED]> wrote: > Here is my app.yaml: > > application: proshortsetf > version: 1 > runtime: python > api_version: 1 > > handlers: > - url: /blueprint >   static_dir: blueprint > - url: /candlestick >   static_dir: candl

[google-appengine] Re: GAE vs. EC2

2008-11-05 Thread yejun
> If you have access to EC2 already, why not put the frontend there too? > It would minimize latency / etc.  Just curious... not sure where I see > the GAE integration as being technically a very attractive option in > your case... > It's not the technology issue here. Theoretically you can use

[google-appengine] Re: html form with file upload, and download files from GAE

2008-11-05 Thread yejun
You can use POST request to upload file to S3 directly. S3 will redirect user back on success but not on failure. On Nov 5, 1:13 pm, Dado <[EMAIL PROTECTED]> wrote: > Shoot! How about file upload time then... I can always store the data > on S3, but if GAE quits on a request that takes a long tim

[google-appengine] Re: GAE vs. EC2

2008-11-05 Thread yejun
On Nov 5, 1:55 pm, "Barry Hunter" <[EMAIL PROTECTED]> wrote: > On Wed, Nov 5, 2008 at 6:39 PM, bFlood wrote: > > > EBS - from the amazon docs: > > "A volume can only be attached to one instance at a time, but many > > volumes can be attached to a single instance. " > >http://aws.amazon.com/ebs/

[google-appengine] Re: html form with file upload, and download files from GAE

2008-11-05 Thread yejun
You can't for now, because python variable is probably limited to 1MB size. On Nov 5, 2:41 pm, Dado <[EMAIL PROTECTED]> wrote: > Sure I can do that, but what if I want to verify or extract > information from the file before storing it? > > On Nov 5, 10:49 am, yejun &l

[google-appengine] Re: GAE vs. EC2

2008-11-05 Thread yejun
Just try it, you will see. I am tired of arguing here. It makes little sense to comparing them hypothetically. They are on completely different level of a real problem. On Nov 5, 2:27 pm, sal <[EMAIL PROTECTED]> wrote: > On Nov 5, 1:46 pm, yejun <[EMAIL PROTECTED]> wrote: > >

[google-appengine] Re: Entites which must not exist

2008-11-06 Thread yejun
In practical, you only need to search a few club geographically close to each other. So an brutual force scan is the simplest way. A query cross global seems pretty meaningless beyond statistical reasons. On Nov 6, 8:14 am, "Ian Bambury" <[EMAIL PROTECTED]> wrote: > 2008/11/6 powera <[EMAIL PROTE

[google-appengine] Re: Entites which must not exist

2008-11-06 Thread yejun
number just for the purpose of subdivide data. On Nov 6, 10:57 am, "Ian Bambury" <[EMAIL PROTECTED]> wrote: > How does that help the 1000-record limit? Do you mean get the nearby clubs > and just do all the rest manually? > > Ian > > http://examples.roughian.com >

[google-appengine] Re: How to set a property is unique key in app engine?

2008-11-06 Thread yejun
On Nov 6, 12:13 pm, Andy Freeman <[EMAIL PROTECTED]> wrote: > Can't this be done with a carefully constructed key_name? > There's a couple differences. Unique key means throw exception on duplication. Save duplicated key_name will cause overwritten. You have to use get_or_insert to test uniquenes

[google-appengine] Re: Permanent Unique User Identifier

2008-11-07 Thread yejun
Google openid already supports persistent id independent of user name or email address. http://code.google.com/apis/accounts/docs/OpenID.html On Nov 7, 5:56 pm, Alexander Kojevnikov <[EMAIL PROTECTED]> wrote: > Ryan, > > I see now. It looks like Google is going to fix this in the future, > see t

[google-appengine] Re: Purchased domain via Google Apps. How to host my appengine app on this domain?

2008-11-07 Thread yejun
I guess part of the reason is dns does not support domain name cname. Even google.com itself is just a redirect to www.google.com On Nov 7, 8:33 pm, jago <[EMAIL PROTECTED]> wrote: > Why did I register this domain if I then can't host my app there? Has > Google gone insane? > > I was possible fo

[google-appengine] Re: Observing GAE Scalability (or trying to ...)

2008-11-07 Thread yejun
Without knowing underlying cost, it's kinda pointless to compare them. You don't know what kind high end routers, servers and network google actually use for GAE and how much development cost per each GAE account. Some data maybe possible to be extrapolated from the price list published in May.

[google-appengine] Re: Purchased domain via Google Apps. How to host my appengine app on this domain?

2008-11-07 Thread yejun
Just set url to www in your app setting. On Nov 7, 9:20 pm, jago <[EMAIL PROTECTED]> wrote: > okok...I know. Google calls them 'access URLs' but a common although > wrong term is subdomain. > > let me rephrase my question: Is it possible if I purchasedwww.example.com > from Google to directly mak

  1   2   >