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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
db6938a8dd54b6fa00ecb91347ee208c2866472a | C++ | MohammedMaaz/cpp-programs | /sfml/scientific_calc/headers/styling.h | UTF-8 | 7,899 | 2.890625 | 3 | [] | no_license | #ifndef STYLING_H_INCLUDED
#define STYLING_H_INCLUDED
#include<SFML/Graphics.hpp>
#include<string>
class Button : public sf::Transformable
{
public:
//public data-members
//NOTE: Convention for data-members followed is that there first alphabet is capitalized
std::string ReturnValue;
bool IsClicked ... | true |
630b440557ba974079e48e8f36236a09ebe61c06 | C++ | H2rOver/H2RoverExamples | /IMU/IMUTest/IMUTest.ino | UTF-8 | 1,047 | 3.09375 | 3 | [
"MIT"
] | permissive |
/* Created By: Daniel Benusovich
Created On: 4 November 2017
Last Edited By: Daniel Benusovich
Last Edited On: 4 November 2017
*/
#include <IMU.h>
#include <MotorControl.h>
#include <PinDeclarations.h>
IMU thingy;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(1000);
/... | true |
4fa21345671c0243586665ad31006428cd7ed86b | C++ | eulphean/InteractiveTouch | /src/Connection.h | UTF-8 | 1,433 | 3.28125 | 3 | [] | no_license | // Author: Amay Kataria
// Date: 10/3/2017
// Description: Defines a Connection class that gets instantiated as soon as a new
// connection is observed. Every connection is represented by a successful completion
// of the circuit, which is indicated by a "keyPressed" event on the makey makey board.
#pragma once
#incl... | true |
15235a64445ec87c651ec6e2a1327db48190d7f9 | C++ | changsongzhu/leetcode | /C++/category/hash_table/358_h.cpp | UTF-8 | 1,466 | 3.671875 | 4 | [] | no_license | /**
358[H]. Rearrange String k Distance Apart
Given a non-empty string str and an integer k, rearrange the string such that the same characters are at least distance k from each other.
All input strings are given in lowercase letters. If it is not possible to rearrange the string, return an empty string "".
Example 1:
... | true |
54bb32fa548d38e0cfd973462432d3d5d64d186c | C++ | run921/STL | /containers_perfomance_test/containers_perfomance_test/containers_perfomance_test.cpp | GB18030 | 17,976 | 3.5 | 4 | [] | no_license | /********************************
*ܣSTL
*
*by ǿ
**********************************/
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<array>
#include<ctime>
#include<cstdlib> //qsort,bsearch,NULL
using namespace std;
long get_a_target_long() //һֵСrandصֵRAND_MAX
{
long target = 0;
cout << "tar... | true |
bb0c2334673a8470a882de39080abe20b3037fb9 | C++ | ioqoo/PS | /Samsung Academy/day4/2904.cpp | UTF-8 | 893 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define MAX 1000005
#define ll long long
using namespace std;
bool sieve[MAX];
vector<int> primes;
int nums[100];
int N;
int prime_cnt[100][1001];
void decomp(int order, int n){
int curr = n;
while(curr != 1){
for (int p: primes){
if (curr % p == 0) {
curr /= p;
prime_cnt[orde... | true |
cceeb567418d072d18059f850d31e4318a01fcbe | C++ | PhantomLimb/OpenWorkshopEditor | /Util.hpp | UTF-8 | 1,022 | 2.953125 | 3 | [] | no_license | #ifndef UTIL_HPP
#define UTIL_HPP
#include <string>
#include <vector>
#include <fstream>
#include <cstring>
using namespace std;
typedef unsigned char uint8;
typedef unsigned short int uint16;
typedef signed short int sint16;
typedef unsigned long int uint32;
class Util
{
public:
static void string_split(string... | true |
cba4dc5a236cd372241234a0b99abfdbc042f269 | C++ | FireFoxPlus/LeetCode | /LeetCode/valid skudo.cpp | UTF-8 | 1,143 | 3.046875 | 3 | [] | no_license | #include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
bool isValidSudoku(vector<vector<char> > &board) {
static bool row[9][9];
static bool col[9][9];
static bool box[9][9];
for(int i = 0; i < 9; i++)
for(int j = 0; j < 9; j++)
{
row[i][j... | true |
a3cd13c836f1fe11b0e004bbc00166d3d126034d | C++ | YogeshSakhalkar/C-plus-plus-language | /constrctor example1/constrctor example1/Source.cpp | UTF-8 | 580 | 3.546875 | 4 | [] | no_license | #include<iostream>
using namespace std;
class complex
{
int image;
int real;
public:
void setImage(int i)
{
this->image=i;
}
void setReal(int r)
{
this->real=r;
}
int getImage()
{
return image;
}
int getReal()
{
return real;
}
void display()
{
cout<<" "<<getImage()<<"\t"<<getReal()<<"\n\n";
}... | true |
f0b0bde9cebb67bd5882b867cc81c5603de4e536 | C++ | koolguru/CodingPractice | /Leetcode/LargestValueFromTree.cpp | UTF-8 | 1,228 | 3.484375 | 3 | [] | no_license | // Solution for LC # 515: Find the largest value in each tree row
/**
* 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:
vector<int> largestValues(Tr... | true |
e9b95c31b648da95bf08c672ed981a4338102456 | C++ | kyuue/homework-1 | /Homework-1-part2/Homework-1-part2/Homework-1-part2.cpp | UTF-8 | 1,737 | 3.625 | 4 | [] | no_license | // Homework-1-part2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
void duzUcgen(int deger)
{
for (int tryCount = 0; tryCount < 3; tryCount++)
{
if (deger < 3 || deger > 15 || deger % 2 == 0)
{
std::cout << "boyut> ";
std:... | true |
fc8b077ae4e43e8498ef5e544b1c27055f5ede3e | C++ | floki2020/Cplus | /Chapter/2.7/4.cpp | UTF-8 | 320 | 3.4375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int MyConvert(int num);
int main()
{
/* code */
int num;
cout<<"Please enter a Celsius value:";
cin>>num;
int result= MyConvert(num);
cout<<num<<" degress Celsius is "<<result<<" degrees Fahrenheit."<<endl;
return 0;
}
int MyConvert(int num)
{
return 1.8*num+32.0;
}
| true |
f7f31db69760ef49aad2bfa8e60622cb3b87d3fc | C++ | SlickHackz/famous-problems-cpp-solutions | /06 Array/Source Files/Z_others/FindDuplicatesinaRangeinArray.cpp | UTF-8 | 409 | 3.609375 | 4 | [] | no_license | #include<iostream>
using namespace std;
void printDuplicates(int arr[],int n)
{
for(int i=0 ; i<=n-1 ; i++)
{
if(arr[abs(arr[i])] >= 0)
arr[abs(arr[i])] = -1*arr[abs(arr[i])] ;
else
cout<<"One of the repeating elements is : "<<abs(arr[i])<<endl;
}
}
int main()
{
int arr[] = {1, 2, 3, 1, 3, 0, 2, 3,3,0}... | true |
8e6a7b475d00fc4f16b466474211702bac173b7e | C++ | esolera/juego_gato | /hls_project/src/game_session.cpp | UTF-8 | 3,741 | 3.265625 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
//Variables Globales
int Board[3][3]={{0,0,0},{0,0,0},{0,0,0}};
bool jugador_out;
int posicion;
bool valido;
//Funcion para saber el turno del jugador
bool Check_jugador(){
int jugadas=0;
for ( int i = 0; i < 3; i = i + 1 ){
for ( int j = 0; j < 3; j = j + 1 ){
if(Bo... | true |
264636228ca96bfcb1eab3187558d2243b828472 | C++ | Watanai1245/study | /butterfly.cpp | UTF-8 | 1,318 | 3.390625 | 3 | [] | no_license | #include <stdio.h>
struct number {
int x[10];
int i;
int j;
}num, row, star, space;
void moretriangle (int n)
{
for(row.i=1 ; row.i<=n-1 && row.i>0 ; row.i++)
{
for(star.j=1 ; star.j<=row.i && star.j>0 ; star.j++)
{
printf("* ");
}
for(space.j=1 ; space.... | true |
5c90bcb83457f89b5093bf44a2be1ea7959ab67a | C++ | Tduderocks/PracticeProblems | /Ch_5/Ch5_Ex5.cpp | UTF-8 | 720 | 3.5 | 4 | [] | no_license | // Chapter 5 ex 5 a,b: works:) c: added to Library :) and d:tested :) works done :)
#include <iostream>
using namespace std;
void DisplayFormatted(int n, int width)
/*Displays the value of n left-aligned in a field of size width.
Post: Value displayed left-aligned in a field of size Width*/
{
cout.setf(ios::left)... | true |
2f9e528611d9ca639748c9625040733a800b0bd8 | C++ | CHandPY/EngineCpp_2d | /Engine/Engine/src/core/Input.cpp | UTF-8 | 2,172 | 2.765625 | 3 | [] | no_license | #include "Input.h"
#include <iostream>
int Input::events[LAST_EVENT_BOUND];
int Input::events_started[LAST_EVENT_BOUND];
int Input::events_stopped[LAST_EVENT_BOUND];
int Input::DX = 0, Input::DY = 0, Input::MX = 0, Input::MY = 0;
bool Input::m_grab = false;
int Input::event(int id) {
return events[id];
}
int Input... | true |
ef30ae2e1f39ad7b39774b64cf62b748239b968a | C++ | Souly9/DX12-Utah-Teapot | /Combustion/Wrappers/Camera/Camera.cpp | UTF-8 | 2,695 | 2.71875 | 3 | [] | no_license | #include <stdafx.h>
#include "Camera.h"
Camera::Camera()
{
}
Camera::Camera(float fov, float zNear, float zFar, float aspectRatio,
DirectX::XMVECTOR pos,
DirectX::XMVECTOR rot)
: m_FoV(fov),
m_zNear(zNear),
m_zFar(zFar),
m_AspectRatio(aspectRatio)
{
m_pData = (AlignedCameraData*)_aligned_malloc(sizeof(Aligne... | true |
1b94e90506938360fd599af70bcc0915cdb78cea | C++ | lo1cgsan/rok202021 | /2A_1/cpp/T7_p8_1.cpp | UTF-8 | 289 | 2.9375 | 3 | [] | no_license | /*
* T7_p8_1.cpp
*
*/
#include <iostream>
#include <cmath>
using namespace std;
int main(int argc, char **argv)
{
float st, rad;
st = 0.0;
do {
rad = st * M_PI/180;
cout << "cos(" << st << ") = "
<< cos(rad) << endl;
st += 10.0;
} while (st != 100);
return 0;
}
| true |
5451d38258fd9970e3a82d2d22c67567c329a680 | C++ | JstD/HackerRank | /Algorithm/non_divisible_subset.cpp | UTF-8 | 845 | 3.1875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'nonDivisibleSubset' function below.
*
* The function is expected to return an INTEGER.
* The function accepts following parameters:
* 1. INTEGER k
... | true |
7dfb4bb9bc12a6baab0f547ec042790147e5f6b6 | C++ | TamasSzep/Framework | /Source/Common/Core/DataStructures/SimpleTypeUnorderedVector.hpp | UTF-8 | 11,126 | 3.359375 | 3 | [] | no_license | // Core/DataStructures/SimpleTypeUnorderedVector.hpp
#pragma once
#include <Core/DataStructures/SimpleTypeVector.hpp>
#include <Core/SimpleBinarySerialization.hpp>
#include <map>
namespace Core
{
template <typename T, typename SizeType = size_t>
class SimpleTypeUnorderedVector
{
enum class State : unsigned cha... | true |
845205d1d039e193436cb7f6f173d6d9dab4b93f | C++ | noname2048/code-test | /a.cpp | UTF-8 | 2,298 | 2.515625 | 3 | [] | no_license | #include <cassert>
#include <iostream>
#include <string>
#include <vector>
#define N 8
using namespace std;
bool used[N];
int position[N];
int record_for_activate = 0;
int record_prun_effectiveness = 0;
class ClassFactorial {
public:
ClassFactorial();
static vector<long> cache;
static int last_called... | true |
8647b7506a03a7b0d89ba459d1beb0b7ef94e86c | C++ | stdstring/leetcode | /Algorithms/Tasks.1001.1500/1492.KthFactorOfN/solution.cpp | UTF-8 | 1,124 | 3.609375 | 4 | [
"MIT"
] | permissive | #include <vector>
#include "gtest/gtest.h"
namespace
{
class Solution
{
public:
[[nodiscard]] int kthFactor(int n, int k) const
{
std::vector<int> smallFactors;
std::vector<int> bigFactors;
int number = 1;
while (number * number <= n)
{
if (n % number == 0)... | true |
69270a400e44df2e7e94d3affb0dd6ba86a471f0 | C++ | harsh-malik-0803/Data-Structure-and-Algorithm | /recursion/checksorted.cpp | UTF-8 | 332 | 2.921875 | 3 | [] | no_license | #include<stdio.h>
bool is_sorted(int a[],int n){
if(n==0 || n==1){
return true ;
}
if (a[0]>a[1]){
return false;
}
bool issmaller_sorted=is_sorted(a+1,n-1);
return issmaller_sorted;
}
int main(){
int n;
scanf("%d",&n);
int a[n];
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
int t=is_sorted(a,n);
printf("%d",t);... | true |
93d01ff877175088369940f41a65669bb360ea75 | C++ | leonardoqt/gcmc_data_analyser | /class.h | UTF-8 | 2,373 | 2.5625 | 3 | [] | no_license | #include <cstring>
#include <fstream>
#ifndef MY_CLASS
#define MY_CLASS
class vec;
class atom;
class cell;
class vec
{
private:
double x[3];
friend atom;
friend cell;
public:
void import(double *);
void clean(); // reset value to zero
vec operator+(const vec&);
vec operator-(const vec&);
vec operator*(const d... | true |
269678590cc9c86f6ca84af90f190169e1bbab0a | C++ | mchavaillaz/cplusplus | /qt_project/PaintMaze/camera.h | UTF-8 | 438 | 2.53125 | 3 | [] | no_license | #ifndef CAMERA_H
#define CAMERA_H
#include "angle3d.h"
class QVector3D;
class Camera
{
public:
Camera(QVector3D *p, Angle3D *a);
~Camera();
void view();
void setYaw(double yaw);
void setPitch(double pitch);
void setRoll(double roll);
void setP(QVector3D *point) { this->p = point; }
... | true |
4cbb7cb488ec3db9c915b1779f74e58b25e675a3 | C++ | chenyue0102/mytestchenyue | /testopengl/src/testspine/My/MyFrameBuffer.h | UTF-8 | 2,240 | 2.515625 | 3 | [] | no_license | #pragma once
#include <GL/glew.h>
#include "OpenGLESHelper.h"
#include <string>
#include <Windows.h>
static bool SaveBitmap(const char* pFileName, int width, int height, int biBitCount, const void* pBuf, int nBufLen)
{
if (nullptr == pFileName
|| 0 == width
|| 0 == height
|| !(biBitCount == 24 || biBitCount ==... | true |
297db50ddd428609c2a4b80d2d7adf62da128cf4 | C++ | gabsi26/GameBoyEmu | /gemu_tests/8_bit_alu_tests.cpp | UTF-8 | 72,745 | 2.546875 | 3 | [] | no_license | #include "pch.h"
#include "../GameBoyEmu/GZ80.h"
#include "../GameBoyEmu/memory.h"
using namespace GZ80;
class _8BitALUTests : public testing::Test
{
public:
GZ80::CPU cpu;
virtual void SetUp()
{
}
virtual void TearDown()
{
}
};
// ################## ADD #####################
TEST_F(_8BitALUTests, ADDAACanAddR... | true |
33b0a316e69565d4d84b998eba32bbaa57acbd59 | C++ | MakGulati/elementalCplusplus | /templateEg.cpp | UTF-8 | 723 | 3.890625 | 4 | [] | no_license | #include<iostream>
using namespace std;
template <typename T> //tell the compiler we are using a template
T findSmaller(T input1,T input2);
int main()
{
int a = 54;
int b = 89;
float f1 = 7.8;
float f2 = 9.1;
char c1 = 'f';
char c2 = 'h';
string s1 = "Hello";
string s2 = "Bots are fun... | true |
af19f3e9b597c35e2c8f08f9744c33d05ae3b59d | C++ | mayfool/PersonnelArchives | /archivestablemodel.h | UTF-8 | 2,844 | 2.90625 | 3 | [] | no_license | /*功能说明
文件名称:archivestablemodel.h
作 者:马进
联系方式:
创建时间:2017.11.19
目 的:显示目录信息的视图的模型
功能描述:建立一个自定义结构的链表,填充从数据库中读取的目录信息,填充十大分类、空行等
约束条件:
*/
#ifndef ARCHIVESTABLEMODEL_H
#define ARCHIVESTABLEMODEL_H
#include <QAbstractTableModel>
#include <mainwindow.h>
class ArchivesTableModel : public QAbstractTableModel
{
Q_OBJEC... | true |
a6fb43d851c606bcc5d63f73595f6c0c711b5769 | C++ | danielaparker/jsoncons | /include/jsoncons/detail/parse_number.hpp | UTF-8 | 36,253 | 2.609375 | 3 | [
"BSL-1.0",
"MIT",
"Apache-2.0"
] | permissive | // Copyright 2013-2023 Daniel Parker
// Distributed under the Boost license, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See https://github.com/danielaparker/jsoncons for latest version
#ifndef JSONCONS_DETAIL_PARSE_NUMBER_HPP
#define JSONCONS_DETAIL_PARS... | true |
0b2b13bea689fcdc1ffe29a385692d95a3748f9e | C++ | FrankWork/LeetCode | /algorithm/two_pointer/167. Two Sum II - Input array is sorted.cc | UTF-8 | 749 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution{
public:
vector<int> twoSum(vector<int>& a, int k){
/* 双指针
l 从左侧开始移动
r 从右侧开始移动
类似二分查找
*/
int n=a.size();
int l=0, r=n-1;
vector<int> res(2);
while(l<r){
... | true |
6661b7bbf927ade66e7b09f277e60ef0f0b0b2ec | C++ | ArshaShiri/Mandelbrot_Image | /Mandelbrot-Image/RGB.cpp | UTF-8 | 247 | 2.90625 | 3 | [] | no_license | #include "RGB.h"
RGB::RGB(double r, double g, double b) : red_(r), green_(g), blue_(b)
{}
RGB operator-(const RGB &first, const RGB &second)
{
return RGB(first.red_-second.red_, first.green_ - second.green_, first.blue_ - second.blue_);
}
| true |
ae35760fb9ed7bfee635ad715b8af7d9937a428b | C++ | homespring/Chip8-Emulator | /chip8.cpp | UTF-8 | 11,765 | 3 | 3 | [
"MIT"
] | permissive | #define _CRT_SECURE_NO_WARNINGS
#include "chip8.h"
#include "INIReader.h"
#include <iostream>
#include <fstream>
#include <iomanip> // cout hex value
#include <cstdlib> // srand
#include <ctime> // time
#include "elapsedtimer.h"
using namespace std;
Chip8::Chip8(std::string cfg_filepath)
{
INIReader ... | true |
7bd9dd6db680d120edadac7b228484eee16955b0 | C++ | rgoliveira/USACO-tp | /solutions/section-1.1/friday.cpp | MacCentralEurope | 1,926 | 2.921875 | 3 | [] | no_license | /*
ID: ricardo39
PROG: friday
LANG: C++
*/
#include <iostream>
#include <fstream>
#define SAT 0x00
#define SUN 0x01
#define MON 0x02
#define TUE 0x03
#define WED 0x04
#define THU 0x05
#define FRI 0x06
#define JAN 0x11
#define FEB 0x12
#define MAR 0x13
#define APR 0x14
#define MAY 0x15
#define JUN 0x16
#define JUL 0x1... | true |
3370684b75291cd5f85c3c3262f18b43906530e4 | C++ | errord/libdstruct | /src/dsioformat.cpp | UTF-8 | 16,649 | 2.609375 | 3 | [] | no_license | #include "dsbase.h"
#include "dsioformat.h"
#include "dstruct.h"
using namespace dstruct;
void
iDStructIOFormat::reset()
{
mDSStream = "";
mStreamPos = 0;
mLinenum = 1;
mPath.clear();
}
void
iDStructIOFormat::setDStructStream(const string& dstream)
{
mDSStream = dstream;
}
string&
iDStructIOFormat::getDSt... | true |
33b1c375b34dc3379c9917e7a6785660a9162706 | C++ | xtl-murphy/ZXDJRenderer | /component/Matrix.cpp | UTF-8 | 4,677 | 3.1875 | 3 | [] | no_license | //
// Created by murphy on 2019-06-26.
//
/**
* Matrix
* @version 1.0
* @since 1.0
* <p>
* Created by murphy at 2019-06-26 18:11
**/
#include "Matrix.hpp"
void matrix_add(Matrix *c, const Matrix *a, const Matrix *b)
{
int i, j;
for (i = 0; i < 4; i++)
{
for (j = 0; j < 4; j++)
{
... | true |
9142b90e816d20ce1e5e162f6464ca3691d0fffa | C++ | yossich6/System-Programing-SPL---Ass1 | /include/cyberexpert.h | UTF-8 | 919 | 2.625 | 3 | [] | no_license | #ifndef CYBER_EXPERT
#define CYBER_EXPERT
#include <iostream>
#include <string>
#include <vector>
#include "../include/cyberpc.h"
class CyberExpert
{
private:
const std::string cyber_expert_name_;
const int cyber_expert_work_time_;
const int cyber_expert_rest_time_;
const int cyber_expert_e... | true |
57fc0f6d3f048c56c15e8316d8bfd10f9ff9641f | C++ | andy199310/posd_hw1 | /HW1/Command/DeleteCommand.h | UTF-8 | 717 | 2.59375 | 3 | [] | no_license | //
// Created by Green on 2016/12/5.
//
#ifndef POSD_HW1_DELETECOMMAND_H
#define POSD_HW1_DELETECOMMAND_H
#include "../Application.h"
#include "Command.h"
class DeleteCommand : public Command{
private:
Application *_application;
std::map<std::string, Media*> _mediaMap;
Media* _deleteTarget;
std::vect... | true |
4f147efd08d9c545c151be51938c286d07aaa588 | C++ | charmdong/Algorithm_solutions_2019 | /Baekjoon/BJ2156_repeat.cpp | UTF-8 | 555 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int wine[10001];
int dp[10001];
int solution(int n);
int main()
{
int n;
cin >> n;
for(int i=0; i<n; i++) {
cin >> wine[i + 1];
}
cout << solution(n) << endl;
return 0;
}
int solution(int n)
{
dp[1] = wine[1];
dp[... | true |
961ec6afa2405da86e786d776eaba36e07471cac | C++ | janhuang6/Cplusplus-ImageProcessing | /worklist/worklistserver/timer.cc | UTF-8 | 3,679 | 2.75 | 3 | [] | no_license | /*
* file: timer.cc
* purpose: Implementation of the timer class
* Modified from book "Unix System Programming Using C++"
* created: 30-Nov-03
* property of: Philips Nuclear Medicine, ADAC Laboratories
*
* revision history:
* 30-Nov-03 Jiantao Huang initial version
*/
#include "... | true |
f8868658f05ed4d05d4b3a04b6858d51d915f47a | C++ | PkuRainBow/leetcode_locked_problems | /Closest-Binary-Search-Tree-Value.cpp | UTF-8 | 596 | 3.203125 | 3 | [] | no_license | //
// Created by pianocoder on 16/5/8.
//
/**
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.
Note:
Given target value is a floating point.
You are guaranteed to have only one unique value in the BST that is closest to the target.
**/
#include ... | true |
d5c1cd45295551f430bfcdf21a42fde509207493 | C++ | PhoenixGS/Solutions | /Luogu/3379.cpp | UTF-8 | 1,565 | 2.5625 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
long long read()
{
char last = '+', ch = getchar();
while (ch < '0' || ch > '9') last = ch, ch = getchar();
long long tmp = 0;
while (ch >= '0' && ch <= '9') tmp = tmp * 10 + ch - 48, ch = getchar();
if (last == '-') tmp = -tmp;
return tmp;
}
const int _n = 500000 + 10;
in... | true |
2493fda5df48ee62914f88b741a7b319e435ac70 | C++ | Skywalker666666/visual_mapping | /voxblox-plusplus/voxblox/voxblox/include/voxblox/io/sdf_ply.h | UTF-8 | 8,021 | 2.546875 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | #ifndef VOXBLOX_IO_SDF_PLY_H_
#define VOXBLOX_IO_SDF_PLY_H_
#include <algorithm>
#include <string>
#include "voxblox/core/layer.h"
#include "voxblox/io/mesh_ply.h"
#include "voxblox/mesh/mesh.h"
#include "voxblox/mesh/mesh_integrator.h"
#include "voxblox/mesh/mesh_layer.h"
namespace voxblox {
namespace io {
enum P... | true |
48477ff2c0417b505237eda107a5d3a527b29157 | C++ | XiyouLinuxGroup-2019-Summer/TeamF | /lhd/Solution/2-3.cc | UTF-8 | 537 | 3.171875 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<iterator>
using namespace std;
class K
{
public:
void get()
{
cin >> A >> B;
sort(B.rbegin(),B.rend());
int j = 0 ;
for(size_t i = 0; i < A.size() ; i++)
{
if(B[j] > A[i] )
... | true |
68cabaf91f4143b0150d64e6377e6e198e3c71e0 | C++ | jowie94/The-Simpsons-Arcade | /Engine/Scene.h | UTF-8 | 3,596 | 2.75 | 3 | [
"MIT"
] | permissive | #ifndef __SCENE_H__
#define __SCENE_H__
#include "Module.h"
#include "Entity.h"
#include <memory>
class Scene : public Module
{
public:
Scene(bool active) : Module(active)
{
xmin = xmax = zmin = zmax = 0;
}
virtual ~Scene() {}
void AddEntity(Entity* entity)
{
_entities.push_back(entity);
}
void RemoveE... | true |
88db5fbc19f59d72d5e815c707c4024ad9fd778c | C++ | knivey/weather | /FetchURL.cpp | UTF-8 | 769 | 2.90625 | 3 | [] | no_license | #include "FetchURL.hpp"
#include <cpprest/http_client.h>
std::tuple<bool, std::string> FetchURL(std::string url, web::uri_builder builder) {
std::string data;
try {
web::http::client::http_client_config config;
//Leading research shows my friends are unable to wait longer than 5 seconds
... | true |
ab9dc08c505e8cfdbde5fdda4c2bd4257d0d0333 | C++ | emmacneil/euler | /051-100/093/main.cpp | UTF-8 | 3,393 | 3.5 | 4 | [] | no_license | /*
* Project Euler - Problem 93
* Arithmetic Expressions
*
* Assuming that 0 is not going to be one of our digits, we have 9 choose 4
* choices for a < b < c < d. There are 4! ways of arranging {a,b,c,d}. We have
* 4^3 choices for our operators {+,-,*,/}, and 5 ways of pairing our
* parentheses. In all, there ar... | true |
ef4eab916afce69ce3f6818f46ac491a9d58de63 | C++ | iuliabenyi/UBB-Labs | /Year 3/Sem1/PDP/Lab1/Lab1/Product.cpp | UTF-8 | 704 | 3.359375 | 3 | [] | no_license | #include "Product.h"
#include<iostream>
int Product::currProdID = 0;
Product::Product(int price, int quantity)
{
this->ID = this->currProdID++;
this->price = price;
this->initQuantity = quantity;
this->quantity = this->initQuantity;
}
int Product::getID() const
{
return this->ID;
}
int Product::getPrice() cons... | true |
a09a4755d7850282b17ebbe06de2b9405eab2fd2 | C++ | Treekay/Learn-C-CPP | /Cpp-learing/2907 [Exception] Stack and Exception/Latest Submission/Stack.h | UTF-8 | 847 | 3.671875 | 4 | [] | no_license | const int MAX_LEN = 5;
template<class T>
class Stack{
public:
explicit Stack(){
for (int index = 0; index < 0; index++){
data[index] = 0;
}
stack_size = 0;
}
bool empty() const{
return stack_size;
}
int size() const{
return stack_size;
}
T& top(){... | true |
b4d20382b268b830f0207d237e7ebf35c34f27dc | C++ | lennon2298/Mario-Clone | /Mario-Clone/src/main.cpp | UTF-8 | 2,558 | 2.578125 | 3 | [
"MIT"
] | permissive | #include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <glm/glm.hpp>
#include "ResourceManager.h"
#include "Game.h"
unsigned int WIDTH = 800, HEIGHT = 600;
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void key_callback(GLFWwindow* window, int key, int scancode, int... | true |
5cdee4bd2033dbabe5df681941e4fc8d5af93e85 | C++ | JoshuaHernandezAl/ProgrammingOldStuff | /Analisis/PolinomiosAN-master/Complejo.h | UTF-8 | 1,014 | 2.921875 | 3 | [] | no_license | #ifndef COMPLEJO_H
#define COMPLEJO_H
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
class Complejo{
private:
double real;
double imaginario;
public:
Complejo(void);
Complejo(float r, float i);
void pideDatos(void);
void muestraDatos(void);
double dameTuReal(... | true |
ed2d52f8b40f1401c3a9f67901fb009751445a6e | C++ | itsjustwinds/study-path | /HK3_2018-2019/CS163/W07/18125130_Ex02/Ex02_2.cpp | UTF-8 | 1,062 | 2.765625 | 3 | [] | no_license | /*
* Ex02_1.cpp
*
* Created on: Jul 10, 2019
* Author: huy
*/
#include"Ex02_2.h"
void input(int &n, int &begin, int &finish,int* &bef, int** &edge){
cin>>n>>begin>>finish;
edge=new int*[n];
for (int i=0;i<n;++i)
edge[i]=new int[n];
int u,v;
while(cin>>u){
cin>>v;
edge[u][v]=1;
}
bef=new int[n];... | true |
c6bef3b699744e48cd1d13ef24f13dcf1b93d306 | C++ | MasaokaKou/portfolio | /project/3portfolio(AttackOfMendako)/src/sceneGameClear.cpp | SHIFT_JIS | 4,057 | 2.546875 | 3 | [] | no_license | //---------------------------------------------------------------------------
//! @file sceneGameClear.cpp
//! @brief Q[vC̃V[̊Ǘ
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//! RXgN^
//-----------------------... | true |
4d9ea896ccc958b2515f4f39cee043afba4e53e1 | C++ | DenisEvteev/4_semester_mipt | /algorithms/merge_sort.cpp | UTF-8 | 2,080 | 3.71875 | 4 | [] | no_license | //
// Created by user on 01/04/2020.
//
#include <vector>
#include <iostream>
template <class T>
void merge_sort(std::vector<T>& res, size_t start, size_t end);
template <class T>
void merge(std::vector<T>& res, size_t start, size_t mid, size_t end);
int main()
{
std::vector<int> v(5000);
for(int i = 0; i < v.s... | true |
264a805423dd27ff0fabff8970f5d112dda61f0f | C++ | akudrinsky/sorts | /include/graphics.hpp | UTF-8 | 1,296 | 2.921875 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
#include "button.hpp"
#include "graph.hpp"
#include "usefulDefines.hpp"
#include <vector>
// Creates application for a program
void MakeApp();
// Basic interface for graphics, consists of buttons and graphs. TODO: more
// TODO: array of pointers to sf::Drawable
class applic... | true |
2e5268bf1e44b225d6f3818e89082e7139762b2c | C++ | Anatole-j/test_et_verification | /1_Software/Etape_7/src/main.cpp | UTF-8 | 591 | 2.625 | 3 | [] | no_license | #include "stdio.h"
#include "stdlib.h"
#include "math.h"
#include <assert.h>
#include "pgcd.hpp"
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
TEST_CASE( "cas normaux", "[pgcd]" ) {
SECTION( "A>B") {
REQUIRE( PGCD(135, 55) == 5 );
REQUIRE( PGCD(133, 97) == 1 );
}
/*SECTION( "A<B... | true |
f9782f52bf893c90620e851e42644b8cd8a931fc | C++ | chrissearle/teensy8x8matrix | /src/main.cpp | UTF-8 | 1,154 | 2.953125 | 3 | [] | no_license | #include <Arduino.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Max72xxPanel.h>
int pinCS = 10;
int numberOfHorizontalDisplays = 1;
int numberOfVerticalDisplays = 1;
Max72xxPanel matrix = Max72xxPanel(pinCS, numberOfHorizontalDisplays, numberOfVerticalDisplays);
String tape = "Hello Philip ";
int wait = 5... | true |
0cd589fd637960ddab58ee869c7ef17638401135 | C++ | kkislay20/SPOJ | /hubululu.cpp | UTF-8 | 206 | 2.59375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int t;
long m,n;
cin>>t;
while(t--)
{
cin>>m>>n;
if(n==0)
cout<<"Airborne wins.\n";
else
cout<<"Pagfloyd wins.\n";
}
return 0;
}
| true |
b394aa592e4374c6942b3ac11a5cde017c1c3baa | C++ | Ignacio-Mosconi/Green-Nacho-Engine | /Green-Nacho-Engine/Legacy/Shape.h | UTF-8 | 869 | 2.703125 | 3 | [] | no_license | #pragma once
#include "Legacy/Entity.h"
namespace gn
{
class Material;
namespace legacy
{
/*
It consists of the base class for many of the entities that will be actually drawn to the screen.
*/
class ENGINE_DECL_SPEC Shape : public Entity
{
protected:
Material* _material;
float* _vertexBufferData;
... | true |
ed656b702af240ecad7fe8d829b701945bcf83af | C++ | boonkey/BattleShips | /BattleShips/BattleShips/ThreadManager.cpp | UTF-8 | 10,587 | 2.859375 | 3 | [] | no_license |
#include "Match.h"
struct ResultData {
int wins = 0;
int losses = 0;
int pointsFor = 0;
int pointsAgnst = 0;
double winRate = 0; //winrate will only be calcualted after 1 match atlist was played so no need to warry about divByZero errors //% = Wins/(Wins+Losses)
ResultData() {}; //default constructor,... | true |
c3343013bb70dff9eb4615fd389d7052d1ccf23e | C++ | michalsobczyk/Portfolio | /C++/Michal_Sobczyk_Projekt/complexShape.cpp | UTF-8 | 307 | 3.078125 | 3 | [] | no_license | #include "complexShape.h"
ComplexShape::ComplexShape(Display* w) : Shape(w) {}
bool ComplexShape::add(Shape* o) {
if (shapes.size() == 5) {
return false;
}
shapes.push_back(o);
return true;
}
void ComplexShape::draw() {
for (unsigned int i = 0; i < shapes.size(); ++i) {
shapes[i]->draw();
}
}
| true |
0d9f9e14a01c39dd1f6b06b2d63d01a2da0c16e1 | C++ | daniel321/repoFacu | /tp/ConcuCalecita/common/memCompartida/MemCmpRaw.h | UTF-8 | 1,114 | 3.015625 | 3 | [] | no_license | #ifndef MEMCMPRAW_H_
#define MEMCMPRAW_H_
#include "../semaforos/Semaforo.h"
/**
* Clase que modela memoria compartida
* Nota importante, la clase funciona estilo smart pointer, si ningun proceso tiene referencia, se borra del OS
* Asi que tener cuidado con cosas del estilo crearla con un proceso y luego cerrar es... | true |
e3e3d963c9ad6a76f5be643d04a4ccdc17d7f2c7 | C++ | omar-faruk01/Problem-Solving-Programming | /Lab 21/Lab 21.cpp | UTF-8 | 3,039 | 4.0625 | 4 | [] | no_license | //==========================================================
//
// Title: Matrix to Matrices!
// Course: CSC 1101
// Lab Number: 21
// Author: Omar Faruk
// Date: 12/1/2020
// Description:
// Creating an application taking two fixed Matrices and
// creating a 3rd matrix if columns in matri... | true |
9a972f70edf5fe75d159153e7f3e6f3a8c27c24c | C++ | ekg/protobufstream | /test.cpp | UTF-8 | 913 | 2.671875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include "cpp/test.pb.h"
#include "stream.hpp"
using namespace google::protobuf;
using namespace test;
int main(void) {
Note note1;
note1.add_idea("a fun way to idea");
note1.add_idea("could this really be serialized");
Note note2;
note2.add_idea("yheaw");
note2.set_numbe... | true |
efb0f356787c10ca963b23c212504baaa9119b61 | C++ | mcheese/cheesebase | /src/storage.cc | UTF-8 | 1,570 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | // Licensed under the Apache License 2.0 (see LICENSE file).
#include "storage.h"
namespace cheesebase {
Storage::Storage(const std::string& filename, OpenMode mode)
: cache_(filename, mode, k_default_cache_size / k_page_size) {}
PageRef<PageReadView> Storage::loadPage(PageNr page_nr) {
return cache_.readPage... | true |
a407baf4fb06796672a8347bf74cac5181d66e4e | C++ | saidul-islam98/Codeforces-Codes | /cAPS lOCK.cpp | UTF-8 | 1,439 | 2.921875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
bool flag=false;
if(s.length()==1 && (s[0]>='A' && s[0]<='Z')){
s[0]=tolower(s[0]);
cout<<s;
}
else if(s.length()==1 && (s[0]>='a' && s[0]<='z')){
s[0]=toupper(s[0]);
cout<<s;
}
... | true |
0f85eaabf7feccd6c75518018ae73c8dfdcafc80 | C++ | sandeepkalra/utilities | /Phonebook.h | UTF-8 | 2,731 | 3.28125 | 3 | [
"MIT"
] | permissive | /* ----------------------------------------
* Author: Sandeep Kalra
* License: MIT License.
* Copyright(c) 2013 Sandeep.Kalra@gmail.com
*/
#ifndef __PHONEBOOK_H_
#define __PHONEBOOK_H_
#include <iostream>
#include <map>
#include <string>
using namespace std;
// ref: http://www.gotw.ca/gotw/029.htm
struct ci_char... | true |
c7f79932e7bc716bfc9a3eccc097ed5c9f2f2f1e | C++ | X3N0-Life-Form/Traveling-Salesman-Problem | /code/run/interval/StrategicMemory.h | UTF-8 | 899 | 2.90625 | 3 | [
"MIT"
] | permissive | /*
* File: StrategicMemory.h
* Author: etudiant
*
* Created on 18 juin 2014, 11:50
*/
#ifndef STRATEGICMEMORY_H
#define STRATEGICMEMORY_H
#include <list>
#include "Action.h"
/**
* Records things that happen in Strategy.
*/
class StrategicMemory {
private:
std::list<Action*> actionsConsidered;
public:
... | true |
6e0c627aacf54b35f8d504fcb1c3aabdc34fa03d | C++ | jameshi16/weather-alert | /weatherInfo/weatherStation.hpp | UTF-8 | 1,967 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef WEATHERSTATION_H
#define WEATHERSTATION_H
#include <string>
#include "weatherInfo.hpp"
#include "../json.hpp"
#include "../contacter.hpp"
#define OPENWEATHERMAP_URL L"api.openweathermap.org" //open weather map's URL
#define OPENWEATHERMAP_VERSION L"2.5" //the version used for open weather map
/* Weather Sta... | true |
c20a61e868cabff9d3a5baac73ad915606ca4b07 | C++ | gts2030/cpps | /week4/problem7.cpp | UTF-8 | 808 | 4 | 4 | [] | no_license | #include <stack>
class MyQueue {
public:
std::stack<int> front;
std::stack<int> back;
/** Initialize your data structure here. */
MyQueue() {
}
/** Push element x to the back of queue. */
void push(int x) {
back.push(x);
}
/** Removes the element from in front of queue and returns that element. */
int po... | true |
f2a66c8aeea15310067c7077810c61b9a2a69003 | C++ | ayyse/ComputerGraphics | /WireCar/WireCar/main.cpp | IBM852 | 6,581 | 2.5625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <GL/glut.h>
#include <GL/GL.h>
#include <GL/GLU.h>
#include <math.h>
#define PI 3.141592f
#define LEFT 1
#define RIGHT 2
float theta = PI / 2.0f - 0.4f;
float phi = 0.0f;
float distance = 40.0f;
float oldX, oldY;
int motionState;
float degree = 0;
int turn = 0;
GLfl... | true |
587de132f499d2f95004485fd04e18c3724cb323 | C++ | GhostsOfHiroshima/Glow-ESP | /External Heckle/ProcMem.h | UTF-8 | 3,272 | 2.84375 | 3 | [] | no_license |
#ifndef PROCMEM_H //If Not Defined
#define PROCMEM_H //Define Now
#define WIN32_LEAN_AND_MEAN //Excludes Headers We Wont Use (Increase Compile Time)
using namespace std;
class ProcMem {
protected:
//STORAGE
HANDLE hProcess;
DWORD dwPID, dwProtection, dwCaveAddress;
//MISC
BOOL bPOn, bIOn, bProt;
public:
... | true |
2e64f3e27819d11430327788c91426a1d7ee4e7b | C++ | wjhan1993/hw11 | /hw11/array/test_array.cpp | UTF-8 | 1,022 | 3.296875 | 3 | [] | no_license | #include "array.h"
#include <cstdio>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
int origin[10] = {-10,-8,-6,-4,-2,0,2,4,6,8};
Array arr(8,origin);
Array rtoo(5,1);
for(int i = 0; i < rtoo.size(); i++)
rtoo[i] = i * 2;
cout << "arr = " << arr << endl;
cout <... | true |
c5cb627990ec1bcbc540ec9ab00812600b2bcbe5 | C++ | naveen-kummar/cruise_control_system | /2_source_code/cruise_control/ros/header/topic_info.h | UTF-8 | 1,382 | 3.15625 | 3 | [] | no_license | /*
* @file topic_info.h
* @brief This file define class for storing topic data information
*
* Declares and define functionality to retrive the topic information
* which is assigned while creating object of this class
*/
#ifndef CRUISE_CONTROL_ROS_HEADER_TOPIC_INFO_H
#define CRUISE_CONTROL_ROS_HEADER_TOPIC_INFO_H
#... | true |
12530ccbf2ec3662301c5535c1e8af144dba58aa | C++ | alecrisan/Quiz | /exception.h | UTF-8 | 331 | 2.859375 | 3 | [] | no_license | #ifndef EXCEPTION_H
#define EXCEPTION_H
#include <exception>
#include <string>
using namespace std;
class Exception: public exception
{
private:
string message;
public:
Exception(const string &mess): message(mess) {}
virtual const char* what()
{
return message.c_str();
}
};
#endif // E... | true |
c8cfed7cb9739b05e2cfddae7e9b519aa68b3259 | C++ | JaiVig/2D-Game-Engine | /GameProject1/MainGame.cpp | UTF-8 | 8,583 | 2.65625 | 3 | [] | no_license | #include "MainGame.h"
#include <SDL.h>
#include<iostream>
#include<Crusty/Crusty.h>
#include<Crusty/Error.h>
#include"Zombie.h"
#include<ctime>
#include<random>
const float HUMANSPEED = 1.0f;
const float ZOMBIESPEED = 3.0f;
const float PLAYERSPEED = 8.0f;
const float PI = 3.142857;
MainGame::MainGame() :_screenWidth(19... | true |
19ea9b1085e804e433118f5c24fed50c52c2f20c | C++ | 1601062/AudioCoursework | /AudioCoursework/DigitalAudio/Game.cpp | UTF-8 | 10,835 | 2.78125 | 3 | [] | no_license | #include "Game.h"
#include <random>
#include <time.h>
using std::cerr;
void Game::die(const char* s) {
cerr << "Fatal: " << s << "\n";
cerr << "Current directory is:\n";
system("cd");
system("pause");
exit(1);
}
Game::Game(sf::RenderWindow* win, Input* in, bool* bWin) : window(win), input(in), bGa... | true |
909e9e4dde187d35b10cc40e00cfd941faf398a5 | C++ | schmitzcj/Arduino-LightShow | /fade_up.ino | UTF-8 | 3,376 | 2.765625 | 3 | [
"MIT"
] | permissive | #include <FastLED.h>
#define LED_LOW 2
#define LED_MID 8
#define LED_TOP 10
#define NUM_LEDS 60
CRGB lowLED[NUM_LEDS];
CRGB midLED[NUM_LEDS];
CRGB topLED[NUM_LEDS];
//Vars
int delayAmt = 84;
int brightLvl = 255;
int stripCnt = 60;
//Counters
int countTop = 0;
int countMid = 0;
int countLow = 0;
bool cycleComplete =... | true |
a96373e3dcc51b7d9b2d9086549336a14e39fbb1 | C++ | mingu950202/SmartHome_IoT | /TempHumid/TempHumid.ino | UTF-8 | 2,320 | 2.875 | 3 | [] | no_license | #include <DHT.h>
#include <DHT_U.h>
#define TEMP 2
#define DHTTYPE DHT22
int BlindPin = 8;
int AirconPin = 13;
int BoilerPin = 12;
int ReadUVintensityPin = A0;
int Fan1Pin = 3;
char AValue;
DHT temp(TEMP, DHTTYPE);
void setup() {
temp.begin();
Serial.begin(9600);
pinMode(AirconPin, OUTPUT);
pinMode(Boi... | true |
c9caa0c81027d5f9310ec7f073fbbbf9b9e1534a | C++ | KarolStryczek/Network_Project | /project_netsim/include/Report_Generation/SpecificTurnsReportNotifier.hpp | UTF-8 | 727 | 2.546875 | 3 | [] | no_license | // 4a_2: Stryczek (297457), Świerczek (297464), Śliwińska(297462)
//
// Created by Karolina on 05.01.2019.
//
#ifndef PROJECT_NETSIM_SPECIFICTURNSREPORTNOTIFIER_HPP
#define PROJECT_NETSIM_SPECIFICTURNSREPORTNOTIFIER_HPP
#include "IReportNotifier.hpp"
#include <set>
class SpecificTurnsReportNotifier: public IReportNo... | true |
d378d0c08d80638d8df0d87471f28b032d5ff875 | C++ | pelican/pelican-astro | /src/data/ModelVisibilityData.h | UTF-8 | 1,414 | 2.78125 | 3 | [] | no_license | #ifndef MODEL_VISIBILITYDATA_H_
#define MODEL_VISIBILITYDATA_H_
#include "data/VisibilityData.h"
#include "data/Source.h"
#include <vector>
/**
* @file ModelVisibilityData.h
*/
namespace pelican {
namespace astro {
/**
* @class ModelVisibilityData
*
* @brief
* Container class to hold visibilities for a model ... | true |
93524a5ffddc7398bcce55315610930a73f0cbb0 | C++ | aces/mni_surfreg | /surflib/surface_checking.hpp | UTF-8 | 3,392 | 2.84375 | 3 | [] | no_license | /*
Copyright Alan C. Evans
Professor of Neurology
McGill University
*/
#ifndef SURFLIB_SUBDIVIDED_ICOSAHEDRON_HPP
#define SURFLIB_SUBDIVIDED_ICOSAHEDRON_HPP
#include <cmath>
#include <exception>
#include <CGAL/circulator.h>
#include <CGAL/squared_distance_3.h>
namespace MNI {
/*! \brief Assert that surfac... | true |
b9d2b51d725366f218fef6adabb6005347243922 | C++ | Velmisov/CS253_Intelligent_system | /four_in_a_row/main.cpp | UTF-8 | 1,851 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include "position.h"
#include "solver.h"
using namespace std;
const int DEPTH = 9;
int main() {
//auto pos = new Position("44445252656655577373337767646");
auto pos = new Position("");
pos->show();
auto solver = new Solver();
int player;
do {
cout << "Choose nu... | true |
620081f6924b131d710b5971ee104ff806f47c0b | C++ | Nihav-Jain/The-Channeler | /TheChanneler/Source/TheChanneler/Analytics/AnalyticsModule.h | UTF-8 | 3,866 | 2.765625 | 3 | [] | no_license | #pragma once
#include "AnalyticsCommon.h"
#include "AnalyticsModule.generated.h"
class UAnalyticsSession;
/**
* The basic AnalyticsModule plugin class, a new plugin for analytics system should derive from this class
*/
UCLASS(Blueprintable, BlueprintType)
class THECHANNELER_API UAnalyticsModule : public UObject
{
GE... | true |
efa9bd43aaba11f6c1748ed50e43992d714c9522 | C++ | L0mion/xkill-source | /xkill-architecture/ScoreComponent.cpp | UTF-8 | 9,014 | 2.53125 | 3 | [] | no_license | #include "ScoreComponent.h"
#include <xkill-utilities/AttributeManager.h>
#include <xkill-utilities/EventType.h>
#include <xkill-utilities/Timer.h>
#include <xkill-utilities/Converter.h>
ATTRIBUTES_DECLARE_ALL
#define SAFE_DELETE(x) {if(x != nullptr) delete x; x = nullptr;}
ScoreComponent::ScoreComponent()
{
ATTRI... | true |
ccee6c71f23fb676c67e4ad8a403eaeb9416d68f | C++ | hhzzk/cplus-practice | /example3-7/example.cpp | UTF-8 | 1,670 | 3.390625 | 3 | [] | no_license | /*************************************************************************
> File Name: example.cpp
> Author: king
> Mail: wangjinrui2013@gmail.com
> Created Time: 2014年11月18日 星期二 19时37分10秒
************************************************************************/
#include<iostream>
#include<string>
... | true |
52a09d0465acf05b69a4319642385f13a5f4f746 | C++ | DarthParth/EpollDemo | /Base2/src/PeerTracker.h | UTF-8 | 681 | 2.75 | 3 | [] | no_license | /*
* PeerTracker.h
*
* Created on: Dec 13, 2014
* Author: parth
*/
#ifndef PEERTRACKER_H_
#define PEERTRACKER_H_
#include <string>
#include <set>
class PeerTracker {
public:
void update(const std::set<std::string> &incoming) {
std::set<std::string> diff {};
_discoveredPeers.insert(incoming.begin(), in... | true |
1ae9c28423b2df8ee4ca80aafe593e68660c8e3d | C++ | emaldonadogamedev/CodeSamples | /3DGraphics/MeshRenderer/esteban.maldonado_CS300_4/CS300_Fall2016_framework_DirectX11/src/Keyboard.cpp | UTF-8 | 2,023 | 2.6875 | 3 | [] | no_license | #include "Keyboard.h"
#include "DXUtil.h"
Keyboard::Keyboard(LPDIRECTINPUT8 directInput) :m_directInput(directInput), m_device(nullptr)
{
}
Keyboard::~Keyboard()
{
if (m_device != nullptr)
{
m_device->Unacquire();
m_device->Release();
m_device = nullptr;
}
}
const unsigned char* const Keyboard::Cu... | true |
8d926a2a64fe718dbbc3042a192c4e9b9554e69c | C++ | ngmgit/cpplove | /Linkedlist/main.cpp | UTF-8 | 483 | 3.359375 | 3 | [] | no_license | #include "LinkedList.h"
#include <initializer_list>
#include <iostream>
void print(int N) { std::cout << N << ' '; }
void multiplyBy10(Node *node) { node->value = node->value * 10;}
int main(int argc, char *argv[])
{
MyLinkedList l;
l.insert(10);
l.insert(20);
l.insert(30);
l.remove(12);
l.re... | true |
bc83f83fed73f18d3a8ddf2fe3cd5f4523f553ac | C++ | ffk0716/onnc | /include/onnc/Core/ObjectWriter.h | UTF-8 | 1,010 | 2.546875 | 3 | [] | permissive | //===- ObjectWriter.h -----------------------------------------------------===//
//
// The ONNC Project
//
// See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef ONNC_CORE_OBJECT_WRITER_H
#define ONNC_CORE_OBJECT_WRITER_H
#... | true |
31c3ecee37984cc09b78eb8326bbc8c78dea5232 | C++ | madwax/OPHD | /OPHD/Things/Structures/MineFacility.h | UTF-8 | 1,727 | 2.59375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #pragma once
#include "Structure.h"
#include "../../Mine.h"
/**
* Implements the Mine Facility.
*/
class MineFacility : public Structure
{
public:
using ExtensionCompleteSignal = NAS2D::Signal<MineFacility*>;
public:
MineFacility(Mine* mine);
void mine(Mine* mine) { mMine = mine; }
void maxDepth(int depth) { ... | true |
a7086aac7bc5f8747299b0355e23db13b9d4da84 | C++ | JayHoris/Cpp-Algorithm-Collection | /格式输出练习.cpp | GB18030 | 1,050 | 3.40625 | 3 | [] | no_license | #include<iostream>
#include<iomanip>//ʽΪsetͷcoutͷģsetͷ䶼Ҫiomanip
#include<string>
using namespace std;
//ʽɼ_ʵ2-1
void main()
{
cout << "2019113681ܴϽ" << endl; //ѧ
double a, b, c, aver;
string name, num; //
cout << "ѧź";
cin >> num >> name;
cout << "ſγɼ";
cin >> a>>b>>c; //Ϣ
cout... | true |
175ef712f59d8fd068ae9731c38d44548bcc1807 | C++ | cbiasco/slime-apocalypse | /Headers/Sphere.hpp | UTF-8 | 678 | 2.796875 | 3 | [] | no_license | #ifndef SPHERE_H_GUARD
#define SPHERE_H_GUARD
#include "Object.hpp"
const GLdouble PI = 4.0*atan(1.0);
class Sphere : public Object {
public:
Sphere();
Sphere(float r, float x, float y, float z);
Sphere(float r);
Sphere(float r, glm::vec3 p);
virtual ~Sphere();
virtual void simulate(double dt) {};
virt... | true |
d7fd909cee64e1fcc4e987f941bc2851102aec15 | C++ | mihabor2002/EVM | /Triangle.h | UTF-8 | 641 | 2.96875 | 3 | [] | no_license | #pragma once
#include "point.h"
#include <fstream>
//211-Borovikov-Mikhail-2021
class Triangle
{
private:
Point A, B, C;
int id;
int neighbouring_triangle_id;
public:
Triangle();
Triangle(Point a, Point b, Point c);
Triangle(const Triangle& T);
~Triangle() = default;
const Triangle& operator=(c... | true |
15da7103c88c39283df04fa7e9b9699bf13cea42 | C++ | Hana-Noorudheen/CPP_LAB | /telephone.cpp | UTF-8 | 1,684 | 3.015625 | 3 | [] | no_license | import java.io.*;
class post_evln {
private int max;
private int[] arr;
private int top;
private int a;
private int b;
private int r;
public post_evln(int s){
max=s;
arr= new int[max];
top=-1;
}
public void push(int item) {
top++;
arr[top]=i... | true |
bad1062be8d5b0316e5af2446dfafa1534ee7bab | C++ | emilybache/Lift-Kata | /cpp/src/lift.h | UTF-8 | 1,818 | 3.109375 | 3 | [
"MIT"
] | permissive | #ifndef CPP_LIFT_H
#define CPP_LIFT_H
#include <string>
#include <utility>
#include <vector>
#include <set>
class Call {
public:
bool operator<(const Call &rhs) const { // Needed for std::inserter()
if (floor < rhs.floor)
return true;
if (rhs.floor < floor)
return false;
... | true |
148835327190fcf17fdde30e5605f579927bb74c | C++ | panda-sheep/leetcode | /026_Remove_Duplicates_from_Sorted_Array/remove_dup.cc | UTF-8 | 708 | 3.921875 | 4 | [] | no_license | /**********************************************************************
Given a sorted array, remove the duplicates in place such that each element
appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place
with constant memory.
For example,
Given inp... | true |
444856ac2c486dcc2b26b3674057928b236952f1 | C++ | ciechowoj/haste-format | /data_t.cpp | UTF-8 | 59,469 | 2.5625 | 3 | [
"MIT"
] | permissive | #include <haste/data_t.hpp>
#include <algorithm>
#include <cstdint>
#include <cstring>
namespace haste {
using namespace std;
using float8_t = uint8_t;
using float16_t = uint16_t;
using float32_t = float;
using float64_t = double;
typedef void (*datacpy_t)(void*, const void*, size_t);
inline size_t index(data_t dt... | true |
a2195dfcc27bcd2be61841ba517972d5b97a00c6 | C++ | getov/TopCoder | /TopCoder SRM solutions/SRM 424 DIV 2 Level One (250)/MagicSpell.cpp | UTF-8 | 803 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
class MagicSpell
{
public:
string fixTheSpell(string spell);
};
string MagicSpell::fixTheSpell(string spell)
{
vector<char> coll;
for (int i = 0; i < spell.size(); ++i)
{
if (spell[i] == 'A' ... | true |