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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
103adaf51c271c083a65e6aa7daed4ddada6f872 | C++ | keshav1999/c_plus_plus_Programming | /day9/bubblesortrecursion.cc | UTF-8 | 557 | 3.265625 | 3 | [] | no_license | #include<iostream>
using namespace std;
void input( int arr[], int n)
{
for (int i = 0; i < n; ++i)
{
cin >> arr[i];
}
}
void output( int arr[], int n)
{
for (int i = 0; i < n; ++i)
{
cout << arr[i] << " ";
}
}
void bubblesort(int arr[],int n)
{
if(n<=0)
{
return;
} ... | true |
4a78527a45fb63b29f291e3575ddc4fd9ed64b9d | C++ | chrisdenado/suanfa-jichu | /chap3-iteration/c3-smallgame.cpp | UTF-8 | 2,232 | 3.109375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int To[4][2] = {{0,1},{1,0},{0,-1},{-1,0}};
bool isIn(int x, int y, int w, int h)
{
return ( x>-1 && x<h+2 && y>-1 && y<w+2 );
}
void search(const vector<vector<int>> &card, vector<vector<int>> &mark, int &min_step, int step, int forwar... | true |
6b90cc440b601d2d453a0fa58e8fdc00e0ea92de | C++ | benpauldev/OSU-CS165 | /Assignment 4/Project 4.c/Project 4.c/Student.cpp | UTF-8 | 414 | 2.78125 | 3 | [] | no_license |
/*
Author: Benjamin Fondell
Date: 1/31/2017
Description: Project 4.c Student.cpp
*/
#include "Student.hpp"
#include <string>
using namespace std;
Student::Student(string studentName, double studentScore)
{
name = studentName;
score = studentScore;
}
string Student :: getName()
{
return ... | true |
6b09df0d2e4da1b0d671466d4cf20620103887f3 | C++ | LegatAbyssWalker/OpenGL-Tests | /OpenGL First Test/World.cpp | UTF-8 | 1,138 | 2.8125 | 3 | [
"MIT"
] | permissive | #include "World.h"
World::World(GLWindow& glWindow) : glWindow(glWindow) {
// Chunk generation
GLsizei TOTAL_CHUNK_AMOUNT = 2; // MULTIPLE OF 2
GLsizei TOTAL_TREE_AMOUNT_PER_CHUNK = 5;
for (GLsizei x = 0; x < TOTAL_CHUNK_AMOUNT / 2; x++) {
for (GLsizei z = 0; z < TOTAL_CHUNK_AMOUNT / 2; z++) {
chunk... | true |
382e8b4ec909a3ce44d8f33aa6ba7aa944f0227d | C++ | cynthia-1999/crypto-accumulators | /lib/utils/ThreadPool.cpp | UTF-8 | 938 | 3.265625 | 3 | [
"MIT"
] | permissive |
#include <utils/ThreadPool.hpp>
void Worker::operator()()
{
while(true)
{
std::unique_lock<std::mutex> lock(pool.queue_mutex);
while(!pool.stop && pool.tasks.empty())
pool.condition.wait(lock);
if(pool.stop && pool.tasks.empty())
return;
std::function<vo... | true |
8faa520480df581f66fb281402bfe7cb2c490e15 | C++ | Mourx/RTS | /RTS/RTS/Node.h | UTF-8 | 212 | 2.78125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <vector>
class Node {
public:
Node();
Node* Adjacent[4]; // Up, Right, Down, Left
int travelCost;
int totalTravelCost;
float x, y;
Node* nextNode;
};
| true |
b0a342bc648834123a6ef32d74dd9feaf3810f2c | C++ | andy-yang-1/BookStore | /src/unrolled_linked_list.cpp | UTF-8 | 6,347 | 3.046875 | 3 | [] | no_license | #include "unrolled_linked_list.h"
List::List() {}
List::List(const char *file_name)
{
strcpy( filename , file_name ) ;
}
void List::add_key(element &add_element, pair<bool, pair<int, int>> search_pos)
{
block temp_block ;
temp_block.get_block( getKeyType(filename) , search_pos.second.first ... | true |
855718f98aff81130826372f623e57dd0c98a417 | C++ | thetruegamer/zork_game | /zork/Creature.cpp | UTF-8 | 2,462 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include "Creature.h"
#include "../rapidxml/rapidxml.hpp"
#include "../rapidxml/rapidxml_utils.hpp"
#include "../rapidxml/rapidxml_print.hpp"
using namespace std;
using namespace rapidxml;
Creature::Creature(xml_node<> * creatureTag){
xml_no... | true |
c7694360603f941acbcaf98a83345b73d301fb73 | C++ | pamtabak/DistributedSystems | /IPC/Sockets/Producer/main.cpp | UTF-8 | 3,089 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <sys/socket.h>
#include <netinet/in.h>
#define RAND(min, max) rand() % (max - min + 1) + min
#define BUFFER_SIZE 256
#define PORT_NO 666
#define MAX_CONNECTIONS 5
/**
* Returns a random number larger than the last ont generated and between the min/max value
* @param[in] lastRandomNumbe... | true |
40ce8a7dbe0f948b44156b34abf6a9326cd64d28 | C++ | Tanmoytkd/programming-projects | /Contest Participations/Mara 5/mnew.cpp | UTF-8 | 1,634 | 2.671875 | 3 | [] | no_license | using namespace std;
#include <bits/stdc++.h>
bool valid(vector<vector<string> > &c, const string &w) {
for (int i = 0; i < c.size(); ++i) {
int bad = true;
for (int j = 0; j < 3; ++j)
if (c[i][j].find(w[j]) == string::npos)
bad = false;
if (bad)
return false;
}
return true;
}
ch... | true |
918ea9837e22a30d41da6428fa894dddedcad69e | C++ | Dukeboys/open-dis | /old/tags/2.1/cpp/DIS/Marking.cpp | UTF-8 | 1,419 | 3.046875 | 3 | [
"BSD-3-Clause"
] | permissive | #include <DIS/Marking.h>
using namespace DIS;
Marking::Marking():
_characterSet(0)
{
}
Marking::~Marking()
{
}
unsigned char Marking::getCharacterSet() const
{
return _characterSet;
}
void Marking::setCharacterSet(unsigned char pX)
{
_characterSet = pX;
}
char* Marking::getCharacters()
{
return ... | true |
81b18b440eda81d8a98c530d171b6a5a5623ea7e | C++ | chrispiech/cs106b-fall-2016-website | /lectures/6-Sets_Maps/code/anagrams/src/anagrams.cpp | UTF-8 | 1,560 | 3.546875 | 4 | [
"MIT"
] | permissive | /*
* CS 106B, Chris Piech
* This program demonstrates the use of the Stanford C++ Set class.
* A set is a collection without duplicates that efficiently supports
* the core operations of adding, removing, and searching for elements.
*/
#include <fstream>
#include <iostream>
#include <iomanip>
#include "console.h"... | true |
ab28cf37b4d2d761fdb5220e09ef754f5b5510ee | C++ | carloscarretero/Minotauro | /Algoritmo.ino | UTF-8 | 7,210 | 2.765625 | 3 | [] | no_license | /*
* -------------------------------------------------------------------------
* | Maze solving robot algorithm |
* | Authors: Carlos Carretero Aguilar, Rafael Moreno Anarte |
* | Date: 11 - 16 - 2015 |
* | Version... | true |
ecf4603bcb8fd9ac2da84b8296669cd74d9e2cf2 | C++ | TrueFinch/Figures-intersections | /tests.cpp | UTF-8 | 12,442 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "catch.hpp"
#include "figures.h"
using namespace std;
using namespace figures;
TEST_CASE("Point's tests", "[]") {
SECTION("Operator <") {
Point p1 = {1.0, 1.0}, p2 = {42.0, 42.0}, p3 = {23.08, 1999.0};
REQUIRE(p1 < p2);
REQUIRE(p1 < p3);
REQUIRE(!(p2 < p... | true |
4a4be5e216396ff6aac1f5fc8f76a7201ccae14e | C++ | jdibling/euler_cpp | /euler-3.0.cpp | UTF-8 | 531 | 3.265625 | 3 | [] | no_license | /*
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
*/
#include "euler.h"
void Euler_3_0()
{
//int N = 13195;
int64_t N = 600851475143;
int64_t Na = static_cast<int>(ceil(sqrt(static_cast<float>(N))));
vector<int64_t> factors;
for( int i = 2; i < ... | true |
40bcbe61edc3a34ebdbedf25bb63f05b2317bc37 | C++ | padjal/computerSystemsArchitecture | /Homework/hw1-Animals/beast.cpp | UTF-8 | 1,335 | 3.546875 | 4 | [
"MIT"
] | permissive | /**
* beast.cpp - contains functions for working with beast
*/
#include <cstring>
#include "beast.h"
#include "rnd.h"
// Enter beast parameters form file
void in(beast &be, FILE *file){
int type;
fscanf(file,"%s", be.name);
fscanf(file,"%i", &be.weight);
fscanf(file,"%i", &type);
if(type == 0){... | true |
cb055769902dbefc52877dff0156dc73760f07a5 | C++ | seth1002/antivirus-1 | /CommonFiles/Licensing2/src/Verdict.h | UTF-8 | 1,225 | 3.03125 | 3 | [] | no_license | /**
* @file
* @brief Implementaion of IVerdict interface.
* @author Andrey Guzhov
* @date 12.07.2005
* @version 1.0
*/
#ifndef VERDICT_H
#define VERDICT_H
#include <vector>
namespace KasperskyLicensing {
namespace Implementation {
/**
* Implements IVerdict interface.
*/
class Verdict : p... | true |
2028a12f5bfb8300dc776cbb59faa343c0332d9a | C++ | WarcramSpartanix/GD-ENG-MO | /DirectXGame/CameraManager.cpp | UTF-8 | 4,445 | 2.859375 | 3 | [] | no_license | #include "CameraManager.h"
#include "EngineTime.h"
#include "InputSystem.h"
CameraManager* CameraManager::sharedInstance = nullptr;
CameraManager* CameraManager::getInstance()
{
if (sharedInstance == nullptr)
initialize();
return sharedInstance;
}
void CameraManager::initialize()
{
sharedInstance = new C... | true |
e6cd9cf578c46815d9dd0da265aa4bdea55f667f | C++ | Elojah/Meuh2.0 | /util/Rool/src/MemberTemplate.cpp | UTF-8 | 969 | 2.625 | 3 | [] | no_license | #include "MemberTemplate.hpp"
#include "ReplaceClassName.hpp"
#include <fstream>
#include <string.h>
MemberTemplate::MemberTemplate(void) {
}
MemberTemplate::MemberTemplate(std::string const &path) : _path(path) {
}
MemberTemplate::~MemberTemplate(void) {
for (tBehaviors::const_iterator it = _behav.begin(); it != _... | true |
180433ad8495392d0d9686a8e9959ebd7ceb4716 | C++ | conquerheaven/EnergyMonitor | /code/cal.cpp | UTF-8 | 1,321 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <vector>
using namespace std;
struct point{
double x , y;
point(double x , double y):x(x),y(y){}
};
vector<point> pv , allp;
vector<point> result;
double L(double x){
double sum = 0;
for(int i = 0; i < pv.size(); i++){
... | true |
7a179f3d7d4fadbe73df6947d5f78c436bfe0bf0 | C++ | blackHatMonkey/maze_runner | /disjointset_test.cpp | UTF-8 | 14,759 | 3.03125 | 3 | [] | no_license | /*
* To compile: g++ disjointset.cpp disjointset_test.cpp timer.cpp -std=c++0x
*/
#include <cstdlib>
#include <iostream>
#include <string>
#include "disjointset.hpp"
#include "timer.hpp"
bool test1(std::string &error);
bool test2(std::string &error);
bool test3(std::string &error);
bool test4(std::string &error);
... | true |
00ab7b3b5126fdf273e2773422a93c48ff36af1c | C++ | chenyangfan13/LearnRoboticsCpp | /include/path_planning/rrtbase.hpp | UTF-8 | 1,358 | 2.609375 | 3 | [] | no_license | #pragma once
struct Node {
float x;
float y;
std::vector<float> path_x;
std::vector<float> path_y;
int parent = -1;
int idx = -1; // position in nodes_list_
float cost = 0.0f;
Node (float _x, float _y) : x(_x), y (_y) {}
Node () {}
};
using CircleObstacle = std::tuple<float, f... | true |
9bb290ce6c1f44196c6569acc92d1e4034863b4b | C++ | jonathanpoelen/falcon | /falcon/functional/invoke_partial_recursive_param_loop.hpp | UTF-8 | 2,455 | 2.828125 | 3 | [
"MIT"
] | permissive | #ifndef FALCON_FUNCTIONAL_INVOKE_PARTIAL_RECURSIVE_PARAM_HPP
#define FALCON_FUNCTIONAL_INVOKE_PARTIAL_RECURSIVE_PARAM_HPP
#include <falcon/math/min.hpp>
#include <falcon/c++1x/syntax.hpp>
#include <falcon/functional/invoke.hpp>
#include <falcon/parameter/manip.hpp>
#include <falcon/preprocessor/not_ide_parser.hpp>
#i... | true |
c5aa05bca1514b5510b7395a9a3d0e1e70725bbe | C++ | telwell/nand2tetris | /06/assembler/Parser.hpp | UTF-8 | 681 | 2.671875 | 3 | [] | no_license | #include <string>
#include <fstream>
class Parser
{
public:
Parser(std::string file);
void incLineNum();
// File methods
void openFile();
void closeFile();
void next();
// Getters
int getLineNum();
std::string getFileName();
// Command
std::string getCurrentCommand();
void oCurrentCommand();... | true |
1769c50c98dfad7f71a61c41a9c8cc3103531660 | C++ | khalilovske/IT-STEP | /Class works/9.4.2019 Files,Tasks/9.4.2019 Files,Tasks/Fill.cpp | UTF-8 | 191 | 2.59375 | 3 | [] | no_license | #include"Arrays.h"
#include<ctime>
#include<iostream>
using namespace std;
void Fill(int *const arr, int const size) {
for (int i = 0; i < size; i++) {
arr[i] = rand() % 10;
}
} | true |
c142b4de9a2feddb7bd4f8fe79186e31c7f524ed | C++ | burakkose/HackerRank | /Challenges/Code Golf/Sudoku/sudoku_solver.cpp | UTF-8 | 1,552 | 3.140625 | 3 | [
"Unlicense"
] | permissive | #include <iostream>
#include <list>
#define N 9
using namespace std;
list<int> zeroPos;
bool isSafe(int grid[N][N],int mrow,int mcol,int num){
for(int i = 0 ; i < 9 ; i++)
if(grid[mrow][i] == num || grid[i][mcol] == num )
return false;
mrow -= (mrow%3);
mcol -= (mcol%3);
for(int ... | true |
7d01a53231e2dd5116846b1f5c694ecdf3b637d6 | C++ | hryuh1121/Team16 | /Project1/Model.cpp | SHIFT_JIS | 38,168 | 2.6875 | 3 | [] | no_license | #include "Model.h"
#include "DirectXTex.h"
#include<d3dx12.h>
#include "Camera.h"
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#pragma warning(disable : 4996)
using namespace DirectX;
using namespace Microsoft::WRL;
using namespace std;
//ÓIoϐ̎
ID3D12Device* Model::device = nullptr;
UINT... | true |
7c9717a5ef4d85109816b369938babe1da1579dd | C++ | ahmostthere/LittleLeaf | /test/blendModeTests.hpp | UTF-8 | 6,179 | 2.59375 | 3 | [] | no_license | // #include "SomeTest.hpp"
// #include "Test2.hpp"
// void start()
// {
// Testing::load();
// while(!Testing::quitting())
// {
// Testing::resetTimer();
// Testing::handleInput();
// Testing::update();
// Testing::render();
// }
// Testing::quit();
// }
// int m... | true |
26c499276b502a64af594887e93260383f0462eb | C++ | ajaykarthik/unixv6 | /unixv6.cc | UTF-8 | 26,592 | 2.8125 | 3 | [] | no_license | /*****************************************************************************************************************
Operating Systems project 2
Ajay Karthik Ganesan and Ashwin Rameshkumar
This program, when run creates a virtual unix file system, which removes the V-6 file system size limit of 16MB
Compiled and run on c... | true |
a0d21f556657b1e80f7f193aeecb7a1fc88b4032 | C++ | luoxz-ai/codegoogle.gbmath | /normal2.cpp | UTF-8 | 1,292 | 3.015625 | 3 | [
"MIT"
] | permissive |
#include "_gbmath.h"
namespace gbmath
{
normal2& normal2::rotate (const mat22& m)
{
vec2 tmp(_x,_y);
tmp = m * tmp;
_x=tmp.x;
_y=tmp.y;
return *this;
}
float normal2::angle( const normal2& n ) const
{
float fdot = vec2(_x,_y).dot( vec2(n._x , n._y) );
float res = acos(fdot);
retu... | true |
3c857b6218d3d5269bb1c2d4af017d7ed11eaff1 | C++ | at97/HomeHerb | /GSMModuleMoistureSensor/GSMModuleMoistureSensor.ino | UTF-8 | 2,968 | 2.84375 | 3 | [] | no_license | //If sms send = TEST then you get a SMS reply to your own phone
#include <SoftwareSerial.h>
// Green wire
int rxPin = 53;
//Blue wire
int txPin = 51;
SoftwareSerial MySerial(rxPin,txPin);
char incomingbyte[150]; // array to compare incoming SMS
int index=0; // array to compare incoming SMS - index
int c... | true |
c5f659b34f28a7bc819d739efc1902e404ebf4f9 | C++ | kondratyev-nv/training | /cpp/src/maximize_loot.cpp | UTF-8 | 1,040 | 3.515625 | 4 | [
"Unlicense"
] | permissive | /**
* A thief finds much more loot than his bag can fit. Help him to find the most
* valuable combination of items assuming that any fraction of a loot item can
* be put into his bag. The goal of this code problem is to implement an
* algorithm for the fractional knapsack problem.
*/
#include "maximize_loot.hpp"
... | true |
57643069ee965d4a228f7b326a75bf61d8871f35 | C++ | vergilium/itstep | /ITStepWorks/DesignPatterns/Adapter/ChemicalElementsInformation.cpp | UTF-8 | 798 | 2.890625 | 3 | [] | no_license | #include "ChemicalElementsInformation.h"
#include <algorithm>
ChemicalElementsInformation::ChemicalElementsInformation()
{
}
ChemicalElementsInformation::~ChemicalElementsInformation()
{
}
double ChemicalElementsInformation::GetDensity(string pName) const
{
transform(pName.begin(), pName.end(), pName.begin(), ::t... | true |
e76d3a9fb1b457a1de8d91ae84553953fbecb47d | C++ | tmgarcia/CPPGameEngine | /GameSkeleton/Engine/AStarData/Nodes/Node.h | UTF-8 | 244 | 2.59375 | 3 | [] | no_license | #pragma once
#include <glm\glm.hpp>
using glm::vec3;
class __declspec(dllexport) Node
{
public:
vec3 position;
int numConnections;
Node(vec3 location)
{
position = location;
numConnections = 0;
}
~Node(){}
};
| true |
7826b3e63575b155004971f66fbba00a4315c16a | C++ | nmtrmail/backstroke | /src/rtss/backstroke/rtss-macros.h | UTF-8 | 1,279 | 2.828125 | 3 | [] | no_license | // headers
#define AVPUSH_RESTORE_DISPOSE_HEADER(type,typename) \
private:\
std::deque<std::pair<type*, type> > data_container_##typename; \
inline void restore_##typename();\
inline void dispose_##typename();\
public:\
inline type* avpush(type* address); \
// implementations
#define AVPUSH_RESTORE_DISPOSE_... | true |
62ff1756d6fe4ccf52c4f61a4fcf998a719f8c9d | C++ | KevinACoder/collection | /exception.cpp | UTF-8 | 1,598 | 3.28125 | 3 | [] | no_license | //
// exception.cpp
// boost_t
//
// Created by KevinLiu on 2018/11/17.
// Copyright © 2018 KevinLiu. All rights reserved.
//
#include <stdio.h>
#include "stddefine.h"
#include <boost/exception/all.hpp>
#include <exception>
/*class cexception1 : public std::exception
{
public:
cexception1(const char *msg, int... | true |
a2099aa174b0f1f3e3dd12c4bee2f947d71873f4 | C++ | dongeronimo/exdental | /teste_algoritmos/RgbToGrayscale/rgbToGrayscale.cpp | UTF-8 | 1,899 | 2.71875 | 3 | [] | no_license | #include <string>
#include <itkImageFileWriter.h>
#include <itkImageFileReader.h>
#include <itkImage.h>
#include <vtkSmartPointer.h>
#include <vtkImageData.h>
#include <vtkPNGReader.h>
using namespace std;
vtkSmartPointer<vtkImageData> LoadImagemOriginal(string filepath);
int main(int argc, char* argv[])
{
string in... | true |
cd13ea5d29331bd92486b6ce963b2d024ad05711 | C++ | RIckyBan/competitive-programming | /AtCoder/PetrozavodskContest/001/C.cpp | UTF-8 | 879 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
#define INF 1e9
#define MAXN 100005
#define MAXM 100005
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pii pa... | true |
34349f0d6dbd2a16c1b65a49ba4e9a42af07e8e5 | C++ | IssaMDOunejjaR/Cpp_Modules | /Module 04/ex00/Victim.cpp | UTF-8 | 1,801 | 3.03125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Victim.cpp :+: :+: :+: ... | true |
892c2b8c0ee0f9a65a9975418bd84475e75d9523 | C++ | schollz/CISC220-Final-Project | /ChordGraph.cpp | UTF-8 | 2,920 | 3.328125 | 3 | [] | no_license | #include "ChordGraph.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include <algorithm>
#include <vector>
#include <limits>
#include <string>
#include <sstream>
using namespace std;
// Code that creates a vector of strings using delimiters. Each index of the vector will contain a chor... | true |
748000fe2edcc19b587883e21b1af9ee4c01ced7 | C++ | NH333/novel | /caq/cppPrimer/ch12/12_23.cpp | UTF-8 | 619 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <string>
int main() {
char* p1 = new char[10]{"anqi"};
char* p2 = new char[10]{"chen"};
int len = strlen(p1) + strlen(p2) + 1;
char* result = new char[len](); //注意初始化,没有初始化为空,后面的strcat就无法进行拼接
char* result2 = new char[len]();
strcat_s(result, len, p1);
strcat_s(re... | true |
fca41a9dcf2ae0b8d5991f00a154354c40998b9b | C++ | Meegan1/N-Queen-Parallel | /main.cpp | UTF-8 | 8,384 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <queue>
#include <future>
typedef int chessboard;
template <typename T>
class ThreadSafeQueue {
public:
explicit ThreadSafeQueue() = default;
void push(T &&new_value) {
std::lock_guard<std::mutex> lock(gate);
queue.push(std::move(new_value));
}
bool try_... | true |
727231cc5141e059a2164eee90846ca65b684b0b | C++ | Na5morK/MInDiff | /MInimal difference(минимальная разность).cpp | UTF-8 | 713 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <complex>
//поиск минимальной разности
int main()
{
using namespace std;
//cout<<"инициализация...\n";
int const SIZE=4;
int a[SIZE],min=2147483647;
//cout<<"успешно.\n";
//cout<<"ввод...\n";
cout<<"Enter array\n";
for (int i=0;i<SIZE;i++)
cin>>a[i];
//cout<<"у... | true |
825cecf26068518784a8e061f506c6215bfa1964 | C++ | gitcseme/solved-problems-catagorized | /Math/uva 1636 Headshot.cpp | UTF-8 | 667 | 2.8125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
char ch[105];
int len, a, b, c, d;
void r() {
int cnt = 0;
for (int i = 0; i < len; ++i)
if (ch[i] == '0') ++cnt;
a = cnt;
b = len;
}
void s() {
int cnt = 0;
for (int i = 1; i < len; ++i)
if (ch[i] == '0' && ch[i-1] == '0') ++cnt;... | true |
a758ed32fd13e0da06bf02ea2726fa697e36449f | C++ | linmx0130/OJCode | /POJ/P2245/main.cpp | UTF-8 | 538 | 2.546875 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define MAXN 15
int S[MAXN];
int N;
int PQ[MAXN];
void Search(int now,int last)
{
if (now==7)
{
for (int i=1;i<6;++i)
{
printf("%d ",S[PQ[i]]);
}
printf("%d\n",S[PQ[6]]);
}
for (int i=last+1;i<=N;++i)
{
PQ[now]=i;
Search(... | true |
2828bde89da1eb2b473c60a14b4aa7db8911f833 | C++ | jeffsetter/coreir | /src/lib/passes/inline.cpp | UTF-8 | 7,282 | 2.90625 | 3 | [] | no_license | #include "coreir-pass/passes.h"
namespace CoreIR {
// This helper will connact everything from wa to wb with a spDelta.
// spDelta is the SelectPath delta to get from wa to wb
void connectOffsetLevel(ModuleDef* def, Wireable* wa, SelectPath spDelta, Wireable* wb) {
//cout << "w:" << w->toString() << endl;
//cou... | true |
015375e0c73bafe2d391714c0869d680bc5e1413 | C++ | ashishugi/MYCODES | /strings/naivematch.cpp | UTF-8 | 483 | 2.8125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
bool ismatch(string s,string p){
bool check = true;
for(int i=0;i<(s.length() - p.length());i++){
check = true;
for(int j=0;j<(p.length());j++){
if(s[i+j]!=p[j]){
check= false;
break;
}
}... | true |
034ddcec52d3055c84278e9dfd4043260d2b4c63 | C++ | LeonAbelmann/MagOD | /Testfunctions/MagOD2/TestLED/TestLED.ino | UTF-8 | 1,450 | 3.34375 | 3 | [
"MIT"
] | permissive | //Pins for the RGB LED.
#define LED_red 2 //RED LED
#define LED_green 32 //Green LED
#define LED_blue 4 //BLUE LED
/* Coil variables (to switch them off) */
uint8_t Coil_x = 33; // output of the coils in the x direction
uint8_t Coil_y = 26; // output of the coils in the y direction
uint8_t Coil_z = 14; // output of th... | true |
7da438fd68bffedc866f116c26c98fc3b678d474 | C++ | ksercs/algo_school_base | /base/Работа с файлами. Ввод-вывод/Задача 2/Task 2.cpp | MacCyrillic | 448 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include <fstream>
using namespace std;
int ans,num;
int main()
{
ifstream cin("Task 2.in");
ofstream cout ("Task 2.out");
//cout <<"\n ";
cin >>num;
ans=(num%1000)/100;
cout /*<<"\n "*/ <<ans;
getch ();
return 0;
}
| true |
7ded95f2383005a02809be9ec0a9e36a36466214 | C++ | nikhil-seth/LeetCode | /876. Middle of the Linked List.cpp | UTF-8 | 511 | 3.4375 | 3 | [] | no_license | //876. Middle of the Linked List
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* middleNode(ListNode* head) {
if(!head)
return head;
ListNode ... | true |
9954dad66689a2faa45fd20e6e5ee5ca91a39ce7 | C++ | PRKKILLER/Algorithm_Practice | /LeetCode/0009-Palindrome Number/main.cpp | UTF-8 | 1,296 | 3.84375 | 4 | [] | no_license | //
// Created by 薛智钧 on 2020/3/16.
//
// Determine whether an integer is a palindrome.
// An integer is a palindrome when it reads the same backward as forward.
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
class Solution {
public:
// 利用string
bool isPalindrome(int x) {
... | true |
2a1364587650ecee8613f11d5c1e953c2ee0b1e8 | C++ | plasma-effect/For_My_Game | /plasma/range_number.hpp | UTF-8 | 786 | 2.578125 | 3 | [
"BSL-1.0"
] | permissive | // Copyright plasma-effect 2014.
// Distributed under the Boost Software License, Version 1.0.
//(See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include<plasma/config.hpp>
namespace plasma
{
template<class T,T Min,T Max>class range_number
{
static_ass... | true |
96a20cbe1d46890b7e5d7b6485127c693c5d6314 | C++ | FancyKings/SDUSTOJ_ACCode | /Code_by_runid/2329815.cc | UTF-8 | 1,268 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <vector>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#define timespec A_A_A
#include <iomanip>
typedef long long LL;
usi... | true |
6dff7a6b624a498dd88afdd62d3a85bd339cd5e5 | C++ | LangeraertPepijn/Minigin | /Minigin/Observer.h | UTF-8 | 446 | 2.609375 | 3 | [] | no_license | #pragma once
#include "GameObject.h"
#include "Event.h"
class Observer
{
public:
Observer() = default;
Observer(const Observer& other) = delete;
Observer(Observer&& other) = delete;
Observer& operator=(const Observer& other) = delete;
Observer& operator=(Observer&& other) = delete;
virtual ~Observer() = default... | true |
962a298d7c6b8a1794d00aa31245565a551d27f8 | C++ | denis-gubar/Leetcode | /Hash Table/2461. Maximum Sum of Distinct Subarrays With Length K.cpp | UTF-8 | 803 | 2.546875 | 3 | [] | no_license | class Solution {
public:
long long maximumSubarraySum(vector<int>& nums, int k) {
long long result = 0;
int N = nums.size();
unordered_map<int, int> M;
int nonDistinct = 0;
long long sum = 0;
for (int i = 0; i < k; ++i)
{
if (++M[nums[i]] == 2)
... | true |
f2a8d8d0243e8e7ab5bd2dcdf417c7bb410150be | C++ | guptapiyush8871/BasicRayTracer | /RenderConfig.cpp | UTF-8 | 1,511 | 2.6875 | 3 | [] | no_license | #include "RenderConfig.h"
RenderConfig::RenderConfig() :
m_Msaa(e1X),
m_BackgroundColor(RGBAColor())
{
}
RenderConfig::~RenderConfig()
{
}
void RenderConfig::SetBackgroundColor(const RGBAColor& iBackgroundColor)
{
m_BackgroundColor = iBackgroundColor;
}
RGBAColor RenderConfig::GetBackgroundCol... | true |
97aece57286f3dd270619d37c84f011a33c2563a | C++ | amb-lucas/Competitive-Programming | /Strings/Manacher.cpp | UTF-8 | 747 | 3.46875 | 3 | [] | no_license |
vector<int> findOdd(string &str){
int n = str.size();
vector<int> d1(n);
for(int i=0, l=0, r=-1, k; i<n; i++){
if(i>r) k = 1;
else k = min(d1[l+r-i], r-i+1);
while(0 <= i-k && i+k < n && str[i-k] == str[i+k]) k++;
d1[i] = k--;
if(i+k > r){
l = i-k;
... | true |
47aaa7f2070aa73f34a5772fccd6ad2c66643ea5 | C++ | rubi1993/SwitchesNRouters | /rules.h | UTF-8 | 2,664 | 2.765625 | 3 | [] | no_license | //
// Created by igor.a on 8/30/18.
//
#ifndef SRA_RULES_H
#define SRA_RULES_H
#include <string>
class Rule{
public:
std::string way_to_rule;
std::string source_address;
std::string destination_address;
int source_adress_start,source_adress_end;
int destination_adress_start,destination_adress_end... | true |
13c001af0d9cdbf8587a29d3133b00f37a5df824 | C++ | jasonmnemonic/qfx-analysis | /src/StochMATrendGroup.cpp | UTF-8 | 1,586 | 2.703125 | 3 | [] | no_license | #include "StochMATrendGroup.hpp"
#include "Stochastic.hpp"
#include "MovingAverageTrend.hpp"
StochMATrendGroup::StochMATrendGroup(Parser *parser) {
mas = {
new MovingAverageTrend(parser, false, 10, 25, 50),
new MovingAverageTrend(parser, false, 25, 50, 100),
new MovingAverageTrend(parser, false, 50, 100, 200),
... | true |
50545c8a457608167269803968c0ac4279875de1 | C++ | lys8325/boj_study | /01546/main.cpp | UTF-8 | 313 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, sum=0, tmp, maxN = -1;
double ans;
cin>>n;
for(int i=0;i<n;++i){
cin>>tmp;
maxN = max(maxN, tmp);
sum += tmp;
}
ans = (double)sum * 100 / maxN / n;
cout<<ans;
return 0;
}
| true |
11722985d677edaac50f44c9104e9c4ef9c34dc0 | C++ | jhinkoo331/leetcode | /solution/0021____Merge_Two_Sorted_Lists.cpp | UTF-8 | 564 | 3.375 | 3 | [
"MIT"
] | permissive | #include "model\ListNode.h"
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
return _1(l1, l2);
}
private:
ListNode* _1(ListNode* l1, ListNode* l2){
ListNode head; //* head is initialized in stack
ListNode* tail = &head;
while(l1 != nullptr && l2 != nullptr)
if(l1->val <= ... | true |
c16fc5cc337c38c1a2a06ba9028076a1c3dce849 | C++ | cnsuhao/GUILib-3 | /Slider.cpp | UTF-8 | 3,970 | 2.59375 | 3 | [] | no_license | #include "Slider.h"
Slider::Slider(uint16_t _posX, uint16_t _posY, uint8_t _zDepth, SliderOrientation_t _orientation, uint16_t _length)
{
posX = _posX;
posY = _posY;
zDepth = _zDepth;
orientation = _orientation;
length = _length;
value = 0;
prev_value = 0;
hasTouchEventCallback = fal... | true |
d56cc8078446a613186d4a121c1bcf6859d13038 | C++ | borisborgobello/photon-mapping | /src_parallel/raytracing/photon_map.hpp | UTF-8 | 1,944 | 2.6875 | 3 | [] | no_license | #ifndef PHOTON_MAP_HPP_
#define PHOTON_MAP_HPP_
#include <vector>
#include <cstdlib>
#include <boost/shared_ptr.hpp>
#define LIBSSRCKDTREE_HAVE_BOOST
#include <ssrc/spatial/kd_tree.h>
#include "launchables/photon.hpp"
class PhotonMap
{
typedef std::array<double, 3> ArrayPoint ;
typedef ssrc::spatial::kd_tree<... | true |
66a3fd8f4eb9ed204071cb98a0508e4d12a2d41d | C++ | atrin-hojjat/CompetetiveProgramingCodes | /CF/Goodbye 2019/G.cpp | UTF-8 | 1,487 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
const int MaxN = 1e6 + 6.66;
int mark[MaxN];
int arr[MaxN];
vector<int> topo, loop;
void topo_dfs(int v) {
mark[v] = 1;
int u = v - arr[v];
if(mark[u] == 0) topo_dfs(u);
topo.push_back(v);
}
int find_dfs(int v) {
mark[v] = 1;
{
int u = v - ... | true |
a817e2125dcb8a98e55253e25a345fdeb829bacb | C++ | nguyenviettien13/CodeLearning | /1000CppExercise/ACOAlgorithm/antalRank.cpp | UTF-8 | 6,920 | 2.53125 | 3 | [] | no_license | //ACO - Rank based ACO
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <stdio.h>
#include <fstream>
//#include <cv.h>
//#include <highgui.h>
#define MAX_CITIES 30
#define MAX_DIST 100
#define MAX_TOUR (MAX_CITIES * MAX_DIST)
#define MAX_ANTS 30
using namespace std;
//Initial D... | true |
5ce1546da29653169f8df2e2b074f3301eca191d | C++ | katejim/study | /c++/ha2/errors.h | UTF-8 | 1,575 | 3.203125 | 3 | [] | no_license | #ifndef ERRORS_HPP
#define ERRORS_HPP
#include <stdexcept>
#include <string>
using std::string;
class Exception : public std::exception
{
string msg;
size_t erLine;
public:
Exception(size_t inLine, string const &message) : msg(message), erLine(inLine) {}
const char* what() const throw()
{
... | true |
0984f6a6caca5f40b38e945d6615648af6ae7dc6 | C++ | Maazil/BomberRoyale | /bomberRoyale/jsonobjects/credits.h | UTF-8 | 484 | 2.859375 | 3 | [] | no_license | #ifndef BOMBER_ROYALE_CREDITS_H
#define BOMBER_ROYALE_CREDITS_H
#include <string>
class Credits {
public:
/**
* Read the credits from the file.
*
* @param filename is the path to the file
*/
bool readFromJson(const std::string& filename);
/**
* Return the credits text
* @ret... | true |
9efd96b9b3bda3aa8b29b4102c70fec387816d7f | C++ | lapuglisi/ccpp | /studies/hash_table/hash_table.h | UTF-8 | 2,072 | 3.265625 | 3 | [] | no_license | #ifndef HASH_TABLE_H
#define HASH_TABLE_H
#include <iostream>
#include <memory.h>
#include <string.h>
namespace hash_table
{
///
/// Separate chaining Linked List
///
struct LinkedList
{
int data;
const char* key;
struct LinkedList* next;
LinkedLi... | true |
b2d3f18189da81dfddea52cfd24606c1a1a20f00 | C++ | alohaeee/Corrosion | /src/driver/driver.hpp | UTF-8 | 2,126 | 2.90625 | 3 | [
"MIT"
] | permissive | #ifndef CORROSION_SRC_DRIVER_DRIVER_HPP_
#define CORROSION_SRC_DRIVER_DRIVER_HPP_
#include "utility/std_incl.hpp"
#include "lexer/lexer.hpp"
#include "parser/interface.hpp"
namespace corrosion
{
using CommandArgs = std::vector<std::string>;
class ArgReader
{
public:
static CommandArgs splitByWhiteSpaces(std::s... | true |
f74e41a35c287662fb5a57a5de14cc2287db448d | C++ | alisarogers/dictionaryTries | /cse100_pa2_startercode/DictionaryHashtable.cpp | UTF-8 | 734 | 3.203125 | 3 | [] | no_license | #include "util.h"
#include "DictionaryHashtable.h"
#include <unordered_set>
#include <string>
/* Create a new Dictionary that uses a Hashset back end */
DictionaryHashtable::DictionaryHashtable(){}
/* Insert a word into the dictionary. */
bool DictionaryHashtable::insert(std::string word)
{
std::pair<std::set<std:... | true |
9f3e889b23a4a91f0c2d9c4cd99db676e72a0dd7 | C++ | galin-kostadinov/Software-Engineering | /C++/Programming Basics with C++/12. Nested loops/simple_tasks/Building.cpp | UTF-8 | 782 | 3.15625 | 3 | [
"MIT"
] | permissive | #include<iostream>
using namespace std;
int main() {
int numOfFloors, numOfRooms;
cin >> numOfFloors >> numOfRooms;
char prefix = ' ';
int room = 0;
for (int i = numOfFloors - 1; i >= 0; i--) {
for (int j = 0; j < numOfRooms; j++) {
if (i % 2 == 0 && i < numOfFloors - 1 && n... | true |
d2eacea9ed44309a132bde0c38caa02947382d52 | C++ | agustinamartinez1044/ObjectOrientedProgramming | /Implementacion/Implementacion/src/clases/Comentario.cpp | UTF-8 | 522 | 2.796875 | 3 | [] | no_license | #include "../../include/clases/Comentario.h"
Comentario::Comentario(int id, DtFechaHora *fecha, string comentario){
this->id = id;
this->fechaEnvio = fecha;
this->comentario = comentario;
}
Comentario::~Comentario(){
delete fechaEnvio;
}
int Comentario::getId() {
return this->id;
}
string Comen... | true |
3e93dc952a95490bc49122e5ca8ede5439845c57 | C++ | sugawaray/filemanager | /tests/fm_map_impl.cpp | UTF-8 | 2,749 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <string>
#include <vector>
#include <fm.h>
#include <fm_map_impl.h>
#include "fixture/db.h"
#include "fm_map_impl.h"
using test::Db_fixture;
using namespace fm;
using std::string;
using std::vector;
namespace {
class Fixture : public Db_fixture {
public:
Fixture() {
categories.push_back("catA");
}
vec... | true |
65d7ea12f7bae59f8f59efc1cd01babb92e5a0da | C++ | Chaitya62/ComputerGraphics | /code/mid_point_ellipse.cpp | UTF-8 | 1,612 | 2.90625 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<graphics.h>
#define HEIGHT 480
#define WIDTH 640
#define X(x) x+(WIDTH/2)
#define Y(y) (HEIGHT/2) - y
using namespace std;
void putpixelo(int x, int y, int color){
setlinestyle(SOLID_LINE, 1, 3);
line(X(-100), Y(100), X(100), Y(100));
putpixel(X(x), Y(y),color);
return;
}
int drawE... | true |
deb0fe25bed2b680ed65905744d2f7990881c6c1 | C++ | shoeisha-books/dokushu-cpp | /ch01/list_1.6/main.cpp | UTF-8 | 197 | 3.40625 | 3 | [
"MIT"
] | permissive | #include <iostream>
int main()
{
int a = 1 + 2 * 3 - 4;
std::cout << a << std::endl;
int b = (1 + 2) * (3 - 4); // 括弧の中から計算
std::cout << b << std::endl;
}
| true |
c5e2e1d35f5ccaaf8f7cb6a1f09bdd1c6caafb65 | C++ | zeropoint-t/GCSDD | /Data Structures & Algorithm I/Project2/House.h | UTF-8 | 894 | 3.125 | 3 | [] | no_license |
#ifndef House_h
#define House_h
#include <iostream>
#include "Score.h"
class House{
public:
House();
House(Score* score, double price, double milesFromMainCity, double squareFootage, double numOfRooms, double numOfBathrooms);
~House();
bool operator>(const House& house);
... | true |
c872953a3e64cb5501666d529bbc540270951a50 | C++ | sonnh-uit/TheSis | /SOURCE/file_rw.cpp | UTF-8 | 595 | 3.109375 | 3 | [] | no_license | #include "file_rw.h"
void write_ob(string file, string content)
{
ofstream myfile;
myfile.open(file, ios_base::app);
if (myfile.is_open())
{
myfile << content;
myfile.close();
}
else
cout << "Can't write, Unable to open file " << file << endl;
}
string read_ob(string fi... | true |
6dc12fa93aaaeb138e37e39d05803177924a1f0c | C++ | lynren/uva-online-judge | /10035 Primary Arithmetic/solution.cxx | UTF-8 | 1,534 | 3.84375 | 4 | [] | no_license | /* Lyndon Renaud
* 2020-10-04
*
* Solution:
* Initially, we have 0 total carries and carry value set to 0
* Starting from the right most numbers i1, j1, we check
* if i1 + j1 + carry > 9. If this is true, we carry, so we set carry to 1
* and increment our carry counter. Else we set carry to 0.
* We keep moving ... | true |
7534590335472d443aa12204dc3c60e07c6d8bb7 | C++ | KaYBlitZ/CS3113-HW | /CS3113_HW_6/CS3113 HW6/Asteroid.cpp | UTF-8 | 4,453 | 3.0625 | 3 | [] | no_license | #include "Asteroid.h"
Asteroid::Asteroid() : Entity(0.0f, 0.0f, 0.0f), velocity(0.0f), shape(nullptr) {}
Asteroid::Asteroid(float x, float y, float rotation, float velocity, AsteroidSize size) : Entity(x, y, rotation), velocity(velocity), size(size) {
switch (size) {
case LARGE:
radius = 0.2f;
numPoints... | true |
e677995032798aed695a6415dc6aff3c70838fd4 | C++ | zxy3/cpp_primer_practice | /test10.33.cpp | GB18030 | 655 | 2.53125 | 3 | [] | no_license | /**=================================================================================================
* @file test10.33.cpp.
*
* Implements the test 10.33 class
* ϰ 10.33 д һļļļ Ӧ
* ʹ istream_iterator ȡ ʹ ostream_iteratorдһļ ÿֵ֮һո
* żдڶļ ÿֵռһС
*===============================================... | true |
a8899a6877a7f06affe952361b2f05b4dbbb41a9 | C++ | pydata/numexpr | /numexpr/str-two-way.hpp | UTF-8 | 14,424 | 2.609375 | 3 | [
"MIT"
] | permissive | /* Byte-wise substring search, using the Two-Way algorithm.
* Copyright (C) 2008, 2010 Eric Blake
* Permission to use, copy, modify, and distribute this software
* is freely granted, provided that this notice is preserved.
*/
/* Before including this file, you need to include <string.h>, and define:
RETURN_T... | true |
5c609577cf791f79b5098fb6e56794b7eee741cb | C++ | Vidrohi/EffectiveCPP | /EffCPP/Chapter6/PerformanceTester.cpp | UTF-8 | 4,051 | 3.265625 | 3 | [] | no_license | #include "NonPOD.h"
#include "PerformanceTester.h"
#include <vector>
void PrintNonPODByVal(Performance::NonPOD values)
{
printf("[PRINT_PASS_BY_VALUE] , NonPOD %s with id %i and value %f was printed \n", values.GetName().c_str(), values.GetId(), values.GetValue());
}
void PrintNonPODConstRef(const Perf... | true |
ac7322a9ef9b9889c9baa30b4db5da3370991e3d | C++ | yugpatell/text-based-rpg | /Character/Knight.cpp | UTF-8 | 1,052 | 3.171875 | 3 | [] | no_license | #include "Knight.h"
#include "../AttackStrategy/KnightAttack.h"
#include <iostream>
using namespace std;
Knight::Knight(string name, characterType role) {
attackMethod = new KnightAttack();
chestplate = nullptr;
leggings = nullptr;
weapon = nullptr;
this->name = name;
this->role = role;
ma... | true |
59baf065c3c5f4cc10d1c5bb0be3fae8208cc03e | C++ | klub-programatoru/RobotKarel | /Karel/main.cpp | UTF-8 | 2,906 | 2.625 | 3 | [] | no_license | #include "graphics.h"
#include <SDL2/SDL.h>
#include <stdio.h>
#include <cstdio>
#include <math.h>
#include "karel.h"
#include "wall.h"
#include "background.h"
#include "karel.h"
#include "obdelnik.h"
#include "finish.h"
#include "game.h"
#include <list>
#include <vector>
#include <string>
#include <iostream>
int z = ... | true |
301a9dc395f97f662d03371753884d6dbf685050 | C++ | stephengroat/OSVR-Core | /examples/plugin-hosts/BasicPluginLoader.cpp | UTF-8 | 1,615 | 2.703125 | 3 | [
"Apache-2.0",
"NCSA",
"BSL-1.0",
"BSD-3-Clause",
"MPL-2.0",
"LicenseRef-scancode-other-permissive",
"MIT"
] | permissive | /** @file
@brief Implementation
@date 2014
@author
Sensics, Inc.
<http://sensics.com/osvr>
*/
// Copyright 2014 Sensics, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the ... | true |
e41ba4d2314265cc0f81b08e59baf833a7959e06 | C++ | AGmanufacture/lightmashine | /lightmashine/RecieverChannel.cpp | UTF-8 | 1,277 | 3.03125 | 3 | [] | no_license | #include "RecieverChannel.h"
RecieverChannel::RecieverChannel(int pin, int minSignal, int maxSignal) {
_maxSignal = maxSignal;
_minSignal = minSignal;
_pin = pin;
_value = 0;
_lastState = LOW;
pinMode(pin, INPUT);
_stateChanged = micros();
_dropNextValue = false;
}
void RecieverChannel::read() {
in... | true |
35dd866711dd00c8ff425fbe7919dd5d1763ae4e | C++ | jasonrohrer/OneLife | /server/networkStressTest.cpp | UTF-8 | 1,611 | 2.515625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | #include <stdio.h>
#include "minorGems/network/Socket.h"
#include "minorGems/network/SocketServer.h"
#include "minorGems/system/Thread.h"
#define buffSize 8192
int main() {
printf( "Listening on port 9000\n" );
SocketServer server( 9000, 10 );
Socket *sock = server.acceptConnection( -1 );
... | true |
cc7c61f2853ff0fb3b0bebd6746f15b9d03c06e6 | C++ | IrinaStarshova/VendingMachine | /vendingMachine/VendingMachine/machine.cpp | UTF-8 | 4,549 | 3.28125 | 3 | [] | no_license | #include "machine.h"
#include "constants.h"
#include "dateTime.h"
#include "fileStatistics.h"
#include "createAndFreeFilePointer.h"
#include <iostream>
#include <random>
#include <chrono>
#include <algorithm>
using namespace std;
Machine::Machine() : totalProducts(0)
{
cellsNames.reserve(cellsCount);... | true |
6ba8eef0493b475ecfadfb7a7cc7a92e2a2ca77e | C++ | oboro-graph/Smart-Grid-Advanced-Metering-Infrastructure-privacy-preserving-protocol-implementation | /src/crypto/SmartMeter.h | UTF-8 | 3,292 | 2.796875 | 3 | [] | no_license | #ifndef __SMIMP_SMARTMETER_H_
#define __SMIMP_SMARTMETER_H_
#include "examples.h"
#include "Requester.h"
class SMAdapter;
namespace SMImp {
//! Smart Meter protocol implementation.
/*!
Most variables have been named after their respective names given in the original research paper available [here](htt... | true |
bbb8d738adc50e1af0f30905e6387c7fea652fad | C++ | NirvanaNimbusa/better-faster-stronger-mixer | /src/coverage.cpp | UTF-8 | 9,032 | 2.625 | 3 | [
"MIT"
] | permissive | #include "AllMixersWithClasses.h"
#include "bitops/rot.h"
#include "doctest.h"
#include "fmt/to_hex.h"
#include "robin_hood.h"
#include "sfc64.h"
#include <algorithm>
#include <bitset>
#include <iostream>
#include <nmmintrin.h>
uint16_t mumx16(uint16_t a, uint16_t b) {
auto m = static_cast<uint32_t>(a) * static_... | true |
6fb4cf3b574fd311995fd5c4434bc969533ee051 | C++ | shoaibrayeen/Data-Structures-and-Algorithms | /DATA STRUCTURES/Array/Query Square Root Decomposition/code_1.cpp | UTF-8 | 1,075 | 3.46875 | 3 | [
"MIT"
] | permissive | //
// code_1.cpp
// Algorithm
//
// Created by Mohd Shoaib Rayeen on 23/11/18.
// Copyright © 2018 Shoaib Rayeen. All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
struct Query {
int L, R;
};
void getQuerySums( vector<int> array , vector<Query> List ) {
int m = int(List.s... | true |
c699335a1f1c8f8f4a8efe64dd925d398fc8fdf3 | C++ | whutaihejin/repo | /primer/chapter16/t16.2.cc | UTF-8 | 2,264 | 3.765625 | 4 | [] | no_license | #include <iostream>
template <typename T>
T Fobject(T x, T) {
return x;
}
template <typename T>
T Frefrence(const T& x, const T&) {
return x;
}
template <typename T>
int Compare(const T& x, const T& y) {
if (x < y) {
return -1;
} else if (y < x) {
return 1;
}
return 0;
}
temp... | true |
ad126fafcd220b47170564a3b12ecff4e252e135 | C++ | xinfushe/gpu-real-time-shadows | /modelLoader.cpp | UTF-8 | 4,210 | 2.71875 | 3 | [] | no_license | #include "modelLoader.h"
#include <cassert>
#include <stdexcept>
#include <sstream>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <glm/glm.hpp>
std::ostream& operator<<(std::ostream& stream, const aiVector3D& vec)
{
stream << "(" << vec.x << ", " << vec.y << ", ... | true |
2299651ad429dd62e1ce3033e8a26c441fd53df8 | C++ | ellyheetov/Problem-Solving | /LeetCode/c++/300_Longest_Increasing_Subsequence.cpp | UTF-8 | 775 | 3.3125 | 3 | [] | no_license | //
// Created by 박혜원 on 2020/04/06.
//
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> length_dp;
int max_length = 1;
int lengthOfLIS(vector<int>& nums) {
if(nums.size() == 0)
return 0;
length_dp.resize(nums.size(),1);
... | true |
f17725df8f067ebc54ee7f142805bfe639b9554d | C++ | gudonghee2000/Algorithm-C | /BaekJoon/BaekJoon_재귀/10870.cc | UTF-8 | 256 | 2.84375 | 3 | [] | no_license | #include <iostream>
#define MAX 10000
using namespace std;
int fib(int n){
if(n==1)return 1;
if(n==0)return 0;
return fib(n-1)+fib(n-2);
}
int main() {
int n;
scanf("%d",&n);
int b= fib(n);
printf("%d",b);
return 0;
} | true |
f323dd2d9adf71395f7e7cf812b5b0708015c45b | C++ | Gazella019/Leetcode | /leetcode_1048.cpp | UTF-8 | 1,129 | 3.046875 | 3 | [] | no_license |
class Solution {
public:
int longestStrChain(vector<string>& words) {
int i, j, k, n, res = 0;
n = words.size();
vector<vector<int>> length(17);
vector<vector<int>> table(n, vector<int>(26, 0));
vector<int> dp(n, 1);
for(i=0;i<words.size();i++){
... | true |
2694dacfb0bb964f2d7f0d1857525694ae008130 | C++ | MatthewBerkvens/Computer-Graphics-Engine | /Figure.cc | UTF-8 | 2,710 | 2.90625 | 3 | [] | no_license | #include "Figure.h"
Figure::Figure(std::vector<double>& _ambientReflection, std::vector<double>& _diffuseReflection, std::vector<double>& _specularReflection, double _reflectionCoefficient)
: ambientReflection(_ambientReflection), diffuseReflection(_diffuseReflection), specularReflection(_specularReflection), reflect... | true |
47dc4e728a3ef3f8c21b2f2b1b9c6f326eea8abe | C++ | brosell/HTS-Games | /BertsToolBox/null_ostreambuf.h | UTF-8 | 381 | 2.875 | 3 | [] | no_license | #ifndef null_ostreambuf_h
#define null_ostreambuf_h
#include <iostream>
namespace hts
{
/** eats all output */
template <typename charT, typename traits = std::char_traits<charT> >
class null_ostreambuf: public std::basic_streambuf<charT, traits>
{
public:
protected:
virtual int_type overflow(int_type ... | true |
c0cf7429e495d6493c520d43a6084d2f3e9f4bf9 | C++ | AnthonyDugarte/competitive-programming | /COJ/3425.cpp | UTF-8 | 541 | 2.703125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
size_t t;
cin >> t;
while(--t != -1)
{
size_t n;
cin >> n;
string s;
map<string, size_t> counts;
while(--n != -1)
{
cin >> s >> s;
... | true |
7aa3df5869fe6ae443ef0732d0c6ccfa912aeab2 | C++ | xMijumaru/CSC17A_Summer2018 | /CSC 17A CLASS/CSC 17A Assignment 1/Gaddis_8thEdition_CHAP8_ ProgChal7_LotteryWinner/main.cpp | UTF-8 | 1,376 | 3.484375 | 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: main.cpp
* Author: kevr1
*
* Created on June 20, 2018, 6:11 PM
*/
#include <cstdlib>
#include <iostream>
#include ... | true |