Category: Open Source

  • 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.

  • Mozilla Minimo .007

    Very early this morning I saw a story fly by on Yahoo! News about a preliminary release of Minimo for PocketPC. I thought that was kind of neat so I checked out the Minimo homepage but didn’t see any downloadables. Lo and behold just a few hours later, PocketPC Thoughts has tracked down a screenshot and a link to the download. I think the tabs are critical for me.

    I would also love to see Minimo on the Nokia 770, though the device ships with Opera which looks like it will have a lot of polish. Even so it would rock to have browser alternatives such as Minimo and GTK+ WebCore.

  • Nokia is Serious About Linux and Maemo

    This entry at Gnome FootNotes confirms that the Maemo/770/Linux team is indeed growing and that Nokia really is serious about this whole Linux and open source thing. There are currently 9 open job positions relating to the Maemo platform. Sure that’s a drop in the bucket for a company as large as Nokia, but it’s significant too.

  • Django: Trivial Patch

    Last night I ran across a deprecation warning when running django-admin.py startproject <projectname>, so I went to file a ticket but found that someone else had experienced the same problem. I looked at the solution, and on the surface it looked like the fix involved replacing from whrandom import choice to from random import choice. Indeed that was all it took, so I submitted a (trivial) patch and continued to bang on Django a bit more.

    That trivial patch made me really wish that there were unit tests for Django. I would have felt a lot better knowing that after applying my patch n tests still passed with flying colors. Without a test framework in place, I really had no idea if my trivial search and replace broke something. It’s possible that somewhere in the code was really expecting some behavior specific to whrandom that was just slightly different than the behavior of random.

    I’m going to hunt around for other little trivial fixes that don’t require carnal knowledge of the codebase and submit patches if I can come up with a fix. At the same time I hope that Nelson’s test suite ticket gets noticed. I wouldn’t mind doing some of the dirty work once a framework is in place, but as always I defer to Adrian and the core Django team when it comes to policy and implementation.

  • Keeping Up With Django

    It’s been quite amazing watching this framework called Django, pulled from a production environment, evolve in realtime right before my eyes. Adrian has been committing changes left and right, fixing bugs, adding features, and most importantly lowering the barrier for new users. Docs and tutorials are being clarified, things made simpler, and a few of those nagging problems are dissapearing in front of my eyes.

    Yesterday Adrian modified the cookie system so that we didn’t have to add a custom setting in order to make it work. He’s also moved DJANGO_SETTINGS_MODULE to a Python variable so you should no longer have to set an environment variable in order to tel the system which module you want to run. Strike that, you still need the environment variable, the name is just user configurable. (Thanks Stefano!) And of course the addition of django-admin.py runserver lets you bypass mod_python or another WSGI-compliant server while you are just checking out the framework or during initial development.

    jango team and everyone in the quickly expanding community. If you’re having trouble with something, hop on #django at Freenode, there’s probably someone else in there who has experienced the exact same thing. And don’t forget to svn up often!

    Now that I’ve gone through the tutorials and have reasonably wrapped my head around the framework I plan to work on a small project to flex my newly found Django muscles.

    Update:

    As always, Adrian has made our lives simpler, this time with Changeset 247:

    Added ‘–settings’ option to django-admin. This specifies which settings module to use, if you don’t want to deal with setting the DJANGO_SETTINGS_MODULE environment variable. Refactored django-admin to use optparse. Updated the tutorials to use ‘–settings’ instead of environment variables, which can be confusing.

  • OXLook for OPEN-XCHANGE

    Nice! I was looking for more information on how much OXLook for the open source version of OPEN-XCHANGE is, and they’re only $20 a seat! More information on the Outlook connector can be found here.

    In an ideal world it would be awesome if I could use the built-in exchange syncronisation on my Dell X30, but that’s a no-go. Plugging it in to a windows desktop in order to sync changes made from the web portal or from ical-over-webdav to Evolution( (I hope) might be the closest I can get to perfection.

    I’m still not sure what is going to be best to get me organized, but right now I think a “try something and see if it works” attitude is the way to go.

  • Pimp My Django

    Pimp My Django

    Yeah, baby! Thanks to tons of SVN updates, I’ve managed to plow through the second Django tutorial unscathed. I’m really impressed with the admin interface and how a dab of Python can do stuff like create a sidebar or create a rocking search interface.

    Huzzah!

  • Django: Making it Easier

    Yes! Adrian has just commited a patch that bypasses mod_python completely!

    mcroydon@mobilematt:~/django/proj$ django-admin.py runserver
    Starting server on port 8000. Go to http://127.0.0.1:8000/ for Django.

    svn up in your django_src dir and enjoy.

  • Django Gotchas

    I know that a lot of these things will get ironed out or explained more clearly once the platform matures and more people start using it, but here are some tips for early Django adopters trying to get through the tutorials:

    1. Don’t name your project test. I know it sounds like a good idea now. I did the same. Trust me though, at the beginning of Tutorial 2 you’ll start kicking yourself when you run in to namespace collisions with the test module. In order to make this warning a bit more abstract, you’re best off not naming your project anything that is a Python module in the Python Standard Library
    2. Your project directory should be somewhere in your Python Path. Under Linux your best bet is to set the PYTHONPATH environment variable. Here’s the gotcha, if your project is in /path/to/project, you actually want to set your PYTHONPATH variable to /path/to. On a per-session basis you can do this by doing something like export PYTHONPATH=/path/to
    3. In order to really use django-admin.py as often as you’re going to, you really want to symlink it to /bin or /usr/bin. For me (again, under Ubuntu having checked out Django via Subversion), ln -s /usr/lib/python2.4/site-packages/django/bin/django-admin.py /usr/bin/django-admin.py did the trick.
    4. Really pay attention to the install instructions and make sure you symlink your django install to /usr/lib/python/site-packages correctly.
    5. I’m still dealing with the newbie cookie authentication bug that tends to creep up partway through the second tutorial, but I was able to get the admin login to pop up by using the following settings for Apache2 and mod_python (with special thanks to #django and the Django on OSX installation guide):
      <location /admin/>
              SetHandler mod_python
              PythonHandler django.core.handler
              PythonPath sys.path+['/home/mcroydon/django']
              SetEnv DJANGO_SETTINGS_MODULE proj.settings.admin
              PythonDebug On
      </location>

      The PythonPath to the directory containing your project is again quite critical. This is where the test collision will show up if you’ve been foolish enough to name your project test. Make sure that DJANGO_SETTINGS_MODULE points to your project. This worked perfectly for me under Ubuntu Hoary, but YMMV. PythonDebug On is your friend here and turns a plain jane 500 error into a traceback.

    Gotchas like these are going to have to be minimized in order to not scare away newbies and also enable that “running start” feeling that you get with Rails. I’m sure that a few of these are mitigated by setup.py in the tarball and the rest should be made a lot easier once WSGI support is added (and I’m glad to hear that adding a built-in server is on the list somewhere) should take care of the rest.

    I do have to say that so far (gotchas aside) I’m really impressed with the platform. It’s great to be able to work with the Python interpreter to flush out some test data (you can do similar things with the Ruby interpreter with Rails, but Python is my native language). I also got warm fuzzies when someone asked if there was a mail module for Django. Heck, Python has an awesome standard library, why not use it?

    Thanks again to everyone in #django on Freenode for all the help and guidance. Now it’s time to get back to that login gotcha.

    Note: Django is a moving target right now. Since I wrote this early this morning, support for a standalone server has been added (just after WSGI support was added) and lots of little bugs and niggles are being taken care of as I type.

  • Django: Python on Rails?

    Let the buzz over Django begin. I first saw it fly by very early this morning as Clint Ecker pointed to some documentation. Simon Willison has given it a proper introduction this morning.

    I definitely need to take a close look at Django if it can approach the productivity of Rails while speaking my native Python. I could be missing something, but I think one very important thing that Django needs in order to have that running start in development productivity is to ship with a small HTTP server available by default. Rails uses WEBrick for this and allows development without the need to mess with Apache or lighttpd in order to start coding. It should be trivial to add similar functionality to Django (with CGIHTTPServer and all).

    I don’t mean to rag on the new framework on the block. I think Django has a ton of potential. It’s off to the right start, having been extracted from a working environment being worked on by some really smart people.

    We’ll see how this turns out, but I’m extremely excited.

  • OPEN-XCHANGE, Finally!

    Open-Xchange, Finally!

    I can’t tell you how many hours I’ve put in to getting to this screenshot, which if you can’t tell means that I have a working OPEN-XCHANGE installation. Just after OX was released as open source I repeatedly tried to install it without success. The install instructions always seemed to be slightly out of sync with reality and I usually got about 3/4 of the way through but died horribly during slapd or OX.

    Starting last night just before bed and finishing this evening when I had free time, I followed these excellent instructions (login required) to install OX on a fresh Sarge install. I’d like to thank Murphy and everyone who provided him input, including Laurent Francoise, who got me so close so many times.

  • Killer Mobile Interfaces with Python and Maemo?

    Thanks to INdT‘s hard work, Python as well as PyGame are available for Maemo and the 770. This got me thinking about how cool it would be to use PyGame on Maemo to develop simple (but really good looking) apps with that “video game menu” feel to it. Killer apps like MythTV Freevo have proven that you can use PyGame to create killer interfaces.

    I’m going to put this somewhere on my long list of things to do in my spare time, but it would rock if someone ran with this. What do you think?

  • Maemoizing X-Chat

    Someone has been busy Maemoizing X-Chat. I was able to get a vanilla build of XChat running on Maemo but text input was a bit tricky. With a little tweaking it should be a great IRC app for the 770. While I still haven’t gotten around to applying the patches to Gaim mentioned on maemo.org, that should also be a viable option for IRC as well as AIM, MSN, Jabber, and others.

  • Best. DRM. Evar!

    Rails Book non-DRM

    Okay, I lied. The best DRM isn’t DRM at all. I’m not a huge fan of DRM because it always seems to get in the way when you’re trying to use something that you’ve bought in a way that you think is appropriate. No, the best DRM in the world just makes sure you don’t redistribute the stuff you’ve bought, or makes sure you can get in trouble if you do.

    The above screenshot is from the PDF version of the upcoming Agile Web Development with Rails book. They have these PDF-aware gerbils at The Pragmatic Programmer that generate (and regenerate upon request when a new version is out) PDFs on the fly, with your name on the bottom of each page.

    Having your name plastered all over the place is one sure way to discourage sharing it with friends or on file sharing networks. Imagine what would happen if the publisher found out htat you’re the guy responsible for the book ending up on BitTorrent?

    Granted, this method isn’t foolproof, and I’m sure that if you really wanted to you could figure out a way to remove your name from the PDF. The exact same thing can be said for the vast majority of DRM out there though, if you really want to get around it. I’m very glad that I can just use the stuff I paid for without having to deal with DRM silliness.

    My hat is off to the publisher and authors of this awesome book for “getting it.” In related news, the book rocks. It’s definitely worth having if you’re using or thinking about using Rails.

  • Maemo Subversion Repository

    Good news from the Maemo developer’s list coming not long after the announcement of the official Maemo Wiki:

    Hi all,

    Starting from now, a subversion repository is available for everyone at:

    https://stage.maemo.org/svn/maemo

    login: guest

    password: guest

    Currently just a few packages were imported, but expect all the others
    to pop up in the coming days/weeks. Bleeding edge development and latest
    bug fixes will happen there.

    Stay in tune!

    luc

    This should make tracking the bleeding edge just that little bit easier. Thanks again to everyone at the Maemo team for all of their hard work.

  • In Defense of the 770

    Nancy Gohring was able to get her hands on a Nokia 770 prototype the other day at a press event in Helsinki. She posted a review on Mobile Pipeline and cross posted a shorter review on Wi-Fi Network News. Every postitive thing she said about the device hinted at the fact that she hated it because it was dog slow. One must remember that the processor behind the 770 is a 220MHz ARM, and that a 220MHz arm just isn’t a 2GHz Pentium 4. Having said that, I’m pretty sure that the final device will be a bit zippier than the one she played with. I’m also pretty sure that the boot time will be resolved on the final device and will be quick enough.

    I also think that a 800×480 high resolution screen in a device that size is quite an accomplishment and shouldn’t be overlooked. It’s not a 15 inch LCD, but it’s also extremely portable. While the operating system won’t officially include VoIP and instant messaging until the Internet Tablet 2006 update, there is a tutorial on porting Gaim to Maemo on the website, and I know of several people working on VoIP, SIP, and other communications programs for the platform. Silky, a secure internet chat client, has already been ported to Maemo, the development environment for devices like the 770. My guess is that there will be a handful of communications programs available for the 770 at launch time.

    While the press junket might be the first time members of the press have been able to play with a Nokia 770, it has been shown (and I believe demoed) at the Linux World Summit in New York and Guadec 6 in Stuttgart.

    In conclusion, I think there’s a ton of potential in this device. While the 770 is never going to be a fullsize notebook in terms of performance, I’m pretty sure that the speed and responsiveness will be better on the final device than the one Nancy was able to play with. There are a lot of people around the world working very hard to make sure that the Nokia 770 and the platform it is built on are as solid and fast as can be. I’m definitely looking forward to purchasing my developer device as soon as it’s available and testing a bunch of apps on the device.

  • Linux Device Drivers, 3rd Edition

    You can find a copy of Linux Device Drivers, 3rd Edition on LWN. The work, current to Linux 2.6.10, is licensed under a Creative Commons Attribution-ShareAlike license. While it’s available for free, if you really dig it, grab a physical copy published by O’Reilly to support the authors and forward-thinking publisher.

    I’m definitely not a hardcore kernel hacker, but it’s great to have this resource available in a form that I can graze on if I wanted to get my feet wet. Thanks so much to Thoron on #maemo for pointing this out.

  • WebCore for Series 60

    Dave Hyatt cites a Nokia Press release stating that they’re going to bring WebCore to Series 60. WebCore is the rendering technology behind Apple’s browser, Safari. WebCore is based on the KHTML rendering engine used in Konqurer in KDE.

    It will be interesting to see if Nokia have based WebCore for Series 60 on GTK+ WebCore, a port of WebCore using GTK+.

    Regardless of how this shakes out, I think it’s a great move by Nokia and a definite win for the open source community.

  • Whoppix: Knoppix for H4x0rs

    Whoppix is a Knoppix-based (which is in turn Debian-based) Live-CD with lots of, um, “penetration testing” tools included. It’s a heavier weight distro with a lot more tools than PHLAK, but what really amazed me was that my Linksys WPC11 worked just fine with Whoppix. I currently use my internal Broadcomm wireless with NDISWrapper, but I’ve been trying off and on to get the PCMCIA card working so that I have options.

    I’m a hardcore Gnome guy as of late, thanks to the wonders of Ubuntu, which does an amazing job of putting a lot of stuff in the “just works” category while getting out of my way. It had been awhile since I had taken a look at KDE, and I’ve got to say that the latest release looks good, though I’m still going to stick with utilitarianism over candy coated widgets.

    I will probably use my experience with Whoppix to motivate me to try the latest kernel to see it I can get my WPC11 working with my HP ze4430us laptop under Ubuntu. Currently my WPC11 is like a magic key that brings my system to a complete halt when I plug it in. I will definitely be keeping a copy of Whoppix in my bag though, as it has tons of great tools that can be very useful when doing penetration testing of in-house stuff.