Posts by Maniero • 444,682 points
6,921 posts
-
5
votes1
answer488
viewsA: Xamarin.Forms Portable or Xamarin.Forms Shared
Portable is applied in a limited version (subset) of framework that can run on all platforms. Any code has to be written considering these limitations and if you need to do some specialization, this…
-
5
votes1
answer105
viewsA: Vector reading in C is wrong
At some points it already does better than some beginners. But it still has some basic mistakes. There are a lot of small and big mistakes in what you are doing. I will just solve the most serious…
-
8
votes2
answers2414
viewsA: What is the purpose of the "id" and "name" properties of an HTML tag?
The name serves to name each content when submitting the form. One might wonder if I could take advantage of the id for this. It cannot because the purpose of the id is to provide a unique…
-
2
votes1
answer118
views -
12
votes1
answer755
views -
7
votes4
answers16290
viewsA: How to remove spaces from a string in C?
It would be easier to play in a string auxiliary, but if you are to do this, you need to separately control the reading progress of each character and the character that must be "copied". So every…
-
18
votes2
answers7772
viewsA: What characterizes imperative and functional programming?
The imperative paradigm is the one that expresses the code by commands to the computer. Another striking feature is the state mutation (changing the values of objects). It works like a cake recipe.…
-
2
votes3
answers139
viewsA: Best way to write a Javascript function
Clearly the first one is better written because it has better variable names. The code should be self-documenting. So you can say that the first is better. The style of access to members of Node as…
-
3
votes2
answers142
viewsA: How to add the WTFPL license to my project?
Of course if this is really very important you should look for a lawyer. If I can give you advice, I would use a license that is more (re)known and probably more "serious". I don’t see an advantage…
-
4
votes1
answer2344
views -
27
votes1
answer5420
viewsA: What is the programming paradigm used by Javascript?
Today any language mainstream (which everyone knows and uses, which has popularity) uses various paradigms. The main of them all (only among the mainstream) is the imperative, JS is no different,…
-
9
votes1
answer325
viewsA: In C++ where are the functions of the objects in memory?
Functions are usually in an area called static. The space occupied by the binary code of the functions is there regardless of whether there is an instance or not, because the instantiation has…
-
2
votes1
answer332
views -
4
votes2
answers276
views -
12
votes5
answers13398
views -
3
votes1
answer936
viewsA: Dynamic allocation with struct
In fact the allocation of structit doesn’t do so. One should take the size of it, I don’t know why it is getting the size of a int if you want to allocate the structure. And multiplication only…
-
5
votes3
answers410
viewsA: Call a method automatically via a partial class on . NET
Specifically answering the question asked, as far as I know, with the Add() is not possible. I know that can touch the SaveChanges(), but then it’s too late. The ideal would be to actually have a…
-
8
votes1
answer7212
viewsA: Pass Array as a function parameter
Just pass the array (pointer) and the number of elements for the function: #include<stdio.h> #include<stdlib.h> void func(int *ptr, int x) { for (int i = 0; i < x; i++) {…
-
4
votes3
answers113
viewsA: How to implement custom features in a model on . NET?
This has been more or less answered in How to edit a Partial Class? Partial classes exist precisely for this type of problem. You create the customizations in a separate file that will be compiled…
-
2
votes1
answer6279
viewsA: Convert String to Double while maintaining content
I couldn’t reproduce the problem. It worked for me. Of course, it appeared in scientific notation. If your wish is to present in floating point notation, then you need to use the function that…
-
4
votes1
answer41528
viewsA: Calculation of percentage in C
The first mistake is that you are applying the discount before giving the bonus, which is the opposite of what the statement determines. Second you’re calculating the wrong percentage anyway. You’re…
-
1
votes2
answers282
viewsA: How do I use the Chr() function in C++ Builder?
C++ is different from Delphi in this respect. The type char in C++ is both a numeric and text type. You can both store in a variable char the textual representation of the character (with single…
-
7
votes2
answers2441
viewsA: Convert date and time to numeric value in Javascript
That’s probably timestamp which is the number of seconds since a specific date (1970-01-01 00:00:00 UTC), so it cannot represent any date. If that’s what you want there just use the function…
-
4
votes2
answers142
views -
4
votes3
answers3650
viewsA: Scanf function with variable amount of parameters, how to implement?
One of the ways is to use normal reading adapting to needs, something like that: char arquivo[] = "1 2 3 4 5"; int a, b, c, d, e; sscanf (arquivo, "%d %d %d %d %d", &a, &b, &c, &d,…
-
9
votes1
answer209
viewsA: Strange property initialization
Object initializer That’s a Object initializer. It is a way to start members of an object independent of having a constructor. It works analogously to the constructor, but it can initialize any…
-
3
votes1
answer156
viewsA: Can index in an ENUM field bring any advantage?
I can’t say in Mysql specifically (nor do I think it matters, I hope it doesn’t :P). There is probably no advantage if it is an index with a single column and/or enumeration so simple, but I do not…
-
7
votes1
answer1772
views -
8
votes1
answer574
views -
2
votes2
answers109
views -
1
votes1
answer758
viewsA: Insert date and currency data of a maskedTextBox into Mysql
There is not much information so I won’t give a definitive answer. The problem is that probably the columns are of the type datetime and decimal (at least it should be something like that) and is…
-
8
votes1
answer1284
viewsA: Cin vs scanf, which is faster?
As performance may vary according to implementation, those who will do competitive programming will certainly test this on the implementation used to make sure which is best. If the person does not…
-
5
votes1
answer709
viewsA: Why is strcpy() insecure?
First it is important to say that it is possible to use this function safely. Her problem is that the programmer may forget or not know how to do this. The first problem of the function is that it…
-
10
votes2
answers6643
viewsA: Why is my function concatenating instead of summing the numbers?
This is because the function return prompt() is always a string. Then the addition will concatenate both. If you want to sum the numbers you need to convert the variable to a numeric type, this is…
-
1
votes3
answers1008
viewsA: Print variables in Ruby
It worked for me: x = 1 y = 2 print x, y print x print y Behold working in the ideone. And in the repl it.. Also put on the Github for future reference.…
-
4
votes1
answer442
viewsA: Copying string stored in pointer
If you want to use the memcpy() same has to copy to another place, can not do on top of the same string: char *str = " teste"; int j = 0; while (str[j] == ' ') j++; int size = strlen(str) - j + 1;…
-
3
votes2
answers1731
viewsA: Conceptual model
There are various notations of diagrams, each with its own characteristic. None is wrong, but each may be more suitable than the other. It depends on the intention to demonstrate. Particularly I…
-
9
votes2
answers653
views -
7
votes1
answer368
viewsA: Overflow by multiplying two integers in Biginteger
It’s simple, the code is multiplying two integers and passing to a method that will create one BigInteger. When the multiplication of two integers occurs, there is the overflow and gives the…
-
14
votes4
answers1048
viewsA: Should every algorithm be finite?
This is an algorithm, of course. And the algorithm doesn’t necessarily have to be finite. It’s desirable, but not mandatory. When this occurs it is called a computational method, as stated in the…
-
10
votes3
answers19310
viewsA: Alternatives for developing in C# on Linux?
Beyond the Monodevelop that already uses, can use several other editors (Vim, Emacs, Sublime, etc.), some have some facilities for C#. Few. Others have something more. The Visual Studio Code looks…
-
9
votes1
answer120
viewsA: Differences between readonly Func<> and method
Basically the first is an anonymous method defined by a delegate (user guide). In the case the delegate is predefined with the signature used. Then your "content" can be "stored" in a variable, as…
-
5
votes2
answers195
viewsA: Inserting single quotes into null fields
The problem is that the data in the application is as string empty and not null, so save a string empty. If you want to save a null to the database you need to ensure that the data is null. If the…
-
3
votes1
answer2796
viewsA: Global variable used in multiple functions
From what I understand only needed to call the functions: donos = [] def calcula_media(): lista_dicionario = [1,2,3] donos.extend(lista_dicionario) def funcao2(): print(donos) calcula_media()…
-
11
votes3
answers4507
viewsA: What is the point of "interrogation" in the type statement in C#?
In this specific case it is a syntactic sugar to indicate a cancellable type. This means that your DateTime which would not normally accept a null value, may accept. This is especially useful for…
-
3
votes4
answers135
viewsA: How does object copying work?
JS works objects as reference. That is, the object variable is only the memory address from which the data is. The object type (which at the bottom is a array) is the only type considered a type by…
-
8
votes2
answers815
viewsA: How does the logic of Where in the Entity Framework work?
I think the first question is making a correct statement :P The negation of the result of Contains() is one way to solve this. There may be more interesting ways depending on what you want, but for…
-
25
votes2
answers22927
viewsA: What is the meaning of the "&" (commercial) operator in the C language?
In this context is the "address" operator. Then the result of it will always be the memory address of the object in question (in general the location where a variable is allocated in memory). That…
-
4
votes2
answers56
viewsA: Field of type time or decimal, how to solve?
I think you are thinking of the right solution. I will list the options. Imagining that you would need calculations, the best solution is not to do this. The correct one would be a way to normalize…
-
4
votes1
answer580
views