enumerate

How to search for .xml files within project files in Silverlight

I want to search for files with .xml extension within my silverlight project, for example (ApplicationRoot)/Resources/102.xml I know how to do this using System.IO.Directory: // create a collection to hold the file enumeration List<string> directoriesInFolder = new List<string>(); // using the file api to enume...

Python: Unpacking an inner nested tuple/list while still getting its index number

I am familiar with using enumerate(): >>> seq_flat = ('A', 'B', 'C') >>> for num, entry in enumerate(seq_flat): print num, entry 0 A 1 B 2 C I want to be able to do the same for a nested list: >>> seq_nested = (('A', 'Apple'), ('B', 'Boat'), ('C', 'Cat')) I can unpack it with: >>> for letter, word in seq_nested: pr...

enumerate()-ing a generator in Python

I'd like to know what happens when I pass the result of a generator function to python's enumerate(). Example: def veryBigHello(): i = 0 while i < 10000000: i += 1 yield "hello" numbered = enumerate(veryBigHello()) for i, word in numbered: print i, word Is the enumeration iterated lazily, or does it slurp ...

Accessing later index in array using enumerate(array) Python

hey guys, how would you access an array from array[n] in an array of 100 floats in this for loop (i need the enumerate): for index,value in enumerate(array): #do stuff with array[n] n=n+1 im trying to make it so that it operates in a smaller and smaller space each iteration.. thanks ...

Latex - skip numbering in an enumerate environment

I would like to skip numbering in a Latex enumerate environment to generate lists as follows: (1) Item 1.. (2) Item 2.. (5) Item 5.. (6) Item 6.. and so on. The Latex code is auto-generated, so ideally, I would like to insert "silent" \item-s in the environment, so that they will keep track of the numbering but nothing will appear ...

latex enumerate custom numerical order

are there any simple: almost a single liner latex commands to make enumerate count in a weird order for instance that of a homework assignment? Ex. 1, 5, 6, 9, 10, 13, 16 ...

How to iterate initialized enumerated types with Delphi 6 and avoid the "out of bounds" error?

I am using Delphi 6 Professional. I am interfacing with a DLL libraty that declares an enumberated type as follows: TExtDllEnum = (ENUM1 = $0, ENUM2 = $1, ENUM3 = $2, ENUM4 = $4, ENUM5 = $8, ENUM6 = $10); As you can see the initialized values are not contiguous. If I try to iterate the type using a for loop as follows: var e: T...