FAQ Database Discussion Community


MATLAB - Generate square signal in ODE15s function?

matlab,signals,solver,ode,square
I'm trying to generate a square signal from inside a function, run through an ODE15s solver. The problem is, that the output is not square, but rather linear. function dX = test(t ,X ) y = X (1) ; a = 24; dc = 50; k = 2; f=k*2*pi; y=a*square(f*t,dc);...

Observer Pattern Via Boost Signal2

c++,boost,signals,bind,observer-pattern
So, I've read the docs for Boost.Siganl2 and I have done a bit of Googleing and I just haven't quite found what I needed. What I have is a controller and a view concept. The Controller will be sending data to the View for it to render. What I want...

Libev c++ can't stop dynamic loops in multithread application

c++,linux,multithreading,signals,libev
I write multithread server with c++ and libev and has one problem. I start default_loop in main thread and create and start dynamic_loop in every slave threads. When I handle signals to stop process I call break_loop(ev::ALL). After that default event loop stopped but all dynamic loops work, need help...

signal handler reading incorrect value

c,signals,fork
on receiving a SIGUSR1 signal, I want to display the value read by the child from the pipe. Having a little issue. It is always displaying 0 despite getppid() was written to pipe by parent process. Any solution? ` #include <stdio.h> #include <unistd.h> #include <signal.h> #include <stdlib.h> char bufP[10], bufC[10];...

Convolution of signals using VHDL

signals,signal-processing,vhdl,modelsim
I have been working on implementing convolution operation using VHDL in MultiSim Student PE Edition. The following code compiles successfully, however When I click Simulate i am getting the following error: # vsim # Start time: 10:32:20 on Apr 26,2015 # Loading std.standard # ** Error: (vsim-13) Recompile work.convolution because...

Handling signals in C after execl

c,signals
I have problem with handling signals. I run program in terminal, I am pressed CTRL + C, but don't see "I am pressed CTRL-C" wasn't printed. But I am trying delete row execl("/usr/bin/gedit", "gedit", "test.c", NULL), "I am pressed CTRL-C" was printed. Can I help you, how to print "I...

Maya PySide: Maya crashes when I try to connect custom signal to slot

qt,signals,pyside,maya,slot
I'm about 2 weeks into PySide and I'm loving it, but I'm having trouble understanding some of the more intermediate concepts. Any help would be greatly appreciated. I'm trying to get a few custom QEvents working in PySide with QLineEdit and QCompleter. I'm using the old style for signal/slot connections...

signal() in C doesn't work

c,signals,fork
why this code doesn't work? I want that the code print the content of figlioA function if the number in input is even or print another code content in figlioB if the number in input is odd. What is wrong? Thank you! #include <stdlib.h> #include <stdio.h> #include <signal.h> int x;...

Accessing a signal in both structural and behavioural architecture

architecture,signals,vhdl,counter
I have defined the structural architecture of a module e.g. architecture structural of my_entity is signal counter : integer := 0; begin MODULE port map(......count => counter.....); --this is an inout port end structural; I would like to implement a counter which is incremented based on a change in an...

Cannot connect slots from another class

c++,qt,signals,slots
I currently try to write an little application for experiments and more. I write everything in its own file (Menu -> menu.cpp etc.). Now I want to create a menu action, this works but interacting with the action doesnt. Thats what I've done so far: menu.cpp #include "menu.h" #include <QMenuBar>...

Linux : pthread_cond_signal() is not working inside a Signal Handler()

c++,c,linux,signals,posix
Summary ----------- 1. In main() am going for pthread_cond_wait(). 2. In signal handler() am waking main() using pthread_cond_signal(). 3. But main() is not coming out from pthread_cond_wait(). What is wrong here? help me out. #include <stdio.h> myclass *myObj = NULL; In main I am trying to wait for a signal:...

simple signal code in C, some confusion

c,linux,output,signals
So here is some simple signal code in C. I have just a few questions on the concept behind this code. I don't have Linux on my computer, so please consider explaining the concept behind this code to me; I really appreciate this! What does the array int list[] store?...

How to kill a process within a thread in python?

python,multithreading,concurrency,signals
Ok, Class A is the Thread. Class B does the call. I tried to kill more than one process (tor, and a firefox) created inside the thread but seems that signals can only be send throught the main thread, so it failed, It says: signal only works in main thread...

Problems connecting Qlistwidget itemDoubleClicked signal with a slot

qt,signals,slots
I am having problems conecting the itemDoubleClicked() signal with a slot in my qt program. I think that it should be working but something goes wrong. I define the GUI by Qt code. Here is the connection part of the code. MainWindow::MainWindow(QWidget* parent) : QWidget(parent) { QListWidget *mImagesListWidget = new...

Die reliably in response to a signal

perl,try-catch,signals
The following code is supposed to time out after a certain period, due to arrival of SIGALRM - sub sig_alrm_handler() { die "Timed out, sorry" } $SIG{ALRM} = \&sig_alrm_handler; main(); Usually this approach works, except sometimes main() includes a Try::Tiny 'try' block which intercepts the "die" from sig_alrm_handler, effectively ignoring...

Synchronizing processes with semaphores and signals in C

c,linux,multiprocessing,signals,semaphore
I have to write program in C on Linux. It has to have 3 processes - first reads from STDIN, sends message through FIFO to second process, which counts lenght of recevied message and sends result to third process (also through FIFO), which displays it on STDOUT. I have to...

Elm - Displaying Text Character By Character (with pauses)

signals,elm
I'm an Elm newbie, and as an experiment, I am trying to display a string one character at a time at a certain rate. This much I've already accomplished. However, I'd like to introduce a brief pause in the output whenever the program hits an end of sentence character (period,...

GDB backtrace without stopping

c++,multithreading,gdb,signals
I am trying to let my program run continously with GDB. Currently I have a bash script which starts GDB with my program and when it crashes it prints the backtrace and starts GDB again (endless loop). Now I added a signal handler for my program which kills specific threads...

C++, signal and threads

c++,multithreading,c++11,signals
I'm having some hard time designing the main workflow of my application, using threads and signals. My goal here is to have a main thread, catching signals, and n other threads doing stuff periodically (actually using sensors on a raspberry pi, and saving retrieved data). I want the ability to...

Sending a glib signal across threads

c++,multithreading,pthreads,signals,glib
I have a thread created using pthreads that I am receiving progress notification callbacks in that thread. This is done in an external non-glib library. I want the callback to emit a glib signal event, but am not sure how to get the event onto the main (GUI) thread. The...

Catch KeyboardInterrupt or handle signal in thread

python,multithreading,python-3.x,signals
I have some threads running, and one of those threads contains an object that will be spawning subprocesses. I want one such subprocess to be able to kill the entire application. The aforementioned object will need to save some state when it receives this signal. Unfortunately I can't get the...

Generating Signals with Python

python,signals,fft
I was trying to generate signals into the raw way but I am getting the error below could somebody help me ? And yes I need it into the raw way and after I will generate the spectrum of it. Also, could someone gimme some hints of where could I...

C - kill system call doesn't wake up a process

c,multithreading,gcc,multiprocessing,signals
I'm writing a program for synchronization between two child processes. The request is: Implement a concurrent program in C language that creates two children: a sender and a receiver. The sender loops reading a string from the standard input and preparing a “message” of a single line in a file,...

In C++, can I use multithreading tools to synchronize UNIX signals with my main program?

c++,linux,multithreading,unix,signals
Does a signal handler set with sigaction run in its own thread? Can I use Pthreads tools to synchronize my signal handler with my main program, like Pthreads mutexes? Can I use C++11 tools like mutex and atomic? Sorry if the question is a bit too general but I'm really...

python Pool result.get() block signal handler

python,multithreading,multiprocessing,signals
I give some long running work to Pool and do result.get(): result = my_pool.apply_async(long_run_func) result.get() The process will be blocked here and I try to send a signal to this process. Then I found the signal handler will only be called after the result.get() finished. Here is the sample code...

Calculating a forecast's tracking signal in R

r,signals,tracking
I'd like to ask if there is any R package with a function for calculating and plotting the tracking signal of a time series forecast, supposing that I have a list of real and predicted values. I've searched a lot and haven't found anything for R, and I think it...

Golang: Get signal origin

go,signals
Im using golang to launch a couple of scripts and when they have some problems they use the "alert" signal, I know Golang can capture those signals but I need to know the PID that originated the Signal. in C to the signal handler is passed a structure to know...

Django log user IP for user_login_failed signal

python,django,ip,signals
I would like to log the user IP address in my Django application, specifically for login, logout and failed login events. I'm using Django builtin functions as follows: from django.contrib.auth.signals import user_logged_in, user_logged_out, user_login_failed from ipware.ip import get_ip import logging logger = logging.getLogger(__name__) def log_logged_in(sender, user, request, **kwargs): logger.info("%s User...

How to execute a function in Qt when a variable changes its value in the QML?

c++,qt,signals,signals-slots
error: no matching function for call to 'SimulationMode::connect(QString&, const char*, SimulationMode* const, const char*)' QObject::connect (m_standingAgvID, SIGNAL (f(int)), this, SLOT (d(int))); Here, m_standingAgvID is an object of a QString variable which is also used in the Q_PROPERTY. f(int) and d(int) have been defined and declared in the respective signal and...

Task mixed in a signal

signals,frp,elm
I would like to send a message to mailbox inline with a signal. module Main where import Graphics.Element exposing (show) import Html exposing (..) import Html.Attributes exposing (..) import Html.Extra exposing (..) import Signal import Model.PickList exposing (pickList) import Model.BabyName.Debug as Debug headerPane : Html headerPane = header [ id...

need to know how to interrupt all pthreads

multithreading,pthreads,signals
In Linux, I am emulating an embedded system that has one thread that gets messages delivered to the outside world. If some thread detects an insurmountable problem, my goal is to stop all the other threads in their tracks (leaving useful stack traces) and allow only the message delivery thread...

segfault handler for C only called once

c,segmentation-fault,signals
I'm writing a program that scans the process memory and creates a memchunk structures to represent the accessibility of a block of memory. A side effect of this process is to learn how to handle signals, as there should be many segfaults over the course of this scan. So, I'm...

In Linux/C++, does a signal sent to a thread/process make it become active?

c++,c,linux,multithreading,signals
In Linux, when a signal is sent to a process/thread (for whatever reason), is the signal handler (assuming there is one, and the signal isn't blocked) called immediately? I mean, I'm pretty sure that in the process/thread that handles the signal it will be called immediately, but I mean with...

Marking a signal

python,numpy,signals
I wonder if there is an easy and efficient way to mark a signal, which is a signal from photodiode attached to the monitor gathering the information about its luminance changes. Luminance changes abruptly. In the following figure, I've pointed out the piece of signal from one luminance change from...

handling sigterm in OSx

c++,osx,signals,sigterm
I have console C++ application built in XCode 6 and want to add SIGTERM handler to it. There are a lot of examples, but I can't get them to work. #include <csignal> namespace { volatile std::sig_atomic_t gDone = 0; } static void term_handler(int i) { gDone = 1; } int...

which process is sending SIGKILL

linux,crash,signals,dbus,sigkill
In my linux system I have a daemon which starts very early ( during bootup ). The daemon during boot-up is just initializing the g_dbus name. Specifically : guint id = g_bus_own_name ( G_BUS_TYPE_SESSION, DBUS_NAME, G_BUS_NAME_OWNER_FLAGS_NONE, bus_acquired_handler, name_acquired_handler, name_lost_handler, NULL, NULL); But to my surprize I always get this :...

How can i use signals in django bulk create

python,django,signals
I have this code Task.objects.bulk_create(ces) Now this is my signal @receiver(pre_save, sender=Task) def save_hours(sender, instance, *args, **kwargs): logger.debug('test') Now this signal is not triggered in bulk create I am using django 1.8...

complicated matlab image processing

matlab,image-processing,signals
I have a really weird question. Let's assume i have an oscillogram like the one shown below. I need to -somehow- capture the points that compose the signal and afterwards try to make a Fourier analysis and plot the harmonics of the signal. Do you think such an operation could...

How to work with signals from QTableWidget cell with cellWidget set

qt,signals,qtablewidget
I've got a QTableWidget with some columns inside. Due to my needs I set QComboBox inside some columns and fill them with necessary data. void settingsDialog::onAddFieldButtonClicked() { fieldsTable->setRowCount(++rowCount); combo = new QComboBox(); combo->addItem(QString("Choose from list...")); foreach( int height, heightsAvailable) combo->addItem(QString("%1").arg(height)); fieldsTable->setCellWidget(rowCount-1, 3, combo); // etc for other columns ... }...

Rails Signalling Server

ruby-on-rails,signals,server,message,webrtc
I am creating an app with Ruby on Rails (4.2). I want to add a WebRTC functionality to it so that two users can choose to videochat with each other. I'd appreciate if you can help with: What are some of the options to create a signalling server with Rails...

SIGINT signal gets dropped during write to a pipe

c++,pipe,signals
I have a program that dumps pcap data gathered using the libpcap to stdout using pcap_dump function, with stdout as the FILE *. There is a little bit of cleanup necessary on SIGINT, so I handle that with sigaction(). This works nicely when executed from a shell. However, this program...

How to control red noise generator by another one (Rocket engine effect - Subtractive synthesis of sound)

java,audio,signals,signal-processing,wav
I programming some sound effects in Java and exporting them into .wav files. Currently, I am trying to program a rocket engine sound effect. I want to do it in the following way: The sound of a rocket engine may be synthesized with a red noise generator controlled by a...

What is best practice for signal handling in production multi-threaded program on Linux?

c,linux,multithreading,signals
I'm writing a multi-threaded program that shall run on a Linux system. I want to be sure that, if the program was in a reliable running condition (i.e. no segmentation faults, no abort, etc...), on exit it finalises a file writing some trailing information. To do so I want to...

Matlab 30 Khz still be heard

matlab,audio,signals
By using the Matlab code as below, I created 30 Khz signal and used sound function to hear the signal created. But, according to my knowledge, I, as a human, should not have heard anything above 20Khz. What is the part that i am missing below? Am I not a...

Sending signal to bash shell launched in GVim

bash,vim,signals
How do I send a signal (say, SIGINT), to a shell launched inside GVim, using a keyboard shortcut? Neither Ctrl+C nor Ctrl+D seem to work....

jBPM 6.2.0 send recurring Task reminder after 1 day time interval if the task is not complete

events,timer,signals,task,jbpm
I am new to jBPM. I am working on jBPM version 6.2.0. I want to perform following tasks. Send reminder email to user / group. Remind the user again after 1 business day if the task is not yet complete. Continue to send reminder everyday untill the task is done....

Qt send signal to different thread

multithreading,qt,signals,slot
I have searched SO for this question, but they were a bit different than mine. My problem is that I dont want to receive a signal from another thread, but I want to send one. Receiving works in my app, but when trying to send, I am getting error that...

Interrupt a accept() that is waiting, just changing a global variable value

c,sockets,pthreads,signals
I'm doing a project for university, a chat system with a server and multiple clients. In the specification document there is written: The main thread does a controlled loop on the global var go, and at each cycle waits for a connection request by an user And also: Server stops...

Wrong exit code received from wexitstatus

php,multiprocessing,signals,pcntl,wexitstatus
I'm using PCNTL to multiprocess a big script in PHP on an ubuntu server. Here is the code ( simplified and commented ) function signalHandler($signo = null) { $pid = posix_getpid(); switch ($signo) { case SIGTERM: case SIGINT: case SIGKILL: // a process is asked to stop (from user or...

Interruption in a linux multithreaded app generate SIGSEGV

c++,c++11,pthreads,signals
I have a x86_64 multithreaded application where I try to emulate avr interrupts: when interrupt occurs application and all threads are suspended while interrupt handler execute defined actions. I thought signals were the solution to do this so I'm trying to catch SIGUSR1 signal, but when I raise SIGUSR1 program...

Pthreads and signals C++

c++,pthreads,signals
I'm new to threads and seem to be having a timing problem. When I run my code my output is... Data received! Data processed! and then it just hangs. I assume I'm using wait and signal incorrectly. Help would be greatly appreciated. #include <string.h> #include <pthread.h> #include <stdio.h> #include <unistd.h>...

Qt app receives HUP signal unexpectedly when forked to background

qt,signals,fork,daemon,signals-slots
I have built a Qt app which upon receipt of the HUP signal shuts down nicely (setup like this how to get signals into Qt). This works great under Red Had 6, but when I run this app under Ubuntu 14 my app receives the HUP signal immediately (after forking...

Why is my signal handler not working?

linux,signals
I want to handle the signal SIGTSTP (18) on Linux. This is my code: void handler(int signum){ printf("Signal %d has tried to stop me.", signum); } int main(void){ struct sigaction act; sigset_t mask; act.sa_handler = handler; act.sa_flags = 0; sigemptyset(&mask); sigaddset(&mask, SIGTSTP); sigprocmask(SIG_SETMASK, &mask, NULL); sigaction(SIGTSTP, &act, NULL); pause(); }...

'kill -9 process ID' signal handler

c,sockets,signals,kill
I develop a program which use tcp socket in the http server for communication with clients. I use the following code to create the http server: void http_server_init(void) { struct sockaddr_in server; int cr_port; for(;;) { cr_port = conf.port; int i = (DEFAULT_PORT == cr_port)? 1 : 0; //Create socket...

What does signal(SIGPIPE, SIG_IGN); do?

c,unix,signals
I know the individual uses of SIGPIPE and SIGIGN. What does signal(SIGPIPE, SIG_IGN); exactly do?...

open on FIFO (named pipe) freezes - ignores SIGINT, SIGTERM

c++,linux,signals,named-pipes,freeze
I'm using named pipes to communicate between forked processes. Each process handles SIGINT and SIGTERM and then closes its end of the pipe and cleans up. If the signal happens right when I fork a process, the process then hangs while trying to open the pipe (because the other end...

Qt Model and View - Link data from model to view, how?

qt,view,model,signals,slots
I'm pretty new to the Model and View concept and I'm having trouble finding the right way to do this. So in my understanding the concept means, that I have one class that handles all the view (GUI) parts and an other class which handles the data processing. The GUI...

QT signal & slots inside second class

c++,qt,signals,slots
I have made a simple program: Which run main program -> class program -> second class Let we see the code: main program: QApplication a(argc, argv); testqtc w; // this one intresting i call this 'first_class' w.show(); return a.exec(); } In 'first_class' I have : testqtc::testqtc(QWidget *parent) : QMainWindow(parent) {...

Checking if signal handler isn't default

c++,linux,signals
Is it possible to check from other thread, if signal function was already called? (i.e default signal handler isn't the default one) signal(SIGTERM, signal_handler);

SIGINT ignored by multiple processes

c,linux,signals,fork,signal-handling
I would like to create three processes, which would print some stuff till I press ctrl+c. Below you can see my try but when a try to stop the program nothing happens. When the only one child is forked, it works good. Where could be a problem? Thanks in advance....

QTcpSocket not emit any error or connected signals

c++,qt,network-programming,signals,qtcpsocket
I have a small project which send some data over network using QTcpSocket. The server works fine but the client(code here) seems does nothing. If I set breakpoint at tcpSocket.connectToHost("127.0.0.1",port); it does jump in, but not any slots I defined. I can't figure out what's wrong. I think the environment...

Plotting random signal on circle

matlab,plot,signals,circle
I have some random signal (for example sin signal) with the time scale. t=0:0.1:2*pi y=sin(t) plot(t,y) Now I want to draw this signal on this circle. So the time vector actually becomes an envelope of the circle. Envelope of the circle represents "y = 0" in cartesian coordinate system. Here...

Cleaning up after a ruby script — trapping signals

ruby,bash,signals,trap
My ruby script creates a tempfile and spawns an potentially long-running external process. Neither may continue to exist after the script ends, no matter the way in which the script terminates. I thought the following lines would take care of things: stderr = File.open(Tempfile.new(__FILE__),'w') trap("EXIT") { FileUtils.rm_f stderr.path } pid...

C synchronize processes using signal

c,linux,signals,system-calls,forking
Okay so I am trying to teach myself on how to do signalling, and I came across a hiccup and I can't figure out what I'm doing wrong. What is going on right now is: it is executing the parent then goes to child and then back to parent.. It's...

How to introduce string by keyboard in child after fork

c,concurrency,process,signals,scanf
I'm exercising over concurrency in C, I wrote a small and simple program in which a parent process creates two children, sender and receiver. Sender will read from stdin a string and then procede to send it in some way to receiver (not relevant). The real problem here is that...

memory leak between ljmp and setjmp

c,linux,process,segmentation-fault,signals
I have a problem. I am working on a project where there are expected segmentation faults, I have to catch the segmentation faults and change the default behaviour ( i.e. application crash) using setjmp and ljmp mechanism. By the time the code throws a segmentation fault, there are memory allocations...

Send a success signal when the group of tasks in celery is finished

django,signals,task,group,celery
So i have a basic configuration django 1.6 + celery 3.1. Say i have an example task: @app.task def add(x, y): time.sleep(6) return {'result':x + y} And a function that groups and returns job id def nested_add(x,y): grouped_task = group(add.s(x,y) for i in range(0,2)) job = result_array.apply_async() job.save() return job.id...

Is it possible to disable the light-blue mouse over highlighting on a QTreeWidgetItem?

c++,qt,signals,qtreewidget
I've a QTreeWidget and need to disable the mouse over highlighting on the childItems but not the click selection. The point here is, that I need to set this per Item because some are selectable. I was thinking about the QTreeWidget::itemEntered signal to check if the item should be highlighted...

Execute code at exit

python,signals,atexit
In my code I have function like this: def myfunc(): # Don't do anything if there's an instance already if get_var('running') == 'true': return set_var('running', 'true') # In case things go wrong atexit.register(set_var, 'running', 'false') do_something() do_something_else() set_var('running', 'false') # Unregister handler because nothing bad happened atexit.unregister(set_var) set_var sets variable...

Why signal handler works only for my first ctrl + c?

c,signals
Here is my code: #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <signal.h> static void sigint_handler(int signo){ printf("%s\n", "hello world!"); for(;;){ pause(); } } int main() { signal(SIGINT, sigint_handler); for(;;){ pause(); } return 0; } And in action: Korays-MacBook-Pro:~ koraytugay$ gcc tugay.c Korays-MacBook-Pro:~ koraytugay$ ./a.out ^Chello world! ^C^C^C^C^C^C Why don't I...

QT Signals & slots in diffrent class

c++,qt,signals,slots
My program has 2 classes. One of them is MainWindow and another is Calc. In main window I use automatic generated function on_PushButton_clicked. This function should send two values: double & char to function in Calc. first: void MainWindow::on_OneButton_clicked(){ QObject::connect(ui->ZeroButton , SIGNAL(clicked()), this, SLOT(...)) ); ui->TextEdit->insertPlainText("1"); } second : void...

Recursive signal call using kill function

c,signals
I'm now learning signals in computer system and I've stuck with a problem. There is a code given below; int i = 0; void handler(int s) { if(!i) kill(getpid(), SIGINT); i++; } int main() { signal(SIGINT, handler); kill(getpid(), SIGINT); printf("%d\n", i); return 0; } And the solution says that the...

Why isnt the signal getting blocked?

linux,signals
When I raise SIGUSR2 inside the SIGUSR1 handler, shouldn't it get blocked ? This code prints "second - Inside first" void hand1(int s) { kill(getpid(), SIGUSR2); printf("Inside first"); } void hand2(int s) { printf("second - "); } main() { signal(SIGUSR1, hand1); signal(SIGUSR2, hand2); kill(getpid(), SIGUSR1); } ...

How does this logic produce high and low pass filters?

matlab,filter,signals
I was studying for a signals & systems project and I have come across this code on high and low pass filters for an audio signal on the internet. Now I have tested this code and it works but I really don't understand how it is doing the low/high pass...

Matlab: How to re-using the corresponding amplitude without re-compute the signal?

c++,matlab,signals
Guys, I need your help! Matlab : Plot this continuous-time signal on Matlab. Define and plot the following continuous-time signals. and choose a a time interval that is relevant for this signal. 2.For signal x(t) in above, define y(t) =1+2x(-2t+3) by reusing the corresponding amplitude vetor defined in question #1...

Docker: how to send a signal from one running container to another one?

docker,signals
I'm using docker, and I would like to know: Is it possible to send a signal, from a running container to another running container ? More precisely, I would like to send SIGUSR1 to python program. I already made a bash script to get pid of my python process and...

Messing with signals, pipes and forks in C

c,bash,shell,signals,fork
How can I get the a process to listen for user input without terminating? . So, for example, i want the bash to wait for X minutes, and if i say "stop" it quits, or else just keeps waiting... How can I achieve that? So, upon execution my process would...

Qt: Connecting signals and slots

c++,qt,signals,slot
I have a MainWindow that contains a custom widget with a QTextEdit in it. I would like to create a signal/slot between the MainWindow and the QTextEdit. In MainWindow I have: QObject::connect(ui->Header, SIGNAL(ui->Header->getTextWidget()->textChanged()), this, // this : MainWindow SLOT(headerUpdated())); // Function of MainWindow But this does not work. Is it...

Bash ERR signal not trapped in procedures?

bash,signals
Consider the following code: #!/bin/bash trap 'echo "ERROR" && exit 2' ERR proc(){ false return 0 } echo START proc echo END The above shows output START END but I would expect the false command to trigger the trap procedure for the ERR signal. If I put false instead of...

Output of this program [closed]

c,error-handling,signals
What direction does this program take? I'm having a hard time following x. int x = 10; void handler(sig) { x += 7; return; } int main(int argc, const char* argv[]) { int pid; signal(SIGCHLD, handler); if ((pid = fork()) == 0) { x -= 3; exit(0); } waitpid(pid, NULL,...

Continuos Signal handle

c++,signals
I am building an algorithm for handling signal received from RS232 port. The basic idea is to receive a signal from RS232 and then grab image with camera. Let's ignore camera and RS232 for now. My short program should enter the while loop, and ask for "cin" command. If command...

signal() : any performance impact?

c++,c,exception,signals,sigsegv
I need to catch SIGABRT, SIGSEGV and SIGILL to present the user a proper critical error message when something out of my control fails and the program need to exit. However my program does a lot of realtime computing, so performance is important. Does signal() ( http://www.cplusplus.com/reference/csignal/signal/ ) cause any...