I have animations that fade in a Button (alpha from 0 to 1) and fade out a button (alpha from 1 to 0). This part is all working fine. Button A triggers the fade in of Button B. Button B triggers the fade out of itself.
Button B totally covers up Button A. The idea is that Button B contains an image that is used like an information popup. Button A is touched and Button B fades in on top. When Button B is touched it fades itself out again.
Initially, Button B's visibility is set INVISIBLE and when the fade in animation is complete, it is set to VISIBLE. When Button B is clicked it fades out and then I set the visibility to INVISIBLE.
The problem is that after Button B has faded out, and it is set INVISIBLE, it is still clickable and even though it is not visible, and touches are not received by Button A.
I have tried removing Button B from the parent and re-adding it after the animation is completed, and this allows for touches to reach Button A, but only once. After that button B is not longer touchable.
What does the following code example do and why does it require a transaction?
// PersistenceManager pm = ...;
Transaction tx = pm.currentTransaction();
User user = userService.currentUser();
List<Account> accounts = new ArrayList<Account>();
try {
tx.begin();
Query query = pm.newQuery("select from Customer " +
"where user == userParam " +
"parameters User userParam");
List<Customer> customers = (List<Customer>)
query.execute(user);
query = pm.newQuery("select from Account " +
"where parent-pk == keyParam " +
"parameters Key keyParam");
for (Customer customer : customers) {
accounts.addAll((List<Account>)
query.execute(customer.key));
}
} finally {
if (tx.isActive()) {
tx.rollback();
}
}
Greetings!
I am trying to work with a single column in the datatstore, I can view and display the contents, like this -
q = test.all()
q.filter("adjclose =", "adjclose")
q = db.GqlQuery("SELECT * FROM test")
results = q.fetch(5)
for p in results:
p1 = p.adjclose
print "The value is --> %f" % (p.adjclose)
however i need to calculate the historical values with the adjclose column, and I am not able to get over the errors
for c in range(len(p1)-1):
TypeError: object of type 'float' has no len()
here is my code!
for c in range(len(p1)-1):
p1.append(p1[c+1]-p1[c]/p1[c])
p2 = (p1[c+1]-p1[c]/p1[c])
print "the p1 value<-- %f" % (p2)
print "dfd %f" %(p1)
new to python, any help will be greatly appreciated!
thanks in advance
Ray
HERE IS THE COMPLETE CODE
class CalHandler(webapp.RequestHandler):
def get(self):
que = db.GqlQuery("SELECT * from test")
user_list = que.fetch(limit=100)
doRender(
self,
'memberscreen2.htm',
{'user_list': user_list} )
q = test.all()
q.filter("adjclose =", "adjclose")
q = db.GqlQuery("SELECT * FROM test")
results = q.fetch(5)
for p in results:
p1 = p.adjclose
print "The value is --> %f" % (p.adjclose)
for c in range(len(p1)-1):
p1.append(p1[c+1]-p1[c]/p1[c])
print "the p1 value<--> %f" % (p2)
print "dfd %f" %(p1)
Hello, i have one doubt. I have an iteration of TextViews, and what i want is when i click in one TextView , i want stop the iteration and open a web, who can i know what TextView as been click on? i have this code:
Iterator<TextView> it = text.iterator();
while(it.hasNext()){
test = it.next();
test.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//mWebView = (WebView) findViewById(R.id.webview);
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(url);
}
});
// condition to stop the iteration when i click on TextView
}
And what i want is the condition to stop the iteration when i click on the TextView that i want see, i try using some methods that are in the TextView and don't work. Anyone can help me? I have the iteration of TextViews because i want to do this dynamic, and i don't know the TextView who as click, and i want to know what TextView was click to stop the iteration, because if i don't stop this, for example if i have 3 TextView they will open the same web.
Thanks and forgive my English
Hello!
I want to save text from 2 edittexts(et1,et2) and selection from 3 spinners(spinnerm,spinner and spinner2) onPause and setting them back onResume.
Text from edittexts is saved correctly, only spinner selection don't work as desired.
My code:
public void onResume(){
super.onResume();
Log.d("REZUM","notr smo");
SharedPreferences seti = getSharedPreferences( "pavzica", MODE_PRIVATE);
spinnerm.setSelection(seti.getInt("m", 0));
spinner.setSelection(seti.getInt("k", 0));
spinner2.setSelection(seti.getInt("p", 0));
et1.setText(seti.getString("zade", ""));
et2.setText(seti.getString("Vseb", ""));
}
public void onPause() {
shraniPolja();
super.onPause();
}
public void shraniPolja() {
SharedPreferences seti = getSharedPreferences( "pavzica", MODE_PRIVATE);
SharedPreferences.Editor edito = seti.edit();
edito.putString("zade", et1.getText().toString());
edito.putString("Vseb", et2.getText().toString());
edito.putInt("m", spinnerm.getSelectedItemPosition());
edito.putInt("k", spinner.getSelectedItemPosition());
edito.putInt("p", spinner2.getSelectedItemPosition());
edito.putBoolean("b", true);
edito.commit();
}
What am i doing wrong?
Hi,
I'm getting an error on the production env but not on the local one.
Is there a way to see the exception that is probably being thrown from production?
In tomcat - the user will be able the see the exception as the servlet returns its output
final Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("image/jpeg");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "this is the test");
emailIntent.putExtra(Intent.EXTRA_TEXT, "testing time");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
I am modifying the source code here: http://thinkandroid.wordpress.com/2009/12/30/getting-response-body-of-httpresponse/
I get this error: non-static method getContentCharSet(org.apache.http.HttpEntity) cannot be referenced from a static context
String charset = getContentCharSet(entity);
This error is line 13 on the second box.
Any ideas? I have been really struggling with this code :-(
I wish to send a request like
<v:Envelope xmlns:i="xxx">
<v:Header />
<v:Body>
<sendTwoWaySmsMessage xmlns="xxx" id="o0" c:root="1">
<connectionId i:type="d:string">connectionId</connectionId>
<twoWaySmsMessage>
<message i:type="d:string">love it. It seems to work</message>
<mobiles i:type="d:string">345</mobiles>
<messageId i:type="d:string">123</messageId>
</twoWaySmsMessage>
</sendTwoWaySmsMessage>
</v:Body>
</v:Envelope>
what i get is
<v:Envelope xmlns:i="xxx">
<v:Header />
<v:Body>
<sendTwoWaySmsMessage xmlns="xxx" id="o0" c:root="1">
<twoWaySmsMessage>
<message i:type="d:string">love it. It seems to work</message>
<mobiles i:type="d:string">345</mobiles>
<messageId i:type="d:string">123</messageId>
</twoWaySmsMessage>
<connectionId i:type="d:string">connectionId</connectionId>
</sendTwoWaySmsMessage>
</v:Body>
</v:Envelope>
code is
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, url);
SoapObject message = new SoapObject("", "twoWaySmsMessage");
request.addProperty("connectionId", did);
message.addProperty("message", "love it. It seems to work");
message.addProperty("mobiles", "435");
message.addProperty("messageId", "123");
request.addSoapObject(message);
request.setProperty(0, "connectionId");
when i use SoapUI with the second with the "connectionId" swaped it seem to work can anyone help. of have ideas.
I have looked at just about every ksoap question out there and cant seem to find an answer?
Hi
Were now testing our application with a few friends. Sometimes there are some errors which dont throw an exception. So I don't really know whats the problem was. So i thought it would be a good idea to implement a menu item which allows to send the logcat file to a email adress, so that we can examine the logcat.
Unfortunately I didnt found a hint in the Internet how to extract the Logcat from a phone. How to send a email shouldn't be the problem.
I need a simple tagging system in GAE-J.
As I see it, the entity that is being tagged should have a collection of keys referring to the tags with which it's associated.
A tag entity should simply contain the tag string itself, and a collection of keys pointing to the entities associated with the tag.
When an entity's list of tags is altered, the system will create a new tag if the tag is unknown, and then append the entity's key to that tag's key collection. If the tag already exists, then the entity's key is simply appended to the tag's key collection.
This seems relatively straight-forward and uncontroversial to me, but I would like some feedback on this design, just to be sure.
Is there an event for situations where something is selected on an HTML page like arbitrary text within a span element? Does such a thing exist or does one need to poll at regular interval & analyze the window.getSelection() ?
I would like to trap this event type from within a browser extension (Chrome).
I need to write an app which can observe and manipulate the positions of windows on screen, and I've been told that this requires using Cocoa's Accessibility API.
Unfortunately I'm a Java programmer, and Objective C scares me ;) Is it possible to access this Cocoa API from within Java? I know that back when Apple cared about Java it maintained a "bridge" to cocoa, but I'm not sure if this does what I need.
Oh, and my IDE is Eclipse, in case that is relevant.
I have Karmic Koala which has Python 2.6 installed by default.
However I can't run any Python App Engine projects because they require Python 2.5 and python ssl.
To install ssl I installed python2.5-dev first while following some instructions I found elsewhere.
sudo apt-get install libssl-dev
sudo apt-get install python-setuptools
sudo apt-get install python2.5-dev
sudo easy_install-2.5 pyopenssl
However, I am afraid this is not good for my Ubuntu installation since Ubuntu expects to see version 2.6 of Python when you type 'python' on the command line. Instead, it says '2.5.5'.
I tried to revert to the original default version of Python by doing this:
sudo apt-get remove python2.5-dev
But that didn't seem to do anything either - when I type 'python' on the command line it still say 2.5.5.
And App Engine still doesn't work after all this. I continue to get an SSL-related error whenever I try to run my Python app:
AttributeError: 'module' object has no attribute 'HTTPSHandler'
UPDATE: Just checked whether SSL actually installed as a result of those commands by typing this:
$ python2.5
Python 2.5.5 (r255:77872, Apr 29 2010, 23:59:20)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named ssl
>>>
As you can see, SSL is still not installed, which explains the continuing App Engine error.
If anyone knows how I can dig myself out of this hole, I would appreciate it.
I would like to make a LinearLayout that was created from xml invisible, and another LinearLayout visible to replace it. The replacement layout starts out as invisible. When I make the originally visible layout invisible, it still leaves space for it on the screen. How can I refresh the screen so that space is gone?
Sometimes I have a button in my UI that it is so small that it is difficult to click. My solution so far has been to add a transparent border around the button in photoshop. Just increasing the padding on the button does not work, since this will also stretch the image. Since it is kind of a fuss to open photoshop each time I want to change the clickable surface, is there any way to do this programmatically? I have tried placing a framelayout behind the button and make it clickable, but then the button wont change appearance on touch as it should. Ofcourse I could also add a ontouchlistener on the framelayout which changes the buttons appearance, but then it quite some code if I have several of those buttons.
Cheers,
I have copied the simple Django forms example exactly, running on localhost. The basic contact form example should submit a POST request when you click the Submit button.
I'm running Chrome on Mac Snow Leopard, and whenever I submit the form, the page simply reloads with an empty form: I can see from the runserver output that it's not sending a POST - instead it's sending a GET request.
If I open the same page in Firefox on Mac Snow Leopard, and submit the form, I can see it's sending a POST request (as it should be).
Looking at the source in Chrome, the form definitely says method="post".
<form action="/contact/" method="post">
<p><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" /></p>
<p><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" /></p>
<p><label for="id_sender">Sender:</label> <input type="text" name="sender" id="id_sender" /></p>
<p><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself" /></p>
<input type="submit" value="Submit" />
</form>
External sites with POST forms seem to work OK in Chrome.
In addition, if I fill the form in incorrectly, in Chrome the page just reloads, with a GET request, as before; in Firefox the form gets validated, as it should.
I've tried with other POST forms on localhost and got the same result.
I know Chrome for Mac has its quirks, but what on earth is going on?
Hi,
Can someone tell if why when starting an activity with startActivity(intent) , calling getParent() in onCreate() of the new created activity returns a nul ?
Also how could I obtain the parent of an activity created in such a way ? Can a reference of the activity below the current activity in the activity stack be obtained ?
I have developped an application that has a list of items in one frame; when one clicks on an item it does something in another frame (loads an image).
This used to work fine in all browsers, including Chrome 3; now it still works fine in FF but in recent versions of Chrome (I believe since 4) it throws this error:
Unsafe JavaScript attempt to access frame with URL (...) from frame with URL (...).
Domains, protocols and ports must match.
This is obviously a security "feature" but is it possible to get around it?
Here is a simple test:
index.html:
<html>
<frameset>
<frame src="left.html" name="left"/>
<frame src="right.html" name="right"/>
</frameset>
</html>
left.html:
<html>
<body>
<a href="javascript:parent.right.test('hello');">click me</a>
</body>
</html>
right.html:
<html>
<body>
<script>
function test(msg) {
alert(msg);
}
</script>
</body>
</html>
The above works in FF 3.6 and Chrome 3 but in Chrome 5 it throws the above error...
I am trying to rotate my camera using a Quaternion in libGDX. I have a Quaternion created and being manipulated but I have no idea how to apply it to the camera, everything I've tried hasn't moved the camera at all.
Here is how I set up the rotation Quaternion:
public void rotateX(float amount) {
tempQuat.set(tempVector.set(1.0f, 0.0f, 0.0f), amount * MathHelper.PIOVER180);
rotation = rotation.mul(tempQuat);
}
public void rotateY(float amount) {
tempQuat.set(tempVector.set(0.0f, 1.0f, 0.0f), amount * MathHelper.PIOVER180);
rotation = tempQuat.mul(rotation);
}
Here is how I am trying to update the camera (Same update method as the original libGDX version but I added the part about the rotation matrix to the top):
public void update(boolean updateFrustum) {
float[] matrix = new float[16];
rotation.toMatrix(matrix);
Matrix4 m = new Matrix4();
m.set(matrix);
camera.view.mul(m);
//camera.direction.mul(m).nor();
//camera.up.mul(m).nor();
float aspect = camera.viewportWidth / camera.viewportHeight;
camera.projection.setToProjection(Math.abs(camera.near), Math.abs(camera.far), camera.fieldOfView, aspect);
camera.view.setToLookAt(camera.position, tempVector.set(camera.position).add(camera.direction), camera.up);
camera.combined.set(camera.projection);
Matrix4.mul(camera.combined.val, camera.view.val);
if (updateFrustum) {
camera.invProjectionView.set(camera.combined);
Matrix4.inv(camera.invProjectionView.val);
camera.frustum.update(camera.invProjectionView);
}
}
This logic is written in a function with signature
private void showDialog(final AdapterView<? extends Adapter> parent,
String title, String message, final Tag subject)
Is there a better way of doing this?
// refresh adapter
SimpleCursorAdapter adapter;
if (parent.getAdapter() instanceof WrapperListAdapter) {
adapter = (SimpleCursorAdapter) ((WrapperListAdapter) parent.getAdapter()).getWrappedAdapter();
} else {
adapter = (SimpleCursorAdapter) parent.getAdapter();
}
adapter.getCursor().requery();
adapter.notifyDataSetChanged();
Also, is there any point in having AdapterView<? extends Adapter> in the signature and not just AdapterView<?>?
Can anyone tell me how I can Dynamically add groups & children to an ExpandableListView. The purpose is to create a type of task list that I can add new items/groups to.
I can populate the view with pre-filled arrays but of course can't add to them to populate the list further. The other method i tried was using the SimpleExpandableListAdapter. Using this i am able to add groups from a List but when it comes to adding children i can only add 1 item per group.
public List<Map<String, String>> groupData = new ArrayList<Map<String, String>>();
public List<List<Map<String, String>>> childData = new ArrayList<List<Map<String, String>>>();
public void addGroup(String group) {
Map curGroupMap = new HashMap();
groupData.add(curGroupMap);
curGroupMap.put(NAME, group);
//Add an empty child or else the app will crash when group is expanded.
List<Map<String, String>> children = new ArrayList<Map<String, String>>();
Map<String, String> curChildMap = new HashMap<String, String>();
children.add(curChildMap);
curChildMap.put(NAME, "EMPTY");
childData.add(children);
updateAdapter();
}
public void addChild(String child) {
List children = new ArrayList();
Map curChildMap = new HashMap();
children.add(curChildMap);
curChildMap.put(NAME, child);
curChildMap.put(IS_EVEN, "This child is even");
childData.add(activeGroup, children);
updateAdapter();
}