Coder Social home page Coder Social logo

heckel_diff's Introduction

heckel-diff

Project for learning C++. Inspired by IGListKit (https://github.com/Instagram/IGListKit).

Based on Paul Heckel's linear time diffing paper (http://documents.scribd.com/docs/10ro9oowpo1h81pgh1as.pdf)

Feedback gratefully received.

Modify

The Algorithm<T> currently accepts std::string, size_t and uint32_t

  • vi example/main.cpp (or favourite editor) and do your modifications
  • cmake -H. -Bbuild && cd build && make

Notes

The tests have a wall_clock and cpu_clock (TEST(HeckelDiff, Benchmark)) test set to expect 1600 diffs to run in no greater than wall_clock 16.67ms (60fps). You may have to adjust this as your computer requires.

I use some of the non NSIndexPath test conditions from IGListKit (https://github.com/Instagram/IGListKit).

CPPLint.cfg is available.

heckel_diff's People

Contributors

rowungiles avatar

Stargazers

Kvar Izunia avatar Diomidis Spinellis avatar

heckel_diff's Issues

Algorithm fails when inserting elements in the middle of the file

The following (failing) test case demonstrates the problem.

TEST(HeckelDiff, SameEnd) {

    std::vector<std::string> original{"1" , "4" , "5" , "8" , "9"};
    std::vector<std::string> updated{"1" , "4" , "5" , "6" , "7" , "8" , "9"};

    auto expected_inserted = new std::vector<std::string>{"6", "7"};

    testExpectations<std::string>(original, updated, expected_inserted, nullptr, nullptr, nullptr);

    delete expected_inserted;
}

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.