Questions tagged [generalization]

131 questions
-1
votes
4 answers

Leave parts of the instructions blank for python to complete

I'm new to Python so I don't know if this is possible, but my guess is yes. I want to iterate over a list and put items into new lists according to their value. For instance, if item_x == 4, I would want to put it in a list called list_for_4. The…
gimi
  • 395
  • 3
  • 13
-1
votes
1 answer

What is a crypto currency application

Recently started looking at cryptocurrency and I'm a little confused at what exactly a cryptocurrency application is and what is a "smart contract". Please correct me if I'm wrong, however, a basic cryptocurrency application would be any normal…
-1
votes
2 answers

Python: How are objects/variables such as the complex '1j' defined?

And how can I define my own types of variables/objects to behave with the provided operations in python? Can I do this without having to create my own object classes and operators as a separate and distinct entity? I dont mind having to create my…
-1
votes
1 answer

Generalization of code

I'm working on a small Real-Time OS project and I ran into a small problem. void printOutput(void) { Log_info2("Fib(%d) = %d", FIB_N , cur) ; …
Jadenkun
  • 317
  • 2
  • 16
-1
votes
1 answer

How to to generalizing of the code for more variables?

In the code making up the graph I have blocks with similar conditions for four variables. Block 1: a =''.join(map(str, ['a1' if x%4==0 else 'a2' if x%4==1 else 'a3' if x%4==2 else 'a3' if x%4==3 else 'a4' for x in comb_3bit[i]])) Block…
Tomasz Przemski
  • 1,127
  • 9
  • 29
-1
votes
1 answer

Assocation and Generalization between two classes

Can anyone give me example of class B which inherits from A and there is association between them and what pattern uses such bonds? I am referring to the situation where A is generalization of B and exists association bond between them on UML…
ssukienn
  • 558
  • 6
  • 22
-1
votes
1 answer

Generalizing my YoY quarterly percentage growth code to suit different data

I have written out a code that works for year over year quarterly percentage growth. However my code only works for the data i was using to write the code. I would like to be able to just run my whole code with data of different lengths and not have…
-2
votes
2 answers

Java OOP - Role Playing Game classes in GENERAL

// in general, it could be potion, armor, weapon, etc. Item class { // states id name // behavior set, get of states here.. use() // still thinking what is the other general behavior } // in general, it could be…
ronscript
  • 397
  • 1
  • 8
  • 33
-2
votes
2 answers

If two classes in java have generalization relationship, can the child only inherite some, not all, mehods of the parent class?

For example: I have customer class which has two child classes, which are guest class or signed-up users class. Customer class has username as an instance variable. Does guest class also have username as an instance variable? How about methods of…
Hiep
  • 109
  • 1
  • 2
  • 6
-5
votes
1 answer

Generalisation of function in Golang

I want to write a generic function which handles SQL queries. Sqlx module provides function StructScan(), which automatically scans results into struct fields. type Place struct { Country string City sql.NullString …
John Snow
  • 339
  • 4
  • 17
-5
votes
2 answers

Is it a right generalization association of an interface class

As the ttitle said, im asking if is this a good programmation/design way. I got a class, that can be just an Interface (only got 1 abstract method and few attributes) As a example of my case, this is similar: We got a main class Car than could be a…
1 2 3
8
9