Coder Social home page Coder Social logo

Comments (3)

attilaszia avatar attilaszia commented on June 25, 2024

Hm, thats weird, it works for me just as fine as the others.
Anyways, thank you for the overall effort, it is of course very welcome :)

from nonogram.

richelbilderbeek avatar richelbilderbeek commented on June 25, 2024

(attilaszia: no need to read this, this is a note for myself)

Found the cause:

bool Table::Init(std::string filename){
  std::cout << "Initializing a table with " << filename << "\n";
  std::ifstream f;
  std::string line;
  f.open(filename.c_str());
  assert(f.is_open());
  
  int lastindex = filename.find_last_of("."); 
  raw_filename_ = filename.substr(0, lastindex); 
  
  if ( f.is_open() ) {
    if ( getline (f,line) ){
      
      std::stringstream  linestream(line);
      // Setup width, and height 
      linestream >> width_;
      linestream >> height_;

      assert(height_ > 0);
      assert(height_ < 1'000'000'000);
    }
    // Setup cols 
    for (int i=0; i<width_; i++){
      getline (f,line);
      std::vector<int> linedata; 
      std::stringstream linestream(line);
      int value;
      while ( linestream >> value ) {
        linedata.push_back(value);
        assert(linedata.size() < 1'000'000);
      }
      assert(height_ > 0);
      assert(height_ < 1'000'000'000); //HERE
      Line* current_col = new Line(linedata, height_);
      current_col->set_type(kColumn);
      current_col->j(i);
      cols_.push_back( current_col );
      heap_.push( current_col );
    }
  //...
}

2017-04-11-154017_1600x1200_scrot

Leading hypothesis:

  • Windows file format used in the text files

from nonogram.

richelbilderbeek avatar richelbilderbeek commented on June 25, 2024

Works now locally and on Travis, without any bug actually found. May be a Heisenbug. Close anyways.

from nonogram.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.