Debian Squeeze on HP 620 Notebook
Problem:
External speakers and wireless not working on HP 620 Notebook
Solution:
Followed the step by step instructions here. Now everything works.
http://blog.sviluppoweb.eu/2011/08/05/how-to-install-debian-6-0-squeeze-linux-on-hp-620-notebook/
Appengine – Appstats (python)
Setting up Appstats for python and djangoappengine.
Assuming you have your djangoappengine setup as explained here.
Now following the instructions from http://code.google.com/appengine/docs/python/tools/appstats.html
1. Add this to settings.py
MIDDLEWARE_CLASSES = ( 'google.appengine.ext.appstats.recording.AppStatsDjangoMiddleware', # ... )
2. Add this to app.yaml
builtins: - appstats: on
That’s it. Now start your server is running
python2.5 manage.py runserver
Point your browser to http://127.0.0.1:8000/_ah/stats/
You should see something like
Now add some data by visiting some pages eg http://127.0.0.1:8000/ (Do this in a different tab then refresh.) You should have some stats now.
That’s it. Very simple and straight forward instructions from the docs.
Google I/O: Building Scalable, Complex Apps on App Engine
appengine – SELECT using OR clause – alternative
Problem:
Appengine does not support SELECT using an OR clause. There are a number of options out there and this is one of them. The Kind I am using this on will not have alot of data and I am hoping (fingers crossed) that it will not cause a performance issue later on.
Solution:
Filter, StringListProperty.
from googleappengine.ext import db class Post(db.Model): author = db.StringProperty() category = db.StringListProperty() post = Post(author="Sam", category=['bash', 'emacs','lisp']) post.save() post = Post(author="Peter", category=['bash', 'appengine']) post.save() post = Post(author="Ken", category=['mail', 'django','irc', 'sql']) post.save() results = Post.all().filter('category = ', 'bash') for item in results: print item.author, item.category
Results
You would then get the following two items.
Sam [u'bash', u'emacs', u'lisp'] Peter [u'bash', u'appengine']