Impromptu Rides

Feb 28, 2012 in Technology

wpid-impromptu-2012-02-28-10-13.png

Yesterday Cindy and I pushed out the new version of the Day Rides Center web site, now renamed to Impromptu Rides.

This site supports our cycling club’s program for scheduling ad-hoc bike rides. While the club (Rochester Bicycling Club) has a yearly formal schedule of rides, that schedule is put together with a workweek in mind: mostly rides in the weekend and the evening weekday hours once daylight savings starts. But many club members and other local cyclists have time during the week during the day. And so an initiative came about to help coordinate interested riders to suggest, find and join in on rides outside the regular schedule. At first this was an email send-around effort. Then last winter Cindy asked if I could help make a web site to make this easier. My answer: “Sure!”

It was a great excuse to tinker with a few technologies I have wanted to play with and learn but didn’t have a “real world”-enough project to try them out on. These were GWT (Google Web Toolkit) and GAE (Google App Engine). GWT allows one to write the browser portion in Java. GWT compiles the Java source code to Javascript and takes care of the differences between the various browsers. GAE is Google’s cloud computing platform and so that is hosting the backend of the site. GAE is what GWT is to Javascript: I can just write Java without having to worry much, or know much, about server-side computing and Java EE at all.

We launched the first version last March and then during the year added some features, fixed bugs and so on. We used this winter – not many people riding bikes – to redesign the layout, add a bunch new features and I took the opportunity to re-implement a good portion. The latter is the usual software engineering happenstance: I learned a lot about the two technologies during the year and so found better ways to do certain things, the bolting on of new features made some parts a little bloated, and to make doing some of the new things easier it required some rewriting as well.

The backend also gained a new front end client this winter: the Club Rides iOS app now plugs in too to show both the regular ride schedule and the impromptu rides. The ease of doing this shows a benefit of both App Engine and GWT: it’s all just a REST API and so the front end and the back end are nicely decoupled.

This winter I focused on getting feature parity between Impromptu Rides and the Club Rides app. The Club Rides app grabs the RSS feed from the RBC web site to display recent club news. The new version also uses a Google service to grab the weather forecast. This content is also returned as XML. Working with XML, and in general any content over an http connection, is really easy to do in Objective-C. It has always amazed me how hard, comparatively, this is in Java. The built-in parsers are memory hungry and it takes a lot of code to get the content from the http connection and then parse it. For Objective-C there’s a really nice, fast, small open source library to parse XML: TBXML. Delighted I was to discover that Julien Foltz ported it to Java!

Now, all that is needed to ingest the RSS feed is:

try {
    URL url = new URL(http://rbcbike.wordpress.com/feed/);
    TBXML doc = new TBXML(url);
    if (doc != null) {
        TBXMLElement root = doc.rootXMLElement();
        TBXMLElement channel = doc.childElement(“channel”, root);
        TBXMLElement element = doc.childElement(“item”, channel);
        ArrayList> result = new ArrayList>();
        while (element != null) {
            TBXMLElement temp = doc.childElement(“title”, element);
            […snip…]
            result.add(entry);
            element = doc.nextSibling(“item”, element);
        }
        return result;
    }
} catch (Exception e) {
     this.sendEmailReport(“AdminServiceImpl:getClubNews”, e.toString());
}

The browser’s security framework does not allow the opening of URL connections – GWT doesn’t therefore implement java.net.URL – so the above code runs on the server. The client makes a Java RPC call to the server requesting the feed, the server grabs it, parses it and passes it back as a hashmap array to the browser.

Impromptu Rides tries to determine whether it’s being viewed on a computer, a tablet or a phone. In case of the latter it displays a simpler version of the app: just the Find Rides portion. This involves interpreting the user.agent values that the browser reports. Messy stuff. The Android devices, or rather their manufacturers, could be a little nicer and more forthcoming about what category of device they are. In the end I chose to distinguish between “Safari” and “Mobile Safari” which seems to work to draw the line between computers and tablets on one side and phones (and iPods) on the other. At least for iOS and Android devices. I don’t know how Blackberry or other non-Android devices present themselves. The Impromptu Rides site also knows about the regular RBC schedule and so together with the mobile device support this saves me needing to do an Android version of the Club Rides app.

As you can see from the code snippet the server-side code sends me an email when something is amiss. I quite like that. I can leave the application running by itself without needing to keep an eye. When something unexpected happens it sends me a little email.

When I started playing with GWT last year, I had to smile. When Google first released GWT I was working at Sun. We, JavaSoft, were not amused. This was not Java. What Google did was Wrong and Bad, how dare they! Now, as a software developer I find GWT great. Google directly addressed a developer need and a niche in the available tools at that time: writing in a well-known high-level language, no need to learn Javascript, shielded from (most) browser-specific stuff, zero administration and no plug-ins required.

A quick summary of the new features:

–        Elevation profiles for most, known, routes

–        Weather forecast for the starting location

–        Recent club news

–        When scheduling a ride, include a link to MapMyRide, BikeToaster, etc for Garmin Edge bike computers

–        “Remember me” for ride leaders and admin

–        Adjusted layout for iPhones and Android phones

–        and an About page which explains what Impromptu Rides are actually about!

So, have a play with it and join us on some of our rides!

Around the Public Market

Feb 26, 2012 in Photography

wpid-Tracks2-2012-02-26-11-02.jpgIn the eight years or so that I’ve been here I still have to visit the Public Market. Yesterday’s photo excursion doesn’t count as I was there mid-afternoon and so too late for the market although there were still a few vendors going strong. Instead the focus of the trip were the buildings and train tracks in that area. Combined with the strong winds and the drifting snow I was hoping that it would lend itself to photos with some character. Whether I succeeded you can assess for yourself in the gallery.

These photos were edited on my iPad with Snapseed. I am falling love with that app! Nik Software now also released a Mac OS version of the app.

To pick up from the previous blog entry, I found a new home to display the photos. As mentioned, Apple is discontinuing the MobileME Gallery and so I was pondering what to do. I do post on Flickr as well which is nice for getting comments and ratings on my work but I don’t really like the display options there – it is very cluttered. After some searching and browsing I came upon smugmug.com. It has similarly nice presentation options as MobileME has (or had), it integrates with Aperture, it looks nice on iPads as well. So, onno.smugmug.com will be new photographic home. Let me know what you think?

Yesterday and Friday evening were also productive times for another hobby: the web site for the Day Rides program, now renamed to Impromptu Rides: impromptu.onno.com. In two or three days time we will launch the new version I’ve been working on for a few weeks. And I made good progress on the Club Rides app for the ’12 season as well! I should be submitting the update to Apple today or tomorrow – a few loose ends still to tie up.

Club Rides 2011

Mar 08, 2011 in Cycling, Technology

wpid-clubrides-iPad1-2011-03-8-10-18.pngThe new version of my bike ride scheduling iPhone app, Club Rides, is up in the iTunes App Store.

It has native support for both iPhone and iPad. In addition to the new schedule for 2011 there are several other enhancements:
– Faster launch time
– Displays the club’s RSS feed for club news
– Share your favorite rides via email (facebook and twitter to come in an update)
– Send the rides you plan to do directly to your calendar
– Tap the ride leader’s phone number to call

To enable posting your rides to the calendar on your device, tap the Settings icon in the top right corner of the screen and select which calendar you want to use.

On iPhone to show a map with the starting location of the ride, tap the starting location in the ride view.

Club Rides comes preloaded with Rochester Bicycling Club’s schedule. It supports other clubs, like Northern California’s Western Wheelers, as well. And it can support your club by using the customization guide. If you like to make Club Rides applicable to your cycling or hiking club then I would be happy to assist you.

(this post is a little late – couldn’t log in for days – called in my host’s customer support and lunarpages came through with flying colors – thanks guys!)

stretch mark removal products
Спорт-как способ похудеть ссылка сайт кремлёвской диеты женские сайты диеты как быстро похудеть и накочать мускулы как можно быстро похудеть без проблем рисовая диета для похудения как быстро похудеть, рецепты похудения как похудеть быстро без дееты за 14 дней срочно похудеть с помошью салона красоты в казани как быстро похудеть народные рецепты как похудеть быстро и не мучить себя голодом диеты для снижения веса сайт девчат быстро похудеть на 30 килограмм срочно похудеть на 5 кг. за 10 дней алан кар легкий способ похудеть скачать бесплатно как быстро и безвредно похудеть? как похудеть быстро за месяц 10кг спомощю воды диетхудеем быстро без с упражнениями отзывы средства для похудения хочу быстро легко похудеть быстрый способ похудеть aллен кaрр срочно похудеть за три дня три колограмма быстро похудеть без лекарств худеем быстро после родов ка быстро похудеть делая клизмы сайт диета доктора аткинса легкий способ похудеть от алена карра диета для похудения из куриного мяса танец живота как способ похудеть индивидуальная диета тест худоба ру легкий способ похудеть