How do I set Tasker to start a countdown timer for an alarm when I scan an nfc tag? - tasker

How do I set Tasker to start a countdown timer for an alarm when I scan an nfc tag?
I hear people talking about doing this, but not sure how to go about setting it up. I can write and scan nfc tags with Locale NFC Plugin, it's the task that sets a time (based on a tag in the nfc tag) that I'm having a problem with.
How can I set up Tasker to countdown X minutes and have a sound/alert play when it reaches 00:00.

You could use the "Start System Timer" action. Set it to the desired number of seconds and (optionally) check the box to show the UI. When the task is activated Google Clock will display the countdown and play the alarm sound when it reaches 0:00.

Related

Prevent Mac Screen Saver

In older versions of MacOSX, one would use
UpdateSystemActivity(UsrActivity);
In order to reset the screensaver timer.
In modern versions of MacOSX, the most commonly recommended solution is:
static IOPMAssertionID activity_assertion_id = kIOPMNullAssertionID;
IOReturn r = IOPMAssertionDeclareUserActivity(CFSTR("FractalUserActivity"),
kIOPMUserActiveLocal, &activity_assertion_id);
or
IOReturn result = IOPMAssertionCreateWithName(
kIOPMAssertionTypeNoDisplaySleep,
kIOPMAssertionLevelOn,
CFSTR("FractalNewFrameActivity"),
&power_assertion_id);
IOPMAssertionRelease(power_assertion_id);
However, neither of these in my testing appear to actually reset the MacOSX Screensaver timer. When I set my screensaver to 1minute, but run the above code in a loop at 60FPS, the screensaver still turns on eventually.
Often it's said that IOPMAssertionRelease should only be called after the screen no longer wants to be held awake, but I don't think that's the functionality I need. I need to simply reset the 1min screensaver timer. Because, the timer should be reset every single time a framebuffer gets rendered [due to the application changing what's being displayed]. But, if no frame gets rendered in a 1minute interval, the screensaver should be displayed.
Is there no way to do this in modern versions of MacOSX? Chromium currently exhibits the exact feature that I desire. When watching a YouTube Video, 1minute after the video ends, is when the screensaver will turn on, regardless of how long the youtube video is, even if it's e.g. a 10min Youtube Video.
~ I don't want to hardcode 1minute, since obviously it should regardless of what your screensaver time setting is.

Siri shortcuts do not disturb bug?

I have been trying to write a shortcut to work as a pomodoro timer. Basically, I would like it to set a timer for 25 minutes, then put my phone on DND for 25 minutes. I have been trying to do this second part with a DND “until” and a magic variable holding a date +25 minutes, but the DND is never turning off.
I have tried turning off my DND schedule on my phone, but that has not helped. I’ve attached the (simple) shortcut below.
https://www.icloud.com/shortcuts/856239d511ca4e5fb0d204fbf6bcd78f

Preventing screen dim and display sleep on OS X

I'm making an app for OS X 10.7 and later that plays video. Any document can be taken full-screen using the standard full-screen commands.
I'd like to forestall the automatic screen dim and display sleep as long as any document in my app is playing.
Ideally, the end (or pausing) of all playing videos should commence the full display sleep timer—a 3-minute display sleep delay shouldn't run out 1 minute and 37 seconds after the last video ends simply because something was checking or disrupting the timer every 3 minutes.
I also don't want to disable display sleep outright. If my program crashes or is force quit or the power goes out, the user's display sleep settings should remain untouched.
What's the best way to ensure that playback is not considered “idle”, but that once playback finishes, display sleep after idle works correctly?
Take a power assertion during playback with IOPMAssertionCreateWithName(), and release it when done. Power assertions handle unexpected process termination correctly:
Assertions should be released with IOPMAssertionRelease. However, even if not properly released, assertions will be automatically released when the process exits, dies, or crashes. A crashed process will not prevent idle sleep indefinitely.

alarm functionality in Windows Phone 7?

I am saving the time in sqlite database. There are five screens in my app. In first screen I am adding the details including time in sqlite database. In second screen I am getting the details from sqlite database showing the details to user. In that page I wrote alarm functionality given alarm.Begintime=sqlitestoreddatetimevalue; if user as in the same page then only firing alarm. If user closes the app the alarm didn't work. How to achieve this?
Where to write alarm functionality to call through out application.time data coming from sqlitee database.
You need to add the alarm to the ScheduledActionService in order to register the alarm with the system, so that it goes off.
Assuming alarmTime is the variable which stores the time at which the alarm should go off, do the following:
var alarm = new Microsoft.Phone.Scheduler.Alarm(System.Guid.NewGuid().ToString())
{
Content = "Alarm Text",
BeginTime = alarmTime,
Sound = new Uri("Location of Sound file which the alarm will use when triggered", UriKind.Relative),
//RecurrenceType = RecurrenceInterval.None
};
ScheduledActionService.Add(alarm);
For more help, look at this link.

MFC Dynamic Text Control?

What MFC control should I use and how should I use it to display constantly changing text (like progress text) on a dialog?
For example, should I use the static text control? But can you change it programmatically?
Yes, you can change the contents of a static control programmatically. Change the ID to something other than IDC_STATIC, then you can assign a member variable to it. You can set the text with your_var.SetWindowText().
Edit: how many changes are you making, and how fast? I did a quick test program with a timer (set to a duration of 0) that formats and writes a new string to the control when the time fires, so it's updating constantly. Here's what it looks like after running for a while:
And here's what Task Manager shows:
The spike a the right is (at least mostly) from taking the screen shot of the test program saving it, and so on. As soon as I quit doing things like that, CPU usage went back to do noise level (with the occasional blip). I left the program running -- a half hour or so later, it's still doing fine, with no noticeable CPU usage (in fast according to Task Manager, it hasn't used even one second of CPU time yet).

Resources