<commit_before>var Application = require("../application");
var Message = require("../../component/client/message");
var Resource = require("../../component/resources/resource");
var Component = require("../../component/component");
var util = require("util");
var util = require("path");

//-----------------------------------------------------------
// Class Definition
//-----------------------------------------------------------

/*
 * A trivial application example. This does nothing but provide a UI to enter messages, 
 * and echo back all received messages with the same content.
 */
function Echo(id) {
  Application.super_.call(this, id);
};
util.inherits(Echo, Application);
var p = Echo.prototype;

//-----------------------------------------------------------
// Methods 
//-----------------------------------------------------------

p._initializeClientResources = function(callback) {
  // Only one resource is needed, and this must be loaded immediately on client connection.
  // The async method is used as an example for applications with more resources.
  var self = this;
  var fns = [
    function(asyncCallback) {
      var filepath = path.resolve(__dirname, "./echoClient.js");
      var data = new String(fs.readFileSync(filepath));  
      var resource = new Resource(Resource.TYPE_JAVASCRIPT, "/echo/echoClient.js", data);
      self.factory.resources.defineBootstrapResource(resource, asyncCallback);
    }
  ];
  async.parallel(fns, callback);
};

p.receive = function(message, clientId) {
  // Echo back the content of received messages.
  var echoMessage = new Message(message.data, this.id);
  this.send(echoMessage, clientId);
};

p.connection = function(client) {
  // do nothing
};

p.disconnection = function(clientId) {
  // do nothing  
};

//-----------------------------------------------------------
// Exports - Class Constructor
//-----------------------------------------------------------

module.exports = Echo;<commit_msg>Bad path fixed<commit_after>var Application = require("../application");
var Message = require("../../component/clientInterface/message");
var Resource = require("../../component/resources/resource");
var Component = require("../../component/component");
var util = require("util");
var util = require("path");

//-----------------------------------------------------------
// Class Definition
//-----------------------------------------------------------

/*
 * A trivial application example. This does nothing but provide a UI to enter messages, 
 * and echo back all received messages with the same content.
 */
function Echo(id) {
  Application.super_.call(this, id);
};
util.inherits(Echo, Application);
var p = Echo.prototype;

//-----------------------------------------------------------
// Methods 
//-----------------------------------------------------------

p._initializeClientResources = function(callback) {
  // Only one resource is needed, and this must be loaded immediately on client connection.
  // The async method is used as an example for applications with more resources.
  var self = this;
  var fns = [
    function(asyncCallback) {
      var filepath = path.resolve(__dirname, "./echoClient.js");
      var data = new String(fs.readFileSync(filepath));  
      var resource = new Resource(Resource.TYPE_JAVASCRIPT, "/echo/echoClient.js", data);
      self.factory.resources.defineBootstrapResource(resource, asyncCallback);
    }
  ];
  async.parallel(fns, callback);
};

p.receive = function(message, clientId) {
  // Echo back the content of received messages.
  var echoMessage = new Message(message.data, this.id);
  this.send(echoMessage, clientId);
};

p.connection = function(client) {
  // do nothing
};

p.disconnection = function(clientId) {
  // do nothing  
};

//-----------------------------------------------------------
// Exports - Class Constructor
//-----------------------------------------------------------

module.exports = Echo;
{'fraction_non_alphanumeric': 0.2916455696202532, 'fraction_numerical': 0.0, 'mean_word_length': 1.8081023454157783, 'pattern_counts': {'":': 0, '<': 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': '4010113', 'n_tokens_mistral': 934, 'n_tokens_neox': 914, 'n_words': 275}