Example #1
0
void Text::setWidth(qreal w)
{
    width = w;
    dirty = true;

    regenerate();
}
Example #2
0
void Text::visibilityChanged(bool visible)
{
    keepInMemory = visible;

    regenerate();
    update();
}
Example #3
0
void main_loop()
{
	regenerate();
	if (do_specific_syscall == 1)
		regenerate_random_page();

	while (1) {
		fork_children();
		handle_children();

		/* Only check taint if it was zero on startup */
		if (do_check_tainted == 0) {
			if (check_tainted() != 0) {
				output("kernel became tainted!\n");
				exit(EXIT_FAILURE);
			}
		}

		if (syscallcount && (shm->execcount >= syscallcount))
			exit(EXIT_SUCCESS);

		if (shm->execcount % 1000 == 0)
			synclogs();
	}
}
Example #4
0
void RGraphicsView::setFactor(double f, bool regen) {
    factor = f;

    if (!RMath::isNormal(factor)) {
        factor = 1.0;
    }

    if (RSettings::getLimitZoomAndScroll()) {
        if (factor>1.0e6) {
            factor = 1.0e6;
        }
        if (factor<1.0e-6) {
            factor = 1.0e-6;
        }
    }

    scene->setPixelSizeHint(mapDistanceFromView(1.0));

    if (regen) {
        regenerate();
        if (scene!=NULL) {
            // notify actions about zoom change:
            scene->getDocumentInterface().zoomChangeEvent(*this);
        }
    }
    //viewportChangeEvent();
}
void HbSplashGenerator::uncachedRegenerate()
{
    // Same as regenerate() but no caching is used so every file is
    // parsed again.
    mParsedSplashmls.clear();
    regenerate();
}
Example #6
0
void RGraphicsView::setOffset(const RVector& offset, bool regen) {
    RVector o = offset;

    if (!o.isSane()) {
        o = RVector(0,0);
    }

    // 20111024: avoid overflows with weird behaviour when using track pad:
    if (RSettings::getLimitZoomAndScroll()) {
        if (offset.x < -1.0e8 || offset.x > 1.0e8) {
            o.x = 0.0;
        }
        if (offset.y < -1.0e8 || offset.y > 1.0e8) {
            o.y = 0.0;
        }
    }

    this->offset = o;

    // offset in pixels:
    //RVector ov(RMath::mround(offset.x*factor), RMath::mround(offset.y*factor));
    ////ov = RVector(RMath::mround(ov.x), RMath::mround(ov.y));
    ////this->offset = mapFromView(ov);
    //this->offset = RVector(ov.x/factor, ov.y/factor);

    if (regen) {
        regenerate();
        if (scene!=NULL) {
            // notify actions about zoom change:
            scene->getDocumentInterface().zoomChangeEvent(*this);
        }
    }
    //viewportChangeEvent();
}
Example #7
0
bool Pattern_maze::display()
{
    int now = millis();
    int t = now - m_start_time;

    bool all_done = true;
    for (int y = 0; y < ROW_COUNT; ++y) {
	for (int x = 0; x < COLUMN_COUNT; ++x) {
	    bool done = false;
	    draw_pixel(x, y, m_fader.generate(get_led(x, y), t, &done));
	    if (!done) {
		all_done = false;
	    }
	}
    }

    if (all_done) {
	regenerate(); 
    }

    return true;
#if 0
    int now = millis();
    if (m_finished_ms) {
	if (now > m_finished_ms + RESET_MS) {
	    m_maze.reset();
	    m_update_ms = now;
	    m_finished_ms = 0;
	}
    } else if (now > m_update_ms + UPDATE_MS) {
	// Try to expand and record what happened.
	if (m_maze.expand()) {
	    m_update_ms = now;
	} else {
	    m_finished_ms = now;
	}
    }

    for (int y = 0; y < ROW_COUNT; ++y) {
	for (int x = 0; x < COLUMN_COUNT; ++x) {
	    int index = get_led(x, y);
	    int order = m_maze.get_order(index);
	    int hue = g_hue.get();
	    Colour c = COLOUR_BLACK;
	    if (order) {
		c = make_hue(hue + HUE_OFFSET * order);
	    }
#ifdef SHOW_POSSIBILITES
	    if (m_maze.in_wall_list(index)) {
		c = make_hue(hue + 50);
	    }
#endif
	    draw_pixel(index, c);
	}  
    }

    return true;
#endif
}
Example #8
0
void LeafModel::setWidth (float val)
{
	if (val != width)
	{
		width = val;
		regenerate (seed);
	}
}
Example #9
0
void LeafModel::setRandomRange (float val)
{
	if (val != randomRange)
	{
		randomRange = val;
		regenerate (seed);
	}
}
/*
	From http://www.ap.com/kb/show/170
	Table 1 Window Scaling Factors
	Window						Noise Power Bandwidth aka Equivalent Noise Bandwidth
	Blackman Harris 3-term		1.73
	Blackman Harris 4-term		2.00
	Dolph-Chebychev 150dB		2.37
	Dolph-Chebychev 200dB		2.73
	Dolph-Chebychev 250dB		3.05
	Equiripple					2.63
	Flat-top					3.83
	Gaussian					2.21
	Hamming						1.36
	Hann						1.50
	None (rectangular)			1.00
	None, move to bin center	1.00
	Rife-Vincent 4-term			2.31
	Rife-Vincent 5-term			2.62

	From http://www.bores.com/courses/advanced/windows/files/windows.pdf
	Coherent power gain is the reduction in signal power caused by the window function
	Coherent power gain = sum (window coefficients) ^ 2 //Doesn't match tables

	From http://dsp-book.narod.ru/HFTSP/8579ch07.pdf which has full table and is a great window function ref
	Coherent power gain = 1/N * sum(window coefficients) //Gives same results as tables

*/
WindowFunction::WindowFunction(WINDOWTYPE _type, int _numSamples)
{
	windowType = _type;
	numSamples = _numSamples;
	window = new double[numSamples];
	windowCpx = memalign(numSamples);
	regenerate (_type);
}
//events are called when the system is active
//Feel free to make things interactive for you, and for the user!
void CloudsVisualSystemNbody::selfKeyPressed(ofKeyEventArgs & args){
	if(args.key == 'R'){
		regenerate();
	}
	if(args.key == 'S'){
		loadShaders();
	}
}
Example #12
0
bool monster::TakeDamage(int damage)
{
    qDebug() << "TAKING DAMAGE IN MONSTER" <<endl;
    QString HLTH=tr("Health");
    MonsterStats.insert(&HLTH, -1*damage);
    if ( MonsterStats[HLTH] <= 0 )
        regenerate();
}
Example #13
0
void LeafModel::setHeight (float val)
{
	if (val != height)
	{
		height = val;
		regenerate (seed);
	}
}
Example #14
0
void LeafModel::setSizeV (float val)
{
	if (val != sizeV)
	{
		sizeV = val;
		regenerate (seed);
	}
}
Example #15
0
void LeafModel::setDensity (int val)
{
	if (val != density)
	{
		density = val;
		regenerate (seed);
	}
}
Example #16
0
void LeafModel::setFlip (bool val)
{
	if (val != flip)
	{
		flip = val;
		regenerate (seed);
	}
}
Example #17
0
void RGraphicsView::restoreViewport() {
    RVector tmpOffset = previousOffset;
    double tmpFactor = previousFactor;
    saveViewport();
    factor = tmpFactor;
    offset = tmpOffset;
    regenerate();
}
Example #18
0
void Quick3DNodeInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bool reset)
{
    Q_Q(Quick3DNodeInstantiator);

    if (!m_componentComplete || m_effectiveReset)
        return;

    if (reset) {
        regenerate();
        if (changeSet.difference() != 0)
            emit q->countChanged();
        return;
    }

    int difference = 0;
    QHash<int, QVector<QPointer<QObject> > > moved;
    const auto removes = changeSet.removes();
    for (const QQmlChangeSet::Change &remove : removes) {
        int index = qMin(remove.index, m_objects.count());
        int count = qMin(remove.index + remove.count, m_objects.count()) - index;
        if (remove.isMove()) {
            moved.insert(remove.moveId, m_objects.mid(index, count));
            m_objects.erase(
                    m_objects.begin() + index,
                    m_objects.begin() + index + count);
        } else {
            while (count--) {
                QObject *obj = m_objects.at(index);
                m_objects.remove(index);
                emit q->objectRemoved(index, obj);
                if (obj)
                    m_instanceModel->release(obj);
            }
        }

        difference -= remove.count;
    }

    const auto inserts = changeSet.inserts();
    for (const QQmlChangeSet::Change &insert : inserts) {
        int index = qMin(insert.index, m_objects.count());
        if (insert.isMove()) {
            QVector<QPointer<QObject> > movedObjects = moved.value(insert.moveId);
            m_objects = m_objects.mid(0, index) + movedObjects + m_objects.mid(index);
        } else for (int i = 0; i < insert.count; ++i) {
            int modelIndex = index + i;
            QObject *obj = m_instanceModel->object(modelIndex, m_async ?
                QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested);
            if (obj)
                _q_createdItem(modelIndex, obj);
        }
        difference += insert.count;
    }

    if (difference != 0)
        emit q->countChanged();
}
void quotient_filter<Key, Hash, Bits>::max_load_factor(float ml) noexcept {
  assert(size() <= max_allowed_size());

  max_load_factor_ = std::min(std::max(ml, 0.01f), 1.0f);

  if (size() > max_allowed_size()) {
    regenerate(0);
    assert(size() <= max_allowed_size());
  }
}
Example #20
0
void LogWidget::setShowNotice(bool show) {
  int old = _show;
  if (show) {
    _show |= Debug::Notice;
  } else {
    _show &= ~Debug::Notice;
  }
  if (_show != old) {
    regenerate();
  }
}
Example #21
0
void LogWidget::setShowWarning(bool show) {
  int old = _show;
  if (show) {
    _show |= Debug::Warning;
  } else {
    _show &= ~Debug::Warning;
  }
  if (_show != old) {
    regenerate();
  }
}
Example #22
0
void LogWidget::setShowError(bool show) {
  int old = _show;
  if (show) {
    _show |= Debug::Error;
  } else {
    _show &= ~Debug::Error;
  }
  if (_show != old) {
    regenerate();
  }
}
Example #23
0
 CypherMapGenerator::CypherMapGenerator(bool isInit){
     if(!isInit){
         return;
     }
     array<char,64> randomString = randomCharSequence();
     for(int i=0;i<4;i++) {
         for (int j = 0; j < 16; j++) {
             cypherMap[i][j] = randomString[(i << 4) + j];
         }
     }
     regenerate();
 }
Example #24
0
File: text.cpp Project: iphydf/qTox
void Text::selectText(const QRegularExpression &exp, const std::pair<int, int>& point)
{
    regenerate();

    if (!doc) {
        return;
    }

    auto cursor = doc->find(exp, point.first);

    selectText(cursor, point);
}
Example #25
0
File: text.cpp Project: iphydf/qTox
void Text::selectText(const QString& txt, const std::pair<int, int>& point)
{
    regenerate();

    if (!doc) {
        return;
    }

    auto cursor = doc->find(txt, point.first);

    selectText(cursor, point);
}
Example #26
0
//==== Parm Has Changed ReGenerate Component ====//
void FuselageXSec::parm_changed(Parm* p)
{
	if ( allTanStrFlag == 1 && xstype !=  FXS_GENERAL )
	{
		upp_str = low_str = bot_str =  top_str();
	}

	regenerate();

	//==== Trigger Fuse Geom Update ====//
	if ( geom_ptr )
		geom_ptr->parm_changed( &updateFuse );
}
Example #27
0
void DAG_graph::build(){
	std::vector<Quaternion *>::iterator iter = codes.begin();

	/* Skip block which contains items below. */
	while(iter!= codes.end()){
		Quaternion::op opcode = (*iter)->opcode;
		if( opcode==Quaternion::ARR_LOAD||
			opcode==Quaternion::PUSH||
			opcode==Quaternion::PUSH_VAR||
			opcode == Quaternion::CALL ||
			opcode==Quaternion::READ||
			opcode==Quaternion::WRITE)
			return ;	
		iter++;
	}

	/* Set head and tail code. */
	iter = codes.begin();
	while(iter != codes.end()){
		if(iter == codes.begin()&&
			((*iter)->opcode == Quaternion::PROC||
			(*iter)->opcode== Quaternion::LABEL)){
				head = *iter;
			
		}else if(iter+1 == codes.end()&&
			((*iter)->opcode == Quaternion::END||
			((*iter)->opcode >= Quaternion::JE && (*iter)->opcode <=Quaternion::JMP))){
				tail = *iter;
		}else{
			add_node(*iter);
		}
		iter++;
	}

// 	Now i did this when set node map. 
// 	/*  Add items to node and set value to each nodes. */
// 	std::map<Symbol_item *  ,DAG_node *>::iterator m_iter = node_map.begin();
// 	while(m_iter!= node_map.end()){
// 		Symbol_item * item= m_iter->first;
// 		DAG_node * node = m_iter->second;
// 		node->items.push_back(item);
// 		/* Maybe useless. */
// 		if (node->item == NULL) node->item = item;
// 		m_iter++;
// 	}

	print_content(std::cout);
	regenerate();
	
}
Example #28
0
void Text::selectText(const QString &txt, const int index)
{
    regenerate();

    if (!doc) {
        return;
    }

    auto cursor = doc->find(txt, index);

    if (!cursor.isNull()) {
        cursor.beginEditBlock();
        cursor.setPosition(index);
        cursor.setPosition(index + txt.size(), QTextCursor::KeepAnchor);
        cursor.endEditBlock();

        QTextCharFormat format;
        format.setBackground(QBrush(QColor("#ff7626")));
        cursor.mergeCharFormat(format);

        regenerate();
        update();
    }
}
int DeterministicGenerator::generate(void *buffer, int count)
{
    int processedBytes = 0;
    char *dest = static_cast<char *>(buffer);
    while (processedBytes < count) {
        if (m_offset == m_generatedData.size()) {
            regenerate();
        }
        const int available = m_generatedData.size() - m_offset;
        const int bytesToCopy = qMin<int>(count - processedBytes, available);
        memcpy(dest + processedBytes, m_generatedData.constData() + m_offset, static_cast<size_t>(bytesToCopy));
        processedBytes += bytesToCopy;
        m_offset += bytesToCopy;
    }
    return count;
}
Example #30
0
File: text.cpp Project: iphydf/qTox
void Text::selectText(QTextCursor& cursor, const std::pair<int, int>& point)
{
    if (!cursor.isNull()) {
        cursor.beginEditBlock();
        cursor.setPosition(point.first);
        cursor.setPosition(point.first + point.second, QTextCursor::KeepAnchor);
        cursor.endEditBlock();

        QTextCharFormat format;
        format.setBackground(QBrush(QColor(COLOR_HIGHLIGHT)));
        cursor.mergeCharFormat(format);

        regenerate();
        update();
    }
}