Comments (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.
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)
- Add CLI arg to disable the backspace key
- Pull real world quotes from Wikipedia or similar.
- Fails with "cargo install ttyper"! HOT 2
- wordcount to screen HOT 1
- [Feature Request] Sudden death mode HOT 1
- [Feature Request] Add option to not show the typing output HOT 1
- Code clarity: consider renaming "Test" to "Exam" or something HOT 1
- "Bug" report: Holding control while typing letters causes the letters to be typed still
- [Feature request] Option to read text data for typing from file or stdin HOT 1
- Incorrectly showing underlines in Conemu on Windows 7 HOT 2
- [Feature Request] Import quotes or paragraph from json file or standard output. HOT 1
- [Feature Request] add the keybind to restart the typing test on click of "TAB" key HOT 2
- Piped text into ttyper can sometimes prematurely terminate
- [Feature] Keystroke dwelling (or key-hold) time stat
- Add Homebrew formula to install on macOS HOT 4
- Add "Practice missed words" option on results page
- Error: division by zero HOT 1
- Don't show `worse keys` with 100% accuracy HOT 2
- Idea report results HOT 1
- Ctrl+Backspace acting as regular Backspace in Windows Terminal HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ttyper.