1,910 questions
2
votes
1
answer
71
views
Edit Array issue with array of enums in Dymola
When editing an array of enumeration with unknown size in Dymola (2025x r1), it is possible for the user to set a value to the array which is not a vector:
type Catalogue = enumeration(A "A",...
1
vote
1
answer
83
views
Shallow copying enumeration iterator behavior in Python
I am trying to understand the behavior of iterators in Python, particularly when using the copy.copy() and copy.deepcopy() functions. I have the following script:
import copy
my_list = ["a",...
4
votes
2
answers
168
views
What is the difference between an enumeration constant and an enumerator?
In C17's final draft N2176,
in the 1st paragraph of 6.2.1 it says
member of an enumeration is called an enumeration constant.
in the 7th paragraph 6.2.1 it says
Each enumeration constant has scope ...
1
vote
0
answers
154
views
Four byte enum value comparison as signed integer, not as unsigned
In short, I think, Delphi compares four byte enumeration values as Integer (signed), not as Cardinal (unsigned), as opposed to the documentation:
Finally, if an enumerated type is declared in the {$...
0
votes
1
answer
45
views
LINQ - DataTable GroupBy Count Distinct
I am trying to join to tables together in vb.Net using linq to return the distinct count of the primary keys, and I can't quite seem to get the syntax
Here's the code to create the tables
Dim ...
0
votes
0
answers
56
views
How do I enumerate registry entries in powershell with wmi?
I'm trying to enumerate the registry valuenames in FirewallRules.
The code I have is not working, what is wrong with it?
$HKEY_LOCAL_MACHINE =2147483650
$Key = "SYSTEM\CurrentControlSet\Services\...
3
votes
2
answers
129
views
Enumerating all possible lists (of any length) of non-negative integers
I would like to generate/enumerate all possible lists of non-negative integers such that the algorithm will generate lists like the following at some point
[1]
[24542,0]
[245,904609,848,24128,350,999]
...
0
votes
2
answers
123
views
Converting an element of enum class type into its matching string
I have an enum class, I'm trying to create a function that will return a string of its matching enum class member.
For example if I have the following enum class:
enum class SignalState
{
red, ...
0
votes
0
answers
135
views
Can this Discrete Program Search have improved asymptotics in Haskell?
I've been researching how to use optimal evaluation to optimize Discrete Program Search and I arrived at a simple solution that seems to be really effective. Based on the following tests:
f 1001101110 ...
0
votes
1
answer
39
views
Collection.Count shows zero even though Collection.GetEnumerator.Current contains a reference after MoveNext()
Note: An answer in either VB.NET or C# will be fine. I have no preference for this Q&A.
I'm trying to test my networking code and I'm running into a very strange problem: the GatewayAddresses ...
0
votes
1
answer
1k
views
Typst Report-Style Enumeration
I would like to modify Typst's #enum function to number every paragraph within my document following a technical report style.
For example
+ Paragraph 1
+ SubParagraph 1
+ Sub-SubParagraph 1
+ ...
-1
votes
1
answer
90
views
How to call a Swift enum function to get string in objc?
I have this enum in Swift SDK, and need to print the description as a debug message.
@objc public enum ResultCode : UInt16 {
case noError = 0x0000
@objc public func description() -> String ...
1
vote
2
answers
160
views
static java reflection - enum of fields of a class (pre-compilation)
is there a type of reflection in Java that provides simply an enum of the fields in a class?
The information is, afterall, "precompilation-static". Why should it not be compiled into the ...
1
vote
1
answer
80
views
Is enumeration over custom union type possible? [duplicate]
Having a disjoint union type like this:
type yolo = | A | B | C
Is it possible in OCaml to iterate/enumerate over each possible value of type yolo without prior knowledge of how many/what these ...
0
votes
1
answer
62
views
Managing enumeration members in header files
In an application I am developing, there is a header file responsible for the entire functions of an ADC, let's call it adc.h.
Where there is an enumeration indicating the input PINs used in the ADC.
...
0
votes
2
answers
130
views
Enumerate unique multiples of numbers
Suppose we're given an array of positive numbers M, say [3, 5, 7] and we want to enumerate all numbers which are multiple of any one of them, less than some upper bound, say K, so in this case 0, 3, 5,...
-2
votes
1
answer
237
views
Delphi - Binary OR values from an enumerated type
I have a variable declared from an enumerated type. I would like to binary OR values from this enumeration to the variable.
type
TValues = (vValue1 = $01, vValue2 = $02);
procedure BinaryOR;
var
...
0
votes
3
answers
166
views
DropDownListFor selected value returns null in the Enum property Model on form POST in ASP.Net Core MVC
I have a form page with DropDownlistFor or select as below:
<select asp-for="LeaveType"
class="form-control" style="max-width:180px"
asp-items=&...
2
votes
0
answers
48
views
Seeking Efficient Enumeration Strategies for Graph Partitioning
I am currently working on a class project that involves partitioning a non-directed graph, possibly weighted, into p classes. The objective is to minimize the sum of the weights of the edges between ...
1
vote
1
answer
101
views
Trying to import csv string value, with variable within string? [duplicate]
I'm a bit stuck trying to use param values in a string, imported from within a CSV.
I've tried a few methods, and can't seem to enumerate the parameter within the string.
First of all I have a csv ...
-1
votes
1
answer
154
views
How do I get a list of possible names/values from System.Net.SecurityProtocolType [duplicate]
I wish to present a drop down list of the System.Net.SecurityProtocolType available on the server that the code is running from (The servers are different)
So I wish to do the working equivalent of
......
1
vote
1
answer
157
views
Efficient calculation of all permutations mapping a vector into another in Python?
Given two vectors, I would like to calculate (in Python) all permutations (as vectors of coordinates) which map the first vector into the second. The vectors are given as numpy arrays of the same ...
0
votes
1
answer
53
views
Enumerated with default value, but not name
public class Document {
@Id
@Column(name = "id")
@GeneratedValue
private Long id;
@Column(name = "type")
private Long subjectType;
@Column(name = &...
0
votes
1
answer
238
views
How do I setup my coroutine to go through each character's turn, one by one?
I am trying to set up a Turn-based combat system in Unity where I can step through each of the character's turns, and on the player's turn, get some input. I have heard coroutines & IEnumerators ...
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
62
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
110
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
554
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
500
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
70
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
232
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
130
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
281
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
733
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 ...
2
votes
2
answers
190
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
408
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
119
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
100
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
123
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
40
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
145
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
289
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
1
answer
111
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
264
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
31
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
31
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
91
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
756
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
367
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 ...
2
votes
3
answers
144
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 ...