Posts by Maniero • 444,682 points
6,921 posts
-
3
votes2
answers229
views -
4
votes1
answer187
viewsA: What’s worse a "Where" or "Join"? Which is more expensive?
Deep down a join will work through searches the way the where is done. Like this where will be mounted depends on the SQL parser of the database in question. The analyzer can be better or worse…
-
2
votes2
answers2263
viewsA: Modeling for comprehensive entity registration
Various forms are possible according to the need that is not clear. It could be something like this: public class Cliente { private String CNPJ; private String CPF; private String Comprador; //só…
-
8
votes3
answers1682
viewsA: Is it common to have multiple different servers for the same web application?
I’m answering based on what you were asked. You’re talking about having servers in different hosts. The other answers say things that make sense in a hosting with different servers. They are correct…
-
6
votes1
answer508
viewsA: Update console without using system("cls") on Windows
The solution is to create a function that manipulates the console to clean up using the Windows API. This is demonstrated in the documentation. #include <windows.h> void cls() { HANDLE…
-
2
votes1
answer179
viewsA: How do I restart a program based on user input?
I imagine you’re using an introductory language that no one uses, just to learn, right? Wouldn’t it be interesting to learn to do the code in an organized way? Or do you want to do it anyway?…
small-basicanswered Maniero 444,682 -
4
votes2
answers5403
viewsA: Cut the last character of a string C#
Do this: foreach (DataRow row in dt.Rows) { foreach (DataColumn column in dt.Columns) { txt += row[column.ColumnName].ToString() + ";"; } txt = txt.TrimEnd(";") + "\r\n"; } Documentation of…
-
25
votes1
answer5828
viewsA: Difference between Task and Thread
Thread is something closer to concrete. Every implementation on . NET basically follows what the operating system offers. You use it when you need to deal specifically with thread. Note that it is…
-
4
votes1
answer264
viewsA: Performance difference between static and shared library
On load the dynamic library will have to assemble a table where the symbols are available that the code will access. The difference is very small and will not make any important difference. There…
-
1
votes1
answer40
viewsA: How to list static properties (Shared Property) equal to System.Drawing.Color
Accessing members of a class or structure (which gives the same effect with members of a public body) is quite different from accessing static (shared) members of a type. Static members can only be…
-
2
votes2
answers2098
viewsA: Display decimals (Currency) is rounding
The solution is very simple: Model.ValorExibicao / 100M This ensures that the division will be done in decimal, since the suffix M indicates a decimal literal. Then you want to apply a ToString(),…
-
2
votes1
answer1203
viewsA: Error opening application with process.start
Apparently the executable only works if it is called in the folder where it is, which is a failure, but to resolve this you should call it in the folder instead of the absolute path. For this you…
-
7
votes3
answers253
viewsA: Is there a "in" comparator operator in Javascript?
No. You need to use a trick, create a function, or use a library. Example: if ([1, 2, 5].indexOf(tipoDemissao) > -1) valorDemissao = 525.20; If I may use jQuery has: if ($.inArray(tipoDemissao,…
-
1
votes2
answers896
viewsA: Software to create documentation without using source code
There’s something in Eclipse (I don’t know if it’s the IDE you use) that allows you to assemble classes with your members through a basic form and it generates the code. This can simplify the code a…
-
11
votes1
answer405
viewsA: What’s the difference between cloud computing and web computing?
I’m not going into it, not least because the terms are used very, I would say, randomly. Has a question here explaining what cloud computing is and brush on the web. Web Web computing is one that…
-
4
votes3
answers16110
viewsA: What is the difference between web server and application server?
A web server is a application server to meet needs web. For example, contrary to what many people think, Microsoft’s IIS is a application server, and one of its functions is to serve web. An…
-
2
votes1
answer116
viewsA: Use of threads in C# without storing in variable
The question does not give much context, I will try to guess some things. Each time this code is called will create a new instance, ie a new object, carrying a new thread. They don’t get confused.…
-
9
votes2
answers10981
viewsA: Concatenate char variable text in printf
There are 3 problems in the code: the format for string in the scanf() is %s (better use a limiter of the amount of characters you can enter) like the array is already a reference for an object just…
-
3
votes1
answer656
viewsA: What is the complexity of each of these functions?
When it has a loop walking through the elements of a data structure it is already a great clue that it is linear - O(n). Can be linear modified, for example could be O(n / 2) if you just want to…
-
45
votes1
answer5885
views -
5
votes2
answers161
viewsA: Protecting data in memory
The only help we can give is not to keep the password anywhere. There is no miracle. If you need this protection all do not store any password, let the user enter the password of what needs access.…
-
10
votes1
answer2664
viewsA: What are the characteristics of structured programming?
C is a language that allows and even facilitates the structured programming, which in theory can be applied in any high-level programming language. In fact today there is practically no more…
-
14
votes1
answer7950
viewsA: What is the difference between functions and procedures?
Muddle Many experienced programmers may have difficulty understanding the difference between one and the other. They confuse so much that some people think that functional paradigm languages are the…
-
7
votes2
answers268
views -
8
votes3
answers161
viewsA: Are objects similar to arrays?
I’ve answered almost every question here. There is a question dealing with the general issue (I suggest reading to get all the details). In short, the JS objects are actually arrays (membership). So…
-
6
votes3
answers1905
viewsA: What are the layers of a web application?
You said yourself that you model GUI this way. It’s your form, not everyone’s, not the most suitable for all applications. There are those who prefer to have fewer layers, there are those who prefer…
-
2
votes1
answer201
viewsA: How to measure the amount of disk space required for an ALTER TABLE operation?
It is difficult to give a definitive answer on this and trial and error turns out to be an effective method to figure out how far to go. It’s actually kind of weird to need so much space because the…
-
3
votes3
answers1140
viewsA: Methods with the same name but with a number of different parameters
These are actually different parameters, this is called overloading (overload). In Javascript this is not possible because it has not mentioned the resource, it has to put something in the name to…
-
2
votes2
answers998
viewsA: Search week number of the year through a date in C#
Just do this: DateTime.Parse(dataEntrada).AddDays(28).ToString() Behold working in the ideone. And in the .NET Fiddle. Also put on the Github for future reference. I am assuming that the date will…
-
4
votes2
answers6895
viewsA: How to define "charset" of a table in SQL Server?
First, UTF-8 is a encoding and not a charset. The charset to be chosen depends somewhat on the chosen encoding. The same goes for the text conversion and search rules. Not possible, SQL Server does…
-
17
votes2
answers13280
viewsA: What are the differences between the available versions of Visual Studio 2015?
Professional The Visual Studio Community in itself has nothing unless the Professional. There may be some benefits beyond the IDE that Microsoft only gives in the paid version. Among them stand out…
-
3
votes1
answer286
viewsA: One method stopping the loop of another method
From the little bit of code that was placed, you can’t tell if you have an engineering error of the whole class. I will consider that there is something that changes the state of the variable on for…
-
14
votes2
answers1019
viewsA: Convert.Tostring() and . Tostring()
The first is used when you want to explicitly convert an object to a string. The second is to take the textual representation of an object. It is an important semantic difference that must be…
-
2
votes3
answers940
viewsA: Compare the same variable in PHP
I think this is what you want: if ($email !='[email protected]' && $email !='[email protected]') { This says that both must be different. or if (!($email == '[email protected]' || $email ==…
-
4
votes1
answer80
viewsA: How long is the data allocated to functions?
First nothing is running within these functions. There is no memory allocation, therefore there is nothing to be released. If the example had some variable being allocated, at the end of the…
-
3
votes1
answer2378
viewsA: What are the differences in performance when using querys with EF vs ADO
There is a old comparison shown the performance of some Orms with raw access. The Entity Framework improved greatly from there to here, especially EF Core, but there is still a overhead natural in…
-
2
votes1
answer129
views -
7
votes2
answers736
viewsA: What is the advantage of using Junit to test methods in a class?
Junit is a framework to produce tests. It knows better than programmers how to do this correctly, it is all ready for its use. Of course the programmer needs to know how to use. The advantage of…
-
6
votes2
answers168
viewsA: What makes an object eligible to be allocated in the stack?
First understand the reasons for not being able to allocate an object to stack. Take advantage and try to understand the functioning of stack and of heap, if you still have doubts. So the normal of…
-
2
votes1
answer653
viewsA: Method within method or class within class
I will answer what it gives. The question is confusing and full of errors (nor will I comment on the use of .NET 2.0 that has not been supported for a long time). It may be that the answer is not…
-
5
votes2
answers9189
viewsA: Return today’s date in C# in specific format
There is already a response that meets the request, but there is a pattern that may be more appropriate depending on what is being done. Of course the specific need may be to use a format defined by…
-
3
votes2
answers303
viewsA: Property of a method in another method
Some considerations OOP alone does not solve any problem. Many cases where one keeps trying to use OOP would be better without this paradigm. Knowing what you’re doing, thinking about the problem,…
-
3
votes1
answer234
viewsA: Why does this seemingly simple implementation of "strupr" not work?
There are 2 problems: adding the pointer there will generate an undefined behavior and is not returning anything, have to change the function signature or return something. That’s how it works:…
-
3
votes2
answers76
viewsA: Determining when it will be executed
The function that does this is setTimeout(). var horaInicio = new Date("Fri Apr 01 2016 23:55:00") - new Date(); setTimeout(function(){ alert("teste" )}, horaInicio); I put in the Github for future…
-
26
votes2
answers2284
viewsA: TODO - What is, what is its utility and how to use it?
You saw it in code, it could be called code tags. It is strictly a comment like any other. It may have a specific meaning for some tool. It is common for Ides or at least extensions of them to have…
-
13
votes2
answers381
viewsA: Java 8 "default method" versus C# "extend method"
The C# extension method alone is not equivalent to the standard Java method. Only when adding the interface can the mechanism be comparable. It is already immediately clear that in Java the syntax…
-
4
votes2
answers84
viewsA: Why does the new instance of Actionlistener receive a parenthesis and a ;(semicolon) at the end?
When we keep the code organized, with correct indentation becomes easier to understand: ActionListener trataEventos = new ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e)…
-
6
votes2
answers61
viewsA: Script giving syntax error after ;
There is an improper semicolon inside the initialization of the object. Just change it by comma and the problem is solved: <script> $(document).ready(function() {…
-
4
votes1
answer120
viewsA: How to perform an operation without showing the result in C?
Would this be: #include <stdio.h> int main() { int x, y; printf("Entre com 2 números: "); scanf("%i %i", &x, &y); int z = x + y; printf("\n%i", z); } Behold working in the ideone. And…
-
90
votes2
answers4577
viewsQ: DRY is to avoid redundancies, right?
The DRY means Don’t Repeat Yourself. So every time I see a repeat in the code I’m not doing DRY? Is DRY about not having redundancies? How it should be applied?…