Posts

Showing posts with the label Java

Perl, Java, Ruby

Well, I realized the Pine Flat Road Race was tomorrow (Sunday) not today (Saturday) and so, had I rested today, I probably could have gone. Ah, well. I have a rule that I need to do a hard group ride before I even think about racing, and I haven't yet done so this year, or even towards the end of last year. No, the Friday Noon Ride is not a "hard group ride".... nor is Wednesday. Only Tue and Thu come close to qualifying. So it probably wouldn't have been prudent trying to mix it up at Pine Flat, anyway. But on the positive side, that's 6-7 hours I will not be spending in a car, and more time I won't spend in a smelly motel room, more time to devote to my coding project. On Facebook, it was recommended I look at Ruby. This was an obvious thing to do, since it is what Strava uses for its API example . However, I had gravitated towards Java because with Java I knew I could generate an Android app. All it takes is a bit of Googling to note that Android a...

mired in Java

So, while this weekend was largely consumed with The MegaMonster Enduro , my quest to become a Java master continues. The Megamonster went okay. It's a long trip down to Paicines: I am in Howard's debt for the ride. And since I have the Low-Key "stuff", it made for a full car. I didn't really help much while there: this year I rode. I did the 100-miler for the first time in 3 years, the preceding two not having the fitness for it. I felt fairly good, but I was slow, taking 5:35 for the course. It's not easy: wind, hills, and this year light rain. I don't think the rain was much of a factor but the wind always is. Anyway, the big deal is doing the results after. I always have a hard time with Megamonster results: for each rider we have three checkpoint times, a start time, and a finish time. I'm prone to making typos, and my scoring scripts only get used once per year, so it's never as smooth as I want. I think things are in fairly good ...

implementing StravaToCsv in Java

In an earlier post I wrote how I put together a "Strava_to_CSV" code using Perl in maybe half an hour. It was pretty easy once I'd installed the Perl JSON libary. But my goal here is Java, not Perl, so I decided to try to write a similar code in Java. Well, I did it, but it took a lot longer than a half an hour (maybe 5 hours total) and it's a lot longer. Of course, I know Perl fairly well, while Java I'm trying to learn, so the time is an unfair comparison. Still, in the Java there's stuff to look after. I won't share the full code here, but will summarize the key points. First, to get the data from Strava, I once again used their "streams" method from version 1 of the API: System.err.println("processing Strava activity # " + stravaToCsv.activities[n]); String urlString = "http://app.strava.com/api/v1/streams/" + stravaToCsv.activities[n]; System.err.println("accessing ride data via URL = " + urlString); j...

update on Java coding project

Image
While it seems at times my early progress on my Android/Strava app project has stagnated, really I've gotten a decent amount done. On the computer side, I had to upgrade the Ubuntu on my Thinkpad T60 from 9.10 to 11.10 to allow for the installation of current packages. This was inhibited by an inability to access my CD drive, but a bit of isopropyl alcohol blown off with a blast of dry compressed air (borrowed from the tech support at work... shh!) on the sensitive bits seemed to fix that. As with my previous Ubuntu upgrade, I lost a lot of packages in the shuffle, even things as fundamental as emacs, but as these omissions are encountered I reinstall them. Things are basically up and running now. Second, I gave in and ordered a Mac Air. The Thinkpad is in a fairly sorry state at this point, and I really think the Mac will provide a better machine for my needs. I'll get that in another week. Then education: The Oracle (formerly Sun) Java Tutorial is quite good. I admi...

writing my Strava app: part 1

The first step in writing my Strava app was to make a note of exactly what I wanted it to do. Well, perhaps not exactly: I don't know the capabilities yet of the Strava API. In particular, does the Strava API allow you to replace the data on a ride? Apparently it does, since StravaHaHa allows modification of ride data. Honestly I don't know where the API is documented, but I am deferring that until later. No rush. So then when I knew what I wanted the program to do, I set out to design some pages. So I measured the screen on my HTC Incredible phone and found it was 5 cm wide by 8 cm high. So I set up an image file using GIMP with 500 pixels wide by 800 pixels high, and for each screen, began "sketching out" how I wanted the page to look. It's different assembling a page from a widget tool kit, so details aren't critical here: I just the look and feel of each page. When I got tired of doing that, and I was on-line, I started downloading some of the s...