void SpathVessel::calculate( const unsigned& current, MultiValue& myvals, std::vector<double>& buffer, std::vector<unsigned>& der_index ) const { double pp=mymap->getPropertyValue( current, getLabel() ), weight=myvals.get(0); if( weight<getTolerance() ) return; unsigned nderivatives=getFinalValue()->getNumberOfDerivatives(); buffer[bufstart] += weight*pp; buffer[bufstart+1+nderivatives] += weight; if( getAction()->derivativesAreRequired() ) { myvals.chainRule( 0, 0, 1, 0, pp, bufstart, buffer ); myvals.chainRule( 0, 1, 1, 0, 1.0, bufstart, buffer ); } }
void LLPanel::setPanelParameters(LLXMLNodePtr node, LLView* parent) { /////// Rect, follows, tool_tip, enabled, visible attributes /////// initFromXML(node, parent); /////// Border attributes /////// BOOL border = mBorder != NULL; node->getAttributeBOOL("border", border); if (border) { LLViewBorder::EBevel bevel_style = LLViewBorder::BEVEL_OUT; LLViewBorder::getBevelFromAttribute(node, bevel_style); LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; std::string border_string; node->getAttributeString("border_style", border_string); LLStringUtil::toLower(border_string); if (border_string == "texture") { border_style = LLViewBorder::STYLE_TEXTURE; } S32 border_thickness = LLPANEL_BORDER_WIDTH; node->getAttributeS32("border_thickness", border_thickness); addBorder(bevel_style, border_style, border_thickness); } else { removeBorder(); } /////// Background attributes /////// BOOL background_visible = mBgVisible; node->getAttributeBOOL("background_visible", background_visible); setBackgroundVisible(background_visible); BOOL background_opaque = mBgOpaque; node->getAttributeBOOL("background_opaque", background_opaque); setBackgroundOpaque(background_opaque); LLColor4 color; color = mBgColorOpaque; LLUICtrlFactory::getAttributeColor(node,"bg_opaque_color", color); setBackgroundColor(color); color = mBgColorAlpha; LLUICtrlFactory::getAttributeColor(node,"bg_alpha_color", color); setTransparentColor(color); std::string label = getLabel(); node->getAttributeString("label", label); setLabel(label); }
int Volume::formatVol() { if (getState() == Volume::State_NoMedia) { errno = ENODEV; return -1; } else if (getState() != Volume::State_Idle) { errno = EBUSY; return -1; } if (isMountpointMounted(getMountpoint())) { SLOGW("Volume is idle but appears to be mounted - fixing"); setState(Volume::State_Mounted); // mCurrentlyMountedKdev = XXX errno = EBUSY; return -1; } bool formatEntireDevice = (mPartIdx == -1); char devicePath[255]; dev_t diskNode = getDiskDevice(); dev_t partNode = MKDEV(MAJOR(diskNode), (formatEntireDevice ? 1 : mPartIdx)); setState(Volume::State_Formatting); int ret = -1; // Only initialize the MBR if we are formatting the entire device if (formatEntireDevice) { sprintf(devicePath, "/dev/block/vold/%d:%d", MAJOR(diskNode), MINOR(diskNode)); if (initializeMbr(devicePath)) { SLOGE("Failed to initialize MBR (%s)", strerror(errno)); goto err; } } sprintf(devicePath, "/dev/block/vold/%d:%d", MAJOR(partNode), MINOR(partNode)); if (mDebug) { SLOGI("Formatting volume %s (%s)", getLabel(), devicePath); } if (Fat::format(devicePath, 0)) { SLOGE("Failed to format (%s)", strerror(errno)); goto err; } ret = 0; err: setState(Volume::State_Idle); return ret; }
bool AcdkOrbIdl::writeMethod(StringBuffer& sb, const ClazzInfo* ci, const ClazzMethodInfo* mi, int flags) { if ((mi->flags & MiPublic) == false) return false; if (isCompatible(ci, mi) == false) return false; if (_suppressDublicatedMethods == true && isMethodDefinedInSuper(ci, getLabel(mi)) == true) return false; if (flags & MiStatic) { if ((mi->flags & MiMiConstructor) == false && (mi->flags & MiStatic) == false) return false; } else { if ((mi->flags & MiMiConstructor) || (mi->flags & MiStatic)) return false; } if (strcmp(mi->name, "getClass") == 0) return false; if (mi->altlabel != 0) sb << "\n // orginal method name: " << (char*)mi->name << "\n "; sb << " "; sb << getReturnType(mi->returnType) << " "; if (flags & MiStatic && (mi->flags & MiMiConstructor)) sb << "createCor"; sb << (char*)getLabel(mi) << "("; for (int i = 0; mi->methodArgs[i] != 0; ++i) { if (i != 0) sb << ", "; writeMethodArg(sb, ci, mi, mi->methodArgs[i]); } sb << ");\n"; return true; }
void InstanceNSECRecord::writeSpecific(Buffer * buffer) { buffer->writeUInt16(9); getLabel()->write(buffer); buffer->writeUInt8(0); buffer->writeUInt8(5); buffer->writeUInt8(0); buffer->writeUInt8(0); buffer->writeUInt8(0x80); buffer->writeUInt8(0); buffer->writeUInt8(0x40); }
/// Return command in string representation QString CheckCmd::evalString() const { QString lbl = ""; if( !label.isEmpty() ) lbl = QString("%1: ").arg(getLabel()); if( isFullPel ) return QString("%1 chk %2 ; Check full pel pattern[%3, %4]").arg(lbl).arg(patName).arg(start).arg(size); else return QString("%1 chkfr %2 ; Check fractional pel pattern[%3, %4]").arg(lbl).arg(patName).arg(start).arg(size); }
std::string StringTable::add(std::string val) { auto iter = m_table.find(val); if(iter != m_table.end()) { return iter->second; } auto label = getLabel(); m_table[val] = label; return label; }
void CodeGen::visitEInt(EInt *eint) { visitInteger(eint->integer_); // BOOKMARK // stringstream temp; // temp << "#" << tempInt; // emitCmd("MOV", 0, temp.str()); // THIS IS WHAT'S CAUSING ALL THE SHIT. DEAL WITH IT TOMORROW string intAfter = getLabel(curScope, "intLit", curDataNum, "after"); string intLabel = getLabel(curScope, "intLit", curDataNum, "data"); cout << "\tB \t" << intAfter << "\n"; emitLabel(intLabel); cout << ".int\t" << tempInt << "\n"; printf(".align 4\n"); //cout << "\"\n .align 4\n"; emitLabel(intAfter); cout << "\tLDR \tr12,\t=" << intLabel << "\n"; cout << "\tLDR \tr0,\t [r12]\n"; curDataNum++; }
//********************************************************************** // voidCNoneSizeWeight::rebuild() // Validate the size-weight relationship //********************************************************************** void CNoneSizeWeight::rebuild() { try { // Base CSizeWeight::rebuild(); } catch (string &Ex) { Ex = "CNoneSizeWeight.rebuild(" + getLabel() + ")->" + Ex; throw Ex; } }
void Cluster::addAnnotation(const Annotation &ann) { if (ann.getTone() != getLabel()) Annotation(ann).setTone(ui->lineEdit->text()); QListWidgetItem *item = new QListWidgetItem(_item_label(ann)); item->setData(Qt::UserRole, QVariant::fromValue<Annotation>(ann)); ui->listWidget->addItem(item); ui->f0Display->addAnnotation(ann); }
std::shared_ptr<cs6300::BasicBlock> cs6300::MemoryAccessExpression::emit() const { auto result = std::make_shared<BasicBlock>(); if (m_offset->isConst() && m_value != 0) { result->instructions.emplace_back(ThreeAddressInstruction::LoadMemoryOffset, getLabel(), m_value, m_offset->value()); } else { auto code = m_offset->emit(); std::copy(code->instructions.begin(), code->instructions.end(), std::back_inserter(result->instructions)); result->instructions.emplace_back( ThreeAddressInstruction::LoadMemory, getLabel(), m_offset->getLabel(), 0); } return result; }
void VsMDVariable::createComponents() { VsLog::debugLog() <<"VsMDVariable::createComponents() - Entering" <<std::endl; size_t numComps = getNumComps(); if (numComps > 1) { for (size_t i = 0; i < numComps; i++) { registry->registerComponent(getFullName(), i, getLabel(i)); } } VsLog::debugLog() <<"VsMDVariable::createComponents() - Returning" <<std::endl; }
void CharacterGeneration::showName() { CharacterGenerationInfo info = *_chargenInfo; _charGenMenu.reset(new CharacterGenerationNameMenu(info)); sub(*_charGenMenu, kStartCodeNone, true, false); if (_charGenMenu->isAccepted()) { _step += 1; _chargenInfo->setName(info.getName()); getLabel("LBL_NAME")->setText(_chargenInfo->getName()); } }
void VsVariable::createComponents() { //Name & register components VsLog::debugLog() <<"VsVariable::createComponents() - Creating component names." <<std::endl; // Number of component of the var size_t numComps = getNumComps(); // Does this variable have a transformation? bool transformExists = this->hasTransform(); //Note that single-component variables just use the base variable name //I.E. instead of a singleton named "var_0", we just call it "var" if (numComps > 1) { for (size_t i = 0; i < numComps; ++i) { registry->registerComponent(getFullName(), (int)i, getLabel(i)); if (transformExists) { registry->registerComponent(getFullTransformedName(), (int)i, getLabel(i)); } } } }
void OptionsFeedbackMenu::updateTooltipDelay(uint32 UNUSED(tooltipDelay)) { WidgetLabel &ttDelayLabel = *getLabel ("ToolTipValue" , true); WidgetSlider &ttDelaySlider = *getSlider("TooltipSlider", true); const float ttDelay = ((float) (ttDelaySlider.getState() + 1)) / 10.0; const Common::UString secString = TalkMan.getString(kStringSec); const Common::UString ttDelayText = Common::UString::sprintf("%3.1f %s", ttDelay, secString.c_str()); ttDelayLabel.setText(ttDelayText); }
void InstSwitch::dump(const Cfg *Func) const { Ostream &Str = Func->getContext()->getStrDump(); Type Ty = getComparison()->getType(); Str << "switch " << Ty << " "; getSrc(0)->dump(Func); Str << ", label %" << getLabelDefault()->getName() << " [\n"; for (SizeT I = 0; I < getNumCases(); ++I) { Str << " " << Ty << " " << getValue(I) << ", label %" << getLabel(I)->getName() << "\n"; } Str << " ]"; }
ValueVessel::ValueVessel( const VesselOptions& da ): Vessel(da), no_output_value(false) { parse("COMPONENT",mycomp); ActionWithValue* a=dynamic_cast<ActionWithValue*>( getAction() ); plumed_massert(a,"cannot create passable values as base action does not inherit from ActionWithValue"); int numval = getNumericalLabel(); if( numval<0 && a->getNumberOfComponents()==0 ) { // This allows us to make multicolvars pretend to be colvars - this is used in AlphaRMSD etc a->addValueWithDerivatives(); a->setNotPeriodic(); final_value=a->copyOutput( a->getNumberOfComponents()-1 ); } else if( numval<0 ) { no_output_value=true; final_value=new Value(); final_value->setNotPeriodic(); } else { plumed_massert( !a->exists(getAction()->getLabel() + "." + getLabel() ), "you can't create the name multiple times"); a->addComponentWithDerivatives( getLabel() ); a->componentIsNotPeriodic( getLabel() ); final_value=a->copyOutput( a->getNumberOfComponents()-1 ); } }
void Function::comput_label(){ Line* element = _head; if(element == _end && element->isLabel()) _list_lab.push_back(getLabel(element)); while(element != _end) { if(element->isLabel()) _list_lab.push_back(getLabel(element)); if(element->get_next()==_end){ if(element->isLabel()) _list_lab.push_back(getLabel(element)); break; } else element = element->get_next(); } }
void OKCancelDialog::show() { // Center the message WidgetLabel &msg = *getLabel("MessageLabel", true); WidgetPanel &pnl = *getPanel("PNL_OK" , true); float pX, pY, pZ; pnl.getPosition(pX, pY, pZ); msg.setPosition(pX - msg.getWidth() / 2.0, pY - msg.getHeight() / 2.0, pZ - 1.0); GUI::show(); }
void DirectVolume::handlePartitionRemoved(const char *devpath, NetlinkEvent *evt) { int major = atoi(evt->findParam("MAJOR")); int minor = atoi(evt->findParam("MINOR")); char msg[255]; SLOGD("Volume %s %s partition %d:%d removed\n", getLabel(), getMountpoint(), major, minor); /* * The framework doesn't need to get notified of * partition removal unless it's mounted. Otherwise * the removal notification will be sent on the Disk * itself */ if (getState() != Volume::State_Mounted) { return; } if ((dev_t) MKDEV(major, minor) == mCurrentlyMountedKdev) { /* * Yikes, our mounted partition is going away! */ snprintf(msg, sizeof(msg), "Volume %s %s bad removal (%d:%d)", getLabel(), getMountpoint(), major, minor); mVm->getBroadcaster()->sendBroadcast(ResponseCode::VolumeBadRemoval, msg, false); if (mVm->cleanupAsec(this, true)) { SLOGE("Failed to cleanup ASEC - unmount will probably fail!"); } if (Volume::unmountVol(true)) { SLOGE("Failed to unmount volume on bad removal (%s)", strerror(errno)); // XXX: At this point we're screwed for now } else { SLOGD("Crisis averted"); } } }
void PretzelSlider::draw() { gl::pushMatrices(); { gl::translate(mOffset); if( mSliderListf.size() > 1 ){ mGlobal->renderText(mSliderListf.front().getLabel(), mBounds.getUpperLeft() + vec2(12, 1)); std::string sValues = ""; int i=0; for( auto it=mSliderListf.begin(); it!=mSliderListf.end(); it++){ if(i==0) mGlobal->renderText("x", vec2(12, 0 + 13) ); if(i==1) mGlobal->renderText("y", vec2(12, 15*i + 13) ); if(i==2) mGlobal->renderText("z", vec2(12, 15*i + 13) ); it->draw(); sValues += mGlobal->to_string_with_precision( it->getValue() ) + ", "; ++i; } sValues = sValues.substr(0, sValues.length()-2); mGlobal->renderTextRight( sValues, mBounds.getUpperRight() + vec2(-12, 1)); }else{ for( auto it=mSliderListf.begin(); it!=mSliderListf.end(); ++it){ mGlobal->renderText(it->getLabel(), mBounds.getUpperLeft() + vec2(12, 1)); mGlobal->renderTextRight( mGlobal->to_string_with_precision( it->getValue() ), mBounds.getUpperRight() + vec2(-12, 1)); it->draw(); } } if( mSliderListi.size() > 1 ){ }else{ for( auto it=mSliderListi.begin(); it!=mSliderListi.end(); ++it){ mGlobal->renderText(it->getLabel(), mBounds.getUpperLeft() + vec2(12, 1)); mGlobal->renderTextRight( to_string(it->getValue()), mBounds.getUpperRight() + vec2(-12, 1)); it->draw(); } } }gl::popMatrices(); }
float PortraitCut::getCurrMaxInterTerm(const int i, const int j) { assert(i>=0 && i<_w && j>=0 && j<_h); float max = FLT_MIN; Coord p(i,j); if (i>0) max = MAX(max, BVZ_interaction_penalty(p, Coord(i-1,j), getLabel(i,j), getLabel(i-1,j))); if (i<_w-1) max = MAX(max, BVZ_interaction_penalty(p, Coord(i+1,j), getLabel(i,j), getLabel(i+1,j))); if (j>0) max = MAX(max, BVZ_interaction_penalty(p, Coord(i,j-1), getLabel(i,j), getLabel(i,j-1))); if (j<_h-1) max = MAX(max, BVZ_interaction_penalty(p, Coord(i,j+1), getLabel(i,j), getLabel(i,j+1))); return max; }
int main(int argc, char** argv) { struct GeneString StringofStrings[10], *Genetik; int i,e; double n; FILE* f; f=fopen("infile", "r"); if(f==NULL) { printf("where is infile?!\n"); exit(EXIT_FAILURE); } getc(f); //get the first arrow. for(i=0;i<10;i++) { StringofStrings[i].label=" "; StringofStrings[i].gcCont=0.0; } i=0; e=0; while(i!=1) { Genetik=(struct GeneString*)malloc(sizeof(struct GeneString)); Genetik->label=getLabel(f); Genetik->gcCont=getGCCont(f, &i); StringofStrings[e]=*Genetik; //assumably that means it copies across... free(Genetik); Genetik=NULL; e++; //hope to god that this does not happen more than 10 times } e=0; for(i=0;i<10;i++) { if(StringofStrings[i].gcCont>e) { n=StringofStrings[i].gcCont; } } for(i=0;i<10;i++) { if(StringofStrings[i].gcCont==n) { printf("%s%f\n",StringofStrings[i].label,StringofStrings[i].gcCont*100.0); } } return 0; }
// DND void CodeGen::visitSWhile(SWhile *swhile) { if(!dontMindMeJustCollectingGlobals) { curWhile.push(maxWhile++); string startWhile = getLabel(curScope, "while", curWhile.top(), "start"); string endWhile = getLabel(curScope, "while", curWhile.top(), "end"); emitLabel(startWhile); swhile->expression_->accept(this); emitCmd("CMP", 0, "#0"); emitCmd("BEQ", endWhile); swhile->statement_->accept(this); emitCmd("B", startWhile); emitLabel(endWhile); curWhile.pop(); } }
void getLocation(const std::string & str, const unsigned stringStart, Token & token, Machine & machine) { switch (str[stringStart]) { case 'S': getStackLocation(str, stringStart + 1, token); break; case 'R': getRegister(str, stringStart + 1, token, machine); break; default: if (isdigit(str[stringStart])) getHeapLocation(str, stringStart, token, machine); else if (isalpha(str[stringStart])) getLabel(str, stringStart, token); else throw(std::runtime_error("Lexer::getLocation: Invalid keyword given")); break; } }
void CharacterGeneration::showPortrait() { CharacterGenerationInfo info = *_chargenInfo; _charGenMenu.reset(new CharacterGenerationPortraitMenu(info)); sub(*_charGenMenu); if (_charGenMenu->isAccepted()) { _step += 1; _chargenInfo->setFace(info.getFace()); _chargenInfo->setSkin(info.getSkin()); getLabel("PORTRAIT_LBL")->setFill(_chargenInfo->getPortrait()); } }
void OptionsVideoAdvancedMenu::updateFSAALabel(int n) { Common::UString text; if (n == 0) text = TalkMan.getString(67539); else if (n == 1) text = TalkMan.getString(67540); else if (n == 2) text = TalkMan.getString(67542); else text = Common::UString::sprintf("%dx %s", 1 << n, TalkMan.getString(67538).c_str()); getLabel("AntialiasLabel", true)->setText(text); }
bool BasicBlock::isValid() const { // in case we have no label, fail-fast if (!getLabel()) return false; // now check all instructions for validity if (getInsns().empty()) return true; auto last = getInsns().end() - 1; auto it = std::find_if(getInsns().begin(), last, [&](const InsnPtr& insn) { return insn->getInsnCategory() == Insn::IC_Termination; }); // in this case we have a termination insn within the insn stream! if (it != last) return false; return (*last)->getInsnType() != Insn::IT_Label; }
void CharacterGenerationMenu::showName() { // Operate on a copy of the character object CharacterGenerationInfo info = *_pc; _charGenMenu.reset(new CharacterGenerationNameMenu(info)); sub(*_charGenMenu); if (_charGenMenu->isAccepted()) { *_pc = info; getLabel("LBL_NAME")->setText(info.getName()); _step += 1; } }
void CharacterGenerationMenu::showPortrait() { // Operate on a copy of the character object CharacterGenerationInfo info = *_pc; _charGenMenu.reset(new CharacterGenerationPortraitMenu(info)); sub(*_charGenMenu); if (_charGenMenu->isAccepted()) { *_pc = info; getLabel("PORTRAIT_LBL")->setFill(_pc->getPortrait()); _step += 1; } }