How to return from program results in TD Turbo debeger to tge main INSTRUCTION window - html-table

Iam new to td and when running a instructions at the middle of program it shows the result but I am not able to return to the TD where there is module window is there any specific way to return to td I even pressed Alt_f5 which retruns from user screen But it didnt work
Niether i dont know if program in Td causes TD to hang up?

Related

PyDub opens window no matter what I have tried

I'm trying to make a music making program and used PyDub for playing sounds as I could change the pitch. However, it opens a window whenever playing a sound. No matter what I do, it will open a window.
I have tried using
startupinfo = subprocess.STARTUPINFO
startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = subprocess._subprocess.SW_HIDE
behind every
p = subprocess.Popen(conversion_command, stdin=devnull, stdout=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=startupinfo)
but to no avail. I have also tried putting creationflags=0x08000000 in the
p = subprocess.Popen(conversion_command, stdin=devnull, stdout=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=startupinfo)
which also does not work.
Edit: I found another post which set default creationflags to 0x08000000, which worked!

Setting currentTime to anything sets time back to 0 in videojs

I'm doing something fairly simple with videojs. I simply want to set the time to an arbitrary point on the timeline by clicking on an externally build UI (not the default seek stuff, but a set of divs that are acting like a progress bar.)
All the documentation and every post seems to indicate that setting currentTime as in object.currentTime(time) works. But in my case it doesn't. Not in the console, not anywhere.
Here's my code:
function clearSetTimeBug(videoObj,timeToSetTo){
console.log('timeToSetTo:'+timeToSetTo);
console.log("-1."+videoObj.id()+" readyState(): "+videoObj.readyState());//returns 4 (loaded)
console.log("0."+videoObj.id()+" bufferedEnd(): "+videoObj.bufferedEnd());//returns about 2 seconds ahead of where the playhead is)
if(videoObj.bufferedEnd()>timeToSetTo){
console.log("1."+videoObj.id()+" currentTime(): "+videoObj.currentTime()); // returns a valid videojs object id and then shows the currentTime to be where the video's current timecode as a float.
videoObj.currentTime(timeToSetTo);//this should totally work!
console.log("2."+videoObj.id()+" currentTime(): "+videoObj.currentTime());// shows that the current time is 0!
}else{
//I added this to just go to as far as it's buffered, but this doesn't work either
console.log("3."+videoObj.id()+" currentTime(): "+videoObj.currentTime());
console.log("4. newTime: "+videoObj.bufferedEnd());
videoObj.currentTime(videoObj.bufferedEnd());
pageTime=videoObj.bufferedEnd();
console.log("5."+videoObj.id()+": "+videoObj.currentTime());// still shows that the current time is 0!
console.log("6. pageTime:"+pageTime);
}
}
The player is spun up like this:
function setUpPlayers(playerId,playlist,local_file,index){
let myAspectRatio=heightRatio+":1"
let videoTag="";
videoTag +="<video id='playerInstance"+index+"' class='video-js vjs-fluid' width='100%' height='100%'>\n";
videoTag +="\t<source src='"+playlist+"' type='video/mp4'>\n";
videoTag +="</video>\n"
$('#player'+index).html(videoTag);
window["vjPlayer"+index]=videojs("playerInstance"+index, {"autoplay": false, "preload": "auto" });
}
Play() and pause() and even currentTime() to get the current time works. But trying to set it just forces the player to go back to 0.
I'm working in a Mac in Chrome Version 86.0.4240.80 and Firefox Developer's Edition 71.0b1 (64-bit). These are all local files and I'm running it from http://localhost:8000/index.php.
In the video.js github channel, I figured out the answer to this question. I hadn't checked it on my server, so running the page locally screwed up the ability to click around and set currentTime. Quite strange, actually. I'm still not sure why it happens. You can see the comment here: https://github.com/videojs/video.js/issues/6900
Not the smartest move on my part, but hopefully this might help someone else in the future.

GEB assertion, waitFor

I'm learning GEB in IntelliJ and have two issues.
When I click button on the top of the page I'm redirected to very bottom of the page.
After this I need to do assertion that the site slided down.
I try to do assertion in this example:
assert page.element_on_the bottom.isDisplayed() == true
// element_on_the bottom {$('css_selector)
The above assertion always returns true even I don't click button to slide down.
I need to check if element is visible on the part of website which is actually displayed on my monitor screen. Is there a way to do this?
I try to use waitFor statement in example:
waitFor{page.element.isDisplayed()}
but it doesn't work:
geb.waiting.WaitTimeoutException: condition did not pass in 5.0 seconds (failed with exception)
instead of this I use:
Thread.sleep(3000) //which is not desirable here
and then my test passes. I think my element don't trigger any js or ajax script actions.
I'm not sure how to use waitFor that should wait for all elements to load.
Element doesn't have to be in view for is isDisplayed() to return true - it will return true as long as the element is visible on page, e.g. it's display property is not set to hidden. You will need to detect your scroll position using javascript because WebDriver does not expose scroll information. See this response for how to detect that scroll is at the bottom of the page and see this section of the Book of Geb for how to execute javascript code in the browser.
What is the exception and its stacktrace that you're getting from your waitFor {} call? It probably contains the clue on what is actually going on.
For your first problem, can you please try the following as displayed should work fine for the visibility and present should be good to check the presence of the css selector in the DOM:
waitFor { page.element_on_the bottom.isDisplayed() }
or
waitFor { page.element_on_the bottom.displayed() }
For the second problem, you need to edit your Gebconfig file, like below as the waiting time you have right now is 5 seconds that's why it's failing whereas your sleep time is way more than 5 seconds:
waiting {
timeout = 30
retryInterval = 0.1
}
or, you can also try that at the same line of the code as below:
waitFor (30, 0.1) {page.element.isDisplayed()}
Please let us know if that worked fine or not! On another note, why don't you simply write the function name from the imported class instead of always writing className.functionName()? Best of luck and Cheers!!

How to update UI from a new thread vb.NET website

My application works like this:
Upload Excel file + convert to DataTable
Start new thread
Begin loop through DataTable
Update UI (Label) to show "Processing row [i] of [n]"
Next
End loop
The bold is what I'm not able to do. I've looked around online for updating UI elements from worker threads, but all the results I can seem to find are for Windows Forms, rather than a web project. Is this possible?
yes, you can do it, and actually it is not difficult. you can use ajax toolbox to do it easily. simply use an updatepanel, and update progress.
check http://ajaxcontroltoolkit.codeplex.com/
an example: http://www.asp.net/ajax/documentation/live/overview/updateprogressoverview.aspx
I found a workaround using jQuery AJAX and asp.NET WebMethods and a session variable.
I used a method from one of my previous questions, by having a WebMethod check on a Session variable that was updated by the worker thread.
Worker thread:
Session["progress"] = "{\"current\":" + (i + 1) + ", \"total\":" + dt.Rows.Count + "}"
WebMethod:
[WebMethod]
public static string GetProgress()
if (HttpContext.Current.Session["progress"] == null) {
return "{\"current\":1,\"total\":1}";
} else {
return HttpContext.Current.Session["progress"];
}
}
my jQuery basically looped calling that AJAX WebMethod every second. It would start on page load and if the current = total then it would display "Completed" and clear the loop, otherwise it shows "Processing row [current] of [total]". I even added a jQuery UI Progressbar
This is kind of a manual solution but it solves my problem, with little overhead. An unexpected but nice piece is that since it is utilizing a Session variable, and the WebMethod checks on page load, if the worker thread is active then the progressbar will show even if you navigate away and come back to the page.

How to use wxBusyInfo?

I have encountered a problem with wxBusyInfo.
I want to disable user's operation when doing some calculation.
I just write the code like this:
wxWindowDisabler disableAll;
wxBusyInfo info(_T("Working, please wait..."), this);
for(int i = 0; i < 1; i++)
{
Install();
}
In the Install() function, I do some work like this:
wxSleep();
wxExecute(cmd, output, errors);
When I run the application, the busyinfo dialog will show up, but it will no longer at the top of the application. Also after I click the application, or click the busyinfo dialog, it will turn out like the pictures attached. When the Install() function finished, it will be ok. But I don't want users can end the application by that way.
What's the problem? What can I do?
after click the applicatioin
after click the busyinfo dialog
You are calling wxExecute synchronously, which means that it does not return until cmd completes. So you application does not get a chance to update the display.
So, you need to call wxExecute asynchronously.
The snag is that you cannot then see the output and errors from the executed command.