



onClick="clicker('id1964')"
onMouseOver="mover('id1')"
onMouseOut="mouter('id1964')"
onClick="displayText('id11', 'Khine 1980');"
/* KYAW TEST June 25, 2007 */
function loader() { alert("on load on body tag"); }
function unloader() { alert("on unload on body tag"); }
function blure() { alert("on blur on body tag"); }
function focuse() { alert("on focus on body tag"); }
function clicker(elemId) {
var elem=document.getElementById(elemId)
elem.style.color="red"
alert("this box follow the link anyway!!!");
}
function mover(textAreaName) {
document.getElementById(textAreaName).style.visibility="hidden";
alert("blah");
}
function mouter(textAreaName) {
document.getElementById(textAreaName).style.visibility="visible";
}
function displayText(textId, mess) {
document.getElementById(textId).firstChild.nodeValue=mess;
}
indexes:
# AUTOGENERATED
# This index.yaml is automatically updated whenever the dev_appserver
# detects that a new type of query is run. If you want to manage the
# index.yaml file manually, remove the above marker line (the line
# saying "# AUTOGENERATED"). If you want to manage some indexes
# manually, move them above the marker line. The index.yaml file is
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.
...
- kind: Inventory
properties:
- name: expenses
- name: locations
- name: distance
- name: skus
- name: unit_space
direction: desc
- name: transports
...
- kind: Inventory
properties:
- name: gender
- name: name
- name: distance
- name: skus
- name: unit_space
direction: desc
- name: transports
# goodpt3
...
- kind: Inventory
properties:
- name: unit_space
- name: gender
- name: locations
- name: phone
- name: skus
- name: transports
...
# goodpt2
...
- kind: Inventory
properties:
- name: unit_space
- name: expenses
- name: gender
- name: locations
- name: phone
- name: distance
- name: skus
- name: transports
# goodpt1 - kind: Inventory
properties:
- name: education
- name: transports
- name: gender
- name: locations
- name: skus
- name: unit_space
direction: desc
...
- kind: Inventory
properties:
- name: transports
- name: gender
- name: locations
- name: distance
- name: skus
- name: unit_space
direction: desc
...
import os import sys import logging import wsgiref.handlers from google.appengine.ext import webapp from google.appengine.ext.webapp import template from util.sessions import Session from google.appengine.ext import db sys.path.append(os.path.join(os.pardir,os.getcwd())) from helper_rendering import doRender import urllib, urllib2 from google.appengine.api import mail from google.appengine.api import urlfetch from google.appengine.ext.webapp.util import run_wsgi_app PP_URL = "https://www.sandbox.paypal.com/cgi-bin/webscr" ACCOUNT_EMAIL= "my_email_for_sandbox@nice.com" #PP_URL = "https://www.paypal.com/cgi-bin/webscr" #ACCOUNT_EMAIL = "my_email_for_real-paypal_acct@good.com" class IPNHandler1(webapp.RequestHandler): def post(self): parameters = None # Check payment is completed, not Pending or Failed. if self.request.get('payment_status') == 'Completed': if self.request.POST: parameters = self.request.POST.copy() if self.request.GET: parameters = self.request.GET.copy() logging.debug('IPN 1, or your own message for yourself to read in log.') else: self.response.out.write('Error, sorry. The parameter payment_status was not Completed.') # Check the IPN POST request came from real PayPal, # not from a fraudster. if parameters: parameters['cmd']='_notify-validate' params = urllib.urlencode(parameters) status = urlfetch.fetch( url = PP_URL, method = urlfetch.POST, payload = params, ).content if not status == "VERIFIED": self.response.out.write('Error. The request could not be verified, check for fraud.') parameters['homemadeParameterValidity']=False # parameters = None # You may log this data in your database, # for later investigation. # Check the money is really to go to your account, # not to a fraudster's account. if parameters['receiver_email'] == ACCOUNT_EMAIL: transaction_id = parameters['txn_id'] # Check if this is a new, unique txn, # not a fraudster re-using an old, verified txn. invoice_id = parameters['invoice'] currency = parameters['mc_currency'] amount = parameters['mc_gross'] fee = parameters['mc_fee'] # Check if they are the right product/item, right price, # right currency, right amount, etc. email = parameters['payer_email'] identifier = parameters['payer_id'] # Email/notify/inform the user for whatever reason. parameters['your_parm']= "It is ok on 19 September, 2010." logging.debug('IPN 100. All OK.') logging.debug(parameters['txn_id']) logging.debug(parameters['invoice']) logging.debug(parameters['payer_email']) # With this IPN testing, you can't see results on the browser. # See results on the log file maintained by Google AppEngine. #template_values = { 'params': parameters, } #doRender(self,'ipn_ok.htm', template_values ) if __name__ == '__main__': print "IPNHandler1 is being run as main()."
1. 09-29 01:54AM 28.745 /ipn_handle1 200 2141ms 408cpu_ms 4kb gzip(gfe) See details 216.113.191.33 - - [29/Sep/2010:01:54:30 -0700] "POST /ipn_handle1 HTTP/1.1" 200 4842 - "gzip(gfe)" "yourstruly.appspot.com" ms=1234 cpu_ms=123 api_cpu_ms=0 cpm_usd=0.123456 loading_request=1 2. D 09-29 01:54AM 29.395 IPN 1 3. D 09-29 01:54AM 30.682 IPN 100. All OK. 4. D 09-29 01:54AM 30.682 31929814 5. D 09-29 01:54AM 30.682 abc1234 6. D 09-29 01:54AM 30.682 buyer@alan.htet.com 7. I 09-29 01:54AM 30.705 Creating session session-575150356408086346 8. I 09-29 01:54AM 30.884 This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request ...
from google.appengine.ext import db
from models.tutor import Residence
import inspect
query = db.GqlQuery("SELECT * FROM Residence WHERE "
"dimensions IN :mydimensions "
"AND locations IN :mylocs "
"AND rent < :myrent "
"AND gender = :mygender"
,
mydimensions =["30x60", ],
mylocs = ['W', "W"],
myrent = 41,
mygender= "M"
)
print inspect.getmembers(query)
[('__class__',),
('__delattr__',),
('__dict__', {'_namespace': None, '_proto_query':, '_kwds': {'mylocs': ['W', 'W'], 'mydimensions': ['30x60'],
'myrent': 41, 'mygender': 'M'}, '_args': [], '_model_class':,
'_keys_only': False, '_cursor': None, '_end_cursor': None, '_compile': True}),
('__doc__', 'A Query class that uses GQL query syntax instead of .filter() etc.'),
('__getattribute__',),
('__getitem__', bound method GqlQuery.__getitem__ of>), ('__hash__', ),
('__init__', bound method GqlQuery.__init__ of('__iter__', bound method GqlQuery.__iter__ of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c>>), ('__module__', 'google.appengine.ext.db'),
('__new__', built-in method __new__ of type object at 0x8146a20),
('__reduce__', built-in method __reduce__ of GqlQuery object at 0xaa7dd6c),
('__reduce_ex__', built-in method __reduce_ex__ of GqlQuery object at 0xaa7dd6c),
('__repr__', method-wrapper '__repr__' of GqlQuery object at 0xaa7dd6c),
('__setattr__', method-wrapper '__setattr__' of GqlQuery object at 0xaa7dd6c),
('__str__', method-wrapper '__str__' of GqlQuery object at 0xaa7dd6c), ('__weakref__', None), ('_args', []), ('_compile', True), ('_cursor', None), ('_end_cursor', None),
('_get_query', bound method GqlQuery._get_query of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c),
('_keys_only', False), ('_kwds', {'mylocs': ['W', 'W'],
'mydimensions': ['30x60'], 'myrent': 41, 'mygender': 'M'}), ('_model_class', class 'models.tutor.Residence'),
('_namespace', None),
('_proto_query', google.appengine.ext.gql.GQL object at 0xaa7d6ac),
('bind', bound method GqlQuery.bind of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c),
('count', bound method GqlQuery.count of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c),
('cursor', bound method GqlQuery.cursor of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c),
('fetch', bound method GqlQuery.fetch of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c),
('get', bound method GqlQuery.get of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c),
('is_keys_only', bound method GqlQuery.is_keys_only of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c), ('run', bound method GqlQuery.run of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c), ('with_cursor', bound method GqlQuery.with_cursor of google.appengine.ext.db.GqlQuery object at 0xaa7dd6c)]
from google.appengine.ext import db
from models.tutor import Residence
import inspect
query = db.GqlQuery("SELECT * FROM Residence WHERE "
"dimensions IN :mydimensions "
"AND locations IN :mylocs "
"AND rent < :myrent "
"AND gender = :mygender"
,
mydimensions =["30x60", ],
mylocs = ['W', "W"],
myrent = 41,
mygender= "M"
)
print query.__dict__
{'_namespace': None, '_proto_query':, '_kwds':
{'mylocs': ['W', 'W'], 'mydimensions': ['30x60'], 'myrent': 41, 'mygender': 'M'}, '_args': [],
'_model_class': class 'models.tutor.Residence', '_keys_only': False, '_cursor': None,
'_end_cursor': None, '_compile': True}
from google.appengine.ext import db
from models.tutor import Residence
import inspect
query = db.GqlQuery("SELECT * FROM Residence WHERE "
"dimensions IN :mydimensions "
"AND locations IN :mylocs "
"AND rent < :myrent "
"AND gender = :mygender"
,
mydimensions =["30x60", ],
mylocs = ['W', "W"],
myrent = 41,
mygender= "M"
)
obj1= query.__dict__['_proto_query']
print obj1
google.appengine.ext.gql.GQL object at 0xaa7814c
from google.appengine.ext import db
from models.tutor import Residence
import inspect
query = db.GqlQuery("SELECT * FROM Residence WHERE "
"dimensions IN :mydimensions "
"AND locations IN :mylocs "
"AND rent < :myrent "
"AND gender = :mygender"
,
mydimensions =["30x60", ],
mylocs = ['W', "W"],
myrent = 41,
mygender= "M"
)
obj1= query.__dict__['_proto_query']
print obj1.__dict__['_GQL__symbols']
['SELECT', '*', 'FROM', 'Residence',
'WHERE', 'dimensions', 'IN', ':mydimensions',
'AND', 'locations', 'IN', ':mylocs',
'AND', 'rent', '<', ':myrent',
'AND', 'gender', '=', ':mygender']
['SELECT', '*', 'FROM', 'Residence',
'WHERE', 'name', '=', ':myname',
'AND', 'email', '=', ':myemail',
'AND', 'phone', '=', ':myphone',
'AND', 'rent', '=', ':myrent',
'AND', 'neighborhood', '=', ':myneighborhood',
'AND', 'transportation', '=', ':mytransportation',
'AND', 'gender', '=', ':mygender',
'AND', 'race', '=', ':myrace',
'AND', 'dimensions', 'IN', ':mydimensions',
'AND', 'locations', 'IN', ':mylocations',
'ORDER', 'BY', 'email', 'DESC', ',', 'rent', 'ASC']
# instance_eval evaluates a block of code
# with self set to the object that's receiving the instance_eval call.
add_two = Proc.new { self + 2 }
puts 1.instance_eval(&add_two) #=> 3
puts 2.instance_eval(&add_two) #=> 4
"stellar coding staff".instance_eval{p self}
[1970, 1980, 1990, 2000].instance_eval{p self}
{'a'=> 1970, 'water'=> 1990, 'gold'=>2010}.instance_eval{p self}
puts "\n\n"
# Here's a second example using an implicit method receiver.
call_reverse = Proc.new { self.reverse }
p "alan akhoe kid".instance_eval(&call_reverse)
p ["x", "y", "z"].instance_eval(&call_reverse) #=> ["z", "y", "x"]
p [1, 34, 117, 997].instance_eval(&call_reverse)
# OK BAD # p 12121.instance_eval(&call_reverse)
[root@localhost ruby_tutor]# ruby ie_self.rb
3
4
"stellar coding staff"
[1970, 1980, 1990, 2000]
{"a"=>1970, "water"=>1990, "gold"=>2010}
"dik eohka nala"
["z", "y", "x"]
[997, 117, 34, 1]
class C
def initialize
@a = 0
end
def next
@a += 1
end
end
w = C.new
p w.next
p w.next; puts;puts
p w.instance_eval "@a" #=> 2
p w.instance_eval { @a } #=> 2
p C.new.instance_eval { @a } #=> 0
[root@localhost ruby_tutor]# ruby ie_and_private_vars.rb
1
2
2
2
0
If you need to make some money very quickly, what would you do? Your answer points to the kind of problems you can solve. They give you so...