Monday, 2 September 2013

Retrieving GAE data via Key

Retrieving GAE data via Key

I'm new to python & google app engine so this is going to be a basic
question but I cannot find an answer elsewhere ...
I'm trying to retrieve a record by passing the key (as generated by GAE)
from an HTML page back to python.
My html call is
<a
href="/playerprofile?uid=ahRkZXZ-Y293YnJpZGdlYm9va2luZ3IWCxIGTWVtYmVyIgpKb2huIEpvbmVzDA">John
Jones</a>
I'm then trying to pull it out of the table like this
uid = self.request.get('uid')
m = Member.all().filter('Key = ',uid)
It doesn't retrieve anything. How do I do it?

Stop a jQueryUI effect

Stop a jQueryUI effect

I'm developing a kind of chat similar the Facebook one. I used the jQuery
UI highlight effect when a new message arrives. Now I want to stop this
effect when the user click on the windows.
This is my code on window click event. The "janela" class is the chat's
windows.
$('.janela').live('click', function(){
var id = $(this).children('.topo').attr('id');
$.post('sys/chat.php',{acao: 'mudar_status', user: id});
$(".topo").effect("none"); //it's just a frustrated try.
});
Thanks.

Link records in two tables without extra SubmitChanges

Link records in two tables without extra SubmitChanges

Given two tables, where one is bound to another:
Items
SubItems
The Items table has an ID field with Identity Seed.
Here's the problem: to add SubItems to an Item, it's necessary to first
save the Item, so the ID is generated. An extra call to
DataContext.SubmitChanges is required before SubItems can be added and
submitted.
Is there any way to set up the identity to allow just a single
SubmitChanges call to save both the Item and SubItems at once?
One solution could be getting the IdentitySeed manually - but here is an
issue with multithreading.

Collision detection - stop two cubes intersecting

Collision detection - stop two cubes intersecting

I'm trying to work out how to do this and keep getting stuck. Working out
when the two cubes collide is fine, its just how I limit each of them not
to intersect, and instead slide along the edges of one another when they
come into contact that I am struggling with.
I've tried working out the bounding box of each cube (each cube is 100cm
width and height by the way) and then tried saying if B position.x is less
than the bounding box max.x of A then limit box B's position.x. But how I
get that to work on all of the sides I have no idea? Any helpers with a
better brain than mine willing to help?

Sunday, 1 September 2013

If i define an array in if statement then does memory get allocated

If i define an array in if statement then does memory get allocated

If i define an array in if statement then does memory gets allocated
during compile time
eg.
if(1)
{
int a[1000];
}
else
{
float b[1000];
}
then a memory of 2*1000 for ints + 4*1000 for floats get allocated?

Sql query with default value

Sql query with default value

I have an select Query in employee table i need to make sure that column
value(empaddress) always pass an empty value in select query
Select empname,empaddress,empDeptid from empiD=3
I know that empaddress can contain any value like Null or data. But in the
result set it should always be blank
Any help is much appreciated here
Thanks Prince

C++ Programming First, Middle, Name Program

C++ Programming First, Middle, Name Program

Write a program that reads a person's name from the keyboard in the format
First Middle Last. It should then (1) print each of the names on a
separate line and (2) print the person's initials on the fourth line.
Assume that each person has exactly 3 names, that the first name begins in
the first position on a line (there are no leading blanks) and that the
names are separated from each other by a single blank.
Im stuck and don't know where to start. Also fairly new at programming. I
just need help with some steps to take.