Django on Google App Engine
For the BibBase project that I have been involved in, I need to build a web-based app for linking open data for bibliography data (bibtex files). I have been evaluating putting the thing on Amazon AWS and Google App Engine. Here are some of the notes for Django on Google App Engine:
1. The djangoappengine project implements most of Django’s features on App Engine. The most notable missing support IMO is many-to-many relationships between models.
2. ER-Modeling with Google App Engine (updated) is a great explanation on how to create relational models using Google’s Data Store (essentially BigTable).
3. Paging through large datasets: To get around App Engine’s 1000 OFFSET limit, this is an article describing how to implement paging on App Engine. In the latest SDK, cursor is recommended to do paging.
4. App Engine data store doesn’t allow SQL LIKE style queries. Nonrel-search implements full-text search on non-relational DBMS using lists.
5. App Engine Console: A Python console that can be used to help debugging in both development and production environment.
MobileMonday Toronto April 5 #momoto
I’m at #momoto April 5 event right now. The topic is Google Presents Insights on Mobile Devices.
Rough content outline:
- Mobile devices (phones) is a super computer (when compared with super computers in the early 90s). They are also sensing the environment for people (location, touch, etc).
- Browsers are the starting point of many activities.
- HTML5 makes browsers more powerful and useful as mobile apps. CSS acceleration (nearly native UIs are possible), SQL local storage (offline data storage), application cache (application startup), geolocation API (demoing buzz), CSS transforms and touch (gmail two-pane UI). They also demoed http://css-vfx.googlecode.com/svn/trunk/snowstack/snowstack.html as an example of CSS effects.
- Q&A, which is the more interesting part.
Some thoughts:
- I feel that the people attending #momoto is a different crowd from the ones going to the usual startup events in Toronto. They are on average dressier. I’ve also noticed there were a lot more women attending this than democamp, etc.
- Probably because the audience is less technical, the talk is a little bit shallow. Most of the points are extremely well known and understood already by anyone who comes from a technical background and pays reasonable attention to techcrunch or gizmodo.
My grand challenge: collect 18 autographs
If you are a software engineer and you haven’t read Sam’s new book on Making It Big in Software, it’s worth the $16 dollars off Amazon. In 400 pages, Sam covers most topics that are relevant in career growth and development for a software professional (a.k.a. “Get the Job, Work the Org, Become Great”).
Sam is a senior technical leader with IBM’s DB2 team, an active speaker in academic and technical conferences, and has twenty years of experience in recruiting, managing, and mentoring engineers. I was very fortunate to have him as my mentor and manager when I was an Extreme Blue student.
It is great to hear his perspective. In addition to a systematic overview of the topic, the book also features interviews with 17 interviews with stars of the industry:
Steve Wozniak, Inventor, Apple computer
John Schwarz, CEO, Business Objects
James Gosling, Inventor, Java programming language
Marissa Mayer, Google VP, Search Products and User Experience
Jon Bentley, Author, Programming Pearls
Marc Benioff, CEO and founder, Salesforce.com
Grady Booch, IBM Fellow and co-founder Rational Software
Bjarne Stroustrup, Inventor, C++ programming language
David Vaskevitch, Microsoft CTO
Linus Torvalds, Creator, Linux operating system kernel
Richard Stallman, Founder, Free software movement
Peter Norvig, Google’s Director of Research
Mark Russinovich, Microsoft Fellow and Windows Architect
Tom Malloy, Adobe Chief Software Architect
Diane Greene, Co-founder and past CEO of VMware
Robert Kahn, Co-inventor, the Internet
Ray Tomlinson, Inventor, email
I pre-ordered a copy of the book on Amazon last year and received it last week. Today, Sam signed the book. Then this idea came to my mind: collect the autographs of all 17 interviewees of the book.
It is not an easy job as they are spreaded out geographically. If I can do this in 5 years, Sam promised to buy me a case of beer.
Fingers crossed.
vim customization series #2: search within a function/block
Normally, “/” searches through the whole file. Often I would like to search for the occurrence of a particular variable within a block of code or within a function.
To do that, put the following into .vimrc file:
" reference: http://vim.wikia.com/wiki/Search_keywords_in_c_function
" Search within top-level block for word at cursor.
nnoremap <Leader>[ "ayiw/<C-R>=ScopeSearch("[[")<CR><C-R>a<CR>
" Search within current block for word at cursor.
nnoremap <Leader>{ "ayiw/<C-R>=ScopeSearch("[{")<CR><C-R>a<CR>
" Search within current top-level block for user-entered text.
nnoremap <Leader>/ /<C-R>=ScopeSearch("[[")<CR>
" Return a string to place at the beginning of a search to limit
" the search to a certain scope.
" navigator is a command to jump to the beginning of the desired scope.
function! ScopeSearch(navigator)
exec 'normal ' . a:navigator
let l:s = line(".")
normal %
let l:e = line(".")
normal %
if l:s < l:e
return '\%>' . (l:s-1) . 'l\%<' . (l:e+1) . 'l'
endif
echo "Cannot find search scope with command " . a:navigator . " %"
return ""
endfunction
What the code does is when you press “\” followed by a “/”, it executes this function to calculate the beginning and end of the current function, and generates the command to do a search within those lines.
This is obtained from http://vim.wikia.com/wiki/Search_keywords_in_c_function
vim customization series #1: smart case sensitivity
Since we develop DB2 pureScale completely on Linux or AIX, I’ve been using almost 100% command line interface (less, vim, gdb, grep, find) at work. Over time, I’ve built up a small set of customizations for vim that I cannot work without. I would like to document them here so if I ever need to use vim again, I have a reference point.
To enable smart case sensitivity, add the following lines to .vimrc:
set ignorecase set smartcase
With this enabled, if you search for a keyword that is all in small letters, the search is case insensitive. However, when you have capitalized letters, the search is case sensitive. For example, “abcd” matches “abcd”, “ABCD”, “aBC”D, etc. But “aBcd” only matches “aBcd”.
