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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ef15991d3ee9d70946faf1bf478b0befb02ce201 | C++ | pblottiere/dominus | /src/lib/net/client.hpp | UTF-8 | 403 | 2.796875 | 3 | [
"MIT"
] | permissive | #ifndef CLIENT_HPP
#define CLIENT_HPP
#include <string>
class Client
{
public:
Client( const std::string &ip, const int port );
bool connect();
int port() const;
std::string ip() const;
bool send( const std::string &message );
bool close();
private:
... | true |
768c229b0f22369260c7a2e071b80d285c8100d5 | C++ | recap/datafluo | /vlport-df/modules/Wave/WaveParameters/WaveParameters.cpp | UTF-8 | 2,189 | 2.609375 | 3 | [] | no_license | #include <string>
#include <fstream>
#include <sstream>
#include "LogManager.H"
#include "TimeLag.H"
#include "CommonDefines.h"
#include "IModule.h"
#include <string.h>
#include <stdio.h>
#include <ftw.h>
#define HERE(NUM) cout << "HERE " << #NUM << endl
#define HERE2(VAR) cout<< "HERE " << #VAR << ": " << VAR << end... | true |
9e2b1b807a10969ae2448e5f15c63a6612b353de | C++ | derossm/cuda-doom | /derma/misc/backup_boilerplate.h | UTF-8 | 46,246 | 3.359375 | 3 | [] | no_license |
/*
//=====
// shift (assignment) by const-ref
template<typename U>
requires (std::is_integral_v<U> || ::std::is_same_v<U, Byte<T, N>> || ::std::is_class_v<U>)
constexpr inline Byte<T, N>& operator>>=(const U& other) noexcept
{
if constexpr (::std::is_same_v<U, Byte<T, N>> || ::std::is_class_v<U>)
{
bits... | true |
7b7d7c45f9f20f99725ec80c94f31b69f61a5ac5 | C++ | aliddell/bertini_real | /include/curve.hpp | UTF-8 | 25,318 | 2.59375 | 3 | [
"FSFAP",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifndef CURVE_H
#define CURVE_H
/** \file curve.hpp */
#include <cstddef>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <gmp.h>
#include <time.h>
#include <float.h>
#include <limits.h>
#include <mpfr.h>
#include <mpf2mpfr.h>
#include <set>
#include "be... | true |
093b6921ee4c2da84692600cfca18d8efffe34b1 | C++ | TWANG006/G-LS3U | /AIA/aia_cpu.cpp | UTF-8 | 7,087 | 2.65625 | 3 | [
"MIT"
] | permissive | #include "aia_cpu.h"
#include <time.h>
#include <random>
#include <functional>
#include <omp.h>
#include <mkl.h>
namespace AIA{
AIA_CPU_Dn::~AIA_CPU_Dn()
{}
void AIA_CPU_Dn::operator()(// Outputs
std::vector<double>& v_phi,
std::vector<double>& v_deltas,
double &runningtime,
int &iIter... | true |
a08b3ef2ecf2b431ad4721ae39e66fcef2512853 | C++ | hankrof/jctvc_document_system_fetcher | /token.h | UTF-8 | 1,906 | 3 | 3 | [] | no_license | #ifndef HM_RESULT_TOKEN_H
#define HM_RESULT_TOKEN_H
#include <string>
#include <vector>
#include <memory>
#include <map>
#include <unordered_map>
class Token
{
public:
Token(const std::string &value);
virtual ~Token() = 0;
virtual const std::string& value() const final;
virtual std::string& value() fin... | true |
005697a23ff493dc970f4f3b83e78dacf702c5bc | C++ | DianeHemi/Modules_CPP | /cpp00/ex01/phoneBook.cpp | UTF-8 | 3,061 | 3.21875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* phoneBook.cpp :+: :+: :+: ... | true |
6126dbadcf2fc2c96bf87e88e25bcd83b123ea38 | C++ | breakstate/42_abstract_vm | /src/Parser.cpp | UTF-8 | 3,286 | 2.875 | 3 | [] | no_license | #include "../hdr/Parser.hpp"
Parser::Parser( void ) {
}
Parser::Parser( const Parser & srcObj ) {
this->operator=(srcObj);
}
Parser & Parser::operator=( Parser const & rhs ) {
this->_stackObject = rhs._stackObject;
this->_parseErrors = rhs._parseErrors;
return (*this);
}
Parser::~Parser( void ) {
}
void Parser... | true |
3e803973429b56afda1a6b28ffcdf652d472611f | C++ | AlexanderJDupree/CS162 | /week7/library/library.cpp | UTF-8 | 2,556 | 3.390625 | 3 | [] | no_license | // Implementation for Library class
#include "library.h"
Library::Library() : bookIDs(0), videoIDs(0), musicIDs(0) {}
// Inspectors
const Book& Library::getBook(const size_t& ID)
{
if (ID > SIZE)
{
throw "Invalid ID";
}
return books[ID];
}
const Video& Library::getVideo(const size_t& ID)
{
... | true |
e1105c1ee423551f271da9a406a5d1c3dee184f1 | C++ | snacchus/DeferredRenderer | /src/content/pooled.hpp | UTF-8 | 2,589 | 3.171875 | 3 | [] | no_license | #ifndef CONTENT_POOLED_HPP
#define CONTENT_POOLED_HPP
#include "Content.hpp"
#include "core/ObjectRegistry.hpp"
namespace content
{
namespace detail
{
template<typename T>
T* find_int(const object_type& type, const std::string& name)
{
return instance<ObjectRegistry>()->findTNFirst<T>(name);
}
templat... | true |
1b6230093a75173151991a2520390888a26313a8 | C++ | marco-gallegos/cpp-codeblocks | /programacion/medallero/main.cpp | UTF-8 | 1,917 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace std;
int V_ORO=50;
int V_PLATA=30;
int V_BRONCE=25;
class medallero
{
public:
int oro,plata,bronce,puntaje,sum;
string pais;
void sum_med()
{
sum=oro+plata+bronce;
cout<<pais<<" tiene "<<sum<<" medallas"<<endl;
}
void prom()
{
i... | true |
6e55a36e5d82eda559186f41c2d5689948216149 | C++ | luzhen-linux/test | /133.clone-graph.cpp | UTF-8 | 2,768 | 3.609375 | 4 | [] | no_license | /*
* [133] Clone Graph
*
* https://leetcode.com/problems/clone-graph/description/
*
* algorithms
* Medium (25.18%)
* Total Accepted: 145.1K
* Total Submissions: 576.3K
* Testcase Example: '{}'
*
*
* Clone an undirected graph. Each node in the graph contains a label and a
* list of its neighbors.
*
... | true |
40486c730c812faf9f19dedaa7be4faaf18fbbce | C++ | mrzv/henson | /include/chaiscript/dispatchkit/operators.hpp | UTF-8 | 13,093 | 2.765625 | 3 | [
"BSD-3-Clause-LBNL"
] | permissive | // This file is distributed under the BSD License.
// See "license.txt" for details.
// Copyright 2009-2012, Jonathan Turner (jonathan@emptycrate.com)
// Copyright 2009-2016, Jason Turner (jason@emptycrate.com)
// http://www.chaiscript.com
#ifndef CHAISCRIPT_OPERATORS_HPP_
#define CHAISCRIPT_OPERATORS_HPP_
#include "... | true |
4cc4a9ea564156ca37c48ce47e6819af1df87b68 | C++ | clauswitt/CppComponentSystem | /CppComponentSystem/Core/Shader.cpp | UTF-8 | 4,333 | 2.640625 | 3 | [
"MIT"
] | permissive | //
// HS_Shader.cpp
// HitSoccer
//
// Created by Sid on 16/07/14.
// Copyright (c) 2014 whackylabs. All rights reserved.
//
#include "Shader.h"
#include <cassert>
#include <iostream>
static bool CompileShader(GLuint *shader, GLenum type, const File &file)
{
GLint status;
std::string sourceStr = file.GetC... | true |
705436f2fd83690e36bf58d8003b4ea9bc6b054c | C++ | xtl-murphy/Stitches2 | /Src/Utils/Ref.hpp | UTF-8 | 2,138 | 2.8125 | 3 | [] | no_license |
/**
* Ref
* @version 1.0
* @since 1.0
* <p>
* Created by Murphy at 2020/8/9 2:05
**/
#pragma once
#include "Stitches.hpp"
NS_STITCHES_BEGIN
#define SAFE_DELETE(p) do { delete (p); (p) = nullptr; } while(0)
#define SAFE_DELETE_ARRAY(p) do { if(p) { delete[] (p); (p) = nullptr; } } while(0)
#defin... | true |
e6864579d2be279d93fefaa6e91ae8a61ac11edb | C++ | 1468362286/Algorithm | /CodeForces/912D/14290347_AC_140ms_13876kB.cpp | UTF-8 | 1,479 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <utility>
using namespace std;
inline double max(double a,double b){return a>b?a:b;}
inline double min(double a,double b){return a>b?b:a;}
const int dx[]={1,0,-1,0};
const int dy[]={0,1,0,-1};
struct node
{
int x,y;
d... | true |
33b91e52838fd0b7aff51ddbb6da065f514eef6f | C++ | crequierme/ParticleSystem | /Model.cpp | UTF-8 | 4,379 | 2.59375 | 3 | [] | no_license | //********************************************************************************
/*
Model.cpp
CPSC 8170 Physically Based Animation
Donald H. House 8/23/2018
Modified by Caroline Requierme (crequie@clemson.edu), 9/22/2018
Implementation for Particle System Simulation
*/
//************************************... | true |
375a7d45f70e0f18e50c25709970fc1f8828c642 | C++ | EinsVision/ModernCpp | /m9_9.cpp | UHC | 1,474 | 3.59375 | 4 | [] | no_license | #include "projects.h"
class Fraction_cp
{
private:
int numerator;
int denominator;
public:
Fraction_cp(const int& num_in, const int& deno_in = 1)
:numerator(num_in), denominator(deno_in)
{
cout << "constructor called" << endl;
assert(deno_in != 0);
}
Fraction_cp(const Fraction_cp& fr)
:numerator(fr... | true |
589d0b122ac3c4cabc2d74e1b6ccb5139bcf5fc9 | C++ | antipeon/cpp-labs | /lab-01/regular_polygon.cpp | UTF-8 | 940 | 3.265625 | 3 | [] | no_license | #include "regular_polygon.h"
#include <cmath>
#include <stdexcept>
#include "vector.h"
using geometry::RegularPolygon;
RegularPolygon::RegularPolygon(const std::vector<Point>& points)
: Polygon(points) {
const auto points_number = points.size();
edge_length = Vector(points[0], points[1]).Length();
for (s... | true |
2df45eead0d912c5ff93fc26bb0db3df3ef32642 | C++ | wdavidcalsin/fractal-tree-SFML-vscode | /main.cpp | UTF-8 | 1,317 | 3.28125 | 3 | [] | no_license | #include <SFML/Graphics.hpp>
#include <cmath>
using namespace sf;
const double PI = 3.141592;
const double R = 0.57;
const double O = 45;
sf::Color treeColor = sf::Color::Blue;
void createTreeRecursive(sf::VertexArray &tree, sf::Vector2f point, float angle, float lenght)
{
if (lenght < 3)
return;
t... | true |
1d9e45a4da99bd3f4998b4fbede6cb41b650b7f3 | C++ | acaly/MimiEditor | /MimiEditor/LocalFileWindows.cpp | UTF-8 | 3,415 | 2.640625 | 3 | [] | no_license | #include "File.h"
#include <utility>
#include <cassert>
#include <Windows.h>
//C++ file stream is not designed for binary nor for string (with encoding). Use Windows API instead.
namespace
{
using namespace Mimi;
class WindowsFileReader : public IFileReader
{
public:
HANDLE hFile;
std::size_t Size;
public:... | true |
8dfda0d57fa1bb9b61223c5ab765809f386f313d | C++ | sanjayaherath/Child-Watch | /sketches/SMS_1/SMS_1.ino | UTF-8 | 1,487 | 2.6875 | 3 | [] | no_license | #include <Sim800l.h>
#include <SoftwareSerial.h> //is necesary for the library!!
Sim800l Sim800l; //to declare the library
String numberSms, textSms;
bool error;
String number = "+94719688884";
int motPin = 3;
void setup() {
Sim800l.begin(); // initializate the library.
Serial.begin(9600);
pinMode(motPi... | true |
f940e1f973412120a80ee5bbe1e76248620fdfa1 | C++ | Shingyee/CreativeCoding_2019Summer_ZXYfinalwork | /arduino/sketch_jul03c.ino | UTF-8 | 1,570 | 2.890625 | 3 | [] | no_license | #include <dht11.h> //引用dht11库文件,使得下面可以调用相关参数
#define DHT11PIN 11 //定义温湿度针脚号为11号引脚
dht11 DHT11; //实例化一个对象
const int P = A0; //电位器的引脚
const int U = 2;
int sensorValue = 0; //电位器电压值
int outputValue = 0;
void setup() { //设置
Serial.begin(9600); ... | true |
6a24898e63d2f68ba2354ba2d84a6bee2d219b53 | C++ | iThinkEmo/ComputerGraphics2017 | /ComputerGraphics/Circle.cpp | ISO-8859-1 | 844 | 3.390625 | 3 | [] | no_license | /*********************************************************
Materia: Grficas Computacionales
Fecha: 18 de agosto del 2017
Autor: A01169073 Aldo A. Reyna Gmez
*********************************************************/
#include "Circle.h" //Si es un archivo fuente que ya existe, se usa "", si es librera que se vincula de... | true |
b4e530d805edf5bead3f6f29ec0e71a790861f9d | C++ | xijujie/PAT--Advanced-Level--Practice | /1053.cpp | UTF-8 | 1,182 | 2.640625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int maxn = 100;
int weight[maxn], s;
vector<int> node[maxn], tmp;
vector<vector<int> > ans;
bool cmp(vector<int> &a, vector<int> &b) {
int l = min(a.size(), b.size());
for (int i = 0; i < l; ++i) {
if (a[i] != b[i]) return a[i] > b[... | true |
05138c0b7989ed0288062c5b37ddbbd919bc2b24 | C++ | mirabl/j | /longest-string-chain.cpp | UTF-8 | 1,211 | 2.921875 | 3 | [] | no_license | class Solution {
public:
bool pred(string& s, string& t) {
int n = t.size();
if (t.size() != s.size() + 1) {
return false;
}
int i = 0;
int j = 0;
while (i < n - 1 && s[i] == t[j]) {
i++;
j++;
}
if (i == n - 1) {
... | true |
71109e2b329e9c3c8b92278f81cd71fd35b59221 | C++ | JangHyeonJun/AlgorithmStudy | /Algorithms/programmers_12953.cpp | UTF-8 | 488 | 2.796875 | 3 | [] | no_license | //#include <string>
//#include <vector>
//#include <algorithm>
//using namespace std;
//
//int solution(vector<int> arr) {
// sort(arr.begin(), arr.end());
// int num = 1;
// for(int i=0; i<arr.size(); i++)
// {
// if (num % arr[i] != 0)
// {
// int sum1 = num;
// int sum2 = arr[i];
// while (true)
// {
// ... | true |
eacb989460e22bdd6c0726b0ff0d5b87eb66b2bd | C++ | CarlaOnate/Tec-EstructuraDatos-Algoritmos-Feb-Jun-2021 | /Templates_ClassAct/exampleMain.cpp | UTF-8 | 507 | 3.34375 | 3 | [] | no_license | //
// Created by Carla Onate on 08/02/21.
//
#include <iostream>
using namespace std;
template <class T>
T suma(T n1, T n2, T n3){
return n1 + n2 +n3;
}
template <class D>
D sumaFrac(D n1, D n2, D d1, D d2){
return (n1 + n2)/(d1 + d2);
}
//Todo: Make clase fraction separate form main and sum those fractions... | true |
9d9328bf4ba63de80c5c0bae4ce239aa19885305 | C++ | andyyzhengg/LeapPass | /LeapPassGui/PassListener.cpp | UTF-8 | 6,600 | 2.78125 | 3 | [] | no_license | //
// PassListener.cpp
// LeapPass
//
// Created by Andy Zheng on 3/28/14.
// Copyright (c) 2014 Andy Zheng. All rights reserved.
//
#include "PassListener.h"
using namespace Leap;
PassListener::PassListener(bool save) : _save(save)
{
for(int i = 0; i < 4; ++i)
{
pins[i] = false;
}
}
void
Pa... | true |
a0334ac25603cb0e5d5bf5d8bd7b76858f27db72 | C++ | renatosamperio/process_visualisation | /src/main.cpp | UTF-8 | 4,224 | 2.734375 | 3 | [] | no_license | #include <QApplication>
#include <iostream>
#include <memory>
#include <vector>
#include "boost/program_options.hpp"
#include "Poco/ThreadPool.h"
#include "Poco/Runnable.h"
#include "mainwindow.h"
#include "remotedatafeeder.h"
namespace
{
const size_t ERROR_IN_COMMAND_LINE = 1;
const size_t SUCCESS = 0;
con... | true |
bb3eb28e84d09f8b82a0e2752fef7e130e96b719 | C++ | TitoCarpio/Practica-PED | /Guia2/Ejercicio1.cpp | UTF-8 | 2,099 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include <conio.h>
#include <string.h>
using namespace std;
// variable global que utilizaremos para controlar los for y manejar el arreglo de notas
int n = 0;
// Resgistro donde almacenaremos todos los datos del usuario
struct Estudiante{
string nombre;
string apellido;
string estado... | true |
dc208e49bbec704a219c3e1686a8208b5499e545 | C++ | JanDeng25/Online-Judge | /leetcode OJ/377. Combination Sum IV.cpp | UTF-8 | 736 | 2.96875 | 3 | [] | no_license | class Solution {
public:
/*
//iteration
int combinationSum4(vector<int>& nums, int target) {
vector<int> dp(target+1, 0);
dp[0] = 1;
for(int i = 0; i <= target; i++){
for(int j = 0; j < nums.size(); j++){
if(i - nums[j] >= 0)
{
dp[i] += dp[i - nums[j]];
}
}
}
return dp[target];
}
*/
//Recursion
int co... | true |
4d06e765e4b85135c47142775fb44d8c7979effd | C++ | xiexiangyi0/GoogleCodeJam | /GCJ_Japan_2011_Qualification/A/main.cpp | UTF-8 | 787 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
#define dump(x) cerr << #x << " = " << (x) << endl;
int solve(int M, int C, int W, vector<int>& A, vector<int>& B) {
for (int i = C - 1; i >= 0; i--) {
if (W <= B[i]) {
W += A[i] - 1;
} else if (W <= A[i] + B[i] - 1) {
... | true |
1d77c92a0e835c4d5821216d4616a790af5cd64b | C++ | lja9702/JinAh-BOJ | /BaekjoonOnline/14916_change.cpp | UTF-8 | 288 | 2.734375 | 3 | [] | no_license | #include <cstdio>
int main(){
bool flag = 0;
int res = 0, n;
scanf("%d", &n);
for(int i = n / 5;i >= 0;i--){
int temp = n - i * 5;
if(!(temp % 2)){
res = i + temp / 2;
flag = 1;
break;
}
}
if(flag) printf("%d\n", res);
else printf("-1\n");
}
| true |
f4eac7c595adae315ca14b125e1a6634f6996121 | C++ | dkdlel/DongA-University | /Algorithm/과제12(바둑집 계산)/go.cpp | UHC | 1,932 | 3.0625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
ifstream fcin("go.inp");
ofstream fcout("go.out");
enum { UP, DOWN, LEFT, RIGHT };
class Go {
public:
int n1 = 0, cnt = 0, nextx = 0, nexty = 0, black_cnt = 0, white_cnt = 0, black_room = 0, white_room = 0; // n1 : n x n, cnt :
vector < vector < char > > board; // ٵ
v... | true |
3046ad8cd0f43760af98a6de779c0f5c9938843e | C++ | AxelLavielle/Barde | /Server/ServerSocket/ThreadPoolGenerator.cpp | UTF-8 | 2,922 | 2.640625 | 3 | [] | no_license | /*
==============================================================================
ThreadPool.cpp
Created: 21 Jun 2018 12:56:47pm
Author: anthony
==============================================================================
*/
#include "ThreadPoolGenerator.hh"
ThreadPoolGenerator::Threa... | true |
bf6748010f9fdcbbed21ea500d836646b2de69dc | C++ | shantanugoel/remember | /src/storage/storage_impl_simple_file.cc | UTF-8 | 2,259 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "src/storage/storage_impl_simple_file.h"
#include <ctime>
#include <filesystem>
#include <fstream>
#include <iostream>
#include "CLI/CLI.hpp"
#include "json/json.hpp"
#include "src/model/model.h"
namespace rmbr {
void to_json(nlohmann::json& j, const ModelItemV1& item) {
j = nlohmann::json{{"what", item.... | true |
f4feac7845e343064d7be34eb28b46be947ef00a | C++ | jstnchng/raytracer | /raytracer1.0/headerfiles/plane.h | UTF-8 | 536 | 2.546875 | 3 | [] | no_license | #ifndef __PLANE_H__
#define __PLANE_H__
#include "surface.h"
#include "vector.h"
#include "point.h"
#include "intersection.h"
using namespace std;
class Plane: public Surface {
public:
Vector normal;
double distanceToOrigin;
public:
Plane(){};
~Plane();
Plane(Vector &n, double d);
void init(Vector ... | true |
456415fbc8a73609a82e1ef2a35d6aae013dfd40 | C++ | xh286/leetcode | /215-Kth-Largest-Element-in-an-Array/solution.cpp | UTF-8 | 1,709 | 3.34375 | 3 | [] | no_license | class Solution {
private:
int my_partition(vector<int>& a, int low, int high, int pivot) // choose pivot, partition and return pivot position
{
// assert(a.size() > high && high >= low);
int pivot_value = a[pivot];
a[pivot] = a[low]; // a[low] is now free space
while(low < ... | true |
93c4be4377b2747906bfc30c295a813f0a288a84 | C++ | vivekkalia/defendaman | /Assets/C++_Scripts/Server/ServerTCP.cpp | UTF-8 | 12,739 | 2.796875 | 3 | [] | no_license | #include "ServerTCP.h"
using namespace Networking;
using namespace json11;
/**
* Initialize server socket and address
* @author Jerry Jia
* @date 2016-03-11
* @param port port number
* @return -1 on failure, 0 on success
*/
int ServerTCP::InitializeSocket(short port)
{
int err = -1;
i... | true |
932faa8de4efc4222b881d86f150f8a542452101 | C++ | LynnnnnnnYang/LeetCode_Solution | /PalindromeNumber.cpp | UTF-8 | 901 | 3.59375 | 4 | [] | no_license | // @Source : https://leetcode.com/problems/palindrome-number/
// @Author : LynnnnnnnYang
// @Date : 2016-08-09
/**********************************************************************************
* 9.Palindrome Number
* Determine whether an integer is a palindrome.
* Do this without extra space.
************... | true |
96c7acff99e0d26cf258af7623319613a441a4eb | C++ | sushaoxiang911/interview | /LeetCodeMobileProblems/CombinationSumOnce/combination_sum_once.cpp | UTF-8 | 1,250 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void recursion (vector<vector<int> > &ans, vector<int> &candidates, vector<int> &num, int k,
int sum, int target) {
if (k >= candidates.size() || sum > target)
return;
int current_can = candidates[k];
int i =... | true |
550c7e3ddb211a79ad99036e7f20dc728da58833 | C++ | snowyoneill/CTCI | /4.8/4.8.cpp | UTF-8 | 1,378 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include "BinaryTree.h"
template <class T>
bool treesMatch(Node<T> *n1, Node<T> *n2)
{
if(n1 == NULL && n2 == NULL) return true;
/*
* if((n1 == NULL && n2 != NULL) || (n1 != NULL && n2 == NULL))
* unnecessary as we have already checked above if the 2 nodes are equal.
*/
if... | true |
ebcd7bd6537f543f34c475dd9f4b2c21348396a1 | C++ | Jin22/Chamber-Crawler-3000 | /A5CC3K/A5CC3K-master-50c858ec25aff912f0d47906ff55d0f7a4192e67/grid.cc | UTF-8 | 4,597 | 2.953125 | 3 | [] | no_license | #include "grid.h"
#include "posn.h"
#include <fstream>
#include "entity.h"
#include "player.h"
#include "treasure.h"
using namespace std;
const char * MyMapNotFoundException::what() const noexcept {
return "Tried to load a non existent map";
}
Grid::Grid(): theGrid{vector<vector<Cell>>()}, chambers{vector<vect... | true |
04e9fed2aa8654dc6d5aaf8b76e1b6df9dc8821e | C++ | marththex/Data_Structures | /MarcusChong_5/RollOver.cpp | UTF-8 | 2,244 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "RollOver.h"
using namespace std;
RollOver::RollOver()
{
id = -1;
id2 = -1;
advisor = -1;
name = "";
level = "";
major = "";
department = "";
GPA = -1.0;
undo = -1;
}
RollOver::RollOver(int m_id, string m_name, string m_level, string m_major, double m_GPA, int ... | true |
f44015f8b38c95ec5a91f50efadffa1c13427cd9 | C++ | brhaka/libftTester | /tests/ft_strrchr_test.cpp | UTF-8 | 676 | 2.5625 | 3 | [] | no_license | extern "C"
{
#define new tripouille
#include "libft.h"
#undef new
}
#include "sigsegv.hpp"
#include "check.hpp"
#include "leaks.hpp"
#include <string.h>
int iTest = 1;
int main(void)
{
signal(SIGSEGV, sigsegv);
title("ft_strrchr\t: ")
char s[] = "tripouille";
char s2[] = "ltripouiel";
/* 1 */ check(ft_strrchr(s,... | true |
dfd08ce62c70b22543cd37cb8c0c682f4d75e909 | C++ | wo315/peercode | /hw2/mass_spring_705.hpp | UTF-8 | 4,950 | 3.421875 | 3 | [] | no_license | /**
* @file mass_spring.hpp
* Implementation of mass-spring system using Graph
*/
#include <fstream>
#include <chrono>
#include <thread>
#include "CME212/Util.hpp"
#include "CME212/Color.hpp"
#include "CME212/Point.hpp"
#include "Graph.hpp"
// Gravity in meters/sec^2
static constexpr double grav = 9.81;
/** C... | true |
4fd9ff2bb5f1516a8b4f2785fc0af047b96d5098 | C++ | akotadi/Competitive-Programming | /Interview/Reference/binaryTreeIterativePostorderTraversal.cpp | UTF-8 | 1,192 | 3.796875 | 4 | [] | no_license | /**
* Binary Tree Iterative Postorder Traversal algorithm, visit the nodes
* according to the requirement, recursively uses the memory stack to
* visit all the nodes
*
* @Complexity
* Time O(n)
* Space O(n)
*
* @Identify:
*
* @Practice:
* - Binary Tree Postorder Traversal
*/
vect... | true |
b57c8a30ea9b9dc21470f70059fccfa2d3d57ee8 | C++ | WillPickard/commerce-simulation | /Product.cpp | UTF-8 | 2,094 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <iomanip>
#include <sstream>
#include "Product.h"
using namespace std;
void Product::setDescription(const string & description){
description_ = description;
};
void Product::setSKU(const string & sku){
sku_ = sku;
};
void Product::setQuantity(int quantity){
quan... | true |
a497db44c59c43f73b4fe0c6d7e56413d8a65751 | C++ | imclab/newton | /tools/sfccon/Huff1.cpp | UTF-8 | 10,815 | 2.53125 | 3 | [] | no_license | /**************************************************************************
* *
* HUFF1.C: Huffman Compression Program. *
* 14-August-1990 Bill Demas Version 1.0 *
* ... | true |
abc80f5cc9bf667e7f64bb1e6f440e69d49f0e6e | C++ | PurvaKar/40-Days-of-Code | /Day 27/Rotate List.cpp | UTF-8 | 766 | 3.328125 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
ListNode* Solution::rotateRight(ListNode* A, int B)
{
ListNode* temp = A;
ListNode* t =A;
int i, len=0;
if(temp==NULL)
return A;
whi... | true |
40fa3e9c22e4e4158160a200d373a466bf6848c8 | C++ | tungfaifong/usrv | /src/unit_manager.cpp | UTF-8 | 2,133 | 2.84375 | 3 | [] | no_license | // Copyright (c) 2022 TungFai Fong <iam@tungfaifong.com>
#include "unit_manager.h"
#include <chrono>
#include <string>
#include "interfaces/logger_interface.h"
#include "util/time.h"
#include "unit.h"
NAMESPACE_OPEN
void UnitManager::Init(intvl_t interval)
{
_loop.Init(interval, [self = shared_from_this()](intvl_... | true |
bb8965e093b35e3a5bfcb1d15bc1c518f6968098 | C++ | nareshenoy/base | /src/script/project_euler/12.cpp | UTF-8 | 642 | 3.109375 | 3 | [] | no_license | #include <iostream>
//int num_fac[20000];
int GetNumOfFactors(int n) {
int count = 0, i;
for(i = 1;i <= n;i ++) {
if(n % i == 0) count ++;
}
return count;
}
int main() {
int i = 1, num_fac;
int tri_num;
/*for(i = 0;i < 20000;i ++) {
num_fac[i] = -1;
}
i = 1;*/
while(1) {
if(i % 100 ==... | true |
f34c0484b674d0f6515adb15151012def8e5f9cd | C++ | sedevc/CarReg | /cars.cpp | UTF-8 | 1,583 | 3.359375 | 3 | [] | no_license |
#include "cars.h"
using namespace std;
bool cars::setRegnr(string y){ //accessors
if (y.size() != 6) {
cout << " (Wrong format! 6 chars )" << endl;
return false;
}
int tmp13 = 0, tmp46 = 0;
char tempChar[6];
for (int i = 0; i < 6; i++) { //convert string to char
tempChar[i] = y[i];
}
for (int i... | true |
5f21ed9cace8678494597da7a696f8c2bbbc105d | C++ | TerrySoba/BlobbyThing | /src/MultiSpline.h | UTF-8 | 1,524 | 2.984375 | 3 | [] | no_license | /*
* MultiSpline.h
*
* Created on: 20.04.2012
* Author: yoshi252
*/
#ifndef MULTISPLINE_H_
#define MULTISPLINE_H_
#include "Spline.h"
#include <vector>
#include <array>
template <size_t _dimensions>
class MultiSpline {
public:
MultiSpline() {}
/*! \brief Set points for multispline
*
* ... | true |
6068fe8390cc199265ca1e733d010b8059f08265 | C++ | Guadalupe-Moreno/PAYMN | /Programas_C++/Factorial/factorial_b.cpp | UTF-8 | 355 | 2.75 | 3 | [] | no_license | #include<stdlib.h>
#include<stdio.h>
main(){
long int x, n, m;
printf("\n Dame un numero entero 'n':\n");
scanf("%i", &n);
x=0;
m=1;
while (x<n){
x=x+1;
m=m*x;
}
printf("\n\t Para n= %i", n);
printf("\n\t El factorial n! es: %i\n", m); ... | true |
2f0b32ca3063cd033a7f77f5a88020b8be4df663 | C++ | douysu/algorithm | /algorithm_hufan/algorithm4_6.cpp | WINDOWS-1252 | 169 | 2.8125 | 3 | [] | no_license | #include <stdio.h>
//ݹ飬nĽ׳
int cal(int n){
if(n==1){
return 1;
}
return n*cal(n-1);
}
int main(){
int n=5;
printf("%d",cal(n));
return 0;
} | true |
6ee4f425c95d731fee8bd40dd049b351d05e4be5 | C++ | haebinKahng/codint_test_cpp | /9.모두의약수_솔루션.cpp | UTF-8 | 341 | 2.53125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
freopen("input.txt", "rt", stdin);
int n,i,j,a[1001];
scanf("%d", &n);
for (i=1;i<=n;i++)
{
a[i] = 0;
}
for (i=1;i<=n;i++)
{
for (j=i;j<=n;j+=i)//j=j+i
{
a[j]+=1;
//a[j]++;
}
}
for (i=1;i<=n;i++)
{
cout... | true |
ba41dfa2e8fb7ba17ab321dbe834db5075ffa7ba | C++ | kuba34/PAMSI_project1 | /introsort.hpp | UTF-8 | 830 | 3.046875 | 3 | [] | no_license | #ifndef INTROSORT_HPP
#define INTROSORT_HPP
#include <vector>
#include "quicksort.hpp"
template<class T>
void heapify(std::vecor<T> &vec, const int left, const int right) {
int j, i=left;
while (i<=right/2)
{
j=2*i;
if (j+1<=right && vec[j+1]>vec[j])
j=j+1;
if (vec[i]<v... | true |
d368b2a8ac78125b0f5da9e96bf1f9ca3ee06c18 | C++ | rein4ce/DeferredEngine | /src/Engine/Core/Camera.cpp | UTF-8 | 2,147 | 2.890625 | 3 | [] | no_license | #include "platform.h"
#include "Camera.h"
#include "Utils.h"
CCamera::CCamera(void) :
CObject3D(),
dV(Vector3(0,0,1)),
dU(Vector3(0,1,0))
{
position = Vector3(0,0,0);
rotation = Vector3(0,0,0);
forward = Vector3(0,0,1);
up = Vector3(0,1,0);
right = Vector3(1,0,0);
near = 0.1f;
far = 1000.0f;
CreateOrthog... | true |
2f558d794b147c6bf3f322baace5c0baec0b06e5 | C++ | arangodb/arangodb | /3rdParty/boost/1.78.0/boost/hana/fwd/filter.hpp | UTF-8 | 2,636 | 2.828125 | 3 | [
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | /*!
@file
Forward declares `boost::hana::filter`.
@copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_FWD_FILTER_HPP
#define BOOST_HANA_FWD_FILTER_HPP
#include <boost/hana/co... | true |
3b76d19d3c1f7ff7dab866711732021f809df9bb | C++ | jaan1729/Neural-Network | /include/Layer.hpp | UTF-8 | 1,751 | 3.34375 | 3 | [] | no_license | //Layer is implemented using vector of Neurons
//Values of layers are returned in Matrix data structure which is implemented in Matrix.hpp
//Matrix data structure is helpful to perform matrix operations over the values.
//All the matrix related methods are implemented in matrix.hpp or util.hpp
//The decla=erations are ... | true |
9a3ffc7785ca5aa5a4880ca45260a3c198427210 | C++ | silentst0rm/PandaMini_MarlinUI | /motionscreen.h | UTF-8 | 3,388 | 2.6875 | 3 | [] | no_license | #ifndef MOTIONSCREEN_H
#define MOTIONSCREEN_H
#include "screen.h"
#include "motionunit.h"
#include "screentask.h"
#include <lvstyle.hpp>
class LVButton;
class LVLabel;
class LVImage;
/**
* @brief 运动控制界面
*
* TODO: 为单位按钮添加设置功能
* TODO: 设置运动速度
*
*/
class MotionScreen : public Screen
{
LV_OBJECT
protected:
... | true |
001a8ceb1e8a3dfed8cf232696b416c9d1667698 | C++ | Nviviri/Pi_In_The_Sky | /Examples/cpMQTT/TemperatureConverter.cpp | UTF-8 | 1,377 | 2.828125 | 3 | [] | no_license | #include "MQTTconfig.h"
#include "TemperatureConverter.h"
#include "Topic.h"
#include <string>
#include <iostream>
#define CERR std::cerr << className_ << "::" << __func__ << "()\n "
TemperatureConverter::TemperatureConverter(const std::string& appname,
const std::string& ... | true |
5efd0bcd08e207ca90fbcd0708436f118011fb36 | C++ | friepasc/zed-3d-social-distancing | /src/GLViewer.cpp | UTF-8 | 30,838 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "GLViewer.hpp"
#include <random>
#include "cuUtils.h"
#if defined(_DEBUG) && defined(_WIN32)
#error "This sample should not be built in Debug mode, use RelWithDebInfo if you want to do step by step."
#endif
// Function that calculate the number of unrespected distance in the time interval [current -... | true |
f2f72186baf44fbe82b70ab45810f07f8c7430ea | C++ | paladin-705/InternetRadioPlayer | /src/RadioServer.cpp | UTF-8 | 895 | 2.59375 | 3 | [] | no_license | #include "RadioServer.h"
RadioServer::RadioServer()
{
qDebug() << "Starting server...";
server = new QTcpServer();
if(server->listen(QHostAddress::Any, _serverPort))
qDebug() << "Server listen port: " << _serverPort;
else
qCritical() << "Server starting error: " << server->serverError();... | true |
73166219adcc24aa26f3cc68d28492abdeba985e | C++ | houwenqi/Tool-program | /c-mysql/MYSQLtest.cpp | UTF-8 | 3,379 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> //sleep函数
#include "mysql.h"
//数据结构定义
MYSQL mysql;
MYSQL_RES *res;
MYSQL_ROW row;
void DoSQL(char* sql)
{
int retcode = 0;
retcode = mysql_real_query(&mysql,sql,(unsigned int)strlen(sql));//如果查询成功,函数返回零。如果发生一个错误,函数返回非零。
if( retcode != ... | true |
20d4c5b636948a974470797f11f9cb64335fb201 | C++ | porfirioribeiro/resplacecode | /CPP/xCalc_old/panels/ivapanel.h | UTF-8 | 1,247 | 2.515625 | 3 | [] | no_license | #ifndef IVAPANEL_H
#define IVAPANEL_H
#include <QtGui>
#include "ui_ivapanel.h"
class IvaPanel: public QWidget {
Q_OBJECT
Q_DISABLE_COPY(IvaPanel)
public:
explicit IvaPanel(QWidget *parent = 0) :
QWidget(parent) {
ui.setupUi(this);
doCalc();
}
public slots:
void doCalc() {
double inic... | true |
0bf1818667204c7dcf4bbc33ffd5f522d6f1473e | C++ | kylin0925/online_judge | /acm/c10000/acm10003f1.cpp | UTF-8 | 1,250 | 2.59375 | 3 | [] | no_license | /* @JUDGE_ID: 53xxxx 10003 C++ */
/* @BEGIN_OF_SOURCE_CODE */
#include <stdio.h>
int n;
int l;
int stick[100];
int m[60][60];
void sov()
{
int len,i,j;
int tmp;
for(len=2;len<=n;len++)
{
for(i=0;i<=n-len;i++)
{
... | true |
b65dcf6892378b989092bddb76d4c7e9cc4c5525 | C++ | handahye/AlgorithmStudy | /SWExpert/D3/D3_삼성시의 버스 노선.cpp | UHC | 768 | 3.140625 | 3 | [] | no_license |
int main() {
cout << " ";
int T;
cin >> T;
for (int k = 1; k <= T; k++) {
int N, Q;
cin >> N >> Q;
int cow[100001];
int L[100001], R[100001];
int one[100001], two[100001], thr[100001];
for (int i = 1; i <= N; i++) { //N ǰ Է¹
cin >> cow[i];
}
for (int j = 0; j < Q; j++) { // Է¹
cin >> L[... | true |
d5cba0e703f652be06dc66e7135771f66bf91539 | C++ | telminov/my_notes_for_various-_programlanguages | /c++/teacher/3 class/3.cpp | UTF-8 | 1,845 | 4.15625 | 4 | [] | no_license | #include <iostream>
//целое без знака unsigned int
class Cat
{
public: //открытые переменные , иначе закрытые
void Meow(); //функцие не надо ни чего возвращать - void
int GetAge();
int setAge(int age);
private:
int itsAge;
};
int Cat::GetAge()
{
return itsAge;
}
int Cat::setAge(int age)
{
itsAge = age;
}
void C... | true |
754b066a95aed7a1d4956a9bff393c100498ba41 | C++ | WonJoonPark/BOJ-Algorithm | /1600-1.cpp | UHC | 1,889 | 2.5625 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int k, w, h;
int chesspan[200][200];
bool visit[200][200][31]; //k 0~30
int horsemovex[8] = { -1,-2,-2,-1,1,2,2,1 };
int horsemovey[8] = { -2,-1,1,2,2,1,-1,-2 };
int dx[4] = { 0,0,1,-1 }; //k Ҹ
int dy[4] = {... | true |
cc0e6befd88592092f791f52199952295aabcc11 | C++ | SergiPC/Ready_for_exam | /Programació02_All_in/Programació02_All_in/DLinkedList.h | WINDOWS-1252 | 7,679 | 3.375 | 3 | [] | no_license | // --------------------------------------------
// DLinkedList class
// --------------------------------------------
#ifndef __DLINKEDLIST_H__
#define __DLINKEDLIST_H__
#include <assert.h>
#include "Utilities.h"
#define NULL 0 // for not carrying the entire library
// node from a Double Linked List --... | true |
472c2c0389d8f76d64a2b8be2ed921156dbae425 | C++ | WenjieZhang1/leetcode | /divide.cpp | UTF-8 | 895 | 3.34375 | 3 | [] | no_license | # include <iostream>
using namespace std;
int divide(int dividend, int divisor) {
if(divisor==0 || (dividend==INT_MIN && divisor==-1)) return INT_MAX;
if(divisor==1) return dividend;
bool flag=((dividend>0 && divisor<0) || (dividend<0 && divisor>0));
long dividend_abs = abs((long)divide... | true |
1a7ebd253dcd088a9150584a11b1fd365445ffd3 | C++ | bp274/HackerRank | /Algorithms/Implementation/Birthday Chocolate.cpp | UTF-8 | 496 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n ;
int s[n] ;
for(int i = 0; i < n; i++)
{
cin >> s[i] ;
}
int d, m ;
cin >> d >> m ;
int count=0, sum ;
for(int i=0; i<=n-m; i++)
{
sum=0 ;
for(int j=i; j<m+... | true |
49379711829b15a1f4f79f99303ade71b3b0d07f | C++ | MaltsevaNata/OOP | /Merge/Merge.cpp | UTF-8 | 7,144 | 3.4375 | 3 | [] | no_license | //
// Created by natas on 18.02.2019.
//
#include "Merge.h"
#include <iostream>
void MergeSort (int *arr, int begin, int end) {
if (begin < end)
{
MergeSort(arr, begin, (begin+end)/2);//сортировка левой части
MergeSort(arr, (begin+end)/2+1, end); //сортировка правой части
Merge(arr, b... | true |
0ee578ada1401891a13c81f01c01c8bb6db9554a | C++ | s-vde/talks | /testing-and-verifying-multithreaded-programs/examples/data_race.cpp | UTF-8 | 1,007 | 3.40625 | 3 | [] | no_license |
#include <thread>
//------------------------------------------------------------------
void thread0(std::mutex& m, int& x, int& y)
{
// m.lock();
int x_local = x;
// m.unlock();
if (x_local == 1) // datarace: line 23
{
y = 1; // datarace: line 25
}
pthread_exit(0)... | true |
864f6a4886c320fa73d6d0ff52ef4154aaf5bf27 | C++ | RiyaGupta89/C-Coding-problems-for-beginners | /simpleInput.cpp | UTF-8 | 336 | 3.375 | 3 | [] | no_license | // Print all the numbers before the cumulative sum become negative.
#include<iostream>
using namespace std;
int main() {
int n;
int sum = 0;
while(true) {
cin>>n;
sum = sum + n;
if(sum >= 0) {
cout<<n<<endl;
}
else {
break;
}
}... | true |
aeb43fa4ff13dd060340012b3887467d6a6d7f7e | C++ | itzranjeet/Sensor_Fusion | /sensor_fusion/include/sensor_fusion/console_logger.hpp | UTF-8 | 1,787 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include "logger_base.h"
#include "console_logger.h"
namespace sensor_fusion
{
template<typename... Args>
auto& ConsoleLogger::GetTypeLookupMap(Args&&... args)
{
static log_function_lookup_based_on_type type_lookup_;
type_lookup_[LogMessageType :: error] = [&args...](){... | true |
78850f06525587bd39f49cefa704c752cab156cc | C++ | jrucl2d/Algorithm-Homework | /week5-1.cpp | UHC | 2,246 | 3.6875 | 4 | [] | no_license | #include <iostream> // 2015112083
#include <vector>
#include <fstream>
#include <string>
using namespace std;
#define NOWAY -1
int dp[5][5]; // (i,j) µ ִ
struct map {
int right;
int down;
};
void GetInfo(map** tour) {
ifstream file; // Է Ʈ
file.open("map_info.txt"); //
// Է¹ޱ
char info[50]; // 5*5 = 2... | true |
3b2584fd1fba1298327beebb370fa0adcde189d1 | C++ | sovaai/sova-engine | /src/InfEngine2/InfEngine/InfFunctions/FunctionsRegistry.hpp | UTF-8 | 15,325 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #ifndef __FunctionsRegistry_hpp__
#define __FunctionsRegistry_hpp__
#include <InfEngine2/InfEngine/InfFunctions/InfInternalFunction.hpp>
#include <InfEngine2/InfEngine/InfFunctions/InfExternalFunction.hpp>
/**
* Реестр функций языка DL.
*/
class FunctionsRegistry
{
public:
/** Конструктор реестра. */
FunctionsRe... | true |
eb12a209f1fec874a0ede14b77946d825ffe644c | C++ | leisheyoufu/study_exercise | /algorithm/leetcode/107_Binary_Tree_Level_Order_Traversal_II/main.cpp | UTF-8 | 1,658 | 3.671875 | 4 | [] | no_license | /*
107. Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
return its bottom-up level ord... | true |
6f52761098abdca83e5ce2e57b23ea6a6660221e | C++ | better-712/Compilers-project | /spl_project4/visitor.hpp | UTF-8 | 4,038 | 2.640625 | 3 | [] | no_license | //
// Created by 10578 on 11/4/2019.
//
#ifndef __VISITOR_HPP__
#define __VISITOR_HPP__
#include "ast.hpp"
namespace SPL {
class Exp_Info;
template<typename T, typename S, typename E>
class AST_Visitor {
public:
/* Internal Nodes */
virtual T visit(Program_Node *node) = 0;
virtual T visit(ExtDefList_No... | true |
f670ec598001b9064f9c03c95352656c2609e0c4 | C++ | zpiao1/CPP-Primer | /Code8-2-2_1.cpp | UTF-8 | 518 | 3.203125 | 3 | [] | no_license | #include <fstream>
#include <string>
using namespace std;
int main()
{
// file1 is truncated in each of these cases
ofstream out("file1"); // out and trunc are implicit
ofstream out2("file1", ofstream::out); // trunc is implicit
ofstream out3("file1", ofstream::out | ofstream::trunc);
// to prese... | true |
5f62538501c81c61348c5f81d4a8640350efd816 | C++ | HerculesShek/cpp-practise | /src/ch4/precedence/demo03.cc | UTF-8 | 170 | 2.8125 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main()
{
short short_value = 32767;
short_value += 1;
cout << "short_value: " << short_value << endl;
return 0;
}
| true |
0ef266f27ddeb4daf6954c0ba28e4340f2d17cc4 | C++ | ilovethisid/Assignments | /MainSystem.cpp | UTF-8 | 1,303 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <conio.h>
#include <Windows.h>
#include "Window.h"
#include "Stats.h"
#include "Units.h"
#include "Properties.h"
using namespace std;
// function headers
void gamestart(Window, Stats);
void gameover();
void pickCard(NumUnits, Window, Stats);
// stru... | true |
a97a6e3ba19a36569a8d9ebbfe017c4e8ac5ff55 | C++ | Lucria/MyKattisSolutions | /ReachableRoads.cpp | UTF-8 | 2,035 | 2.5625 | 3 | [] | no_license | // Created by Jerry
#include <iostream>
#include <iomanip>
#include <cmath>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <string>
#include <sstream>
#include <list>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <unordered_map>
#include <unordered_set>
... | true |
4fa4e034d2f69a50f976629cbd906cb9c9da6fbf | C++ | njoy/GNDStk | /src/GNDStk/Node/src/sort.hpp | UTF-8 | 2,458 | 3.375 | 3 | [
"BSD-2-Clause"
] | permissive |
// -----------------------------------------------------------------------------
// Helpers
// Private, for use by sort(). Could lead to surprises for users if not used
// in the proper sort() context. In particular, less() assumes that any child
// nodes it inspects were sorted already; if they weren't, then transiti... | true |
af56fadf4f79075aff0b1d695feb0c033d8808e3 | C++ | LiamPilot/LightSaber | /src/utils/QueryApplication.h | UTF-8 | 1,362 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <vector>
#include "utils/SystemConf.h"
class Query;
class TaskProcessorPool;
class TaskDispatcher;
class PerformanceMonitor;
/*
* \brief This is the query application that is going to be executed once
* the @setup is called first and the @processData function gets invoked.
*
* A query appl... | true |
15e233a6d56446ca7b61634ac1aa9dd3ccccdea8 | C++ | jandrea/CHROMIETracking | /Geometry/PixelTelescope/plugins/DDTelescopePlanesAlgo.h | UTF-8 | 1,743 | 2.703125 | 3 | [] | no_license | #ifndef DD_TelescopePlanesAlgo_h
#define DD_TelescopePlanesAlgo_h
//////////////////////////////////////////////////////////////////////////////////////////
// DDTelescopePlanesAlgo
// Description: Places pixel telescope planes inside a given telescope arm.
// The planes can be tilted (rotation around CMS_X) then ske... | true |
8fd836b87f68d05e25d6519257a4b874e55c7fcd | C++ | gan-ta/Algorithm | /BackJoonOnline/14226스티커.cpp | UTF-8 | 1,178 | 2.984375 | 3 | [] | no_license | #include <cstdio>
#include <queue>
using namespace std;
typedef struct imo{
int total;
int storage;
int depth;
}imo;
int visited[2001][2001];
queue<imo> q;
int main()
{
int s;
int res = 0;
scanf("%d", &s);
imo start;
start.total = 1;
start.storage = 0;
start.depth = 0;
q.push(start);
visited[1][0] = ... | true |
4041cc7a06d25782fc8a2b5c924bbb7e656f04ba | C++ | BenjaminHb/WHU_CS_WebLearn | /src/Problem_203.cpp | UTF-8 | 703 | 2.640625 | 3 | [
"MIT"
] | permissive | /**
* File Name: Problem_203.cpp
* Project Name: WHU_CS_WebLearn
* Author: Benjamin Zhang
* Created Time: 01/13/2019 19:35
* Version: 0.0.1.20190113
*
* Copyright (c) Benjamin Zhang 2019
* All rights reserved.
**/
#include<stdio.h>
#include<stdlib.h>
int main()
{
int no;
... | true |
8d65809a15561040f63b4dd90a93b3c3b86ab8c5 | C++ | aracitdev/AsciiCmd | /src/Drawables/Rectangle.cpp | UTF-8 | 938 | 2.796875 | 3 | [] | no_license | #include <AsciiCmd/Drawables/Rectangle.h>
#include <AsciiCmd/RenderTarget.h>
namespace AsciiCmd
{
Rectangle::Rectangle(Vector2<uint32_t> size)
{
shapeSize=size;
}
void Rectangle::Draw(RenderTarget* target)
{
Vector2<int32_t> counter;
for(counter.x=0; (uint32_t)counter.x < ... | true |
04a5ac88362a07b503c183f1c1ab878813b8b235 | C++ | seanamax/orchidflow | /test/unittest/test_tuple.cpp | UTF-8 | 1,857 | 3.109375 | 3 | [] | no_license | //
// Created by chris on 17-10-8.
//
#include "../lib/catch.h"
#include "../../include/tuple.h"
using namespace std;
using namespace orchidflow;
TEST_CASE("Test Tuple class", "test all Tuple class functions.") {
// test constructor function with {}。
Tuple<int> a({1, 2, 3});
REQUIRE(a[0] == 1);
REQUI... | true |
fb8d1182fc1694024b8f4d2c2b25e076199aaff1 | C++ | borgishmorg/bfu | /Sem_2/Lab_2/Task 1/include/Dish.hpp | UTF-8 | 484 | 2.703125 | 3 | [] | no_license | #ifndef __DISH__
#define __DISH__
#include <string>
namespace DataBaseNS
{
class Dish{
public:
Dish(std::string name, std::string type, std::string country);
~Dish();
const std::string & getName() const;
const std::string & getType() const;
const... | true |
89b1711d5bd8a1640e63c7746acef9b2ea9222f7 | C++ | edamame8888/edamame-s_ABC | /100-109/104/D/D.cpp | UTF-8 | 1,717 | 2.734375 | 3 | [] | no_license | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | true |
4d3b2d6eb20942df6835a26ea64a2757fc310f53 | C++ | israelfontes/Wall-e | /src/main.cpp | UTF-8 | 4,682 | 2.984375 | 3 | [] | no_license | #include <Arduino.h>
#include <Ultrasonic.h>
#include <Servo.h>
#include "DcMotor.hpp"
//Pino Servo
#define PIN_SERVO 10
//Pinos SR04
#define PIN_ECHO 9
#define PIN_TRIGGER 8
//Pinos Motor A
#define PINA1 2
#define PINA2 4
#define PIN_SPEED_A 3
//Pinos Motor B
#define PIN_B1 ... | true |
a1006d2f2911a7afd32435de44a82ccb42ab1bee | C++ | SamanGharatchorlou/RougeLike | /RougeLike/Source/Objects/Abilities/AbilityHandler.h | UTF-8 | 777 | 2.5625 | 3 | [] | no_license | #pragma once
class Ability;
class Actor;
class EffectPool;
class InputManager;
enum class AbilityType;
enum class AbilityState;
class AbilityHandler
{
public:
AbilityHandler() { }
void init(EffectPool* effectPool, std::vector<Actor*>* targets);
Ability* get(AbilityType type);
void add(Ability* ability);
con... | true |
62c72cc3a9063eb80bd22deb8b937459df4e0ef9 | C++ | cmosnick/hpc-work | /homework3/src/mosnickThread.cpp | UTF-8 | 2,692 | 3.140625 | 3 | [] | no_license | #include "MosnickThread.hpp"
#include <iostream>
mosnick::MosnickThread::MosnickThread (unsigned int numResults, unsigned int step, unsigned int totalLines, const std::vector<float> *queryFloats) :
_numResults(numResults), _step(step), _totalLines(totalLines), _queryFloats(queryFloats){
// std::cout << "Constructin... | true |
0beb274629f26aa6da4d7c95f870aff89b9b71d5 | C++ | SumuduKMadushanka/Sorting_Algorithm | /shell_sort.cpp | UTF-8 | 881 | 3.65625 | 4 | [] | no_license | #include "shell_sort.h"
void shell_sort(int array[], int size)
{
int gap = size/2;
while (gap > 0)
{
for (int i = gap; i < size; i++)
{
int tmp = array[i];
int j = i;
while (j >= gap && array[j - gap] > tmp)
{
array[j] = array[... | true |