Posts by Maniero • 444,682 points
6,921 posts
-
5
votes1
answer107
viewsA: Why is it possible to access array indexes with "{}" keys?
Accessing an index of an array with keys instead of brackets has some special meaning? Not. Why is it possible to use both forms? The manual says you can, no explanation why I have this alternative.…
-
2
votes2
answers167
viewsA: How do I pass an array of structure pointers to a function?
I think what you r actually is this: #include <stdio.h> #include <stdlib.h> #define NUM_NOTAS 5 #define TAM_NOME 20 struct Aluno { char nome[TAM_NOME]; int numero; int notas[NUM_NOTAS];…
-
5
votes1
answer109
viewsA: Random Order with Entity Framework
Use the Guid.NewGuid(): var pessoa = contexto.tbPessoa.OrderBy(a => Guid.NewGuid()).FirstOrDefault() I put in the Github for future reference.…
-
9
votes1
answer1239
viewsQ: What’s the difference between #include <filename> and #include "filename"?
Why do we use #include <filename> and #include "filename" When to use each?
-
10
votes1
answer1239
viewsA: What’s the difference between #include <filename> and #include "filename"?
#include <filename> It is used for standard language libraries. Generally the compiler already knows where the headers of what is part of the language are. Obviously this can be configured.…
-
6
votes2
answers3075
viewsA: How can I see the structure of a table in Sqlite?
If you are the interpreter just use .schema nome_da_tabela. He will show the query that Grou this for you. It does not have a specific mechanism. Can also call a function that gives this…
-
3
votes2
answers276
viewsA: Accepting null fields from a Texbox
You need to treat the error and make a decision of what to run in that situation. Or even let the error occur, which is the right one. That is, don’t use Convert.ToInt64() because it was made for…
-
1
votes1
answer191
viewsA: Avoid memory leakage in return function
Don’t try to write Java in C++, write C++ and forget how you did it in Java. Writing the right way works and there are no leaks. There’s no reason why this code could produce a leak. #include…
-
3
votes2
answers143
viewsA: Overload of C++ operators, is the auxiliary variable necessary in this case?
First the code does not work properly no. See that depending on how the operator is used gives problem. The book example is a little better because at least it returns an object of the type Contador…
-
8
votes2
answers4111
viewsA: Copy string from a given character
You’re on the right track. Didn’t you start by taking position 0? As you want to take position 15 onwards, use it. As you go all the way, you must take the sizeof of the whole text and subtract the…
-
2
votes1
answer544
viewsA: Error: assignment of Member '' in read-only Object
You declared the parameter as const then you cannot modify it. If the intention is to modify you should not use this modifier. You may have other code problems, but these specific errors are…
-
16
votes3
answers243
viewsA: Does C# have native serialization?
Yes, it is possible, the . NET provides this possibility through reflection. But don’t worry, you don’t have to do anything too much, just say what you want to be serializable. Just use the…
-
18
votes1
answer11268
viewsA: What is the programming language for creating Android apps?
Java and Kotlin are the "official" languages of the platform. It doesn’t matter what you’re going to do, it’s essentially what you’re going to use. So this is the objective answer to the question is…
-
3
votes1
answer66
viewsA: Why can’t we use Await inside a Catch, Finally and Synclock in VB?
I don’t know how to give you a definitive answer on that. I can say that it was because the language specified so. So C# had specified so in version 5. Later they realized that they could relax this…
-
3
votes2
answers79
viewsA: Color Visualization and New Creation
See if the color example shown in that documentation help you. There are some Color Picker software that do by name (I imagine these are universal names). An online that does this. The ideal would…
-
3
votes1
answer42
viewsA: Creating bytes collection in old browsers through Javascript?
Javascript is probably not the most suitable language for this. It wasn’t designed to minimize memory usage and make your access more flexible. Now they’re including a little bit of this kind of…
-
1
votes2
answers167
viewsA: How to use Database Diagrams in Visual Studio 2015
No longer exists. You can install SQL Server Management Studio that has this, but it’s not the same thing. That book is very old. Or you need to learn from something new or you need to make…
-
3
votes1
answer68
viewsA: Are hardware configurations relevant to measuring the efficiency of sorting algorithms?
There are controversies. That can be seen in this question. Read everything, including the comments, there is something very good there, including showing how things actually happen in practice. It…
answered Maniero 444,682 -
6
votes1
answer111
viewsA: Is it incorrect to change the arguments in an extended class in PHP?
In builder there is no problem some because there is effectively no polymorphism in it. You can only call the constructor of the specific class you want, you don’t have to have polymorphism in this…
-
5
votes1
answer1213
viewsA: Install app made in Visual Studio on client machine
In general not. First, you need to have the . NET Framework, in the version you required in your application, installed on the machine. If not, it needs to be shipped together and install before. It…
-
6
votes1
answer4920
viewsQ: Is there a difference between using "Return" or "Exit()" to terminate the "main()" function?
The function exit() closes the execution of the application immediately. The command return makes you quit the function, but when you’re inside the main() will exit the application, including the…
-
9
votes1
answer4920
viewsA: Is there a difference between using "Return" or "Exit()" to terminate the "main()" function?
There is an important semantic difference in C++. The return will close the scope and call all the pending destructors. If it is the same application shutdown, rarely will the destructors call…
-
15
votes2
answers310
viewsA: Go with a ";" at the beginning of the loop, which means
The person should have used one while in this case, after all has only one condition and nothing else. The wisest would be: while (indField > 0 && indMask > 0) In that case the…
-
21
votes3
answers1426
viewsA: How does the HTTP protocol process requests?
Protocol As Bacco has already well said in the commentary, protocol is a specification, so he doesn’t process anything. pro to co lo |ó| male noun Form. .Minutes of conferences between…
-
22
votes2
answers8927
viewsA: In Python, what is the difference between == and the is command?
No, that’s not true. The operator == tests equality of values. It tests whether object values match. The operator is tests the identity of objects, so it needs to be the same object for it to be…
-
4
votes1
answer4789
viewsA: Pass vector by reference or value?
There are several errors in your code, especially of declaring variables and functions when in fact will only use them, but none that is in the question. You only set the type of the variable or…
-
16
votes1
answer677
viewsQ: What is undefined behavior, unspecified and defined by implementation?
What is the difference between the three terms "undefined behavior", "unspecified behavior" and "behavior defined by implementation"? Why do they exist in these forms?
-
9
votes1
answer677
viewsA: What is undefined behavior, unspecified and defined by implementation?
Safer languages try to avoid these behaviors. In languages where it is expected the best of performance, flexibility and use of architecture is more common to leave some things open. This is the…
-
7
votes2
answers156
viewsA: How to Ensure Writing File on a Single Disk Block?
Guarantee to keep a file continuously nothing that guarantees that my file will be written on a single disc block Generally is not possible, at least not only in its code in a simple and universal…
-
6
votes1
answer99
viewsA: How to automatically add namespaces in Visual Basic?
You must look at these two ways: \*VisualStudioInstallationDirectory*\Common7\IDE\ItemTemplates\*Language*\Code\*Locale*\…
-
5
votes3
answers815
viewsA: In PHP are all variables declared global?
First, there’s a terminology problem there. Global variables have life span and time throughout the application. Being inside a function indicates that it is local. That’s how it is in C#, PHP and…
-
1
votes1
answer54
views -
16
votes1
answer832
viewsA: What are statements and operators?
Statement Statement is a statement, by literal translation. It is a statement. We often call it a command in English, although the word does not express well what it is. Usually used in imperative…
-
4
votes1
answer173
viewsA: Is hybrid hosting with a single domain possible?
Domains are not linked to technologies, they are just names that lead to an IP address. So right away we can conclude that there is no problem. Hence the question about can put two different…
-
16
votes2
answers787
viewsA: What is elegant coding?
First understand that the evaluation will always be subjective, although there may be objective criteria. The dictionary’s definition is good. Of course it does not help to understand the points to…
-
7
votes1
answer527
views -
28
votes1
answer479
viewsA: Is inheritance a bad practice for all languages?
It’s bad practice to teach things like bad practice or good practice. The ideal would be to explain why things happen. Often the person does not explain why he does not know (I am not saying that…
-
17
votes3
answers4038
viewsA: What is the definition of verbose code? And why is it interesting to reduce it?
Verbose code is one that needs more words, or longer words, than necessary to properly express the intent of the code. In verbose codes there are many very long symbols or symbols. There is a…
-
4
votes1
answer191
viewsA: isUserAMonkey() and isUserAGoat() methods
The first is used to check whether the user is real or just a testing mechanism, where you may want to have a different action. That’s what it says in a question in the OS. Apparently the second is…
-
2
votes1
answer135
viewsA: Word in reverse order
There are two errors: it seems that you did not understand what was answered in previous question who needs to use the %c to display characters; and he must consider position 0 as one of the…
-
3
votes3
answers962
viewsA: Printing a character in place of a number
It is showing the numeric value and not the character because that is what you had done. The %d take a value and print as a decimal number. Use %c is having the same value printed as a character.…
-
3
votes1
answer138
viewsA: How to concatenate strings from a 3-in-3 vector in Java?
You can do it like this: class HelloWorld { public static void main(String[] args) { String[] vetor = {"aaa", "aaa", "aaa", "bbb", "bbb", "bbb", "ccc", "ccc", "ccc", "ddd", "ddd", "ddd"}; String[]…
-
5
votes2
answers185
viewsA: How to pass a lambda expression as argument of a parameter in a method?
The most adopted way is to use a predefined delegate, such as the Func(Of TSource, Boolean): Private Sub Metodo(Of TSource)(Expressao As Func(Of TSource, Boolean)) Lista = Lista.Where(Expressao) End…
-
2
votes1
answer72
viewsA: Reset a variable, or recreate it?
I had the IL code of both generated and got exactly the same code, so there’s no difference between them. There’s a question about C# that talks more or less about this. .method private static void…
-
24
votes2
answers5046
viewsA: What is the difference between Isnullorempty and Isnullorwhitespace?
Both check if it is null, this seems obvious. Let’s get to the differences. At first it only matters if the size of the text is zero, ie if it has zero characters. So if you have a single space is…
-
5
votes1
answer562
viewsA: Do I really need to have the src and ng-src attributes in the IMG tag? What is the function of each?
ng-src is used by Angularjs, src it is not. The src is what you know about HTML, it carries an image with that name, you can say that it is static. The ng-src is interpreted by Angularjs and if the…
-
3
votes1
answer164
viewsA: Why is there so much talk about security in targeted programming?
Security is a property that has nothing to do with object-oriented programming. Perhaps the term was another. Defining something as private does not protect anything. The compiler does not let you…
-
7
votes1
answer861
viewsA: Alternatives for PHP
It is true that PHP has this embedded in the interpreter itself, but can put code inside a tamplate is not characteristic of a programming language, so anyone can do this, just the system template…
-
1
votes1
answer48
viewsA: Universal Apps 8.1 on Windows 10
Yes, except for some unintentional incompatibility that is discovered. Otherwise it is no longer true.
-
6
votes3
answers269
viewsA: I need to sort a list in order that seems unusual
You can use PadLeft() to align the text, but you may need something more complex if the pattern is not so linear. It complicates a little more solving the alignment after the decimal point, so you’d…