Beispiel #1
0
TimeCounter::TimeCounter(QObject *parent) :
    QObject(parent),
    m_timeStamp(0),
    m_maxWorkingTime(MAX_WORKING_TIME),// 1/3 min
    m_currentTime(0),
    m_currentFreeTime(0)

{
    m_machineState = gray;
    m_timeStamp = QDateTime::currentDateTime().toTime_t();
    m_countTimer = new QTimer(this);
    connect(m_countTimer, SIGNAL(timeout()),
            this, SLOT(m_count()));
}
int numTrees(int n) {
    if (n < 2)
        return n;
    vector<int> m_count(n + 1, 0);
    m_count[0] = 1;
    m_count[1] = 1;
    for (int i = 2; i <= n; i++) {
        int temp  = 0;
        for (int j = 1; j <= i; j++) {
            temp += m_count[j - 1] * m_count[i - j];
        }
        m_count[i] = temp;
    }
    return m_count[n];
}
Beispiel #3
0
void
TimeCounter::m_createConnectionsTrans(){
    connect(m_countTimer, SIGNAL(timeout()),
            this, SLOT(m_count()));
}