{"id":18406486,"url":"https://github.com/georgiifirsov/utilites","last_synced_at":"2026-04-24T23:32:42.573Z","repository":{"id":159274044,"uuid":"198784893","full_name":"GeorgiiFirsov/Utilites","owner":"GeorgiiFirsov","description":"Currently it is a set of my utility functions and scripts, which I use in my projects and work tasks. You are free to use and modify this stuff for any target you want :)","archived":false,"fork":false,"pushed_at":"2019-11-18T15:23:35.000Z","size":2320,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-11T13:17:33.253Z","etag":null,"topics":["cpp","libraries","python","utilites"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeorgiiFirsov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-07-25T07:54:37.000Z","updated_at":"2019-11-18T15:23:37.000Z","dependencies_parsed_at":"2023-06-11T16:10:39.447Z","dependency_job_id":null,"html_url":"https://github.com/GeorgiiFirsov/Utilites","commit_stats":null,"previous_names":["georgiifirsov/utilites"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GeorgiiFirsov/Utilites","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FUtilites","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FUtilites/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FUtilites/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FUtilites/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeorgiiFirsov","download_url":"https://codeload.github.com/GeorgiiFirsov/Utilites/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiiFirsov%2FUtilites/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32245147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cpp","libraries","python","utilites"],"created_at":"2024-11-06T03:09:18.419Z","updated_at":"2026-04-24T23:32:42.558Z","avatar_url":"https://github.com/GeorgiiFirsov.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utilites\n\nThis repo contains various utilites for common computer usage and C++ programming. Fell free to use, modify and contribute :)\nMy target is to build a large base of code with useful stuff.\n\n## Table of contents\n\n- Utilites for programming\n  - [ArrayLength](#ArrayLength)\n  - [is_convertible and is_convertible_v](#is_convertible-and-is_convertible_v)\n  - [ThrowsException and ThrowsAnyException](#ThrowsException-and-ThrowsAnyException)\n- Utilites for another tasks\n  - [LookUp](#LookUp)\n\n### ArrayLength\n`ArrayLength` is a function, that calculates length of C-style static array in compile time. Requires at least C++11.\n\nIt was created to use with old API in modern C++, in such moments, when you can not replace C-style array with std::vector, std::string or std::array.\n\nExample:\n\n```cpp\nint aiFirst[] = { 1, 2, 3, 4, 5};\n\nstd::cout \u003c\u003c ArrayLength(aiFirst); // prints: 5\n\nint aiSecond[ArrayLength(aiFirst)];\nassert( ArrayLength(aiFirst) == ArrayLength(aiSecond) );\nassert( ArrayLength(aiSecond) == 5 );\n\nconstexpr auto ulLength = ArrayLength(aiFirst);\nassert( ulLength == 5 );\n```\n\n### is_convertible and is_convertible_v\n\n`is_convertible` is a class, that contains variable value, which is true, when and only when first type is implicitly convertible to second one (same types are allowed). `is_convertible_v` is just a simpler way to use class above.\n\nExample:\n\n```cpp\nstd::cout \u003c\u003c std::boolalpha;\n\nstd::cout \u003c\u003c is_convertible\u003cshort, int\u003e::value;       // prints: true\nstd::cout \u003c\u003c is_convertible_v\u003cshort, int\u003e;            // prints: true\nstd::cout \u003c\u003c is_convertible_v\u003cint, std::vector\u003cint\u003e\u003e; // prints: false\n                                                      // std::vector(int) is explicit constructor\n```\n\n### ThrowsException and ThrowsAnyException\n\nThese two functions return true, if callable object (parameter) throws an exception. Here better to show an example:\n\n```cpp\nvoid foo() noexcept { }\nvoid bar() { throw std::runtime_error(\"Error\"); }\nvoid baz(int t, std::string str) { if (!t) throw std::logic_error(\"Error\"); }\n\nstd::cout \u003c\u003c std::boolalpha;\n\nstd::cout \u003c\u003c ThrowsException\u003cstd::runtime_error\u003e(foo);          // prints: false\n\nstd::cout \u003c\u003c ThrowsException\u003cstd::runtime_error\u003e(bar);          // prints: true\nstd::cout \u003c\u003c ThrowsException\u003cstd::exception\u003e(bar);              // prints: true\nstd::cout \u003c\u003c ThrowsException\u003cstd::logic_error\u003e(bar);            // prints: false\n\nstd::cout \u003c\u003c ThrowsException\u003cstd::logic_error\u003e(baz, 1, \"Text\"); // prints: false\nstd::cout \u003c\u003c ThrowsException\u003cstd::logic_error\u003e(baz, 0, \"Text\"); // prints: true\n\nstd::cout \u003c\u003c ThrowsAnyException(foo);                           // prints: false\nstd::cout \u003c\u003c ThrowsAnyException(bar);                           // prints: true\nstd::cout \u003c\u003c ThrowsAnyException(baz, 1, \"Text\");                // prints: false\nstd::cout \u003c\u003c ThrowsAnyException(baz, 0, \"Text\");                // prints: true\n```\n\n### LookUp\n\nThis simple python script can help you to find files with specific line inside. For instance, you need to find all \nfiles with boolean variable bFlag. So you can run following command:\n```bash\npython LookUp.py dir=my_dir \"bool bFlag\"\n```\n\nFull usage of this utilite:\n```\npython LookUp.py [dir=\u003csearch_dir\u003e] [mode=\u003cmode\u003e] string1 [string2 [string3 ...]]\n        \nSearches strings string1, string2, etc. in all files in specified directory search_dir\n        \nParameters:\n    - dir - directory with files (by default - directory with script)\n    - mode - type of search:\n        0 - search in subdirectories too (default)\n        1 - search only in current directory\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgiifirsov%2Futilites","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgiifirsov%2Futilites","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgiifirsov%2Futilites/lists"}