Questions tagged [enumeration]

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

Use for enumeration types.

1894 questions
0
votes
2 answers

Python: Using the list length to increment the index of the enumerated dictionary

I am looping and enumerating a dictionary as following: for column, key, in enumerate(guid_material_dictionary.iteritems()): print column, key, len(key[1]) It gives the following output: 0 ('0GVHv3rDXBewxnxizHODe9', ['Steen',…
Claus
  • 119
  • 1
  • 12
0
votes
3 answers

Java enum in practice, bad code to improve

I want to improve my use of JDK 1.5 and stop using private static final String instead of enum. This is what seems to be recommended. But now my constant class looks like this : public class CEnum{ /** * @author JJA * date :…
jayjaypg22
  • 1,641
  • 5
  • 22
  • 41
0
votes
1 answer

Capture values from a TextField within a table cell

Scenario: Im passing in comma separated values to a table. 2 columns, one with the original value, one with a text field with the values populated inside. They are lined up so I can add/change values, and copy the changes to a string. I cannot…
Nevets17
  • 109
  • 1
  • 9
0
votes
0 answers

Swift, Add remove items in single transation

I'm having trouble with Swift arrays. I want to add and remove items from an array in a single transaction when I have the indexes of items to add or remove. array.insert(insertions.map({return (viewModels[$0], NSIndexPath(forRow: $0, inSection:…
Andrius Steponavičius
  • 8,074
  • 3
  • 22
  • 25
0
votes
2 answers

Scala Enumeration Compare Order

object CardNum extends Enumeration { type CardNum = Value; val THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE, TWO = Value } Above shows my enumeration. I want to compare the ordering of the enumeration such as…
Ginsan
  • 291
  • 1
  • 5
  • 13
0
votes
1 answer

Getting a huge list of files in ruby

I'm trying do some operations on a directory which contains nearly 20 million files, I tried Dir.glob, Dir.foreach and Dir.entries to no success. Is there anything similar to Csharp's Directory.EnumerateFiles in ruby which can enumerate a huge list…
Jeremy Mc
  • 119
  • 1
  • 10
0
votes
0 answers

Excel Interface implements enumeration

I am working on a class that implements an interface. I found a road block when I try to implement an enumeration. Is that possible? Example: IFruits Public enum enuFruits End enum Public Sub AddNewToCollection(ByVal TypeSelected as enuFruits) End…
Charlie
  • 101
  • 2
  • 16
0
votes
1 answer

scala Enumeration retrieving enum by withName when Value has argument

Say i have enum like this: object Enm extends Enumeration { val ONE, TWO, THREE = Value } and it's possible for me to get disired result by calling with name on it Enm.withName("ONE"), but if i have Value with argument, say: object Enm…
Dmitrii
  • 604
  • 2
  • 9
  • 30
0
votes
1 answer

Swift - map dictionary based on keys

Consider the dictionary : var dict : [String : String]! = ["12" : "This", "5" : "is", "52" : "a", "42" : "Test"] var keys = Array(dict.keys) var values : [String]! = [String]() for (_, key) in keys.enumerated() { …
Sreejith
  • 1,345
  • 13
  • 25
0
votes
1 answer

Extracting specific Data from a registry key when the name is unknown (USBSTOR)

I need to extract certain data from a registry key and output this data to separate files so that I can call another external program to perform functions on the output. I want to do this for all of the registry keys under…
Rich
  • 39
  • 2
0
votes
1 answer

UWP subclassed ComboBox control in C# for enum - Display

I've developed a subclassed ComboBox control in C#, UWP, for enum type properties. It works great! Almost all the time (... types). Problem surfaced when the type of the enum was Windows.UI.Text.FontStyle. The item selection still works right, but…
George
  • 1
  • 3
0
votes
2 answers

Collection was mutated while being enumerated crash with NSTableView, NSArrayController and NSThread

In my small Core Data application I have some NSTableView views binded with NSArrayController controllers in Entity mode. When I try to import some big amount of data to my table in background thread, after some successfully added imports (from…
Lukasz
  • 19,816
  • 17
  • 83
  • 139
0
votes
2 answers

How to get the total page of LINQ pagination

Based on this answer on how to apply paging on a list. I would like to extend this question of how can we get the total page of a list with a specific total collection of item per page? For example, suppose i have 50 items each page has 12 items.…
Shift 'n Tab
  • 8,808
  • 12
  • 73
  • 117
0
votes
4 answers

Check if enumeration contains multiple elements without throwing exception?

I want to check if an enumeration contains 0, 1 or 1+ elements. I want to avoid the overhead of enumerating the entire sequence, thus want to avoid Count(). I know Linq query SingleOrDefault() could be used for this purpose, but instead adds…
Kjell Rilbe
  • 1,331
  • 14
  • 39
0
votes
1 answer

How to enumerate json string in MVC Razor foreach loop?

I'm using SQL Server 2016 to return json data in a string field in my data set. I passed the json string to the model without any conversions. I want to enumerate my json string field in MVC razor like: @foreach (var notification in…
Rodney Hickman
  • 3,133
  • 11
  • 53
  • 83
1 2 3
99
100