synchronous

Verilog/VHDL - How to avoid resetting data registers within a single always block?

人走茶凉 提交于 2019-11-28 01:16:57
问题 I like to avoid resetting data registers that don't need to be reset. For example, when streaming data through pipeline stages, if each stage has a valid bit, there is no need to reset the data registers. (I believe this eases routing and timing on the data registers.) This can easily be accomplished by using separate always blocks (or processes in vhdl), but I find this verbose, and doing the following is problematic because the data register is essentially being enabled by the reset. always

Loading Indicator on Synchronous Ajax

自古美人都是妖i 提交于 2019-11-28 00:14:44
问题 I'm using ajax with jQuery on my site and need to show a progress / loading indicator. My dilemna is this: Synchronous AJAX locks the browser, so I cant do anything (e.g. show a loading indicator) till the contents are returned, by which time it is too late I am using JSON as the return data type and setting async = true returns an empty response string my whole framework relies on the return type being JSON-formatted I cannot seem to find any way to get JS to give the user an indication that

Will Chrome and other browsers drop support for Synchronous XMLHttpRequest?

送分小仙女□ 提交于 2019-11-27 23:15:51
问题 Synchronous XMLHttpRequest is being deprecated, meaning support for it will be removed eventually, here is the message I get in Chrome: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/. So, my question is if, and, if yes, when, major browsers (esp. Chrome) will drop support for Synchronous XMLHttpRequest? 回答1: Update: Chrome's announcement on removal of synchronous XHR

Stop browser locking during (synchronous) Ajax?

旧巷老猫 提交于 2019-11-27 22:17:41
What I am trying to do is append a loading image to a div (so the user knows something is loading) and then I call a jquery ajax function, which is set to "async: false". Here is my code: $jQuery("#playersListDiv").html(loadingImage); $jQuery.ajax({ type: "POST", /* this goesn't work with GET */ url: urlValue, /*ex: "NBAgetGamesList.php" */ data: parameters, /*ex: "param1=hello" */ cache: false, async: false, success: function(data){ } }); The problem is that the browser locks and does not append the loading image until AFTER the ajax call is done which is useless of course. Firefox is the

Why are javascript promises asynchronous when calling only synchronous functions?

佐手、 提交于 2019-11-27 20:17:53
In testing I've found that JavaScript Promises are always asynchronous regardless of whether or not they contain any asynchronous functions in their chain. Here is some code that shows the order of operations in console. If you run it you will see that even though every function is synchronous the output shows both of the aPromise() calls being run in parallel, and "surprisingly this happens after run 2 finishes" not happening before run 2 finishes. function aPromise() { return new Promise(function(resolve, reject) { console.log("making promise A") resolve(bPromise()); console.log("promise A

Change the asynchronous jQuery Dialog to be synchronous?

允我心安 提交于 2019-11-27 19:18:01
Currently, I'm working to replace "alert'/"confirm" with the jquery dialog. But most of legacy codes is written in some asynchronous way, which make it difficult to change. Is there any way to make jquery dialog work in a synchronous way? ( don't use loop or callback function ) For example: function run() { var result = confirm("yes or no"); alert( result ); \\more codes here } In this example the alert and other codes will be executed after user's choice. If we use jquery dialog var result = $dialog.open() It will continue to execute the alert, which is asynchronous. Currently, my solution is

Data doesn't load in UITableView until I scroll

守給你的承諾、 提交于 2019-11-27 18:56:36
I am trying to load parsed data in cells, but the problem is that it is happening synchronously and UitableView doesn't show until the data has finished loading. I tried to solve the problem by using performSelectorInBackground, but now data isn't loaded in the cells until I start scrolling. Here is my code: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [self performSelectorInBackground:@selector(fethchData) withObject:nil]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view.

node.js: readSync from stdin?

拟墨画扇 提交于 2019-11-27 18:41:29
Is it possible to synchronously read from stdin in node.js? Because I'm writing a brainfuck to JavaScript compiler in JavaScript (just for fun). Brainfuck supports a read operation which needs to be implemented synchronously. I tried this: const fs = require('fs'); var c = fs.readSync(0,1,null,'utf-8'); console.log('character: '+c+' ('+c.charCodeAt(0)+')'); But this only produces this output: fs:189 var r = binding.read(fd, buffer, offset, length, position); ^ Error: EAGAIN, Resource temporarily unavailable at Object.readSync (fs:189:19) at Object.<anonymous> (/home/.../stdin.js:3:12) at

Asynchronous and Synchronous Terms

荒凉一梦 提交于 2019-11-27 18:22:08
I'm confused by the term asynchronous when related to programming. It seems to mean the opposite in programming terms as what it is defined as in the dictionary. For example, the word synchronous means: occurring at the same time; coinciding in time; contemporaneous; simultaneous. going on at the same rate and exactly together; recurring together. Yet, Wikipedia says: "In programming, asynchronous events are those occurring independently of the main program flow. Asynchronous actions are actions executed in a non-blocking scheme, allowing the main program flow to continue processing." Wouldn't

If MessageBox()/related are synchronous, why doesn't my message loop freeze?

こ雲淡風輕ζ 提交于 2019-11-27 17:46:21
问题 Why is it that if I call a seemingly synchronous Windows function like MessageBox() inside of my message loop, the loop itself doesn't freeze as if I called Sleep() (or a similar function) instead? To illustrate my point, take the following skeletal WndProc : int counter = 0; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_CREATE: SetTimer(hwnd, 1, 1000, NULL); //start a 1 second timer break; case WM_PAINT: // paint/display counter variable