Posts by Maniero • 444,682 points
6,921 posts
-
2
votes1
answer142
viewsA: How to include a new note in an array?
You can’t. You have some options, create a array well large enough for all of them, which can cause an unnecessary memory consumption, but that does not make real difference in many cases, even more…
-
4
votes1
answer114
views -
14
votes1
answer335
viewsA: Why don’t we have a 128-bit Integer?
Basically because it is rare to have need. Real problems do not need such large numbers. For the rare cases where you need such a large number it’s usually better to work with a guy who has total…
-
2
votes2
answers62
viewsA: Double appearing dice
From what I understand, the whole problem lies in modeling. It is registering the customer and employee as relevant information for the sales item, when in fact it should only be sales information…
-
1
votes2
answers80
views -
2
votes2
answers1326
viewsA: How to work with timezones without using a timestamp?
There are errors there. One of them is that all kinds of Mysql schedules do not save time zones, especially TIMESTAMP It doesn’t do this because it doesn’t even make sense to have this in this guy,…
-
1
votes1
answer85
viewsA: My program seems not to be correct, what to improve?
No, and it should be obvious. The letter C asks to give the percentage, in no time you calculate percentage of anything, calculate something that I can not imagine what it is, can infer that is…
-
1
votes1
answer59
viewsA: Pointer accessed improper data
This is getting worse. First it was to choose how many employees would register, now you’re asking to add new employees? Where did this requirement come from that I didn’t have before? If this is…
-
1
votes1
answer47
viewsA: Dynamic allocation in wrong scope
Probably these lines shouldn’t be inside the if, should start up first and then do the maintenance work on array servant. printf("Quantos funcionarios deseja cadastrar? "); scanf("%d",…
-
1
votes2
answers47
viewsA: Members of a structure as pointers
There are several mistakes. Some not exactly mistakes, but that could be better. I preferred to use a typedef that creates a type and makes it much easier to manipulate it. Changed idade to have no…
-
2
votes2
answers117
viewsA: How do I make "while" repeat 4 times only and break to the next C command?
There are some errors in this code. I think I should even use a for in this case, but it may have been required to use a while. I organized and gave more meaningful names for the variables. The sum…
-
4
votes1
answer110
viewsA: Why is one method that uses polymorphism being called in place of another in case of inheritance?
That’s how polymorphism works. When you created an object of the type Homem he tries to execute the methods of this object, right? And he found the ver(). If a method does not exist in this type…
-
6
votes1
answer156
viewsA: What is Pattern matching in functional languages?
In C# there is yes, since the version 7 and from there to here are improving a lot what he can do. I’ve seen proposal to put in C++, but any language can do more or less the same, can only take much…
-
1
votes1
answer87
viewsA: Declare a class as attribute or implement Abstract?
Before I start I have to say what you call an attribute is actually called a field and what you are actually using is neither, is the property. I also have to warn you that you’re trying to do…
-
3
votes1
answer89
viewsA: Convert all strings to lowercase
I went to do some research to make sure there was nothing frameworks Sometimes they like to do magic, although this case I think would be very pointless to do it. You really don’t have anything that…
-
3
votes1
answer91
viewsA: How to use indexes beyond the primary key?
And I don’t understand why you think a id speed up the query if searches do not use this field. The question presupposes this and is a wrong premise. Correct indexes help selections with filters…
-
3
votes1
answer550
viewsA: Queues (queues) are useful in Node.js, which is asynchronous?
Queues are not what you think they are (in a sophisticated mechanism). Fila is just a data structure very similar to a list and uses what is called FIFO (First In First Out) or in Portuguese PEPS…
-
2
votes1
answer1140
viewsA: ERROR: column Reference "Customer" is ambiguous
There is a column called customerin the two tables involved: tb_get_gap and tb_get_customers, then he doesn’t know which of the two to take, you must give the fully qualified column name, for…
-
1
votes2
answers78
viewsA: Why does the program work despite the invasion of memory in the vector?
I didn’t even analyze the code to see the exact problem, but what people need to keep in mind is that C is a permissive language, it lets almost everything happen, and it’s the programmer’s problem…
-
8
votes3
answers177
viewsA: Why does the this(6) command inside a constructor initialize the class array?
The this() is only calling the constructor, in this case it is an alias of it. It is the way to call this special method called constructor. Since it is possible to have a normal method exist in the…
-
0
votes1
answer72
viewsA: Calling one class within another
You are not using class within class. See what is a class. You’re creating a class that has a field and in building it is initiating this field with an instance of another class, that’s all. Only…
-
9
votes2
answers217
viewsA: Why does this if check "if it’s ! false" instead of "if it’s true"?
In this specific case the person did so because he wanted to do it. He does not have a clear motivation and it should be so, so you are covered with reason. For the adepts of good practice, this is…
-
1
votes1
answer63
viewsA: Why can I still access a variable in the heap even after the function is over?
At no time does this code make use of the heap, then the confusion of what is happening there is general. I imagine you don’t even realize you’re mixing C code with C++. It can, it works, but it’s…
-
1
votes2
answers106
viewsA: Make a game continue or stop as the player chooses
There are several problems with this code. First, I wouldn’t use a function for this, it doesn’t look like it needs it, there’s no clear reason to use it if there’s no reason not to. If it is to use…
-
2
votes1
answer188
viewsA: Processing of units of measurement in the database
Usually you normalize the data. The data obtained (input) or presented (output) can be in the unit of magnitude you want, you then convert to a specific quantity that is in the database, the same…
-
5
votes1
answer106
viewsA: Is an executable in imperative programming language smaller than an executable in object-oriented language?
There is no such direct relationship paradigms and executable size, mainly in absolute form. And it confuses two different things also unrelated, after all the imperative is certainly a paradigm,…
-
2
votes1
answer112
viewsA: Why do lists (arrays) behave differently than common variables in Python?
First, the title says something wrong. lists (arrays) behave differently than common variables List is a type of data and variable is a name that defines a memory position, so comparing the two…
-
1
votes1
answer84
viewsA: How to get the default value of a type in Kotlin?
Kotlin has nothing like it, and the way out is to use the literal Usually it is a value 0, some type of 0, not necessarily 0. This means your C# assumptions for string and Foo are wrong. Because…
-
1
votes1
answer75
viewsA: Where and when Angularjs is suitable to use?
Angularjs is well suited for medium/large applications? It serves. In fact, there is no direct relationship between one thing and another. And I would still have to define what a medium or large…
-
2
votes2
answers53
viewsA: Hidden value of variable
If I understood correctly you have to print the two original values in a different way, then it makes no sense not to print one of them and print a temporary value that is the same as the other. Not…
-
16
votes1
answer125
viewsA: What is the latest and stable version of HTTP?
Contrary to what you’re imagining, HTTP is just one specification and not a software, so it is not worth talking about stability, any version of a specification is stable because it does not change…
-
9
votes1
answer282
viewsA: Are all Javascript values, except primitives, objects?
W3schools has never been reliable and the specification uses universally wrong terms. One of the mistakes is to think that there are things that are objects and others that are not. Everything is an…
-
1
votes2
answers76
viewsA: clone, copy, changeable object on getter for security
This has nothing to do with security, one way or another, security is something else. What you might be talking about is that you avoid any problems doing so, so it would be safe because of this,…
-
2
votes2
answers107
viewsA: Don’t I have to worry about the frontend?
It’s not that you don’t have to worry, only you can never guarantee the security of your code because it can even be played aside and communicate with the backend without him, so anything you do…
-
7
votes2
answers1119
viewsA: Where is Session stored in ASP.NET Core and how best to use it?
A session weighs on the server? So you’re doing something wrong. A session on the server stays in memory as long as it takes or the ASP.NET policy determines, if the application does not invalidate,…
-
4
votes1
answer116
viewsA: Problem to use a "System.out" on an object
You’re calling this one toString() (who accepts a Object) because it does not have a method to print the textual representation of debugging a array of Apartamento, has only one that prints a array…
-
3
votes2
answers98
viewsA: CS0847 error in matrix code in C#
It means that you are creating a 3 x 3 matrix and you are initiating it with fewer elements, in case very clearly you are doing 3 x 2, if what you want is a matrix like this, then determine the…
-
5
votes1
answer111
viewsA: Difference between overall, const and define()
global declares a normal variable with global life span and time (is not only where it was declared), therefore it exists for the entire time of the execution from the time of its statement. This in…
-
2
votes1
answer142
viewsA: Problem with System.Indexoutofrangeexception in C#
This particular problem is that you are accessing an element of array which does not exist, is accessing a number greater than the amount created elements, and needs to validate this. It would be…
-
2
votes1
answer875
viewsA: How to invert a positive number to negative and vice versa in C#?
Placing the equal negative sign (-) in mathematics. It also seems that you have not yet learned to pick up a number typed correctly, as I have answered you before (it can give a more significant…
-
7
votes1
answer134
viewsA: Variables and methods in the abstract class, where to put?
It should create all that is common in the abstract class, both fields and methods, which is possible because it is the same in all classes. Even if the behavior of the methods are potentially…
-
3
votes1
answer1999
viewsA: Syntaxerror: invalid syntax, what happened?
This code is almost random. There are rules to be followed to write a code, can not write the way you want. So it works: character_name = "Johnny" character_age = "64" print(character_name + " is…
-
5
votes2
answers89
viewsA: Backslashes on the way: do they influence anything?
It depends a little on the language, but in general it should not deal with paths on their own, the languages have their own library that knows how to handle it and you work the way without worrying…
-
3
votes2
answers122
viewsA: Is using the Mariadb JSON type a good one for saving primary keys?
Not at all. Primary keys must be stable, If mute is not a primary key, this data is clearly secondary, I do not know if it is appropriate to access so, but as primary key it certainly does not…
-
3
votes2
answers256
viewsA: What is the relationship between software architecture and Patterns design?
Never read Wikipedia in Portuguese, it is full of errors and do not let you fix it a lot of the time (the English version was wrong until those days too, who knows now let change). This case isn’t…
-
9
votes1
answer88
viewsA: What is the advantage of PHP objects being passed by default references?
I have my doubts whether the statement of the first paragraph is correct, in fact I don’t even know if it is clear. What is the advantage of PHP objects being passed by default references? Basically…
-
8
votes1
answer95
viewsA: Where is the function taking the current time?
In the first instance comes from the operating system that controls the time of the moment for the entire system. It allows this time to be changed in various ways, for example to be synchronized…
-
7
votes1
answer138
viewsA: Why do auto properties exist in C#?
Automatic properties are just what we call syntax sugar, that is, a way to write less code when that is the normal you will do most of the time. The question is quite confused and so it can be…
-
6
votes1
answer85
viewsA: What are the widgets?
Each one can give their definition since much of what we use of IT is terms coined by someone and adopted by the market means that without criterion, study or questioning. Some things are adopted in…
-
4
votes2
answers78
viewsA: Condition does not enter as entered
You should make the full comparison, it doesn’t work the way you’re imagining it. The or expects as operating on each side a boolean result. One of the ways to get one is by doing a comparison…