signal

Trapping signals in Python

According to the documentation: There is no way to “block” signals temporarily from critical sections (since this is not supported by all Unix flavors). What stops me using signal.signal(signum,SIG_IGN) to block it, then adding the signal back? ...

Signal handler for SIGALRM does not work even if resetting in the handler

The example code of section 10.6, the expected result is: after several iterations, the static structure used by getpwnam will be corrupted, and the program will terminate with SIGSEGV signal. But on my platform, Fedora 11, gcc (GCC) 4.4.0, the result is [Langzi@Freedom apue]$ ./corrupt in sig_alarm I can see the output from ...

siginterrupt() only works for the first signal? (Python)

For some reason, siginterrupt() only seems to set the behaviour for the first signal received. In this example program, the first SIGQUIT appears to do nothing, but the second sigquit prints "SIGQUIT Handler" and s.accept() throws an Interrupted system call exception. from signal import * from socket import * import sys def sigquitHan...

Saving work after a SIGINT

I have a program which takes a long time to complete. I would like it to be able to catch SIGINT (ctrl-c) and call the self.save_work() method. As it stands, my signal_hander() does not work since self is not defined by the time the program reaches signal_handler(). How can I set it up so self.save_work gets called after a SIGINT? #...

how do you detect a weak wireless signal from a windows mobile 6 app?

I am using a Windows Mobile 6 based hand held device. I there a way to detect low or no wireless signal activity? Since I cannot detect this, my application is getting exceptions and ultimately runs out of threads. ...

non-reentrant function in signal handler?

Hi guys, consider a signal handler that call exit() as last instruction: is safe to call non-reentrant functions (e.g. free()) in that handler? IMHO it would be legal due to the fact that the handler does not return to the normal sequence of execution. Thank you in advance. ...

'accept_position' signal not getting called in Ruby/Gtk2

I'm creating a application with panes in Ruby/Gtk. When the panes are resized, I need to do some stuff. But I cannot figure out which signal to use. I think it is 'accept_position' - but it don't seem to work. This is a sample app that illustrates my problem... #!/usr/bin/env ruby require 'gtk2' window = Gtk::Window.new(Gtk::Window::T...

Basic DSP question

I'm new to DSP programming, and I'm wondering how best to carry out the seemingly basic operation of level adujustment. Say I have an 8 bit number that represents the amplitude I want a signal to be in 256 steps. I have a set of 16 bit numbers representing the signal data. What's the best way to go about scaling the signal data based ...

[VHDL] How to generate serial signal from string?

How do I send data represented by a binary string (e.g. "01011101000100111", length is variable) to an std_logic signal given either fixed delay or clock signal? I want this for a testbench so I'd want to be able to arbitrarily change the binary string with as little hassle as possible, so I'm thinking of using generate. ...

How to detect if a link has signal with Java ?

Is there a way to detect if a link like the following examples has signal with a Java method ? If you cut and paste them into your browser's url field, you'll see the first one has signal but the 2nd has none, so if I have a Java method like this, how to detect the signals ? boolean hasSignal(String Link) // Link = "mms://online.ntdtvc...

Can more than one boost::signal be connected to 1 slot?

i know i can connect multiple slots to the same signal. but Can I do it the other way round? having 3 signals connected to the same slot? anyone ever tried this? thanks a lot! ...

Signal 11 segfault on wait() system call?

I'm new to processes in *nix, and am working on a basic shell in C... in implementing pipes, I count the commands on the line and iteratively fork() a new process. At the end of each iteration I wait() on the child before proceeding to the next command. This was working fine, but I've apparently changed something to break it: Program ...

SA_ONESHOT conflict in signal handling (LINUX)

Does the treatment of SA_ONESHOT in sys_signal() and get_signal_to_deliver() lead to a conflict ? ...

can matlab catch signals from linux? SIGIO

does matlab have the capability to catch signals from linux? for example, the signal SIGIO (29) can be sent to a process with a lease on a file when another process attempts to open that file. from my testing, when I try kill -s 29 pid, where pid is the process ID of a running matlab window, the matlab process is killed. similarly,kill -...

How to get cell service signal strength in Android?

I am trying to write a very simple Android application that checks the signal strength of the current cell. So far, I have only found something called getNeighboringCellInfo(), but I'm not really sure if that includes the current cell. How do I get the CURRENT cell signal strength in Android? Does getNeighborCellInfo() get the current...

Django: signal when user logs in ?

In my Django app, I need to start running a few periodic background jobs when a user logs in and stop running them when the user logs out, so I am looking for an elegant way to get notified of a user login/logout query user login status From my perspective, the ideal solution would be a signal sent by each django.contrib.auth.views...

How do I add ScrolledWindow support to a custom Widget in GtkMM?

I am writing a custom widget for Gtkmm that is supposed to display a huge dataset (imagine something like a 4096x256 character datasheet). Mostly for reasons of elegance, but also for a possible usage in a Glade/Gtk-Builder editor, I want this widget to support ScrolledWindow natively, that is, once it is set as the child of ScrolledWin...

comparing modem.oqpsk probability error and ber

hi currently i have the following code in my matlab values = [0;1;0;0;1;0;1;0]; % can contain only 0s and 1s h = modem.oqpskmod; y = modulate(h, values); g = modem.oqpskdemod(h); z = demodulate(g,y); BER = sum(logical(values(:)-z(:)))/numel(values);% thanks to gnovice! now my question ...

Dealing with Floating Point exceptions

Hi, I am not sure how to deal with floating point exceptions in either C or C++. From wiki, there are following types of floating point exceptions: IEEE 754 specifies five arithmetic errors that are to be recorded in "sticky bits" (by default; note that trapping and other alternatives are optional and, if provided, non-default). * ...

python timer mystery

Well, at least a mystery to me. Consider the following: import time import signal def catcher(signum, _): print "beat!" signal.signal(signal.SIGALRM, catcher) signal.setitimer(signal.ITIMER_REAL, 2, 2) while True: time.sleep(5) Works as expected i.e. delivers a "beat!" message every 2 seconds. Next, no output is produced: ...