Saturday, January 25, 2014

From the top: Ruby and Frameworks: Divvy Neighborhoods

I want to create a Ruby web app, just to become familiar with the syntax
and to see what my options are out there. Every framework has its own approach
to web apps.

I have minmal, old experience with Ruby on Rails, so for now I’m going to look past
it. An outline of what I want to do goes something like this…

Divvy Neighborhoods

Summary Page

  • Aggregates station information
  • Associates it with neighborhoods
  • Displays overall availability on a per-neighborhood basis

It would be nice if the aggregation took place at the server level, so that the only thing
passed to the front-end was some JSON that looks like this…

someDebugging: {},
neighborhoodSummary: [
    {
        neighborhood: 'River North',
        stations: 12,
        availableBikes: 100,
        totalBikes: 150,
    },
    ...
    {
        ...
    }
]

Since stations appear and disappear all the time, it would be nice to have a way to associate
stations with neighborhoods that didn’t require keeping a file up-to-date in the git repository.

History Page

A big goal of this is to track neighborhood-level changes in station availability over time. This
seems to call for a conventional transactional database.

With the historical changes, you can do some interesting stuff.

  • Track the broad availability of bicycles
  • Track the average availability (available / total bikes) of bikes
  • Compare the changes of availability in a given neighborhood, versus the changes in average income in a neighborhood.

Timeline

I don’t have the faintest idea when this will be done, but I do plan on having the code open-sourced
and available on GitHub. Suggestions would be appreciated!

Wednesday, January 22, 2014

Adding graphs to the Chicago Crash Browser

Pull request #3 (of, hopefully, 5) is to add graphs to the Chicago Crash Browser.

I’m a fan of data visualizations, but I haven’t been able to work with that during my day
job. So this will do. :-)

I utilized Highcharts, and after a few hours of wrestling with JavaScript
objects, I’m happy with the result:

Chicago Crash Browser Preview

What Web Development Means

…to me.

The big news today is that beginning Monday, February 3, I will be starting a new position
with GoHealth, a company that sells health insurance to consumers. I’ll be working on both
consumer-facing and intra-company web applications, utilizing Ruby, JavaScript, or whatever
works best for the task at hand.

This comes at the end (or should I say, beginning!) of a process in which I thought more about
web development, and more specifically: what it means to me.

Front end, back end

Recently I had considered myself strictly a back-end developer. That is, I saw our web development
stack as this…

  • Browser (HTML, CSS/LESS)
  • Server (PHP, XSLT)
  • Remote APIs

There was, I felt, a pretty clear delineation of responsibilities there. Browser is front-end. Server is back-end.

As I dug into enterprise web development, the picture started to get a little blurrier.

  • Browser (HTML, vanilla JavaScript)
  • JavaScript Frameworks (jQuery, Angular.js, Backbone.js, etc.)
  • Server-side Frameworks / API consumers (node.js, Django / web.py, Ruby on Rails)
  • API Implementors (can be enterprise Java or C# but it really just depends)
  • Databases and other data sources

I haven’t worked on anything on the other side of the API wall… which probably meant I wouldn’t
pick be able to take on authentic back-end roles (i.e., server-side business logic). That leaves focusing
on web development over non-web development.

A better web developer

Going into this new phase, I have a couple of goals.

  1. Increase my exposure to different web technologies. This is particularly important with reference to transferable skills. I’m very good when it comes to working with the Tessitura API, but to be a full-stack developer, I’m going to have to step into the full spectrum of web technologies.
  2. Speak at meetups about these technologies. They could be OpenGov Hack Nights or meetups downtown. But nothing guarantees knowing your technology more than having to publicly speak about it. :-D

Sunday, January 19, 2014

Goals for 2014

My new year’s resolution for this year is to have goals.

A stretch, I know. For this blog I prefer to keep things professional,
though if something sneaks in about me wanting to run in a
half-marathon, don’t be surprised.

Learn JavaScript

In other words, be a full-stack developer.

Which can be a bit misleading. Currently I work in PHP/XSLT, which
can arguably be full-stack or back-end, depending on how you look
at things.

And don’t ask me to design anybody’s website.

But. The structure of data on a page. Managing how data is displayed
on a page. Data binding through models. AJAX-y stuff.

That’s more up my alley, and with the amount of frameworks that
are sprouting up daily to address this problem, it’s a good time to
see what types of client-side solutions are being used throughout
the web.

Do Good Things

I have a goal to put in 5 pull requests to some project(s) on GitHub
by the end of the month. I’m not sure if I’m going to make it, but
the broader point applies: the more I work with other people’s code,
the more I learn about codiing as a whole.

Make the Chicago Crash Browser awesome

Chicago Crash Browser

This could be a really handy tool throughout all of Illinois, not just Chicago,
so I’d be very happy to help make this a fast, functional tool for bicycle
and pedestrian advocates like me.

Find a project in Python or Ruby to contribute to

There’s a lot of options at Open Gov Hack Night. Which one sounds interesting to me? Which one can help people the most?

Spend time with the wife and family

Because they’re important too. :-D

Tuesday, January 14, 2014

Weekly for January 12, 2014

New Resources
* Programming with Asserts

Existing Resources
* PHP: The Right Way

Interesting Posts
* How To Be A Great Developer

On My Bookshelf
* Learning Python. (Returned library book. Page 1,024)
* Node.js In Action, borrowed from a colleague (20%)
* Getting Started with NoSQL (70%)
* Programming Python, 4th Edition (not started)
* PHP Objects, Patterns and Practice (page 65)

Summarize later
* The Art of Agile Development
* 97 Things Every Programmer Should Know
* PHP Web Services

Wish List
* JavaScript: The Good Parts

This week I continue my search for a Python (or, dare I say, Ruby) open source project to work with. I also have a couple of good suggestions on Facebook to work in the jQuery library.

Friday, January 10, 2014

Git and merging

Things I learned in Git today…

  • git pull upstream doesn’t pull upstream changes. git pull upstream master does.
  • As a result of this, and of changing files without being 100% aware of which branch I’m in, I learned than on a conflict, you can use git checkout –theirs to pick the file that you want to use, so that you can commit your changes.

The learning continues…

Thursday, January 9, 2014

30 Days of Hustle: Pull Request

Pull request #2 is for the Chicago Crash Browser project.

It’s housecleaning, but touches on some topics I wanted to dig into later…
* Bower
* Other package management utilities, and the problems Bower avoids
* What a nice build process would look like for the Chicago Crash Browser project
* Dude, jQuery is awesome

This pull request starts to do some cleanup on the main logic, keeps the size of the main index.php down, and opens the door to future functionality being added with minimal hassle.

Sunday, January 5, 2014

Weekly for January 5, 2014

As promised, this is the weekly post that helps me keep track of my personal professional development as a web developer. (That’s a weird phrase. Maybe there’s a better way.)

New Resources
* PHP: The Right Way

On My Bookshelf
* Learning Python. A library book, ‘til 1/14. (75%)
* Node.js In Action, borrowed from a colleague (20%)
* Getting Started with NoSQL (70%)
* Programming Python, 4th Edition (not started)

Summarize later
* The Art of Agile Development
* 97 Things Every Programmer Should Know
* PHP Web Services

Wish List
* JavaScript: The Good Parts
* PHP Objects, Patterns and Practice

This week I started getting familiar with GitHub (and more generally, Git), my first foray into distributed version control systems. I also contributed to an open source project for the first time(!).

First pull request submitted!

One of my goals for the first 30 days of the year is to submit 5 pull requests. I haven’t decided if that will be for 5 separate projects (since that means I’d have to find and familiarize myself with 5 different codebases!) but I did get the first one out of the way.

These two commits allow additional detail to be viewed on http://chicagocrashes.org, a website that lets you browse law enforcement reports about crashes taking place in Chicago.

While the changes aren’t difficult, the value was in getting more familiar with the git and github workflow.

Although apparently I had “origin” and “upstream” backwards. Oops. [runs to fix that]

Okay. Now that I know what origin and upstream are, I’m going to feel a bit more comfortable contributing to open source projects from now on. Just in case there are more things I thought I knew but don’t actually know, I’ll drop in on a web seminar provided through GitHub on January 17.

Friday, January 3, 2014

What is the equation for my weight?

I’ve been actively running since early September. I much prefer riding a bicycle, especially to work, which used to be 9.5 miles either way. Unfortunately a bicycle is a poor transportation choice for toddlers.

Accordingly, I’ve lost quite a bit of weight. 20 pounds in 4 months, which isn’t too shabby. The rate of loss seems to have slowed, so I decided to figure out what equation is the best fit for my weight.

Naturally, there’s a way to do this in Python, and it’s pretty easy.

from numpy import polyfit

x = [<a whole bunch of integers representing days since 9/1/13>]
y = [<a whole bunch of doubles representing weight>]

# this part is interactive:

>>> polyfit(x,y,2)
array([  5.36576978e-04,  -2.05927136e-01,   2.30620968e+02])

Well. That was easy. So the equation approximating my weight is:

.000536x^2 -.205921 x + 230.62

Naturally, I wanted to know what I’d weigh in the future.

>>> (a, b, c) = polyfit(x,y,2)
# this seems... silly
>>> d = [c,b,a]
>>> Poly = numpy.polynomial.polynomial.polyval

Day 121 checks out, so things are good. What about the future?

>>> Poly(200, d)
210.89861954517085
>>> Poly(300,d)
217.13475489610073
>>> Poly(400,d)
234.10242981212033
>>> Poly(1000, d)
561.27081017512194

Uh oh. I didn’t plan on doubling my weight 3 years from now. Maybe my weight isn’t a 2nd degree polynomial with a positive coefficient.

What I’m looking for looks a lot more like 1/x. Which, if I recall, is by definition not a polynomial. The search continues…

Thursday, January 2, 2014

On introversion

I started reading Quiet: The Power of Introverts in a World that Can’t Stop Talking last night. I’m still reading it, so only a couple of initial thoughts.

  1. It gives a good overview of introversion and how extraversion is a relatively recent concept.
  2. The veneration of extraversion that’s outlined in Chapter 2 is telling. I didn’t realize just how much culture values initiating action; I tend to think of people that act first and think later as “boorish”.

This book so far is good food for thought if, like me, you prefer composing thoughts and typing over talking. It makes me wonder where my thoughts and opinions were ignored, because I’m not the sort of person to advance them loudly.

I’m looking forward to seeing what in my life I’ll (try to!) change as a result of reading this book.

Wednesday, January 1, 2014

The Professional Programmer

97 Things Every Programmer Should Know is a good read. I’ll probably pick out a few essays and flesh out how I’d like to apply them in my work and spare coding time. But this being January 1, I’d like to point out The Professional Programmer by Robert C. Martin as the one I keep returning to in my mind.

Specifically, this:

If you are a professional, then you are responsible for your own career. You are responsible for reading and learning. You are responsible for staying up to date with the industry and the technology. Too many programmers feel that it is their employer’s job to train them. Sorry, this is just dead wrong.

This is something that I’ve lacked throughout my career. It seems larger employers are better about training; in fact, in my time at United Airlines, we took a few classes with Object Mentor to help with our Java skills. I knew a little more about object-oriented programming after taking that course.

Seeking out the “right thing” to pursue in the off hours is both necessary, and a loaded question. There is no “right thing” the pursue; there is “what we are doing in our day jobs today”, and “what the hive mind of web developers believes are good solutions to their problems”.

It’s up to us as individuals to understand what problems are being solved, and why. Then, to actually try to apply these problems to our domains. To the extent that I have New Year’s Resolutions, this is mine.