I use my rad-scripts node module to quickly set up management and automation of my active projects.  I now have a couple private node modules:

  • mah-haus is my node module that mass-manages all my repos – it’s great; with one command I can completely sync my entire dev station when I start/finish a session
  • atci is for my AbetterTrader project and gives me all the dev tools I need to build, publish, and run continuous integration

Thanks node.js, I love my new automated life.  Should I publish these modules even though they have no real public use?  Nah, why pollute the npm-isphere?  But I will put this post here so I can use it for the module home pages.  😉  Carry on!

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.

 

I pushed my http[s] RESTy client and server to github yesterday.  It’s almost there.  Today, working on favicon.ico support.  Cmon!

Persistent notes will go on the wiki.

There are a million ways to do CI.  My goal is to keep it as simple as possible.  Concepts:

  • My target projects include multi-platform C++ applications, Firefox addons, cross-platform desktop apps, mobile apps, and web apps with lots of JavaScript and JavaScript libraries.
  • I want to use a simple-to-use very-capable cross-platform scripting language.  I’ve concluded that I will use JavaScript via Node.js.  It is async and portable from the day it was born.  Installing a node.js module for scripts means they are available from any path on any platform’s command line.
  • For CI tasks, I will avoid dependencies on anything else.  The core Node.js API is very capable.  Modules are available if needed (eg the amazing aws-sdk) but will be avoided whenever possible.
  • I need intelligent placement of CI windows (eg a popup shell for build-on-save).  My Ubuntu i3 window manager is capable of this, as is Autohotkeys under Windows.  These auto-placed windows will always run cross-platform node scripts.
  • If you want to use Powershell, for the love of all that’s holy, make sure you fix its terrible default of hiding debug output with:
       $global:DebugPreference = "Continue"
  • Goals:
    • on code save: automatically build
    • on code commit: automatically build, do any custom build steps, run any unit tests, run any end-to-end tests, and report results dynamically
    • on app production release: compile artifacts, assist in automatic versioning

See the wiki for details.

I’m writing trading software called A better Trader.  For the web UI, I started using some basic JQuery and JQuery UI, with a mind to kick the tires on Bootstrap.  I dug in and after looking at a  bazillion frameworks and libraries (some fading, some up and coming, NONE really owning it)… K.I.S.S. is ruling the day.  I’m finding myself happy with the following:

  • HTML5 with support for multimedia, flexboxes, dragon droppings, etc.
  • JQuery && (JQuery UI || bootstrap)
  • D3 for all things visual… so good…
  • iframes!  Yep!  API calls typically return SVG-based graphic components in iframes, and API parent pages combine them into application-like views.

On the back end, I’m doing RESTful services with boost ASIO.  It’s a light clean set of tools.  I will probably stand up bootstrap on the front end, and node.js on the back end, for comparison.  We’ll see how it goes.