delay

Xcode Objective-C | iOS: delay function / NSTimer help?

被刻印的时光 ゝ 提交于 2019-12-03 06:22:55
问题 So I'm developing my first iOS application and I need help.. Simple program for now, I have about 9 buttons and when I press the first button, or any button, I just want the first button to highlight for 60 milliseconds, unhighlight, second button highlights, wait 60 milliseconds, unhighlight and so on for the rest of the buttons so it looks like a moving LED. I've looked tried sleep/usleep but once that sleep duration is done it seems like it skips the highlight/unhighlight all together. For

Trying to add delay to jQuery AJAX request

陌路散爱 提交于 2019-12-03 04:05:36
I am trying to delay an AJAX request so that it is sent out 2-3 seconds after the LAST keyup of an input cell. So far I have managed to delay the requests, but after 2-3 seconds I get one request sent for every keyup in the field... How can I make jQuery cancel the first ones and just send the last keyup? Here's the code so far: $('#lastname').focus(function(){ $('.terms :input').val(""); //clears other search fields }).keyup(function(){ caps(this); //another function that capitalizes the field $type = $(this).attr("id"); // just passing the type of desired search to the php file setTimeout

Sox : merge two audio files with a pad

纵饮孤独 提交于 2019-12-03 04:05:25
I'm using the sox tool and I would like to merge two audio files , let's say long.ogg and short.ogg to output a file output.ogg . This is very easy using $ sox -m long.ogg short.ogg output.ogg . Thing is, I would like the short.ogg to be played after n seconds (while long.ogg should start right from the beginning). To do so, I've found the pad effect. But I don't understand the syntax to delay only the short.ogg input file, not the long.ogg one. I found a (dirty) way of doing so (with n=6): $ sox short.ogg delayed.ogg pad 6 $ sox -m long.ogg delayed.ogg output.ogg I would like not to have to

AudioTrack lag: obtainBuffer timed out

女生的网名这么多〃 提交于 2019-12-03 02:48:01
I'm playing WAVs on my Android phone by loading the file and feeding the bytes into AudioTrack.write() via the FileInputStream > BufferedInputStream > DataInputStream method. The audio plays fine and when it is, I can easily adjust sample rate, volume, etc on the fly with nice performance. However, it's taking about two full seconds for a track to start playing. I know AudioTrack has an inescapable delay, but this is ridiculous. Every time I play a track, I get this: 03-13 14:55:57.100: WARN/AudioTrack(3454): obtainBuffer timed out (is the CPU pegged?) 0x2e9348 user=00000960, server=00000000

How to minimize the delay in a live streaming with ffmpeg

流过昼夜 提交于 2019-12-03 02:20:39
问题 i have a problem. I would to do a live streaming with ffmpeg from my webcam. I launch the ffserver and it works. From another terminal I launch ffmpeg to stream with this command and it works: sudo ffmpeg -re -f video4linux2 -i /dev/video0 -fflags nobuffer -an http://localhost:8090/feed1.ffm In my configuration file I have this stream: <Stream test.webm> Feed feed1.ffm Format webm NoAudio VideoCodec libvpx VideoSize 720x576 VideoFrameRate 25 # Video settings VideoCodec libvpx VideoSize

jquery delay between javascript functions

强颜欢笑 提交于 2019-12-02 23:18:45
问题 I have multiply functions with parameters simplified as: function f1(p1,p2){ alert('Function one is P1:'+p1+' P2:'+p2); } function f2(p1,p2){ alert('Function two is P1:'+p1+' P2:'+p2); } I need to fire these is a sequence with a delay between. I have however found that jQuery dislikes running functions with parameters. I have tried the .click function. $.delay(1000).click(f1('One',false)).delay(1000).click(f2('One',false)); But the delay makes the click functions not work... 回答1: I would just

How can I update the value of a Label control periodically?

穿精又带淫゛_ 提交于 2019-12-02 23:10:03
问题 I'm trying to make a label display some text, and then after a short while refresh itself and be able to re-display something else later. At the moment however I don't know how to make a label pause (if at all possible). My code so far: foreach (var x in mod) { labelWARNING.Visible = true; labelWarningMessage.Text = "This module has a prerequisite module: " + x; //need a pause here to give user sufficient time to read the above text //labelWarningMessage.Text = ""; } 回答1: From your questions,

Android Alarm working, but delayed

狂风中的少年 提交于 2019-12-02 20:51:10
问题 I'm trying to make a simple alarm clock and everything is working as it should, but I'm finding that the firing of the alarm is delayed. I think the problem may be that the system is recording the exact millisecond I am setting the alarm, and then firing the alarm at that exact millisecond. So for example, if I make an alarm for 8:00am but I set the alarm at 10:00:30.225pm, then the alarm will fire at 8:00:30.225am. How would I go about making sure the alarm fires exactly on the minute? I

How long pauses can occur in a Haskell program due to garbage collection?

牧云@^-^@ 提交于 2019-12-02 20:35:28
Relating to my other question Haskell collections with guaranteed worst-case bounds for every single operation? , I'm curious: How long pauses can be caused by garbage collection? Does Haskell use some kind of incremental garbage collection so that a program is stopped only for small periods at a time, or can it stop for several seconds in an extreme case? I found two SPJ's papers on the subject: https://research.microsoft.com/en-us/um/people/simonpj/papers/non-stop/index.htm . But I didn't find a reference if these ideas were actually adopted by GHC (or other Haskell implementations). GHC is

How can I automatically send an email with delay from an Outlook inbox usign VBA?

廉价感情. 提交于 2019-12-02 19:17:01
问题 I'm new in the ways of VBA and I want to create a rule (script) that can automatically forward an email received in my Outlook inbox with a specified delay? Can you please give me some instructions on how can I achieve this? I tried: Public Declare Sub Sleep Lib "kernel32" (ByVal dwMiliseconds As Long) Sub send(Item As Outlook.MailItem) Set fwd = Item.Forward fwd.Recipients.Add "mail@email.com" Sleep (10000) fwd.send End Sub Also tried: Sub WasteTime(Finish As Long) Dim NowTick As Long Dim