UML class diagram enum

They are simply showed like this: _______________________ | <<enumeration>> | | DaysOfTheWeek | |_____________________| | Sunday | | Monday | | Tuesday | | … | |_____________________| And then just have an association between that and your class.

Why was “Avoid Enums Where You Only Need Ints” removed from Android’s performance tips?

the original version of that document was just a bunch of prejudices. it’s been rewritten to only contain facts backed up by actual benchmarks, and it’s updated as the VM is updated. you can find the various benchmarks — plus some of the benchmarks we use to optimize the core libraries — at http://code.google.com/p/dalvik/.

Getting the max value of an enum

Enum.GetValues() seems to return the values in order, so you can do something like this: // given this enum: public enum Foo { Fizz = 3, Bar = 1, Bang = 2 } // this gets Fizz var lastFoo = Enum.GetValues(typeof(Foo)).Cast<Foo>().Last(); Edit For those not willing to read through the comments: You can also do … Read more

Why Python 3.6.1 throws AttributeError: module ‘enum’ has no attribute ‘IntFlag’?

It’s because your enum is not the standard library enum module. You probably have the package enum34 installed. One way check if this is the case is to inspect the property enum.__file__ import enum print(enum.__file__) # standard library location should be something like # /usr/local/lib/python3.6/enum.py Since python 3.6 the enum34 library is no longer compatible … Read more

Swift: Convert enum value to String?

The idiomatic interface for ‘getting a String’ is to use the CustomStringConvertible interface and access the description getter. Define your enum as: enum Foo : CustomStringConvertible { case Bing case Bang case Boom var description : String { switch self { // Use Internationalization, as appropriate. case .Bing: return “Bing” case .Bang: return “Bang” case … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)