text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|> const Payload& get_payload() const { return m_payload; } bool operator==(const ReferenceBase<Payload>& in_ref) const { return (m_payload == in_ref.m_payload); } bool operator!=(const ReferenceBase<Payload>& in_ref) const ...
code_fim
hard
{ "lang": "cpp", "repo": "jafffy/VKGL", "path": "/include/OpenGL/reference.h", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> trans_m->set_streaming_width(4); trans_m->set_byte_enable_ptr(0); trans_m->set_dmi_allowed(false); if(size ==1) { //temp_t = data_s; trans_m->set_data_length(1); } else if(size == 2){ //temp_t = data_s; trans_m->set_dat...
code_fim
hard
{ "lang": "cpp", "repo": "TAKE72K/ESL", "path": "/FINAL/platform/DMA.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: TAKE72K/ESL path: /FINAL/platform/DMA.cpp #include "DMA.h" void DMA::b_transport(tlm::tlm_generic_payload& trans, sc_time& delay1){ tlm::tlm_command cmd_s = trans.get_command(); sc_dt::uint64 addr_s = trans.get_address(); unsigned char* data_s = trans.get_data_ptr(); //unsigned int len = tr...
code_fim
hard
{ "lang": "cpp", "repo": "TAKE72K/ESL", "path": "/FINAL/platform/DMA.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> int main(){ while(~scanf("%d",&N)){ for(int i=1;i<=N;i++) scanf("%d",&a[i]); sort(a+1,a+N+1); dp[1]=a[1]; dp[2]=a[2]; for(int i=3;i<=N;i++) dp[i]=min(dp[i-1] + a[1] + a[i],dp[i-2] + a[1] + a[i] + 2*a[2]); printf(...
code_fim
medium
{ "lang": "cpp", "repo": "Linzecong/My-ACM-Code", "path": "/POJ/3404/10385781_AC_16ms_704kB.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> sort(a+1,a+N+1); dp[1]=a[1]; dp[2]=a[2]; for(int i=3;i<=N;i++) dp[i]=min(dp[i-1] + a[1] + a[i],dp[i-2] + a[1] + a[i] + 2*a[2]); printf("%d\n",dp[N]); } return 0; }<|fim_prefix|>// repo: Linzecong/My-ACM-Code path: /POJ/3404/10385781_...
code_fim
medium
{ "lang": "cpp", "repo": "Linzecong/My-ACM-Code", "path": "/POJ/3404/10385781_AC_16ms_704kB.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Linzecong/My-ACM-Code path: /POJ/3404/10385781_AC_16ms_704kB.cpp #include <iostream> #include <stdio.h> #include <stdlib.h> #include <vector> #include <map> #include <string.h> #include <algorithm> #include <queue> #define INF 1<<29 using namespace std; <|fim_suffix|> while(~scanf("%d",&N...
code_fim
medium
{ "lang": "cpp", "repo": "Linzecong/My-ACM-Code", "path": "/POJ/3404/10385781_AC_16ms_704kB.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>sd::LongType AllocationEntry::numBytes() { return _numBytes; } MemoryType AllocationEntry::memoryType() { return _memoryType; } } // namespace memory } // namespace sd<|fim_prefix|>// repo: deeplearning4j/deeplearning4j path: /libnd4j/include/memory/impl/AllocationEntry.cpp /* ************************...
code_fim
medium
{ "lang": "cpp", "repo": "deeplearning4j/deeplearning4j", "path": "/libnd4j/include/memory/impl/AllocationEntry.cpp", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|>// repo: jarven-zhang/paas_smsp path: /sudao-smsp/01_trunk/source/smsp_c2s/CMPPSocketHandler.cpp #include "CMPPSocketHandler.h" #include <stdlib.h> #include <stdio.h> #include <iostream> #include <string> #include <sstream> #include <fstream> #include <vector> #include "UrlCode.h" #include "propertyutil...
code_fim
hard
{ "lang": "cpp", "repo": "jarven-zhang/paas_smsp", "path": "/sudao-smsp/01_trunk/source/smsp_c2s/CMPPSocketHandler.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> if (resp.Unpack(reader)) { if(reader.GetSize() < resp._totalLength - 12) { reader.SetGood(false); return reader; } if(resp._commandId == CMPP_CONNECT) { /////LogDebug("cmpp_connect commandLength[%d],commandId:0x[%x],seque...
code_fim
hard
{ "lang": "cpp", "repo": "jarven-zhang/paas_smsp", "path": "/sudao-smsp/01_trunk/source/smsp_c2s/CMPPSocketHandler.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>public: TextMap(); TextMap(const QSize& levelSize, int levelNumber); TextMap(const TextMap& otherLevel); TextMap(const TextMap&& otherLevel); TextMap(const Map* map); protected: void init(const QSize& levelSize, int levelNumber); void clear(); public: bool isEmpty() const...
code_fim
hard
{ "lang": "cpp", "repo": "bulmaxvad/QtSokoban", "path": "/Source/Map/TextMap.h", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> // Comments // ~~~~~~~~ // // 0 1 2 3 4 5 6 -- ширина уровня // [.][.][.][.][.][.][.][.] // [.][.][.][.][.][.][.] // [.][.][.][.][.] // [.][.][.][.][.][.][.][.][.] // [.][.][.][.][.] // [.][.][.][.][.] // [.][.][.][.][.][.][.][.] #endif // TEXTMAPLEVEL_H<|fim_prefix|>// repo: bulmaxvad/QtSokob...
code_fim
hard
{ "lang": "cpp", "repo": "bulmaxvad/QtSokoban", "path": "/Source/Map/TextMap.h", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> class CRuntime_Dictionary { public: static void Bind(CVirtualMachine* machine); }; #endif<|fim_prefix|>// repo: TLeonardUK/ZombieGrinder path: /Source/XScript/VirtualMachine/Runtime/CRuntime_Dictionary.h /* ***************************************************************** <|fim_middle|> CRuntime_Di...
code_fim
hard
{ "lang": "cpp", "repo": "TLeonardUK/ZombieGrinder", "path": "/Source/XScript/VirtualMachine/Runtime/CRuntime_Dictionary.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: TLeonardUK/ZombieGrinder path: /Source/XScript/VirtualMachine/Runtime/CRuntime_Dictionary.h /* ***************************************************************** CRuntime_Dictionary.h Copyright (C) 2012 Tim Leonard - All Rights Reserved <|fim_suffix|>class CVirtualMachine; class CRuntime_...
code_fim
medium
{ "lang": "cpp", "repo": "TLeonardUK/ZombieGrinder", "path": "/Source/XScript/VirtualMachine/Runtime/CRuntime_Dictionary.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>{ public: static void Bind(CVirtualMachine* machine); }; #endif<|fim_prefix|>// repo: TLeonardUK/ZombieGrinder path: /Source/XScript/VirtualMachine/Runtime/CRuntime_Dictionary.h /* ***************************************************************** CRuntime_Dictionary.h Copyright (C) 2012 Tim Leon...
code_fim
medium
{ "lang": "cpp", "repo": "TLeonardUK/ZombieGrinder", "path": "/Source/XScript/VirtualMachine/Runtime/CRuntime_Dictionary.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>JsonValue TlsValidationContextSdsTrust::Jsonize() const { JsonValue payload; if(m_secretNameHasBeenSet) { payload.WithString("secretName", m_secretName); } return payload; } } // namespace Model } // namespace AppMesh } // namespace Aws<|fim_prefix|>// repo: aws/aws-sdk-cpp path: /genera...
code_fim
hard
{ "lang": "cpp", "repo": "aws/aws-sdk-cpp", "path": "/generated/src/aws-cpp-sdk-appmesh/source/model/TlsValidationContextSdsTrust.cpp", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|>// repo: sunooms/learn path: /gtest/gtest_demo_2/sample2.h #ifndef GTEST_SAMPLES2_H_ #define GTEST_SAMPLES2_H_ #include <string.h> // a simple string class class MyString { private: const char* c_string_; const MyString& operator=(const MyString& rhs); <|fim_suffix|> size_t ...
code_fim
hard
{ "lang": "cpp", "repo": "sunooms/learn", "path": "/gtest/gtest_demo_2/sample2.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> size_t Length() const{ return c_string_ == NULL ? 0 : strlen(c_string_); } // set the 0-terminated c string this MyString object represents void Set(const char* c_string); }; #endif<|fim_prefix|>// repo: sunooms/learn path: /gtest/gtest_demo_2/sample2.h #ifnd...
code_fim
medium
{ "lang": "cpp", "repo": "sunooms/learn", "path": "/gtest/gtest_demo_2/sample2.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Tanish74/Code-and-Compile path: /Choose items for highest discount.cpp #include <bits/stdc++.h> using namespace std; int main(int argc, char** argv) <|fim_suffix|>cin>>n; string item,lowestdisitemname; while(ctr<n) { cin>>item>>price>>discount; int currdisamt=price*discount/100; if...
code_fim
medium
{ "lang": "cpp", "repo": "Tanish74/Code-and-Compile", "path": "/Choose items for highest discount.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> if(ctr==0) { lowestdisitemname=item; lowestdis=currdisamt; } else { if(currdisamt<lowestdis) { lowestdis=currdisamt; lowestdisitemname=item; } } ctr++; } cout<<lowestdisitemname; }<|fim_prefix|>// repo: Tanish74/...
code_fim
medium
{ "lang": "cpp", "repo": "Tanish74/Code-and-Compile", "path": "/Choose items for highest discount.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>}; extern "C" HttpServlet* createManageLaunchProcedureServlet(); extern "C" void destroyManageLaunchProcedureServlet(HttpServlet* s); #endif<|fim_prefix|>// repo: querrec/Mascaret path: /Dev/C++/Mascaret/include/Tools/Network/Servlets/ManageLaunchProcedureServlet.h #ifndef MANAGE_LAUNCH_PROCEDURE_SERVL...
code_fim
medium
{ "lang": "cpp", "repo": "querrec/Mascaret", "path": "/Dev/C++/Mascaret/include/Tools/Network/Servlets/ManageLaunchProcedureServlet.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: querrec/Mascaret path: /Dev/C++/Mascaret/include/Tools/Network/Servlets/ManageLaunchProcedureServlet.h #ifndef MANAGE_LAUNCH_PROCEDURE_SERVLET_H #define MANAGE_LAUNCH_PROCEDURE_SERVLET_H 1 #include "httpServer/httpServlet.h" <|fim_suffix|>{ void manageRequest(HttpRequest* req); }; extern "C" ...
code_fim
easy
{ "lang": "cpp", "repo": "querrec/Mascaret", "path": "/Dev/C++/Mascaret/include/Tools/Network/Servlets/ManageLaunchProcedureServlet.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: anonymouss/cpp_notes path: /head_first_design_patterns/04_Factory/04_factory_method/inc/ChicagoPizzaStore.h #ifndef __CHICAGO_PIZZA_STORE_H__ #define __CHICAGO_PIZZA_STORE_H__ <|fim_suffix|>public: virtual ~ChicagoPizzaStore() = default; virtual std::unique_ptr<IPizza> orderPizza(Pizza...
code_fim
medium
{ "lang": "cpp", "repo": "anonymouss/cpp_notes", "path": "/head_first_design_patterns/04_Factory/04_factory_method/inc/ChicagoPizzaStore.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>public: virtual ~ChicagoPizzaStore() = default; virtual std::unique_ptr<IPizza> orderPizza(PizzaType type) final; protected: virtual std::unique_ptr<IPizza> createPizza_l(PizzaType type) final; }; #endif // __CHICAGO_PIZZA_STORE_H__<|fim_prefix|>// repo: anonymouss/cpp_notes path: /head_f...
code_fim
medium
{ "lang": "cpp", "repo": "anonymouss/cpp_notes", "path": "/head_first_design_patterns/04_Factory/04_factory_method/inc/ChicagoPizzaStore.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: arunkumarcea/ahir path: /ericsson/wrapper/wrapper_lib.hh #include <stdint.h> uint64_t swap_bytes64(uint64_t x); // in wrapper_lib.aa void send_packet(uint32_t pkt); // in wrapper_lib.aa <|fim_suffix|>uint32_t ahir_packet_get(); // in wrapper_lib.aa void ahir_packet_free(uint32_t pkt); // in wr...
code_fim
easy
{ "lang": "cpp", "repo": "arunkumarcea/ahir", "path": "/ericsson/wrapper/wrapper_lib.hh", "mode": "psm", "license": "NCSA", "source": "the-stack-v2" }
<|fim_suffix|>uint32_t ahir_packet_get(); // in wrapper_lib.aa void ahir_packet_free(uint32_t pkt); // in wrapper_lib.aa<|fim_prefix|>// repo: arunkumarcea/ahir path: /ericsson/wrapper/wrapper_lib.hh #include <stdint.h> uint64_t swap_bytes64(uint64_t x); // in wrapper_lib.aa void send_packet(uint32_t pkt); // in wra...
code_fim
easy
{ "lang": "cpp", "repo": "arunkumarcea/ahir", "path": "/ericsson/wrapper/wrapper_lib.hh", "mode": "spm", "license": "NCSA", "source": "the-stack-v2" }
<|fim_suffix|> // Create mesh for the model. Mesh processMesh(aiMesh *mesh, const aiScene *scene); // Checks all material textures of a given type and loads the textures if they're not loaded yet. // the required info is returned as a Texture struct. std::vector<Texture> loadMaterialTextures(...
code_fim
hard
{ "lang": "cpp", "repo": "GChasing/heli-gym", "path": "/heligym/envs/renderer/src/model.h", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>{ public: CSGLight(double x, double y, double z) : m_x(x), m_y(y), m_z(z) {} ~CSGLight(); virtual void Render(); private: double m_x; double m_y; double m_z; };<|fim_prefix|>// repo: jimurray/472_Robot path: /DancingRobot/SGLight.h #pragma once #include "SGNode.h" class CSGLight : <|fim_middle|> pu...
code_fim
easy
{ "lang": "cpp", "repo": "jimurray/472_Robot", "path": "/DancingRobot/SGLight.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: jimurray/472_Robot path: /DancingRobot/SGLight.h #pragma once #include "SGNode.h" class CSGLight : <|fim_suffix|>{ public: CSGLight(double x, double y, double z) : m_x(x), m_y(y), m_z(z) {} ~CSGLight(); virtual void Render(); private: double m_x; double m_y; double m_z; };<|fim_middle|> pu...
code_fim
easy
{ "lang": "cpp", "repo": "jimurray/472_Robot", "path": "/DancingRobot/SGLight.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Nov11/lintcode path: /Strings Homomorphism .cpp class Solution { public: /** * @param s a string * @param t a string * @return true if the characters in s * can be replaced to get t or false */ bool isIsomorphic(string& s, string& t) { // Write your code ...
code_fim
medium
{ "lang": "cpp", "repo": "Nov11/lintcode", "path": "/Strings Homomorphism .cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>]; ss.insert(t[i]); } else{ if(hash[s[i]] != t[i]){return false;} } } return true; } };<|fim_prefix|>// repo: Nov11/lintcode path: /Strings Homomorphism .cpp class Solution { public: /** * @param s ...
code_fim
medium
{ "lang": "cpp", "repo": "Nov11/lintcode", "path": "/Strings Homomorphism .cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> Element *current = head; Element *next = NULL; while (current != nullptr && current->next != nullptr){ next = current->next; delete current; current = next; } if(current != nullptr) delete current; list = nullptr; } //________________________________...
code_fim
hard
{ "lang": "cpp", "repo": "SinayDEAD/SEM_4", "path": "/SEM4_SPARSE_MATRIX_P01/SparseMatrix.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: SinayDEAD/SEM_4 path: /SEM4_SPARSE_MATRIX_P01/SparseMatrix.cpp #include "SparseMatrix.h" double epsilon = 0.000001; // значение для корректного сравнения Element::Element(size_t c, double v, Element *nxt){ col = c; value = v; next = nxt; } void Element::operator = (double...
code_fim
hard
{ "lang": "cpp", "repo": "SinayDEAD/SEM_4", "path": "/SEM4_SPARSE_MATRIX_P01/SparseMatrix.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> private : boost::shared_ptr<Pierre> m_pierre; std::vector<boost::shared_ptr<Pierre> > pierresSupprimees; boost::weak_ptr<FenetreSGF> fp; //QString logMsg; }; #endif // ActionNext_H<|fim_prefix|>// repo: marieJulien/GoProjet_TX path: /FenetrePrincipale/ActionNext.h #ifndef ACTIONNEXT_H ...
code_fim
hard
{ "lang": "cpp", "repo": "marieJulien/GoProjet_TX", "path": "/FenetrePrincipale/ActionNext.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: marieJulien/GoProjet_TX path: /FenetrePrincipale/ActionNext.h #ifndef ACTIONNEXT_H #define ACTIONNEXT_H #include "FenetreSGF.h" /*** D�claration de la classe actionNext : h�rite de QUndoCommand, permet d'annuler des coups Garde en m�moire la pierre qui a �t� ajout�e, les pierres qui ont �t� s...
code_fim
medium
{ "lang": "cpp", "repo": "marieJulien/GoProjet_TX", "path": "/FenetrePrincipale/ActionNext.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> void undo(); //QString getLogMsg() const { return logMsg;} void setFenetrePrincipalePtr(boost::shared_ptr<FenetreSGF> fpPtr) {fp = fpPtr;} private : boost::shared_ptr<Pierre> m_pierre; std::vector<boost::shared_ptr<Pierre> > pierresSupprimees; boost::weak_ptr<FenetreSGF> fp; /...
code_fim
hard
{ "lang": "cpp", "repo": "marieJulien/GoProjet_TX", "path": "/FenetrePrincipale/ActionNext.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: martinv/pdekit path: /src/solver/rdm/PGRDMethodExplicit.hpp = result_of::tria_t<MeshConfig>; using dof_map_t = result_of::dof_map_t<MeshConfig>; using f_space_cells = interpolation::FunctionSpace<MeshConfig>; using f_space_facets = interpolation::FunctionSpace<MeshConfig, Mes...
code_fim
hard
{ "lang": "cpp", "repo": "martinv/pdekit", "path": "/src/solver/rdm/PGRDMethodExplicit.hpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>// ---------------------------------------------------------------------------- template <typename MeshConfig, typename Physics, typename SchemeTraits> void PGRDMethodExplicit<MeshConfig, Physics, SchemeTraits>::assemble_lhs_and_rhs(const Real CFL) { assemble_rhs(); RDTimeUpdate &time_update = rd_me...
code_fim
hard
{ "lang": "cpp", "repo": "martinv/pdekit", "path": "/src/solver/rdm/PGRDMethodExplicit.hpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: martinv/pdekit path: /src/solver/rdm/PGRDMethodExplicit.hpp ame void remove_boundary_condition(const std::string &condition_name) override; /// Remove all boundary conditions void remove_all_boundary_conditions() override; /// Assemble both lhs and rhs simultaneously void assemble_lh...
code_fim
hard
{ "lang": "cpp", "repo": "martinv/pdekit", "path": "/src/solver/rdm/PGRDMethodExplicit.hpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: zjuxlh1993/acmcode path: /poj1036.cpp #include <stdio.h> #include <iostream> #include <cmath> #include <algorithm> #pragma warning (disable:4996) using namespace std; struct MyStruct { int time; int pro; int stou; <|fim_suffix|> for (int i = 2; i <= n; i++) { if (gan[i].time == ...
code_fim
hard
{ "lang": "cpp", "repo": "zjuxlh1993/acmcode", "path": "/poj1036.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> int ans[105]; memset(ans, 0, sizeof(ans)); bool bo[105]; memset(bo, 1, sizeof(bo)); bo[0] = 0; h[0] = 0; while (st <= ed) { for (int i=0;i<=n;i++) if (p[h[st]][i] + ans[h[st]] > ans[i]&&p[h[st]][i]) { ans[i] = ans[h[st]] + p[h[st]][i]; if (bo[i]) { ed++; bo[i] = 0...
code_fim
hard
{ "lang": "cpp", "repo": "zjuxlh1993/acmcode", "path": "/poj1036.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> for (int i = 2; i <= n; i++) { if (gan[i].time == gan[st].time&&gan[i].stou == gan[st].stou) { gan[st].pro += gan[i].pro; gan[i].pro = 0; } else st = i; } for (int i = 0; i <= n; i++) { for (int j = 0; j <= n; j++) { if (i != j&&gan[j].time - gan[i].time >= abs(gan[j].stou - g...
code_fim
hard
{ "lang": "cpp", "repo": "zjuxlh1993/acmcode", "path": "/poj1036.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>{ fscanf(f,"%d",&nr); nr*=2; N=sqrt(nr); for(b=1;b<=N;b++) { if(nr%b==0) { if(((nr/b)-b+1)%2==0&&b!=1) { a=((nr/b)-b+1)/2; V.push_back(make_pair(a,b)); } if((b+1-(nr/b))%2==0) { ...
code_fim
medium
{ "lang": "cpp", "repo": "georgerapeanu/c-sources", "path": "/numar0/main.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: georgerapeanu/c-sources path: /numar0/main.cpp #include <cstdio> #include <algorithm> #include <vector> using namespace std; FILE *f=fopen("numar.in","r"); FILE *g=fopen("numar.out","w"); int b,nr,a,N; <|fim_suffix|>{ fscanf(f,"%d",&nr); nr*=2; N=sqrt(nr); for(b=1;b<=N;b++) {...
code_fim
medium
{ "lang": "cpp", "repo": "georgerapeanu/c-sources", "path": "/numar0/main.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> void tearDown(); void testRuleName(); void testCCNSevenIsNotASmell(); void testCCNEightIsASmell(); void testCCNNineIsASmell(); };<|fim_prefix|>// repo: halfhiddencode/oclint-04 path: /test/headers/oclint/rule/CyclomaticComplexityRuleTest.h #include <cxxtest/TestSuite.h> #include "oclint/rule/Cy...
code_fim
medium
{ "lang": "cpp", "repo": "halfhiddencode/oclint-04", "path": "/test/headers/oclint/rule/CyclomaticComplexityRuleTest.h", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Malory9/data-structure path: /CPP/JpTools.cpp #include<iostream> #include<functional> #include <vector> using namespace std; function<int(int)> Pair(int first, int second) { auto innerFunc = [=](int flag) <|fim_suffix|>{ return pair(1); } template class vector<int>;<|fim_middle|> { int in...
code_fim
hard
{ "lang": "cpp", "repo": "Malory9/data-structure", "path": "/CPP/JpTools.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> return innerFunc; } int GetFirst(function<int(int)>pair) { return pair(0); } int GetSecond(function<int(int)>pair) { return pair(1); } template class vector<int>;<|fim_prefix|>// repo: Malory9/data-structure path: /CPP/JpTools.cpp #include<iostream> #include<functional> #include <vector> using na...
code_fim
hard
{ "lang": "cpp", "repo": "Malory9/data-structure", "path": "/CPP/JpTools.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: scylla/cpp_template_sample_algos path: /BSTValidator.h #include <stack> template <typename T> struct Node { Node* left; Node* right; T val; Node(const T& v) : val(v), left(nullptr), right(nullptr) {} }; template <typename T, typename F> //requires F to be comparator obj for Nod...
code_fim
hard
{ "lang": "cpp", "repo": "scylla/cpp_template_sample_algos", "path": "/BSTValidator.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>template <typename T, typename F> void BSTree<T, F>::addNode(const T& val) { node_ptr np = new Node<T>(val); if(root == nullptr) { root = np; return; } node_ptr tp = root; node_ptr par_np = root; while(tp != nullptr) { par_np = tp; if(func(np, tp)) {...
code_fim
hard
{ "lang": "cpp", "repo": "scylla/cpp_template_sample_algos", "path": "/BSTValidator.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> node_ptr np = new Node<T>(val); if(root == nullptr) { root = np; return; } node_ptr tp = root; node_ptr par_np = root; while(tp != nullptr) { par_np = tp; if(func(np, tp)) { tp = tp->right; } else { tp = tp->left; ...
code_fim
hard
{ "lang": "cpp", "repo": "scylla/cpp_template_sample_algos", "path": "/BSTValidator.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: binarek/EDAMI path: /include/NormalizationParams.h #ifndef EDAMI_NORMALIZATIONPARAMS_H #define EDAMI_NORMALIZATIONPARAMS_H <|fim_suffix|> void setValue(int col, double value); Values getValues(int col) const; private: std::map<int, Values> values_; }; #endif /* EDAMI_NORMALIZATIONP...
code_fim
hard
{ "lang": "cpp", "repo": "binarek/EDAMI", "path": "/include/NormalizationParams.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>private: std::map<int, Values> values_; }; #endif /* EDAMI_NORMALIZATIONPARAMS_H */<|fim_prefix|>// repo: binarek/EDAMI path: /include/NormalizationParams.h #ifndef EDAMI_NORMALIZATIONPARAMS_H #define EDAMI_NORMALIZATIONPARAMS_H #include <map> class NormalizationParams { <|fim_middle|>public: ...
code_fim
hard
{ "lang": "cpp", "repo": "binarek/EDAMI", "path": "/include/NormalizationParams.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> // Return true if the current game is finished: bool is_game_over( ) const; // Return true if the given move is legal for the next player: bool is_legal(const std::string& move) const; //VIRTUAL FUNCTIONS THAT MUST BE OVERRIDDEND void make_move(const std::string& move); void restart(); who w...
code_fim
hard
{ "lang": "cpp", "repo": "rdunne2020/CS2401", "path": "/Assignment 6/Phase 3/othello.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: rdunne2020/CS2401 path: /Assignment 6/Phase 3/othello.h /***************************************** Name: Rory Dunne File: Othello.h Purpose: Declare all purely virtual functions from game.h as members of othello and Declare private variables necessary for the game Date: 11/28/17 *************...
code_fim
hard
{ "lang": "cpp", "repo": "rdunne2020/CS2401", "path": "/Assignment 6/Phase 3/othello.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: ktj007/Raiderz_Public path: /Develop/Server/GameServer/main/GCmdHandler_App_Msg.h #pragma once #include "MCommandHandler.h" using namespace minet; class GCmdHandler_App_Msg: public MCommandHandler, public MTestMemPool<GCmdHandler_App_Msg> { public: GCmdHandler_App_Msg(MCommandCommunicator* pC...
code_fim
hard
{ "lang": "cpp", "repo": "ktj007/Raiderz_Public", "path": "/Develop/Server/GameServer/main/GCmdHandler_App_Msg.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> DECL_CMD_HANDLER(OnMsgRes); DECL_CMD_HANDLER(OnMsgEnterChannel); DECL_CMD_HANDLER(OnMsgEnterChannelPlayerInfo); DECL_CMD_HANDLER(OnMsgLeaveChannel); DECL_CMD_HANDLER(OnMsgLeaveChannelPlayerInfo); DECL_CMD_HANDLER(OnMsgKick); DECL_CMD_HANDLER(OnMsgKickPlayerInfo); DECL_CMD_HANDLER(OnMsgBan); DECL_...
code_fim
medium
{ "lang": "cpp", "repo": "ktj007/Raiderz_Public", "path": "/Develop/Server/GameServer/main/GCmdHandler_App_Msg.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: icprog/cpc152 path: /drivers/drv-test/integr_data.cpp #include "integr_data.h" #include <algorithm> #include <memory.h> #define bzero(ptr,sz) memset(ptr,0,sz) Tintegr_data::Tintegr_data(int _size):prev_time(0),count_time(0),count_scan(-1) { vcount = std::max(1,_size); values = new int32_...
code_fim
hard
{ "lang": "cpp", "repo": "icprog/cpc152", "path": "/drivers/drv-test/integr_data.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>void Tintegr_data::get_results(int32_t * results,int32_t* p_results,int32_t* n_results ,int count,bool mk_div,int32_t mul ) { int32_t * end_res = results+count; int32_t * p_beg = this->p_res; int32_t * n_beg = this->n_res; while(results<end_res) { if(p_results) *p_results++ = *p_beg; ...
code_fim
hard
{ "lang": "cpp", "repo": "icprog/cpc152", "path": "/drivers/drv-test/integr_data.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>std::optional<std::string> IPhysicsUI::LoadObjectClicked() { if (mLoadObjectClicked) { mLoadObjectClicked = false; return mObjectPath; } return {}; } bool IPhysicsUI::StartSimulationClicked() { if (mStartSimulationClicked) { mStartSimulationClicked = false; return true; } ...
code_fim
hard
{ "lang": "cpp", "repo": "moirj15/IPhysics", "path": "/src/physics-sim/app/IPhysicsUI.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: moirj15/IPhysics path: /src/physics-sim/app/IPhysicsUI.cpp #include "IPhysicsUI.h" #ifndef IMGUI_IMPL_OPENGL_LOADER_GLAD #define IMGUI_IMPL_OPENGL_LOADER_GLAD #endif #include "../../../imgui/imgui.h" #include "../../../imgui/imgui_impl_glfw.h" #include "../../../imgui/imgui_impl_opengl3.h" #incl...
code_fim
hard
{ "lang": "cpp", "repo": "moirj15/IPhysics", "path": "/src/physics-sim/app/IPhysicsUI.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: a-day-old-bagel/DualityEngine path: /source/ui/TextField.cpp // // Created by volundr on 7/11/16. // #include <vector> #include <limits> #include "TextField.h" #include "loadShaders.h" #include "errorChecks.h" namespace DualityEngine { float TextFieldParams::getAdvX() { return cha...
code_fim
hard
{ "lang": "cpp", "repo": "a-day-old-bagel/DualityEngine", "path": "/source/ui/TextField.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> position = {x, y}; } void TextField::updateText(uint32_t start, const char* text) { std::string textStr(text); uint32_t end = (uint32_t)std::min((uint32_t)textStr.length(), numCharsTotal - start); std::vector<float> charOffsets(end * 8); for (uint32_t i = 0...
code_fim
hard
{ "lang": "cpp", "repo": "a-day-old-bagel/DualityEngine", "path": "/source/ui/TextField.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> std::string textStr(text); uint32_t end = (uint32_t)std::min((uint32_t)textStr.length(), numCharsTotal - start); std::vector<float> charOffsets(end * 8); for (uint32_t i = 0; i < end; ++i) { int offsetToChar; if (textStr[i] < font.firstChar || textSt...
code_fim
hard
{ "lang": "cpp", "repo": "a-day-old-bagel/DualityEngine", "path": "/source/ui/TextField.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: nodreambird/codePractice path: /LinkedList/21Merge2SortedList.cpp /* Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: <|fim_suffix|> if (l1->val >= l2->val){ head = l2; ...
code_fim
hard
{ "lang": "cpp", "repo": "nodreambird/codePractice", "path": "/LinkedList/21Merge2SortedList.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> if (l1->val >= l2->val){ head = l2; cur1 = l1; cur2 = l2->next; }else{ head = l1; cur1 = l1->next; cur2 = l2; } cur = head; while(cur1 && cur2){ if (cur1->val >= cur2->val){ ...
code_fim
hard
{ "lang": "cpp", "repo": "nodreambird/codePractice", "path": "/LinkedList/21Merge2SortedList.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>{ p_rotationY.set(f); } //------------------------------------------------------------------ int simLaser::getRotationY() { return p_rotationY.get(); } //------------------------------------------------------------------ void simLaser::setorientationY(float f) { orientationY = f; } //------------------...
code_fim
hard
{ "lang": "cpp", "repo": "cjsatuforc/simulaLEV", "path": "/src/simLaser/simLaser.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: cjsatuforc/simulaLEV path: /src/simLaser/simLaser.cpp #include "simLaser.h" int bufferSpeedSize=60; //------------------------------------------------------------------ simLaser::simLaser() { name = "Lx"; baseHeight=0; baseWidth=30; heightOffset=70; maxTiltSpeed = 250.0 / 1.3; ...
code_fim
hard
{ "lang": "cpp", "repo": "cjsatuforc/simulaLEV", "path": "/src/simLaser/simLaser.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> ofPushMatrix(); { /// BILLBOARDING float modelview[16]; int i,j; // save the current modelview matrix glPushMatrix(); // get the current mo...
code_fim
hard
{ "lang": "cpp", "repo": "cjsatuforc/simulaLEV", "path": "/src/simLaser/simLaser.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>TEST(Grmpy, GenotypesSingleSwap) { std::string graph_path = g_testenv->getBasePath() + "/../share/test-data/paragraph/long-del/chr4_graph_typing.2sample.json"; std::string reference_path = g_testenv->getBasePath() + "/../share/test-data/paragraph/long-del/chr4_graph_typing.fa"; ...
code_fim
hard
{ "lang": "cpp", "repo": "pkrusche/paragraph", "path": "/src/c++/test-blackbox/test_grm.cpp", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> { public: //================================================================================= // Public Methods //================================================================================= void Update(Core::Time& aTimeDelta); }; } }<|fim_prefix|>// repo: BryanRobertson/Alba...
code_fim
hard
{ "lang": "cpp", "repo": "BryanRobertson/Alba", "path": "/Source/Demo/Quake3Viewer/Quake3Viewer_Tasks.hpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: BryanRobertson/Alba path: /Source/Demo/Quake3Viewer/Quake3Viewer_Tasks.hpp #pragma once #include "Quake3Viewer_API.hpp" #include "Core_Time.hpp" <|fim_suffix|> { public: //================================================================================= // Public Methods //===...
code_fim
hard
{ "lang": "cpp", "repo": "BryanRobertson/Alba", "path": "/Source/Demo/Quake3Viewer/Quake3Viewer_Tasks.hpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: chrinide/vowpal_wabbit path: /vowpalwabbit/distributionally_robust.h // Copyright (c) by respective owners including Yahoo!, Microsoft, and // individual contributors. All rights reserved. Released under a BSD (revised) // license as described in the file LICENSE. #pragma once #include <algori...
code_fim
hard
{ "lang": "cpp", "repo": "chrinide/vowpal_wabbit", "path": "/vowpalwabbit/distributionally_robust.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> Duals() : unbounded(false), kappa(0.f), gamma(0.f), beta(0.f), n(0.f) {} Duals(bool unbounded, double kappa, double gamma, double beta, double n) : unbounded(unbounded), kappa(kappa), gamma(gamma), beta(beta), n(n) { } double qfunc(double w, double r) { return unbounded ? 1 : -(gamma + (be...
code_fim
hard
{ "lang": "cpp", "repo": "chrinide/vowpal_wabbit", "path": "/vowpalwabbit/distributionally_robust.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> { alpha = _alpha; tau = _tau; wmin = 0.0; wmax = std::numeric_limits<double>::infinity(); rmin = 0.0; rmax = 1; n = 0.0; sumw = 0.0; sumwsq = 0.0; sumwr = 0.0; sumwsqr = 0.0; sumwsqrsq = 0.0; delta = chisq_onedof_isf(alpha); duals_stale = true; ...
code_fim
hard
{ "lang": "cpp", "repo": "chrinide/vowpal_wabbit", "path": "/vowpalwabbit/distributionally_robust.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: metaphysis/Code path: /UVa Online Judge/volume130/13057 Prove Them All/program.cpp // Prove Them All // UVa ID: 13057 // Verdict: Accepted // Submission Date: 2018-01-03 // UVa Run Time: 0.030s // // 版权所有(C)2018,邱秋。metaphysis # yeah dot net #include <bits/stdc++.h> using namespace std; // 最大顶...
code_fim
hard
{ "lang": "cpp", "repo": "metaphysis/Code", "path": "/UVa Online Judge/volume130/13057 Prove Them All/program.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> // 以邻接表方式读入图数据。 //cin >> n >> m; nextInt(n), nextInt(m); for (int e = 1; e <= m; e++) { //cin >> from >> to; nextInt(from), nextInt(to); edges[from].push_back(to); } // Tarjan算法求强连通分量。 for (int u = 1; u <=...
code_fim
hard
{ "lang": "cpp", "repo": "metaphysis/Code", "path": "/UVa Online Judge/volume130/13057 Prove Them All/program.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>extern bool constructPSMfromRawSeed(char*, struct _PMScan&, CPolarMatch*); extern void m2cm(struct _PMScan*); extern void cm2m(struct _PMScan*); #endif<|fim_prefix|>// repo: eglrp/laser_slam path: /src/localization/globaldef.h #ifndef GLOBAL_DEF_H #define GLOBAL_DEF_H struct _PMScan; class CPolarMatch;...
code_fim
hard
{ "lang": "cpp", "repo": "eglrp/laser_slam", "path": "/src/localization/globaldef.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: eglrp/laser_slam path: /src/localization/globaldef.h #ifndef GLOBAL_DEF_H #define GLOBAL_DEF_H struct _PMScan; class CPolarMatch; extern const int g_num_of_global_particles; extern const int g_num_of_particles; extern const int g_num_of_weight_particles; extern const double g_goodness_of_local...
code_fim
medium
{ "lang": "cpp", "repo": "eglrp/laser_slam", "path": "/src/localization/globaldef.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> cout << "Number Square\n"; cout << "-------------------------\n"; while (num <= MAX_NUMBER) { cout << num << "\t\t" << (num * num) << endl; num++; // Increment the counter } return 0; }<|fim_prefix|>// repo: sergiogutierrez2/Intro_to_C_plus_plus_Projects-DeAnza-2014 ...
code_fim
medium
{ "lang": "cpp", "repo": "sergiogutierrez2/Intro_to_C_plus_plus_Projects-DeAnza-2014", "path": "/Examples/Chapters 1-5/Counter.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: sergiogutierrez2/Intro_to_C_plus_plus_Projects-DeAnza-2014 path: /Examples/Chapters 1-5/Counter.cpp // This program shows a counter #include <iostream> using namespace std; int main () <|fim_suffix|> cout << "Number Square\n"; cout << "-------------------------\n"; while (num <= MAX...
code_fim
medium
{ "lang": "cpp", "repo": "sergiogutierrez2/Intro_to_C_plus_plus_Projects-DeAnza-2014", "path": "/Examples/Chapters 1-5/Counter.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> std::string valname_; std::string bgname_; double var_cut_; std::string t_; std::string ch_; typedef std::vector<double> BaseValues; typedef std::unordered_map<std::string, BaseValues> CompValues; typedef std::vector<CompValues> ChannValues; ChannValues in_values_; ChannValues out_values_; Base...
code_fim
hard
{ "lang": "cpp", "repo": "SCIInstitute/fluorender", "path": "/FluoRender/FluoRender/Script/ScriptVisitors.h", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> cout<<"type 'yes' to start the exam"<<endl; cin>>respond; if (respond == "yes") { cout<<"good luck"<<endl; } else{ cout<<"goodbye"<<endl; return 0; } question q1; question q2; question q3; question q4; question q5; question q6; question q7; question q8; quest...
code_fim
hard
{ "lang": "cpp", "repo": "Bhuvaneswar2001/QUIZ", "path": "/quiz.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Bhuvaneswar2001/QUIZ path: /quiz.cpp #include<iostream> #include<string> using namespace std; int guess; int total; class question { private: string question_text; string answer_1; string answer_2; string answer_3; string answer_4; int correct_answer; int question_sco...
code_fim
hard
{ "lang": "cpp", "repo": "Bhuvaneswar2001/QUIZ", "path": "/quiz.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: NightmareJames/StrategoCloneCPlusPlus path: /Stratego Game/Week 1 iLab/GamePiece.h #pragma once #include "sprite.h" #include <d3d9.h> #include <d3dx9.h> #pragma comment(lib, "d3d9.lib") #pragma comment(lib, "d3dx9.lib") class GamePiece : public The_Sprite { private: int playercode; <|fim_suff...
code_fim
hard
{ "lang": "cpp", "repo": "NightmareJames/StrategoCloneCPlusPlus", "path": "/Stratego Game/Week 1 iLab/GamePiece.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> bool getShowRank(); void setShowRank(bool); bool checkForCollision(D3DXVECTOR3); bool getSelection(); void setSelection(bool); int getPlayerCode(); void setPlayerCode(int); };<|fim_prefix|>// repo: NightmareJames/StrategoCloneCPlusPlus path: /Stratego Game/Week 1 iLab/GamePiece.h #pragma once #in...
code_fim
medium
{ "lang": "cpp", "repo": "NightmareJames/StrategoCloneCPlusPlus", "path": "/Stratego Game/Week 1 iLab/GamePiece.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> bool getActive(); void setActive(bool); bool getShowRank(); void setShowRank(bool); bool checkForCollision(D3DXVECTOR3); bool getSelection(); void setSelection(bool); int getPlayerCode(); void setPlayerCode(int); };<|fim_prefix|>// repo: NightmareJames/StrategoCloneCPlusPlus path: /Stratego Game...
code_fim
medium
{ "lang": "cpp", "repo": "NightmareJames/StrategoCloneCPlusPlus", "path": "/Stratego Game/Week 1 iLab/GamePiece.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>template<typename T> struct Tree { T value; tree_ptr<T> left; tree_ptr<T> right; Tree(T value, tree_ptr<T>&& left, tree_ptr<T>&& right) : value(value), left(std::move(left)), right(std::move(right)) {} };<|fim_prefix|>// repo: Checkmate50/cpp99problems path: /p5460/bst.hpp #pragm...
code_fim
medium
{ "lang": "cpp", "repo": "Checkmate50/cpp99problems", "path": "/p5460/bst.hpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Checkmate50/cpp99problems path: /p5460/bst.hpp #pragma once #include <memory> template<typename T> struct Tree; <|fim_suffix|>template<typename T> struct Tree { T value; tree_ptr<T> left; tree_ptr<T> right; Tree(T value, tree_ptr<T>&& left, tree_ptr<T>&& right) : valu...
code_fim
medium
{ "lang": "cpp", "repo": "Checkmate50/cpp99problems", "path": "/p5460/bst.hpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: amazonsx/archives path: /leetcode/unique_path/cpp/solution.cc #include <iostream> #include <vector> #define DEBUG using namespace std; class Solution { <|fim_suffix|>int main(int argc, char *argv[]) { Solution s; cout << s.uniquePaths(2, 1) << endl; return 1; }<|fim_middle|>public: ...
code_fim
hard
{ "lang": "cpp", "repo": "amazonsx/archives", "path": "/leetcode/unique_path/cpp/solution.cc", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|>int main(int argc, char *argv[]) { Solution s; cout << s.uniquePaths(2, 1) << endl; return 1; }<|fim_prefix|>// repo: amazonsx/archives path: /leetcode/unique_path/cpp/solution.cc #include <iostream> #include <vector> #define DEBUG using namespace std; class Solution { public: int uniquePat...
code_fim
hard
{ "lang": "cpp", "repo": "amazonsx/archives", "path": "/leetcode/unique_path/cpp/solution.cc", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> vector<vector<int> > paths(m, vector<int>(n, 0)); for ( int i = 0; i < m; i ++) { paths[i][n-1] = 1; //m - 1 - i; } for ( int i = 0; i < n; i ++) { paths[m-1][i] = 1; //n - 1 - i; } int i = m - 2, j = n - 2; while ( i >= 0 && j >= 0) { paths[i][j] = path...
code_fim
medium
{ "lang": "cpp", "repo": "amazonsx/archives", "path": "/leetcode/unique_path/cpp/solution.cc", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> v1->release(); v2->release(); v3->release(); root->release(); } protected: Root * root; View * v1; View * v2; View * v3; View * v11; View * v12; View * v111; View * v31; }; TEST_F(MouseControllerUnitTestBase, ShiftOver) {//测试over M...
code_fim
hard
{ "lang": "cpp", "repo": "bonescreater/bones", "path": "/bones/core/mouse_controller_unittest.cpp", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> View * v11; View * v12; View * v111; View * v31; }; TEST_F(MouseControllerUnitTestBase, ShiftOver) {//测试over MouseController mc(root); EXPECT_EQ(nullptr, mc.over()); MouseEvent move(kET_MOUSE_MOVE, kMB_NONE, root, Point::Make(80, 80), Point::Make(80, 80), 0); mc.ha...
code_fim
hard
{ "lang": "cpp", "repo": "bonescreater/bones", "path": "/bones/core/mouse_controller_unittest.cpp", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> static std::string help() { std::string a = "\nDefinition:\n"; std::string b = "\twipe - wipes requested file in specified range\n"; std::string c = "\nSyntax:\n"; std::string d = "\t[-h --help] - prints help\n"; std::string e = "\t[-d --directory <directory name>] - searches in requested dir...
code_fim
medium
{ "lang": "cpp", "repo": "devmichalek/Skipper", "path": "/Commands/cmd_wipe.h", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> m_horizontal = 2.0f * _half_horizontal; m_vertical = 2.0f * _half_vertical; m_lower_left_corner = m_origin - _half_horizontal - _half_vertical - m_w * focus_distance; } Ray Camera::GetRay(float s, float t) const { Vec3 _rd = (m_lens_radius > 0.0f) ? m_lens_radius * r...
code_fim
hard
{ "lang": "cpp", "repo": "abasilak/raytracing", "path": "/Camera.cpp", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: abasilak/raytracing path: /Camera.cpp #include "Utils.h" #include "Camera.h" Camera::Camera(const Vec3& origin, const Vec3& lower_left_corner,const Vec3& horizontal,const Vec3& vertical) : m_origin(origin), m_lower_left_corner(lower_left_corner), m_horizontal(horizontal), m_vertical(vertical) {...
code_fim
hard
{ "lang": "cpp", "repo": "abasilak/raytracing", "path": "/Camera.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> { bird_rect = pRect; } bool GetColState() const { return is_col; } int GetCount() const { return mcount; } int Getlevel() const { return mlevel; } void FreeBlock(); private: std::vector<Tube...
code_fim
hard
{ "lang": "cpp", "repo": "nguyenthithutrang313/trangbee", "path": "/BlockObject.h", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: nguyenthithutrang313/trangbee path: /BlockObject.h #ifndef BLOCKOBJECT_H_INCLUDED #define BLOCKOBJECT_H_INCLUDED #include "BaseObject.h" #include "CommonFuntion.h" class BlockObject : BaseObject { public: BlockObject(); ~BlockObject(); bool LoadImg(std::string path, SDL_Renderer* s...
code_fim
hard
{ "lang": "cpp", "repo": "nguyenthithutrang313/trangbee", "path": "/BlockObject.h", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: Dan12/GBS_AIVD_2015 path: /ultraArray/ultraArray.ino #include <Servo.h> #include <AV4Wheel.h> AV4Wheel car; #define NumUltras 4 AV4Wheel ultras[NumUltras] = { AV4Wheel(), AV4Wheel(), AV4Wheel(), AV4Wheel() }; <|fim_suffix|>void setup() { //Parameters: Motor pin a, Encoder pin, Stee...
code_fim
medium
{ "lang": "cpp", "repo": "Dan12/GBS_AIVD_2015", "path": "/ultraArray/ultraArray.ino", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }
<|fim_suffix|> //Parameters: Motor pin a, Encoder pin, Steering Servo pin, Wheel Circumfrenc (in inches) car.init(11,7,9, 4*3.14); //Parameters: Trigger Pin, Echo Pin, Max Distance (cm) for(int i = 0; i < NumUltras; i++){ ultras[i].initUltra(triggerPins[i],echoPins[i],maxDistance); } Serial.begin(9600); ...
code_fim
medium
{ "lang": "cpp", "repo": "Dan12/GBS_AIVD_2015", "path": "/ultraArray/ultraArray.ino", "mode": "spm", "license": "unknown", "source": "the-stack-v2" }
<|fim_prefix|>// repo: zsq001/oi-code path: /csp-s2019.luogu/source/XJ-00103/meal/meal.cpp #include<bits/stdc++.h> #define LL long long #define MOD 998244353 using namespace std; template <class T> void read(T &x) { x=0; char ch=getchar(); while(ch<'0'||ch>'9') ch=getchar(); while(ch>='0'&&ch<='9'){x=(x<<1)...
code_fim
hard
{ "lang": "cpp", "repo": "zsq001/oi-code", "path": "/csp-s2019.luogu/source/XJ-00103/meal/meal.cpp", "mode": "psm", "license": "unknown", "source": "the-stack-v2" }