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.