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.

Getting late but sleep is about the last thing I feel like right now. What’s the point really? I’ll just wake up in an hour or three, and be looking for ways to forget my dreams, or end up thinking my brains senseless. My dreams have been horrible lately.

It usually takes a few weeks of non stop moving before my body demands a proper crash landing. Now if only I could work myself that tired, and get real rest.

Something about having a dozen windows open and a gazillion tabs of everything running, reminds me just how much I hate task bars. Alt+tab ftw.

Just a fluke or signs of an impending FML moment?

The desktops entire display blanked out, yet the monitor continued to display that it was receiving signal. Regardless of what I did, it wouldn’t display anything! Managed to RDP into it from the laptop and found everything working perfectly fine. On reboot everything worked as normal. Obviously I made sure the male VGA connector was properly inserted, and reseated it, but that didn’t make any difference.


The big question is it a fluke, or associated to the freak overheat a while back? Either way, it doesn’t bode well be it the hardware (GPU, Mobo) or software (crap driver, crap Windows kernel).


Just woke up, couldn’t have dozed off for more than 15-20 minutes. Dreamt everything ended up suitably close to exploding or agonizingly ambiguous, that by the time dreams became peaceful, I could sense my mind grepping to find it’s way back and sort things out. I nearly woke up screaming.

I really think my sleep patterns are setting a new level in ridiculousness.

I have a lot on my mind, one could say much to much food for though. While I try to live in the moment, for the most part, my mind never ceases, it’s even worse when more on the idle side.

For some reason, I feel very tired..