This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <syncstream> | |
| #include <iostream> | |
| template<typename... Args> | |
| void print_sync(Args&&... arg) | |
| { | |
| std::osyncstream out(std::cout); | |
| (out << ... << arg) << "\n"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "font_size": 15, | |
| "font_face": "Fira Code", | |
| "trim_trailing_white_space_on_save": "all", | |
| } | |
| { | |
| "cmd": ["bash", "-c", "g++ -pthread --std=c++20 \"${file}\" -o \"${file_base_name}\" -latomic && \"${file_path}/${file_base_name}\""], | |
| "working_dir": "${file_path}", | |
| "selector": "source.c++" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Copy file from a remote host to local host SCP example: | |
| $ scp username@from_host:file.txt /local/directory/ | |
| Copy file from local host to a remote host SCP example: | |
| $ scp file.txt username@to_host:/remote/directory/ | |
| Copy directory from a remote host to local host SCP example: | |
| $ scp -r username@from_host:/remote/directory/ /local/directory/ | |
| Copy directory from local host to a remote hos SCP example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <fstream> | |
| #include <iostream> | |
| #include <vector> | |
| #include <iterator> | |
| #define CHUNK_SIZE (256U) | |
| typedef std::vector<uint8_t> ByteBuffer; | |
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <fstream> | |
| std::ifstream infile("thefile.txt"); | |
| //------------------------------------------- | |
| // Assume that every line consists of two numbers and read token by token: | |
| int a, b; | |
| while (infile >> a >> b) | |
| { | |
| // process pair (a,b) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| static int dump(long address, long len); | |
| static bool file2buffer(const char *pstrFileName, const char *pstrOpenMode, uint8_t **ppui8Buffer, uint32_t *puiBufSize); | |
| static int dump(long address, long len) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <ctype.h> | |
| #include <stdbool.h> | |
| typedef int (*CheckFct)(int); | |
| bool isValidNumber( const char *str, CheckFct pFunc) | |
| { | |
| bool bIsNum = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string> | |
| #include <iostream> | |
| std::string header("$$$:"); | |
| void check(std::string &teststring, std::string &header) | |
| { | |
| std::cout << "Testing: " << teststring << " if starts with header:" << header << std::endl; | |
| if(0 == teststring.rfind(header, 0)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #define NRELEM(x) (sizeof(x)/sizeof(x[0])) | |
| #define INVALID_KEY_VALUE (0xFFFFFFFF) | |
| ///////////////////////////////////////////////////////////////////// | |
| // TYPE DEFINITIONS | |
| ///////////////////////////////////////////////////////////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # How to install pySerial python library | |
| #---------------------------------------- | |
| # 1.) install pip | |
| # ---------------- | |
| # curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | |
| # python get-pip.py | |
| # | |
| # 2.) install pySerial |
NewerOlder