Coder Social home page Coder Social logo

Results history option about ttyper HOT 2 OPEN

max-niederman avatar max-niederman commented on June 19, 2024
Results history option

from ttyper.

Comments (2)

JulianWgs avatar JulianWgs commented on June 19, 2024 2

I'd would like to propose a JSON data structure for this, which would save all necessary data to replay the trial and do thorough analysis.

{
    "word": [
        {"start_datetime": "2021-08-02 17:36:22.2", "keystrokes": "word", "timings": [0.2, 0.1, 0.1, 0.2], "trial_hash": "a4f8e2"},
        {"start_datetime": "2021-08-02 17:37:25.7", "keystrokes": "wort\bd", "timings": [0.3, 0.1, 0.1, 0.3, 0.1, 0.1], "trial_hash": "a4f8e2"}
    ]
}

Alternatively it would also be possible to put the word into the data structure. The datetime string should be formatted so it is best read by common parsers. Alternatively one could save the int64 representation.

Zipping this would lead to very small files. Also they could be saved separately for each trial and then concatenated if needed.

Having the really detailed data available would be very convenient for in depth analysis:

  • Which words are the hardest for me? Where do I spend time?
  • Which sequences (like the "-ion" ending) are the hardest for me?
  • How did I improve over time?
  • At which time of day do I perform best?

Providing a easy to parse data structure makes it easy to analyze the data in other frameworks or languages.

Best regards
Julian

EDIT: Think through this one more time I actually would prefer a solely csv based data structure. It is again easier to parse than json (for example with excel) and concatenating is also much easier. Also when zipping it, it should make no difference in filesize (zipping uses a dictionary). Also reading from one or multiple csv files is embarrassingly parallelize-able.

start_datetime,keystrokes,timings,trial_hash
2021-08-02 17:36:22.2,word,0.2 0.1 0.1 0.2,a4f8e2

I'm not sure how to best represent the timings. But joining them with a spacebar should work out.

from ttyper.

max-niederman avatar max-niederman commented on June 19, 2024 1

I've been thinking about this issue for a little bit, and I think it would be best to store the results internally using a binary file format or JSON, and then provide multiple exporters for different file formats.

Using serde, this would be quite easy to implement for most JSON-like formats. It also has the advantage of minimizing uncompressed file sizes, and if we store the results internally, we could easily implement automatic compression if file size is still an issue.

As for @JulianWgs' suggestion of using CSV, I definitely think providing a CSV exporter could be useful, but I also think a lot of thought needs to be put into the encoding since our data is essentially a two-dimensional list of characters (keystrokes, really) annotated with a duration, plus some metadata about the test; there's simply no good way to encode a two-dimensional list of tuples in a CSV file. @JulianWgs' proposed encoding would certainly work, but I'm not sure if it would be much easier to parse than JSON because of the space-delimited timings, which won't work well with e.g. Excel.

As for performance concerns, I don't think there really are any. It's true that CSVs are stupidly easy to append to, but if we use a file per test we won't ever need to and each results object should almost never be larger than a few dozen KBs.

from ttyper.

Related Issues (20)

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.