Browsed by
Category: Cool Applications

Applications, usually for Mac OS X, that I think are useful.

Ride History Mashup

Ride History Mashup

Below are some mashups showing the frequency density of where I have ridden my bikes in the last three years. (I never use my GPS on the track, so velodrome riding is not represented here. And besides, that isn’t very interesting.) The circles on the maps represent a place I have passed through, and the color how many times. Red means many, perhaps as many as 5000 times for the area near my apartment, and blue means few, as few as once. That 5000 doesn’t mean I’ve done 5000 rides, it means that there are 5000 GPS waypoints in the 100 meter radius circle around that particular point. As waypoints are recorded closer than 100m apart, the same ride could have multiple waypoints inside each circle. Also note that the circles on the map are much larger than 100m.

Click on each for a larger view.

Update: 19 April 2009 I made a Google Earth KMZ file containing all the points. If you open it, be patient as it will take a bit of time to load. Download it here.

I think I’m planning on posting the code here and at the forums on Motionbased, as I think other people might like this fun bit of code. But I want to clean it up a bit before I make it public.

OpenMP

OpenMP

I’m all about graphs lately…

The graph above shows the speedup that a few OpenMP statements can give with very little effort. OpenMP is a simple way to parallelize a C/C++ program which allows you to run a program on many processors at once. However, unlike MPI which can run on many different machines (like a cluster), OpenMP can only be run on one computer at a time. Since most new machines have multiple processors (or cores), OpenMP is quite useful.

I’ve added a couple dozen OpenMP statements to the code I’m working on. The blue line shows how long (in seconds) it took me to run a test problem on between one and 32 processors. The green line shows the speedup compared to running on a single processor as a ratio of time. It is very typical of parallel programs that the speedup isn’t linear and flattens out at high thread count. This small test problem deviates at 16 processors; when I do a real run (which will be much larger and the parallelization more efficient) I may see nearly linear speedups all the way to 32 processors.

I think it’s pretty neat how with very little effort I was able to significantly speedup my code. If you have a little programming experience, you can take a look at some simple OpenMP examples and see for yourself just how easy OpenMP is.

[W]hack a Phone

[W]hack a Phone

Motorola E815

I’ve had my Motorola E815 phone for about a year. It has bluetooth, a camera, and other cool features, like many modern phones. Bluetooth enables you to transfer photos, movies and ringtones on and off a phone. All these things seem like a useful feature set for a phone. However, Verizon, the carrier for my current phone, disabled a number of bluetooth features, such as file transfer.

Why would Verizon intentionally cripple a phone? Money, of course. Turning off the file transfer abilities of a phone means that if I want to get the photos I take using my phone onto my personal computer, I need to use their not free services. Also, if I want to get a new ringtone, I need to pay for them (often over a buck for 30 seconds of music!), instead of uploading a simple, free, MIDI I found on the internet.

Ever since I got my phone, I’ve been aware that it is easily hacked to allow all bluetooth function, but it required a special USB cable. I never got around to buying the $10 cable, and hacking the phone, until now.

12-17-05_1325

The camera actually takes farily decent photos in a wide range of light conditions considering it’s just a pinhole lens. It also takes short movies, with sound. I can also upload MIDI sound files, or even MP3s, and make them my ringtone. I’ve always wanted to pull out my camera phone whenever I saw something cool, but never bothered because I couldn’t get them off the camera for free. Now that I can, I’ll be more willing to snap a pic of whatever.

09-28-06_1842

Intel MacBook, Parallels & Garmin GPS

Intel MacBook, Parallels & Garmin GPS

MacBook

Just a few days ago, I replaced my four year old white 500 Mhz G3 iBook with a shiny widescreen white 1.83 Ghz Intel Core Duo MacBook (the black one seemed altogether silly to spend extra money on). The laptop is a very nice machine. My home machine is a 20″ iMac G5 with a widescreen, and I’ve gotten used to the extra real estate, so I like the fact that the MacBook has one too. Really, the main reason I bought it is because my iBook had decayed to the point that it was only good for websurfing. I wanted a machine I could use at school, and the iBook just couldn’t cut it (I definitely tried to make the iBook work!).

Since Apple is switching to Intel chips, the world of Windows is now available using either Boot Camp or Parallels. I have a copy of Windows 2000, and since I believe that Boot Camp only works with Windows XP, I am not going to try that out. Also, Boot Camp makes your machine dual-boot, which means only one OS at a time and no interaction between the two. Parallels is the more attractive option, it allows you to run Windows along with Mac OS X. The Windows world lives inside of an application that runs on Mac OS X. Choosing to interact with Windows is no more difficult that switching applications. Also, Parallels works with basically any Intel-compatible operating system, so I could use my Win2000 install disk.

After much trial and tribulation (mainly related to the fact that my Win2000 is an upgrade version, not full install) I got Win2000 installed using Parallels on my MacBook. After installing the myriad of security updates, I installed the softwares for my Garmin Forerunner 301. You see, Garmin (right now) only makes software for their gadgets for Windows. They’ve promised to make a Mac OS X verison of the software I use by Spring 2006 (they have two and a half weeks). Obviously, waiting around for that to be relased will just waste my time, so I was hoping that I could use this whole setup to run the Windows software on my MacBook to talk to my GPS. However, sadly, it doesn’t work. It’s clear it almost works, since Win2000 notices when I plug in the GPS, but the Garmin stuff can’t quite talk to the GPS. The situation seems exactly the same as when I tried using Virtual PC on my G5 over a year ago.

All in all, I like the laptop, I like Parallels, and I’m displeased with Garmin. I’m using a beta 30-day activation key with Parallels, and I’m unsure if I’ll buy the full version ($40 for pre-ordering). I really try to stay away from Windows applications. Right now the only app I do want to run is the Garmin stuff, and it doesn’t look like that’s going to work.

Google Map Routes

Google Map Routes

If you’re one of my legion of rabid fans of everything I do, you’ve already noticed by now the improvements I’ve made over at UCSDCycling.org. For the rest of you, here’s an overview.

Ever since I saw the Google mapified routes for the Tour of California (here’s an example), I’ve wanted to do the same thing on the UCSD Cycling routes page.

I recently stumbled across GPS Visualizer.com. It’s an amazing website full of all kinds of GPS tools. The one I found to be useful was the Google map tool. It can take all kinds of GPS data files, and it outputs the route superimposed on a draggable Google map. Since I use a Garmin Forerunner 301, I can use the GPS data to make a Google map route.

There are two ways I can go about this:

  • Upload my data to Motionbased.com, which then allows me to download the route as either a KML or GPX file. I then give that to GPS Visualizer.
  • Use LoadMyTracks to download the data off my GPS to my iMac, and then (after some parsing) upload that file to GPS Visualizer.

So far I’ve only done a few of the routes, but here are some examples. So for all you fans of me out there in cyberspace, keep checking back for new Google map cycling routes!

Sim City 4

Sim City 4

About a month ago I received my iPod settlement gift certificate worth $50. The money was only good at the Apple store. As you can find out for yourself, there’s not much for $50 on the Apple store, save for a few iPod accessories. I didn’t really want any iPod accessories, and besides, most wouldn’t fit my second generation iPod. Of course Apple was hoping that I’d just go ahead and use the $50 as an excuse to by a quad-G5 desktop system for $3,300 (make that $3,250).

Sim City 4

Full Size View

Look for the one-way streets, wide boulevards, and train tracks.

Above the iPod accessories, the lowest price items are software titles. I browsed through them and discovered that there was a Mac OS X version of Sim City 4. I’ve always liked the Sim City series, starting with the orginal Sim City, which you can play online for free. I like the planning of a citys infrastructure. As the ‘mayor’ of the city, the player has to lay roads, freeways, railways, subways, power lines and water pipes. The mayor has to also balance a budget of expedatures and taxes (more on that later). The goal of the game can be as simple as building the largest city possible, or the most asthetically pleasing, or one with the ‘happiest’ residents, or one with the best finances. My goal has usually been to have a high population combined with a happy population.

Sim City 4

Full Size View

Look for the railroad crossing guards, various species of trees and the accurate railroad “Y”.

The newest version has many improvements over the previous versions, Sim City 2000 and Sim City 3000. For one, this version supports regions, whereby you can build dozens of cities that are neighbors on one big map. Each city is independent in that you can only edit one at a time, but cities influence neighbors by way of jobs & trade. One of the biggest improvements has been in the graphics. This new game has beautiful graphics with very high level of detail. There are something like six levels of zoom. The closest one is so close you can see individual ‘sims’ (people) on the streets (look for them on the above image of the train station).

See if you can find the county fair & golf course

One of the keys to a well-functioning city is the transportation system. Sims are very touchy about how long it takes to drive to their job. Sim City 4 introduces a very useful tool that allows you to see what kind of traffic goes where through your transportation system. In the picture linked on the right, you can see all the commute traffic that goes through a train station in the center of town (in the lower-left of the picture). You can trace foot traffic onto a passenger train, which gets off at a different station and walks to a jobsite.

I must admit that one key element of Sim City, collecting taxes and balancing a budget, I’ve never really liked. I either cheat to get the cash to run the town, or find some other way to make money, like building a magic building found on the internet. I’m no libertarian – I just don’t really care too much about the fiscal part of the game. If I were really going to play the game for real, I would not cheat. But I don’t want to play it for real, so I feel no guilt.

One nice thing about this game is there is no death & violence, no princess to save, and I can stop the game at any time without losing my progress.

Photo Mosaics

Photo Mosaics

Lately I’ve been playing with a cool Mac OS X application called MacOSaiX. You give the application a photograph and a collection of photos, and it recreates the main photo using small photo tiles from the collection. The effect is at least somewhat artistic, and definitely cool.

Here’s one I made using pretty much every photo I’ve ever taken. It’s of me at Collegiate Track Nationals, 2005, during the points race qualifying race. I think it came out pretty good, except for the white barrier in the background, which is kind of dirty in the mosaic because I have taken very few photos of only white things.

DSCN3141

NatsPointsRaceMosaic

The program can also scour Google Images for photos, using search terms I provide. Pictured below is Chris Nekarda (closest to the camera), Tona Rodriguez-Nikl (with the red jersey), Tyler Ofstad (on the right) and me riding a few warm-up laps. For this mosaic, I put in a few dozen cycling-related search terms, netting over 30,000 images returned. Not all the photos are cycling-related, which is the main problem using Google Images, but at least no porn snuck into the mosaic. I think this one has a more artistic quality than the one above, especially in the red jersey that Tona’s wearing. I think this is due to the larger library of photos searched and the wider variety of photos – I tend to take my photos in one way and of similar things.

4UCSD_Guys-mosaic

KONICA MINOLTA DIGITAL CAMERA

A third mode of the program is ‘Glyph’ mode, whereby instead of photos, glyphs are made at random and fit to the photo. I also chose the hexagon mode, rather than the rectangle mode of the above two mosaics. The program chooses two colors at random, and also a random character from a random font on my computer. It makes one color the background of the glyph, and the character the other color in the foreground. This technique provides a nearly limitless number of glyphs – I esitmate nearly 1019 different glyphs are possible. This is not neccessarily a good thing – the program will pick color combinations that do not exist in nature, and it will throw out that glyph. The photo below ran for about 200,000 glyphs, and I would argue that it doesn’t have the same level of detail replicated as the photo-based mosaics. This could partly be because I used an older version of MacOSaiX which could have poorer matching algorithms, or a result of the limited complexity and too big color space of glyphs. Of course, to make the best comparison I need to make a mosaic of the same photo using Glyphs and photos with the same version of the program.

126_2637_IMG

Melissa

I have some quibbles about the program. First off, it’s not a team player. It’s a serious resource hog and the computer is almost unusable for other tasks while it’s running. This means if I want to run it I’ve got to leave my computer alone for several hours. iDVD, for instance, will happily encode a DVD in the background while I use the computer for other things, and I would argue that that is no less computationally intenstive. Also, I wish I could go to a particular grid square and tell the application that I don’t like the image it put there, and it would put the second best image from the library in that square. The user can place images by hand on the mosaic, but I’m not nearly as skilled at photo matching as the computer. What I am better at is having an opinion whether or not that photo is good for the mosaic.