types

Missing Infopath Content Type in SharePoint Form Library

I've had a strange issue come up. We have a Form Library in SharePoint with a number of InfoPath forms. When a user creates a new InfoPath form using the "New" drop down menu and saves it back to the form library. The content type of the form and the document are not associated. I can fix the document type, open the form back up, save...

Generic Class & Type.GetType()

Hi All, Bit of a puzzler, I have a generic class public abstract class MyClass<T> : UserControl { } and I have got a type like this Type type = Type.GetType("Type From DB as String", true, true); and I want to create and instance of MyClass using the type... But this doesn't work. MyClass<type> control = (MyClass<type>)LoadCon...

Is there a straightforward way to copy a Type using reflection?

I realize this is a very strange question. Let me just say that I have my reasons. (I tend to write very long, wordy questions; I want to keep this one short.) If I have some type T, can I use reflection to define a new type, let's call it T2, that will basically be identical to T? What I'm looking for is essentially a dynamic way to do...

Page content type

I have a list of links for the page which point to the images. When I click some the image opens in the browser, and I need to make it downloadable (use have to see the window for image saving). As I udnerstand, I have to make script (php only), and use it in that links addresses, passing the image name to it. Then, somehow change the co...

Where Are Value Types Stored In (C#) Generic Collections

It is true that generic collections perform better than non-generic collections for value types. (i.e. List vs. ArrayList). But why is that, other than the boxing-unboxing step? Where are the value type objects stored once added to the collection? In non-generic collections, they'll be boxed and stored on heap, what is different in gene...

How to check if type is IEnumerable<BaseType>?

Should be easy... class Base{} class Foo:Base{} public bool Bar(Type t){ // return ??? // NB: shouldn't know anything about Foo, just Base } Assert.True(Bar(typeof(IEnumerable<Foo>)); Assert.False(Bar(typeof(IEnumerable<Base>)); Assert.False(Bar(typeof(string)); Assert.False(Bar(typeof(Foo)); Just to answer question why 2n...

Postgresql function returns composite - how do I access composite values as separate columns?

I have a Postgresql function which returns a composite type defined as (location TEXT, id INT). When I run "SELECT myfunc()", My output is a single column of type text, formatted as: ("locationdata", myid) This is pretty awful. Is there a way to select my composite so that I get 2 columns back - a TEXT column, and an INT column? ...

id type to NSString

is there any way by which I can change an id type to NSString object? note the following line of my code. NSString *value = [appDelegate.bird_arr objectAtIndex:rowClicked] ; in this appDelegate is object of my AppDelegate class in a navigation based program and bird_arr is object of NSMutableArray. I want to use the string written in ...

.NET "invertible" dictionary where keys and values are exchangeable

Is there any .NET type that would represent a set of key-value pairs where each key will only be paired with a single value (like a regular Dictionary), but also each value will only be paired with a single key? I've been thinking of this as an "invertible" dictionary because you could swap the keys with the values without any collision...

C++ converting an int to an array of chars?

Possible Duplicate: C++ convert int and string to char* Hello, i am making a game and I have a score board in it. The score is stored in an int variable but the library im using for the game needs an array of chars for its text outputting for my scoreboard. So how do i turn an int into an array of chars? int score = 1234; ...

How to iterate initialized enumerated types with Delphi 6 and avoid the "out of bounds" error?

I am using Delphi 6 Professional. I am interfacing with a DLL libraty that declares an enumberated type as follows: TExtDllEnum = (ENUM1 = $0, ENUM2 = $1, ENUM3 = $2, ENUM4 = $4, ENUM5 = $8, ENUM6 = $10); As you can see the initialized values are not contiguous. If I try to iterate the type using a for loop as follows: var e: T...

How to do simple type cast in Scala?

This should be a silly question. scala> val aFloat = 1.5f aFloat: Float = 1.5 How to cast aFloat to an Int in a simple way? I already know to use a.asInstanceOf[Int]. But it needs too much keystrokes. ...

Integration tests implementation

I have a tree layered app web app (asp.net mvc for simplicity here), business services data repositories And I know there are four types of integration tests: top down bottom up sandwich (combination of the top two) big bang I know I would write big-bang tests just like unit tests but without any mocking so I would employ a backe...

Is there any programming language that lets you redefine its type system?

Hi, I'm looking for programming languages that let you redefine their type system without having to hack into the compiler. Is there anything out there that allows you to do that? Thanks ...

IPhone SDK - How to detect variable type (float or double)?

Hello, How do I detect whether a variable is float, double, int, etc.? Thanks. ...

Why doesn't Python's `except` use `isinstance`?

The Python documentation for except says: For an except clause with an expression, that expression is evaluated, and the clause matches the exception if the resulting object is “compatible” with the exception. An object is compatible with an exception if it is the class or a base class of the exception object, [...] Why...

Why does my Lambda query return an anonymous type versus Linq's strongly-typed return value?

Ok, bear with me... hadn't done any Linq or Lambda until a couple of days ago :) I'm using C# and the ADO.NET Entity Framework. I want to query my model and get back a List of objects based on a relationship. Here's my code: var query = db.Achievements.Join ( db.AchievementOrganisations, ach => ach.AchievementId, ao => ao.Achieve...

two ways of displaying a decimal

Hello, let's say I have a list of decimals : List<decimal> values; and 2 function to display a decimal : string DisplayPct(decimal pct) { return pct.ToString("0.00 %"); } string DisplayValue(decimal val) { return val.ToString("0.00"); } What would be the best mechanism to implement so I could know which function to call dep...

about python datetime type

What's the equivalent type in types module for datetime? Example: import datetime import types t=datetime.datetime.now() if type(t)==types.xxxxxx: do sth I didn't find the relevent type in types module for the datetime type; could any one help me? ...

Type equality performance

I have an iterator of objects and I have to take specific action if the item is of some type. That type is a friend class in the runtime, and therefore cannot be used in design-time. So my question is, which of the following will cost less performance: Private Const myType As String = "System.HiddenNameSpace.MyHiddenType" Sub Compare()...