Hi,
while trying to use the "InfoStrat"-Bing-Maps-Control in Expression Blend 4 for my Surface Application, I get the error message:
"Mixed mode assembly is built against version v2.0.50527 of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information"
I already found out that I need to write this configfile:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
But Expression Blend doesn't seem to recognize that it is there. So how can I solve this problem?
When a user sends a filled form, I want to print an error message in case there is an input error. One of the GAE sample codes does this by embedding the error message in the URI.
Inside the form handler (get):
self.redirect('/compose?error_message=%s' % message)
and in the handler (get) of redirected URI, gets the message from request:
values = {
'error_message': self.request.get('error_message'),
...
Is there a way to accomplish the same without embedding the message in the URI?
I have a field device which keeps on sending data over to any designated port using sockets. I am planning to use GAE for server-side infrastructure.
I read GAE does not support sockets. But i can configure the device to send the data over port 80. so we wrote a genericservlet to capture this data on GAE. But it is not obtaining any values from the client.
any suggestions to fix this issue?
In my AppEngine project I have a need to use a certain filter as a base then apply various different extra filters to the end, retrieving the different result sets separately. e.g.:
base_query = MyModel.all().filter('mainfilter', 123)
Then I need to use the results of various sub queries separately:
subquery1 = basequery.filter('subfilter1', 'xyz')
#Do something with subquery1 results here
subquery2 = basequery.filter('subfilter2', 'abc')
#Do something with subquery2 results here
Unfortunately 'filter()' affects the state of the basequery Query instance, rather than just returning a modified version. Is there any way to duplicate the Query object and use it as a base? Is there perhaps a standard Python way of duping an object that could be used?
The extra filters are actually applied by the results of different forms dynamically within a wizard, and they use the 'running total' of the query in their branch to assess whether to ask further questions.
Obviously I could pass around a rudimentary stack of filter criteria, but I'd rather use the Query itself if possible, as it adds simplicity and elegance to the solution.
I'm using GwtUpload to upload images on GAE. The problem is that the images seem to get much bigger when I move them into a blob. I've noticed the same for simple text fields and in that case I've realised that some weirdo characters are being appended to the end of the field values (encoding right?). Can anyone help?
public class ImageUploadServlet extends AppEngineUploadAction {
/**
* Maintain a list with received files and their content types
*/
Hashtable<String, File> receivedFiles = new Hashtable<String, File>();
Hashtable<String, String> receivedContentTypes = new Hashtable<String, String>();
private Objectify objfy;
public ImageUploadServlet() {
ObjectifyService.register(Thumbnail.class);
objfy = ObjectifyService.begin();
System.out.println("ImageUploadServlet init");
}
/**
* Override executeAction to save the received files in a custom place and
* delete this items from session.
*/
@Override
public String executeAction(HttpServletRequest request,
List<FileItem> sessionFiles) throws UploadActionException {
Thumbnail t = new Thumbnail();
for (FileItem item : sessionFiles) {
//CacheableFileItem item = (CacheableFileItem)fItem;
if (false == item.isFormField()) {
System.out.println("the name 1st:" + item.getFieldName());
try {
// You can also specify the temporary folder
InputStream imgStream = item.getInputStream();
Blob imageBlob = new Blob(IOUtils.toByteArray(imgStream));
t.setMainImage(imageBlob);
System.out.println("blob: " + t.getMainImage());
} catch (Exception e) {
throw new UploadActionException(e.getMessage());
}
} else {
System.out.println("the name 2nd:" + item.getFieldName());
String name = item.getFieldName();
String value;
try {
InputStream is = item.getInputStream();
StringWriter writer = new StringWriter();
IOUtils.copy(is, writer,"UTF-8");
value = writer.toString();
writer.close();
System.out.println("parm name: " + name);
System.out.println("parm value: " + value + " **" + value.length());
System.out.println(item.getContentType());
if (name.equals("thumb-name")) {
t.setName(value);
}
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("Error");
e.printStackTrace();
}
}
removeSessionFileItems(request);
}
objfy.put(t);
return null;
}
As an example the size of the image is 20kb, and the lib has some debugging that confirms that this is the case when it's uploading the file but the blob ends up being over 1 MB.
Wes
Hi,
Consider the scenario of a typical webapp with JSFs on the front and ejb3, with Hibernate as JPA provider, talking to backend database such as mysql, etc. The main user actions are login and mostly CRUD operations (minus any D(elete) operations). And the App Server is GlassFish of course.
Given this scenario, how and where all would one go about providing caching to improve performance? From what I have googled, I have seen that hibernate provides some sort of caching through different cache providers. Is there any sort of caching that can be provided for the jsf pages? How about session beans or entity beans on the ejb side of things?
Also, I just read about memcached and was wondering if this was something to consider?
GAE webapp allows to map single handler to a route:
application = webapp.WSGIApplication([
('/login', gae_handlers.UserLogin),
], debug=True)
Is there any way I can have a chain of request handlers?
I want to have handler which does authentication before all other handlers run.
I have a module called nbemail.py and in this module I want to use the function package_post defined in the module main.py. I am using this statement:
from api.main import package_post
But I am getting this error:
ImportError: cannot import name package_post
I really don't know why I am getting this error! I do have _init_.py files in the api directory (which contains the files nbemail.py and main.py) and I do have the function package_post defined in main.py.
Any idea to help fixing this problem?
In my app.config file I made the setting like the following
<add key = "Delimeter" value ="\t"/>
Now while accessing the above from the program by using the below code
string delimeter = ConfigurationManager.AppSettings["FileDelimeter"].ToString();
StreamWriter streamWriter = null;
streamWriter = new StreamWriter(fs);
streamWriter.BaseStream.Seek(0, SeekOrigin.End);
Enumerable
.Range(0, outData.Length)
.ToList().ForEach(i => streamWriter.Write(outData[i].ToString() + delimiter));
streamWriter.WriteLine();
streamWriter.Flush();
I am getting the output as
18804\t20100326\t5.59975381254617\t
18804\t20100326\t1.82599797249479\t
But if I directly use "\t" in the delimeter variable I am getting the correct output
18804 20100326 5.59975381254617
18804 20100326 1.82599797249479
I found that while I am specifying the "\t" in the config file, and while reading it into
the delimeter variable, it is becoming "\\t" which is the problem.
I even tried with but with no luck.
I am using C#3.0.
Need help
I started an app that was initially a testing platform--user management, and managers that can view their employees tests.
Recently, functionality has been extended (not built yet) to allow users to complete a test in place of an employee--basically adding a record, but no user.
I have three tables in use for this: users(contains user info for login/security), profiles (all personal info: address, height, etc.), and survey (contains survey answers for user).
How do I extend my application to encompass this functionality with minimal change to the structure?
I assume that the best way to do this would be to insert records to the tables profiles and survey, and have no username/password/email? There MUST be a user_id associated b/c the tables are linked through the user_ids...
Anyone have or know of a java implementation of an openid relying party(consumer) for gwt/gae?
openid4java and joid bring in too much baggage for my needs.
Hello.
I need some clarification. I know that in order to run a java EE project, one needs a java EE compliant application server, such as tomcat, jboss, glashfish, etc. But, i download these to my desktop, but how about when i run it online? Are Jboss, tomcat, glashfish, etc. application servers just for your desktop, or are these the app server internet service providers have as well. I am trying to use godaddy as my internet service provider; i called them, but the customer service guy didnt know what application server they had, or did i ask the wrong question? Or how can i know waht application server they have? Thank you, any help is greatly appreciated.
Hi everyone,
I have changed the Configure::write('Security.salt', '############'); value in the file
config/core.php
file to a '256-bit hex key'. Is it safe or a good practice to change these lines for every different installation of cakephp application or shall I revert back to the original ?
I also changed the Configure::write('Security.cipherSeed','7927237598237592759727'); to a different one of more length.
Please throw some light on this.
Thanks
Hi,
In this example IS the exception being thrown if ANY of the Table elements are being changed by another client OR only if the element that we changed has been changed by another client?
Just to verify - the exception is thrown from the commit() isn't it?
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
pm.currentTransaction().begin();
List<Row> Table = (List<Row>) pm.newQuery(query).execute();
Table.get(0).setReserved(true); // <----- we change only this element
pm.currentTransaction().commit();
} catch (JDOCanRetryException ex) {
pm.currentTransaction().rollback() // <----- if Table.get(1) was changed by another client do we get to this point???
}
Hello Guys,
I am completely fresh to both JDO and GAE, and have been struggling to get my data layer to persist any code at all!
The issues I am facing may be very simple, but I just cant seem to find any a way no matter what solution I try.
Firstly the problem: (Slightly simplified, but still contains all the info necessary)
My data model is as such:
User:
(primary key)
String emailID
String firstName
Car:
(primary key)
User user
(primary key)
String registration
String model
This was the initial datamodel. I implemented a CarPK object to get a composite primary key of the User and the registration. However that ran into a variety of issues. (Which i will save for another time/question)
I then changed the design as such:
User: (Unchanged)
Car:
(primary key)
String fauxPK (here fauxPK = user.getEmailID() + SEP + registration)
User user
String registration
String model
This works fine for the user, and it can insert and retrieve user objects. However when i try to insert a Car Object, i get the following error:
"Cannot have a java.lang.String primary key and be a child object"
Found the following helpful link about it:
http://stackoverflow.com/questions/2063467/persist-list-of-objects
Went to the link suggested there, that explains how to create Keys, however they keep talking about "Entity Groups" and "Entity Group Parents". But I cant seem to find any articles or sites that explain what are "Entity Group"s or an "Entity Group Parents"
I could try fiddling around some more to figure out if i can store an object somehow, But I am running sort on patience and also would rather understand and implement than vice versa.
So i would appreciate any docs (even if its huge) that covers all these points, and preferably has some examples that go beyond the very basic data modeling.
And thanks for reading such a long post :)
Thanks for the help.
Currently I import in gae:
from google.appengine.ext.webapp import template
then use this to render:
self.response.out.write(template.render('tPage1.htm', templateInfo ))
I believe the template that Google supplied for Django templete is version 0.96.
How do I setup and import the newer version of only the Django template version 1.2.1?
Brian
I've changed my model from
class Place
include DataMapper::Resource
has n, :trails
property :id, Serial
property :name, String, :length => 140
property :tag, String, :required => true
timestamps :at
end
to
class Place
include DataMapper::Resource
has n, :trails
property :id, Serial
property :name, String, :length => 140
property :tag, String, :required => true
property :trail_count, Integer, :default => 0
timestamps :at
end
I just added "property :trail_count, Integer, :default = 0"
and i want to migrate the existing appengine table to have the extra field "trail_count"
i've read that DataMapper.auto_upgrade! should do it.
but i get an error "undefined method `auto_upgrade!' for DataMapper:Module"
can you please help How do i migrate the DM models?
JID jid = new JID("[email protected]"); //success with code
SUCCESS
JID jid = new JID("mycomponent.host.domain.com"); //send fail with
code INVALID_ID ,but when i try send from gmail OR jabber to
mycomponent.host.domain.com . it was a success.
Is this a but in google xmpp api?
I am impressed with django.Am am currenty a java developer.I want to make some cool websites for myself but i want to host it in some third pary environmet.
Now the question is can i host the django application on appengine?If yes , how??
Are there any site built using django which are already hosted on appengine?
Hi! I have a smart client application being deployed with a CickOnce webpage.
here's the current scenario.
User runs the application, and the application shows a login form.
User enters ID/Password in the login form, and the application sends that information to the server.
The server authenticates the user and sends configuration and data to the application.
Different users have different configuration and data for their application.
I was concerned that anyone can download the application from the webpage if they know the URL.
So I'm trying to change the authentication scheme,
so that users can login at the webpage to download the application.
I want to send the authentication info from the webpage(Program running at the server) to the smart client app,
so that application can download the configuration information from the server,
without prompting users to make a login again.
How can the webpage send the ID/Passoword to the application securely?
It is known that google has best searching & indexing algorithm.
The also have good relevancy.
They are also quicker in getting down the latest results.
All that's fine.
What programming language (c, c++, java, etc...) & database (oracle, MySQL, etc...) they have used in achieving this. Since they have to manipulate with volume of data quickly and effectively.
Though I'm not looking for their indepth architecture (if in case violates their company policies) an overview of all such things could be useful.
Anybody please add you valuable suggestions and insight on this?
If I have a pair of floats, is it any more efficient (computationally or storage-wise) to store them as a GeoPtProperty than it would be pickle the tuple and store it as a BlobProperty?
If GeoPt is doing something more clever to keep multiple values in a single property, can it be leveraged for arbitrary data? Can I store the tuple ("Johnny", 5) in a single entity property in a similarly efficient manner?
I'm writing code that will allow my iphone-app to have a "configuration page".
A grouped, scrolling, UITableView... with cells that contain the needed textFields, switches, sliders, etc.
It is an ENOURMOUS amount of code. Is there an easier way?
Is there a way I could create a simple text-file, contain all my desired design choices and have my (reusable) code build the TableView for me?
Or... can I just do the whole thing quicker/easier in Interface Builder instead of code?
Hi everybody, I need to set up a simple event listener to refresh a listview from once in a while. The problem is I don't know how could I generate an event.
I know that for events like key or button pressing I just need to implement the handler. But in this specific case I actually need to generate the event, which will be fired everytime another running thread of my app wakes up and refreshes it's list of news from a rss feed.
I've done everything, but got stucked in here. Can I get any suggestion or link with some more info on how to implement this?
Thanks
Nelson R. Perez