types

New Payload type for RTP profile

I am designing a new RTP profile. How can I determine the next available RTP payload type, which I can assign to my profile type? ...

"Store" a type parameter for later use in C#?

I'm creating a Settings object in my app, used for storing user-defined settings and whatnot. I plan on using various datatypes for my setting fields (ints, strings, enums, anything Serializable, really). I'd also like, if possible, a type-safe way to set any of the settings. My proposed method would be doing something like this: Tuple...

When are the first Python objects 'object' and 'type' instances created ?

Reading: http://www.python.org/download/releases/2.2/descrintro/#metaclasses A class statement is executed and then the name, bases, and attributes dict are passed to a metaclass object. Since 'type' is an instance - isinstance(type, type), it is an object already. When/how is the very first instance created ? My guess is that the firs...

Java: Put objects of different types into a ArrayList for a ModelCollection. Interaces?

I want to have my models wrapped up in a ModelCollection which is mostly used for a ListView. The Collection has always the same attributes like title, totalResults (for Pagination) and it shall contain the listItem-Models in the ArrayList "items". However, these models have different types like "ModelCategory" or "ModelChain" and often...

What type is a function ?

let's try some calls to the "type" function : user=> (type 10) java.lang.Integer user=> (type 10.0) java.lang.Double user=> (type :keyword?) clojure.lang.Keyword and now with an anonymous function : user=> (type #(str "wonder" "what" "this" "is")) user$eval7$fn__8 A) what does this mean "user$eval7$fn__8" ? B) and what type is a ...

Compare type of IEnumerable<T>

I have dictionary that gives me back a method according to the value passed in. Defined as so: Dictionary<Type, IXmlWriterConverter> I have now added a new function that which has the Key/type set to IEnumerable, so far so good. But when I execute my unit test with a List containing two DataTables but the dictionary can not find the k...

Safely traversing a raw Iterator in Java?

I'm using a third party library that returns a raw Iterator, e.g. Iterator<?> children = element.getChildElements(); I know the actual type, but I don't necessarily trust the third party lib to stick with it in the future. There are two (that I can think of) somewhat risky ways to traverse this: @SuppressWarnings("unchecked") Iterat...

Java generic methods cast to parameter type at runtime, is it possible?

I have a method that looks like this public static <T extends MyClass, X extends AnotherClass> List<T> (Class<T> aParameter, X anotherParameter) Now if AnotherClass is an abstract class that does NOT Have getId defined, but every single class that extends this interface does. (Don't ask me why it is designed this why, I did not desi...

C#: Type specific/static methods supporting overriding

In C# it is not possible to override a static method. Nevertheless I have some type specific methods (instead of the usual instance methods) and I want to give the user the ability to override those methods, and in addition, have the ability to call those (overridden) methods from my own code without knowing about the 'overriding' done b...

What is the difference between “int” and “uint” / “long” and “ulong”?

I know about int and long (32-bit and 64-bit numbers), but what are uint and ulong? ...

Haskell: Deducing function from type

So I was playing around with Haskell today, thinking about autogeneration of function definitions given a type. For example, the definition of the function twoply :: (a -> b, a -> c) -> a -> (b, c) is obvious to me given the type (if I rule out use of undefined :: a). So then I came up with the following: ¢ :: a -> (a ->b) -> b ¢ =...

How to create a new instance of the same class as the other object?

Having a object x which is an instance of some class how to create a new instance of the same class as the x object, without importing that all possible classes in the same namespace in which we want to create a new object of the same type and using isinstance to figure out the correct type. For example if x is a decimal number: >>> fr...

Editor does not contain main type in Eclipse

I got this message when running my project in Eclipse, and I am sure that I have a main in my project. I tried cleaning, closing and re-opening it, but nothing works. Can anyone help me please? ...

Use of `inline` in F#

The inline keyword in F# seems to me to have a somewhat different purpose than what I'm used to in e.g. C. For example, it seems to affect a function's type (what are "statically resolved type parameters"? Aren't all F# types resolved statically?) When should I be using inline functions? ...

Why would System.Type.GetType("Xyz") return null if typeof(Xyz) exists?

I have come across a strange behaviour in my (huge) .NET 4 project. At some point in the code, I am referring to a fully qualified type, say: System.Type type = typeof (Foo.Bar.Xyz); later on, I do this: System.Type type = System.Type.GetType ("Foo.Bar.Xyz"); and I get back null. I cannot make sense of why this is happening, becaus...

WordPress 3.0.1 Query Custom Post Type with Custom Taxonomy

I have a custom post type with multiple taxonomy types. The issue is focused around just one of them. I need to display all custom posts that have a taxonomy from featured-vendors checked. Right now, there is just one "featured" , but there may be more in the future, such as "highlight" or "sponsor" or something alone those lines. But, f...

Is there a way to determine if a generic type is built from a specific generic type definition?

I've got a generic method: Func<IEnumerable<T>, bool> CreateFunction<T>() where T can be any number of different types. This method does a bunch of stuff using reflection and if T is an IDictionary, regardless of the the dictionary's TKey and TValue I need to execute dictionary specific code. So the method could be called: var f = C...

find about about the type of function parameters

can i somehow find all functions/macros that take a specific type of parameter ? for example, what function accepts a Namespace object as parameter ? (this is because i can create a namespace and store it in a var, but i don't know where i could use that var; what function might i pass that var to ?) here is some code: user=> (def wo...

How to get ExtJS Layout used for Container

Hi, is there a way to find out which layout type is used for a container. For instance. When I use the following code to get a container how can I determine the layout type. comp = Ext.getCmp('<name>'); comp.getLayout(); I only get a layout object but there is no field from the object which tells me the layout type ...

Delphi: array of Char and TCharArray "Incompatible Types"

I've run across this "Incompatible types" error in the comment below a few times, and never been happy with why this isn't directly supported in Delphi 2007: program Project1; {$APPTYPE CONSOLE} type TCharArray = array of Char; procedure DoArray(Chars: array of Char); begin end; function ReturnTCharArray: TCharArray; var CharArray: T...