Posts by Maniero • 444,682 points
6,921 posts
-
2
votes1
answer106
viewsA: Why is the description variable leaving null?
This code seems to be quite wrong. But I don’t know, it can be an initial exercise. Anyway you will be learning in a way that I consider wrong. To fix the problem presented, simply initialize the…
-
14
votes3
answers13730
viewsA: What is the difference between simply-chained and double-chained list?
What are? Both work with data independent nodes. These nodes have the element value and a pointer to the next element in the list. Since they are not in continuous sequence in memory (or other…
-
10
votes2
answers1691
viewsA: What is the advantage of using languages you compile for other languages?
Disadvantages Generalizing like this, none :P Only has disadvantages. Of course, if you look specifically, there could be advantages. Compiling for another language itself is not such a big problem,…
-
7
votes2
answers213
viewsA: Difference between ":" and "." in the methods of a Lua table
The first is the member operator, it only separates to whom the function belongs. The second is a syntactic sugar, is the same as: function obj.GoGoGo(self, name) end Then it only puts one more…
-
3
votes2
answers212
viewsA: What is the # (fence) in the Lua language for?
It is the operator of length, the length. In this case you’re taking the last element of array ents.objects. Remember that in Lua the arrays start at 1 and not 0. It is accessed by the meta method…
-
10
votes1
answer363
viewsA: Custom global variable
The problem of using global variables implicitly is not great, only that you lose the perspective that is dealing with global. Have you seen the other questions that global is not something to be…
-
4
votes1
answer128
viewsA: Why can’t I modify the string this way?
Because you are trying to play a pointer as the value of the variable. The literal string determined by quotation marks record these characters in memory and generate a pointer that can be played in…
-
14
votes5
answers1091
viewsA: Pros and cons of a 100% HTML/Javascript web application
Obviously all pros and cons depend not only on the technique used but also on the actual implementation. Pros Better user experience responding faster and without breaks in information flow. User…
-
7
votes2
answers1919
viewsA: When should I use GC.Suppressfinalize()?
Some questions that may help you understand the theme: I should always use Dispose? When a class is recommended to implement Idisposable? What is the difference between Idisposable implementations?…
-
20
votes2
answers5051
viewsA: What is a deterministic, nondeterministic algorithm?
Deterministic algorithm is what always produces the same result given certain data entries. Most algorithms are deterministic. Thank goodness :) Therefore, algorithms do not always reproduce the…
-
3
votes3
answers325
viewsA: Data types in SQL Server 2012 and HTML forms with PHP: date and monetary values
SQL Server has no format, it stores data, all databases work like this, format is something the application should use to present the data. It can even be the application and use a format when…
-
10
votes3
answers1027
viewsA: $GLOBALS to store settings?
In principle it’s okay to do this, I always say, as long as you know what you’re doing. Keep in mind that this will always need to be included in scripts whenever necessary. The one about software…
-
5
votes3
answers960
viewsA: Is Mysql embedded in Easyphp?
Easyphp installs everything you need to learn how to use a web server, including Mysql. You don’t need anything beyond this, although you may want other things later. With learning you will know…
-
11
votes1
answer755
viewsA: Difference between casting and Promotion
To promotion is the elevation of numerical types existing in language to a type that may represent a greater greatness. The rules of what can be promoted are specified in the language and always…
-
3
votes1
answer138
viewsA: What does "Inconsistent modifiers style" mean in Resharper?
Your intention is for the class to be public? Then there is a mistake there, you need to say that it is public explicitly. Should the class be internal? That is, it should be accessible only within…
-
2
votes2
answers234
viewsA: Why is the recursive function return not being used?
Because array is a reference type. Reference types passed as argument methods are confused with the parameter. Unlike the types by value in which a copy of the object (of the value) is made in the…
-
6
votes1
answer1523
viewsA: Correct use of free() in function?
The most correct way is not to do it this way. In C, the ideal is to always allocate and free the memory in the same function. So it looks right, but the allocation should be done at the lowest…
-
3
votes1
answer2135
viewsA: NULL error when adding a new line
As the columns described cannot be null and have no value default, you have to insert something. So: INSERT INTO Produtos (descricao, marca, preco, Tipo) VALUES ('Geladeira', 'BrasTemp', 700,…
-
8
votes1
answer3554
viewsA: Difference between SQL Server Express versions?
There’s a page with information (2019). SQL Server Express with Tools It is the database with some extra tools to help with maintenance in SQL Server Express, Localdb, and SQL Azure. SQL Server…
-
5
votes2
answers14713
viewsA: How to change Visual Studio background color?
Is here the documentation. Tools -> Options -> Environment -> General -> Color Theme Or Tools -> Options -> Environment -> Fonts and Colors -> C# -> Item background…
-
7
votes1
answer108
viewsA: Error in . First(), as there is no selected result
There are some solutions to this, one of them is to use the FirstOrDefault(). var user = db.Usuario.FirstOrDefault(u => u.Nome == model.Nome && u.Senha.Equals(model.Senha)); Obviously you…
-
3
votes1
answer960
viewsA: How to separate global functions/variables from the program into files?
The little code shown clearly indicates that there should be no such separation. Apparently, the whole code has a direct connection, and it’s important that he be there. A separation should only…
-
5
votes4
answers2938
viewsA: Link without using href
As a matter of curiosity it might be to do this: <a id="missionclick" class="moreinfo" style="cursor:pointer;">exemplo</a> I put in the Github for future reference. Obviously there is no…
-
10
votes3
answers20821
viewsA: How to define a software version?
There is no pattern. Each project adopts what suits it best, so the explanation of what each number (if any numbers are used) means must be provided by the project itself. What is recommended is…
-
7
votes2
answers521
viewsA: Performance difference between multiple conditions in one IF or multiple IF’s separately?
This code certainly performs less than it should. There is no reason for the if external, does not change any logic, or there is gain, on the contrary, it will certainly make redundant comparisons.…
-
26
votes7
answers13486
viewsA: Is Delphi an IDE or programming language?
There are controversies, I’ve seen sources claiming one thing or another. This has little practical importance but is worth the curiosity, especially because it helps understand a little better what…
-
87
votes9
answers41109
viewsA: What is a programming language, IDE and compiler?
TL;DR Programming language is a more abstract concept, are the rules specified governing how a code should behave to produce computer programs. The language is not a program that executes. Compiler…
-
1
votes1
answer307
viewsA: What is the difference between Qstring and Qstringliteral?
QString is a type representing text in Qt. It is the equivalent of the type string of C++, but they are not compatible, they are stored differently. When using Qt it is usually more advantageous to…
-
16
votes1
answer314
viewsA: Is it correct to use a block using inside another using block?
It is absolutely correct. Every resource needs its own using to ensure its closure when no longer needed. You can improve a little here: using (DataTable dataTable = new DataTable()) using…
-
7
votes2
answers1359
viewsA: What changed from MVC4 to MVC5?
There is a official page saying what the news was, you don’t have to use opinions that are not accepted here. Essentially everything you learn in 4 can be taken advantage of in 5. There are…
-
2
votes1
answer1909
viewsA: How to convert decimal to binary with large numbers?
If you really need this, change the type of number to BigInteger. static string DecimalParaBinario(BigInteger n) { BigInteger resto; var result = ""; while (n > 0) { resto = n % 2; n /= 2; result…
-
3
votes2
answers1077
viewsA: Implement abstract method in Python inheritance
Maybe you know this way is not much phytonica. When you want guarantees in the code it’s better to use another language. This is probably why Pycharm complains about this, he doesn’t go very far to…
-
11
votes2
answers5656
viewsA: When and where to use a delegate in C#?
Roughly speaking, it’s a way to store a code in a variable. In other words, in a somewhat simplified way, the value of the variable is a code that can be invoked at some point. When to use The…
-
7
votes2
answers185
viewsA: How to store a website settings?
Depends on the way you need it. The simplest way is to put this information into global variables or encapsulated in some way (a array, a class, etc.). This usually works well if it cannot be…
-
3
votes2
answers92
views -
13
votes1
answer5885
viewsA: What are INDEX, B-Tree, hash, Gist, and GIN?
B-Tree The B-Tree, or some variation of it, is the most common in all database systems. It is very efficient for almost all common use cases. It is a balanced tree which allows all types of access…
-
6
votes2
answers671
viewsA: What is the way to store and read settings?
There is no guarantee, on the contrary, if you do not know what you are doing it is easier to end up doing something less secure this way. Changing the extension or even the internal text format…
-
5
votes2
answers1283
views -
15
votes5
answers1643
viewsA: Difference between private and final methods
It is not the same if the method is declared as private. This modifier indicates that the method should only exist within the class. It’s something inside her and no one else should have access, not…
-
9
votes3
answers183
viewsA: Visual Studio 2013 no install in windows 7
Most likely is missing the Service Pack 1 in the Windows 7, or it could be another update of it. You have to make sure everything is up to date. See link presented more details if this is not the…
-
4
votes1
answer550
viewsA: Compilation/Minification of HTML, CSS and class names
I already talk about the minification in another question. It is interesting in elements that change little. HTML usually changes a lot, so it is better to compress or leave without any size gain.…
-
6
votes3
answers742
viewsA: How to check if a value is present within an array?
You don’t need all this, just use the function in_array() right in the array original: in_array("25", $fthi) Or if you think you should do something else for some reason: in_array("25",…
-
3
votes1
answer112
viewsA: How to read a variable in setText()?
Do so: void MainWindow::on_pushButton_clicked(){ Qstring texto; texto = "mensagem"; ui->lineEdit->setText(texto); } Or better yet: void MainWindow::on_pushButton_clicked(){…
-
48
votes3
answers26529
viewsA: What is the difference between a class and an object?
Think of it as a matter of a construction company that needs to build houses. Class is the plan, is the planning, is the model to be followed so that the house is built within certain…
-
19
votes3
answers1472
viewsA: How does an SQL Injection happen?
These methods know how to clean the content, they remove any potentially dangerous text. As there is expected something very limited, ie just numbers or a text like string (in quotes), anything that…
-
2
votes3
answers9326
viewsA: Is it possible to use Sqlite as client-server?
The question is well answered, but I want to complement that even not using a ready solution is easy to create a small server to access the Sqlite. The idea is to have an executable running all the…
-
8
votes1
answer460
views -
12
votes2
answers994
viewsA: Why use a generic return?
This is a placeholder for the type that will be used. It’s like a super variable. Its "value" is the type that was chosen from the use of the method or class. By then you probably know. The point is…
-
28
votes3
answers1255
viewsA: What is SRP and how is it used?
Introducing He is a principle to be followed and not a project pattern. So it already shows that it is difficult to define a line where they are being used correctly or not. My experience indicates…
-
13
votes2
answers1408
viewsA: How and when should we use Interface to document systems in PHP?
Necessary is not, but it is good for several reasons, documenting really is one of them, give more robustness in the code is another. I just don’t quite understand how dynamic typing languages…