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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b06929e766f910e6a00909896073dbdec1528d14 | C++ | yunfei-he/Udacity | /CarND-Path-Planning-Project/src/PathPlanner.cpp | UTF-8 | 7,322 | 2.953125 | 3 | [
"MIT"
] | permissive | #include "PathPlanner.h"
#include <iostream>
#include "const.h"
#include "Helper.h"
#include "spline.h"
PathPlanner::PathPlanner() {
reference_car_.speed_ = 0.0;
reference_car_.d_ = 1.5 * LANE_WIDTH; //put car in the middle
}
void PathPlanner::SetWayPoints(const std::vector<double>& xs, const std::vector<do... | true |
226520bd8dacb2ec58b5c16dc67e086345de3b8f | C++ | A-renderer/Viewing-and-Clipping | /main.cpp | UTF-8 | 4,984 | 2.59375 | 3 | [] | no_license | #include "FrameBuffer.cpp"
#include <cstring>
#include <termios.h>
#include <fstream>
#include "assets.h"
using namespace std;
FrameBuffer FB;
bool quit = false;
vector<Polygon> map;
Window window;
int key;
int kbhit(void);
Polygon matrixToPolygon(int object[][2], int col);
void drawMap();
void redraw();
void move(i... | true |
bcc521cc088e152d2d4d652abf84a2f5709fa742 | C++ | jessiepao14/CPSC350_Assignment5 | /Student.hpp | UTF-8 | 1,385 | 3.28125 | 3 | [] | no_license | #ifndef _STUDENT_HPP_
#define _STUDENT_HPP_
#include <iostream>
#include <fstream>
using namespace std;
class Student
{
private:
int id;
string name;
string level;
string major;
double gpa;
int advisorId;
public:
Student();
Student(int idNumber, string studentName, string studentLeve... | true |
7a81bf29eb520f23b8cc67ad85c1a3eae318d163 | C++ | anstjaos/KIT-Homeworks | /2학년/자료구조2/1차과제/3/main.cpp | UHC | 398 | 3 | 3 | [] | no_license | /* --- ڿ binary search tree --- */
/* --- ۼ: 蹮, й: 20130162 --- */
/* --- 333 lines, ۼ: 2017. 9. 9. --- */
#include "Tree.h"
void main()
{
Tree<string> t;
string input;
cout << "ڿ Էϼ ( 0) : ";
while (1)
{
cin >> input;
if (input == "0") break;
t.createNode(input);
}
t.showAll();
} | true |
7d05f7c7858d44fccb044ed09d31694456f3ae24 | C++ | Itsposs/cppprimer | /ch09/vector3.cc | UTF-8 | 624 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <chrono>
#include <vector>
int main(int argc,char *argv[])
{
using namespace std::chrono;
auto begin = high_resolution_clock::now();
std::vector<int> ivec;
for(size_t ix = 0;ix != 24;++ix)
{
ivec.push_back(ix);
}
ivec.reserve(48);
std::cout << "size:" << ivec.size()
<< "... | true |
9fe3fa543b2eee0cf426b15189919bbbfdd60037 | C++ | jainsourav43/DSA | /CP/jfhtf.cpp | UTF-8 | 1,801 | 3.15625 | 3 | [] | no_license | #include<iostream>
#include<time.h>
#include<cmath>
#include <stdlib.h>
using namespace std;
typedef
struct node
{
int data;
struct node *next;
} *lptr;
void display1(lptr l)
{
lptr t=l;
cout<<t->data<<" ";
t=t->next;
while(t!=l)
{
cout<<t->data<<" ";
t=t->next;
}cout<<endl;
}
void... | true |
270c3f496056478f014277b39b95421e97e57ac1 | C++ | mjyc/spencer_people_tracking | /detection/laser_detectors/srl_laser_features/src/srl_laser_features/features/feature09.cpp | UTF-8 | 839 | 2.578125 | 3 | [
"BSD-2-Clause"
] | permissive | #include <srl_laser_features/features/feature09.h>
namespace srl_laser_features {
void Feature09::evaluate(const Segment& segment, Eigen::VectorXd& result) const
{
result = Eigen::Vector1d::Zero();
const size_t numPoints = segment.points.size();
if (numPoints > 2) {
double std_x = 0.0;
double std_y = 0.0;
... | true |
55077213a98ba3abd11256ddcbb17b2b450f1714 | C++ | zll5267/save-daily-exercise | /cpp/trigraphs/Trigraphs.cpp | UTF-8 | 951 | 2.78125 | 3 | [] | no_license | /*
Before any other processing takes place, each occurrence of one of the following sequences of three characters
(“trigraph sequences”) is replaced by the single character indicated in Table 1.
----------------------------------------------------------------------------
| trigraph | replacement | trigraph |... | true |
9bc1b30f872340fb3868e2f53a31b28bba4908b0 | C++ | sysfce2/Arcade_Bagman | /src/sys/ThreadSafeContainer.hpp | UTF-8 | 2,424 | 2.6875 | 3 | [] | no_license | /*---------------------------------------------------------------------------*
* (C) 2004 - JFF Software *
*---------------------------------------------------------------------------*/
#ifndef THREADSAFECONTAINER_H
#define THREADSAFECONTAINER_H
/*------------*
* Used units *
*-------... | true |
b7ed97cd2de563ca1a453c734b895315b290d40d | C++ | leader120/USC-EE569 | /hw2/problem3/part1/problem3_part1.cpp | UTF-8 | 7,479 | 3.265625 | 3 | [] | no_license | /*
Name: Armin Bazarjani
USC ID: 4430621961
USC Email: bazarjan@usc.edu
Submission Date: 2-23-21
cpp file for Problem 3-part 1 (Separable Error Diffusion)
*/
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <vector>
#include <fstream>
#include <cmath>
#include <cstring>
#inc... | true |
ef20e960c7b60662773afff2bf6ba241403e2139 | C++ | Sudarshan-Kulkarni/Huffman-Compressor | /main.cpp | UTF-8 | 730 | 3.390625 | 3 | [
"MIT"
] | permissive | #include "huffman.h"
bool fileExists(string fileName)
{
fstream infile(fileName.c_str());
return infile.good();
}
int main(int argc, char *argv[])
{
if(argc!=3)
{
cout<<"Wrong number of arguments provided."<<endl<<"Usage:'./app.exe <-(c/d)> <filepath>";
return -1;
}
string mod... | true |
377aa34fc45ca857db3129b9a10f7e4021feaf8c | C++ | Xiaojiean/ros2_tutorial_collection | /tutorial_sync_service/src/service_server.cpp | UTF-8 | 786 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | #include "rclcpp/rclcpp.hpp"
#include "std_srvs/srv/trigger.hpp"
class ServiceServer: public rclcpp::Node
{
public:
ServiceServer():Node("sample_server")
{
server_ = create_service<std_srvs::srv::Trigger>(
"sample_service",
std::bind(&ServiceServer::service_callback, this, std::placeholders::_1, std::placeh... | true |
1fdb859b4f7edd46eb902a56bef82cf115c73e2a | C++ | md143rbh7f/competitions | /codeforces/121/demonstration.cpp | UTF-8 | 568 | 2.625 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <utility>
using namespace std;
pair<int,int> c[100005];
int main()
{
int n, k;
long long b;
cin >> n >> k >> b;
for( int i = 0; i < n; i++ )
{
cin >> c[i].first;
c[i].second = i + 1;
}
sort( c, c + n - 1 );
reverse( c, c + n - 1 );
long long tot = 0;
f... | true |
30584fe3093fd15d21ea81056119ed7636fad032 | C++ | llalexandru00/ICPC-Training | /Codeforces/#451 Div. 2/A - Rounding.cpp | UTF-8 | 162 | 2.59375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int a;
int main()
{
cin >> a;
if (a % 10 <= 5)
cout << a / 10 * 10;
else
cout <<(a / 10 + 1) * 10;
return 0;
} | true |
9ef8a3ce7caa490d59cca7ef18874f092dc10c9e | C++ | MukulR/Turning-point | /worlds/src/pom.cpp | UTF-8 | 1,249 | 2.578125 | 3 | [] | no_license | #include "pom.hpp"
#include "commons.hpp"
#include "motordefs.hpp"
#include "robot_driver.hpp"
POM::POM(MotorDefs *md, RobotDriver *rd, bool ra, Commons *ca){
mtrDefs = md;
robotDriver = rd;
redAlliance = ra;
commonAutons = ca;
}
POM::~POM() {}
void POM::getPlatformBallAndAlignAgainstFence(){
// Dri... | true |
82e804904b136837496f40ece8028d1fecbee31e | C++ | ihorkobreniuk/repos | /lab1/lab1-1/lab1-1.cpp | UTF-8 | 449 | 2.765625 | 3 | [] | no_license |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d, e, f;
a = sizeof(int);
b = sizeof(short);
c = sizeof(long);
d = sizeof(char);
e = sizeof(float);
f = sizeof(double);
//sizeof рассчитывает кол-во байт в операторе
return 0;
}
//f11 - Шаг с заходом. f10 - ... | true |
ff7d7fd5ad08070370922b67acb2025b6de08c05 | C++ | tanvirhossain33/uva | /10327 - Flip Sort.cpp | UTF-8 | 422 | 3.109375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int num,ary[1000],i,j,count,temp;
while(cin >> num){
for(i = 0; i < num; i++)
cin >> ary[i];
count = 0;
for(i = 0; i < num; i++){
for(j = 1; j < num; j++){
if(ary[j-1] > ary[j]){
temp = ary[j];
ary[j] = ary[j-1];
ary[j-1] = temp;
... | true |
f6a803c80ee8c2a5cc144c5b1454159de4e68f2c | C++ | Puttichai/projecteuler | /src/p0037.cpp | UTF-8 | 1,754 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include <stdlib.h> // atoi
#include <vector>
#include <string>
#include <algorithm>
bool IsPrime(long target) {
if( target < 2 ) {
return false;
}
if( target == 2 ) {
return true;
}
if( target % 2 == 0 ) {
return false;
}
for( long i = 3; i < target/2; i += 2 ) {
if... | true |
187b1715bb0d2e68680e1aeaed1f52bebdc2aaf0 | C++ | banghartOSU/165 | /week5/stringSort.cpp | UTF-8 | 2,830 | 4.21875 | 4 | [] | no_license | /*************************************************************************************
* Author: Thomas Banghart
* Date: 04/27/2019
* Description: stringSort sorts an array of C++ strings (std::string) into dictionary order.
* It takes two parameters, an array of strings, and the size of the array. Two helper fu... | true |
37d6ccfed4d5ece1f2cc784f23b74f91f79a1bf4 | C++ | Daniel521/raytracing | /p_raytracing2/Matrix.h | UTF-8 | 7,994 | 3.328125 | 3 | [] | no_license | #pragma once
#include "Vector.h"
#include "Misc.h"
namespace RT {
template <typename scalar_type, size_t HEIGHT, size_t WIDTH>
class Matrix {
public:
// Type aliases
using same_type = Matrix<scalar_type, HEIGHT, WIDTH>;
using row_type = Vector<scalar_type, WIDTH>;
using row_container_type = std::array<row_... | true |
4e902da7f7d2913e706b64f81ada4af58ccaac2d | C++ | suhwoo/algo_study_alone | /백준/2839_deliver_sugar_dp.cpp | UTF-8 | 895 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
unsigned int bagNum[5001];
int main() {
unsigned int totalWeight;
cin >> totalWeight;
bagNum[3] = 1;
bagNum[5] = 1;
for (int index = 6; index <= totalWeight; index++) {
if (index % 5 == 0) {
bagNum[index] = bagNum[index-5] + 1;
}
else if (index... | true |
88630a590c4bff91a9c5ed91ce93e53cb3e95eb6 | C++ | zombre98/zia | /src/server/DlWrapper.hpp | UTF-8 | 1,856 | 2.796875 | 3 | [
"Unlicense"
] | permissive | #pragma once
#ifdef WIN32
#include <windows.h>
#else
#include <dlfcn.h>
#endif
#include <string>
namespace zia {
class DlWrapper {
public:
DlWrapper() = default;
/**
* Construct and load
* @param file the path to the file
*/
DlWrapper(const std::string &file) {
open(file);
}
/**
* Destructor
*/
... | true |
abac975bc5d77a8a441132d39bfd7a995d9a7acb | C++ | HunterKonoha/ESCCore | /ESCCore/src/Data/Transform.cpp | UTF-8 | 3,148 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "Transform.h"
#include "../Entity/Entity.h"
#include <boost/range/adaptor/indexed.hpp>
gsl::Transform::Transform(const boost::uuids::uuid & Obj) :self_(Obj) {
}
gsl::Transform::Transform(Transform && Obj) {
this->self_ = std::move(Obj.self_);
this->center_ = std::move(Obj.center_);
this->child_ = std:... | true |
3245b6d2ce7af88fabab68eaf45d6de9c245043f | C++ | RGoralewski/pithon | /Pithon/Rect.cpp | UTF-8 | 1,016 | 3.03125 | 3 | [] | no_license | #include "Rect.h"
#include <SDL2_image/SDL_image.h>
#include <iostream>
Rect::Rect(int _w, int _h, int _r, int _g, int _b, int _a) :
w(_w), h(_h), r(_r), g(_g), b(_b), a(_a)
{
}
Rect::Rect(SDL_Renderer *renderer, int _w, int _h, const std::string &image_path) :
w(_w), h(_h)
{
texture = nullptr;
... | true |
ce2e8181183967b400170f05bb1f0fcc6e0f15db | C++ | kirill146/CudaMemoryAnalyzer | /CudaMemoryAnalyzer/src/Operator.h | UTF-8 | 2,472 | 2.71875 | 3 | [] | no_license | #pragma once
#include "Expression.h"
enum UnaryOperation {
PRE_INCREMENT,
PRE_DECREMENT,
POST_INCREMENT,
POST_DECREMENT,
NEGATE,
NOT, // ~
ADDR_OF,
DEREF,
LNOT, // !
REAL,
IMAG,
UO_UNDEFINED
};
enum BinaryOperation {
ASSIGN,
ADD,
SUB,
MUL,
DIV,
R... | true |
69c9ba2aef5e83c641ff22779fb1a94269a85837 | C++ | OronW/Genetic-Lab4 | /Genetic.cpp | UTF-8 | 12,455 | 2.625 | 3 | [] | no_license | #include <string>
#include "Genetic.h"
#define TARGET std::string("Hello world!")
#define BULLSEYE 2 * TARGET.size() * TARGET.size()
#define MAXITER 16384
#define ELITISIM_RATE 0.2f
#define MUTATION_RATE 0.25f
#define MUTATION RAND_MAX * MUTATION_RATE
#define MAXK 20
#define LOST 8
#define S... | true |
60b5137882edf37a63b263b923ebb4ed4ee2f1dc | C++ | keineahnung2345/leetcode-cpp-practices | /1382. Balance a Binary Search Tree.cpp | UTF-8 | 1,302 | 3.53125 | 4 | [] | no_license | //Runtime: 188 ms
//Memory Usage: 52 MB
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void inOrder(TreeNode* node, vector<int>& nums){
... | true |
4e877b1979ac214ec3276321862441290c738e75 | C++ | SerenityOS/serenity | /Userland/Libraries/LibWeb/HTML/ListOfAvailableImages.cpp | UTF-8 | 2,019 | 2.71875 | 3 | [
"BSD-2-Clause"
] | permissive | /*
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/HTML/DecodedImageData.h>
#include <LibWeb/HTML/ListOfAvailableImages.h>
namespace Web::HTML {
ListOfAvailableImages::ListOfAvailableImages() = default;
ListOfAvailableImages::~ListOfAvailab... | true |
d85b313ef4a5b3549b62c79347836fbb6c3ff04c | C++ | petrmanek/fel-master-thesis | /gen/main.cpp | UTF-8 | 1,459 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <random>
#include <cmath>
#include <cal/cal.h>
int track_width(double k, double wmax)
{
double e = 2.5 * k - 0.3;
double w = wmax * std::exp(-e*e);
return std::max(0, std::min(256, (int) w));
}
kev_t track_energy(double k, double l, double emax)
{
double e = 4.0 * l;
... | true |
c096d6ed8639ad5fa8e77369f4b1669d29ad5d9f | C++ | kailashkai28/programs- | /Cplusplus/p12.cpp | UTF-8 | 803 | 3.25 | 3 | [] | no_license | #include<iostream>
#include "head12.h"
using namespace std;
int main(){
Employee e1;
cout<<e1;
Employee e2(e1);
cout<<e2;
Employee e3[5];
int ch,n;
do{
cout<<"\n\t-0-0-0-0Employee Menu-0-0-0-0\n\t\t1.Add details\t2.Display details\t3.Exit\nChoose an option(1-3):";
cin>>ch;
switch(ch){
case 1:
... | true |
9409284cfd73e6ed6bda5c406e34e76132601b1e | C++ | GordilloXavi/pro1 | /consolidation/X17276.cc | UTF-8 | 814 | 3.25 | 3 | [] | no_license | #include<iostream>
#include <vector>
using namespace std;
typedef vector< vector<int> > Matrix;
bool diags(Matrix& m, int r, int c){
int rows = m.size();
int cols = m[0].size();
bool a = true;
int i = r, j = c;
while(i<rows and j < cols){
if()
i++;
j++;
}
}... | true |
c27d42245fbe2ef3f7984f10bab7f76f4782af3e | C++ | d01000100/tank_game | /GameServer/TankGameStuff/TankControls.cpp | UTF-8 | 1,544 | 2.890625 | 3 | [] | no_license | #include "TankControls.h"
#include "cGameBrain.h"
#include <string>
void cTankControls::updateTank(std::string tankName, UserInputMessage pressedKeys)
{
std::map<std::string, cGameObject*>::iterator itGO;
itGO = ::g_map_GameObjects.find(tankName);
if (itGO != ::g_map_GameObjects.end())
{
cGameObject* player = it... | true |
de792ee9b6469c18bd6a07a749aefe35060f210a | C++ | Shailesh-Tripathi/cuda_helpers | /gpu_sgemm/main.cpp | UTF-8 | 1,966 | 3.109375 | 3 | [] | no_license | /* Author : Shailesh Tripathi
* Sample code for invoking the gpu_sgemm wrapper function
* command to compile : nvcc -o res main.cpp fun.cu -lcudart -lcublas
*/
#include <stdio.h>
#include <stdlib.h>
#include "fun.h"
/* Matrix size */
#define N (4)
#define K (3)
#define M (2)
/* Main */
int main(int argc, char **a... | true |
b4a3b1b99f632c97aa0e43714d77fb15fc9a4c6b | C++ | Biendeo/Wolf3D-Clone | /MapViewer/src/Framebuffer.cpp | UTF-8 | 981 | 3.421875 | 3 | [] | no_license | // Framebuffer.cpp
//
// Holds the data to determine a frame (as well as providing quick functions
// for modifying and accessing the buffer).
#include "Framebuffer.h"
Framebuffer::Framebuffer(uint16_t width, uint16_t height) {
this->data = nullptr;
Resize(width, height);
}
Framebuffer::~Framebuffer() {
delete[] ... | true |
556e6a8ebefaa788971bad2005cc0f05b293c981 | C++ | leandrovianna/programming_contests | /URI/2560_splay.cpp | UTF-8 | 6,008 | 3.34375 | 3 | [] | no_license | // URI - Surf Aquático - 2560
#include <bits/stdc++.h>
using namespace std;
template <typename T>
class SplayTree {
template <typename U>
struct Node {
U key;
Node *left, *right;
Node *parent;
int count;
Node(U key) :
key(key), left(nullptr), right(nullptr), parent(nullptr), count(1) {}
... | true |
a9794af71ddd1e40f9eb6b90a565a613aa0d67ed | C++ | alexloboda/SVDFunctions | /src/vcf_parser.cpp | UTF-8 | 12,391 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "include/vcf_parser.h"
#include <algorithm>
#include <sstream>
#include <type_traits>
#include <Rcpp.h>
namespace {
using namespace vcf;
using std::istream;
using std::vector;
using std::string;
using std::find;
using std::pair;
using std::stoi;
// Rcpp conflict
using vc... | true |
5912d670d62409fb884167ebf4839046cf55b39d | C++ | ali-ramadhan/cToan | /tests/movingaround/main.cpp | UTF-8 | 15,352 | 2.828125 | 3 | [] | no_license | #include <stack>
#include <vector>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include "SDLWrap_SDLEngine.hpp"
#include "SDLWrap_Surface.hpp"
#include "SDLWrap_Display.hpp"
#include "SDLWrap_Font.hpp"
#include "SDLWrap_Color.hpp"
#include "SDLWrap_FontSurface.hpp"
#include "SDLWrap_Enums.hpp"
#in... | true |
45d251d1626241fdfef18c1af3b47f0a2ea1149b | C++ | firewood/topcoder | /atcoder/agc_015/b.cpp | UTF-8 | 438 | 2.671875 | 3 | [] | no_license | // B.
#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <vector>
using namespace std;
typedef long long LL;
int main(int argc, char *argv[])
{
string s;
cin >> s;
LL n = s.length(), ans = 0;
for (LL i = 0; i < n; ++i) {
if (s[i] == 'U') {
ans += (n - ... | true |
71e36b7760de0866b72bf4436d5ad7f7f5d6bd03 | C++ | Tainel/cpn | /source/algorithms/dynamic_programming.cpp | UTF-8 | 712 | 3.078125 | 3 | [] | no_license | /// SOURCE - DYNAMIC PROGRAMMING
/** Source file for Dynamic Programming. */
#ifndef __DYNAMIC_PROGRAMMING__
#define __DYNAMIC_PROGRAMMING__
//_____________________________________________________________________________
// ------ IMPLEMENTATION ------ //
/** Returns dp of size k+1 such that dp[i] is the maximum pos... | true |
88ccb2e22e563ed7b9a481e0c9280dc0307f8ba1 | C++ | Bootz/BlueCodes | /FunScripts/XpForPvp.cpp | UTF-8 | 1,017 | 2.6875 | 3 | [] | no_license | /*
Author: Chase(http://wowemuf.org)
*/
class System_Xpforpvp : public PlayerScript
{
public:
System_Xpforpvp() : PlayerScript("System_Xpforpvp") {}
void OnPVPKill(Player* killer, Player* killed)
{
uint32 killerlvl = killer->getLevel();
uint32 killedlvl = killed->getLevel();
int32 diff = killerlvl-... | true |
cc557ab9dbaca38bae1fcf418649b2653203c381 | C++ | Pbra1484/DataStructures | /DataStructures/Controller/DataStructureController.cpp | UTF-8 | 9,966 | 3.25 | 3 | [] | no_license | //
// DataStructureController.cpp
// DataStructures
//
// Created by Brashear, Patrick on 2/8/17.
// Copyright © 2017 Brashear, Patrick. All rights reserved.
//
#include "DataStructureController.hpp"
#include <iostream>
#include "../Model/IntNodeArray.hpp"
#include "../Model/Array.hpp"
#include "../Model/List.hpp"... | true |
66225d73a1311455583840a22f164841ab4f8f8d | C++ | oshogun/Dogoo | /src/Player.cpp | UTF-8 | 1,492 | 2.984375 | 3 | [
"Unlicense"
] | permissive | #include "Player.h"
Player::Player() : abilities(6)
{
}
void Player::setName (const std::string _name)
{
name = _name;
}
std::string Player::getName()
{
return name;
}
void Player::setHP (int hp)
{
HP = hp;
}
void Player::setMP(int mp)
{
MP = mp;
}
int Player::getHP()
{
return HP;
}
int Player::getMP()
{
return... | true |
21b2e74ffeca7225e10eb0d18d8cdd9b07d0bcb3 | C++ | NikolausDemmel/KTH-AI-Project | /opposition/mnp/board.cc | UTF-8 | 15,339 | 2.828125 | 3 | [] | no_license | /*
* board.cc
*
* Created on: 20.09.2011
* Author: astridrupp
*/
#include <algorithm>
#include <sstream>
#include <queue>
#include <vector>
#include "board.h"
namespace mnp {
////////////////////////////////////////////////////////////////////////////////
// CONSTRUCTION
//////////////////////////////////... | true |
6450ea2c5e17bad533336dbaa150936b2894ee42 | C++ | cRYP70n-13/Algorithms | /Data_Structures/C++/BinaryTree/BinaryTree.cpp | UTF-8 | 584 | 3.71875 | 4 | [] | no_license | #include <iostream>
struct Node {
int val;
struct Node *left;
struct Node *right;
};
struct Node *newNode(int data)
{
struct Node *new_node = malloc(sizeof(struct Node));
new_node->val = data;
new_node->left = NULL;
new_node->right = NULL;
return (new_node);
}
int main(void)
... | true |
55114a76b1972e4b815e812da1589985f85b68ba | C++ | axxonite/algorithms | /EPI/Solutions/25_HonorRoll/25.13_binary_tree_postorder_traversal_iterative_solution.cpp | UTF-8 | 1,286 | 3.328125 | 3 | [] | no_license | // Copyright (c) 2015 Elements of Programming Interviews. All rights reserved.
#include "stdafx.h"
#include "binary_tree_prototype.h"
namespace Solutions
{
// A few key things to be able to write this in the most compact and elegant way:
// There's no need for a "current" pointer. Just push the current at the top o... | true |
473f948a808bae2ddf3857b25c6e1abe5a8d7883 | C++ | lyw1204/Racoon-Project | /scanner_optimizing/e_TrickArsenal.ino | UTF-8 | 1,149 | 2.625 | 3 | [] | no_license | class TrickArsenal{
private:
byte _pin1;
byte _pin2;
byte _pin3;
public:
TrickArsenal(byte dPIN1, byte dPIN2, byte dPIN3){
_pin1 = dPIN1;
_pin2 = dPIN2;
_pin3 = dPIN3;
pinMode(_pin1, OUTPUT);
pinMode(_pin2, OUTPUT);
pinMode(_pin3, OUTPUT);
}
void deploy... | true |
29e1df2cedcb6aaef0ac6a813ee0b8c582d7dfde | C++ | DenysenkoIvan/toy-compiler | /source/Tokenizer.cpp | UTF-8 | 4,602 | 3.0625 | 3 | [] | no_license | #include "Tokenizer.h"
Tokenizer::Tokenizer(const std::filesystem::path& input_file)
: m_stream(input_file)
{
scan_next_token();
}
Token& Tokenizer::current() {
return m_token;
}
Token& Tokenizer::next() {
scan_next_token();
return m_token;
}
void Tokenizer::scan_next_token() {
Position pos = { m_stream.line(... | true |
afc6ed8f8e6c449f4c28572b5b0ba5f5d52714f1 | C++ | leandro1623/Punto-movible- | /puntoM.cpp | UTF-8 | 554 | 3.046875 | 3 | [] | no_license | #include<iostream>
#include<iomanip>
#include"puntoM.h"
using std::setw;
void puntoM::set_x(int x){
this->x=x;
}
void puntoM::set_y(int y){
this->y=y;
}
int puntoM::get_x(){
return this->x;
}
int puntoM::get_y(){
return this->y;
}
void puntoM::limpiar_mapa(){
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
... | true |
03eee56c6d79184e5be72c0764557addd550cbe6 | C++ | dtbinh/crapengine | /source/core/unittests/source/delegates.cpp | UTF-8 | 3,299 | 2.8125 | 3 | [
"MIT"
] | permissive | #include "delegates.h"
#include "UnitTest++.h"
#include "logger.h"
namespace
{
TEST( AnnounceTestDelegates )
{
CRAP_DEBUG_LOG( LOG_CHANNEL_CORE| LOG_TARGET_COUT| LOG_TYPE_DEBUG, "Starting tests for \"delegates.h\"" );
}
int dele_func( void )
{
return 1;
}
int dele_add( int val )
{
return 1+val;
}
lon... | true |
d6f32c0f8db6d9851bf86f65a609d3769bf6674a | C++ | melancholymans/PocketCplusplus | /chapter5/264.cpp | UTF-8 | 191 | 2.765625 | 3 | [] | no_license | #include <iostream>
using namespace std;
/*
int main(void)
{
wchar_t s;
char sc;
cout << "wchar size= " << sizeof(s) << " char size= " << sizeof(sc) << endl;
getchar();
return 0;
}
*/
| true |
c549443412147b24667ff0a762efa0b1993d7a72 | C++ | DetrembleurArthur/engineTools | /unnamed-engine/windows-no-last-update/engine/include/CircleEntity.hpp | UTF-8 | 947 | 2.703125 | 3 | [
"MIT"
] | permissive | #ifndef CIRCLEENTITY_HPP
#define CIRCLEENTITY_HPP
#include "Entity.hpp"
#include "Image.hpp"
#include "Animated.hpp"
class CircleEntity : public Entity<sf::CircleShape>, public Animated
{
private:
protected:
public:
static const float DEFAULT_RADIUS;
CircleEntity();
CircleEntity(float x, float y, Origin origin=TOP_... | true |
b32d50d36614a2203f4d4be0eff646ab6233eec2 | C++ | czczc/LArViewer | /MicroBooNE/event/MCGeometry.h | UTF-8 | 1,130 | 2.59375 | 3 | [] | no_license | #ifndef MCGEOMETRY_H
#define MCGEOMETRY_H
#include "MCChannel.h"
#include <map>
#include "TString.h"
#define NCHANNELS 8254
class MCGeometry {
private:
MCGeometry();
MCGeometry(MCGeometry const&) {};
void operator=(MCGeometry const&) {};
public:
MCChannel channels[NCHANNELS];
TString mapFileNa... | true |
e8b02be86cf6861a87140438bbfa148a0b71029b | C++ | ysluckly/Hello-Linux | /C++/Project2_ConcurrentMemoryPool/CentralCache.h | GB18030 | 1,161 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include "Common.h"
// 1.central cacheһϣӳspan
// 2.ÿӳСempty spanһУnonempty spanһ
// 3.Ϊ˱֤ȫֻΨһcentral cache౻Ƴ˵ģʽ
class CentralCache
{
public:
static CentralCache* GetInstance(){
return &_inst;
}
// ĻȡһĶthread cache
size_t FetchRangeObj(void*& start, void*& end, size_t n, size_t byte... | true |
008eb963f6632a9a0d4647a1cc1fedba5bb6217b | C++ | garcia-pedro-hr/ComponentGameSystem | /Actor.cpp | UTF-8 | 1,398 | 3.078125 | 3 | [] | no_license | #include "Actor.h"
#include <cassert>
Actor::Actor()
{
} // EOConstructor
Actor::Actor(std::string p_name, int p_ID ) :
m_name(p_name), m_actorID(p_ID)
{
} // EOConstructor
Actor::~Actor(void)
{
Destroy();
} // EODestructor
void Actor::Destroy(void)
{
// Nunca chame explicitamente o destrutor.
f... | true |
d183dacd80772c0d8db5e560160dfd1cd168ebd7 | C++ | adaapp/primers-portfolio-e457 | /include/thursday.h | UTF-8 | 1,847 | 3.734375 | 4 | [] | no_license | #include <iostream>
#include<thread>
#include <chrono>
using namespace std;
void sleep(int seconds = 10) { //sleep for 10 seconds by default
int milliseconds = seconds * 1000; //calculate the number of milliseconds from the seconds provided
cout << "sleep - thread: " << this_thread::get_id() << " started\n";
thi... | true |
b4f474f270beb9873eeeee77af968afc32fecaf6 | C++ | sxudai/myWebSever | /asyncLogging.cpp | UTF-8 | 4,966 | 2.96875 | 3 | [] | no_license | #include <ctime>
#include <chrono>
#include <functional>
#include "logFile.h"
#include "asyncLogging.h"
asyncLogging::asyncLogging(const string& basename,
size_t rollSize,
int flushInterval)
: flushInterval_(flushInterval),
running_(true),
b... | true |
e89342cd1786f58f6d0ca0c6255ddfdd0d0dd807 | C++ | wjakubowski/akademia | /cmake-gtest-master/src/rational.h | UTF-8 | 1,500 | 3.265625 | 3 | [] | no_license | #ifndef RATIONAL_H
#define RATIONAL_H
#include <exception>
#include <ostream>
//liczby wymierne
//sprowadzanie do ujednoliconej postaci:
//najmiejszy wspulny dzielnik
//nie zewoeosc mianownika
//jak mianownik <0 mnozymy gore i dol przez -1
int nwd(int i1, int i2);
int nww(int i1, int i2);
class Rational
{
int... | true |
f2a7d95308d7652e3438764f7ca4a7d64e7a1a03 | C++ | slayerwalt/LeetCode | /OJ/leet699/leet699.cpp | UTF-8 | 1,281 | 2.890625 | 3 | [] | no_license | /*
leet699
*/
#include <iostream>
#include <tuple>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <uti... | true |
b3781b69ca97cd2dc582ddb6af563d262f3d1be3 | C++ | kevcywu/Cpp-Tutorial-Sample | /Concepts/Linkedlist/intlinkedlist4/intlist4.cpp | UTF-8 | 1,609 | 3.703125 | 4 | [] | no_license | #include "stdafx.h"
#include "IntList4.h"
#include <iostream>
IntList4::Node::Node(int n): data(n), next(nullptr) {
std::cout << "Creating node " << data << " (" << reinterpret_cast<uintptr_t>(this) << ")\n";
}
IntList4::Node::~Node() {
std::cout << "Destroying node " << data << " (" << reinterpret_cast<uintptr_t>(... | true |
e98a1d31ed07b5ed95bf9b7c0054a289f13ececb | C++ | Grishameister/TestTask | /include/Parser.h | UTF-8 | 922 | 2.75 | 3 | [] | no_license | #ifndef TESTTASK_PARSER_H
#define TESTTASK_PARSER_H
#include <string>
struct Table {
std::string name_;
std::string date_;
std::string hours_worked_;
std::string car_;
std::string StringTable() {
std::string res;
res.reserve(name_.length() + date_.length() + hours_worked_.length()... | true |
db898ef8a0a8bbec76b5c5a76f59644da3ea1cb9 | C++ | humeaua/CVATools | /CVATools/PutSpread.cpp | UTF-8 | 963 | 2.921875 | 3 | [] | no_license | //
// PutSpread.cpp
// CVATools
//
// Created by Alexandre HUMEAU on 28/09/13.
//
//
#include "PutSpread.h"
#include "Require.h"
namespace Finance
{
namespace Payoff
{
PutSpread::PutSpread(double dStrike, double dLeftSpread, double dRightSpread) : dStrike_(dStrike), dLeftSpread_(dLeftSpread), dRigh... | true |
665c2e956d091943f4896491ddef9b2c52ece545 | C++ | sejal2712/OOPM-CI-305-_Assignments | /p7_quadratic_eq.cpp | WINDOWS-1252 | 874 | 3.6875 | 4 | [] | no_license | //Write a Program for Solving Quadratic Equation
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double a,b,c,x1,x2;
cout<<"enter coefficient a,b and c of Quadratic Equation of form (ax^2 + bx + c = 0) = ";
cin>>a>>b>>c;
cout<<"equation : "<<"("<<a<<" * x * x) + ("<<... | true |
e1b098f7b6aed78d747a9c04e5c9405fd8181fc5 | C++ | stungeye/Advent-of-Code-2020-CPP | /BinaryBoarding/BinaryBoarding/PassengerRoster.cpp | UTF-8 | 984 | 3.109375 | 3 | [] | no_license | #include "PassengerRoster.h"
#include <algorithm>
#include <iterator>
PassengerRoster::PassengerRoster(const std::vector<std::string>& codes) {
std::transform(codes.cbegin(), codes.cend(), std::back_inserter(boarding_passes),
[](auto code) -> BoardingPass { return BoardingPass(code); });
... | true |
3c44937a0afefe03a94099292d890dabfbf8b91d | C++ | Aiyuan-h/programming-language | /c++/20140222/20140222/20140222.cpp | UTF-8 | 323 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include<cstring>
int main()
{
using namespace std;
char ch;
int space =0;
int total =0;
cin.get (ch);
while(ch!='.')
{
if(ch==' ')
++space;
++total;
cin.get(ch);
}
cout<<space<<"space,"<<total;
// cout<<""endl<<cout<<"\n";
cin.get();
cin.get();
return 0;... | true |
1597e338020cd6aa88088066cd049fa04bf9e2a3 | C++ | hoklavat/beginner-algorithms | /MORE/Dynamic(NumberOfWays).cpp | UTF-8 | 678 | 4.0625 | 4 | [] | no_license | //Dynamic(NumberOfWays)
//Task: find number of ways to obtain given number by summing specified numbers. numbers can be used multiple times.
//Reference: dynamic programming.
#include <iostream>
using namespace std;
//numbers used to reach n are 3, 5 and 10.
int count(int n){
int T[n+1];
int i;
for(int j = 0; j <... | true |
4ea0dfaafbc5c0a6f350e8c6750b1eff88ff6e4b | C++ | Doyarun/TestTask | /TaskThree/Time.cpp | UTF-8 | 2,280 | 3.390625 | 3 | [] | no_license | #include "Time.h"
using namespace std;
Time::Time() : _hour(0), _minute(0), _second(0) {}
Time::Time(int h, int m, int s) : _hour(h), _minute(m), _second(s) { optimize(); }
void Time:: optimize(){
_minute += _second / 60;
_second = _second % 60;
_minute += ((_second < 0) ? -1 : 0);
_second += ((_secon... | true |
eb6d5a01b0e0851988f519bf7f27c4d93a9167c9 | C++ | m-aleksei/cpp-programs | /1-montecarlo(openmp).cpp | UTF-8 | 690 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <ctime>
#include <math.h>
#include <omp.h>
using namespace std;
double a,b;
double I,S,x,y,f;
int K;
const int N = 100*1024*1024;
double func(double xx)
{
double ff = xx*xx + 3;
return ff;
}
void main()
{
cout<<"Input a = "; cin>>a;
clock_t time = clock();
b = func(a);
K = 0;
omp... | true |
f1d54fcb533781577974c72d148b87bb35e5a7a7 | C++ | hellowincci/C-Simple-program-using-pointers | /main.cpp | UTF-8 | 6,537 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <string>
#include <cstdlib>
#include <locale>
using namespace std;
class Users
{
public:
Users();
string userName;
string accessR;
};
Users::Users()
{
userName[20]='\0';
}
class Files
{
public:
string fileName;
list<Users> users;
Files();
};
Files::Files()
{
fil... | true |
7800300a3ed7c68ab4c745898af31b0c23913ae7 | C++ | KietNguyen10112000/FileSharingSystem | /FileSharing/FileSystemProtection/FileFolder.h | UTF-8 | 18,087 | 2.78125 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
#ifdef _DEBUG
#define Throw(msg) throw msg L"\nThrow from File \"" __FILEW__ L"\", Line " _STRINGIZE(__LINE__) L"."
#else
#define Throw(msg) throw msg
#endif // DEBUG
#include "... | true |
dc31bf3dc3b8d24b0e218d05baa97a4a8da58b7f | C++ | zhangxu128/Linux | /quick.cpp | UTF-8 | 1,037 | 4 | 4 | [] | no_license | #include <iostream>
using namespace std;
void print(int array[],int size){
for(int i = 0 ; i < size; i++){
cout<<array[i]<<" ";
}
cout<<endl;
}
void QuickSort(int array[],int left,int right){
int i = left;
int j = right;
int privot = array[left]; //保存基准值
if(i < j){
while(i < j){
//从后往前找小于基准值的数
w... | true |
a23011f56aadd66cbd4dbc36811da53c28056be7 | C++ | skyformat99/ppshuai_socketlibrary | /src/SocketLibrary/SocketLibrary/util/Random.h | UTF-8 | 1,898 | 3.125 | 3 | [] | no_license | /*
* File: random.h
* Version: 1.0
* Last modified on Fri Jul 22 16:44:36 1994 by eroberts
* -----------------------------------------------------
* This interface provides several functions for generating
* pseudo-random numbers.
*/
#ifndef RANDOM_H
#define RANDOM_H
#pragma once
#include "../config.h"
#ifndef... | true |
e200516c9ca984a40b1d0fdbb7d91e6b842c1cc2 | C++ | TauGames/Rendu | /src/engine/renderers/Probe.hpp | UTF-8 | 4,634 | 2.84375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "resources/Buffer.hpp"
#include "resources/ResourcesManager.hpp"
#include "graphics/Framebuffer.hpp"
#include "renderers/Renderer.hpp"
#include "input/Camera.hpp"
#include "Common.hpp"
/**
\brief A probe can be used to capture the appareance of a scene at a given location as a 360° cubemap.
\d... | true |
bbb3c6ed543765edd1ba2cad9ab2ad5e2aff1985 | C++ | cygwins/Leetcode | /73.Set Matrix Zeroes/n.cpp | UTF-8 | 994 | 3.109375 | 3 | [] | no_license | /*
* O( m + n )
* record all rows and colums need to be bombed
*/
#include <vector>
#include "catch.hpp"
using std::vector;
class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int R = matrix.size(), C = matrix[0].size();
vector< bool > row( R, false ), col( C, false );
... | true |
18c2074876253d822c532796738dec3872b43bac | C++ | katsuunhi/PTA | /PAT_(Advanced_Level)_Practice/25/1020. Tree Traversals/main.cpp | UTF-8 | 1,078 | 2.953125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct node{
int index, value;
};
vector<int> in, post;
vector<node> level;
bool cmp(node a, node b){
return a.index < b.index;
}
/*7
2 3 1 5 7 6 4
1 2 3 4 5 6 7*/
void pre(int postl, int postr, int inl, int inr, int index){
int i = inl;
if(inr < inl) return;
if(postl... | true |
e522209cac4117aab870c98ce9521f8eed79eeec | C++ | l34k1m/disciplinaAED1 | /Produzido/Lista recursividade/Exercício 1/Somatoria/main.cpp | UTF-8 | 210 | 3.125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int somatoria (int n) {
if (n==0) return 0;
else return (n+somatoria(n-1));
}
int main()
{
cout << somatoria(3) << endl;
return 0;
}
| true |
15ecffac6175638c9236c21d982047859e35f061 | C++ | HoangNhat629/Game | /Homework/MiniGameStarter/TrainingFramework/src/Game/StateMachine/GravitySelectState.cpp | UTF-8 | 3,345 | 3 | 3 | [] | no_license | #include "GravitySelectState.h"
#include "StateMachine.h"
#include "../GameWorld.h"
#include <array>
namespace Agvt
{
constexpr float Lerp(float a, float b, float t);
GravitySelectState::GravitySelectState(StateMachine* managingStateMachine) : StateBase(managingStateMachine),
m_sourceAngle{}, m_targ... | true |
c12cc3935d0a605c755bf7cb2226d063643d47cb | C++ | obellado/cxx.08 | /ex02/mutantstack.hpp | UTF-8 | 684 | 2.984375 | 3 | [] | no_license | #pragma once
#ifndef __MutantStack__HPP__
# define __MutantStack__HPP__
# include <iostream>
# include <list>
# include <vector>
# include <deque>
# include <stack>
# include <exception>
# include <algorithm>
template <typename T>
class MutantStack : public std::stack<T> {
public:
MutantStack() : std::stack<T>() {}... | true |
878b828dbdc87161f6dbd9e32da00665fb662e6d | C++ | soma62jp/PRML | /1-1/Matrix.h | UTF-8 | 7,972 | 3.234375 | 3 | [
"MIT"
] | permissive | //--------------------------------------------------//
// File Name: Matrix.h //
// Function: Matrix calculation //
// Copyright(C) 2016 shoarai //
// The MIT License (MIT) //
//-------------------------------------------... | true |
ced574acb1c9df928b2e148aa296d84565a59dfe | C++ | DESPEL/code | /cosa.cpp | UTF-8 | 1,496 | 3.0625 | 3 | [] | no_license | #include <iostream>
#define ir_(b) ;return b; }
#define ff_(b) { b
std::string* sanitize(std::string &s, std::string r = "") ff_(for) (char &c : std::string(s)) (c == ' ') ? r : r += c, s = r ir_(&s)
std::string CaesarEncrypt(std::string s, const int offset) ff_(for) (char &c : *sanitize(s)) (c == ' ') ? c : c = 'a' ... | true |
9f8e797056db308688f8768d5c078a63206c680a | C++ | FIRST1778/navxmxp | /roborio/c++/navx_frc_cpp/src/TimestampedQuaternionHistory.h | UTF-8 | 702 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* TimestampedQuaternionHistory.h
*
* Created on: Jul 29, 2015
* Author: Scott
*/
#ifndef SRC_TIMESTAMPED_QUATERNION_HISTORY_H_
#define SRC_TIMESTAMPED_QUATERNION_HISTORY_H_
#include <stdint.h>
#include <mutex>
#include <TimestampedQuaternion.h>
class TimestampedQuaternionHistory {
protected:
Times... | true |
bf194522a1a862919ff7518eab482d3fe43c77f1 | C++ | anna-fomina/stepik-c-part2 | /task_1_2.cpp | UTF-8 | 750 | 3.125 | 3 | [] | no_license | #include <iostream>
struct Base {
int x;
Base(int x = 0) : x(x) {}
virtual void print() const {
std::cout << "Base" << std::endl;
}
};
struct D1 : Base {
void print() const {
std::cout << "D1" << std::endl;
}
};
struct D2 : Base {
void print() const {
std::cout << "D2" << std::endl;
}
};
struct D3 : D... | true |
43094c51b9d153c2a82832faab8b47ba723b2be6 | C++ | nolanderc/glt | /include/vec/vec.hpp | UTF-8 | 1,471 | 2.8125 | 3 | [
"MIT"
] | permissive | //
// Created by Christofer Nolander on 2017-12-27.
//
#pragma once
#include "vec_core.hpp"
namespace glt {
// Define common vector types
// 2D vectors
typedef vec2<int> vec2i;
typedef vec2<float> vec2f;
typedef vec2<double> vec2d;
// 3D vectors
typedef vec3<int> vec3i;
typedef v... | true |
8f67558bafba325d6e2cf3a07539a7438f93854a | C++ | KobeyMyhre/SoliPong | /Splash.cpp | UTF-8 | 569 | 2.53125 | 3 | [] | no_license |
#include "Splash.h"
#include "menuestate.h"
#include "sfwdraw.h"
#include <iostream>
void splash::init(int a_font)
{
d = a_font;
}
void splash::play() { timer = 7.f; }
void splash::draw()
{
char buffer[64];
sprintf_s(buffer, "Loading..");
sfw::drawString(d, buffer, 100, 100, 20, 20);
sfw::drawLine(100, 80, 10... | true |
cd7df08697066ab200fcc3ca7005370ecc4bb407 | C++ | shivendrakrjha/Dynamic-Programming | /UnboundedKnapsack/max_coin_change.cpp | UTF-8 | 596 | 2.859375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int> coins = {1, 2, 3};
int sum = 5;
vector<vector<int>> dp;
dp.resize(coins.size() + 1);
for(int i = 0; i < coins.size() + 1; i++)
dp[i].resize(sum + 1, 0);
for(int i = 0; i < coins.size() + 1; i++)
dp[i][0] = 1;
for(int i = 1; i < coins... | true |
cc0ed885b0d0456dcb750e6b132d6ab85bf55ed3 | C++ | breakTBB/acm | /OJ/51nod/1268.cc | UTF-8 | 1,490 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <cstring>
#include <algorithm>
using namespace std;
#define CLR(a,b) memset(a,b,sizeof(a))
#define INF 0x3f3f3f3f
#define LL long long
int dp[20000005];
int main()
{
int n;
int num[22];
int k;
int sum = 0;
scanf ("%d %d",&n,&k);
for (int i = 1 ; i <= n ; i++)
{
scanf ("%d",&num[i]);... | true |
e747a901ed379e4d33d88e2d33f8e0ea6ebf9004 | C++ | ernestyalumni/HrdwCCppCUDA | /Voltron/Source/IO/Epoll/EpollFd.cpp | UTF-8 | 1,817 | 2.765625 | 3 | [
"MIT"
] | permissive | //------------------------------------------------------------------------------
/// \file EpollFd.h
/// \author Ernest Yeung
/// \email ernestyalumni@gmail.com
/// \brief Create a new epoll instance and encapsulate it.
/// \ref http://man7.org/linux/man-pages/man2/epoll_create.2.html
/// http://cs241.cs.illinois.edu/... | true |
4ecae23c9a60422b69def9bc18c0216b7a122b4c | C++ | moyin1004/learning | /TimeLine/20190218/netlib/v3/EventLoop.h | UTF-8 | 1,704 | 2.828125 | 3 | [] | no_license | /// @file EventLoop.h
/// @author moyin(moyin1004@163.com)
/// @data 2019-02-20 17:30:23
#ifndef __EVENTLOOP_H__
#define __EVENTLOOP_H__
#include "MutexLock.h"
#include <sys/epoll.h>
#include <vector>
#include <map>
#include <memory>
#include <functional>
namespace wd {
class Acceptor;
class TcpConnection;
... | true |
381e98fff6ca9edfda2acc7ac7bd49d2a0bfffdc | C++ | hzjTurbo/pat_Practice | /PAT (Basic Level) Practise (中文)/b1032.cpp | UTF-8 | 406 | 2.625 | 3 | [] | no_license | //pat_b1032
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 100000 + 5;
int iScore[maxn] = { 0 };
int main(){
int N;
cin >> N;
while (N--){
int trem, score;
cin >> trem >> score;
iScore[trem] += score;
}
int index = 0;
for (int i = 0; i < maxn; i++){
if (iScore[index] < iSc... | true |
b20cdfdbad94426cbefd46cb4f82c838d5a772e6 | C++ | rheehot/Algorithm-40 | /BOJ/11729/11729.cpp | UHC | 1,422 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include <cmath>
void Hanoi(int n, int from, int tmp, int to) {
if (n == 1) {
printf("%d %d\n", from, to);
}
else {
Hanoi(n - 1, from, to, tmp);
printf("%d %d\n", from, to);
Hanoi(n - 1, tmp, from, to);
}
}
int main() {
int n;
scanf("%d", &n);
printf("%d\n", (int)pow(2, n) - 1);
Ha... | true |
d7307bd0011768db23885360dae67395bb9b0e57 | C++ | AminTakhtiNejad/laplacian_filter_hls | /filter.cpp | SHIFT_JIS | 3,339 | 2.6875 | 3 | [] | no_license | /**
* Laplacian filter by AXI4-Stream input/output.
* Achieves 1 clk/pixel.
*/
#include <stdio.h>
#include <string.h>
#include <ap_int.h>
#include <hls_stream.h>
#include <ap_axi_sdata.h>
#define HORIZONTAL_PIXEL_WIDTH 240
int laplacian_fil(int x0y0, int x1y0, int x2y0, int x0y1, int x1y1, int x2y1, int x0y2, i... | true |
1170eebc3d71369e0725c8b0aae9a49cc085c521 | C++ | oledjan/Blm | /Blm/biosec_lib/archiveEntry.h | UTF-8 | 1,506 | 2.609375 | 3 | [] | no_license | #ifndef __archiveEntry_h__
#define __archiveEntry_h__
#include <vector>
#include <memory>
#include "libarchive/archive_entry.h"
#include "libarchive/archive.h"
#include "fileEncryptor.h"
namespace blm_utils{
enum class EntryFileType{
REGULAR,
DIRECTORY
};
class ArchiveEntry {
public:
ArchiveEntry();
... | true |
729b78ed623951b47f191cd5526a544381f7a8a1 | C++ | jfcarr/arduino-c-cpp | /1-simple/CTest/CTest.ino | UTF-8 | 202 | 2.65625 | 3 | [] | no_license |
void setup() { pinMode(LED_BUILTIN, OUTPUT); }
void loop() {
int delayValue = 250;
digitalWrite(LED_BUILTIN, HIGH);
delay(delayValue);
digitalWrite(LED_BUILTIN, LOW);
delay(delayValue);
}
| true |
d06800883fd697de801bbc335eec831d549e35fe | C++ | SOMAS2020/somas-demo | /src/server.cpp | UTF-8 | 4,426 | 3.125 | 3 | [] | no_license | #include <zmqpp/zmqpp.hpp>
#include <bits/stdc++.h>
#include "client.hpp"
#include "consts.hpp"
// get_clients gets a mapping from the port string to the `clients/<teamname>_<portnum>`
// representation of the client.
// Health checks like port number >=1024 and repeat port numbers are run.
void get_clients(std::vecto... | true |
b93f2ed69e775a62b5c465a55966569627d43617 | C++ | me-cooper/esp_controlled_via_esp_over_wifi | /client_1.ino | UTF-8 | 1,602 | 2.578125 | 3 | [] | no_license | #include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
HTTPClient sender;
//Wlan-Daten eures Netzwerks eintragen
const char* ssid = "WLAN_SSID";
const char* password = "WLAN_PASSWD";
void setup()
{
Serial.begin(115200);
Serial.println("ESP Gestartet");
WiFi.begin(ssid, password);
Serial.print("Verbindung... | true |
a73a7b4e46f5979e3c114228d44c24da4ecaaa39 | C++ | Alexzerntev/C-Cpp-Projects | /Syspro/syspro1/tests/bitcoin_tree_test.cpp | UTF-8 | 2,071 | 3.0625 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "../error_handler/error_handler.h"
#include "../data_structures/bitcoin_tree/bitcoin_tree.h"
#include "../string/string_handler.h"
namespace
{
class BitcoinTreeTest : public testing::Test
{
protected:
BitcoinTreeTest()
{
}
~BitcoinTreeTest() override
{
}
... | true |
304ce4a4d2aea82e5890a0152bc85ba7c7dd8efc | C++ | Daviswww/Submissions-by-UVa-etc | /AOJ ITP1/AOJ 041 - Dice I.cpp | UTF-8 | 883 | 2.8125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
const int
a[6] = {1, 2, 3, 4, 5, 6},
w[6] = {3, 2, 6, 1, 5, 4},
e[6] = {4, 2, 1, 6, 5, 3},
n[6] = {2, 6, 3, 4, 1, 5},
s[6] = {5, 1, 3, 4, 6, 2};
int main()
{
string str;
int ary[6] = {0}, ax[6];
for(int i = 0; i < 6; i++)
{
cin >> ary[i];
}
... | true |
fad428f129ce0685b3a4b67ac514172b528b3987 | C++ | dineshmakkar079/My-DS-Algo-code | /interviewbit/Letter_Phone.cpp | UTF-8 | 1,688 | 3.5 | 4 | [] | no_license | /*
Time : Sat Aug 19 2017 16:13:49 GMT+0530 (IST)
URL : https://www.interviewbit.com/problems/letter-phone/
Given a digit string, return all possible letter combinations that the number could represent.
A
mapping of digit to letters (just like on the telephone buttons) is given below.
The digit 0
maps to 0 itself... | true |
73ff50ea351751307476b587ce788e00f9341def | C++ | troy-dem/le_garage | /one_led_matrix_test/one_led_matrix_test.ino | UTF-8 | 829 | 2.6875 | 3 | [] | no_license | #include "LedControl.h"
/*
pin 2 is connected to the DataIn
pin 4 is connected to the CLK
pin 3 is connected to LOAD
***** Please set the number of devices you have *****
*/
LedControl lc=LedControl(12,10,11,1);
const int addrL = 0; // first LED matrix - Left robot eye
/*const int addrR = 1; // second LED m... | true |
9276c71166bfef3d7f1f47d9eb8add8020828d79 | C++ | WayWingsDev/SIMUL_DSA | /HOG/cvModifiedPeopleDetect/otherPeople/tutorial/tutorial3.cpp | UTF-8 | 11,452 | 3.0625 | 3 | [] | no_license | /*This function takes in a the path and names of 64x128 pixel images, the size of the cell to be
used for calculation of hog features(which should be 8x8 pixels, some modifications will have to be
done in the code for a different cell size, which could be easily done once the reader understands
how the code works), a ... | true |
9214e161ce1147ed37d66d691d390a6882bfcea0 | C++ | gbrlas/AVSP | /CodeJamCrawler/dataset/14_4065_55.cpp | UTF-8 | 2,323 | 2.53125 | 3 | [] | no_license | package com.main;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class CookieClicker {
public static void main(Stri... | true |