Convert dictionary key to object name in Python

I've got a dictionary whose keys are country names, and its values are an object of the class Country, which has several attributes (population, area, etc.). For example: {"Chile":Country(17000000,124234,...)} However, when I try to reach a countr...
more »

2017-10-04 23:10 (0) Answers

How to remove `duplicates' in list of instances

I have a list of instances of a certain class. This list contains `duplicates', in the sense that duplicates share the exact same attributes. I want to remove the duplicates from this list. I can check whether two instances share the same attributes...
more »

2017-10-04 16:10 (2) Answers

ER diagram covert to Class Diagram

I have drawn the ER diagram. I have attached the images below please see the image ER diagram of Defect management system [1]: This is a class diagram which I tried my self. I have attached the image below I do...
more »

2017-10-04 07:10 (0) Answers

How do I cycle through images in Tkinter?

I want to have the button's image cycle through all possible pizza images, but instead it throws the following error when I click on it: self.config(image=next(self.images)) AttributeError: 'buttonInitialize' object has no attribute 'config' Here'...
more »

2017-10-04 04:10 (1) Answers

NodeJS async/await class mysql/mariadb

I tried to something I thought would be simple using: nodejs 8.6, MariaDB, MySQL2/promise and classes. But it does not work: Here is the simple example: const mysql = require('mysql2/promise'); class mySQLClass { constructor() { this....
more »

2017-10-04 00:10 (1) Answers

How class/object relationships implemented in PHP

hypernym-hyponym (supertype-subtype) relations between types (classes) defining a taxonomic hierarchy, where for a subsumption relation: a hyponym (subtype, subclass) has a type-of (is-a) relationship with its hypernym (supertype, superclass); ho...
more »

2017-10-03 20:10 (0) Answers

Wordpress's favicon with custom template

I'm building a website with wordpress and I'm struggling with the favicon. Here's the problem: let's say that, for some reason, you want to write your code in the backend (using the only static code, for example, if you need to add some php directly ...
more »

2017-10-03 17:10 (2) Answers

Get PHP class property from array

I have an array looking something like this: Array ( [0] => my_val_one [1] => my_val_two ) I then have an object looking something like this: stdClass Object ( [id] => 123123 [name] => my_name [m...
more »

2017-10-03 15:10 (2) Answers

C# static classes. How to improve the code?

As an ex-Matlab user, I have been finding it hard to work with classes because in Matlab I am not used to working with classes. Now, I have C# Winforms project, and it is working okay but I am feeling that it has code smells and has wrong design pat...
more »

2017-10-02 11:10 (1) Answers

C# how to reference the class from assembly

I wanna dynamic generate a Class,and use the class as T in List.But I can't make the dymanic Class as T in List,I need your help and give me some advice,or the article relation.Here is my way to finalize: I have generated a dynamic assemly.It contai...
more »

2017-09-29 14:09 (0) Answers