<commit_before>// decaying

/**
 * Reddit's hot sort
 * (popularized by reddit's news ranking)
 * http://amix.dk/blog/post/19588
 * Corrected for decay errors in post
 */
exports.redditHot = function (decay) {
  if (decay == null) {
    decay = 45000;
  }
  return function (ups, downs, date) {
    var s = ups - downs
      , order = Math.log(Math.max(Math.abs(s), 1), 10)
      , secAge = (Date.now() - date.getTime()) / 1000;
    return order - secAge / decay;
  };
};

/**
 * Hackernews' hot sort
 * http://amix.dk/blog/post/19574
 */
exports.hackerHot = function (gravity) {
  if (gravity == null) {
    gravity = 1.8;<commit_msg>replace erroneous use of Math.log(val, base) with the proper Math.log(val)/Math.log(base) - fixes #1 and slightly downscales initial redditHot values (therefore making them hit zero slightly faster)<commit_after>// decaying

/**
 * Reddit's hot sort
 * (popularized by reddit's news ranking)
 * http://amix.dk/blog/post/19588
 * Corrected for decay errors in post
 */
exports.redditHot = function (decay) {
  if (decay == null) {
    decay = 45000;
  }
  return function (ups, downs, date) {
    var s = ups - downs
      , order = Math.log(Math.max(Math.abs(s), 1)) / Math.LN10
      , secAge = (Date.now() - date.getTime()) / 1000;
    return order - secAge / decay;
  };
};

/**
 * Hackernews' hot sort
 * http://amix.dk/blog/post/19574
 */
exports.hackerHot = function (gravity) {
  if (gravity == null) {
    gravity = 1.8;
{'fraction_non_alphanumeric': 0.15584415584415584, 'fraction_numerical': 0.03349282296650718, 'mean_word_length': 2.914438502673797, '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': '5943576', 'n_tokens_mistral': 562, 'n_tokens_neox': 501, 'n_words': 139}