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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a1a03e68410a0801cb348da44840b6c8f91c5389 | C++ | bmjoy/ZenonEngine | /znEngine/SceneFunctional/SceneNode/MeshComponent.h | UTF-8 | 926 | 2.515625 | 3 | [] | no_license | #pragma once
#include "ComponentBase.h"
class
__declspec(uuid("403E886D-7BD7-438B-868D-AC4380830716"))
CMeshComponent : public CComponentBase
{
public:
typedef std::vector<std::shared_ptr<IMesh>> MeshList;
public:
CMeshComponent(std::shared_ptr<SceneNode3D> OwnerNode);
virtual ~CMeshComponent();... | true |
8eef66a4197663c8b81da4510e1ed2b095c41b15 | C++ | sickwiz/ds-algo | /pointers/character_pointer.cpp | UTF-8 | 339 | 3.359375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
char c[]="aamir"; //
char *c1=&c[0]; // pointing to a string
cout<<c1<<endl; //1
char c2='a';
char *c3=&c2;
cout<<c3<<endl; //2
// AT 1 AND 2, IT WILL KEEP PRINTING UNTIL A NULL CHARACTER I.E \0 IS FOUND;
// char *ptr="asaad"; TH... | true |
0c7d6775fff70524f7f3ca571fc2d4da7acafd9e | C++ | JoeDumoulin/CS172 | /Homework/HW6Example/testComplex.cpp | UTF-8 | 1,176 | 3.375 | 3 | [] | no_license | // testComplex.cpp - test the complex number class
// compile with g++ testComplex.cpp Complex.cpp -o test
//
#include <iostream>
#include "Complex.h"
using namespace std;
int main()
{
// Test printing complex numbers
Complex c1(2,5);
Complex c2;
cout << c1.toString() << endl;
cout << c2.toSt... | true |
17887c31c8b4833fec06bb8f76b3282bb18e5a39 | C++ | elft3r/AlgoLab13 | /problems/w08/Collisions/Collisions2.cpp | UTF-8 | 1,962 | 2.75 | 3 | [] | no_license | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <iostream>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Delaunay_triangulation_2<K> Triangulation;
typedef Triangulation::Vertex_iterator Vertex_iterator... | true |
1d6afd7ff9a94357c81b49a0a478f4f4350028ae | C++ | littleboys/Chairman-Mao | /Chairman Mao/GuardOwnedStates.h | UTF-8 | 1,955 | 2.71875 | 3 | [] | no_license | #ifndef GUARD_OWNED_STATES_H
#define GUARD_OWNED_STATES_H
#include "State.h"
struct Telegram;
class Guard;
class GuardGlobleState : public State<Guard>
{
private:
GuardGlobleState(){}
//copy ctor and assignment should be private
GuardGlobleState(const GuardGlobleState&);
GuardGlobleState& ope... | true |
86c17e6fec87988aeb6d692bda97736b5a229338 | C++ | xjrueda/fixprime | /src/Node.cpp | UTF-8 | 13,088 | 2.890625 | 3 | [] | no_license | /*
* File: Node.cpp
* Author: DeveloperPrime
*
* Created on September 27, 2014, 9:57 PM
*/
#include "Node.h"
#include "Protocol.h"
#include "Component.h"
namespace fprime {
Node::Node() {
}
Node::Node(NodeType t) : _type(t), isRequired(false) {
}
Node::Node(const Node& other) :
_ty... | true |
100fd3861a05c1e578ad19bc503855b44620e9a8 | C++ | zylzjucn/Leetcode | /1200~1299/1209. Remove All Adjacent Duplicates in String II.cpp | UTF-8 | 547 | 2.796875 | 3 | [] | no_license | class Solution {
public:
string removeDuplicates(string str, int k) {
string res;
stack<pair<char, int>> s;
for (const auto& c : str) {
if (!s.empty() && s.top().first == c)
s.top().second++;
else
s.emplace(c, 1);
... | true |
36a9b58924e18fc2d4e1ec0cfb5a14d9a5812ff8 | C++ | StarThinking/MOBBS | /src/ceph-0.72.2-src/common/sharedptr_registry.hpp | UTF-8 | 4,165 | 2.625 | 3 | [] | no_license | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
*
* This is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General P... | true |
eb5e0981ea3d4e3c34ee96766bad9dd162d4ee84 | C++ | gd2dg/pat-basic | /code/46.cpp | UTF-8 | 618 | 2.8125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(int argc, char const *argv[]) {
int n;
int num1 = 0, num2 = 0;
cin >> n;
for (size_t i = 0; i < n; i++) {
int aWin = 0, bWin = 0;
int aSay, bSay, aShow, bShow;
cin >> aSay >> aShow >> bSay >> bShow;
int sum = aSay + bSay;... | true |
e7a4ed3fd7c1d3986da99cda2d4593af3d0ec586 | C++ | nyeBaker/MPhys | /Project/Monte_carlo.cpp | UTF-8 | 6,172 | 3.03125 | 3 | [] | no_license | /*
Author: Aneirin John Baker
Date: 23/09/17
Description: The script is where the HMC algorithm will take place. The intergration methods will be
housed here and will be executed here.
*/
#include "Monte_carlo.h"
#define Oscillator_flip 1
void lattice_Evolution(vector<vector<double> > &lattice,unsigned int len... | true |
732b32319fd8a7a8a44f930b4dde7b110355a832 | C++ | systemtwo/CellPhoneEscape | /main.cpp | UTF-8 | 2,716 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <SFML/Graphics.hpp>
#include "ResourceManager.h"
#include "StateManager.h"
#include "TitleState.h"
#include "LoaderState.h"
#include "GameState.h"
#include "GameOverState.h"
#include <typeinfo>
#include <cstdio>
//If you see a white pixel that is supposed to be an image, try looking to see... | true |
4a83212a4e7f8f22b447c007ceb5610ed9c803f6 | C++ | Jeevz10/kattis-code | /wheresmyinternet.cpp | UTF-8 | 1,001 | 3.109375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void DFS (int i,vector < vector<int> > &AL,vector<int> &visited) {
visited[i] = 1;
for (auto &v: AL[i]) {
if (!visited[v]) {
DFS(v,AL,visited);
}
}
}
int main() {
int houses,num;
cin >> houses >> num;
vector < vector<int> > AL;
AL.assign(houses, vector... | true |
ce29fb9d2cca6ade9381d6ee2c2cc0372a6e6928 | C++ | shramov/tll | /src/tll/util/argparse.h | UTF-8 | 4,816 | 2.71875 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) 2021 Pavel Shramov <shramov@mexmat.net>
*
* tll is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*
* Command line parser inspired by python argparse and used an idea from Simon Schneegans
*
* http://schneegans.github.io/... | true |
e7e6fe60f2fd1e8e5847edf1bd63f9471a5a9bec | C++ | ferrolho/feup-contests | /USACO/Section 1.3/Prime Cryptarithm/miguelsandim.cpp | UTF-8 | 3,298 | 3.0625 | 3 | [] | no_license | /*
ID: migueel1
PROG: crypt1
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
int numbers[9];
int subset_number;
unsigned int solution_number;
bool existsInSubSet(int num)
{
for (int i=0; i < subset_number; i++)
if (numbers[i] == num)
return t... | true |
0fe60fd88c2e5f53540988c8bef77543f8e8101e | C++ | riobun/142nb | /Classes/NetworkManager.h | GB18030 | 8,284 | 2.546875 | 3 | [] | no_license | // NetworkManager: շҪӿ
// οMultiplayer game programming, Joshua Glazer, Sanjay Madhav
// ģõ 2019.06.05
#ifndef _NETWORK_MANAGER_H_
#define _NETWORK_MANAGER_H_
class NetworkManager
{
public:
// Packet Types
//sent when first trying to join
static const uint32_t kHelloCC = 'HELO';
//sent when accepted by mast... | true |
756456a5c8c5599ab28fac042fbcecb039fbf93c | C++ | Fanqingle/- | /Desktop/个人春招/华为/华为机试/051 组成一个偶数最接近的2个质数/051.cpp | UTF-8 | 1,093 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
bool isPrimeNum(int n)
{
if(1 == n || 4 == n)
return false;
if(2 == n || 3 == n || 5 == n)
return true;
int v = (int)sqrt(n) + 1;
bool bOk = true;
for(int i = 2 ; i <= v ; i++)
{
if(n % i == 0)
{
... | true |
7b0a7d96e3190fc12fea59be076a8a17a3346efa | C++ | clumpytuna/ABBYY_2018 | /Functor/Functor.h | UTF-8 | 9,340 | 3.359375 | 3 | [] | no_license | // Автор: Михаил Анухин
// Описание: Класс CFunctor<typename T, TYPELIST_N(...) >
#ifndef Functor_h
#define Functor_h
#include "TypeList.h"
// Шаблонный класс реализующий возможности функтора.
// Можно поместить в класс функтор, функцию или метод класса и использовать их стандартным образом,
// вызывая оператор (). ... | true |
733c19019210b80da3f3fa7fa5e1e3c621af4717 | C++ | firewood/topcoder | /atcoder/arc_090/d.cpp | UTF-8 | 1,003 | 3.109375 | 3 | [] | no_license | // D.
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
typedef long long LL;
struct Edge {
int node;
LL dist;
};
struct Node {
LL value;
vector <Edge> edges;
bool vis;
};
vector<Node> nodes;
bool check(int n, LL valu... | true |
ccf708a3d9f670c2b02a235857463e21b36d563a | C++ | TheMoira/Semesters_1-4 | /CPP/lab08b/ExceptType.cpp | UTF-8 | 829 | 3.359375 | 3 | [] | no_license | #include "ExceptType.h"
#include <iostream>
ExceptType2::ExceptType2() : ExceptType(2), exp(new ExceptType4())
{
std::cout<<"***konstruktor ExceptType2\n";
}
void ExceptType1::PrzedstawSie() const
{
std::cout<<"Nazywam sie Except1\n";
}
void ExceptType2::PrzedstawSie() const
{
std::cout<<"Nazywam sie Exc... | true |
cabbd6b0b9457b265e16dd8da80fca6699ca4ee2 | C++ | DingZhan/Data-Structure-and-Algorithm-Chinese-PTA- | /07. 六度空间/a.cpp | UTF-8 | 2,617 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
using namespace std;
//Floyd算法,一定要记住中间结点k一定要放在最外层循环
#define MAX_N 10001
//如果结点i,j之间有一条直接的通路,则该元素值为1; 初始时,矩阵全部为0;
//后续扫描时,该矩阵用来存储顶点i,j之间的连通距离
unsigned char mat[MAX_N][MAX_N];
int main()
{
//设置高速I/O
std::ios::sync_with_stdio(false);
int N, M, i, a, b, j, k, v;
c... | true |
4a8ebaa75d34be101c5511fba43e99877407b959 | C++ | andj97/RG165-bethebachelor | /src/camera.cpp | UTF-8 | 1,968 | 2.78125 | 3 | [] | no_license | //
// Created by nikjan on 3/11/19.
//
#include <GL/glut.h>
#include <cmath>
#include "camera.hpp"
#define FIRST_VIEW (1)
#define SECOND_VIEW (2)
#define THIRD_VIEW (3)
#define FOURTH_VIEW (4)
Camera::Camera(double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX,
... | true |
768cc59252663904d0a0a80ea003ac8e4f49307d | C++ | blorin948/cpp | /day04/ex03/MateriaSource.cpp | UTF-8 | 1,122 | 3.296875 | 3 | [] | no_license | #include "MateriaSource.hpp"
MateriaSource::MateriaSource(void) : _count(0)
{
_save[0] = NULL;
_save[1] = NULL;
_save[2] = NULL;
_save[3] = NULL;
}
MateriaSource::MateriaSource(MateriaSource const &c)
{
*this = c;
}
MateriaSource &MateriaSource::operator=(MateriaSource const &c)
{
deleteAll();
int i = 0;
whi... | true |
84f93a83d795297649a8f4a1d3918404f58f3876 | C++ | Peteef/GFK_Projekt | /main.cpp | UTF-8 | 960 | 2.9375 | 3 | [] | no_license | #include "Figure.h"
#include "FigureArray.h"
#include <iostream>
#include "Line.h"
int main()
{
FigureArray arr;
arr.AddLine(0, 0, 1, 1, 5, 6, 7);
arr.Get()[0]->Get();
arr.AddCircle(5, 7, 5, 1, 4, 5, 7, 8, 65);
arr.Get()[1]->Get();
arr.AddRectangle(3, 4, 5, 26, 4, 6, 43, 3, 6, 6);
arr.Get()... | true |
9af741c041a179f24cc22c8933b492e6e27ebc7c | C++ | wook0605/wook0605.github.io | /C++/Phone_Book/test.cpp | UTF-8 | 2,435 | 3.46875 | 3 | [
"MIT"
] | permissive |
//
// main.cpp
// cpptest
//
// the template Created by Jong-Chul Yoon on 13/04/2019.
// Copyright ? 2019 Jong-Chul Yoon. All rights reserved.
// Coder : KiWook Lee
#include "phonebook.h"
using namespace std;
int main() {
int input;
char N_temp[20];
Person P_temp;
Phonebook... | true |
7713d9096d556cef5489b99ef7275fd7d8ff3825 | C++ | MarsXiaolei/Design-Patterns | /单例模式.cpp | GB18030 | 1,661 | 3.78125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Singelton {
public:
static Singelton* getInstance()
{
if (instance==NULL)
{
instance = new Singelton;
}
m_count++;
return instance;
}
int getCount()
{
return m_count;
}
private:
Singelton()
{
instance = NULL;
m_count = ... | true |
fa4ae8783c0a4f3e97ece0f67dc2085d1809c25e | C++ | thiagosantos1/Practice_CPlus | /Labs/Lab11/Circle.h | UTF-8 | 284 | 2.640625 | 3 | [] | no_license | #ifndef CIRCLE_H
#define CIRCLE_H
class Circle : public Shape
{
public:
Circle(int);
virtual void setX(int);
virtual void setY(int);
virtual void setGray (float);
virtual void drawOn (sf::RenderWindow &);
private:
int radius;
int x, y;
float colorGrey;
};
#endif | true |
80cb0453ac18dd6c786f44b477add2e77d305543 | C++ | hibamueen/hospital-management-system | /Hospital Management System/Hospital Management System/Doctor.h | UTF-8 | 1,887 | 3.140625 | 3 | [] | no_license | #pragma once
#include<iostream>
#include<string>
#include<conio.h>
#include "Patient.h"
using namespace std;
class Doctor
{
string name, Field;
int age, id, size, index, fees;
char gender;
double contact;
Patient * ptr;
bool slot;
public:
Doctor() { slot = true; ptr = NULL; }
Doctor(Doctor &q)
{
if (size > 1... | true |
b48e88749aaeb4bf42023b28f3d3bdf0fef93f24 | C++ | 93Hong/Algorithms | /9461_waveSequence/Main.cpp | UTF-8 | 345 | 2.625 | 3 | [] | no_license | #include <cstdio>
#pragma warning(disable:4996)
using namespace std;
long long int arr[101];
int main() {
int N;
scanf("%d", &N);
arr[1] = 1;
arr[2] = 1;
arr[3] = 1;
arr[4] = 2;
arr[5] = 2;
for (int i = 6; i <= 100; i++) {
arr[i] = arr[i-1] + arr[i-5];
}
while (N--) {
int n;
scanf("%d", &n);
print... | true |
c93ae15e0e00245eae5589c106925da37ae99793 | C++ | warrenween/fuzzification | /ia.cpp | ISO-8859-1 | 10,277 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <locale.h>
#include <ctype.h>
void layout(){
setlocale(LC_ALL, "Portuguese");
printf("\n");
for(int i =0; i <79; i++)
printf("-");
printf("\n");
printf(" Bem vindo ao bar do Gallo ");
... | true |
d2cfeb66154f90ea0e7f1f3614da04dc6807d5ce | C++ | enriquecs095/Ejercicio-Basico-c- | /MiPrimerEjercicioEnC++/Main.cpp | UTF-8 | 2,641 | 3.890625 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{ //ejercicio 4.26 , 4.27 y 2.29
int opcion;
int numero1, numero2, numero3, numero4, numero5;
int contador = 0;
double entrada2 = 0;
int entrada;
bool salir = true;
do {
cout << "\nEjercicios Basicos de c++\n" << endl;
cout << "1. Numero palindrome" << e... | true |
0334798896e57caa4f11892757fc5be7edf86672 | C++ | drbaird2/Restart | /Objects/Sphere.cpp | UTF-8 | 2,584 | 3 | 3 | [] | no_license | #include "Sphere.h"
#include "../Utilities/Constants.h"
Sphere::Sphere() :
center(Point3(0,0,0)),
radius(1.0)
{}
Sphere::Sphere(Point3 cen, double rad) :
center(cen),
radius(rad)
{}
Sphere::Sphere(const Sphere& sphere)
: Object(sphere)
, center(sphere.center)
, radius(sphere.radius)
{
mat = sphe... | true |
678cf735c62a7fdecf9e6a27c33fbc1bacc4c160 | C++ | DianaGeorgievaa/Data-Structures-and-Algorithms- | /Practice_05/Task4.cpp | UTF-8 | 1,000 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include<vector>
#include<stack>
using namespace std;
int main()
{
long long n;
cin >> n;
vector<long long>numbers;
if (n <= 9)
{
for (int i = 1; i <= n; i++)
{
numbers.push_back(i);
}
}
else
{
for (int i = 1; i <= 9; i++)
{
numbers.push_back(i);
}
... | true |
248c4e41d2e9e2763e96cb33463b41d0c11913c4 | C++ | whguo/LeetCode | /C++/Tree/449.Serialize and Deserialize BST.cpp | UTF-8 | 2,100 | 3.828125 | 4 | [] | no_license | /*
对二叉搜索树进行序列化和反序列化。
*/
/*
思路:由于二叉搜索树的中序遍历是一定的,所以任何相同结点的二叉搜索树中序序列一样。
因此,为了使得序列化后的唯一性,考虑使用前序遍历。
前序遍历的序列中,先是root,然后是root左侧,最后root右侧。
左右侧是靠root结点的值区分开的,左侧的小于root,右侧大于。
反序列化是依据这一特点解开的。
为了方便,这里使用4字节的char直接表示一个int值。
*/
#include <iostream>
#include <cstring>
#include <limits.h>
using namespace st... | true |
001f416c773218065ef6509659487684eff8395e | C++ | wsmind/leaf | /src/engine/resource/ResourceManager.inline.h | UTF-8 | 3,366 | 2.984375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <algorithm>
#include <engine/resource/Resource.h>
#include <engine/resource/ResourceWatcher.h>
template <class ResourceType>
void ResourceManager::updateResourceData(const std::string &name, const unsigned char *buffer, size_t size)
{
ResourceDescriptor &descriptor = findDescriptor<Resource... | true |
891b6dcad153f9818436b02b1308e61f5376c929 | C++ | marioandre01/PTC-Projeto1B_ComSerialTunTxRx_Cpp | /ComSerialTunTxRx/Callback.cpp | UTF-8 | 1,060 | 2.640625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Callback.cpp
* Author: marioandre
*
* Created on 1 de Novembro de 2018, 00:12
*/
/*
* To change this license hea... | true |
82bfd535fc7e45c81f76a66366f5200715e95df3 | C++ | Chennyben/Data-Science | /PA Excercise/PA Excercise/new randf/main.cpp | UTF-8 | 3,792 | 2.90625 | 3 | [
"MIT"
] | permissive | /*
*
* Compilation line:
g++ -o main main.cpp DensityTree.cpp -lopencv_core -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml
*
*/
#include "DensityTree.h"
Mat densityForest(unsigned int D, unsigned int numberOfThreshodls,unsigned int numberOfTrees, Mat X);
Mat generateData();
void plotData(Mat da... | true |
c42213daad3d88cb36ca37fe5e5ad0d6a49fecaf | C++ | ayabdelrahman72/Data-Structures-using-C-Plus-Plus | /Chapter11/Binary Trees/binaryTreeType.h | UTF-8 | 1,443 | 3.15625 | 3 | [] | no_license | #ifndef BINARYTREETYPE_H
#define BINARYTREETYPE_H
#include "stackLinkedList.h"
class binaryTreeType
{
public:
~binaryTreeType();
binaryTreeType();
binaryTreeType(const binaryTreeType &);
const binaryTreeType &operator=(binaryTreeType &);
bool isEmpty()const;
void in... | true |
865e7a507fe74436d19c401617ac8ed96566e347 | C++ | ENgineE777/Atum | /Atum/Services/TaskExecutor/TaskExecutor.h | UTF-8 | 3,803 | 2.9375 | 3 | [
"Zlib"
] | permissive |
#pragma once
#include "Support/Support.h"
#include <vector>
#include <map>
/**
\ingroup gr_code_services_task_executor
*/
/**
\brief TaskExecutor
This class manages execution of tasks. Each task is a callback, i.e. method
of class. Task can be ordered by level of execution and can be combined in single
pool via c... | true |
a93961dc20d8cfc3b405c5fd02695f1d5f06dba4 | C++ | 96scar/UNT_code | /csce4550/project.cpp | UTF-8 | 4,579 | 3.125 | 3 | [] | no_license | #include "header.h"
using namespace std;
//hashtable.push_back("0");
//hashtable.resize(SIZE);
vector<string> hashtable(100, "0");
int main()
{
User myUser;
int logged_in = 0; //whether or not anyone is logged in
int Sinput = 0; //start input
int Uinput = 0; //user input
int start = 1; //start is true
int Us... | true |
25b0f7168ab1db55aa218e42afaeb4ea1b916a8d | C++ | rashikshrestha/opencv-try1 | /smooth_using_trackbar.cpp | UTF-8 | 2,341 | 3.3125 | 3 | [] | no_license | #include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
char string1[] = "Smooth Type:\n 0: Normal Blur\n 1: Gaussian Blur\n 2: Medial Blur\n 3: Bilateral Filter";
int smooth_type = 0;
int max_type = 3;
char string2[] = "Maximum Kernel size";
int kernel_size = 0;
int max_kernal_size = 20;
c... | true |
ad03f93429cfb3772ef35c2c0ab8036e92126a8a | C++ | actnet/saedb | /storage/mmap_test.cpp | UTF-8 | 1,258 | 2.953125 | 3 | [] | no_license | #include <cstdlib>
#include <iostream>
#include <string>
#include "testing/testharness.hpp"
#include "mmap_file.hpp"
using namespace std;
struct MMapFileTest {
MMapFileTest() {
filepath = saedb::test::TempFileName();
}
~MMapFileTest() {
int ret = remove(filepath.c_str());
ASSERT_T... | true |
eec8d680695c06b5fe7be734f19b7ec232205e01 | C++ | shreysingla11/ssl-project | /Backend/Parser/submissions/Assignment 4/52.cpp | UTF-8 | 2,826 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <list>
using namespace std;
class counter{
private:
long n;
vector<long> page;
long maxAtt;
list< list<long> > order;
vector<list< list<long> >::iterator> point;
vector<list<long>::iterator> position;
public:
... | true |
c648f2942e5069649e70c6c0e48e99244df2c660 | C++ | WassimHajji10/ComicBookReader | /include/comic_book_reader_contract.h | UTF-8 | 1,041 | 2.609375 | 3 | [] | no_license | #pragma once
#include <string>
#include <map>
#include <opencv2/opencv.hpp>
#include <vector>
class ArchiveInterface
{
// class for archiving file, unzip the image files
// Use OpenCV, format for image: "cv::Mat"
public:
bool virtual loadArchivedFiles(std::string file_path) = 0;
// Use 7z function
//load to priv... | true |
7966acb60911e52315786e50316027c7947d63bf | C++ | brem-hub/project-2 | /container/container.h | UTF-8 | 3,182 | 3.171875 | 3 | [] | no_license | #ifndef PROJECT_CPP_CONTAINER_CONTAINER_H_
#define PROJECT_CPP_CONTAINER_CONTAINER_H_
#define MAX_CONTAINER_SIZE 10001
#include "../objects/number.h"
#include "../objects/complex.h"
#include "../objects/fraction.h"
#include "../objects/polar.h"
/*
* Класс контейнера, хранящего в себе числа.
*/
class container {
... | true |
fc995d7feb6ee4d76a5caf044dd8e52fa16225da | C++ | karnkaul/LittleEngineVk | /engine/src/graphics/animation/animation.cpp | UTF-8 | 1,222 | 2.640625 | 3 | [
"MIT"
] | permissive | #include <le/core/visitor.hpp>
#include <le/graphics/animation/animation.hpp>
namespace le::graphics {
auto Animation::Channel::duration() const -> Duration {
return std::visit([](auto const& s) { return s.duration(); }, storage);
}
void Animation::Channel::update(NodeLocator node_locator, Duration time) const {
au... | true |
ac5e1e517ce90f6ab46446feaf44875b2ce1e36d | C++ | GodOfProgramming/ltt | /c++/test/tag-parser.cpp | UTF-8 | 4,876 | 2.953125 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <unordered_map>
#include <memory>
class Tag;
typedef std::vector<std::string> string_vec;
typedef std::unordered_map<std::string, std::string> AttributeMap;
typedef std::unordere... | true |
70dcc8c7df069aa71140278bd71c79b1d67b57c3 | C++ | TwentyFiveSeven/Algorithm | /C-Code/Map)위장.cpp | UTF-8 | 459 | 2.578125 | 3 | [] | no_license | #include <string>
#include <vector>
#include <iostream>
#include <map>
using namespace std;
map<string,vector<string>> M;
int count=0;
int solution(vector<vector<string>> clothes) {
int answer = 1,Fsize = clothes.size();
for(int i=0;i<Fsize;i++)
M[clothes[i][1]].push_back(clothes[i][0]);
int Msize =... | true |
93b0f7e5ab18e3b705f6a6de6ca57efe80efa8b1 | C++ | opendarkeden/server | /src/server/gameserver/BloodBibleBonusManager.cpp | UTF-8 | 4,266 | 2.734375 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////////////
// Filename : BloodBibleBonusManager.cpp
// Written By : beowulf
// Description :
//////////////////////////////////////////////////////////////////////////////
#include "BloodBibleBonus.h"
#include "BloodBibleBonusManager.h"
#include ... | true |
7485d941314eadb9caaa6617863924af5022b6f3 | C++ | joelbygger/adventofcode19 | /src/day3/routes.hpp | UTF-8 | 967 | 2.953125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <cstdint>
#include <utility>
#include <vector>
class Routes
{
public:
using rawPoint = std::pair<char, int32_t>;
using rawRoute = std::vector<rawPoint>;
using rawRoutes = std::vector<rawRoute>;
// Route is expected to be on format Rn or Dn or Un or Ln.
void addRoutes(const raw... | true |
72da5a86734396e7d5572a002b24dc983f5883ea | C++ | PMSeitzer/openmp-example | /PS5_problem2.cpp | UTF-8 | 1,824 | 3.6875 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct cae_t {
int value;
bool isLocked = false;
int numAttempts = 0;
};
int test_and_set(int* mem);
bool compare_and_exchange(cae_t * mem, int compare_value, int swap_value);
int main(int argc, char *argv[])
{
cae_t mem;
mem.value = 4;
int compare_v... | true |
0ae21882ce5671335b5888db1f8be035ee14f6a5 | C++ | cheunkay/carolc-shawnkade-ixd-textile-proj1 | /Sequential_blinking_10_.ino | UTF-8 | 3,040 | 2.9375 | 3 | [] | no_license | /*
Light-up distance sensor
Reading data from the ping/ultrasonic sensor. By measuring arbitrarily
set distance, white light emitting diodes (LEDs) turn on one after the other
when an object comes into close proximity with the sensor. When an object
goes out of the set distance, LEDs turn off one after the ... | true |
f34cd7aa9d80f625352122cacdbf10eed812cf09 | C++ | Ryednap/Coding-Competition | /Codeforces/Practice/Gym/Tree(Galen_Colin_Mashup)/G.cpp | UTF-8 | 2,528 | 2.625 | 3 | [] | no_license | // include the library code for LCD
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
float value;
int pressureinbar = 0;
String ssid
= "Simulator Wifi"; // SSID to connect to
String password = ""; // Our virtual wifi has no password (so dont do your banking
String host
= "api.thingspeak.com"; // Open W... | true |
c522a330d949ccee7158d24ce8eeedadcd1499c2 | C++ | imdanielsp/nex | /src/nex_stmt.hpp | UTF-8 | 5,876 | 2.796875 | 3 | [] | no_license | #ifndef NEX_STMT_HPP_
#define NEX_STMT_HPP_
#include "nex_token.hpp"
#include "nex_expr.hpp"
#include <memory>
#include <vector>
namespace nex::ast::stmt {
struct Block;
struct Class;
struct Expression;
struct Function;
struct If;
struct Print;
struct Return;
struct Let;
struct While;
class Visitor {
public:
vir... | true |
f869b4ccc7bd95209d597c7a11af32662fde0725 | C++ | priety33/arrays | /1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit.cpp | UTF-8 | 1,356 | 2.84375 | 3 | [] | no_license | class Solution {
public:
int longestSubarray(vector<int>& nums, int limit) {
int n=nums.size();
int len=0;
int s=0,e=0;
pair<int,int> low={nums[0],0}, high={nums[0],0};
while(s<n && e<n)
{
if(nums[e]>high.first) high={nums[e], e};
if(nums[e]<lo... | true |
41b82264eca60d3fb290c2d7197e766e002abdb9 | C++ | garrity-patrick/foamy | /include/exp_operator.hpp | UTF-8 | 2,112 | 3.046875 | 3 | [] | no_license | // exp_operator.hpp
// @author Chris Cornelius
// Created 11/07/2011
// An extension of exp_base to represent exp_operator - the set of binary operators
#ifndef _EXP_OPERATOR_HPP_
#define _EXP_OPERATOR_HPP_
#include "exp_base.hpp"
//Temporary fix to get around multiple enum declaration for OperatorType
#include "toke... | true |
62ce2ef0aecb89edbf4d72983687639d45df3889 | C++ | tarce/Practice_Problems | /CountAndSay.cpp | UTF-8 | 745 | 2.953125 | 3 | [] | no_license | class Solution {
public:
string countAndSay(int n) {
string seq = "1";
int iter = 1;
while (iter < n) {
string newSeq;
char last = seq[0];
int count = 0;
for (int i = 0; i <= seq.size(); i... | true |
ebdb06fbd1b4e9a787cde859042a5ccd63502519 | C++ | C0DE-RUNNER/Practice-Questions-DSA | /Arrays/Middle-of-three.cpp | UTF-8 | 1,122 | 3.4375 | 3 | [] | no_license | Given three distinct numbers A, B and C. Find the number with value in middle (Try to do it with minimum comparisons).
Example 1:
Input:
A = 978, B = 518, C = 300
Output:
518
Explanation:
Since 518>300 and 518<978, so
518 is the middle element.
Example 2:
Input:
A = 162, B = 934, C = 200
Output:
200
Exaplanation:... | true |
f6dabb350c1650b0968e2f179b522e7fa874eec7 | C++ | PeterSansan/job_prepare | /C与CPP语言基础/const关键字/const_c.cpp | UTF-8 | 2,343 | 3.375 | 3 | [] | no_license | /*顺序表示例代码*/
#include<iostream>
#include <fstream>
#include<time.h>
#include<stdlib.h>
#include<math.h>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <random>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <sstream> //字符串调用读写... | true |
0ed9c379609cd0d8c7c1986dbe9d3f9292ab50a2 | C++ | AlfaIV/C-plus-plus--Stepic | /sum/sum.cpp | UTF-8 | 914 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
void sum(){
int len;
cin >> len;
//cout << len << "\n";
int a,b;
for(int j = 0; j < len; ++j){
//cout << j << " ";
cin >> a;
cin >> b;
//cout << a << " " << b << "\n";
cout << a + b;
if (j + 1 != len){
cout << "\n";
... | true |
78392f122ffb849196aeaebcc533f4a672fc2cea | C++ | JingHuu/BreakoutHit | /GAD173/Main.h | UTF-8 | 4,131 | 3.171875 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
#include <iostream>
constexpr float windowX = { 1000 }; // window width
constexpr float windowY = { 600 }; // window height
const sf::Color colour = sf::Color(255, 255, 0, 255); // custom colour. value between 0-255 for R,G,B,A
class Game // gonna make this a game m... | true |
6f124d0b66ae7caffa163fbf77615a0d359615a5 | C++ | hagego/SmartHome | /FS20ShutterControl/libraries/TinyTime/TinyTime.h | UTF-8 | 22,460 | 2.953125 | 3 | [] | no_license | #ifndef __TINYTIME_H
#define __TINYTIME_H
/**
* This class implements a time base with time based events.
* It only cares about time of day, not about the date.
* Events can be schedules as absolute time or relative to sunraise or sunset
*/
// some constants that cannot be put inside class declaration
const IPAd... | true |
a2d0ae6b17c7f28b2592a91f722ecfe62c0289d6 | C++ | ras0219/mlcard | /shared/game.h | UTF-8 | 4,905 | 2.71875 | 3 | [] | no_license | #pragma once
#pragma once
#include "vec.h"
#include <fmt/format.h>
#include <string>
#include <vector>
enum class ArtifactType
{
DirectImmune,
CreatureImmune,
DoubleMana,
HealCauseDamage,
LandCauseDamage,
Count,
};
const char* artifact_name(ArtifactType t);
struct Card
{... | true |
1d4265911e1456a2c2b221b2beec3aafa11644c4 | C++ | thomoncik/hexadoku | /src/Model/BoardCell.cpp | UTF-8 | 826 | 2.890625 | 3 | [
"MIT"
] | permissive | //
// Created by Jakub Kiermasz on 2019-05-11.
//
#include <Model/BoardCell.hpp>
const int BoardCell::EMPTY_VALUE = 0;
const int BoardCell::MAX_HEXADOKU_VALUE = 16;
const int BoardCell::MAX_STANDARD_VALUE = 9;
BoardCell::BoardCell() : isSelected(false), isCorrect(true), value(EMPTY_VALUE) {
}
void BoardCell::SetVa... | true |
faa48ad2759121a7183570972d080c5cc24ce157 | C++ | adityanjr/code-DS-ALGO | /GeeksForGeeks/Practice/NDigitNumbersWithDigitsInIncreasingOrder.cpp | UTF-8 | 897 | 3.171875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <queue>
#include <string>
using namespace std;
struct temp{
long long int num;
int last;
int len;
};
int main() {
//code
int test;
cin >> test;
while(test--){
int n;
cin >> n;
queue<temp> q;
for(int i = 1; i <= 9; i++){
temp t;
... | true |
23c60370ba35739b0a003226e6db1719215acb43 | C++ | lucasbivar/competitive-programming | /competitions/SBC Marathon/SBC_2020/E/e.cpp | UTF-8 | 1,084 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
vector<int> amgs[100005];
int idades[100005];
int visited[100005];
int qtd[100005];
int anf, l, r;
void DFS(int x){
for(int i = 0; i < amgs[x].size(); i++){
int v = amgs[x][i];
if(visited[v] != -1) continue;
... | true |
c0714f425c4ea515530f861fe4a79f213fa4fd3d | C++ | claudiiolima/Prog_III | /Aula06/Car/Car.cpp | UTF-8 | 740 | 3.34375 | 3 | [] | no_license | #include "Car.h"
Car::Car(int year, string brand) : yearModel(year), make(brand), speed(0) {}
int Car::getYearModel() { return yearModel; }
void Car::setYearModel(int year) { yearModel = year; }
string Car::getMake() { return make; }
void Car::setMake(string brand) { make = brand; }
int Car::getSpeed() { return s... | true |
25aaf9cfc7f4fcd40afef6be398b90a1bb089c09 | C++ | RichardKlem/IMS | /main.cpp | UTF-8 | 1,743 | 2.515625 | 3 | [] | no_license | /**
* @author1: Martin Haderka
* @author2: Richard Klem
* @email1: xhader00@stud.fit.vutbr.cz
* @email2: xklemr00@stud.fit.vutbr.cz
* @login1: xhader00
* @login2: xklemr00
* @date: 6.11.2020
*/
#include <iostream>
#include "CellularAutomaton.h"
#include "main.h"
int main(int argc, char *argv[]) {
unsigned... | true |
0912020094a053f32c3815a09a933b9e9671eb96 | C++ | radtek/Pos | /MenuMate/MenuMate/Source/product-count-down/spinlock.cpp | UTF-8 | 452 | 2.546875 | 3 | [] | no_license | #include <spinlock.hh>
namespace utilities {
namespace locking {
spinlock::spinlock()
: lock_(false)
{
}
spinlock::~spinlock()
{
}
void
spinlock::enter()
{
while (InterlockedCompareExchange(&lock_, true, false))
;
}
void
spinlock::exit()
{
InterlockedExchange(&lock_, false);
}
... | true |
a4c56703f900d8c99c759d124737861b83cfb8ec | C++ | virtyaluk/leetcode | /problems/1499/solution.cpp | UTF-8 | 1,283 | 3.03125 | 3 | [] | no_license | // yi + yj + |xi - xj| = yi + xi + yj - xj
class Solution {
public:
int findMaxValueOfEquation(vector<vector<int>>& points, int k) {
int ans = INT_MIN;
deque<pair<int, int>> dq; // xj, yj - xj
for (const vector<int>& point: points) {
int xj = point[0], yj = point[1], di... | true |
5095ffc7ade8684b8ca90e0a2dffb912f1b553b5 | C++ | skeimeier/Arduino | /JEE/JeeBlink/JeeBlink.ino | UTF-8 | 594 | 3.125 | 3 | [] | no_license |
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
#include <Ports.h>
Port led (1);
void setup() {
Serial.begin(57600);
Serial.println("\n[JeeBlink]");
// initialize the digital pin as an output.
// Pin 13 ... | true |
8c1f0b83741224e6943bb3aee035b718ae6e2fff | C++ | jiangyinzuo/icpc | /data_structure/segment_tree/yinchuan_g.cpp | UTF-8 | 3,270 | 2.84375 | 3 | [] | no_license | //
// Created by jiang on 2020/8/12.
//
#include <cstdio>
#include <cstring>
#include <array>
long long seq[100008];
std::array<int, 4> seg_tree[400008]; // 本题build初始化
std::array<int, 4> multi_tags[400008];
/**
* 下推懒惰标记
* @param l 左区间端点
* @param r 右区间端点
* @param num 序号
*/
void push_down(int l, int r, int num) {... | true |
d8adaaa36555c136f0b5f3977f7ec1a1856818e1 | C++ | tdcoish/GUNSLINGER_PLAYART_CREATOR | /PlayArtCreator/Structs.h | UTF-8 | 1,566 | 2.78125 | 3 | [] | no_license | #pragma once
#include <string>
#include <list>
struct Vec2 {
int x, y;
Vec2 operator+(const Vec2& v2) {
Vec2 v;
v.x = x + v2.x;
v.y = y + v2.y;
return v;
}
Vec2 operator-(const Vec2& v2) {
Vec2 v;
v.x = x - v2.x;
v.y = y - v2.y;
return v;
}
Vec2 operator*(const int val) {
Vec2 v;
v.x = x * v... | true |
f3abacbc91b97ebc29a031fb41da2962cab1dea7 | C++ | busraeskiyurt/arduino | /sunflower.ino | UTF-8 | 804 | 3.0625 | 3 | [] | no_license | #include<Servo.h>
int a =90;
Servo sevro;
void setup() {
Serial.begin(9600);
sevro.attach(8);
sevro.write(90); //we move the servo motor to the 90 position at the start
}
void loop() {
int ldr1 = analogRead(A0);
Serial.println(ldr1);
int ldr2 = analogRead(A1);
Serial.println(ldr... | true |
ad6e70bddd18c4ab57ff65ccf735ea153dd2081e | C++ | ShubhikaBhardwaj/Leetcode-Coding | /journeytoMoon.cpp | UTF-8 | 1,026 | 2.859375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Edge
{ public:
int v;
Edge(int v)
{
this->v=v;
}
};
vector<vector<Edge>> graph;
void addEdge(int v,int u)
{
graph[v].push_back(u);
graph[u].push_back(v);
}
int ConnectedComp(int x,vector<bool>&vis)
{
vis[x]=true;
in... | true |
b250d49dcd947066186df9e53d4675ffdea83a94 | C++ | Matthew-E-Gould/Past-Projects | /IoT Plant Grower Sim/CW1/Source.cpp | UTF-8 | 4,905 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <windows.h>
#include <stdlib.h>
#include <time.h>
#include <string>
#include "Classes.h"
using namespace std;
uint16_t Random16Bit(); // generates a random 16 bit value
void InputCheck(uint16_t &i, uint16_t min, uint16_t max);
void turnOn(Machine &m, Weather &w);
int main(... | true |
de56b9612b76a753d7c5cc8b0e4ddf4ac238c6a7 | C++ | ChengHsinHan/myOwnPrograms | /CodeWars/C++/8 kyu/#24 Collatz Conjecture (3n+1).cpp | UTF-8 | 1,058 | 4 | 4 | [] | no_license | // The Collatz conjecture (also known as 3n+1 conjecture) is a conjecture that
// applying the following algorithm to any number we will always eventually
// reach one:
//
// [This is writen in pseudocode]
// if(number is even) number = number / 2
// if(number is odd) number = 3*number + 1
// #Task
//
// Your task is t... | true |
c35df17a5062fe3c5dbf58875978322675d57a26 | C++ | buppter/LearnCPP | /struct/04_stuct_nesting_stuct.cpp | UTF-8 | 592 | 3.21875 | 3 | [] | no_license | //
// Created by SXTian on 2019/10/18.
//
#include <iostream>
using namespace std;
//定义学生的结构体
struct Student {
string name;
int age;
int score;
};
//定义老师结构体
struct Teacher {
int id;
string name;
int age;
struct Student stu;
};
int main4(){
Teacher t;
t.id = 100;
t.name = "老王... | true |
b8a91175d213722623e17ce57c0e0573b04e5df7 | C++ | HERECJ/FINISH | /1503 1A.cpp | WINDOWS-1252 | 1,106 | 3.109375 | 3 | [] | no_license | //===1503
#include <iostream>
#include <string.h>
using namespace std;
char Input[100];
char Result[105];
int main(){
string s;
string Out;
int len,c;//cǽλ
int i,j;
memset(Result,0,sizeof(char)*105);
while(cin >> s){
memset(Input,0,sizeof(char)*100);
c = 0;
if(s.compar... | true |
f89915914cfedbb7e35f995b539076ee9cea7a85 | C++ | jairochaves2/Curso-Sertaozinho | /exemplos/Aula 1 e 2/exemplo-06.cpp | UTF-8 | 288 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[]) {
float numero,num2,div;
printf("Digite um numero: ");
scanf("%f", &numero);
printf("Digite um numero: ");
scanf("%f", &num2);
div=numero/num2;
printf("seu numero eh: %f\n", div);
return 0;
}
| true |
c183d6849ac0c9322dcb7450490e4b4b1eb3462d | C++ | byreave/Simple2DGameEngine | /Engine/PhysicsSystem.h | UTF-8 | 1,632 | 2.515625 | 3 | [] | no_license | #pragma once
#include "GameObject.h"
#include <vector>
#include "SmartPointer.h"
namespace Engine {
namespace Physics {
class PhysicsSystem {
private:
WeakPointer<GameObject> m_GameObject;
bool isKinematic;
float m_Mass;
float m_DragCoef; //Positive
Point2D<float> m_Force;
//Point2D<float> m_Velo... | true |
b4db975928bc0c063f2845be0ca4eb070a3308a8 | C++ | erik-zwart/leetcodeCpp | /LinkedListSerializer.cpp | UTF-8 | 1,608 | 3.453125 | 3 | [] | no_license | using namespace std;
struct EncodedList {
std::string storage;
};
struct Node {
int val;
struct Node* next;
Node(int v) : val(v), next(nullptr) {}
};
EncodedList encode(Node* head) {
EncodedList e;
for(auto it = head; it != nullptr; it = it->next) {
e.storage += to_string(it->val);
if(it->next) e.storage +=... | true |
21106dc11bd513554c282a998bb3097f4c3e8b03 | C++ | MakerTakala/ZeroJudge | /a539.cpp | UTF-8 | 385 | 2.984375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n,a[1000];
while(cin>>n){
for(int i=0;i<n;i++)
cin>>a[i];
int sum=0;
for(int i=0;i<n;i++)
for(int j=i-1;j>=0;j--)
if(a[i]<a[j])
sum++;
cout<<"Minimum... | true |
72783da99dd5306b6c772e8f588b187859bd7c55 | C++ | Leamsy/Fundamentos-de-la-Programacion-2015-2016 | /Sesión 9/III_Intervalo.cpp | ISO-8859-1 | 2,530 | 3.65625 | 4 | [] | no_license | /***************************************************************************/
// FUNDAMENTOS DE PROGRAMACIN
// GRADO EN INGENIERA INFORMTICA
//
// CURSO 2015-2016
// (C) ISMAEL MOYANO ROMERO
// 1B - GRUPO 3
//
// RELACIN DE PROBLEMAS 3
// EJERCICIO 22
/*
Programa que calcula la pertenecia de un nmero a d... | true |
860e488425afb2e628e10f94a9160ab65f9693c0 | C++ | EdwinJosue16/Proyecto_Integrador_Redes-SO | /src/Green/Log.cpp | UTF-8 | 428 | 2.703125 | 3 | [] | no_license | /// @copyright 2020 ECCI, Universidad de Costa Rica. All rights reserved
/// This code is released under the GNU Public License version 3
/// @author Jeisson Hidalgo-Céspedes <jeisson.hidalgo@ucr.ac.cr>
#include "Log.hpp"
Log &Log::getInstance()
{
static Log log;
return log;
}
void Log::write(const std::string &te... | true |
5ceacdc4d4ed9aee50da445448c304d988742df7 | C++ | fumyparli/problem-solving | /lyricsSearching_binary_search.cpp | UTF-8 | 1,473 | 2.703125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector<vector<string>> a(10001);
vector<vector<string>> ra(10001);
int get_iv(string &s1, string &s2, int flag) {
int s_size = s1.size();
if (flag == 0) {
auto ed = lower_bound(a[s_size].begin(), a[s_size].end(), s2);
auto st = upper_bound(a[s_size]... | true |
dff6711799096010871728a01056514022c400fb | C++ | wxz879526/UIEngine | /components/skia/src/gpu/gl/GrGLEffect.h | UTF-8 | 4,748 | 2.546875 | 3 | [
"MIT"
] | permissive | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrGLEffect_DEFINED
#define GrGLEffect_DEFINED
#include "GrBackendEffectFactory.h"
#include "GrGLProgramEffects.h"
#include "GrGLShaderVar.h"
#include "GrGLSL.h"
clas... | true |
e4d1b310bfe77fce2037d35fffc76e91a9365544 | C++ | HomuraVehicle/HomuraMachine_Ontake | /hmrM2500_Ontake/hmLib_v3_04/position.hpp | SHIFT_JIS | 9,298 | 2.90625 | 3 | [] | no_license | #ifndef HMLIB_POSITION_INC
#define HMLIB_POSITION_INC 100
#include <cmath>
#include <iostream>
namespace hmLib{
template<class T>
struct di_position{
public:
T x;
T y;
di_position<T>(){
x=0;
y=0;
}
di_position<T>(T _x,T _y){
x=_x;
y=_y;
}
di_position<T>(const di_position<T>& _T){
x=_T.x;... | true |
400b2a4828114e13e2844a67afa35566a7e1cc04 | C++ | hjed/owr_software | /gui/src/oculus_arm_gui/src/FocusArm.cpp | UTF-8 | 545 | 2.546875 | 3 | [] | no_license | /**
* Uses mouse input to center the oculus on the correct point.
* Started by: Harry J.E Day
* Date: 5/11/2015
*/
#include "oculus_arm_gui/FocusArm.hpp"
FocusArm::FocusArm() {
//key to activate this mode
shortcut_key_ = 'o';
}
FocusArm::~FocusArm() {
//does nothing
}
void FocusArm::o... | true |
86e6cee552efc5ec07bde48924cf62a6aa18b4cd | C++ | bk19881128/Study | /C++_primer/13_chapter/5/hasPtr_test.cc | UTF-8 | 969 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <stdexcept> //runtime_error
#include <list>
#include <deque>
#include <vector>
#include <forward_list>
#include <string>
#include <stack>
#include <algorithm>
using namespace std;
class HasPtr {
public:
HasPtr(const std::string &s = std::string()):
ps(new std::string(s)), i(0) { }
H... | true |
6ab1dddc1a6e0603ed404e6cafce74d1de53ee25 | C++ | infparadox/Data-Structures-and-Algorithms | /gametheory/stones.cpp | UTF-8 | 770 | 2.75 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll mex(unordered_set<ll>set)
{
ll ans=0;
while(set.find(ans)!=set.end())
ans++;
return ans;
}
ll calcgrundy(ll n,ll grundy[])
{
if(grundy[n]!=-1)
return grundy[n];
unordered_set<ll>set;
set.insert(calcgrundy(n-2,grundy));
set.insert(cal... | true |
64a6960d0279efd547a6a36f1153c658fc7f3663 | C++ | MingNine9999/algorithm | /Problems/boj1654.cpp | UTF-8 | 805 | 3.046875 | 3 | [] | no_license | //Problem Number : 1654
//Problem Title : 랜선 자르기
//Problem Link : https://www.acmicpc.net/problem/1654
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n, k;
vector<int> v;
int par(long long l, long long r)
{
if (l >= r) {
return l;
}
long long mid = (l + r + 1... | true |
f6c175783bc731e0676f599c1293cf74ece7d97e | C++ | yooncheolkim/study_algorithm | /10971_외판원순회2/10971.cpp | UTF-8 | 681 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
int N;
int w[11][11];
int dp[11][1 < 12];
int go(int cur, int visited)
{
if (((1 << N) - 1) == visited)
return w[cur][0];
int &ret = dp[cur][visited];
if (ret != 0) return ret;
ret = 999999999;
for (int next = 0; next < N; next... | true |
7ce5ee59aa48fc8796869c58885410c13851d2cd | C++ | maksym-pasichnyk/NativeParticleSystem | /NativePlugin/Src/Runtime/ParticleSystem/PolynomialCurve.h | UTF-8 | 6,848 | 3.1875 | 3 | [] | no_license | #ifndef POLYONOMIAL_CURVE_H
#define POLYONOMIAL_CURVE_H
template<class T>
class AnimationCurveTpl;
typedef AnimationCurveTpl<float> AnimationCurve;
class Vector2f;
struct Polynomial
{
static float EvalSegment (float t, const float* coeff)
{
return (t * (t * (t * coeff[0] + coeff[1]) + coeff[2])) + coeff[3];
}
... | true |
b682616333b0223204fcbf50e8f20240d7f64638 | C++ | DGLeming/cpp_blackjack | /cardsMain.cpp | UTF-8 | 6,237 | 3.296875 | 3 | [] | no_license | #include "cardsStruct.cpp"
#include "iostream"
#include <ctime>
#include <time.h>
#include <array>
void printCard(const Card &card)
{
switch (card.rank)
{
case RANK_2: std::cout << '2'; break;
case RANK_3: std::cout << '3'; break;
case RANK_4: std::cout << '4'; break;
case RANK_5: std::cout << '5'; break;
c... | true |
5f2ed32c8bb51aecc414a12618ecd76494e20168 | C++ | vicyan1611/vscode-cpp | /archive/Training Gitgud/EXPRESS.cpp | UTF-8 | 1,868 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
int a[1004],max1,max2,res;
pair <int,int> pos1,pos2;
int main()
{
freopen("express.inp","r",stdin);
freopen("express.out","w",stdout);
int n;
cin>>n;
for (int i=1;i<=n;++i)
cin>>a[i];
for (int i=1;i<n;++i)
{
if (a[i... | true |
78dbbe765e8e1ce780b53b6651bab903ce69d8b9 | C++ | sb-baifeng-sb/SpaceTD | /include/components/Turret.hpp | UTF-8 | 809 | 2.53125 | 3 | [] | no_license | /*
* Turret.hpp
*
* Created on: 02/10/2014
* Author: giovani
*/
#ifndef TURRET_HPP_
#define TURRET_HPP_
#include <entityx/entityx.h>
#include "TurretInfo.hpp"
struct Turret : entityx::Component<Turret>
{
Turret(entityx::Entity entity, const TurretInfo& info);
~Turret();
entityx::Entity entity_;
bo... | true |
5901f3b03a263292418a29f403dbd65cf320eef9 | C++ | mycmac/TDtestsUnitaires | /TDtestsUnitaires/Calculator.cpp | ISO-8859-1 | 645 | 3.28125 | 3 | [] | no_license | #ifndef _Calculator_H_
#define _Calculator_H_
#include <iostream>
#include <math.h>
#include "Calculator.h"
int Calculator::factorielle(int a) {
int fact = 1;
int i = 0;
while (i <= a) {
fact *= i;
i++;
}
return fact;
}
int Calculator::add(int a, int b) {
return a + b;
}
int Calculator::sub(int a, int b)... | true |
2ad9880a25a0f0ddd34315ec2c92372aa4b3f0b6 | C++ | bmleight/kegbot_wander | /kegbot_wonder.ino | UTF-8 | 7,896 | 2.53125 | 3 | [] | no_license | #include <NewPing.h>
#include "BMSerial.h"
#include "RoboClaw.h"
#define address 0x80
/* KEGBOT MODES */
const int USER_DRIVE = 1;
const int ROBOT_DRIVE = 2;
RoboClaw roboclaw(15,14);
#define SONAR_NUM 5 // Number or sensors.
#define ITERATION_NUM 4 // Number or iterations.
#define MAX_DISTANCE 200 // Maximum d... | true |
a231cb0aab4763463a427a49445a503ad2f30780 | C++ | Asoke26/CrackingTheCodingInterview | /RotateMatrix1.7/src/rotate_matrix.cpp | UTF-8 | 792 | 3.84375 | 4 | [] | no_license | #include <vector>
#include <algorithm>
#include <iostream>
void rotate(std::vector<std::vector<int> >& matrix){
// Rotation must be in place
// First calculate the transpose
int n = matrix.size();
for(int i = 0; i < n; i++){
for(int j = i; j < n; j++){
std::swap(matrix[i][j], matrix[j][i])... | true |
9c1fd7f680e305c211447a541d0235d78daee758 | C++ | lucaparisi91/qmc3 | /dmc/wavefunction/shell.h | UTF-8 | 2,068 | 3.125 | 3 | [
"MIT"
] | permissive | #ifndef SHELL_H
#define SHELL_H
#include <complex>
#include <cmath>
#include <vector>
#include <tuple>
#include <iostream>
#include <algorithm>
#if DIMENSIONS == 3
class shell
{
public:
shell(unsigned int n_) : n(n_){list();};
size_t capacity() const {return shellStructure.size();}
unsigned int level() const... | true |