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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b9056ff03b1f233eb08d02c44f8c1623900dde6b | C++ | arthurteisseire-epitech/CPP_rtype_2019 | /server/src/engine/protocol/TypeProtocol.hpp | UTF-8 | 884 | 2.59375 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2019
** rtype
** File description:
** TypeProtocol.hpp
*/
#ifndef RTYPE_TYPEPROTOCOL_HPP
#define RTYPE_TYPEPROTOCOL_HPP
#include <unordered_map>
#include <string_view>
#include "CBulletType.hpp"
namespace ecs
{
class TypeProtocol {
public:
enum Type {
SHIP_NORMAL,
... | true |
8cfdeb9f0f03521482f5c8b3fdc4e33fc75b2f2c | C++ | theAnton-forks/Competitive-Programming-Portfolio | /Match/src.cpp | UTF-8 | 761 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
typedef long long ll;
const int maxn = 1e6 + 1e2;
int n;
std::string s;
std::string assigned;
bool works(){
std::stack<char> sc;
for(int i = 0; i < n; i++){
if(assigned[i] == '('){
sc.push(s[i]);
} else if(assigned[i] == ')'){
if(sc.empty() or sc.top() != s[i]){
return false... | true |
44b2c9e590b58bc4700f5841d97fe931baf83c1f | C++ | bieddes-blade/CBS-2021 | /ctSolution.h | UTF-8 | 1,538 | 2.546875 | 3 | [] | no_license | #ifndef CTSOLUTION_H
#define CTSOLUTION_H
#include "search.h"
#include "ctNode.h"
#include "pairVert.h"
#include <queue>
#include <vector>
// a comparator for comparing constraint tree nodes
struct CompareCBS {
bool operator()(CTNode& one, CTNode& two) {
return one.cost < two.cost;
}
};
// an object... | true |
67490022b8ee7adb61dbeb47ef8532ffed20edd4 | C++ | welkin-qing/C | /c语言代码/其他/指向指针.cpp | UTF-8 | 273 | 2.84375 | 3 | [] | no_license | #include<stdio.h>
main()
{
char *name[]={"forgive",
"forget",
"remeber",
"togher"
};
char **p=name;
printf("%s\n",*p);
printf("%c\n",**p);
printf("%s\n",*(p+1));
printf("%c",*(*(p+1)+2));
}
| true |
061d61638ca260099f75fa2534eb5c7451b37da1 | C++ | exnotime/NaiveEngine | /source/gfx/MaterialBank.cpp | UTF-8 | 4,204 | 2.5625 | 3 | [] | no_license | #include "MaterialBank.h"
#include <fstream>
#include <assimp/scene.h>
#include "Model.h"
#include "Material.h"
#include "gfxutility.h"
gfx::MaterialBank::MaterialBank() {
}
gfx::MaterialBank::~MaterialBank() {
ClearMaterials();
}
gfx::MaterialBank& gfx::MaterialBank::GetInstance() {
static MaterialBank m_Bank;
re... | true |
ccdf89c431a691e500dad5d291f3d2f2449ac75c | C++ | i7sharath/geeks4geeks | /Trees/65_SerializeDeserialize.cpp | UTF-8 | 2,153 | 3.515625 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct TreeNode
{
int data;
TreeNode *left,*right;
};
TreeNode *createNewNode(int data)
{
if(data==-1)
return NULL;
TreeNode *newNode=(TreeNode*)malloc(sizeof(TreeNode));
newNode->data=data;
newNode->left=NULL;
newNode->right=NULL;
return newNode;
}
TreeNode *... | true |
329d0921692fa60868d3e6fb02a6586ea9d2b7ad | C++ | loading21th/stl_test | /settest.cpp | UTF-8 | 989 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <set>
#include<utility>
using namespace std;
void settest(){
set<int> settest;
set<int>::iterator it;
set<int>::iterator it1;
pair<set<int>::iterator,bool> insetr_pair;
if (settest.begin()==settest.end())
{
cout<<"this is empty!\n";
}
for (int i=1;i<10;i++)
{
insetr_pair=settes... | true |
db75db3c1bc0bf88636321a66fc70fe74f4b420e | C++ | akv25710/Coding | /Array/maxLengthBitonic.cpp | UTF-8 | 623 | 3.5 | 4 | [] | no_license | #include<iostream>
using namespace std;
int maxLengthBitonic(int ar[], int low, int high){
if(low>high) return 0;
if(low==high) return 1;
if(ar[low]<=ar[low+1]) return 1+maxLengthBitonic(ar,low+1,high);
if(ar[high]<=ar[high-1]) return 1+maxLengthBitonic(ar,low,high-1);
if(ar[low]>ar[low+1]) return maxLengthBitoni... | true |
1699e07d365701786cba0ffcd2ee02b008f6932f | C++ | suhwanhwang/problem-solving | /google/2017/qr/c/c.cpp | UTF-8 | 4,024 | 2.96875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <cassert>
#include <ctime>
using namespace std;
typedef long long ll;
pair<ll, ll> solution2(ll n, ll k) {
auto cmp = [](pair<ll, ll> l, pair<ll, ll> r) {
return l.second - l.first < r.se... | true |
7da3d383a56cec7fa5ca612f014c199d53cae66c | C++ | AntraJoshi/Programs | /Patterns/Pattern15.cpp | UTF-8 | 342 | 2.671875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int i,j,n,k;
cin>>n;
for(i=0;i<n/2+1;i++){
for(j=0;j<n/2-i;j++)
cout<<" ";
for(k=1;k<=(i*2)+1;k++)
cout<<k;
cout<<"\n";
}
for(i=0;i<n/2;i++){
for(j=0;j<i+1;j++)
cout<<" ";
for(k=1;k<=(n/2-i)*2-1;k++)
cout<<k;
cout<<"\n";
... | true |
9200743cea6885e2a53ddbdafc24d3e354e6256d | C++ | Sefjor/home-light | /sketch_jun05b.ino | UTF-8 | 1,353 | 2.609375 | 3 | [] | no_license | #include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
RF24 radio(9,10);
int role = 1; // 1=tranciever, 2=reciever
void setup()
{
Serial.begin(9600);
Serial.println("BEGINNING");
pinMode(7, OUTPUT);
radio.begin();
if ( role == 1)//tranciever
pinMode(6, INPUT);
radio.openWritingPipe(0xF0F0F0E0E1LL)... | true |
fb56cb9162708ab802a763b27a39c993f3197dfb | C++ | trv001/lab3-bst | /Sequence.h | UTF-8 | 659 | 3.171875 | 3 | [] | no_license | #pragma once
#include "DynamicArray.h"
#include "LinkedList.h"
template <class T> class Sequence {
public:
virtual T GetFirst() const = 0;
virtual T GetLast() const = 0;
virtual T Get(int index) const = 0;
virtual int GetLength() const = 0;
virtual int GetReserved() const ... | true |
96742d4ab5c30e126253e2e0bdba14e4b5214403 | C++ | 2020lwy/CppPratice | /C++/ref.cpp | UTF-8 | 336 | 3.203125 | 3 | [] | no_license | #include <iostream>
void print(int &a,int &b){
std::cout << "a = " << a << std::endl;
std::cout << "b = " << b << std::endl;
a = 1000;
b = 120;
}
int main(void){
int a = 100;
int b = 200;
print(a,b);
std::cout << "a = " << a << std::endl;
std::cout << "b = " << b << std::endl;
... | true |
f60f10fc0470e6cc28277d9083077483c9ffab53 | C++ | gdgf/PAT-Practice | /BPAT/Bpat1072_error.cpp | UTF-8 | 998 | 2.765625 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#include<set>
#include<map>
using namespace std;
struct info{
string name;
int data[100];
int count=0;
};
int main(){
int N,M;
cin>>N>>M;
//scanf("%d %d",&N,&M);
set<int> goods;
for(int i=0;i<M;i++){
int temp;
cin>>temp;
goods.i... | true |
9157543b826aa8320bbf2134cff6611af1a8d6a9 | C++ | cbmeeks/CLK | /Machines/AppleII/Video.cpp | UTF-8 | 3,962 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// Video.cpp
// Clock Signal
//
// Created by Thomas Harte on 14/04/2018.
// Copyright 2018 Thomas Harte. All rights reserved.
//
#include "Video.hpp"
using namespace AppleII::Video;
namespace {
struct ScaledByteFiller {
ScaledByteFiller() {
VideoBase::setup_tables();
}
} throwaway;
}
VideoBase::VideoB... | true |
a5de826af90e442e502ef534caabfcc567e885a2 | C++ | karan-saj/Data_Structure_Practise | /ll_merge.cpp | UTF-8 | 1,950 | 3.953125 | 4 | [] | no_license | #include<iostream>
using namespace std;
struct node // Create linked list structure
{
int d;
node *next;
};
node *head=NULL; //Initialise head = NULL
node *head1=NULL; //Initialise head1 = NULL
node *hed=NULL;
class Linked_List
{
public:
void insert(int nu,int c) //Insert node at end of list
{
if(c==1)
{
... | true |
d72e0be13cbf6424ad8071b0a68cf1f87b1022f9 | C++ | GH2005/myLeetcodeSolutions | /485. Max Consecutive Ones.cpp | UTF-8 | 312 | 2.890625 | 3 | [] | no_license | class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int res = 0;
int currConsecutive = 0;
for (int value : nums)
{
if (value == 0) currConsecutive = 0;
else res = max(res, ++currConsecutive);
}
return res;
}
};
| true |
9aa73ee17498e32049b5f7e507a0a799cf07e6b7 | C++ | qawbecrdtey/BOJ-sol | /problems/acmicpc_14614.cpp | UTF-8 | 175 | 2.625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
using namespace std;
int main() {
int a, b; string c;
cin >> a >> b >> c;
if((c.back() - '0') & 1) cout << (a ^ b);
else cout << a;
} | true |
0cd5e2cdb174e42f476d54ec2a840d48aad86ef7 | C++ | herzbube/libsgfcplusplus | /src/parsing/propertyvaluetypedescriptor/SgfcPropertyComposedValueTypeDescriptor.h | UTF-8 | 3,670 | 2.515625 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"BSL-1.0"
] | permissive | // -----------------------------------------------------------------------------
// Copyright 2020 Patrick Näf (herzbube@herzbube.ch)
//
// 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
//
//... | true |
aef130e2edd7dc81224fc54671a3ca34353cc30d | C++ | Aura-zx/zhx-Leetcode | /LeetCode/215_Kth_Largest_Element_in_an_Array.h | UTF-8 | 1,011 | 3.46875 | 3 | [] | no_license | #ifndef KTH_LARGEST_ELEMENT_IN_AN_ARRAY_H
#define KTH_LARGEST_ELEMENT_IN_AN_ARRAY_H
#include <vector>
class Solution_215
{
private:
void swap(std::vector<int>& nums, int i, int j)
{
int temp = nums[i];
nums[i] = nums[j];
nums[j] = temp;
}
int QuickSelect(std::vector<int>& nums, int k, int start, int end)
... | true |
f68a15ba0377e18f12db0d95150afe0d0949644d | C++ | jpugliesi/PA6 | /Die.h | UTF-8 | 242 | 2.8125 | 3 | [] | no_license | //Die.h
#ifndef DIE_H
#define DIE_H
class Die{
private:
int numSides; //number of sides on the die
public:
//constructors
Die();
~Die();
//functions
int rollDie(); //generates and returns random value between 1 and 6
};
#endif | true |
79b3e7097319c7b3f1a06223937101db1cd4602f | C++ | octavio1594/Intermediate-Level-Course-work | /Lab8/Lab8b.cpp | UTF-8 | 1,084 | 4.21875 | 4 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
bool isFibonacci(int num);
long fib(int n);
int main()
{
int num;
cout << "Enter a number (enter a negative number to quit): ";
cin >> num;
while (num >= 0)
{
if (isFibonacci(num) == true)
cout << "Yes, you got it, " << num ... | true |
fe5913bce3cc04eb6c2e6b39657291521fa0eac6 | C++ | Sackdima/msu_spring_2019 | /03/matrix.h | UTF-8 | 666 | 3.421875 | 3 | [] | no_license | #pragma once
#include <cstdlib>
class Matrix
{
private:
size_t rows;
size_t columns;
int *matrix;
public:
class Row
{
private:
size_t columns;
int *row_ptr;
public:
Row(int *row, size_t cols);
int &operator[](size_t index);
const int &operator[](size_t index) const;
};
Matrix(size_t rows_count = ... | true |
4de00dd77984c7801df776a2461191824d6de44f | C++ | Sadman007/DevSkill-Programming-Course---Basic---Public-CodeBank | /DevSkill_CP/Advanced/Batch 3/Class 25/nPr.cpp | UTF-8 | 865 | 2.8125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
/**
1) DP optimization --> i) D&C ii) Knuth iii) Alien Trick iv) CHT (Convex Hull Trick)
2) Sibling DP
3) Interval DP
4) Tree DP
5) Graph DP
**/
bool checkBit(int n, int pos)
{
int val = n & (1 << pos);
return val > 0;
}
int setBit(int n, int p... | true |
7930372a04df203ea7ad2fac56f920cdaec766b3 | C++ | zachnicoll/cpp-video-app | /src/gui/rect/rect.cpp | UTF-8 | 838 | 3.125 | 3 | [] | no_license | #include "../gui.hpp"
Rect::Rect(float _x1, float _y1, float _x2, float _y2, void (*on_click)())
{
x1 = _x1;
y1 = _y1;
x2 = _x2;
y2 = _y2;
OnClickFunc = on_click;
}
void Rect::Draw()
{
float height = this->y1 - this->y2;
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_QUADS);
// top left
glTexCoord2f(0.0f,... | true |
0dde45f0e687a58d7a88475f64366b47f6b00659 | C++ | fabianchis/integra | /IntegraTEC/CE-Experience2019/CE-Experience2019.ino | UTF-8 | 3,218 | 2.796875 | 3 | [] | no_license |
//ESTOS SON LOS LEDS
int ledRojo = 10;
int ledAzul = 13;
int ledVerde = 11;
int ledAmarillo = 12;
//ESTOS SON LOS BOTONES
int botonRojo = 8;
int botonAzul = 9;
int botonVerde = 7;
int botonAmarillo = 6;
//ESTOS SON LOS CABLES
int cable1 = 3;
int cable2 = 5;
int cable3 = 2;
int cable4 = 4;
int... | true |
29f65eafff01b8502f6dd0f3a47558684033fc42 | C++ | cartmanie/leetcode | /algorithms/ValidateBinarySearchTree/Solution.cpp | UTF-8 | 2,213 | 3.609375 | 4 | [] | no_license | /**
* 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:
bool isValidBST(TreeNode* root) {
if (root == NULL)
{
return tr... | true |
00f6a087a3c11bd308ecc5081d56d03abcb4d43e | C++ | decipher07/Payroll-Mangement | /Project_Payroll_Mangement.cpp | UTF-8 | 26,545 | 2.859375 | 3 | [] | no_license | #include <iostream.h>
#include <fstream.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <dos.h>
class MENU {
public:
void MAIN_MENU();
void EDIT_MENU();
void INTRODUCTION();
}
M;
class EMPLOYEE {
public:
void NEW_EMPLOYEE();
void M... | true |
229a9acd13c36f70c79d731c0f409366e833ed25 | C++ | ueclectic/Quiz | /Quiz/player.h | UTF-8 | 360 | 2.8125 | 3 | [] | no_license | #pragma once
#include <string>
namespace quiz {
class Player
{
public:
Player(std::string firstName, std::string lastName);
~Player();
std::string getFirstName() const;
std::string getLastName() const;
int getScore() const;
void addPoints(const int points);
private:
std::string firstName_;
std::... | true |
2bf228fe63ebcbde1026c0ca7a7d48d402cec388 | C++ | someonefighting/test | /mytest/StaveDetection.h | UTF-8 | 1,932 | 2.59375 | 3 | [] | no_license | #ifndef StaveDetection_HEAD
#define StaveDetection_HEAD
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include<vector>
#include <iostream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "NoteHead.h"
#include "StavePeaks.h"
#include"... | true |
2d9355999549a417c730eabaf23d916ee16a60a8 | C++ | gjones1911/GraphUtilities | /node.h | UTF-8 | 1,034 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
using namespace std;
//a node in a graph
class node
{
public:
//public data
vector<int> adj; //the adjacent list for the node
int v; //the nodes visited field
node * next;
node * p... | true |
d032d7b00bf74a6b733b5d27a6b1c6f0e4608265 | C++ | 1980744819/ACM-code | /2017.12.28/My-RegexEngine-master/main.cpp | UTF-8 | 1,103 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | #include "RE.h"
#include <iostream>
using namespace std;
int main()
{
RE re("ab|abcde");
string test_str;
test_str = "abcde";
if (re.match(test_str))
cout << test_str << "ƥ��ɹ�" << endl;
else
cout << test_str << "ƥ�䲻�ɹ�" << endl;
test_str = "abcd";
if (re.match(test_str))
cout << test_str << "ƥ��ɹ�" <<... | true |
27a9eac930df7da695cd9a21a39d2745e5799bb8 | C++ | patryk7891/jimp2 | /lab4/geometry/Point.cpp | UTF-8 | 850 | 3.5 | 4 | [] | no_license | //Definicja znajduje się w pliku Point.cpp
#include <cmath>
#include <ostream>
#include "Point.h"
namespace geometry {
using ::std::ostream;
using ::std::endl;
using ::std::pow;
using ::std::sqrt;
/* Aby wskazać, ze definicja funkcji dotyczy metody danej klasy
stosujemy tzw. operator zasięgu - "::"... | true |
f196e92d74d782a37dd36fee7f78390f1a31b371 | C++ | NicoG60/OpenOrganigram | /src/Control/ModInst/f_ModInst_Ope.cpp | UTF-8 | 2,967 | 2.515625 | 3 | [] | no_license | //-------------------------------------------------------------------------------
/**
* @file f_ModInst_Ope.cpp
* @brief Fenetre de modification d'une insturction
*
* @author N.Jarnoux
* @author STS IRIS, Lycée Nicolas APPERT, ORVAULT (FRANCE)
* @since 04/03/14
* @version 1.0
* ... | true |
8a994c7911e26ff5d2e0167bfd3e56535bfe0914 | C++ | TinSlam/ProblemSolver | /ProblemSolver/ClassicalSearch/Algorithm/SearchAlgorithm.cpp | UTF-8 | 353 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | #include "SearchAlgorithm.h"
std::list<Action*>* SearchAlgorithm::constructPath(SearchNode* node){
std::list<Action*>* path = new std::list<Action*>();
if(node != nullptr){
while(node->getParent() != nullptr){
path->push_front(node->getAction());
SearchNode* temp = node->getParent();
delete(node);
nod... | true |
b86da33e8833a28837b637d99b65311f6c2cfed1 | C++ | keelimeguy/Darnel-Engine | /Darnel/include/Renderer/Renderer.h | UTF-8 | 2,550 | 2.875 | 3 | [] | no_license | #pragma once
#include "Window.h"
#include "VertexArray.h"
#include "VertexBuffer.h"
#include "VertexBufferLayout.h"
#include "IndexBuffer.h"
#include "Shader.h"
#include <glm/glm.hpp>
namespace darnel {
class RendererAPI {
public:
enum class API {
None = 0,
OpenGL3
};... | true |
95d3477136a7af6a79fea7dcd20e15dcd570a210 | C++ | 7956968/CameraExperiment | /videoframe.cpp | UTF-8 | 922 | 2.78125 | 3 | [] | no_license | #include "videoframe.h"
VideoFrame::VideoFrame(QObject *parent): QObject(parent), m_surface(nullptr)
{
registerMetaType();
}
VideoFrame::VideoFrame(const QByteArray & data, const int & width, const int & height, QObject * parent) : VideoFrame(parent)
{
m_surface.reset(new Surface(data, width, height));
}
Vid... | true |
82357e48c41f1af13568fa64f06310595b6ec51a | C++ | harshmehra31/MyCodeTree | /mycodeschool/factorial.cpp | UTF-8 | 676 | 3.21875 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
/* Include other headers as needed */
int pow(int a,int b){
int t=1;
while(b){
if(a>0){
t*=a;
}
else if(a<0){
t/=a;
}
else
{
return 1;
}
b--;
}
return t;
};
int main()
{
int count,i,loop_count,x,number;
printf("Enter ... | true |
ae41218bf423924ddaf3b9087bfa2c98caf23b0c | C++ | Alvaro9366/Bomberman | /Source/Jugador.cpp | WINDOWS-1250 | 3,316 | 2.953125 | 3 | [] | no_license | #include "../Headers/Jugador.h"
#include "../Headers/Escenario.h"
Jugador::Jugador(int x, int y) {
//Posicin del jugador
this->x = x;
this->y = y;
//Desplazamiento del jugador
dx = 0;
dy = 0;
//Animacin del sprite
ancho = 17;
alto = 26;
indiceX = 0;
indiceY = 0;
direccion = Direcciones::Ninguna;
ulti... | true |
2640a83c89f3425e85afde930c27a6253f4d46f6 | C++ | rpringst/ProjectEulerCPP | /problem9.cpp | UTF-8 | 735 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <vector>
struct Triples{
int _a, _b, _c;
Triples(int a, int b, int c) : _a(a), _b(b), _c(c) {}
int sum() {return _a + _b + _c;}
int product() {return _a * _b * _c;}
};
bool pSq(int n, double& sq){
sq = sqrt(n);
return sq == floor(sq);
}
int main(v... | true |
8ee30ef4b0f0f41808945be382e80e19d9457644 | C++ | ceosss/dsa | /tree/tree.h | UTF-8 | 1,590 | 3.875 | 4 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
class Tree
{
public:
Tree *left;
int data;
Tree *right;
void create();
void inorder(Tree *);
void preorder(Tree *);
void postorder(Tree *);
} * root;
Tree *newTreeNode(int n)
{
Tree *newnode = new Tree();
newnode->left = NULL... | true |
57a9fffbbf7411d403d95f51fc29f045dea09622 | C++ | 213519433/Tut2 | /Fraction tut/Main.cpp | UTF-8 | 1,619 | 3.359375 | 3 | [] | no_license | /*****************************
* Fraction Program : Class *
*****************************/
#include <iostream>
#include <string>
#include <math.h>
#include "Fractions.h"
using namespace std;
int main()
{
int Nunom1, Dnom1, Nunom2, Dnom2;
cout << endl << endl << " Testing of Fractions Class" << endl << " ======... | true |
e55236e6f7459c7e11c452729d400ee527e0120e | C++ | sp9103/Koistudy_solution | /quiz/Q1.cpp | WINDOWS-1252 | 503 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(){
srand(time(NULL));
int arr[20];
int ans[20];
for(int i = 0; i < 20; i++){
arr[i] = rand() % 100;
printf("%d\t", arr[i]);
}
//
int max;
int idx = -1;
for(int i = 0; i < 20; i++){
max = -1;
for(int j = 0; j < 20; j++){
if(max <... | true |
df0f7c347587bc431d8e465c75b3a6133639540a | C++ | Apexsf/DES | /des.hpp | GB18030 | 2,066 | 3.40625 | 3 | [] | no_license | #ifndef DES_H
#define DES_H
#include <bitset>
#include <vector>
#include <iostream>
using namespace std;
class DES {
public:
using bit64 = bitset<64>;
using bit56 = bitset<56>;
using bit48 = bitset<48>;
using bit32 = bitset<32>;
using bit28 = bitset<28>;
DES(bit64 key);... | true |
3d4bf5506142bac035a9bcefbd02ffa0dd72a61e | C++ | andresyusti/Practica04 | /proyecto04/enrutador.h | UTF-8 | 678 | 2.5625 | 3 | [] | no_license | #ifndef ENRUTADOR_H
#define ENRUTADOR_H
#include <iostream>
#include <string>
#include <map>
#include <sstream>
#include<fstream>
#include<ostream>
#include <list>
#include <cstdlib>
#include<time.h>
using namespace std;
class enrutador
{
private:
map<char,int> router;
map<char,int>::iterator it;
//map<... | true |
8ab5c6f1f7f750f1c8d27c7b57c553d874e42b2c | C++ | singhdharmveer311/PepCoding | /Level-1/11. Time and Space Complexity/Selection_Sort.cpp | UTF-8 | 884 | 3.546875 | 4 | [
"Apache-2.0"
] | permissive | #include <bits/stdc++.h>
using namespace std;
bool isSmaller(vector<int> &arr, int i, int j) {
cout << "Comparing " << arr[i] << " and " << arr[j] << endl;
if (arr[i] < arr[j]) {
return true;
} else {
return false;
}
}
void swap(vector<int> &arr, int i, int j) {
cout << "Swapping " << a... | true |
fc3d3fbe49d6922497648a8da0c364e8ca9ed82d | C++ | pasirin/BTVN | /BTVN/Tuần 2/Untitled-2.cpp | UTF-8 | 880 | 3.1875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct NS{
int ngay, thang, nam;
NS(int ng, int th, int n){
ngay =ng;
thang=th;
nam = n;
};//ham tao co doi
NS () {};//ham tao khong doi
void nhapdl ()
{
char ch;
cin>>ngay>>ch>>thang>>ch>>nam;
... | true |
fd05b6553e77052bd8e1c81cd909ebcf46117a1f | C++ | anuragroy11/GeeksForGeeks | /SudoPlacements/Hash/09.CheckContiguous.cpp | UTF-8 | 673 | 3.015625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool isContiguous(vector<int> a) {
int min = *min_element(a.begin(), a.end());
int max = *max_element(a.begin(), a.end());
for (int i = min; i <= max; i++) {
if (find(a.begin(), a.end(), i) == a.end())
return false;
}
retur... | true |
7a02709780fc210e9bc7ba10a5b6b56733d0263d | C++ | SnowFleur/Coding-Test-Collection | /백트래킹/[백준] 15649 N과M.cpp | UHC | 802 | 3.546875 | 4 | [] | no_license | #include<iostream>
#include<vector>
/*
N: 1 N
M: ߺ
*/
int g_N, g_M;
std::vector<int> g_v;
std::vector<bool> g_visited;
void BackTracking(int curr) {
//curr 4̸
if (curr > g_M) {
for (const auto& i : g_v)
std::cout << i << " ";
std::cout << "\n";
return;
}
//ݺ Ѵ
for (int i = 1; i <= g_N; ++i) {
//... | true |
448d70a9b2b9f964b018d15c1fa0b8e0a28ebfae | C++ | marcoafo/OpenXLSX | /OpenXLSX/sources/XLDateTime.cpp | UTF-8 | 7,104 | 3.21875 | 3 | [
"BSD-3-Clause"
] | permissive | //
// Created by Kenneth Balslev on 28/08/2021.
//
#include "XLDateTime.hpp"
#include "XLException.hpp"
#include <string>
#include <cmath>
namespace {
/**
* @brief
* @param year
* @return
*/
bool isLeapYear(int year) {
if (year == 1900) return true;
if (year % 400 == 0 ||... | true |
06bfd2583685c42fcab170fbf1bd6706443196d8 | C++ | ramaym13/Arduino | /Modul 1/2a/2a.ino | UTF-8 | 330 | 2.796875 | 3 | [] | no_license | int ledred = 12;
int i;
void setup() {
// put your setup code here, to run once:
pinMode(ledred, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
for(i=0; i<=255; i+=5){
digitalWrite(ledred, i);
delay(100);
}
for(i=255; i>=0; i-=5){
digitalWrite(ledred, i);
delay(10... | true |
98d785945bade9caf09b57809fa6a290928efd4d | C++ | USEPA/OME | /include/OMERuntime/omeobjects/EvalTable.h | UTF-8 | 3,208 | 2.78125 | 3 | [] | no_license | #pragma once
#include "XMLLoadable.h"
#include "OMEDefines.h"
/** Table of values that can be accessed by Evaluable expressions.*/
class __EXPORT__ EvalTable : public XMLLoadable
{
public:
typedef ARRAY_TYPE<OME_SCALAR> DataArray; ///< Type that contains a list of values.
EvalTable();
EvalTable(const STLString &... | true |
bf1b3cfe03da3c806efde2c11a868d1d382c91ec | C++ | itiievskyi/42-CPP-Pool | /day00/ex01/Contact.class.hpp | UTF-8 | 2,119 | 2.5625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Contact.class.hpp :+: :+: :+: ... | true |
7e8506efc9cfa759c28e6ca80521105221d4ae88 | C++ | TMalicki/ParticleSystem | /windowSettings.cpp | UTF-8 | 5,042 | 2.546875 | 3 | [] | no_license | #include "windowSettings.h"
windowSettings::windowSettings(sf::RenderWindow& window, float border) : m_gui{ window }, m_type{ ParticleType::Vertex }
{
auto windowSize = sf::Vector2f{ static_cast<float>(window.getSize().x), static_cast<float>(window.getSize().y) };
m_activeWindowSize = sf::Vector2f{ windowSize.x... | true |
5ad78dcc7ab8d65849bc1c093364394d4b9e4fa5 | C++ | kozel-stas/TIIT | /Lab3TIIT/Lab3TIIT/Lab3TIIT.cpp | WINDOWS-1251 | 2,113 | 3.203125 | 3 | [] | no_license | // Lab3TIIT.cpp: .
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
string *Source, *dopSource,*CutStr1,*CutStr2;
int NumberofSource = 0;
void Add (string str);
void Cut(string str1, string str2);
string *Cutting(string str);
int main()
{
setlocale(LC_ALL, "rus");
bool Cycle... | true |
138ea9a99988f70931acf26d813e8534b9f4b0a3 | C++ | kanikakala02/DAA | /week6/problem2.cpp | UTF-8 | 1,132 | 3.703125 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector <int> g[100];
void bfs(int *color,int curr,int src)
{
queue <int> q;
color[src]=curr;
q.push(src);
while(!q.empty())
{
int f=q.front();
q.pop();
if(color[f]==1)
curr=2;
else
curr=1;
for(auto j:g[f])
{
... | true |
3e7903809c6dae6aac4c67313ade12e263368b19 | C++ | vincentfiestada/CacheLoadSim.Win32 | /Cache Load Sim For Win32/Cache Load Sim For Win32.cpp | UTF-8 | 3,301 | 2.90625 | 3 | [] | no_license | // Cache Load Sim For Win32.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "Cache.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
// Initialize
vector<DataChunk> MainMemory;
int size = 0;
int mapalgo = 1;
int repalgo = 0;
int mainme... | true |
f36e72d398133ce429e11cd4d33bcf1cf54bc051 | C++ | proqk/Algorithm | /BruteForce/7568 덩치_cpp.cpp | UTF-8 | 707 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool cmp(pair<int, int>& a, pair<int, int>& b) {
if (a.first == b.first) return a.second > b.second;
else return a.first > b.first;
}
int main() {
int n;
cin >> n;
vector<pair<int, int>> v; // v(51)로 범위를 잡아버리면 제대로 출력 안 됨 왜지?
for (in... | true |
4220ac0e7f0d772ca0dd12e83b1c2ca758073b7b | C++ | SifuUA/Picine-CPP | /day05/ex00/main.cpp | UTF-8 | 877 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include "Bureaucrat.h"
int main() {
Bureaucrat bureaucrat = Bureaucrat("BILL", 145);
std::cout << bureaucrat << std::endl;
try {
for (int i = 0; i < 13; ++i) {
bureaucrat.decrement();
}
}catch (std::exception &e) {
std::cout << "Exception catched... | true |
29120df8af744ee42298b8dee672720baee43bac | C++ | vuyyurii/decaffcompiler | /Phase-3/genera.h | UTF-8 | 745 | 2.796875 | 3 | [] | no_license | #ifndef CODEGEN_H
#define CODEGEN_H
#include "ClassDefs.h"
class Codegen : public Codegenerator{
public:
static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction, const std::string &VarName, string type) {
/* Allocates memory for local variables on the stack of the function */
/* Get the builder for c... | true |
7b2ac0f07e535aa62b89b4f82f2e8a1c7049f7cc | C++ | sequeto/ED2 | /Trabalho Fase 2/main.cpp | UTF-8 | 2,575 | 2.65625 | 3 | [] | no_license | /**
UNIVERSIDADE FEDERAL DE JUIZ DE FORA
INSTITUTO DE CIÊNCIAS EXATAS
DEPARTAMENTO DA CIẼNCIA DA COMPUTAÇÃO
TRABALHO DE ESTRUTURA DE DADOS 2(||) - 2020.3 (ERE)
PROF.DR.MARCELO CANIATO RENHE
GRUPO:
BEATRIZ CUNHA RODRIGUES MAT 201776038
IVANYLSON HONORIO GONÇALVES MAT 201776002
... | true |
8c68c08fbad32159411af3dceb4dc031a85990a7 | C++ | BiteSnail/BaekJoon | /BaekJoon/5052.cpp | UTF-8 | 1,091 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int T;
int N;
string phoneNumbers[10010];
typedef struct TRIE{
bool is_end = false;
struct TRIE *child[10] = {0, };
}TRIE;
//911
bool isPrefix(int I, TRIE *cur, string & phoneNumber){
if(I==phoneNumber.length()){
cu... | true |
851ad231e25f61e7aa55c1ac8f1ae2bc153028f6 | C++ | fazhang/myLeetCode | /leetCode/backup/3.cpp | UTF-8 | 1,001 | 3.375 | 3 | [] | no_license | https://leetcode.com/problems/longest-substring-without-repeating-characters/
class Solution {
public:
int lengthOfLongestSubstring(string s) {
//最长不重复子串。 一维动态规划
//dp 的定义是, 以当前item 结尾的最长不重复串是多长
int strLen = s.size();
vector<int> dp(strLen,1);//至少是1
//需要一个辅助数组,记录某个字符,最后一次出现的... | true |
801516906225820cbc774a5f340873ecb87aeeb2 | C++ | pampersrocker/MathLib | /MathLib/MathLibUnitTest/AABBtpl2DTest.cpp | UTF-8 | 2,836 | 2.578125 | 3 | [] | no_license | #include "stdafx.hpp"
#include "CppUnitTest.h"
#include "Vector2.hpp"
#include "ClassicalMechanics/Volumes/AABB.hpp"
using namespace ClassicalMechanics::Volumes;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
template class __declspec ( dllexport )LinearMath::Vector2_tpl< float >;
template class __de... | true |
ccd21c14c0a31f42ea9472e41e1e88d7bf41ce4e | C++ | Etherealblade/CLRS | /Chapter 6/MinHeap/MinHeap/main.cpp | UTF-8 | 517 | 3.421875 | 3 | [] | no_license | // MinHeap.cpp : This file contains the 'main' function. Program execution begins and ends there.
// https://www.geeksforgeeks.org/binary-heap/
#include <iostream>
#include "MinHeap.h"
using namespace std;
// Driver program to test above functions
int main()
{
MinHeap h(11);
h.insertKey(3);
h.insertKey(2);
h.de... | true |
2fc3ee8182b0bb1d7c0942cc9db450ab823482a2 | C++ | andyvans/Arduino | /first-robot/first-robot.ino | UTF-8 | 3,958 | 2.953125 | 3 | [] | no_license | #include <Servo.h> //include Servo library
const int dangerThresh = 10; //threshold for obstacles (in cm)
int leftDistance, rightDistance; //distances on either side
Servo panMotor;
long duration; //time it takes to recieve PING))) signal
#define trigPin 13
#define echoPin 12
// Motor 1
int dir1PinA = 2;
int dir2... | true |
5f34ae4e1215e8be8ced074c4b6f8c08399e1327 | C++ | Saransh-kalra/Data-Structures-Lab | /LinkedListLecture/LinkedListLecture/LinkedList.hpp | UTF-8 | 845 | 3.078125 | 3 | [] | no_license | //
// LinkedList.hpp
// LinkedListLecture
//
// Created by Saransh Kalra on 9/28/18.
// Copyright © 2018 Saransh Kalra. All rights reserved.
//
#ifndef LinkedList_hpp
#define LinkedList_hpp
#include <stdio.h>
class Node {
int datum;
Node *next;
public:
Node(int);
// we do not need a descructo... | true |
480634acc1b832968db19a5368ea635a5ba29b20 | C++ | neiljonlouie/project-euler | /solutions/0000-0009/euler_0009.cpp | UTF-8 | 875 | 3.03125 | 3 | [] | no_license | #include <iostream>
void generate_triplet(int m, int n, int& a, int& b, int &c) {
a = m * m - n * n;
b = 2 * m * n;
c = m * m + n * n;
}
int main(int argc, char **argv) {
int a, b, c, d, desired = 1000;
bool done = false;
for (int n = 1; n <= 25; n++) {
for (int m = n + 1; m <= 25; m++... | true |
5b762fe72e93f9410671eb6269ca6832e63d4741 | C++ | xiaokimi/RayTracing | /RayTraceDemo/src/PerlinNoise.cpp | UTF-8 | 2,235 | 2.953125 | 3 | [] | no_license | #include "rtpch.h"
#include "PerlinNoise.h"
PerlinNoise& PerlinNoise::getInstance()
{
static PerlinNoise m_Noise;
return m_Noise;
}
float PerlinNoise::getNoise(const Point3& point) const
{
float u = point.x() - std::floorf(point.x());
float v = point.y() - std::floorf(point.y());
float w = point.z() - std::floor... | true |
28c72623824e72aab90295aa4dea9c3f8e97e4cc | C++ | Jeblas/Parallel-Fourier-Transforms | /src/complex.cc | UTF-8 | 1,300 | 3.171875 | 3 | [
"MIT"
] | permissive | #include "complex.h"
#include <cmath>
const float PI = 3.14159265358979f;
Complex::Complex() : real(0.0f), imag(0.0f) {}
Complex::Complex(float r) : real(r), imag(0.0f) {}
Complex::Complex(float r, float i) : real(r), imag(i) {}
Complex::Complex(const Complex & rhs) : real(rhs.real), imag(rhs.imag) {}
Complex Com... | true |
313aa8e98b74fef91f432a402602487cd492cae3 | C++ | sosswald/nao_calibration | /src/data_capturing/MarkerDetection.cpp | UTF-8 | 1,377 | 2.515625 | 3 | [] | no_license | /*
* MarkerDetection.cpp
*
* Created on: 22.12.2013
* Author: stefan
*/
#include "../../include/data_capturing/MarkerDetection.h"
#include <cv_bridge/cv_bridge.h>
#include <ros/ros.h>
#include <sensor_msgs/image_encodings.h>
namespace kinematic_calibration {
using namespace std;
namespace enc = sensor_ms... | true |
0f34aa67631c8361dbc798973f9d917081406e3e | C++ | zzzbf/PAT | /PAT_A1166.h | UTF-8 | 1,484 | 2.828125 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
int parent[210];
int Find(int a) {
return a == parent[a] ? a : parent[a] = Find(parent[a]);
}
void Union(int a, int b) {
int pa = Find(a);
int pb = Find(b);
if (pa != pb) parent[pb] = pa;
}
bool check(vector<vector<bool>> &isFriend, ... | true |
531854ee1a0525e6cfa6608f45f84f1b2039f211 | C++ | ZengFLab/PyroTools | /src/GenericReadBins.cpp | UTF-8 | 1,944 | 3 | 3 | [] | no_license | #include "GenericReadBins.h"
using namespace GenericSequenceTools;
#include <sstream>
void GenericReadBins_Clear_Stringstream(std::stringstream& ss)
{
ss.str(std::string());
ss.clear();
}
GenericReadBins::GenericReadBins(int binMin, int binMax, int binStep)
: m_binMin(binMin)
, m_binMax(binMax)
... | true |
4a2ef033cfbe8f9f3d35d55e30f4253bcba88e7b | C++ | kiranmuddam/leetcode | /problems/valid_palindrome/solution.cpp | UTF-8 | 904 | 3.421875 | 3 | [] | no_license | class Solution {
public:
bool isPalindrome(string s) {
if (s == " ") {
return true;
}
int startPointer = 0;
int endPointer = s.size() - 1;
while (startPointer < endPointer) {
if (!(isalpha(s[startPointer]) || isdigit(s[startPointer]))) {
... | true |
080e27e69a2bb876b034b3294b905d0995aeafef | C++ | AwkwardDev/Descent-core-scripts-3.3.5 | /src/arcemu-shared/MemManager/GarbageCollector.h | UTF-8 | 1,815 | 2.59375 | 3 | [] | no_license | #ifndef _GARBAGE_COLLECTOR_H_
#define _GARBAGE_COLLECTOR_H_
#include "Singleton.h"
//the whole point of this is to avoid using dead pointers due to thread concurency
//the solution sucks but it comes to patch an already badly syncronized system
// The idea is simple :
// instead direct delete and object we insert it... | true |
507af3839de2b54ee9adf1407229ae34297553f1 | C++ | v-biryukov/cs_mipt_faki | /term2/seminar07_move/classroom_tasks/code/1move/14return_no_rvo.cpp | UTF-8 | 1,314 | 3.765625 | 4 | [] | no_license | /*
Но что если RVO оптимизация неприменима?
Например, если мы возвращаем из функции один из его аргументов, то RVO неприменима.
Нужно ли в этом случае писать std::move при возврате из функции?
Ответ: нет, не нужно.
Дело в том, что в этом случае объект будет перемещён автоматически, даже если вы не... | true |
bf5405a967da8056d1bfe3e8377fb35ea2202692 | C++ | StSiRe/Algoritms | /Algorithms and Data Structures/Second task/second/main.cpp | UTF-8 | 6,711 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <ctime>
bool isMaxRequired = false;
float func(float x) {
if(isMaxRequired)
return -(pow(x,3)-x+exp(-x));
return pow(x,3)-x+exp(-x);
}
void PassiveSearch(float left,float right, float e)
{
srand(time(0));
int steps = 0;
float minPoint = 0;
fl... | true |
353b94c89d3361a55acdc8e5c7878aa2d43463af | C++ | sgioia9/Live-Shader | /SGraphic/Sources/worldobject.cpp | UTF-8 | 1,149 | 2.609375 | 3 | [] | no_license | #include <glm/gtc/matrix_transform.hpp>
#include "worldobject.hpp"
namespace Core {
WorldObject::WorldObject(
const std::shared_ptr<Model>& model,
const glm::mat4& transform)
: _model(model),
_transform(transform) {}
WorldObject::WorldObject(const std::shared_ptr<Model>& model)
... | true |
f7399e23d31764749ce26c54b1607ae30c86f918 | C++ | SvBoichuk/EmployeeDataManagement | /employee.cpp | UTF-8 | 655 | 3.015625 | 3 | [] | no_license | #include "employee.h"
Employee::Employee()
{
}
Employee::Employee(const EmployeeData &d)
{
data = d;
}
Employee::Employee(const QString &f_name, const QString &m_name, const QString &l_name, int range, float tariff, int shop_numb)
{
data.first_name = f_name;
data.middle_name = m_name;
... | true |
186c225f49f5b64ad0be4a011cb6cf1714572c06 | C++ | venGaza/starwars | /src/randomNumber.cpp | UTF-8 | 615 | 3.703125 | 4 | [
"MIT"
] | permissive | /*
* Function: randomNumber
* Usage: randomNumber(int min, int max)
* -------------------------
* This function takes two parameters whicha are the min and max values and returns a random number
* between those values.
*/
#include "randomNumber.hpp"
#include <random>
int randomNumber(int min, int max) {
std... | true |
f9db14b05aa5ed739220aa52a754ad11ba5fa2e8 | C++ | q4a/DirectxSample-Snowman | /d3dMySkyBox/D3DUtility.cpp | GB18030 | 8,390 | 2.625 | 3 | [] | no_license | #include "D3DUtility.h"
CD3DUtility::CD3DUtility(void)
{
_backWidth = 0;
_backHeight = 0;
_windowed = true;
_d3dDeviceType = D3DDEVTYPE_HAL;
}
CD3DUtility::~CD3DUtility(void)
{
}
void CD3DUtility::SetHW(UINT width, UINT height, bool windowed)
{
_backWidth = width;
_backHeight = height;
_windowed = windowed;
... | true |
859a9ebf07fc8ec868459bcd55eb5fcc8465230b | C++ | teodoraalexandra/Data-Structures-And-Algorithms | /DSALAB5/Heap.h | UTF-8 | 1,107 | 2.90625 | 3 | [] | no_license | //
// Created by Teodora Dan and her groupmate <3 on 2019-05-07.
//
#pragma once
#include <utility>
#include <vector>
#include "DynamicArray.h"
typedef int TElem;
using namespace std;
typedef bool(*Relation)(TElem p1, TElem p2);
//removes the last k elements from the vector (considering the relation)
//if k is le... | true |
537ae343e0f5f6e408c543e5315e3d438b2ea92f | C++ | rkdehdduq92/AlgorithmsPractice | /baekjoon/14888.cpp | UTF-8 | 800 | 3.28125 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
int N;
int * nums;
int * opers;
int maxnum, minnum;
void calculate(int n, int cal);
int calc(int c, int n, int i);
int main(){
cin>>N;
nums=new int[N];
opers=new int[4];
for(int i=0; i<N; i++)
cin>>nums[i];
cin>>opers[0]>>opers[1]>>opers[2]>>opers[3];
ma... | true |
3dd37fde6320a712635a666fa164fc52ad5a8414 | C++ | henrybetts/ofxLaunchpad2 | /example-basic-drawing/src/ofApp.cpp | UTF-8 | 2,684 | 2.609375 | 3 | [] | no_license | #include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofSetBackgroundAuto(false);
ofBackground(0);
//allocate frame buffer
fbo.allocate(9, 9);
//allocate pixel buffer
pixels.allocate(9, 9, OF_PIXELS_RGB);
pixels.setColor(ofCo... | true |
7f2075bd3cb2a4a80b16855f35052a1b435522e7 | C++ | AhmedShalaby92/Lexical-Analyzer | /LexicalAnalyzer/DFA_Generator.h | UTF-8 | 1,536 | 2.515625 | 3 | [] | no_license | /*
* DFAGenerator.h
*
* Created on: 10 Apr 2013
* Author: Mohamed
*/
#ifndef DFAGENERATOR_H_
#define DFAGENERATOR_H_
#include "DNode.h"
#include <vector>
#include <stack>
#include "Table_obj.h"
#include <string>
namespace std {
class DFA_Generator {
public:
vector<vector<Table_obj*> > NTransitions;
DFA... | true |
2b3706e957faa3ebfd8ec0b27dd4dd61d5caefb0 | C++ | XzoRit/boost_playground | /exception/test_exceptions.cpp | UTF-8 | 6,616 | 2.9375 | 3 | [] | no_license | #include <boost/test/unit_test.hpp>
#include <boost/exception/all.hpp>
#include <stdexcept>
#include <string>
#include <iostream>
class current_location
{
public:
current_location()
: m_func_name("")
, m_file("")
, m_line(0)
{}
current_location(const char* func_name, const char* fi... | true |
65a5f4ce234abafb6ace7602585a9da7feba1623 | C++ | alexandraback/datacollection | /solutions_1285485_0/C++/yongheng5871/main.cpp | UTF-8 | 2,325 | 2.75 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#include <cstring>
#include <cmath>
#include <vector>
using namespace std;
const int Maxn=33;
char map[Maxn][Maxn];
int n,m;
double d,x[2],y[2];
int eps(double x,double y)
{
if(fabs(x-y)<1e-10)return 0;
return x<y?-1:1;
}
int dirx[]={-1,-1,1,1};
int diry[]={-1... | true |
99479cdacba59ccffdd505997b09d7f8ff511e0a | C++ | leminhtr/PluriNotes_LO21 | /waffichercouple.cpp | UTF-8 | 1,634 | 2.53125 | 3 | [] | no_license | #include "waffichercouple.h"
#include "relation.h"
#include <QLabel>
#include <QListWidget>
#include <QLayout>
#include <QPushButton>
WindowAfficherCouple::WindowAfficherCouple(QString& relation_name, QWidget *parent):
QWidget(parent) {
setFixedSize(320,350);
//NotesManager *NM = NotesManager::getInstance... | true |
776eec4c183e90634b338241b8d847c4f96bd52a | C++ | KPO-2020-2021/zad5_1-Szymon-Sobczak | /tests/test_Scene.cpp | UTF-8 | 1,324 | 2.5625 | 3 | [
"Unlicense"
] | permissive | #include "../tests/doctest/doctest.h"
#include "Scene.hh"
TEST_CASE("Test konstrukotra z parametrem klasy Scene wraz z metodami pozwlajacymi na pobieranie stalych danych o dronach ze sceny oraz zmiane aktywnego drona."){
PzG::LaczeDoGNUPlota Link;
Scene Example(Link);
CHECK ((Example.get_active_drone().... | true |
5a7306ae0abd5217218b3a1508004c2164a5f461 | C++ | AlikhanAldabergenov/TASK1-100 | /16.cpp | UTF-8 | 208 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#define _USE_MATH_DEFINES
using namespace std;
int main() {
double a,b,c,x;
cin>>a>>b>>c;
x=a*2+(b-3)+pow(c,2);
cout<<"Sum of 3 numbers:"<<x;
return 0;
}
| true |
16d6c6e0f3d248bfb05fd059eeea269a7e77ad1b | C++ | Madfish5415/CCP_plazza_2019 | /src/pizza/Recipe.cpp | UTF-8 | 1,908 | 3.015625 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2020
** CPP_plazza_2019
** File description:
** Recipe.cpp
*/
#include "Recipe.hpp"
#include <regex>
#include <utility>
pizza::Recipe::Recipe() = default;
pizza::Recipe::Recipe(std::string type, std::map<std::string, unsigned int> ingredients, unsigned int cookTime)
: _type(std::move(type... | true |
1d676680de3f1b04d16370c8b9ad213708565beb | C++ | ousttrue/im3d_dll | /samples/win32_window.cpp | UTF-8 | 5,257 | 2.546875 | 3 | [] | no_license | #include "win32_window.h"
#include <Windows.h>
#include <windowsx.h> // GET_X_LPARAM macros
#include <assert.h>
static LRESULT CALLBACK WindowProc(HWND _hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
class Win32WindowImpl *g_window = nullptr;
static ATOM GetOrRegisterWindowClass(HINSTANCE hInstance, const TCH... | true |
6ce6bcc7678b08d74a0a995838dd84939b5be89b | C++ | fpawel/hromat900 | /Source/Application/BinStream.hpp | WINDOWS-1251 | 2,597 | 2.765625 | 3 | [] | no_license | #ifndef MY_BIN_STREAM_HLPR
#define MY_BIN_STREAM_HLPR
#define VCL_IOSTREAM
#include "MyIostream.h"
#include "MyExcpt.hpp"
#include "crc16.h"
DECLARATE_AND_DEFINE_MY_EXCEPTION_CLASS_(CantReadIStream, Exception );
DECLARATE_AND_DEFINE_MY_EXCEPTION_CLASS_(CantWriteOStream, Exception );
class MyBinaryIStreamHlpr : publi... | true |
d3ff0b4b6762a989c5ccd9dd585e222bee1a9eb5 | C++ | luklieb/waveguide | /waveguide.cpp | UTF-8 | 2,049 | 2.734375 | 3 | [] | no_license |
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include "Source/Colsamm.h"
typedef struct{
double x;
double y;
} point;
typedef struct{
uint16_t v0;
uint16_t v1;
uint16_t v2;
} face;
void readInput( point* points, face* faces ){
double... | true |
d7eb71548e4c695ec6903d96d265147e8203c4c7 | C++ | aliceresearch/MAGPIE | /src/scenarios/ant/nodes/AntLeftNode.h | UTF-8 | 605 | 2.96875 | 3 | [] | no_license | #ifndef ANTLEFTNODE_H
#define ANTLEFTNODE_H
#include "../../../gp/Node.h"
/**
* {@link Ant} node for turning left 90°.
* @author David Bennett
*/
class AntLeftNode : public Node
{
public:
/** Constructs the node with an arity of 0 and the name 'Left'. */
AntLeftNode() : Node(0, "Left") { }
/** Tur... | true |
67317e3b7d6196606fb417711742c887eb45ec67 | C++ | 1135037047/- | /每日一题/7.16/7.16/test.cpp | UTF-8 | 811 | 3.09375 | 3 | [] | no_license | #if 0
#include <iostream>
#include <vector>
using namespace std;
bool IsLeapYear(const int& year) {
if (year % 4 == 0) {
if (year % 100 == 0) {
if (year % 400 == 0) {
return true;
}
else {
return false;
}
}
else {
return true;
}
}
else {
return false;
}
}
int main() {
int year, m... | true |
21d9b6470318caea31d6e0e9478e193e22e2db26 | C++ | tenawalcott/cc3k-project | /main.cc | UTF-8 | 8,593 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <memory>
#include "floor.h"
#include "display.h"
#include "character.h"
#include <sstream>
#include "item.h"
class Shade;
class Vampire;
class Goblin;
class Drow;
class Troll;
using namespace std;
string intToStr(int num) {
string result;
string... | true |
34f64465012bd74a4cb6fa50a5876a8da5a258d3 | C++ | JCiroR/Competitive-programming | /Problems/Topic-specific/ProblemSolvingParadigms/DP/10664Luggage.cpp | UTF-8 | 1,046 | 2.78125 | 3 | [] | no_license | #include <cstring>
#include <cstdio>
#include <algorithm>
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
const int MAXM = 21;
const int MAXT = 200;
int nums[MAXM];
bool knap[MAXT + 1];
bool func(int target, int n) {
knap[0] = true;
for(int i = 0; i < n; i++) for(int j = MAXT; ... | true |
83779ca5dbef83a95792c9d516ffd03e6715ffdc | C++ | vik228/SpojCodes | /SUMFOUR.cpp | UTF-8 | 947 | 2.6875 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<cstring>
using namespace std;
int a[4000],b[4000],c[4000],d[4000];
int lhs[16000001],rhs[16000001];
int main()
{
int n;
int* lhs_ptr;
int* rhs_ptr;
lhs_ptr=lhs;
rhs_ptr=rhs;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d%d%d%d",... | true |
97e3c983292da190a1c5fb8aa592436bdb4ae050 | C++ | AhJo53589/leetcode-cn | /problems/longest-palindromic-substring/SOLUTION.cpp | UTF-8 | 1,213 | 3.15625 | 3 | [] | no_license |
//////////////////////////////////////////////////////////////////////////
void findPalindrome(string s, int &low, int &high)
{
while (s[low] == s[high])
{
low--;
high++;
if (low < 0 || high > s.size() - 1) break;
}
low++;
high--;
}
string longestPalindrome(string s)
{
if (s.size() == 1) return s;
strin... | true |