Skip to content

Instantly share code, notes, and snippets.

View AlexBolotsin's full-sized avatar

AlexBhpp AlexBolotsin

  • Romania, Bucharest
View GitHub Profile
#include <iostream>
#include <string>
using namespace std::string_literals;
void tprintf(const char* format) // base function
{
std::cout << format;
}
class Image
{
public:
int sizeInBytes;
//...
};
Image makeMiniatureImage(Image img) {
//...
return img;
class Image
{
public:
int sizeInBytes
//...
};
Image makeMiniatureImage(Image img) {
//...
return img;
#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
{
#include <string>
#include <iostream>
template <typename T>
class ListNode
{
ListNode* _next = nullptr;
T _value;
public:
ListNode(T value) : _value(value) {}
#include <iostream>
#include <algorithm>
#include <vector>
template <typename T>
using Storage = std::vector<T>;
class ValuesWrapper;
class BigBlobData
class MyStorage : Storate<float>
{
public:
...
class Iterator {
MyIterator(A::SomeClass* ptr)
{
...
bool operator==(const Iterator& itr)...
bool operator!=(const Iterator& itr)...
class MyStorage : Storate<float>
{
public:
...
};
...
{
...
for (auto& item : myStorageInstance)
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;
#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"