220 questions
0 votes
0 answers
106 views
Godot (4.3) Windows Export issue, unexpected C# script behaviour
On Godot engine, I created a generator that throw on the map various references of objets, and compare if positions are available, It is entirely based on C# code and uses the classic windows export....
1 vote
1 answer
257 views
Simplest way in C# to defer task execution without synchronization context [closed]
Inside an async method in C#, I need to defer the execution (return the execution to the caller), and also to clear the synchronization context before proceeding with the execution. The statement ...
1 vote
1 answer
71 views
C# LINQ Deferred Execution and Nested Methods
I have written the following code: List<int> ints = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; int start = 0; int end = 5; int limit = 10; IEnumerable<...
0 votes
2 answers
73 views
Does Javascript have deferred collection APIs like .NET LINQ?
I know Javascript Array has map, filter and the like, and reduce can be used as a way merge them (though I really dislike the syntax, it does work). However, a simple example below can prove that it ...
0 votes
1 answer
58 views
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 = ...
0 votes
1 answer
157 views
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 ...
3 votes
1 answer
2k views
Performance impact of async vs defer in 3rd party script tag
How does the use of async and defer differ when considering the script execution after download and its impact on page performance? Async Blocks the parsing of the page when executed Executed as soon ...
0 votes
1 answer
170 views
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. <html> <head> </head> <body> <script id="sovrn-ad" async defer ...
0 votes
1 answer
33 views
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 ...
1 vote
2 answers
857 views
Defer, return and Argument evaluation in golang [duplicate]
package main import "fmt" // fibonacci is a function that returns // a function that returns an int. func fibonacci() func() int { a, b := 0, 1 return func() int { defer ...
1 vote
1 answer
2k views
Why should I call os.Exit at most once in the main function?
I started a new job and we've been instructed to use Ubers Go coding standards. I'm not sure about one of their guidelines entitled "Exit Once": If possible, prefer to call os.Exit or log....
2 votes
1 answer
75 views
Difference between `where` in the query object and `if` in the extension methods [closed]
I am studying LINQ. I don't know the difference between using if in extension method and using where in query object. The Console.WriteLine() results are the same, is there any difference in speed? If ...
2 votes
0 answers
692 views
defer - modify named return value vs non-named return value
Code func deferModifyReturnValue() int { x := 0 defer func() { x += 1 // executed before return, }() return x } func deferModifyNamedReturnValue() (x int) { defer func() { ...
3 votes
2 answers
562 views
What does "object is enumerated" mean in C#?
I've been reading lately articles and documentation about deferred execution, LINQ, querying in general etc. and the phrase "object is enumerated" came up quite often. Can someone explain ...
0 votes
1 answer
372 views
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 ...