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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9c08e0fe319f84176498477b532db75d06d313e6 | C++ | Mp5A5/c--primer-plus | /chapter14-reusing/private.cpp | UTF-8 | 751 | 3.40625 | 3 | [] | no_license | #include <iostream>
using namespace std;
class SuperClass
{
private:
void private_call()
{
cout << "super private call" << endl;
}
public:
SuperClass(/* args */){};
~SuperClass(){};
void say()
{
cout << "super say..." << endl;
}
};
class SubClass : protected SuperClas... | true |
4d42377b46cd4b1dc81b824cbba39cb340724790 | C++ | jaronho/project_memory_monitor | /logger/Logger.cpp | UTF-8 | 3,043 | 2.859375 | 3 | [] | no_license | /**********************************************************************
* Author: jaron.ho
* Date: 2019-08-25
* Brief: 日志模块
**********************************************************************/
#include "Logger.h"
#include <fstream>
#include <iostream>
#include <mutex>
#ifdef __linux
#include <syslog.h>
#endif
void... | true |
512ffc34bd7e6091b870e6f82cc9965cec518a53 | C++ | jhashivam1996/problem_solving | /dynamic_programing/coin_combinations.cpp | UTF-8 | 621 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
int wayOfCoinChange(int *denominations, int amount)
{
int combinations[amount + 1];
memset(combinations, 0, sizeof(combinations));
combinations[0] = 1;
for (int i = 0; i < 3; i++)
{
for (int j = 1; j < amount + 1; j++)
{
... | true |
3c2adce3ba2b0e50d43649e4e8263a4fedde779d | C++ | RaviKim/CentDir | /CPlusTest.d/dailyPractice.d/0202.d/itervector.cpp | UTF-8 | 284 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int ari[] = {1, 2, 3, 4, 5};
vector<int> vi(&ari[0], &ari[5]);
vector<int> :: iterator it;
for(it = vi.begin() ; it!=vi.end(); it++)
{
cout << *it << endl;
cout << "Address : " << &*it << endl;
}
}
| true |
615f4d3c69f8119c1563bc6f5a8e02d63a5cbba0 | C++ | Diegores14/CompetitiveProgramming | /Lightoj/1204 - Weird Advertisement/solution.cpp | UTF-8 | 2,304 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int n, k;
const int tam = 30000;
struct node {
int count, sum;
node *left, *right;
node(): count(0), sum(0), left(NULL), right(NULL) {}
};
struct edge {
int x, y1, y2, value;
bool operator <(const edge & other) {
return x < other.x;
}
} li... | true |
32a941d51c7daa1a41aff7fef1899907a9c31401 | C++ | kingkk31/BOJ | /source code/12813_이진수 연산.cpp | UTF-8 | 844 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <utility>
#pragma warning (disable:4996)
using namespace std;
int main(void)
{
string a, b;
cin >> a >> b;
for (int i = 0; i < a.length(); i++)
printf("%d", ((int)(a[i] - '... | true |
5d071ea781284eee826337074f9c8fb734f32521 | C++ | jchan1e/graphics | /second_semester/examples/ex26/ex26.cpp | UTF-8 | 13,727 | 2.671875 | 3 | [] | no_license | /*
* nBody Simulator
* This program requires OpenGL 3.2 or above
*
* Demonstrates using OpenMP and OpenCL to accelerate computations and
* displaying the result in OpenGL
*
* Key bindings:
* m/M Cycle through modes
* a Toggle axes
* arrows Change view angle
* PgDn/PgUp Zoom in a... | true |
ab9a26b8e54b27debe31ce421d14a055ce1420fe | C++ | Kam-Sergei/PNRPU | /2 семестр/Лабораторные/Лабораторная 18.1/Lab1_main.cpp | UTF-8 | 1,550 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include"fraction.h"
using namespace std;
fraction make_fraction(double F, double S)
{
fraction t;
t.Init(F, S);
return t;
}
int main()
{
fraction A;
A.Init(0.4,0.3);
A.Show();
cout << "A.hipotenuse(" << A.first << "," << A.second << ")=" << A.hipotenuse() << endl<<endl;
fr... | true |
c9468273584adcca2d6a0b6a7a7b9115da340a4f | C++ | chenditc/hackathon_2014 | /simulator.cpp | UTF-8 | 2,935 | 3.234375 | 3 | [] | no_license | #include "simulator.h"
#include <algorithm>
#include <assert.h>
struct StateComp {
bool operator() (const game_state &lhs, const game_state &rhs) {
return lhs.getScore() > rhs.getScore();
}
} stateComp;
board_point Simulator::getBestMove() {
// stateContainer.push_back(gameState);
simulateAllM... | true |
5c580a3bceaa1da272f94d2484aaf4122b4e83a3 | C++ | jehalladay/CS1-Fundamental-of-Computer-Science | /Assignments/assign4/images/HDDB.cpp | UTF-8 | 6,714 | 2.828125 | 3 | [
"MIT"
] | permissive | /*********************************************************************************************
* Implementation program for Practicum 8 by Sherine and CSCI 111 student: *
******************************************************************
* Filename: HDDB.cpp
... | true |
cd335d5a4903022baac03ba0b80996f90e51eb07 | C++ | zzDeagle545zz/CSC-5 | /Lecture/Lecture_gCh5_sCh4/main.cpp | UTF-8 | 3,098 | 3.140625 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Christopher Garcia
*
* Created on January 26, 2016, 5:25 PM
*/
#include <iostream>
#include <cstring>
using namespace std;
int main(int argc, char** argv) {
/*Functions
* fstream library
*
* modular programming
* breaking the program into smaller pieces
* short blocks 50 ... | true |
9c2a0a24d193aa1655ecc21deb980015ad401547 | C++ | malytomas/asciilabyrinthgen | /sources/labgen/paths.cpp | UTF-8 | 2,581 | 3 | 3 | [] | no_license | #include "labgen.h"
#include <vector>
#include <utility> // std::swap
namespace
{
struct Paths
{
Labyrinth &lab;
std::vector<uint32> dists;
std::vector<ivec2> prevs;
Paths(Labyrinth &lab) : lab(lab)
{}
Cell &cell(ivec2 p)
{
CAGE_ASSERT(p[0] >= 0 && (uint32)p[0] < lab.width && p[1] >= 0 && (uint3... | true |
e01b0ae8f130897a78df4bd9958074a516437c4c | C++ | NikolayKIvanov/Banking-System | /Task1/Account.h | UTF-8 | 501 | 3.203125 | 3 | [] | no_license | #pragma once
#include "iostream"
class Account
{
public:
Account(const char* _iban = "", int _ownerid = 0, double _amount = 0.0);
Account(const Account&);
Account& operator=(const Account&);
~Account();
virtual void deposit(double) = 0;
virtual bool withdraw(double) = 0;
virtual void display() const = 0;
do... | true |
095639198fb8f44753751cbc85c7f068f4967e06 | C++ | gadm21/INTERPRETER | /Instruction.h | UTF-8 | 16,237 | 2.90625 | 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: Instruction.h
* Author: gad
*
* Created on April 25, 2018, 2:49 PM
*/
#ifndef INSTRUCTION_H
#define ... | true |
c610d3730c595c16fb33603c011ac6695ea557f4 | C++ | HPMongo/CS325_Max_Sum_Subarray | /MSS.cpp | UTF-8 | 14,663 | 3.359375 | 3 | [] | no_license | /*
* Author: Mike Sharkazy & Huy Pham
* Date Created: 07/11/15
* Last Date Modified: 07/12/15
* File Name: MSS.cpp
* Assignment: Project 1 - Project Group 18
* Overview: A program to calculate the maximum subarray sum of arrays
* using different algorithms; The progra... | true |
e1d740261181d19ff9d0b02d1d8e2c58b9f791bd | C++ | SRamsey73/RoomControl | /controllers/desk_controller/src/main.cpp | UTF-8 | 1,523 | 2.75 | 3 | [] | no_license | #include <Arduino.h>
#include <TemperatureSensor.h>
#include <LightSensor.h>
#include <OccupancySensor.h>
#include <LEDStrip.h>
//Defines led strip animations in a separte file to keep main tidy
#include "DeskAnimations.h"
TemperatureSensor* roomTemperauteSensor;
LightSensor* roomLightSensor;
OccupancySensor* roomOc... | true |
494046f48ec61bd89936225a714ed0449f127876 | C++ | migaelstrydom/haggis | /src/test/testwindow.cpp | UTF-8 | 17,477 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | /************************************************************************
*
* testwindow.cpp
* Window class tests
*
************************************************************************/
#include "window.h"
#include "test.h"
#include <iostream>
#include <cppunit/extensions/HelperMacros.h>
/**
... | true |
cc31bf8b7116616c5be1a6a0fde47011da16ed90 | C++ | Artemmm91/CSES | /Dynamic Programming/Edit Distance/Edit Distance/main.cpp | UTF-8 | 905 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int n, m, temp;
string s1, s2;
cin >> s1 >> s2;
n = (int)s1.size();
m = (int)s2.size();
vector<int> v_0;
vector<vector<int>> v;
for(int i =0; i <= n; i++){
v_0.push_ba... | true |
1c9b9da68e14b4a50fe1b60bce5a3fd3c2f0fa7f | C++ | gg-uah/GARouter | /GAROUTER/CommonUtils/include/StringUtilsException.hpp | UTF-8 | 1,271 | 3.34375 | 3 | [] | no_license | #ifndef __STRING_UTILS_EXCEPTION
#define __STRING_UTILS_EXCEPTION
#include <string>
namespace common {
enum StrUtilErrorType {STRUTIL_UNSPECIFIED,
STRUTIL_BAD_INT_CAST,
STRUTIL_BAD_LONG_CAST,
STRUTIL_BAD_FLOAT_CAST,
... | true |
c44834052d162fa47892eb01c608761b1d2414fe | C++ | ariyonaty/ECE1310 | /Exercises/exercise_89.cpp | UTF-8 | 2,663 | 4.03125 | 4 | [] | no_license | /*
Ari Yonaty
ECE 1310
3.21.2019
Exercise 89: Tic Tac Toe
*/
// Libraries
#include <iostream>
#include <iomanip>
using namespace std;
// Functions
char setup();
void printBoard(char array[][3]);
bool turn(char array[][3], int t);
bool winner(char array[][3]);
// Variables
char player;
char comp... | true |
c5bf97d930f73f640ba73641e4d0d3a9f78e5a75 | C++ | yhencay/CayShienne_CSC17A_42636 | /Hmwk/Assignment_4/Gaddis_8thEd_Chap12_Prob5_LineNumbers/main.cpp | UTF-8 | 1,916 | 3.53125 | 4 | [] | no_license | /*
* File: main.cpp
* Author: Shienne Cay
* Created on April 3, 2017, 9:20 PM
* Purpose: Homework #4 Line Numbers
*
* Problem: (This assignment could be done as a modification of the program in
* Programming Challenge 2.) Write a program that asks the user for the name of
* a file. The program should disp... | true |
37bd23b67b20d61b761253319178dc57ce4b885f | C++ | jk983294/CommonScript | /cpp/std_cpp/stl/iterator/istream_iterator.cpp | UTF-8 | 472 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <iterator>
using namespace std;
// istream iterators read successive elements from an input stream (such as cin, file).
int main() {
double value1, value2;
std::cout << "Please, insert two values: ";
std::istream_iterator<double> iit(std::cin), eos;
if (iit != eos) valu... | true |
27a447161d90ca9694e8d50a2f695e976a017150 | C++ | burakbayramli/books | /Riemann_Solvers_and_Numerical_Methods_for_Fluid_Dynamics_Toro/Riemann-Solvers-master/Euler Equation/MUSCL/basic.cc | UTF-8 | 16,467 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
const double G0 = 1.4;
const double G1 = 0.5 * (G0 - 1) / G0;
const double G2 = 0.5 * (G0 + 1) / G0;
const double G3 = 2 * G0 / (G0 - 1);
const do... | true |
c451408b3d006412dcbe3bf973af52636086ad72 | C++ | wandsu/arduino | /semaforo.ino | UTF-8 | 1,722 | 2.796875 | 3 | [] | no_license | //Botão Pedestre
int botaoPedestre = (9);
//Pinos Semáforo Carros
int carrosVerde = (3);
int carrosAmarelo = (2);
int carrosVermelho = (1);
//Pinos Semáforo Pedestre
int pedestreVerde = (7);
int pedestreVermelho = (6);
void setup()
{
pinMode(botaoPedestre,INPUT);
pinMode(pedestreVerde,OUTPUT);
p... | true |
4748cf9207ba91c8c91e3cb0770d42246ba374b0 | C++ | ltjohn25/Galaxianfinal | /includes/Star.h | UTF-8 | 718 | 2.75 | 3 | [] | no_license | #ifndef STAR_H
#define STAR_H
#include <vector>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include "Includes.h"
#include "Rect.h"
#include "Constants.h"
#include "Color.h"
#include "Surface.h"
#include "Event.h"
class Star
{
private:
int x;
int y;
int h_;
int w_;
Color color;
... | true |
399379c278502b6528e262892b6e6b3696d27822 | C++ | Novota15/Space-Invaders | /controls.cpp | UTF-8 | 677 | 2.625 | 3 | [] | no_license | // control functions
#include "controls.h"
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {
switch (key) {
case GLFW_KEY_ESCAPE:
if (action == GLFW_PRESS) game_running = false;
break;
case GLFW_KEY_RIGHT:
if (action == GLFW_PRESS) move_dir += 1;
... | true |
2317fe23a70f285baf57ef998e1fbd354755a206 | C++ | WhiZTiM/coliru | /Archive2/0d/91d6c1b887569a/main.cpp | UTF-8 | 852 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <boost/asio.hpp>
namespace foo
{
const int _1 = 1;
const int _2 = 2;
}
template<typename Derived>
struct helper
{
using Derived::_1;
using Derived::_2;
void print_this()
{
std::cout << _1 << ", " << _2 << std::endl;
... | true |
c8da9ed9882827ada951ac6aef449bff61dfd9b8 | C++ | N4PSTER013/TheNewBostonCPP | /Class 8 || If.cpp | UTF-8 | 606 | 3.15625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
if(5 > 2)
{
cout << "Bucky is awesome!" << endl;
}
if(1 > 2)
{
cout << "Bucky is awesome!" << endl;
}
if(2 >= 2)
{
cout << "Bucky is awesome!" << endl;
}
if(0 >= 2)
{
cout << "Bucky is awe... | true |
916e17fee4a65caa8234208c13b8e525926fd7db | C++ | dupes/carp | /shared/Object.h | UTF-8 | 1,382 | 2.734375 | 3 | [] | no_license | /*
* Object.h
*
* Created on: Nov 20, 2012
* Author: dupes
*/
#ifndef OBJECT_H_
#define OBJECT_H_
#include <string>
#include <opencv2/imgproc/imgproc.hpp>
#include "Database.h"
#include "CVImage.h"
using namespace std;
using namespace cv;
struct tObject
{
int id;
int frame_id;
Mat object_image;
vec... | true |
4d5895bc0ef924bbc880a40e076d055a78559a89 | C++ | zhongfanZhang/flightsim | /Physics.cpp | UTF-8 | 2,412 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <math.h>
#include "Physics.h"
#define DEG2RAD(x) ((x)*M_PI/180.0)
#define RAD2DEG(x) ((x)*180.0/M_PI)
Physics::Physics()
{
//position of the start of the runway
position = glm::vec3(14.0, 96.0, 250.0);
yaw = M_PI;
pitch = 0.0;
roll = 0.0;
speed... | true |
ca5b35673278f4c8b1b85d690d07ceb251565088 | C++ | amandewatnitrr/Cpp | /String/Program_to_trace_out_sub_string.cpp | UTF-8 | 825 | 3.125 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
#include<process.h>
#include<string.h>
#define max 80
using namespace std;
int main()
{
char m[max],s[max];
int n,len;
cout<<"\nEnter the main String --> \n";
cin.getline(m,max);
cout<<"\nEnter the start point for string --> ";
cin>>n;
if(n>strlen(m))
{
cout<<"\nWrong S... | true |
e54dc997cf8c59921aa188516032821f173b4f2b | C++ | FraserGreen/APT | /repoGit/PreRecVideos_w03/w03-03-pointers.cpp | UTF-8 | 665 | 3.375 | 3 | [] | no_license | #include <iostream>
#define ROWS 10
#define COLS 5
int main(void) {
int x = 10;
int y = -3;
int* ptr = &x;
int* qtr = &y;
// int** pptr = &ptr;
// int*** ppptr = &pptr;
std::cout << x << std::endl;
std::cout << y << std::endl;
std::cout << *ptr << std::endl;
std::cout << *... | true |
c2adb97b40a6c541b2303017d3f8e7cd6a5eae43 | C++ | hmmvot/gltest | /GLTest/src/Renderer.cpp | UTF-8 | 3,419 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "Renderer.h"
#include "Camera.h"
#include <list>
void Renderer::Render(const Camera &camera, const std::vector<ObjectRef> &objects)
{
glClearColor(0.9f, 0.9f, 0.9f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
const auto projection = camera.GetProjectionMatrix();
const auto view ... | true |
6bb5875cace6c272355b0f85732063055d5acbd7 | C++ | trikstor/laboratory_work | /lab2/main.cpp | UTF-8 | 2,091 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include "func_mass.h"
using namespace std;
/*
* 8.
*Сформировать одномерный массив целых чисел, используя датчик случайных чисел.
*Распечатать полученный массив.
*Удалить все элементы с заданным значением.
*Добавить перед... | true |
e0b3a6f1dd10ee2fdcb717e8303219e00ab23eb7 | C++ | AL5624/TH-Rosenheim-Backup | /INF/B4/Rechnerarchitektur (RA)/CA_exercises/sheet_12_bus/io_prog_isolated_io/io_prog_isolated_io.ino | UTF-8 | 972 | 2.984375 | 3 | [] | no_license | //TODO: set a "1" for ON and a "0" for OFF for the right bit into the register.
//use an appropriate number representation for that.
//".equ" is nearly similar to the C-preprocessor statement "#define"
asm (".equ ON, "); //value for enable (switch on)
asm (".equ OFF, "); //value for disable (switch off)
void setup()... | true |
de03f750e0a1d3524a372f837cff36c5e26930c8 | C++ | MaciekMr/SofarInverter | /inverter.cpp | UTF-8 | 2,134 | 2.625 | 3 | [] | no_license | #include "inverter.h"
#include "configmodel.h"
#include "datacollector.h"
#include <threadset.h>
#include <connector.h>
#include "definitions.h"
Inverter::Inverter()
{
timer = new QTimer(this);
worker = nullptr; //new Worker(new server_point);
}
Inverter::~Inverter(){
if(timer->isActive())
timer-... | true |
f0730f70c2c7105cf8a83839344411816dd69fcb | C++ | RomainDuclos/M1alma2017-2018_Complexite | /Complex/include/AlgoLib.hpp | UTF-8 | 6,596 | 3.203125 | 3 | [] | no_license | #ifndef ALGOLIB_HPP
#define ALGOLIB_HPP
#include <vector>
#include <iostream>
#include <string>
#include "../include/MyLib.hpp"
using namespace std;
int LSA(vector<int> v)
{
vector<Machine> ens_mach;
vector<Tache> ens_tache;
//Creation machines
for (int i = 0; i < v[0]; ++i)
{
Machine m;
m.ind = i;
ens... | true |
a4515da25003a3f7534254f71f60dcc7b86b5a75 | C++ | abhishek1BM19CS400/C-plusplus | /Day-1/bitwise.cpp | UTF-8 | 348 | 3.484375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int a = 10, b = 12;
int c1, c2, c3, c4, c5;
c1 = a & b; //And
c2 = a | b; //or
c3 = ~a; //not
c4 = a >> b; //right shift
c5 = a << b; //left shift
cout << c1 << endl;
cout << c2 << endl;
cout << c3 << endl;
cout << c4 << end... | true |
69d2aae7d4ec73375bd0aa1a4b8233ceb3fb53c3 | C++ | cstrike111/Watermelon | /GameEngine/GameEngine/Physics/Physics.h | UTF-8 | 2,006 | 2.90625 | 3 | [] | no_license | #pragma once
#include <string>
#include <map>
#include "..\Entity\Entity.h"
#include "..\EventSystem\EventSystem.h"
#include "..\Profile\Profile.h"
#include "Box2D\Box2D.h"
#include "..\Entity\BulletEntity.h"
#include "ContactListener.h"
#include <vector>
using namespace std;
class Physics {
public:
/* For the unit... | true |
43dbbc729d2eeaed85bf9211e8fb06cf612f2b66 | C++ | elbica/INHA | /02_22/Eunseo/10824.cpp | UTF-8 | 341 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
string s1, s2;
s1 = to_string(a) + to_string(b);
s2 = to_string(c) + to_string(d);
long long num1 = stoll(s1); //string -> int
long long num2 = stoll(s2);
cout << num1 + num... | true |
31af7d6eb86d5b938d4a2e91bc63bbee750143b1 | C++ | repmop/CUDAbins | /main.cpp | UTF-8 | 1,833 | 2.84375 | 3 | [] | no_license | /*
* CLI for bin-packing optimizer
* Takes an input file in the format specified in README.md
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <iostream>
#include <unistd.h>
#include "bin.h"
#include "parse.h"
void usage() {
fprintf(stderr, "-f /path/to/input [-o /path/to/output]\n");
}
... | true |
ffb1d2e98a23bebf4744e4c3c7ee63a8df97c359 | C++ | Zhiwei5/Duke-Algorithm-Data-Structure-Class | /dukeC++class/077_sort_cpp/sortLines.cpp | UTF-8 | 1,201 | 3.5625 | 4 | [] | no_license | #include <algorithm>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
void print_vec(std::vector<std::string> & vec) {
std::vector<std::string>::iterator it = vec.begin();
while (it != vec.end()) {
std::cout << *it << std::endl;
++it;
}
}
int main(int argc, char ** argv) {
if... | true |
a7731442c03c91938122b6ac4a6f6e3ca6e24c15 | C++ | dOrgJelli/UrsineMath | /Source/UrsineMath.hpp | UTF-8 | 3,279 | 3.140625 | 3 | [
"MIT"
] | permissive | /* ---------------------------------------------------------------------------
** Team Bear King
** DigiPen Institute of Technology 2014
**
** UrsineMath.hpp
**
** Author:
** - Jordan Ellis - J.Ellis@digipen.edu
**
** Contributors:
** - <list in same format as author if applicable>
** ----------------------------------... | true |
296bccc21e30e40163066449f1035f2de989ab4f | C++ | yangyanggong28/SmartString | /SmartString_test/SmartString_test.cpp | UTF-8 | 1,376 | 2.859375 | 3 | [] | no_license | // SmartString_test.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
#include <string>
#include "SmartString.h"
int main()
{
SmartString testStr(" gyy ");
std::cout << testStr << std::endl;
testStr.trimLeft();
std::cou... | true |
bc32d93a670a6c87a5921733e7afa9ecb33a0d0c | C++ | wpilibsuite/allwpilib | /wpilibcExamples/src/main/cpp/examples/GearsBot/include/subsystems/Elevator.h | UTF-8 | 1,632 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include <frc/AnalogPotentiometer.h>
#include <frc/motorcontrol/PWMSparkMax.h>
#include <frc2/command/PIDS... | true |
82080a6d35f004fd4c8de4a049e799794cac4107 | C++ | dujingui/LetCode | /LetCode/LetCode/Code_1603.h | UTF-8 | 482 | 3.1875 | 3 | [] | no_license | #pragma once
#include "Define.h"
class ParkingSystem {
public:
enum CarType {
BIG,
MEDIUM,
SMALL,
MAX,
};
public:
ParkingSystem(int big, int medium, int small)
{
m_ParkingNum[CarType::BIG] = big;
m_ParkingNum[CarType::MEDIUM] = medium;
m_ParkingNum[CarType::SMALL] = small;
}
bool addCar(int carT... | true |
ffb3abaa3a5ea850770d470572ce42424a666826 | C++ | mikee649/Project-Euler-Solutions | /Problems/P107/Disjoint_sets.h | UTF-8 | 2,738 | 3.34375 | 3 | [] | no_license | #ifndef DISJOINT_SET_H
#define DISJOINT_SET_H
#ifndef nullptr
#define nullptr 0
#endif
#include <limits>
using namespace std;
struct ll_entry; // represents each element of the linked list
struct set_info; // keeps track of the information (pointers to head and tail and the size of the set) of each set
//could we ... | true |
78b3bd1ffe7b06b69d4501ae8c69171ae227abc2 | C++ | hanky3/HLP_CodeJam | /AlgoSpot/02_Graph/MCHESS.cpp | UTF-8 | 3,737 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
using namespace std;
#define MAX_TEXT_SIZE 101
typedef pair<int, int> _pos;
FILE *fpInput;
FILE *fpOutput;
int N;
vector<vector<char>> chessMap;
_pos startPos;
_pos endPos;
map<char, vector<_pos>> chessDirec... | true |
1a406297230d2c2e0b26cce88b5a27d4c0a55a12 | C++ | tangsancai/algorithm | /PAT-B/1013. 数素数.cpp | UTF-8 | 596 | 2.6875 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
int main()
{
int M;
int N;
scanf("%d%d",&M,&N);
int i=0;
int Num=2;
int flag=0;
int huan=0;
while(i<=N)
{
for(int j=2;j<=(int)sqrt((double)Num);j++)
{
if(Num%j==0)
{
flag=1;
break;
}
}
if(flag==1)
{
flag=0;
}
else
... | true |
fe03d7124114971843b16f0fe8421b07e9048864 | C++ | ArtTolston/myrepository | /Coursera_MIPT_Yandex_Courses/Yellow_Belt_C++/bus_stations-2/bus_manager.cpp | UTF-8 | 2,046 | 2.890625 | 3 | [] | no_license | #include "bus_manager.h"
#include "responses.h"
void BusManager::AddBus(const string& bus, const vector<string>& stops) {
for(const auto& i: stops) {
BusManager::stops_for_buses[bus].push_back(i);
BusManager::buses_for_stops[i].push_back(bus);
}
}
BusesForStopResponse BusM... | true |
4cb9d7a4bded5bd74100ccdcdbf12caf546ede9e | C++ | brendangoldz/coursework_cplus | /BrendanGoldsmith_WeatherStation 5/BrendanGoldsmith_WeatherStation/wind.cpp | UTF-8 | 1,236 | 3.296875 | 3 | [] | no_license | #include "stdafx.h"
#include <string>
#include <iostream>
#include <sstream>
#include <regex>
#include "wind.h"
using namespace std;
bool validate_wind(string in, string val) {
const char* test = in.c_str();
regex re(val);
cmatch match;
if (regex_match(test, match, re)) {
return true;
}
else {
... | true |
194c6101a7637b838ce36fcdc58ee4ccb6e83def | C++ | ValdemarOrn/NoiseInvaderVST | /VstNoiseGate/AudioLib/Utils.cpp | UTF-8 | 1,017 | 2.71875 | 3 | [] | no_license | #include "MathDefs.h"
#include <cmath>
#include "Utils.h"
namespace AudioLib
{
float Utils::note2Freq[12800];
float Utils::sintable[TableSize];
float Utils::costable[TableSize];
float Utils::tableScaler;
float Utils::tanhTable[TanhTableSize];
void Utils::Initialize()
{
for (int i = 0; i < 12800; i++)
{
... | true |
bc5d15ed6207e903f69787f849bf30d125300114 | C++ | ChristopherHX/libjnivm | /src/tests/Tests.cpp | UTF-8 | 60,068 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <jnivm/class.h>
#include <jnivm/wrap.h>
#include <gtest/gtest.h>
#include <jnivm.h>
#include <stdexcept>
struct Class1 : public jnivm::Object {
jboolean b;
static jboolean b2;
std::shared_ptr<jnivm::String> s;
static std::shared_ptr<jnivm::String> s2;
};
jboolean Class1::b2 = false;
std::share... | true |
5632c2872d9aa3e1f33a96b44039a04ec5d23f69 | C++ | mytpp/FakeOS | /FakeOS/FakeOS/CPUCore.cpp | GB18030 | 11,403 | 2.65625 | 3 | [] | no_license | #include "CPUCore.h"
#include "ProcessScheduler.h"
#include "MemoryManager.h"
#include "FileSystem.h"
#include <cassert>
#include <iostream>
#include <sstream>
using namespace std;
using namespace kernel;
inline void removePrefixedSpace(string_view& sv)
{
sv.remove_prefix(min(sv.find_first_not_of(' ... | true |
15e84f3d2b2d4a99baacebfc1ea8e67fe1a50af0 | C++ | Ynjxsjmh/DataStructureAssignment | /结果/第七次在线测评结果/source/1114/preorder.cpp | UTF-8 | 1,122 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
using namespace std;
ifstream fin("preorder.in");
ofstream fout("preorder.out");
struct point
{
char data;
point *left;
point *right;
};
class tree
{
public:
point *root;
void build(string &, string &, point *&);
tree();
void preorder... | true |
16b81015c374c3a3a613b0a4a5dd82950dd741e6 | C++ | nathan-create/assignment-problems | /seqSum.cpp | UTF-8 | 1,061 | 3.671875 | 4 | [] | no_license |
# include <iostream>
# include <cassert>
int seqSum(int n){
if (n==0){
return 0;
}
int seqList[n+1];
int sum = 1;
seqList[0] = 0;
seqList[1] = 1;
for (int x = 2; x <= n; x++){
seqList[x] = seqList[x-1] + 2 * seqList[x-2];
sum += seqList[x];
}
return sum;
}
... | true |
61357dfcfb90b97828a2352ee71f5531356d0e78 | C++ | sharp104/SmartMancala | /Mancala.cpp | UTF-8 | 9,992 | 2.984375 | 3 | [] | no_license | // Mancala.cpp : Defines the entry point for the application.
//
#include "Mancala.h"
#include <array>
using namespace std;
MancalaState::MancalaState() {
init();
}
void MancalaState::init() {
cur_p = 0;
p1pock = 0;
p2pock = 0;
gameover = false;
for (int i = 0; i < BOARD_SIZE; i++) {
boar... | true |
725c51b3682120a0b6337f7fd14b8f538d71ca61 | C++ | AnvilOnline/AnvilClient | /AnvilEldorado/Source/Blam/Math/RealOrientation3D.cpp | UTF-8 | 649 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "RealOrientation3D.hpp"
namespace Blam::Math
{
RealOrientation3D::RealOrientation3D()
: RealOrientation3D(RealQuaternion(), RealPoint3D(), 0.0f)
{
}
RealOrientation3D::RealOrientation3D(const RealQuaternion &rotation, const RealPoint3D &translation, const float scale)
: Rotation(rotation), Translatio... | true |
001895860d7523797528968a4b32438dc137c12c | C++ | westlicht/teensy-template | /src/Point.h | UTF-8 | 178 | 2.859375 | 3 | [] | no_license | #pragma once
#include <cstdint>
//! 2D point.
struct Point {
int16_t x;
int16_t y;
constexpr Point(int16_t x_, int16_t y_) : x(x_), y(y_) {}
};
typedef Point Size; | true |
0a077a92abc3b1a74df2e088fa389a9246ed9199 | C++ | tonyinuma/ArduinoNodeJS | /counter/counter.ino | UTF-8 | 292 | 2.546875 | 3 | [] | no_license |
//int counter = 0;
float tempC;
int pinLM35 = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
//Serial.print(++counter, DEC);
//delay(2000);
tempC = analogRead(pinLM35);
tempC = (5.0 * tempC * 100.0)/1024.0;
Serial.print(tempC);
Serial.print("\n");
delay(10000);
}
| true |
4a518697899e9be4ec0e16bebf8f2f135fac199f | C++ | JuanFerInc/Prog-4 | /3_lab0/Lab_0/Source/DtViajeBase.cpp | UTF-8 | 592 | 2.5625 | 3 | [] | no_license | #include <string>
#include "../Header/DtViajeBase.h"
//Constructora
DtViajeBase::DtViajeBase() {
}
DtViajeBase::DtViajeBase(DtFecha fecha_arg, int duracion_arg, int distancia_arg) {
fecha = fecha_arg;
duracion = duracion_arg;
distancia = distancia_arg;
}
DtViajeBase::DtViajeBase(const DtViajeBase& via) {
this... | true |
28733ec35575412bf07f52338fdfb9e2a855a77a | C++ | SX-CPP/sci_computing_cpp_wi2019 | /exercises/solution/sheet8/exercise3/almost_equal.hh | UTF-8 | 580 | 3.390625 | 3 | [] | no_license | #pragma once
#include <cmath>
#include <limits>
#include <utility>
// floating-point comparison
template <class T>
typename std::enable_if<!std::numeric_limits<T>::is_integer, bool>::type
almost_equal(T x, T y, int ulp = 2)
{
return std::abs(x-y) <= std::numeric_limits<T>::epsilon() * std::abs(x+y) * ulp
// u... | true |
d2097924e6a481f08086b0f0a8b1e2a29ed65931 | C++ | nuttert/Server-back | /Utils/Containers/multi_index_container.hpp | UTF-8 | 7,504 | 3.046875 | 3 | [] | no_license | #pragma once
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/mem_fun.hpp>
#include <Utils/type_traits.hpp>
#include "types_container.hpp"
namespace
{
namespace mi = boost::multi_index;
namespace tt = utils::ty... | true |
8eb8f53439f69f5151eba0d18aee33928c068268 | C++ | mdqyy/hpm | /src/hpm/hpmatch.cpp | UTF-8 | 10,860 | 2.53125 | 3 | [] | no_license | #include <hpm/hpmatch.hpp>
using namespace std;
using namespace cv;
namespace hpm {
template<>
const unsigned int feat::oob = -1;
//---------------------------------------------------------------------------
// main HPM entry point when feature labels (visual words) are known
// (cv style)
double HPMatcher::match(... | true |
9960b8b14095e78c4d6af54a47a0dbc5daa3e767 | C++ | BorduzRazvan/IEP_2017-2018 | /Server/IEP_SERVER_APP/pin.h | UTF-8 | 1,011 | 2.875 | 3 | [] | no_license | #ifndef PIN_H
#define PIN_H
#define OFF_VALUE 0u
#define ON_VALUE 1u
class Pin
{
public:
Pin(int pin);
Pin(int pin, int dir);
Pin(int pin, int dir, int pull_up);
void set(int Option);
int getValue(void);
void changeDir(int new_Dir);
void set_eds(void);
int ... | true |
00538294535c5b05a374bb2e167ab18e1f1a4a08 | C++ | ericoloewe/computer-science | /aulas/sistemas-embarcados/praticas/pir/pir.ino | UTF-8 | 717 | 2.84375 | 3 | [] | no_license | int motionSensorPort = 27;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
establishContact();
attachInterrupt(digitalPinToInterrupt(motionSensorPort), detectsMovement, RISING)... | true |
67cb3c1faf4adb1bf027aa766ff7cace76fd3d16 | C++ | rickflaget/bpy | /grammartypes.cpp | UTF-8 | 2,036 | 2.9375 | 3 | [] | no_license | #include <map>
#include <string>
using namespace std;
typedef enum gtypes {IF, MAIN, PROGRAM, ELSE, WHILE, FOR, VAR, FUNCTION, CLASS, EQUAL, OR, AND, VARIABLE, NUMBER, STRING, COMMENT,
ENDofINPUT, OPAREN, CPAREN, COMMA, PLUS, TIMES, MINUS, DIVIDES, LESSTHAN, GREATERTHAN, ASSIGN, SEMICOLON, MOD, EXP, OBRACE,
CBRACE, D... | true |
093920e8bca3e084304e644eeea488a3b2bced08 | C++ | 10098/braveball | /game/objects/threat.cpp | UTF-8 | 557 | 2.640625 | 3 | [] | no_license | #include "game/objects/threat.h"
#include "game/engine.h"
namespace game
{
Threat::Threat(const game::Engine& e, int x, int y):
GameObject(x, y, 15, 9),
m_movementThr(15),
m_anim(e.resourceManager().getAnimationData("meanies/king/king"))
{
addTag("king");
}
void Threat::update(Engi... | true |
39608b3681bdd4a5c7d2c8ad624969b85ac95469 | C++ | LangdalP/ecs-vs-oo | /utils.h | UTF-8 | 2,120 | 2.796875 | 3 | [] | no_license | //
// Created by Peder Voldnes Langdal on 20/04/2020.
//
#ifndef ECS_VS_OO_UTILS_H
#define ECS_VS_OO_UTILS_H
#include <cstdlib>
#include "GameObject.h"
#include "Components.h"
#include "GameObjectWithPointers.h"
float random_float() {
auto randomInt = rand();
return (float)randomInt;
}
Position generate_pos... | true |
93761c4e07c485acde802574a321cf43c48aa3e7 | C++ | idaohang/QML-GPSKoordinaten | /pointmodel.h | UTF-8 | 699 | 2.640625 | 3 | [] | no_license | #ifndef POINTMODEL_H
#define POINTMODEL_H
#include <QAbstractListModel>
#include <QList>
#include "point.h"
class PointModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit PointModel(QObject *parent = 0);
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QMo... | true |
a1ad3c38626a5bbf7a87a0f9bb925fa2be58bbeb | C++ | frchaban/CPP-42 | /5_day_CPP/ex02/Form.hpp | UTF-8 | 1,473 | 3.09375 | 3 | [] | no_license | #ifndef FORM_HPP
# define FORM_HPP
# include <string>
# include <iostream>
# include "Bureaucrat.hpp"
class Bureaucrat;
class Form;
class Form
{
public:
Form(std::string const &name, unsigned int const signed_grade, unsigned int const exec, std::string target);
Form(Form const &other);
Form& operator=(Form co... | true |
319d432d0c99bbc0025f09441098162fd75e1b50 | C++ | HaoLi-China/Mobility-Reconstruction | /geom/map_copier.cpp | UTF-8 | 4,703 | 2.609375 | 3 | [] | no_license | #include "map_copier.h"
#include "map_builder.h"
MapCopier::MapCopier() {
copy_all_attributes_ = false ;
current_source_ = nil ;
current_destination_ = nil ;
// By default: copy vertex locks
declare_vertex_attribute_to_copy("lock") ;
}
MapCopier::~MapCopier() {
}
void MapCopier::copy(
MapBuild... | true |
7d5b37cead1eabde5b3249142d9a8a714e91e5f5 | C++ | refiute/special_study | /genetic_algorithm_template.cpp | UTF-8 | 3,388 | 3.140625 | 3 | [] | no_license | #include <boost/random.hpp>
#include <boost/dynamic_bitset.hpp>
using namespace std;
boost::random::mt19937 gen;
class Gene{
public:
boost::dynamic_bitset<> chromosome;
int fitness;
Gene(int l){
boost::random::uniform_int_distribution<> dist(0, 1);
chromosome.resize(l);
for(int i=0;i<chromosome.size();i++){... | true |
1be5ba6b57d0ef1b95aed00c347a4fe26e0fad95 | C++ | andrewhannebrink/C---Command-Line-Poker | /lab5332.cpp | UTF-8 | 907 | 2.578125 | 3 | [] | no_license |
//Andrew Hannebrink (408421)
//ahannebrink@wustl.edu
//This is the main function, it makes sure the user puts in the right input and then repeated calls before_round, round, and
//after_round until there are no players left in the game
#include "stdafx.h"
#include "rwfuncs.h"
#include "deck.h"
#include <io... | true |
5efa9f9134474a6f961e04b899c1990614d8f84a | C++ | filipedgb/Myriades | /Rectangle.cpp | UTF-8 | 542 | 2.953125 | 3 | [] | no_license | #include "Rectangle.h"
Rectangle::Rectangle(float x1, float y1, float x2, float y2){
this->x1 = x1;
this->x2 = x2;
this->y1 = y1;
this->y2 = y2;
}
void Rectangle::draw(float text_s, float text_l) {
glNormal3d(0,0,1);
glBegin(GL_QUADS);
glTexCoord2d(0,0);
glVertex3d(x1,y1,0);
... | true |
89d799a1995845e28877cc7d0f1507f0fd2cd432 | C++ | ialhashim/extend-mesh | /GraphicsLibrary/Slicer.h | UTF-8 | 934 | 2.546875 | 3 | [] | no_license | #ifndef SLICER_H
#define SLICER_H
#include "Mesh.h"
#include "Plane.h"
#include "HashTable.h"
struct SliceResult
{
StdSet<Face*> cutFaces, removeFaces, keepFaces;
IntSet cutPoints;
IntSet newPoints;
EdgeSet cutEdges;
SliceResult(StdSet<Face*>& faces, IntSet& points, IntSet& new_points,
EdgeS... | true |
fb26b3119f75d1b7dab170b4296cf448051c0f2c | C++ | haspeleo/Algorithms-implementation | /BINPACKING/main.cpp | UTF-8 | 2,712 | 3.375 | 3 | [] | no_license | /*
* http://www2.algorithm.cs.sunysb.edu/mediawiki/index.php/Introduction-TADM2E //wiki for book Skiena
* a better way to do this is to use intefaces
* for diffrenting picking policies
*/
#include <cstdlib>
#include <vector>
#include <iostream>
#include <algorithm>
#include <fstream>
using namespace std;
int pi... | true |
42b97d437d237bf036e3346e5cc79a3fef867dc1 | C++ | JarneBeaufays/2DAE01_Engine_Beaufays_Jarne | /Minigin/SceneObject.h | UTF-8 | 545 | 2.75 | 3 | [] | no_license | #pragma once
namespace dae
{
class SceneObject
{
public:
virtual void Delete() { m_Delete = true; }
virtual void Update() = 0;
virtual void Render() const = 0;
virtual bool GetDelete() const { return m_Delete; }
SceneObject() = default;
virtual ~SceneObject() = default;
SceneObject(const SceneObject&... | true |
3f0f3f811e90822720902c34c8784370fafc49a6 | C++ | RDLLab/tapir | /src/solver/changes/HistoryCorrector.hpp | UTF-8 | 2,663 | 3.015625 | 3 | [] | no_license | /** @file HistoryCorrector.hpp
*
* Defines an abstract base class for correcting history sequences.
*/
#ifndef SOLVER_HISTORYCORRECTOR_HPP_
#define SOLVER_HISTORYCORRECTOR_HPP_
#include <unordered_set>
#include "global.hpp"
#include "solver/Solver.hpp"
namespace solver {
class HistorySequence;
class Model;
/** ... | true |
dabec0a713362e9a58a78177516abc3f59972b9a | C++ | petrkamnev/cf-tasks | /Фокус со стаканчиками/source.cpp | UTF-8 | 3,930 | 3 | 3 | [] | no_license | #define _CRT_DISABLE_PERFCRIT_LOCKS
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <random>
#include <ctime>
using namespace std;
int INF = 1e9;
struct Node {
int y, val, size, num;
Node *left, *right;
Node(int x, int t) {
num = t;
val = x;
y ... | true |
c8ed1b01051ca077e25b9b92800d52229323104e | C++ | ThomasDetemmerman/gevorderde-algoritmen | /2019-2020/12.2 - labo Suffixtabellen/LGP.h | UTF-8 | 2,737 | 2.78125 | 3 | [] | no_license | //
// Created by Thomas on 03/12/2019.
//
#ifndef A___LABO_SUFFIXTABELLEN_LGP_H
#define A___LABO_SUFFIXTABELLEN_LGP_H
#include <vector>
#include <string>
#include "saisclass.h"
using std::vector;
using std::string;
using std::ostream;
class LGP:public vector<int> {
public:
LGP(SAIS suffixArray, string data);
... | true |
f9cb59bcbf5d4e6302863cc9c3ac4644b08caf0a | C++ | zshwuhan/graphchi_mf_topn_index | /rtree.hpp | UTF-8 | 5,511 | 2.9375 | 3 | [] | no_license | #ifndef __RTREE_H
#define __RTREE_H
#include <algorithm>
#include <cmath>
#include <vector>
using std::vector;
bool sort_items_rtree(std::pair<double, unsigned int> a, std::pair<double, unsigned int> b) {
return a.first > b.second;
}
class RTreeNode {
public:
RTreeNode() {
}
~RTreeNode() {
}
public:
vect... | true |
af144cdf886abdff2bec1ce9cc8dab1d6fcec7d1 | C++ | ukibs/GameEngine | /GameEngine/GameEngine/ActionManager.h | UTF-8 | 671 | 2.703125 | 3 | [] | no_license | #pragma once
#include <vector>
#include <string>
#include <stdio.h>
#include <iostream>
#include <stdarg.h>
#include "Singleton.h"
#include "Action.h"
using namespace std;
class ActionManager : public Singleton<ActionManager>
{
private:
vector <Action> actions;
public:
ActionManager();
~ActionManager();
void add... | true |
064e824ebec0f224713efb4f9f010ab01e394ae9 | C++ | Legendaries/Cpp | /Assignment3/Assignment3/Converter.cpp | UTF-8 | 206 | 3.125 | 3 | [] | no_license | #include "Converter.h"
double inToFt(double in) {
return in / 12;
}
double ftToIn(double ft) {
return ft * 12;
}
double fahrenheitToCelcius(double fahrenheit) {
return (fahrenheit - 32)*(5.0 / 9.0);
} | true |
da2eade9942412963b7c65bf8f2ba656e510466c | C++ | iridium-browser/iridium-browser | /buildtools/third_party/libc++/trunk/test/std/strings/string.view/string.view.template/contains.char.pass.cpp | UTF-8 | 996 | 2.546875 | 3 | [
"BSD-3-Clause",
"NCSA",
"MIT",
"LLVM-exception",
"Apache-2.0"
] | permissive | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | true |
00cfb331e5bdbd78b947444dd212974d785de176 | C++ | Astarx1/plt | /src/state/Mobile.cpp | UTF-8 | 748 | 2.6875 | 3 | [] | no_license | #include "Mobile.h"
using namespace state;
Mobile::Mobile () {
}
bool const Mobile::isStatic () {
return true;
}
Direction Mobile::getDirection () {
return this->direction;
}
void Mobile::setDirection (Direction d) {
this->direction = d;
}
bool Mobile::getEnDeplacement () {
return en... | true |
2e0991744f946de96eeb87860a0b1d9a37641f1f | C++ | LawrenceScroggs/CS161 | /wk4_buggy_lscroggs.cpp | UTF-8 | 1,386 | 3.859375 | 4 | [] | no_license | /**************************************************
* File: wk4_buggy_lscroggs.cpp
* Description: Displays the number of positive integers
* and the number of negative integers entered by the user
*
* Lawrence Scroggs
* 1/30/18
*
* Modifications: Included namespace std; line 20
* cin >> variable was no... | true |
40057277595c613918c665274f1ca6577d77b25b | C++ | lokvamsi/Candidate_Elim | /candel.cpp | UTF-8 | 11,816 | 3.265625 | 3 | [] | no_license | /*
* candel.cpp
*
* Created on: Oct 1, 2017
* Author: Binki
*/
#include <iostream>
#include<list>
#include<fstream>
#include<string>
#include "DataUtil.h"
struct feature;
using namespace std;
/**
* Function to print a list of datapoints/hypotheses
* @param ls list containing the data... | true |
766a73d77b6f8d05ba7c9f0a4ac2a30a55a28ddd | C++ | plumer/hcm | /math/geometry_compact.hpp | UTF-8 | 6,852 | 3.15625 | 3 | [] | no_license | #pragma once
#include "config.hpp"
#include <cassert>
#include <cmath>
namespace hcm {
class cpt3;
class cnormal3;
class cvec3 {
public:
float x, y, z;
// Constructors
cvec3() : x{ 0.0f }, y{ 0.0f }, z{ 0.0f } {}
cvec3(float _x, float _y, float _z) : x{ _x }, y{ _y }, z{ _z } {}
explicit cvec3... | true |
2b1594b24163ae8d93881069f74e7ab7975941c5 | C++ | swy20190/Leetcode-Cracker | /1423/P1423/P1423/main.cpp | UTF-8 | 637 | 3.0625 | 3 | [
"MIT"
] | permissive | #include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int maxScore(vector<int>& cardPoints, int k) {
int sum = 0;
int len = cardPoints.size();
for (auto p : cardPoints) {
sum += p;
}
if (len == k) {
return sum;
}
int window_size = len - k;
int left = 0;
int righ... | true |
37cb092b963c5da8f7b4d2806596d8f73d3aee5f | C++ | samopal-pro/SoilMoistureController | /Gateway_esp8266/WC_Decoder.cpp | UTF-8 | 2,881 | 2.84375 | 3 | [] | no_license | /**
* Контроллер умного дома. Версия 2.0 ESP8266
* Copyright (C) 2016 Алексей Шихарбеев
* http://samopal.pro
*/
#include "WC_Decoder.h"
WC_Data RC_Data[MAX_SENSORS];
int RC_DataCount = 0;
/**
* Проверка контрольной суммы пакета
*/
bool RC_CheckSRC( uint32_t data ){
// Считаем контрольную сумму полубайтами
uint... | true |
14e298fe1ee063940d511aab4ea4415a779607c5 | C++ | dmishin/dmishin-pyscript | /cpp/alife2/src/world.hpp | UTF-8 | 1,283 | 2.625 | 3 | [] | no_license | #pragma once
#ifndef _WORLD_H_
#define _WORLD_H_
//#include "grid.hpp"
#include "grid.hpp"
#include "simulated.hpp"
#include "point.hpp"
#include "ticker.hpp"
namespace alife2{
class Mobile;
class Food;
class World: public Simulated{
float timeStep; //simulation step
float friction; //movement friction... | true |
228ec489a17d9dfbe296e8f1877eed1d58f9db0d | C++ | duckdog/Signal | /Signal/Classes/AnchorPoint.hpp | UTF-8 | 1,391 | 2.765625 | 3 | [
"MIT"
] | permissive | //
// AnchorPoint.hpp
// CocosTemplate
//
// Created by 佐藤 匠 on 2016/03/05.
//
//
#pragma once
#include <map>
//アンカーポイントを定義
namespace AncPoint {
enum Key
{
LeftTop = 0,
RightTop = 1,
LeftBottom = 2,
RightBottom = 3,
Left,
Right,
Top,
... | true |
f745574c29a817f0539424fe38c58a4c14ba11d5 | C++ | mldbai/mldb | /utils/progress.cc | UTF-8 | 2,570 | 2.796875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* progress.cc
* Guy Dumais, 2016-04-28
* Mich, 2016-05-24
* This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved.
**/
#include "progress.h"
#include "mldb/types/basic_value_descriptions.h"
#include "mldb/types/optional_description.h"
namespace MLDB {
using namespace std;
shared_ptr<S... | true |
8a01642c7f02703cc2e8ffce981d505942aa6e02 | C++ | bsy6766/VoxelEngine | /VoxelEngine/Classes/TerrainType.h | UTF-8 | 512 | 2.890625 | 3 | [] | no_license | #ifndef TERRAIN_TYPE_H
#define TERRAIN_TYPE_H
namespace Voxel
{
// Default terrains.
enum class TerrainType
{
NONE = 0,
PLAIN, // Flat terrain. No hills and mountains
HILLS, // Few hills in flat terrain
MOUNTAINS, // Few mountinas
PLATEAU,
};
// Modifiers gives changes on world generation, give... | true |
a0a860d0aca12919d5e9839d4fdf336d8329f32e | C++ | skilling0722/Project-VLC_arduino | /Stored_info.ino | UTF-8 | 3,496 | 2.890625 | 3 | [] | no_license | #include <EEPROM.h>
//160 까지 기기정보 16칸
//161~168 비밀번호 8킨
//300 기기개수 1칸
//char **Stored_device_info;
//char *Stored_pwd;
const int Stored_device_number = 10;
const int Stored_deviceinfo_length = 16;
const int Stored_pwd_number = 1;
const int Stored_pwd_length = 8;
int device_count = 0;
char pwd_temp[8];
char dev... | true |
4bda5f982d445bd59f170a265c878d17b6a1e333 | C++ | errorcodexero/fiddle | /luke/CSV_manipulation.cpp | UTF-8 | 1,072 | 3 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<stdlib.h>
#include<string>
#include<vector>
using namespace std;
ostream& operator<<(ostream& o, vector<string> v){
for(unsigned i = 0; i < v.size(); i++){
o<<v[i]<<"\n";
}
return o;
}
int main(){
fstream f("a.csv");
if(f.good() == false){
cout<<... | true |
8bfea874ac465e34ad41fa6ff31b90e4b2ccb56d | C++ | ianmetcalf/iot-workshop | /examples/ReadBMP280/ReadBMP280.ino | UTF-8 | 629 | 2.90625 | 3 | [
"MIT"
] | permissive | /*********************************************************************
Example: Read from a BMP280 Sensor
*********************************************************************/
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp;
void setup() {
Serial.begin(57600);
while (!Serial) {
delay(1);
}
if (!b... | true |
53c7a281ccd1ae34a418839b3a0743af6f98311b | C++ | Nurl4n/Fundamental-Structures-of-Computer-Science-II | /Project 1/src/main.cpp | UTF-8 | 980 | 3.140625 | 3 | [
"MIT"
] | permissive | /* * Title : Algorithm Efficiency and Sorting
* Author : Nurlan Farzaliyev
* ID : 21503756
* Section : 1
* Assignment : 1
* Description : Main class to test some of the sorting algorithms.
*/
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include "sorting.h"
using namespace s... | true |
7dbecdc0223b0cba6885d645980777502c079ee1 | C++ | TheNsBhasin/CodeChef | /TABGAME/main.cpp | UTF-8 | 1,734 | 2.78125 | 3 | [] | no_license | /*input
2
101
01
6
1 1
1 2
1 3
2 1
2 2
2 3
1011001
0101111
6
5 5
3 4
2 6
3 7
7 7
6 5
*/
//
// main.cpp
// TABGAME
//
// Created by Nirmaljot Singh Bhasin on 13/09/18.
// Copyright © 2018 Nirmaljot Singh Bhasin. All rights reserved.
//
#include <iostream>
#include <memory.h>
using namespace std;
typedef long long... | true |