This file contains 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 <iostream> | |
#include <string> | |
using namespace std::string_literals; | |
void tprintf(const char* format) // base function | |
{ | |
std::cout << format; | |
} | |
This file contains 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
class Image | |
{ | |
public: | |
int sizeInBytes; | |
//... | |
}; | |
Image makeMiniatureImage(Image img) { | |
//... | |
return img; |
This file contains 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
class Image | |
{ | |
public: | |
int sizeInBytes | |
//... | |
}; | |
Image makeMiniatureImage(Image img) { | |
//... | |
return img; |
This file contains 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 <iostream> | |
#include <string> | |
//#include <string_view> | |
constexpr long operator"" _KB(unsigned long long int value) { return value * 1024; } | |
long operator"" _MB(unsigned long long int value) { return value * 1024 * 1024; } | |
long operator"" _GB(unsigned long long int value) { return value * 1024 * 1024 * 1024; } | |
class A | |
{ |
This file contains 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> | |
template <typename T> | |
class ListNode | |
{ | |
ListNode* _next = nullptr; | |
T _value; | |
public: | |
ListNode(T value) : _value(value) {} |
This file contains 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 <iostream> | |
#include <algorithm> | |
#include <vector> | |
template <typename T> | |
using Storage = std::vector<T>; | |
class ValuesWrapper; | |
class BigBlobData |
This file contains 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
class MyStorage : Storate<float> | |
{ | |
public: | |
... | |
class Iterator { | |
MyIterator(A::SomeClass* ptr) | |
{ | |
... | |
bool operator==(const Iterator& itr)... | |
bool operator!=(const Iterator& itr)... |
This file contains 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
class MyStorage : Storate<float> | |
{ | |
public: | |
... | |
}; | |
... | |
{ | |
... | |
for (auto& item : myStorageInstance) |
This file contains 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
QString time_str1 = "02:43:02.343"; // .343 | |
QString time_str2 = "02:43:07.176"; // .643 | |
QDateTime time1 = QDateTime::fromString(time_str1, "hh:mm:ss.zzz"); | |
QDateTime time2 = QDateTime::fromString(time_str2, "hh:mm:ss.zzz"); | |
qint64 diff = time1.msecsTo(time2); | |
int seconds = diff / 1000; | |
int msec = diff % 1000; | |
qDebug() << "HEre is your time" << seconds << msec; |
This file contains 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 <windows.h> | |
#include <iostream> | |
int main() | |
{ | |
STARTUPINFO si; | |
PROCESS_INFORMATION pi; | |
ZeroMemory(&si, sizeof(si)); | |
si.cb = sizeof(si); | |
ZeroMemory(&pi, sizeof(pi)); | |
// "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" |
NewerOlder