Posts by Luiz Vieira • 34,160 points
330 posts
-
7
votes2
answers818
viewsA: Pixel distribution algorithm
As I have already commented, there are a multitude of suggestions that can be made. But unfortunately you have not given feedback regarding your problem, so there is no way to suggest something more…
-
2
votes3
answers1307
viewsA: Count elements between two quantities
Your project has two errors. Problem 1 As already answered, you can not use more than one comparison criterion in the function CONT.SE. For that, you accurate use the function CONT.SES (which allows…
-
6
votes1
answer1032
viewsA: How to rotate an image without knowing the angle of inclination?
To rotate an image without knowing the angle you need estimate the inclination (in the documentation, read the topic "Parameter Estimation"). This pet works by comparing notable points between an…
-
9
votes1
answer220
viewsA: How to determine the character’s level by gaining experience?
Your problem is not programming, but mathematics. Your experiment calculation uses the following "formula": float neededExperience = ((level - 1) * experienceRatio) * level; Calling neededExperience…
-
8
votes2
answers1435
viewsA: A game-specific programming language
Is there a specific programming language for development video game? No. Simply because there are no unique or special requirements when developing games that would require a specific programming…
-
3
votes2
answers728
viewsA: Find equal ranges in a list
I don’t think it’s trivial (maybe even possible) to do this directly with Excel formulas because it involves an interactive search. So, I believe the best way is even using VBA. An example of a…
-
7
votes4
answers549
viewsA: Problem with polymorphism
The answers obtained are all very good and already provide much of what AP needs to learn, considering his need is learning the concepts of interfaces and polymorphism. Still, how these concepts are…
-
3
votes2
answers425
viewsA: Use delete on allocated objects without new?
Important remark: In this answer I use freely the term "static" allocation and "dynamic" to refer respectively to the allocation of data in the stack and no heap. I call stack allocation "static"…
-
6
votes1
answer22028
viewsA: Add photo in excel spreadsheet from local folder
As far as I know there isn’t a ready-made formula that can do this. But you have a few options. Option 1 The simplest option and that does not involve VBA (uses only existing formulas and functions…
-
4
votes1
answer1039
viewsA: C++ - Convert Mat to Opencv integer array?
The iteration over the pixels of an image with Mat is made the way you already use it. Here is an example program: #include "opencv2/core.hpp" #include "opencv2/opencv.hpp" using namespace cv; int…
-
2
votes1
answer743
viewsA: Hyperlink customization in excel
Do the following: In the cell where the value is, right-click and select "Hyperlink". In the hyperlinks window, select the "Put This Document" button and enter the address of the cell itself where…
-
5
votes1
answer168
viewsA: How to extend the length of Widgets within a Qscrollarea?
I’ve figured out how to solve both problems. The main problem is that the QScrollArea does not work well with an internal widget that contains daughter widgets arranged in layout if the scroll…
-
5
votes1
answer19956
viewsA: Text settings in latex
An answer in Latex. :) \documentclass[a4paper]{article} \usepackage[portuguese]{babel} \usepackage[utf8x]{inputenc} \usepackage{wasysym} \usepackage{hyperref} \usepackage{titlesec} \title{Teste para…
-
4
votes1
answer168
viewsQ: How to extend the length of Widgets within a Qscrollarea?
I’m looking to build a question form in Qt. As there are several questions to be answered, it is necessary to allow the scrolling of the form, and so I used a QScrollArea. Questions are all answered…
-
19
votes1
answer15048
viewsA: Understanding the concept of Threads in practice (in Python)
Threads are competing execution lines in the same process (in your case, your Python program). They are competitors in the sense that they run simultaneously, but each with its own line of execution…
pythonanswered Luiz Vieira 34,160 -
6
votes1
answer560
viewsA: C++ - Sort particular points of a rectangle in a vector?
The solution to your problem is quite simple. The basic algorithm is as follows:: Given the vertices of the polygon, calculate the midpoint (center of the polygon). To do this, just do, for each…
-
0
votes1
answer49
viewsA: Visual Studio 2015 shows no Qstring content during debug/debugging
Visual Studio has a feature called Customized Visualization of Native Objects (a free translation of the English original Custom Views of Native Objects). In the blog of Microsoft has a very nice…
-
1
votes1
answer49
viewsQ: Visual Studio 2015 shows no Qstring content during debug/debugging
I’m using Visual Studio 2015 to develop an application in Qt 5. Everything works correctly, but when I try to debug the code and inspect a variable of type QString, debug does not show the contents…
-
8
votes2
answers2875
viewsA: When should I use disabled, read-only or hidden fields?
[...] in this case fixed fields are never editable [...] That is, they are not edit fields/boxes (Edit boxes) yes labels (Labels). So your answer is: use option C (Hidden). Justifications In the…
-
0
votes1
answer377
viewsA: Zoom camera with touch on Unity
I am without Unity3d installed at the moment to test, but I have the impression that the Touch.position returns a Vector2 with the coordinate onscreen. Thus, the distance calculation will return a…
-
5
votes1
answer246
viewsA: QT - Identify coordinates of an image in a different size Qlabel?
If I understood what you mean by "correct coordinates", you would simply like to get the coordinates in the "real image" (without adjustment), and not in the "squeezed" image (the one that was…
-
1
votes1
answer82
viewsA: QT - View Webcam on a Qlabel using another Thread?
The graphical interface seems locked because you are consuming all the resources of your thread (the main one) when making a loop virtually "infinite". You can try moving the update code to another…
-
3
votes1
answer538
viewsA: Qt5widgets.dll error when it is installed to another computer
Note: The final solution was given in the edition, added at the end of this reply. I kind of figured out what happens. : / The error is in the copy made by BundleUtilities in the Cmake script (not…
-
3
votes1
answer538
viewsQ: Qt5widgets.dll error when it is installed to another computer
I’m trying to export an application built in Qt 5.7.0 (compiled to 32 bits, although development takes place in a Windows 10 environment, 64 bits) to another computer (this one with Windows 8.1, 32…
-
5
votes1
answer732
viewsA: Mapping between user Stories and use cases
This is a free translation of Courtney’s original blog post Boost Agile (Use cases vs user Stories in Agile Development, 18 de January de 2012, www.boost.co.nz). TL;DR - User Stories are not the…
-
2
votes1
answer58
viewsA: Segmentation fault in client/server implementation
Simple. You allocate the variable client_message 1000-byte: char client_message[1000]; But then, on the call from limpa_Buffer you make a loop up 4096: for (i = 0; i < 4096; i++) {…
-
4
votes1
answer384
viewsA: Medium function does not work
Your problem is that you are manipulating hours as text strings (since you are using the function concat for "merge" hour and minutes). As it makes no sense to calculate the text average (the…
excelanswered Luiz Vieira 34,160 -
2
votes1
answer286
viewsA: how to resolve "SIGSEGV" error when using`strcpy`
Important note: When you do: ls_buffer_PPouAUT = "TESTE"; you immediately cause a memory leak (memory Leak). Previously you had allocated memory using malloc and assigned the allocation address to…
-
5
votes1
answer3337
viewsA: Is it possible to edit Listbox data?
Yes, it is possible. Simply change the property value List in the index of the selected object. Here is an example of code with two Userforms (one called "Test", which displays the Listbox, and…
-
7
votes1
answer620
viewsA: Why does my image recognition training in Opencv generate transparent samples?
The documentation unmixed the names "Negative" and "background". I think you got it wrong anyway. One "negative image", in the context of training an Opencv recognizer, means an image that does not…
-
4
votes2
answers640
viewsA: Are there security problems by Auto Macro Run when calling Excel?
Yes, there are security issues, and potentially very serious. But first, an explanation of the security levels in Excel. Levels of Safety As you may have already noticed, when creating any code VBA…
-
38
votes4
answers2243
viewsA: How do I implement wind in a trajectory equation?
Understanding the code This is your code snippet: for(int i = 1; i <= 1000 - Xpos; i += 1) { // tempo do projétil, que é calculado em base do I float t = i / (float) ((power + powerSalt[(int)…
-
11
votes1
answer4136
viewsA: How to convert color image to black and white and highlight only the white of a video
Note: This is just a little "ear tug" that you deserve, before the answer effectively. This is no longer your first question around here, and I already I told you a few times that this site is not a…
-
4
votes1
answer1825
viewsA: How to Identify and Count Prefabs Collision in Unity
Before suggesting an algorithm to treat what you actually need, I’ll take the liberty of offering some tips that might help you to maybe even another future reader: Use comments. Your code has…
-
11
votes1
answer127
viewsQ: Qvideowidget displays nothing
I’m trying to use the classes QMediaPlayer and QVideoWidget to display a video on a system I’m producing. Only these class rays don’t work as expected. The QVideoWidget just doesn’t show up, doesn’t…
-
4
votes1
answer720
viewsA: Sudoku game resolution giving infinite loop in C
I didn’t go through all the code to see if there were any other problems. But a potential problem with your code is that you do the following in the section that attempts to assemble each column/row…
-
8
votes1
answer311
viewsA: How to order hours
If the hours are always on 24-hour format and as strings, you don’t need to convert them to compare (i.e., use the SimpleDateFormat.parse). Just compare in string even. Ai will get everything in the…
javaanswered Luiz Vieira 34,160 -
17
votes1
answer2964
viewsA: Calculate force to reach point B from point A
Physics Related The force acting on the projectile at the moment it is launched (and, consequently, the speed at which it moves in the parabola) is a vector given by two components (in terms of a…
-
2
votes1
answer49
viewsA: Create an enumerator in QML by C++
Since Qt 5.5 you must use a new macro called Q_ENUM immediately after the definition of the enumeration. In your case: enum TypeSex{NONE, MEN, WOMAN}; Q_ENUM(TypeSex) Note that you no longer need to…
-
6
votes1
answer1142
viewsA: What is the function to see the tank distance to the wall in the robocode?
Well, if your need is just to calculate the distance to the walls, here’s an example of code that does that: package towerbot; import robocode.*; import java.awt.*; import java.awt.geom.*; public…
-
4
votes1
answer2081
viewsA: How to create events dynamically in VBA?
There are a few alternatives. You can try to dynamically create a new click handling function for each label, using the format <nome do controle>_Click(), but for that you will need: 1 - Set…
-
3
votes1
answer950
viewsA: Errors in using the Application.VBE object inside the VBA
Your code had some problems/errors: 1 - In Excel, the object is not called ActiveDocument, and yes ActiveWorkbook. This is written in the documentation (just pay a little attention ;) ): (In…
-
10
votes1
answer756
viewsA: How does terrain generation work in a game?
Okay. Your question is interesting, but it actually has more than one subject in it. I’m going to split the answer into two parts. Procedural Generation of Content Like fellow @Bacco already…
-
6
votes1
answer563
viewsA: Algorithm to find common word sequence
You do not mention exactly what you did not understand in the SOEN response. But one thing the author there repeats quite a lot is "linear time". The idea of an algorithm capable of processing data…
-
5
votes2
answers1449
viewsA: Putting and comparing dominoes in order in C, using list or not ( if you can without)
You’ve already had the gist of your answer: build a recursive algorithm. If you choose to use a linked list, the advantage is that the removal of items will be quite efficient. Thus, it is possible…
-
2
votes1
answer778
viewsA: C++ How to remove an element outside the ends of a list
Here is a solution: #include <vector> #include <list> #include <iostream> #include <algorithm> using namespace std; class No { private: int id; public: No(int id) {…
-
2
votes1
answer539
viewsA: Class c++ has no Member named
Well, you didn’t answer my questions, but considering the error message ("class Std::vector has no Member named 'getId'"), the error almost certainly occurs on the line containing this code call…
-
34
votes3
answers2390
viewsA: Find the center of each circle in the image
The answer you already have is very good and provides a simple and very efficient algorithm for the example image provided. However, it may not work well for more complex images, containing, for…
-
2
votes1
answer551
viewsA: Calculation of figures area
Well, you did not provide important details of your problem (for example: What type of image is it? Is the red color pure red, or is it a range of shades of red?) and it is also unclear what you…
-
11
votes1
answer5232
viewsA: What do the terms MDI and SDI mean regarding the software interface?
What are? The names say it all. MDI (Multiple Document Interface) translates to Multiple Document Interface as it deals with a choice of interaction method in which an application allows the user to…