Category : resize

Is there an alternative to resize() of an std::vector, which only allows the increase the size of the vector std::vector v; v.resize(10); v.resize(5); –> v.size() == 5, but I like its length to stay at 10 and moreover I like its data not to be (potentially) deleted. I could use std::vector v; v.resize(std::max(v.size(),10)); v.resize(std::max(v.size(),5)); This ..

Read more

Note: This a self answered question. It cause me some headache to solve it in past, so I think it is worth to share. I have a qml application designed for HD resolution(1366×768). It’s using QtQuick.Layouts, so adaptable to custom resolution. But resizing it to less than HD resolution makes it squishy and meaningless. I ..

Read more

I have a working Linux script, but i am too stupid to translate this to a windows 10 batch. I want to make identical size for landscape and for portrait (800×600 or 600×800) from images recursive in a folder. I want to fill the "stripes" with the background color of the image (position 0,0). Linux: ..

Read more

I am new to programming and have a c++ computer progam exam coming up and am doing some exercises to practice. There is one exercise i keep getting stuck on and it’s the folowing : #include <iostream> #include <vector> using namespace std; int main() { const int PAGE_SIZE = 4; vector<int> sizes = {3, 6, ..

Read more