signals

pyqtSignals not emitted in QThread worker

只愿长相守 提交于 2019-12-31 04:13:08
问题 I have an implementation of a BackgroundTask object that looks like the following: class BackgroundTask(QObject): ''' A utility class that makes running long-running tasks in a separate thread easier :type task: callable :param task: The task to run :param args: positional arguments to pass to task :param kawrgs: keyword arguments to pass to task .. warning :: There is one **MAJOR** restriction in task: It **cannot** interact with any Qt GUI objects. doing so will cause the GUI to crash. This

Differences in controlling daemons & applications

拟墨画扇 提交于 2019-12-31 03:54:11
问题 With respect to this excellent post: What's the difference between nohup and a daemon? I would like to ask the following: After launching an application from my terminal, the application keeps running either in the background or the foreground and the only thing I can do to interact with it is by sending it signals from my terminal (given that stdin is still in place). However, after a daemon process is launched, I realized that it can be controlled with other means like querying it or

Boost::signals2 - descruction of an object with the slot

女生的网名这么多〃 提交于 2019-12-31 03:37:26
问题 Consider this: #include <boost/signals2.hpp> #include <iostream> struct object_with_slot { void operator()() { std::cout << "Slot called!" << std::endl; member = 50500; } int member; }; int main() { boost::signals2::signal<void ()> sig; object_with_slot * ptr = new object_with_slot; sig.connect(*ptr); delete ptr; sig(); } Output is "Slot called!" and no crash or anything. That's why I have a few questions: 1) Why there is no crash? 2) Why there is no crash even if the slot function assigns

C handle signal SIGFPE and continue execution

a 夏天 提交于 2019-12-31 00:34:08
问题 I am trying to handle a SIGFPE signal but my program just crashes or runs forever. I HAVE to use signal() and not the other ones like sigaction() . So in my code I have: #include <stdio.h> #include <signal.h> void handler(int signum) { // Do stuff here then return to execution below } int main() { signal(SIGFPE, handler); int i, j; for(i = 0; i < 10; i++) { // Call signal handler for SIGFPE j = i / 0; } printf("After for loop"); return 0; } Basically, I want to go into the handler every time

What is the smallest audio buffer needed to produce Tone sound without distotions with WaveOUT API

允我心安 提交于 2019-12-30 12:09:50
问题 Does the WaveOut API has some internal limitation of the size for the current piece of buffer played ? I mean if I provide a very small buffer does it affects somehow the sound played to the speakers. I am experiencing very strange noise when I am generating and playing the sinus wave with small buffer. Something like a peak, or "BUMP". The complete Story: I made a program that can generate Sinus sound signal in real time. The variable parameters are Frequency and Volume. The project

Prevent “inherited” signal handlers from executing

泄露秘密 提交于 2019-12-30 10:42:43
问题 Defining a signal handler in a "base" component is pretty nifty when that functionality is going to be frequently used by many derived components. However, in QML installing a new handler in a derived component does not replace the original handler, it merely stacks on top of it. As handlers are not really unique per signal, they are merely connections, and you can have multiple connections per signal. One solution is to simply not provide a default handler in the base component, but then you

EventHandler type with no event args

泪湿孤枕 提交于 2019-12-30 08:13:11
问题 When we want to pass data to an event subscriber, we use EventArgs (or CustomEventArgs) for this. .Net provides a build in type EventHandler that uses as a parameter an instance of EventArgs class that is build in as well. What about cases, when I need to notify a subscriber that some action is over, for example search is over? I don't want to even use EventArgs, that won't contain anything. Is there a build in type for signaling another class, without the need to use empty EventArgs? 回答1:

EventHandler type with no event args

我是研究僧i 提交于 2019-12-30 08:12:14
问题 When we want to pass data to an event subscriber, we use EventArgs (or CustomEventArgs) for this. .Net provides a build in type EventHandler that uses as a parameter an instance of EventArgs class that is build in as well. What about cases, when I need to notify a subscriber that some action is over, for example search is over? I don't want to even use EventArgs, that won't contain anything. Is there a build in type for signaling another class, without the need to use empty EventArgs? 回答1:

MATLAB - Pitch Shifting an Audio Signal

前提是你 提交于 2019-12-30 07:49:43
问题 My group is developing a simple MATLAB Graphical User Interface (GUI) that is supposed to record audio from a microphone - plugged in or built in to the computer - and play back the signal. So far we have that completed. Our GUI also can load a sample (a .wav file, etc..) and play it back using the same "Play" pushbutton on the GUI. We have a Play, Record, Load, and Save push button. Now for the pitch-shifting of loaded or recorded samples... We know we need a peak-picking algorithm to find

MATLAB - Pitch Shifting an Audio Signal

白昼怎懂夜的黑 提交于 2019-12-30 07:49:15
问题 My group is developing a simple MATLAB Graphical User Interface (GUI) that is supposed to record audio from a microphone - plugged in or built in to the computer - and play back the signal. So far we have that completed. Our GUI also can load a sample (a .wav file, etc..) and play it back using the same "Play" pushbutton on the GUI. We have a Play, Record, Load, and Save push button. Now for the pitch-shifting of loaded or recorded samples... We know we need a peak-picking algorithm to find