text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_suffix|>CharSlot::~CharSlot()
{
}
Scene* CharSlot::createScene()
{
auto scene = Scene::create();
auto layer_BG = CharSlot_BG::create();
auto layer_MENU = CharSlot_MENU::create();
scene->addChild(layer_BG);
scene->addChild(layer_MENU);
return scene;
}<|fim_prefix|>// repo: Ariten-story/classes path: /Ch... | code_fim | easy | {
"lang": "cpp",
"repo": "Ariten-story/classes",
"path": "/CharSlotScene.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: xflying777/OpenAcc path: /fast_poission/fastpoisson_gpu2.cpp
//*******************************************************************************
//Using cufft to do the discrete sine transform and solve the Poisson equation.
//*******************************************************************... | code_fim | hard | {
"lang": "cpp",
"repo": "xflying777/OpenAcc",
"path": "/fast_poission/fastpoisson_gpu2.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>void fdst_gpu(float *data, float *data2, float *data3, int Nx, int Ny, int Lx)
{
float s;
s = sqrt(2.0/(Nx+1));
#pragma acc data present(data3[0:2*Lx*Ny],data[0:Nx*Ny],data2[0:Lx*Ny])
{
expand_data(data, data2, Nx, Ny, Lx);
expand_idata(data2, data3, Nx, Ny, Lx);
// Copy data to devic... | code_fim | hard | {
"lang": "cpp",
"repo": "xflying777/OpenAcc",
"path": "/fast_poission/fastpoisson_gpu2.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> float h, *lamda, *temp;
temp = (float *) malloc(Nx*Ny*sizeof(float));
lamda = (float *) malloc(Nx*sizeof(float));
h = 1.0/(Nx+1);
#pragma acc data create(lamda[0:Nx],temp[0:Nx*Ny]), present(b[0:Nx*Ny],x[0:Nx*Ny])
{
#pragma acc parallel loop independent
for(i=0;i<Nx;i++)
{
lamda[i] = 2 -... | code_fim | hard | {
"lang": "cpp",
"repo": "xflying777/OpenAcc",
"path": "/fast_poission/fastpoisson_gpu2.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: cbm-instructions/informatik-rangers path: /code/sounding_sender/sounding_sender.ino
// Sensor pins
#define SENSOR_INPUT_FRONT A0 //sensor nr.: 515
#define SENSOR_INPUT_BACK A1 //sensor nr.: 510.5
double rmsFrontSensor = 0, rmsBackSensor = 0;
<|fim_suffix|> int delayBetweenMeasures = 1;
i... | code_fim | hard | {
"lang": "cpp",
"repo": "cbm-instructions/informatik-rangers",
"path": "/code/sounding_sender/sounding_sender.ino",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>// Print two values in one graph
void sendValuesAsIntegerPerPrint(double value1, double value2) {
int v1 = value1 * 100;
int v2 = value2 * 100;
Serial.print(v1);
Serial.print(',');
Serial.println(v2);
}<|fim_prefix|>// repo: cbm-instructions/informatik-rangers path: /code/sounding_sender/sou... | code_fim | hard | {
"lang": "cpp",
"repo": "cbm-instructions/informatik-rangers",
"path": "/code/sounding_sender/sounding_sender.ino",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> CYiRongCarDetectFPQDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: �ڴ˷��ô�����ʱ��
// ��ȷ�������رնԻ���Ĵ���
}
else if (nResponse == IDCANCEL)
{
// TODO: �ڴ˷��ô�����ʱ��
// ��ȡ�������رնԻ���Ĵ���
}
// ���ڶԻ����ѹرգ����Խ����� FALS... | code_fim | hard | {
"lang": "cpp",
"repo": "isliulin/brpj",
"path": "/YiRongCarDetectAIO/YiRongCarDetectFPQ/YiRongCarDetectFPQ.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: isliulin/brpj path: /YiRongCarDetectAIO/YiRongCarDetectFPQ/YiRongCarDetectFPQ.cpp
// YiRongCarDetectFPQ.cpp : ����Ӧ�ó��������Ϊ��
//
#include "stdafx.h"
#include "YiRongCarDetectFPQ.h"
#include "YiRongCarDetectFPQDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
//��ǰ·��
TCHAR Curr... | code_fim | hard | {
"lang": "cpp",
"repo": "isliulin/brpj",
"path": "/YiRongCarDetectAIO/YiRongCarDetectFPQ/YiRongCarDetectFPQ.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
glUniformMatrix4fv(glGetUniformLocation(m_shaderProgram, name.c_str()), 1, GL_FALSE, glm::value_ptr(value));
}
unsigned int Shader::GetShaderProgram() const
{
return m_shaderProgram;
}<|fim_prefix|>// repo: dwarzecha/gl-craft path: /gl-craft/Source/Shader/Shader.cpp
#include "GL/glew.h"
#incl... | code_fim | medium | {
"lang": "cpp",
"repo": "dwarzecha/gl-craft",
"path": "/gl-craft/Source/Shader/Shader.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: dwarzecha/gl-craft path: /gl-craft/Source/Shader/Shader.cpp
#include "GL/glew.h"
#include "Shader.hpp"
<|fim_suffix|>{
glUniformMatrix4fv(glGetUniformLocation(m_shaderProgram, name.c_str()), 1, GL_FALSE, glm::value_ptr(value));
}
unsigned int Shader::GetShaderProgram() const
{
return ... | code_fim | medium | {
"lang": "cpp",
"repo": "dwarzecha/gl-craft",
"path": "/gl-craft/Source/Shader/Shader.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>unsigned int Shader::GetShaderProgram() const
{
return m_shaderProgram;
}<|fim_prefix|>// repo: dwarzecha/gl-craft path: /gl-craft/Source/Shader/Shader.cpp
#include "GL/glew.h"
#include "Shader.hpp"
void Shader::UniformMatrix4fv(glm::mat4 value, const std::string& name) const
<|fim_middle|>{
gl... | code_fim | medium | {
"lang": "cpp",
"repo": "dwarzecha/gl-craft",
"path": "/gl-craft/Source/Shader/Shader.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: ShiZhuming/pku-pkupsy path: /practice3/C.cpp
#include<cstdio>
int main()
{
const int size = 30005;
int n, m, max = 0;
<|fim_suffix|> for (int i = 0; i < size; i++)
{
p[i] = 0;
}
while (n--)
{
scanf("%d",&m);
p[m] ++;
}
for (int i = 0; i ... | code_fim | easy | {
"lang": "cpp",
"repo": "ShiZhuming/pku-pkupsy",
"path": "/practice3/C.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> for (int i = 0; i < size; i++)
{
p[i] = 0;
}
while (n--)
{
scanf("%d",&m);
p[m] ++;
}
for (int i = 0; i < size; i++)
{
max = p[i] > max ? p[i] : max;
}
for (int i = 0; i < size; i++)
{
if(p[i] == max)
{
... | code_fim | easy | {
"lang": "cpp",
"repo": "ShiZhuming/pku-pkupsy",
"path": "/practice3/C.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: tkinsey95/Tiriah-CSCI20-Fall2016 path: /lab8/lab8.cpp
#include <iostream>
using namespace std;
/*
void weightInput(double £s, double &ounces){
cout << "Enter the pounds: ";
cin >> pounds;
cout << "Enter the ounces: ";
cin >> ounces;
}
... | code_fim | hard | {
"lang": "cpp",
"repo": "tkinsey95/Tiriah-CSCI20-Fall2016",
"path": "/lab8/lab8.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> int main() {
double lbs = 0;
double kilograms = 0;
cout << "Enter the pounds: ";
cin >> lbs;
cout << "Kilograms: " << toKilo(lbs) <<endl;
cout << "Enter the kilograms: ";
cin >> kilograms;
cout << "Pounds: " << toPounds(kilograms) << end... | code_fim | hard | {
"lang": "cpp",
"repo": "tkinsey95/Tiriah-CSCI20-Fall2016",
"path": "/lab8/lab8.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> std::cout << size << std::endl;
}
}
int main() {
std::cout << "starting" << std::endl;
hfu::find_nth_index_test();
std::cout << "find_nth_index_test passed" << std::endl;
hfu::extract_airline_test();
std::cout << "find_airline_test passed" << std::endl;
hfu::create_... | code_fim | hard | {
"lang": "cpp",
"repo": "AljoshaVieth/ObjektOrientiertesProgrammieren",
"path": "/09/main.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: AljoshaVieth/ObjektOrientiertesProgrammieren path: /09/main.cpp
//
// Created by Aljosha on 01.06.2021.
//
#include <string>
#include <iostream>
#include <cassert>
#include <map>
#include <fstream>
#include <bits/unique_ptr.h>
namespace hfu {
/**
* This function should return the nt... | code_fim | hard | {
"lang": "cpp",
"repo": "AljoshaVieth/ObjektOrientiertesProgrammieren",
"path": "/09/main.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: lyu/ams595 path: /day4/day4_obj_lifetime.cpp
// Predict the output of this program
#include <iostream>
class Foo {
public:
int x;
<|fim_suffix|>
friend Foo operator+(const Foo& a, const Foo& b) {
Foo tmp;
tmp.x = a.x + b.x;
return tmp;
... | code_fim | hard | {
"lang": "cpp",
"repo": "lyu/ams595",
"path": "/day4/day4_obj_lifetime.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>void bar(const Foo i) {
static Foo s3 = i + 1;
++s3;
}
int main() {
Foo s1, s2(1);
bar(s1);
bar(2);
}<|fim_prefix|>// repo: lyu/ams595 path: /day4/day4_obj_lifetime.cpp
// Predict the output of this program
#include <iostream>
class Foo {
public:
int x;
<|fim_middle|>... | code_fim | hard | {
"lang": "cpp",
"repo": "lyu/ams595",
"path": "/day4/day4_obj_lifetime.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
friend Foo operator+(const Foo& a, const Foo& b) {
Foo tmp;
tmp.x = a.x + b.x;
return tmp;
}
};
void bar(const Foo i) {
static Foo s3 = i + 1;
++s3;
}
int main() {
Foo s1, s2(1);
bar(s1);
bar(2);
}<|fim_prefix|>// repo: lyu/ams59... | code_fim | hard | {
"lang": "cpp",
"repo": "lyu/ams595",
"path": "/day4/day4_obj_lifetime.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> PLUGIN_NO_DEFAULT_CONSTRUCTION(CFireManager)
public:
unsigned int m_nTotalFires;
CFire m_aFires[40];
SUPPORTED_10EN_11EN_STEAM void ExtinguishPoint(CVector point, float range);
SUPPORTED_10EN_11EN_STEAM CFire *FindFurthestFire_NeverMindFireMen(CVector pos, float minRange, float maxRa... | code_fim | medium | {
"lang": "cpp",
"repo": "DK22Pac/plugin-sdk",
"path": "/plugin_III/game_III/CFireManager.h",
"mode": "spm",
"license": "Zlib",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: kyasutome/BabyMIND-Analysis path: /lib/src/BMHitClusterDict.cc
// Do NOT change. Changes will be lost next time file is generated
#define R__DICTIONARY_FILENAME BMHitClusterDict
#define R__NO_DEPRECATION
/*******************************************************************/
#include <stddef.h>
... | code_fim | hard | {
"lang": "cpp",
"repo": "kyasutome/BabyMIND-Analysis",
"path": "/lib/src/BMHitClusterDict.cc",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> // Dictionary for non-ClassDef classes
static TClass *BMHitCluster_Dictionary() {
TClass* theClass =::ROOT::GenerateInitInstanceLocal((const ::BMHitCluster*)0x0)->GetClass();
BMHitCluster_TClassManip(theClass);
return theClass;
}
static void BMHitCluster_TClassManip(TClass* ){
... | code_fim | hard | {
"lang": "cpp",
"repo": "kyasutome/BabyMIND-Analysis",
"path": "/lib/src/BMHitClusterDict.cc",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: J4Yaaa/Template path: /List.cpp
#include "List.h"
#include <iostream>
using namespace std;
#include <assert.h>
#include <string>
#include <stdio.h>
#include <stdlib.h>
template <class T>
List<T>::List() :_head(new Node(T()))
{
_head->_next = _head;
_head->_prev = _head;
}
temp... | code_fim | hard | {
"lang": "cpp",
"repo": "J4Yaaa/Template",
"path": "/List.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
assert(pos && _head->_next != _head);
Node* prev_node = pos->_prev;
Node* next_node = pos->_next;
prev_node->_next = next_node;
next_node->_prev = prev_node;
delete pos;
}
template <class T>
void List<T>::Show()
{
Node* cur = _head->_next;
while (cur != _head)
{
cout << cur-... | code_fim | hard | {
"lang": "cpp",
"repo": "J4Yaaa/Template",
"path": "/List.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: GeospatialDaryl/pyBCMRowCol path: /bcm.cpp
#include "bcm.hpp"
int RolFromXCoord(double xCoord){
double xLeft = -374495.83635;
double cellSize = 270.0;
double result;
int retVal;
result = (xCoord - xLeft)/cellSize;
retVal = result;
return retVal;
}
int RowFromYCoo... | code_fim | medium | {
"lang": "cpp",
"repo": "GeospatialDaryl/pyBCMRowCol",
"path": "/bcm.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> double yBot = -616153.33419;
double cellSize = 270.0;
double result;
int retVal;
result = (yCoord - yBot)/cellSize;
retVal = result;
return retVal;
}<|fim_prefix|>// repo: GeospatialDaryl/pyBCMRowCol path: /bcm.cpp
#include "bcm.hpp"
int RolFromXCoord(double xCoord){
... | code_fim | medium | {
"lang": "cpp",
"repo": "GeospatialDaryl/pyBCMRowCol",
"path": "/bcm.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
result = (yCoord - yBot)/cellSize;
retVal = result;
return retVal;
}<|fim_prefix|>// repo: GeospatialDaryl/pyBCMRowCol path: /bcm.cpp
#include "bcm.hpp"
int RolFromXCoord(double xCoord){
<|fim_middle|> double xLeft = -374495.83635;
double cellSize = 270.0;
double result;
i... | code_fim | hard | {
"lang": "cpp",
"repo": "GeospatialDaryl/pyBCMRowCol",
"path": "/bcm.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: OwenQian/Phil-Ivy path: /player.h
#ifndef PLAYER_H
#define PLAYER_H
#include <vector>
class Player {
private:
std::vector<int> holeCards;
double chips;
double potInvestment;
public:
Player();
// Creates players with appropriate values
Player(std::vector<int> hcard... | code_fim | medium | {
"lang": "cpp",
"repo": "OwenQian/Phil-Ivy",
"path": "/player.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> Player& operator=(const Player& rhs);
};
inline void Player::setHoleCards(int c1, int c2) {
std::vector<int> v{c1, c2};
holeCards = v;
}
#endif<|fim_prefix|>// repo: OwenQian/Phil-Ivy path: /player.h
#ifndef PLAYER_H
#define PLAYER_H
#include <vector>
class Player {
private:
std::vector... | code_fim | hard | {
"lang": "cpp",
"repo": "OwenQian/Phil-Ivy",
"path": "/player.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>TrajectoryState LinearTrajectory::evaluate(double t) {
return inner->evaluate(t);
}
}<|fim_prefix|>// repo: dennisss/tansa path: /src/trajectory/linear.cpp
#include <tansa/trajectory.h>
#include <vector>
#include <iostream>
using namespace std;
namespace tansa {
/*
Linear trajectories go from poi... | code_fim | hard | {
"lang": "cpp",
"repo": "dennisss/tansa",
"path": "/src/trajectory/linear.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> //
// If an error has occurred, more details can be found here.
//
virtual bool IsError() const = 0;
virtual const char* GetErrorString() const = 0;
};
//-------------------------------------------------------------------------------------
// EXAMPLE USAGE
//
// IDXConfigDB... | code_fim | hard | {
"lang": "cpp",
"repo": "TomLeeLive/aras-p-dingus",
"path": "/dingus/dingus/dxutils/DXConfigDB.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>//-------------------------------------------------------------------------------------
// EXAMPLE USAGE
//
// IDXConfigDB* pCDB = IDXConfigDB::Create();
// if (!pCDB->Load("config.txt", d3dAdId, d3dCaps, SysMem, VidMem))
// {
// ... error ...
// }
//
// ... use properties ...
//
// pCDB->Rele... | code_fim | hard | {
"lang": "cpp",
"repo": "TomLeeLive/aras-p-dingus",
"path": "/dingus/dingus/dxutils/DXConfigDB.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: rafid211/online-judge-solution path: /codeforces/A. Nicholas and Permutation.cpp
#include <bits/stdc++.h>
using namespace std;
int main()
<|fim_suffix|> int mn=INT_MAX;
for(int i=0;i<n;i++){
cin >>a[i];
mx=max(mx,a[i]);
mn=min(mn,a[i]);
}
int mnI,mxI;
f... | code_fim | medium | {
"lang": "cpp",
"repo": "rafid211/online-judge-solution",
"path": "/codeforces/A. Nicholas and Permutation.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if(mnI>mxI){
ans=max(mnI,n-1-mxI);
}
else{
ans=max(mxI,n-1-mnI);
}
cout <<ans<<endl;
return 0;
}<|fim_prefix|>// repo: rafid211/online-judge-solution path: /codeforces/A. Nicholas and Permutation.cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
in... | code_fim | hard | {
"lang": "cpp",
"repo": "rafid211/online-judge-solution",
"path": "/codeforces/A. Nicholas and Permutation.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: dadalee51/debouncerArduino path: /debouncer/Debouncer.cpp
#include "Debouncer.h"
#include "Arduino.h"
int reading=0;
int buttonState=0; // the current reading from the input pin
int lastButtonState = 0; // the previous reading from the input pin
int ledState = 0;
unsigned long last... | code_fim | medium | {
"lang": "cpp",
"repo": "dadalee51/debouncerArduino",
"path": "/debouncer/Debouncer.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> reading = digitalRead(buttonPin);
if (reading != lastButtonState) {
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
if (reading != buttonState) {
buttonState = reading;
if (buttonState == HIGH) {
ledState = !ledState;
}
}
... | code_fim | hard | {
"lang": "cpp",
"repo": "dadalee51/debouncerArduino",
"path": "/debouncer/Debouncer.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>//------------------------------------------------------------------------------
AutoMemBlock::~AutoMemBlock()
{
Clear();
}
//------------------------------------------------------------------------------
bool AutoMemBlock::IsEmpty() const
{
return allocatorPtr_.IsNull();
}
//-------------------... | code_fim | hard | {
"lang": "cpp",
"repo": "hoboaki/engineplan",
"path": "/Scratch/LowLevelGraphics/VulkanSample/AeVulkanLib/ae/base/AutoMemBlock.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: hoboaki/engineplan path: /Scratch/LowLevelGraphics/VulkanSample/AeVulkanLib/ae/base/AutoMemBlock.cpp
// 文字コード:UTF-8
#include <ae/base/AutoMemBlock.hpp>
// includes
#include <ae/base/IAllocator.hpp>
//------------------------------------------------------------------------------
namespace ae::b... | code_fim | hard | {
"lang": "cpp",
"repo": "hoboaki/engineplan",
"path": "/Scratch/LowLevelGraphics/VulkanSample/AeVulkanLib/ae/base/AutoMemBlock.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> for (size_t i = 0; i < arg_shape.size(); i++) {
input_batch_transform_source_axis_order[i] = i;
}
CoordinateTransform input_batch_transform(arg_shape,
input_batch_transform_start,
... | code_fim | hard | {
"lang": "cpp",
"repo": "openvinotoolkit/openvino",
"path": "/src/core/reference/include/ngraph/runtime/reference/avg_pool.hpp",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: MacroMachines/ADDAC-Library path: /examples/TUTORIAL_00_01_02_BASICS/Part_1_startVCC/startVCC_blank/startVCC_blank.ino
//INCLUDE STANDARDCPLUSPLUS LIBRARY//
#include <StandardCplusplus.h>
#include <vector>
////////////////////////////////////
//include ADDAC class
#include <ADDAC.h>
//... | code_fim | medium | {
"lang": "cpp",
"repo": "MacroMachines/ADDAC-Library",
"path": "/examples/TUTORIAL_00_01_02_BASICS/Part_1_startVCC/startVCC_blank/startVCC_blank.ino",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> //update VCC
VCC.update();
}<|fim_prefix|>// repo: MacroMachines/ADDAC-Library path: /examples/TUTORIAL_00_01_02_BASICS/Part_1_startVCC/startVCC_blank/startVCC_blank.ino
//INCLUDE STANDARDCPLUSPLUS LIBRARY//
#include <StandardCplusplus.h>
#include <vector>
///////////////////////////////////... | code_fim | medium | {
"lang": "cpp",
"repo": "MacroMachines/ADDAC-Library",
"path": "/examples/TUTORIAL_00_01_02_BASICS/Part_1_startVCC/startVCC_blank/startVCC_blank.ino",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if(s1 >= s2)
res= res +s1;
else{
res=res + (s2 - s1);
i++;
}
}
else
res =res +s1;
}
return res;
}
};<|fim_prefix|>// repo: muskanj895/Leetcode... | code_fim | hard | {
"lang": "cpp",
"repo": "muskanj895/Leetcode-solution.cpp",
"path": "/Array/Roman to integer .cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: muskanj895/Leetcode-solution.cpp path: /Array/Roman to integer .cpp
class Solution {
public:
int value(char r)
{
if(r=='I')
return 1;
if(r == 'V')
return 5;
if(r == 'X')
return 10;
if(r == 'L')
return 50;
... | code_fim | hard | {
"lang": "cpp",
"repo": "muskanj895/Leetcode-solution.cpp",
"path": "/Array/Roman to integer .cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if(result == -1)
{
CDC_Transmit_FS((uint8_t *)"\a", 1);
}
else if(result == 0)
{
CDC_Transmit_FS((uint8_t *)"\r", 1);
}
}
else
{
slcan_str[slcan_str_index+... | code_fim | hard | {
"lang": "cpp",
"repo": "takeyabuyaketa/usbcan",
"path": "/Src/usbd_cdc_if.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
public:
DFileMessageParser() = default;
static void parse(BufferPointer buffer, SimpleDFileMessageHandlerPointer handler);
static void parse(SimpleBufferPointer buffer, SimpleDFileMessageHandlerPointer handler);
static void parse(const void* buffer, int size, SimpleDFileMessageHandlerPoi... | code_fim | medium | {
"lang": "cpp",
"repo": "e-al/cranesps",
"path": "/daemon/src/message/DFileMessageParser.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: e-al/cranesps path: /daemon/src/message/DFileMessageParser.h
//
// Created by e-al on 29.08.15.
//
#ifndef DGREP_MESSAGEPARSER_H
#define DGREP_MESSAGEPARSER_H
<|fim_suffix|>class DFileMessageParser
{
public:
DFileMessageParser() = default;
static void parse(BufferPointer buffer, Simple... | code_fim | medium | {
"lang": "cpp",
"repo": "e-al/cranesps",
"path": "/daemon/src/message/DFileMessageParser.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: phamthai12316/T1904A1 path: /Tongsole.cpp
#include <stdio.h>
int main()
<|fim_suffix|> for(int a=1; a<=100;a=a+2)
{
s=s+a;
} printf("Tong so le den so 100 la: %d \n",s);
return 0;
}<|fim_middle|>{
int s;
| code_fim | easy | {
"lang": "cpp",
"repo": "phamthai12316/T1904A1",
"path": "/Tongsole.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> } printf("Tong so le den so 100 la: %d \n",s);
return 0;
}<|fim_prefix|>// repo: phamthai12316/T1904A1 path: /Tongsole.cpp
#include <stdio.h>
int main()
<|fim_middle|>{
int s;
for(int a=1; a<=100;a=a+2)
{
s=s+a;
| code_fim | easy | {
"lang": "cpp",
"repo": "phamthai12316/T1904A1",
"path": "/Tongsole.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>void FloatToHalfConverter::InitializePrecomputeTables(void*)
{
for (int i = 0; i < 256; i++)
{
int e = i - 127;
if (e < -24)
{
// Too small to represent becomes zero
m_ExponentTable[i] = 0x0000;
m_MantissaShift[i] = 24;
}
... | code_fim | medium | {
"lang": "cpp",
"repo": "nefeithu/recastnavigation",
"path": "/Math/Source/FloatConversion.cpp",
"mode": "spm",
"license": "Zlib",
"source": "the-stack-v2"
} |
<|fim_suffix|> const FString& TargetFilename = TEXT("/Engine/BasicShapes/Cube.Cube");
const float TargetScale = 0.3f;
Target = UxtTestUtils::CreateNearPointerGrabTarget(World, Center, TargetFilename, TargetScale);
// Enable focus lock when the target is grabbed
Target->bUseFocusLock = true;
... | code_fim | hard | {
"lang": "cpp",
"repo": "microsoft/MixedReality-UXTools-Unreal",
"path": "/UXToolsGame/Source/UXToolsTests/Tests/GrabTargetComponentFocusLock.spec.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: GBhutra/Generic-IOT-Framework path: /source/smartDevice/common/utility.h
/***********************************************************************/
/* Project : CSCE 622 Co-Design
/* Component : generic
/* File : utility.h
/* Description : Defines some common terminology across the pro... | code_fim | hard | {
"lang": "cpp",
"repo": "GBhutra/Generic-IOT-Framework",
"path": "/source/smartDevice/common/utility.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>/**/
#define IOT_MAX_MSG_SIZE 1024
#define MAX_THREADS_THNGSMGR 10
#define DEVICE_SERVER_IP_ADDRESS "192.168.168.137"
#define DEVICE_SERVER_PORT_NO 54325
//#define DEV_SERVER_ACK_WORD_LENGTH 3
#define DEV_SERVER_ACK_WORD "ACK"
#define MAX_UPLINK_QUEUE_SIZE 5
#define EXTRACT_MSG(message... | code_fim | hard | {
"lang": "cpp",
"repo": "GBhutra/Generic-IOT-Framework",
"path": "/source/smartDevice/common/utility.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
#define IOT_MAX_MSG_SIZE 1024
#define MAX_THREADS_THNGSMGR 10
#define DEVICE_SERVER_IP_ADDRESS "192.168.168.137"
#define DEVICE_SERVER_PORT_NO 54325
//#define DEV_SERVER_ACK_WORD_LENGTH 3
#define DEV_SERVER_ACK_WORD "ACK"
#define MAX_UPLINK_QUEUE_SIZE 5
#define EXTRACT_MSG(message,ip,port... | code_fim | hard | {
"lang": "cpp",
"repo": "GBhutra/Generic-IOT-Framework",
"path": "/source/smartDevice/common/utility.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: ta-verma/OS path: /Priority.cpp
#include<iostream>
using namespace std;
struct Priority
{
char PId[20];
int bt;
int pt;
int ta;
int wt;
static int ct;
friend istream & operator>>(istream & in,Priority &ob);
friend ostream & operator<<(ostream & out,Priority &ob);
void calc_ct()
{
... | code_fim | hard | {
"lang": "cpp",
"repo": "ta-verma/OS",
"path": "/Priority.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> int avgwt=0;
cout<<"Enter number process:";cin>>n;
Priority*ob=new Priority[n];
for(int i=0;i<n;i++)
{
cin>>ob[i];
}
for(int i=0;i<n;i++)
{
for(int j=i;j<n;j++)
{
if(ob[i].pt<ob[j].pt)
{
Myswap(ob[i],ob[j]);
}
if(ob[i].pt==ob[j].pt&&ob[i].bt>ob[j].bt)
... | code_fim | hard | {
"lang": "cpp",
"repo": "ta-verma/OS",
"path": "/Priority.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> x = m_my_rand.Rannyu(xmin, xmax);
sum += f->Eval(x);
}
return (xmax-xmin)*sum/punti;
};
double integralMC :: integralAVE_par(double xmin, double xmax, FunzioneBase* f, int punti) {
double x, y;
double sum = 0;
for (int i=0; i<punti; i++) {
y = m_my_rand.Rannyu();
x = 1 -... | code_fim | medium | {
"lang": "cpp",
"repo": "edozavatti/LSN_Exercises_EdoardoZavatti",
"path": "/Consegnare_8/Esercizio_8.2/integralMC.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: edozavatti/LSN_Exercises_EdoardoZavatti path: /Consegnare_8/Esercizio_8.2/integralMC.cpp
#include "integralMC.h"
#include "random.h"
#include <iostream>
double integralMC :: integralAVE(double xmin, double xmax, FunzioneBase* f, int punti) {
double x;
double sum = 0;
<|fim_suffix|> ... | code_fim | medium | {
"lang": "cpp",
"repo": "edozavatti/LSN_Exercises_EdoardoZavatti",
"path": "/Consegnare_8/Esercizio_8.2/integralMC.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return (xmax-xmin)*sum/punti;
};
double integralMC :: integralAVE_par(double xmin, double xmax, FunzioneBase* f, int punti) {
double x, y;
double sum = 0;
for (int i=0; i<punti; i++) {
y = m_my_rand.Rannyu();
x = 1 - sqrt(1-y);
sum += f->Eval(x);
}
return (xmax-xmin)*s... | code_fim | hard | {
"lang": "cpp",
"repo": "edozavatti/LSN_Exercises_EdoardoZavatti",
"path": "/Consegnare_8/Esercizio_8.2/integralMC.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: ivatet/flex-bison-calc path: /calc.cpp
#include <iostream>
#include <string>
#include <map>
typedef std::map<std::string, int> var_map;
static var_map calc_var_map;
<|fim_suffix|>{
var_map::iterator it = calc_var_map.find(s);
if (it != calc_var_map.end()) {
*val = it->second;
return 0;
... | code_fim | hard | {
"lang": "cpp",
"repo": "ivatet/flex-bison-calc",
"path": "/calc.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
std::cout << s << std::endl;
}
#ifdef __cplusplus
}
#endif
int main(int argc, char *argv[])
{
yyparse();
return 0;
}<|fim_prefix|>// repo: ivatet/flex-bison-calc path: /calc.cpp
#include <iostream>
#include <string>
#include <map>
typedef std::map<std::string, int> var_map;
static var_map calc_va... | code_fim | hard | {
"lang": "cpp",
"repo": "ivatet/flex-bison-calc",
"path": "/calc.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: JokerGreed/PATBasic-Level path: /1021C++.cpp
#include <iostream>
using namespace std;
/*
1021 ��λ��ͳ��
������ģ�
��1��N����Ϊ1000��������int
��2�����ͳ��0-9���ֵĸ���
*/
int main(){
<|fim_suffix|> int len=N.length();
for(int i=0;i<len;i++)
d[N[i]-'0']++;
for(int i=0;i<10;i++){
if(d[i]!=0)
... | code_fim | easy | {
"lang": "cpp",
"repo": "JokerGreed/PATBasic-Level",
"path": "/1021C++.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> for(int i=0;i<len;i++)
d[N[i]-'0']++;
for(int i=0;i<10;i++){
if(d[i]!=0)
cout<<i<<":"<<d[i]<<endl;
}
return 0;
}<|fim_prefix|>// repo: JokerGreed/PATBasic-Level path: /1021C++.cpp
#include <iostream>
using namespace std;
/*
1021 ��λ��ͳ��
������ģ�
��1��N����Ϊ1000��������int
��2�����ͳ��0-9���ֵ... | code_fim | easy | {
"lang": "cpp",
"repo": "JokerGreed/PATBasic-Level",
"path": "/1021C++.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: brunobuzzi/libssh-svn path: /binding/libsshpp/options.hpp
/*
* options.hpp
*
* Created on: 21 juin 2009
* Author: aris
*/
#ifndef OPTIONS_HPP_
#define OPTIONS_HPP_
#include "session.hpp"
namespace ssh {
<|fim_suffix|>public:
Options();
~Options();
void setWantedAlgos(int algo, st... | code_fim | medium | {
"lang": "cpp",
"repo": "brunobuzzi/libssh-svn",
"path": "/binding/libsshpp/options.hpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> void setLogVerbosity(int verbosity);
void setDsaServerKey(std::string key);
void setRsaServerKey(std::string key);
};
}
#endif /* OPTIONS_HPP_ */<|fim_prefix|>// repo: brunobuzzi/libssh-svn path: /binding/libsshpp/options.hpp
/*
* options.hpp
*
* Created on: 21 juin 2009
* Author: aris
*/... | code_fim | medium | {
"lang": "cpp",
"repo": "brunobuzzi/libssh-svn",
"path": "/binding/libsshpp/options.hpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> void allowSsh1(bool allow);
void allowSsh2(bool allow);
void setLogVerbosity(int verbosity);
void setDsaServerKey(std::string key);
void setRsaServerKey(std::string key);
};
}
#endif /* OPTIONS_HPP_ */<|fim_prefix|>// repo: brunobuzzi/libssh-svn path: /binding/libsshpp/options.hpp
/*
* options.hp... | code_fim | hard | {
"lang": "cpp",
"repo": "brunobuzzi/libssh-svn",
"path": "/binding/libsshpp/options.hpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: peauc/RType path: /EnemyExample/inc/Mojojo.hpp
//
// Created by buis_p on 1/18/18.
//
#ifndef RTYPE_MOJOJO_HPP
# define RTYPE_MOJOJO_HPP
<|fim_suffix|>public:
Mojojo(Engine::Game &game);
Mojojo(const Mojojo &other) = default;
Mojojo &operator=(const Mojojo &other) = default;
~Mojojo() = de... | code_fim | medium | {
"lang": "cpp",
"repo": "peauc/RType",
"path": "/EnemyExample/inc/Mojojo.hpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>}
class Mojojo : public Engine::Entity {
public:
Mojojo(Engine::Game &game);
Mojojo(const Mojojo &other) = default;
Mojojo &operator=(const Mojojo &other) = default;
~Mojojo() = default;
};
#endif //RTYPE_Mojojo_HPP<|fim_prefix|>// repo: peauc/RType path: /EnemyExample/inc/Mojojo.hpp
//
// Created ... | code_fim | easy | {
"lang": "cpp",
"repo": "peauc/RType",
"path": "/EnemyExample/inc/Mojojo.hpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: peauc/RType path: /EnemyExample/inc/Mojojo.hpp
//
// Created by buis_p on 1/18/18.
//
<|fim_suffix|>#include "Entity.hpp"
namespace Engine {
class Game;
}
class Mojojo : public Engine::Entity {
public:
Mojojo(Engine::Game &game);
Mojojo(const Mojojo &other) = default;
Mojojo &operator=(co... | code_fim | easy | {
"lang": "cpp",
"repo": "peauc/RType",
"path": "/EnemyExample/inc/Mojojo.hpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>}
RPLInstanceListLink::~RPLInstanceListLink(){
}<|fim_prefix|>// repo: psu-powerlab/DERAS-Server path: /DERAS-Server/src/ieee_sep/RPLInstanceListLink.cpp
///////////////////////////////////////////////////////////
// RPLInstanceListLink.cpp
// Implementation of the Class RPLInstanceListLink
// Cre... | code_fim | medium | {
"lang": "cpp",
"repo": "psu-powerlab/DERAS-Server",
"path": "/DERAS-Server/src/ieee_sep/RPLInstanceListLink.cpp",
"mode": "spm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>
RPLInstanceListLink::~RPLInstanceListLink(){
}<|fim_prefix|>// repo: psu-powerlab/DERAS-Server path: /DERAS-Server/src/ieee_sep/RPLInstanceListLink.cpp
///////////////////////////////////////////////////////////
// RPLInstanceListLink.cpp
// Implementation of the Class RPLInstanceListLink
// Create... | code_fim | easy | {
"lang": "cpp",
"repo": "psu-powerlab/DERAS-Server",
"path": "/DERAS-Server/src/ieee_sep/RPLInstanceListLink.cpp",
"mode": "spm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: jkwok678/RailwayBuilderOld path: /track.cpp
#include "track.h"
#include "element.h"
<|fim_suffix|>};
StraightTrack :: StraightTrack(bool isElectrified, std :: string newElectrificationMethod)
{
electrified = isElectrified;
electrificationMethod = newElectrificationMethod;
};<|fim_midd... | code_fim | easy | {
"lang": "cpp",
"repo": "jkwok678/RailwayBuilderOld",
"path": "/track.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
StraightTrack :: StraightTrack(bool isElectrified, std :: string newElectrificationMethod)
{
electrified = isElectrified;
electrificationMethod = newElectrificationMethod;
};<|fim_prefix|>// repo: jkwok678/RailwayBuilderOld path: /track.cpp
#include "track.h"
#include "element.h"
<|fim_middle|>... | code_fim | easy | {
"lang": "cpp",
"repo": "jkwok678/RailwayBuilderOld",
"path": "/track.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (nx <= 0 || nx > n || ny <= 0 || ny > m || nz <= 0 || nz > h) continue;
if (map1[nx][ny][nz] == '0') {
tomato++;
map1[nx][ny][nz] = '1';
q.push({ nx,ny, nz });
}
}
}
}
if (totalnum != tomato) {
cout << "-1\n";
return 0;
}
cout << cnt << '\n';
return 0;
}<|fim_... | code_fim | hard | {
"lang": "cpp",
"repo": "jh280722/online-judge",
"path": "/solve/srf/BFS/7569 토마토.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: jh280722/online-judge path: /solve/srf/BFS/7569 토마토.cpp
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct DATA {
char x, y;
char z;
};
const int MAX = 101;
const int INF = 2147400000;
char map1[MAX][MAX][MAX];
int dr[] = { -1, 0, 1, 0, 0, 0 };
int dc[] = { 0, 1, 0, -... | code_fim | hard | {
"lang": "cpp",
"repo": "jh280722/online-judge",
"path": "/solve/srf/BFS/7569 토마토.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>tERROR StartUpEnum2::LoadSubCureLibrary() //KLSubCure.dll
{
DWORD dAttr = -1;
tERROR error=errOK;
cStrObj strSubCureLibName("%Bases%\\KLSubCure.dll");
//INT3;
if( errOK_DECIDED == sysSendMsg(pmc_PRODUCT_ENVIRONMENT, pm_EXPAND_ENVIRONMENT_STRING, (hOBJECT)cAutoString (strSubCureLibName), 0, 0) )
... | code_fim | hard | {
"lang": "cpp",
"repo": "seth1002/antivirus-1",
"path": "/AV/StartUpEnum2/startupenum2.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (INVALID_HANDLE_VALUE == m_hDevice)
{
OLD_ClientUnregister( m_hDevice );
CloseHandle( m_hWhistleup );
CloseHandle( m_hWFChanged );
CloseHandle( m_hDevice );
m_hDevice = INVALID_HANDLE_VALUE;
}
if (m_hShellLib)
{
pfCoUninitialize();
FreeLibrary(m_hShellLib);
m_hShellLi... | code_fim | hard | {
"lang": "cpp",
"repo": "seth1002/antivirus-1",
"path": "/AV/StartUpEnum2/startupenum2.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: seth1002/antivirus-1 path: /AV/StartUpEnum2/startupenum2.cpp
OBJECT p_pRetObject, tSTRING p_DetectedVirusName )
{
tERROR error = errOK;
PR_TRACE_FUNC_FRAME( "StartUpEnum2::CleanUp method" );
PR_TRACE((this,prtNOTIFY,"startupenum2\t<CleanUp> started"));
cAutoNativeCS _lock(&m_sCleanu... | code_fim | hard | {
"lang": "cpp",
"repo": "seth1002/antivirus-1",
"path": "/AV/StartUpEnum2/startupenum2.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> static void searchHelper(string s, int level, string currentIp, vector<string> &result){
if(s.size() > 3 && level == 3){
return;
}
if(s.size() > 0 && level > 3){
return;
}
if(s.size() == 0 && level < 3){
return;
}
if(s.size() == 0 && level > 3){
result.push_back(currentIp.subst... | code_fim | medium | {
"lang": "cpp",
"repo": "mertonmeng/leetcode",
"path": "/Search & BackTrack Related/RestoreIPAddresses.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> ss << str;
ss >> val;
if(val > 255){
return;
}
if(to_string(val).size() < str.size()){
continue;
}
temp = currentIp + str + ".";
searchHelper(s.substr(i), level + 1, temp, result);
}
}
};<|fim_prefix|>// repo: mertonmeng/leetcode path: /Search & BackTrack Related/Rest... | code_fim | hard | {
"lang": "cpp",
"repo": "mertonmeng/leetcode",
"path": "/Search & BackTrack Related/RestoreIPAddresses.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: mertonmeng/leetcode path: /Search & BackTrack Related/RestoreIPAddresses.cpp
#include "stdafx.h"
#include <vector>
#include <string>
#include <sstream>
using namespace std;
class RestoreIPAddresses {
public:
static vector<string> restoreIpAddresses(string s) {
int level = 0;
string curr... | code_fim | hard | {
"lang": "cpp",
"repo": "mertonmeng/leetcode",
"path": "/Search & BackTrack Related/RestoreIPAddresses.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
public:
View(std::shared_ptr<ViewModel> model);
private:
std::shared_ptr<ViewModel> _modelPtr;
};
}
#endif //EPIPHANY_VIEW_HPP<|fim_prefix|>// repo: melnikos/navilation path: /gui/include/view.hpp
//
// Created by sigi on 04.08.19.
//
#ifndef EPIPHANY_VIEW_HPP
#define EPIPH... | code_fim | easy | {
"lang": "cpp",
"repo": "melnikos/navilation",
"path": "/gui/include/view.hpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> class View {
public:
View(std::shared_ptr<ViewModel> model);
private:
std::shared_ptr<ViewModel> _modelPtr;
};
}
#endif //EPIPHANY_VIEW_HPP<|fim_prefix|>// repo: melnikos/navilation path: /gui/include/view.hpp
//
// Created by sigi on 04.08.19.
//
#ifndef EPIPHANY_VIEW_... | code_fim | easy | {
"lang": "cpp",
"repo": "melnikos/navilation",
"path": "/gui/include/view.hpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: melnikos/navilation path: /gui/include/view.hpp
//
// Created by sigi on 04.08.19.
//
#ifndef EPIPHANY_VIEW_HPP
#define EPIPHANY_VIEW_HPP
#include "view_model.hpp"
namespace epi{
<|fim_suffix|> public:
View(std::shared_ptr<ViewModel> model);
private:
std::shared_ptr<Vi... | code_fim | easy | {
"lang": "cpp",
"repo": "melnikos/navilation",
"path": "/gui/include/view.hpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>void Teacher::setExperiense(unsigned short experiense) {
this->experiense = experiense;
}
void Teacher::print() {
Person::print();
cout<<"|"<<getDiscipline()<<"|"<<getDiscipline()<<"|";
}<|fim_prefix|>// repo: RossitsaTasheva/reps path: /University/src/Teacher.cpp
/*
* Teacher.cpp
*
* Created on: ... | code_fim | hard | {
"lang": "cpp",
"repo": "RossitsaTasheva/reps",
"path": "/University/src/Teacher.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: RossitsaTasheva/reps path: /University/src/Teacher.cpp
/*
* Teacher.cpp
*
* Created on: 29.04.2017 г.
* Author: Rossi
*/
#include "Teacher.h"
Teacher::Teacher(string name, string egn, string discipline, short experiense):
Person(name,egn) {
setDiscipline(discipline);
setExperiense... | code_fim | medium | {
"lang": "cpp",
"repo": "RossitsaTasheva/reps",
"path": "/University/src/Teacher.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
long int t,a[3],i;
scanf("%li", &t);
while(t--)
{
for(i=0;i<3;++i)
scanf("%li", &a[i]);
sort(a,a+3);
printf("%li\n", a[1]);
}
return 0;
}<|fim_prefix|>// repo: richa18b/Competitive_Coding path: /CodeChef/Practice/FLOW017.cpp
#include<bits/stdc++.h>
using namespace std;
<|fim_middle|>int... | code_fim | easy | {
"lang": "cpp",
"repo": "richa18b/Competitive_Coding",
"path": "/CodeChef/Practice/FLOW017.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: richa18b/Competitive_Coding path: /CodeChef/Practice/FLOW017.cpp
#include<bits/stdc++.h>
using namespace std;
<|fim_suffix|>{
long int t,a[3],i;
scanf("%li", &t);
while(t--)
{
for(i=0;i<3;++i)
scanf("%li", &a[i]);
sort(a,a+3);
printf("%li\n", a[1]);
}
return 0;
}<|fim_middle|>int... | code_fim | easy | {
"lang": "cpp",
"repo": "richa18b/Competitive_Coding",
"path": "/CodeChef/Practice/FLOW017.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> type->SetBaseType(::app::Fuse::Animations::MasterProperty__float4__typeof());
type->__fp_OnComplete = (void(*)(::app::Fuse::Animations::MasterBase__float4*))DiscreteMasterProperty__float4__OnComplete;
type->SetInterfaces(
::app::Fuse::Animations::IMixerMaster__typeof(), offsetof(Discr... | code_fim | hard | {
"lang": "cpp",
"repo": "noircynical/soscon_demoproject",
"path": "/.build/iOS-Debug/src/app/Fuse.Animations.DiscreteMasterProperty-1.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: noircynical/soscon_demoproject path: /.build/iOS-Debug/src/app/Fuse.Animations.DiscreteMasterProperty-1.cpp
#include <app/Fuse.Animations.DiscreteMasterProperty__bool.h>
#include <app/Fuse.Animations.DiscreteMasterProperty__float.h>
#include <app/Fuse.Animations.DiscreteMasterProperty__float4.h>... | code_fim | hard | {
"lang": "cpp",
"repo": "noircynical/soscon_demoproject",
"path": "/.build/iOS-Debug/src/app/Fuse.Animations.DiscreteMasterProperty-1.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> type = (DiscreteMasterProperty__float4__uType*)::uAllocClassType(sizeof(DiscreteMasterProperty__float4__uType), "Fuse.Animations.DiscreteMasterProperty<float4>", false, 2, 0, 0);
type->SetBaseType(::app::Fuse::Animations::MasterProperty__float4__typeof());
type->__fp_OnComplete = (void(*)(::a... | code_fim | hard | {
"lang": "cpp",
"repo": "noircynical/soscon_demoproject",
"path": "/.build/iOS-Debug/src/app/Fuse.Animations.DiscreteMasterProperty-1.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Kolosso/Smash-n-Dash path: /Framework/levelmanager.cpp
#include "levelmanager.h"
#include "backbuffer.h"
#include "tile.h"
LevelManager::LevelManager()
: levelWidth(25)
, levelHeight(19)
, background('O')
, platform('W')
, scoretile('S')
{
}
LevelManager::~LevelManager()
{
// delete tile... | code_fim | hard | {
"lang": "cpp",
"repo": "Kolosso/Smash-n-Dash",
"path": "/Framework/levelmanager.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> for (int h = 0; h < levelHeight; h++)
{
for (int w = 0; w < levelWidth; w++)
{
mapFile >> (tileID);
if (tileID == background)
{
// Sprites from online tutorial. www.photonstorm.com/flash-game-dev-tips/flash-game-dev-tip-12-building-a-retro-platform-game-in-flixel-part-1
// Not free ... | code_fim | hard | {
"lang": "cpp",
"repo": "Kolosso/Smash-n-Dash",
"path": "/Framework/levelmanager.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> tile->SetPositionX((float) w * 32);
tile->SetPositionY((float) h * 32);
tile->Initialise(pTileSprite, 16, 16); // Height and Width taken as half lengths object width = 2*given width)
tiles.push_back(tile);
}
else if (tileID == platform)
{
Sprite* pTileSprite = m_pBackBuff... | code_fim | hard | {
"lang": "cpp",
"repo": "Kolosso/Smash-n-Dash",
"path": "/Framework/levelmanager.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> Vector3 newScale(scale);
node->set(newScale, newRot, newTrans);
}
delete[] name;
}
// Check if attrubutes on a camera is changes or if new then creates the camera
else if (type == MessageType::mCamera)
{
char* name;
float camMatrix[4][4];
mayaData.getNewCame... | code_fim | hard | {
"lang": "cpp",
"repo": "antc13/FinalProject",
"path": "/MayaWarfare/src/main.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: antc13/FinalProject path: /MayaWarfare/src/main.cpp
#include "main.h"
// Declare our game instance
main game;
main::main()
: _scene(NULL), _wireframe(false)
{
}
void main::initialize()
{
_scene = Scene::create();
Node* lightNode = Node::create("pointLightShape1");
... | code_fim | hard | {
"lang": "cpp",
"repo": "antc13/FinalProject",
"path": "/MayaWarfare/src/main.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> mayaData.getNewTransform(name, translations, scale, rotation);
Node* node = _scene->findNode(name);
if (node)
{
Quaternion newRot(rotation);
Vector3 newTrans(translations[0], translations[1], translations[2]);
Vector3 newScale(scale);
node->set(newScale, newRot, ne... | code_fim | hard | {
"lang": "cpp",
"repo": "antc13/FinalProject",
"path": "/MayaWarfare/src/main.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> prepare_input();
memcpy(output_reference, input_reference, size);
normalize_scalar(output_reference, size);
if (algorithm1[value] != nullptr) {
printf(" algorithm1"); fflush(stdout);
memcpy(input, input_reference, size);
algorithm1[value... | code_fim | hard | {
"lang": "cpp",
"repo": "WojciechMula/image-similarity",
"path": "/normalization/unittest.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: WojciechMula/image-similarity path: /normalization/unittest.cpp
#include <cstdint>
#include <cassert>
#include <cstdio>
#include "../ansi.cpp"
#include "scalar.c"
#include "sse-test.c"
class UnitTest {
static const size_t size = 32 * 32;
uint8_t input_reference[size];
uint8_t ou... | code_fim | hard | {
"lang": "cpp",
"repo": "WojciechMula/image-similarity",
"path": "/normalization/unittest.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> /* Private variables */
std::function<ReferenceUniquePtr(Payload)> m_acquire_reference_func;
std::function<void(ReferenceBase<Payload>*) > m_on_reference_created_func;
std::function<void(ReferenceBase<Payload>*) > m_on_reference_destroyed_func;
const Payload m_p... | code_fim | hard | {
"lang": "cpp",
"repo": "jafffy/VKGL",
"path": "/include/OpenGL/reference.h",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.