Questions tagged [enumeration]
The process of enumerating values, for example from some collection.
1,899
questions
0
votes
0
answers
28
views
Python request.get function returning 404 on all directories even valid ones
I have created a port scanning and web directory enumerator (the directory enumerator is heavily inspired by one found on github), and it keeps returning with 404 when dirb responds 200 to the same ...
0
votes
0
answers
47
views
Python - Emumerating all possibilities of a list with duplicates in it [duplicate]
Hello there here's the problem :
I have this code :
from graphes import Graphe
def permutations(liste):
"""
Génère toutes les permutations d'une liste donnée.
Entrée:
...
0
votes
0
answers
18
views
When there are many hands in an image, what is Mediapipe's policy of enumerating them?
When there are many hands in an image, what is Mediapipe's policy of enumerating them? Say there are 4 hands in the image. They will be given numbers 0,1,2,3. which hand will be given which number, ...
0
votes
0
answers
43
views
Is there any way to override the name of enum in scala?
I am new to the Scala. I am sorry if it's just basic one.
I want to have a way where I can Override the enum name using any method.
object ErrorCode extends Enumeration {
type ErrorCode = Value
...
0
votes
1
answer
88
views
How to write a function defined for a subset of all enumeration values?
Suppose I've got enumeration A :
object A extends Enumeration { type A = Int; val A1 = 1; val A2 = 2; val A3 = 3 }
Also, I have a function defined only for A1 or A2 but not for A3.
def foo(a: A): Int ...
3
votes
2
answers
68
views
HashTable enumeration with unexpected results
This may be a dumb question so please be kind LOL. I'm trying to wrap my head around something I just ran into.
First
I have a HashTable that I can enumerate using the following:
$ht = [hashtable]@{&...
0
votes
1
answer
58
views
JAXB Maven plugin won't generate Java enum
I have the following snippet in my XSD file. I would expect that it generates a Java enum with the two elements STANDALONE and CONNECTED.
<xs:attribute name="Sample">
<xs:...
-1
votes
1
answer
25
views
How to define a type with enumerated strings in RELAX NG?
Still learning RELAX NG (wondering whether I should learn XSD instead), I got my element hierarchy mostly right, so I'm working on contents:
One element (Unit) uses an enumeration type (a fixed set of ...
5
votes
3
answers
182
views
Efficiently enumerate all subsets with difference constraints in R
I have a vector V of consecutive integers of length l , e.g., 1, 2, 3, 4, 5, 6, 7. I want to find all subsets of size k such that the difference between any two numbers in the subset can be no less ...
2
votes
1
answer
67
views
Assigning the same number to multiple enum members [duplicate]
If I assign the same number to the variables in the enum structure, which one will it call?
It varies according to the same number of values I give, 2 same value or 3 same value. Sometimes first ...
0
votes
1
answer
55
views
Have Description of Enum show as a tooltip in Razor page
I'm trying to have a tooltip show up in a dropdown consisting of enum values in a Razor page in a MVC application(see screenshot below). I see other posts referring to using the Title attribute so I ...
1
vote
1
answer
141
views
Pycharm gives a warning with an enum created using functional syntax
I am writing an enumeration using function-call (functional) syntax, like this:
from enum import Enum
Color = Enum('Color', ['RED', 'GREEN', 'BLUE'])
myColor = Color.RED
print(myColor)
The ...
0
votes
0
answers
25
views
How Can I find the subdomains of a specific domain or ip address In Java?
How can I find the subdomains of a specific domain without brute force using java.
I used the WhoisClient in my code but It gave me errors.
public static List<String> enumerateSubdomains(String ...
2
votes
2
answers
137
views
How to efficiently enumerate binary black-white trees, while accounting for symmetry?
Consider the following type of black-white binary trees:
data BW = Black BW BW | White BW BW | Leaf Nat
With the following equivalence relation:
∀ a b c d . Black (White a b) (White c d) == White (...
3
votes
2
answers
141
views
Validate csv by checking if enumeration columns contains any invalid coded values
We recieve many different csv files from external labs and centers. When recieving such a file, we first need to do some QA checks before further processing. So make sure the data is correct, at least ...
0
votes
1
answer
87
views
Is this design introducing Circular Dependency?
Supposed I have two types of customers - Regular and VIP. I would like to give discounts to them based on CustomerType and their attributes. I have following design in my mind:
class Customer {
...
0
votes
2
answers
55
views
How to store enums in external file and import in java code
How to store enum in separate file and import in java code. In the following code I have created enum for hostMessages. In that, it has more than 3000 errorcodes. So it is failing to compile. So I am ...
1
vote
1
answer
56
views
Is enumerating combinations of k values from k sets of n values each (one value from each set) polynomial time?
Suppose I am writing a program to enumerate all possible combinations of k values, where each combination contains one value from each of k sets. Each set has n values each.
The input to the program ...
-1
votes
2
answers
23
views
Creating Question Drill Down with Nested Enums
I have a view controller that will show users a "question drill down", where answering one question shows the next assigned question based on the previous answer. I'm trying to figure out ...
0
votes
1
answer
102
views
How can I find the least number of segments to get from start point to end point using Python?
So, I have start number, end number and a list of segments.
start = 10
end = 100
li = [(50, 60), (10, 20), (10, 40), (40, 60), (60, 80), (75, 95), (95, 100), (35, 45)]
And I need to find the least ...
2
votes
2
answers
115
views
Python: Solving "Generate Parentheses" with Backtracking --> Confused About stack.pop()
I am trying to understand the backtracking code below:
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
stack = []
res = []
def backtrack(openN, ...
0
votes
0
answers
17
views
How to get the name of an enumeration element in C++? [duplicate]
Is there any way to directly get the name of an enumeration element instead of its value.
For example:
enum months {Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec};
int main(){
months thisMonth = ...
0
votes
0
answers
44
views
Setting up secondary condition for exact cover problem
I understand and have coded the Knuth’s dancing link algorithm for the exact cover problem. What I have a problem with is setting up the options matrix, mainly secondary items.
The problem I am trying ...
0
votes
1
answer
50
views
Why do I get an enumeration error using xlwings to return the result of an Excel add-in function?
I have an Excel addin that has a formula I would like to use. I have xlwings update the spreadsheet with the formula and then get the value of the formula.
I have had numerous times where I have ...
-2
votes
3
answers
63
views
I want to use the indexes I got from enumerate() for slicing the word. I can't find how to do it [duplicate]
I am working with a word which is input by the user. Example: "where". I need to find the first vowel and start the word from it, and place the beginning of the word to the end.
First I want ...
0
votes
1
answer
27
views
Backchange enumeration mistakes
I have to change an array with an enumeration. It´s made of 0.0025 steps, but because of a methode I use it changes slightly. So it looks kind of like this:
[0, 0]
[0.002499989, 1]
[0.0049989, 2]
[0....
0
votes
1
answer
27
views
Can I apply enumeration to a schema element only in specific situations?
In my XML Schema, I have an element that looks like this:
<xs:element name="food">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded&...
1
vote
1
answer
73
views
Is there a compiler attribute to decrement enumerator-list values/enumeration-constants (in C)?
When you declare a enum, the constant values of the enumerator-list automatically increment. E.g.
typedef enum{
TEST0 = 0,
TEST_X, // automatically will be 1
TEST_Y, // ...will be 2
...
}test_t;
...
0
votes
1
answer
268
views
Test-NetConnection behaves differently in one specific port
I'm currently finishing the Try Hack Me's "Hacking with Powershell" room. In the last challenge, you are supposed to write a script to find all open ports within a range [130-140]. Here is ...
1
vote
1
answer
132
views
Python string matching to a string in a list on indices and return a value in the list based on most matches
I am passing a string argument into a function that I want to match as closely as possible to an item in a list. The layer of complexity added here is that the argument and items in the list will all ...
0
votes
0
answers
17
views
Mpping each enum type to each columns using jpa entity
This is my Entity.
@Entity
public class Student{
...
@Column
private boolean english;
@Column
private boolean math;
...subject
}
I want to manage subect using enum.
so, I create it.
...
2
votes
2
answers
61
views
Better way to rotate index back to first element in `for` loop with enumerate() in Python
I hope more experienced users in Python will be able to help me make this more efficient:
If I need cyclic operations, for example if the last element of an array needs to be connected to the first ...
0
votes
2
answers
128
views
Processing large strings only a lot of numbers in C#
We need to process a lot of strings, which contain many numbers (formatted as strings) and are separated by an arbitrary character.
Ex: numbers separated by a space:
var s = "1234.555 43434.43 ...
0
votes
0
answers
223
views
I got this Error when i try to install reNgine, any Suggest?
when I try to install reNgine recon tool, it always stops at (32/51) and gives me this error, I tried searching for it but no luck
failed to solve: executor failed running [/bin/sh -c GO111MODULE=on ...
0
votes
1
answer
158
views
How to set additional values on model for Enum values?
I'm brand new to the ASP.NET MVC world.
I'm working on an MVC widget in Sitefinity. It is to create an alert on the page. Below is how the View looks. It's all built with Bootstrap 5 on the front end.
...
0
votes
2
answers
54
views
Nested If to LINQ and Lambda
Net 6.0
Our company uses a metric layout that takes records that look like this
AAA|0000A|000AA|0001A
AAA|0000A|000AA|0002A
AAA|0000A|000AB|0001B
AAA|0000A|000AB|0002B
AAA|0000B|000BA|0001A
AAA|0000B|...
0
votes
1
answer
60
views
Python - While Loop & Enumeration
I'm playing a bit with what I am learning:
Is there anyway to write a better code?
At the end of the program, if you are overweight, a list of month will appear with a schedule.
For example if you ...
1
vote
1
answer
45
views
Index Enumeration doesn't seem to be operating properly. Where am I messing up?
I'm trying to figure out how to enumerate an index properly into specified cells on an Excel spreadsheet using Python. Following a tutorial video, I thought I had it figured out, but it doesn't seem ...
2
votes
2
answers
54
views
Paired enumeration of two arrays [duplicate]
I have 2 arrays: I need to sort them in foreach to modify 1 file.
1 array with dbs name like:
$dbs = ['Honda', 'Toyota', 'BMW', 'Opel']
2nd array with their size like:
$dbsSize = ['123', '300', '222',...
2
votes
1
answer
247
views
Enumerating large powershell object variable (1 million plus members)
I'm processing large amounts of data and after pulling the data and manipulating it, I have the results stored in memory in a variable.
I now need to separate this data into separate variables and ...
0
votes
1
answer
38
views
Is there a way to get my for loop to work in all cases of this slice?
so what my code is essentially trying to do is return a total of all the numbers in a list, but not add numbers in the list that are between 6 and 9. Anyways, it took me a while but I found a solution ...
3
votes
1
answer
8k
views
Python match statement with enum
I'm trying to match "header" to one of the header types in my ENUM class. I've tried header to match Header.PROFILE_NAME, Header.PROFILE_NAME.name, Header.PROFILE_NAME.name. However none of ...
0
votes
0
answers
116
views
How to search data from enum file
I have a enum file name 'EmployeePosition' which contain 'position list' and i want to search here a position name. Is any way to search here name?
enum EmployeePosition:int {
case Manager = 1;
...
0
votes
0
answers
14
views
How can I add customer methods to ENUM to get string value of the value I am using (if needed) [duplicate]
I am creating an ENUM for some personal side project, and I wanted it to return the String value of each value if I desire to store the value as String variable in my code somewhere else.
for example:
...
0
votes
0
answers
42
views
Combinations algorithm without enumeration
here is how you generate combinations :
from itertools import combinations_with_replacement, combinations
list(combinations([1,2,3,4,5],r=3))
[(1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4), (1, ...
2
votes
2
answers
165
views
What is the difference between an "enumeration type" and an "enumerated type" in C++?
The Standard "apparently" defines "enumeration type" in [dcl.enum]/1. The term "enumerated type" is defined here.
1
vote
1
answer
418
views
Additional field to enum members in Python
I would like to use enum mechanism properly on Python side. There is a fantastic example for django because the text feature of enum items can be changed without touching enum mechanism. However, I am ...
-2
votes
1
answer
125
views
SyntaxError: invalid syntax | list comprehension on enumerated on list [closed]
I am trying to run list comprehension on enumerated list but is gives syntax error. here is the code sample that I am trying to run.
list1 = [1,2,3,4]
print([(x,y) for x,y in enumerate(list1)])
Error:...
0
votes
2
answers
104
views
Is it proper to use an enumeration in this way?
I'm making an android game in Kotlin and I'm wondering about the use of my enumeration.
It looks like this:
package com.example.makemoremeat.enumerations
import com.example.makemoremeat.R
enum class ...
0
votes
1
answer
226
views
Enumerating Child Classes for Selection
I am making an editor tool that allows me to add parts to instances of scriptable-object class I've made. I use a generic method to add the new parts:
[CreateAssetMenu]
class Whole : ScriptableObject {...