Posts by pepper_chico • 1,228 points
20 posts
-
3
votes3
answers2490
viewsA: What are the differences between pointer and reference in c++?
references in si (not the referenced type), are always const, therefore always initialized once, pointers not. It may be difficult to imagine an attempt to reset a reference, since after the initial…
-
7
votes2
answers325
viewsA: How to use random in C++?
#include <random> #include <iostream> int main() { using namespace std; random_device rng; // Gerador de números randômicos próprio para gerar seeds. mt19937 prng(rng()); // Gerador…
c++answered pepper_chico 1,228 -
4
votes5
answers3666
viewsA: How do I know the last commit to move the same file as my commit?
From the repository root directory: git diff --name-only <rev>^! | xargs git log <rev>^ -1 -- Where <rev> is the SHA-1 (or SHA-1 piece) of your commit that contains the files you…
gitanswered pepper_chico 1,228 -
10
votes4
answers584
viewsA: How to verify the efficiency of these 2 functions in C++?
Overall, responses so far address the measurement of efficiency in practical terms. I will give you an answer in theoretical terms, since you ask two questions: How to determine the equations of…
-
19
votes5
answers2269
viewsA: Is Nosql as troublesome as it seems?
The CAP Theorem (Consistency/Availability/Partition tolerance) refers to the integrity of these three items in a distributed system, and does not particularly refer to SQL or Nosql systems. What…
-
4
votes2
answers1104
viewsA: How is Garbage Collection implemented in Go?
Programs written in Go language, although compiled, will have the resources required by the specification embedded in the generated executable. The language will be compiled as well as C, C++, Rust,…
-
5
votes5
answers1927
viewsA: Why is multiplication faster than division?
The following is a table with the clock latency of the multiplication and division operations for comparison. Note that if your program actually does perform such operations, this is what will occur…
-
5
votes3
answers9428
viewsA: How does serial communication work and how do I use C/C++?
Apparently you are asking about the implementation of serial communication instead of simply asking how it is used. Good, for this recommend a good book of Linux drivers, recommend the Linux Device…
-
0
votes2
answers131
viewsA: Pick singularly characters in a multiple string
This regular expression is a minimum of 8 characters, a-za-Z characters: [[:alpha:]]{8,} or [a-zA-Z]{8,}
-
3
votes3
answers1655
viewsA: How to verify which technologies the CPU supports at runtime?
The library Yeppp! seems to have what you seek [1], [2], seems to be quite portable, and has a permissive license. Normally it will be used with the intention of enjoying high-level SIMD operations,…
-
0
votes3
answers869
viewsA: Time measurement in Windows
C++11 provides high_resolution_clock, is the ideal solution but microsoft still does not provide a correct implementation that uses Queryperformancecounter. This is considered a bug, and it looks…
-
3
votes2
answers259
viewsA: Removal of repeated values
Vector-only alternative solution (using Generic Both of c++14): #include <vector> #include <utility> #include <iostream> #include <algorithm> using namespace std; int main()…
-
5
votes2
answers182
viewsA: Should old tags and branches be deleted from the remote repository?
There is no single solution, what I recommend is to do a search in the various types of workflows and see what fits best with your company’s way of working. Regardless of which one is chosen, when…
gitanswered pepper_chico 1,228 -
2
votes2
answers892
viewsA: Upload localhost application for online domain (hosted on my computer)
If you really want to see your application on your online machine on some domain, have you tried DDNS? noip for example? I have already made my machine accessible online via noip + settings…
-
2
votes3
answers1531
viewsA: How to identify heat regions in thermal images?
I have no experience on the subject but I know that Opencv is widely used for image processing, and, in the case of a thermal camera, I imagine that warmer than normal areas are highlighted on…
-
8
votes3
answers640
viewsA: What is the use of nested blocks in Java?
The example block you gave is a Instance Initializer with purpose other than a simple block of scope. Whenever you find these loose blocks within the body of a class, it comes to that and not the…
javaanswered pepper_chico 1,228 -
0
votes5
answers453
viewsA: Is it legal to delete this in a member function?
Comparing the two cases, there is a difference that in the second the execution of the code still involves making the call to the member function, and in the first this has already occurred. Without…
-
7
votes2
answers185
viewsA: How to make an IO "equivalence" in Java and C++?
The default formatting in C++ tries to act "smart" and discards zeros from the decimal place that do not interfere with the value, if you put 1.1 both of you will see that the exit will be the same.…
-
12
votes7
answers14277
viewsA: What can C++ do that C# can’t?
C++ is Turing-complete, C# too, so with computational effort it can be done the same with both. Limitations will appear due to the environment under which they will be submitted and not to a…
-
2
votes4
answers152
viewsA: Is a compiler allowed to omit a reference member in a class?
Your case has already is was a problematic situation: #include <iostream> struct Type { int a, b, c; int& ref; Type(int m) : a(m), b(m), c(m), ref(a) { } }; int main() { Type a(42); Type…