Click here to Skip to main content
15,886,835 members
Home / Discussions / C#
   

C#

 
QuestionC# EPPlus How to hide range of columns Pin
Mou_kol24-Jan-22 2:01
Mou_kol24-Jan-22 2:01 
AnswerRe: C# EPPlus How to hide range of columns Pin
Richard Deeming24-Jan-22 2:58
mveRichard Deeming24-Jan-22 2:58 
AnswerRe: C# EPPlus How to hide range of columns Pin
Victor Nijegorodov24-Jan-22 3:50
Victor Nijegorodov24-Jan-22 3:50 
QuestionHow would you describe what an IEnumerable is to a bright student of C# Pin
BillWoodruff22-Jan-22 2:34
professionalBillWoodruff22-Jan-22 2:34 
AnswerRe: How would you describe what an IEnumerable is to a bright student of C# Pin
jschell23-Jan-22 7:25
jschell23-Jan-22 7:25 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
Richard Deeming23-Jan-22 21:59
mveRichard Deeming23-Jan-22 21:59 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
BillWoodruff25-Jan-22 3:23
professionalBillWoodruff25-Jan-22 3:23 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
jschell30-Jan-22 6:37
jschell30-Jan-22 6:37 
BillWoodruff wrote:
if there's a cheap way to use virtual memory with IEnumerable



Large data sets still end up going to disk since "virtual memory" in the traditional sense uses the disk to get that memory.

That is why for example even though a binary sort might "seem" fast if you attempt it on a large data set that requires disk paging it not going to work. See heap sort instead.

Actions on large data sets which involve disk access always require careful design. They can't be fixed by implementation (where implementation precludes design.)

So for example that is why one must carefully consider what indexes database tables should use.
And if one is going to return a sorted list to a UI which originates from a database then from the very first design the API should have paging in it. I have seen silly designs for decades (now and then) where the UI falls over because the developer designed a UI report and tested it for 20 entries and now the major customer using it has 20 million entries. And the UI was set up to sort it in memory.


As for IEnumerable you can of course back it with anything. So for example the implementation can use a database paged query. The call to the exposed methods track the point where the last chunk was grabbed in the database and it returns the next chunk and then feeds from a chunk until that one is empty. That doesn't fix the count problem because there is no way to expose the count in the first place. So you would need to use another interface. You can of course use a double interface and then in the calling code it would need to cast to get the top level which has a count. The backing implementation would then provide the count in a better way than using the IEnumerable iterator.

But of course there are often other design problems with solutions like the above.
1. They assume that the count is a absolute. With large datasets the data very likely will be in transition. By the time you get to the end there could be more or less than the original count.
2. They right UIs with expectation that users are stupid and don't know how to do their job. So that example above with 20 entries and no other way to search becomes absolutely useless when there are 20 million entries even if it is paged. It should always have search criteria.
AnswerRe: How would you describe what an IEnumerable is to a bright student of C# Pin
#realJSOP24-Jan-22 23:44
mve#realJSOP24-Jan-22 23:44 
AnswerRe: How would you describe what an IEnumerable is to a bright student of C# Pin
endo funk26-Jan-22 5:31
endo funk26-Jan-22 5:31 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
Gerry Schmitz26-Jan-22 6:13
mveGerry Schmitz26-Jan-22 6:13 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
endo funk26-Jan-22 9:40
endo funk26-Jan-22 9:40 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
Gerry Schmitz27-Jan-22 16:58
mveGerry Schmitz27-Jan-22 16:58 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
endo funk27-Jan-22 19:35
endo funk27-Jan-22 19:35 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
Gerry Schmitz28-Jan-22 5:50
mveGerry Schmitz28-Jan-22 5:50 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
endo funk28-Jan-22 6:40
endo funk28-Jan-22 6:40 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
Gerry Schmitz28-Jan-22 7:29
mveGerry Schmitz28-Jan-22 7:29 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
endo funk28-Jan-22 8:46
endo funk28-Jan-22 8:46 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
BillWoodruff26-Jan-22 23:52
professionalBillWoodruff26-Jan-22 23:52 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
BillWoodruff26-Jan-22 23:39
professionalBillWoodruff26-Jan-22 23:39 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
endo funk27-Jan-22 6:44
endo funk27-Jan-22 6:44 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
BillWoodruff27-Jan-22 23:44
professionalBillWoodruff27-Jan-22 23:44 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
endo funk28-Jan-22 2:11
endo funk28-Jan-22 2:11 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
jschell30-Jan-22 7:08
jschell30-Jan-22 7:08 
GeneralRe: How would you describe what an IEnumerable is to a bright student of C# Pin
endo funk30-Jan-22 14:22
endo funk30-Jan-22 14:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.