Generic programming is a style of computer programming in which algorithms are written using type parameters which are later substituted with concrete types.
3
votes
0answers
57 views
defining a scala function1 for use by java has wrong types
The problem can be summarised as follows:
I have a class that defines several methods to be called from java. one of them has a signature like:
import java.lang.{Double => JDouble}
def ...
3
votes
0answers
114 views
.NET generate generic method - compact framework
Here is the original question where I'm looking for a way to generate a generic delegate:
.Net generate generic methods
Here is the code to generate a generic delegate in .NET 3.5:
public delegate ...
3
votes
0answers
293 views
Delphi XE2 generics in TRemotable classes
For reasons not really relevant to the question I want to use generics in my TRemotable classes. I've found that Soap.OPToSOAPDomConv.pas has some problems with this. It's using the old RTTI which I ...
3
votes
0answers
229 views
Fluent NHibernate and automapping generic types
I'm automapping most of my model, but have a problem with generics.
I've got ValueContainer, and I make it abstract so that it
doesn't throw an exception during automapping. Next, I have to create
...
2
votes
0answers
36 views
JSF: auto conversion when backing a view item with an instance of a subclass of a generic class with resolved type parameter
We have a hierarchy of generic "parameter" types, with non-generic concrete leaf classes, a vertical slice of it given here:
public interface Parameter<T>
public T getValue();
public void ...
2
votes
0answers
21 views
How to use RhinoMocks Test GetEntityByName<T> Function? Is it possible or good practice?
I have a method using reflection to get a generic type of entity by name.
public T GetEntity<T>( string name ) where T : EntityBase
{
return GetDbSet<T>().FirstOrDefault( x => ...
2
votes
0answers
65 views
Jersey JSON marshalling of nested generic produces null
Having an issue trying to marshall into JSON a HashMap nested in a List using Jersey 1.11.
Here's a snippet of a Jersey endpoint which produces MediaType.APPLICATION_JSON via the returned Response ...
2
votes
0answers
84 views
Must type template every time for generic functions?
In C++, is there any way to avoid having to type the template name every time I am writing a class function outside of its class definition?
For example, if I want to define a class function, do I ...
2
votes
0answers
106 views
value === is not a member of type parameter TKey (using Squeryl)
I'm trying to write a simple BaseDao class using the excellent squeryl ORM framework.
However I've come across a problem when using generic typed keys. I get a compile error when I try and use the ...
2
votes
0answers
169 views
JAXB Bindings File Sets @XmlElement type to String instead of XMLGregorianCalendar
I'm trying to create an XmlAdapter that takes in an XMLGregorianCalendar and outputs an XMLGregorianCalendar. The purpose is simlply to remove timezone data from the element when unmarshalling data.
...
2
votes
0answers
214 views
How can I repurpose a generic C# expression allowing the input type argument to change?
EDIT: Simplified Question the real-world version can be found below but perhaps it's not necessary to answer this question.
I have a MethodCallExpression which I would like to repurpose. The method ...
2
votes
0answers
98 views
How is the generic-type hash calculated?
When returning a generic type in a WCF service, the service client generation will generate a type with the name "[GenericType]Of[TypeParameterName][hash]".
According to this Data Contract Names MSDN ...
2
votes
0answers
363 views
Generic descendant of TObjectList<T> in Delphi XE violates memory of ancestor
I discovered a strange problem in Delphi XE concerning a generic type def.
I created a derivative of TObjectList that include a number of classes (in example fIndex). Then I create a descendant class ...
2
votes
0answers
311 views
Dynamiclinq library with generic repository
Does anyone have any examples of using the dynamic linq library with a generic repository pattern?
http://nuget.org/packages/DynamicLINQ
...
2
votes
0answers
235 views
MissingMethodException when applied generic type parameters to method that returns generic parameter
I have a method called DynamicInvoke that is as follows:
public static object InvokeDynamic(Delegate d, object[] args)
{
Type[] tparams = d.Method.DeclaringType.GetGenericArguments()
...