Most voted "typing" questions
For data type system related issues.
Learn more…349 questions
Sort by count of
-
6
votes1
answer111
viewsWhat is type reference?
Was reading regarding the key word ref and I came across a warning that said not to confuse reference passage with type reference. No doubt this warning left me confused and awakened more doubts…
-
6
votes5
answers146
viewsIs there a disadvantage or is it harmful to use null types?
I always have trouble receiving null values from the database because I forget to use the cancellable types and face the same problem: The type cannot be null This usually happens with attributes…
-
6
votes1
answer99
viewsWhy do typed accessors run the process faster?
I was reading an article by how to improve the performance of a Reader data using ADO.NET and in this article he cites the use of Typed Accessors to perform this function, from what I understand it…
-
6
votes2
answers108
viewsLine breaking problems and correctly display real value conversion on C#
I made a simple C# code that asks you to enter name, age, weight, city and state, performs normally only that it appears some problems as instead of the weight being 60.5KG gets 605KG and wanted to…
-
6
votes1
answer133
viewsWhy do we use "<>" in Typescript?
Why do we use <> in Typescript? Example: funcaoExemplo(x: X<any>, x: X): Observable<X<any>>
-
6
votes1
answer404
viewsHow does type "Unknown" work in Typescript?
The guy unknown is a Feature a little more recent language, and is said as a any, only that type safe. So I was left with some doubts: What is your difference from any? It is safe to use it for type…
-
6
votes1
answer165
viewsHow does the "+" operator work in Javascript?
Recently I had seen on the website of MDN Web Docs that it was possible to convert a String in a Number even in the example below: let n1 = "10"; console.log(typeof n1); //=> string ("10") The…
javascript characteristic-language typing operators type-conversionasked 4 years, 9 months ago felipe 61 -
6
votes2
answers1334
viewsSQL decimal field size
I am making a form, and in the database documentation there are some numerical fields that are divided into 2 parameters. Ex: Field: Cost Type: NUMERIC Tam.: (12,4) What does this size divide and…
-
6
votes2
answers398
viewsWhat are the differences between a type and interface alias in Typescript?
Typescript allows us to create aliases for types. For example: type State = 'inactive' | 'active' | 'banned'; The type allows to also create types for objects, such as: type User = { username:…
-
6
votes1
answer57
viewsWhy can a double var store an int type?
Why a var of the kind double can store a var of the kind int? Using C# int x; double y; x = 5; y = 2*x; Console.WriteLine(x); Console.WriteLine(y); Console.ReadLine();…
-
6
votes1
answer132
viewsWhat are algebraic data types (algebraic data types or Adts)?
Eventually I read in some articles related to functional programming the term algebraic data types, but I don’t really know what they are and I end up getting a little lost. What are algebraic data…
terminology typing functional-programming type-theory algebraic-typesasked 3 years, 11 months ago Luiz Felipe 32,886 -
5
votes1
answer147
viewsPersisting all data as string is a problem?
Is there any problem in storing all the information of an application like string in the database? Independent of the application, SGDB, the programming language used, etc. I ask more for data…
-
5
votes2
answers179
viewsObject type for Time type data (Ex: 1 min 56 seconds) in Android/Java?
I need to work with times, such as a chronometer (not my case), which at the end of its execution would have to keep its value. So I thought of some possibilities like: java.utils.Date: only that…
-
5
votes1
answer543
viewsParameter of any type in method
I am building a method and would like it to extend into any type. For now I am using string but I would like the same to work for int, float, double and datetime. public static bool isNotNull(string…
-
5
votes2
answers6790
viewsCan an int equal null?
After seeing a question related to this, and many college colleagues with doubts linked to it, I decided to ask this question. The guy int may equal to null?…
-
5
votes1
answer2036
viewsWhat type should I use to save only the time (no date) in a database?
I am in doubt which type I should use to work with hours on my system. I should use DateTime, Time or TimeStamp. I would like the hours to be saved in this format: HH:MM…
-
5
votes1
answer3246
viewsHow to define predefined types in Mysql?
In the site I’m developing I will, for example, a registration form where the user should define their gender in a combobox (male or female). The table users in the database will have all user…
-
5
votes5
answers156
viewsType induction for any type of object
I am wanting to make a method of a certain class accept an object as a parameter. However, this object could be of any type. Example: class classeExemplo { public function meuMetodo(Object $objeto)…
-
5
votes1
answer116
viewsIn a repetitive structure are there differences between working with Object or Array?
When I do a query in the database by PHP and want to return this data with while, usually use the fetch_object(), which returns the data in type object. For example: $query = "SELECT * FROM TABELA";…
-
5
votes1
answer624
viewsWhat kind of data do you use to store Uris in the database?
What kind of data to use to store Uris in the database, taking into account an indeterminate or very large URI length?
-
5
votes2
answers15372
viewsConversion of an nvarchar data type into a datetime data type resulted in a value outside the range
Code line INSERT [dbo].[Shop_Goods] ([TemplateID], [Name], [Remark], [CategoryID], [Description], [Attack], [Defence], [Agility], [Luck], [Level], [Quality], [Pic], [MaxCount], [NeedSex],…
-
5
votes2
answers498
viewsHow to assemble a list of generic objects in C?
In many higher-level languages it is possible to have a structure or a collection of data of various types, often the type is used Object for this. How to do the same in C? I mean, I don’t know the…
-
5
votes2
answers2603
views -
5
votes1
answer199
viewsConvert uint16_t to int
I’m doing a project where a distance detector stores the distance in a variable uint16_t, and I need to turn it into int to make comparisons, but I can find nowhere how to do it. How to do?…
-
5
votes2
answers279
viewsConverting string to long int
I have an activity to do in which the teacher asks that the names of the numbers in the integers be converted (long int). I wonder if in Java there is any function that does this... I searched in…
-
5
votes2
answers858
viewsComparison of variables of different type with conversion returns incorrect result
I have the following code var Valor1: string; Valor2: Double; begin Valor1 := '150.15'; Valor2 := 150.15; If StrToFloat(Valor1) = Valor2 then ShowMessage('Iguais'); end; In this situation, sometimes…
-
5
votes4
answers11349
viewsWhat is the difference between SMALLINT(3) and INT(3)
I have a question about the difference between two types of data in Mysql: That document has this table: The standard construction of these types is SMALLINT(M) and INT(M) where M = numero máximo de…
-
5
votes2
answers97
viewsWhat are the consequences of not working on data typing?
I want to create an application where the client can create a new form or table, in which he can choose the data type of the field, such as number, text, binary, etc. An "easy" solution would be to…
-
5
votes1
answer728
viewsWhat is and what is the explanation for type-safe in C#?
Not being able to understand the concept of type-safe in C# and what is its use, since C# is type-safe.
-
5
votes3
answers253
viewsCannot implicitly convert "decimal" type to "int" in C#function code
This code averages the arithmetic or weighted average of the 3 student grades based on your choice of average according to the use of the Equals, code error is exactly this conversion of decimal for…
-
5
votes1
answer65
viewsWhy does Std::Ceil produce different results for float and double?
Follows the code: #include <iostream> #include<math.h> using namespace std; int main() { float calculo = 4.347 * 20 * 100; double calculo2 = 4.347 * 20 * 100;…
-
5
votes2
answers154
viewsIs there a rule for "type statements in class properties"?
PHP 7.4 supports type declarations in class properties. In a normal routine I would use: /* @var array */ protected $names; Now in PHP 7.4 I can: protected array $names; But if I declare it this way…
-
5
votes1
answer742
viewsHow does Python manage memory when assigning different types?
I wanted to understand how dynamic typing is done. In Python, for example, when we create a variable with content a number int and then that same variable gets a string, the fact of not giving…
-
5
votes1
answer91
viewsWhat kind of data do you use to store the date of death in a register (Datetime or string)?
I have a record of people where I need to store birth dates (DateBirth) and death (DateDeath). Knowing that the guy DateTime in C# cannot be empty and its default initial value is 01/01/0001…
-
5
votes1
answer67
viewsWhat is the syntax that comes before the variable name in function parameters?
Reading the PHP documentation I came across the following example: function bar(A $a = null, $b) {} // Ainda permitido function bar(?A $a, $b) {} // Recomendado I did a little digging and figured…
-
5
votes3
answers126
viewsWhy does type "any" exist in Typescript?
I’m studying Typescript and I got to the part about the guy any. What I understand is that the any is used when the type of the value that the variable will have. But if that’s the case, the two…
-
4
votes1
answer315
viewsHow to properly step data type by PDO
In the php section below, what is the type of PDO::PARAM should I use ? $cnx = new PostgreSQL(); //Classe de conexão do banco $data = '2015-02-13'; $select = 'SELECT * FROM eventos WHERE "data" =…
-
4
votes1
answer1246
viewsIn Postgresql, which field to use for percentage?
In the table that I am creating, I will have a column that will indicate the discount percentage, for example, "for a given agreement I will have 20% discount, for another agreement I will have 50%…
-
4
votes1
answer339
viewsWhen using each data type of mysqli_stmt_bind_param
According to the documentação: i - corresponding variable has type integer d - corresponding variable has type double s - corresponding variable has type string b - corresponding variable is a blob…
-
4
votes1
answer152
viewsTyping a pointer to struct
I was suggested to build a chained list using the following struct knotted: typedef struct node *link; struct node{ int item; link next; }; As I did not understand what the pointer operator means…
-
4
votes2
answers180
viewsVery large integer does not work
My code is like this: #include <stdio.h> int main() { unsigned long int L, N; scanf("%lu%lu", &L, &N); printf("%lu\n", (L-(N-1))*(L-(N-1)) + (N-1)); return 0; } When the test case has…
-
4
votes2
answers3911
viewsWhat is the difference between data types Enum, struct and Union in C?
I am reading the GNU’s C manual and I’m in the data types section and I notice a certain similarity between the types enum, struct, and union. Is the syntax the same, or is there something that…
-
4
votes1
answer337
viewsHow to declare an integer type variable in C#?
I’m learning C# to migrate a system in VBA to C#. I’m really enjoying the language . NET. How do I declare an integer type variable?
-
4
votes1
answer51
viewsUnsigned modifier for integer type in C
The works say that this modifier causes the variable not to accept negative values, but when I compile this code: #include <stdio.h> void main() { unsigned int idade; idade = -3; /* Não existe…
-
4
votes2
answers1128
viewsWhat does an abstract class type variable mean?
Studying Pattern design I saw something that I didn’t understand very well what it means, when we have a variable of the type of an abstract class what it means exactly? Example: ClasseAbstrata…
-
4
votes1
answer857
viewsVarchar or int for "type" fields
I have a column guy with 6 options to save in the bank, it is better to save the string as varchar or as int and treat it in front? For example, when it is 1 in the bank, display certain string on…
-
4
votes1
answer2845
viewsWhat is the correct way to declare a struct in C?
Also how to rename data types with structures? I have doubt about it because of a Windows Manager that I use has the following code: typedef struct exem exem; struct exem { tiposdedado variavel; };…
-
4
votes2
answers1567
viewsError declaration null - Unknown type name bool
The error you are making is in this function. bool tem_numero_na_lista(tipo_lista * aux, int valor) { while (aux - > prox != NULL) { if (aux - > info == valor) { return true; } aux = aux -…
-
4
votes1
answer61
viewsIs it possible to use the DOUBLE data type on 32-bit systems?
The type of data DOUBLE is a 64-bit floating point, but can be used on 32-bit systems without any problem?
-
4
votes1
answer682
viewsMaking the Insert in SQL Server in a float field?
I have the following problem in my code, I have a textbox that receives the value 0.900, only when I’m recording this value in the bank, it’s only recording 900, and I need you to record the 0.900…