Tuesday, May 29, 2012

ssdownloader

I recently purchased some electronic media from Simon & Schuster.

Apparently the technology guys at Simon & Schuster believe in "Java Over Functionality." Unlike most companies that sell DRM-free digital media, I was not given a link to download zip file containing the contents of my purchase.

Instead, I was given a JNLP file, which is nothing more than an XML file. A little Googling revealed that these files should be openable by javaws, a Java Web Starter application. After getting the file to successfully run, I was greeted with a custom download manager. This is great because why offer a simple download that will be managed with my browser's download manager when I can have some half-rate, custom download manager to fudge things up?

So the download manager asked me where I would like to save the file, downloaded each file individually for about twenty minutes, and then told me it was done. There was a big problem, my files where not in the location I specified. In fact, a hard drive search revealed they didn't exist anywhere on my machine.

I tried again, no dice.

So, if Mother Necessity if the driver of invention, then welcome her new baby, ssdownloader. I wrote this Python app up in a little over an hour. It was a good chance to strengthen my weak command of Python, and to actually get the stuff I paid for.

It simply parses the JNLP file to find the other XML file that defines where the actual downloads are. It then loops through that file, grabbing each file and saving it locally. If anyone out there gets frustrated trying to make good on their Simon & Schuster purchases, feel free to use this to make your life happy.

Tuesday, May 1, 2012

500-Mile May

This month I'm going to try to really push myself physically and travel 500-hundred miles on foot or bicycle. To accomplish this goal I will need to travel an average of 16.13 miles per day.

A bicycle ride to work gets me 10 miles each way, giving me a potential 20 mile each workday. Except, on Fridays I go to Bread and Roses after work, which is a 6 mile ride. This gives me 19 non-Friday weekdays, and 4 Fridays, so 19 * 20 + 4 * 16 = 444 miles on bicycle.

That gives me only 56 miles to find elsewhere. In my one-hour lunch-break I can fit a 2-mile walk or a 4-mile run. In practice, presently, I can only run about 2 miles. With 23 work-days, that comes out to 46.  444 + 46 = 490 miles. Now I've only got 10 miles left to make up. This can be done over the weekend, or by walking the dogs after work.

As always, a big factor here is the reality of life. Last weekend Kim came down with a surprise case of appendicitis. That has put the task of transporting the kids before and after work on me for now. So today, the first day of my challenge, I did not ride to work and will not be riding home. I did get a 2.17 mile run in, but that's a far cry from the 16.13 miles I need each day, and not a good start.

I've also got a conference with Athena's teacher on May 8th, so I will not be riding to work that day, but can still ride home. May 10th I will be participating in Aurora's field trip to Saint Augustine. The walking may make up some of those miles though.

I can only assume other life-events will show up, and will have to take them as they come. As strange as it may seem, I don't believe I will actually be able to make my goal. However, I'm going to give it my all and see how it goes.

I will be keeping my activities updated at http://www.google.com/fusiontables/DataSource?snapid=S478383Gdyj

You can also see all of my recorded activities on Runkeeper at http://runkeeper.com/user/maxolasersquad/activity/


Monday, April 16, 2012

GPS navigation with Osmand+



On Friday I went down to Deland, Fl to get my grandfather who was on a fishing trip down there.

When I was first asked about going down there to get him I viewed the map in OpenStreetMap and made some corrections to the fish camp he was staying at there, and made all the appropriate tags.

In the past I have tried to use Osmand+ to route me places and have found it to be all but useless for getting directions.  Since I didn't have any time frame I needed to make it down there I decided I would try the latest version to see how it would perform.

Everything seemed to go very smoothly, thought I am very sure that the route it took me was not the best.  It had me get off after Gainseville, drive east of town, and then head South.  I took its advice since I like taking back-roads when I'm not pressed for time.

About two miles from my destination it tried to take me down a road that ran into a private government area that was blocked off by a fence.  I tried Google Maps and it was doing the exact same thing.

I drove just a few hundred feet past that wrong turn and it rerouted me the correct way.
At my destination I fixed the OSM mapping and filed a bug with Google Maps.  I also walked around the fish camp and made updates based off of observations that could not be easily made from satellite imagery.

I was very happy with the capabilities of Osmand's offline routing mode.  The most recent version of the offline maps for Florida did not have the fixes I had made for the fish camp the previous week, but that was alright as prioprietary maps can take years to have updates and receiving the updates can be costly.


Monday, March 26, 2012

Beginning NE Tallahassee

I have reviewed and/or mapped, in Tallahassee, all roads east of Monroe Street, North & West of Capital Circle Southeast, and south of Tennessee Street. Last weekend I began moving north of Tennessee Street, where I will focus on everything South and West of Capital Circle, and East of Monroe Street.

My ultimate goal is to have all streets within the Capital Circle cup and South of the Interstate reviewed and mapped. The idea is that within Tallahassee, the maps should by 99.999% reliable. Once this area has been mapped I'll begin seriously moving outside of that circle and getting areas like Buck Head and Killearn. I will also begin an attempt at getting all buildings and POIs marked within the circle.

I've added some building and businesses in areas I frequent, such as around Apalachee Parkway.

Tuesday, January 10, 2012

Copy and paste from the system clipboard with vim

Often, when using vim, highlighting text in the terminal to copy-and-paste it around is plausible.  This is definitely true when on a true terminal.  I use the rnu option so that I have relative line numbers on each line.  So copying multiple lines with the mouse grabs the line number with unwanted indentation.  When I need to move code around it is annoying to have to manually remove the numbers.

To understand how to get vim's clipboard to match your system's you need to understand vim registers.  On a computer we usually only get one clipboard.  Every time we ctrl-c, the contents of the clipboard are discarded and replaced with whatever is highlighted.  We don't have any option to copy multiple objects and then paste them around.  However vim has multiple "registers" where text can be copied and pasted from.  To see the registers type :reg in command mode.

The register that we are interested in is register +.  To test it out, copy some text from another application then run :reg and see the contents displayed in register +.

So now we just need to know how to access the contents of register +.  Register access is done with ".  To paste from they keyboard we type "+p  To copy, for example an entire line, into the system clipboard we type "+yy  To delete the current line and store it in the system clipboard we type "+dd

We can also use registers with visual mode.  If we wanted to copy the line underneath the cursor we would type V"+y  We could copy the next three lines into the system clipboard by typing Vjj"+y

To sum it up, to use the system clipboard to copy and paste in vim simply do what you would usually do in vim, then prepend "+ to your y (yank) or p (paste) command.

Update:
Depending on the version of vim you are using, the register for the clipboard may work differently. In some cases the * and + registers are the same register. If you want to find out which register is for your system clipboard, simply copy some text from anywhere into your clipboard, then run :reg. Whichever register has the text you copied is the register that holds the contents of your clipboard.

Changing priorities for a bit.

I'm going to cease work on beefing up the Tallahassee map and fixing MapDust bug in Florida to start addressing area that the OSM Inspector shows needs to be addressed before the licensing change.  Given that this is time sensitive it will be my new effort up until April 1.