<commit_before><?php

require_once(__DIR__.'/../db.php');

function get_nb_jours_total() {
  return 15;
}
function get_nb_jours_restant() {
  global $bdd;
  $req = $bdd->prepare("SELECT DATEDIFF('2016-10-18', inserted_at) as nb FROM documents ORDER BY inserted_at DESC LIMIT 1");
  $req->execute();
  $data = $req->fetch();
  return $data['nb'];
}

function get_pc_done() {
  $total = get_nb_documents();
  $contribs = get_nb_contribs();
  $done = get_nb_done();
  return ($done / $total) * (get_nb_jours_total() - get_nb_jours_restant()) / get_nb_jours_total();
}

function get_rand_document() {
  global $bdd;<commit_msg>Arrondit pour les stats<commit_after><?php

require_once(__DIR__.'/../db.php');

function get_nb_jours_total() {
  return 15;
}
function get_nb_jours_restant() {
  global $bdd;
  $req = $bdd->prepare("SELECT DATEDIFF('2016-10-18', inserted_at) as nb FROM documents ORDER BY inserted_at DESC LIMIT 1");
  $req->execute();
  $data = $req->fetch();
  return $data['nb'];
}

function get_pc_done() {
  $total = get_nb_documents();
  $contribs = get_nb_contribs();
  $done = get_nb_done();
  return ceil(($done / $total) * (get_nb_jours_total() - get_nb_jours_restant()) / get_nb_jours_total());
}

function get_rand_document() {
  global $bdd;
{'fraction_non_alphanumeric': 0.16798732171156894, 'fraction_numerical': 0.017432646592709985, 'mean_word_length': 5.072115384615385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2197355', 'n_tokens_mistral': 495, 'n_tokens_neox': 474, 'n_words': 96}