lang
stringclasses
10 values
seed
stringlengths
5
2.12k
cpp
// Inputs: at lease two objects of a subclass of AbstractBase. if (args_spec_list.size() < 2) { MS_LOG(EXCEPTION) << "The size of arguments of MakeRecord operator must greater than 1, but the input size is " << args_spec_list.size() << "."; } // args_spec_list[0] maybe AbstractScalarPtr or AbstractTypePtr MS_EXCEPTION_IF_NULL(args_spec_list[0]); TypePtr type = args_spec_list[0]->GetTypeTrack(); MS_EXCEPTION_IF_NULL(type);
cpp
#define EOS_SYMBOL S(4, EOS) #define DICE_SYMBOL S(4, BOCAI) #define LOG N(eosbocailogs) #define DICETOKEN N(eosbocai1111) #define DEV N(eosbocaidevv) #define PRIZEPOOL N(eosbocai1111) #define DICESUPPLY 88000000000000 typedef uint32_t eostime; // @abi table bets i64 struct st_bet
cpp
class Solution { public: int strStr(string haystack, string needle) { int n = haystack.size(); int m = needle.size(); if (m == 0) { return 0; } vector<int> pi(m); for (int i = 1, j = 0; i < m; i++) { while (j > 0 && needle[i] != needle[j]) { j = pi[j - 1]; } if (needle[i] == needle[j]) { j++;
cpp
this->matrixes.push_back(matrix); } }
cpp
#define BADSITE3 "{\"Type\":\"StationInfo\",\"Site\":{\"Station\":\"LRM\",\"Channel\":\"EHZ\",\"Network\":\"MB\",\"Location\":\"--\"},\"Enable\":true,\"Quality\":1.0,\"UseForTeleseismic\":true}" // NOLINT // test to see if the sitelist can be constructed TEST(SiteListTest, Construction) { glass3::util::Logger::disable(); printf("[ startup ]\n"); // construct a sitelist glasscore::CSiteList * testSiteList = new glasscore::CSiteList(); printf("[ construct]\n"); // assert default values
cpp
* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software
cpp
EXPECT_TRUE(IsNoMatch (CheckStates<tuple<uint64_t, TFree<uint32_t>>, tuple<uint32_t, uint32_t>>(tuple<uint64_t, TFree<uint32_t>>(UInt64_A, FreeUInt32), tuple<uint32_t, uint32_t>(UInt32_B, UInt32_A)))); } FIXTURE(UInt64) { EXPECT_TRUE(IsUnifies (CheckStates<tuple<TFree<uint64_t>>, tuple<uint64_t>> (tuple<TFree<uint64_t>>(FreeUInt64), tuple<uint64_t>(UInt64_A)))); EXPECT_TRUE(IsUnifies (CheckStates<tuple<TFree<uint64_t>>, tuple<uint64_t>> (tuple<TFree<uint64_t>>(FreeUInt64), tuple<uint64_t>(UInt64_B)))); EXPECT_TRUE(IsNoMatch (CheckStates<tuple<uint64_t>, tuple<uint64_t>> (tuple<uint64_t>(UInt64_A), tuple<uint64_t>(UInt64_B)))); EXPECT_TRUE(IsUnifies (CheckStates<tuple<uint64_t>, tuple<uint64_t>> (tuple<uint64_t>(UInt64_A), tuple<uint64_t>(UInt64_A)))); EXPECT_TRUE(IsNoMatch (CheckStates<tuple<uint64_t, TFree<uint64_t>>, tuple<uint64_t, uint64_t>>(tuple<uint64_t, TFree<uint64_t>>(UInt64_A, FreeUInt64), tuple<uint64_t, uint64_t>(UInt64_B, UInt64_A)))); EXPECT_TRUE(IsUnifies (CheckStates<tuple<uint64_t, TFree<uint64_t>>, tuple<uint64_t, uint64_t>>(tuple<uint64_t, TFree<uint64_t>>(UInt64_A, FreeUInt64), tuple<uint64_t, uint64_t>(UInt64_A, UInt64_A)))); EXPECT_TRUE(IsPrefixMatch(CheckStates<tuple<uint64_t, TFree<uint64_t>>, tuple<uint64_t, bool>>(tuple<uint64_t, TFree<uint64_t>>(UInt64_A, FreeUInt64), tuple<uint64_t, bool>(UInt64_A, Bool_A))));
cpp
// Throw an excepion if the // SetHeader method failed. CResponseWriter::ThrowOnFail(hr); // Write the IHttpCachePolicy pointer // data to the response stream. Write(policy, writer);
cpp
m_pdssci.minDepthBounds = minDepthBounds; m_pdssci.maxDepthBounds = maxDepthBounds; return *this; } Pipeline& Pipeline::addDesciptorSetLayout(const VkDescriptorSetLayout& dsl) { checkInitNotCreated(); m_descriptorSetLayouts.push(dsl); return *this; } Pipeline& Pipeline::addPushConstantRange(const VkPushConstantRange& pcr) {
cpp
} } return 0; } // } Driver Code Ends
cpp
} //TOFILL int main() {
cpp
MakeCommandCallback<HubFanControlResponse>(cb, client_data)); return result; } livox_status HubGetFanState(HubGetFanStateRequest *req, uint16_t length, HubGetFanStateCallback cb, void *client_data) { if (device_manager().device_mode() != kDeviceModeHub) { return kStatusNotSupported;
cpp
BookmarkNode* mutable_old_parent = AsMutable(old_parent); std::unique_ptr<BookmarkNode> owned_node = mutable_old_parent->Remove(old_index); BookmarkNode* mutable_new_parent = AsMutable(new_parent); mutable_new_parent->Add(std::move(owned_node), index); if (store_) store_->ScheduleSave(); for (BookmarkModelObserver& observer : observers_)
cpp
* SPDX-License-Identifier: MIT */ /* ===================================================================== */ /*! @file Replace an original function with a custom function defined in the tool. The new function can have either the same or different signature from that of its original function. */ /* ===================================================================== */ #include "pin.H" #include <iostream> using std::cout;
cpp
#include "Runtime/Particle/CParticleElectric.hpp" #include "Runtime/Particle/CParticleSwoosh.hpp" #include "Runtime/World/CEffect.hpp" #include <zeus/CVector3f.hpp>
cpp
cout << "Address : arr " << &arr << endl; strcpy(arr, "hello world!"); cout << "var:" << hex << var << endl; // 将变量 var 以 16 进制输出 cout << "arr:" << arr << endl; return 0; } /* * Address : var 0x23fe4c * Address : arr 0x23fe42 * var:11002164 * arr:hello world! * 说明:从上述代码中可以看出,变量 var 的后六位被字符串 "hello world!" 的 * "d!\0" 这三个字符改变,
cpp
} if ( m_Total_Connect_Time ) { s.WriteKeyVal( "TOTALCONNECTTIME", m_Total_Connect_Time ); } if ( m_Last_Connect_Time ) { s.WriteKeyVal( "LASTCONNECTTIME", m_Last_Connect_Time ); } if ( m_uidLastChar.IsValidUID())
cpp
///* 0x2D */ { REG_PREAMBLELSB, RF_PREAMBLESIZE_LSB_VALUE } // default 3 preamble bytes 0xAAAAAA /* 0x2E */ { REG_SYNCCONFIG, RF_SYNC_ON | RF_SYNC_FIFOFILL_AUTO | RF_SYNC_SIZE_2 | RF_SYNC_TOL_0 }, /* 0x2F */ { REG_SYNCVALUE1, 0x2D }, // attempt to make this compatible with sync1 byte of RFM12B lib /* 0x30 */ { REG_SYNCVALUE2, 0 }, // NETWORK ID /* 0x37 */ { REG_PACKETCONFIG1, RF_PACKET1_FORMAT_VARIABLE | RF_PACKET1_DCFREE_OFF | RF_PACKET1_CRC_ON | RF_PACKET1_CRCAUTOCLEAR_ON | RF_PACKET1_ADRSFILTERING_OFF }, /* 0x38 */ { REG_PAYLOADLENGTH, 66 }, // in variable length mode: the max frame size, not used in TX ///* 0x39 */ { REG_NODEADRS, nodeID }, // turned off because we're not using address filtering /* 0x3C */ { REG_FIFOTHRESH, RF_FIFOTHRESH_TXSTART_FIFONOTEMPTY | RF_FIFOTHRESH_VALUE }, // TX on FIFO not empty /* 0x3D */ { REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_2BITS | RF_PACKET2_AUTORXRESTART_ON | RF_PACKET2_AES_OFF }, // RXRESTARTDELAY must match transmitter PA ramp-down time (bitrate dependent) //for BR-19200: /* 0x3D */ { REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_NONE | RF_PACKET2_AUTORXRESTART_ON | RF_PACKET2_AES_OFF }, // RXRESTARTDELAY must match transmitter PA ramp-down time (bitrate dependent) /* 0x6F */ { REG_TESTDAGC, RF_DAGC_IMPROVED_LOWBETA0 }, // run DAGC continuously in RX mode for Fading Margin Improvement, recommended default for AfcLowBetaOn=0 {255, 0} }; digitalWrite(_slaveSelectPin, HIGH);
cpp
输出:2 解释:如果删除 [1,1,2] 和 [1,1,3] 这两条边,Alice 和 Bob 仍然可以完全遍历这个图。再删除任何其他的边都无法保证图可以完全遍历。 所以可以删除的最大边数是 2 。 示例 2: 输入:n = 4, edges = [[3,1,2],[3,2,3],[1,1,4],[2,1,4]]
cpp
/// </summary> Low, /// <summary> /// 中 /// </summary> Medium, /// <summary> /// 高 /// </summary> High, /// <summary> /// デフォルト [低]
cpp
mvLog(MVLOG_ERROR,"disconnecting XLink. status = %d", xlink_ret); // ToDo: convert from XLink to errno ret = EIO; goto exit; }
cpp
} int evaluationPostfix(string s){ stack<char> st; int x1,x2,r; for(int i=0;i<s.size();i++){ if(isOperand(s[i])){ st.push(s[i]-'0'); }
cpp
* 1 ~ h までの足場がある。最小は n 個の足場しか出現していないが * x でレバーを引くとxとx-1の出現状況がそれぞれ反転する * この事象とクリスタルをうまく使って 0 地点までたどり着くのをシミュレーション */ void Main() { int Q; cin >> Q; rep(q, Q) { int H, N; cin >> H >> N; vector<int> P(N); rep(i, N) cin >> P[i]; P.push_back(-10);
cpp
public: int maxTurbulenceSize(vector<int>& A) { int inc = 1, dec = 1, ans = 1, n = A.size(); for(int i = 1; i < n; ++i) { int a = A[i - 1], b = A[i]; if (a < b) { tie(inc, dec) = make_tuple(dec + 1, 1); } else if (a > b) { tie(inc, dec) = make_tuple(1, inc + 1); } else { tie(inc, dec) = make_tuple(1, 1); } ans = max(ans, inc); ans = max(ans, dec); }
cpp
double calculateSpeedError(double desired_speed, double actual_speed); /** * @brief Getters and setters for the errors in heading angle of the robot in the robot frame and its linear speed * */ void setHeadingError(double);
cpp
void SetUp() { // code here will execute just before the test ensues LOGGER_INSTANCE setLogLevel(ERROR); pks = SQLiteStoreConv::getStore(); pks->setKey(std::string((const char*)keyInData, 32)); pks->openStore(std::string()); } void TearDown() { // code here will be called just after the test completes
cpp
#define BITS_TO_BYTES(x) ((x + 7) / 8) #define BITS_TO_WORDS(x) ((x + 63) / 64) #define POS_TO_BYTE_INDEX(p) (p / 8) #define POS_TO_BIT_INDEX(p) (p % 8) FORCE_INLINE bool bitMapGetBit(const uint8_t* bmap, int64_t position) {
cpp
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * 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. * ****************************************************************************/ /**
cpp
void rpc_id(fc::variant); fc::optional<fc::variant> rpc_id() const; // Pass result to remote connection void result(fc::optional<fc::variant> result); void unsafe_result(fc::optional<fc::variant> result);
cpp
, &qtnCreateDelegate<QtnPropertyDelegateGeoCoord, QtnPropertyDoubleBase> , "GeoCoord"); } QString val2strGeoCoord(const qreal c) { QString s; s = c < 0 ? "-" : ""; qreal r = qAbs(c); int deg = static_cast<int>(r); r -= deg; r *= 60;
cpp
//Se A for vdd if(a) { printf("\n A eh verdadeiro"); }
cpp
IMPLEMENT_REPLY(MapVisitorReply) IMPLEMENT_COMMAND(EmptyBucketsCommand, EmptyBucketsReply) IMPLEMENT_REPLY(EmptyBucketsReply) MapVisitorCommand::MapVisitorCommand()
cpp
#include "hcimsgs.h" #include "osi/include/allocator.h" static const allocator_t* buffer_allocator; static BT_HDR* make_packet(size_t data_size); static BT_HDR* make_command_no_params(uint16_t opcode); static BT_HDR* make_command(uint16_t opcode, size_t parameter_size, uint8_t** stream_out); // Interface functions static BT_HDR* make_reset(void) { return make_command_no_params(HCI_RESET); }
cpp
llvm::cast<llvm::CallBase>(CallStmt), DestMthd); } std::shared_ptr<FlowFunction<IDEGeneralizedLCA::d_t>> IDEGeneralizedLCA::getRetFlowFunction(IDEGeneralizedLCA::n_t CallSite, IDEGeneralizedLCA::f_t CalleeMthd, IDEGeneralizedLCA::n_t ExitStmt, IDEGeneralizedLCA::n_t /*RetSite*/) { assert(llvm::isa<llvm::CallBase>(CallSite)); // std::cout << "Ret flow: " << llvmIRToString(ExitStmt) << std::endl; /*return std::make_shared<MapFactsToCaller>( llvm::ImmutableCallSite(callSite), calleeMthd, exitStmt,
cpp
// Boolean value : true = 1 & false = 0 if (true) max(a,b) else std::cout << "Macro failed." << std::endl; return 0; } */ // This will always give the output as "Macro failed." because the compiler will look at the code as shown below : /* #include <iostream> using namespace std;
cpp
ut.GetDescriptor()->file()->CopyTo(&file_desc_proto); std::string file_desc_str; file_desc_proto.SerializeToString(&file_desc_str); EXPECT_TRUE(factory->RegisterPythonMessage(file_desc_str)); proto_desc.set_desc(file_desc_str); std::string proto_desc_str; proto_desc.SerializeToString(&proto_desc_str); EXPECT_TRUE(factory->RegisterMessage(proto_desc_str)); EXPECT_TRUE(factory->RegisterMessage(file_desc_proto)); EXPECT_TRUE(factory->RegisterMessage(*(ut.GetDescriptor()))); EXPECT_TRUE(factory->RegisterMessage(ut));
cpp
hdc = BeginPaint(hwnd, &ps); Memhdc = CreateCompatibleDC(hdc); Membitmap = CreateCompatibleBitmap(hdc, win_width, win_height); SelectObject(Memhdc, Membitmap); FillRect(Memhdc, &WBounds, WHITE_BRUSH); view_matrix_t vm = RPM<view_matrix_t>(moduleBase + dwViewMatrix);
cpp
static int inc(int num) { num++; if (repeat > 0) num %= repeat; return num; }
cpp
suffix_array(suffix_array) {} MatchingsFinder::MatchingsFinder() {} MatchingsFinder::~MatchingsFinder() {} PhraseLocation MatchingsFinder::Find(PhraseLocation& location, const string& word, int offset) { if (location.sa_low == -1 && location.sa_high == -1) {
cpp
const struct CVehicleHandlingData_1604 { DWORD dwHandlingNameHash = 0x0008; int fMass = 0x000C; int fInitialDragCoeff = 0x0010; int fDownforceModifier = 0x0014; // 0x0018 // 0x001C vec3Offset vecCentreOfMass = { 0x0020, 0x0024, 0x0028 };
cpp
int tmp; vector<int> v; for (int i=0; i<n; ++i){ scanf("%d", &tmp); v.push_back(tmp);
cpp
*/ void init(unsigned size, SimpleFreeList *_freeList, RegIndex _zeroReg); /** * Pair of a physical register and a physical register. Used to * return the physical register that a logical register has been * renamed to, and the previous physical register that the same * logical register was previously mapped to. */ typedef std::pair<PhysRegIdPtr, PhysRegIdPtr> RenameInfo; /** * Tell rename map to get a new free physical register to remap
cpp
//H 04: <t_2_009.cpp> //H 05: $B(t_2_009.cpp) ($B(t_2_009.cpp)) //H 10: t_2_009.cpp(15): #if //H 11: t_2_009.cpp(15): #if !defined(FILE_002_009_CPP) : 0 //H 06: //H 19: $B(t_2_009.cpp): FILE_002_009_CPP //H 10: t_2_009.cpp(29): #include //H 01: t_2_009.cpp(19): USER_HEADER
cpp
if (line[loncol].empty() || line[latcol].empty()) { static int warned = 0; if (!warned) { fprintf(stderr, "%s:%zu: null geometry (additional not reported)\n", fname.c_str(), seq + 1); warned = 1; } continue;
cpp
operations_->AddComDllList(options_, com_dll_list); } void Product::AppendProductFlags(base::CommandLine* command_line) const { operations_->AppendProductFlags(options_, command_line); } void Product::AppendRenameFlags(base::CommandLine* command_line) const { operations_->AppendRenameFlags(options_, command_line); } bool Product::SetChannelFlags(bool set, ChannelInfo* channel_info) const {
cpp
#include <SF/SerializeStl.hpp> namespace SF { // std::deque template<typename T, typename A> inline void serialize(SF::Archive &ar, std::deque<T,A> &t, const unsigned int version) { serializeStlContainer<PushBackSemantics>(ar, t, version);
cpp
height = in_height; } Inheritance::Square::Square(float in_side) { side = in_side; }
cpp
CursorMap[ImGuiMouseCursor_ResizeEW] = IDC_SIZEWE; CursorMap[ImGuiMouseCursor_ResizeNESW] = IDC_SIZENESW; CursorMap[ImGuiMouseCursor_ResizeNWSE] = IDC_SIZENWSE; CursorMap[ImGuiMouseCursor_Hand] = IDC_HAND; }
cpp
// 找到所有深度为 depth - 1 的节点,然后用 val 构造的新节点替换,替换时要注意顺序 std::vector<TreeNode*> depth_1_nodes = [root, &depth]() { std::vector<TreeNode*> cur, next; // 层序遍历当前层,下一层 cur.push_back(root); while (--depth) { for (auto t: cur) { if (t->left) next.push_back(t->left); if (t->right) next.push_back(t->right); }
cpp
#define _CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h> BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH:
cpp
class VulkanApp : public AbstractApp { protected: utils::Result<utils::Void> EarlyInitialize() override; utils::Result<utils::Void> LateInitialize() override; utils::Result<utils::Void> SetupSDL() final; utils::Result<utils::Void> SetupGfxAPI() final;
cpp
{ cin >> arr[i]; } sol.DNFSortAlgorithm(arr, size); //function call cout << "Sorted Array: " << endl; for (int i = 0; i < size; i++) //print the sorted array {
cpp
void PID::checkParameters() { if (_dt <= 0.0) { throw std::domain_error("dt must be positive and non-zero"); } else if (_Kp <= 0 || _Ki <= 0 || _Kd <= 0) { throw std::domain_error("gains must be positive and non-zero"); } }
cpp
} }; // Writing MetadataGetter for method: VROSC::WidgetController::OnDestroy // Il2CppName: OnDestroy template<> struct ::il2cpp_utils::il2cpp_type_check::MetadataGetter<static_cast<void (VROSC::WidgetController::*)()>(&VROSC::WidgetController::OnDestroy)> { static const MethodInfo* get() { return ::il2cpp_utils::FindMethod(classof(VROSC::WidgetController*), "OnDestroy", std::vector<Il2CppClass*>(), ::std::vector<const Il2CppType*>{}); } }; // Writing MetadataGetter for method: VROSC::WidgetController::Toggle
cpp
// regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 //
cpp
using namespace llvm; using namespace std; namespace klee { std::string Utils::to_const_bitvec(unsigned i) { std::stringstream stream;
cpp
#include "WbLens.hpp" void WbLens::init() { mCenter = findSFVector2("center"); mRadialCoefficients = findSFVector2("radialCoefficients"); mTangentialCoefficients = findSFVector2("tangentialCoefficients"); }
cpp
#include "../settings/globals.h" #include "../imgui/imgui.h" namespace features { void aimlines(ImDrawList* draw_list) //I need to figure out how to make the lines not render through walls. { CGameTrace trace, _trace; CTraceFilter filter; Ray_t ray, _ray; Vector start, end, forward; QAngle entity_angles; if (!g::local_player)
cpp
const static int kFindObjDuration = 44; private: ProcessingTime pt; int depo = 0; int magnitflag = 1; int magnitlag = 0; int should_deposit =1; int deposit_num = 0; void magnit (char x); }; // World2 class Game1_Masuda : public UserGame1
cpp
ASSERT_FALSE(engine.CompileJavaScriptFile("/path/to/file")); } TEST(ScriptingTests, TestEngineCompilesCorrectFilePath) {
cpp
DisableJmpi = false; DisableVectorDecomposition = false; DisableJumpTables = false; WarnCallable = false; EmulateLongLong = false; HasAdd64 = false; UseMulDDQ = false; OCLRuntime = false; HasSwitchjmp = false; WaNoMaskFusedEU = false; HasIntDivRem32 = false; HasBitRotate = false; if (StackScratchMem) StackSurf = PreDefined_Surface::PREDEFINED_SURFACE_T255;
cpp
for (auto cur: numbers) { ++i; int toFind = target - cur; if (base.count(toFind)) { vector<int> ret; ret.push_back(base[toFind]); ret.push_back(i); return ret; } base[cur] = i; } return vector<int>();
cpp
#include "misc.h" #include "mayurc.h" #include "windowstool.h" #include "dlgeditsetting.h" #include "layoutmanager.h" #include <windowsx.h> ///
cpp
void deleteNote(Note const& note) { notes_.erase(note.id()); removeFromIndex(titleIndex_, note.title(), note.id()); removeFromIndex(textIndex_, note.text(), note.id());
cpp
#include "common.h" #include "WorkerManager.h" void WorkerManager::update() { handleIdleWorkers(); }
cpp
template<> struct hz_serializer<Value> : identified_data_serializer { static int32_t get_factory_id() noexcept { return 1; } static int32_t get_class_id() noexcept { return 6; }
cpp
}); })); } bool verify(VerificationSetting&) { constexpr auto ERROR_THRESHOLD = 0.05; // Trigger writeback C_buffer.reset();
cpp
#include "step_activation_function.hpp" #include "rectified_activation_function.hpp" #include "sigmoid_activation_function.hpp" #include "input_synapse.hpp" #include "synapse.hpp" #include "neuron.hpp" func main() -> int { sigmoid_activation_function saf{0.5}; rectified_activation_function raf{}; step_activation_function taf{0.0};
cpp
#include "tensorflow/core/platform/env.h" #include "tensorflow/core/platform/file_system.h" #include "tensorflow/core/platform/path.h" #include "tensorflow/core/platform/platform.h" #include "tensorflow/core/platform/status.h"
cpp
PrefersColorSchemeTest() : theme_client_(&test_theme_) { feature_list_.InitWithFeatureState(features::kWebUIDarkMode, GetParam()); } ~PrefersColorSchemeTest() override {
cpp
} void QCGLView::setIMEKeyboardState(bool) { } void QCGLView::setViewName(const char* pszViewName) { } void QCGLView::setFrameSize(float width, float height)
cpp
alloc.allocate(stack_ctx, stack_size); my_context = bc::make_fcontext( stack_ctx.sp, stack_ctx.size, sf); #elif BOOST_VERSION >= 105300 size_t stack_size = FC_CONTEXT_STACK_SIZE; void* stackptr = alloc.allocate(stack_size); my_context = bc::make_fcontext( stackptr, stack_size, sf); #else size_t stack_size = FC_CONTEXT_STACK_SIZE; my_context.fc_stack.base = alloc.allocate( stack_size ); my_context.fc_stack.limit = static_cast<char*>( my_context.fc_stack.base) - stack_size; make_fcontext( &my_context, sf ); #endif }
cpp
*/ #include <bits/stdc++.h> using namespace std; void fract(int a, int b) { if(b==0||a==0) return; if(b%a==0) {
cpp
for (auto &vec:m) { if (vec.second.size()==1) { deq.push_back(vec.first); cout<<"add "<<vec.first<<endl; } } while (n>2) { int dl= deq.size(); n-=dl; for (int i=0;i<dl;i++) {
cpp
address.sin_addr.s_addr = INADDR_ANY; address.sin_port = htons(port); int bind_got = bind(sock, (const struct sockaddr*)&address, sizeof(address)); if (0 != bind_got) { lll("got %x from bind, expected 0\n", bind_got); std::exit(-1); } int listen_got = listen(sock, 1);
cpp
succeeded = true; } else if (kind == ActivationKind::StartupTask) { auto startupArgs = args.as<IStartupTaskActivatedEventArgs>(); if (startupArgs.TaskId() == L"this_is_a_test") { // Signal event that startuptask was activated. SignalPhase(c_testStartupPhaseEventName); succeeded = true; } } if (!succeeded) {
cpp
printf("error: %e (%s)\n", error, error == 0.0 ? "PASS" : "FAIL"); hipFree(d_x); hipFree(d_y); hipFree(d_z); free(x); free(y); free(z);
cpp
#ifndef __UNIX_DIRECTORYSPECIFICATION_PRIVATE_H #define __UNIX_DIRECTORYSPECIFICATION_PRIVATE_H #endif #endif
cpp
float minSide = MIN(wsize.x, wsize.y); ImVec2 arsize = ImVec2(minSide * AR, minSide); // Texture loading ImGui::Image((void*)(intptr_t)image->GetTexture()->GetTextureID(), arsize); ImGui::End(); } void ImageEditor::ShowParameters() { if (ImGui::CollapsingHeader("Color Editors")) {
cpp
// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "TimelineBlueprintHelpers.h" #include "Engine.h" #include "TimelineGameSubsystem.h"
cpp
auto root = _volume->open_root(); if (root == nullptr) { close(); errno = EINVAL; return false; } _root = new object; bool success = _root->open(this, root); delete root;
cpp
MEMTYPE_ENTRY(M_POLAR_DEV), MEMTYPE_ENTRY(M_POLAR_IOQ), MEMTYPE_ENTRY(M_PANGU_DEV), MEMTYPE_ENTRY(M_PANGU_IOQ), MEMTYPE_ENTRY(M_PANGU_TASK), MEMTYPE_ENTRY(M_DISK_DEV), MEMTYPE_ENTRY(M_DISK_IOQ), MEMTYPE_ENTRY(M_DISK_DIOBUF), MEMTYPE_ENTRY(M_DENO_VECT), MEMTYPE_ENTRY(M_CHUNK_META), MEMTYPE_ENTRY(M_CHUNK_READSTREAM),
cpp
return points; } auto compute_welzl(const std::vector<Point>& points) { return DwellRegions::welzl(points, {}); }
cpp
const size_t num_strips = 1; strip_data strips[num_strips] = {}; LPD8806_IO_init(num_strips); usb_init(); while (!usb_configured()) /* wait */ ; while (!usb_is_connected()) /* wait */ ; usb_serial_flush_input(); while (1) { uint8_t index = usb_serial_blocking_read(); if(!(index & 0x80)) index = usb_serial_blocking_read(); // dropped byte uint8_t color_byte = usb_serial_blocking_read();
cpp
#include "qgsspatialitesourceselect.h" #endif #include "qgslogger.h" #include "qgsmimedatautils.h" #include "qgsvectorlayerexporter.h" #include "qgsmessageoutput.h" #include "qgsvectorlayer.h" #include "qgssettings.h" #include <QAction> #include <QFileDialog> #include <QMessageBox>
cpp
FAC_GPIO, FAC_POWER, FAC_SENSOR, FAC_DEVICE }facility_t; static ErrorMgr *shared() { if(!sharedInstance){ sharedInstance = new ErrorMgr; } return sharedInstance; }
cpp
} API_EXPORT int API_CALL mk_media_source_get_reader_count(const mk_media_source ctx){ assert(ctx); MediaSource *src = (MediaSource *)ctx; return src->readerCount(); } API_EXPORT int API_CALL mk_media_source_get_total_reader_count(const mk_media_source ctx){ assert(ctx); MediaSource *src = (MediaSource *)ctx; return src->totalReaderCount(); }
cpp
HANDLE_SPUT_X_JUMBO(OP_SPUT_OBJECT_VOLATILE_JUMBO, "-object-volatile/jumbo", ObjectVolatile, _AS_OBJECT) OP_END
cpp
D[index[0]] = D[index[0]] + B[index[0]] - C[index[0]]; }); }); auto FinalD = BufD.get_access<access::mode::read>(); std::cout << "Result:" << std::endl; for (size_t i = 0; i < N; i++) { // A[index[0]] = index[0]; int A = i;
cpp
const vaddr_t element; /// 配列/vectorの要素数 const unsigned int num; /** * Allocate a new basic type to memory. * @param memory
cpp
#include "observer.h"
cpp
return SL_RESULT_PARAMETER_INVALID; } const CodecDescriptor *cd = codecDescriptors; SLuint32 index; if (NULL == pDescriptor) { for (index = 0 ; NULL != cd->mDescriptor; ++cd) { if (cd->mCodecID == codecId) { ++index; } } *pIndex = index; return SL_RESULT_SUCCESS;
cpp
VERIFY_NOT_REACHED(); } void DynamicParser::enable_aml_interpretation() { // FIXME: Implement AML Interpretation VERIFY_NOT_REACHED();
cpp
ALLOCCONSOLE() hooks::Initialize(); while (true) { if (GetAsyncKeyState(VK_DELETE) & 1) break; Sleep(100); } FreeLibraryAndExitThread(static_cast<HMODULE>(lpParameter), EXIT_SUCCESS); } BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) { if (dwReason == DLL_PROCESS_ATTACH)
cpp
// // Created by 11409 on 2021/5/13. // #include "CommandLinePlayer.hpp" CommandLinePlayer::CommandLinePlayer(int color) { this->playerColor = color; }
cpp
boost::filesystem::create_directories(pathTemp); mapArgs["-datadir"] = pathTemp.string(); pblocktree = new CBlockTreeDB(1 << 20, true); pcoinsdbview = new CCoinsViewDB(1 << 23, true); pcoinsTip = new CCoinsViewCache(pcoinsdbview); InitBlockIndex(); #ifdef ENABLE_WALLET bool fFirstRun; pwalletMain = new CWallet("wallet.dat"); pwalletMain->LoadWallet(fFirstRun); RegisterValidationInterface(pwalletMain); #endif nScriptCheckThreads = 3; for (int i=0; i < nScriptCheckThreads-1; i++)
cpp
#endif } if (generate_mode) { generate(design, generate_cells, generate_ports); return; } log_push(); if (top_mod == nullptr) for (auto mod : design->modules())
cpp
switch (evt.act) { case action::ALLOCATE: return "allocate"; case action::FREE: return "free"; default: return "allocate failure"; } }()}; const auto format_width{9};
cpp
{ playerId = new unsigned; discard = new bool; *playerId = 0; *discard = false; value = nullptr; suit = nullptr; }
cpp
addr.sin6_addr = *reinterpret_cast<const in6_addr *>(cmp); addr.sin6_family = AF_INET6; reverse = DNS::getHostnameByAddress<struct sockaddr_in6>(&addr); break; }