Beau's tumblr

Apr 10

CSS a go go

Ran into some weirdness just now while reading the basic but well put together intro to haskell http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way

me: jump to 3.2.4
me: and see if you can spot that oh so rare bug that wouldn't be picked up by the compiler
mate: 3.2.4?
mate: heading?
me: search for 3.2.4
me: "Trees" is a bit general
mate: 0 hits
me: the fuck..

So…

<h4 id="trees">Trees</h4>

No 3.2.4 mentioned anywhere in the html. Ok. Check the CSS.

.article #afterheader h4::before {
  content: counter(niv02)"."counter(niv03)"."counter(niv04)". ";
}

I don’t know whether to be impressed by this or horrified. On the one hand, aint CSS cool these days? On the other, I can’t rely on these section numbers, and at least in Chrome I can’t search for them or copy+paste them either. I think that section numbers probably fall more under content than structure.

Jul 27

Topological sort of a DOT Graph

Today I needed to get a sequential execution order for a system that I already had a DOT dependency graph of, which I knew contained no cycles.

Currently I don’t officially have access to.. well, anything resembling a development environment at all really, so I was faced with the prospect of doing this in vba. As my masochism is underdeveloped I haven’t actually tried this yet, but given I can barely read vba I’d estimate this task at at least a few hours, with a worst-case blowout of a day.

Obviously I didn’t do that, so below is the code to do it in perl, research time 15 minutes, development time 5 minutes. Let me say that again: 20 minutes, versus a few hours. Multiply that out by the amount of time you hire programmers for and how much you pay them and see how well your “risk of getting a virus mitigated by locking down all IT resources” strategy is stacking up.

use Graph::Reader::Dot;
use Graph;

my $reader = Graph::Reader::Dot->new();
my $graph = $reader->read_graph($ARGV[0]);

my @sorted_nodes = $graph->topological_sort;

foreach(@sorted_nodes) {
  print $_,"\n";
}

Tl;dr Let the people doing the work decide on the tools.

(I used perl instead of ruby because I couldn’t find a gem to read DOT files)

Jul 09

“The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.” — John Carmack

Jun 22

Oracle enhanced adapter for Rails 3 -

It makes me very happy that someone continues to work on this.

Jun 14

Martin Fowler on team room layouts -

My favourite bit:

First make sure it is the right size for the team. While a team room should be open within itself, it should be closed to everyone else

Yes, a million times yes.

Jun 01

Interview with Jim Coplien -

I really enjoyed this interview (but I’m weird that way) with Jim Coplien. Goes over many many things, the rise of functional programming techniques, the prevalence of class-oriented programming over object-oriented programming, the DCI architecture and some general thoughts about Scrum and Agile and just plain old professionalism.

It’s also the first mention I’ve seen of DCI, which led me here, which is also very interesting.

It’s all much more articulate than my “it’s easy to construct and interact with the domain model, but where does the doing go?” refrain at least.

Apparently if I end with a question mark people can ‘answer’, but not otherwise. Stupidest feature ever by tumblr?

May 25

Flay for cucumber -

Quick very hacky job to get flay to give some duplication metrics on cucumber files, gives ideas on where your features are repeating themselves and should be refactored into higher level steps or at least moved into Background’s and Outline’s.

Only tested on a regular cucumber install run from the root directory of a rails app, likely won’t work anywhere else.

May 01

There are two novels that can change a bookish fourteen-year old’s life: The Lord of the Rings and Atlas Shrugged.

One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world.

The other, of course, involves orcs.

” — @jeremydmiller who doesn’t know the original source

Apr 29

DRX - ruby object inspection

This is so freaking cool source

Steps to get running on ubuntu:

sudo apt-get install libtcltk-ruby tk-tile
sudo gem install drx
irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'drx'
=> true
irb(main):003:0> 123.see
=> nil
irb(main):004:0> 

Anyone who ever saw me use ‘ddd’ will understand why I love this.

Apr 21

Weird history

Ada Lovelace - Commonly known as the first programmer

chiefly known for her work on Charles Babbage’s early mechanical general-purpose computer, the analytical engine. Her notes on the engine include what is recognized as the first algorithm intended to be processed by a machine;

fathered by

Lord Byron - Famous poet, “mad, bad and dangerous to know” who used his place in the house of lords to support the Luddites

His first speech before the Lords was loaded with sarcastic references to the “benefits” of automation, which he saw as producing inferior material as well as putting people out of work.

I wonder if daddy was proud? :-)