Posts by Maniero • 444,682 points
6,921 posts
-
4
votes1
answer146
viewsA: Problems with Assembly
Do not use Dev-C++, it is quite problematic. But there are IDE for Aseembly yes, just to name a few you have the Winasm, the Fresh, Easycode, Visualmasm and there are even simpler ones, editors that…
-
2
votes2
answers98
viewsA: Continue "do while" from last point
The first thing you need to change is to eliminate the recursive flame that will end up causing problems. It may cause nothing in the exercise, but it will learn wrong. This will burst the stack in…
-
10
votes3
answers2531
viewsA: How to select all columns except one in particular?
Unable to grab all columns except one or a few specific ones. Generally catch everyone is already a mistake, gets worse when there are exceptions. Almost every time someone wants to do this is to…
-
12
votes1
answer488
viewsA: Why is the application entry point a static method?
Initially the application is not an instance of anything. And in a way this explains why the method is static. It could be an instance method, there’s nothing technically to stop you doing it that…
language-independentanswered Maniero 444,682 -
4
votes2
answers540
viewsA: PHP POO error Polymorphism
I often say that if everyone who says they do OOP did it right, I would quit. OOP adds complexity to the code. If done where you need to bring advantages. I see some problems in this code. First I…
-
2
votes2
answers81
viewsA: Doubt between block and statement
Initially I answered generically and researching over there was documentation that implied that a block is not a statement. Seeing the Java specification makes it clear that the right answer is D,…
-
3
votes1
answer98
viewsA: A user model should have all the actions that involve it?
This has nothing to do with MVC but modularization or project organization with a whole independent of being MVC or not. It’s even about object orientation. Facilitating maintenance is somewhat…
-
5
votes1
answer1716
viewsA: How to create a single index based on two columns?
CREATE UNIQUE INDEX IpEmail ON tabela (ip ASC, email ASC) Documentation. I hope you have another column that is primary, these data may vary and are not good candidates for primary key. If you want…
-
13
votes3
answers599
viewsA: Is mixing HTTP with HTTPS a problem?
Generally speaking, it’s not a problem. Of course you have to do it right. I realize that some people don’t really know which pages should be encrypted, and they end up encrypting what’s not a…
-
3
votes3
answers218
viewsA: Dictionary does not return all possible words
The biggest problem there is that you’re not comparing the strings correctly. Need to use function strcmp() to compare character to character. Maybe because you didn’t know it the algorithm got…
-
2
votes1
answer2462
viewsA: Put multiple classes in the same file
Java really limits having more than one public class per file. All other classes must be internal to the package. Furthermore, the public class must have the same file name. If you need multiple…
-
0
votes1
answer242
viewsA: Check if a variable exists in a class
Are you sure you don’t want to do anything if the variable doesn’t exist? This is probably a programming error and should be fixed. Exception does not serve for this. If you want to insist just…
-
3
votes1
answer257
viewsA: Is Myisam the default Storage engine on this Mysql server?
This is Portuguese from Portugal. By default it would be by default, or by default as we usually use in Brazil. It is the value that will be used in the absence of a certain value explicitly at the…
-
1
votes2
answers841
views -
4
votes2
answers84
viewsA: Comparing two objects and copying conditionally
The simplest way is this: PessoalAlteracao.CPF = PessoalAlteracao.CPF ?? Pessoal.CPF; I put in the Github for future reference. All other options are more complicated. Some may have fewer lines (for…
-
6
votes1
answer117
viewsA: Is it bad practice to use an "optional" variable inside an object?
I talk a lot about malpractice. I say how much this means little or nothing. You have to do what you need to do to meet the need in the best way possible. This varies from case to case. Can you…
-
2
votes1
answer121
viewsA: What is Metadata-Based Architecture (MDDA)?
It’s an architecture that preaches an abstraction level so high that there’s virtually no code. There’s a framework that works with defined metadata to create the application. It is a declarative…
-
3
votes2
answers2516
viewsA: What’s the difference between Team Foundation Service and Git?
Both are version controllers that we can say are concurrent. In essence it’s the same difference between Git and SVN. Git is decentralized and TFS is centralized. Of course, their working philosophy…
-
3
votes2
answers461
viewsA: Do I need to import a module several times?
The import is usually only valid for the file where it is made, so you need to explicitly import in everyone who will use that module. Of course if you import a module into a file and then import…
-
10
votes1
answer269
viewsA: What sort algorithm does . NET use by default in a list?
It uses an algorithm of classification. The Sort() class List<T> uses the algorithm of array, since internally the list is only one array. According to the documentation it uses an…
-
3
votes1
answer82
viewsA: How to treat an index band exception?
The error is in one of these lines at most in the last, but it may be up to an earlier one: this.txt_solicitacao.Text = row.Cells[0].Value.ToString(); this.txt_cliente.Text =…
-
6
votes2
answers677
viewsA: Is it mandatory to open and close connection when entering data?
It is not mandatory, but it is common to close so you no longer need to use it at that time. Corruption happens for other reasons, even because if it was open or could access again. You don’t even…
-
28
votes3
answers128363
viewsA: Number of characters of CPF, CNPJ and RG
Are there valid Cnpjs with fewer than 14 characters? (e.g., old companies) The format is this for all national companies. One day it may change, but today it is always so. Some systems may have to…
-
0
votes1
answer171
viewsA: How to put class information in an array?
Programming is about conceptualizing well, it’s about writing significant code. It’s not about typing less. What you’re trying to do is make the code unreadable and create maintenance issues. Don’t…
-
2
votes2
answers792
viewsA: What’s the difference between echo, print, var_export in PHP?
In fact almost all printing options were dissected in Difference between var_dump and print_r and echo or print, which really is the best option?. Then the var_export() does the same as the…
-
13
votes5
answers2375
viewsA: Should I show generic error messages like, wrong password or user, or specific messages?
Today very rarely will someone do something like this because it is easier to program. Of course, if the programmer is a layman, and many are, maybe he does it out of ignorance, but it’s never the…
-
2
votes2
answers425
viewsA: Class association or inheritance?
It seems to me that an academic is not a user, although he seems to be. If he is not, there is no inheritance. You can force that to be true, and some will say it is, but I wouldn’t go that way. An…
-
3
votes2
answers409
viewsA: How does Python keep the same memory reference as a list after resizing it?
Because the object of the list is not the direct reference to the array, it is a structure with some information, among them the reference to the array that makes up the list. This is internal…
-
1
votes1
answer303
viewsA: Instantiate a class that inherits an interface class
Class and interface are very different things, either it’s class or it’s interface. Classes and interfaces have in common that are types, that’s all. The instantiation of a class is independent of…
-
23
votes3
answers4426
viewsA: In practice, what is the use of C-pointers?
Essentially serves to create indirect. What can be very important to solve various computing problems, as the answer linked. So instead of accessing a value directly, you have an address where you…
-
5
votes3
answers230
viewsA: Why are methods that operate pointers insecure in . NET?
What does this modifier do? The modifier only indicates to the compiler that you will use unsafe code and therefore it must allow this code to be considered valid. To compile a code unsafe it is…
-
3
votes2
answers74
viewsA: What’s missing from this code?
So it works, I think it was just typo since the created class calls TarefaDeCasa and the call to instantiate was Tarefa: fun main(args: Array<String>) { val minhaTarefa =…
-
5
votes3
answers608
views -
3
votes1
answer274
viewsA: Use of async with . NET Core and nhibernate
The method BuscarTodos() obviously will never execute asynchronously. Your Get() will perform so when called with a await, unless it is modified. Since it is very simple and only calls another…
-
4
votes1
answer77
viewsA: How to solve the code duplication problem?
Create an intermediate class, something like that: class CustomListTable extends WP_List_Table In it overwrite the methods you want and create new ones that will be common. Then inherit like this:…
-
2
votes2
answers83
viewsA: Accessing variables from a struct
Essentially understood everything. The first is taking the amount that is in the address depois and then taking the field hora (in the question the field name is wrong). The parentheses are just…
-
2
votes2
answers63
viewsA: Optimization of database model
Essentially not, unless you change the requirement. And you have no unspoken requirement. I don’t think you’ll have as much data as you think there will be. Even less that there will be performance…
-
1
votes2
answers212
viewsA: Recursive algorithm does not work
I improved a few things to make the code more C-like. I also solved some other problems that the code had that are not in the statement, but if not treat it gives error. For lack of a specific…
-
0
votes1
answer510
viewsA: How to turn pointer into matrix
The code has some problems that I fixed. It’s also a little poorly organized so the comments made themselves necessary. I didn’t organize everything, but if you do well organized you don’t need…
-
4
votes2
answers455
viewsA: How to fix this error "Cannot Convert from 'int' to 'char[]'
See the documentation of this method. There are several overloads to call you, each handles the information in a different way. Most are for basic types of language and as can be seen only accepts…
-
7
votes3
answers309
viewsA: Fibonacci sequence does not work
The reason I was wrong is that the logic is too complex. Following the definition of Fibonacci makes it simpler. The definition states that the sequence begins with 0 and 1, so start the sequence…
-
7
votes1
answer357
viewsA: Differences between Python and Javascript in relation to arrays?
Although identical syntax, semantically what is produced with it is very different in each language. In Pyhton this code actually produces a list. In Javascript what you are creating is a…
-
6
votes4
answers1933
viewsA: How to choose a convention for variable and function names?
In fact, you need to follow a convention, which you already know. The convention can change according to the technology, so if you are programming in PHP can be one, and in Javascript can be…
-
9
votes2
answers248
viewsA: Alternative to Observable and Observer in Java 9
Like every function that becomes obsolete, they did not meet the needs well, were poorly designed and now have better solutions. These types were too general, did not carry important information…
-
1
votes1
answer544
viewsA: Check null or empty fields in an entity without consecutive use of "if-Else"
There is always another way. The question is whether it is suitable for current need and will be for others that may arise. You need to do something that’s conceptually right. I see no problems in…
-
12
votes2
answers1070
viewsA: Path from previous folder
I believe you desire the GetParent(). using static System.Console; using System.IO; public class Program { public static void Main() => WriteLine(Directory.GetParent("/Pasta1/Pasta2")); } Behold…
-
2
votes2
answers307
viewsA: C Cast vs C++ Cast
There is a fundamental difference since, as the name says, cast C++ is static, meaning it is done at compile time, there is no external cost and can produce an error before generating the…
-
2
votes1
answer108
viewsA: Machine Learning with a server language and another desktop language
Yes, you could. You can do anything in any language. For my taste I think it makes more sense to do the opposite, but I know there are those who disagree. To tell the truth I would do everything in…
-
5
votes1
answer123
viewsA: How to present the untreated exceptions?
I am not an expert in UX. For my taste, not talking much to the average user seems ideal in most cases. For technical user it can be useful to give information that helps him do something. The…
-
3
votes2
answers280
views