Caleb’s extremely interested in the American Revolution and colonial times so we thought this fall break we’d take him to Colonial Williamsburg and Washington DC. We’ve had a blast the past two days learning about life in the 18th century. To top it off my parents drove down from CT to meet us here and experience it with us! Our favorite was the printmaker, we also enjoyed the capitol tour.

Sara in West Africa

From my sister:

Today is the day!! It's an opportunity for you to be a part of sending me to West Africa or join one of my fellow recruits in getting to their field! Get excited and #SENDME!! https://give.cmfi.org/p-19947-sara-garringer.aspx

Father's Day 2018

Happy Father’s Day Mark Garringer!!! You love us well, and make us laugh. I wouldn’t want to raise these kids with anyone else. ❤️

Merry Christmas

"The best of all gifts around any Christmas tree: the presence of a happy family all wrapped up in each other." ~Burton Hillis

Merry Christmas from the Garringers!

Merry Christmas from the Garringers! More photos in the picture gallery!

Another Chapter?

2008-09 – GeoEstimator is born/takes off.
05/2011 – Pictometry acquires GeoEstimator (press release)
01/2013 – Pictometry merges with EagleView (press release)
01/2014 – Verisk acquires Eagleview (press release)

Javascript Mathematics Libraries… GO!

I needed to look at the performance of multiple different Javascript Math libraries, specifically around Matrices. So, I’ve created numerous jsperf.com tests to compare them on different items. I’d originally started with 3 libraries:

After learning to use the libraries, comparing the performance, and just generally using them I parred it down to 2: Sylvester & Numeric. Sylvester is on the far OOP side of design, fluent interface, pretty good looking and readable code. Numeric is on the completely opposite end of the world with all static calls, no types just arrays, very functional looking, with code that is nearly IMPOSSIBLE to read. Google Closure on the other hand is the worst of both worlds. It’s OOP but the different libraries don’t play nice with each other (e.g. Vec3, Matrix) while it’s not easy to read the code and rather tedious in general. So, most of my later tests leave out gc.

Identity Matrix: http://jsperf.com/numeric-vs-sylvester-for-3d-matrix-operations/2
4×4 * 4×1 Multiplication: http://jsperf.com/numeric-vs-sylvester-vs-closure-matrix-multiplication
Single 3D Transformation: http://jsperf.com/sylvester-vs-numeric-vs-closure-for-3d-transformation/2
500 3D Rotates (T,R,T) w/ Unrolled: http://jsperf.com/numeric-vs-sylvester-vs-closure-for-unrolled
1000 3D Rotates (T,R,T) w/ Unrolled: http://jsperf.com/numeric-vs-sylvester-vs-closure-for-unrolled/2
1000 3D Rotates (T,R,T) w/ Unrolled not building Matrix: http://jsperf.com/numeric-vs-sylvester-vs-closure-for-unrolled/3
Row Access: http://jsperf.com/numeric-vs-sylvester-on-col-row-access
Col Access: http://jsperf.com/numeric-vs-sylvester-on-col-row-access/2
4×4 & 3×3 Inversion: http://jsperf.com/numeric-vs-sylvester-4x4-3x3-inversion
Equality: http://jsperf.com/sylvester-vs-numeric-vector-equality

When I got to the Row access, I thought things were going to be ‘similar’. MAN, were they not. Numeric kicked Sylvesters butt, like 100 to 1 style. I decided to look into it a bit and found that quite a bit happens on Matrix/Vector creation in Sylvester. Inputs are checked, arrays are copied/sliced/created, and all around good stuff when dealing with outside input. By simply removing all of this ‘stuff’ and simply creating a Vector and settings it’s elements to a known ‘good’ array from another matrix I was able to improve Sylvesters time by ~10x. That still left it years behind Numeric on row access so I dug deeper. Turns out it’s simple prototypal object creation that’s slowing Sylvester down. The vector constructor does absolutely nothign code-wise, simply instantiates an object. Simply putting ‘new Vector();’ in the numeric tests slowed down them down put them right on par with Sylvester. Leads me to believe that the speed of complex object creation is a big part of what is perceived as ‘slowness’ in Sylvester.

At the end of the day I’d recommend Numericjs for ‘raw performance’ and Sylvester for about everything else. Sylvester is easier to understand, has more implementation around common 3D constructs, is readable, and all round ‘nicer’. Numericjs cuts ALL cruft, is horrible to read, not nice at all, but is fast. Did I mention lots of variables named x,y,z (and not x, y, z coordinates) and functions named foo, dim, and other such worthless names? Did I mention that a LOT of the code is actually creating javascript on the fly with string concatenation?

Defining ‘Technical Debt’, breaking down agile, and how it all fits together

Here are some links to the slidedeck and other items of interest in relation to my talk on May 16th, 2013 at the Indy Software Artisans meetup.

My Slidedeck:
Technical Debt & Craftsmanship

Slides for most of the speakers at the Agile Indy Conference:

Ward Cunninghams Correction on Technical Debt:

Ron & Chet giving the same talk @ COHAA:

Cynefin Framework overview:

Monitoring MySQL replication with Nagios.

This isn’t a post about setting it all up. That would require quite a bit more space/time than I have as Nagios is fairly complex. I just wanted to let people know about some changes I’ve made to an existing package.

I found the check-mysql-all scripts on google code that already contained a number of nice scripts for monitoring with Nagios. What it didn’t support was the mk-heartbeat command in it’s check_maatkit command. In my github repo I’ve added this support. We’ll see if it ever makes it into the google code repo. Not having easy push/pull requests sucks! (maybe google code does if I used it?)

Handling Master/Slave replication servers in a Zend MVC app

Increasingly, our mysql db has been the bottleneck on performance in our application. After researching, looking around, weighing the options and all that jazz we decided to look at adding read-only slaves to our existing HA (drbd style) mysql server. When looking for solutions in Zend that would help to take advantage of this scenario I found a few projects out there but all they appeared to be were simple data structures to create, store, and retrieve Zend_Db_Adapters. This would require a code change everyplace the database is used to get either a master (update,insert,delete) or a slave (read).

I wanted plug and play, so I created the new Zend_Db_Adapter_Replication. It simply takes 2 adapters, anything implementing Zend_Db_Adapter_Abstract should do. From there it uses the correct connection depending on what operation you are running. If the update/insert/delete functions are called it passes them through to the master. If select is called it goes to slave. If the more generic query is called it looks at the query to determine which connection to use. If you start a transaction, it assumes you want master, and it forces everything else that happens inside that transaction to happen on the master.

This was enough for me to simply replace our current db in the Zend_Registry with the Replication db and everything ‘just worked’. You can watch munin/nagios/mysqladmin and the distribution looks perfect.

At the time of writing there’s no way to get an individual connect simply because I’ve not needed it. There’s also no way to force it one way or the other besides using transactions, again because I’ve not needed it.

So need it now? Where is it? Get the code on github!

behat – BDD for PHP

I’ve looked at implementing acceptance testing style tests for our website with cucumber/ruby in the past but never pulled the trigger due to the fact that I live in a PHP world at work. Any ruby setup code that was written for the step definitions would most likely be duplicate code that we already have written and support in PHP.
Recently I became aware of a BDD framework, nearly identical to cucumber, for PHP named behat. It uses a PHP cloned gherkin parser so the features themselves are nearly identical to cucumber

Feature: User sessions
In order to access their account
As a user
I need to be able to log into and out of the website
Scenario: Login
Given I am on "/account/login"
And I should see "Login"
When I fill in "username" with "username"
And I fill in "password" with "passwd"
And I press "Login"
Then I should be on "/account/my"
And I should see "Hello Mark Garringer"

Behind the scenes the step definitions are similar. Due to language limitations the regular expressions for matching are in doc blocks on methods rather than method names but very workable. I’m not sure I’m a fan of the more inheritance based nature of their step definitions but it does the job and doesn’t get in the way.

Much like cucumber out of the box it doesn’t do web, but instead you use a driver that does web. In this case it is Mink (by the exact same people). Mink provides headless (javascript-less) browsers for quick tests as well as drivers for selenium and sahi for testing javascript enabled pages.
All in all, what testing I have done, has proved very promising. The documentation is pretty good although the ‘google factor’ seems fairly low. Finding examples and help outside of the website and project resources is fairly hard. I’ve implemented some rather in depth tests putting it through it’s paces and it has worked like a champ. It suffers from the same javascript timing issues that other such frameworks suffer from but it does what it says, and does it well.
Most importantly it can output in junit format so integrating it with our build server and getting feedback was a cinch!

Behat FTW!!