types

What is the difference between Bool and Boolean types in C#

What is the difference between Bool and Boolean types in C#? ...

What's the canonical way to check for type in python?

What is the best way to check if a given object is of a given type. How about checking if the object inherits from a given type. Let's say I have an object o. How do I check if it's an str? ...

How do you store Date ranges, which are actually timestamps

Java & Oracle both have a timestamp type called Date. Developers tend to manipulate these as if they were calendar dates, which I've seen cause nasty one-off bugs. For a basic date quantity you can simply chop off the time portion upon input, i.e., reduce the precision. But if you do that with a date range, (e.g.: 9/29-9/30), the diffe...

C++ types using CodeSynthesis XSD Tree Mapping

Hi All, I'm using CodeSynthesis XSD C++/Tree Mapping utility to convert an existing xsd into c++ code we can populate the values in. This was we always make sure we follow the schema. After doing the conversion, I'm trying to get it to work so I can test it. Problem is, I'm not used to doing this in c++ and it's my first time with thi...

Can you control whether a variable's type is dynamic or static in VB9?

I would like to use VB9 but am not sure what syntax to use to say that I want a variable to be statically typed as in C#'s: var foo = new Whatever(); In previous versions of VB: Dim foo = New Whatever() created a dynamically typed variable. Is there a way to get static typing without actually writing the type in VB9? ...

Java: Newbie-ish inheritance question...

Suppose I have a base class B, and a derived class D. I wish to have a method foo() within my base class that returns a new object of whatever type the instance is. So, for example, if I call B.foo() it returns an object of type B, while if I call D.foo() it returns an object of type D; meanwhile, the implementation resides solely in t...

Getting a System.Type from a type name

I want to get a System.Type given only the type name in a string. For instance, if I have an object: MyClass abc = new MyClass(); I can then say: System.Type type = abc.GetType(); But what if all I have is: string className = "MyClass"; ...

Dynamically find the class that represents a primitive Java type

I need to make some reflective method calls in Java. Those calls will include methods that have arguments that are primitive types (int, double, etc.). The way to specify such types when looking up the method reflectively is int.class, double.class, etc. The challenge is that I am accepting input from an outside source that will specify...

Java Generics Syntax for arrays

What data structure does the following declaration specify? List<ArrayList>[] myArray; I think it should declare an array where each element is a List (e.g., a LinkedList or an ArrayList) and require that each List contain ArrayList objects. My reasoning: List<String> someList; // A List of String objects List<ArrayLi...

Getting the string representation of a type at runtime in Scala

In Scala, is it possible to get the string representation of a type at runtime? I am trying to do something along these lines: def printTheNameOfThisType[T]() = { println(T.toString) } ...

.NET webservice using an instance of a parameter type?

I have a Windows forms project and a Web Service project in my solution, and I'm trying to call the web service and return a customer object as the result. The problem is that when I try to receive the return object, I get an error that it can't convert it. For example, here is the signature for my webservice: Public Function GetDriverB...

Converting a char string to its underlying data type.

I have a string(char*), and i need to find its underlying datatype such as int, float, double, short, long, or just a character array containing alphabets with or with out digits(like varchar in SQL). For ex: char* str1 = "12312" char* str2 = "231.342" char* str3 = "234234243234" char* str4 = "4323434.2432342" char*...

What is a type and effect system?

The Wikipedia artcile on Effect system is currently just a short stub and I've been wondering for a while as to what is an effect system. Are there any languages that have an effect system in addition to a type system? What would a possible (hypothetical) notation in a mainstream language, that you're familiar, with look like with e...

What does a type followed by _t (underscore-t) represent?

This seems like a simple question, but I can't find it with the Stack Overflow search or Google. What does a type followed by a _t mean? Such as int_t anInt; I see it a lot in C code meant to deal closely with hardware—I can't help but think that they're related. ...

.NET: How to check the type within a generic typed class?

Hello everybody! How do I get the type of a generic typed class within the class? An example: I build a generic typed collection implementing ICollection< T>. Within I have methods like public void Add(T item){ ... } public void Add(IEnumerable<T> enumItems){ ... } How can I ask within the method f...

Is it possible to modify a method body at run-time in .NET?

I know that it is possible (in theory) to create a new type at run-time, but is it possible to modify a method body of an existing type at run-time? My plan (if I can get this to work) is to tag up methods with a custom attribute, and then at run-time search for methods with the attribute, and insert some of my own code into the method b...

Is there anyway to declare a TYPE without a Property in Oracle 10gR2

I want to create a base object that has only methods. The object would be QUEUABLE_OBJECT_TYPE and it will have an ENQUEUE method(s). The Payload of these messages (properties) would be added by subtyping this object. I get an error that makes it sound like you cannot. PLS-00589: no attributes found in object type "QUEUABLE_OBJECT_T...

VB.NET: What's the suffix (type character) for "Byte" numeric constants?

Just out of curiosity: I know I can tell the compiler if I want a value to be interpreted as a certain numeric type, e.g. as Integer (32 bit signed) this way appending an "I" (type character) to the constant value: Private Function GetTheAnswerAsInteger() As Integer Return 42I End Function There's also "S" for Short or "D" for D...

.NET : How do you get the Type of a null object?

I have a method with an out parameter that tries to do a type conversion. Basically: public void GetParameterValue(out object destination) { object paramVal = "I want to return this. could be any type, not just string."; destination = null; // default out param to null destination = Convert.ChangeType(pa...

What's bigger than a double?

Is there a native c++ variable type that's "bigger" than a double? float is 7 double is 15 (of course depending on the compiler) Is there anything bigger that's native, or even non-native? ...