text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_suffix|> int top = -1;
Product* products[100];
public:
bool addProduct(Product*);
bool canAddProduct() { return top < 99; }
bool show();
};
void Product::show() {
std::cout
<< "---- Product ID : " << uid << '\n'
<< "Description : " << description << '\n'
<< "Maker ... | code_fim | hard | {
"lang": "cpp",
"repo": "moreal/JumpUp-Camp-2018",
"path": "/PracticeCpp_03/05-misson_open_challenge.cc",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
if (skip_)
{
return;
}
// if not already marked as a getter
if (!isGetter_)
{
if (!parameters_.Size() && returnType_)
{
if (name_.Length() > 3 && name_.StartsWith("Get") && isupper(name_[3]))
{
String pname = name_.... | code_fim | hard | {
"lang": "cpp",
"repo": "honigbeutler123/AtomicGameEngine",
"path": "/Source/ToolCore/JSBind/JSBFunction.cpp",
"mode": "spm",
"license": "LicenseRef-scancode-unknown-license-reference",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: honigbeutler123/AtomicGameEngine path: /Source/ToolCore/JSBind/JSBFunction.cpp
//
// Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
// LICENSE: Atomic Game Engine Editor and Tools EULA
// Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
// license informa... | code_fim | hard | {
"lang": "cpp",
"repo": "honigbeutler123/AtomicGameEngine",
"path": "/Source/ToolCore/JSBind/JSBFunction.cpp",
"mode": "psm",
"license": "LicenseRef-scancode-unknown-license-reference",
"source": "the-stack-v2"
} |
<|fim_suffix|> for ( unsigned j = 0; j < fparams.Size(); j++)
{
if (!parameters_[j]->Match(fparams[j]))
return false;
}
return true;
}
JSBClass* JSBFunction::GetReturnClass()
{
if (!returnType_)
return 0;
if (!returnType_->type_->asClassType())
return 0;
... | code_fim | hard | {
"lang": "cpp",
"repo": "honigbeutler123/AtomicGameEngine",
"path": "/Source/ToolCore/JSBind/JSBFunction.cpp",
"mode": "spm",
"license": "LicenseRef-scancode-unknown-license-reference",
"source": "the-stack-v2"
} |
<|fim_suffix|>// Click Color MODE
boolean FunkData_clickColor(int RadA, int RadB)
{
// Send data:
RF24NetworkHeader header(FunkMasterSwitchcabinet); // Address where the data is going
dataOutgoing.header = 2; // Farbrad
dataOutgoing.val1 = RadA; // RAD A
dataOutgoing.val2 = RadB; // RAD B
dataOutgoing.val... | code_fim | hard | {
"lang": "cpp",
"repo": "HUGEFANCY/HF-TeensyControl",
"path": "/Code_Arduino_Joystick/NRF24L01.ino",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: HUGEFANCY/HF-TeensyControl path: /Code_Arduino_Joystick/NRF24L01.ino
/*
Arduino Wireless Network - Multiple NRF24L01 Tutorial
== Base/ Master Node 00==
by Dejan, www.HowToMechatronics.com
Libraries:
nRF24/RF24, https://github.com/nRF24/RF24
nRF24/RF24Network, https://github.c... | code_fim | hard | {
"lang": "cpp",
"repo": "HUGEFANCY/HF-TeensyControl",
"path": "/Code_Arduino_Joystick/NRF24L01.ino",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: vehlwn/BruteSudoku path: /src/StdRandom.h
#pragma once
#include <random>
#include <type_traits>
<|fim_suffix|> template<typename T, typename U>
static auto next(T a, U b)
-> std::enable_if_t<std::is_integral_v<T> && std::is_integral_v<U>,
std::common_type_t<T, U>>
... | code_fim | medium | {
"lang": "cpp",
"repo": "vehlwn/BruteSudoku",
"path": "/src/StdRandom.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> template<typename T, typename U>
static auto next(T a, U b)
-> std::enable_if_t<std::is_integral_v<T> && std::is_integral_v<U>,
std::common_type_t<T, U>>
{
using ret_t = std::common_type_t<T, U>;
std::uniform_int_distribution<ret_t> dist{
static_... | code_fim | medium | {
"lang": "cpp",
"repo": "vehlwn/BruteSudoku",
"path": "/src/StdRandom.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>#include <chrono> // time and clocks
#include "util.hpp"
using namespace std;
using namespace LFen;
int main()
{
deque<int> coll;
for(int i=1; i<=9; ++i) {
coll.push_back(i);
coll.push_front(i);
}
PrintAll(coll, "coll default without sort");
sort(coll.begin(), coll.end(... | code_fim | hard | {
"lang": "cpp",
"repo": "phenixwutao/DemoProjects",
"path": "/STL_2nd/022_algorithm_sort.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: phenixwutao/DemoProjects path: /STL_2nd/022_algorithm_sort.cpp
#include <iostream>
#include <array>
#include <vector>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <forward_list>
#include <iterator>
#include <memory> // smart pointers
#include <thread>... | code_fim | hard | {
"lang": "cpp",
"repo": "phenixwutao/DemoProjects",
"path": "/STL_2nd/022_algorithm_sort.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: wonder-sk/stereo_fun path: /growth/stereo.cpp
#include "stereo.h"
#include "matchingtable.h"
#include "now.h"
#include <QPainter>
const int DISP_MIN = -100;
const int DISP_MAX = +100;
//////////////////////////////////
StereoMatching::StereoMatching(QImage leftImage, QImage rightImage, Q... | code_fim | hard | {
"lang": "cpp",
"repo": "wonder-sk/stereo_fun",
"path": "/growth/stereo.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> C_best_L = _init_C_array(mImgL);
C_best_R = _init_C_array(mImgR);
}
else
{
mTableBaseline = new MatchingTable(mImgL.width(), mImgR.width(), mImgL.height());
}
}
void StereoMatching::runExit()
{
if (mUseProposed)
{
proposed_do_matching();
delete mTableProposed;
mTableProposed = NULL;
... | code_fim | hard | {
"lang": "cpp",
"repo": "wonder-sk/stereo_fun",
"path": "/growth/stereo.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>void StereoMatching::loadSeedsFromFile(QString path)
{
// Start a new queue
mQueue = SeedQueue();
QFile fseeds(path);
bool res = fseeds.open(QIODevice::ReadOnly);
Q_ASSERT(res);
// add seeds
for (;;)
{
QByteArray line = fseeds.readLine();
if (line.isNull()) break;
QList<QByteArr... | code_fim | hard | {
"lang": "cpp",
"repo": "wonder-sk/stereo_fun",
"path": "/growth/stereo.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
public:
tile();
tile(string l, int v);
string getl();
int getv();
void setl(string &l);
void setv(int &v);
private:
string myl;
int myv;
};
tile::tile()
{
myl = "";
myv = 0;
}
tile::tile(string l, int v)
{
myl = l;
myv = v;
}
string tile::getl()
{
return myl;
}
int tile::getv()
{
return m... | code_fim | medium | {
"lang": "cpp",
"repo": "thearkochatterjee/Computer-Programming-3-projects",
"path": "/scrabble/scrabble/tile.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
return myv;
}
void tile::setl(string &l)
{
myl = l;
}
void tile::setv(int &v)
{
myv = v;
}
#endif<|fim_prefix|>// repo: thearkochatterjee/Computer-Programming-3-projects path: /scrabble/scrabble/tile.h
#ifndef _TILE_H
#define _TILE_H
#include <string>
#include <sstream>
#include <fstream>
using nam... | code_fim | hard | {
"lang": "cpp",
"repo": "thearkochatterjee/Computer-Programming-3-projects",
"path": "/scrabble/scrabble/tile.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: thearkochatterjee/Computer-Programming-3-projects path: /scrabble/scrabble/tile.h
#ifndef _TILE_H
#define _TILE_H
#include <string>
#include <sstream>
#include <fstream>
using namespace std;
class tile
<|fim_suffix|>{
myl = l;
}
void tile::setv(int &v)
{
myv = v;
}
#endif<|fim_middle|>{
pub... | code_fim | hard | {
"lang": "cpp",
"repo": "thearkochatterjee/Computer-Programming-3-projects",
"path": "/scrabble/scrabble/tile.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> //SCALE - outside of loop b/c burst has same scale
this->curScale += this->curScaleDelta * deltaTime;
this->Scale.set( SCALE, this->curScale );
//UPDATE then DRAW individual particles
for( int i = 0; i < this->numParticles; ++i )
{
//UPDATE PARTICLES
this->particleArray[i].vel = this->particle... | code_fim | hard | {
"lang": "cpp",
"repo": "dkim828/MyGameEngine",
"path": "/Game/w14 Engine/ParticleBurst_Round.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: dkim828/MyGameEngine path: /Game/w14 Engine/ParticleBurst_Round.cpp
#include "ParticleBurst_Round.h"
#include "ParticleEmitter.h"
#include "ParticleEffect.h"
#include "Particle.h"
#include "TimeManager.h"
#include "CameraManager.h"
#include "ParticleEffectManager.h"
ParticleBurst_Round::Part... | code_fim | hard | {
"lang": "cpp",
"repo": "dkim828/MyGameEngine",
"path": "/Game/w14 Engine/ParticleBurst_Round.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
void ParticleBurst_Round::updateDraw( float deltaTime )
{
CameraManager::getCurrentCam()->getPos( this->CamPos );
//COLOR
this->curColor += this->curColorDelta * deltaTime;
this->gObj->color.set( this->curColor );
//SCALE - outside of loop b/c burst has same scale
this->curScale += this->curSc... | code_fim | hard | {
"lang": "cpp",
"repo": "dkim828/MyGameEngine",
"path": "/Game/w14 Engine/ParticleBurst_Round.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: erikperillo/mc833 path: /project/src/chatcontroller.h
#ifndef __CHATCONTROLLER_HEADER__
#define __CHATCONTROLLER_HEADER__
#include "chat.h"
#include "chatview.h"
#include <limits>
#include <string>
enum err: signed int
{
USER_NOT_FOUND = std::numeric_limits<int>::min(),
GROUP_NOT_FOUND,
USE... | code_fim | hard | {
"lang": "cpp",
"repo": "erikperillo/mc833",
"path": "/project/src/chatcontroller.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
private:
Chat& model;
ChatView& view;
public:
ChatController(Chat& model, ChatView& view);
int addGroup(const std::string& group_name);
int delGroup(const std::string& group_name);
int addUser(const User& user);
int delUser(const std::string& user_name);
int queueMessage(const Message& msg);... | code_fim | medium | {
"lang": "cpp",
"repo": "erikperillo/mc833",
"path": "/project/src/chatcontroller.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> // Define function block
block->build(buildtime);
return this;
}
bool run(MincRuntime& runtime, const std::vector<MincExpr*>& params)
{
return false;
}
MincObject* getType(const MincBlockExpr* parentBlock, const std::vector<MincExpr*>& params) const
{
return getVoid().type;
... | code_fim | hard | {
"lang": "cpp",
"repo": "RcSepp/minc",
"path": "/builtin-packages/paws/src/paws_subroutine.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (expectedType != gotType)
{
const MincCast* cast = buildtime.parentBlock->lookupCast(gotType, expectedType);
if (cast == nullptr)
throw CompileError(buildtime.parentBlock, argExpr->loc, "invalid function argument type: %E<%t>, expected: <%t>", argExpr, gotType, expectedType);
... | code_fim | hard | {
"lang": "cpp",
"repo": "RcSepp/minc",
"path": "/builtin-packages/paws/src/paws_subroutine.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> Famer(int);
Person operator[](int);
void add(const Person &);
};<|fim_prefix|>// repo: HoangDung1220/Demo3 path: /Famer.h
#include "Person.h"
class Famer{
private:
int size;
<|fim_middle|> Person *data;
public:
| code_fim | easy | {
"lang": "cpp",
"repo": "HoangDung1220/Demo3",
"path": "/Famer.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: HoangDung1220/Demo3 path: /Famer.h
#include "Person.h"
class Famer{
<|fim_suffix|> Person *data;
public:
Famer(int);
Person operator[](int);
void add(const Person &);
};<|fim_middle|> private:
int size;
| code_fim | easy | {
"lang": "cpp",
"repo": "HoangDung1220/Demo3",
"path": "/Famer.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Jumu3668/CSCI-2270-Code path: /Assignments/Assignment1/problem2.cpp
//Justin Murillo
//problem is that the last thing being printed is the array by itself
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
struct Park
{
string parkname;
stri... | code_fim | hard | {
"lang": "cpp",
"repo": "Jumu3668/CSCI-2270-Code",
"path": "/Assignments/Assignment1/problem2.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> stringstream convert2(argv[3]);
convert2 >> minArea;
for (int j = 0; j < arrayLength; j++)
{
if (prk[j].area >= minArea)
{
outFile << prk[j].parkname << "," << prk[j].state << "," << prk[j].area << endl;
}
}
outFile.close();
}<|fim_prefix|>// repo: Jumu366... | code_fim | hard | {
"lang": "cpp",
"repo": "Jumu3668/CSCI-2270-Code",
"path": "/Assignments/Assignment1/problem2.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>/* 80022138-80022158 0020+00 s=0 e=6 z=43 None .text fpcM_IsCreating__FUi */
BOOL fpcM_IsCreating(unsigned int pID) {
return fpcCt_IsCreatingByID(pID);
}
// TODO, uses a lot of functions outside f_pc/SSystem
/* 80022158-800222B8 0160+00 s=0 e=1 z=0 None .text fpcM_Management__FPFv_vPFv_v ... | code_fim | hard | {
"lang": "cpp",
"repo": "DedoGamingONE/tp",
"path": "/src/f_pc/f_pc_manager.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: DedoGamingONE/tp path: /src/f_pc/f_pc_manager.cpp
//
// Generated By: dol2asm
// Translation Unit: f_pc/f_pc_manager
//
#include "f_pc/f_pc_manager.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "f_pc/f_pc_base.h"
#include "f_pc/f_pc_create_iter.h"
#include "f_pc/f_pc_creator.h"
#i... | code_fim | hard | {
"lang": "cpp",
"repo": "DedoGamingONE/tp",
"path": "/src/f_pc/f_pc_manager.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>/* 800222F4-80022348 0054+00 s=0 e=3 z=0 None .text fpcM_FastCreate__FsPFPv_iPvPv */
base_process_class* fpcM_FastCreate(s16 pProcTypeID, FastCreateReqFunc param_2, void* param_3,
void* pData) {
return fpcFCtRq_Request(fpcLy_CurrentLayer(), pProcTypeID, (fstCr... | code_fim | hard | {
"lang": "cpp",
"repo": "DedoGamingONE/tp",
"path": "/src/f_pc/f_pc_manager.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>STDMETHODIMP CConnectedCtf::ObjectWindowEvent (OBJWNDEVT oe, long hORWnd)
{
return NOERROR;
}
///////////////////////////////////////////////////////////////////////////////
// CTF specifics
bool CConnectedCtf::EnsureLoaded(void)
{
if (NULL != m_pCTF)
return true;
return LoadCTF();
}
... | code_fim | hard | {
"lang": "cpp",
"repo": "15831944/TRiAS",
"path": "/TRiAS/TRiAS V2.07/FakeMFC/ConnectedCtf.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: 15831944/TRiAS path: /TRiAS/TRiAS V2.07/FakeMFC/ConnectedCtf.cpp
///////////////////////////////////////////////////////////////////////////////
// Connected CTF for maintenance of coordinate system configuration
// File: ConnectedCtf.cpp
#include "fakemfcp.hxx"
#include "fakemfc.h"
#incl... | code_fim | hard | {
"lang": "cpp",
"repo": "15831944/TRiAS",
"path": "/TRiAS/TRiAS V2.07/FakeMFC/ConnectedCtf.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>STDMETHODIMP CConnectedCtf::GeoClassEvent (long hPr, GEOCLASSEVT ce, long ulIdent)
{
return NOERROR;
}
STDMETHODIMP CConnectedCtf::GeoObjectEvent (long hPr, GEOOBJECTEVT oe, long lONr)
{
return NOERROR;
}
STDMETHODIMP CConnectedCtf::GeoFeatureEvent (long hPr, GEOFEATUREEVT fe, long ulMCode)
... | code_fim | hard | {
"lang": "cpp",
"repo": "15831944/TRiAS",
"path": "/TRiAS/TRiAS V2.07/FakeMFC/ConnectedCtf.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: mzry1992/workspace path: /contest/2012summer/UESTC Summer Team Training #3/H.cpp
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
using namespace std;
map<int,int> mp;
char s[10001];
int b,p,n,res;
<|fim_suffix|>int main()
{
int totc... | code_fim | hard | {
"lang": "cpp",
"repo": "mzry1992/workspace",
"path": "/contest/2012summer/UESTC Summer Team Training #3/H.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>int main()
{
int totcas;
scanf("%d",&totcas);
while (totcas--)
{
gets(s);
gets(s);
scanf("%d%d%d",&b,&p,&n);
res = 0;
if (b == 0)
{
for (int i = 0; s[i] != 0; i++)
if (s[i]%p == n)
... | code_fim | hard | {
"lang": "cpp",
"repo": "mzry1992/workspace",
"path": "/contest/2012summer/UESTC Summer Team Training #3/H.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: abiles/StudySlowly path: /201_CPP14/delete2.cpp
//// �Լ��� �����ϴ� �پ��� ���
template<typename T> void goo(T a)
{
}
<|fim_suffix|>//// ������ ���� ������ ���� ���, ������ �ƴ϶� ��ũ��
//private:
// Mutex(const Mutex&);
};
int main()
{
//// 1. �Ϲ� �Լ��� ���ø� �Լ����� ���� �Ҹ��� ������ void goo(d... | code_fim | medium | {
"lang": "cpp",
"repo": "abiles/StudySlowly",
"path": "/201_CPP14/delete2.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
//// 1. �Ϲ� �Լ��� ���ø� �Լ����� ���� �Ҹ��� ������ void goo(double) = delete; �� ������ �� �ؿ��� ������
goo(3.4);
//// 2. Mutex�� ���� �����ڸ� ����� �� ����.
Mutex m1;
Mutex m2 = m1; // ���� ������.
}<|fim_prefix|>// repo: abiles/StudySlowly path: /201_CPP14/delete2.cpp
//// �Լ��� �����ϴ� �پ��� ... | code_fim | hard | {
"lang": "cpp",
"repo": "abiles/StudySlowly",
"path": "/201_CPP14/delete2.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return labels[ bin ];
}
const int DepthHistogram::depthToPeak( const double depth, const std::vector< int > & peaks ) const
{
//double histDepth = this->m_bins.rows * ( ( depth - this->m_minimum ) / ( this->m_maximum - this->m_minimum ) );
double histDepth=this->depthToBin(depth);
std::vector< do... | code_fim | hard | {
"lang": "cpp",
"repo": "liguanqun/Origal_DSKCF",
"path": "/src/cf_libs/common/DepthHistogram.cpp",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> //Filter out the neighbouring peaks that are closer than the minimum peak distance
if( minimumPeakdistance > 1 )
{
while( current_max > minimumPeakHeight * max )
{
auto itr = std::find( candidates.begin(), candidates.end(), current_max_location.y );
if( itr != cand... | code_fim | hard | {
"lang": "cpp",
"repo": "liguanqun/Origal_DSKCF",
"path": "/src/cf_libs/common/DepthHistogram.cpp",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> return Box(range, range, range);
}
private:
Point2D compute_uv_from_xyz(const Point3D& p) const
{
Cartesian3D cartesian{ p.x(), p.y(), p.z() };
Spherical spherical = convert_coordinates<Spherical>(cartesian);
double u = fmod(Int... | code_fim | hard | {
"lang": "cpp",
"repo": "thomasvangoidsenhoven/Raytracer-3D-Cplus",
"path": "/raytracer/raytracer/primitives/sphere-primitive.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: thomasvangoidsenhoven/Raytracer-3D-Cplus path: /raytracer/raytracer/primitives/sphere-primitive.cpp
#include "primitives/sphere-primitive.h"
#include "util/misc.h"
#include "math/coordinate-systems.h"
#include "math/quadratic_equation.h"
#include "performance/performance.h"
#include <assert.h>
... | code_fim | hard | {
"lang": "cpp",
"repo": "thomasvangoidsenhoven/Raytracer-3D-Cplus",
"path": "/raytracer/raytracer/primitives/sphere-primitive.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: titarenko/Pathman path: /Pathman/RandomMovableController.cpp
#include "RandomMovableController.h"
#include "Game.h"
#include "Board.h"
#include "Movable.h"
#include "Random.h"
using namespace irr;
using namespace core;
<|fim_suffix|> array<E_DIRECTION> directions =
_board->getAv... | code_fim | hard | {
"lang": "cpp",
"repo": "titarenko/Pathman",
"path": "/Pathman/RandomMovableController.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>void RandomMovableController::refresh()
{
}
bool RandomMovableController::OnEvent(const SEvent& event)
{
if (Game::ToGameEvent(event) == EGE_FRAME_ENDED &&
_movable->isStopped() &&
Random::GetNumber() < _turnProbability) {
array<E_DIRECTION> directions =
_board->getAvailableDirect... | code_fim | hard | {
"lang": "cpp",
"repo": "titarenko/Pathman",
"path": "/Pathman/RandomMovableController.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> array<E_DIRECTION> directions =
_board->getAvailableDirections(_movable->getPosition());
_movable->move(directions[Random::GetNumber(directions.size())]);
}
return false;
}<|fim_prefix|>// repo: titarenko/Pathman path: /Pathman/RandomMovableController.cpp
#include "RandomMovableControl... | code_fim | hard | {
"lang": "cpp",
"repo": "titarenko/Pathman",
"path": "/Pathman/RandomMovableController.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>#include "TextureProgram.h"
class GenericTex {
public:
GenericTex(int cantTriangulos, float* positionArray, float* colorArray, float* normalArray, float* textureArray, int textId);
void print();
virtual ~GenericTex();
private:
int texId;
int cantTriangulos;
float* positionArray;
float... | code_fim | medium | {
"lang": "cpp",
"repo": "sebastiansanio/sistemasgraficosfiuba",
"path": "/tp3/src/GenericTex.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> float* positionArray;
float* colorArray;
float* normalArray;
float* textureArray;
TextureProgram* program;
GLuint bufferPositionHandler;
GLuint bufferColorHandler;
GLuint bufferNormalHandler;
GLuint bufferTextureHandler;
};
#endif /* GENERICTEX_H_ */<|fim_prefix|>// repo: sebastiansan... | code_fim | hard | {
"lang": "cpp",
"repo": "sebastiansanio/sistemasgraficosfiuba",
"path": "/tp3/src/GenericTex.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: sebastiansanio/sistemasgraficosfiuba path: /tp3/src/GenericTex.h
/*
* GenericTex.h
*
* Created on: Jan 16, 2013
* Author: damian
*/
#ifndef GENERICTEX_H_
#define GENERICTEX_H_
#include "TextureProgram.h"
<|fim_suffix|>public:
GenericTex(int cantTriangulos, float* posi... | code_fim | medium | {
"lang": "cpp",
"repo": "sebastiansanio/sistemasgraficosfiuba",
"path": "/tp3/src/GenericTex.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: laotse/libmgr path: /net/mgrInet.cpp
/*
*
* Skeleton Server
*
* (c) 2006 �AC - Microsystem Accessory Consult
* Dr. Lars Hanke
*
* $Id: mgrInet.cpp,v 1.6 2008-05-15 20:58:24 mgr Exp $
*
* This defines the classes:
*
* This defines the values:
*
*/
#include <string.h>
#include <stdli... | code_fim | hard | {
"lang": "cpp",
"repo": "laotse/libmgr",
"path": "/net/mgrInet.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> try {
Forker Mother;
printf("Test %d: InetStreamSocket CTROR\n",++tests);
InetStreamSocket socket;
puts("+++ CTOR finished OK!");
printf("Test %d: InetStreamSocket::hostname()\n",++tests);
res = socket.hostname("localhost");
if(ERR_NO_ERROR != res){
errors++;
... | code_fim | hard | {
"lang": "cpp",
"repo": "laotse/libmgr",
"path": "/net/mgrInet.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if(::pipe(pfd)){
printf("*** Error: pipe() failed %d\n",errno);
perror("*** System Error");
mgrThrow(ERR_FILE_OPEN);
}
pid_t child = -1;
res = Mother.fork( child );
if(res != ERR_NO_ERROR){
printf("*** Error: fork() failed 0x%.4x\n",(int)res);
perro... | code_fim | hard | {
"lang": "cpp",
"repo": "laotse/libmgr",
"path": "/net/mgrInet.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Eric07110904/UVA path: /uva530.cpp
#include<bits/stdc++.h>
using namespace std;
int main(){
//use double otherwise it will overflow
double m,n;
vector<double>top;
vector<double>bottom;
while(cin>>m>>n){
if(m==0&&n==0)
break;
if(n==0){
c... | code_fim | hard | {
"lang": "cpp",
"repo": "Eric07110904/UVA",
"path": "/uva530.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> }
double ans=1,ans2=1;
for(int i=0;i<n;i++){
ans*=top[i];
ans2*=bottom[i];
}
cout<<int(ans/ans2)<<endl;
top.clear();
bottom.clear();
}
return 0;
}<|fim_prefix|>// repo: Eric07110904/UVA path: /uva530.cpp
#include<bi... | code_fim | hard | {
"lang": "cpp",
"repo": "Eric07110904/UVA",
"path": "/uva530.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> std::cout << "Expression Stack:" << std::endl;
while(stackPtr-5 >= LoExpStack)
{
stackPtr-=5;
switch(*stackPtr)
{
case SID_CINT:
{
short number;
memcpy(&number, stackPtr+1, sizeof(short));
std::cout << "[CI " << number << "]" << std::endl;
}
break;
case SID_CFLOAT: ... | code_fim | hard | {
"lang": "cpp",
"repo": "hotkeysoft/pfe_8085basic",
"path": "/basic/prototypes/expreval/exprstack.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
//1.һ���� onePerson
struct one_person
{
std::string name;//��Ա����
std::vector <string> images;//��Աͼ��
int lable;//��Ա��ǩ
};
//2.����� group_db_person
struct group_db_person
{
map<int, one_person> db;//map�ṹ
//map ���ĸ���
int size() {
return (int)db.size();
};
//ѵ��push
void push(int... | code_fim | hard | {
"lang": "cpp",
"repo": "xueruomei/identification",
"path": "/identification/public.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return (int)db.size();
};
//ѵ��push
void push(int lable, string namefolder, string images) {
//cout << "lable:::" << lable << "->namefolder:::" << namefolder << "->images:::" << images << endl;
map<int, one_person>::iterator iter;//������
iter = db.find(lable);//����������
if (iter != db.end... | code_fim | hard | {
"lang": "cpp",
"repo": "xueruomei/identification",
"path": "/identification/public.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: xueruomei/identification path: /identification/public.h
#pragma once
#include <string>
#include<opencv2\opencv.hpp>
using namespace std;
using namespace cv;
//���еĽṹ��
//Ԥ��ֱ�ӷ��ؽ��
struct predict_data
{
string name;//ʶ�����ԱȺ����ʵ����
int predictedLabel;//ʶ�����ı�ǩ
double confidence;//���Ŷ... | code_fim | hard | {
"lang": "cpp",
"repo": "xueruomei/identification",
"path": "/identification/public.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: harmony84/Modern_C path: /Sort/Bubble/Source.cpp
#include <iostream>
#pragma region "Bubble Sort"
// Bubble sort = O(N^2)
// 거의 모든 상황에서 최악의 성능을 보여준다. 간단한 로직
void BubbleSort( char* target, size_t count )
{
for ( size_t i = 0; i < count - 1; ++i )
{
for ( size_t j = 1; j < count - i; ++j ... | code_fim | medium | {
"lang": "cpp",
"repo": "harmony84/Modern_C",
"path": "/Sort/Bubble/Source.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
#pragma region "Bubble Sort"
char word[] = { "TOLEARNSORTALGORITHMK" };
printf( "%s\n", word );
BubbleSort( word, strlen( word ) );
printf( "%s\n", word );
#pragma endregion
return 0;
}<|fim_prefix|>// repo: harmony84/Modern_C path: /Sort/Bubble/Source.cpp
#include <iostream>
#pragma region ... | code_fim | medium | {
"lang": "cpp",
"repo": "harmony84/Modern_C",
"path": "/Sort/Bubble/Source.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> jsmn_init(&parser);
int numTokens = jsmn_parse(&parser,
jsonObject.string(), jsonObject.size(), NULL, 0);
if (numTokens < 0) {
ALOGE("Parser returns error code=%d", numTokens);
return false;
}
unsigned int jsmnTokensSize = numTokens * sizeof(jsmntok_t);
mJs... | code_fim | hard | {
"lang": "cpp",
"repo": "LineageOS/android_frameworks_av",
"path": "/drm/mediacas/plugins/clearkey/JsonAssetLoader.cpp",
"mode": "spm",
"license": "LicenseRef-scancode-unicode",
"source": "the-stack-v2"
} |
<|fim_suffix|>JsonAssetLoader::JsonAssetLoader() {
}
JsonAssetLoader::~JsonAssetLoader() {
}
/*
* Extract a clear key asset from a JSON string.
*
* Returns OK if a clear key asset is extracted successfully,
* or ERROR_CAS_NO_LICENSE if the string doesn't contain a valid
* clear key asset.
*/
status_t JsonAssetL... | code_fim | hard | {
"lang": "cpp",
"repo": "LineageOS/android_frameworks_av",
"path": "/drm/mediacas/plugins/clearkey/JsonAssetLoader.cpp",
"mode": "spm",
"license": "LicenseRef-scancode-unicode",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: LineageOS/android_frameworks_av path: /drm/mediacas/plugins/clearkey/JsonAssetLoader.cpp
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may ... | code_fim | hard | {
"lang": "cpp",
"repo": "LineageOS/android_frameworks_av",
"path": "/drm/mediacas/plugins/clearkey/JsonAssetLoader.cpp",
"mode": "psm",
"license": "LicenseRef-scancode-unicode",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: abcd1236386/Programming path: /usaco/3.1/agrinet/agrinet.cpp
/*
ID:haoziyi1
PROG:agrinet
LANG:C++
*/
#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cstring>
using namespace std;
ifstream fin("agrinet.in");
ofstream ... | code_fim | hard | {
"lang": "cpp",
"repo": "abcd1236386/Programming",
"path": "/usaco/3.1/agrinet/agrinet.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> fin>>n;
int en=0;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
fin>>v;
if(j<=i)
continue;
edg[en].v=v;
edg[en].x=i;
edg[en].y=j;
en++;
}
}
//
sort(edg,edg+en,cmp);
... | code_fim | hard | {
"lang": "cpp",
"repo": "abcd1236386/Programming",
"path": "/usaco/3.1/agrinet/agrinet.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
public:
static vtkImageResliceST *New();
vtkTypeMacro(vtkImageResliceST, vtkImageReslice);
virtual void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkImageResliceST();
~vtkImageResliceST();
vtkImageResliceST(const vtkImageResliceST&);
void operator=(const vtkImageResliceST&);
... | code_fim | medium | {
"lang": "cpp",
"repo": "lheckemann/namic-sandbox",
"path": "/TensorDemonsRegistration/Original/Cxx/vtkImageResliceST.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> virtual void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkImageResliceST();
~vtkImageResliceST();
vtkImageResliceST(const vtkImageResliceST&);
void operator=(const vtkImageResliceST&);
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData,
int ext[6], in... | code_fim | medium | {
"lang": "cpp",
"repo": "lheckemann/namic-sandbox",
"path": "/TensorDemonsRegistration/Original/Cxx/vtkImageResliceST.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: lheckemann/namic-sandbox path: /TensorDemonsRegistration/Original/Cxx/vtkImageResliceST.h
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See Doc/copyright/copyright.txt
o... | code_fim | hard | {
"lang": "cpp",
"repo": "lheckemann/namic-sandbox",
"path": "/TensorDemonsRegistration/Original/Cxx/vtkImageResliceST.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Youngmj1994/Random-Projects path: /DoublyLinkedList/DoubleNode.cpp
#include "DoubleNode.h"
#include<iostream>
template<class ItemType>
DoubleNode<ItemType>::DoubleNode(const ItemType& anItem, DoubleNode<ItemType>* prevPtr, DoubleNode<ItemType>* nextPtr) :
item(anItem), prev(prevPtr), next(next... | code_fim | medium | {
"lang": "cpp",
"repo": "Youngmj1994/Random-Projects",
"path": "/DoublyLinkedList/DoubleNode.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
this->prev = prevPtr;
}
template<class ItemType>
void DoubleNode<ItemType>::setNext(DoubleNode<ItemType>* nextPtr)
{
this->next = nextPtr;
}<|fim_prefix|>// repo: Youngmj1994/Random-Projects path: /DoublyLinkedList/DoubleNode.cpp
#include "DoubleNode.h"
#include<iostream>
template<class ItemType>
D... | code_fim | medium | {
"lang": "cpp",
"repo": "Youngmj1994/Random-Projects",
"path": "/DoublyLinkedList/DoubleNode.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: footoflove/libmythtv-ui path: /src/mythsignalingtimer.h
// -*- Mode: c++ -*-
#ifndef _MYTH_SIGNALING_TIMER_H_
#define _MYTH_SIGNALING_TIMER_H_
#include <stdint.h>
#include <QThread>
#include <QMutex>
#include "mythexp.h"
<|fim_suffix|> private:
virtual void run(void);
QMutex ... | code_fim | hard | {
"lang": "cpp",
"repo": "footoflove/libmythtv-ui",
"path": "/src/mythsignalingtimer.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> private:
virtual void run(void);
QMutex startStopLock;
volatile bool dorun;
volatile bool running;
volatile uint64_t microsec;
};
#endif // _MYTH_SIGNALING_TIMER_H_<|fim_prefix|>// repo: footoflove/libmythtv-ui path: /src/mythsignalingtimer.h
// -*- Mode: c++ -*... | code_fim | hard | {
"lang": "cpp",
"repo": "footoflove/libmythtv-ui",
"path": "/src/mythsignalingtimer.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
Q_OBJECT
public:
MythSignalingTimer(QObject *parent, const char *slot);
~MythSignalingTimer();
virtual void stop(void);
virtual void start(int msec);
virtual bool blockSignals(bool block)
{ return QObject::blockSignals(block); }
signals:
void timeout(void);
... | code_fim | hard | {
"lang": "cpp",
"repo": "footoflove/libmythtv-ui",
"path": "/src/mythsignalingtimer.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: maxwang7/aa241a_airfoil path: /foil.cp
# x Cp
1.00000 0.49467
0.99249 0.15736
0.98176 0.01521
0.96946 -0.11994
0.95633 -0.23426
0.94288 -0.33484
0.92937 -0.42290
0.91570 -0.45969
0.90173 -0.48176
0.88752 -0.... | code_fim | hard | {
"lang": "cpp",
"repo": "maxwang7/aa241a_airfoil",
"path": "/foil.cp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>.11464
0.43213 -0.09913
0.44725 -0.08394
0.46239 -0.06877
0.47753 -0.05389
0.49268 -0.03935
0.50783 -0.02471
0.52299 -0.01020
0.53816 0.00396
0.55334 0.01829
0.56852 0.03272
0.58370 0.04683
0.59889 0.06114
0.6140... | code_fim | hard | {
"lang": "cpp",
"repo": "maxwang7/aa241a_airfoil",
"path": "/foil.cp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> while(i2 != -1)
{
if(s1.find(i2) != s1.end())
{
printf("%d", i2);
return 0;
}
else
{
i2 = arr[i2].next;
}
}
if(i2 == -1)
printf("-1");
return 0;
}<|fim_prefix|>// repo: Heartbleed98/PA... | code_fim | hard | {
"lang": "cpp",
"repo": "Heartbleed98/PAT",
"path": "/PAT甲级/1032.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>int main()
{
int start1, start2, n;
scanf("%d%d%d", &start1,&start2, &n);
for(int i = 0; i < n; i++)
{
int add, nt;
char c;
scanf("%d %c %d", &add, &c, &nt);
node n1 = {c, nt};
arr[add] = n1;
}
set<int> s1;
int i1 = start1;
while(i1... | code_fim | medium | {
"lang": "cpp",
"repo": "Heartbleed98/PAT",
"path": "/PAT甲级/1032.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Heartbleed98/PAT path: /PAT甲级/1032.cpp
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
struct node{
char ch;
int next;
};
<|fim_suffix|> scanf("%d%d%d", &start1,&start2, &n);
for(int i = 0; i < n; i++)
{
int... | code_fim | medium | {
"lang": "cpp",
"repo": "Heartbleed98/PAT",
"path": "/PAT甲级/1032.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: gabrysiam8/labPOI path: /lab00/Trojkat.h
#ifndef TROJKAT_H
#define TROJKAT_H
#include "Ksztalt.h"
//klasa reprezentujaca trojkat, dziedziczy publiczne skladowe klasy Ksztalt
class Trojkat: public Ksztalt
<|fim_suffix|> //metoda niepobierajaca zadnych argumentow, zwracajaca wartosc typu double -... | code_fim | hard | {
"lang": "cpp",
"repo": "gabrysiam8/labPOI",
"path": "/lab00/Trojkat.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> //metoda niepobierajaca zadnych argumentow, zwracajaca wartosc typu double - pole powierzchni trojkata reprezentowanego przez obiekt klasy
double polePow() const;
private:
//zmienne przechowujace dlugosci bokow trojkata
double _a;
double _b;
double _c;
};
#endif<|fim_prefix|>// repo: gabrysiam8/lab... | code_fim | hard | {
"lang": "cpp",
"repo": "gabrysiam8/labPOI",
"path": "/lab00/Trojkat.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
int TT;
scanf("%d", &TT);
for (int tt = 1; tt <= TT; tt++) {
int R, C, N;
scanf("%d %d %d", &R, &C, &N);
ULL sol = get_min(R, C, N);
printf("Case #%d: %llu\n", tt, sol);
}
return 0;
}<|fim_prefix|>// repo: alexandraback/datacollection path: /solutions... | code_fim | hard | {
"lang": "cpp",
"repo": "alexandraback/datacollection",
"path": "/solutions_5769900270288896_0/C++/chicapi/sol.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: alexandraback/datacollection path: /solutions_5769900270288896_0/C++/chicapi/sol.cpp
#include <assert.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#inc... | code_fim | hard | {
"lang": "cpp",
"repo": "alexandraback/datacollection",
"path": "/solutions_5769900270288896_0/C++/chicapi/sol.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>int main ()
{
int TT;
scanf("%d", &TT);
for (int tt = 1; tt <= TT; tt++) {
int R, C, N;
scanf("%d %d %d", &R, &C, &N);
ULL sol = get_min(R, C, N);
printf("Case #%d: %llu\n", tt, sol);
}
return 0;
}<|fim_prefix|>// repo: alexandraback/datacollection path... | code_fim | hard | {
"lang": "cpp",
"repo": "alexandraback/datacollection",
"path": "/solutions_5769900270288896_0/C++/chicapi/sol.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: cmenpgroup/ctProcess_omega path: /EG2Target.h
#ifndef EG2TARGET_H
#define EG2TARGET_H
#include <vector>
#include <string>
<|fim_suffix|> string Get_Label(int num) {return Label[num];};
double Get_LD2_lo() {return RangeLD2[0];};
double Get_LD2_hi() {return RangeLD2[1];};
double Get_N... | code_fim | hard | {
"lang": "cpp",
"repo": "cmenpgroup/ctProcess_omega",
"path": "/EG2Target.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> int Get_nIndex() {return Index.size();};
string Get_Label(int num) {return Label[num];};
double Get_LD2_lo() {return RangeLD2[0];};
double Get_LD2_hi() {return RangeLD2[1];};
double Get_Nuc_lo() {return RangeNuc[0];};
double Get_Nuc_hi() {return RangeNuc[1];};
int Get_Index(double... | code_fim | medium | {
"lang": "cpp",
"repo": "cmenpgroup/ctProcess_omega",
"path": "/EG2Target.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> string Get_Label(int num) {return Label[num];};
double Get_LD2_lo() {return RangeLD2[0];};
double Get_LD2_hi() {return RangeLD2[1];};
double Get_Nuc_lo() {return RangeNuc[0];};
double Get_Nuc_hi() {return RangeNuc[1];};
int Get_Index(double z);
void Print_Info();
};
#endif<|fim_prefi... | code_fim | hard | {
"lang": "cpp",
"repo": "cmenpgroup/ctProcess_omega",
"path": "/EG2Target.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>d::string &source) const;
private:
iconv_t conversionDescriptor;
};<|fim_prefix|>// repo: BuYishi/charset_converter_test path: /charset_converter_test/CharsetConverter.h
#pragma once
#include <iconv/iconv.h>
#include <string>
class Chars<|fim_middle|>etConverter
{
public:
CharsetConverter(const char *t... | code_fim | medium | {
"lang": "cpp",
"repo": "BuYishi/charset_converter_test",
"path": "/charset_converter_test/CharsetConverter.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: BuYishi/charset_converter_test path: /charset_converter_test/CharsetConverter.h
#pragma once
#include <iconv/iconv.h>
#include <string>
class Chars<|fim_suffix|>har *fromCode);
~CharsetConverter();
std::string convert(const std::string &source) const;
private:
iconv_t conversionDescriptor;
};... | code_fim | medium | {
"lang": "cpp",
"repo": "BuYishi/charset_converter_test",
"path": "/charset_converter_test/CharsetConverter.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>har *fromCode);
~CharsetConverter();
std::string convert(const std::string &source) const;
private:
iconv_t conversionDescriptor;
};<|fim_prefix|>// repo: BuYishi/charset_converter_test path: /charset_converter_test/CharsetConverter.h
#pragma once
#include <iconv/iconv.h>
#include <string>
class Chars... | code_fim | medium | {
"lang": "cpp",
"repo": "BuYishi/charset_converter_test",
"path": "/charset_converter_test/CharsetConverter.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>void MainWindow::fs_behavior_down(){
roboy_dep::brain_id msg;
msg.brain_id = 42.;
brain_id_pub.publish(msg);
roboy_dep::transition_direction msg1;
msg1.up = false;
tran_dir_pub.publish(msg1);
}
void MainWindow::sd_behavior_down(){
roboy_dep::brain_id msg;
msg.brain_id = 63.;
brain_id_pub.publis... | code_fim | hard | {
"lang": "cpp",
"repo": "morpana/dep_gui",
"path": "/src/mainwindow.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: morpana/dep_gui path: /src/mainwindow.cpp
<roboy_dep::depParameters>("/roboy_dep/depParameters", 1);
depLoadMatrix = nh->advertise<roboy_dep::depMatrix>("/roboy_dep/depLoadMatrix", 1);
depMatrix = nh->subscribe("/roboy_dep/depMatrix", 1, &MainWindow::msgDepMatrix, this);
motorStatus = nh->s... | code_fim | hard | {
"lang": "cpp",
"repo": "morpana/dep_gui",
"path": "/src/mainwindow.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: morpana/dep_gui path: /src/mainwindow.cpp
,j));
}
msg.depMatrix.push_back(msg_temp);
}
depLoadMatrix.publish(msg);
}
void MainWindow::publishLinearCombination(){
bool on = false;
double prev_level = 0.0;
double curr_level = 0.0;
while (1){
t_start = std::chrono::high_resolution_cloc... | code_fim | hard | {
"lang": "cpp",
"repo": "morpana/dep_gui",
"path": "/src/mainwindow.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>struct Skeleton {
size_t n_nodes = 0;
SkeletonNode nodes[32];
std::map<std::string, size_t> names;
};<|fim_prefix|>// repo: Hypersonic/FistDance path: /src/core/skeleton/skeleton.h
#pragma once
#include <cstring> // For size_t
#include <assert.h>
#include <map>
#include <string>
<|fim_middle|... | code_fim | easy | {
"lang": "cpp",
"repo": "Hypersonic/FistDance",
"path": "/src/core/skeleton/skeleton.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> std::map<std::string, size_t> names;
};<|fim_prefix|>// repo: Hypersonic/FistDance path: /src/core/skeleton/skeleton.h
#pragma once
#include <cstring> // For size_t
#include <assert.h>
#include <map>
#include <string>
#include "node.h"
<|fim_middle|>struct Skeleton {
size_t n_nodes = 0;
Skele... | code_fim | medium | {
"lang": "cpp",
"repo": "Hypersonic/FistDance",
"path": "/src/core/skeleton/skeleton.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Hypersonic/FistDance path: /src/core/skeleton/skeleton.h
#pragma once
#include <cstring> // For size_t
#include <assert.h>
#include <map>
#include <string>
<|fim_suffix|>struct Skeleton {
size_t n_nodes = 0;
SkeletonNode nodes[32];
std::map<std::string, size_t> names;
};<|fim_middle|... | code_fim | easy | {
"lang": "cpp",
"repo": "Hypersonic/FistDance",
"path": "/src/core/skeleton/skeleton.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> //if this is a new node return default statistics
if(mymap.find(id) == mymap.end()){
mean = 0.0;
std = -1.0;
return;
}
else{
mymap[id] -> calStat(Depth, Length);
mean = mymap[id] -> getMean();
std = mymap[id] -> getStd();
}
}<|fim_prefix... | code_fim | hard | {
"lang": "cpp",
"repo": "geodesic1/insight_data_anomalous_detection",
"path": "/src/graph.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>//get the statistics given the id of this people
void Graph::checkStat( int id, double &mean, double &std){
//if this is a new node return default statistics
if(mymap.find(id) == mymap.end()){
mean = 0.0;
std = -1.0;
return;
}
else{
mymap[id] -> calStat(De... | code_fim | hard | {
"lang": "cpp",
"repo": "geodesic1/insight_data_anomalous_detection",
"path": "/src/graph.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: geodesic1/insight_data_anomalous_detection path: /src/graph.cpp
#include "graph.h"
Graph::Graph(int D, int T){
Depth = D;
Length = T;
pID = 0;
}
//function to process purchase event
void Graph::purchase(string timestamp, int id, double amount){
Node* tmp;
//find people Node by... | code_fim | medium | {
"lang": "cpp",
"repo": "geodesic1/insight_data_anomalous_detection",
"path": "/src/graph.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: ebby-s/ELEC40004 path: /q3/s2/GenA.cpp
#include "Proxy.hpp"
<|fim_suffix|>{
Proxy c;
c.set_X(4);
c.set_Y(4.5);
c.set_Z("Hello");
for(int i=0; i<5; i++){
c.g();
c.f(4);
}
}<|fim_middle|>int main()
| code_fim | easy | {
"lang": "cpp",
"repo": "ebby-s/ELEC40004",
"path": "/q3/s2/GenA.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> c.set_X(4);
c.set_Y(4.5);
c.set_Z("Hello");
for(int i=0; i<5; i++){
c.g();
c.f(4);
}
}<|fim_prefix|>// repo: ebby-s/ELEC40004 path: /q3/s2/GenA.cpp
#include "Proxy.hpp"
int main()
<|fim_middle|>{
Proxy c;
| code_fim | easy | {
"lang": "cpp",
"repo": "ebby-s/ELEC40004",
"path": "/q3/s2/GenA.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> scene->addChild(layer_BG);
scene->addChild(layer_MENU);
return scene;
}<|fim_prefix|>// repo: Ariten-story/classes path: /CharSlotScene.cpp
#include "CharSlotScene.h"
#include "CharSlot_BG_Layer.h"
#include "CharSlot_MENU_Layer.h"
USING_NS_CC;
<|fim_middle|>CharSlot::CharSlot()
{
}
CharSlot::~Char... | code_fim | hard | {
"lang": "cpp",
"repo": "Ariten-story/classes",
"path": "/CharSlotScene.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Ariten-story/classes path: /CharSlotScene.cpp
#include "CharSlotScene.h"
#include "CharSlot_BG_Layer.h"
#include "CharSlot_MENU_Layer.h"
USING_NS_CC;
CharSlot::CharSlot()
{
}
CharSlot::~CharSlot()
{
}
<|fim_suffix|>
auto layer_BG = CharSlot_BG::create();
auto layer_MENU = CharSlot_MENU::cr... | code_fim | medium | {
"lang": "cpp",
"repo": "Ariten-story/classes",
"path": "/CharSlotScene.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.