<commit_before>#include "stdsneezy.h"
#include "database.h"
#include "lowtools.h"
#include <unistd.h>

int main(int argc, char **argv)
{
  TDatabase db(DB_SNEEZYBETA);
  vector<int>vnums;
  map<sstring,sstring>val;
  char file[]="/tmp/sqledobjXXXXXX";
  FILE *tmpfile;
  sstring buf, sbuf;
  int answer;

  if(argc<=1){
    printf("Usage: sqledobj <vnum list>\n");
    printf("Example: sqledobj 13700-13780 13791 13798\n");
    exit(0);
  }

  if(!parse_num_args(argc-1, argv+1, vnums))
    exit(0);

  for(unsigned int i=0;i<vnums.size();++i){
    printf("Fetching data for object %i\n", vnums[i]);

    db.query("select * from obj where vnum=%i", vnums[i]);
    if(db.fetchRow()){
      buf = fmt("- obj\n"); sbuf+=buf;
      buf = fmt("vnum: %s\n") % db["vnum"];  sbuf+=buf;
      buf = fmt("name: %s\n") % db["name"];  sbuf+=buf;
      buf = fmt("short_desc: %s\n") % db["short_desc"];  sbuf+=buf;
      buf = fmt("long_desc: %s\n") % db["long_desc"];  sbuf+=buf;
      buf = fmt("action_desc: %s\n") % db["action_desc"];  sbuf+=buf;
      buf = fmt("type: %s\n") % db["type"];  sbuf+=buf;
      buf = fmt("action_flag: %s\n") % db["action_flag"];  sbuf+=buf;
      buf = fmt("wear_flag: %s\n") % db["wear_flag"];  sbuf+=buf;
      buf = fmt("val0: %s\n") % db["val0"];  sbuf+=buf;
      buf = fmt("val1: %s\n") % db["val1"];  sbuf+=buf;
      buf = fmt("val2: %s\n") % db["val2"];  sbuf+=buf;
      buf = fmt("val3: %s\n") % db["val3"];  sbuf+=buf;
      buf = fmt("weight: %s\n") % db["weight"];  sbuf+=buf;
      buf = fmt("price: %s\n") % db["price"];  sbuf+=buf;
      buf = fmt("can_be_seen: %s\n") % db["can_be_seen"];  sbuf+=buf;<commit_msg>added a call to loadToggles<commit_after>#include "stdsneezy.h"
#include "database.h"
#include "lowtools.h"
#include <unistd.h>

int main(int argc, char **argv)
{
  TDatabase db(DB_SNEEZYBETA);
  vector<int>vnums;
  map<sstring,sstring>val;
  char file[]="/tmp/sqledobjXXXXXX";
  FILE *tmpfile;
  sstring buf, sbuf;
  int answer;

  toggleInfo.loadToggles();


  if(argc<=1){
    printf("Usage: sqledobj <vnum list>\n");
    printf("Example: sqledobj 13700-13780 13791 13798\n");
    exit(0);
  }

  if(!parse_num_args(argc-1, argv+1, vnums))
    exit(0);

  for(unsigned int i=0;i<vnums.size();++i){
    printf("Fetching data for object %i\n", vnums[i]);

    db.query("select * from obj where vnum=%i", vnums[i]);
    if(db.fetchRow()){
      buf = fmt("- obj\n"); sbuf+=buf;
      buf = fmt("vnum: %s\n") % db["vnum"];  sbuf+=buf;
      buf = fmt("name: %s\n") % db["name"];  sbuf+=buf;
      buf = fmt("short_desc: %s\n") % db["short_desc"];  sbuf+=buf;
      buf = fmt("long_desc: %s\n") % db["long_desc"];  sbuf+=buf;
      buf = fmt("action_desc: %s\n") % db["action_desc"];  sbuf+=buf;
      buf = fmt("type: %s\n") % db["type"];  sbuf+=buf;
      buf = fmt("action_flag: %s\n") % db["action_flag"];  sbuf+=buf;
      buf = fmt("wear_flag: %s\n") % db["wear_flag"];  sbuf+=buf;
      buf = fmt("val0: %s\n") % db["val0"];  sbuf+=buf;
      buf = fmt("val1: %s\n") % db["val1"];  sbuf+=buf;
      buf = fmt("val2: %s\n") % db["val2"];  sbuf+=buf;
      buf = fmt("val3: %s\n") % db["val3"];  sbuf+=buf;
      buf = fmt("weight: %s\n") % db["weight"];  sbuf+=buf;
      buf = fmt("price: %s\n") % db["price"];  sbuf+=buf;
      buf = fmt("can_be_seen: %s\n") % db["can_be_seen"];  sbuf+=buf;
{'fraction_non_alphanumeric': 0.23522388059701493, 'fraction_numerical': 0.020298507462686566, 'mean_word_length': 3.510094212651413, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, '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': '2707322', 'n_tokens_mistral': 1462, 'n_tokens_neox': 1426, 'n_words': 276}