tagged [iteration]
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
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...
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
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...
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...
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 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
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
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 ...
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...
Allowing iteration without generating any garbage
Allowing iteration without generating any garbage I have the following code in an object pool that implements the IEnumerable interface. ``` public IEnumerable ActiveNodes { get { for (int i =...
- Modified
- 23 May at 12:2
Existing LINQ extension method similar to Parallel.For?
Existing LINQ extension method similar to Parallel.For? > [LINQ equivalent of foreach for IEnumerable](https://stackoverflow.com/questions/200574/linq-equivalent-of-foreach-for-ienumerablet) The lin...
- Modified
- 23 May at 12:18
Best way to iterate over a list and remove items from it?
Best way to iterate over a list and remove items from it? I need to iterate over a `List` and remove items that answer a certain condition. I saw this answer ([https://stackoverflow.com/a/1582317/5077...
Python list iterator behavior and next(iterator)
Python list iterator behavior and next(iterator) Consider: So, advancing the iterator is, as expected, handled by mutating that same object. This being the case, I would expect: to skip every second e...
How to iterate over a JavaScript object?
How to iterate over a JavaScript object? I have an object in JavaScript: I want to use a `for` loop to get its properties. And I want to iterate it in parts (not all object properties at once). With a...
- Modified
- 13 Sep at 19:56
What is the perfect counterpart in Python for "while not EOF"
What is the perfect counterpart in Python for "while not EOF" To read some text file, in C or Pascal, I always use the following snippets to read the data until EOF: Thus, I wonder how can I do this s...
What is the fastest/safest method to iterate over a HashSet?
What is the fastest/safest method to iterate over a HashSet? I'm still quite new to C#, but noticed the advantages through forum postings of using a `HashSet` instead of a `List` in specific cases. My...
- Modified
- 26 Feb at 19:0
How to iterate through two IEnumerables simultaneously?
How to iterate through two IEnumerables simultaneously? I have two enumerables: `IEnumerable list1` and `IEnumerable list2`. I would like to iterate through them simultaneously like: If they don't con...
- Modified
- 28 Apr at 19:30
How to loop through key/value object in Javascript?
How to loop through key/value object in Javascript? now I want to create a `setUsers()` method that takes a key/value pair object and initializes the `user` variable. where data is like:
- Modified
- 17 Sep at 07:0
How to iterate through an ArrayList of Objects of ArrayList of Objects?
How to iterate through an ArrayList of Objects of ArrayList of Objects? Let say I have a class call `Gun`. I have another class call `Bullet`. Class `Gun` has an ArrayList of `Bullet`. To iterate thro...
Python: Adding element to list while iterating
Python: Adding element to list while iterating I know that it is not allowed to remove elements while iterating a list, but is it allowed to add elements to a python list while iterating. Here is an e...
How can I loop through a C++ map of maps?
How can I loop through a C++ map of maps? How can I loop through a `std::map` in C++? My map is defined as: For example, the above container holds data like this: ``` m["name1"]["value1"] = "data1"; m...
- Modified
- 1 Jan at 15:36
How to loop through array in jQuery?
How to loop through array in jQuery? I am trying to loop through an array. I have the following code: Am trying to get all the data out of the array. Can some one lead me in the right path please?
- Modified
- 12 Apr at 15:18
How to iterate through a list of dictionaries in Jinja template?
How to iterate through a list of dictionaries in Jinja template? I tried: In the template: ``` Key Value {% for dictionary in list1 %} {% for key in dictionary %}
- Modified
- 12 Oct at 21:11