<commit_before>var express = require('express');
var router = express.Router();


router.get('/add', function(req, res, next) {

    // Set our internal DB variable
    var db = req.db;

    var target = req.query.target;
    var source = req.session.signum;

    if (target == undefined || target == source) {
        console.log("Using default user self");
        target = "yourself";
    } 
    
    console.log("Source: [" + source +  "]  Targeting: [" + target + "]");

    // Set our collection
    var collection = db.get('skills');
    collection.find({},{},function(e,docs){
        res.render('profileAdd', {
            "skillsList" : docs,
            "stepDetails": "Please select between 3 and 5 values that describe ",
            "target" : target 
        });
    });
});


router.get('/show', function(req, res, next) {

    // Set our internal DB variable
    var db = req.db;

    var attrMatrix = {};

    var attrCollection = db.get('skills');
    attrCollection.find({},{},function(e,result){
        for (var attributeTmp in result) {
            //console.log(result[attributeTmp]["skillTitle"]);
            attrMatrix[result[attributeTmp]["skillTitle"]]=[];
        }
        
    });

    var target = req.query.target;
    var source = req.session.signum;
    if (target == undefined) {
        console.log("Using default user self");
        target = source;
    } 
    
    console.log("Source: [" + source +  "]  Targeting: [" + target + "]");

    // Set our collection
    var collection = db.get('attributesPerPersonByDate');


    //collection.find({target: 'ecapati'},{},function (err, result) {
      collection.find({target: target},{},function (err, result) {
      if (err) {
        console.log(err);
      } else if (result.length) {
        //console.log('Found:', result);

        var modifiedResult = [];
        

        for (var name in result) {

          attributes = result[name].attributes;<commit_msg>Update tmpOptimizedProfiles.js<commit_after>var express = require('express');
var router = express.Router();


router.get('/add', function(req, res, next) {

    // Set our internal DB variable
    var db = req.db;

    var target = req.query.target;
    var source = req.session.signum;

    if (target == undefined || target == source) {
        console.log("Using default user self");
        target = "yourself";
    } 
    
    console.log("Source: [" + source +  "]  Targeting: [" + target + "]");

    // Set our collection
    var collection = db.get('skills');
    collection.find({},{},function(e,docs){
        res.render('profileAdd', {
            "skillsList" : docs,
            "stepDetails": "Please select between 3 and 5 values that describe ",
            "target" : target 
        });
    });
});


router.get('/show', function(req, res, next) {

    // Set our internal DB variable
    var db = req.db;

    var attrMatrix = {};

    var attrCollection = db.get('skills');
    attrCollection.find({},{},function(e,result){
        for (var attributeTmp in result) {
            //console.log(result[attributeTmp]["skillTitle"]);
            attrMatrix[result[attributeTmp]["skillTitle"]]=[];
        }
        
    });

    var target = req.query.target;
    var source = req.session.signum;
    if (target == undefined) {
        console.log("Using default user self");
        target = source;
    } 
    
    console.log("Source: [" + source +  "]  Targeting: [" + target + "]");

    // Set our collection
    var collection = db.get('attributesPerPersonByDate');


    //collection.find({target: 'carlos'},{},function (err, result) {
      collection.find({target: target},{},function (err, result) {
      if (err) {
        console.log(err);
      } else if (result.length) {
        //console.log('Found:', result);

        var modifiedResult = [];
        

        for (var name in result) {

          attributes = result[name].attributes;
{'fraction_non_alphanumeric': 0.15895218718209564, 'fraction_numerical': 0.001017293997965412, 'mean_word_length': 2.3701799485861184, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4127260', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1128, 'n_words': 272}