Node is fun!  Except when it’s not.  It’s pretty easy stuff, but I was burned by a couple things today while debugging.  Take note!

  • You can – and MUST, at times – mess with installed node modules; hack away directly at their source for instantaneous satisfaction!
    • find them here:
      • linux (always easier): ~/.npm
      • Windows: C:\Users\#name#\AppData\Roaming\npm
    • however, watch out that you follow dependencies properly; if a module requires another, it will often keep a copy underneath its folder; there may also be a global copy in the root npm folder
  • debugging is most easily accomplished by the good old-fashioned “jam in print statements” hacker methodology
    • via console.log(“WHAT IS HAPPENING!?);
  • when you grow up and want to get into serious debugging, use linux, and sling your code into the Chrome debugger, via node-inspector

I’ve documented my Phabricator workflow on the wiki.  It’s working great.  The very-configurable workboard column configuration can make querying difficult. But epriestley works hard to keep the whole thing driving forward without it spinning into chaos.  I just did a [git pull] and got the new features I was looking for that allowed me to save sort defaults for my workboards, just perfect.  I’m still waiting for one more feature, but I have workarounds described on the wiki to keep my flow pretty damned tight.

Simple reason: because it’s open source software.

Specific advantages that Scite has over Sublime, because it is OSS:

  • It runs on Pi (because, like, WE HAVE THE SOURCE)
  • With a solarized setup, it’s just as pretty
  • No NAG SCREENS OMG kill me now

Sublime is great.  Scite is better.

I gave myself an hour to add multi-line search-and-replace support in my code.  It took 3, and C++11 std::regex_replace() gave me a hard crash with inline replacement.  The syntax can be annoying (for example, using double escape), so for reference, here’s a jumpstart.

Given:

using namespace std;
string str = "Lots of text to search\nacross lines";
string from = "text[\\s\\S]*lines";
string to = "rainbows";

Boost happily did the job:

#include 
 boost::regex reg;
 reg.assign(from);
 str = boost::regex_replace(str,reg,to,boost::match_default);

C++11 is even simpler, but it crashes with gcc 4.9.2 if you use the same string for source and target, like this:

#include 
 std::regex reg(from);
 str = std::regex_replace(str,reg,to);

You can fix that by using a swap string:

#include 
 regex reg(from);
 string newstr = regex_replace(str,reg,to);
 str = newstr;

But it isn’t working across lines, with this particular syntax, and I’ve seen others complain that they couldn’t get multiline syntax going.  I’ll stick with boost for now until this smooths out a little bit more.  Onwards.

 

Agile is really important.  I’ve commented before that it’s nothing new, but it’s an important refinement.  It allows you to quickly think about priorities, every day, and then focus on the highest one.  Very important.

I’ve played with a lot of development planning tools over the years, and JIRA Agile is at the top.  But I will always go open source whereever it is an option.  I stood up Phabricator and so far it has been very little pain to get a solid quality set of Agile boards going for my top 4 projects.  The “Conduit” API appears a bit dicey to navigate, but if I can get that going, I’ll have board-driven priorities for all my projects on my home page.  Onwards.