blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 117 | path stringlengths 3 268 | src_encoding stringclasses 34
values | length_bytes int64 6 4.23M | score float64 2.52 5.19 | int_score int64 3 5 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | text stringlengths 13 4.23M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
c4099d9beb33789e19007e85e370b0f929eef871 | C++ | Lohit9/MasterYourAlgorithms | /General Questions/same_tree.cpp | UTF-8 | 513 | 3.125 | 3 | [] | no_license | //
// same_tree.cpp
//
//
// Created by Lohit on 2016-01-17.
//
//
#include <stdio.h>
/* Program to check if 2 binary trees are the same - need to have teh same data values and structure */
bool isSame(struct Node* tree1, struct Node* tree2){
if(tree1 == NULL && tree2 == NULL){
return true;
}
... | true |
9a461c67160f593421319c8145b624ee1511189e | C++ | atlas3141/Snake | /Main.cpp | UTF-8 | 4,632 | 2.71875 | 3 | [] | no_license | #include "SDL.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
#include "Sprite.h"
using namespace std;
class Segment {
private:
Sprite* sprite;
int age;
int x, y;
public:
Segment(int nx, int ny, SpriteGroup* group, SDL_Surface* screen, int board[50][50] ){
x = nx;
y = ny;
Uint32 red =... | true |
2d3dae6d3e8497484f2667f43f3cf1c1bbfb64a5 | C++ | mm4ever/feature_3daoi | /src/SSDK/Shape.hpp | UTF-8 | 1,514 | 2.921875 | 3 | [] | no_license | #ifndef SHAPE_HPP
#define SHAPE_HPP
#include <vector>
#include "Point.hpp"
namespace SSDK
{
/**
* @brief 表示形状的类,存有形状的坐标位置
*
* @author peter
* @version 1.00 2018-01-05 peter
* note:create it
*/
class Shape
{
public:
enum class ShapeType
... | true |
5683485b6618f33cdcdf471f54d729d69d61c8ff | C++ | xdlaba02/light-field-image-format | /liblfif/include/components/stack_allocator.h | UTF-8 | 1,025 | 3.3125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] | permissive | #pragma once
#include <cstdint>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <iostream>
class StackAllocator {
inline static uint8_t *m_base = nullptr;
inline static uint8_t *m_head = nullptr;
inline static uint8_t *m_end = nullptr;
inline static uint8_t *m_max_head = nullptr;
Sta... | true |
9985fb0fd176b16ab5bb91c7b8678bfcc7e034b0 | C++ | GwonilJoo/Samsung_SDS_Algorithm | /2_TimeComplexity/D.cpp | UTF-8 | 1,164 | 3.140625 | 3 | [] | no_license | // 2517 달리기
/*
Inversion Count
merge sort의 merge 과정!
근데 왜 시간초과 뜨냐;; -> endl 대신 '\n' 쓰기.....
*/
#include<iostream>
#include<algorithm>
using namespace std;
struct Runner{
int pos;
long long value;
};
int N;
Runner nums[500000];
Runner temp[500000];
int Rank[500000];
void merge(int s, int m, int e){
int p1... | true |
098a499362630c685b610af6c96d75a43fca790f | C++ | Sopel97/conference_db_gen | /conference_database_gen/include/Csv/CsvDocument.h | UTF-8 | 329 | 2.640625 | 3 | [] | no_license | #pragma once
#include <vector>
#include "CsvRecord.h"
class CsvDocument
{
public:
void add(const CsvRecord& record);
void add(CsvRecord&& record);
std::string toString() const;
friend std::ostream& operator<< (std::ostream& stream, const CsvDocument& doc);
private:
std::vector<CsvRecord> m_rec... | true |
4ee74cde76e9a2ba4483ca6b0a04f3d6479ec0b4 | C++ | kevyuu/soul | /sample/triangle/triangle_sample.cpp | UTF-8 | 2,479 | 2.65625 | 3 | [] | no_license | #include "core/panic.h"
#include "core/type.h"
#include "gpu/gpu.h"
#include <app.h>
using namespace soul;
class TriangleSampleApp final : public App
{
gpu::ProgramID program_id_;
auto render(gpu::TextureNodeID render_target, gpu::RenderGraph& render_graph)
-> gpu::TextureNodeID override
{
const gpu::... | true |
a4e20bfbd41c070be3a4237b29ab8b0f0264b734 | C++ | xiazhiheng/C | /List/SqlList.cpp | UTF-8 | 974 | 3.140625 | 3 | [] | no_license | #include<iostream>
using namespace std;
#define MaxSize 10
SqlList* InitList(SqlList *sqlList);
bool ListInsert(SqlList *sqlList,int i,int data);
bool ListDelete(SqlList *sqlList,int i);
typedef struct{
int data[MaxSize];
int length;
}SqlList;
int main(){
}
SqlList* InitList(SqlList *sqlList){
sqlList = (SqlLi... | true |
7488bfc00c63681c98823700014c5245116e0a05 | C++ | kkq1l/konfetki | /СandyWay/СandyWay/Hud.cpp | UTF-8 | 1,330 | 2.546875 | 3 | [] | no_license | #include "Hud.h"
Hud::Hud()
{
image.loadFromFile("Texture/life.png");
image.createMaskFromColor(Color(50, 96, 166));
t.loadFromImage(image);
s.setTexture(t);
s.setTextureRect(IntRect(783, 2, 15, 84));
bar.setFillColor(Color(0, 0, 0));
max = 100;
key = 0;
}
void Hud::initGUI()
{
font.loadFromFile("Fonts/Pixell... | true |
a23b7cd6e69af0285122466d4b5ff88548c76d24 | C++ | MarcoAFC/gameoflife | /src/life.cpp | UTF-8 | 5,004 | 3.234375 | 3 | [] | no_license | #include "../include/life.h"
#include "../include/matriz.h"
/*!
* A function that seeks the alive cells and places them in a map, while generating a hash for rule verification.
* \param mat the matrix representing the table.
* \param nlinhas the number of lines in the matrix.
* \param ncol the numbe... | true |
d341385dffde8190653aaa9d2c2aad73f224cc8c | C++ | IceAndSnow/touchdown | /src/players/generic_instantiator.h | UTF-8 | 885 | 2.90625 | 3 | [] | no_license | #ifndef TOUCHDOWN_GENERIC_INSTANTIATOR_H
#define TOUCHDOWN_GENERIC_INSTANTIATOR_H
#include "player_instantiator.h"
namespace players {
template<typename TPlayer>
class GenericInstantiator : public PlayerInstantiator {
private:
TPlayer* m_player;
public:
GenericInstantiator() {
... | true |
7527b7125bd0ada117cdfc8e39d981d5b32ac8e6 | C++ | krishna6431/Data-Structure-Algorithms-Implementation-Using_CPP | /01_Recursion/04_head_recursion.cpp | UTF-8 | 466 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | //Data Structure Course
//All Codes Are Written by Krishna
//Recursion
#include<iostream>
using namespace std;
int function1(int n);
void function(int n){
if(n>0){
function(n-1);
cout << n << " ";
}
}
int main(){
int x=10;
function(x);
cout << endl;
function1(x);
cout << endl;
retu... | true |
96c4a48439b78d20a488cdacfeb8d9a71d048eeb | C++ | SameOwner/gravity | /MyGame/MyGame/src/Fade/FadeSprite.h | UTF-8 | 492 | 2.734375 | 3 | [] | no_license | #pragma once
#include<functional>
class FadeSprite {
private:
enum State {
In,
Out,
Stop
};
public:
FadeSprite();
~FadeSprite();
void init();
void start();
void update(float deltaTime);
void draw()const;
bool isActive()const;
void addCallBack(const std::function<void()>& func);
void in(float deltaT... | true |
d818b7faf60164f0c7b0ac04dbd71727520bacef | C++ | johnmangold/School-Projects | /csc456/prog3/mailbox/mailbox_functions.cpp | UTF-8 | 6,294 | 3.015625 | 3 | [] | no_license | #include "mailbox.h"
using namespace std;
/************************************************************************
Function: bool create_memory(vector<int> &ids, int mb_num, int mb_size
Author: John Mangold, Colter Assman, Jason Anderson
Description: Creates shared memory segments
Parameters: vector<int>... | true |
04f7a30c13c24ab6dd2d238aadae13f58526bc3a | C++ | HitLumino/mrpt | /libs/serialization/src/stl_serialize_unittest.cpp | UTF-8 | 1,802 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | /* +------------------------------------------------------------------------+
| Mobile Robot Programming Toolkit (MRPT) |
| http://www.mrpt.org/ |
| |
| Cop... | true |
6339d99715194908dffa4105cf0d8b35e5bb47ab | C++ | mdqyy/FeatureDetection | /libTracking/include/classification/FixedApproximateSigmoidParameterComputation.h | UTF-8 | 1,675 | 2.703125 | 3 | [] | no_license | /*
* FixedApproximateSigmoidParameterComputation.h
*
* Created on: 24.09.2012
* Author: poschmann
*/
#ifndef FIXEDAPPROXIMATESIGMOIDPARAMETERCOMPUTATION_H_
#define FIXEDAPPROXIMATESIGMOIDPARAMETERCOMPUTATION_H_
#include "classification/ApproximateSigmoidParameterComputation.h"
namespace classification {
... | true |
58c5f35d23b43e58fa3bc7d2ea2ed15bcc21085a | C++ | Jin-SukKim/Algorithm | /Problem_Solving/leetcode/Algorithm/Sorting/56_Merge_Intervals/mergeIntervals.cpp | UTF-8 | 1,956 | 4.03125 | 4 | [] | no_license | /*
56. Merge Intervals
Given an array of intervals where intervals[i] = [starti, endi],
merge all overlapping intervals, and return an array of
the non-overlapping intervals that cover all the intervals
in the input.
Example 1:
Input: intervals = [[1,3],[2,6],[8,10],[15,18... | true |
64b11de14222375e0028c1c9e2e12da04c8dc29e | C++ | eemurat3/Array | /Array.h | UTF-8 | 4,713 | 4.15625 | 4 | [] | no_license | /**
* @file Array.h
* @author murat kaymaz
* @brief This class is uses for array operation and can be used for all types
* @version 0.1
* @date 2021-05-30
*
* @copyright Copyright (c) 2021
*
*/
#ifndef ARRAY_H
#define ARRAY_H
template<class T>
class Array{
public:
/**
* @brief Construc... | true |
aa3a9b5c9fde39d8f166ff93b9e1f49a447df232 | C++ | makometr/ADS-9304 | /Shunyaev/cw/Source/Node.h | UTF-8 | 1,349 | 2.765625 | 3 | [] | no_license | #pragma once
#include "Includes.h"
class Node
{
friend class AVLTree;
public:
Node(int key, std::shared_ptr<Node> left = nullptr, std::shared_ptr<Node> right = nullptr);
unsigned char GetHeight();
int GetKey();
int GetCounter();
int BalanceFactor(DemoState state = DemoState::NoDemo);
void AdaptHeight(DemoSta... | true |
a13a14077435675553c2f04edd3fef0f9a04fddd | C++ | kopecdav/CircleCi | /_libs_/byzance/MqttBuffer.cpp | UTF-8 | 2,619 | 2.875 | 3 | [] | no_license | /*
* DeviceList.h
*
* Created on: 11. 7. 2016
* Author: Viktor, Martin
*/
#include "MqttBuffer.h"
#include "ByzanceJson.h"
REGISTER_DEBUG(MqttBuffer);
MqttBuffer::MqttBuffer(){
_msg_list.clear();
}
// todo: destruktor!!!
/**
* @brief Lock buffer
* @param none
* @retval ==0 for success
* !=0 for ... | true |
430f141de2f00d35f812bd3dadaf29c4f7095da7 | C++ | jrazoesp/Linux-Robotic-Arm | /demo.cpp | UTF-8 | 1,154 | 2.859375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <signal.h>
#include <sched.h>
#include <pthread.h>
#include "RoboticArm.h"
RoboticArm *RoboArm;
void _cleanup(int signum)
{
std::cout << "\nINFO: Caught signal " << signum << std::endl;
/* Delete all of the robotic-arm ob... | true |
74cf240f44e8de8d630f194a0e3cb25831f10876 | C++ | anqin-gh/ECS | /src/ecs/cmp/entity.hpp | UTF-8 | 827 | 2.5625 | 3 | [] | no_license | #pragma once
#include <ecs/util/typealiases.hpp>
#include "component.hpp"
namespace ECS {
struct Entity_t {
explicit Entity_t() = default;
constexpr EntityID_t getID() const noexcept { return ID; }
template <typename CMP_t>
void addBelongingComponent(const CMP_t& cmp) {
auto typeID = cmp... | true |
ca49ffd1542c148048fc5aba4822d90e56f01ca7 | C++ | furious/yoshisisland-leveltool | /functions.cpp | UTF-8 | 1,492 | 2.625 | 3 | [] | no_license | #include "main.h"
#define sprintf(format, ...) AnsiString().sprintf((format), __VA_ARGS__)
// OTHER FUNCTIONS
void fn_Log(UnicodeString text){
if(frsMain->chk_DebugInfo->Checked)
frsMain->DebugInfo->Lines->Add(text);
}
// SNES ADDRESSING FUNCTIONS
int addr2pc(int addr){
if(addr >= 0x400000)
return addr - 0x4000... | true |
ea90b5a76d95273d4165306b70bb2db85a4d4614 | C++ | gtmcoder/bamtest | /src/bt.cpp | UTF-8 | 1,637 | 2.59375 | 3 | [] | no_license | #include </Users/marth/Dropbox/Unix/Software/bamtest/bamtools/include/api/BamMultiReader.h>
#include </Users/marth/Dropbox/Unix/Software/bamtest/bamtools/include/api/BamWriter.h>
using namespace BamTools;
// standard includes
#include <iostream>
#include <string>
#include <vector>
int main (int argc, char *argv[]) {... | true |
de49afa3e91b5140c2209f7df61deb3edbbe23c6 | C++ | hysteriai/CppPrimer | /p40lx29.cpp | UTF-8 | 203 | 2.703125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
// cin >> int input_value;
// int i = {3.14};
// double salary = wage = 9999.99;
int i = 3.14;
cout << i << endl;
return 0;
} | true |
91885a467f95b3ba8f5df370582168f3be073487 | C++ | sptungG/Data-Structure-Advanced | /Training 4-Divide&Conquer/C-EKO.cpp | UTF-8 | 2,447 | 3.1875 | 3 | [] | no_license | /*
Lumberjack Mirko needs to chop down M metres of wood.
It is an easy job for him since he has a nifty new woodcutting machine that can take down forests like wildfire.
However, Mirko is only allowed to cut a single row of trees.
Mirko's machine works as follows: Mirko sets a height parameter H (in metres),
and the m... | true |
b3e1989d6a6c7e6dd0d449a8bd058e6c94a50f7b | C++ | principal6/TessellationTest | /Core/Camera.h | UTF-8 | 2,885 | 2.71875 | 3 | [] | no_license | #pragma once
#include "SharedHeader.h"
class CCamera
{
public:
enum class EType
{
FirstPerson,
ThirdPerson,
FreeLook
};
enum class EMovementDirection
{
Forward,
Backward,
Rightward,
Leftward,
};
struct SCameraData
{
SCameraData() {}
SCameraData(EType _eType, XMVECTOR _EyePosition, XMVECTOR... | true |
1c0d4d93daa08704ad0209470f61e3a1022638ee | C++ | aambbroo/MathRebus_ | /MathRebus_.cpp | UTF-8 | 11,570 | 2.765625 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
typedef struct accord {
char Char;
short Num;
bool Use;
};
struct accord Local_Accord[10];
int Nums[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
char Letters[26] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G'... | true |
5f5ba987df297fefa3b0cda9966231847bea2f1b | C++ | logicaltrojan/Algorithm | /Algorithm/search/prime_1963.cpp | UTF-8 | 1,170 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
using namespace std;
int prime[10005];
int check[10005];
bool visited[10005];
int change(int n, int i, int j ){
if(i == 0 && j == 0)
return -1;
string temp = to_string(n);
temp[i] = '0'+j;
return ... | true |
7a9933cad1b878743af83353d2d1402d45d03a9f | C++ | PacktPublishing/CPP-Game-Development-Cookbook | /Chapter4/Source/Recipe2/Source.cpp | UTF-8 | 602 | 3.546875 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <conio.h>
using namespace std;
bool Linear_Search(int list[], int size, int key)
{
// Basic sequential search
bool found = false;
int i;
for (i = 0; i < size; i++)
{
if (key == list[i])
found = true;
break;
}
return found;
}
bool Binary_Search(int *list, int size, int key)... | true |
36642f776984efd9f7b2dd068965efe9ae16cc4a | C++ | shablov/OrderBook | /src/orderbook/benchmark/ChangeOrderElementBenchmark.cpp | UTF-8 | 7,072 | 3.125 | 3 | [] | no_license | #include <random>
#include <iostream>
#include "benchmark/benchmark.h"
#include "orderbook/OrderBooks.h"
template <typename OrderBookT>
static OrderBookT createBook(uint64_t startPrice, uint64_t stepPrice, double delimeter, uint64_t bookSize) {
OrderBookT book;
uint64_t price = startPrice;
uint64_t quantity ... | true |
d60734591fe329fe49d2e05ab88a2a1cd9c00a4b | C++ | katherine-yuan/Assignment-2 | /Assignment 2/Cylinder.h | UTF-8 | 878 | 2.640625 | 3 | [] | no_license | // Group 80
// Rebecca Schacht z5115440 2018/08/31
#ifndef MTRN2500_CYLINDER_H
#define MTRN2500_CYLINDER_H
#include "Shape.hpp"
// Global variables to allow cylinder shape to form
#define STACKS 1 // The number of subdivisions along the z axis
#define SLICES 1000 // The number of subdivisions around the... | true |
381cc5aaef9a410c7c84be0a48a8d88b5aa491d3 | C++ | HekpoMaH/Olimpiads | /grupa A/olimpiada/ob6tinski/2012/NOI_1_2012_A/poker/author/poker_PF.cpp | UTF-8 | 882 | 3.046875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{int a,b,c,d,e,t;
cin>>a>>b>>c>>d>>e;
if (a>b){t=a;a=b;b=t;}
if (a>c){t=a;a=c;c=t;}
if (a>d){t=a;a=d;d=t;}
if (a>e){t=a;a=e;e=t;}
if (b>c){t=b;b=c;c=t;}
if (b>d){t=b;b=d;d=t;}
if (b>e){t=b;b=e;e=t;}
if (c>d){t=c;c=d;d=t;}
if (c>e){t=c;c=e;e=t;}
... | true |
f36790bd258a92a66d1e0d88bf8101e7ec6d111b | C++ | MilWolf/OpenGL_SDL_Essai | /src/Camera.cpp | ISO-8859-1 | 3,896 | 3 | 3 | [] | no_license | #include "Camera.h"
Camera::Camera(): phi(0.0), theta(0.0), orientation(), axeVertical(0, 0, 1), deplacementLateral(), position(), pointCible()
{
}
Camera::Camera(vec3 position, vec3 pointCible, vec3 axeVertical) : phi(0.0), theta(0.0), orientation(), axeVertical(axeVertical),deplacementLateral(), position(position),... | true |
0ee4afdc15b94ee7840b1fe5060d8e91a055374b | C++ | everfor/Frankenstein | /Core/Physics/physics_engine.h | UTF-8 | 863 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include "object.h"
#include "physics_object.h"
#include <vector>
#include <glm/glm.hpp>
class PhysicsEngine
{
public:
PhysicsEngine(bool if_enable_gravity = false);
virtual ~PhysicsEngine() {};
void addObject(PhysicsObject* obj) { objects.push_back(obj); };
void update(float delta);
void swi... | true |
ef6baf5b8c2d4ca3d946faada51aba71c6a7a904 | C++ | karagog/gutil | /src/core/utils/circularint.h | UTF-8 | 3,217 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | /*Copyright 2012-2015 George Karagoulis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | true |
15228c993270070eee760ad6311cb5d98496e859 | C++ | glenco/SLsimLib | /TreeCode_link/peak_refinement.cpp | UTF-8 | 5,129 | 2.625 | 3 | [
"MIT"
] | permissive | /*
* peak_refinement.c
*
* Created on: Apr 8, 2011
* Author: bmetcalf
*
* Written for project with S.Hilbert for adaptive ray tracing through the Millennium II simulation.
*
* Uses a defection solver provided by the user. Adaptively finds regions with high kappa and refines
* them to high... | true |
e5c5d34251516dd09dcba9029c2393bcde769d71 | C++ | wtfenfenmiao/buptProgram | /prog_2/pagerank带调试信息.cpp | GB18030 | 5,285 | 2.609375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h> //ֻһУlinuxwindows
#include<string.h>
#include<vector>
#include<unordered_map>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
using namespace std;
//Gm:ÿһһϵ3УDZ3URL˭... | true |
12eb258d496a07164036be5fc304ac5c8cae4c82 | C++ | jordancde/seamail | /src/models/thread.h | UTF-8 | 591 | 2.640625 | 3 | [
"MIT"
] | permissive | #ifndef _THREAD_H_
#define _THREAD_H_
#include <iostream>
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
#include "../utility/serializable.h"
class Thread : public Serializable {
void serialize(nlohmann::json&) const override;
void deserialize(const nlohmann::json&) override;
std:... | true |
936885ed7f831dca3cfd00e1447cc6595f9204b0 | C++ | ShengKeTan/DalyPractice | /Log/util/list/list.cpp | UTF-8 | 600 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include "list.h"
int main(int argc, char** argv)
{
list<int> mlist;
mlist.push_back(1);
mlist.push_back(2);
mlist.push_back(3);
std::cout << mlist.size() << std::endl;
for (list<int>::iterator it = mlist.begin(); it != mlist.end(); ++it)
{
std::cout << (*it) << std::endl;
}
mlist.c... | true |
673198935bcc4ddf685f21ea659d8774100c5c65 | C++ | dillonfeinman/Longest-Common-Subsequence | /program2.cpp | UTF-8 | 3,141 | 3.8125 | 4 | [] | no_license | #include <string>
#include <fstream>
#include <cstdlib>
#include <iostream>
#include <chrono>
using namespace std;
//max takes in two ints, a and b, and returns the greater of the two by simple >= comparison
//a and b are assumed to be integers.
int max(int a, int b){
if(a >= b){
return a; //a is bigger
}
e... | true |
12230499bcc56a434b4a960b57cd280fc304f3f6 | C++ | eerick1997/Club | /Ejercicios/LeetCode/Permutations.cpp | UTF-8 | 1,006 | 3.296875 | 3 | [] | no_license | //Problem link: https://leetcode.com/problems/permutations/
//Time complexity O(n * n!)
//Space complexity O( n * n! )
class Solution {
public:
vector<vector<int>> permute(vector<int>& nums) {
vector< vector<int> > ans;
vector< bool > visited( nums.size(), false );
vector< int > current;
... | true |
e0b34374dca72b090b04fd138da44d3f40514082 | C++ | ginkgo/AMP-LockFreeSkipList | /test/inarow/RecursiveSearch/InARowGameTask.h | UTF-8 | 5,180 | 2.59375 | 3 | [] | no_license | /*
* InARow.h
*
* Created on: 22.09.2011
* Author: Daniel Cederman
* License: Boost Software License 1.0 (BSL1.0)
*/
#ifndef INAROWGAMETASK_H_
#define INAROWGAMETASK_H_
#include <pheet/pheet.h>
#include "../../../pheet/misc/types.h"
#include "../../../pheet/misc/atomics.h"
#include <string.h>
#include <stdl... | true |
551e7b4bedf04ba9a55f65c6063c1005b10da4b7 | C++ | Arduini-Projects/cpCMRI | /src/cpCMRI.cpp | UTF-8 | 20,586 | 2.625 | 3 | [] | no_license | #include <Arduino.h>
#include <cpCMRI.h>
#include <I2Cexpander.h>
#define CMRI_DEBUG_PROTOCOL 0x0001
#define CMRI_DEBUG_SERIAL 0x0002
#define CMRI_DEBUG_IOMAP 0x0004
#define CMRI_DEBUG_IO 0x0008
#define CMRI_DEBUG_TIMING 0x0010
#define DEBUG_INFO 0x0100
#define DEBUG_FREERAM ... | true |
d97bdefa0f077dff64607712a86721ad5cc2c6a4 | C++ | whuang8/Data-Structures-Algorithms | /C++/DataStructures/Heap.cpp | UTF-8 | 1,956 | 3.515625 | 4 | [] | no_license | #include "Heap.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Heap::Heap(int maxSize){
_maxSize = maxSize;
_heap = new int[_maxSize];
_last = 0;
}
Heap::~Heap(){
delete [] _heap;
}
int parent(int node){
return (node-1)/2;
}
int left(int node){
return node*2 + 1;
}
int right(... | true |
c7923ceea42d8c32f683f42e1b62bc87676633cd | C++ | chris-misa/StarFlow | /backend/src/kernels/old/host_timing_profiler.h | UTF-8 | 3,800 | 2.65625 | 3 | [] | no_license |
#ifndef STARFLOW_KERNELS_HOST_PROFILER
#define STARFLOW_KERNELS_HOST_PROFILER
#include <iostream>
#include <fstream>
#include <chrono>
#include <vector>
using namespace std;
using namespace std::chrono;
#include "flat_hash_map.hpp"
// Builds a timing profile of each monitored source address.
// (example 1)
#defi... | true |
3736076d600cd6b3270cb750291a2bee539103ec | C++ | NSchwindt/Weather.Scroll | /WeatherTTGO-V2Web.ino | UTF-8 | 2,194 | 2.53125 | 3 | [] | no_license | #include "WiFi.h"
#include <HTTPClient.h>
#include <iostream>
#include <string.h>
#include <SPI.h>
#include "LedMatrix.h"
#define NUMBER_OF_DEVICES 4 //number of led matrix connect in series
#define CS_PIN 15
#define CLK_PIN 13
#define MISO_PIN 2 //we do not use this pin just fill to match constructor
#de... | true |
5d3f255568ff90ca4206fe9120bc20870af77136 | C++ | siklosid/co-cluster | /src/Reader/ReaderControl.h | UTF-8 | 2,147 | 2.828125 | 3 | [] | no_license | /*! ReaderControl controls the Reader thread objects that reads the */
/*! different parts of the dataset. In Constructor it gets */
/*! the type of the readers, than creates them by the help of */
/*! ReaderFactory. It allows as much Reader threads to read as much */
/*! is given in parameter. */
#ifndef __READER_CON... | true |
3293377a6490dc9d7b8aa72b348fb80b57ee5c27 | C++ | chiahsun/problem_solving | /Algospot/PI/solve1.cc | UTF-8 | 1,442 | 2.71875 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
const bool debug = false;
const int M = 10000+5;
char pi[M];
int a[M];
int get_type(int begin, int end) {
bool d_same = true;
int d = pi[begin+1] - pi[begin];
for (int i = begin+2; i < end; ++i)
if (pi[i]-pi[i-1] != d) {
... | true |
7cc49682a7f46f87079526ae92c35d8ec14f7281 | C++ | shinsumicco/pose-graph-optimization | /src/se2/problem.h | UTF-8 | 4,262 | 2.625 | 3 | [] | no_license | #ifndef SE2_PROBLEM_H
#define SE2_PROBLEM_H
#include <iostream>
#include <fstream>
#include <string>
#include <ceres/ceres.h>
#include <ceres/autodiff_cost_function.h>
#include "types.h"
#include "error_function.h"
namespace se2 {
void build_problem(const constraints_t& constraints, poses_t& poses, ceres::Problem&... | true |
fa4aa51bd1aba9b0bbb9486f31b1663fc35f57ff | C++ | hwl19951007/Cpp_Primer_Exercise | /chapter5/5.21.cpp | UTF-8 | 966 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
const vector<string> scores = { "F", "D", "C", "B", "A", "A++" };
string lettergrade;
int grade;
while (cin >> grade)
{
if (grade < 60)
lettergrade = scores[0];
else
lettergrade = scores[(grade - 50) / 10];
cout <... | true |
343eeb6207df36f62e558833d9fc2db45650202e | C++ | Gofrettin/simple-aes-cpp | /test/test_pkcs7_padding.cpp | UTF-8 | 1,946 | 2.921875 | 3 | [
"MIT"
] | permissive | #include <gtest/gtest.h>
#include <cstring>
#include "../src/Pkcs7Padding.h"
#include "../src/AES.h"
#include "../src/debug.h"
TEST(PKCS7PaddingTest, PadIncompleteBlock){
uint8_t block [] = {
0x00, 0x01, 0x02, 0x04,
0x00, 0x01, 0x02, 0x04,
0x00, 0x01, 0x02, 0x04,
0x00, 0x00, 0x00,... | true |
117ab2aea632ecf2a4ac3a940a74efc21fd24a2a | C++ | sehe/ideone_slurp | /output/9MmE9.cpp | UTF-8 | 2,004 | 2.734375 | 3 | [] | no_license | // error: OK
// langId: 44
// langName: C++11
// langVersion: gcc-4.8.1
// time: 0
// date: 2012-09-10 15:39:48
// status: 0
// result: 0
// memory: 0
// signal: 0
// public: false
// ------------------------------------------------
#include <iostream>
static constexpr auto MOD = 1000000007LL;
inline /*hint hint*/ lo... | true |
91d9b67a229bf728e6f154b08bfa579bd38a4f33 | C++ | huskycat1202/100June | /1764.cpp | UTF-8 | 433 | 2.625 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int n, m, sum=0, k=0;
string N[500000], M, K[500000];
cin >> n >> m;
for(int i=0; i<n; i++){
cin >> N[i];
}
sort(N,N+n);
for(int i=0; i<m; i++){
cin >> M;
if(binary_search(N,N+n,M)){
K[k++]=M;
sum... | true |
b718663e1c97e0fc9dd403e1d14f2e26ca843264 | C++ | jhomble/redis | /lib_acl_cpp/include/acl_cpp/redis/redis_client_pool.hpp | GB18030 | 1,684 | 2.6875 | 3 | [] | no_license | #pragma once
#include "acl_cpp/acl_cpp_define.hpp"
#include "acl_cpp/connpool/connect_pool.hpp"
namespace acl
{
/**
* redis ӳ̳࣬ connect_pool connect_pool ͨõй
* TCP ӳصͨ÷
* redis connection pool inherting from connect_pool, which includes
* TCP connection pool methods.
*/
class ACL_CPP_API redis_client_pool : publ... | true |
98c122a57872c43d0929bd1c99b0b7bbd6f956d8 | C++ | JameyWoo/csmile | /parse.cpp | UTF-8 | 18,745 | 2.8125 | 3 | [
"MIT"
] | permissive | #include "parse.h"
#include "scan.h"
ofstream out("Output-parseTree.txt", ios::out);
void error() {
error_cnt += 1;
cout << "ErrorToken >> " << ptoken.type << ": " << ptoken.value << endl;
}
Token match(string expected) {
Token tmp = ptoken;
// cout << "ptoken.type = " << ptoken.type << " ptoken.val ... | true |
c6c95f045bb0f7423e8e76e7e2512c0da1479147 | C++ | NEEC-KAMATA-D3Software/2017Summer_Gr9_UtaWima | /Framework/Source/Component/RenderClientComponent.h | SHIFT_JIS | 1,802 | 2.515625 | 3 | [] | no_license | #pragma once
#include<Source\Component\Component.h>
#include<string>
#include<memory>
#include<Source\Component\Animation\AnimatorComponent.h>
/**
* @file RigidInstanceRenderComponent.h
* @brief CX^X`I[i[R|[lgNX
* @dital ̃R|[lgĂIuWFNg̓CX^X`悳
* @authro {DP
* @date 2017/03/13
*/
namespace framework {
class CubeRenderT... | true |
63ebf8eb8c526dcf59faf40e4171abd40ac01524 | C++ | nasty091/answer-home-work | /22-9/ex2.cpp | UTF-8 | 755 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <math.h>
using namespace std;
bool isPrimeNumber(int x){
if (x<2) return false;
if (x>2){
for(int i = 2; i<= sqrt(x);i++){
if(x % i == 0){
return false;
}
}
}
return true;
}
int main(){
int n;
... | true |
7ac414475e92b878ef3ec474a98d5f9df6a5aa4f | C++ | neelchoudhury/cp | /Codechef and Spoj/L-Z/NOWAYS.cpp | UTF-8 | 619 | 2.671875 | 3 | [] | no_license | #include<bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
using namespace std;
ll power(ll a,ll b, ll c)
{
ll y=a,x=1;
while(b>0)
{
if(b%2==1) x=(x*y)%c;
y=(y*y)%c;
b=b/2;
}
return x%c;
}
ll nck(ll n, ll k)
{
ll result = 1 ;
for (ll i=1; i<= min(k,n-k); i++)
{
result = ((result%... | true |
03936008230cc473a82ed87a9ac5e422fd11745f | C++ | LucianoTorrano/TicTacToe | /main.h | UTF-8 | 1,426 | 2.609375 | 3 | [] | no_license | /*
* main.h
*
* Created on: 28 sep. 2021
* Author: lucho
*/
#ifndef MAIN_H_
#define MAIN_H_
#include <iostream>
#include <string>
#include "type.h"
#include "GameData.h"
#include "UserData.h"
#include "utilities.h"
const std::string VOID_ARCHIVE_NAME = "-";
const std::string TXT_ARCHIVE_ENDING = ".txt";
... | true |
10713f7c34886c7dbc8c4d189b85674d82c4ee7b | C++ | tsingke/Homework_Turing | /刘润轩/Experiment_2/SourceCode/2.5.2.cpp | WINDOWS-1252 | 413 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <windows.h>
using namespace std;
float PI = 3.14;
float zhouchang(float r);
float s(float r);
int main()
{
float r,l,S;
cout << "Please input 뾶=" << endl;
cin >> r;
l=zhouchang(r);
S = s(r);
cout << "ܳ=" << l << endl << "=" << S <<endl;
system("pause");
return 0;
}
float zhou... | true |
61e049553e1d88c3618fcd2481719f7577d4e701 | C++ | yushengding/win32_Mygame | /win32_Mygame/MyDirector.cpp | GB18030 | 2,679 | 2.546875 | 3 | [] | no_license | //ѧţ1252957
//
//ļGameScene
//ļϷĵ һ дĹ캯趨ʼ
// MyDirectorӽijĻƷԼ·
// ͨԸIJﵽлЧ
#include "stdafx.h"
#include "MyDirector.h"
#include <iostream>
#include "selftimer.h"
#include "GameScene.h"
#include "initScene.h"
using namespace std;
MyDirector::MyDirector(void)
{
initScene *a=new initScene();
pushScene(a);
srand(GetC... | true |
3060eb38691e59dc7ed12bdb606ec01d2614f192 | C++ | nilsso/cisc310-lab2 | /src/queue.hpp | UTF-8 | 2,298 | 4.09375 | 4 | [] | no_license | #pragma once
#include <list>
#include <initializer_list>
//! Generic queue
// Generalized implementation of the queue data structure which
// enforces FIFO (first in, first out) insertion/deletion order.
template <class T>
class queue {
private:
//! Underlying buffer
std::list<T> m_buffer;
public:
//! De... | true |
895ca74e6122d7c57116a620dacc64af23b9b155 | C++ | kuronekonano/OJ_Problem | /1003Tiles of Tetris, NOT!.cpp | GB18030 | 461 | 3 | 3 | [] | no_license | #include<stdio.h>
long long gcd(long long x,long long y)
{
if(y==0)
{
return x;
}
else
{
return gcd(y,x%y);
}
}
int main()
{
long long a,b;
while(scanf("%lld%lld",&a,&b)!=EOF)
{
if(a==0&&b==0)
{
return 0;
}
... | true |
03285f32aea97a73bb343490d40c0e2b6a1c192f | C++ | yangjae33/sw15_jaehyuk | /11375.cpp | UTF-8 | 1,062 | 2.625 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int N,M;
vector<vector<int> > work;
vector<int> assigned;
vector<int> visited;
int dfs(int idx){
if(visited[idx] == 1){
return 0;
}
visited[idx] = 1;
for(int i = 0; i<work[idx].size(); i++){
if(assigned[work[idx][i]] == -1){
... | true |
09730842307c063af838bb64930b5f9fcb6b4d38 | C++ | fanzhaoyun/LeetCode | /dataStruct.h | UTF-8 | 128 | 2.6875 | 3 | [] | no_license | #pragma once
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {};
}; | true |
e194536655a3b0b2707c51e691e38073a3e5ea88 | C++ | Jooye0n/Algorithm | /BAEKJOON/17822.cpp | UTF-8 | 3,877 | 3.21875 | 3 | [] | no_license | /*
https://www.acmicpc.net/problem/17822
입력
첫째 줄에 N, M, T이 주어진다.
둘째 줄부터 N개의 줄에 원판에 적힌 수가 주어진다. i번째 줄의 j번째 수는 (i, j)에 적힌 수를 의미한다.
다음 T개의 줄에 xi, di, ki가 주어진다.
4 4 1
1 1 2 3
5 2 4 2
3 1 3 5
2 1 3 2
2 0 1
*/
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int n,m,t;
int result;
vector<vecto... | true |
2b6b655892586c465b0e7f766fc4bfff6c0f1e38 | C++ | georgeshanti/XSe | /include/xse/linux/Connection.hpp | UTF-8 | 705 | 2.8125 | 3 | [
"MIT"
] | permissive | #ifndef XSE_LINUX_CONNECTION
#define XSE_LINUX_CONNECTION
#include<sys/socket.h>
#include<iostream>
#include<netinet/in.h>
#include<string.h>
#include<unistd.h>
#define IPV4 AF_INET
#define IPV6 AF_INET6
#define TCP SOCK_STREAM
#define UPD SOCK_DGRAM
namespace XSe{
class Connection{
private:
public:
int ... | true |
e90e92efbe245e631a084efccddee80235fbeb07 | C++ | PawelBoe/PECS | /PECS/core/Entity.h | UTF-8 | 773 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// Created by Pawel Boening on 17/06/18.
//
#ifndef ECS_ENTITY_H
#define ECS_ENTITY_H
#include <cstdint>
namespace pecs
{
typedef uint32_t EntityIndex;
typedef uint8_t EntityVersion;
typedef uint32_t EntityId;
class Entity
{
public:
struct Hash
{
unsigned int... | true |
66f534ed9e9b5df3844e17f5b2ede06c6212d0c6 | C++ | osak/Contest | /AOJ/0116.cc | UTF-8 | 2,993 | 3.25 | 3 | [] | no_license | //Name: Recutangular Searching
//Level: 3
//Category: 累積和,連続区間
//Note: 類題 POJ1964
/*
* あるマスについて,そのマスを含めてそれより上にいくつ白マスが連続しているかを記憶しておく.
* すると,1行内のある区間を底辺に持つ長方形の面積は,区間長 * その区間内の最小値で与えられることが分かる.
*
* これはスタックを使い,ある高さの区間がいくつ連続しているかを高さの昇順で管理すると効率良く求められる.
* 1行を左から右になめながら値をpushしていくが,このとき
* ・スタックトップより大きい値であればそのままpushする.
* ... | true |
a0c619b8f3179e4d2c86f2eebd8759b747d5c5b5 | C++ | SimonBrandner/Basic2DGameEngine | /Game.cpp | UTF-8 | 548 | 2.6875 | 3 | [] | no_license | #ifndef GAME
#define GAME
#include "Game.hpp"
Game::Game(int length, int mapSizeX, int mapSizeY, bool * q) : MapSizeX(), MapSizeY(), quit()
{
// Variables
MapSizeX = mapSizeX;
MapSizeY = mapSizeY;
quit = q;
}
// Variables
std::vector<Pixel> Game::getChangedPixels()
{
std::vector<Pixel> change... | true |
717cfdb945a8aa9c5bbcbb65d32c14fc9f9d5102 | C++ | VolodymyrShchyhelsky/Client-Server-remote | /Server/mytcpserver.cpp | UTF-8 | 4,207 | 2.65625 | 3 | [] | no_license | #include "mytcpserver.h"
MyServer::MyServer(QObject *parent):
QObject(parent)
{
// Data base of pathes to programs
db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("E:/QT/Server/PathDataBase.db");
db.open();
server = new QTcpServer(this);
connect(server,SIGNAL(newCo... | true |
46ae746d4ae763f27d73522450e851bfecba999f | C++ | shaohua0720/sbl-sandbox | /samples/nmr2d/ista.cc | UTF-8 | 2,843 | 2.53125 | 3 | [
"MIT"
] | permissive |
/* Copyright (c) 2019 Bradley Worley <geekysuavo@gmail.com>
* Released under the MIT License.
*
* Compilation:
* g++ -std=c++14 -O3 ista.cc -o ista -lfftw3_threads -lfftw3 -lm
*/
#include "inst.hh"
int main (int argc, char **argv) {
/* read the instance data from disk. */
auto data = load(argc, argv);
... | true |
5526a439a93a84b7e234be16f520780d08a40471 | C++ | intel/AVB-AudioModules | /public/inc/internal/audio/smartx_test_support/IasTimeStampCounter.hpp | UTF-8 | 2,065 | 2.75 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright (C) 2018 Intel Corporation.All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file IasTimeStampCounter.hpp
* @brief Time Stamp Counter, based on rdtsc, to be used for performance optimizations.
* @date May 06, 2013
*/
#ifndef IASTIMESTAMPCOUNTER_HPP_
#define IASTIME... | true |
abb8de49942fbc11abd71ec65999073c4ad129bc | C++ | alediaferia/morph-again | /src/core/parser.cpp | UTF-8 | 8,085 | 3.03125 | 3 | [] | no_license | #include "parser.h"
#include "type.h"
#include "constant.h"
#include "assign.h"
#include "arith.h"
#include "strlit.h"
#include "array.h"
#include "seq.h"
#include "exprstmt.h"
#include <sstream>
#include <iostream>
#define TRY_MATCH(arg) \
if (!match(arg)) \
return;
#define TRY_MATCH_ELSE(arg, _else) \
... | true |
4caef4f4de9c1f98ac896b3732612f7f30c4b469 | C++ | adityavk/json-parser | /TestCases/AllTestCases.cpp | UTF-8 | 9,471 | 3.140625 | 3 | [] | no_license | //
// AllTestCases.cpp
// JSONParser
//
// Created by Aditya Vikram on 13/03/21.
//
#include "AllTestCases.hpp"
#include "lexer.hpp"
#include <iostream>
using namespace std;
using namespace JSONParser;
void lexString() {
const std::string input("\"hello world\"fafnnk");
cout<< "Lexed: "<< StringLexer::lex... | true |
ed7d7c72076e9c5c191551ec04c7a42897d6e1b8 | C++ | cms-sw/cmssw | /Geometry/CommonTopologies/interface/TkRadialStripTopology.h | UTF-8 | 9,871 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef _TkRADIAL_STRIP_TOPOLOGY_H_
#define _TkRADIAL_STRIP_TOPOLOGY_H_
#include "Geometry/CommonTopologies/interface/RadialStripTopology.h"
/**
* \class TkRadialStripTopology
* A StripTopology in which the component strips subtend a constant
* angular width, and, if projected, intersect at a point.
*
* \author ... | true |
e389f4362a94611d51d528ee1d2b00b0f7368d30 | C++ | yerson001/mycpp | /oop/p14_multiple_files/main.cpp | UTF-8 | 301 | 3.296875 | 3 | [] | no_license | #include "add_and_sum.h"
#include <iostream>
int main(){
std::vector<int> a{1,2,3,4,5};
std::cout << "Orignal vector: ";
for (auto i: a){
std::cout << i << " ";
}
std::cout <<"\n";
std::cout << "Add 1 to each element and sum the vector: "<< AddAndSum(a) << "\n";
}
| true |
700b5851953d841322477edfe1b31d0fb160a0b1 | C++ | Ras-al-Ghul/SPOJ | /PRISMSA.cpp | UTF-8 | 408 | 2.5625 | 3 | [] | no_license | // diff. S formula with respect to a and substitue for h using V and a
// diff. = 0, solve for a
// plug a in S formula written only in terms of a
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int t; scanf("%d", &t);
double vol, S, a;
while(t--){
scanf("%lf", &vol);
a = pow(4*vol,0.333... | true |
d42100ceb01783e9e470744f898a8a87b7950e7b | C++ | Moenya1030/CPPStudyCode | /作业/lab10/Lab10_1.cpp | GB18030 | 1,589 | 3.84375 | 4 | [] | no_license | //һΪLab10_1.cpp ʵҪ
//aһΪMatrixľ࣬洢һάdouble飬Լȡ
//bͨ+ʵ֮ͬĵ+㣬C=A+B
//cͨ<<ʹÿͨʾcout<<CʾC
#include<iostream>
#include<string.h>
using namespace std;
class Matrix;
ostream& operator<<(ostream &out,const Matrix &m);
class Matrix
{
public:
Matrix(int r=0,int c=0);
void setMatrix(int r=0,int c=0);
Matrix operator+(cons... | true |
92cc00f2c4e144e53542e2f22ad9d59f08c4d134 | C++ | RBrNx/GED-RPG-Coursework | /RPG Coursework/gameOverState.cpp | UTF-8 | 1,883 | 2.796875 | 3 | [] | no_license | #include "gameOverState.h"
#include "statePlay.h"
#include "game.h"
#include "stateBattle.h"
gameOverState::gameOverState() {
textFont = TTF_OpenFont("MavenPro-Regular.ttf", 36); //init font
gameOverText = new Label();
gameWinText = new Label();
battleWinText = new Label();
gameWinText->textToTexture("You have... | true |
7105db9e29eeb0fed91d12c0fc35f880b1e6c529 | C++ | cca-company/BattleShip | /BattleShip/GameManager.h | UHC | 763 | 2.59375 | 3 | [] | no_license | #pragma once
#include "stdafx.h"
#include "Player.h"
#include "Render.h"
class GameManager
{
public:
/* initialize function */
GameManager();
~GameManager();
void StartGame(); // մϴ
int StartSoloPlay(); // ¶ ÷̸ մϴ
int StartNetworkPlay(); // ¶ ÷̸ մϴ
protected:
Network ConnectNetwork(); // ¶ ÷̸ ... | true |
b0ae86333e9a86ddfbcbc29e459fc1b5a25a8e1f | C++ | Manuel1426/my-teaching-materials | /by-language/cpp/cpp-oo/templates/workshop/07.cpp | UTF-8 | 191 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
//Create a simple class template which contains 2 item and has both a get and a set method for these!
return 0;
}
| true |
85362a0f6fecc089c77371a7c51bf5d65ac65517 | C++ | qhpark/compiler-adacs | /ringbuffer.hpp | UTF-8 | 801 | 3.109375 | 3 | [] | no_license | #ifndef __RINGBUFFER_HPP_
#define __RINGBUFFER_HPP_
class RingBuffer {
public:
RingBuffer();
// give size.
RingBuffer(int bytes);
~RingBuffer();
// get last position
//int get_last_pos();
// return how much buffer is used.
int num_stored();
// return how much more is left to read
int num_unr... | true |
1b306efb3448669f2de5f6b30d89ec24bb0fab33 | C++ | buglog/desert-stalker | /Engine/Spike.h | UTF-8 | 592 | 3.0625 | 3 | [] | no_license | #pragma once
#include "Vampire.h"
class Spike
{
//spikes are 10 pixels wide each. these spikes extrude to a length of 15 pixels.
public:
void init(int setx, int sety, int setlength);
//choose your direction of spikes. each function draws, blocks, and kills the vamp all by itself.
void floor(Vampire& vamp, Graphics... | true |
57cd8aefd18537c099d965ccea7ce794ba536508 | C++ | MohammadMoeinKeyvani/ArkanoidGame | /Engine/Paddle.h | UTF-8 | 557 | 2.8125 | 3 | [] | no_license | #pragma once
#include "Vec2.h"
#include "Ball.h"
#include "Colors.h"
#include "Keyboard.h"
class Paddle
{
public:
Paddle(Vec2 inputPos, float inputHalfWidt, float inputHalfHeight);
bool DoBallCollision(Ball& ball) const;
void DoWallCollision(const Rect wall);
void Update(float deltaTime, Keyboard& keyboard);
voi... | true |
5b282f5db104c79d232c45f21ff8d19bc53bffae | C++ | yielding/code | /cpp.fp/io.monad/optional.cpp | UTF-8 | 1,101 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <functional>
using namespace std;
template<class T>
class optional
{
public:
optional() : _isValid(false) {} // Nothing
optional(T x) : _isValid(true) , _v(x) {} // Just
auto isValid() const { return _isValid; }
auto val() const { return _v; }
template <typename R>
auto ... | true |
a41c04b68f7941095eaa8908862ae68ea6544dad | C++ | Mauricioduque/Proyecto_final | /Rabbits_Adventures/jabalienemigo.cpp | UTF-8 | 2,222 | 2.5625 | 3 | [] | no_license | /*
Proyecto: Rabbit's Adventures
Creado por: Laura Isabel Vidal - Mauricio Duque
Informática II
Facultad de Ingeniería
Departamento de Electrónica y Telecomunicaciones
Universidad de Antioquia
Clase Jabali Enemigo: objeto del segundo mundo, que se desplaza en determina seccion
y se encuentra asociado a un ti... | true |
24b490a6bb0c23e9cef64664d311491bde5497ba | C++ | scipianus/Algorithm-contests | /CodeForces/MemSQL Start[c]UP 2.0 Round 1/A/A.cpp | UTF-8 | 559 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
int n, m;
char s[100];
string nume[8] = {"vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"};
int main()
{
int i, j;
bool ok;
std::ios_base::sync_with_stdio(false);
cin >> n;
cin >> s;
for(i = 0; i < 8; ++i)
{
m = ... | true |
c77c872e31ea4d18e0e27cf5031cfec22aa565e0 | C++ | Fatnerdfy/Monopoly | /Richers2/Richers2/game.cpp | UTF-8 | 1,694 | 2.84375 | 3 | [] | no_license | //
// game.cpp
// Richers2
//
// Created by CQQ on 2017/9/24.
// Copyright © 2017年 CQQ. All rights reserved.
//
#include <iostream>
using namespace std;
#include "game.h"
#include "menu.h"
Game * Game::game = nullptr;
Game * Game::getInstance() {
if (game == nullptr) {
int gid = 1;
GameFactor... | true |
a3469918ab3978195a64137a3c40306c0f37b259 | C++ | shifushihuaidan/op11 | /C++/测试.cpp | GB18030 | 405 | 2.75 | 3 | [
"MIT"
] | permissive | #include<iostream>
using namespace std;
#include <ctime>
#include<windows.h>
int main ()
{
SYSTEMTIME sysTime;
ZeroMemory(&sysTime, sizeof(sysTime));
GetLocalTime(&sysTime);
cout << "ʱΪ" << sysTime.wYear << "" << sysTime.wMonth << "" <<sysTime.wDay<<""<<endl;
cout <<sysTime.wHour << "ʱ" <<sysTime.wM... | true |
eccae618077e0a990f82edfdf9d694bda38a7e59 | C++ | RuslanArkh/PatientsApp | /photodao.cpp | UTF-8 | 2,517 | 2.78125 | 3 | [] | no_license | #include "photodao.h"
#include "photo.h"
#include "dbmanager.h"
#include "dbmanager_exceptions.h"
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QString>
PhotoDao::PhotoDao(QSqlDatabase & database)
: mDatabase(database)
{
}
void PhotoDao::init() const {
if (!mDatabase.tables().contains("photo")) {
... | true |
90c97dc407a3249ec97cc5405c6f0e06f27a3ff9 | C++ | ElSpato/Funciones | /Funciones y subrutinas/ejercicio10.cpp | UTF-8 | 1,776 | 3.046875 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
using namespace std;
void matrizA();
int main(){
matrizA();
getch();
return 0;
}
void matrizA(){
int a[20][20],b[20][20],c[20][20];
int k,m,n;
cout<<"\t.:Matriz A:."<<endl;
do {
cout<<"Filas de A: ";
cin>>k;
cout<<"Columnas de A: ";
cin>>m;
... | true |
ac67447ec7bae6564807b496c7b8c01b4def8bec | C++ | NarouMas/ZeroJudge | /c123 00514 - Rails.cpp | UTF-8 | 868 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<stack>
using namespace std;
int main()
{
stack<int> st;
int n,a[1005],t,pushn;
bool dis;
while(cin>>n)
{
if(n==0)
break;
cin>>a[0];
while(a[0]!=0)
{
for(int i=1;i<n;i++)
cin>>a[i];
while(st.size()!=0)
st.pop();
st.push(1);
t=0,pushn=2,dis=true;
while(s... | true |
213b28594fb1f5fee1394ec1af69341273fbab2c | C++ | JZZQuant/genneteq | /gennet/graph.h | UTF-8 | 3,513 | 2.875 | 3 | [] | no_license | /*****************************************************************************/
/* Author: Jason Sauppe */
/* Date: 2010-06-16 */
/* File: graph.h */
... | true |
705ddc388d1e5044500d807a232c0422835846d6 | C++ | NicMen99/Jojo-Run | /Src/Entities/Obstacle.h | UTF-8 | 488 | 2.796875 | 3 | [] | no_license | //
// Created by Niccolo on 28/02/2021.
//
#ifndef JOJO_RUN_OBSTACLE_H
#define JOJO_RUN_OBSTACLE_H
#include "Entity.h"
class Obstacle : public Entity
{
public:
Obstacle(EntityType mtype, const std::string & name) :
Entity(EntityGroup::Obstacle, mtype, name) { }
~Obstacle() override {};
void ... | true |
c40d73fb4e53132ac03d9fc02fe05d9d7575719a | C++ | utt-zachery/ping-plus-plus | /flags/TTLFlag.h | UTF-8 | 600 | 2.828125 | 3 | [] | no_license | #pragma once
#include <string>
#include "AbstractFlag.h"
#include "../exceptions/SyntaxException.h"
//Concrete flag class that allows users to execute a custom command if PING requests are systematically failing
class TTLFlag : public AbstractFlag {
public:
TTLFlag();
//Default behavior will be set t... | true |
03e21bf4249dd4ccd8853a0a1bd032e1f8d55559 | C++ | Queuebee2/OS-buffer | /project/buffer.test.cpp | UTF-8 | 10,855 | 2.890625 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <stdlib.h>
#include <fcntl.h>
#include <thread>
#include <vector>
using namespace std;
// GTEST info message hack https://stackoverflow.com/a/48924764/6934388
#define GTEST_COUT_INFO std::cerr << "\033[33m" << "[ INFO ] " << "\033[37m"
// declarations of methods you want to tes... | true |
81fa9fa3455b17840e83a67a965fc16e8ab5162a | C++ | zielona9/PersonalBudget | /UserManager.h | UTF-8 | 880 | 2.828125 | 3 | [] | no_license | #ifndef USERMANAGER_H
#define USERMANAGER_H
#include <iostream>
#include <vector>
#include "User.h"
#include "SupportingMethods.h"
#include "FileWithUsers.h"
using namespace std;
class UserManager
{
int idOfLoggedInUser;
vector <User> users;
FileWithUsers fileWithUsers ;
bool doesLoginExists(string lo... | true |
8e9278a2f0ed03871293509d449fe71792158472 | C++ | kshvedov/PA8_CS122_DataAnalysis | /PA8_S2_K_Shvedov/DataAnalysis.cpp | UTF-8 | 1,817 | 3.453125 | 3 | [] | no_license | #include "DataAnalysis.h"
//empty constructor
DataAnalysis::DataAnalysis()
{
}
//empty destructor
DataAnalysis::~DataAnalysis()
{
mCsvStream.close();
}
//runs the analisys application
void DataAnalysis::runAnalysis(void)
{
openFile();
readFile();
writeTrends();
}
//opens the file stream
void... | true |