Posts by Maniero • 444,682 points
6,921 posts
-
9
votes1
answer568
viewsA: How does inheritance work in Postgresql?
It doesn’t work. In practice it is implemented in half and is very rare to be useful for something, although the functional part is not especially problematic. In general, it is not "good practice"…
-
6
votes1
answer326
viewsA: How to create a monolithic application executable. NET?
Same monolithic executable with only the .NET Native. Either Mono or now with . NET 5 using Runtime mono. With . NET Core it’s easy to generate a single executable, but you’ll still need the Runtime…
-
13
votes1
answer326
viewsA: What is the difference between >>= and >>>= in Java?
There’s nothing oop about that. These are bit operators, in which case are the compound assignment operators, then it will take this variable apply the operator and the result will be saved in the…
-
4
votes2
answers766
viewsA: What is the difference between the versions of Xamarin?
Obviously Xamarin.iOS and Xamarin.Android are implementations of Xamarin for these specific platforms and access 100% of the platform’s API (at least it always tries to be around this). Obviously…
-
1
votes2
answers82
viewsA: Process of connection to libraries (DLL’s) during the C++ source compilation process
The process has nothing to do with #include, even less with the namespace. This has to do with linkage of the code. When going to use some DLL the executable is generated in a form that is indicated…
-
7
votes3
answers2111
viewsA: Comparing C string contents to find palindrome
This code is too complex, simplifying it is much easier to understand. Just compare the first with the last, the second with the penultimate character and so on. It only needs to go half as long as…
-
3
votes1
answer1187
viewsA: What is marshalling and how does it work?
Marshalling is similar to serialization, is a technique of transforming a binary object suitable for memory into an object in a format suitable for transport between processes, possibly in different…
-
6
votes1
answer1393
viewsA: Difference between if and elsif
else if, elseif, elsif, elif, and other forms are just different ways of writing the same thing, probably each one is in accordance with the philosophy of syntax. There is no difference in their…
-
4
votes1
answer240
viewsQ: Why are there so many parentheses in macro?
Seeing this, it intrigues because it needs those parentheses that seem unnecessary. What is their functionality? #define SUB(x, y) ((x) * (y))
-
5
votes1
answer240
viewsA: Why are there so many parentheses in macro?
Because macro is only a substitution of texts, it is not a construction of the language that considers the semantics of the code, without the parentheses the argument can be confused with the…
-
5
votes1
answer248
viewsA: What is managed code?
Windows is essentially built with C and most of the newer Apis are in C++, with some compatibility with C. There’s nothing important about Windows that uses . NET, it can be completely uninstalled.…
-
1
votes1
answer1230
viewsA: Which library to use to pause the system instead of getch?
You can use the getchar() or the system("Pause"). Depending on the platform you can use some own option.…
-
8
votes2
answers180
viewsA: Change of object in inheritance
It depends a lot on the requirements. I wouldn’t do that with inheritance. It seems to me that the function (role) of the person is a transitional situation, then I would make a composition. When…
-
4
votes1
answer178
viewsA: What is an Appdomain?
The Appdomain, or application domain, is more or less like a process within another process. It has a certain isolation from other Appdomains. It is not widely used, but it is useful especially if…
-
3
votes1
answer166
viewsA: When will the object be eligible for the Garbagecollector?
In options 2, 4 and 5. In the others the object is still referenced and cannot be collected there. Possibly it will be collected at the end of the method (if it does not escape it somehow (put in…
-
7
votes3
answers284
viewsA: What should I observe when creating a hash code?
I went to see the blog from Eric Lippert where he has legal information: it must always generate the same code for the same object if two objects have identical characteristics should generate the…
-
8
votes1
answer80
viewsQ: Can you initialize only a few members of a C array already in your definition?
I know you can do this: int a[5] = { 0, 3, 8, 0, 5 }; or int a[5]; a[1] = 3; a[2] = 8; a[4] = 5; Can you do the same in just one line, already in the definition? IE, you can initialize only a few…
-
11
votes1
answer80
viewsA: Can you initialize only a few members of a C array already in your definition?
There’s a syntax for this: int a[5] = { [1] = 3, [2] = 8, [4] = 5 }; I put in the Github for future reference. It can even be in any order. This syntax is the same as making the assignment after the…
-
3
votes1
answer241
viewsA: How to increment an Enum in C?
There is no secret and that is what that code shows. The enumeration is created. Declares a variable of the enumeration type, assigns one of the possible values to the variables, and can already use…
-
3
votes2
answers1230
viewsA: HTML inside a Stringbuilder
You don’t need all this complication and waste processing, it can be as simple as that: public class Program { public static void Main() { var html = @"<!DOCTYPE html> <html lang =…
-
19
votes5
answers8944
viewsA: What is an SDK?
But after all what would be an SDK? Software Development Kits can take the form of toolkits or of frameworks and provide everything you need to program on top of a platform (operating system,…
-
4
votes2
answers4792
viewsA: What is Yenumerable and Yenumerator for?
Could someone explain in a more didactic way what these interfaces are for IEnumerable is an interface that marks the classes that wish to implement it so that it is known that it can be iterated…
-
16
votes3
answers3192
viewsA: What is the difference between Full Text Search and LIKE?
LIKE is usually a simple mechanism to be used in expressions comparing to various texts in the database, so it reads the required data in the expression and applies the LIKE which is a simplified…
-
7
votes1
answer3111
viewsQ: What good is an Inker?
Some languages use a Linker or likeditor as it is also called. What is its function and its relation to the compiler? Why some languages do not have a Linker?…
-
8
votes1
answer3111
viewsA: What good is an Inker?
The Linker is a utility that is usually complementary to compiler. It takes binary code generated by the compiler and merges everything, hence the name, into an executable. The executable can be…
-
6
votes1
answer488
viewsA: Using Concat to concatenate array of strings
Probably what you read was a "good practice" (which I am a critic of). I myself fall into this nonsense when I write because we do not always have time to explain all the details, but if one accepts…
-
8
votes2
answers2912
viewsA: What is the purpose of the Gethashcode() method?
Most of the question has already been answered in What is Hashcode and what is its purpose?. It says it’s mainly for use in tables hash where the most prominent type is the Dictionary. You need a…
-
2
votes1
answer121
viewsA: Iterate an array (vector) via Ienumerator? For what reason?
If you know it’s a array and it’s a simple tie I don’t see any reason to use IEnumerator. If you want to generalize implementation and accept other things than one array as implementation detail,…
-
7
votes2
answers435
viewsA: What characterizes a database?
This is not a simple definition, anyone can give room to understand something other than what it is. And without a clear definition it is not easy to define what it is. A database is a diverse…
-
5
votes3
answers300
viewsA: How should I deal with mistakes?
Avoid exceptions as much as possible. Only use when it makes a lot of sense. Exception is the most poorly used feature of programming nowadays. People don’t know when to launch, let alone when to…
-
2
votes1
answer295
viewsA: Variable type float does not receive valuation
In a good compiler the code does not even compile. If compile is worse because the code is full d errors. I will not even mention the fact of store monetary value with float be a mistake. The code…
-
4
votes1
answer67
viewsA: Should all inherited attributes be used?
This is incorrect, because it certainly violates the the principle of Liskov’s substitution. In fact it seems that did not understand what the inheritance is for. It is not to eliminate repetitions,…
-
5
votes5
answers789
viewsA: List comprehension with conditional
The if cannot be on the same line as for. cont = 0 seq = [] max = 10 for x in seq: if x == max: cont = cont + 1 print(cont) Behold working in the ideone. And in the repl it.. Also put on the Github…
-
4
votes1
answer1133
viewsA: Reference struct inside another in C
When there is cyclic reference you have to declare the structure before using it and then define it later. See What is the difference between declaration and definition?. #include <stdio.h>…
-
5
votes2
answers25163
viewsA: Numbers in Ascending Order C
This code is too complex, it doesn’t need all this and I found the answer accepted even worse because it became a quadratic algorithm (not that it makes much difference in such a simple case), so…
-
3
votes3
answers5094
viewsA: How to download a file from a URL using C#
You can use the DownloadFileTaskAsync() and then check the status of the task if necessary with Task. using var client = new WebClient()); var tarefa await…
-
35
votes5
answers12535
viewsA: Why is Varchar(255) widely used?
The VARCHAR by definition has variable size, you can put the size you want there, at least within the ANSI standard. This 255 is just information of how it should be shown in a selection, it does…
-
7
votes2
answers10403
viewsQ: How to separate a string into pieces?
In other languages there is split, explode or something like that string in pieces according to some separator. There is something ready in C or I have to do in hand?…
-
6
votes2
answers10403
viewsA: How to separate a string into pieces?
You don’t have something so ready, but there is strtok() that analyzes the string and replaces a specified delimiter with a null character and thus what was a single string becomes several, since…
-
3
votes1
answer284
viewsA: In this case use switch or if?
The question does not make the criteria very clear, but probably each percentage is applied according to a range of values. If this is just the if works. switch does not allow working with tracks,…
-
1
votes1
answer154
views -
21
votes4
answers4422
viewsA: What is the difference between & and &&operators?
The & is the bit operator and, then it compares each bit of the verified data and results in 1 whenever the corresponding bit in the two operands is 1, after all the and is only true when both…
-
3
votes1
answer132
views -
2
votes1
answer159
views -
8
votes2
answers157
viewsA: Is capturing Nullpointerexception bad practice?
In general it is yes. This usually occurs by a programming error. If there is an expectation that an information may be null, test before accessing it. This is the only acceptable practice in almost…
-
14
votes2
answers2209
viewsA: What is typing style?
In fact the most appropriate term is the type system adopted by the language. Each classification has at least two forms, and in general one opposes the other, but it is possible to adopt both with…
-
2
votes2
answers1554
viewsA: How to clear the array name so it doesn’t end up with the rest of the previous strings
The code is too complicated and mixes things from C that is not ideal. Use a string same and then everything becomes very simple. See: #include <iostream> #include <string> using…
-
9
votes3
answers956
viewsA: What is Container in POO?
I have not seen the term being used specifically for object orientation, although it can be used because it is something so fundamental that it is certainly applied to OO. Container is something…
-
6
votes1
answer1292
viewsA: Why is a function calling itself?
The last line is an isolated code and has the clinic(), without it nothing would run. Functions are executed only when they are called. The previous one is within the function clinic(), that is, she…
-
7
votes1
answer635
viewsA: Is there a difference between a compiler and an interpreter?
Languages are hardly linked to the use of a compiler, interpreter or Jitter. Implementations yes. Difference between language and compiler. A example of language taken as compiled but has…