<commit_before>/*
To lint the JS code in this project, run:

  jslint.js lib/piped.js lib/configurator.js --nomen --plusplus --white --node --continue --eqeq --vars

Also see:

  http://www.jslint.com/
*/


// *********************************
// Libraries
// *********************************

var U               = require('util');
var Base            = require('./base');
var C               = require('./common');
var Configurator    = require('./configurator');
var LL              = require('./local_listen');
var RS              = require('./remote_send');

// *********************************
// Utility functions
// *********************************

function _usage( msg ) {
    var usage = "\n\
Usage: node lib/piped.js /path/to/config file [--option=value, ...]\n\
    ";

    return "ERROR: " + msg + usage;
}

// *********************************
// Main program
// *********************************

(function( config_file, opts ) {
    var BO = new Base.BaseObject();

    if( config_file === undefined ) {
        // I don't know what to do with out a config file.
        throw _usage( "Missing config file" );
    }

    // Callback will be called when the config is ready to go.
    Configurator.config( config_file, opts, function( config_object ) {

        // This will now be available to any other object building
        // off of BaseObject; It's the FIRST thing we should set, so
        // all other code can access it.
        BO._set_config_object( config_object );

        // If you enabled trace, let's show you the config we're
        // running with
        C._trace( config_object );

        // We only care about the config at this point, not the
        // default config or options passed in
        var config = config_object.config;

        // *********************************
        // TCP server
        // *********************************

        if( config.tcp_port ) {
            var tcp = new LL.LocalStreamListen(
                        'tcp', config.tcp_port, config.bind_address );

            C._trace( tcp.is_stream );
        }

        var rs = new RS.RemoteStreamSend(
                    "tcp://localhost:10001", "localhost", 10001 );


    });

// first arg to the app is the config file, the rest are arguments
}( process.argv[2], process.argv.slice(3) ) );
<commit_msg>* fire up an admin server<commit_after>/*
To lint the JS code in this project, run:

  jslint.js lib/piped.js lib/configurator.js --nomen --plusplus --white --node --continue --eqeq --vars

Also see:

  http://www.jslint.com/
*/


// *********************************
// Libraries
// *********************************

var U               = require('util');
var Base            = require('./base');
var C               = require('./common');
var Configurator    = require('./configurator');
var LL              = require('./local_listen');
var RS              = require('./remote_send');
var AdminServer     = require('./admin_server');

// *********************************
// Utility functions
// *********************************

function _usage( msg ) {
    var usage = "\n\
Usage: node lib/piped.js /path/to/config file [--option=value, ...]\n\
    ";

    return "ERROR: " + msg + usage;
}

// *********************************
// Utility functions
// *********************************




// *********************************
// Main program
// *********************************

(function( config_file, opts ) {
    var BO = new Base.BaseObject();

    if( config_file === undefined ) {
        // I don't know what to do with out a config file.
        throw _usage( "Missing config file" );
    }

    // Callback will be called when the config is ready to go.
    Configurator.config( config_file, opts, function( config_object ) {

        // This will now be available to any other object building
        // off of BaseObject; It's the FIRST thing we should set, so
        // all other code can access it.
        BO._set_config_object( config_object );

        // If you enabled trace, let's show you the config we're
        // running with
        C._trace( config_object );

        // We only care about the config at this point, not the
        // default config or options passed in
        var config = config_object.config;

        // *********************************
        // Admin Server
        // *********************************
        AdminServer.AdminServer( config.admin_port, config.admin_bind_address );
    });

// first arg to the app is the config file, the rest are arguments
}( process.argv[2], process.argv.slice(3) ) );


/*

        // *********************************
        // TCP server
        // *********************************

        if( config.tcp_port ) {
            var tcp = new LL.LocalStreamListen(
                        'tcp', config.tcp_port, config.bind_address );

            C._trace( tcp.is_stream );
        }

        var rs = new RS.RemoteStreamSend(
                    "tcp://localhost:10001", "localhost", 10001 );

*/

{'fraction_non_alphanumeric': 0.24112631370216142, 'fraction_numerical': 0.004759071980963712, 'mean_word_length': 2.252095422308188, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5343982', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1295, 'n_words': 421}