delay

Silverlight AutoCompleteBox takes a long time to respond on first “search”

别来无恙 提交于 2019-12-25 03:02:00
问题 I have a Silverlight application which loads about 2000 objects of half a dozen fields into an AutoCompleteBox. The filter is then set to search on any of four of the fields. I've set it to begin searching after two characters. However, when I type the second character (when the box is supposed to start populating) for the very first time after populating the List of objects, the AutoCompleteBox takes about 6-7 seconds to respond. Any ideas on how I can optimize this? Is there a way to create

backstretch.js duration out of sync with .animate() delay

会有一股神秘感。 提交于 2019-12-25 01:22:54
问题 Preface: I am new to writing my own jQuery code and have had help writing the animateContinously() function below. I'm using backstretch.js to have a full browser viewport/background slideshow and jQuery animate() function to change the color (with the help of the jquery-color.js plugin) of the text that shows on top of the backstretch controlled images, depending on which backstretch image is showing. It works, but the backstretch() duration and animate() delay are out of sync if I set them

OpenCL Kernel wait/delay

萝らか妹 提交于 2019-12-24 22:26:36
问题 I'am new to the OpenCL. How can i make a delay in OpenCL Kernel script without making loops? I have a code that's in some circumstances needs to wait for some time and then resume execution like so __kernel void test(uint4 value,uint4 delay) { uint id = get_global_id(0); //some code for(uint i=0;i<delay;i++) { //... do nothing like this? } } But i suppose that the loop will make gpu busy as hell, is there something i can use like sleep maybe in the kernel CL? I looked up in the sdk

Proper use of Task.Delay to delay key presses

老子叫甜甜 提交于 2019-12-24 19:33:01
问题 The code below works for what i'm doing however I'm curious if my use of Task.Delay() is not best practice. I need a delay to ensure that the GameHandler has enough time to process my Key presses. However, i'm wondering if there is a better approach to doing something like this. async public Task<bool> CloseMenusAsync(CancellationToken token) { while (GameHandler.Menu.IsOpen && !token.IsCancellationRequested) { if (GameHandler.Menu.IsOpen && GameHandler.Menu.DialogText.Question == "Open") {

Php sleep function for delay?

喜你入骨 提交于 2019-12-24 16:09:54
问题 Suppose a website with 'high' traffic, I want to use the php sleep(4) function to avoid flooding. Is it a good idea or should I use different delay ways ? sleep() keeps a connection open, could this be a problem ? I do: index.php -> stuff.php -> index.php Stuff.php does something and then sleep(4); so the user waits 4 seconds with a blank screen, and then goes back to index. Thanks. Update: My enemies are both, hackers, that wants a DOS, and stressed pepole that click fast on the search

Want to print text char by char for my textbased game, but it prints out the whole text after the summed delay

混江龙づ霸主 提交于 2019-12-24 11:35:52
问题 Im trying to print out some text char by char with some delay, the problem is that it waits and waits and then prints the whole sentence out. It's like it's printing char by char to a string and then printing that string out once its finished: public static void printWithDelay(String data, TimeUnit unit, long delay) throws InterruptedException { for (char ch : data.toCharArray()) { System.out.print(ch); unit.sleep(delay); } } please help (: 回答1: Why don't you use Thread.sleep()? import java

Refresh page element after specific time

社会主义新天地 提交于 2019-12-24 10:46:50
问题 I'm not very good at code so please use laymans terms in answering!! I have broadcast site where I hide links until a specific time of day (i.e. broadcast time) this is the code I use to do this: <?php date_default_timezone_set('Europe/London'); $currtime = date('Hi'); // Change time $starttime = 2200; $endtime = 2300; $endtime = $endtime + 2400; $endtest = $currtime + 2400; ?> <?php if( $currtime >= $starttime && $endtest <= $endtime ){ ?> <a href="*broadcastlink*">LIVE NOW</a> <?php } else{

How to make a pause before continuing method

醉酒当歌 提交于 2019-12-24 08:28:08
问题 Now, I know that this has been asked, but I need to know how to do this NOT on html or anything. Heres my code, not including all of the other java files. package rtype; import java.awt.Image; import java.awt.event.KeyEvent; import java.util.ArrayList; import javax.swing.ImageIcon; public class aa { private int xd; private int yd; private int dx; private int dy; private int x; private int y; private Image image; private ArrayList missiles; private final int CRAFT_SIZE = 70; public aa() {

Delay recursive backtracking java

我的梦境 提交于 2019-12-24 08:23:17
问题 I found this sudoku solver which use backtracking when it is trying to solve the puzzle and for better understanding I would like to delay the process so I can analyse the backtracking. But I don't really know how to do that. I tried to use Thread.sleep(100); but I don't really know where exactly to put the delay. abstract class SudoKiller { private SudokuBoard sb; // Puzzle to solve; public SudoKiller(SudokuBoard sb) { this.sb = sb; } private boolean check(int num, int row, int col) { int r

Bigquery streaming data delays

人盡茶涼 提交于 2019-12-24 07:44:13
问题 I'm streaming data into a bigquery table, for some reason last few times I checked the data isn't available instantly. The streamed data eventually is available to query, sometimes it looks like it's more than an hour out of sync. But data does eventually appear after some delays. Is this expected? If it is, what are the ways around it? The table is partitioned by date and we are not "load"-ing data into any particular partition, we are streaming data only for the current day. Update: When I