Questions tagged [enumeration]

The process of enumerating values, for example from some collection.

Use for enumeration types.

1894 questions
0
votes
1 answer

Good practice with equalities for non-class enums (rvalues on left?)

I work in an environment that is slowly updating old c to c++. Frequently non-class enums are used within equality statements. Now I'm sure anyone who has taken a programming course or read a book which covers good practice knows that equalities…
mreff555
  • 1,049
  • 1
  • 11
  • 21
0
votes
1 answer

Enumeration handle names issue

I found a way to enumerate other programs handles, but I have problem now. I can not see Process type threads. I need to check which programs open handles for my process. When I check the output, it is "unnamed", I don't know how to fix it. Should…
ismet JM
  • 21
  • 1
  • 9
0
votes
1 answer

Enumerate handles

Im trying to enumerate everyprocess handles and willing to get their name some of them retrives unnamed. How can I fix this? When I check it with process hacker or process explorer they can take that unnamed handles name. int wmain(int argc, WCHAR…
ismet JM
  • 21
  • 1
  • 9
0
votes
0 answers

subclass ctypes.c_int to create an enum to use in ctypes.Structure._fields_

Thats what i came from at first place: class DismRestartType(DismEnum): DismRestartNo = 0, 'No Restart' DismRestartPossible = 1, 'Restart Possible' DismRestartRequired = 2, 'Restart Required' and using it like: class…
FalloutBoy
  • 964
  • 1
  • 9
  • 22
0
votes
1 answer

Use/select enumeration values in DXL DOORS

I tried to use somekind of condition of another attribute object to set the attribute with pre-set enumeration values {"", "1","2","3"}, something like: if ( o."attr1" = "AA" ) { o."enumeratedAttr" = "1" } else if (o."attr1" = "BB" ) { …
0
votes
1 answer

Elixir reducing a list and adding to a map

I am trying to reduce a list and add some data into a map. The code is something like this: map = Enum.reduce(1..1000, %{}, fn(x, accumalator) ->( calculate a hash of a string if condition is fulfilled do …
praxmon
  • 5,009
  • 22
  • 74
  • 121
0
votes
1 answer

AutoMapping Enumeration Class

I'm experimenting with using enumeration classes (link) instead and enums and "lookup tables". I have this scenario which displays a simple list in my view where I want to display the TaskStatus name from the enumeration class instead of the…
Tim
  • 81
  • 3
  • 11
0
votes
1 answer

Enumeration interface. Default methods implementation

Good evening, consider the following: public class TestEnum implements Enumeration { private Enumeration files; private TestEnum(Vector files) { this.files = files.elements(); } public Enumeration getFiles() { …
Maksim
  • 351
  • 1
  • 2
  • 12
0
votes
1 answer

Elixir/Phoenix enum through tuple to replace paths

I'm parsing some HTML with Floki. And receive the following tuple: {"html", [{"lang", "en"}], [{"head", [], [{"title", [], ["My App"]}, {"link", [{"rel", "stylesheet"}, {"href", "/css/app.css"}], []}]}, {"body", [], [{"main", [{"id",…
Ilya
  • 1,120
  • 1
  • 12
  • 33
0
votes
0 answers

how to create dynamic enum and how to access that enum value directly

how to create dynamic enum and how to access that enum value directly. Problem example: enum Test{ RED, GREEN } now i want to add Enum value BLUE dynamically and want to access it like Test.BLUE kindly suggest solution.
0
votes
3 answers

How to replace a Hash's key names with the values from a separate array?

I have a hash, e.g.: hash = {field1: 'name', field2: 'street1', field3: 'street2', field4: 'city'} and I would like to replace all of the key names with the values I have in a separate array, e.g.: array = [:address1, :address2, :address3,…
jbk
  • 1,911
  • 19
  • 36
0
votes
2 answers

increment number in reddit python bot reply

I'm trying to make a bot that increments a number every time someone mentions a string. So far I can only get it to increment once and every other reply stays at the same number. It is declared at 2017, but will only reply with 2018 when it finds a…
bills
  • 59
  • 9
0
votes
1 answer

Enum Class in ES6 - Sintax Error

I was looking for a good solution to use Enumeration in ES6. I've found the following JS library below. But I'm getting some error related to the ES6 syntax for this code. Source…
0
votes
1 answer

Given a dictionary, getting all possible sub-dictionary configurations possible

I am having the following difficulty: Given my input dictionary with 4 keys and their values e.g. global_dict = {'Cloudy': (False, True), 'Rain': False, 'Sprinkler': (False, True), 'WetGrass': (False,…
0
votes
1 answer

Elixir/Phoenix exit the loop

I have two lists with maps: apps = [%{name: "app1", version: "0.0.1"}, %{name: "app2", version: "0.0.1"}] updates_list = [%{name: "app1", version: "0.0.2"}, %{name: "app2", version: "0.0.1"}, %{name: "app3", version:…
Ilya
  • 1,120
  • 1
  • 12
  • 33