Posts by Maniero • 444,682 points
6,921 posts
-
17
votes3
answers41730
viewsA: Difference between Visual Studio Community, Enterprise and Code
Microsoft’s own website has various information about each other’s differences and no one will get so complete here. I I have already talked about the differences between the different editions of…
-
9
votes1
answer105
viewsA: Is there an alternative to multiple while loops?
All that exists a certain pattern is possible to abstract and make the code generic. Then it is possible to create a method that makes this code in a generic way by "filling in the gaps" that are…
-
4
votes2
answers292
viewsA: How do I compare an input in char with an interval (0 to 9) without specifying individual conditions?
You can do it like this: #include <stdio.h> #include <stdlib.h> #include <ctype.h> int main() { char t[10]; char r[10]; fgets(t, 10, stdin); int c = 0; for (int i = 0; i < 10…
-
4
votes1
answer76
viewsA: What do the following column/row measurements mean?
The asterisk indicates that the size should be proportional. The calculation is based on all values found in all asterisks of that group of elements. In a way, it’s the way you use percentage…
-
5
votes2
answers297
viewsA: What are the differences between Visibility.Hidden and Visibility.Collapsed?
Obviously both prevent the element from being displayed. Visibility.Hidden reserves the space that the element will occupy in the layout, so nothing will be redesigned except in this area.…
-
7
votes1
answer624
viewsA: What kind of data do you use to store Uris in the database?
If you consider that Urls do not usually exceed 2K in size and that the VARCHAR in Mysql supports up to 65535 characters (the line also has this limit, so in practice it has to be a little smaller.…
-
5
votes1
answer112
viewsA: How and when to use "Shadows" and "Overrides"?
In a way it is already answered in How "new" and "virtual" work in C#?. Only it’s C there#. Overrides in VB.NET is the same override of C#. AND Shadows is the same as new as a method modifier.…
-
5
votes1
answer1039
viewsA: Sort list by a string property with number
Can you guarantee that it’s all valid number? You can do this: lstAtas = lstAtas.OrderBy(x => Convert.ToInt32(x.NroAta)).ToList(); Behold working in the ideone. And in the .NET Fiddle. Also put…
-
6
votes1
answer117
viewsA: How to change Java’s final property to C#?
In the context of the question is const, but in fact it is not usually useful and practically never seen being used. " Constants" within a local scope help very little (slightly helps in…
-
8
votes1
answer75
viewsA: When declaring an interface in the class, who should implement it?
The Gerente implement right below. The signature of this class has the interface, so it is this class that will have to implement. If Funcionario has already been implemented, even if a…
-
7
votes2
answers2197
viewsA: Is encrypting the database an efficient measure? How to protect data against leaks?
Yes, it is. If you use a suitable mechanism, usually provided by the databases themselves. Some provide the possibility to encrypt only a few parts, a column, for example. They can also offer…
-
12
votes1
answer478
viewsA: What is the security in using input "password" or "text"?
Zero! It’s just what’s in the question anyway, it hides the password when typing and nothing else. If the computer is infected with something, it will read the password normally. And there is…
-
5
votes2
answers1192
viewsA: Maximum value for srand((unsigned)time(NULL);
You can get as random as possible implemented where you are using with RAND_MAX. Only old or bad (Windows) implementations and platforms are so low. If you need numbers above the generated one has…
-
8
votes1
answer195
viewsA: What are the differences between the following Caps and when to use each one?
i.ToString() results in the textual representation of the object, not necessarily a conversion as many think. It works for anything. Has more in detail on Convert.Tostring() and . Tostring().…
-
29
votes1
answer2636
viewsA: What is the difference between const and readonly?
const is static and is solved at compile time. That is, what will be put in the code that consumes the constant is the value established in it. If by chance it changes its value, it has to compile…
-
6
votes2
answers763
viewsA: Trigger in Mysql VS logic in PHP application?
You can’t tell which is better. It depends on the architecture of every solution, the experience of the team, the goal, you can tell until it’s taste. Can you make sure you put it into the…
-
8
votes3
answers197
viewsA: Account with PHP in the order it is in the string
I have decided to give a supplementary answer on the eval() which is a valid solution. This can be seen in Eval is either good or bad?. To tell the truth any information about the eval() that I…
-
2
votes2
answers2767
viewsA: Determining a string within a C switch
Not possible. Or use other language construction (if strcmp()) or create an auxiliary table to take care of it (a table hash is usually used). Constants may be used instead of strings, better.…
-
10
votes2
answers12195
viewsA: Difference between Std::Cout and Cout?
std::cout is the full name of the object, including its "family name", the surname. A lot of people like to use it like this, eliminating any ambiguity. Others prefer to use only the object name to…
-
1
votes1
answer185
viewsA: Standardize code formatting Visual Studio
Go to: Tools -> Options -> Text Editor -> C# -> Formatting -> Wrapping -> (bookmark): Leave block on single line Leave Statements and Member declaration on the same line This works…
-
8
votes5
answers5699
viewsA: How to get the current iteration index of a foreach?
Actually if you really need the index, the right thing is to use the for. If you don’t want to use the right tool for the problem, the most obvious solution is the one presented in the question.…
-
8
votes2
answers840
views -
3
votes1
answer67
viewsA: Inlinestring vs String - what’s the difference?
I went to find a response in the OS who speaks of this: CellValues.String It is used to store the text of the formula used in the cell. XML would look: <x:c r="C6" s="1" vm="15" t="str">…
-
31
votes3
answers3113
viewsA: Why is it mandatory to implement "public Static void main (String [] args)"?
It’s mandatory because every app needs a point of entry. Normally the operating system needs to know where the code starts, in Java it is actually its operating environment, it is the JRE that will…
-
26
votes2
answers1892
viewsA: What is the difference, in practice, between "" and String.Empty?
Zero practical difference. string.Empty is equivalent to "". In the past there have even been, then some people recommended to use the "constant" and not the literal, but today each one uses what it…
-
4
votes1
answer343
viewsA: Sqlite being accessed remotely
Yes, it is possible, but not recommended. Any direct access to the file is problematic, the operating system has difficulty dealing with direct competing remote access. Moreover it is not so simple…
-
5
votes2
answers569
viewsA: DOCTYPE declaration of HTML
According to the specification needs to be complete. Browsers usually accept without because they try to give compatibility to poorly written code, but it’s wrong. And it may not produce the…
-
3
votes1
answer296
viewsA: Variable as Java Method Argument
Yes and no. Let’s conceptualize well. To variable cannot be passed, it is a local concept that indicates storage of something. The instance can yes. In types by value the variable contains the…
-
5
votes2
answers601
viewsA: How to take the path of the open executable in C
If you want the path and not just the name, it does not have a universal standard form. You will have to consult the operating system and each has its own way. Since you have not been informed, I…
-
1
votes1
answer53
viewsA: Java Socket Specification and Implementation
Depends on what you did in your class. I would say probably not, I believe that what has been implemented in the mother class is enough, I don’t think you need to do anything else. But if you need…
-
6
votes4
answers188
viewsA: SQL Embedded in C#
The solution is usually to use Sqlite. It is a built-in database and usually meets most application needs, especially if there is no direct access coming from different machines. Note that indirect…
-
4
votes2
answers4659
viewsA: Comparing only the Datetime field date in C#
Marco Giovanni’s reply is correct, I decided to answer to put the idiomatic form: var aux = new DateTime(2016, 09, 02, 10, 0, 0); if (aux.Date == DateTime.Now.Date) { Console.WriteLine("Ok"); }…
-
2
votes2
answers184
viewsA: Doubt about having control TFS version
According to microsoft document, Epic is a general item that is above Features. It’s a general definition of a problem, it’s something that transcends a release or project interaction. It is a…
terminology visual-studio-2015 versioning team-foundation-server project-managementanswered Maniero 444,682 -
10
votes5
answers8188
viewsA: Best factor calculation algorithm
The most common is to separate the calculation from the presentation, but in something so simple you can understand. According to what was put in the question I would do so (actually I would…
-
18
votes3
answers15156
viewsA: List all triggers in SQL Server
SELECT * FROM sys.triggers I put in the Github for future reference. Documentation.…
-
29
votes6
answers7015
viewsA: How to get unique values in a Javascript array?
The solution that can be adopted now in JS (unless you need to work with older versions) is much simpler and better: var array = ['a', 'b', 'b', 'c', 'c']; var unique = [...new Set(array)];…
-
3
votes1
answer290
viewsA: Porting Java code to C++ or Python
I don’t think it’s a good way to get what you want. Math and logic is learned outside of programming languages. Java is roughly considered an evolution of C++ (I can assure you that no experienced…
-
3
votes2
answers435
views -
8
votes2
answers1642
viewsA: How do you convert an Enum guy into a list?
In accordance with response in the OS, can do this: using System; using System.Linq; using static System.Console; using System.Collections.Generic; public class Program { public static void Main() {…
-
19
votes1
answer739
viewsQ: What is the difference between "Generics" (Java/C#) and "template" (C++)
In the question What are the differences between Generic Types in C# and Java? the difference between the Generics between Java and C#. We know that C++ does not have Generics, but uses templates…
-
18
votes1
answer739
viewsA: What is the difference between "Generics" (Java/C#) and "template" (C++)
I will not go into detail about the paradigm already answered in What is generic programming?. For a more detailed comparison only of generics can already be seen in the aforementioned question.…
-
2
votes1
answer602
viewsA: Exchange accented characters for accented characters
You can use the COLLATE to accomplish this, I do not know if it is what you want or if it will work, the question is too generic: UPDATE foo SET bar = (SELECT bar COLLATE…
-
2
votes1
answer34
viewsA: Like a program’s icons don’t need to be in a resource folder or something?
A standard executable may have resources inside it in addition to the binary execution code. As you may already know this is called Resources (name on Windows, but can do on Linux also, and in Macos…
-
6
votes3
answers148
views -
7
votes1
answer1949
viewsA: What is the difference between Debug and Release?
It is not a matter of being more advantageous, as the name itself says one is for the purpose of debugging and the other is for release purposes (put into production). The way of debug has much more…
-
6
votes2
answers379
viewsA: Handle 404 error without using Try/catch
There is no way to solve this without capturing the exception since this was the mechanism adopted by the API. In theory it is possible to use another API (Httpclient, for example, which by the way…
-
3
votes2
answers1524
viewsA: Condition on Join or Where?
Yes there is a difference, as you can see. At least it exists in current Mysql. Of course not seeing the whole expression (has a reticence there) it may be that there was a reason to be different.…
-
6
votes4
answers13213
views -
8
votes2
answers249
viewsA: Do While enters infinite loop
It’s infinite because that expression will always be true: while((operacao != '*') || (operacao != '/') || (operacao != '-') || (operacao != '+')); Let’s take the first comparison: operacao != '*'…
-
1
votes2
answers475
viewsA: Is it possible to run ASP.NET MVC without IIS?
Yes, it is possible It may not be what you want, but it’s possible. You need the .NET Core where you have the new ASP.NET MVC that doesn’t need an external server. And now it has become the…