Resizing Images in Bulk

I help maintain a site for a craft business. One of the challenges is multiple sizes of images for new stock each year. I used to go through and resize each image manually with a program like Gimp.

I finally got smart and installed ImageMagick.

With a Rakefile, I can pass each image into the convert command with the proper sizing, and get the output into a new folder, ready for upload. The code is shown here:

One catch to keep in mind if you work on a Mac. There can be orientation metadata from some images that OS X will honor, but a browser will not. If your images show up on the web in the wrong orientation, look into ImageMagick convert command’s -rotate option.

Data-Driven vs the Dashboard 

It is common for technical product companies to call themselves “data-driven” these days. The idea is that metrics are used to drive decisions. Sounds easy enough, and compatible with a technology landscape that is enamored with data science, etc. 

But something didn’t always feel right to me. Strange, right? If you follow this blog or know me, you probably know that I have been steering my career in a data-centric direction. I coordinate the Cleveland R User Group, and have spent most of my personal technical time with a variety of tools to do analysis and modeling. 

Maybe it’s a deeper understanding of statistics and related skills that lies at the center of my problem. Many people view these fields as black and white. “Show me the numbers”, people say. As if they are stone tablets chisled with the truth. Creating summaries, graphs, models, etc. requires understanding the domain, and subtle interactions. The tools are getting better, but we still need people to drive the tools and frame the questions right. To correct mistakes of causality. 

In explaining this, the example that hits home for me is a dashboard for a product. Have you ever tried building a B2B software product without one? Good luck when sitting in front of an executive board and you can’t show them a dashboard they can monitor. Never mind that for all of your existing customers that dashboard is the least used page in your analytics. It’s key to the sale. But if you ignore that, and just look at user data to drive all of your decisions you’ll miss that. 

So maybe there’s nothing wrong with being data-driven, it’s just that you have to be willing to mix in some decisions based on strategy and experience. And you have to ask your customers the right questions in the first place.

To be a great firm, a company should find a sophisticated middle ground. You can’t rely on a visionary employee to drive all decisions. Many founders think they are Steve Jobs and can divine all customer needs. Steve Jobs is an outlier among outliers. The answer, however, is not to turn in your brain because you started gathering data. The metrics are a tool, and you can still choose how to use your tools. A feature (or page) may still be legally required. Or it may be used rarely, but of tremendous value when it is. Data provides clarity for the many mundance decisions. It should still be up to a person to set the strategy. Otherwise, you’ll be selling a product without a dashboard. Heaven forbid…

My Next Home: Why DialogTech?

In my last post, I wrote about why I was making a change. I started in January at Ifbyphone’s Cleveland office. This week, we rebranded to DialogTech. In my opinion, a much better name.

We have software-as-a-service products (SAAS, Cloud-based, however you want to say that) around managing analytics, specifically geared towards marketing efforts. Anyone with much SEO/SEM experience knows that tracking lead sources, ad effectiveness, and other ROI indicators is key to marketing. For a lot of businesses, however, there is a real problem in that large amounts of their customers research online, but want to talk to someone before buying. Today, that is often via a telephone call, but consider the future impact of WebRTC (think Amazon Mayday on the web), Skype, Hangouts, etc. Those channels can be a blind spot for folks trying to analyze marketing effectiveness.

Our software helps businesses continue to gather intelligence across those channels. We also have software that improves the customer experience by intelligently routing customers directly to the right call agents, etc.

So why do I want to work here? A couple of reasons. First, I was looking mostly at product companies that work in either marketing or healthcare, because I believe those areas are the furthest along in terms of understanding how data science and modern tools can assist. And they have a lot of data to deal with.

Within the companies that fit that bill, I was looking for a growing opportunity where I had opportunity to make an impact. DialogTech is in a rapid expansion mode, but big enough to be stable. The company is already providing a lot of insight to our customers, but I believe there is a lot more we can do with our data. We also do a fair amount of integration and custom work, and that is a nice fit with my consulting background.

More than anything, my final qualifications were cultural. Does the team care about success, and do the leaders and owners represent a leadership I can work for. In both cases, I have been extremely happy with what I found here. The enthusiasm of a startup, mixed with the warm personalities of the midwest (Chicago and Cleveland). There is a genuine enthusiasm, without a lot of bravado and hyperbole. We are helping other businesses connect with their customers and potential customers better. Period.

Finally, via experience I have learned to take a hard look at the owners and Senior managers of a company, and see what I can perceive of their character. It may sounds naive, but I really believe it. Environments where people are solely focused on their individual success, hold open disdain for the company or their peers, these things are toxic and the company cannot overcome them. Particularly if they are present near the top.

Fortunately, I didn’t have to make many mistakes in my career in terms of direct employment. Consulting exposes you to a lot of businesses and leaders. I consulted for some great places, and some toxic places. I don’t see a need to dwell on the cost of the negative places, most people understand that. I’d rather emphasize the simplicity and support that great leaders provide that is easy to underestimate. Value it, and seek it out when you look for a job. And if you are willing to show some loyalty and sacrifice in return, you’ll form meaningful relationships with the type of people you want to work for. That will pay off more in the long-run. It’s like the compound interest of a career.

Needless to say, I liked what I saw when I took a look at our leadership here. I’m anxious to see what we can build in the coming years.

On Leaving A Job After 8 Years

In tech years, eight years is enough for a gold watch. I went to work for a newly formed company called Method Driven Software in early 2007 as it’s first employee (there were two partner/employees that remain with the firm today in various forms). Through the years, we acquired several firms and rebranded twice, eventually becoming Level Seven. I had the privilege of helping shape the company along the way, and working with many talented individuals. While I helped shape the experience, it certainly shaped me.

Over the course of 2014, it became fairly clear to me that it was time for a new direction in my career. Not because of Level Seven. With the labor shortage in technology and expanding economy, I think Level Seven is poised for success. I also happen to have supported some of the new leadership joining the company, and would recommend it as a place for anyone interested in technical service work.

I’ll expand on what is next for me in a later post, but I have been moving in the direction of data science tools and building of larger technical teams for a while. I also found myself looking to try my hand in the product space, where I could focus on growing and building a suite of software for a while. In short, my interests and talents were aligning less with what Level Seven was doing in the near term. We did have one project that required some of those technical skills, but in the grand scheme: I was growing in value to companies outside of the consulting world, and Level Seven was less dependent on me than it had been in the past. I can be sentimental about things at time, but work is rarely one of them.

I’d like to summarize some of the most important things working at Leven Seven taught me.

Customer Service

There are a lot of development jobs you can start your career in where you won’t meet customers very often directly. This is why UX is so hard, many companies’ processes just aren’t wired for it. Service companies understand the impact of client relationships. As do sales people. And at a services company, everyone should be selling.

Leadership Over Authority

If you choose to work as a consultant, you will regularly be put in the position of having to convince the people who are paying your bills that they are wrong and there is a better way. You have to be certain, and judicious about this, and have a good reason to do so. But most importantly, when you do this, you will have to drive consensus without authority. After all, you don’t work at the client, you’re just paid to be there. This is invaluable. Because at the end of the day, it’s the only way to lead anyway. If you are a team lead or manager at a product company, you may have the “authority” to order people to follow your direction without explanation. But keep in mind those people can find a new job in about ten minutes. And they will provide feedback to your boss and other stakeholders. Real leaders lead, they don’t dictate. Let the right ideas rise to the top. This doesn’t fix the fact that you will run into people that won’t admit they are wrong when the ship is going under, but that’s life.

Principles And Domains Over Languages

For the company, I worked in C#, VB.Net, ASP, Ruby, PHP, JavaScript, Java, Objective-C, C, and other languages I’m probably forgetting. That variety was nice, but it was the many domains and concepts I was exposed to that I found so valuable. Marketing, Finance, Property Management, Transportation & Logistics, Telecommunications, Health & Fitness to name a few.


It’s an cliche, but you should be doing this in any job. From the perspective of the job you’re in, it’s valuable to your company if you can generate business leads, find recruits, or recommend great vendor partners. But what about yourself? It’s how you grow by interacting with other perspectives, form an employment safety net, etc. Through user groups, client relationships, etc, I was able to drive value to Level Seven. And in turn, I knew that even though a company of that size carries some employment risk, I had enough contacts to be reemployed with a very short turnaround if need be.

Evaluate Jobs Based On Leadership And Strategy

Many job seekers look at finances. Others (especially in technology) look at platforms and toolsets. Working in consulting is a form of post-graduate education on business. You get exposed to a lot of business models and projects, and get a taste for what works and what doesn’t. The experience of working with the so many companies in NorthEast Ohio showed me that great leadership and owners prevail. Look for honest, driven people who are focused on sustainable success. And I would avoid getting trapped in stereotypes of platforms. Language X may be “dying”, but I would take a great team working with yesterday’s technology over a dysfunctional one with with ruby node elixir or whatever is hot.

In The End…

I had the privilege of working with some great mentors, and mentoring some great people at Level Seven. I entered the company as a newly-wed and leave a father of two still happily married. I was treated fairly (and then some) my entire tenure. I had many experiences and training opportunities that I wouldn’t have had elsewhere. And I left on my own terms with a sense of accomplishment. It was difficult to leave a workplace with so many friends, but I feel a sense of peace with my entire cycle there. It was an experience I can’t place a value on, and I hope you find value in me sharing some of it.

Analyzing Spread Football Picks With R

I’ve been making an effort to learn R for about a year. I have experimented with it on and off over the years, but this is first serious effort I’ve been making.

Whenever I am learning something, rather than just focusing on book examples, I try to come up with an example that is relevant to me and interesting. Doing that helps keep me motivated, and drives me to pick the things I want to know that are useful, and not just focus on the things that are revealed through examples. I would liken this to an experiment I heard a Khan Academy engineer talking about where students are exposed to various Logo drawings. Some of which have the source code available and some don’t. The ones without source serve as motivation and focus on principles that will build and challenge on what the student already knows.

In my case this means the following: if I’m going to work with Linear Models in R, I’m not just going to work with an example that lends itself to that data, but to be challenged to evaluate with variables might make a valid model and then test that fit with a critical eye.

In my case, I decided to try to not be the worst in my NFL Pick’em league this year. I usually do ok in the league, but I’m having a particularly bad year. The premise of the league is as follows. This league is only about picking game results, not like fantasy football. You pick every game each week, and you pick against the spread. The most correct picks win.

For those who don’t know what a spread is: it’s a gambling mechanism to get people to bet on both sides of a game. Bets are like stock purchases, you may not think about it every time you make a transaction but there needs to be someone taking a position on the other side. Many people assume the casino (or bookmaker) is taking the other position. They are trying not to take a position, they are really just a market-maker. The bookmaker attempts to make money by having a small profit margin (sometimes called overround) on the bets. In order to not take a position, they want as close to 50% of the betting population on each side of the bet. That way, each winner is paid using the losses of a loser. In order to accomplish that, they use a spread, or payout odds. In the case of a spread, they subtract a certain number of points from the favorite, to entice people to bet the underdog. If Denver plays Oakland, and the spread is Denver – 10, the bookmaker is saying that by subtracting 10 from Denver’s score, they think they will get an even market. If Denver wins by more than 10, the Denver betters are right. If they win by less than 10 or lose the game outright, the Oakland betters win. If Denver were to win by exactly 10, the bet is a push, and both sides get their original bet back.

Our league is not a gambling league in the sense of betting per game. You just pick all the games, and there is a prize at the end of the year for the most correct picks. It is run by a friend and I have been in the league for over 10 years now. So needless to say, I know the domain. Which in doing analysis is a huge leg-up. You can intuit pretty quickly if numbers look correct, or if a stat has meaning.

So the first step was to track results. I used google docs to keep track of my picks. It has an option to download spreadsheets as a csv file, which is a very friendly format for R to work with. If you want to try this with your picks, you can make a copy from here.

Now comes the R work. All the code is up on my github account. The first step was to get the data into a data frame, one of R’s most common structures. Picks.R does just that, and adds some calculated columns and gets calculates some general league trends. I wrote two functions condition_frequency and condition_percentage that can calculate almost all the required stats. They are functions that count the number of occurences of some condition, or a percentage. Both take functions for the condition, and can look at all picks, or be passed another function that is used to determine a subset to analyze. For instance, you can calculate the percentage of home teams that cover the spread when they are favored by passing a set condition that looks for results where the home team is favored, and a subset condition of the home team winning by more than the spread.


Describe.R writes a markdown file that can produce html to show league trends and personal trends. The result looks like:

Next I decided to plot my results by week. The results are:

My results by week

You can see I tried to apply a simple linear model to the results based on how many weeks of football I had to project how much better picking would get. That’s a questionable model to try, but it at least demonstrates your general trend.

In Teams.R there is a function unplayed_games that will give you relevant stats about each team in the games that don’t have scores yet.

So what did I learn?

I learned to use functions very effectively in R, and to try to take advantage of the way you can operate on entire vectors at the same time. (Data frame columns are vectors). I learned to work with Hadley Wickham’s dplyr and ggplot2 libraries, which are great for productivity once you understand the philosophy of how to work with those libraries.

A lot of the visual and transformation work was helped by a workshop the Cleveland R User Group held with Robert Kabacoff. He was a very good instructor and it really put a lot of pieces together for me about working with R.

What Next?

I’d like to get into clustering the data, and seeing how results vary by spread size. In addition, I’d like to try some machine learning. Train up models and see if the machine can predict better.

In particular, I’d like to bring team popularity into the model. Why? Remember the long-winded discussion of how and why bookmakers make spreads? Did you notice that the bookmaker isn’t trying to predict the most accurate line, they are trying to get 50% of the betters on each side. That means that there are opportunities for exploitation. The common example is large market (or popular) teams. Consider the Pittsburgh Steelers (which as a Bengals fan, I of course loathe but that is not the point…): The steelers have backer groups across the country and a huge following. If they were to play a team like Jacksonville that struggles to sell out their tickets, it is likely that there is a certain base that is going to bet on the Steelers simply because they are fans. In order to achieve that 50% balance, bookmakers are likely to skew the spread to overly favor Jacksonville. To make the less popular team a more attractive bet. Savvy data driven pickers end up taking the mathematical advantage at the expense of betters just playing favorites.

Also, I’d like to investigate ways to make the entire app more approachable. Could this be a shiny app that takes a url to a csv and present the user with results?

It’s been a fun project, and I’ve seen some improvement over the year. That said, I’ve had a rough picking year and certainly won’t finish in the money. But it’s kept my R learning journey moving along, and I’ve enjoyed it.