Questions tagged [alarm]

Anything related to the design and implementation of alarms. An alarm is a form of man-machine interaction where the attention of the user of an application or a system is attracted using an audible, a visual or some other kind of signal (or a combination thereof) in order to make the user aware that some event has happened.

Anything related to the design and implementation of alarms. An alarm is a form of man-machine interaction where the attention of the user of an application or a system is attracted using an audible, a visual or some other kind of signal (or a combination thereof) in order to make the user aware that some event has happened.

1448 questions
8
votes
2 answers

Why does alarm() cause fgets() to stop waiting?

I am playing around with signals in C. My main function basically asks for some input using fgets(name, 30, stdin), and then sits there and waits. I set an alarm with alarm(3), and I reassigned SIGALRM to call a function myalarm that simply calls…
Aaron Parisi
  • 189
  • 2
  • 11
8
votes
2 answers

Perl: closing subprocess pipe in signal handler hangs?

I need to timeout on a script that's doing blocking io. Surprisingly it turns out exit hangs if there is an open pipe to a subprocess: #!/usr/bin/perl (-f…
lemonsqueeze
  • 901
  • 7
  • 16
8
votes
4 answers

How can I terminate a system command with alarm in Perl?

I am running the below code snippet on Windows. The server starts listening continuously after reading from client. I want to terminate this command after a time period. If I use alarm() function call within main.pl, then it terminates the whole…
user285686
  • 185
  • 1
  • 2
  • 11
8
votes
1 answer

Send notification once in a week

I want to notify the user about answer the weekly questions.I need to send the notification to the user even my app is not running.The notification will send once in a week. When user clicks the notification my app will gets open. I tried this via…
Jolly
  • 437
  • 1
  • 6
  • 11
7
votes
2 answers

Snooze local Notification

I am working on an alarm application and I am using local notification for that. Now I want to add snooze functionality to my alarm. I searched on Google and found that iPhone doesn't support such functionality. But is there another way to do this?
Yogi
  • 3,528
  • 3
  • 32
  • 51
7
votes
1 answer

recvfrom() timeout with alarm()

I'm debugging the following code: signal(SIGALRM, testt); alarm(1); result = recvfrom( listening_socket, buf, maxlen, 0, &from,…
Alexandru
  • 22,519
  • 17
  • 61
  • 78
7
votes
1 answer

Problem acquiring wake lock from broadcast receiver

I have a problem. I am trying to make a broadcast receiver acquire a wake lock so my alarm will wake the phone from sleep mode. In the broadcast receiver below, the program crashes with "source not found" on line "sCpuWakeLock.acquire(); when the…
Billie
  • 71
  • 1
  • 3
7
votes
3 answers

setAlarmClock without icon in notification bar

To build an exact and reliable Alarm in Android OS 6, aka Marshmallow, I am forced to use setAlarmClock method of AlarmManager. The problem is this method displays an alarm icon in top status bar. Since my app needs an alarm to refresh some data at…
AVEbrahimi
  • 13,285
  • 12
  • 70
  • 151
7
votes
4 answers

How can I timeout a forked process that might hang?

I am writing a Perl script that will write some inputs and send those inputs to an external program. There is a small but non-zero chance that this program will hang, and I want to time it out: my $pid = fork; if ($pid > 0){ eval{ local…
Dang Khoa
  • 5,412
  • 7
  • 44
  • 79
6
votes
3 answers

How I can open native alarm clock in iphone by using code?

I have to crate a sample app in which when I clicked a button that should open the native alarm clock so that user can use it for setting alarm?
Sandy
  • 4,714
  • 4
  • 42
  • 69
6
votes
6 answers

What else can i do 'sleep' when the sleep() can't work well with alarm?

There are many documents say "you should avoid using sleep with alarm, since many systems use alarm for the sleep implementation". And actually, I'm suffering with this problem. So does anyone can help me that what else i can do 'sleep' when the…
William.Zhou
  • 159
  • 2
  • 6
6
votes
2 answers

Set an Alarm from My application

I want to create an alarm object from my application. I am writing a To-Do application which will have an option to set an Alarm on the phone. I wanna set the Date and Time and also the Label for the alarm. Calendar c =…
Harsha M V
  • 50,335
  • 109
  • 326
  • 496
6
votes
2 answers

UILocalNotification fires after reinstalling the app

My app has an alarm function using UILocalNotification, and it works great. However, if the user uninstalls the app, then later REINSTALLS it, he would receive all the "in between" notifications at once. I have tried to call: [[UIApplication…
Enzo Tran
  • 5,590
  • 6
  • 29
  • 36
6
votes
1 answer

How to raise an immediate sigalarm in c

I know i can set an alarm to "go off" with a SIGALRM after a specified amount of time using alram(numberOfSeconds) what i am looking to do is to raise the SIGALRM immediately. Any help would be greatly appreciated.
Daniel
  • 2,276
  • 3
  • 23
  • 34
6
votes
1 answer

alarm clock like sleep cycle ios swift

I have been looking for answer very long and I haven't found it. I'd like to create some app which would be similar to alarm clock. One of it's features will be waking up at specified by the user time (nothing surprising). If you look at sleep…
Kasper
  • 124
  • 2
  • 8