deferred-execution Questions

1

Solved

I have a question regarding deferred execution and the disposing of data. Consider the following example: private IEnumerable<string> ParseFile(string fileName) { using(StreamReader sr = n...
Stedmann asked 7/1, 2013 at 21:0

3

Solved

I have this function to repeat a sequence: public static List<T> Repeat<T>(this IEnumerable<T> lst, int count) { if (count < 0) throw new ArgumentOutOfRangeException("count"...
Palmirapalmistry asked 21/11, 2012 at 19:26

4

Solved

I have a function that accepts an Enumerable. I need to ensure that the enumerator is evaluated, but I'd rather not create a copy of it (e.g. via ToList() or ToArray()) if it is all ready in a List...
Risky asked 8/3, 2012 at 20:56

1

Solved

I discovered by experimenting that creating a timer with a duration of 0 allows me to defer work into the event queue. I really like this feature, because it allows avoiding a lot of nasty reentran...
Whitted asked 6/11, 2012 at 3:44

4

Solved

Given a very basic LINQ that is returned to a MVC view, at what exact point does the deferred execution fire? In the controller: public ActionResult Index() { var model = _fooService.GetAll(); ...
Ventriloquize asked 29/10, 2012 at 1:52

2

Solved

After running this code: var input = new List<T>( ... ); var result = input.Select( t => new U(t) ); U first1 = null; foreach ( U u1 in result ) if ( first1 == null ) first1 = u1; U f...
Equity asked 18/8, 2012 at 1:6

3

Solved

In a loop, I am trying to defer the comparison the two value()s of two Nodes to a later time. class Node(): def __init__(self, v): self.v = v def value(self): return self.v nodes = [Nod...
Fragrance asked 18/6, 2012 at 16:26

1

Solved

I'm working on a project that uses the new Web API and I noticed somebody is returning an IQueryable<T> from a Get method. My understanding is that IQueryable is useful for improving perform...
Pekin asked 9/4, 2012 at 17:49

1

Solved

I am trying to implement the jQuery Deferred.pipe() method for the following scenario: Add a user in DB via $.ajax() Get response whether user was added correctly or not. If successfully added, g...
Mammoth asked 7/5, 2011 at 13:11

1

Solved

I have a TabLayout panel with 2 tabs. I would like to programmatically select the 2nd tab and then scroll to a particular element within the tab. This is how my code looks like: public void scroll...
Dorkas asked 24/3, 2011 at 20:36

1

Solved

I have been doing some web application programming using GWT and have been confused by the term "browser event loop". I have encountered situations where I need to execute deferred commands and "d...
Franchot asked 24/3, 2011 at 21:35

2

Today I read about the defer statement in the Go language: A defer statement pushes a function call onto a list. The list of saved calls is executed after the surrounding function returns. De...
Hexastyle asked 3/2, 2011 at 8:17

2

Solved

I'm debugging in VS2010, and I want to inspect a string value but all I can get the debugger to show me (through watches, hovering, locals, etc.) is: "System.Linq.Enumerable+<TakeIterator>d_...
Epicarp asked 23/4, 2010 at 22:43

1

Solved

What is the difference between defer.execute() and threads.deferToThread() in twisted? Both take the same arguments - a function, and parameters to call it with - and return a deferred which will b...
Simplism asked 10/9, 2010 at 16:56

2

Solved

I have what could be seen as a bizarre hybrid of IQueryable<T> and IList<T> collections of domain objects passed up my application stack. I'm trying to maintain as much of the 'late que...
Thrashing asked 18/5, 2010 at 5:59

3

I have a normal Django site running. In addition, there is another twisted process, which listens for Jabber presence notifications and updates the Django DB using Django's ORM. So far it works as...
Azaleeazan asked 29/10, 2009 at 8:57

4

Solved

Suppose I have an IQueryable<T> expression that I'd like to encapsulate the definition of, store it and reuse it or embed it in a larger query later. For example: IQueryable<Foo> myQue...
Boondoggle asked 20/8, 2009 at 18:52

6

Solved

How could I implement my own deferred execution mechanism in C#? So for instance I have: string x = DoFoo(); Is it possible to perform some magic so that DoFoo does not execute until I "use" x?...
Cronyism asked 10/9, 2009 at 1:8

© 2022 - 2024 — McMap. All rights reserved.