[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-09 Thread Ernesto Karim Oltra
Maybe you need to re-think your database models. This message may help: http://groups.google.com/group/google-appengine/browse_thread/thread/52d44bde94f2e8b8?pli=1 On 9 ene, 17:57, nischalshetty wrote: > Say a user selects 5000 unread messages (each message is an entity) > and wants to mark all

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-09 Thread Jay
That is a good link Ernesto. nischalshetty - I think the best answer is probably an "it depends" kind of thing. What do you want to do with unread status? Of course the key here is that unread is a per user deal. You might be able to keep some kind of bit-map or other compressed data structure to

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-09 Thread nischalshetty
@Ernesto Thanks for the link, that's a good starting point. @Jay Thanks for some more pointers. Simply put here's what I want to do (a twitter app): 1. Pull all the tweets of a user 2. The user can selectively read tweets (which would be marked as 'Read') 3. Unread tweets would be well 'Unread

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-10 Thread master outside
One option is to use a date time stamp when they mark all as read. If you allow people to mark items as unread then you in addition need have a way to detect that on old items. For example if you were to use '0' for unread and '1' for read you could use '2' to override the the all read after time.

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-10 Thread nischalshetty
You guys are all awesome. My friend and I are soon going to finalize a way and I'll post it here. Your feedback would be greatly appreciated. -N On Jan 10, 10:20 pm, master outside wrote: > One option is to use a date time stamp when they mark all as read. If > you allow people to mark items as

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-11 Thread David
You can save a date for the user on when the last mark all read date was set. Then consider anything before that date as read by that user. That way you only have to update a single entity. On Jan 9, 8:57 am, nischalshetty wrote: > Say a user selects 5000 unread messages (each message is an ent

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-11 Thread nischalshetty
@David That sounds good but it would probably fail if the user marks one of the messages in between as 'unread' :( -- 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-appeng...@googlegroups.com. To

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-11 Thread Julian Namaro
This one year old thread discusses the same problem I think: http://groups.google.com/group/google-appengine/browse_thread/thread/b35a0387dfdf918b/55563f57306defbc?lnk=gst&q=mark+as+read#55563f57306defbc A possible solution: class Message(db.Model): sender=db.StringProperty() body=db.TextProp

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-17 Thread sameer.mhatre
@Jay As you have mentioned in the post about "bit-map or other compressed data structure to hold read/unread info". Can you give an example for it or else any link which provides implementation for bit-map thing. -- You received this message because you are subscribed to the Google Groups "Goo

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-18 Thread Jay
@Sameer A bit-map for holding the "list" of read/unread is a pretty common and widely used pattern. http://en.wikipedia.org/wiki/Bit_array Also see data structure and algorithm books. You can think of the bitmap as a compact list of all read/unread assuming that the entries can be encoded with a k

[google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-18 Thread sameer.mhatre
@Jay Thanks for your reply. This is really helpful to me to solve my problem. I was quite aware of how the bit map works and all. But not able to co-relate my problem to this. Thanks again. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group.

Re: [google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-09 Thread Stephen Johnson
Here are some quick statistics I did using the idea that you have a entity which consists solely of a key and no other properties. I called this entity kind 'READ'. If a tweet has a matching key in this entity then the tweet has been read. If it doesn't exist then the tweet is unread. I did a batch

Re: [google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-09 Thread nischalshetty
@Stephen Wow! I'm grateful to you for taking time out to make things so clear. From what I see, you're suggesting to have a different key that when present indicates a tweet as 'Read'. You're right, there would be pagination so I'll be displaying say 50 tweets per page. Now, I would fetch 50 tw

Re: [google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-09 Thread Stephen Johnson
It sholdn't be cumbersome at all. Use the same key identifier for the tweets as for the Read entity, then do a batch get with those keys. Based on my numbers I'd say latency for 50 keys will be from 10ms to 20ms. You'll get back a Map (if using Java - not sure for Python). If they key is in the map

Re: [google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-09 Thread nischalshetty
My bad. I forgot to mention, there would be an option where I show just the 'unread' tweets to the user or just the 'read' tweets. When I show all tweets, your example would work perfectly fine. But what about the other two scenarios? Any pointers would help. I use GAE/J. -N -- You received t

Re: [google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-10 Thread Jeff Schwartz
I don't know if the requirement are the same but here's something I came up with that might be of use to you as well. If I need to mark a group of entities as having some common trait (the trait could be read or unread in your case) in response to an action the user has taken upon a group of entie

Re: [google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-10 Thread Stephen Johnson
Ok. A trick I use is to use the key field to hold more than one piece of data so that I can get around some of the limitations of queries as well as get back info doing keys only queries and keeping down the number of the custom keys I have, so you could do something like the following: I suppose e

Re: [google-appengine] Re: How to implement 'Mark All Read' feature in appengine

2011-01-10 Thread Eli Jones
Nick Johnson's newsgroup e-mail explains pretty much what you need.. except he leaves out some details (don't know, maybe he was busy building out the Appengine subsystem at the time or something) explaining exactly how to set it up underneath. You should probably try something like this (which I