Tuesday, September 30, 2014

So How Was Your Day, Dear?

Monday, September 29, 2014

Just Ship It

Last week was a bit of a whirlwind. I slammed through most of my backlog in Skillcrush's Web Developer Blueprint course and published two (imperfect) sites:

The url for this site is about to be swiped for my Rails Rumble submission. I'm open to ideas for a better (more fitting) name for this brainstorming site. Also on the to-do list is to get set up with asset hosting on AWS so that the images uploaded along with the ideas will be saved! (Image storage on Heroku itself is strictly ephemeral!)


This resume-splash page was for an assignment on Skillcrush. I've got two main to-dos for this site. First, optimize the image better so that the background isn't so slow to render. Second, it looks terrible on a mobile screen in portrait mode.

I need to figure out how to tell the css to drop into a different mode when in a really small screen.

I'd like to continue my streak and ship another page this week. Not sure what yet (likely a starter page for my SeaGL talk this month.) Finally, I'm throwing in my hat for Rails Rumble - registration starts on October 6th and I'm super stoked to be a part of it this year.

Oh, yeah, and I've got my "day" job at [company name retracted due to uber-restrictive social media policy].

It's going to be a great week!

Edited to add:
I completely forgot! I also (finally!) got around to signing up at exercism.io I've just started but it's so much fun! :D

Wednesday, September 17, 2014

What a Summer it Has Been

This is a difficult post to write. I started this summer excited by my new OPW internship and anxious to get started. It began with a lengthy project map

The following enhancements are needed to allow storing and rendering of time-based information in OpenHistoricalMap.

1. Enhance the iD and The_Rails_Port so that a javascript time/date slider can be added to control the time period that is of interest.

2. Enhance the ID and The_Rails_Port so that meta-data hooks are added to the code that allow for custom deployments of both software. The intent is to support their use as dedicated user interfaces to certain applications (such as medieval walking path editing) while still using a generic data source.

3. Modify the Mapnik tile renderer to handle Key:start_date and Key:end_date.


and an ambitious proto-developer.

The goal of the project was/is, essentially, to put a time slider on a fork of the Open Street Map to enable users to search for historical maps that have been loaded into the system.

My original OPW proposal was ambitious and reveled my inexperience. As I worked through the first part of the project and then moved on to tackle the tile renderer, I began to understand the reactions of more experienced developers who I shared my work with. Still, I strove on (see logs).

In the end, I suceeded in integrating a timeslider into the OHM and in propagating a time variable throughout the tile renderer. I've also learned a great deal about how real-live applications look and I've picked up some C, as well.

I plan to continue contributing to the project. As my internship time ended, I was still working on building a working test server. I've had some hardware issues but expect to be able to begin working (part-time - I need paid work, too! :) ) soon. After the initial time variable is proven to work, I will then be able to introduce the actual keys to the render.

I would really like to see my code make it into the wild and it's a great mission. I've learned a lot about how real-life Rails applications work (look, Ma, there's business logic in the JavaScript!). I've learned even more about how far off paper time estimates can be from reality. ;)

Monday, August 25, 2014

Postgres and Postgis are a PAIN

The following is from a blog post from 2009. Installing PostgreSQL and PostGIS is still (still!!) incredibly painful. I'm re-blogging this here (I hope the author forgives me!) I'm terrified of losing these instructions. I know I'll need them again:


Install PostgreSQL 8.4 and PostGIS 1.4.0 in Ubuntu 9.0.4



Install PostgreSQL 8.4 and PostGIS 1.4.0 in Ubuntu 9.0.4

I am a big fan of the new PostGIS 1.4.0 (and also of Paul Ramsey) . I always have troubles installing PostGIS in ubuntu so I thought that this time I was gonna document it and blog it here. So this is just a log of the steps required to install it on an EC2 instance with Ubuntu 9.04. I hope it can be useful for someone else.

Just for the record. The EC2 instance I used was ami-ccf615 from http://alestic.com .

Once login (totally fresh).

apt-get update
apt-get install vim
#The sources are still not available on the regular package servers... edit the sources 
vim /etc/apt/sources.list
  add deb http://ppa.launchpad.net/pitti/postgresql/ubuntu jaunty main
          deb-src http://ppa.launchpad.net/pitti/postgresql/ubuntu jaunty main

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8683D8A2
sudo apt-get update
sudo apt-get install postgresql-8.4
#This changes the port from 5433 to 5432
sudo sed -i.bak -e 's/port = 5433/port = 5432/' /etc/postgresql/8.4/main/postgresql.conf

sudo /etc/init.d/postgresql-8.4 stop
sudo /etc/init.d/postgresql-8.4 start
apt-get install postgresql-server-dev-8.4 libpq-dev
apt-get install libgeos-dev
wget http://postgis.refractions.net/download/postgis-1.4.0.tar.gz
apt-get install proj
tar xvfz postgis-1.4.0.tar.gz
cd postgis-1.4.0
make install
sudo su postgres
#change the postgres password to "atlas" so that you can later login
psql -c"ALTER user postgres WITH PASSWORD 'atlas'"

createdb geodb    (with password atlas)
createlang -dgeodb plpgsql
psql -dgeodb -f /usr/share/postgresql/8.4/contrib/postgis.sql
psql -dgeodb -f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql
psql -dgeodb -c"select postgis_lib_version();"
#This should return 1.4.0

Good Luck!

Sunday, August 17, 2014

What's the Magic Vagrant Word?

The magic Vagrant command is:

sudo /etc/init.d/vboxdrv setup

Get comfy with that command. You keep needing it.

Saturday, August 16, 2014

Leaping into the World of APIs and Data

I am taking a flying leap and creating an entry for GitHub's 3rd Annual Data Challenge. My topic: The Six Degrees of Baconjs. Much like the movie-buff parlor game, the premise is simple: in six degrees or fewer, you can connect every user on GitHub (users who have at least one contributions/contributor outside of their own personal repos) with any other.

I have never attempted anything like this before. From the 10,000 feet view, given an input of a user, I will need to query for a list of all contributors to the Baconjs project and work backwards through each of their other repos to find the next degree's list of users. It's going to be recursive and strange but lots of fun!  I'm starting my studies of the first step with the GitHub API docs and the terrific tutorials on Codecademy. They even have one specifically on the GitHub API!

Wish me luck! I'm going to need it!

Monday, August 11, 2014

Time Flies Like an Arrow and Fruit Flies Like a Banana

That's my new little motivational mantra. Someday, I will help create a computer that understands that sentence.

Back in the present, though, here's a run-down of what I've been up to in the Open Historical Map project:

Week 11: July 28 - August 3[edit | edit source]

  1. We're jumping into the rendering now. Most of the work will be in ohm_mod_tile, especially renderd and the master daemon program.
  2. I posted the IRC log here (tried to strip out the filler /leave, /join, etc)
    1. This file is proving vital but elusive: home/tim/ohm-carto/ohm-carto/mapnik 2008.xml (UPDATE: I have the file now, but...)
  4. The bulk of the renderer is written in C and C++ (with a lot of Bash and some inline SQL for good measure.)
    1. I am v e r y s l o w l y and carefully modifying the renderer to accept the {t} parameter. It's been many years since I've even looked at C code (and that was in an introductory C class.)
    2. I'm relying heavily upon the 'git grep' command (tracking here).
    3. I'm logging my progress so I can keep track of what I've changed and where: git diff log.
  5. I don't want to lose this reference (is this Momento?):
    1. on line 245 in mod_tile.c, ~~bzero~~ recv() (bzero is used to zero out the bits at &resp to prepare it for the map tiles) and sends &resp to get the tiles from the database over a websocket
  6. I am really deep in the weeds here in C. I am going to take a little time to read up more in the man pages and go through some more of the tutorial over on Learn Code the Hard Way

Week 12: Aug 4 - Aug 10[edit | edit source]

  1. Made some changes to my changes (meta!) to the renderd.py byte packing/unpacking directive.
    1. IRC log on discussion here
    2. updated diff log here
    3. link on languages and urls from Chippy
    4. link on parameterization of mapnik tiles from Chippy
  2. The OHM Team had our monthly Google Hangout notes
  3. Re-attempting to install dependencies to run test server, instructions here for Mapnik and here for mod_tile
  4. After much searching (and an upgrade to gcc, I finally got it all running well enough to attempt to compile.
    1. Sadly, MediaWiki's spam filter is preventing me from posting a link to the very helpful blog that walked me through the task of upgrading my C/C++/Java compiler. If you visit charette.no-ip.com:81/programming/2011-12-24_GCCv47, you'll get to the instructions.
  5. I am now working on fixing the massive list of warnings and errors that running make generated for me!