Posts by Maniero • 444,682 points
6,921 posts
-
1
votes1
answer88
viewsA: Fill variable with different types
You can’t do it like this. I don’t know if it was a mistake (it seems not) or was purposeful, but the class OdbcConnection does not derive from one that can be generalized. If it was purposeful then…
-
11
votes1
answer404
viewsA: Why are certain languages faster than others?
I’ve heard a lot about how C is faster than C++ and Java, Lua is the fastest scripting language, among other examples. Languages are not faster It’s not like that, languages are not fast or slow,…
-
8
votes1
answer314
viewsA: What is the correct term, key word or reserved word?
Both are correct because they mean different things to the same thing, i.e., reserved word means that that word cannot be used for identifiers in your code, the language prohibits this because it…
terminologyanswered Maniero 444,682 -
16
votes2
answers587
viewsA: What’s the difference between command, instruction and code?
People use them interchangeably in many cases, but they should not because precise meanings are not the same thing, and it is even difficult to define them clearly, at least in Portuguese. Obviously…
terminologyanswered Maniero 444,682 -
2
votes2
answers238
viewsA: How to compare only the date with Date objects?
If you reset the time part then only the date is left to compare. You can do this with setHours(). This way will be compared the timestamp only considering the part of the same date. let date = new…
-
4
votes1
answer175
viewsA: Unable to convert from decimal to double
Basically you have to make a cast since the method expects to send a type double and returns this same type, and the final result is indicating to be decimal: using static System.Console; using…
-
4
votes1
answer63
viewsA: How do I tell the compiler that every Observablelist<O> I pass as an argument will contain a certain method?
You must restrict what you can use as a parameter: private static <O extends AlgumTipo> I put in the Github for future reference. where AlgumTipo can be a class, interface or other type that…
-
4
votes2
answers299
viewsA: Do I need to open a Mysql connection for each PHP query?
No, preferably you should not do this, in PHP it is even easy to control it because in almost 100% of the cases it is only running one script ephemeral, so the limit is basically the duration of it,…
-
1
votes1
answer64
viewsA: When can I use . NET Framework 4.x and . NET Core on Windows, Linux and Macos?
Application using NET Framework 4.x can be run on Windows, Linux and macos? No, just Windows, and him can be considered obsolete. And application using . NET Core can run on Windows, Linux and…
-
3
votes1
answer410
viewsA: Why can’t I make an "append()" on a list formed from a "Join()"?
The error is precisely this that is written in the error message, interpreting it already knows what occurs. In case you’re creating a string and guarding in abc, there calls a method called…
-
2
votes1
answer88
viewsA: Is it possible to have a list as an attribute of a table in a relational database?
It is not possible to do this in a natural way. The most common is that a list is another table doing the correct one normalization and relationship among them (see more). In some cases…
-
7
votes2
answers202
viewsA: Is there a difference between a perfect binary tree and a balanced binary tree?
Yes, as the name says a perfect binary tree has all its uniform nodes, having no imbalance, so it is always connected to 2 nodes (except the last one which evidently may have only one). It’s…
terminologyanswered Maniero 444,682 -
8
votes3
answers2052
viewsA: Convert a comma-separated string to a multidimensional array
There’s a lot of mistakes in there, and I can’t even begin to say what. There are some ways to solve this, I preferred so, although maybe not the most efficient (but in general the staff usually…
-
2
votes1
answer406
viewsA: What is a Service Class? And what would a Service be in that context?
There is a bit of controversy about what is and there are different contexts even for the service class. For example if using the DDD discipline it has a clear definition of what it proposes, which…
-
4
votes1
answer54
viewsA: Can a local chatbot be considered a P2P system?
To be peer to peer needs to be able to connect one chat with another without intermediaries. Worse yet, a chatbot should operate on an existing chat and not be a chat if it is a chat, before being a…
-
6
votes1
answer150
viewsA: Is it possible to delay the initialization of a constant?
I answered because I think there is genuine interest and many can learn from the content here, and I only did so because I had a bad answer, so either it was to erase everything so as not to give…
-
4
votes3
answers431
viewsA: What is the difference between float and float[]?
The guy float is a type of numerical data that holds values of various magnitudes and accuracy in the well-rounded decimal part, so it can hold very large and quite fractionated values. Contrary to…
-
5
votes3
answers641
viewsA: What is Unobtrusive Javascript?
It is an evolution and expansion of When to use Graceful Degradation and when to use Progressive Enhancement? (I will not give details because there is well answered and in the background is what…
-
5
votes2
answers123
viewsA: How far should we follow OCP?
Open Close Principle In my vision the OCP is the most complicated principle to follow within the SOLID. And often it is adopted as cake recipe. Luckily you are questioning it. I don’t know if you’re…
-
2
votes1
answer40
views -
4
votes3
answers906
viewsA: How to run the loop for 2 in 2?
Probably missing a space in the printing, the automatic broker of the site wants something exact, can not miss even the space. But I took advantage and simplified and gave more performance to the…
-
6
votes3
answers10568
viewsA: What is the difference between using += and =+ in Python?
I am considering that using a standard numeric type existing in Python, with another type of data can give another result or error. The first is adding up the value of n at value x existing and…
-
3
votes2
answers106
viewsA: How do I get a variable in another method?
It has two strategies and depends on what you want. You must communicate the value through the method, step it as argument and I receive as parameter and return the changed value for who called.…
-
2
votes2
answers290
viewsA: Why should we use HTML 5 instead of Javascript?
Understanding the DOM and the relationship between HTML and Javascript There are already some questions about the DOM: What is DOM, Render Tree and Node? What is parse, and how the parse of DOM…
-
1
votes1
answer272
viewsA: On which layer should I create constants in my application with DDD concept?
First make some considerations: Constant is really useful? and What is the difference between const and readonly? (the most important is the philosophy of use of each). Just as variables constants…
-
3
votes1
answer185
viewsA: When is an operating system created the compilers of ASM, C language, CPP must be created as well or are portable?
The question starts from some wrong premises. No operating system needs to do anything he doesn’t want to. The reason to create one no matter the purpose is can do what the creator wants and set…
-
1
votes2
answers282
viewsA: Array return
The code is very wrong and not close to what it asks even having basic errors in the code, so consider doing simpler exercises first while not mastering something so complex. And if the statement is…
-
2
votes2
answers77
viewsA: Performance problem when declaring variables
It may be that the code posted is not the same one you are using, but in this case I didn’t see much real difference in making one way or another from the point of view of typing or readability.…
-
4
votes2
answers1779
viewsA: Function to calculate calories
One of the mistakes is that it’s not accumulating calories every time. Another is that in this case it is one of the rare ties that should start from 1 and not from 0 and end when you arrive at the…
-
4
votes6
answers2258
viewsA: Exercise: loop and for
I do not know where the statement comes from, but it is not good, I would rethink if it is worth continuing with this source of study. For example he talk about xand have the loop variable be i.…
-
2
votes1
answer207
viewsA: Instantiating an entity within another entity: how to do it?
Contrary to what the other answer says, it is not a question of performance, unless you are talking about the quality of this particular code. The issue is construction warranty. Read What good is a…
-
2
votes1
answer56
viewsA: What are the differences when including values (coming from a form for example), in a query mounted in PHP and executed in MYSQL, among the forms below?
1st form: Completely insecure, is prone to attack SQL Injection. Takes data directly as PHP natively delivers what comes from outside and uses in query. 2nd form: It cleans up the contents of the…
-
7
votes1
answer3822
viewsA: What is debug? What is it for and how to do it?
That one debug who is speaking is a tool that we say we use to do debugging, ie to monitor and analyze the execution of the application to understand what is happening and try to find what is…
-
4
votes1
answer173
viewsA: How to play a var inside Return?
That? function tamanhoNomeCompleto(a, b){ return a.length + b.length + 1; } console.log(tamanhoNomeCompleto("Paulo", "Paulada")); I put in the Github for future reference. To variable is totally…
-
6
votes2
answers348
viewsA: Should or should not Httpclient be used within a using block?
The big problem is precisely that it is misleading. By having implemented the interface IDisposble everyone thinks they should use the using. And I don’t know if in the first implementation of this…
-
3
votes1
answer516
viewsA: What is the difference between an Entity and a Model (MVC and the like)?
I’m imagining that in the context you’re using it’s the same thing with different names, and it depends a little bit on the discipline you’re adopting. In MVC itself the term is model. I don’t see…
-
8
votes3
answers690
viewsA: What is a mainframe?
In general it has always been known as a large computer, as opposed to smaller computers. They used (or are in some rare cases) to be used for quite complex tasks (by the standards of the time) and…
-
6
votes1
answer219
viewsQ: How does the . NET "using" and Garbage interface work?
In a reply now deleted here on the site it seems that there was some confusion with the content indicating the use of GC.Collect() and how the using C# works. So how does it actually work using and…
-
5
votes1
answer219
viewsA: How does the . NET "using" and Garbage interface work?
The question is best understood with the context of the deleted answer and the discussion that took place there. In a reply now deleted here on the site it seems that there was some confusion with…
-
8
votes2
answers118
viewsA: What’s the difference between executing code inside or outside the "for" keys?
It is a matter of intention, this type of loop has a construction with 3 parts in its statement: a state-of-control initialization of the steps of each execution, and all variables involved in it…
-
7
votes1
answer443
viewsA: Is Laravel’s Blade a programming language?
I took a look over at documentation and as far as I can make out Turing complete, therefore it is a programming language, as well as any language of template well complete. What made me consider so…
-
0
votes1
answer448
viewsA: Decrease SQL database size [Oracle] - ORA-12953
You can change the tables to wipe the data with: alter table mytable enable row movement or alter table mytable shrink space cascade I put in the Github for future reference. Source.…
-
14
votes2
answers252
viewsA: Difference between instantiating class and using
The question itself doesn’t make as much sense because in both is instantiating a class, in exactly the same way other than the fact that one of them is using a var that could have used in both…
-
2
votes1
answer175
viewsA: Concept of delegate in Flutter
I’m going to talk about Dart and not Flutter because Flutter isn’t supposed to have this, this is a language mechanism and the language is Dart, so you can use this in Flutter. It seems like people…
-
2
votes3
answers843
viewsA: Show the amount of each alphabet letter in a String
I decided to answer because I did not like the current solutions, although certain. In general the staff does not program thinking about performance. In such an algorithm that can be used over and…
-
5
votes1
answer68
viewsA: In Assumptions on Timing - I don’t understand this concept of a book
This means that you cannot consider when things are going to happen. They will happen when they have to, in the order the application determines to be best and possible in the current processing…
-
3
votes2
answers73
viewsA: Error in a function that returns an AND of two variables in python
It’s the same problem as your previous question, so you didn’t learn from the solution there. , you have to convert the values individually to apply the operator, you are applying the operator to…
-
5
votes1
answer67
viewsA: Is it possible not to allow duplicity in a combination of 2 columns or more?
Yes, it is possible, the simplest way would be like this: CONSTRAINT nome_da_chave UNIQUE (coluna1, coluna2) If you are going to change an existing table you have to do: ALTER TABLE tabela ADD…
-
6
votes3
answers170
viewsA: How to change property access level in an inheritance?
It is not possible, period. They tried to give a solution, but it does not exist. Once the field (and not attribute, this term is wrong, but it is worse because this is not even a field is a…
-
1
votes1
answer356
viewsA: Dynamic string allocation in an array
There are several errors there, some not exactly mistakes but this is not how it is usually done: The syntax errors I just fixed, I won’t even mention them. Pay attention to every detail of the code…