delayed-execution

Compare using Thread.Sleep and Timer for delayed execution

I have a method which should be delayed running for a specified amount of time. Should I use Thread thread = new Thread(() => { Thread.Sleep(millisecond); action(); }); thread.IsBackground = true; thread.Start(); Or Timer timer = new Timer(o => action(), null, millisecond, -1); I had read some articles about using Thread.S...

Delaying execution of PHP script

What is the best way to stop bots, malicious users, etc. from executing php scripts too fast? Is it ok if I use the usleep() or sleep() functions to simply do "nothing" for a while (just before the desired code executes), or is that plain stupid and there are better ways for this? Example: function login() { //enter login code here } ...

c# reliable delayed/scheduled execution best practice

The project I am working on requires some executions to be done at a certain time. I am not sure what would be the best way to deal with this situation. The method must be able to survive server restart/maintenance. And method calls must be programmatically. I am considering going down this path: I could have a table in database (or ev...

Force an IQueryable to execute?

I have a method that 'has no translation to SQL' that I want to perform on an IQueryable, is there a way to force the IQueryable to execute without having to store it in some intermediate class? ...

Delayed loading for large queries

A pleasant user experience requires a page to load very fast. This can be difficult when there is a large query taking place or when a web service is being used. I deally, the entire page should be loaded first with loading images everywhere a cumbersome task takes place. In ASP.NET, this can be accomplished using update panels and a 1...

How can I make sure my LINQ queries execute when called in my DAL, not in a delayed fashion?

I have a DAL that is composed of a bunch of methods that perform LINQ queries on my database. How do I ensure that before returning say an IEnumberable or something similar from the database, I ensure that the LINQ query is execute then, not in some delayed fashion only to be executed when the result is used? I know I can call .ToList(...

Iphone delayed execution of code

Dear All, [I just posted a similar question, but I'm not sure whether is actually got posted. Editor: please remove if this is a double post.] The app that I'm writing has quite some code in the appdelegate's "applicationDidFinishLaunching" and a ViewController's "viewDidLoad". All of this code is executed before the user can start do...

Force Linq to not delay execution

In fact, this is the same question as this post: how-can-i-make-sure-my-linq-queries-execute-when-called-in-my-dal-not-in-a-delay But since he didn't explain why he wanted it, the question seems to have been passed over a bit. Here's my similar-but-better-explained problem: I have a handful of threads in two types (ignoring UI thread...

Is there a way to stop MYSQL Delayed Inserts from the MySQL configuration?

Hi guys, I got stuck with a weird issue with one of our servers. I see there are delayed mysql inserts +--------+----------------+-----------+------------------+----------------+------+--------------------+------------------------------------------------------------------------------------------------------+ | Id | User |...

Executing ajax code after a few seconds of inactivity from the user

Hey folks, I'm new here so please go easy on me. This is somewhat of a confusing situation. :) I'm working on a search input in which a user enters a name of another user (or part of a name) in a search text box and then a list of users matching that search string is returned. The problem is that it is a bit slow when there are tens...

NServiceBus Delayed Message Processing

I have an NServiceBus application for which a given message may not be processed due to some external event not having taken place. Because this other event is not an NSB event I can't implement sagas properly. However, rather than just re-queuing the message (which would cause a loop until that external event has occurred), I'm wrappi...

Delay Loading DLLs

Hi I am in desperate need of help, I need to manage an application dependency in Visual Studio. The application links to a DLL only on a specific version of windows, lets say Windows 7. and on other environments, the DLL should not be loaded. How will I be able to achieve that using DLL Delay Loading as this topic is completely new to m...

Why my iPhone app has a delayed loading?

I noticed some iPhone apps give you the title screen instantly. Then there are some apps that gives you a black/blank screen for a brief moment. I have the latter issue, but its lasting about 2 seconds. I would like to display a PNG image (over 200 KB size) and a loading indicator view. My app is based on UIView. The specified a custom...

jQuery passing a function call through to another function and order of execution

I have this javascript: triggerAnimation(listItem,toggleToggleRadioListItem(listItem)); function triggerAnimation(listItem,passThruFunction){ listItem.find(".inlineLoading").show(); // pause and then call the toggle function $("body").animate({opacity: 1}, 1000, function(){ alert("a"); passThruFunction; } ...

What are the most time consuming checks performed by .NET when executing a managed appplication?

I've developed a .NET based Windows service that uses part managed (C#) and unmanaged code (C/C++ libraries). In some domain environments (e.g. Win 2k3 32bit server inside domain abc.com) sometimes the service takes more than 30 seconds to start (especially on OS restart), thus failing to start the service. I suspect that it has somethi...

JQuery Animate Delay Problems

Below is the HTML & JQuery code I have: HTML I have: <div class="announcement"> <img id="imgBanner" style="cursor: pointer;" onmouseover="showPopup();" /> </div> <div id="divArrow" class="arrow"> <img id="imgExpandContract" style="cursor: pointer;" alt="Arrow" border="0"onmouseover="showPopup();" /> </div> <div id="window"> ...

PLINQ delayed execution

I'm trying to understand how parallelism might work using PLINQ, given delayed execution. Here is a simple example. string[] words = { "believe", "receipt", "relief", "field" }; bool result = words.AsParallel().Any(w => w.Contains("ei")); With LINQ, I would expect the execution to reach the "receipt" value and return true, without ex...

Linq to Sql DB Object to Domain Object mapping and performance

I'm having a problem trying to make my LINQ to SQL queries and the mapping to my domain objects DRY without incurring the cost of multiple round trips to the db. Given this example: var query1 = from x in db.DBProducts select new MyProduct { Id = x.ProductId, Name = x.ProductName, ...

Why does the interpreted order seem different from what I expect?

I have a problem that I have not faced before: It seems that the order of interpretation in my program is somehow different from what I expect. I have written a small Twitter client. It takes a few seconds for my program to actually post a tweet after I click the "GO" button (which can also be activated by hitting ENTER on the keyboard)...

Emails sent using Flex app are delayed

I'm currently building an application in Flex that utilizes SMTP Mailer to automatically send out emails to the user when a particular condition is satisfied. The application checks this condition every 30 seconds. The condition is satisfied based on new records being returned from a database table. The problem is as follows: When the ...