Questions tagged [generalization]
131 questions
0
votes
1 answer
GCD of multiple parameters
My aim was to generalize the __gcd() available in std header in C++. which should be able to call for a range of values of a std::vector array.
The generalized template __gcd() works perfectly when parameters have been passed directly.…
user9267359
0
votes
2 answers
Generalising multiple nested for loops
I have a data structure like this: map>>
Now, I have multiple functions all of which use the same for loop method:
for (auto p1 : myMap)
for (auto p2 : p1.second)
for (auto p3 : p2.second)
…

Markus Meskanen
- 19,939
- 18
- 80
- 119
0
votes
1 answer
How to apply arguments to all neural network objects in cell array
I want to have N parallel neural networks working side by side with the same input parameters. So I decided first to start with 2 neural networks to generalize to N next round.
To do this I created a function called getUntrainedNet as…

Prophet Daniel
- 327
- 2
- 15
0
votes
1 answer
UML generalization subclasses?
So, I am just a totally normal, everyday, boring human being who happens to be learning UML a the moment. I'd like to start out by saying that my problem isn't applied to a real situation, it is an exercise.
It says the following "each principal is…

Heeiman
- 249
- 1
- 4
- 15
0
votes
1 answer
How to add a foreign key constraint references to the IS-A-to-Two-Tables relationship?
First in my ER-Model I have an account entity which has a IS-A relationship with two disjoint subentities saving-account and checking-account.
However I have a customer entity have a depositor relationship with the account entity, such the use case…

OOD Waterball
- 707
- 1
- 11
- 31
0
votes
0 answers
c#, How to Generalise that a set of items belongs to a label and then access the list of objects from the label
I want to be able to use some sort of Machine Learning or similar to generalize from lots of sets of items each with a label, lets call it a box. For each box their is contained inside a set of items with an id and string identifier. I want to as…
0
votes
1 answer
Generalizing Lisp functions
For rapid prototyping purposes, I would like to start building a library of generalized versions of some basic functions provided in Common Lisp, rather than only collect (or import) special purpose functions for the task at hand. For example, the…

davypough
- 1,847
- 11
- 21
0
votes
1 answer
Generalize without losing type
I need to merge these two methods in only one generalizing them. I know IQueryable implements IEnumerable, IOrderedQueryable implements IOrderedEnumerable and the first method seems to be useless if the second is present. But for some Entity…

Max
- 13
- 2
0
votes
1 answer
Should I add a owner component on every entity that has parent?
Should I add a owner component on every entity that has parent? if yes, what is the right term for that component. Currently I am using AttachmentComponent that consist of owner Entity, and use it like in the below code.
AttachmentComponent…
user4822216
0
votes
2 answers
Java generalization - constructor cannot be applied to given types
I am doing an tutorial task on implementing Graph using Adjacency List but got problem with the constructor.
In the given GraphTester.java I have:
//Constructor cannot be applied to given types
FriendShipGraph graph = new…

Jay Nguyen
- 342
- 1
- 2
- 18
0
votes
2 answers
UML 2.0 Can I have an bidirectional extend relationship in between use cases?
Example:
Use Case 1 : Buy drinks
Use Case 2 : Buy food
A user can enter our store and start by ordering some drinks. We can upsell him a food item => Buy food extends buy drinks.
The other way around would be possible as well. A user wants to…

DiscoFever
- 123
- 8
0
votes
2 answers
good way to generalize multiple try except
I have 15 try except statements in a for loop in the code. I think that it can be generalized but I am not able to get to the solution. How can I do it.
for item in results:
try:
a = item.something()
except:
a = ""
…

raj247
- 381
- 1
- 4
- 21
0
votes
1 answer
Generalizing XSLT code
I'm trying to learn the different possibilities to generalize XSLT templates for the sake of reusing them at different places. So far, I have two cases where I do not know how to proceed.
Case 1 - source XML might contain nodes Foo1, Foo2, ...,…

csoltenborn
- 1,127
- 1
- 12
- 22
0
votes
2 answers
How can I get the same method code in a subclass without code duplication?
I have the following code:
#include
class Exception : public std::exception {
private:
const char* MESSAGE = "Exception"
public:
inline virtual const char* what() const throw() {
return this->MESSAGE;
}
};
class…

Lilo
- 341
- 2
- 14
0
votes
1 answer
Appropriate place for factory class specific generic functions (abstract class?)
I haven't quite found an answer to this specific question on Stack Overflow, so I'm posting it here.
I have a factory class which generates a Database handling object from an abstract class, depending on which database you need (see code).
My…

RightmireM
- 2,381
- 2
- 24
- 42