Posts by Maniero • 444,682 points
6,921 posts
-
2
votes1
answer738
viewsA: Comparison of char type variables
First, the comparison is being made with a array of characters. And is comparing a size 5 to a size 0, of course this does not work, making the array the correct size works, although you may still…
-
3
votes1
answer462
viewsA: Alternative to multiple inheritance
Multiple inheritance is problematic and is rarely needed in fact. How one thing can be two things at once?. Besides the same inheritance gain is very small in almost all scenarios, mainly if one…
-
5
votes1
answer449
viewsA: What is the smallest memory unit of a processor?
The only place where you have an application information on the actual processor is the register, so it is the smallest and largest unit. Today the processors are more complex and have specialized…
-
10
votes1
answer1008
viewsA: What are the most common types of databases for web applications?
Fired the most used is the model relational that has been there for more than 40 years serving very well almost all computing problems that require data storage. Other models are being used more…
-
11
votes2
answers772
viewsA: How does XOR work for two binaries with more than one digit?
The binary numbering system works no different than the decimal system. Just as sum or multiplication works equal, so do logical operators. So the XOR is bit by bit, as you would add a decimal that…
-
1
votes1
answer179
viewsA: Malloc does not work in C code
The first only generates one Warning because it is only a possibility of problems, write like this and it should work: int* vetSoma = malloc(sizeof (int) * 20); I put in the Github for future…
-
21
votes3
answers478
viewsA: Can Garbage Collector language be used for games?
Any language that uses a garbage collector in systems real team will have problems because the memory release time is not deterministic, which is a fundamental feature for real-time system. Even in…
-
4
votes3
answers92
viewsA: VB.NET to C#
That code is really bad, I think the best way to do this would be with if: var WebReq = HttpWebRequest.Create(GET_Data); using var WebRes = WebReq.GetResponse); using var Reader = new…
-
1
votes1
answer106
viewsA: Arrays in loops
By the comment you know how to fill the first two. If you want to print the array arr, should print what? The variable containing the array, right? More specifically you should print an element of…
-
2
votes1
answer1466
viewsA: How to store the return value of a function in a local variable in C?
Just as you can assign a value literal in variable, may assign a expression since you made a subtraction, which is an expression. An expression can contain a number of things that generate some…
-
1
votes1
answer279
viewsA: Error: "error: array type 'int [sizeExcedent]' is not Assignable"
C can only copy simple memory to copy one array needs a function (in fact all languages are equal, only different C that gives you the power to do it the way you want while others make a pattern…
-
4
votes1
answer156
viewsA: What are symbols in the . NET Framework?
Symbols Symbols are names. In fact this is for any application, it is not exclusive to NET. They are linked to some address, but not necessarily a physical or fixed address, it can be a relative…
-
13
votes3
answers511
viewsA: What is the most recommended "Try" or "if"
I wouldn’t use either, or even use the if, but in a different way: using static System.Console; public class Program { public static void Main(string[] args) { var textBox1 = "123.45"; //só para…
-
2
votes4
answers191
viewsA: Can you make one simpler than that?
Yes it is possible, no need to create auxiliary variables and no need to take care of the exception within the loop. It would eliminate the increment in one of the variables, but it would create…
-
1
votes1
answer427
viewsA: List web file folder
For HTTP there is no way to do it this way. Actually there will have to be API and remote access that allows you to do by HTTP. If you just want to take the data on the network and can be by any…
-
3
votes1
answer70
viewsA: Use of % in variables
In Shell Script this is an indicator formatting, so it will take the result of date and will apply the format that the programmer establishes right after, in this case the %H indicates that you only…
-
9
votes2
answers281
viewsA: What is the correct syntax to use C# object orientation using . NET Core?
Any material that teaches a language on top of an IDE is not a good material to learn language. I don’t even like the material you are using, but it’s just my opinion. C# is the same language no…
-
3
votes1
answer61
viewsA: Why does the server require open ports on an access modem but the client does not?
The client does not receive requests, it only issues them. The server receives requests, so it needs to be allowed to do so. If I allowed all the doors I would have a large attack area through…
-
3
votes1
answer393
viewsA: Why does input work in Python 3.x and not 2.7?
Use raw_input() to read strings in Python 2: name = raw_input("tell me your name:") print 'Hello', str(name), '!' Behold working in the ideone. And in the repl it.. Also put on the Github for future…
-
5
votes2
answers1982
viewsA: How to call a method within a System.out.println?
The code has several errors. There is the name of the method that is declared as uppercase, which is not ideal and is calling lowercase. He’s getting parameters that aren’t even needed, but the call…
-
9
votes1
answer5883
views -
3
votes2
answers87
viewsA: Why is this code not generating the average correctly?
The main problem is that the return is inside the loop, so it makes the calculation in the first step and already leaves the function then. Removing the return of loop it only runs at the end when…
-
6
votes1
answer302
viewsA: What happens in real life in a developer environment if the programmer does not encapsulate an attribute?
There’s an earthquake in Canada :) If it’s necessary and you know what you’re doing, it’s okay. Of course, this example can be a problem because a balance should not be manipulated directly. I don’t…
-
4
votes1
answer146
viewsA: Garbage Ollector is automatic?
It is automatic and What you did should not be done. The problem is that actually either there was no pressure from memory or you is not releasing memory as you think you are. I don’t know the…
-
5
votes2
answers6106
views -
1
votes1
answer113
viewsA: Relation between structs in C
Basically is produto.unidade.cod = 10; where produto is the instance variable. The reading would be done like this: produto.unidade.cod I put in the Github for future reference. If the object is…
-
8
votes2
answers368
viewsA: How to get the properties of a type when using Generics C#
It is possible using the operator typeof. See the difference to the GetType(). I don’t know if you really need to do this, the code is so simple that you wouldn’t even need this method, let alone…
-
4
votes1
answer5675
viewsA: What is "overlay" and what is its connection to memory?
This is used in primitive operating systems. The famous MS-DOS used this technique. Today it is only used in very limited devices, although some are becoming quite popular with the Iot. In general…
-
6
votes1
answer126
viewsA: A property occupies space in the object?
The property itself is a method, or a pair of methods get and set. Then, like any method, a memory space is occupied for the method code once in the application, no matter how often it is used. It…
-
9
votes1
answer3480
viewsQ: What is ACID in a database?
I’m not talking about web implementation indicator. Besides the acronym, because it’s important?
-
9
votes1
answer3480
viewsA: What is ACID in a database?
Totomicity It is something indivisible. Either everything that is in a transaction must be carried out successfully, or nothing must be carried out. At least nothing should be considered fulfilled.…
-
31
votes2
answers48751
viewsA: What are Begin, Commit and Rollback transactions?
Actually transaction is the whole process of query or manipulation of the database. It is a way to establish that something should be done atomically, I mean, you do everything or do nothing, you…
-
23
votes4
answers936
viewsA: Why is the use of Dynamic something to be avoided?
Never accept something that says a practice is good or bad, it serves nothing but for the person who said "impose" your will. If the person explains why it ceases to be a mere practice and becomes…
-
12
votes1
answer127
viewsA: Static members are collected by GC when no longer needed?
The variable will never be collected, it stays in a static area and as you said yourself, lasts the time of the application. So any object referenced by it will stay alive at all times. The static…
-
16
votes2
answers590
viewsQ: What does Iot mean in the context of development?
Today only talk about Internet of Things. I understand that this is the use of the Internet in various devices. The idea is that any object can connect to the internet and benefit from this.…
-
6
votes2
answers1503
viewsA: How to identify the MVC version?
As it was not specified whether it is in code or not, go by code: typeof (Controller).Assembly.GetName().Version I put in the Github for future reference.…
-
17
votes2
answers4107
views -
12
votes1
answer173
viewsA: Constant is really useful?
I do not know if there is greater readability. Until it has to be considered that it indicates better the intention of the value to be constant. The constant, as long as it’s constant*, has the…
-
7
votes1
answer83
viewsA: Is there any way to be notified that there will be a garbage pickup?
Event even does not have, this would be little useful since at the time you need to make the collection nothing else can be done. What you can do is be notified before an allocation is made, it is…
-
8
votes1
answer122
viewsA: Why should a struct have a maximum of 16 bytes?
In fact you can use the size you want, the recommendation exists for efficiency. This recommendation is only to alert you to investigate further whether it will be a good option if you run away from…
-
4
votes1
answer306
viewsA: PHP x C++ web performance and security
1 - C++ running on CGI will really be more performative than PHP on Apache2? (I know this depends a lot on the application, but take into account a well written and architected application) Yes,…
-
3
votes2
answers118
viewsA: Can I have more than one Views directory in MVC?
You can organize it any way you want. The disposition of where things are doesn’t matter. Of course it’s very easy to maintain the standard that Visual Studio already knows how to work well. No…
-
1
votes1
answer101
viewsA: Use of Sqlite Android
It is usually used to store application data on the device itself, like every database. If you are not doing this you should remove any reference to it in the client application that will run on the…
-
3
votes1
answer185
viewsA: The 'Connection' object can be discarded more than once in the method
Just take the explicit closure of the connection, after all it is doing right with the using that will close the connection. public ActionResult Index(ViewModel model, string returnUrl) { var query…
-
8
votes1
answer771
viewsA: Fibonacci sequence
The algorithm does not do what is in the statement. It does not ask to create array. Okay, it’s a form, but confusing and not optimized. It stops when the sum reaches 100000, this is never checked.…
-
7
votes2
answers602
viewsA: Difference in C/C++ array declarations
The first two are creating a array crude, the one that was used in C. In idiomatic code C++ this type of array except to chat with C code or who likes to mix two different languages. In practice,…
-
7
votes1
answer51
viewsA: Operator "and" for class assignment
The same as in if, after all this is a boolean operator, it can be applied in any expression that requires a true or false result, it does not need to be in a if as many people think. I do not…
-
5
votes2
answers590
viewsA: What is the useshellexecute property for?
Its use is rarely interesting, it has more disadvantages than advantages. As it is used as if it were one shell even it has the characteristics of how you were using the cmd.exe windows or other…
-
8
votes2
answers93
viewsA: Method equivalent to Biginteger.and() in C#
If you want the bitwise has the operator. If you want the boolean, he doesn’t have to have it anyway since the operation is independent of being int, BigInteger or something else. using static…
-
16
votes1
answer382
viewsA: Should we use all variables as private?
What you usually read are called good practice. The person says what you should do without saying why, often because the person doesn’t even know why. It is common even to be just repeating what she…