<commit_before>var shoe = require('shoe');
var through = require('through');
var dnode = require('dnode');

var result = document.getElementById('result');

var stream = shoe('/mouse');


var s = through(function (msg) {

  // msgs are real mouse position
  console.log('mouse',msg);

  result.appendChild(document.createTextNode(msg));
  this.queue(String(Number(msg)^1));
})


stream.pipe(s).pipe(stream);

var d = dnode();
var dnodeResult = document.getElementById('dresult');

d.on('remote', function (remote) {
  remote.transform('beep', function (s) {
    dnodeResult.textContent = 'beep => ' + s;
  });

  remote.log('touch support',"ontouchend" in document);
  var touchel = document.getElementById('touch')
  var ts = touchStream(touchel,remote);


  document.body.on('mousemove',function(){
    remote.log('mousemove!');
  });

});
d.pipe(shoe('/dnode')).pipe(d);


function touchStream(el,remote){
  var s = through(function(data){
    var last = data;
    if(!this.paused) return this.queue(data);
  });


  var start = function(ev){
    remote.log('touchstart',arguments);
  }, end = function(ev){
    remote.log('touchend',arguments);
  }, move = function(ev){
    remote.log('touchmove',arguments);
  };

  remote.log('binding touch events');
  el.addEventListener('touchstart',start,false);
  el.addEventListener('touchend',end,false);
  el.addEventListener('touchmove',move,false);

  s.on('end',function(){
    el.removeEventListener('touchstart',start);
    el.removeEventListener('touchend',end);
    el.removeEventListener('touchmove',move);
  })

  return s;

}


<commit_msg>the internet likes me more<commit_after>var shoe = require('shoe');
var through = require('through');
var dnode = require('dnode');

var result = document.getElementById('result');

var stream = shoe('/mouse');

alert(3);

var s = through(function (msg) {

  // msgs are real mouse position
  console.log('mouse',msg);

  result.appendChild(document.createTextNode(msg));
  this.queue(String(Number(msg)^1));
})


stream.pipe(s).pipe(stream);

var d = dnode();
var dnodeResult = document.getElementById('dresult');

d.on('remote', function (remote) {
  remote.transform('beep', function (s) {
    dnodeResult.textContent = 'beep => ' + s;
  });

  remote.log('touch support',"ontouchend" in document);
  var touchel = document.getElementById('touch')
  var ts = touchStream(touchel,remote);


});
d.pipe(shoe('/dnode')).pipe(d);


function touchStream(el,remote){
  var s = through(function(data){
    var last = data;
    if(!this.paused) return this.queue(data);
  });


  var start = function(ev){
    console.log('start');
    remote.log('touchstart');
   
    ev.preventDefault();
    return false;
  }, end = function(ev){
    console.log('end');
    remote.log('touchend');
    ev.preventDefault();
    return false;
  }, move = function(ev){
    console.log('move');
    remote.log('touchmove');
    ev.preventDefault();
    return false;
  };

  remote.log('binding touch events');
  el.addEventListener('touchstart',start,false);
  el.addEventListener('touchend',end,false);
  el.addEventListener('touchmove',move,false);

  s.on('end',function(){
    el.removeEventListener('touchstart',start);
    el.removeEventListener('touchend',end);
    el.removeEventListener('touchmove',move);
  })

  return s;
}

window.onerror = function(e){
  alert('error!: '+e+'');
}

{'fraction_non_alphanumeric': 0.1811443818559146, 'fraction_numerical': 0.0008894159501927068, 'mean_word_length': 4.68013468013468, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5639431', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1079, 'n_words': 197}