Questions tagged [deferred-execution]

219 questions
1
vote
3 answers

iterating over a Where'd collection

I think this is a defered execution issue, but maybe i am missing the point somewhat I have a loop thus List processed = new List() foreach(KeyValuePair tbl1 in tables.Where(z=>!processed.Contains(z.Key))){ //do some…
nat
  • 2,185
  • 5
  • 32
  • 64
0
votes
1 answer

Queue Function Without CRON or Shell

I am developing a system with Symfony which has a notification module integrated into it. The purpose of the script is to allow for a wide range of compatibility, and as such the requirements would leave cron, root & shell out of the…
viablepath
  • 307
  • 2
  • 3
  • 13
0
votes
2 answers

Deferred execution value unchanged

Say I have IQueryable cars. I iterate it such as: foreach (Car c in cars) { c.Doors = 2; } Why does c.Doors contain the original value after the foreach, instead of the changed value? Thank you in advance
Dante
  • 3,833
  • 4
  • 38
  • 55
0
votes
1 answer

Server-side execution of Entity Framework Query combined with Stored Procedure

Is it possible to call a StoredProcedure from an ObjectQuery? Basically I want to dynamically build a query and execute it server-side. You can imagine each query to be part of a search where you can combine different criteria with "and" or "or". It…
0
votes
2 answers

defer loading of JS libraries AND several document ready functions

i managed to defer loading of JS libraries and also one document ready function, following this post Possible to defer loading of jQuery? However, I have multiple document ready functions that are placed in the page by different modules (and not on…
0
votes
0 answers

How to adjust and execute Ant task from BeanShell script?

I have large jar task in my ant build file. But I don't want to execute it immediately. I want to add some filesets to the task and only than execute it. I don't want to define the jar task completely in the script. How to do that? I've tried…
alehro
  • 2,198
  • 2
  • 25
  • 41
0
votes
1 answer

LINQ deferred execution when updating a property

I have the following C# code: #nullable enable using System; using System.Collections.Generic; using System.Linq; public class Program { public static void Main() { var userNames = new List{"Jon Doe", "Jane Doe"}; …
Pelle Stenild Coltau
  • 1,268
  • 10
  • 15
0
votes
1 answer

Implementation of DeferredFirstOrDefault to execute SQL queries in batch with multiple result sets

I'm working on my own DeferredFirstOrDefault() implementation. I want it to get an IQueryable and append FirstOrDefault() method to its expression tree. Using the new Expression i want to create a new IQueryable which will have a call to…
0
votes
1 answer

Dynamic script tag not loading, can't see network traffic for it

This code doesn't seem to load dynamically. Am I doing something wrong? Is there a better way.
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
0
votes
1 answer

Execute a collection of tasks int the order they where add to a list in batchs

I am wondering if anyone can help me, I am trying to get my head around how to execute concurrent tasks in batches and apologies if it is a silly question. However, I can only get them to execute all at the same time. I created a class below which…
0
votes
1 answer

JavaScript: Using the defer attribute with library files

I know that there is a lot of discussion on the defer and async attributes, but I would like to clear up the correct usage in modern browsers. If I want to include a library file on which the second script depends, I gather that async is no good. To…
Manngo
  • 14,066
  • 10
  • 88
  • 110
0
votes
1 answer

Stop time.NewTimer initialized inside for loop

I have a program similar to below program: package main import ( "fmt" "time" ) func main() { ch := make(chan string) go endProgram(ch) printFunc(ch) } func printFunc(ch chan string) { for { timeout :=…
Abhay Gupta
  • 786
  • 12
  • 30
0
votes
1 answer

Is my C#.NET LINQ expression optimized for deferred execution (Entity Framework Core)

I am building a REST API using C#.NET for a customer, which will be used to retrieve error logs from a database. The database has three tables: Fault, Message and MessageData. The relation of the tables are as follows: Fault <---* Message <---1…
0
votes
2 answers

Getting Count() with deferred execution and lazy loading

I have some code that uses deferred execution and lazy loading: public static IEnumerable GetStreamElementP(string fileId, ListProgressEventHandler progressHandler, int total) { var filePath =…
Andy B
  • 101
  • 1
  • 8
0
votes
1 answer

Am I enumerating my IEnumerable n times?

I am fairly comfortable with LINQ in c#, but am lost on whether or not my foreach loop is causing excessive enumeration. Assuming the following code snippet is run, var listOfStuff = new List { new CustomObject { Id = 1, Cost = 20M…
BakeryD
  • 3
  • 3