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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
417f171b41a0fef0a74a977db667982273fba7bb | C++ | battleofdie/interview | /leetcode/Valid-Number.cpp | UTF-8 | 2,269 | 3.234375 | 3 | [] | no_license | // Silly and ugly code, I am not satisfied with this code.
class Solution {
public:
bool isNumber(const char *s) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if(s == NULL) return false;
while(*s != '\0' && *s == ' ') s++;
if(*s == ... | true |
51313ab4fcc4e6cf97627034758d0069b8bbf754 | C++ | dwelman/Nibbler | /basicLib/targsrc/UIGroup.cpp | UTF-8 | 1,347 | 2.859375 | 3 | [] | no_license | #include <UIGroup.hpp>
int UIGroup::next = 1;
UIGroup::UIGroup() : ID(next)
{
next++;
}
UIGroup::UIGroup(const UIGroup & src) : ID(next)
{
elem = src.elem;
next++;
}
UIGroup::~UIGroup()
{
}
UIGroup & UIGroup::operator=(const UIGroup & src)
{
elem = src.elem;
return (*this);
}
void... | true |
59b04537a6706045f385f925dec6c224e8122359 | C++ | nr-parikh/RealTimePathPlanning | /nodeStruct.h | UTF-8 | 379 | 2.546875 | 3 | [] | no_license | #pragma once
#include"ofMain.h"
struct Nodes
{
ofVec2f location;
Nodes *parent, *prevParent=NULL;
bool alive = true;
ofColor color = { 10, 12, 160 };
float costToStart;
std::list<Nodes*> children;
Nodes()
{
}
Nodes(float x_, float y_, float costToStart_, Nodes* p_ = NULL)
{
location.x = x_;
location.... | true |
78eb1e857bbf6217bc428adaccf3b1dc04b1b88b | C++ | H4tch/Basic-SDL2-Demo | /include/camera.h | UTF-8 | 1,850 | 3.296875 | 3 | [
"MIT"
] | permissive | #ifndef _ENGINE_CAMERA_H
#define _ENGINE_CAMERA_H
#include "object.h"
#include "SDL2/SDL_rect.h"
// Camera centers itself over an Object until it hits the map's edge.
// Note, Camera updates the object it is following before it repositions itself
// over it. This prevents the object from 'wiggling' around on the scre... | true |
4c7c3fec2e02e57701b31b0693a22b0b9236715d | C++ | tothambrus11/arc-2020 | /old/wemos_code/wemos_code.ino | UTF-8 | 1,394 | 2.765625 | 3 | [] | no_license | #define M1A D5
#define M1B D6
#define M2A D7
#define M2B D8
#define M3A D3
#define M3B D4
#define M4A D1
#define M4B D2
long counter1 = 0;
long counter2 = 0;
long counter3 = 0;
long counter4 = 0;
void setup() {
// put your setup code here, to run once:
pinMode(M1A, INPUT_PULLUP);
pinMode(M2A, INPUT_PULLUP);
p... | true |
3226b99976451afcd06c5f1d606c169dae757bc5 | C++ | ydk1104/PS | /boj/4000~4999/4690.cpp | UTF-8 | 273 | 2.9375 | 3 | [] | no_license | #include<stdio.h>
int main(void){
for(int i=1; i<=100; i++){
for(int j=2; j<=i; j++){
for(int k=j; k<=i; k++){
for(int l=k; l<=i; l++){
if(i*i*i == j*j*j+k*k*k+l*l*l){
printf("Cube = %d, Triple = (%d,%d,%d)\n", i, j, k, l);
}
}
}
}
}
}
| true |
21d0947fd97db061862d9d183a475e692de06116 | C++ | neokito/OpenCLTabu | /TabuSolver/Solution.cpp | UTF-8 | 1,133 | 2.78125 | 3 | [] | no_license | /*
* Solution.cpp
*
* Created on: 14-08-2012
* Author: donty
*/
#include "Solution.h"
namespace tabu {
/* +----------------------+
* | k_ | k_ | k_ | k_ |
* +----------------------+
* |_______n_machines_____|
*/
Solution::Solution(unsigned int n_machines) {
this->n_machines = n_machines;
this->c... | true |
7e69aaba234aaa2f91ee2b000e5adb92fe8b378e | C++ | moddyz/CXXPythonDocs | /src/cxxpythondocs/vec3f.h | UTF-8 | 2,346 | 3.75 | 4 | [] | no_license | #pragma once
namespace cxxpythondocs {
/// \class Vec3f
///
/// A vector class with 3 floating-point components.
class Vec3f
{
public:
// -----------------------------------------------------------------------
/// \name Construction
// ----------------------------------------------------------------------... | true |
1264c8351477ae1e5b95542218d3479a7ba119b5 | C++ | allansp84/metafusion-multiview-learning | /bsifcpp/test.cpp | UTF-8 | 2,576 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <boost/python/numpy.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <fstream>
#include "bsifmodule.h"
namespace p = boost::python;
namespace np = boost::python::numpy;
int main(int argc, char **argv){
if (argc < 2) {
std::cout << "Usage: test <imag... | true |
a944ce964d5d4dcce702204b001ed4efa2c47c0c | C++ | skdudn321/algorithm | /baekjoon/11053.cpp | UTF-8 | 487 | 2.71875 | 3 | [] | no_license | #include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
vector<int> ve;
int main(void){
int N;
int i;
int temp;
scanf("%d", &N);
scanf("%d", &temp);
ve.push_back(temp);
for (i = 1; i < N; i++){
scanf("%d", &temp);
if (temp > ve.back()){
ve.push_back(temp);
}... | true |
0bba85298e07657a5f9a1741a7e8ff38fb8cee29 | C++ | Silverutm/Concursos-Algoritmia | /XV Semana 0ct 2016/findingekt/SolutionMedium.cpp | UTF-8 | 558 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int V;
int AdjMat[160][160];
void floyd()
{
for (int k = 0; k < V; k++) // remember that loop order is k->i->j
for (int i = 0; i < V; i++)
for (int j = 0; j < V; j++)
AdjMat[i][j] = min(AdjMat[i][j], AdjMat[i][k] + AdjMat[k][j]);
}
int main()
{
int k, ... | true |
c1a7b56f380b7f99056199e8f891b44282fbfb2c | C++ | FZU1816K/personal-project | /Cplusplus/031601232/src/src/WordCount/WordNum.cpp | GB18030 | 944 | 2.796875 | 3 | [] | no_license | #include"WordNum.h"
int WordNum(char * filename)
{
map<string, int> Word_Num_map;
char ch;
FILE *file;
fopen_s(&file, filename, "rt");
int flag = 0; // Զ״̬ 0 1 2 3 44ս״̬,0Ϊʼ״̬
int count = 0;
while((ch = fgetc(file)) != EOF)
{
if ('A' <= ch && ch <= 'Z')
ch = ch + 32;
switch (flag) ... | true |
92508f0889cdec651a5731bb479c748b4b92021f | C++ | andriantolie/Impressionist | /CircleBrush.cpp | UTF-8 | 1,221 | 2.5625 | 3 | [] | no_license | /*
* The implementation of circle brush.
*
*/
#include "ImpressionistUI.h"
#include "ImpressionistDoc.h"
#include "CircleBrush.h"
extern float frand();
CircleBrush::CircleBrush (ImpressionistDoc* pDoc, char* name) : ImpBrush(pDoc, name) {}
void CircleBrush::BrushBegin (const Point source, const Point target) {
I... | true |
92e22bcf8fd353909ed16c634032ef56b74a2a4c | C++ | Tecelecta/HIP-GSWITCH | /src/data_structures/bitmap.hxx | UTF-8 | 4,897 | 2.671875 | 3 | [] | no_license | #ifndef __BITMAP_CUH
#define __BITMAP_CUH
#include <hip/hip_runtime.h>
#include "utils/utils.hxx"
#include "utils/intrinsics.hxx"
#include "utils/platform.hxx"
template<typename word_t, int sft>
struct bits_t{
int build(int nvertexs){
n_words = (nvertexs + 8*sizeof(word_t)-1) >> sft;
H_ERR(hipMalloc((void... | true |
ffda9f1b6390166a7e4c2717e3c71794724bdb1d | C++ | NajwaLaabid/CompetitiveProgramming | /CodeForces/MathProblems/A9.cc | UTF-8 | 413 | 3.0625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(void) {
int n, k = 1, ans = 0;
vector<int> p;
cin >> n;
// Ys
for( int i = 2; i < n - 1 ; i++ ) {
k = 1;
while ( pow(i, k) <= n ) {
p.push_back( pow(i, k) );
k++;
ans++;
}
}
// number of Ys
cout << ans << endl;
for( int i = 0; i < p.s... | true |
878ef815711a0515844323bb7b9082d707488440 | C++ | ordinary-developer/education | /cpp/std-11/r_lischner-exploring_cpp_11-2_ed/ch_53-containers/04-array_with_a_user-defined_class/main.cpp | UTF-8 | 666 | 3.25 | 3 | [
"MIT"
] | permissive | #include "card.hpp"
#include "randomint.hpp"
#include <array>
#include <iostream>
int main() {
std::array<card,52> deck;
std::generate(deck.begin(), deck.end(), card_generator{});
randomint picker{ 0, deck.size() - 1 };
for (int i{ 0 }; i != 10; ++i) {
card const& computer_card{ deck.at(pick... | true |
6c03066959139e150d4edc1cb0b8c2a2c99533e4 | C++ | lysakov/Signature | /src/modular_arithmetic.cpp | UTF-8 | 8,550 | 3.125 | 3 | [] | no_license | #include "modular_arithmetic.hpp"
enum {
MOD = 256,
BYTE_SIZE = 8
};
typedef Block::Block<1024> uint1024_t;
struct Division_struct
{
Division_struct (const uint1024_t&, const uint1024_t&);
uint1024_t quoitient;
uint1024_t remainder;
};
uint1024_t operator / (const uint1024_t&, const uint1024_t... | true |
322b0aed3c330ba5482d0c7917cab5be556d9bee | C++ | MamoruKato/kato_bar | /src/pedido.cpp | UTF-8 | 619 | 2.625 | 3 | [] | no_license | /*
* pedido.cpp
*
* Created on: 13 de out de 2017
* Author: bruno
*/
#include "pedido.h"
Pedido::Pedido(unsigned int npedido, unsigned int ncliente) {
_pedido = npedido;
_idCliente = ncliente;
_idGarcom = 0;
}
Pedido::~Pedido() {
}
/*
* Retorna a id do cliente que realizou o pedido
*/
unsigned int P... | true |
5e268d2d929e8568daa675a8c9417bb1037ca68b | C++ | francescozoccheddu/Neighborhood | /Projects/Game/Header Files/Game/Resources/Resource.hpp | UTF-8 | 1,019 | 2.640625 | 3 | [] | no_license | #pragma once
#include <Game/Direct3D.hpp>
#include <Game/Utils/NonCopyable.hpp>
#include <string>
#define GAME_RESOURCES_DIR "Resources/"
class Resource : private NonCopyable
{
public:
virtual void Create (ID3D11Device & device) = 0;
virtual void Destroy () = 0;
virtual bool IsCreated () const = 0;
};
class... | true |
e6436d6014f9b042606176fa3da6fbf79d970326 | C++ | uskey512/AtCoder | /ABC/125/c.cpp | UTF-8 | 705 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int gcd(int a, int b) {
if (b == 0) return a;
else return gcd(b, a % b);
}
int main() {
int n; cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) cin >>... | true |
6f1ca24667f1d0d5f501f16bf2ce73f886812004 | C++ | leolimcav/projeto01-ED | /Matrizes Esparsas/include/Matrix.h | UTF-8 | 1,318 | 3.65625 | 4 | [] | no_license | /*
* Aluno: Leonardo Lima Cavalcante
* Matricula: 427665
*/
#ifndef MATRIX_H
#define MATRIX_H
#include <string>
struct Node;
class Matrix
{
private:
Node *head;
public:
// Constructor: Create a new sparse matrix by initializin an empty
// circular linked list with head node.
Matrix();
// Destructor:... | true |
6d342ead6b89bb304fab1c41d79cf506afb99937 | C++ | 0xWaleed/qt-httpclient | /test/HttpClientTest.cpp | UTF-8 | 4,614 | 2.953125 | 3 | [] | no_license | //
// Created by MINE on 15/03/2020.
//
#include "dependency/catch.hpp"
#include <HttpClient.h>
#include <QApplication>
SCENARIO("Http Client Library With Basic Operations")
{
QString url(TEST_URL "/anything");
HttpClient httpClient;
GIVEN("Http Client to perform get Requests")
{
WHEN("The ... | true |
e29263a155f4599d274477fb5a180c335a995492 | C++ | kirillin/acmp | /courses/cpp/cycles/1127_list_of_powers_of_two.cpp | UTF-8 | 356 | 2.828125 | 3 | [] | no_license | /*
Problem N1127
list of powers of two
acmp.ru
Artemov Kirill
*/
#include <iostream>
#include <cmath>
using namespace std;
int main() {
long long n, base;
cin >> n;
base = 2;
if (n <= 2) {
cout << 1 << " ";
}
if (n > 2) {
cout << 1 << " ";
cout << 2 << " ";
}
while ((2 * base) <= n) {
base = base... | true |
241182685db7eaa01dcb2431e94934cd5567e6c9 | C++ | vkg001/DSA-important-question-solutions | /Queue Implimentation (Linked List).cpp | UTF-8 | 2,075 | 3.953125 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Queue
{
int num;
Queue *next;
public:
Queue *front;
Queue *end;
Queue()
{
front=NULL;
end=NULL;
}
Queue(int n)
{
num=n;
next=NULL;
}
void enqueue(int n)
{
... | true |
eea47db282e23de8334332888a188e63081f6ee6 | C++ | danhui/allrgb | /event.h | UTF-8 | 455 | 3.640625 | 4 | [
"MIT"
] | permissive | #pragma once
// Event stores two things:
// 1. What type of event (e.g. mouse down, key up, key down, etc.)
// 2. The value from the event (eg. an ascii code).
class Event {
public:
Event (int type, int value) {
type_ = type;
value_ = value;
}
Event () {
type_ = 0;
value_ = 0;
... | true |
b8fe4c9e862f0ceabb8cf3fb8d3c20f6c2b52815 | C++ | Tadamson20192/RayTracer | /Lab8/Ray.h | UTF-8 | 333 | 2.59375 | 3 | [] | no_license | #ifndef Ray_H
#define Ray_H
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <cmath>
#include "Vector.h"
using namespace std;
class Ray {
public:
float x, y, z;
vec3 origin, direction;
Ray(vec3 inOrigin, vec3 inDirection) : origin(inOrigin), direction(inDirection){
}
... | true |
a7461d96335c05ca4548dae27ec35d40002a3ad3 | C++ | infinit/elle | /range-v3/test/utility/concepts2.cpp | UTF-8 | 10,676 | 2.625 | 3 | [
"Apache-2.0",
"NCSA",
"LicenseRef-scancode-mit-old-style",
"MIT",
"LicenseRef-scancode-other-permissive",
"BSL-1.0"
] | permissive | // Range v3 library
//
// Copyright Eric Niebler 2014-present
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range-v3
... | true |
ba7b254c0498290f6efbbc6efc1ef85899a148ba | C++ | markuskr/raytracer | /CSGTree.h | UTF-8 | 1,174 | 2.765625 | 3 | [] | no_license | //----------------------------------------------------------------------
/// \author Markus Krallinger 0630748, Group: 20
/// \brief Represents the CSGTree
/// Last Changes: 22.06.2008
//----------------------------------------------------------------------
#ifndef CSGTREE_H
#define CSGTREE_H
#include "Primitive.h"
#... | true |
c8715bbd4ff4feb441b1a0c185ba632236160fb2 | C++ | KAGSme/GP3-Coursework | /S1313540-GP3-Coursework/cFreeCameraActor.cpp | UTF-8 | 2,685 | 2.71875 | 3 | [] | no_license | #include "cFreeCameraActor.h"
cFreeCameraActor::cFreeCameraActor()
{
}
cFreeCameraActor::~cFreeCameraActor()
{
cInputMgr* iM = cInputMgr::getInstance();
InputAxis* iaV = iM->getInputAxisState("Vertical");
if (iaV)
__unhook(&InputAxis::InputAxisChange, iaV, &cFreeCameraActor::moveVertical);
InputAxis* iaH =... | true |
72b67d7560c959ffae2f0f5273c3c7e1dc7abe5c | C++ | andrewbolster/cppqubmarch2013 | /CppExamples/ObjectOrientation/FriendlyAccess/main.cpp | UTF-8 | 968 | 3.6875 | 4 | [] | no_license | #include<iostream>
using namespace std;
class X;
int test(X& x);
class Z {
public:
int test(X& x);
};
class Y{
private:
//cannot be seen from X as friendship is one way
int hidden;
public:
int test(X& x);
};
class X {
private:
int i;
int func(){return 27;}
friend int test(X& x); ... | true |
5a0728b16e7978b6a0d3b6ddd48acfbede5a2e39 | C++ | jeanyves-yang/skinning | /project/src/lib/perlin/perlin.hpp | UTF-8 | 1,610 | 2.65625 | 3 | [] | no_license | /*
** TP CPE Lyon
** Copyright (C) 2015 Damien Rohmer
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later ve... | true |
c57a7869f984894c8ca082f59f0b337bf0b79220 | C++ | impyamin/TP_S2 | /TP5_S2/Node.cpp | UTF-8 | 231 | 2.640625 | 3 | [] | no_license | #include "Node.h"
Node::Node()
{
m_nodes.push_back(this);
}
std::vector<Node *> Node::allNode() const
{
for(Node n:m_nodes)
{
std::cout<<m_nodes.at(n)<<endl;
}
}
std::string Node::asXML() const
{
}
Node::~Node()
{
}
| true |
ae9ff02205b9b4b99999d80e0f0c5fcdeef5cc18 | C++ | kamyu104/LeetCode-Solutions | /C++/number-of-ways-to-stay-in-the-same-place-after-some-steps.cpp | UTF-8 | 543 | 2.75 | 3 | [
"MIT"
] | permissive | // Time: O(n^2), n is the number of steps
// Space: O(n)
class Solution {
public:
int numWays(int steps, int arrLen) {
static const int MOD = 1000000007;
const int l = min(1 + steps / 2, arrLen);
vector<int> dp(l + 2);
dp[1] = 1;
while (steps-- > 0) {
vector<int... | true |
97ea842fe48d900003ea9c627964f518549200f1 | C++ | Ashish65649/My-Repository | /Dijkstra.cpp | UTF-8 | 2,779 | 3.390625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Dijkstra{
private:
map<int,list<pair<int,int> > >m;
public:
void AddEdge(int src,int dest,int weight,bool bidirectional=true){
pair<int,int> p;
p = make_pair(dest,weight);
m[src].push_back(p);
i... | true |
84b22c323f34b7e04a34538eff62f271863a02af | C++ | ksvcng/code | /documents/codechef/jan challange2018/test.cpp | UTF-8 | 9,695 | 2.90625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int SieveOfEratosthenes(int n)
{
bool prime[n+1];
int count=0;
memset(prime, true, sizeof(prime));
for (int p=2; p*p<=n; p++){ if (prime[p] == true){for (int i=p*2; i<=n; i += p)prime[i] = false;}}
for (int p=2; p<=n; p++){if (prime[p]){cout<<prime[p]<<" ";count++;}}... | true |
d02a0819339717401bc9aef25b464549592b852f | C++ | GuyTristram/grt | /include/common/valuepack.h | UTF-8 | 4,123 | 3.25 | 3 | [
"MIT"
] | permissive | #ifndef VALUEPACK_H
#define VALUEPACK_H
#include <tuple>
#include <limits>
#include <cassert>
namespace grt
{
template<class T>
struct value_pack_max { static const size_t value = static_cast<size_t>(T::Count) - 1; };
namespace vp_helpers
{
template<size_t I> struct bits { static const size_t value = bits<I /... | true |
d04fd74a2428433bd20c57d2b40136a5c74926fd | C++ | bharathstranger/IS_F311_Assignments | /Second_Assign_3D_Scene/Principles of Computer Graphics/OpenGL/Example10_3/Example10_3.cpp | UTF-8 | 5,980 | 2.546875 | 3 | [] | no_license | #include <windows.h> //the windows include file, required by all windows applications
#include <gl\glut.h>
#include "Example10_3.h"
#include "..\bmp.h"
void UpdateCameraPosition(CAMERAINFO *camera) {
LARGE_INTEGER currentTime;
GLfloat elapsedTime;
GLfloat velocity=0;
GLfloat avelocity= 0;
... | true |
66ac0923df5d15f89484d37765a311fd4ace454b | C++ | Ding-Feng/PAT | /Template/并查集.cpp | UTF-8 | 762 | 2.65625 | 3 | [] | no_license | #include <algorithm>
using namespace std;
vector<int> fa;
class UnionFind {
private:
int* id;
int count;
public:
UnionFind(int n) {
count = n;
id = new int[n];
}
};
int find(int x) {
if (x != fa[x]) {
fa[x] = find(fa[x]); //回溯时的压缩路径
}
return fa[x];
//从x结点搜... | true |
4d00ad5639c66c9754528ca6aeeec419b83a4878 | C++ | htwsoft/VS2 | /server/XMLWorker/source/XMLWorkerTest.cpp | UTF-8 | 7,531 | 2.8125 | 3 | [] | no_license |
#include "XMLWorkerTest.h"
#include <iostream>
using namespace std;
XMLWorkerTest::XMLWorkerTest()
{
this->xmlWorker = new XMLWorker();
}
XMLWorkerTest::~XMLWorkerTest()
{
delete this->xmlWorker;
}
void XMLWorkerTest::starteTest()
{
this->starteBenutzersteuerung();
}
/*
* Methode Startet... | true |
6fe8de11e86edeb055ddd5d2291260ddd39579f4 | C++ | Thor99/OldAndMaybeNewThingz | /obi/stockMaximizeHackerrank.cpp | UTF-8 | 660 | 2.890625 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int testes;
scanf("%d", &testes);
while(testes--){
int N;
vector<int> prices;
long long int profit = 0;
scanf("%d", &N);
for(int i = 0; i < N; i++){
int price;
... | true |
75a2c1efb4c8421a6f45606d1d5a2b30394f68b0 | C++ | CompPhysics/ThesisProjects | /doc/MSc/msc_students/former/ChristianF/ThesisCodes/vmc-solver/Math/random.cpp | UTF-8 | 1,289 | 2.65625 | 3 | [
"CC0-1.0"
] | permissive | #include "random.h"
#include <cmath>
long Random::iy = 0;
long Random::iv[NTAB];
long Random::seed = -1;
void Random::setSeed(long seed) {
Random::seed = seed;
}
double Random::nextGaussian(double mean, double standardDeviation) {
double standardNormalRandomNumber = sqrt( -2.0*log(1.0 - nextDouble... | true |
2c29532c5863611e21353c463b5df5c0777c65fe | C++ | hmc-cs-jamelang/hmc-tessellate | /test/diagram-test.cpp | UTF-8 | 13,469 | 3.03125 | 3 | [
"MIT"
] | permissive | /*
* diagram-test.cpp
*
* Tests for the hmc-tessellate interface.
*
* Does NOT test for correct results, simply that the interface works.
*/
#include <algorithm>
#include <cstdlib>
#include <vector>
#include "../src/hmc-tessellate.hpp"
using namespace std;
using namespace hmc;
// tee hee
#define FACE_AREAS 0
... | true |
fe5d97e5bff53dad71038b6b303881a30e452860 | C++ | grahambrooks/lazybuilder | /src/command_line.hpp | UTF-8 | 674 | 3.15625 | 3 | [] | no_license | class is {
public:
static bool verbose_option(const char *option) {
return not_null(option) && switch_char(option[0]) && verbose_char(option[1]) && eos(&option[2]);
}
static bool trigger_option(const char* option) {
return not_null(option) && switch_char(option[0]) && trigger_char(option[1]) && eos(&op... | true |
89f14cc30cdceace7d4f830c32e54b06e7257d1b | C++ | quanhuynh2007/oop | /matrix/matrixVer1/fractionOperator.cpp | UTF-8 | 2,702 | 3.171875 | 3 | [] | no_license | #include "fractionOperator.h"
Fraction::Fraction()
{
numerator = 0;
denominator = 1;
}
Fraction::Fraction(ulong num, ulong den)
{
if (den < 0)
{
num = -num;
den = -den;
}
if (den == 0)
{
den = 1; num = 0;
}
numerator = num;
denominator = den;
compact()... | true |
6ae739229bcfc0a4d84551787ffb8a20b823566d | C++ | mothergoose729/AutomatedSTEPV1.0 | /alpha3.0/STEPAutomatedInstaller.cpp | UTF-8 | 3,703 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <ctype.h>
using namespace std;
void unpackModDirectories(string);
void cleanup(string);
void specialOps(ifstream&, string);
const char* CONFIG = "source/config";
const char* ARCHIVENAME = "source/name";
const char* SOURCEDIRECTORYFILETXT = "source/sour... | true |
b81f406dd2e793ed36f6ecec1a7ce79bf4a2f37c | C++ | inter-bellum/Inber | /Neopixels.ino | UTF-8 | 1,886 | 2.8125 | 3 | [] | no_license | #include <Adafruit_NeoPixel.h>
#define LED_PIN 3
#define NUM_NOTES 5
#define NUM_LEDS_PER_HIT 4
#define NUM_LEDS 20
// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
//how bright are all the pixels
float pixelBright[NUM_LEDS];
//how ... | true |
3df920307c8678473c3a14fbfa693ca9594506c3 | C++ | piotrGTX/Matrix | /Matrix.h | WINDOWS-1250 | 1,698 | 3.359375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
class Matrix {
public:
static Matrix myMatrixExample(const size_t N, const double a1, const double a2, const double a3);
static Matrix myVectorExample(const size_t N);
// Nie zainicjowana
Matrix(size_t N, size_t M);
Matrix(size_t N);
// Zainicjowana przy pomo... | true |
2dc77d4991efb8fae12367c4d06d7061e2a08bdf | C++ | AnneLivia/Competitive-Programming | /Online Judges/URI/1115/main.cpp | UTF-8 | 439 | 3.296875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include "stdio.h"
using namespace std;
int main()
{
int x, y;
cin >> x >> y;
while(x != 0 && y != 0){
if(x > 0 && y > 0)
cout << "primeiro\n";
else if(x < 0 && y > 0)
cout << "segundo\n";
else if(x < 0 && y < 0)
cout << "terc... | true |
1e8091ced057c424243d2c970faa0f9457aecb8f | C++ | MarcDerequitooo/CodeLab2---Files | /Exercise 1 - Biography.cpp | UTF-8 | 513 | 3.40625 | 3 | [] | no_license | #include<iostream>
using namespace std;
main()
{
string name,hometown;
double age;
cout<<"State your Information in this order: \nFull name, Hometown, and Age"<<endl;
getline(cin,name);
getline(cin,hometown);
scanf("%d",&age);
printf("Full Name: %s \n",name.c_str());
printf("Hometown: %s \n",... | true |
b3cf1593273e6eac04e96d70bff22a9187a29138 | C++ | ordinary-developer/education | /cpp/std-17/m_bancila-modern_cpp_programming_cookbook/ch_01-core_lang/04-non-static_member_initialization.cpp | UTF-8 | 4,259 | 3.5625 | 4 | [
"MIT"
] | permissive | // region [how to do it]
#include <iostream>
#include <string>
namespace example_01 {
enum class TextVAlignment { Up, Middle, Bottom };
enum class TextHAlignment { Rigth, Left };
struct Control {
int const DefaultHeight = 14;
int const DefaultWidth = 80;
std::string text;
TextVAlignm... | true |
8f0016ca365fe2f76f7a7e8f49780836c0a2d091 | C++ | stefanobiano/PC | /editDistanceOpenmp.cpp | UTF-8 | 2,026 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <string>
#include <set>
#include<iostream>
#include <time.h>
#include <omp.h>
using namespace std;
class EditDistance {
private:
string firstString;
string secondString;
int firstStringLength;
int secondStringLength;
int editMatrix[150... | true |
84e1f5e4feac56f713a93fa62bc1605c6ffe6979 | C++ | jakubtyrcha/playground | /Benchmarks/hashmap_benchmarks.cpp | UTF-8 | 1,856 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "Hashmap.h"
#include "box.h"
#define CATCH_CONFIG_ENABLE_BENCHMARKING
#include "catch/catch.hpp"
using namespace Playground;
#include <unordered_map>
TEST_CASE("hashmap fill up", "hashmap_vs_unordered_map")
{
BENCHMARK("Hashmap")
{
Hashmap<i32, i32> h;
for(i32 i=0; i<100000; i++) {
... | true |
c86f506dd7cb1fcf7c45bba561c0971bf7b3368c | C++ | clroot/TIL | /ALGORITHM/자료구조/집합/14425.cpp | UTF-8 | 554 | 2.75 | 3 | [] | no_license | #include "iostream"
#include "string"
#include "unordered_set"
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
unordered_set<string> set;
int answer = 0;
cin >> n >> m;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
set.insert(... | true |
a9aea1ebeba8f04af3e201a096a0a8f8fea833c7 | C++ | niuxu18/logTracker-old | /second/download/curl/gumtree/curl_repos_function_1611_curl-7.41.0.cpp | UTF-8 | 328 | 2.734375 | 3 | [] | no_license | static char *
create_hostcache_id(const char *name, int port)
{
/* create and return the new allocated entry */
char *id = aprintf("%s:%d", name, port);
char *ptr = id;
if(ptr) {
/* lower case the name part */
while(*ptr && (*ptr != ':')) {
*ptr = (char)TOLOWER(*ptr);
ptr++;
}
}
retu... | true |
03d974ca8ae535f761478fb3fb04be22ac169a85 | C++ | Jody-Lu/Array | /200_Number_of_Islands/numIslands.cpp | UTF-8 | 1,053 | 3.1875 | 3 | [] | no_license | #include <vector>
using namespace std;
class Solution {
public:
void removeIsland(vector<vector<char> >& grid, int y, int x) {
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int m = grid.size(), n = grid[0].size();
grid[y][x] = '0';
for(int ... | true |
496755893ac1079438fc423bc9e244009d4fcd5c | C++ | MingNine9999/algorithm | /Problems/boj15593.cpp | UTF-8 | 1,383 | 2.984375 | 3 | [] | no_license | //Problem Number : 15593
//Problem Title : Lifeguards (Bronze)
//Problem Link : https://www.acmicpc.net/problem/15593
#include <iostream>
#include <algorithm>
using namespace std;
pair<int, int> t[100001];
int work[100001];
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
for (int i... | true |
4ed5b4e1dcce8ff68e62f707e1afc4006d3f9618 | C++ | guillaumemoreau/RaOcclusion | /ObjetEtTracking/cameraPos.h | ISO-8859-1 | 3,050 | 2.890625 | 3 | [] | no_license | #ifndef _CAMERAPOS_
#define _CAMERAPOS_
#include <opencv/cv.h>
#include <fstream>
using namespace cv;
//Aruco
#include "aruco\aruco.h"
void axis(float); /**< Afficher des axes dans le repre courant */
/**Lire les matrices "intrinsics" et "distorsion" depuis un fichier.
* <br /> Format du fichier :
* <br /> # co... | true |
8e21bcd237d256ba5ef6ec2fc934d49473777b2f | C++ | MacBono/kasumi_a53 | /a53kasumi/kgcore.cpp | UTF-8 | 2,055 | 2.515625 | 3 | [] | no_license | #include "kasumi.h"
#include <stdio.h>
//co is output, cl is length, cc given, ck key build earlier, ca given, cb given, cd given
void KGcore(u8 ca, u8 cb, u32 cc, u8 cd, u8* ck, u8* co, int cl)
{
Struct1 A; // a 64-bit register that is used within the KGCORE function to hold an intermediate value.
Struct1 r... | true |
f9cb0bf470d7d2454473b28f091c41dadb1e9dc3 | C++ | msrishu65/codes | /codes/repeat/movezeroestoend.cpp | UTF-8 | 262 | 2.515625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int a[]={1, 9, 8, 4, 0, 0, 2, 7, 0, 6, 0};
int c=0;
int i;
for(i=0;i<11;i++)
{
if(a[i]!=0)
{
a[c]=a[i] ;
c++;
}
}
for(int j=c;j<11;j++)
a[j]=0;
for(int i=0;i<11;i++)
cout<<a[i]<<" ";
}
| true |
a846d14ea7dcc861b27f27ff6ad89034ad8bda04 | C++ | Ares-Developers/YRpp | /FPSCounter.h | UTF-8 | 1,367 | 2.625 | 3 | [] | no_license | #pragma once
class FPSCounter
{
public:
//!< The number of frames processed in the last second.
static constexpr reference<unsigned int, 0xABCD44u> const CurrentFrameRate{};
//!< The total number of frames elapsed.
static constexpr reference<unsigned int, 0xABCD48u> const TotalFramesElapsed{};
//!< The time it ... | true |
4cd8ba364c4d5d38e5925e87184deab200dd7a05 | C++ | WRodewald/HPEQ | /source/hpeq/AFourierTransformFactory.h | UTF-8 | 1,150 | 3.125 | 3 | [] | no_license | #pragma once
#include "AFourierTransform.h"
#include <memory>
/**
Class implements a simple factory that can create a fourier transform engines
*/
class AFourierTransformFactory
{
public:
/**
Installs the factory as a singleton to be. The singleton will be used to create fourier transform enignes
via #FourierT... | true |
ea504157b0269f449568a4818305685e23438eb3 | C++ | Sonaza/glen | /glen/src/Graphics/MeshLoader.cpp | UTF-8 | 4,100 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <glen/System/Types.hpp>
#include <glen/Graphics/MeshLoader.hpp>
#include <glen/System/ErrorStream.hpp>
namespace
{
//////////////////////////////////////////////////////////////
template <typename T>
T strto(const std::string& s... | true |
9ca8c17600bfb1ea2eff0a6dc26d57c3ada21571 | C++ | hesitationer/cuda-dnn-inference | /cuda/cudnn.hpp | UTF-8 | 18,196 | 2.765625 | 3 | [] | no_license | #ifndef CUDA_CUDNN_HPP
#define CUDA_CUDNN_HPP
#include "error.hpp"
#include "stream.hpp"
#include "utils/noncopyable.hpp"
#include <cudnn.h>
#include <sstream>
#include <string>
#include <cstddef>
#define CHECK_CUDNN(call) cuda::cudnn::detail::check_cudnn_status((call), __FILE__, __LINE__)
namespace cuda {
nam... | true |
69f3ab8dbb524723a45e7d3af29e7febf3feb411 | C++ | sdy1423/Algorithm | /[boj_18233]_러버덕을 사랑하는 모임.cpp | UTF-8 | 1,278 | 2.609375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#define f first
#define s second
using namespace std;
typedef pair<int, int> P;
int n, p, e, ans[21];
vector<P> MinMax;
bool isAnswer;
void FindAns(int bits) {
int Min = 0, Max = 0;
for (int i = 0; i < n; i++) {
if (bits & (1 << i)) {
Min += MinMax[i].f;
Max += MinMax[i].s;... | true |
14205a13ee27b2bb57e635e1f186f9ee4a42c560 | C++ | kbuczek/computerScienceStudies | /Algorithms/Semeseter1/sort_selection.cpp | UTF-8 | 1,890 | 3.53125 | 4 | [] | no_license | #include<iostream>
#include <cstdlib>
#include<stdio.h>
#include <ctime>
#define N 100
using namespace std;
int liczbaOperacji = 0;
void sort_selection(int tab[])
{
for (int i = 0; i < N-1; i++)
{
int min = i;
for(int j=i+1; j<N; j++)
{
liczbaOperacji++;
... | true |
0076975a0acf9150bbaf2f5167fcff47a79f7150 | C++ | EnTaroYan/leetcode-answer | /202. Happy Number .cpp | UTF-8 | 1,149 | 4.0625 | 4 | [] | no_license | /*Write an algorithm to determine if a number is "happy".
A happy number is a number defined by the following process: Starting with any positive integer,
replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay),
or it loops endlessly in a cycle... | true |
2030243b29dbb852f78dc0de4af05cd5db4e17e0 | C++ | roboclub-tu/Line-Follower | /QTRA_PID/QTRA_PID_Test.ino | UTF-8 | 3,296 | 2.84375 | 3 | [
"MIT"
] | permissive | #include <QTRSensors.h>
QTRSensors qtr;
const uint8_t SensorCount = 5;
uint16_t sensorValues[SensorCount];
//motors
int E1 = 10;
int M1 = 12;
int E2 = 11;
int M2 = 13;
// Motor speed when traveling straight
int M1Speed = 175;
int M2Speed = 175;
int maxSpeed = 255;
// Sensors sum used for stopping
int sumSensors =... | true |
5d36a60d247efef6731758f6759a83b930e22727 | C++ | drewnoakes/lwsxx | /include/lwsxx/http.hh | UTF-8 | 2,942 | 2.875 | 3 | [] | no_license | #pragma once
#include <functional>
#include <memory>
#include <regex>
#include <stdexcept>
#include <string>
#include <vector>
#include "websocketbuffer.hh"
class libwebsocket_context;
class libwebsocket;
namespace lwsxx
{
enum class HttpMethod
{
GET,
POST
};
enum class HttpStatus : short
{
U... | true |
f8eee3006c50d7d414869bcfae2e2fa46115966c | C++ | hal-oconnell/prog2100 | /C++ Lessons/Week 10 - Polymorphism/FailBitExample/Source.cpp | UTF-8 | 1,093 | 3.03125 | 3 | [] | no_license | #include <fstream>
#include <cstdlib>
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
ifstream fin;
ofstream fout;
double num1, num2, num3, num4, num5, num6, num7, num8, num9, num10;
fin.open("numbers.txt");
if (fin.fail())
{
cout << "Input file opening failed." << en... | true |
74fdef8ea3d6ae78f50be1b20889d57716056df3 | C++ | manhhung20020246/Tuan07 | /A3.7.cpp | UTF-8 | 367 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <array>
using namespace std;
void even(int* arr, int length) {
for (int i = 0; i < length; i++)
{
if (arr[i] % 2 == 0){
cout << arr[i] << " ";
}
}
}
int main()
{
int arr[5];
int length = sizeof(arr) / sizeof(arr[0]);
for (int i = 0; i < length; i++)
{
cin >> arr[i];
}
eve... | true |
21f7d03c3ce21915ddacb09f56554af146a6b711 | C++ | WheretIB/nullc | /NULLC/translation/std_file_bind.cpp | UTF-8 | 6,877 | 2.859375 | 3 | [
"MIT"
] | permissive | #include "runtime.h"
#include <stdio.h>
#include <string.h>
#if defined(_WIN32)
#pragma warning(disable:4996)
#endif
// Array classes
#pragma pack(push, 4)
struct File
{
int flag;
void* id;
};
struct Seek
{
Seek(): value(0){}
Seek(int v): value(v){}
int value;
};
#pragma pack(pop)
File F... | true |
5765ebcb8ec5c3465942f7733c0a82c796be800c | C++ | AABNassim/DPPML-Worker-Source | /PPML/Worker.cpp | UTF-8 | 3,243 | 3.03125 | 3 | [] | no_license | //
// Created by root on 30/06/19.
//
#include "Worker.h"
Worker::Worker() {
}
void Worker::connect_to_mlsp() {
if ((mlsp_sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
printf("\n Socket creation error \n");
return;
}
mlsp_addr.sin_family = AF_INET;
mlsp_addr.sin_port = htons(ml... | true |
87c54ba1d247edcb10b8057b1ff0c7dab44cf836 | C++ | LLZK/Linux_study | /chat/chat_system/data_pool/data_pool.h | UTF-8 | 682 | 3.09375 | 3 | [] | no_license | #include<iostream>
#include<semaphore.h>
using namespace std;
class data_pool
{
public:
data_pool(int _cap,int _size)
:cap(_cap)
,size(_size)
,index1(0)
,index2(0)
{
sem_init(&blank,0,cap);
sem_init(%data,0,0);
}
void getdata(string& instr)
{
sem_wait(blank);
size++;
pool[index1] = instr;
ind... | true |
74ab3ccd82977fb41811868f4c157e6da29318e2 | C++ | ProkopHapala/cpp_arch | /ShipSimulator/triangleRayCast/include/TrinagleMesh.h | UTF-8 | 1,845 | 2.65625 | 3 | [] | no_license |
class TrinagleMesh{
public:
int nvert;
int ntri;
Vec3d * verts;
Vec3d * normals;
double * areas;
int * tris;
int viewlist=0;
TrinagleMesh( int nvert_, int ntri_ ){
nvert = nvert_;
ntri = ntri_;
verts = new Vec3d [ nvert ];
tris = new int [ 3 * ntri ];
normals = new Vec... | true |
478bc70d49618cc5c291415cca39dd68c98ce57b | C++ | mirsking/mirsking_leetcode | /medium230_kth_smallest_element_in_BST/main.cpp | UTF-8 | 809 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
/**
* Definition for a binary tree node.
*/
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
int kthSmallest(TreeNode* root, int k) {
ve... | true |
f429bb9e61c1333bc1337965f350789a44729f72 | C++ | SpinHit/Tetris-Plateau | /generation.cpp | UTF-8 | 1,813 | 2.96875 | 3 | [] | no_license | #include "include.h"
void genererTriangle(int tableau[TRIANGLE][A]){
for(int i=0; i<TRIANGLE; i++){
for(int j=0;j<A;j++){
if(j >= MILIEUTRIANGLE - i && j <= MILIEUTRIANGLE + i){
tableau[i][j] = C;
} else {
tableau[i][j] = 3;
}
}
... | true |
447dad492ed0abc83e56784d894ebed8139e754c | C++ | ducaale/spaceship | /src/player.h | UTF-8 | 8,483 | 2.609375 | 3 | [
"MIT"
] | permissive | #ifndef PLAYER_H
#define PLAYER_H
#include <fstream>
#include "game.h"
#include "components.h"
#include "json.hpp"
using json = nlohmann::json;
struct CThruster : Component {
Game* game = nullptr;
CAnimatedSprite* cSprite = nullptr;
CHealth* cHealth = nullptr;
bool boosterOn = false;
CThruste... | true |
8091173d29dba9c8f71a4f84e57c0822af3594d2 | C++ | jonasj65/streamfiler | /streamfiler/tests/ParametersTest.cpp | UTF-8 | 9,539 | 2.5625 | 3 | [] | no_license | /*
* File: ParametersTest.cpp
* Author: Janos Jonas
*
* Created on April 29, 2020, 12:00 AM
*/
#include "ParametersTest.h"
using namespace streamfiler_test;
using namespace streamfiler;
CPPUNIT_TEST_SUITE_REGISTRATION(ParametersTest);
ParametersTest::ParametersTest()
{
}
ParametersTest::~ParametersTest() ... | true |
4a31f2188d33aa6a7e3e53b8f023e45bb464148a | C++ | azurite/AST-245-N-Body | /src/first_task.cpp | UTF-8 | 8,943 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <memory>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <cmath>
#include <mgl2/mgl.h>
#include <Eigen/Dense>
#include <data.hpp>
#include <particle.hpp>
#include <gravitysolvers.hpp>
#include <first_task.hpp>
std::unique_ptr<std::vector<Particle>> p(Data::readFromFile(... | true |
30d2642cc988976074d00b41ec219f6c82fb8041 | C++ | xbaby123/C-program | /Botnet/Botnet_module/module/main.cpp | UTF-8 | 5,251 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
using namespace std;
void decodeMessage(char* fdMessage, string &decodedMessage);
void str2chr(char [], string s);
int String2CharPointer(string s, char* a);
int main()
{
char *fbMessage = "child... | true |
de8314f4c9ef0eeaa75061c37ca62eb03cc474dc | C++ | MikeGitb/data_matrix | /tests/src/test_data_matrix.cpp | UTF-8 | 1,313 | 3.34375 | 3 | [] | no_license | #include <data_matrix/data_matrix.h>
#include <catch2/catch.hpp>
#include <iostream>
using namespace mba;
TEST_CASE( "Insert", "[data_matrix_tests]" )
{
data_matrix<int, float, double, std::vector<int>> data;
mba::column<float> row2 = data.template get<1>();
mba::column<std::vector<int>> row4 = data.template ge... | true |
82246e5ae7f26c54d49fcb361e46ea3b5f2bdfb6 | C++ | NuckleR/LR_8 | /LR_8(2)/LR_8(2)/File.cpp | WINDOWS-1251 | 9,439 | 2.765625 | 3 | [] | no_license | #include "File.h"
#include "Casino.h"
#include "Exception.h"
#include <io.h>
#include <sys/types.h>
#include <stdio.h>
File& operator<<(File& file, const char* s)
{
try {
if (!file.file.is_open()){
throw 1;
}
}
catch (int i){
Exception ex(i);
ex.Print();
}
string str = s;
file.f... | true |
557baa6bd086d42205dd6dc9489cf0c66007213e | C++ | SHornung1/KFParticle | /KFParticle/KFParticleField.h | UTF-8 | 7,170 | 3.0625 | 3 | [] | no_license | //----------------------------------------------------------------------------
// Class for approximation of the magnetic field for KF Particle
// .
// @author I.Kisel, M.Zyzak
// @version 1.0
// @since 20.08.13
//
//
// -= Copyright © ALICE HLT and CBM L1 Groups =-
//_________________________________________... | true |
5fb5e157512e0dbe84ff54c3438a58af7be5b6b4 | C++ | Iftekhar79/Competitve-Programming | /URI/uri2417.cpp | UTF-8 | 467 | 2.890625 | 3 | [] | no_license | // Championship
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
int x,y,z;
cin>>a>>b>>c;
cin>>x>>y>>z;
int point_a= a*3 + b;
int point_x= x*3 + y;
if(point_a> point_x || point_a == point_x && c>z ){
cout<<"C"<<endl;
}
else if(point_a < p... | true |
98d112e93cd18c63ec6482f969504e5f6bc0aae3 | C++ | vpamrit/ArduinoSPIClientLib | /src/SPIClient.cpp | UTF-8 | 7,118 | 2.59375 | 3 | [] | no_license | #include <SPIClient.h>
static uint8_t PACKET_RETRY_LIMIT = 5;
bool ModeSwitch::set()
{
state = true;
return state;
}
bool ModeSwitch::use(bool consume)
{
if (!consume)
return state;
bool ret = state;
state = false;
return ret;
}
MessageToBeReceived SPIClient::msgComingIn;
MessageToB... | true |
9df4ceef28ca8b32c5f67f722878766749b7cebe | C++ | pratham-0094/100DaysOfCode | /Day-44/78_SubSet.cpp | UTF-8 | 956 | 3.4375 | 3 | [] | no_license | // https://leetcode.com/problems/subsets/submissions/
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
vector<vector<int>> ans;
vector<vector<int>> subsets(vector<int> &nums)
{
int n = nums.size();
vector<int> sub;
for (int i = 0; ... | true |
1309953d249c7958a078c4cdd1c434621ad4788f | C++ | toddxue/todd-algorithm | /graph.h | UTF-8 | 3,758 | 3.203125 | 3 | [] | no_license | /*
* graph.h --
*
* graph data structures and misc routines
*
* 2010/01/17: initial release by Todd Xue
*/
#ifndef _graph_h
#define _graph_h
#include <stdio.h>
struct Vertex {
// draw support
int x;
int y;
int no;
int edges_c;
void* data;
struct Edge* edges[100];
};
struct Edge {
... | true |
6ae8b6552cbd4a4f19a40bb377f03fb745d087fe | C++ | BlueLightning42/word-creator | /main.cpp | UTF-8 | 1,244 | 3.109375 | 3 | [] | no_license | #include "wordcreator.h" //dependancies are <fstream> <vector> <unordered_map> <string> <cstring>
// switched from fmt to iostream before uploading to github
#include <iostream>
void logger(std::string _to_log) {
std::cout << _to_log << std::endl;
}
int main() {
//initialize with the sound directory and callback f... | true |
7f6184b231ae1b34980919aa7fc4212dd612e0b9 | C++ | EndlessDex/cs225-fall2016 | /mp2/scene.h | UTF-8 | 698 | 2.75 | 3 | [] | no_license | #ifndef SCENE_H
#define SCENE_H
#include "image.h"
#include "png.h"
struct data { Image* pic; int x; int y; };
class Scene
{
public:
Scene(int max);
~Scene();
Scene(const Scene &source);
const Scene& operator=(const Scene &source);
void changemaxlayers(int newmax);
void addpicture(const char... | true |
c229e34e6795f7c500905ac3ce1cc73c0af0b32d | C++ | rakhiagr/Splitwise | /splitwise_transactions.cpp | UTF-8 | 2,352 | 3 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <stack>
#include <string>
#inc... | true |
e90e766d198bf607297d697e5eb4471d4ba844d7 | C++ | gky360/contests | /atcoder/panasonic2020/f/Main.cpp | UTF-8 | 1,102 | 2.8125 | 3 | [] | no_license | /*
[panasonic2020] F - Fractal Shortest Path
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(c) (c).begin(), (c).end()
const int K = 30;
int Q;
... | true |
e52a9d97c567fa083eaa4cabe0bebd43bc3fd029 | C++ | denfer57/ProjetSyntheseL3 | /Projet_synthese/Polygone.cpp | ISO-8859-1 | 3,590 | 3.0625 | 3 | [] | no_license | #include "Polygone.h"
#include "Visiteur.h"
Polygone::Polygone(){ }
Polygone::Polygone(vector<Point> points) : listesPoints(points){ }
Polygone::Polygone(const Couleur & couleur) : Forme(couleur) { }
string Polygone::toString() const
{
ostringstream oss;
oss << "Polygone : { Points : { ";
int taille = listesPoin... | true |
a32f867cff7d4b3526e52c2ddcbb47c743f86a3a | C++ | raywhz/Stack-and-Queue | /07 Stack infix to postfix.cpp | UTF-8 | 2,383 | 3.84375 | 4 | [] | no_license | //
// 07 Stack infix to postfix.cpp
// (a+b)*(c+d) == ab+cd+*
// Stack and Queue
//
// Created by Haozhou Wu on 10/2/17.
// Copyright © 2017 Haozhou Wu. All rights reserved.
//
#include <stdio.h>
#include <iostream>
#include <stack>
#include <string>
using namespace std;
// function to convert infix to postfix
s... | true |
8102645f7402f0d6521ac098c893290b59659311 | C++ | raghumdani/typocoder | /Solutions/432.cpp | UTF-8 | 416 | 3.0625 | 3 | [] | no_license | ///a(n) = (1+a(floor(n/2))) mod 3.
#include<bits/stdc++.h>
using namespace std ;
long long x ;
int solve(long long int i)
{
if(i == 0 )
return 0 ;
else
{
return((1 + solve(floor(i/2)))%3) ;
}
}
int main()
{
int g ;
cin>>g;
while(g--)
{
cin>>x;
int ans = solve(x) ;
... | true |
ae5b970c3180f4cf118259d7cd8223e1ad43ad60 | C++ | ESdove/Cpp-syntax-analysis | /47-类模板/47-类模板/Array.hpp | UTF-8 | 1,875 | 3.984375 | 4 | [
"MIT"
] | permissive | #pragma once
#include <iostream>
using namespace std;
template <typename Item>
class Array
{
friend ostream &operator<<<>(ostream &, const Array<Item> &);
// 用于指向首元素
Item *m_data;
// 元素个数
int m_size;
// 容量
int m_capacity;
void checkIndex(int index);
public:
Array(int capacity = 0);
~Array();
void add(Item ... | true |
6467bb91c052cef22e49d315fa02c3b83e88ca5f | C++ | junwang-nju/mysimulator | /include/new/pdb/atom/position/interface.h | UTF-8 | 621 | 2.5625 | 3 | [] | no_license |
#ifndef _PDB_Atom_Position_Interface_H_
#define _PDB_Atom_Position_Interface_H_
namespace mysimulator {
struct PDBAtomPosition {
public:
typedef PDBAtomPosition Type;
double X,Y,Z;
PDBAtomPosition() : X(0), Y(0), Z(0) {}
~PDBAtomPosition() { clearData(); }
void clearData() ... | true |
32b5632e35e1a1098d51d109457510ed075f5afa | C++ | Shiiiin/cpp | /baekjoon/problem1259.cpp | UTF-8 | 913 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
string n;
while(true){
cin >> n;
if(n == "0") break;
int split = n.length()/2;
if(n.length() %2 == 0){
string left = n.substr(0, split);
string right = n... | true |
85647929a6b67e583c997ee4d1b3dc63172acafb | C++ | jincaoawei/Simple-Simulator | /Force/AngularSpringForce.h | UTF-8 | 462 | 2.890625 | 3 | [] | no_license | #pragma once
#include "Force.h"
class AngularSpringForce : public Force{
public:
AngularSpringForce(Particle* p1, Particle* p2, Particle* p3, double angle, double ks, double kd);
void draw() override;
void update();
private:
Particle * const m_p1; // particle 1
Particle * const m_p2; // particle 2 ... | true |
ec6b385e9ae86023bb0ce0a2914c2bc2a7da7bb2 | C++ | muellesi/PSE_2018 | /PSE_2018_Gruppe1/src/test/test.cpp | UTF-8 | 354 | 2.5625 | 3 | [] | no_license | #include <gtest/gtest.h>
#include "../Logging.hpp"
TEST(EmptyTest, TrueAndFalse)
{
bool b = true;
EXPECT_EQ(b, true);
EXPECT_NE(b, false);
}
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
// When testing, we want the maximum available log output
Logging::setMaxLevel(DIAG_VERBO... | true |
d4a1e86a30848b2eebd444dfa97c572f9b6c01fe | C++ | MicrosoftDocs/cpp-docs | /docs/mfc/codesnippet/CPP/cstring-formatting-and-message-box-display_1.cpp | UTF-8 | 1,250 | 3.28125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | // The following example extracts a series of name, value pairs from a
// given source string:
// Input string consisting of a number of name, value pairs
LPCTSTR lpszSource = _T("\"Name\"=\"John Smith\"\n")
_T("\"Company\"=\"Contoso, Ltd\"\n\"Salary\"=\"25,000\"");
CString strNameValue; // an individual name, value ... | true |