<commit_before>// Copyright (c) 2015, <NAME>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library dlog.example;

import 'package:dlog/dlog.dart' as DLog;

gen(int rows, int cols, List target) {
  cols = rows * cols;
  while (rows-- > 0) {
    while (cols-- > 0) {
      target.add("$rows-$cols");
    }
  }
}

main() {

  var someData = {
    "Vasya": 21,
    "Vanya": 27,
    "Nikolay": 30
  };

  // create table without header (3 column)
  var debugNames = new DLog.Table(2);

  // specity header (optional)
  // this number of overwrite what was specified in the constructor,
  // and vice versa
  debugNames.columns.addAll(["#", "name", "chars", "age"]);

  // set data
  int index = 1;
  someData.forEach((name, age){
    // the number of times specified in constructor or columns
    // the remainder will be skipped
    // > numSkipped = data.length % (columns.length|size)
    debugNames.data.addAll([index++, name, name.length, age]);
  });

  // output for debugging :)
  print(debugNames);

  DLog.Table t1 = new DLog.Table(3);
  t1.columns.addAll(["1","2","3"]);
  gen(10, 3, t1.data);
  print(t1);

  // Dartium (win8-64 i5 34GHz/8Gb): 50000 rows and 4 column = ~315ms
  // (output in the console will be slower)<commit_msg>Clean example file<commit_after>// Copyright (c) 2015, <NAME>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library dlog.example;

import 'package:dlog/dlog.dart' as DLog;

main() {

  var someData = {
    "Vasya": 21,
    "Vanya": 27,
    "Nikolay": 30
  };

  // create table without header (3 column)
  var debugNames = new DLog.Table(2);

  // specity header (optional)
  // this number of overwrite what was specified in the constructor,
  // and vice versa
  debugNames.columns.addAll(["#", "name", "chars", "age"]);

  // set data
  int index = 1;
  someData.forEach((name, age){
    // the number of times specified in constructor or columns
    // the remainder will be skipped
    // > numSkipped = data.length % (columns.length|size)
    debugNames.data.addAll([index++, name, name.length, age]);
  });

  // output for debugging :)
  print(debugNames);

  // Dartium (win8-64 i5 34GHz/8Gb): 50000 rows and 4 column = ~315ms
  // (output in the console will be slower)
{'fraction_non_alphanumeric': 0.14321819713563605, 'fraction_numerical': 0.02990732940185341, 'mean_word_length': 2.9983164983164983, 'pattern_counts': {'":': 6, '<': 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': '757532', 'n_tokens_mistral': 857, 'n_tokens_neox': 781, 'n_words': 268}