text:
/* global describe, require, it, before, after, beforeEach, afterEach */
"use strict";

// safer to ensure this here (in addition to grunt:env:test)
process.env.NODE_ENV = 'test';

var Q = require( "q" ),
    chai = require( "chai" ),
    expect = chai.expect,
    chaiAsPromised = require( "chai-as-promised" ),
    app = require( '../../config/express' ),
    model = require( '../../app/models/account-model' ),
    config = require( "../../app/models/config-model" ).server;

chai.use( chaiAsPromised );

describe( 'Account Model', function() {

    describe( 'get: when attempting to obtain an account', function() {

        it( 'returns an error when the account does not exist', function() {
            return expect( model.get( 'nonexisting' ) ).to.eventually.be.rejected;
        } );

        // the test below assumes the config.json server url does not have the http:// prefix
        it( 'returns the hardcoded account object', function() {
            var account, getAccountPromise;

            config[ 'linked form and data server' ][ 'server url' ] = 'example.com';

            account = {
                key: config[ 'linked form and data server' ][ 'api key' ],
                openRosaServer: 'http://' + config[ 'linked form and data server' ][ 'server url' ]
            };
            getAccountPromise = model.get( account );

            return Q.all( [
                expect( getAccountPromise ).to.eventually.have.property( 'key' ).and.to.equal( account.key ),
                expect( getAccountPromise ).to.eventually.have.property( 'openRosaServer' ).and.to.equal( account.openRosaServer )
            ] );
        } );
    } );

} );


text:
namespace ai
{

	struct sGenome
	{
		double fitness;
		vector<double> chromo;

		sGenome() : fitness(0) {}
		sGenome(const vector<double> &w, double f) : chromo(w), fitness(f) {}

		friend bool operator< (const sGenome& lhs, const sGenome& rhs) {
			return (lhs.fitness < rhs.fitness);
		}
		const sGenome& operator=(const sGenome &rhs) {
			if (this != &rhs)
			{
				fitness = rhs.fitness;
				chromo = rhs.chromo;
			}
			return *this;
		}
	};

	class cGeneticAlgorithm
	{
	public:
		cGeneticAlgorithm();
		virtual ~cGeneticAlgorithm();

		bool InitGenome();
		bool AddGenome(const sGenome &genome);
		const vector<sGenome>& GetGenomes() const;
		void Epoch(const uint grabBestFitCnt=4);

	protected:
		sGenome GetChromoRoulette();
		void GrabNBest(int NBest, const int NumCopies, OUT vector<sGenome> &out);

	public:
		vector<sGenome> m_genomes;
	};

}

redpajama_set_name: RedPajamaGithub