In traditional embedded programming, we will give a delay function like so:
for(i=0;i<255;i++)
for(j=0;j<255;j++);
In the microprocessor's view, is this how the sleep() function works?
Is there an alternative for the sleep() function in C?
...
Can anyone send me javascript code on how I can construct a time delay from the time I click a button on a page to the time the function called by the button click is executed. I am a novice with javascript, and I have some code that performs a function when I click a button, and I just want to have a time delay. Thanks.
...
We have an ASP.Net app, that behaves strangely under IIS6. The app itself is straightforward ASP.Net 2.0 Webforms deal, nothing too weird is going on in there (there are couple HTTP Modules in the pipeline, but I wouldn't consider those weird :) ). The thing I don't understand is the page execution times, or, more specifically, the diffe...
Is there some way to delay defining the size of an array until a class method or constructor?
What I'm thinking of might look something like this, which (of course) doesn't work:
class Test
{
private:
int _array[][];
public:
Test::Test(int width, int height);
};
Test::Test(int width, int height)
{
_array[width][he...
I need to figure out how to fade in and out of multiple LEDS in a function with an Arduino. Can't use delay() because other things need to run while the light is fading. This is what it has so far, but does not work.
int value = 0; // variable to keep the actual value
int ledpin = 9; ...
i am trying to appendChild() on an existing form, and its not working.
i wonder if i need to delay the page, at least i thought i read that somewhere.
what i am thinking is dynamically altering window onload to be a delay.
do i grab the body tag like any other DOM element?
...
Just wondering, what is the average packet transmission delay between two hosts over the internet (ignoring packet loss and retransmission).
Now, hang a second before you write that it's too genenral and depends on too many factors (Location of the two hosts, network workload at a specific time, just to name a few), i'm aware of that.
Y...
I'm developing a Queue simulation, using a Swing Timer to dequeue objects after certain amounts of time. The interval is determined by peeking at the next object in the queue, getting an integer from it, and setting the delay of its corresponding timer.
Here's the relevant snippet from the program (Note: _SECONDS_PER_ITEM is a constant ...
I was wondering if anyone knew of a better sleep function that could be used in windows in c, other than Sleep(), which takes a millisecond input and only guarantees that the input is the minimum amount of time that elapses. I am passing in 1 millisecond, but actually getting a 15-16 millisecond delay. Is there any way to accurately set ...
I have two elements that shouldn't be active at the same time, so when one is toggled I fade the other out, however I would like to be able to fade the open element out and then bring the other one in. Is there a way to do this that isn't a hack?
<script ="text/javascript">
$(function() {
$('#jlogin').click(function() {
$('#login')....
Here's what I want to do in code.
Animate an MC of a car for a duration of x seconds.
After the car is done, move an MC of a dog for y seconds.
And so on...
With this code, all animations execute simultaneously.
car.slideTo(200,100,1);
dog.slideTo(200,100,5);
blimp.slideTo(200,100,2);
...
Is it possible to write a pause function to...
Hello,
What I got here is a Ajax.Updater prototype js function. It's working perfectly this way:
new Ajax.Updater('feedback', 'contact.php', {
method: 'post',
parameters: Form.serialize($('contactForm')),
onFailure: reportError
});
But I want to delay the process a bit. I asked around on the prototype irc channel and this...
How to tell google syndication not to wait forever to load the ads in case of slow internet connection or otherwise too? Can we fix a time that says okay go and search for 5ms to get ads otherwise don’t delay the load of rest of page.
...
Background info:
I have a function that when called creates select list inside a form and populates it. After that the script runs through the options in the list and looks for a certain value. If the value is there, the script 'selects' that option.
Problem:
Because the list is dynamically created and is some times very large, it takes...
Hi everyone,
I currently have a very simple app for which the only interaction is shaking the iPhone. However eventually the screen dims and auto-locks since the iPhone is not getting any touch events. I was wondering if there is a way to reset the auto-lock time-out when shaken?
I know that to disable auto-lock completely I would do...
I've implemented a simple socket wrapper class. It includes a non-blocking function:
void Socket::set_non_blocking(const bool b) {
mNonBlocking = b; // class member for reference elsewhere
int opts = fcntl(m_sock, F_GETFL);
if(opts < 0) return;
if(b)
opts |= O_NONBLOCK;
else
opts &= ~O_NONBLOCK;
...
Hi all
I have developed a web application that I want to stress test. The app uses a Flash swf to allow users to browse for images on their machine and upload them to the webserver. This swf will read jpg images from local file system, resize them and generate a thumbnail and then upload these as byteArray to an AMFPHP script that write...
I have a system that will generate messages sporadically, and I would like to only submit either zero or one message every 5 minutes. If no message is generated, nothing would be processed by the queue consumer. If a hundred identical messages are generated within 5 minutes I only want one of those to be consumed from the queue.
I am ...
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...
I have written a java applet which opens a JFrame (so when run in the browser, it will popup a small new window).
The problem is, when pressing one of the buttons of the window frame, there is a slight delay (cannot move the mouse for 2 or 3 sec) before the window will close/minimize/maximize. The hidden menu actions (accessed when pres...