<commit_before>var http = require('http')
  , express = require('express')
  , app = express()
  , path = require('path')
  , server = http.createServer(app)
  , spawn = require('child_process').spawn
  , build = require('./build')
  , instruments = require('./instruments');

app.configure(function() {
  app.use(express.bodyParser()); // this is required
  app.use(app.router);
});

app.listen(4723, 'localhost', function() {
  console.log("Appium server running");
});

var appRoot = path.resolve(__dirname, '../sample-code/apps/TestApp/');
var simApp = path.resolve(appRoot, 'build/Release-iphonesimulator/TestApp.app');

build(appRoot, function(err) {
  if (err) {
    console.log(err);
    process.exit(1);
  }

  console.log("Launching instruments...");
  var inst = instruments(
    app
    , simApp
    , null
    , path.resolve(__dirname, 'bootstrap_example.js')
    , path.resolve(__dirname, '../app/uiauto/Automation.tracetemplate')
  );

  inst.launch(function() {
    inst.sendCommand("mainWindow.textFields()[0].setValue('3');", function() {
      inst.sendCommand("mainWindow.textFields()[1].setValue('5');", function() {
        inst.sendCommand("mainWindow.buttons()[0].tap();", function() {
          inst.sendCommand("mainWindow.staticTexts()[0].value()", function(sum) {
            console.log("Sum should be 8 and is " + sum);
            inst.shutdown();
          });
        });
      });
    });
  }, function(code) {
    process.exit(code);
  });
});<commit_msg>update instruments example with new paths<commit_after>var http = require('http')
  , express = require('express')
  , app = express()
  , path = require('path')
  , server = http.createServer(app)
  , spawn = require('child_process').spawn
  , build = require('./build')
  , instruments = require('./instruments');

app.configure(function() {
  app.use(express.bodyParser()); // this is required
  app.use(app.router);
});

app.listen(4723, 'localhost', function() {
  console.log("Appium server running");
});

var appRoot = path.resolve(__dirname, '../sample-code/apps/TestApp/');
var simApp = path.resolve(appRoot, 'build/Release-iphonesimulator/TestApp.app');

build(appRoot, function(err) {
  if (err) {
    console.log(err);
    process.exit(1);
  }

  console.log("Launching instruments...");
  var inst = instruments(
    app
    , simApp
    , null
    , path.resolve(__dirname, '../app/uiauto/bootstrap.js')
    , path.resolve(__dirname, '../app/uiauto/Automation.tracetemplate')
  );

  inst.launch(function() {
    inst.sendCommand("mainWindow.textFields()[0].setValue('3');", function() {
      inst.sendCommand("mainWindow.textFields()[1].setValue('5');", function() {
        inst.sendCommand("mainWindow.buttons()[0].tap();", function() {
          inst.sendCommand("mainWindow.staticTexts()[0].value()", function(sum) {
            console.log("Sum should be 8 and is " + sum);
            inst.shutdown();
          });
        });
      });
    });
  }, function(code) {
    process.exit(code);
  });
});
{'fraction_non_alphanumeric': 0.19210351692103517, 'fraction_numerical': 0.007962840079628402, 'mean_word_length': 3.466666666666667, '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': '4786122', 'n_tokens_mistral': 952, 'n_tokens_neox': 941, 'n_words': 153}