Most voted "typing" questions
For data type system related issues.
Learn more…349 questions
Sort by count of
-
2
votes2
answers176
viewsWhat is the Box<T> declaration for?
I was taking a look at documentation of the Hack. I know that this language is a modification of PHP to introduce type checking. I saw that they put this example to demonstrate the use of classes, I…
-
2
votes1
answer88
viewsHow to decide the type of a function?
In many C written codes on which I see on the internet I only see type functions void and int Is it possible to declare functions of other types? For example struct and float. I did a simple test…
-
2
votes2
answers743
viewsReceive by parameter a List of miscellaneous objects
I have the following problem described in the comment: public class Funcionario{ public long Id {get; set;} public string Nome {get; set;} public DateTime DataContrato {get; set;} } public class…
-
2
votes1
answer42
viewsCreating bytes collection in old browsers through Javascript?
I wonder if there’s such a thing as Uint8Array in older browsers (at least IE8), a collection type with elements that occupy only 1 byte of browser memory. An approach would be to use strings,…
-
2
votes2
answers113
viewsXML for Datatable
I’ve been searching on how to pass the data contained in an XML to a DataTable and found the following reply. Doubt: By doing so, the method theDataSet.ReadXml(theReader); is able to identify data…
-
2
votes1
answer132
views -
2
votes1
answer1217
viewsConversion from Farenheit to Centigrade always gives zero
This is the exercise: 1.12.3. Conversion from Farenheit degrees to centigrade is obtained by 5 C = 9(F - 32) Make an algorithm that calculates and writes a table of centigrade as a function of…
-
2
votes3
answers378
views -
2
votes2
answers71
views -
2
votes1
answer734
viewsHow to represent the Real type in C#?
I have an existing table in a bank of a client of mine and there has an attribute with the data type REAL. Like I do at C#? float or decimal? Which is the best way?…
-
2
votes1
answer50
viewsAlgorithm C. Why does the string "Why" return and does not return numerical values?
I wrote an algorithm in C to write on the screen ordered pairs of a function, with input of x integer numbers. int main(int argc, char *argv[]) { int x,i; x = -1; do{ system("cls");…
-
2
votes2
answers377
viewsDecimal places in Javascript
What type of variable can I use to generate as many decimals as possible in Javascript? Ex.: 1.98719751097319284791284710237182479182471209381290481284 If possible, of course =)
-
2
votes2
answers807
viewsPrimitive type int() in Python
I am beginner(1 semester of TADS), the maximum programming I saw was programming logic and now I’ve started to study Python. In the course of Python Video Course he taught that the primitive type…
-
2
votes1
answer31
viewsI need to create a Compound dataset using HDF in C#
My application contains a list of Basicvariables and within each of the BV’s, I have a list of objects of class OPC_UA, which have 3 attributes, a datetime (which I will convert to a timestamp), a…
-
2
votes3
answers750
viewsSpace occupied between different types of integers
By the table of official Mysql documentation, and a question here at Sopt, I had a question. Considering the table: Type Storage(Bytes) MinimumValueSigned MinimumValueUnsigned MaximumValueSigned…
-
2
votes1
answer608
viewsWhat does the class name mean in super(). __init__()?
How the name of the classes inserted within the constructor’s parentheses works __init__( ), in the classes Telefones, TiposTelefone and Agenda? This is only an excerpt of Chapter 10 code from the…
-
2
votes1
answer235
viewsAccuracy of float64
Why Go when performing the calculation: (1 * 0.09) + 0.36 returns a float64 in the following format 0.44999999999999996? I’m trying to make comparisons with tests and the calculation should be 0.45…
-
2
votes2
answers103
viewsUnexpected result
I wish to carry out the division of two integers and have as a result a floating point value. The following code works normally: #include <stdio.h> float divInts(int x, int y) {…
-
2
votes1
answer109
viewsProblems with 2 vectors joining
I have a problem joining two sets of integer numbers into one vector, without repeating numbers that are in Set A and Set B. The following error is shown in row 13: error: Unknown type name ?bool';…
-
2
votes2
answers1014
viewsFind the maximum and minimum number in a list in a string
I have the following file: a = '1 0 10 2 3' I want to print the highest value and the lowest, so I used the max() and min() but it only counts the unit. I did it this way: a='joao 1 0 10 2 3'…
-
2
votes1
answer59
viewsBinary file being misspelled
Creating the binary file: #include <stdio.h> int main(int argc, char const *argv[]) { FILE *BIN; BIN = fopen ("BIN.bin","wb"); if (BIN!=NULL) { for (int i = 1; i <= 100; i++) { fwrite(…
-
2
votes1
answer170
viewsCalculations with String in Java
I need to average some numbers I receive via JSON in the format of Strings, this calculation must return a value so that I can set it within a TextView on Android, but I’m not able to format this…
-
2
votes1
answer86
viewsDoes not accept Enum parameter with non-zero integer
Follows code: class Program { public enum Enum { Casa = 0, Apartamento = 5 } public static string MinhaFuncao(Enum @enum) => "MinhaFuncao"; static void Main(string[] args) { var r =…
-
2
votes2
answers1154
viewsWhat type of variable allocates less memory, integer or string?
Imagining the situation I’m taking from the database a field number, which represents the client’s code. This value tends to be between 1 to 50000. I must for this case save as string or how integer…
-
2
votes1
answer462
views"unsigned int" and "int," what’s the fastest?
In language C, enter unsigned int and int, what is the fastest type? I know (think) that unsigned can store larger numbers why int reserve a bit (space) for the signal and unsigned no. But which the…
-
2
votes3
answers111
views -
2
votes1
answer55
viewsWhen to use "rsize_t" instead of "size_t"?
What’s the difference between rsize_t and size_t, looking in the draft I found in the item K.3.6 General Utilities : rsize_t which is the type size_t; which means they’re the same type, but I…
-
2
votes2
answers113
viewsisinstance() does not produce the expected result after a data entry
I made the following example of factorial using function isinstance(). def factory(n): if not isinstance(n,int) or n<0: print('NAO E NUMERO INTEIRO VALIDO:\n') return None if n==0: return 1 else:…
-
2
votes1
answer70
viewsWhat kind of data to accept any size?
What kind of data can I use to store text "dynamically" in SQL Server? I know that CHAR and VARCHAR are character data types, the difference is that CHAR is a type of data fixed length and VARCHAR…
-
2
votes1
answer77
viewsWere the Wrapper classes depreciated in Java?
I’m following a sequence of old video lessons, in the video, Java 7 is used and the following code compiles: Long var3 = new Long("100"); I tried to compile and received the following message: Note:…
-
2
votes2
answers257
viewsRange of variables in C
I could never understand the question of the range of variables, I know that each one occupies a certain space in memory, but what does the interval mean? When I say a variable char assumes values…
-
2
votes1
answer39
viewsOptimizing columns of Mysql tables that receive only two different values
I have a Mysql table with 30 columns, and 25 can receive only one of the following values: Not or Yes. Currently they are defined as char(3). In case I convert these char columns to tinyint,…
-
2
votes1
answer64
viewsHow to declare a boolean Operator()?
I understand what it does and its usefulness, however, during the researches I did found contradictory information regarding the syntax of a boolean operator. I found 2 syntaxes: bool operator()…
-
2
votes1
answer193
viewsWhat’s the difference between Dynamic and Object
What’s the difference between using Dynamic and Object on Dart? For example, functions that do not know the type of return: Future<dynamic> getQuery ou Future<Object> getQuery To make…
-
2
votes1
answer102
viewsShould I specify the type of return of a procedure in Python?
For some time I have studied and learned a little more about Python. I recently read an article about the description of python typing using the module typying. Since I learned about this feature I…
-
2
votes1
answer178
viewsIf in C# "Enum"s only accept whole types, why accept a "char"?
When we’re learning about enums in C# is said to accept only integer numeric types. Therefore, we soon think of sbyte, byte, short, ushort, int, uint, long or ulong. But the code below also works,…
-
2
votes1
answer74
viewsType annotation in asynchronous functions in Typescript
I am new to Typescript and I have the following question. It is necessary to be explicit about the type of return of a request fetch? const getPeoples: () => { userId: number, id: number, title:…
-
2
votes1
answer47
viewsIf B is a subtype of A, why is a collection of B not a subtype of a collection of A?
Dice: public interface A { ... } public interface B extends A { ... } private Set<B> bs = new HashSet<>(); RecebeA qualquerCoisa = new RecebeA(bs); Why does the last line compile if the…
-
2
votes1
answer53
viewsWhy do different types of variables give different results when modified in a function?
I can’t understand why x and v[0] are different. void edit1 (int x) { x = 9 * x; } void edit2 (int v[]) { v[0] = 9 * v[0]; } int main () { int x, v[2]; x = 678; edit1 (x); printf (" x: %d\n" , x);…
-
2
votes1
answer199
viewsWhat is the difference between "value types" and "Reference types"?
I didn’t quite understand these classifications among the types that a variable can contain that are value types (types of value) and Reference types (reference types) that exists in the language…
-
2
votes1
answer170
viewsProblem typing first parameter of React setState
Hello, I’m a little new to the typescript world and there’s something going on that I can’t explain why. I have the following state: const [estaExecutando, mudarExecucao] = useState(false); Step to…
-
2
votes1
answer32
viewsInitialization of variables in Java
Good night Folks! I’m learning java, and if you can help me with that question,... I saw it in a course that I’m doing, in a book that I’m reading, and on websites where I researched this assuming…
java variables typing initialization programming-principlesasked 3 years, 3 months ago Tarcio Vinicius Nieri 73 -
1
votes2
answers4640
viewsAverage calculation problem between int and float
I’m having a problem with an average calculation. I have a struct with 3 fields. The ones I’m looking for are average product quantity and unit value. I need to average all the products and their…
-
1
votes1
answer1145
viewsWhat is the difference between Int32 and int in C#?
In C#, use String or string, Int32 or int, among others, there is no difference, in thesis. Anyone knows if this difference generates any impact on the performance of high complexity applications?…
-
1
votes1
answer59
viewsGet Type from a class without instantiating it
I need to get the Type of a class without instantiating it, I tried to do that way: variavelQualquer.Type = new ClasseA().Type; // Type é uma variável pública que guarda o valor do método GetType()…
-
1
votes2
answers174
viewsMethod does not correctly show expected result
I have this interface public interface Promocional { boolean aplicaDesconto(double porcentagem); default boolean aplicaDescontoDe10Porcento() { return aplicaDesconto(0.1); } } The class LivroFisico…
-
1
votes3
answers3092
viewsHow to make an integer store a 12-digit number?
I need to find the largest prime factor of the number 600851475143. Because it is a very large number, I cannot store it in a normal integer type variable. The code I made to find the largest prime…
-
1
votes1
answer1846
viewsSqlitestudio types of data
I’m using Sqlitestudio to model a database. When creating the fields of a table, I noticed that it has some data types that do not appear in the Sqlite documentation. For example, in the combobox…
-
1
votes1
answer759
viewsHow to save the values of a String in a Double variable?
I have a string with the x value inside it (String value = "x") Need to pass this value to a Double Variable, how do I pass the x value of the String to the variable? If I convert from String to…
-
1
votes2
answers1756
viewsC# Challenge Variable value exchange
I recently made a very simple challenge : Swap the value of two variables without using a third variable. int a = 5; int b = 3; a += b; // a = 8 b = a - b; // b = 5; a -= b; // a = 3; It is simple…