w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Backgroundworker's RunWorkerCompleted event is firing even before completing the work
You should add the DoWork-event handler (and all other event handler, too) before calling RunWorkerAsync(). Otherwise, it could happen that RunWorkerAsync does practically nothing.

Categories : C#

RunWorkerCompleted updates UI before DoWork has finished
A little lag is possible and to be expected. The ReportProgress() mechanism probably uses BeginInvoke() so updates are queued. That would give a little delay but usually not noticeable. The ProgressBar has its own internal Update mechanism. This seems to purposely delay feedback with a few hundred msec. Some User scaled tuning I guess.

Categories : C#

Background worker RunWorkerCompleted is never fired
Do you have all the events hooked up correctly ?? backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork); backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler( backgroundWorker1_RunWorkerCompleted);

Categories : C#

Task.ContinueWith doesn't work after previous Task completed
Actually you setup continuation correctly, but you can't see result on console, because application exists before: Task<Int32> t = new Task<Int32>(n => Sum((Int32)n), 100); t.ContinueWith(tt => Console.WriteLine("Finished, SUM={0}", tt.Result), TaskContinuationOptions.OnlyOnRanToCompletion); t.ContinueWith(tt => Console.WriteLine("Exception thrown"), TaskContinuationOptions.OnlyOnFaulted); t.Start(); Console.ReadKey(); // keep app alive Application will not wait for background thread completion - it will be closed when main thread of application finishes it's work (your Main method) EDIT Another option is to wait until backround thread (continuation thread) completes and keep application alive: Task continuation = t.ContinueWi

Categories : C#

mvc: Returning a view in mvc does not work
return this.View("InvoiceDetail"); is return a view only not redirect to an action of any controller. So when you request the index action and return this.View("InvoiceDetail") it search the view in your corresponding view folder (Rental). If you want to redirect to a action then use RedirectToAction("InvoiceDetail"); In your case it will be [HttpPost] public ActionResult Index(RentalCustomerViewmodel ameRentalVm) { ...... ...... ...... if (connInsite.State == ConnectionState.Open) { connInsite.Close(); } //return this.View("InvoiceDetail"); RedirectToAction("InvoiceDetail"); ..... ..... ..... return View(); } public ActionResult InvoiceDetail() { return View();

Categories : Asp Net Mvc

How does returning pointer from a function work?
In main when you delete p you are actually deleting the root pointer in the t object! Don't do that, or you will have undefined behavior, which is what you experience here. When you return a pointer, you return a copy of the pointer, both pointers will point to the same object. If you then delete one of the pointers, the other pointer will now point to a deleted object.

Categories : C++

Why does returning a reference to a automatic variable work?
What might be happening (again, with UB, anything goes) is that since after you called Add, you didn't call anything else, nothing has yet overridden the piece of memory where cen was, and so the old value is still there. That being said, you cannot rely on that always happening.

Categories : C++

C++/CX: Why doesn't returning a StringReference work like passing one as an argument?
No you can't return a StringReference across the ABI boundary. Returning a StringReference across the ABI boundary is similar (but not identical) to returning the address of a local variable. That's because the whole point of a StringReference is that the StringReference doesn't allocate any new memory. Consider what would happen if you could return a StringReference across the ABI boundary. What would happen if you had: String^ ReturnAString() { const wchar_t buffer[500] = "MyString"; return StringReference(buffer); } The StringReference is just a wrapper around the stack allocated buffer. And clearly you can't return that across the ABI boundary (the stack storage is reclaimed as soon as the routine exits). Instead you need to return a real Platform::String - a Platform

Categories : String

Returning object for method call expression doesn't work
I found the issue. I had thought the conversion issue was due to the return type of the method expression, but I forgot I had a conversion expression for one of the method parameters as well - and it was that conversion that was in error. I have an explicit conversion to a value type from a given object, but upon further investigation, it turns out you have to convert "object" to the actual type before implicit conversions will work. ;) So, in summary, if you have a method that returns something other than "object", simply use "Expression.Convert" or "Expression.TypeAs" to convert/box the return type into an object type. ;)

Categories : C#

Windows Powershell - Returning and supplying variables to functions does not work
In your do-while look, $MyReport is just passed to the print everything method. But, it will not be in scope at that point as you are just assigning to $MyReport within the functions. Try using $MyReport as $script:MyReport everywhere, so that it will be in script scope. This is not the ideal solution, but should be good enough to get you started. Also, you might want to read up on pipeline / function output in powershell. You are using it wrong - http://stacktoheap.com/blog/2013/06/15/things-that-trip-newbies-in-powershell-pipeline-output/

Categories : Function

Facebook graph API search query is not returning work field
work is not a public profile field. The user must either have your app installed and you issue user_work_history permission or the user is a friend of a user that installed the application and friends_work_history is issued. https://developers.facebook.com/docs/reference/api/user/

Categories : Facebook

Beautifulsoup and Soupstrainer for getting links dont work with hasattr, returning always true
hasattr() is the wrong test; it tests if there is a a.href attribute, and BeautifulSoup dynamically turns attributes into searches for children. HTML tag attributes are not translated into Python attributes. Use dictionary-style testing instead; you loop over all elements which can include the DocType instance, so I use getattr() to not break on objects that don't have attributes: if 'href' in getattr(link, 'attrs', {}): You can also instruct SoupStrainer to only match a tags with a href attribute by using href=True as a keyword argument filter (not None just means True in any case): for link in BeautifulSoup(test.text, parse_only=SoupStrainer('a', href=True)): This still includes the HTML declaration of course; search for just a links: soup = BeautifulSoup(test.text, parse_only=So

Categories : Python

Using tasks when they have all completed
According to the documentation: Creates a continuation Task that will be started upon the completion of a set of provided Tasks. Yes, it's called when all tasks were finished.

Categories : C#

php run before ajax is completed
Put the PHP that requires a variable in its own script and call it from the ajax call, once the ajax call gets a response update the DOM as needed. PHP runs on server, then javascript runs on client to make the ajax call, then PHP runs on server returning data, then the javascript gets the data and does something with it.

Categories : PHP

Is there a way to know if a timerTask has completed?
You can attempt to cancel the TimerTask using TimerTask.cancel() which returns boolean value that is true if and only if the cancel resulted in the scheduled task not running and false otherwise (meaning the task has already been fired and may be in progress or already done with the run() method)

Categories : Java

End Thread^ which isn't completed
If there is nothing preventing MyForm::ThreadMethod from tracking its own time spent, why not integrate the timing into your threaded work? void ThreadMethod { Int64 watchdog = 1000L * 5L * 60L; // 5 minutes System::Diagnostics::Stopwatch^ sw = System::Diagnostics::Stopwatch::StartNew(); while (sw->ElapsedMilliseconds < watchdog && otherCondition) { // do your work here } }

Categories : Dotnet

PHP SQL query to sum up all the completed tasks of the day
In your code, you're using mysql_connect() to connect to the database, but after that you're using mysqli_query() to execute the query. Do not mix these. Secondly, you do not need single quotes around the identifiers. It should be: SELECT * FROM a WHERE b = 3 AND b >= $onedayago AND b <= $now Also, mysql() is officially deprecated as of PHP 5.5 and it's recommended to switch to mysqli() or PDO.

Categories : PHP

Layout Changes after Activity is Completed
You are calling finish() on your SearchResults Activity in onCreate(), thus the Activity is closed almost as soon as it is opened. If you remove finish() from onCreate(), I believe you will find that you see your new layout.

Categories : Android

Why does xcode think I have not completed implementation?
Remove the semicolon (;) from the end of the @implementation line so it is @implementation withadViewController Also make sure you have a matching @end for each @interface or @implementation to close the block. @interface ... your code... @end and similarly @implementation ... your code ... @end Update: Remove { ADBannerView *banner; BOOL bannerIsVisible; } because the @property declarations already create instance variables to back the properties. Also, make sure you aren't creating another variable named banner locally in your code. The compiler is complaining because you had an instance variable named banner and a variable inside -bannerViewDidLoadAd: also named banner, so inside that method it didn't know which variable you were referring to when you referenced banne

Categories : Iphone

AVAssetExportSession : The operation could not be completed
You want to use fileURLWithPath instead of URLWithString: exportSession.outputURL = [NSURL fileURLWithPath:destinationPath]; See this explanation for more info.

Categories : Iphone

Backgroundworker - UI still not responsive until BGW completed
One thing you might want to add before starting the worker: Me.SuspendLayout() Then, in the RunWorkerCompleted event: Me.ResumeLayout() That should suspend all layout logic until all the work is done, then update the entire form in 1 operation. EDIT Replace BackgroundWorker1.ReportProgress(...) With DirectCast(sender, BackgroundWorker).ReportProgress(...) And get rid of the synclock. EDIT2 The correct way to feed the data to the DoWork event is through the DoWorkEventArgs. Start work like this: BackgroundWorker1.RunWorkerAsync(<globalvar>) And access it like this: Dim globalVarData As Object = e.Argument

Categories : Vb.Net

How to get session when request is completed
Store an empty container (a synchronized set or list, for example) in the session directly from the controller method, then pass this container to each of the tasks, and make the tasks add their response to the container. Also, consider reusing always the same thread pool. It wastes resources to always start a new one. And if too many requests come in, you'll have a much too large number of thread running in parallel, which is precisely what a thread pool is used to avoid.

Categories : Java

Chained payment cannot be completed
So after nearly a month of fighting this issue with PayPal's merchant technical support (most of the time not getting any responses at all) and waiting nearly two weeks for a response on an escalation, it turns out the issue stems from the SDK configuration. Although throughout the API docs and SDK code the Application ID is referenced as applicationId, apparently the SDK requires it to be entered in the config file as acct1.AppId instead. I only discovered this after coming across this wiki page on configuring the SDK, which didn't even exist 24 hours ago. Once I updated my config, I was able to authorize the payment without error.

Categories : Paypal

How does FromEventPattern know when events are completed?
If you are only waiting for a single response from your service, consider using .Take(1) or .FirstAsync() in the query expression: _subscription = Observable .FromEventPattern<NewLoanEventHandler, NewLoanEventArgs>( h => loan.NewLoanEvent += h, h => loan.NewLoanEvent -= h) .Take(1) .Select(a => a.EventArgs.Counterpatry) .GroupBy(c => c.Name) .SelectMany(grp => grp.Max( c => c.MaturityDate ).Select( maturity => new {grp.Key, maturity}) ) .Subscribe( i => Console.WriteLine("{0} --> {1}", i.Key, i.maturity), Console.WriteLine, () => Console.WriteLine("completed") );

Categories : C#

How to determine when all task is completed
if i start 10 task using Task.Factory.StartNew() so how do i notify after when 10 task will be finish Three options: The blocking Task.WaitAll call, which only returns when all the given tasks have completed The async Task.WhenAll call, which returns a task which completes when all the given tasks have completed. (Introduced in .NET 4.5.) TaskFactory.ContinueWhenAll, which adds a continuation task which will run when all the given tasks have completed.

Categories : C#

Completed 406 Not Acceptable in devise
Devise responding to json by default has been removed from version 2.2, So add respond_to :json in your application controller or the specific controller where you would like to respond with json.

Categories : IOS

How to Collapse the first accordion when the last one is completed?
Just use a jQuery cookie and make a modification to the accordion script $(document).ready(function() { var last=$.cookie('activeAccordionGroup'); if (last!=null) { //remove default collapse settings $("#accordion2 .collapse").removeClass('in'); //show the last visible group $("#"+last).collapse("show"); } }); //when a group is shown, save it as the active accordion group $("#accordion2").bind('shown', function() { var active=$("#accordion2 .in").attr('id'); $.cookie('activeAccordionGroup', active) });

Categories : Javascript

How to fire a function after another one has completed
var func1 = function() { //code here func2(); } var func2 = function() { //code here }; $('.mydiv').click(func1); NOTE: This won't work if you're performing asynchronous operations in func1 and want func2 to fire when those operation(s) complete.

Categories : Javascript

print div just after fetching completed
I may be wrong about what your asking as your question isn't 100% clear....But, I believe the problem lies in your misunderstanding of an $.ajax asynchronous call. I believe you are looking for the following to happen Make web request When response is received update the div Call PrintElem with the new div contents In your current code however you do step number 3 when there is no guarantee that step 2 has ever been completed. This means you are actually calling PrintElem before its been updated. Long story short - make sure your call to PrintElem is in your $.ajax success so that it only calls PrintElem after updating the div $.ajax({ url:"taskprocess.php" , data:Data, cache:false, dataType:'json', type:'POST', success: function(output){ if(output[0]

Categories : Jquery

Intellij top level element is not completed
I had something similar happen to be in one of my XML files in IntelliJ 13.1.4. Somehow, I ended up with a situation where my file had language injection configured. I fixed this by: Alt + Enter - Show intention actions and quick-fixes Select Un-inject Language/Reference

Categories : Spring

Leaking Webservice Completed events?
You can do this: void GetData() { var request = new GetDataRequest { someData = "blabla" } ; EventHandler handler = null; handler = (sender, args) => { // do something; i'm afraid that this is executed multiple times, as GetData() is called multiple times //remove itself service.GetDataCompleted -= handler; }; service.GetDataCompleted += handler; service.GetDataAsync(request); } void GetData2() { var request = new GetDataRequest { someData = "blabla2" } ; EventHandler handler = null; handler = (sender, args) => { // do something different here! //remove itself service.GetDataCompleted -= handler; }; service.GetDataCompleted += handler; service.GetDataAsync(request); } EDIT : About synchronizing calls only t

Categories : C#

Switch to different view after a set of animations are completed
You should use the newer block methods. They have built-in completion blocks that will be executed once the animation completes. EDIT: For your situation, use the one where you can give options to use that animationCurve: [UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ button2.transform = CGAffineTransforMakeTranslation(0, 520); } completion:^(BOOL finished) { [self switchtoview2]; }];

Categories : IOS

Check if a javascript function was not completed
Whenever any of the Effects start etc they are added to the global Effects queue, so you can check to see of the queue exists and how many effects are in the queue. if(Effect.Queues.get('global').effects.length == 0) { //do something else } Also because the Effects methods will return immediately you wont exactly know when the effect finished unless you use the afterFinish callback like so new Effect.Morph("thumb_id", { style: "height:300px;", duration: 0.8, afterFinish: function(effect){ //do other things when the effect is finished //the callback is passed the effect object //and the element it is w

Categories : Javascript

How check WebBrowser completed fully?
A web page which uses Ajax is loaded by the browser and executes JavaScript to update / modify its content. The client does not know when a "fully completed" state has been reached. Some JavaScript methods might run after a delay, or periodically.

Categories : Ajax

Jenkins - Get last completed build status
Try http://$host/job/$jobname/lastSuccessfulBuild/api/json Jenkins (and Hudson) expose multiple different builds, such as lastBuild, lastStableBuild, lastSuccessfulBuild, lastFailedBuild, lastUnstableBuild, lastUnsuccessfulBuild, lastCompletedBuild.

Categories : Api

how to rerender a4j:commandLink after the action has been completed
Your action methods is not valid for JSF 1.2 and you don't need the <a4j:support>. Since you want to pass a parameter, you should use <f:attribute /> and actionListener : <a4j:commandLink actionListener="#{ticketAboxEventHelper.removeAboxTicket}" onclick="if(!confirm('Are you sure ... ?')) return false;" reRender="aboxlistpanel"> <h:graphicImage alt="Delete" url="../../img/dialog-error-5.png" title="Delete" /> <f:attribute name="ticket" value="#{ticketAbox}" /> </a4j:commandLink> Your bean method will look like this : public void removeAboxTicket(ActionEvent event) { TicketAbox ticket = (TicketAbox)event.getComponent().getAttributes().get("ticket"); // Your business logic } More info : How to pass parameters in method expression

Categories : JSF

Wait until Code behind WPF Animation is Completed
You can add a completed event on the animation in which you will check how many steps you have to make and perform them if you're not there yet: Private Sub btngo_Click(sender As Object, e As RoutedEventArgs) Handles btnGo.Click PerformNextAction(actions(0)) End Sub Private Sub go_stright() Dim da As New DoubleAnimation(offsety, offsety - 50, New Duration(TimeSpan.FromSeconds(1))) offsety -= 50 Dim tt As New TranslateTransform() AddHandler da.Completed, AddressOf AnimationCompleted tt.BeginAnimation(TranslateTransform.YProperty, da) End Sub Private Sub AnimationCompleted(sender As Object, e As EventArgs) If actionCounter < 4 Then actionCounter += 1 PerformNextAction(actions(actionCounter)) End If End Sub Private Sub PerformNextAction(B

Categories : C#

HttpURLConnection receiving a 405 but service is completed
HttpURLConnection recieving a 405 but service is completed As the error clearly says, you seems to be using an HTTP method which is not supported by your servlet. As you have mentioned that your servlet has only doPost overriden, so it can only handle POST request. And you seems to be using some other HTTP method while sending the request.

Categories : Java

How can I trigger a function after an .each() when delay is completed?
Use .promise(). $('#logo').click(function(){ logosOn(); $('.sections img').promise().done(foo); }); .promise() .promise( [type ] [, target ] ) Returns: Promise Description: Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.

Categories : Jquery

How to know when Asynchronous post request has completed WP8
You already have the methods in place that get called when the request is complete. In your method GetResponseCallback, you should have the updated responseString. You could raise an event in that method so that other classes may handle the updates responseString, or handle the logic within the method itself. See also this introduction to event based programming in C#.

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.