Posts by Maniero • 444,682 points
6,921 posts
-
6
votes1
answer339
viewsA: Create pull function()
Just give you an initial hint: this looks like exercise and is ok to do so, in real applications that need OOP in general the problem is much more complex than this and the way to do it is quite…
-
3
votes1
answer415
viewsA: Temporary variable performance within loop
First, are you sure the comparison is the same? Of course assigning a value outside the loop is supposed to be faster. Already declaring should be the same. But not necessarily. It has to measure.…
-
4
votes2
answers1061
viewsA: Most odd number
The algorithm does not do what the statement asks. To take the largest odd you must store the largest in variable and update it whenever you find an odd larger than the one already stored. I also…
-
3
votes2
answers71
views -
8
votes2
answers4088
viewsA: Getters and Setters Methods
It is not required. In fact in PHP is almost always a cannon to kill bird in these cases. In most situations, given the nature of script PHP, there is little or zero gain in using this kind of…
-
2
votes3
answers1520
viewsA: Can I use an iPhone to test a Xamarin app?
There is no iOS emulator for development, at least not on Windows. Doing so would violate the license imposed by Apple. In the new Visual Studio 2017 Enterprise, IE, the very expensive, has a form…
-
19
votes2
answers2108
viewsA: Are function and method the same thing?
It is not the same thing, but almost. The functionality of both is the same. It is a difference between procedural and object-oriented paradigm terminology. The function is an algorithm, a set of…
-
7
votes1
answer1722
viewsA: What is the real difference between the operator '=' and LIKE?
The same = search for equivalence character by character, has to be exactly equal. Already the LIKE looks for "something like", ie content that has the text searched in a part of where (column(s))…
-
11
votes1
answer712
viewsA: What is the concept of integers signed in a programming language?
If signed whole is meaning checked integer, it is the type normally used in Java. The number has a bit to indicate whether it is positive or negative. Many languages have signal-less types where…
-
2
votes2
answers1212
viewsA: How to use and what is the timer function in C#?
Timer is not a function, is a class that provides a mechanism that allows specifying a time frequency that a given operation must be performed. This creates the object by configuring what should be…
-
17
votes1
answer25845
viewsA: In Python we have the switch function?
No, in general the solution is to use if and elif: x = 1 if x == 0: print("imprime 0") elif x == 1: print("imprime 1") elif x == 2: print("imprime 2") else: print("imprime outra coisa") Or a…
-
11
votes2
answers736
views -
19
votes3
answers9682
viewsA: What’s the difference between Where and having?
Both work as one if, that is, filter lines from the database. The WHERE works directly on the line, already the HAVING works in row aggregator results, the most used is with the GROUP BY.…
-
12
votes1
answer249
viewsA: Everything I can do in POO I can do in PE?
Yes, any programming language can do everything. Now, each paradigm You have your own way of organizing, so you can’t always do it the same way. Moreover, with some languages and use of certain…
-
6
votes1
answer609
viewsA: Working with Hexadecimal in Java
First: hexadecimal is just a numerical representation, so no matter how it was described in the code, what matters is the number itself. Second: it has no secret if it is known what the operator…
-
7
votes6
answers7179
views -
4
votes2
answers54
viewsA: What do I need to change in this method to work properly?
Avoid using flags as much as possible, every time you have a flag in a code it is probably misspelled. In this case it would be better to do the following. public void…
-
5
votes2
answers2577
viewsA: Find amount of times a character appears in a word using recursiveness
The code has some problems, but the main thing is that it is not ideal for recursion. Every time you have to pass a recursion control state, the iteration is usually better. This is an exercise to…
-
3
votes1
answer182
viewsA: Which Ides have Hack language support?
I went in the OS to see. It is not very updated, but there says Vim Emacs Sublime Atom Nuclide Phpstorm should have support eventually, and may be the best option shortly after.…
-
9
votes2
answers1167
viewsA: Foreach of C# vs Foreach() of EF6
Contrary to what it may seem, the Entity Framework LINQ codes will attempt to generate an SQL expression or something equivalent that processes the database data. It will not execute exactly the…
-
16
votes4
answers829
viewsA: Best approach is to filter data in the database or application?
Let the database work for you. Not that this is an absolute truth. But bringing a lot of data to the filtering application is almost always a mistake. I say it almost because there can always be a…
-
12
votes1
answer517
viewsA: What is the name given for the number of columns in a table?
The number of columns is aridity and the number of lines is cardinality. Source. Column, term widely used in SQL, is popularly known as field and academically as attribute. Row, term widely used in…
-
5
votes1
answer56
viewsA: Object state invariance check between private methods execution
Dbc There is a secondary development paradigm called Design by Contract (Dbc). It can be used in any language, but some have their own syntax to facilitate. It is used to give more reliability to…
-
4
votes1
answer100
views -
9
votes2
answers967
viewsA: How to test private methods in C#?
The answer you really want is that of LINQ. But testing unit in private methods is a conceptual error. Unit tests should verify that the public API is always responding in the expected way. Private…
-
4
votes2
answers1292
viewsA: What are the differences between client-side and "Rendering" server-side?
This is about who assembles the content to be presented. If it is on the server it obviously has all the work of assembling a text that will be the page to be delivered to the client essentially…
-
5
votes2
answers464
viewsA: What is the specific area and professional that defines the layout of data in files in a software project?
In general it is called software engineer, but it also meets by developer, programmer, architect and a lot of other names. There is something so specific and there are few definitions of ways of…
-
10
votes11
answers38715
viewsA: How to check if the variable string value is number?
Can use isdigit(). num = input("escolha um valor de 0 a 10") if not num.isdigit(): print("Digite apenas numeros!") print(num) Behold working in the ideone. And in the repl it.. Also put on the…
-
5
votes3
answers1491
viewsA: How to replace the number of letters of a word with a character?
There is a ready-made builder to do this then it is very simple. using System; public class Program { public static void Main() { var texto = "carambola"; var adivinha = new String('_',…
-
5
votes1
answer127
viewsA: Description of a declaration by reference
A bit of history I decided to answer because there is a vision created in the 50/60 years that should comment code. It was very necessary because they programmed in Assembly that has no way to be…
-
1
votes1
answer717
views -
4
votes3
answers606
viewsA: Find the element with the highest number
Keeping the algorithm you did initially has two problems, it is not keeping which is the biggest anywhere. And it is saying who was elected every time a new candidate evaluated has more votes than…
-
2
votes1
answer1259
views -
3
votes2
answers170
viewsA: How do web hosting systems work?
What are the types of limitations that a common host has (or some limitations that can be considered when making the right choice)? In general there are the obvious limits of disk space you can…
terminologyanswered Maniero 444,682 -
4
votes1
answer179
viewsA: Final local variable in Inner class in Java 8
Try making a change in msg and see if compiles. Java 8 decided to infer the final if there are no changes in the variable, so you do not need to be explicit, but at the bottom even in Java 8 msg is…
-
12
votes2
answers1826
viewsA: How is a program loaded into memory and then executed?
I think you’ll want to know how the computer works with the code. The exact way the operating system loads an executable despende d and which operating system we are talking about. The executable…
-
6
votes1
answer249
viewsA: Why doesn’t localhost go online?
By specification all IP with class A 127 is reserved for internal network, so it is possible to use more than 16 million addresses internally. Of course this goes for Ipv4. In Ipv6 it changes a…
-
0
votes1
answer77
viewsA: How to fill out INPI data in a . NET project
There is no correct form because these attributes are purely descriptive and you can put the way you want, one or the other has some semantics that if followed can be used by some specific tool.…
-
15
votes2
answers11213
viewsA: Is it possible to create a C/C++ app for Android?
Yes, it is possible, There is something called NDK (fantastic translator used on this site, translated up the code :) ). Obviously you will have more performance eventually be better or easier to do…
-
5
votes2
answers691
viewsA: Correct use of Override and constructor
If I understood correctly, if the statement is correct, except for the fact that use float for monetary value that is a conceptual error that will calculate wrong values, but that doesn’t get in the…
-
2
votes1
answer142
viewsA: Data Structures - List Differences
In addition to the members' names the first creates a new type that can be used anywhere in the code where a type fits, so tipo_lista becomes as much of a guy as int is a guy. The second creates a…
-
14
votes6
answers1056
viewsA: How to make a Split for when there is a letter in the string?
Use the Split() to break using a array with all the characters that can be broken. To facilitate, although not the most performatic (but not exaggerated) can create a string and turn into a array of…
-
7
votes2
answers279
viewsA: Is there a difference in how polymorphism is applied in Java and C# ?
The answer from LINQ already said that it does not give, but it has solution. I’ll guess more or less how would be the class that needs: using static System.Console; using System; public class…
-
3
votes1
answer574
viewsA: How does the Type.Invokemember method work?
I strongly advise reading the documentation which has all the details about the method and examples of use. This is a method belonging to the type Type which is a type basically used for the…
-
4
votes2
answers11063
viewsA: How to use % in Portugol
Same in any other language. Same alias in mathematics. liquido <- valorTotal * (100 - descontoInss) / 100 I put in the Github for future reference.…
-
14
votes3
answers2425
viewsA: Why in Java is the size of an array an attribute and a String and a method?
I researched because I wanted to know the reason. I concluded that there are only speculations, nobody knows the real reason. Only the developers can answer this. What seems clear to me is that the…
-
3
votes1
answer1731
viewsA: Search repeated numbers in list with Visualg
algoritmo "semnome" // Função : // Autor : // Data : 30/05/2017 // Seção de Declarações var vet:vetor[1..100] de inteiro i, igual : INTEIRO inicio Para i <- 1 ate 100 faca Escreva("Digite um…
-
7
votes1
answer4407
viewsA: What is the difference between Traffic Light and Monitor?
The monitor is a higher-level mechanism aimed at preventing inappropriate concurrent access, requiring an thread wait for another to finish what you’re doing. It is a specific object that controls…
-
12
votes4
answers3416
viewsA: How to do a search to know if a string is inside a vector in C#
If you can use LINQ (Contains()) can resolve on if who decides whether or not to meet. using static System.Console; using System.Linq; public class Program { public static void Main() { string[]…
-
5
votes1
answer68
viewsA: Does the amount of bytes during a file read vary according to the mode chosen?
By no means does the file have the amount of bytes it has, no matter the read mode. What changes is that reading in text mode there is a treatment for the word wrap indicator that will be…