text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_suffix|>{
freopen("meal.in","r",stdin);
freopen("meal.out","w",stdout);
read(n); read(m);
for(int i=1;i<=n;++i)
for(int j=1;j<=m;++j)
read(F[i][j]);
dfs(1,0,0);
printf("%lld",ans%MOD);
return 0;
}<|fim_prefix|>// repo: zsq001/oi-code path: /csp-s2019.luogu/source/XJ-00103/meal/meal.cpp
#inc... | code_fim | hard | {
"lang": "cpp",
"repo": "zsq001/oi-code",
"path": "/csp-s2019.luogu/source/XJ-00103/meal/meal.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>bool check(int now){
for(int i=1;i<=m;++i)
{
if(vis[i]<=(now>>1)) continue;
return false;
}
return true;
}
void dfs(LL tmp,int cnt,int k){
if(cnt>=2){
if(check(cnt)) {
ans=(ans+tmp)%MOD;
}
}
for(int i=k+1;i<=n;++i)
{
if(!VIS[i])
{
VIS[i]=1;
for(int j=1;j<=m;... | code_fim | medium | {
"lang": "cpp",
"repo": "zsq001/oi-code",
"path": "/csp-s2019.luogu/source/XJ-00103/meal/meal.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: jomar2/AdventofCode path: /Day16/Day16b.cpp
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <sstream>
#include <set>
#include <map>
using namespace std;
enum inst
{
addr = 0,
addi,
mulr,
muli,
banr,
bani,
bor... | code_fim | hard | {
"lang": "cpp",
"repo": "jomar2/AdventofCode",
"path": "/Day16/Day16b.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if(Eqrr == AfterRegs[ValC])
{
if (confirmedFuncs.find(inst::eqrr) == confirmedFuncs.end())
{
tmpInstructions.push_back(inst::eqrr);
}
}
if (tmpInstructions.size() == 1)
{
//Verified instruction:
ConfirmedInstructions[instruction] = t... | code_fim | hard | {
"lang": "cpp",
"repo": "jomar2/AdventofCode",
"path": "/Day16/Day16b.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: vinaybranham/robotics_fetch_fun path: /catkin_ws/build/ecto_ros/src/wrap_std_msgs_Float32.cpp
/* DO NOT EDIT or check into source control
* Generated code for wrapping a ros message Pub/Sub in ecto
*
* package : std_msgs
* msg : Float32
*/
#include <ecto_ros/wrap_sub.hpp>
#include <ecto_ros... | code_fim | hard | {
"lang": "cpp",
"repo": "vinaybranham/robotics_fetch_fun",
"path": "/catkin_ws/build/ecto_ros/src/wrap_std_msgs_Float32.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>namespace ecto_std_msgs
{
struct Subscriber_Float32 : ecto_ros::Subscriber<std_msgs::Float32> {};
struct Publisher_Float32 : ecto_ros::Publisher<std_msgs::Float32> {};
struct Bagger_Float32 : ecto_ros::Bagger<std_msgs::Float32> {};
}
ECTO_CELL(ecto_std_msgs, ecto_std_msgs::Subscriber_Float32,... | code_fim | medium | {
"lang": "cpp",
"repo": "vinaybranham/robotics_fetch_fun",
"path": "/catkin_ws/build/ecto_ros/src/wrap_std_msgs_Float32.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: SwenenzY/win-system32-dlls path: /tdh.dll/tdh.dll.cpp
#include <windows.h>
#include <shlwapi.h>
extern "C" {
extern void *ptr_DllCanUnloadNow;
void *ptr_DllCanUnloadNow = NULL;
extern void *ptr_DllGetClassObject;
void *ptr_DllGetClassObject = NULL;
extern void *ptr_TdhEnumerateProviderFieldInf... | code_fim | hard | {
"lang": "cpp",
"repo": "SwenenzY/win-system32-dlls",
"path": "/tdh.dll/tdh.dll.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>extern void *ptr_TdhQueryRemoteWBEMProviderFieldInformation;
void *ptr_TdhQueryRemoteWBEMProviderFieldInformation = NULL;
extern void *ptr_TdhUnloadManifest;
void *ptr_TdhUnloadManifest = NULL;
}
static HMODULE hModule = NULL;
static void module_init()
{
if (hModule) return;
wchar_t sz_mod... | code_fim | hard | {
"lang": "cpp",
"repo": "SwenenzY/win-system32-dlls",
"path": "/tdh.dll/tdh.dll.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> #define __vartype(x) decltype(x)
ptr_DllCanUnloadNow = (__vartype(ptr_DllCanUnloadNow))GetProcAddress(hModule, "DllCanUnloadNow");
ptr_DllGetClassObject = (__vartype(ptr_DllGetClassObject))GetProcAddress(hModule, "DllGetClassObject");
ptr_TdhEnumerateProviderFieldInformation = (__vartype(ptr_... | code_fim | hard | {
"lang": "cpp",
"repo": "SwenenzY/win-system32-dlls",
"path": "/tdh.dll/tdh.dll.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> }
return false;
}
void check(const vector<Match_result>&results,const string& a_team,const string&b_team) {
assert(can_team_a_beat_team_b_dfs(results, a_team, b_team) ==
can_team_a_beat_team_b_bfs(results, a_team, b_team));
}
void main() {
vector<Match_result> matches = { { "Texas", "Cal" },{ "Cal... | code_fim | hard | {
"lang": "cpp",
"repo": "Symas1/Algorithmic-Problems",
"path": "/Chapter 19 Graphs/can_team_A_beat_team_B.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> assert(can_team_a_beat_team_b_dfs(results, a_team, b_team) ==
can_team_a_beat_team_b_bfs(results, a_team, b_team));
}
void main() {
vector<Match_result> matches = { { "Texas", "Cal" },{ "Cal", "Stanford" },
{ "Stanford", "Texas" },{ "Stanford", "MIT" },
{ "Stanford", "CIT" },{ "UCLA", "USC" } };
a... | code_fim | hard | {
"lang": "cpp",
"repo": "Symas1/Algorithmic-Problems",
"path": "/Chapter 19 Graphs/can_team_A_beat_team_B.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Symas1/Algorithmic-Problems path: /Chapter 19 Graphs/can_team_A_beat_team_B.cpp
// given teams A and B, is there a sequence of teams starting with A and ending with B such that each
// team in the sequence has beaten the next team in the sequence
#include <string>
#include <assert.h>
#include <u... | code_fim | hard | {
"lang": "cpp",
"repo": "Symas1/Algorithmic-Problems",
"path": "/Chapter 19 Graphs/can_team_A_beat_team_B.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> array = new_array;
}
}
template <class queue_type>
Queue<queue_type>::Queue( Queue& original_copy )
{
// Allocate memory for copy
if ( original_copy.Size() == 0 )
{
allocation_size = 0;
}
else
{
array = RakNet::OP_NEW_ARRAY<queue_type >( original_copy.Size() + 1 , _FILE_AND... | code_fim | hard | {
"lang": "cpp",
"repo": "MTASZTAKI/ApertusVR",
"path": "/core/sceneManager/network/3rdParty/raknet/Source/DS_Queue.h",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> unsigned writeIndex, readIndex, trueWriteIndex, trueReadIndex;
writeIndex=Size()-1;
readIndex=writeIndex-1;
while (readIndex >= index)
{
if ( head + writeIndex >= allocation_size )
trueWriteIndex = head + writeIndex - allocation_size;
else
trueWriteIndex = head + writeIndex;
if... | code_fim | hard | {
"lang": "cpp",
"repo": "MTASZTAKI/ApertusVR",
"path": "/core/sceneManager/network/3rdParty/raknet/Source/DS_Queue.h",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>}
double SubNegatives::nSubtraction( std::shared_ptr<Particle> particle ){
if( particle->GetStat() != -1 ){
return 1.0;
}else{
return -1.0;
}
}<|fim_prefix|>// repo: yasukitachibana/AAPaperJetAnalysis path: /src/SubNegatives.cc
#include "SubNegatives.h"
#include "Se... | code_fim | hard | {
"lang": "cpp",
"repo": "yasukitachibana/AAPaperJetAnalysis",
"path": "/src/SubNegatives.cc",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> }
return jets_out;
}
double SubNegatives::ptSubtraction( std::shared_ptr<Particle> particle ){
if( particle->GetStat() != -1 ){
return particle->perp();
}else{
return -1.0 * particle->perp();
}
}
double SubNegatives::nSubtraction( std::shared_ptr<Particle> ... | code_fim | hard | {
"lang": "cpp",
"repo": "yasukitachibana/AAPaperJetAnalysis",
"path": "/src/SubNegatives.cc",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: yasukitachibana/AAPaperJetAnalysis path: /src/SubNegatives.cc
#include "SubNegatives.h"
#include "SetXML.h"
#include "SetFile.h"
SubNegatives::SubNegatives(){
std::cout << "-@-Creating SubNegatives"<<std::endl;
}
SubNegatives::~SubNegatives(){
std::cout << "-$-Deleting SubNegatives"<<... | code_fim | medium | {
"lang": "cpp",
"repo": "yasukitachibana/AAPaperJetAnalysis",
"path": "/src/SubNegatives.cc",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: fengjixuchui/rdpfuzz path: /rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp
e following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materi... | code_fim | hard | {
"lang": "cpp",
"repo": "fengjixuchui/rdpfuzz",
"path": "/rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> uint64 ms_elapsed = dr_get_milliseconds() - ms_start;
NOTIFY((ms_elapsed > 10U) ? 1U : 2U,
"Symbol queries for %s took " UINT64_FORMAT_STRING "ms\n", mod_name,
ms_elapsed);
}
static void
instru_funcs_module_unload(void *drcontext, const module_data_t *mod)
{
if (drcontex... | code_fim | hard | {
"lang": "cpp",
"repo": "fengjixuchui/rdpfuzz",
"path": "/rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>static std::vector<std::string>
split_by(std::string s, std::string sep)
{
size_t pos;
std::vector<std::string> vec;
do {
pos = s.find(sep);
vec.push_back(s.substr(0, pos));
s.erase(0, pos + sep.length());
} while (pos != std::string::npos);
return vec;
}
stati... | code_fim | hard | {
"lang": "cpp",
"repo": "fengjixuchui/rdpfuzz",
"path": "/rdpfuzz-dynamorio/clients/drcachesim/tracer/func_trace.cpp",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> try {
cout << "*** Darwin 10x10 ***" << endl;
srand(0);
Game x (10, 10, 100);
for (int i = 0; i < 10; ++i) {
for (int j = 0; j < 10; ++j) {
if (i == 5 && j == 5)
x.add_creature (best, N, i, j);
else
... | code_fim | hard | {
"lang": "cpp",
"repo": "cs371p-spring-2013/cs371p-darwin-tests",
"path": "/bjkoo91-RunDarwin.c++",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: cs371p-spring-2013/cs371p-darwin-tests path: /bjkoo91-RunDarwin.c++
.app > RunDarwin.out
To configure Doxygen:
doxygen -g
That creates the file Doxyfile.
Make the following edits:
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
GENERATE... | code_fim | hard | {
"lang": "cpp",
"repo": "cs371p-spring-2013/cs371p-darwin-tests",
"path": "/bjkoo91-RunDarwin.c++",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: cs371p-spring-2013/cs371p-darwin-tests path: /bjkoo91-RunDarwin.c++
*/
// ----------
// darwin 8x8
// ----------
try {
cout << "*** Darwin 8x8 ***" << endl;
srand(0);
/*
8x8 Darwin
Food, facing east, at (0, 0)
Hopper, facing... | code_fim | hard | {
"lang": "cpp",
"repo": "cs371p-spring-2013/cs371p-darwin-tests",
"path": "/bjkoo91-RunDarwin.c++",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Sandman444/COMP3501-Term-Project path: /Missile.h
#ifndef MISSILE_H
#define MISSILE_H
<|fim_suffix|> // Destructor
~Missile();
private:
SceneNode *rocketParticles;
};
} // namespace game
#endif<|fim_middle|>#include "Projectile.h"
namespace game {
class Missile : public Projectile ... | code_fim | medium | {
"lang": "cpp",
"repo": "Sandman444/COMP3501-Term-Project",
"path": "/Missile.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Sandman444/COMP3501-Term-Project path: /Missile.h
#ifndef MISSILE_H
#define MISSILE_H
#include "Projectile.h"
namespace game {
class Missile : public Projectile {
<|fim_suffix|> private:
SceneNode *rocketParticles;
};
} // namespace game
#endif<|fim_middle|>
public:
// Constructor
... | code_fim | medium | {
"lang": "cpp",
"repo": "Sandman444/COMP3501-Term-Project",
"path": "/Missile.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> private:
SceneNode *rocketParticles;
};
} // namespace game
#endif<|fim_prefix|>// repo: Sandman444/COMP3501-Term-Project path: /Missile.h
#ifndef MISSILE_H
#define MISSILE_H
#include "Projectile.h"
<|fim_middle|>namespace game {
class Missile : public Projectile {
public:
// Constructor
... | code_fim | medium | {
"lang": "cpp",
"repo": "Sandman444/COMP3501-Term-Project",
"path": "/Missile.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: GamoMan/HandyKaraoke path: /Midi/MidiFile.cpp
//
// Created by noob on 16/5/2560.
//
#include "MidiFile.h"
#include <iostream>
#include <fstream>
#include <cstring>
#include <algorithm>
MidiFile::MidiFile() {
clear();
}
MidiFile::~MidiFile() {
clear();
}
int MidiFile::bpm()
{
in... | code_fim | hard | {
"lang": "cpp",
"repo": "GamoMan/HandyKaraoke",
"path": "/Midi/MidiFile.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>MidiEvent* MidiFile::createMidiEvent(int track, uint32_t tick, uint32_t delta, MidiEventType evType, int ch, int data1, int data2) {
MidiEvent *e = new MidiEvent();
e->setTrack(track);
e->setTick(tick);
e->setDelta(delta);
e->setEventType(evType);
e->setChannel(ch);
e->setData1... | code_fim | hard | {
"lang": "cpp",
"repo": "GamoMan/HandyKaraoke",
"path": "/Midi/MidiFile.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> char d1 = in.get();
createMidiEvent(t, tick, delta, MidiEventType::ChannelAftertouch, ch, d1, 0);
break;
}
case 0xE0: {
int ch = status & 0x0F;
char d1 = in.get();
... | code_fim | hard | {
"lang": "cpp",
"repo": "GamoMan/HandyKaraoke",
"path": "/Midi/MidiFile.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: daxingyou/cocos2d-x-games path: /findDiff/Classes/HelloWorldScene.cpp
#include "HelloWorldScene.h"
#include "SoundCtl.h"
#include "GameScene.h"
USING_NS_CC;
using namespace cocostudio::timeline;
Scene* HelloWorld::createScene()
{
// 'scene' is an autorelease object
auto scene = Scene:... | code_fim | hard | {
"lang": "cpp",
"repo": "daxingyou/cocos2d-x-games",
"path": "/findDiff/Classes/HelloWorldScene.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> int bgH = bg->getContentSize().height;
Size visibleSize = Director::getInstance()->getVisibleSize();
float scaleX = visibleSize.width/bgW;
float scaleY = visibleSize.height/bgH;
bg->setScale(scaleX, scaleY);
playBtn->setPosition(Vec2(visibleSize.width/2,150));
bg->setScale(_dev... | code_fim | hard | {
"lang": "cpp",
"repo": "daxingyou/cocos2d-x-games",
"path": "/findDiff/Classes/HelloWorldScene.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> Cam.setfileName("camera1.txt");
PC1 = Cam.capture();
N.filter(PC1);
//Point *P = new Point[PC1.getPointNumber()];
list<Point> P, L;
list<Point>::iterator iter1, iter2;
P = PC1.getPoints();
cout << "Camera1 after radius outlier filter" << endl << endl;
for (iter1 = P.begin(); iter1 != P.end(); ite... | code_fim | medium | {
"lang": "cpp",
"repo": "ismaildemircann/Point-Cloud-Process",
"path": "/src/TestRadiusOutlierFilter.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: ismaildemircann/Point-Cloud-Process path: /src/TestRadiusOutlierFilter.cpp
/**
* TestRadiusOutlierFilter.cpp
* @brief Bu test fonkisyonu RadiusOutlierFilter Class�n� calistirir ve kontrol eder.
*/
#include "RadiusOutlierFilter.h"
#include "DepthCamera.h"
#include <iostream>
#include <string>... | code_fim | hard | {
"lang": "cpp",
"repo": "ismaildemircann/Point-Cloud-Process",
"path": "/src/TestRadiusOutlierFilter.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: jon-takagi/multithread-cache path: /cache/cache_client.cc
#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/version.hpp>
#include <boost/asio/connect.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ip/udp.hpp>
#include <boost/array.hpp>
#include <cs... | code_fim | hard | {
"lang": "cpp",
"repo": "jon-takagi/multithread-cache",
"path": "/cache/cache_client.cc",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> boost::system::error_code ec;
boost::beast::http::response_parser<http::dynamic_body> p;
p.eager(true);
p.put(boost::asio::buffer(response_as_string), ec);
return p.get();
/*
boost::array<char, 1> send_buf = {{ 0 }};
... | code_fim | hard | {
"lang": "cpp",
"repo": "jon-takagi/multithread-cache",
"path": "/cache/cache_client.cc",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> http::response<http::dynamic_body> send_tcp(http::request<http::string_body> req) {
try{
//mutex_.lock();
http::write(*tcp_stream_, req);
beast::flat_buffer buffer;
http::response<http::dynamic_body> res;
http::read(*tcp_stream_, buff... | code_fim | hard | {
"lang": "cpp",
"repo": "jon-takagi/multithread-cache",
"path": "/cache/cache_client.cc",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> ++val;
}
bool firstItem;
for (const auto &row : A) {
firstItem = true;
for (const auto &item : row) {
if (firstItem) {
firstItem = false;
} else {
printf(" ");
}
printf("%d", item);
}
... | code_fim | hard | {
"lang": "cpp",
"repo": "H-Shen/Collection_of_my_coding_practice",
"path": "/Luogu/P2615.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: H-Shen/Collection_of_my_coding_practice path: /Luogu/P2615.cpp
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
int main() {
int n;
scanf("%d", &n);
vector<vector<int> > A(n, vector<int>(n, -1));
int i = 0, j = (n - 1) / 2, val = ... | code_fim | hard | {
"lang": "cpp",
"repo": "H-Shen/Collection_of_my_coding_practice",
"path": "/Luogu/P2615.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> std::vector<cv::Mat> out_mats;
out_mats.push_back(mat_y);
out_mats.push_back(mat_cr);
out_mats.push_back(mat_cb);
// 3. merge
cv::merge(out_mats, super_resolution_content.mat);
if (super_resolution_content.mat.empty())
{
super_resolution_content.flag = false;
return;
}
cv::cvt... | code_fim | hard | {
"lang": "cpp",
"repo": "xinsuinizhuan/lite.ai",
"path": "/ort/cv/subpixel_cnn.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: thegamer1907/Code_Analysis path: /contest/1542594292.cpp
#include <bits/stdc++.h>
using namespace std;
<|fim_suffix|> int n; cin >> n;
bool flag = false;
bool flag1 = false, flag2 = false;
for (int i = 1; i <= n; i ++) {
cin >> str[i];
if (st... | code_fim | medium | {
"lang": "cpp",
"repo": "thegamer1907/Code_Analysis",
"path": "/contest/1542594292.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (flag || (flag1 && flag2)) puts("YES");
else puts("NO");
return 0;
}<|fim_prefix|>// repo: thegamer1907/Code_Analysis path: /contest/1542594292.cpp
#include <bits/stdc++.h>
using namespace std;
string str[105];
int main(int argc, char const *argv[]) {
s... | code_fim | hard | {
"lang": "cpp",
"repo": "thegamer1907/Code_Analysis",
"path": "/contest/1542594292.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: ysfkymz/my-c-codes path: /c_DERS/recursive/recursive 2 lik taban.cpp
#include<stdio.h>
#include<conio.h>
void iki(int sayi){
<|fim_suffix|> int sayi;
printf("onluk taban da bir sayi giriniz");
scanf("%d",&sayi);
iki(sayi);
getch();
return 0;
}<|... | code_fim | medium | {
"lang": "cpp",
"repo": "ysfkymz/my-c-codes",
"path": "/c_DERS/recursive/recursive 2 lik taban.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> printf("onluk taban da bir sayi giriniz");
scanf("%d",&sayi);
iki(sayi);
getch();
return 0;
}<|fim_prefix|>// repo: ysfkymz/my-c-codes path: /c_DERS/recursive/recursive 2 lik taban.cpp
#include<stdio.h>
#include<conio.h>
void iki(int sayi){
<|fim_middle|> if... | code_fim | medium | {
"lang": "cpp",
"repo": "ysfkymz/my-c-codes",
"path": "/c_DERS/recursive/recursive 2 lik taban.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: rajatgirotra/study path: /cpp/C++_11_14/try.cpp
#include <iostream>
using namespace std;
<|fim_suffix|>#if 1
void foo(int&)
{
cout << " foo(int&)" << endl;
}
#endif
#if 1
void foo(int&&)
{
cout << " foo(int&&)" << endl;
}
#endif
int main()
{
int a = 10;
const int& p = a;
f... | code_fim | medium | {
"lang": "cpp",
"repo": "rajatgirotra/study",
"path": "/cpp/C++_11_14/try.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
cout << " foo(int&&)" << endl;
}
#endif
int main()
{
int a = 10;
const int& p = a;
foo(a);
foo(10);
foo(p);
return 0;
}<|fim_prefix|>// repo: rajatgirotra/study path: /cpp/C++_11_14/try.cpp
#include <iostream>
using namespace std;
void foo(const int&)
{
cout << " foo(... | code_fim | easy | {
"lang": "cpp",
"repo": "rajatgirotra/study",
"path": "/cpp/C++_11_14/try.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
cout << " foo(const int&)" << endl;
}
#if 1
void foo(int&)
{
cout << " foo(int&)" << endl;
}
#endif
#if 1
void foo(int&&)
{
cout << " foo(int&&)" << endl;
}
#endif
int main()
{
int a = 10;
const int& p = a;
foo(a);
foo(10);
foo(p);
return 0;
}<|fim_prefix|>// repo... | code_fim | easy | {
"lang": "cpp",
"repo": "rajatgirotra/study",
"path": "/cpp/C++_11_14/try.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: karimimp/PUFoam path: /testCase/results/18/M2
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ /... | code_fim | hard | {
"lang": "cpp",
"repo": "karimimp/PUFoam",
"path": "/testCase/results/18/M2",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>8298601e-35
3.5463472e-28
1.0380687e-25
1.1948521e-24
3.5384903e-24
5.5501967e-24
6.4947873e-24
6.7263602e-24
6.6889791e-24
6.6276261e-24
6.6275838e-24
6.6888597e-24
6.7261876e-24
6.494606e-24
5.550061e-24
3.5384282e-24
1.1948434e-24
1.0380786e-25
3.5464162e-28
2.8756062e-35
1.2571345e-35
4.9024102e-29
1.... | code_fim | hard | {
"lang": "cpp",
"repo": "karimimp/PUFoam",
"path": "/testCase/results/18/M2",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: mokafolio/Luke path: /Luke/GLFW/GLFWDisplayImpl.cpp
#include <Luke/GLFW/GLFWDisplayImpl.hpp>
#include <Luke/GLFW/GLFWInitializer.hpp>
#include <GLFW/glfw3.h>
namespace luke
{
namespace detail
{
using namespace stick;
DisplayImpl::DisplayImpl() : m_glfwMonitor(NULL)
{
}
DisplayImpl::~DisplayI... | code_fim | hard | {
"lang": "cpp",
"repo": "mokafolio/Luke",
"path": "/Luke/GLFW/GLFWDisplayImpl.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> int count;
GLFWmonitor ** monitors = glfwGetMonitors(&count);
for (Size i = 0; i < count; ++i)
{
Display d;
d.m_pimpl->m_glfwMonitor = monitors[i];
ret.append(std::move(d));
}
return ret;
}
} // namespace detail
} // namespace luke<|fim_prefix|>// repo: mok... | code_fim | hard | {
"lang": "cpp",
"repo": "mokafolio/Luke",
"path": "/Luke/GLFW/GLFWDisplayImpl.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> // 6.7
for (int i = 0; i != 10; ++i){
cout << "Cnt: " << inc() << endl;
}
return 0;
}
unsigned int fact(unsigned int n){
unsigned int p = 1;
for (unsigned int i = 1; i <= n; ++i){
p *= i;
}
return p;
}
double abs(double x){
return x < 0 ? -x : x;
}
i... | code_fim | hard | {
"lang": "cpp",
"repo": "ms303956362/myexercise",
"path": "/Cpp/cppprimer/6/6_1.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: ms303956362/myexercise path: /Cpp/cppprimer/6/6_1.cpp
#include <iostream>
#include "Chapter6.h"
using std::cin;
using std::cout;
using std::endl;
int main(int argc, char const *argv[])
{
// 6.3
// cout << fact(5) << endl;
// cout << fact(1) << endl;
// cout << fact(0) << endl;... | code_fim | hard | {
"lang": "cpp",
"repo": "ms303956362/myexercise",
"path": "/Cpp/cppprimer/6/6_1.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
public:
// Constructs default game object.
GameObject();
// Calls tick on scene manager.
bool update(float dt);
private:
DynamicArray<Actor*> *actors;
float timeSinceStart;
};
#endif<|fim_prefix|>// repo: jgardella/CS585 path: /include/gameobject.hh
#ifndef _GAMEOBJECT_HH_
#define _GAMEO... | code_fim | medium | {
"lang": "cpp",
"repo": "jgardella/CS585",
"path": "/include/gameobject.hh",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: jgardella/CS585 path: /include/gameobject.hh
#ifndef _GAMEOBJECT_HH_
#define _GAMEOBJECT_HH_
<|fim_suffix|>{
public:
// Constructs default game object.
GameObject();
// Calls tick on scene manager.
bool update(float dt);
private:
DynamicArray<Actor*> *actors;
float timeSinceStart;... | code_fim | medium | {
"lang": "cpp",
"repo": "jgardella/CS585",
"path": "/include/gameobject.hh",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
TestHeapSort();
//TestBubbleSort();
//TestQuickSort();
//TestMergeSort();
return 0;
}<|fim_prefix|>// repo: YPT-victory/Sort path: /Sort/test.cpp
#include"Sort.h"
int main()
{
//TestInsertSo<|fim_middle|>rt();
//TestShellSort();
//TestSelectSort(); | code_fim | easy | {
"lang": "cpp",
"repo": "YPT-victory/Sort",
"path": "/Sort/test.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: YPT-victory/Sort path: /Sort/test.cpp
#include"Sort.h"
int main()
{
//TestInsertSo<|fim_suffix|>tQuickSort();
//TestMergeSort();
return 0;
}<|fim_middle|>rt();
//TestShellSort();
//TestSelectSort();
TestHeapSort();
//TestBubbleSort();
//Tes | code_fim | medium | {
"lang": "cpp",
"repo": "YPT-victory/Sort",
"path": "/Sort/test.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> else {
//cout<<"x:"<<xyz.at<Vec3f>(i, j)[0]<<" y:"<<xyz.at<Vec3f>(i, j)[1]<<" z:"<<xyz.at<Vec3f>(i, j)[2]<<endl;;
x = x + xyz.at<Vec3f>(i, j)[0];
y = y + xyz.at<Vec3f>(i, j)[1];
depth = depth + xyz.at<Vec3f>(i, j)[2];
... | code_fim | hard | {
"lang": "cpp",
"repo": "SpyderXu/stereo_detect",
"path": "/sgbmmatching.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: SpyderXu/stereo_detect path: /sgbmmatching.cpp
#include "sgbmmatching.h"
sgbmMatching::sgbmMatching()
{
}
Point3f sgbmMatching::cluster(vector<Point3f>& D3points){
if(D3points.size()==0){
return Point3f(0.0,0.0,0.0);
}
float tempX=0.0;
float tempY=0.0;
float tempZ=0.0;
Point3f... | code_fim | hard | {
"lang": "cpp",
"repo": "SpyderXu/stereo_detect",
"path": "/sgbmmatching.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> const double max_z = 7000;
Point3f returnXYZ;
double x = 0.0;
double y = 0.0;
double depth=0.0;
pos.x = pos.x < 0 ? 0 : pos.x;
pos.y = pos.y < 0 ? 0 : pos.y;
pos.width = pos.width+pos.x < 640 ? pos.width : 640-pos.x;
pos.height = pos.height+pos.y < 480 ? pos.height : 4... | code_fim | hard | {
"lang": "cpp",
"repo": "SpyderXu/stereo_detect",
"path": "/sgbmmatching.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: wjdwithyou/BOJ path: /14491/14491.cc
#include <iostream>
#include <cmath>
int main() {
<|fim_suffix|> scanf("%d", &t);
for (int i = 0; i < 5; ++i) {
d = static_cast<int>(pow(9, 4 - i));
buf[i] = t / d + '0';
t %= d;
}
printf("%d", atoi(b... | code_fim | easy | {
"lang": "cpp",
"repo": "wjdwithyou/BOJ",
"path": "/14491/14491.cc",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> buf[i] = t / d + '0';
t %= d;
}
printf("%d", atoi(buf));
return 0;
}<|fim_prefix|>// repo: wjdwithyou/BOJ path: /14491/14491.cc
#include <iostream>
#include <cmath>
int main() {
<|fim_middle|> char buf[8] = { 0, };
int t, d;
scanf("%d", &t);
for ... | code_fim | medium | {
"lang": "cpp",
"repo": "wjdwithyou/BOJ",
"path": "/14491/14491.cc",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: wjdwithyou/BOJ path: /14491/14491.cc
#include <iostream>
#include <cmath>
int main() {
char buf[8] = { 0, };
int t, d;
scanf("%d", &t);
for (int i = 0; i < 5; ++i) {
d = static_cast<int>(pow(9, 4 - i));
<|fim_suffix|> printf("%d", atoi(buf));
re... | code_fim | easy | {
"lang": "cpp",
"repo": "wjdwithyou/BOJ",
"path": "/14491/14491.cc",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>void printProgress(double percentage, string message);<|fim_prefix|>// repo: SIlvaMFPedro/audio_video_code path: /video-codec/lib/progress.hh
#include <stdio.h>
#include <string>
<|fim_middle|>#define PBSTR "============================================================"
#define PBWIDTH 60
using namespac... | code_fim | medium | {
"lang": "cpp",
"repo": "SIlvaMFPedro/audio_video_code",
"path": "/video-codec/lib/progress.hh",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: SIlvaMFPedro/audio_video_code path: /video-codec/lib/progress.hh
#include <stdio.h>
#include <string>
<|fim_suffix|>void printProgress(double percentage, string message);<|fim_middle|>#define PBSTR "============================================================"
#define PBWIDTH 60
using namespac... | code_fim | medium | {
"lang": "cpp",
"repo": "SIlvaMFPedro/audio_video_code",
"path": "/video-codec/lib/progress.hh",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> virtual void DrawIndexed(const Ref<VertexArray>& vertexArray, uint32_t indexCount = 0) = 0;
inline static API GetAPI() { return s_API; }
private:
static API s_API;
};
}<|fim_prefix|>// repo: alvaro55cuartero/ProEngine path: /ProEngine/src/ProEngine/Renderer/RendererAPI.h
#pragma once
#include "... | code_fim | hard | {
"lang": "cpp",
"repo": "alvaro55cuartero/ProEngine",
"path": "/ProEngine/src/ProEngine/Renderer/RendererAPI.h",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: alvaro55cuartero/ProEngine path: /ProEngine/src/ProEngine/Renderer/RendererAPI.h
#pragma once
#include "ProEngine/Math/Vec4.h"
#include "ProEngine/Renderer/VertexArray.h"
namespace Pro
{
struct RendererSpecification {
unsigned int blend = 1;
unsigned int scissor = 0;
unsigned int cullin... | code_fim | hard | {
"lang": "cpp",
"repo": "alvaro55cuartero/ProEngine",
"path": "/ProEngine/src/ProEngine/Renderer/RendererAPI.h",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: gurvinder123/LeetCode-Programs path: /LongestUnivaluePath.cpp
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int parCh... | code_fim | hard | {
"lang": "cpp",
"repo": "gurvinder123/LeetCode-Programs",
"path": "/LongestUnivaluePath.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if(!root){
return 0;
}
return max(max(longestUnivaluePath(root->left), longestUnivaluePath(root->right)),
parChild(root->left, root->val) + parChild(root->right, root->val));
}
};<|fim_prefix|>// repo: gurvinder123/LeetCode-Programs path: /Longes... | code_fim | hard | {
"lang": "cpp",
"repo": "gurvinder123/LeetCode-Programs",
"path": "/LongestUnivaluePath.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: TheSuraj007/Arduino-Works path: /Example/lcd3/lcd3.ino
//LCD text with incrementing number
//Include the library code
#include <LiquidCrystal.h>
//Start the time at 0
int time =0;
//Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(2,3,4,5,6,7);
void setup()
<|fim_s... | code_fim | medium | {
"lang": "cpp",
"repo": "TheSuraj007/Arduino-Works",
"path": "/Example/lcd3/lcd3.ino",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
//Set up the LCD's number of columns and rows:
lcd.begin(16,2);
// Print a message to the LCD.
lcd.print("Mr. Arduino Uno");
}
void loop()
{
//Move cursor to second line, first position
lcd.setCursor(0,1);
//Print Current Time
lcd.print(time);
//Wait 1 second
delay(1000);
//Increment the time
time++;
}<... | code_fim | medium | {
"lang": "cpp",
"repo": "TheSuraj007/Arduino-Works",
"path": "/Example/lcd3/lcd3.ino",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> cout << "d1 = " << d1 << " is a leap year? " << (d1.leapYear() ? "True" : "False") << endl;
cout << "d2 = " << d2 << " is a leap year? " << (d2.leapYear() ? "True" : "False") << endl;
cout << "d3 = " << d3 << " is a leap year? " << (d3.leapYear() ? "True" : "False") << endl;
cout << "1900 is not ac... | code_fim | hard | {
"lang": "cpp",
"repo": "QuantDevHacks/XLDate",
"path": "/Main01.cpp",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: rpoleski/triplelens path: /src/VBBinaryLensingLibrary.cpp
* Et[0];
u = tn * tn + u0 * u0;
mags[i] += FR * (u + 2) / sqrt(u * (u + 4));
mags[i] /= (1 + FR);
}
}
void VBBinaryLensing::BinSourceLightCurveXallarap(double *pr, double *ts, double *mags, double *y1s, double *y2s, dou... | code_fim | hard | {
"lang": "cpp",
"repo": "rpoleski/triplelens",
"path": "/src/VBBinaryLensingLibrary.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>new_jacobians3
Prov->last->dJ = dJ.re;
dJ2 = dJ.re * dJ.re;
za2 = J1c * J1c;
J3 = J3 * za2;
ob2 = (J2.re * J2.re + J2.im * J2.im) * (6 - 6 * dJ.re + dJ2);
J2 = J2 * J2 * za2 * J1c;... | code_fim | hard | {
"lang": "cpp",
"repo": "rpoleski/triplelens",
"path": "/src/VBBinaryLensingLibrary.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: rpoleski/triplelens path: /src/VBBinaryLensingLibrary.cpp
(good[i] > good[worst3]) {
worst3 = i;
}
}
}
// 但是这部分代码好像后面没用到啊?
if ((good[worst3] < dlmax) && ((good[worst1] < dlmax) || (good[worst2] > 1.e2 * good[worst3]))) {
bad = 0;
}
else {
if ((disim > 0) &&... | code_fim | hard | {
"lang": "cpp",
"repo": "rpoleski/triplelens",
"path": "/src/VBBinaryLensingLibrary.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> if (rnd == 0 || rnd == 3 || rnd == 5) new_x = x - 1;
if (rnd == 2 || rnd == 4 || rnd == 6) new_x = x + 1;
if (rnd == 0 || rnd == 1 || rnd == 2) new_y = y - 1;
if (rnd == 5 || rnd == 6 || rnd == 7) new_y = y + 1;
if (new_x >= 0 && new_y >= 0 && new_x < board_info.board_width && new_y < board_inf... | code_fim | hard | {
"lang": "cpp",
"repo": "SteveSmith16384/ChaosGroove",
"path": "/piece.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: SteveSmith16384/ChaosGroove path: /piece.cpp
stion.
if (wizard[game.current_wizard].x == board_info.selected_x && wizard[game.current_wizard].y == board_info.selected_y)
{
wizard[game.current_wizard].x = x;
wizard[game.current_wizard].y = y;
}
// Sound effect.
request_sound_effect(bo... | code_fim | hard | {
"lang": "cpp",
"repo": "SteveSmith16384/ChaosGroove",
"path": "/piece.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: SteveSmith16384/ChaosGroove path: /piece.cpp
// If we have just gone past the end gfx, then reset to the start.
if (board[x][y][PIECE].gfx >= end_frame)
{
board[x][y][PIECE].gfx = board[x][y][PIECE].start_gfx;
}
}
else
{
// Ping-Pong Animation
if (boar... | code_fim | hard | {
"lang": "cpp",
"repo": "SteveSmith16384/ChaosGroove",
"path": "/piece.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: kjoon010/IncubeTech-Contribs path: /IN3WebkitEngineDLL/Core/EPUB/EPubBook.cpp
* @param index : �ϸ�ũ �� �߰��� ������ (fixed layout ������ ��ȿ�� ���� ����)
* @see ParseBookmarkParam
*/
void CEPubBook::OnBookmarkAdded(CString param, int index /*= 0*/)
{
if(param.IsEmpty()) return;
//
IN3Book... | code_fim | hard | {
"lang": "cpp",
"repo": "kjoon010/IncubeTech-Contribs",
"path": "/IN3WebkitEngineDLL/Core/EPUB/EPubBook.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return bRes;
}
/**
* @brief annotation(���̶���Ʈ/��/�������) �� �����Ѵ�.
* @param pAnnotation : ������ annotaton ����
* @return ��Ŷ extension ���� annotation ������ ��û�� ��� = TRUE, ��= FALSE
*/
BOOL CEPubBook::ModifyAnnotation(IN3Annotation *pAnnotation)
{
if(pAnnotation == NULL) return FALSE;
... | code_fim | hard | {
"lang": "cpp",
"repo": "kjoon010/IncubeTech-Contribs",
"path": "/IN3WebkitEngineDLL/Core/EPUB/EPubBook.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: kjoon010/IncubeTech-Contribs path: /IN3WebkitEngineDLL/Core/EPUB/EPubBook.cpp
�Լ�
* @param color : ������� ����(����� ������ ������ ���� ������Ʈ �� �� �� ����)
* @param hasMemo : �� �߰��Ǿ� �ִ��� ����
* @return ��Ŷ extension ���� ������� �߰��� ��û�� ��� = TRUE, ��= FALSE
*/
BOOL CEPubBook::... | code_fim | hard | {
"lang": "cpp",
"repo": "kjoon010/IncubeTech-Contribs",
"path": "/IN3WebkitEngineDLL/Core/EPUB/EPubBook.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: tschabo/esc-tool-for-blheli path: /ceepromdefinitonfileparser.cpp
/****************************************************************************
** Copyright (c) 2012 Sebastian Schmitt
** All right reserved.
** Web: http://code.google.com/p/esc-tool-for-blheli/
**
** Permission is hereby granted,... | code_fim | hard | {
"lang": "cpp",
"repo": "tschabo/esc-tool-for-blheli",
"path": "/ceepromdefinitonfileparser.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>cleanup:
f.close();
return bRetVal;
}
void CEEpromDefinitonFileParser::extractChoices(QString qsChoices, QStringList &qslChoices, bool bDampedModeAvailable)
{
// percental
char tmpByte[3];
if(qsChoices.startsWith("%"))
{
for(int i = 0; i < 256; i++)
{
sprintf(tmpByte, "%02X", i)... | code_fim | hard | {
"lang": "cpp",
"repo": "tschabo/esc-tool-for-blheli",
"path": "/ceepromdefinitonfileparser.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return machineJson;
}
Machine Machine::machineFromJSON(const nlohmann::json &j)
{
std::vector<int> matrixInt = j["Matrix"];
Matrix matrix;
for (int i = 0; i < matrixInt.size(); ++i)
matrix.at(i) = (Slot)matrixInt.at(i);
return Machine(
matrix,
j["TotalBet"].get<int>(),
j["Win"].get<int>()... | code_fim | hard | {
"lang": "cpp",
"repo": "Valeryn4/CasinoMachine",
"path": "/Classes/Machine.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> return Machine(
matrix,
j["TotalBet"].get<int>(),
j["Win"].get<int>(),
(Status)j["Status"].get<int>()
);
}
Machine::Matrix Machine::getRandomMatrix()
{
Matrix matrix = {};
auto randSlot = []() -> std::tuple<Slot, Slot, Slot>
{
int count = int(Slot::COUNT);
int slot = rand() % count;
... | code_fim | hard | {
"lang": "cpp",
"repo": "Valeryn4/CasinoMachine",
"path": "/Classes/Machine.cpp",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: Valeryn4/CasinoMachine path: /Classes/Machine.cpp
#include "Machine.h"
#include <nlohmann/json.hpp>
#include <algorithm>
#include <iostream>
#include <sstream>
using Slot = Machine::Slot;
using Line = Machine::Line;
using Multi = Machine::Multi;
/*
����� ������ �� ���������� ����� �� ������... | code_fim | hard | {
"lang": "cpp",
"repo": "Valeryn4/CasinoMachine",
"path": "/Classes/Machine.cpp",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: whentze/drydock path: /src/error.rs
use core::fmt;
#[derive(Debug, PartialEq, Eq)]
pub enum BadBytes {
LengthMismatch {
wanted: usize,
got: usize,
},
VetFailed,
}
impl fmt::Display for BadBytes {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
writ... | code_fim | hard | {
"lang": "rust",
"repo": "whentze/drydock",
"path": "/src/error.rs",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> impl From<io::Error> for FromReadError {
fn from(inner: io::Error) -> Self {
Self::Io(inner)
}
}
impl From<BadBytes> for FromReadError {
fn from(inner: BadBytes) -> Self {
Self::BadBytes(inner)
}
}
}
#[cfg(feature = "std")]
pub use s... | code_fim | medium | {
"lang": "rust",
"repo": "whentze/drydock",
"path": "/src/error.rs",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> impl From<BadBytes> for FromReadError {
fn from(inner: BadBytes) -> Self {
Self::BadBytes(inner)
}
}
}
#[cfg(feature = "std")]
pub use std_stuff::*;<|fim_prefix|>// repo: whentze/drydock path: /src/error.rs
use core::fmt;
#[derive(Debug, PartialEq, Eq)]
pub enum BadBy... | code_fim | hard | {
"lang": "rust",
"repo": "whentze/drydock",
"path": "/src/error.rs",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> /// Adds pawn en-passant capture to list. From and to are the squares the moving pieces moves from and to, respectively
fn add_pawn_ep_capture(&mut self, from: Square, to: Square);
}<|fim_prefix|>// repo: Nereuxofficial/rust_move_gen path: /src/mv_list/mod.rs
use bb::BB;
use castle::Castle;
use squar... | code_fim | hard | {
"lang": "rust",
"repo": "Nereuxofficial/rust_move_gen",
"path": "/src/mv_list/mod.rs",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> /// Adds pawn non-captures to the list. Targets is a bitboard of valid to-squares. Shift is the distance the pawn moved to get to the target square, mod 64. For example, for a white piece moving forward one row this is '8'. For a black piece moving forward one row this is 56 (-8 % 64).
fn add_pawn_pus... | code_fim | medium | {
"lang": "rust",
"repo": "Nereuxofficial/rust_move_gen",
"path": "/src/mv_list/mod.rs",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: joelverhagen/adventofcode path: /2017/rust/day8/src/main.rs
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
use std::collections::HashMap;
#[derive(Debug)]
enum Operator {
LessThan,
LessThanOrEqual,
GreaterThan,
GreaterThanOrEqual,
Equal,
NotEqual,
}
#[... | code_fim | hard | {
"lang": "rust",
"repo": "joelverhagen/adventofcode",
"path": "/2017/rust/day8/src/main.rs",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> let condition_satisfied = match instruction.condition.operator {
Operator::LessThan => current < instruction.condition.value,
Operator::LessThanOrEqual => current <= instruction.condition.value,
Operator::GreaterThan => current > instructio... | code_fim | hard | {
"lang": "rust",
"repo": "joelverhagen/adventofcode",
"path": "/2017/rust/day8/src/main.rs",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: ziliang8658/CalaRender path: /src/RenderManager.rs
use std::fs::File;
use std::io::{self, BufReader, BufRead};
use std::path::Path;
mod Geometry;
use Geometry::Vec3f;
pub struct SceneManager {
pub models: Vec<Model>,
pub lights: Vec<Light>,
}
pub struct Model {
... | code_fim | hard | {
"lang": "rust",
"repo": "ziliang8658/CalaRender",
"path": "/src/RenderManager.rs",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>
fn parseLightInfo(reader: &mut BufReader<&File>, buf: &mut String, lights: &mut Vec<Light>) -> Model {
let mut light = Light {
lightType: "" as str,
radius: 0.0,
period: 0,
position: Vec3f::new(0.0, 0.0, 0.0),
Color: Vec3f::new(0.0, 0.0, 0.0),
};
... | code_fim | hard | {
"lang": "rust",
"repo": "ziliang8658/CalaRender",
"path": "/src/RenderManager.rs",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> leaky_box!(
ble_gatt_svc_def {
type_: BLE_GATT_SVC_TYPE_PRIMARY as u8,
uuid: ble_uuid16_declare!(GATT_HRS_UUID),
includes: ptr::null_mut(),
characteristics: leaky_box!(
ble_gatt_chr_def {
uuid: ble_uuid16_decla... | code_fim | hard | {
"lang": "rust",
"repo": "sdobz/hanging-plotter",
"path": "/esp32/esp32-bluetooth/src/gatt_svr.rs",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_prefix|>// repo: sdobz/hanging-plotter path: /esp32/esp32-bluetooth/src/gatt_svr.rs
use alloc::boxed::Box;
use core::ffi::c_void;
use core::mem::size_of;
use core::ptr;
use esp32_sys::*;
use crate::{cstr, debug, esp_assert};
use debug::print_svcs;
extern crate alloc;
const MANUF_NAME: &str = "Apache Mynewt ES... | code_fim | hard | {
"lang": "rust",
"repo": "sdobz/hanging-plotter",
"path": "/esp32/esp32-bluetooth/src/gatt_svr.rs",
"mode": "psm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|>pub unsafe extern "C" fn gatt_svr_register_cb(
ctxt: *mut ble_gatt_register_ctxt,
_arg: *mut ::core::ffi::c_void,
) {
let mut buf_arr: [i8; BLE_UUID_STR_LEN as usize] = [0; BLE_UUID_STR_LEN as usize];
let buf = buf_arr.as_mut_ptr();
match (*ctxt).op as u32 {
BLE_GATT_REGISTER_... | code_fim | hard | {
"lang": "rust",
"repo": "sdobz/hanging-plotter",
"path": "/esp32/esp32-bluetooth/src/gatt_svr.rs",
"mode": "spm",
"license": "unknown",
"source": "the-stack-v2"
} |
<|fim_suffix|> /// Return `true` if memo is `Text`.
pub fn is_text(&self) -> bool {
match *self {
Memo::Text(_) => true,
_ => false,
}
}
/// Return `true` if memo is `Hash`.
pub fn is_hash(&self) -> bool {
match *self {
Memo::Hash(_) => tru... | code_fim | hard | {
"lang": "rust",
"repo": "imerkle/shuttle-core",
"path": "/src/memo.rs",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> /// Create new text memo. `text` must be shorter than 28 bytes.
pub fn text<S: Into<String>>(text: S) -> Result<Memo> {
let text = text.into();
if text.len() > MAX_MEMO_TEXT_LEN {
Err(Error::InvalidMemoText)
} else {
Ok(Memo::Text(text))
}
... | code_fim | hard | {
"lang": "rust",
"repo": "imerkle/shuttle-core",
"path": "/src/memo.rs",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> let opcode = rom[0];
match opcode {
/* RLC r */
0x00...0x07 => unimplemented!("RLC r"),
/* RRC r */
0x08...0x0F => unimplemented!("RRC r"),
/* RL B */
0x10 => cmd!(alu::RotateRegisterLeft(r8!(B))),
/* RL C */
0x11 => cmd!(alu::RotateR... | code_fim | hard | {
"lang": "rust",
"repo": "maxjoehnk/emulato-rs",
"path": "/gameboy/src/cpu/instructions/mod.rs",
"mode": "spm",
"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.