FAQ Database Discussion Community


Progress bar while synchronous save to parse.com

ios,parse.com,synchronous,uiprogressview,uiprogressbar
Anyone know how I can show a UIProgressView while I save synchronous to parse.com? I try to show a progress view before I start the sync save and hide it after the save is done, but this doesn't work. It doesn't show the progress view and just start save right...

Synchronous Read of Local File using Javascript

javascript,filereader,synchronous
I have a data file, newline delimited, of a variety of names I want to pull into an array for processing in JavaScript. This set of names will eventually need to be sorted, but right now I'm working on the actual file loading process. Here is my code as it...

Read all text from stdin

node.js,stdin,synchronous
I'm writing a program in Node.js that (in some situations) wants to act as a simple filter: read everything from stdin (up to end of file), do some processing, write the result to stdout. How do you do the 'read everything from stdin' part? The closest solutions I've found so...

Sequelize Query in Express-Module-Function

node.js,express,sequelize.js,synchronous
I'm using Sequelize with node.js and the express framework. I need to implement a function in my app-module which provides specific information from the database. My current approach is this: var app = express(); app.provide = function(){ models.Project.findAll({ include: [{ all: true}]}).then(function(data){ return data; }); }; module.exports = app; My...

iOS UILabel view updating has a delay even though console shows output immediately

iphone,swift,ios8,uilabel,synchronous
I'm trying to update a couple UILabels in my view, but I'm hitting a delay in the updating. I'm creating an NSURLSession, which I don't know if that's what's causing the problem, but I'm able to update other UILabels outside this chunk of code without any delay. When this code...

Call Sync method call from Async Callback?

c#,asynchronous,synchronous
What happens when a synchronous method is called within an asynchronous callback? Example: private void AcceptCallback(IAsyncResult AR) { tcp.BeginReceive(ReceiveCallback); } private void ReceiveCallback(IAsyncResult AR) { tcp.Send(data); } A connection is accepted and the async receive callback is started. When the tcp connection receives data, it calls the receive callback. If...

Swift Alamofire SwiftyJSON Asynchronous/Synchronous Class Methods

swift,asynchronous,synchronous,alamofire,swifty-json
So I currently have the following: class ViewController: UIViewController { class Identity{ let baseUrl = "superSecretURL" var _username: String = "" var _password: String = "" var _apiKey: String = "" init(){ } init(username: String, apiKey: String){ _username = username _apiKey = apiKey } init(username: String, password: String){ _username =...

Make function work synchroniously (wait local events to get fired)

javascript,javascript-events,synchronous
I'm having problems with JavaScript logic. When we have a function that needs data from event-handler to generate result, is it possible to get that data back to function? For example, if we call Image() object or FileReader() inside and wait for its load event to get fired in order...

Run gulp task after completion of other task

javascript,gulp,synchronous
I have two sets of files, let's call them base and mods. The mods files override the base files, so when I run the gulp task related to base, I need to run the mods task directly after. My setup is something like this: gulp.task('base',function(){ return gulp.src('base-glob') .pipe(...) .pipe(gulp.dest('out-glob')) });...

Web Audio API - Scheduling Issue

javascript,html5,web-audio,synchronous,sequencing
I am trying to build a loop sequencer that utilises the web audio API and many different musical loops of different lengths. The general idea is that the loops are chosen at random (to a degree), then played back in in a specific order for a beginning, middle and end...

If a static readonly member calls a static method to get a value, is it done synchronously?

c#,static,synchronous
Given: public class MyClass { private static readonly Dictionary<string,int> mydict = CreateDictionary(); private static Dictionary<string,int> CreateDictionary() { ... } } Is this done synchronously? (i.e. can two quick instantiations of MyClass cause CreateDictionary() to be called twice?...

How should I execute functions only one after another in JavaScript?

javascript,asynchronous,synchronous
I am trying to make a time conversion tool, first thing it does is gets the co-ordinates of both the cities you enter and then calculates time accordingly. But the problem I am facing is that the function which gets the co-ordinates takes some time and it is asynchronous as...

“Synchronous XMLHttpRequest on the main thread is deprecated” using nodejs app.get or http-server

node.js,express,xmlhttprequest,synchronous,http-server
I am creating a front end in AngularJS for a backend in node.js. I have the option of two simple node.js front end servers to serve the front end web page: one is a simple app.get in express, the other is using the http-server package. Whichever front end server code...

iOS - Synchronous Request with Timeout failing

ios,http,swift,request,synchronous
I have code that looks like this: let urlPath: String = "https://github.com/zemirco/sf-city-lots-json/raw/master/citylots.json" var url: NSURL = NSURL(string: urlPath)! var request1: NSURLRequest = NSURLRequest(URL: url, cachePolicy: NSURLRequestCachePolicy.ReturnCacheDataElseLoad, timeoutInterval: 1) var response:NSURLResponse?; var error:NSError?; /*** the follow line is giving the error ***/ var data:NSData = NSURLConnection.sendSynchronousRequest( request1, returningResponse: &response, error: &error)!...

How to write a file synchronously in Node Webkit?

file,node-webkit,synchronous
I am developing a Node webkit desktop application and I need to write a file synchronously, i.e. execute the code lines only when the file has been completely written on the disk. So, I tried two ways : var fs = require('fs'); tmpFileName = "/the/path/to/my/file"; fileContent = "a big string";...

gulp-copy - unexpected behavior

asynchronous,gulp,synchronous
With gulp I want to copy some files from one place to an other before I process them. To demonstrate my problem I've created the following gulpfile.js var gulp = require('gulp'); var copy = require('gulp-copy'); var debug = require('gulp-debug'); gulp.task('default', function () { gulp.start('copy', 'list'); }); gulp.task('copy', function () {...

What happens when I add multiple inline JavaScript functions to an onclick handler?

javascript,asp.net,forms,submit,synchronous
I simply want to know what happens in this case: <input type="submit" name="a" id="b" value="Login" onclick="functionOne();functionTwo();" id="LoginUser_LoginButton"> Does functionOne() first run and then once it is completed, functionTwo() runs? My actual situation is on a ASP.NET page, I'm trying to append a domain name to the username in a login...

php is synchronized or asynchronized?

php,asynchronous,synchronous
<?php $list_years = getYears(); require_once 'view.php'; ?> Here, getYears() is in another file. It's having fetching query. I'm using $list_years in view.php here, it is synchronized or asynchronized?...

How to execute “synchronous” javascript call to server without locking up the browser

javascript,browser,request,nonblocking,synchronous
this may be a stupid question, but....is there a way in Javascript to synchronously wait for a specific request to finish without locking the browser thread? The goal is to call server-side using ajax and executing piece of code after the call is finished AND avoiding callback (hell). Some simple...

Synchronize POSTs to an API in Angular

ajax,angularjs,synchronous
I'm trying to synchronize my POSTs to an endpoint in Angular. I did see some examples of doing a synchronized GET but had trouble understanding the examples well enough to apply them to POSTs. The POSTs are pretty simple, at least from my perspective as the front-end developer. I send...

How to implement asynchronous call with callback?

java,asynchronous,callback,synchronous,futuretask
I need to make a library in which I will have synchronous and asynchronous methods in it. Core Logic of my Library - The customer will use our library and they will call it by passing DataKey builder object. We will then construct a URL by using that DataKey object...