<commit_before>console.log('hello world');

var socket = io('http://localhost:22079');

socket.on('getLastMsgs', function(data) {
  data.forEach(function(item) {
    $('.msgs').prepend(format(item));
  });
});

socket.on('newMsg', function(data) {
  $('.msgs').append(format(data, data.nickname === $('#nickname').val()));
});

$('#send').click(() => {
  let nickname = $('#nickname').val();
  let msg = $('#msg').val();

  socket.emit('send', {
    nickname: nickname,
    msg: msg
  });
});

socket.emit('getLastMsgs');

function format(item, isColored) {
  var str = "";

  if (!isColored)
     str ='<p> [';
  else
    str = '<p style="color: blue"> [';

  return str + new Date(item.date).toLocaleTimeString() + '] ' + item.nickname + ' ' + ' > ' + item.msg + '</p>';
}<commit_msg>Fix client app<commit_after>var socket = io('/');

socket.on('getLastMsgs', function(data) {
  data.forEach(function(item) {
    $('.msgs').prepend(format(item));
  });
});

socket.on('newMsg', function(data) {
  $('.msgs').append(format(data, data.nickname === $('#nickname').val()));
});

$('#send').click(() => {
  let nickname = $('#nickname').val();
  let msg = $('#msg').val();

  socket.emit('send', {
    nickname: nickname,
    msg: msg
  });
});

socket.emit('getLastMsgs');

function format(item, isColored) {
  var str = "";

  if (!isColored)
     str ='<p> [';
  else
    str = '<p style="color: blue"> [';

  return str + new Date(item.date).toLocaleTimeString() + '] ' + item.nickname + ' ' + ' > ' + item.msg + '</p>';
}
{'fraction_non_alphanumeric': 0.2593565331582403, 'fraction_numerical': 0.003282994090610637, 'mean_word_length': 3.8846153846153846, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4073123', 'n_tokens_mistral': 557, 'n_tokens_neox': 544, 'n_words': 96}