Questions tagged as 'tipagem'

2
answers

How does an anonymous type return?

I have a method that should return a collection of anonymous objects: /*Aqui deveria ser o tipo anonimo "AnonymousType"*/ [AnonymousType] ListarAnonimo() { //Especifica um "template" para o tipo retornado. var lista = new[] {...
asked by 11.02.2017 / 22:12
1
answer

What kind should I use to save only the (undated) time in a database?

I'm in doubt on what kind I should use to work with hours on my system. Should I use DateTime , Time or TimeStamp . I wish the times were saved in this format: HH:MM     
asked by 09.07.2015 / 18:43
1
answer

When to use lists and when to use tuples? [duplicate]

What is the difference between list and tuple types in Python and when should I use each one?     
asked by 26.03.2017 / 01:27
1
answer

What is the concept of signed integers in a programming language?

I would like to clarify the meaning of the term "signed integer". I'm researching on protocols, to build one in Java, and over and over meeting the term. I do not know what it's all about. I've always heard of primitive types, for example...
asked by 10.06.2017 / 23:48
2
answers

Comparison 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 Delphi understands that t...
asked by 14.06.2018 / 18:14
1
answer

Parameter of any type in method

I am building a method and would like it to extend to any type. For now I am using string but I would like it to work for int , float , double and datetime . public static bool isNotNull(string AnyTypeValue) //...
asked by 07.04.2015 / 20:01
2
answers

What is the suffix _t and when to use it?

I see in many codes some variables with the suffix _t . There are a lot of examples in the default C library as size_t , int32_t , mbstate_t . How useful, and when to use this suffix?     
asked by 29.09.2016 / 15:48
1
answer

Does a char type always have size 1?

I've always known that char is the only type that has fixed size by specification. Its size is 1, no matter the architecture. But I came across sizeof('a') returning 4 rather than 1. Like this? Did I Learn Wrong?     
asked by 19.01.2017 / 11:18
2
answers

Error parsing image in half using Python

I'm trying to split an image in half using the code below, but I'm having a return error. Code: import cv2 import numpy as np # Read the image img = cv2.imread("IMD015.png") width = img.shape # Cut the image in half width_cutoff = width /...
asked by 15.11.2018 / 19:25
1
answer

Is it interesting to create a type just for a pointer to a type?

I've seen it doing a MinhaEstrutura * be explicitly typed as typedef MinhaEstrutura * pMinhaEstrutura; Why not always do this and get rid of having to rename?     
asked by 12.01.2017 / 11:16