Related
Sergio Romero We are dealing with a lot of legacy WinForms code and are slowly refactoring, breaking down dependencies, implementing the MVP pattern and moving logic from forms and user controls into the presenter. We've added Castle Windsor, which creates a V
User 11383582 I have a small question about generic programming in Java. Is there a way to check the type of the parameter passed to the method? I want to compare the type of the instance on which the method is called and the arguments passed to it. If they ar
dpzmick I want to be able to pass a generic function to another function (in this case a closure) without losing the "genericity" of the passed function. Since this is a convoluted statement, here is an example: use std::fmt::Debug;
fn test<F, I: Debug>(gen:
User 11383582 I have a small question about generic programming in Java. Is there a way to check the type of the parameter passed to the method? I want to compare the type of the instance on which the method is called and the arguments passed to it. If they ar
innocent bystander Imagine the following simplified code: #include <iostream>
void foo(const int& x) { do_something_with(x); }
int main() { foo(42); return 0; }
(1) Besides optimization, what happens when 42 is passed to foo? Does the compiler stick 42 somew
innocent bystander Imagine the following simplified code: #include <iostream>
void foo(const int& x) { do_something_with(x); }
int main() { foo(42); return 0; }
(1) Besides optimization, what happens when 42 is passed to foo? Does the compiler stick 42 somew
innocent bystander Imagine the following simplified code: #include <iostream>
void foo(const int& x) { do_something_with(x); }
int main() { foo(42); return 0; }
(1) Besides optimization, what happens when 42 is passed to foo? Does the compiler stick 42 somew
some development Suppose I have the following schema for later use $ref: "schemas": {
"Order": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"petI
innocent bystander Imagine the following simplified code: #include <iostream>
void foo(const int& x) { do_something_with(x); }
int main() { foo(42); return 0; }
(1) Besides optimization, what happens when 42 is passed to foo? Does the compiler stick 42 somew
innocent bystander Imagine the following simplified code: #include <iostream>
void foo(const int& x) { do_something_with(x); }
int main() { foo(42); return 0; }
(1) Besides optimization, what happens when 42 is passed to foo? Does the compiler stick 42 somew
some development Suppose I have the following schema for later use $ref: "schemas": {
"Order": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"petI
Mr. Sha The tlb library in my python project passes win32com.client. I've easily used a number of built-in functions, but one of the main functions takes a list of arguments for two of them marked as ref int. When I try to pass a python integer to the function
Miffett: I wonder why the Java compiler doesn't accept this assignment: Class<? extends List<?>> blbost = ArrayList.class;
Note that I'm not interested in solutions like this Class<? extends List<?>> blobst = (Class<? extends List<?>>)ArrayList.class;, I'd li
LambdaBeta I have a situation where I want to call a function to produce an object that I only have the type described by KType. Basically I have: inline fun<reified T> coolFunction(from : String) : T = // Okay, I'll be honest - its a JSON parser
...
fun myOth
Elias I can pass the type as a generic parameter, but when I use an object that contains typed parameters, Flow doesn't understand nor suggest the type. Instead, I get an error. export type TAction<T, R> = { +type: string, payload?: T, meta?: R };
function th
flexographic printing I'm using this neat class to map datatables into objects in a MySQL database. Now, I want to write a generic function that returns a list of various different classes so that I can call: List<Person> persons = ReadDataTable<Person>();
Lis
LambdaBeta I have a situation where I want to call a function to produce an object that I only have the type described by KType. Basically I have: inline fun<reified T> coolFunction(from : String) : T = // Okay, I'll be honest - its a JSON parser
...
fun myOth
hi mark I want to pass object with method setName to generic type of object. one example: //Instead of obj.setName = "John"; do this:
aMethod(obj);
aMethod(different_obj); //different_obj has also a method setName
public aMethod(object anOtherObj) {
anOther
hi mark I want to pass object with method setName to generic type of object. one example: //Instead of obj.setName = "John"; do this:
aMethod(obj);
aMethod(different_obj); //different_obj has also a method setName
public aMethod(object anOtherObj) {
anOther
Miffett: I wonder why the Java compiler doesn't accept this assignment: Class<? extends List<?>> blbost = ArrayList.class;
Note that I'm not interested in solutions like this Class<? extends List<?>> blobst = (Class<? extends List<?>>)ArrayList.class;, I'd li
LambdaBeta I have a situation where I want to call a function to produce an object that I only have the type described by KType. Basically I have: inline fun<reified T> coolFunction(from : String) : T = // Okay, I'll be honest - its a JSON parser
...
fun myOth
Elias I can pass the type as a generic parameter, but when I use an object that contains typed parameters, Flow doesn't understand nor suggest the type. Instead, I get an error. export type TAction<T, R> = { +type: string, payload?: T, meta?: R };
function th
flexographic printing I'm using this neat class to map datatables into objects in a MySQL database. Now, I want to write a generic function that returns a list of various different classes so that I can call: List<Person> persons = ReadDataTable<Person>();
Lis
LambdaBeta I have a situation where I want to call a function to produce an object that I only have the type described by KType. Basically I have: inline fun<reified T> coolFunction(from : String) : T = // Okay, I'll be honest - its a JSON parser
...
fun myOth
LambdaBeta I have a situation where I want to call a function to produce an object that I only have the type described by KType. Basically I have: inline fun<reified T> coolFunction(from : String) : T = // Okay, I'll be honest - its a JSON parser
...
fun myOth
Elias I can pass the type as a generic parameter, but when I use an object that contains typed parameters, Flow doesn't understand nor suggest the type. Instead, I get an error. export type TAction<T, R> = { +type: string, payload?: T, meta?: R };
function th
hi mark I want to pass object with method setName to generic type of object. one example: //Instead of obj.setName = "John"; do this:
aMethod(obj);
aMethod(different_obj); //different_obj has also a method setName
public aMethod(object anOtherObj) {
anOther
Elias I can pass the type as a generic parameter, but when I use an object that contains typed parameters, Flow doesn't understand nor suggest the type. Instead, I get an error. export type TAction<T, R> = { +type: string, payload?: T, meta?: R };
function th
Jaroslaw K. I have a problem with passing a class as a generic parameter of a method, if I have a simple method: <T> T sendRequest(SomeRestApiRequest request, Class<T> responseClass)
Parses the response to the specified form. I use them this way: ItemListJSON