Posts by Maniero • 444,682 points
6,921 posts
-
0
votes1
answer60
viewsA: When a C program is compiled, does it include all the dependencies necessary for its operation?
The compilation is done in what you have done, if you don’t have it compiled. In fact no normal compiler compiles dependencies, if he does he is not just a compiler. In general there is a system of…
-
7
votes3
answers263
viewsA: What would be something "native"?
What is something native? It depends on the context that is used. Almost everything you see out there will be in the context of mobile, is comparing only one that goes straight on the operating…
-
4
votes1
answer100
viewsA: What is Monomorphization?
Sometimes we write polymorphic codes. One of the most commonly used polymorphisms is virtualization where the pointer will decide at runtime what to do in a specialized way, but the written code is…
-
2
votes1
answer448
viewsA: What is the difference between operating code (opcode) and instruction set (Instruction set)
Roughly speaking we can say that opcode is the instruction, and of course Instruction set is a set of them. So the relationship and what differs between them is basically this. I think I don’t need…
-
4
votes1
answer61
viewsA: Filter objects with criterion in the array within it
When you want to filter something, just do it once. It would only make sense if you wanted to have a filter inside the filter, but that’s not the case, you just want to filter people. Discipline is…
javascriptanswered Maniero 444,682 -
3
votes1
answer60
viewsA: Comparing strings to switch in PHP
Make no mistake (Initially I thought I gave so I answered, in fact the code does exactly what I should do, I did not know that PHP allowed the syntax used). I did it in a way that is correct and…
-
1
votes1
answer42
viewsA: I deleted old posts and the database was almost the same size
This is how it works and shouldn’t touch it, the space released will be reused, this is a way the database works better, so leave it like this, this optimization will be space, but it will worsen…
-
4
votes1
answer63
viewsA: What is the parameter passed in Sort()
The method sort() will classify a data collection through a criterion that will define the order that will be established in the object and it needs to determine whether a data is larger or smaller.…
-
1
votes2
answers116
viewsA: How to create a factorial function using the 'for' counter?
Has a syntax problem that makes no sense transforms num function and use there, I know why has that. In addition, the ending condition of the loop is when it reaches 1 since it does not need to…
-
5
votes1
answer42
viewsA: Is it possible to declare that in a function you launch an exception with PHP?
You cannot explicitly state (checked Exception) that a function can cast an exception because PHP is not Java, the only language that allows it, and it did not work. You can make an exception as…
-
2
votes1
answer178
views -
2
votes1
answer68
viewsA: How to use Try with while and vectors
You don’t need this complex code. You can just go back on the count of for when it gives error. But that alone does not solve the whole problem. Note that I switched to capture the specific…
-
5
votes1
answer80
viewsA: Using the Strategy standard when it affects other parts of the system
You seem to understand the pattern Strategy, motivation, etc. I don’t know if you think you should use it everywhere. There is a case that it may be better to centralize the strategies without…
-
5
votes1
answer81
viewsA: Why declare Static for all methods of a Static class?
And why should you stop saying that the static method is static? It’s a matter of taste. You think that typing less is more important, the language creators thought it was more important to be more…
-
1
votes1
answer48
viewsA: If an object manipulated by a pointer is allocated in the heap, can it be collected by the Garbage Collector?
Concepts The pointers part is very advanced and almost nobody uses it, it is for very specific situations. What is in the question has nothing really talking about pointers, by chance it has pointer…
-
1
votes1
answer50
viewsA: Array size set by variable
There are typos like , in place of ;, missing put two data in a text template to print that expects two different data and the biggest problem is that is trying to create a array with a data that…
-
2
votes1
answer35
viewsA: What is the difference between build and link?
They are not the same. A linkage is one of the steps that the build performs. The build can accomplish many things, even build the application or complete solution, some of these steps are not even…
-
1
votes1
answer35
views -
4
votes1
answer46
viewsA: Method that returns the smallest between two parameters does not work
The function gives error because for the compiler there is situation that may not return a value. You have a condition that checks if one of them is bigger, then checks if the other is bigger, and…
-
1
votes1
answer53
viewsA: Potentiation with array
Do not need to do this gambiarra, leave whole and do without using auxiliary function (understood that only use double to use the function). But you cannot use foreach when you change the collection…
-
4
votes1
answer74
viewsA: Instantiating a class "x" from another class "y" inherited by the class "x"
This shown this way does not make much sense, but it is a simple and obvious way to show how the mechanism works. What most people don’t understand is just this, and probably one of the biggest…
-
1
votes1
answer81
viewsA: Meaning of signs in C#
Alone do not serve much, you need to understand the contexts of each. Important to say that this has nothing to do with Unity which is only a library, I will answer about C#. All these are…
-
7
votes2
answers78
viewsA: Understanding the content of array elements
You really should explain why you think it should be 1 and 7. If we put to print what is the index of the last element of array it matches the value you print inside the function: const funcs = [];…
-
4
votes3
answers775
viewsA: What are the ".d.ts" files?
The main point of creating Typescript is to give more robustness to complex systems. Javascript was created thinking for use in scripts very simple to automate some action on a page, not to make…
-
2
votes2
answers179
viewsA: Is there realloc() in C++?
It is not unique to C, it exists in C++ as well, but should almost never be used. There may be some cases when creating a structure and need to deal with memory management at a lower level. In C++…
-
1
votes1
answer77
viewsA: My Ry is not reading my except
For what it gave to understand created a loop to keep repeating the request of the data until it is valid. There must be another more external loop that controls how much data was entered, I’ll…
-
4
votes2
answers116
viewsA: In Java, what is the purpose of calling interface methods on objects from other classes?
Design pattern This looks like a design pattern, I don’t guarantee exactly which one because some are similar and aren’t always implemented right (it looks like a Strategy). Even though it is not…
-
4
votes1
answer111
viewsA: How to reverse the order of a sentence?
There are some mistakes there. One of them has a ; in the for wrapping the block and not executing what you want to be repeated by causing a loose line to not even make sense because it uses a…
-
5
votes1
answer74
viewsA: Why char. Parse(string) returns a number?
The method char.Parse() exists basically to convert a character of a string on a die of the kind char as simply as possible. This method returns the character that exists within the string. That one…
-
3
votes2
answers71
viewsA: Allocation of values other than normal
You’re seeing Python’s ability to do multiple assignments. You know the simple assignment and it is easy to understand. to the left of the assignment signal = there is the name of a variable and on…
-
1
votes1
answer228
views -
6
votes1
answer58
viewsA: What is the difference between the function call with ":" and "."?
It is not any method you can call that. You use this operator to indicate that you are using a namespace, a module or class name, until it reaches a member, but since it is accessing a module member…
-
7
votes1
answer72
viewsA: Validate password with Regex
Guilhe3rme has 10 letters, the second condition requires you to have less than 10 To be true, therefore, the second is false. As it is connected with others with && which requires all…
-
5
votes3
answers464
viewsA: What is a Guard clause?
In the context of the question are those conditions that prepare the ground for the actual execution of the code filtering out what will do and especially can be done. These are conditions that the…
-
2
votes1
answer367
viewsA: How can I see the SQL generated by Entity Framework Core?
In fact in Core the behavior is not the same as the normal EF and there is no ready form, this is one of its disadvantages in relation to the full, at least until now. I found some solutions at Soen…
-
4
votes1
answer64
viewsA: What are HTML interfaces for?
Interface in this context indicates that it is a contract. You know what it is API? Application Programming Interface. It’s the same thing as the term in that context. It’s what defines how you…
-
1
votes1
answer41
viewsA: SQL Server Order Allocation
It is possible, but not recommended. To do this would have to change the id and that’s something you shouldn’t do, you’d have to change the id of several other data lines, and in a certain scenario…
-
8
votes1
answer213
viewsA: What is the difference between data structures and abstract types of data?
It is said that ADT is the abstract way of defining structures without specifying the way it works, without the concern with certain criteria, ie if you want to put a list of objects your Abstract…
-
1
votes1
answer88
viewsA: Why does a variable passed to function not keep the changed value when it exits the function?
You are passing variables by reference when using the &, so it’s not passing a value, it’s passing the address where it has a value. You can read more about it at What is the meaning of the…
-
7
votes1
answer1248
viewsA: What is Microsoft’s MAUI?
What changes from the old version to this? The biggest change is how to make a code for all platforms. Now it becomes easier and intuitive to do a single project that will run on all platforms. This…
-
1
votes1
answer420
viewsA: Can you tell the size of an array in Visualg?
As far as I know has not, because in Visualg the array always has fixed size and previously defined in the declaration of variables, so the size is always known by your code, there has to be a…
-
6
votes2
answers149
viewsA: Condition in PHP "if" to know if the sent Mysql command worked or not
A few remarks before you answer what you want. So some people can jump to the solution down there, that first part is only for those who want to do right and not just work. Doesn’t make any sense to…
-
9
votes1
answer178
viewsA: Python 64 bits have advantage?
It can even give some gain in some points when using the 64 bits, but can be worse in others. The biggest reason to use the 64 bit version is to be able to access memory greater than 4GB. The bits…
-
3
votes1
answer291
viewsA: Composition of objects in Python
If you have an inheritance there are no two objects, there is only one that is created based on a model that is defined in two parts. You can see more about What is the difference between a class…
-
1
votes2
answers2053
viewsA: Eoferror: EOF when Ading a line
The code is a little confused, and from what we read in the statement should not ask for 3 entries and break in parts, should read an entry and break (I hate it, it usually gives problems, but we…
-
3
votes1
answer888
viewsA: The sum of the N first prime numbers
I would do so: n = int(input('Digite um número inteiro positivo: ')) soma = 0 conta = 0 num = 2 while conta < n: primo = True for i in range(2, num): if num % i == 0: primo = False break if…
-
2
votes2
answers194
viewsA: Condition to continue loop while invalid value
A <= 1 means that if it is the value 1 (it is equal) or (the smaller ones) 0, or -1, or -2, etc. it is worth. A >= 2 means that if it is the value 2 (is equal) or (the largest) 3, or 4, or 5,…
-
4
votes1
answer307
viewsA: What is the difference between object code and intermediate code?
Intermediate code can have several forms, including a source, while object code is usually machine code. It’s not that the object can’t be a source, but it’s not usually. Intermediate code is an…
-
6
votes2
answers273
viewsA: Why does pointing to the same memory address change an object?
Actually this idea of pointing is slightly wrong. There is even that, but let’s start at the end that you understand better. When you assign 23 to the variable a is very easy to understand. You are…
-
4
votes1
answer463
viewsA: What is object code?
The object is a binary generated by the compiler after it has processed the source code. It usually stays in a file and then can generate the executable through the process of linkediting. The…