Just got home a little bit ago, found the desktop had dropped off the wireless. Luckily the ruby scripts I had left open weren’t disturbed :-/.

Today, I found one positive thought, and I can’t even remember what the hell it was…

Lately things feel like it’s life in a daze. It must be something like 90% of my train of thought is spent grinding on the same subjects, and zero hour just moves closer with each passing moment. Sometimes I wonder if I’ve any marbles left in my head.

I know for a fact, that her royal pains’ funds for petrol have just doubled, and were no where near exhausted yet. Still the car spends most of this week idle. Work forces a driving boost next week in order for HRP to make a greater profit, but knowing my mother, you can bank on the required night driving to take months. I offered a long time ago to put what few bits I’ve got saved towards fuel, to no result. Deadline expires soon, and I did mean it quite literally as a deadline. What else is to expire with it? All my life, I’ve always been expected to suck it up, carry 150% and keep going, get shiat on from every direction and never say a word. I’m fucking tired of it. I’m drowning and everyone still sits on their fat ass.

The other day, I remember pointing out that if I was *actually* a smart person, I wouldn’t be here. A friend corrected me: “If you were less caring you wouldn’t be there”. I guess that’s accurate, because if I didn’t, I wouldn’t. Maybe smart people don’t care about other people, I don’t know. Some how, I’ve always considered myself to be a selfish person; someone, somewhere will undoubtedly agree with that accessement. Despite that prang, I still care very deeply for the people around me. Sometimes I reckon, that makes things hurt all the more.

Right now I just wish I could slam my head into a wall and pass out for a while, but I know better than to break the wall. My mother would never let me hear the end of that; land lord would also be a tad P.O.’d as well.

Just got home and out of the shower a little bit ago. Missed my morning run (again), because I was trying to get crap wrapped up before work. Had to cut that short with HRP driving me bananas sufficient in advance of having to get dressed, that it was pointless. So I just left my computer on and went off to work.

Trying to get some spells of focused coding is about the only relief I get, and they’re to far and few in between. Decided to take a walk after work, before even arriving. Between pacing at work and being on foot, I’ve walked at least 10km today. I’ve been in a terrible mood. At least walking, I can both be alone and have solitude when desired; being at home is as good as being alone, and periodically bitched at or tapped by someone who expects to be waited on like an invalid.

They can fry their eggs out on pavement, but they won’t fry me! Weather service was saying 94F/34C with the humidity enough that it is `supposed` to feel like 99F/37C. That is skin-melting by local standards. Well suck an egg, because that’s not hot. I had a thick shirt and jeans on, no hat, and rarely any shade: but you can’t tell me that was ‘too’ hot to be walking in. Nadda. After growing up in Florida, it has REALLLY got to be smoking out before I’ll take notice. Few places in the country have that intensity or worse, and those out of the states that do, well should we say also know what > 120F/~50C looks like.

Only stopped for about 5 minutes when passing through a dingy park, but otherwise kept on the move; either trying to think or trying not to. Decision day is inching ever closer.

On one positive side, my brother might make an appearance at some point in a way that may lead to some driving time; he’s more interested in barrowing the few bucks I have 8=). I can’t help but remember an old expression about being useless.

Hooah, about an hours sleep and no dreams, now I just need to stay awake…

How I tend to build projects, or why it’s usually painful on build tools

I’ll typically setup what I call a tripple-tree, or a quad-tree layout. Each project has three top level tree structures that represent a phase of “Getting it done”. Hacking it, building it, and distributing it.

A source directory (typically src or Source), that houses  the projects code, and basically everything you/I want under version control. Structure varies but I tend to create modular bundles out of habit.

A build directory (typically Build/Architecture/OS or Build/Architecture.OS), that houses all essential build time files for that configuration, that won’t be distributed. I test builds against multiple Operating Systems, and synchronise the work directory between machines; so being able to have builds of each concurrently tucked away is a bonus. Sometimes I go further and subdivide the build tree into different configurations, such as Release/Optimised/Debug builds, but I rarely have need to.

A distribution directory (typically Dist/Architecture/OS or Dist/Architecture.OS), that contains all the files needed for a user to simply extract to a folder on that given system, and run the program. Worth while for me, for the same reasons as the build tree, plus the added benefit of simple a zip/tar installation!

Sometimes I also create a fourth tree called ‘Vendor’ or ‘Deps’, that functions like the source tree, but instead contains the code for whatever libs are required. Plus customised project files/build scripts to compile them when needed.

Like wise, I’ll often have an associated set of FILES in the top level, and a documentation directory providing all pertinent information. I particularly pay attention to writing down notes about boot strapping builds, and porting the system to a new environment; because you never know when the next sap sending patches will be you.

Oh so many people ship IDE project files that reek of laziness or brain damage. Me, I’m so damn lazy that I don’t want to have to explain it, in fact, I don’t even want to edit it later. I just want the thing to *work* when I tell it to build sth. It takes time to do it that way, but it is usually worth it. At least, for cross-platform freaks like me.

Programming is a subject that I do take seriously.

Quick & Painless C/C++ header installations using rake

In wrapping up and refactoring my new rake driven build system, I’ve written numerous utility functions. Most stuff specific to compiling crap is in a custom “Builder” module that provides a templated interface to the current OS/Compiler kit, via environment variables and methods like make_object, make_shared_library. My top level rakefile also has a neato inference rule rigged together for handling my triple-tree and quad tree build patterns.

The real fun of the day however, is this baby:


#
# A magic function that generates file tasks that copy all headers from
# directory ind # to directory outd.  Any missing directories are created as
# needed.
#
# The return value is a list suitable for the right hand side of a task, e.g.
#
#   task :headers => header_magic(src, dest)
#
def header_magic(ind, outd)
  dirs = []
  hdrs = []

  find_files(ind, /.*.h[hxp]*$/) do |p|
    outdir = File.dirname p.sub(ind, outd)
    outfile = File.join(outd, File.basename(p))

    directory outdir
    file outfile => p do
      cp_r p, outdir
    end
    dirs.push outdir
    hdrs.push outfile
    CLEAN.include outfile, outdir
  end

  dirs+hdrs
end
find_files is another custom function, it simply takes a block and yields and file names matching the specified pattern. (In this case, more liberal than the usual header extensions but sufficient for my needs)
I call it header_magic, because it after all the other stuff I played with, it’s the closest to Clarke’s third law. Which is exactly what I want!
footnote: I just have my top level clean task nuke the entire build tree; so the CLEAN part hasn’t been tested.