Recent blog entries for wtanaka

It's counterintuitive that you need to unquote Google App Engine URL parts twice.

delete index: google app engine

appcfg.py vacuum_indexes ./

Google App Engine Data Migration: Deleting an attribute

One can:

  1. Change the model class definition so that it extends Expando.
  2. Remove the undesired attribute from the property definition list.
  3. Add code which calls del mymodel.myattribute on all the entities eventually
  4. Change the model class definition back to Model

Google App Engine appcfg.py update error:

Could not guess mimetype for favicon.ico. Using application/octet-stream.

Solution:

Add mime_type: image/vnd.microsoft.icon to the appropriate part of app.yaml

Serializing to JSON with Google App Engine

from django.utils import simplejson

Then: http://simplejson.googlecode.com/svn/trunk/docs/index.html

To create a Google app engine custom 404 page, add a handler that matches everything as the last handler:

(r'.*', DefaultHandler),

And somewhere in that handler, call self.error(404)

Google App Engine WSGIApplication for Drupal Users:

(r'/path(?:/(.*))?', HandlerClass),

registers HandlerClass for URLs of the form:


/path
/path/
/path/something
/path/something/else

But not:


/pathfoo

HandlerClass get method should then start with:


   def get(self, args):
      if args is None:
         args = ""

printf debugging in GreaseMonkey without the modal dialog box of alert():

  • You can use GM_log, which logs messages to the Error Console.
  • With the Firebug extension, you can do e.g. console.log("Link: %o", document.links[0]) to log messages and inspect elements. Don't forget to remove the Firebug code before distributing the script.
  • You can use dump() statements to print debugging info to the Firefox console.
  • You can set window.status = message_string, understanding that the status bar text is transient: many other processes within Firefox set it.
21 Mar 2008 (updated 21 Mar 2008 at 09:16 UTC) »

Firefox 2 font configuration in Fedora 8 Linux does not come from GNOME font settings. If you have, at some point turned on sub-pixel font rendering for your LCD in Firefox and want to turn it off because the colors around the edges of the letters are ugly (or if you want to turn it on because you think it looks better), the settings are located in ~/.fonts.conf

The default subpixel font setting is off, so to turn off subpixel rendering in firefox (and reset all the other settings to defaults), one can simply delete ~/.fonts.conf

This also works for seamonkey

13 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!