» Home » Types » Page 1
Inserting subclass types(Integer/String) into superclass types(Object) in ArrayList
by Milander in 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.


Extend PostgreSQL by index structure, data types, retrieval types, etc. with Java?
by dummyadresse in 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

Pass a list of types, limiting the types to classes derived from a particular parent, in c#
by walkah in 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)

Functions don't just have types: They ARE Types. And Kinds. And Sorts. Help put a blown mind back together
by dougbeal in 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

How to fix “Properties whose types are collection of primitives or complex types are not supported” with EF DbContext?
by Barak in 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

Does std::function's copy-constructor require the template type's argument types to be complete types?
by Skipholiday in 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

Oracle JDBC Types Mapped to Java Object Types by getObject() - wrong document?
by Paratus in 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

Boost Preprocessor library for generating a set of types based on a list of basic types e.g. PointI32, PointF32 etc. in C++/CLI
by Gilmar Souza Jr. in 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

What Types of Steam Cleaning Machines Clean Different Types of Floors?
by LDam in Home & Garden
Steam cleaning reaches the deep, hidden areas of your floor, cleaning areas that you cannot reach with a vacuum. Shopping for a machine of this type is slightly difficult because each machine is designed for a different area of the house. Some steam cleaners effectively clean tile floors, while others work well on carpeted areas alone. Before investing in a machine for your house, learn which one

Is there any reason I shouldn't ignore generic types in the concrete types?
by zdyne in Programming Languages

Generics in Java is noisy sometimes. The parameterized types are thrown out by the compiler anyway after compile, so my question is, is there really any drawbacks in ignoring them, as long as I declare the type of the reference to include parameterized types? e.g.,

Map<String, Map<Integer, String>> myMap = new HashMap<String, Map<Integer,String>>();

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .