[appengine-java] Re: Uploading Data on Development Server(On local machine)

2010-08-07 Thread amit
I am also facing the same issue, does anyone know how to upload data
to local datastore.

On Aug 1, 9:44 am, MANISH DHIMAN  wrote:
> I have already tried this, It needs a app.yaml file, but it is a java
> application.
> I created a yaml file but it gives an error of authentication fail?
>
> On Jul 31, 6:18 pm, Peter Ondruska  wrote:
>
> >http://code.google.com/appengine/docs/python/tools/uploadingdata.html
>
> > LoadingDataInto the Development Server
> > If you'd like to test how yourdataworks with the app before
> > uploading it, you can load it into the development server. Use the --
> > url option to point the tool at the development server URL. For
> > example:
> > appcfg.py upload_data --config_file=album_loader.py --
> > filename=album_data.csv --kind=Album --url=http://localhost:8080/
> > remote_api 
>
> > On Jul 31, 12:28 pm, MANISH DHIMAN  wrote:
>
> > > Hi Friends,
> > > I want touploaddataon mylocalmachine in development mode. May any
> > > one provide me information about how to achieve it.
>
>

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



[appengine-java] Re: Java Engine Support for PNG writing

2010-08-07 Thread dovm
Hi,

Give a try to TinyLine.

I think it does what you need. See demos here

http://tinylinegae.appspot.com/

Thanks,
Dov




On Aug 5, 11:39 pm, Skippy Ta  wrote:
> Sorry, I should have specified. The current non-GAE version of my app
> implements several AWT classes such as Dimension, Color, Point, etc.
> I'm trying to get the app engine to draw colored paths using collections of
> points.
> Our current representation interprets ""stroke" tokens which contain
> java.awt.Dimension, Color, etc. properties as mentioned before and are fed
> to the batik library PNGTranscoder which produces an output byte stream.
> However, we can't encode the data to the stroke tokens in the first place
> without the AWT libraries. Are there any libraries that work around it?
>
> On Tue, Aug 3, 2010 at 10:37 AM, Don Schwarz  wrote:
> > You just need to render text?
>
> > Try:  http://code.google.com/p/litetext/wiki/AppEngine
>
> > On Mon, Aug 2, 2010 at 1:04 PM, Skippy Ta  wrote:
>
> >> Currently, my app needs to dynamically write data out to a PNG file,
> >> but the JRE white list doesn't support several of the awt classes
> >> necessary for this (let alone FileOutputStreams). I found that there
> >> was a solution for Python here:
>
> >>http://stackoverflow.com/questions/2431345/text-to-a-png-on-app-engin...
>
> >> ...and was wondering if there were any libraries for Java that could
> >> produce something to a similar effect. That I'm aware of, I can't
> >> think of anything that would do this on the white list.
>
> >> I've tried Google Charts API but the data I need to draw isn't really
> >> compatible with Google Charts' capabilities.
>
> >> Any pointers?
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Google App Engine for Java" group.
> >> To post to this group, send email to
> >> google-appengine-j...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-appengine-java+unsubscr...@googlegroups.com
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-appengine-java?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

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



[appengine-java] "built-in indices are not efficient enough for this query and your data"

2010-08-07 Thread Philip Tucker
I've just started getting the following error on my server. This query
had been working fine for months, and I haven't changed the indexes
lately. Are there some indexes that just buckle under heavy load or
larger data sets? This particular table contains only 242,604 entries.

  The built-in indices are not efficient enough for this query and
your data. Please add a composite index for this query..  An index is
missing but we are unable to tell you which one due to a bug in the
App Engine SDK.  If your query only contains equality filters you most
likely need a composite index on all the properties referenced in
those filters.
  (full stack dump included below)

My query source code:

Query query = pm.newQuery(GameDataV2.class);
Object[] params;
query.declareParameters(
"com.google.appengine.api.datastore.Key userKeyParam"
+ ", com.honkentuber.wordwise.GameState stateParam1"
+ ", com.honkentuber.wordwise.GameState stateParam2"
+ ", com.honkentuber.wordwise.GameState stateParam3");
params = new Object[4];
params[0] = userKey;
params[1] = GameState.PENDING;
params[2] = GameState.PLAYER_TURN;
params[3] = GameState.OPPONENT_TURN;
query.setFilter("(memberKeys == userKeyParam)"
+ " && ((state == stateParam1)"
+ " || (state == stateParam2)"
+ " || (state == stateParam3))");

List gamesData = (List)
query.executeWithArray(params);

I have the following 2 indexes defined:
  memberKeys ▲ , state ▲ , memberLastAccessMs ▲
  memberKeys ▲ , state ▲ , memberScores ▼

I'm not sure why I don't have an index with only memberKeys and state
- does datastore-indexes autoGenerate not generate a new index if it
already has a superset index?

I've changed the query to the following in my local development
environment:

Query query = pm.newQuery(GameDataV2.class);
query.setFilter("(memberKeys == :userKeyParam)
&& :statesParam.contains(state)");
List gamesData = (List) query.execute(
userKey,
Arrays.asList(
GameState.PENDING.name(),
GameState.PLAYER_TURN.name(),
GameState.OPPONENT_TURN.name()));

Some questions about this:

1) Running locally with autoGenerate="true", I'm not getting a new
GameDataV2 index on memberKeys and states. Does contains() not require
an index on that field? Is this just generating 2 separate queries
internally?
2) Is the contains() query more efficient than the nested ORs I had in
my original query? Or will I still get the "not efficient enough for
this query and your data" error?
3) Why do enumerated types not work with contains()? I had to
add .name() to each entry in the list to get this to work.
4) Why do declared parameters not work with collections? I tried
declaring statesParam as a both List and List, and I got
errors resolving the types.

com.google.appengine.api.datastore.DatastoreNeedIndexException: The
built-in indices are not efficient enough for this query and your
data. Please add a composite index for this query..  An index is
missing but we are unable to tell you which one due to a bug in the
App Engine SDK.  If your query only contains equality filters you most
likely need a composite index on all the properties referenced in
those filters.
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java:
40)
at
com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java:
67)
at
com.google.appengine.api.datastore.PreparedQueryImpl.runQuery(PreparedQueryImpl.java:
127)
at
com.google.appengine.api.datastore.PreparedQueryImpl.asIterator(PreparedQueryImpl.java:
87)
at com.google.appengine.api.datastore.PreparedMultiQuery
$DedupingMultiQueryIterator.getNextIterator(PreparedMultiQuery.java:
154)
at com.google.appengine.api.datastore.PreparedMultiQuery
$DedupingMultiQueryIterator.computeNext(PreparedMultiQuery.java:173)
at com.google.appengine.api.datastore.PreparedMultiQuery
$DedupingMultiQueryIterator.computeNext(PreparedMultiQuery.java:98)
at
com.google.appengine.api.datastore.AbstractIterator.tryToComputeNext(AbstractIterator.java:
52)
at
com.google.appengine.api.datastore.AbstractIterator.hasNext(AbstractIterator.java:
47)
at com.google.appengine.api.datastore.BasePreparedQuery
$UncompilablePreparedQuery$1.hasNext(BasePreparedQuery.java:78)
at
org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterator.hasNext(RuntimeExceptionWrappingIterator.java:
44)
at
org.datanucleus.store.appengine.query.LazyResult.resolveAll(LazyResult.java:
115)
at
org.datanucleus.store.appengine.query.LazyResult.size(LazyResult.java:
110)
at
org.datanucleus.store.appengine.query.StreamingQueryResult.size(StreamingQueryResult.java:
124)
at
org.datanucleus.store.query.AbstractQueryResult.toArray(AbstractQueryResult.java:
399)
at java.util.ArrayList.addAll(Unknown

[appengine-java] Re: Can Jade run on GAE?

2010-08-07 Thread Frederik Pfisterer
If no one ever tried it you can try check frameworks jade might depend
on and leave comments here:
http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine

In general jade would have to comply to the sandbox environment
described here:
http://code.google.com/intl/de-DE/appengine/docs/java/runtime.html

Most importantly:
1) no new threads may ever be spun off
2) no operation may take longer than 30 seconds

Hope this helps.

On 6 Aug., 08:05, Hank Chang  wrote:
> We will write an application to use Jade (http://jade.tilab.com/). Can
> Jade run on GAE?

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



Re: [appengine-java] i18n translations

2010-08-07 Thread Hariharan Anantharaman
I can help in publishing in Tamil.
தமிழ் - tamil

Thanks
Hari

2010/8/5 ale 

> Hi everybody,
>
> I'm finishing to develop a web application with GWT + GAE, and I want
> to publish in multiple languages.
>
> The application is about sport, and the message file is about 400
> lines mostly consist of one word.
>
> Is there anyone who can  translate it into his native language?
> In return he will receive my infinite gratitude, I will write his/her
> name in the thanks page of my  site with a link to what he wants.
> And of course I will be happy to return the favor by translating into
> Italian!
> Any language is OK, even English, (I'n not speak wery well, so will be
> full of errors!)
>
> I posted the same request yesterday on the GWT group and 3 person
> answer me for spanish, marathi, hindi and swedish.
>
> Thank you, thank you!
>
> Alessandro
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



Re: [appengine-java] Invalidating users session

2010-08-07 Thread Hariharan Anantharaman
When i tried using session.Invalidate method, during logout, the logout time
increased and the cpu consumption by logout was also high. I could not find
reason behind it.

Thanks
Hari

2010/8/6 Ice13ill 

> This is more of a java servlet/session question, but it's also
> referring AppEngine's user service:
> Is there a way of invalidating a certain user's session ?
> for example, an admin modifies a certain user's  permissions and
> because of that, i need to invalidate that user's session.
> Can i do this with standard java classes like HttpSession,
> ServletContext etc. Or if i use app engine's user service, can i
> invalidate in the admin's call another's user google session (to force
> him to login to google again?)
>
> PS. regardin ah_SESSION objects, are they cleaned by the app engine's
> mechanism? (when i call session.invalidate()) or do i have ti build my
> own logic to clean them?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>

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



[appengine-java] sharded counter report

2010-08-07 Thread aswath satrasala
Hello,
I am basing my entities design based on the sharded counter example for my
accounting webapp.

Extending the sharded counter case further...
Lets say I have a website of 500 pages.  I want to track the number of hits
of each page and then I want a report like this:
Page1  - Nohits
Page2 -  Nohits
Page3 -  Nohits

Page 500 - Nohits.

Per the sharded counter example, lets say there are 10 shards for each page
counter.  So, there will be 5000 rows in all for 500 pages/counters.
To get a report like above:
* query the Counter class sorted by counter name - max 1000 entities are
returned
* calculate the nohits for the page based on the countername from the
results.
* Use the cursor, then query for further rows until all the rows are read.
* After each query, traverse the results and do the calculation for the
nohits for the pages
* The query will be issued for atleast 5 times and then it is done.

Questions:
* Do you see a 30 second timeout limit of the appengine while performing the
above.
* what if I increase the number of shards from 10 to 100 for each counter.
The number of rows will be (500 * 100 = 5). This means, 50 queries to be
issued.
* Any other better ways to get the above report
* Any datamodel changes can be applied without sacrificing on the throughput
of the appengine transactions.

-Aswath

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



[appengine-java] Re: Dates and TimeZones

2010-08-07 Thread Ian Marshall
The UTC time is the same everywhere at the same time.

The trick is to format the date-time for a time zone.

I use the following:

  GregorianCalendar gcUK = new GregorianCalendar(Locale.UK);
  TimeZone tzUK = TimeZone.getTimeZone("Europe/London");
  gcUK.setTimeZone(tzUK);
  gcUK.setTime(new Date());

  DateFormat dfUK =
SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.MEDIUM,
   SimpleDateFormat.MEDIUM, Locale.UK);
  dfUK.setCalendar(gcUK);
  String sDate = dfUK.format(dtDateTime);

Choose your own locale and time zone. Enjoy?


On Aug 6, 5:38 pm, Stephen  wrote:
> If I run :
>
> Date now = new Date();
> System.out.println(now);
>
> from the main method of a plain java class I get :
> Fri Aug 06 11:33:00 CDT 2010 as expected.
>
> If I run that same code in a JSP app engine gives me :
> Fri Aug 06 11:33:00 UTC 2010
>
> Run that same JSP on tomcat and again I get :
> Fri Aug 06 11:33:00 CDT 2010 as expected.
>
> Even if I try to set the timezone manually I still get UTC from a JSP
> hosted by app engine.
> Any ideas what is going on here?
>
> Thanks in advance.

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