signal

Linux 的各种 signal

佐手、 提交于 2019-12-03 13:17:01
2) SIGINT 程序终止(interrupt)信号, 在用户键入INTR字符(通常是Ctrl-C)时发出,用于通知前台进程组终止进程。 3) SIGQUIT 和SIGINT类似, 但由QUIT字符(通常是Ctrl-\)来控制. 进程在因收到SIGQUIT退出时会产生core文件, 在这个意义上类似于一个程序错误信号。 4) SIGILL 执行了非法指令. 通常是因为可执行文件本身出现错误, 或者试图执行数据段. 堆栈溢出时也有可能产生这个信号。 5) SIGTRAP 由断点指令或其它trap指令产生. 由debugger使用。 6) SIGABRT 调用abort函数生成的信号。 7) SIGBUS 非法地址, 包括内存地址对齐(alignment)出错。比如访问一个四个字长的整数, 但其地址不是4的倍数。它与SIGSEGV的区别在于后者是由于对合法存储地址的非法访问触发的(如访问不属于自己存储空间或只读存储空间)。 8) SIGFPE 在发生致命的算术运算错误时发出. 不仅包括浮点运算错误, 还包括溢出及除数为0等其它所有的算术的错误。 9) SIGKILL 用来立即结束程序的运行. 本信号不能被阻塞、处理和忽略。如果管理员发现某个进程终止不了,可尝试发送这个信号。 10) SIGUSR1 留给用户使用 11) SIGSEGV 试图访问未分配给自己的内存,

Matlab, fread, speed up reading file with multiple data types and multiple sample rates

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using Matlab R2015a. I'm using fread to read sensor data from a binary file. The data contains multiple precisions. One signal is sampled at 5 times the rate of the other signals. The file is structured as a sequence of batches, where each batch has e.g. 1 sample of signal_A, but 5 samples of signal_B. I have googled for examples on how to load and format the data fast, but the solutions I have seen only represent cases where there is a single sampling rate, making the solution simpler, as far as I can tell. What I would like to avoid is the

Qt QUdpSocket: readyRead() signal and corresponding slot not working as supposed

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have problems to find why my short QUdpSocket example is not working. I plan to use only one UDP socket to read and write to an embedded device at 192.168.2.66 on port 2007. The device will reply always on port 2007 to the sender. I tested the device with an UDP terminal software and works as I said. So, I designed a simple class to embed the functions needed to manage the device: class QUdp : public QObject { // Q_OBJECT public : explicit QUdp ( QObject * parent = 0 , const char * szHost = 0 , uint16_t wPort = 0 ); ~ QUdp ();

How to register a class for use it in a QWebChannel signal in Qt

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Im using QT 5 with a WebChannel to communicate with a HTML Page. I successfully able to communicate texts and strings. however i woud like to communicate some points data. the official documentation says "No manual message passing and serialization of data is required," http://doc.qt.io/qt-5/qwebchannel.html When i try to send a object or an array, instead of a string, the application throw this message: Don't know how to handle 'data', use qRegisterMetaType to register it. How can I emit a signal with a Point class instead of a string

Connection of pure virtual signal of interface class

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to connect some object's signals derived from an interface class. The connection is done in QWidget::listenToAnimal(AnimalInterface*) . This does not work because qt_metacall is not a member of 'AnimalInterface' and static assertion failed: No Q_OBJECT in the class with the signal . Of course AnimalInterface does not have the Q_OBJECT macro and does not inherit QObject because it is an interface... I want to connect through the interface class because I do not want to manually retype the same code for Cat and for Dog . Is it possible

How to bind to a signal from a delegate component within a ListView in QML

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Let's say I have a ListView of clickable delegate components (or GridView or Repeater ). These delegate components need to emit a signal along with custom data when triggered that can be picked up by the parent of the ListView . How can this signal binding be achieved? e.g. The following code is my attempt but I don't know how to bind the trigger signal of the delegate component to the componentTriggered signal in the root item? Item { id : root anchors . fill : parent signal componentTriggered ( string name ) onComponentTriggered

GTK+ (2.0) - signal “clicked” on GtkEntry?

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm testing some signals with GTK+ 2.0. I'm looking for a way to get a signal emitted when I click on a GtkEntry. if (widgets_info[i].action & IG_INPUT) { widget->frame[i] = gtk_entry_new_with_max_length(MAX_INPUT_LENGTH); gtk_entry_set_text(widget->frame[i], widgets_info[i].text); catch_signal(widget->frame[i], MY_SIGNAL, &change_entry, widget); } I have a pre-selected text in my entry ( widgets_info[i].text ) and i want this text to disappear if the user click on my GtkEntry. Does someone know what is this signal? (Sorry for my English)

Qt5 Signal/Slot syntax w/ overloaded signal & lambda

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using the new syntax for Signal/Slot connections. It works fine for me, except when I try to connect a signal that's overloaded. MyClass : public QWidget { Q_OBJECT public: void setup() { QComboBox* myBox = new QComboBox( this ); // add stuff connect( myBox, &QComboBox::currentIndexChanged, [=]( int ix ) { emit( changedIndex( ix ) ); } ); // no dice connect( myBox, &QComboBox::editTextChanged, [=]( const QString& str ) { emit( textChanged( str ) ); } ); // this compiles } private: signals: void changedIndex( int ); void textChanged(

QML: Using cpp signal in QML always results in “Cannot assign to non-existent property”

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I just want to connect a cpp signal to a qml slot and tried different ways, but it always results in the same QML-Error at runtime: Cannot assign to non-existent property "onProcessed" ! Why? This is my Cpp Object: #include <QObject> class ImageProcessor : public QObject { Q_OBJECT public: explicit ImageProcessor(QObject *parent = 0); signals: void Processed(const QString str); public slots: void processImage(const QString& image); }; ImageProcessor::ImageProcessor(QObject *parent) : QObject(parent) { } void ImageProcessor::processImage

How can I use numpy.correlate to do autocorrelation?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to do auto-correlation of a set of numbers, which as I understand it is just the correlation of the set with itself. I've tried it using numpy's correlate function, but I don't believe the result, as it almost always gives a vector where the first number is not the largest, as it ought to be. So, this question is really two questions: What exactly is numpy.correlate doing? How can I use it (or something else) to do auto-correlation? 回答1: To answer your first question, numpy.correlate(a, v, mode) is performing the convolution of a with