lang
stringclasses
10 values
seed
stringlengths
5
2.12k
cpp
AKOpenNIUserGenerator* thisCookie = static_cast<AKOpenNIUserGenerator*>(pCookie); char * buffer = new char[128]; sprintf(buffer, "Starting calibration of user %i", nID); thisCookie->dispatchInfoMessage((const uint8_t *)buffer); delete buffer; } void XN_CALLBACK_TYPE _calibrationCompleteCallback(xn::SkeletonCapability& rCapability, XnUserID nID, XnCalibrationStatus calibrationError, void* pCookie)
cpp
else dir.write_file+=options.scoring+rw_string; /////////////////////////////// ///////// IMPORT DATA ///////// /////////////////////////////// // reconstruction input if(options.data_source == "ply"){ importPLYPoints(dir, data); } else if(options.data_source == "npz"){ importNPZ(dir, data); } #ifdef COLMAP else if(options.data_source == "colmap"){
cpp
{ #define STRING(name, value) wchar_t const* const name = value; #define STRING_A(name, value) char const* const name = value; #include "Strings.inl"
cpp
void SimbodyBallJoint::Load(sdf::ElementPtr _sdf) { BallJoint<SimbodyJoint>::Load(_sdf); } ////////////////////////////////////////////////// ignition::math::Vector3d SimbodyBallJoint::Anchor( const unsigned int /*_index*/) const { return this->anchorPos; }
cpp
return xfer; } extern template void Schema::readNoXfer<>(apache::thrift::BinaryProtocolReader*); extern template uint32_t Schema::write<>(apache::thrift::BinaryProtocolWriter*) const; extern template uint32_t Schema::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; extern template uint32_t Schema::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; extern template void Schema::readNoXfer<>(apache::thrift::CompactProtocolReader*);
cpp
DWORD index = 0; while (index < 100000) { WCHAR name[MAX_PATH]; DWORD name_size = MAX_PATH; FILETIME last_write_time; LONG result = RegEnumKeyEx(impl->key, index++, name, &name_size, 0, 0, 0, &last_write_time); if (result == ERROR_NO_MORE_ITEMS) break; if (result != ERROR_SUCCESS) continue;
cpp
// Rendering context recreated because it was lost; restart app to let it reload everything os_android->main_loop_end(); godot_java->restart(env); step = -1; // Ensure no further steps are attempted } } }
cpp
uint8 TwoWire::process(){ return process(true); } // TODO: Add in Error Handling if devsel is out of range for other Maples TwoWire::TwoWire(uint8 dev_sel, uint8 flags, uint32 freq) { if (dev_sel == 1) {
cpp
glDeleteBuffers(1, &m_id); } GLPPBO::GLPPBO(): GLBuffer(GL_PIXEL_PACK_BUFFER) {
cpp
bool initialize_card(int card_pin); String card_type(); String read_file(int card_pin, String file_name); bool write_file(int card_pin, String file_name, String content);
cpp
using drake::yaml::YamlReadArchive; using drake::yaml::YamlWriteArchive; namespace drake { namespace yaml { namespace { struct Inner { template <typename Archive> void Serialize(Archive* a) { a->Visit(DRAKE_NVP(doubles)); }
cpp
reservoir_->RecordScore(-1.0); EXPECT_THAT(reservoir_->get_dividers(), ElementsAre(-1.0)); reservoir_->RecordScore(10); EXPECT_THAT(reservoir_->get_dividers(), ElementsAre(-1.0, 10)); reservoir_->RecordScore(2); EXPECT_THAT(reservoir_->get_dividers(), ElementsAre(-1.0, 2, 10)); reservoir_->RecordScore(2); EXPECT_THAT(reservoir_->get_dividers(), ElementsAre(-1.0, 2, 2, 10)); } // Check the RecordScore() function with splitting and merging. TEST_F(BalancedReservoirTest, RecordScorelarge) { reservoir_->set_dividers_for_test({1.0, 2.0, 3.0, 4.0, 5.0});
cpp
state<HomingSlowRetract> + sml::on_entry<_> / [&] {MotorDirection(Backward); MotorSpeed(_ac.homingPwmHz); MotorEnable(true); StartTimer(34000);}, state<HomingSlowRetract> + sml::on_exit<_> / [&] {MotorEnable(false);}, state<HomingSlowRetract> + event<eOnTime>[Retracted] / [&] {PrintLn("HomingExtend"); KillTimer();} = state<HomingExtend>, state<HomingSlowRetract> + event<eOnTime>[TimerDone] / [] {PrintLn("Failed1");} = state<Failed>, state<HomingExtend> + sml::on_entry<_> / [&] {MotorDirection(Forward); MotorSpeed(_ac.slowPwmHz); MotorEnable(true); StartTimer(2000);}, state<HomingExtend> + sml::on_exit<_> / [&] {MotorEnable(false);}, state<HomingExtend> + event<eOnTime>[TimerDone] / [&] {PrintLn("HomingRetract"); KillTimer();} = state<HomingRetract>,
cpp
PB_DB_BEGIN_STRUCT(Component) PB_DB_END_STRUCT PB_DB_BEGIN_STRUCT_DERIVED(ScriptComponent, Component) PB_DB_FIELD_REFERENCE(Script, Script) PB_DB_FIELD_STRING(InlineScript) PB_DB_END_STRUCT
cpp
int a = 0, e = 0, i = 0, o = 0, u = 0; vector<int> arr(26, 0); for(int x = 0; x<n; x++){ if(s[x] == 'A'){ a++; vow++; } else if(s[x] == 'E'){ e++; vow++; } else if(s[x] == 'I'){ i++; vow++;
cpp
static void dtor_native(JNIEnv* env, jobject clazz, jlong w) { delete (BackupDataWriter*)w; } static jint writeEntityHeader_native(JNIEnv* env, jobject clazz, jlong w, jstring key, jint dataSize) { int err; BackupDataWriter* writer = (BackupDataWriter*)w;
cpp
return -1; } } int main() { vector<int> vec {2, 3, 1 ,1 ,2 ,4 ,2 ,0 ,1 ,1}; cout << ritik::min_num_jumps(vec);
cpp
Image computeEdgeStrengthMap(Image& input); void centerWeightMaps(std::vector<Image>& maps, size_t rc = -1, size_t cc = -1); void normalizeCenterWeightedMaps(std::vector<Image>& maps); std::vector<double> computeClusterDensities(std::vector<Image>& maps);
cpp
// Licensed under the Apache License, Version 2.0 #include <keys-storage/KeysStorageMemory.hpp> extern "C" { #include <keys-storage/KeysStorageMemory.h> } KeysStorage* KeysStorageMemory_c_create() { return (KeysStorage*)new verificaC19Sdk::KeysStorageMemory(); }
cpp
*/ #include <memory> #include <iostream> #include <fstream> using namespace std; struct X{/* For example, stores nothing */}; /* * An example using unique pointers */ void f(int i, int j){
cpp
#include "Lib.hpp" #include <iostream> int main() { helloTest(std::cout); helloIT(std::cout); return 0; }
cpp
#include "minddata/dataset/engine/ir/datasetops/dataset_node.h" #include "minddata/dataset/engine/ir/datasetops/map_node.h" #include "minddata/dataset/engine/opt/post/auto_worker_pass.h" namespace mindspore { namespace dataset { // this will become the RootNode:DatasetNode when it is turned on
cpp
for (int i = 0; i < nOutput; i++) { s += result[i]; } printf("Check sum: %lf\n", s); #endif free(input); free(weight); free(bnBias_myKernel); free(bnScale_myKernel); return ((nT2-nT1) << 16); } int kernel_256_1_out(queue &q) {
cpp
{ psb->applyRepulsionForce(timeStep, false); } } } for (int i = 0; i < m_softBodies.size(); ++i) { btSoftBody* psb = m_softBodies[i]; if (psb->isActive() && psb->m_usePostCollisionDamping) { for (int j = 0; j < psb->m_nodes.size(); ++j) { if (!psb->m_nodes[j].m_constrained)
cpp
{ CNetMsg::SP rmsg(new CNetMsg); int result = canProgress(rmsg, ch, pReformerItem, pMagnifierItem, pReformItem, packet->count, packet->grade); if ( result < 0) { SEND_Q(rmsg, ch->m_desc); return ; }
cpp
if (index == triggers_.Size()) AddTrigger(trigger); else if (index < triggers_.Size()) { triggers_[index] = trigger; Sort(triggers_.Begin(), triggers_.End(), CompareTriggers); } } void Animation::AddTrigger(const AnimationTriggerPoint& trigger)
cpp
{ MerkleTree tree = MerkleTree(); std::vector<std::string> hashes { "2a2da09e89fae0f94901eb737f5ed39dd835e4ee4be10fa1ead0416c78c29fa1", "85760bfd24bc3186e4f0bbcb95e87923c2ee1369b01103098390206d426b1681" }; std::string result = tree.root(hashes); std::string expected = "ab26e069d5612422da10856057f8f4a47585e2ca6e528a3ed045fd306e89b60c"; return IS_TRUE(result == expected); }
cpp
template <typename ColorBase, typename Color> struct color_index_type : public detail::type_to_index<typename ColorBase::layout_t::color_space_t,Color> {}; /// \brief Specifies the type of the element associated with a given color tag /// \ingroup ColorBaseAlgorithmColor template <typename ColorBase, typename Color> struct color_element_type : public kth_semantic_element_type<ColorBase,color_index_type<ColorBase,Color>::value> {}; /// \brief Specifies the return type of the mutable element accessor by color name, get_color(color_base, Color());
cpp
XLink::AddParamToHeadInt(&t, whereToMerge); XLink::AddParamToHeadInt(&t, leadingDim); } /* destroy variables */ delete[] dimSize; return t;
cpp
/** * Copyright (C) 2014 MongoDB Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3,
cpp
case ErrorCode::InadequateSecurity: return "InadequateSecurity"; case ErrorCode::Http11Required: return "Http11Required"; default: { return fmt::format("ERROR_CODE_{}", static_cast<unsigned>(ec)); } }
cpp
* Copyright (c) 2018-2020, <NAME> <<EMAIL>> * * SPDX-License-Identifier: BSD-2-Clause */ #include <Kernel/Arch/x86/IO.h> #include <Kernel/CMOS.h> namespace CMOS { u8 read(u8 index) { IO::out8(0x70, index); return IO::in8(0x71); }
cpp
private slots: void updateShear(); private: void createWidgets(); void createLayout(); void createConnections(); QDoubleSpinBox *angleSpinBox;
cpp
return absl::make_unique<OrFilter>(std::move(sub_filters)); } bool OrFilter::IsMatch(const google::protobuf::Message& message) const { for (auto& filter : sub_filters_) {
cpp
prt->print(this); } void swift::code::Code::addMacro(SpecialMacro* macro) { macros.push_back(macro); } std::vector<SpecialMacro*>& swift::code::Code::getAllMacros() { return macros; }
cpp
#include "./brotli_bit_stream.h" #include "./context.h" #include "./entropy_encode.h" #include "./fast_log.h" #include "./hash.h" #include "./metablock.h" #include "./port.h" #include "./prefix.h"
cpp
{ if(size(pitchP, height, 1, 0, 1, internalformat) > IMPLEMENTATION_MAX_IMAGE_SIZE_BYTES) { return nullptr; } return new ImageImplementation(width, height, internalformat, pitchP); } Image *Image::create(GLsizei width, GLsizei height, GLint internalformat, int multiSampleDepth, bool lockable) { if(size(width, height, 1, 0, multiSampleDepth, internalformat) > IMPLEMENTATION_MAX_IMAGE_SIZE_BYTES)
cpp
} if (sdf->HasElement("trackWidth")) { sdf->GetElement("trackWidth")->GetValue()->Get(track_width_);
cpp
pos = add(pos, mul(updir, 1.f)); HIGAN_LOGi("pos "); printfloat3(pos); REQUIRE(pos.y > 0); float4x4 rotmat = math::rotationMatrixLH(direction); HIGAN_LOGi("\nmatrix\n"); printfloat4(rotmat.row(0)); printfloat4(rotmat.row(1)); printfloat4(rotmat.row(2)); printfloat4(rotmat.row(3)); float4 pos2{}; pos2 = mul(float4(0,0,1,1), rotmat).row(0);
cpp
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /** * @author <NAME> (for AVR) * @author <NAME> (for ARM) * @author <NAME> (for ARM) */ #include "pal.h" #include "palExec.h" #include <string.h>
cpp
int findminvertex(int *weight, bool *visited, int v){ int minVertex = -1; for(int i = 0;i<V;i++){ if(!visited[i] &&(minVertex==-1 || weight[i]<weight[minVertex])){ minVertex = i; } } return minVertex; } void prims(){ bool *visited = new bool[V]; int *parent = new int[V]; int *weight = new int[V];
cpp
int buffer[] = {1}; std::ranges::zip_view r(IterNoEqualView{buffer}); auto it = r.begin(); using Iter = decltype(it); static_assert(!std::invocable<std::equal_to<>, Iter, Iter>); inequalityOperatorsDoNotExistTest(it, it); } return true; } int main(int, char**) {
cpp
sAssetBrowserSettings.nThumbSize = 128; sAssetBrowserSettings.bShowLoadedInLevel = false; sAssetBrowserSettings.bShowUsedInLevel = false; sAssetBrowserSettings.bAutoSaveFilterPreset = true; sAssetBrowserSettings.bShowFavorites = false; sAssetBrowserSettings.bHideLods = false; sAssetBrowserSettings.bAutoChangeViewportSelection = false; sAssetBrowserSettings.bAutoFilterFromViewportSelection = false;
cpp
} int main(int argc, char* argv[]) { core::argparse::Parser parser {"Cypher tool"}; auto sub = parser.add_sub_parsers(); sub->add (
cpp
// get the eye pose and projection matricies once if (!this->LeftEyePose) { this->LeftEyePose = vtkMatrix4x4::New(); this->RightEyePose = vtkMatrix4x4::New(); this->LeftEyeProjection = vtkMatrix4x4::New(); this->RightEyeProjection = vtkMatrix4x4::New(); }
cpp
if(dead) { continue; } std::pair<int, std::pair<int, int> > sc2(maxChain<3 ? -10+maxChain : maxChain, std::pair<int, int>(mSc, -sc)); if(bestSc<sc2) { bestSc = sc2;
cpp
#include "BruteForceStl.hpp" #include <iostream> #include <limits> using namespace std;
cpp
<gh_stars>0 #define BOOST_TEST_MODULE "YukariMathsTest" #include <boost/test/included/unit_test.hpp>
cpp
env, texts.Get(), styles.Get(), style_obj.Get(), base::Size::Descriptor::GetSize(size.width_), base::Size::Descriptor::GetMode(size.width_), base::Size::Descriptor::GetSize(size.height_), base::Size::Descriptor::GetMode(size.height_) )); base::Size measured_size = base::Convert::SizeConvert(size_obj.Get()); auto data = jscore::LynxValue::MakePlatformValue(lynx_new jscore::PlatformValue( env, Java_LabelMeasurer_getTextLayout(env).Get())); render_object->SetData(RenderObject::TEXT_LAYOUT, data);
cpp
result = rl; aux = (rm - rl - rh) * middle; result = result + aux; if ((n % 2) == 0) { aux = (rh) * n; } else { aux = (rh) * (n - 1); } result = result + aux; } return result;
cpp
input = analogRead(A0); //read from rotary encoder connected to A0 output = computePID(input); delay(100); analogWrite(3, output); //control the motor based on PID value } double computePID(double inp) { currentTime = millis(); //get current time elapsedTime = (double)(currentTime - previousTime); //compute time elapsed from previous computation
cpp
Version ver; ASSERT_EQ(E_SUCCESS, ver.fromString("1.")); ASSERT_EQ(ver, Version(1)); ASSERT_EQ(ver, Version(1, 0)); ASSERT_STREQ("1", ver.toString().c_str()); }
cpp
{ int num; int result; int num1 = 4; cout<<"Please type in an integer:"<<'\n'; cin >> num; result = multiply_numbers(num); cout<<"The first result is: " << result << '\n'; result = multiply_numbers(num1); cout<<"The second result is: "<<result<< '\n';
cpp
buf[buf_i] = (char*)td->alloc_->alloc(); EXPECT_NE((char*)NULL, buf[buf_i]); memset(buf[buf_i], 0, td->obj_size_); } td->count_ += td->hold_n_; while (*td->run_) { for (int64_t buf_i = 0; buf_i < td->hold_n_; ++buf_i) { td->alloc_->free(buf[buf_i]); buf[buf_i] = (char*)td->alloc_->alloc(); EXPECT_NE((char*)NULL, buf[buf_i]); } td->count_ += td->hold_n_; } for (int64_t buf_i = 0; buf_i < td->hold_n_; ++buf_i) {
cpp
// Date: 2017年7月1日 // Email: <EMAIL> // Time Complexity: O(n) // Space Complexity: O(1) class Solution { public: /** * @param string: An array of Char * @param length: The true length of the string * @return: The true length of new string */ int replaceBlank(char string[], int length) {
cpp
constexpr auto kTimelineMarkingsHeight = kTimelineHeight; constexpr auto kTimelineFontSize = kTimelineHeight * 0.75; constexpr auto kCompositionHeaderHeight = kTimelineMarkingsHeight + kTimelineHeight; constexpr auto kAddVoiceItemHeight = kTrackHeight * 0.75; constexpr auto kAddVoiceArrowHeight = kAddVoiceItemHeight * 0.25; constexpr auto kMinVoiceItemWidth = kTrackHeight; constexpr auto kFragmentArrowWidth = kStepWidth / 2; constexpr auto kFragmentFontSize = kTrackHeight * 0.75; constexpr auto kVoiceNameFontSize = kTrackHeight * 0.5; constexpr auto kVoiceNameMargin = (kTrackHeight - kVoiceNameFontSize) / 2; constexpr auto kCompositionPageSwitchMargin = 50; constexpr auto kLoopItemOffset = 2.0; constexpr auto kLoopItemHeight = 8.0; constexpr auto kCompositionFooterHeight = kLoopItemOffset + kLoopItemHeight;
cpp
} frame = process.laneDetection(frame); if (test == false) { interface.displayLanes(frame); } std::cout << "To quit press any keystroke in the window" << std::endl; // Wait for a keystroke in the window cv::waitKey(0); std::cout << "Thanks for using Vision Module app! " << std::endl;
cpp
THE SOFTWARE. ****************************************************************************/ #include "core.h" easy_int32 main(easy_int32 __arg_num,easy_char** args) { if(3 != __arg_num) {
cpp
* @return bool True/False ===================================================================================================*/ bool amLimitSwitch::check(int8_t switchName) { switch(switchName) { case frontSwitch: // If we are interested in the front limit switch
cpp
public: Node* cloneGraph(Node* node) { if (!node) return NULL; queue<Node*> q; q.push(node); copy[node] = new Node(node->val); while (!q.empty()) {
cpp
base::BindOnce(&CefPrintDialogCallbackImpl::Continue, this, settings)); } } void Cancel() override { if (CEF_CURRENTLY_ON_UIT()) { if (dialog_.get()) {
cpp
auto op_name = node.GetOpName(); dnnl::primitive_attr attr; bool has_bias = ParsingOpName(op_name, attr); // Setup attributes. auto data_entry = node.GetInputs()[0]; auto weight_entry = node.GetInputs()[1]; JSONGraphNodeEntry out_entry(nid, 0);
cpp
use type Redis; class CacheServiceProvider extends AbstractServiceProvider { protected vec<string> $provides = vec[ CacheInterface::class,
cpp
class MessageMess{ public: vector<string>arr; string s; string ans_=""; ll memo[55][55]; ll solve(int i,int ret,string S) { if(i==s.size()) { if(ret==s.size()){ ans_=S;
cpp
this->d = d; this->f = f; this->outputLocation = outputLocation; this->source = source; this->output = new PIDOutputWrapper(outputLocation); this->controller = new frc::PIDController(p, i, d, f, source, output); }
cpp
//------------------------------------------------------------------------------------------------------- // Function : MHD_AllocateElectricArray // Description : Allocate electric arrays for the coarse-grid real patches (on level lv) adjacent to the // coarse-fine boundaries // // Note : 1. Do nothing on the top level // 2. Only used in the serial mode // // Parameter : lv : Coarse-grid level //-------------------------------------------------------------------------------------------------------
cpp
string reply_str = to_string(REPLY * 10 + my_id); char * reply = new char[size_reply_buffer + 1]; reply_str.copy(reply, size_reply_buffer, 0); sendto(sockfd, (const char *)reply, strlen(reply), MSG_CONFIRM, (const struct sockaddr *) &(sender_addr), sizeof(sender_addr)); } }
cpp
bool lookupNowCalled() {return m_lookupNowCalled;} void clearLookupNowCalled() {m_lookupNowCalled = false;} void setValue(const State& state, double value, StateCacheId cache, bool update = true) { std::map<State, Value>::iterator it = m_values.find(state); if (it == m_values.end())
cpp
#include "LambertShader.h" #include "MetalNode.h" #include "MetalShader.h" #include "RenderProcedure.h" #include "utils.h" MStatus initializePlugin(MObject obj) {
cpp
along with SimpleScreenRecorder. If not, see <http://www.gnu.org/licenses/>. */ #include "VideoEncoder.h" #include "Logger.h" #include "AVWrapper.h" #include "Muxer.h"
cpp
#include "base/asynevent/impl/asynevent_win.h" void AsynEventWin::test() { // do something }
cpp
namespace script { NameLookup NameResolver::resolve(const std::shared_ptr<ast::Identifier>& name, const Scope& scp) { return NameLookup::resolve(name, scp); }
cpp
virtual QMenu* getMenu() override; virtual bool doAddAction( int& nb ) override; virtual QAction* getAction( int id ) override; public slots:
cpp
mem = block->m_water_level; if (((size_t)mem) & (alignment - 1)) { mem += (alignment - ((size_t)mem)) & (alignment - 1); } if ((block->m_heap_end >= mem) && (((size_t)block->m_heap_end - (size_t)mem) >= size)) { block->m_water_level = mem + size; return mem; } return nullptr; }
cpp
void ofApp::mouseEntered(int x, int y){ } //--------------------------------------------------------------
cpp
myDC = mDC; myPhysics = Physics; } void Bina_ActionInitialization::Build() const { bool rt = true; Bina_EventAction* Evt = new Bina_EventAction(rt); SetUserAction(new Bina_PrimaryGeneratorAction(myDC)); SetUserAction(Evt); SetUserAction(new Bina_RunAction(rt)); SetUserAction(new Bina_SteppingAction(myPhysics,Evt,rt));
cpp
/** * @brief Destructor. */ ~OptimizerContext() {} /** * @brief Gets the next ExprId. * * @return A new ExprId.
cpp
#include "sys/simulation/simulation_controller.h" #include "sys/simulation/simulation_environment.h" #include "sys/node.h" #include "sys/taggings/basic_tags.h" #include "boost/date_time/posix_time/posix_time.hpp" namespace wiselib {
cpp
// Edit the source 'source/enums/oglplus/framebuffer_attachment.txt' // or the 'source/enums/make_enum.py' script instead. // // Copyright 2010-2014 <NAME>. // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // #if OGLPLUS_DOCUMENTATION_ONLY /// COLOR_ATTACHMENT0 Color,
cpp
PushLimitDownScanEdgesAppendVerticesRule::PushLimitDownScanEdgesAppendVerticesRule() { RuleSet::QueryRules().addRule(this); } const Pattern &PushLimitDownScanEdgesAppendVerticesRule::pattern() const {
cpp
using namespace ot; extern "C" void otPlatInfraIfRecvIcmp6Nd(otInstance * aInstance, uint32_t aInfraIfIndex, const otIp6Address *aSrcAddress, const uint8_t * aBuffer, uint16_t aBufferLength) { AsCoreType(aInstance).Get<BorderRouter::RoutingManager>().RecvIcmp6Message(aInfraIfIndex, AsCoreType(aSrcAddress),
cpp
namespace wxdraw::gui { /** */ class GradientList : public PaletteList<Gradient> { using super = PaletteList<Gradient>; using super::PaletteList; protected: void onSelectItem(const PaletteItemPtr& item) override; }; }
cpp
return request_id; } void WebRTCIdentityService::CancelRequest(int request_id) { std::deque<RequestInfo>::iterator it; for (it = pending_requests_.begin(); it != pending_requests_.end(); ++it) { if (it->params.request_id != request_id) continue; if (it != pending_requests_.begin()) { pending_requests_.erase(it);
cpp
using namespace std; ifstream read("filename.txt"); const int lim=1e5+5; char ch[lim]; int main() { string name,type; while(read>>name) { name[0]='g'; name[1]='s'; ifstream in(name); ofstream out("listing_"+name); while(in>>name) {
cpp
#include <stdio.h> #include <component254/lib1.h> int component254_1 () { printf("Hello world!\n"); return 0; }
cpp
{ ERROR("Acpi: no Fixed ACPI Description Table (FACP)"); return; } // Parse the FACP parseFixedACPIDescriptionTable();
cpp
auto pen = p.pen(); auto brush = p.brush(); p.translate(r.x,r.y); const Button::Type buttonType=st.button; const bool drawBackFrame = (buttonType!=Button::T_ToolButton || st.moveOver) && (buttonType!=Button::T_FlatButton || st.pressed); if( drawBackFrame ) { if(st.pressed || st.checked!=WidgetState::Unchecked)
cpp
#include "paddle2onnx/mapper/tensor/unsqueeze2.h" namespace paddle2onnx { REGISTER_MAPPER(unsqueeze2, Unsqueeze2Mapper) int32_t Unsqueeze2Mapper::GetMinOpset(bool verbose) { if (axes_.size() == 0) { if (HasInput("AxesTensorList")) { Logger(verbose, 13) << "While AxisTensorList as input, " << RequireOpset(13) << std::endl; return 13; } else if (HasInput("AxesTensor")) { auto info = GetInput("AxesTensor"); if (!IsConstantInput("AxesTensor")) { Logger(verbose, 13)
cpp
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
cpp
void AudioSettingsWindow::BindEvents() { Bind(wxEVT_CHECKBOX, &AudioSettingsWindow::EnableAudioClicked, this, ID_AUDIO_ENABLED); Bind(wxEVT_SLIDER, &AudioSettingsWindow::MasterVolumeChanged, this, ID_MASTER_SLIDER); Bind(wxEVT_SLIDER, &AudioSettingsWindow::PulseOneVolumeChanged, this, ID_PULSE_ONE_SLIDER); Bind(wxEVT_SLIDER, &AudioSettingsWindow::PulseTwoVolumeChanged, this, ID_PULSE_TWO_SLIDER); Bind(wxEVT_SLIDER, &AudioSettingsWindow::TriangleVolumeChanged, this, ID_TRIANGLE_SLIDER); Bind(wxEVT_SLIDER, &AudioSettingsWindow::NoiseVolumeChanged, this, ID_NOISE_SLIDER); Bind(wxEVT_SLIDER, &AudioSettingsWindow::DmcVolumeChanged, this, ID_DMC_SLIDER); } void AudioSettingsWindow::DoClose() {
cpp
clk.start(); // Sleep for 2 seconds and ensure we are at tick 1 Clock::sleep(2); assertTrue(clk.getNextTick() == 1); // Sleep for 0.1 seconds and ensure we are still at tick 1 Clock::sleep(0.1); assertTrue(clk.getNextTick() == 1); // Now sleep for 0.5 seconds and we should be at tick 2 Clock::sleep(1.0); assertTrue(clk.getNextTick() == 2);
cpp
* that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "modules/rtp_rtcp/source/rtcp_packet/report_block.h" #include "modules/rtp_rtcp/source/byte_io.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" namespace webrtc {
cpp
#ifndef RBX_LLVM_INLINE_METHOD_HPP #define RBX_LLVM_INLINE_METHOD_HPP #include "llvm/jit_method.hpp" namespace rubinius { namespace jit { class RuntimeData;
cpp
// for (int ij = 0; ij < nrArcs; ++ij) // { // for (int s = 0; s < nrAnatomicalSites; ++s) // { // int size_L_s = _L[s].size(); // for (int c = 0; c < size_L_s; ++c)
cpp
} int main(int argc, char **argv) { /* * To avoid having the recursion run indefinitely, you must include a termination condition. * Another name for the exit condition is the base case. * Keep in mind that a base case is necessary for real recursion. * Without it, the recursion will keep running forever. */
cpp
#include "DebrisCarved.h" UDebrisCarved::UDebrisCarved() { this->CarverType = EDebrisCarvedType::Large; this->TerrainMaterial = NULL; this->Filter = ECarveFilterType::ReplaceAll; this->ExpensiveNoise = 0.00f; this->CarveCellSize = CarveOptionsCellSize::CARVE_CELL_SIZE_50; this->MinNumCarves = 1; this->MaxNumCarves = 1; this->CarveOffsetRadius = 0.00f; this->SpawnAttachClass = NULL; this->AttachSpawnOffsetDistance = 0.00f; }
cpp
m_rxclk = 0; m_rxlen = 8; } void sec_device::cmd_get_lst(void) { m_reply[0] = SEC_DAT; m_reply[1] = m_last; m_reply[2] = 4; // Last Command (is this really 4 bytes?) m_reply[3] = m_last; m_reply[4] = 0x00; m_reply[5] = 0x00; m_reply[6] = 0x00;
cpp
auto left = root->leftChild; auto right = root->rightChild; auto leftleft = left->leftChild; auto rightleft = right->leftChild; rightright = right->rightChild; assert(root->data.key == 3); assert(BLACK_HEIGHT(root) == 2); assert(left->data.key == 1); assert(ISBLACK(left)); assert(BLACK_HEIGHT(left) == 1); assert(left->parent == root); assert(!left->rightChild);
cpp
for(int t=0;t!=entityCount;t++) fprintf(fn,"id %d pos %3.3f %3.3f %3.3f\n", entity[t].id,entity[t].pos.x,entity[t].pos.y,entity[t].pos.z); fclose(fn); } ///////////////////////////////////////////
cpp
if ((es = ArxDbgDbEntity::dwgOutFields(filer)) != Acad::eOk) return es; filer->writeItem(m_version); filer->writeItem(static_cast<const char*>(m_dwgName)); filer->writeItem(m_blockId); return filer->filerStatus(); } /**************************************************************************** **