Windows phone universal app is using camera only one time - camera

In my app I have a button which open camera, take picture and do some processing on it and return back to previous page with the results.
Now Problem is this that it works one time and on second time it open other page but doesn't show camera. Then I have to completely close my application and again launch it to make it work.
I think this is happening because when I am taking picture first time, I open camera, capture it in a captureElement and when I open it second time the previous code is using camera or some thing. I thing there is some thing to close camera which i am missing.

You have to initialize camera every time you navigate to the page that contains it (OnNavigatedTo method). If you want to write a good code you have to deactive camera every time you leave the page (OnNavigatedFrom method). I hope this could be help you.

Related

Colab audio alarm or pop up notification to remind the user to click captcha button when popped up, prevent inactivity

From March 2021 google colab has added a captcha that randomly pops up after some time. So it is difficult or not possible to programmatically prevent Google Colab from disconnecting on a timeout. So there's no option other than opening the tab and clicking the captcha button. I often run model which take more training time and sometimes miss going back to it in 90 mins. The captcha can be popped up even while the training is not completed and soon terminates after a few minutes if not clicked.
Are there any solutions so that I can at least get an audio notification when I get a captcha in colab or if not pop-up message in browser or OS so that I can know about the inactivity?
I had found some ways get notified at some target lines in the notebook, say after training is completed. One is the colab browser notification feature, can be checked to true in settings. Other one is an audio solution, you just add these 2 lines of code found here to get an alarm when the code executes at any line in a cell.
What I am looking for is an alarm or pop up message in case of captcha.
This is probably a half-correct answer, but here's my shot at solving this
This article discusses how to bypass Captcha's, and has some code that clicks the check box if a captcha is found. I think it could be modified to have a sound alert instead.
However, Captchas were made to counter these sort of tools, plus I'm not sure about the legality implications etc, so I wouldn't recommend it.
The use of the below js increased the time before google sent a recaptcha for me. Btw, I set this as a bookmark, to call it whenever I need to. Executing the js bit in the console should be equivalent.
javascript:void(setInterval(function(){ console.log("Connect pushed"); document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click(); },60000))

How do I delay video from my webcam on my own feed?

Id like to have the ability to delay the video from my webcam on. my own computer. Honestly I am using. it. as a "delayed mirror" for my golf swing. I have always recorded, then stopped, opened up the file and watched then did it again. Doing this 30 times in a session working on my swing is annoying. Id like to just take a webcam, be able to delay the video 5,8,10 seconds so I can watch and just keep moving. what is the easiest way around this. I have been told I could do this with a script but not sure where to start. Can anyone help me or send me in the right direction? Im on a Mac but also have a PC if needed.
Python + OpenCV.
First manage to show a current image from your webcam using tutorials.
Then instead of immediately showing the image you add it at the end of a buffer object, this could be a collections.deque from standard Python.
If you want to delay for say 5 seconds and you're capturing with 30 frames per second, then don't show anything until you add 5*30 images from your camera to the buffer. Now when you filled the buffer as soon as you get another image, you add it to the end of the buffer, but also remove 1 image from the beginning of the buffer and show it.

Back Stack in Windows Phone 8.1

I am developing a Windows Phone 8.1 app. In that I need to to navigate from
Page1 --> Page2--> Page3
But I don't want Page1 to apper again when I keep on pressing back button.
Page3-->Page2-->Exit the app
I was able to achieve this using Frame.BackStack.Clear() in the OnNavigatedFrom() of Page1. But the problem is when I click the app icon again its only launching from Page2 not from Page1.
So I want to understand, why the back stack is not cleared when we press
back button and exit the app. And how to achieve the behavior I require
Windows Phone 8.1 Store apps do not close when you are navigating back from the first page. Instead they only get suspended. So once you start open it again, you end up on the last running instance of the app again, this includes backstack, page state, etc.
In the app.xaml.Cs's OnLaunched handler, you can intercept this behavior: You can check the e.PreviousExecutionState where you can check, if you want to handle it as a real restart.
In that case you just dump the current Frame and replace it with a new one, or clear the backstack and start with a new navigation.
Also: The Backstack is a list. You can remove single entries any time and not only completely clear it with the RemoveAt method.
Your methods sounds okay to me. It is that the app runs behind the scene. Unless you write a code like this it will keep running in the last position you kept.
Application.Current.Exit();

Detaching from inside screen. ^a, ad doesnt work

Firstly, I hope this is the right place for this question.
I have an odd problem with screen detaching. I can detach from most every screen I create, except one I am using to host a minecraft server.
When I hit control A D, all I get is another '>' symbol.
I get the same if i Hit control D.
I am doing the same thing that works on other screens, could this one be different somehow?
Ok, heres watcha wanna do. When you log into your unix system you get sent to the main screen. (The screen you first see) what you want to do, is type "screen". This will make you a new screen session. Now in this new screen session, start up your server. Once its started you can now CTRL+A D out of it, and it will take you to the main screen. I had this same exact problem. You NEED to have at least 2 screens to be able to do CTRL+A D.

Record Silverlight 4 MediaElement content

At the moment I'm working on a project. Which contains streaming from an IP camera to the Silverlight 4 MediaElement. The stream that goes through the MediaElement, needs to be cut when a button is clicked.
So is it possible to record MediaElement's content on demand? When that's done, write the recorded part of MediaElement to disk.
If it is possible, what's the most efficient way to do this?
Thank you in advance,
AFAIK, extract part of the entirely video, you can just use a program which has record screen function to record silverlight video on demand. Then you just play the video and use it to start recording from desired beginning and finish recording at intended ending. Thus you will get demand content.