Archive for the 'Uncategorized' Category
Today, I fought with (and conquered!) getting third-party cookies enabled in Safari and Internet Explorer. There was a bunch of scattered information about this problem on the Internet, so I will either add to the noise or help someone out with this post.
Both Safari and Internet Explorer have default privacy settings that are quite harsh [...]
Filed under: VendAsta | Leave a Comment
Dependency Injection in Python
For testability reasons, we’ve begun using a lot of dependency injection in our Python projects. Imagine that I have a function that does some work and then ultimately calls an API over-the-wire:
import simplejson
from google.appengine.api import urlfetch # App Engine example
def my_method(user_id):
url = ‘http://www.example.com/lookup-user/%d.json’ % user_id
result = urlfetch.fetch(url)
if result.status_code == 200:
return simplejson.loads(result.content)
return {}
This is bad for [...]
Filed under: Uncategorized | Leave a Comment
Tags: Projects, VendAsta
Use asynctools to get parallel API calls (including data store queries) on Google App Engine.
Filed under: Uncategorized | 8 Comments
Tags: App Engine, Projects, VendAsta
One of the great things about templating systems is the ability to encapsulate repeatable chunks of code. One of the tough things about templating systems is management of a global “state” to ensure the the overall document that is emitted is as efficient as possible – especially in the HTML world were bandwidth is a [...]
Filed under: Uncategorized | Leave a Comment
Tags: Projects, VendAsta
The other day, I noticed that the button image for a bookmarked site on my iPhone home screen (our corporate GMail) looked really nice, and was different than before:
I got to wondering how it came to be.
Scanning the View Source of the GMail page, I didn’t see any tags that were relevant, so I [...]
Filed under: Uncategorized | Leave a Comment
Tags: Hijinx, VendAsta
Google App Engine doesn’t have a unique constraint in the classical sense of relational databases. This is a favourite construct of application developers and it’s unfortunate that it’s not present. At the same time, a basic understanding of the underlying datastore points to why it’s tough, or at least inefficient.
There are places where you’re willing [...]
Filed under: Uncategorized | 3 Comments
Tags: Projects, VendAsta
Recently, I discovered something surprising about Google App Engine’s datastore and ReferenceProperty. Imagine I have a class like the following:
from google.appengine.ext import db
class Home(db.Model):
address = db.StringProperty()
room = db.ReferenceProperty(Room)
where Room is also a db.Model.
Datastore uses a proxying technique such that db.Model objects are created lightly (i.e., with only their key) and any hit to an attribute [...]
Filed under: Uncategorized | 2 Comments
Tags: Projects, VendAsta
We have a templatetag, called scurl, that needs to look at the HttpRequest object. Django’s templating system provides a straight-forward, yet wordy, mechanism to pass the request object in to the template:
def my_view(request):
return render_to_response(“myview.html”, context_instance=RequestContext(request))
The render method of our scurl templatetag gets access to this context and thus access to the HttpRequest.
So far, so good.
In [...]
Filed under: Uncategorized | 5 Comments
Tags: Projects, VendAsta
So, here we sit, uncertain of our first steps….
Here at VendAsta, we’ve just kicked off our Friday afternoon jam sessions. Starting at noon, we bring in lunch and all get together in adhoc groups and work on projects of interest. Anything. Well, anything software.
It’s an odd feeling though to have all constraints lifted and actually [...]
Filed under: Uncategorized | 3 Comments
Tags: Projects, VendAsta
Code review is essential.
Code review is a vital mechanism for ensuring conventions and patterns, as well as spreading knowledge of solutions and technologies throughout a team.
We have been evaluating Crucible as a formal tool for tracking comments and laying the comments alongside the actual code. The cool thing is that it integrates (somewhat) with Fisheye, Jira, and Subversion [...]
Filed under: Uncategorized | 3 Comments
Tags: Projects, VendAsta