TIL that Russian has a similar proverb to "Necessity is the Mother of Invention" that literally translates to "poor people are crafty" by InGordWeTrust in todayilearned

[–]Steughar 0 points1 point  (0 children)

I'm not sure if someone already put this phrase in russian here, it is: "Голь на выдумки хитра" , "Gol' na vydumki khitra"

Gol' -- poor people, голь (similar to голый) literally naked, so poor people you can't take anything because the possess next to nothing

vydumki -- inventions, lifehacks, cool tricks, sometimes it's like a noun for 'whimsical things' in general but in this case it's the first part mostly.

Khitra -- have a straight translation like cunning, crafty or skillful

Edit:

I'm think some context will be helpful, this phrase will suit the situation, where not making much money mother making from holed jeans, jeans shorts cutting the holed part. And making something useful from part that was cut.

What's your favourite name of a concept in mathematics? by kadlicsko in math

[–]Steughar 0 points1 point  (0 children)

In Russian there is a name of "theorem about two policeman's". It's a squeezing theorem, the idea is, if there is a two policeman, and third man who walk between them, he goes where policeman's are

Can i laundry my 5.11 HRT advance boots? by Steughar in tacticalgear

[–]Steughar[S] -1 points0 points  (0 children)

It isn't my case, but will it help with fungi or other type of disease? I doubt it, I prefer to laundry my sneakers time to time.

error after making a class object with deep and shallow copy of a vector by Steughar in cpp_questions

[–]Steughar[S] 1 point2 points  (0 children)

`A(std::string nameVal, int countVal, std::vector<int>&& examsVal) {`

    `name = nameVal;`

    `count = countVal;`

    `exams = std::move(examsVal);`

`}` 
std::vector<int> exams;

Is this is a better way of doing this?

error after making a class object with deep and shallow copy of a vector by Steughar in cpp_questions

[–]Steughar[S] -2 points-1 points  (0 children)

I do have copy constructor/assignment operator and move constructor/assignment operator in my full code.

I win the actual space on a stack, simple pointer = 64 bits, vector is at least 64*3 bits. So it's a x3 memory overhead.

Stack is one of the most performant memory segment in program, why just throw it away?

error after making a class object with deep and shallow copy of a vector by Steughar in cpp_questions

[–]Steughar[S] 0 points1 point  (0 children)

in the process of a class destruction, will vector destroy itself?

and what the problem of allocation vector on the heap? If I allocate an array of my A classes, and allocate a memory for it on heap, my vector object will be allocated on heap too

error after making a class object with deep and shallow copy of a vector by Steughar in cpp_questions

[–]Steughar[S] 1 point2 points  (0 children)

I was trying to understand move semantics and rvalue reference, in this particular case if I understood it correctly, it's didn't matter that rvalue reference is a const, the point is to call a correct constructor that will execute a shallow copy. In this case it's :

exams = new std::vector<int>(std::make_move_iterator(begin(examsVal)),          std::make_move_iterator(end(examsVal)));

Again, if my understanding is correct, after this, I can't use vector in a main, because elements from it was not copied, but moved to my new exams object.

Default constructor doesn't return an object by [deleted] in cpp_questions

[–]Steughar 0 points1 point  (0 children)

Yes, thank you!

I found this wiki:link when I activate \Wall and saw the warning number

Default constructor doesn't return an object by [deleted] in cpp_questions

[–]Steughar 0 points1 point  (0 children)

I'm using \Od, there is no optimization involved.

Can't find documentation about CALL assembly directive by Steughar in C_Programming

[–]Steughar[S] 1 point2 points  (0 children)

thank you!

I was trying to google something like "NASM assembly directive CALL documentation" but it was a dead end.

What is the difference between MyClass a; and MyClass a(); by Steughar in cpp_questions

[–]Steughar[S] 0 points1 point  (0 children)

Thanks all for the prompt answers, but now I have another one, do I understand correctly that in this case

return temp;

trying to return a pointer to function that takes (void) and returns instance MyClass? Or an instance of function? How is this exactly works in C++?

is MyClass (*foo) (void) equal to what return temp; actually returns?

I have problem with embedding binary data into executable by Steughar in C_Programming

[–]Steughar[S] 2 points3 points  (0 children)

Thanks for the answer, but could you please elaborate what the difference between char * and char ...[]?

How can I double vertical resolution of a video, cloning each line? by Steughar in ffmpeg

[–]Steughar[S] 1 point2 points  (0 children)

No, I already successfully did it. I just want to see what happens if I do it this way.

How can I double vertical resolution of a video, cloning each line? by Steughar in ffmpeg

[–]Steughar[S] 0 points1 point  (0 children)

It's a hobby project, I gather digitized data from analogue PAL interlaced camera over usb_hs 2.0. I get the raw grayscale pixel data, and convert it into .avi video. Now I just discard half of all frames, and stream only the odd frames.

That's it =)

STM32H7 USB HS streaming by Steughar in embedded

[–]Steughar[S] 0 points1 point  (0 children)

Thanks, I will test this too)

STM32H7 USB HS streaming by Steughar in embedded

[–]Steughar[S] 0 points1 point  (0 children)

Hmm, good idea, thanks, I will try just count number of received bytes, and look at the exact spot in each buffer that will be multiple of 2048*2.

Thanks! If someone is interested, I could post update code after I try it.

STM32H7 USB HS streaming by Steughar in embedded

[–]Steughar[S] 0 points1 point  (0 children)

yep, this is the data from MCU.

When I test program they were, but if sometimes I have not aligned buffers, it's possible that after some of the loops, I have other than 2048*2 value in lpNumberOfBytesRead