» Home » Types » Page 1
Inserting subclass types(Integer/String) into superclass types(Object) in ArrayList
Category : Programming Languages

I am learning generics.

I tried below code:

For HashSet

Set<Object> setOfAnyType = new HashSet<Object>();

But When I try same thing in ArrayList of type Object and try to insert integer and String it gives me compile time error why?.Please guide.


View Replies

Extend PostgreSQL by index structure, data types, retrieval types, etc. with Java?
Category : Java

I learned that PostgreSQL is written in C. I would like to extend it by

a customized index structure
a customized nearest neighbor retrieval (with various distance functions)
custom data types

I feared so far to use PostgreSQL because it is written in C. However, I've seen on the PostgreSQL about page (http://www.postgresql.org/about/) that they support "library inter

View Replies

Functions don't just have types: They ARE Types. And Kinds. And Sorts. Help put a blown mind back together
Category : Programming Languages

I was doing my usual "Read a chapter of LYAH before bed" routine, feeling like my brain was expanding with every code sample. At this point I was convinced that I understood the core awesomeness of Haskell, and now just had to understand the standard libraries and type classes so that I could start writing real software.

So I was reading the chapter about applicative functors when

View Replies

Pass a list of types, limiting the types to classes derived from a particular parent, in c#
Category : C & C++ & C#

I have a method on an object oriented database that creates tables based on their type.

I want to be able to send a list of types to get created, but i'm hoping to limit them to only classes derived from a specific base class (MyBase).

Is there a way i can require this in the method signature?
Instead of

CreateTables(IList<Type> tables)

View Replies

Does std::function's copy-constructor require the template type's argument types to be complete types?
Category : Programming Languages


#include <functional>
class world_building_gun;
class tile_bounding_box;
typedef std::function<void (world_building_gun, tile_bounding_box)> worldgen_function_t;
void foo() {
worldgen_function_t v;
worldgen_function_t w(v);

Should this compile? My compilers say:

Yes: GCC/stdlibc++ (a

View Replies

How to fix “Properties whose types are collection of primitives or complex types are not supported” with EF DbContext?
Category : Coding

I have a project containing POCO entities. A database context has been created for it using Entity Framework 4.2 and code first. This works fine, but the context needs to be exposed as an OData service which does not work.

Browsing to the OData service gives this error:

The property 'DataSubmissionItems' on type

View Replies

Oracle JDBC Types Mapped to Java Object Types by getObject() - wrong document?
Category : Java

this is the document link: "Mapping SQL and Java Types"

let's see 8.9.3 JDBC Types Mapped to Java Object Types
at row: TIMESTAMP - java.sql.Timestamp

but when I use getObject() with oracle database on a TIMESTAMP column, the return type is oracle.sql.TIMESTAMP, it can not been cast to java.sql.Timestamp

I know that I can use getTimestamp() but I need ge

View Replies

Boost Preprocessor library for generating a set of types based on a list of basic types e.g. PointI32, PointF32 etc. in C++/CLI
Category : C & C++ & C#

I am trying to figure out how to use the Boost.Preprocessor library http://www.boost.org/doc/libs/release/libs/preprocessor to unfold a "generic" type for different specific types. Below I will ask this for a simple point class example. Given:

struct Point##TYPE_SUFFIX_NAME
// Other code

I want to gene

View Replies

f# types' properties in inconsistent order and of slightly differing types
Category : Coding

I'm trying to iterate through an array of objects and recursively print out each objects properties.
Here is my object model:

type firmIdentifier = {
firmId: int ;
firmName: string ;
type authorIdentifier = {
authorId: int ;
authorName: string ;
firm: firmIdentifier ;
type denormalizedSuggestedTradeRecommenda

View Replies

Determining object equivalence for value types, reference types and ILists in .net
Category : Programming Languages

I have a class with a Property called 'Value' which is of type Object.
Value can be of any type, a structure, a class, an array, IList etc.

My problem is with the setter and determining whether the value has changed or not.
This is simple enough for value types, but reference types and lists present a problem.

For a class, would you assume that the Equals metho

View Replies

2012 / 2017 Copyrights BigHow , All Rights Reserved .