tagged [iteration]
C# or VB.NET - Iterate all Public Enums
C# or VB.NET - Iterate all Public Enums We have a common component in our source which contains all the enums (approx 300!) for a very large application. Is there any way, using either C# or VB.NET, t...
iterating on enum type
iterating on enum type > [How do I enumerate an enum?](https://stackoverflow.com/questions/105372/how-do-i-enumerate-an-enum) I don't know if it is possible to do what I want to do, but I think why ...
Iterating a dictionary in C#
Iterating a dictionary in C# ``` var dict = new Dictionary(); for (int i = 0; i
- Modified
- 23 May at 11:46
How do I iterate through each element in an n-dimensional matrix in MATLAB?
How do I iterate through each element in an n-dimensional matrix in MATLAB? I have a problem. I need to iterate through every element in an n-dimensional matrix in MATLAB. The problem is, I don't know...
- Modified
- 5 May at 06:46
How do I access properties of a javascript object if I don't know the names?
How do I access properties of a javascript object if I don't know the names? Say you have a javascript object like this: You can access the properties by the property name: But is it possible to get t...
- Modified
- 25 Apr at 22:23
How to iterate through range of Dates in Java?
How to iterate through range of Dates in Java? In my script I need to perform a set of actions through range of dates, given a start and end date. Please provide me guidance to achieve this using Java...
Java HashMap: How to get a key and value by index?
Java HashMap: How to get a key and value by index? I am trying to use a HashMap to map a unique string to a string ArrayList like this: Basically, I want to be able to access the keys by number, not b...
Is there a way to iterate over a dictionary?
Is there a way to iterate over a dictionary? I know `NSDictionaries` as something where you need a `key` in order to get a `value`. But how can I iterate over all `keys` and `values` in a `NSDictionar...
- Modified
- 11 Jun at 12:44
How to iterate over a string in C?
How to iterate over a string in C? Right now I'm trying this: ``` #include int main(int argc, char *argv[]) { if (argc != 3) { printf("Usage: %s %s sourcecode input", argv[0], argv[1]); } el...
Iterate over object attributes in python
Iterate over object attributes in python I have a python object with several attributes and methods. I want to iterate over object attributes. I want to generate a dictionary containing all of the ob...
- Modified
- 22 Oct at 19:23
Getting next element while cycling through a list
Getting next element while cycling through a list When this reaches the last element, an `IndexError` is raised (as is the case for any list, tuple, dictionary, or string that is iterated). I actually...
Is if(items != null) superfluous before foreach(T item in items)?
Is if(items != null) superfluous before foreach(T item in items)? I often come across code like the following: Basically, the `if` condition ensures that `foreach` block will execute only if `items` i...
Reverse Sorted Dictionary in .NET
Reverse Sorted Dictionary in .NET Is there any way I can iterate backwards (in reverse) through a SortedDictionary in c#? Or is there a way to define the SortedDictionary in descending order to begin ...
- Modified
- 11 Jun at 10:17
How to loop through an array containing objects and access their properties
How to loop through an array containing objects and access their properties I want to cycle through the objects contained in an array and change the properties of each one. If I do this: ``` for (var ...
- Modified
- 2 May at 08:19
Why isn't IEnumerable consumed?/how do generators work in c# compared to python
Why isn't IEnumerable consumed?/how do generators work in c# compared to python So I thought I understood c# yield return as being largely the same as pythons yield which I thought that I understood. ...
How to modify a foreach iteration variable from within foreach loop?
How to modify a foreach iteration variable from within foreach loop? When I try to do this... ...I get `Cannot assign to 'item' because it is a 'foreach iteration variable'`. Still, I'd
- Modified
- 17 Oct at 15:27
Iterate over C# dictionary's keys with index?
Iterate over C# dictionary's keys with index? How do I iterate over a Dictionary's keys while maintaining the index of the key. What I've done is merge a `foreach`-loop with a local variable `i` which...
- Modified
- 2 May at 15:13
Iterate through properties of static class to populate list?
Iterate through properties of static class to populate list? I have a class of string constants, how can I loop through to get the string and populate a list-box? ``` static class Fields { static re...
remove html node from htmldocument :HTMLAgilityPack
remove html node from htmldocument :HTMLAgilityPack In my code, I want to remove the img tag which doesn't have src value. I am using object. I am finding the img which doesn't have src value and ...
- Modified
- 24 Aug at 19:31
How to iterate through enum type while skipping some values?
How to iterate through enum type while skipping some values? The key part of my question is the skipping. I plan to use an enum type that has about 20 elements. I want to iterate through this set but ...
How to modify or delete items from an enumerable collection while iterating through it in C#
How to modify or delete items from an enumerable collection while iterating through it in C# I have to delete some rows from a data table. I've heard that it is not ok to change a collection while ite...
- Modified
- 17 Jan at 15:42
Fastest way to iterate over all the chars in a String
Fastest way to iterate over all the chars in a String In Java, what would the fastest way to iterate over all the chars in a String, this: ``` String str = "a really, really long string"; for (int i =...
- Modified
- 17 Jan at 14:24
Why can't we assign a foreach iteration variable, whereas we can completely modify it with an accessor?
Why can't we assign a foreach iteration variable, whereas we can completely modify it with an accessor? I was just curious about this: the following code will not compile, because we cannot modify a f...
Does iteratee I/O make sense in non-functional languages?
Does iteratee I/O make sense in non-functional languages? In Haskell, [Iteratee based I/O](http://www.haskell.org/haskellwiki/Iteratee_I/O) seems very attractive. Iteratees are a composable, safe, fas...
Start index for iterating Python list
Start index for iterating Python list What is the best way to set a start index when iterating a list in Python. For example, I have a list of the days of the week - Sunday, Monday, Tuesday, ... Satur...