David Souther

Crafstmanship - Software, Hardware, Art, Language

Cucumber Selenium Mappings Model

To create a ubiquitous language for a project’s interface, I recommend creating a semantic mapping. This is an in-code key/value object defining words and phrases in a ubiquitous language that maps to a specific CSS selector for use in code. This has many advantages, with a couple draw backs. The benefits of having a ubiquitous language are documented in various sources, but in sum, mean less time wasted in a team discussing which piece of the solution is under discussion. This exact solution has some specific drawbacks, that I’ll mention later.

AngularJS Mock Render

We test. A lot. We have quite a few directives. We’re using this mock render function to quickly test those directives. It takes the simple html name of the directive, an object with any parent scope properties, an object with any DOM attributes to set, and a string to use for transclusion: render(directive, data = {}, attributes = {}, transclude = "")

Testing. It’s Hard. Just Do It!

“With enough eyeballs, all bugs are shallow.”

The bug might be shallow when it’s first found, but how does it never happen again? Automated Testing. When a bug is found, prove it exists with a test. Then, that bug is guaranteed to never happen again – a little computer gremlin with eagle-eye focus will look at that bug every time your program runs, and the bug will NEVER HAPPEN AGAIN. It will never happen, because if you come close to making that bug, the gremlin will make your console bleed with the red of a failed test.

“The three chief virtues of a programmer are: Laziness, Impatience and Hubris.” – Larry Wall (creator of Perl)

Sitting at Home, Listening to Beethoven, Thinking of Maenee

The fire in your eyes sets my heart aflame

the spark that lights the tinder in my soul
which, bereft of the waters of love, dried
but did not blow away. Waiting,
instead, to flame up, 'till, engulfed with passion,
the detritus burned away leaving
fertile fields to sow the tears of your beauty.

Nurtured by the passions of our love,
tended by the tender touch we share,
blooming in a garden we share
in my breast, my mind.

National Gallery, West Building

Art in the halls art on the walls
Paintings and sculpture oh my 
A Garden inside to read if you will
Galleries filled for the eyes

An Ancient Pine forest with a mountain stream 
Serene to behold, even without green
That babbling Brook flows strong in winter 
The beauty of Swiss caught with watercolor 
(Alexandre calame 1847)

Hippolyte Petitjean dimples so tight 
Her watercolors still capture light 
Sedative scenes made of single points 
Each lovingly placed with a deft touch 
(promenade by a lake, a river landscape, etc)

Fishing boats tossed before a storm 
Isabey throws the paint ashore 
The fishermen cower 'fore nature's roar 
Yet ride it through in courageous form 
(1840)

Degas, Rodin! Their sculptures show 
Humanity in all our throws 
Romantic: grotesque 
Or plump, yet true?

Hunting in the Pontine Marches 
Mighty Oaks felled low as passing time
The moment captures rifle's aim
The Hound, faithful, pointing, leaves impression
(Horace Vernet, 1833)

People move through 
some with opinions, Others thoughts 
One in a few, even appreciation 
The creations of peers moving them so

Too much to see in a day or a life,
so we pick and we choose
what fancies delights;
then, at the end, the cherubs alight.

7th Ave Between the Square and the Park

I walk her streets alone, awake;
I walk her streets with friends.
Alive we feel some million folks
enjoying her embrace.

Her lights are bright,
yet throw shadows
enough in length to hide
where sounds abound, yet lie.

Her grids ensnare
whom drives across.
"Go below" her whisper,
strong but soft.

Then a whoosh and a rattle
goes her train!
The clank crescendo
from her veins!

A honk, a squeal! The rubber grips
while I on foot move apace,
Hundreds, thousands, also walk
free from the bonds of oil to race.

The buildings are tall, her skin.
Steel and concrete, for those within
to sit above and look upon
her lustrous fair visage.

Green still is found near every where.
Her parks day and night for lovers wait.
The squirrels beg, the rats grow fat.
And pigeons? Crap on your hat.

Her shops will sell most anything.
"What Price" you ask without a tag.
Her people though surprise you so,
"It's my gift, you need it more."

Of course with millions all around
Some less savory can be found.
"What Price" you ask without a fare-
less pleasant a night you're not aware.

She is a bitch, when she wants to be.
Abusive, yes, but then, so welcoming.
Keep your wits, and love her too.
She will always be with you.

Readable D3

d3 example code is horribly convoluted, depending on dozens of unstructured variables (and often some global magic) to achieve even the simplest effects. To improve the readability of my d3 projects, I’ve introduced a Canvas container, with the most commonly used properties conveniently encapsulated in a single object. Combined with mbostocks discussion in Towards Reusable Charts, the canvas container can be used in nearly any project to greatly improve the structure and quality of d3 code.

This Rationalist’s World-View

The myriad parameters to support human life are nearly all emergent.

Look out in the night sky. How many stars do you see? (In the suburbs, maybe 2000). How many of those are actually galaxies? About a dozen. How many planets can you see? 5. How many stars do our telescopes see, in the Milky Way? 300 billion. Galaxies? 170 billion. Planets? Nearly 1000 confirmed (ok, only a dozen or so extra solar have been directly imaged) and another 2,000 awaiting data analysis, and we are literally just getting started. The latest analysis estimates 100 billion planets in the milky way (one every three stars, but more like 3 – 5 every 10 stars, given the way planetary systems form). 17 billion or so of those are probably Earth-like (rocky, with masses between Mars and ~1.5x Earth).

Observers? In *my* Syntax?

Modern graphical programming is dependent on the observer pattern. Its use in Model-View-Controller architectures vaulted the pattern into widespread use. Its continues to find applicability in event and interrupt based systems. The underlying conceptual pattern is astounding. In traditional APIs, the user is allowed to call library code arbitrarily, but there is no mechanism for a library to call user space code. While this is somewhat obviated by extensive callback usage, having formally defined and documented locations where library code calls user code is a great boon in large-scale software architectures. The observer pattern provides such a mechanism. In short, observers are great. How can they be worked even tighter into a coding environment?

Election 2012: Referendum on War

All domestic policies will be for nothing if Israel starts a war with Iran.

The Economy is on everyone’s mind, but the economy’s not going to change overnight (so says Ryan, and I can agree on that point). The Environment is in serious danger of long-term damage that will make it materially more difficult for us as a species to prosper. Our Education system has many calling for a complete overhaul, but that will take years before our best and brightest children are able to make positive changes from such changes.

These are all long-term issues which are critical to building a bright future, and require serious thought in the mid-term.

These will be for nothing if Israel attacks Iran.

Salmon Bake

Fresh fish feels fantastically filling. This salmon bake is great year round, but an especially nice light summer dish.

Spaghetti

The quickest Italian dish ever. If you can’t cook this, you shouldn’t cook. (Actually, you should try it a few more times and figure out how to cook.) If you can’t make this tasty, try a couple more times.

Chili

Cold day or hot, nothing quite says tasty like a bowl of home-made chili. Probably the easiest dish to take and make your own, so many easy things go into the flavors of a pot of easy chili, you can’t help but not experiment with this recipe!

Lazy-Ass Gourmet

The art of cooking Fast, Cheap, Clean

Why aren’t you cooking for yourself? Do you think it’s too expensive? Do you think you don’t know how to cook? Or do you just think you don’t have enough time in the day? If any of those are your excuse, you’re about to lose them. Cooking great food isn’t that difficult once you have a few basic dishes, and with the right recipes, you can be cooking great dinners for yourself or your family in half an hour. This is lazy-ass gourmet, and we’re going to cook the most fantastic meals in no time at all.