{"id":18574873,"url":"https://github.com/smorodov/scrollingbuffer","last_synced_at":"2025-05-16T00:13:10.109Z","repository":{"id":146751241,"uuid":"222709049","full_name":"Smorodov/ScrollingBuffer","owner":"Smorodov","description":"Simple scrolling buffer I used for multimodal time series applications.","archived":false,"fork":false,"pushed_at":"2019-11-19T14:04:54.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T15:11:32.411Z","etag":null,"topics":["algorithms","cpp","multimodal-time-series","queue","ring-buffer","scrolling-buffer","time-series","time-series-analysis","time-series-processing"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Smorodov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-19T13:59:56.000Z","updated_at":"2021-08-12T19:41:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea40e588-4c0f-44db-a0c5-c4b3aa3c93f5","html_url":"https://github.com/Smorodov/ScrollingBuffer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smorodov%2FScrollingBuffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smorodov%2FScrollingBuffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smorodov%2FScrollingBuffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smorodov%2FScrollingBuffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Smorodov","download_url":"https://codeload.github.com/Smorodov/ScrollingBuffer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442855,"owners_count":22071878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","cpp","multimodal-time-series","queue","ring-buffer","scrolling-buffer","time-series","time-series-analysis","time-series-processing"],"created_at":"2024-11-06T23:16:45.616Z","updated_at":"2025-05-16T00:13:09.878Z","avatar_url":"https://github.com/Smorodov.png","language":"C++","readme":"# Scrolling buffer #\nSimple scrolling buffer implementation I used for multimodal time series applications.\n```cpp\n#include \u003ciostream\u003e\n#include \u003cnumeric\u003e\n#include \"ScrollingBuffer.h\"\n\nvoid main (void)\n{\n    size_t N_channels=3;\n    size_t N_samples = 4;\n    ScrollBuffer\u003cint\u003e buff(N_channels, N_samples);\n    std::cout \u003c\u003c \"Just created buffer content:\" \u003c\u003c std::endl;\n    buff.print(N_samples);\n    std::cout \u003c\u003c \"Let's fill it:\" \u003c\u003c std::endl;\n    for (int i = 0; i \u003c N_samples; ++i)\n    {\n        std::vector\u003cint\u003e sampleVector(N_channels);\n        std::iota(sampleVector.begin(), sampleVector.end(), i * N_channels);\n        buff.appendSample(sampleVector);\n    }\n    buff.print(N_samples);\n    std::cout \u003c\u003c \"Let's append 2 more:\" \u003c\u003c std::endl;\n    for (int i = N_samples; i \u003c N_samples+2; ++i)\n    {\n        std::vector\u003cint\u003e sampleVector(N_channels);\n        std::iota(sampleVector.begin(), sampleVector.end(), i * N_channels);\n        buff.appendSample(sampleVector);\n    }\n    buff.print(N_samples);\n    std::cout \u003c\u003c \"Let's get sample (ind = 2):\" \u003c\u003c std::endl;\n    std::vector\u003cint\u003e sampleVector;\n    buff.getSample(2, sampleVector);\n    std::cout \u003c\u003c \"[ \";\n    for (auto x : sampleVector)\n    {\n        std::cout \u003c\u003c x \u003c\u003c \" \";\n    }\n    std::cout \u003c\u003c \"]\" \u003c\u003c std::endl;\n\n    std::cout \u003c\u003c \"Let's get channel (ind = 1):\" \u003c\u003c std::endl;\n    std::vector\u003cint\u003e channelVector;\n    buff.getChannel(1, channelVector);\n    std::cout \u003c\u003c \"[ \";\n    for (auto x : channelVector)\n    {\n        std::cout \u003c\u003c x \u003c\u003c \" \";\n    }\n    std::cout \u003c\u003c \"]\" \u003c\u003c std::endl;\n    \n    std::cout \u003c\u003c \"Let's get selected samples (1-2) of channel (ind = 1):\" \u003c\u003c std::endl;\n    buff.getChannel(1, 1, 2, channelVector);\n    std::cout \u003c\u003c \"[ \";\n    for (auto x : channelVector)\n    {\n        std::cout \u003c\u003c x \u003c\u003c \" \";\n    }\n    std::cout \u003c\u003c \"]\" \u003c\u003c std::endl;\n\n    std::cout \u003c\u003c \"And get buffer's data storage:\" \u003c\u003c std::endl;\n    int* data = buff.getBuffer();\n    std::cout \u003c\u003c \"[ \";\n    for (int i = 0; i \u003c N_samples* N_channels; ++i)\n    {     \n        std::cout \u003c\u003c data[i] \u003c\u003c \" \";\n    }\n    std::cout \u003c\u003c \"]\" \u003c\u003c std::endl;\n}\n```\n\nThe code above produces output:\n\n```\nJust created buffer content:\n0 0 0 0\n0 0 0 0\n0 0 0 0\nLet's fill it:\n0 3 6 9\n1 4 7 10\n2 5 8 11\nLet's append 2 more:\n6 9 12 15\n7 10 13 16\n8 11 14 17\nLet's get sample (ind = 2):\n[ 12 13 14 ]\nLet's get channel (ind = 1):\n[ 7 10 13 16 ]\nLet's get selected samples (1-2) of channel (ind = 1):\n[ 10 13 ]\nAnd get buffer's data storage:\n[ 6 7 8 9 10 11 12 13 14 15 16 17 ]\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmorodov%2Fscrollingbuffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmorodov%2Fscrollingbuffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmorodov%2Fscrollingbuffer/lists"}