Month: August 2005

  • GPE-Calendar on Maemo

    Matthias has made progress on a GPE-Calendar port to the Maemo platform. Porting GPE-Calendar is a lot harder than a lot of ./configure; make; make-install “ports” to Maemo, and it looks like it is coming along nicely. The Nokia 770 is still officially not a PDA mind you, but the more solid apps available for the platform on launch day the better.

  • Using Asterisk with Gizmo

    This wiki page contains instructions for setting up Asterisk to use your Project Gizmo account for both incoming and outgoing calls. It’s a nice little hack and sounds like a perfect way for me to tinker with outbound VoIP using a spare box and a generic card that I picked up on Ebay months ago. BroadVoice‘s Bring Your Own Device plans also sound worthwhile.

    I’m extremely impressed with the configurability of Asterisk. You can do just about anything you can imagine with it, including routing incoming calls based on caller ID info, and extremely complex outbound routing. With the right configuration it’s no big deal to use POTS for outgoing local calls and even multiple VoIP accounts if one has cheaper rates in a partiucular area, all matchable by dial string.

    It’s definitely overkill for a simple answering machine, but it’s truly powerful platform.

  • Feed Fixed

    Sorry about that, when I downloaded WP-HashCash I aparently included a few extra lines at the end which made my feeds not validate and didn’t work in Firefox. It’s fixed now though. I’m going to try this instead of Spam Karma 2 for a bit. It seems to be doing a good job so far, but let me know if you have any trouble leaving comments.

    (Thanks for pointing it out, Mike!)

  • When Text Ads Make My Eyes Bleed

    Text Ads are a beautiful thing. There are now many fine purveyors out there for you to choose from: Google’s AdSense, Yahoo’s YPN, BrightAds by Kanoodle, BlogAds, and I’m sure a bajillion others. The aparent thought process among many out there is “if one text ad good, two must be great, and 4 would be perfect!” I think the opposite is true.

    Text-based advertisements on the web work so well because

    1. They’re almost always targeted well. Text ads are powerful because of their context.
    2. They don’t “get in the way.” You don’t have to punch the monkey.
    3. They often add value to the surrounding content. If they’re well targeted (see #1), the ads may provide the exact information a reader is looking for.
    4. They don’t make my eyes bleed (see previous reference of punching the monkey).

    The problem with text ads is that you can’t just cram them in to every nook and cranny of your weblog and just sit back and cash your checks. Actually, I guess you can, as I discovered in a post by Barry at Search Engine Journal (via Jeremy). Barry has 3 rather large AdSense blocks in his main content pane (they’re all of the square/rectangle variety) and a BlogAd on the left column. At first glimpse (after I cleared the blood from my eyes) I had a hard time discerning content from advertisement. I hate to pick on Barry, because he’s definitely not the only one doing it.

    Please, use text ads sparingly. I know there’s a lot of temptation to just fill ‘er up, but while that might bring in more money, it’s going to start costing you readers. I tend to shy away from eye-bleeding websites be they big or small. I’ve grown far too acustomed to tuning out annoying ads on sites that I value, but I can only tolerate it up to a point.

    In the interest of full disclosure, I use and love text ads on this weblog. I do try to use them sparingly and I also try to shield my regular readers as much as possible. Most of my regular readers catch content via my RSS feed, in which no ads appear. Anyone who types postneo.com in to their browser will see nothing more than one small text ad below the header. Internal referres see the same. I show a much bigger ad to people coming in from external referrers, since a vast majority of those are via search engines, and they tend to be big clickers.

    I’m never going to become a millionare by using text ads as sparingly as I do. I may even experiment with another ad in the sidebar or below the main content. These little ads do however cover my hosting costs, with a little extra on the side for the “gadget fund.”

    So please, think twice before making my eyes bleed.

  • Is Content Self-Publishing the Next Step for the Blogosphere?

    After hearing about Lulu through Erika Dreifus I couldn’t help but browse around the site. What I discovered was a treasure trove of self-published and publish-on-demand books, calendars, and music. There is everything from Matt Raible’s Spring Live published by SourceBeat to Herman the Homeless Hermit Crab by Scott Fisk, an awesome little childrens book available in paperback for $7.99 and in PDF form for less than a buck

    Seeing this broad range of quality professional content, sometimes priced quite affordably in ebook form, I couldn’t help but think that this is the next direction the blogosphere might take. It makes perfect sense if you think about it. There are so many talented yet rather obscure writers on the web out there that know a whole heck of a lot about what they write about.

    If every domain expert (or every average joe who knows a good bit about a topic) out there were to publish something and make it available in print or PDF at a reasonable price, we might just have something. The Long Tail goes on and on.

  • Migrating Your App to Django

    A few days ago I mentioned Changeset 384 which included a new command, django-admin.py inspectdb <dbname>. It has also been tweaked and improved since it was initially committed. The other day I tried it out on a simple database structure, but I decided to throw a more complex example at it.

    I decided to take the final depot application from the excellent Agile Web Development with Rails book. Beta books rule by the way. I executed the SQL in rails-code/depot_final/db/create.sql from the the code tarball to set up the database structure. I then created a new project with django-admin startproject and edited settings/main.py to tell Django how to log in to my mysql database. After exporting the correct DJANGO_SETTINGS_MODULE I ran django-admin.py inspectdb depot_rails which gave me the following model:

    # This is an auto-generated Django model module.
    # You'll have to do the following manually to clean this up:
    #     * Rearrange models' order
    #     * Add primary_key=True to one field in each model.
    # Feel free to rename the models, but don't rename 
    # db_table values or field names.
    #
    # Also note: You'll have to insert the output of 
    # 'django-admin.py sqlinitialdata [appname]'
    # into your database.
    
    from django.core import meta
    
    class LineItem(meta.Model):
        db_table = 'line_items'
        fields = (
            meta.IntegerField('id'),
            meta.IntegerField('product_id'),
            meta.IntegerField('order_id'),
            meta.IntegerField('quantity'),
            meta.FloatField('unit_price'),
        )
    
    class Order(meta.Model):
        db_table = 'orders'
        fields = (
            meta.IntegerField('id'),
            meta.CharField('name', maxlength=100),
            meta.CharField('email', maxlength=255),
            meta.TextField('address'),
            meta.CharField('pay_type', maxlength=10),
            meta.DateTimeField('shipped_at'),
        )
    
    class Product(meta.Model):
        db_table = 'products'
        fields = (
            meta.IntegerField('id'),
            meta.CharField('title', maxlength=100),
            meta.TextField('description'),
            meta.CharField('image_url', maxlength=200),
            meta.FloatField('price'),
            meta.DateTimeField('date_available'),
        )
    
    class User(meta.Model):
        db_table = 'users'
        fields = (
            meta.IntegerField('id'),
            meta.CharField('name', maxlength=100),
            meta.CharField('hashed_password', maxlength=40),
        )

    Per the comment block at the top, you’re not home free yet, but at lot of tedious work has been done for you. This should definitely jumpstart the porting of existing applications to the Django platform.

  • Swik is Slick

    Swik by SourceLabs is really awesome. It’s part wiki and part search engine. I first heard about it through the Django page, but have since poked around and there’s a lot of great information there. There’s a plethora of information on Ajax and related technologies, platforms, and projects. Swik is also folksonomy-enabled (buzzword++). For example, here’s the framework tag, python tag and java tag.

    It’s a great little service.

  • Geolocation Information Gaps

    I’ve been seeking out interesting data sources to plot in Google Earth after learning the basics of KML. I’ve been wanting to do something cool with NOAA’s XML weather feeds since I heard about them, so I thought I would download the 700kb list of stations serving up XML and spit out some KML from that data as a “neat” first step.

    I’ll probably still do that, but after parsing the data, I’m a bit dissapointed. As always there are huge gaps in geolocation information. In order to get my hands on the data I turned to xmltramp which is an awesome library for accessing simple XML documents in a pythonic way. I then whipped up a few lines of Python to walk through the data:

    import xmltramp # http://www.aaronsw.com/2002/xmltramp/
    
    f=open('stations.xml', 'r')
    doc=xmltramp.parse(f.read())
    count = 0
    total = 0
    for station in doc['station':]:
      total = total + 1
      sid = str(station['station_id'])
      lat = str(station['latitude'])
      lon = str(station['longitude'])
      if (lat != 'NA') and (lon != 'NA'):
        print "Station ID: " + sid + \
        " (" + lat + "," + lon + ")"
        count = count + 1
    print str(count) + " out of " + str(total) + \
    " stations are geolocated."

    Here’s the output of the above code:

    mcroydon@mobilematt:~/py/kmlist$ python kmlist.py
    Station ID: PAGM (63.46N,171.44W)
    [... snip ...]
    Station ID: KSHR (44.46.10N,106.58.08W)
    422 out of 1775 stations are geolocated.

    Well that’s a bummer. 422 out of 1775, or less than 25% of all stations are geolocated. While that’s still 422 more stations than I knew about previously, it’s a far cry from a majority of weather stations across the United States.

    Another thing you will notice is that some stations appear to be expressed in degrees in decimal form (63.46N) while others appear to use Degrees/Minutes/Seconds (44.46.10N).

    It’s gaps like these that can make working with “found” geolocation data frustrating.

  • Nokia 6682 Getting Ready to Drop?

    From this post on the massive Nokia 6682 thread on Howard Forums:

    I just called the NBO line and the rep said that the 6682 will be officially available as of tomorrow, the 5th of August through their NBO dept.

    I think NBO stands for “National Business Office,” for larger companies with national accounts. I’m guessing that it will still take some time to get to retail outlets, but this is definitely a good sign for those like me waiting to snag a discounted 6682 on contract.

  • WSDL for Series 80

    I just saw the the Nokia WSDL-to-C++ Wizard fly by my aggregator:

    The Nokia WSDL-to-C++ Wizard is a Microsoft Visual Studio 2003 .NET add-in that creates Symbian C++ code for accessing a web service described by a WSDL file. The code generated by the wizard uses the Service Development API of the Nokia Series 80 Second Edition developer platform and the generated code can therefore only be used on S80 2nd edition compatible phones. The preferred way to use the wizard is together with the Nokia Developer’s Suite for Symbian OS 1.1.

    This should broaden the horizons for C++ app devs targeting Series 80 2nd edition. I’m a big fan of RESTian web services, especially on a mobile device. I wonder how much work it would take to get one of these SOAP toolkits running on Python for Series 60.

  • The Django Shuffle

    Lots of changes are happening in the newly formed Django world these days. Tons of bugfixes and feature additions have been streaming in to the subversion repository. One of my recent favorites is Changeset 384 which adds a django-admin.py inspectdb command. It’s not perfect yet but it should help out people trying to integrate existing databases with Django. The new command will do its darndest to output a Django model given a particular database name.

    In other news, congrats to Eric (slashzero) on the new gig in Naples and to Adrian (adrian_h) on his new gig at The Washington Post.

    Update: Hugo’s at it again and has notes on using Django with Apache and mod_fcgi which build on his experience with Django, lighthttpd and FastCGI.

  • Comment Spam Sucks

    I’ve been doing a poor job at keeping up with comment spam lately. While I still need to go back through all of my comments and delete the spammy ones, I’ve decided to try Spam Karma 2 hoping that will take care of the horde of comment and trackback spam. I think the built-in RBL stuff is snagging all of it, but if you have any problems posting a comment, send me an email at matt at ooiio dot com.

    Update: SK2 seemed to behaving badly in some instances, so I’m going to give WP-Hashcash a go for a bit.

  • The Revolution Will Be Geotagged

    Over the weekend I’ve been working on a Python for Series 60 project that I thought up a few days ago while exchanging information with Gustaf between Google Earth instances. It really should have hit me when Google Sightseeing packed its sights in to a KML file, but what can I say, I’m a little slow.

    After sending a .kml file via email to Gustaf, I decided to take a look at what exactly made up a .kml file. I started to drool a little bit when I read the KML documentation. The first example is extremely simple yet there’s a lot of power behind it. A few lines of XML can tell Google Earth exactly where to look and what to look at.

    Proof of Concept

    With this simple example in mind, I started to prototype out a proof of concept style Python app for my phone. Right now everything is handled in a popup dialog, and for the time being I’m just going to save a .kml file and let you do with it as you please, but over the next few days I plan to re-implement the app with an appuifw.Form, get latitude and longitude information from Bluetooth GPS (if you’re so lucky), and work on smtplib integration so that the app can go from location -> write KML -> send via smtplib.

    Rapid Mobile Development

    When I say that I’ve been working on this app over the weekend, that’s not strictly accurate. I prototyped the proof of concept over about 20-30 minutes on Friday night using the Python for Series 60 compatability library from the wonderful folks at PDIS. I then spent the rest of some free time over the weekend abstracting out the KML bits and reverting my lofty smtplib goals to saving to a local file on the phone. I’m not sure if the problem is due to my limited T-Mobile access or if I need to patch smtplib in order to use it on my phone.

    There’s also one big downside to trying to use smtplib on the phone, and that’s the fact that smtplib (and gobs of dependent modules) aren’t distributed with the official Nokia PyS60 distribution, so if I’m going to distribute this app with smtplib functionality, I’ll have to package up a dozen or two library modules to go with it. I’m going to mull it over for a few days and see if I can get past my smtplib bug or investigate alternatives.

    from kml import Placemark

    I’ve started a rudimentary Python kml library designed with the Series 60 target in mind. It’s rather simplistic, and so far I’ve only implemented the simplest of Placemarks, but I plan to add to it as the need arises. It should be quite usable to generate your own KML Placemark. Here’s a quick usage example:

    >>> from kml import Placemark
    >>> p=Placemark(39.28419, -76.62169, \
    "The O's Play Here!", "Oriole Park at Camden Yards")
    >>> print p.to_string()
    <kml xmlns="http://earth.google.com/kml/2.0">
    <Placemark>
      <description>The O's Play Here!</description>
      <LookAt>
        <longitude>-76.62169</longitude>
        <latitude>39.28419</latitude>
        <range>600</range>
        <tilt>0</tilt>
        <heading>0</heading>
      </LookAt>
      <Point>
        <coordinates>-76.62169,39.28419</coordinates>
      </Point>
    </Placemark>
    </kml>

    Once I have my Placemark object, saving to disk is cake:

    >>> f=open("camdenyards.kml", "w")
    >>> f.write(p.to_string())
    >>> f.close()

    If you have Google Earth installed, a simple double click should bring you to Camden Yards in Baltimore. The simplicity of it and the “just works” factor intrigue me, not the fact that this can be accomplished in a few dozen lines of python but the fact that KML seems so well suited for geographic data interchange.

    Camden Yards in Google Earth

    It’s About Interchange

    If you are really in to geographic data, and I mean so at an academic or scientific level, KML probably isn’t the format for you. You might be more interested in the Open Geospatial Consortium’s GML (Geography Markup Language). It looks like it does a great job at what it does, but I’m thinking that the killer format is aimed more at the casual user. KML is just that. From a simple Placemark describing a dot on a map to complicated imagery overlays, KML has your back covered. I find the documentation satisfying and straighforward, though I’m no expert on standards.

    In the very near future conveying where you are or what you are talking about in a standard way is going to be extremely important. Right now there’s only one major consumer of .kml files and that’s Google Earth. Expect that to change rapidly as people realize how easy it is to produce and consume geodata using KML and .kmz files (which are compressed .kml files that may also include custom imagery).

    I would love to see “proper” KML generators and consumers, written with XML toolkits instead of throwing numbers and strings around in Python. I would love to have a GPS-enabled phone spitting out KML using JSR-179, the Location API for J2ME. I hope to use Python for Series 60 to further prototype an application that uses a Bluetooth GPS receiver for location information and allow easy sharing of geodata using KML.

    The Code

    If you’d like, take a look at the current state my kml Python library, which is extremely simple and naive, but it allows me to generate markup on either my laptop or N-Gage that Google Earth is happy to properly parse. A proof of concept wrapper around this library can be found here. I hope to expand both in the coming days, and I hope to soon have the smtplib-based code working properly on my phone with my carrier.

    Update: Oops, forgot to add the <name/> tag. Fixed. The name should now replace the (ugly) filename for your Placemark.

  • Pythonic Wensleydale?

    I’m guessing that the PyPI folks got tired of pronounciation issues and being confused with PyPy. And so cheeseshop.python.org was born, or at least I’m assuming that’s how it came about.

    I wonder if they’ve got my Wensleydale in yet.

    Update: Looks like it’s just a hostname switch according to AMK.