Generic TypeScript interface with mixed member types

For several HTML forms, I want to configure inputs and deal with their values. My types have the following structure (you may copy it to TypeScript Playground http://www.typescriptlang.org/play to see it in action): interface InputConfig { readonly i

Interface can not be converted to activity

I have created a separate class for the background process. In that, I have two classes and an interface. I am getting string data from the first class and then based on that data I am getting a list of data in another class. The whole process is wor

Summary, interface - when to use what?

I am relatively new to Java - especially when it comes to interfaces and abstract classes (I do know how to use them), however in this case i am a bit confused how i should setup my architecture. First of all, i'd like to say that this is just a proj

Go: Interfaces as return values

I have several structs which I fill with data from MongoDB. type Dog struct { Id string Age int } type Invoice struct { Id int Amount float } I was trying to make a function like this: func LookUp(collection string, ids []string) []interface{} { // I

Go. Multiple value in a single-valued context in Interface

I read below topic Go: multiple value in single-value context But I don't understand this explain in my case. May be that's way because I want to use interface I get error multiple-value NewObject() in single-value context in below case type Facade i

How to use an enumeration as we would use an interface?

How can I assign SomeEnum1 or SomeEnum2 to an "enum" which implements SomeInterface? I can't just specify the interface directly as it's a class and not an enum. I'm sure there is a specify syntactic sugar to make this work but I can't figure it

Socket programming: bind () - invalid argument

I am trying to bind my local IPv6 address to a socket. But always get "invalid argument". The reason I want to bind the specific IP address to socket is that if I don't bind the error "No route to host" came up. When I tried to ping an

It is impossible to transmit data between these two fragments

I'm going insane!! I don't manage to pass data from a fragment(A) to an another fragment(B). I read about using a public interface... and it seems to work, but i don't understand how to use this method. Fragment(A) package it.anddev.pagertabs; public

Creating a generic type instance in Java

This question already has an answer here: Create instance of generic type in Java? 23 answers I have the following Java class public class MyClass <T extends MyInterface> implements RowMapper<MyInterface> I'm implementing the following method:

Difference between constant declared in interface and class?

I ran into a peculiar issue I was curious about (and would like to find a workaround for). If I declare a variable NODES in my class: private static final String NODES = "nodes"; Everything works ok. However, if I declare the variable in an inte

Has good practice left an empty interface?

This time, I'm gonna create a math problems. I plan to have a dictionary where the key is Levels enum {Easy, Medium, Hard} and value should contain some configuration about how to create the problems. For example: BinaryProblemConfiguration + Bound1

Android nested interface to store constants

So I was looking at Google's I/O App, iosched, and I notice they implement constants through a nested interface. For example in their ScheduleDatabase class they have: public class ScheduleDatabase extends SQLiteOpenHelper { interface Tables { String

Build a generic filter parameter entry interface?

I have method calls that take different inputs, i.e: public Authors GetAuthors(string name, string sortBy, string sortDir, int startRow, int numRow) { // Get authors based on filters } public Books GetBooks(string id, string year, string sortBy, stri

Best point to start developing a database interface in C ++?

I'm working on some server/client based application at the moment. The application is multi-threaded, has plugin-support (via dlopen,...) and should work with multiple databases. Now I'm looking for some hints to start the design of the DBI-ABC. Firs

C ++ Iterators, interfaces and pointers

I'm trying to use c++ iterators with interfaces, but does not manage to make it working. I'm a bit lost with what type to choose for the vector contents. Is this need to be a pointer ? do I have to make a "new Implementation()"? In brief, it is

Interfaces in .Net

I would like to use the same code for copying files to an FTP server, and through USB. I've already written some code, which as of now uses functions from the System.IO namespace. To minimize code duplication, I've listed the functions which I need f

is there such a thing as an MXML interface

This could potentially be a dumb question so apologies in advance if it is. I'm wondering if theres an equivilant of Interfaces in MXML? Everytime I feel the need to use an interface I always wind up making an actionscript and not an MXML file becaus

Problems debugging the class library plug-in

I have a windows form application in which I'm attempting to utilize a plugin (class library). In the code I have it load the assembly from a dll file, which means I have not been able to debug. Furthermore I have not found out how to compile the lib

@MustOverride annotation?

In .NET, one can specify a "mustoverride" attribute to a method in a particular superclass to ensure that subclasses override that particular method. I was wondering whether anybody has a custom java annotation that could achieve the same effect

java general question about interfaces

considering i have a method which gets a List passed as an param. Within this method i want to use for instance an ArrayList specific function on that list (lets say trimToSize()). What would be the general approach to deal with a problem like this ?

Generic interface members

I've asked this question yesterday and got lots of good answers, only I just realized my question was wrong and here I want to rephrase it. I have this interface public interface IFoo<T> { T Value(); } With this members public class Bar : IFoo<st

Know what type is a certain interface

I am creating a method that accepts a IOBJECT parameter. there is multiple class that implement this interface. I need to figure out which type IOBJECT is. how would i go about doing thatIt's not ideal, but you can use the "is" operator. Throw i

Any actual example of using the multiple inheritance interface

I m trying to understand Interfaces so that I can implement them in my programs but I m not able to imagine how should i use them. Also give me some eg of using them with multiple inheritance in C#A good example for an interface is a repository patte