Questions tagged [generalization]

131 questions
0
votes
0 answers

Distinguish multi and single tenancy

I am having a hard time distinguishing multi and single tenancy. Like I know that having for example 10 publications/sites/domains on one site (like some sort of CMS) is multi-tenancy. I will provide an example. Lets say that I was given task that…
0
votes
0 answers

I want to inherit concrete level classes to abstract class at run time in c#?

I am working on c# windows form. I want to do class generalization from given input code by generating an abstract class for common properties of all classes given in input and then other classes are inherited with that abstract class. I am…
0
votes
2 answers

UML generalization without polymorphism

Is it possible to have a generalization relationship between two classes in which the subclass adds new operations that are not on the superclass (not overriding, not overloading)? It is not a LSP violation? I don't want polymorphism, just reuse of…
0
votes
2 answers

How to deploy js in production?

I am React js beginner so I wanted to clarify some things. Q1. The only way to use React in production is to use webpack-dev-serve ? Q2. In case that you use webpack-dev-server I should create multiple API which will handle multiple functionalities…
user7781073
0
votes
1 answer

Making my function general as possible for checking a state

I want to create a function that can be general as possible but It doesn't work now. I have two case : Check if the state of a state is not empty or true and if my item is equal to him, I want to reset him by calling resetState() and set to false…
flopic
  • 1,039
  • 4
  • 10
  • 14
0
votes
0 answers

Why a compiler always give error message that doesn't make any sense to anybody?

Take this for example /usr/include/qt5/QtCore/qcoreapplication.h:43: error: QtCore/qglobal.h: No such file or directory #include ^ This is just come from a self generated code of Qt Creator nothing…
shadow_wxh
  • 366
  • 3
  • 17
0
votes
3 answers

In how many ways can this function be simplified?

I'm trying to simplify/generalize a function foo_one that traverses through a multidimensional array and sets all sub-array elements apart from the first one to have null values. I was given only the first function, for which I should then find more…
moodygeek
  • 127
  • 13
0
votes
0 answers

Check if the variable is true to set false, have any impact?

Is a difference / impact to code if i set "variable = false" in an event without to check it if is true ? Like: function OnClick() { variable = true; or variable = object } function OnMouseMove() { variable = false; or variable = null } But is set…
user6168288
0
votes
1 answer

weight update of one random layer in multilayer neural network using backpagation?

In training Multi-layer Neural networks using back-propagation, weights of all layer are updated in each iteration. I am thinking if we randomly select any layer and update weights of that layer only in each iteration of back-propagation. How is it…
0
votes
1 answer

Displace geographic points which lie too closely together (Python / Shapely)

I've got a dataset of refineries in Texas (GeoJSON here - https://pastebin.com/R0D9fif9 ): Name,Latitude,Longitude Marathon Petroleum,29.374722,-94.933611 Marathon…
0
votes
2 answers

F# generalization by overloading

Given the type type T = static member OverloadedMethod(p:int) = () static member OverloadedMethod(p:string) = () Let's suppose we want to create a generic function that resolves to the specific overload based on the type of the parameter.…
Franco Tiveron
  • 2,364
  • 18
  • 34
0
votes
2 answers

Generalize a generic class

I have written a Collection like this: class AnimalCollection where TValue : Animal, new() { void Add(TValue value){}; void AddNew() { Add(new TValue()); } } I have some Classes which are derived from Animal: class…
Syrlia
  • 154
  • 2
  • 14
0
votes
1 answer

General Gson Serialization of API types

I am working with an API that can have different types for it's attributes The attributes can either be Ids or Objects I want to build a generalized type that handles this for me with Gson serialization. Example: "platforms": [ 6 …
Oreex0
  • 324
  • 3
  • 15
0
votes
1 answer

Can these 3 methods be generalized into 1 method

I have these 3 methods below. I only don't have a clue to make them as one, as they are type of array, list or just an object. These methods just convert a given object to a json string and then convert it to the specified class that was given.…
0
votes
1 answer

What is the regex of 'if'?

I am working on a project that needs to check if the user has written a good condition on a textfield. So I'd like to know if one of you knows the regex of a 'if'. For example, if the user writes if ((k <= 5 && k>0)|| x>8) I will return true.
vinny
  • 19
  • 4
1 2 3
8 9