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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8f4936a6a0a60798ce58f97f0be69feff46565ff | C++ | Aaryankamboj/Data-Structures-and-algorithms | /imheritance_question.cpp | UTF-8 | 1,778 | 4.03125 | 4 | [] | no_license | #include <iostream>
#include <cmath>
#include <math.h>
using namespace std;
class SimpleCalculator
{
protected:
int num1, num2;
char choice;
public:
void set_numbers(int a, int b, char sym)
{
num1 = a;
num2 = b;
choice = sym;
}
void selection(int, int, char);
};
void Sim... | true |
55bee3e7f8621b32fae0f61fbbb5d4b047ce94ee | C++ | mayonaiys/run_Qt | /src/main.cpp | UTF-8 | 1,127 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <QApplication>
#include "Window.h"
int main(int argc, char **argv) {
QApplication game(argc,argv); //Création du programme
//Ajout d'une police personnalisée pour le jeu
QFontDatabase::addApplicationFont("../fonts/Joystick-5KjV.ttf"); //Ajout de la police
QFont font = QFont("Joystick",50); //... | true |
d032fbc0759753d06c6661c9edfa703761e89bba | C++ | satyamdash/c-_codes | /Lecture-16_Recursion/Reverse_String.cpp | UTF-8 | 250 | 2.796875 | 3 | [] | no_license | #include<iostream>
using namespace std;
void Reverse(string str)
{
if(str.size()==0)
{
return;
}
string ros=str.substr(1);
Reverse(ros);
cout<<str[0];
}
int main()
{
string str;
getline(cin,str);
Reverse(str);
} | true |
d5e838c924c29850ef77198e9012c197d648520d | C++ | whutaihejin/repo | /primer/chapter16/flexible_array_member.cc | UTF-8 | 952 | 3.34375 | 3 | [] | no_license | #include <iostream>
struct Flex {
Flex(): count(0), average(0) {}
int count;
double average;
double scores[];
//
friend std::ostream& operator<<(std::ostream&, const Flex&);
};
struct F {
int count;
double average;
};
int main() {
std::cout << "Flex size:" << sizeof(Flex) << std::... | true |
d7192b3e85ad937cdd1dc1fd0f6754d24efe6e2f | C++ | ExpandiumSAS/nx | /sources/include/nx/nx/data.hpp | UTF-8 | 1,747 | 2.78125 | 3 | [
"MIT"
] | permissive | #ifndef __NX_DATA_H__
#define __NX_DATA_H__
#include <sstream>
#include <vector>
#include <memory>
#include <nx/config.h>
#include <nx/file.hpp>
#include <nx/socket_base.hpp>
namespace nx {
enum class data_item
{
stream,
file
};
using data_items = std::vector<data_item>;
class NX_API data
{
public:
st... | true |
9e1102be4aaa61b101f4c2f49d42b5bf9484e9c3 | C++ | dubshfjh/LeetCode | /123.cpp | UTF-8 | 1,641 | 3.828125 | 4 | [] | no_license | 动态规划:使用两个数组forward[]和back[]。1. forward[i]:{0..i}这段区间的最优利润,即[i-a]处低价买 & [i-a+b]处高价卖,从0正向遍历到i可以求解。PS:a,b>=0
2. back[i]:{n-1...i}这段区间的逆向最差利润,即[n-a]处高价买 & [n-a-b]处低价卖,它就是[n-a-b]处低价买 & [n-a]处高价卖这种实际情况的逆向说法,从n-1反向遍历到i可以求解。
3. 最后求解forward[i]-back[i]可以得到以每个i为两次交易分界点的最大利润。
class Solution {
public:
int maxProfit(vector<int>... | true |
1d8e751f460fcaa7ba70314a74212ea664a46998 | C++ | shivam17u113/Data-structure-and-algo-revesio- | /Design & Analysis Of Algorithm/7 Hamiltoniain Cycles.cpp | UTF-8 | 4,267 | 3.328125 | 3 | [] | no_license | /*
SIDDESH SUNIL VYAVAHARE
A3 17U373
331067
TY IT
*/
/* REFERENCES ABDUL BARI YOUTUBE CHANNEL HAMILTONIAN CYCLES
*/
#include<iostream>
#include<math.h>
#include<vector>
#include<cstring>
using namespace std;
#define br cout<<"========================================\n";
#defin... | true |
dc43fdfd8aa3622ab0fb58606891ef6ef4b9b19b | C++ | atoxiam/IntroToCPP | /MonthOfYear/Main.cpp | UTF-8 | 832 | 3.390625 | 3 | [] | no_license | #include <iostream>
int main()
{
int varA = 0, varC = 0;
printf("This program will tell you how many days are in a month when you input the number that corresponds with that month \n");
printf("Please enter the number of the month you seeketh: ");
scanf_s("%d", &varA);
getchar();
switch (varA)
{
case 1:
varC... | true |
460feb19fa224938c390a5966248abbfaf315f54 | C++ | anushkaGurjar99/Data-Structure-and-Algorithms | /LEETCODE/DFS/Q841. Keys and Rooms.cpp | UTF-8 | 962 | 3.234375 | 3 | [] | no_license | /*
* Author : Anushka Gurjar
* Date : October 2020
* flags : -std=c++17
*/
#include<bits/stdc++.h>
using namespace std;
// Problem Statement: https://leetcode.com/problems/keys-and-rooms/
class Solution{
public:
bool canVisitAllRooms(vector<vector<int>>& rooms){
int size = rooms.size();
... | true |
1400c79df66bfb4e4e30fb1a97d51b56ae4e93f3 | C++ | Alonvita/AP1_EX2 | /CheckAdditionCreation.cpp | UTF-8 | 6,078 | 2.953125 | 3 | [] | no_license | //
// Created by alon on 29/11/18.
//
#include "CheckAdditionCreation.h"
void Test1() {
auto* myImplementation = new MyImplementation();
// ---- PLANE 1 ----
// MODEL
int p1Model = 747;
// CREW
map<Jobs, int> p1crewNeeded;
p1crewNeeded.insert(make_pair(NAVIGATOR, 1));
p1crewNeeded.ins... | true |
e37a192ae909ef0b5b6ac6c39d611cd04a9f3315 | C++ | mohsin0176/HandNotes-onCPlusCPlus | /structunionenum/15.cpp | UTF-8 | 454 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<bits/stdc++.h>
#include<math.h>
#include<cstdlib.h>
#include<limits.h>
#include<iomanip.h>
#include<fstream.h>
#include<process.h>
#define PI 3.1416
using namespace std;
enum days_of_week{sun,mon,tues,wednesday,thu,fri,sat};
int main()
{
days_of_week day1,day2;
day1=mon;
d... | true |
4f3e81ab6f2940bf5277746dd245ee0112bbed3e | C++ | Pisces000221/curly-octo-waddle | /712-d2e/1.cpp | UTF-8 | 1,014 | 3.328125 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
class RepeatNumberCompare {
public:
static const int MAXLEN = 602;
std::string compare(int x1, int k1, int x2, int k2) {
char x1_str[15], x2_str[15];
int s[MAXLEN] = { 0 }, t[MAXLEN] = { 0 };
sprintf(x1_str, "%d", x1);
sprintf... | true |
412911027c496add07091aca8c5db6e85214648b | C++ | chenmenis/stuff | /permuteStrings.cpp | UTF-8 | 1,341 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <unordered_map>
#include <stack>
#include <climits>
#include <cstring>
#include <string>
#include <sstream>
#include <cmath>
using namespace std;
void permuteUtility(vector<char> &chars, vector<int> &counts,vector<char> &results,i... | true |
0d7d3b0c837af285baf33d411483cd5d5a614815 | C++ | HenkeZeke/HuaweiRouter | /DebugServer/Network/network.cpp | UTF-8 | 5,070 | 2.828125 | 3 | [] | no_license | #include "network.h"
Network::Network(): releaseTheKraken(0), freePort(8000) {}
Network::Network(std::vector<std::pair<int,int>> &adjList,
int port, int nodesAmount):
freePort(port), adjList(adjList) {
createNodes(nodesAmount);
}
Network::Network(std::vector<Node> &nodes,
std::v... | true |
a11c42cdfce64a5195dfc8da10086ccceefd1283 | C++ | tokjun/TrackingServerSimulator | /TestClientSimulator.cxx | UTF-8 | 2,523 | 2.53125 | 3 | [] | no_license | /*=========================================================================
Program: Tracking Server Simulator (Test Client)
Language: C++
Copyright (c) Brigham and Women's Hospital. All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABIL... | true |
71a5f0e1bc1bf166456abd75322cc29d3583c988 | C++ | mirabl/j | /construct-rectangle.cpp | UTF-8 | 234 | 2.9375 | 3 | [] | no_license | class Solution {
public:
vector<int> constructRectangle(int area) {
for (int W = sqrt(area); W >= 0; W--) {
if (area % W == 0) {
return vector<int>{area / W, W};
}
}
}
}; | true |
693aaa0f3ffc8d03235ad61a88de92340e83542c | C++ | Palette25/Computer-Vision | /Final/Final-Project/PartI/src/Partition.cpp | UTF-8 | 12,357 | 2.625 | 3 | [] | no_license | #include "Partition.h"
Partition::Partition(CImg<unsigned char>& input, int seq){
this->seq = seq;
this->grayImg = ImageSegmenter::toGrayScale(input);
CImg<unsigned char> grayScale = this->grayImg;
// Single Threshold Detect
this->grayImg = threshold(grayScale, 15, 0.08);
CImg<unsigned char> ... | true |
86d0954b693dc70a371800c25c38d81f46b2613b | C++ | alielbashir/learncpp | /casting.cpp | UTF-8 | 199 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
// CASTING
// changing data from 1 type to another
cout << (int)3.14 << endl;
cout << (double)3/2 << endl;
} | true |
0f1d283bca04591d749637a3a98e20ea52fe59a6 | C++ | zackkk/leetcode | /Max Points on a Line.cpp | UTF-8 | 1,006 | 3.21875 | 3 | [] | no_license | /**
* Definition for a point.
* struct Point {
* int x;
* int y;
* Point() : x(0), y(0) {}
* Point(int a, int b) : x(a), y(b) {}
* };
*/
class Solution {
public:
// y = kx + b
int maxPoints(vector<Point> &points) {
int max_num = 0;
for(Point p : points){
... | true |
af1a2a4ea8e4b03ad377c7ab4c07eb2943838728 | C++ | michaelkotor/laba05 | /include/Iterator.h | UTF-8 | 897 | 3.234375 | 3 | [] | no_license | //
// Created by Michael Kotor on 11/2/20.
//
#ifndef LABA05_ITERATOR_H
#define LABA05_ITERATOR_H
#include "Node.h"
#include "Queue.h"
template <typename T>
class Iterator {
private:
Node<T>* value;
public:
Iterator(Queue<T> queue) {
this->value = queue.getTop();
}
void operator++() {
... | true |
ae561ad6978d20b6775bec4451b863f93660d2f4 | C++ | yqs112358/YQ-CPP-Library | /CheckPath.h | UTF-8 | 326 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | #ifndef YQ_CHECK_PATH_H
#define YQ_CHECK_PATH_H
#include <string>
using std::string;
string CheckPath(string path)
{
try
{
string::size_type pos=0;
string chars("?*:<>|\"");
while((pos=path.find_first_of(chars,pos)) != string::npos)
path.erase(pos,1);
return path;
}
catch(...)
{
return "";
}
}
#... | true |
f0ec31bd5b7e0b45e1e187fee30b9d1369482022 | C++ | spoosanthiram/Thanuva | /Core/Include/Matrix4x4.h | UTF-8 | 3,538 | 3.046875 | 3 | [] | no_license | /*
* Core: Common Code used by other modules of Thanuva
*
* Copyright 2016, Saravanan Poosanthiram
* All rights reserved.
*/
#ifndef CORE_MATRIX4X4_H
#define CORE_MATRIX4X4_H
#include <array>
#include "Point3d.h"
namespace Core {
class HPoint;
class HVector;
class Quaternion;
/**
* Colum... | true |
c7a665b74c8cc2e150f9e31176afeeed0a28c170 | C++ | terataichi/2- | /Project2/ModePuyo/FallMode.h | SHIFT_JIS | 2,044 | 2.515625 | 3 | [] | no_license | #pragma once
#include "../Stage.h"
struct FallMode
{
void operator()(Stage& stage)
{
bool nextFlg = true;
for (auto puyo : stage.puyoVec_)
{
// ܂Ă`FbN
puyo->SetOldDirFlg();
nextFlg &= stage.CheckMove(puyo);
}
std::for_each(stage.puyoVec_.rbegin(), stage.puyoVec_.rend(), [&](SharePuyo& uniPuyo)
... | true |
2c261675c84c693d44a98e1ffb3b7eaae28b91a4 | C++ | MultivacX/leetcode2020 | /algorithms/hard/1510. Stone Game IV.h | UTF-8 | 800 | 3.203125 | 3 | [
"MIT"
] | permissive | // 1510. Stone Game IV
// https://leetcode.com/problems/stone-game-iv/
// Runtime: 44 ms, faster than 78.31% of C++ online submissions for Stone Game IV.
// Memory Usage: 21.9 MB, less than 5.18% of C++ online submissions for Stone Game IV.
class Solution {
public:
bool winnerSquareGame(int n) {
static ve... | true |
d38e2edb2f2aff040fc43f1c0f9d53b1419bcda1 | C++ | tyler-eto/alarum | /baseSpace.cpp | UTF-8 | 4,241 | 3.296875 | 3 | [] | no_license | /*********************************************************************
** Program name: baseSpace.cpp
** Author: Tyler Eto
** Date: 6/7/18
** Description: implementation file for BaseSpace class
*********************************************************************/
#include "baseSpace.hpp"
#include "helpers.hpp"
usi... | true |
735a59de2f5b413807b5f6b1ad7ed62031791ea6 | C++ | liuhe3647/serialize | /thirdParty/json/GenericReader.cpp | UTF-8 | 15,636 | 2.515625 | 3 | [] | no_license | #include "GenericReader.h"
#include <assert.h>
namespace custom {
resetStruct::resetStruct(uint8_t** pStruct, uint8_t* pTarget)
:_pStruct(pStruct), _pTarget(pTarget) {
}
void resetStruct::reset() {
*_pStruct = _pTarget;
}
/*---------------------------------------------------------... | true |
ea8097382ae2c238871bac479ea22c9045bd8518 | C++ | ycwu0609/OOP_practice | /LAB4/Lab4.cpp | UTF-8 | 3,345 | 3.53125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class PolySeq
{
public:
PolySeq operator -(PolySeq p);
PolySeq operator *(PolySeq p);
void print();
int set_num(int a){num_of_terms=a;}
int get_num_of_terms(){return num_of_terms;}
void set_coe(int* s);
int* get_coe(){return coe;}
void set_exp(in... | true |
b78e75c0ccfa1db04acb69efae633c2388efe8cc | C++ | suchyba/ZadanieZAlgorytmow4 | /ASD4/main.cpp | WINDOWS-1250 | 6,333 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <fstream>
#include "BCD.h"
#include "main.h"
#include "BCDstruct.h"
#include "Wypisywanie.h"
#include "Menu.h"
#include <conio.h>
using namespace std;
int main()
{
fstream plikIn, plikOut;
wezelBST* ang = NULL, * pol = NULL;
bool... | true |
9596849fcd5f59717f9659d180c9f6bd8a322736 | C++ | mertsaner/Algorithms | /HackerRank/search/bilboards.cpp | UTF-8 | 809 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <deque>
using namespace std;
int main()
{
int N,K;
cin >> N >> K;
long long sum=0;
vector<long long> c(N+1), dp(N+1);
deque<long long> dpQ;
for(int i=0;i<N;i++)
cin >> c[i], sum+=c[i];
if(K==N)
{
cout << sum << end... | true |
fe5f981b95ed222d25e4ceffb534046035cf40d1 | C++ | tomzhang/blackhole | /src/blackhole/repository/config/base.hpp | UTF-8 | 825 | 2.75 | 3 | [
"MIT"
] | permissive | #pragma once
#include <string>
#include <boost/variant.hpp>
#include "blackhole/dynamic.hpp"
namespace blackhole {
namespace repository {
namespace config {
class base_t {
std::string type_;
dynamic_t::object_t config_;
public:
base_t(std::string type) :
type_(std::move(type))
{}
co... | true |
ba2f73c0f186127e6c97bac3e53958f050343dad | C++ | flight7788/3d-printing-with-moveo-1 | /Cura/CuraEngine/src/infill/SubDivCube.h | UTF-8 | 5,338 | 2.78125 | 3 | [
"GPL-3.0-only",
"AGPL-3.0-only"
] | permissive | //Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#ifndef INFILL_SUBDIVCUBE_H
#define INFILL_SUBDIVCUBE_H
#include "../settings/types/Ratio.h"
#include "../utils/IntPoint.h"
#include "../utils/Point3.h"
namespace cura
{
struct LayerIndex;
class Polygons;
class Sli... | true |
e9be5469e35aa52f871b69341a4c9fd86dbf326e | C++ | EdsonYamamoto/URI-Online-Judge-Beginner | /1015.cpp | UTF-8 | 1,189 | 3.3125 | 3 | [] | no_license | /*
URI Online Judge | 1015
Distância Entre Dois Pontos
Adaptado por Neilor Tonin, URI Brasil
Timelimit: 1
Leia os quatro valores correspondentes aos eixos x e y de dois pontos quaisquer no plano, p1(x1,y1) e p2(x2,y2) e calcule a distância entre eles, mostrando 4 casas decimais após a vírgula, segundo a fórmula:
Dist... | true |
32baec8e3fe70b8fcb41011996aff5a8db705c5d | C++ | pandakkkk/DataStructures-Algorithms | /Graphs/Traversal on Graphs/Breadth First Search/1557. Minimum Number of Vertices to Reach All Nodes.cpp | UTF-8 | 701 | 3.34375 | 3 | [] | no_license | // 1557. Minimum Number of Vertices to Reach All Nodes
//? Graphs | Mother Vertex | OutDegree
#include <bits/stdc++.h>
using namespace std;
/*
* A node that does not have any incoming edge can only be reached by itself.
* Any other node with incoming edges can be reached from some other node.
* We only have to cou... | true |
ee3e9aa2fe22fd814d67430a40619fbb6794f28e | C++ | wenqicao/algorithm-sec2 | /8_15.cpp | UTF-8 | 1,546 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <memory>
using namespace std;
template<class T>
struct ListNode{
T data;
shared_ptr<ListNode<T>> next;
};
shared_ptr<ListNode<int>> reverse_list(shared_ptr<ListNode<int>> head){
shared_ptr<ListNode<int>> cur = head, pre = nullptr;
while(cur){
shared_ptr<ListNode<int>> temp = cur->ne... | true |
1090efaca28add0c434b30dbe71fffe90e42f764 | C++ | tanmay017/Data-Structure-and-Algorithms-Learning | /14. Trees/const_bin_tree_ino_pre0.cpp | UTF-8 | 1,085 | 3.53125 | 4 | [] | no_license | #include <bits/stdc++.h> //This code is for problem construct binary tree from Inorder and Postorder
using namespace std;
struct Node
{
int key;
Node *left;
Node *right;
Node(int k)
{
key = k;
left = right = NULL;
}
};
Node *cTree(int in[], int pre[], int is, int ie)
{
if (i... | true |
74ca5809056e5cc39222833c9ee219aa524591ae | C++ | Mtaylorr/PIE-Olympie | /PathFinding/headers/astar.h | UTF-8 | 474 | 2.578125 | 3 | [] | no_license | #pragma once
#include <vector>
#include "grid.h"
#include "node.h"
class AStar
{
private:
static constexpr float SQRT_2 = 1.41421356237f;
public:
Grid& grid;
private:
int widthNodes, heightNodes;
Node** nodes;
std::vector<Node*> priority;
public:
std::vector<Node*> explored;
public:
AStar(Grid& grid);
... | true |
7d251ede37a9074e2603ed8df97abb537a80cbb7 | C++ | BramLachat/GPGPU | /RT_TT_CGAL/Mesh.cpp | UTF-8 | 2,309 | 3.0625 | 3 | [] | no_license | #include <vector>
#include <string>
#include <iostream>
#include <iterator>
#include <map>
#include <fstream>
#include <chrono>
#include <algorithm>
#include "omp.h"
#include "Mesh.h"
Mesh::Mesh(std::string n, unsigned int size)
{
name = n;
triangles.reserve(size);
vertices.reserve(size);
}
std::string Mesh::get... | true |
678a29c0a35f51614e6391d539687868ac0bbb36 | C++ | avoropay/action_video | /RunWith2Speed/RunWith2Speed.ino | UTF-8 | 1,943 | 2.578125 | 3 | [] | no_license | #include <AccelStepper.h>
// For arduino speed up
#define FASTADC 1
// defines for setting and clearing register bits
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
// For arduino speed up end
// Define some steppers and th... | true |
13918c9acea733bf6357b09b164a8d29c6666063 | C++ | benjaminhuanghuang/ben-leetcode | /1455_Check_If_a_Word_Occurs_As_a_Prefix_of_Any_Word_in_a_Sentence/solution.cpp | UTF-8 | 950 | 3.46875 | 3 | [] | no_license | /*
1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence
Level: Easy
https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
*/
#include <vector>
#include <string>
#include <sstream> // stringstream, getline
#include "common/ListNode.h"
#include "common/TreeNode.h"
us... | true |
5bb33b2f86ad78f38797d75310d1f71b0ab2f298 | C++ | snewell/bureaucracy | /include/bureaucracy/timer.hpp | UTF-8 | 7,429 | 3.3125 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef BUREAUCRACY_TIMER_HPP
#define BUREAUCRACY_TIMER_HPP 1
#include <condition_variable>
#include <functional>
#include <mutex>
#include <thread>
#include <unordered_map>
#include <vector>
namespace bureaucracy
{
/** \brief A class that triggers Events at certain times.
*
* A Timer manages a list of ... | true |
9f52e358c27554ea5f88359aeaa8b3f605ec8246 | C++ | Oh-kyung-tak/Algorithm | /Baekjoon/baekjoon_15786.cpp | UTF-8 | 416 | 3.078125 | 3 | [] | no_license | #include<iostream>
#include<set>
#include<algorithm>
#include<string>
using namespace std;
int n, m;
string word;
int main()
{
scanf("%d %d", &n, &m);
cin >> word;
while (m--)
{
int count = 0;
string pass;
cin >> pass;
for (int i = 0; i < pass.size(); i++)
{
if (word[count] == pass[i])
cou... | true |
b4ff7500d14e3e0fb7f9dc709ebe3a5a30e343a7 | C++ | FashionDB/lockfree | /C++11/rbq.hpp | UTF-8 | 6,032 | 2.90625 | 3 | [] | no_license | #include <atomic>
#ifndef __LOCKFREE_RBQ_MPMC_H__
#define __LOCKFREE_RBQ_MPMC_H__
#ifdef _WIN32
#include <Windows.h>
#ifdef __cplusplus
extern "C" {
#endif
static inline void usleep(__int64 usec)
{
HANDLE timer;
LARGE_INTEGER ft;
ft.QuadPart = -(10 * usec);
timer = CreateWaitableTimer(NULL, TRUE, NULL);
... | true |
54b6f793df336a4311c77696455f6b77d1c22934 | C++ | RobertCFletcher/Zoo_Tycoon | /tiger.hpp | UTF-8 | 603 | 2.609375 | 3 | [] | no_license | /*****************************************************************************************************************
**Name: Robert Fletcher
**Course: CS162
**Date: 02/04/2018
**Description: Project 2 - Header file for the tiger class.
*********************************************************************************... | true |
49fe801c142c4457107e1ac578fcb24faad57458 | C++ | ngminteck/DigipenGAM200GAM250 | /GAM200AndGAM250/ChestNutEngine/Matrix4x4.cpp | UTF-8 | 10,786 | 3.140625 | 3 | [] | no_license | #include "Matrix4x4.h"
#include <iomanip>
Matrix4x4::Matrix4x4()
{
identity();
}
Matrix4x4::Matrix4x4(const float src[16])
{
set(src);
}
Matrix4x4::Matrix4x4(float m00, float m01, float m02, float m03,
float m04, float m05, float m06, float m07,
float m08, float m09, float m10, float m11,
float m12, float m13, flo... | true |
aaecff4086302287b3d7e7084b69a69ffa97657b | C++ | yumkong/cpp_prac | /leet/0820/leet_530.cpp | UTF-8 | 1,317 | 3.828125 | 4 | [] | no_license | // minimum absolute different in BST
// given a binary search tree with non-negative values, find the minimum absolute difference of any two nodes
// NOTE: there at least two nodes in this BST
#include <iostream>
#include <climits> // INT_MAX, INT_MIN
#include <vector>
using namespace std;
//Definition for a binary tr... | true |
7aba46e4fa145d39903ed1837bf78f44e0232707 | C++ | maksym-pasichnyk/NativeParticleSystem | /NativePlugin/Src/Runtime/Allocator/LinearAllocator.h | UTF-8 | 4,277 | 2.640625 | 3 | [] | no_license | #ifndef LINEAR_ALLOCATOR_H_
#define LINEAR_ALLOCATOR_H_
#include <cstddef>
#include <list>
#include "Configuration/UnityConfigure.h"
#if UNITY_LINUX || UNITY_PS4
#include <stdint.h> // uintptr_t
#endif
#include "Runtime/Allocator/MemoryMacros.h"
struct LinearAllocatorBase
{
static const int kMinimalAlign = 4;
... | true |
44e5a904fbc96fb4f38aee163e021a6dbbb8348c | C++ | adegroat/csci441_a6 | /ParticleSystem.cpp | UTF-8 | 4,583 | 2.6875 | 3 | [] | no_license | #include "ParticleSystem.h"
ParticleSystem::ParticleSystem(float startX, float startY, float startZ, float maxAngle, float minVel, float maxVel, float minLife, float maxLife, float spawnRate) {
this->startX = startX;
this->startY = startY;
this->startZ = startZ;
this->maxAngle = maxAngle;
this->minVel = minVel;
... | true |
d3e2601da05a720481ead44b9f41cd38dc3eb5bf | C++ | juhuahuang/leetcode | /BinartTreeLevelOrderTraversal_102.cpp | UTF-8 | 843 | 3 | 3 | [] | no_license | #include "BinartTreeLevelOrderTraversal_102.h"
void BinaryTreeLevelOrderTraversal_102::execute()
{
this->result = LevelOrder(this->root);
}
BinaryTreeLevelOrderTraversal_102::BinaryTreeLevelOrderTraversal_102(vector<int> num) {
}
vector<vector<int>> BinaryTreeLevelOrderTraversal_102::LevelOrder(TreeNode * root)
{
... | true |
6c30d48c9833471159283da46c5b1b3adadc1697 | C++ | dmitryikh/rcfg | /test/ClassParserTest.cpp | UTF-8 | 3,755 | 2.828125 | 3 | [
"MIT"
] | permissive | #include <gtest/gtest.h>
#include <nlohmann/json.hpp>
#include <rcfg/rcfg.h>
#include "TestEventSink.h"
using json = nlohmann::json;
struct Config
{
std::string s1;
int i2;
bool b3;
};
auto getParser()
{
rcfg::ClassParser<Config> p;
p.member(&Config::s1, "s1", rcfg::Default{std::string("aba")}, rcfg::Updatable... | true |
dbcec52de2168f776a7de58d8f0bd492cf7fcf27 | C++ | DanielParra159/EngineAndGame | /Engine/src/Include/Common/Graphics/SpriteAnimatorComponent.h | UTF-8 | 3,579 | 2.53125 | 3 | [
"CC0-1.0"
] | permissive | #ifndef _ENGINE_GRAPHICS_SPRITEANIMATORCOMPONENT_H_
#define _ENGINE_GRAPHICS_SPRITEANIMATORCOMPONENT_H_
#include "Defs.h"
#include "Types.h"
#include "Logic/IComponent.h"
#include "Graphics/SpriteAnimator.h"
namespace logic{
class IGameObject;
}
namespace graphics
{
/**
*/
class SpriteAnim... | true |
9e487f965b11101169852c242d70c5586d657213 | C++ | sntwr/UVa-Solved-Problems | /solved/UVa484/484.cpp | UTF-8 | 441 | 2.765625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int
main ()
{
map<int, int> ct;
vector<int> rank;
int num;
while (scanf ("%d", &num) == 1) {
map<int, int>::iterator it;
if ((it = ct.find (num)) != ct.end ()) {
it->second++;
} else {
ct[num] = 1;
rank.push_back (num);
}
}
vector<int>::iterator it... | true |
90d23726b43d30fa307b727c7de464db3ed84bfe | C++ | serishan/LeetCode | /Solutions/C++/Problem 004.cpp | UTF-8 | 1,393 | 4.375 | 4 | [] | no_license | /*
Question 4: Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.
Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
You may assume nums1 and nums2 cannot be both empty.
[Example 1]
nums1 = [1, 3]
nums2 = [2]
The median... | true |
695cd4f439baf9aa85e6b18f1151f59796ea17af | C++ | KoWunnaKo/qmlib | /include/qmlib/finance/rates/composite_rate.hpp | UTF-8 | 4,185 | 2.578125 | 3 | [] | no_license |
#ifndef __COMPOSITE_RATE_QM_HPP__
#define __COMPOSITE_RATE_QM_HPP__
#include <qmlib/corelib/static/all.hpp>
#include <qmlib/corelib/tools.hpp>
#include <qmlib/corelib/templates/observer.hpp>
/** \file
* \brief Composite rate base class template
* \ingroup rates
*
*/
QM_NAMESPACE2(finance)
template<... | true |
60c65a91a2ab2f69a6039188ba301ed9c94817ce | C++ | froseb/lgo | /blatt1/src/LinearProgram.cpp | UTF-8 | 2,314 | 3.671875 | 4 | [] | no_license | #include "LinearProgram.h"
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
// Constructs a linear program object by the content of an input file
LinearProgram::LinearProgram(std::string input_file) {
std::ifstream file(input_file);
if (!file.good()) {
throw std::runtime_err... | true |
850d4be8082289b459ffc3d24b90db68c591034b | C++ | NCCA/Sponza | /src/Mtl.cpp | UTF-8 | 14,855 | 2.609375 | 3 | [] | no_license | #include "Mtl.h"
#include <fstream>
#include <ngl/NGLStream.h>
#include <ngl/Texture.h>
#include <ngl/ShaderLib.h>
#include <list>
#include <ngl/pystring.h>
namespace ps = pystring;
bool Mtl::load(const std::string &_fname)
{
std::fstream fileIn;
fileIn.open(_fname.c_str(), std::ios::in);
if (!fileIn.is_open())... | true |
b8c51f811638b771d4a12921cf95186f8087996b | C++ | TASUIT-Inc/CGT-Year-3-Labyrintian | /CodeMeat/src/CodeMeat_Core/Objects/LoaderParams.cpp | UTF-8 | 8,225 | 2.75 | 3 | [] | no_license | #include "LoaderParams.h"
void LoaderParams::CreateCube()
{
DrawMode = GL_TRIANGLES;
float px = 0.1f; float nx = -0.1f;
float py = 0.1f; float ny = -0.1f;
float pz = 0.1f; float nz = -0.1f;
Vertex p1, p2, p3, p4, p5, p6, p7, p8;
//face layout
/*Front Face: p1 --- p2 Left Face: p6 --- p1 Back Face: p5 --- p... | true |
a3dc599d4bfcdc72eb2d01df3198f0da73ba0624 | C++ | dimritium/Code | /ProEuler/19.cpp | UTF-8 | 656 | 2.640625 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int ro,col,coln,n,x,t;
cin>>t;
while(t--)
{
cin>>n;
int a[n][n];
for(... | true |
5e8567be4ea3b2ba8cc0419ce4da30679a428fbd | C++ | snoplus/oxsx | /examples/plot/ROOTOut.cpp | UTF-8 | 1,135 | 3.359375 | 3 | [] | no_license | /*
Demonstrates how to render 1 or 2 D histograms/BinnedPdfs to ROOT
histograms
*/
#include <BinnedED.h>
#include <DistTools.h>
#include <Histogram.h>
#include <TH1D.h>
#include <TH2D.h>
int main(){
// 1D example
// Make a dummy histogram
AxisCollection axes;
axes.AddAxis(BinAxis("name", 0, 10, 1... | true |
ba4c40e33ebb1821cef19c7502d28c4a725fb048 | C++ | sameerad2001/myGeekForGeeksPracticeQuestions | /Stack/Medium/Remove K Digits/main3.cpp | UTF-8 | 820 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <stack>
#include <algorithm>
using namespace std;
// https://www.youtube.com/watch?v=3QJzHqNAEXs
string removeKdigits(string s, int k)
{
int n = s.size();
stack<int> st;
if (k == 0)
{
return s;
}
for (int i = 0; i < n; i++)
{
int number = s[i]... | true |
c4e5d90439424212d8117637d66ce80667f57ebc | C++ | ShinDongHwans/BaekJoon | /여러_개씩_묶어_큰값_골라_배열_만들기.cpp | UTF-8 | 452 | 2.828125 | 3 | [] | no_license | #include <stdio.h>
int min(int x, int y){
if(x>y)
return x;
else
return y;
}
int main(){
int n, g;
int m[100]={};
int minor;
int range;
scanf("%d %d", &n, &g);
for(int i=0;i<n;i++){
scanf("%d", &m[i]);
}
if(n%g!=0)
range = n/g+1;
else
range = n/g;
for(int i=0;i<range;i++){
minor=-1000;
for(i... | true |
d151c0afc52f3ac086c9256b6b29f2fbbbb71884 | C++ | joyfish/Coco2d-xRes | /cocos2d设计模式/二段构建.cpp | UTF-8 | 6,449 | 3.484375 | 3 | [] | no_license | 二段构建
所谓二段构建,就是指创建对象时不是直接通过构建函数来分配内存并完成初始化操作。取而代之的是,构造函数只
负责分配内存,而初始化的工作则由一些名为initXXX的成员方法来完成。然后再定义一些静态类方法把这两个阶段组
合起来,完成最终对象的构建。因为在《Cocoa设计模式》一书中,把此惯用法称之为“Two Stage Creation”,即“二段
构建”。因为此模式在cocos2d里面被广泛使用,所以把该模式也引入过来了。
1.应用场景:
二段构建在cocos2d-x里面随处可见,自从2.0版本以后,所有的二段构建方法的签名都改成create了。这样做的好处是
一方面统一接口,方便记忆,另一方面是以前的类似Cocoa的命... | true |
562590605821f2d4a42cbe74d88864c49fd4be38 | C++ | rocky946/data-structure-course | /chapter09/seq_list.cpp | UTF-8 | 328 | 2.65625 | 3 | [] | no_license | // 顺序表基本运算算法
#include <stdio.h>
#include "seq_list.h"
void CreateList(RecType R[], KeyType keys[], int n) {
for (int i = 0; i < n; ++i) {
R[i].key = keys[i];
}
}
void DispList(RecType R[], int n) {
for (int i = 0; i < n; ++i) {
printf("%d ", R[i].key);
}
printf("\n");
}
| true |
382c8627933f6c0ad9376d869943a45b82c258c4 | C++ | LuizaPizzi/VItA | /structures/tree/SproutingVolumetricCostEstimator.cpp | UTF-8 | 3,237 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /* SPDX-License-Identifier: Apache-2.0 */
/* Copyright 2020 Gonzalo Maso Talou */
/*
* SproutingVolumetricCostEstimator.cpp
*
* Created on: Apr 11, 2018
* Author: Gonzalo D. Maso Talou
*/
#include "SproutingVolumetricCostEstimator.h"
#include "../vascularElements/SingleVessel.h"
SproutingVolumetricCostEsti... | true |
b166dc7f48720d0535307dbca979a223d3e13bc2 | C++ | tanjot/Code-Practice | /hashTable_RansomNote.cpp | UTF-8 | 3,558 | 3.15625 | 3 | [] | no_license | //******PROBLEM STATEMENT - Hash Tables : Ransom Note******/
//A kidnapper wrote a ransom note but is worried it will be traced back to him. He found a magazine and wants to know if he can cut out whole words from it and use them to create an untraceable replica of his ransom note. The words in his note are case-sensit... | true |
8c2269e8eb1fe369cf7c03b8f835cb269a5e496a | C++ | ADFLin/GameProject | /Engine/Math/Vector2.h | UTF-8 | 1,480 | 3.125 | 3 | [] | no_license | #ifndef Vector2_h__
#define Vector2_h__
#include "Math/Base.h"
#include "TVector2.h"
namespace Math
{
class Vector2 : public TVector2< float >
{
public:
Vector2() = default;
constexpr Vector2(Vector2 const& rhs) = default;
template< class T >
constexpr Vector2(TVector2< T > const& rhs) :TVector2<float>(rh... | true |
8072b68b291ff23cc757c88cb16695bbbdc83006 | C++ | zeta1999/TrilateralMap | /Mesh.cpp | UTF-8 | 6,020 | 3.03125 | 3 | [] | no_license | #pragma once
#include "Mesh.h"
#include <cmath>
void Mesh::loadOff(char* name)
{
FILE* fPtr = fopen(name, "r");
char str[334];
fscanf(fPtr, "%s", str);
int nVerts, nTris, n, i = 0;
float x, y, z;
fscanf(fPtr, "%d %d %d\n", &nVerts, &nTris, &n);
while (i++ < nVerts)
{
fscanf(fPtr, "%f %f %f", &x, &y, &z);
... | true |
d8728a7c9f24a39598ac41620124d41000296e26 | C++ | Yixi-sha/datastructure_new | /dataStructureLib/src/dynamicarray.cpp | UTF-8 | 3,295 | 3.296875 | 3 | [] | no_license | #ifndef DYNAMICARRAY_CPP
#define DYNAMICARRAY_CPP
#include "../inc/dynamicarray.h"
namespace yixi {
template <typename T>
void DynamicArray<T>::memCopy(T* dis, T* src, int N)
{
for(int i = 0; i < N ; i++)
{
dis[i] = src[i];
}
}
template <typename T>
void DynamicArray<T>::update(T* newMem, int ne... | true |
27379f5f0e2faa751fcd4fe7b1a3a7ee9e795f0e | C++ | humorbei/ThicknessGauge | /ThicknessGaugeNullSaver/ThicknessGaugeNullSaver.cpp | UTF-8 | 948 | 2.71875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSL-1.0"
] | permissive | // ThicknessGaugeNullSaver.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <opencv2/core/mat.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/videoio/videoio_c.h>
#include <opencv2/imgcodecs.hpp>
void save_null() {
std::string f... | true |
90841dd3e00615a2d0118cad04f11eb6a3731560 | C++ | xiays146/ComputerRoomManagementSystem_V0 | /admin.cpp | GB18030 | 3,507 | 3.21875 | 3 | [] | no_license | #include "admin.h"
#include "mianFunction.h"
Admin::Admin() {}
Admin::Admin(string name, string password) {
name = name;
password = password;
initVector();
}
//˵
void Admin::openMenu() {
cout << "\t+----------------+\n";
cout << "\t| 1.˺ |\n";
cout << "\t| 2.鿴˺ |\n";
cout << "\t| 3.鿴 |\n";
cout << ... | true |
659db987c5c126849f0277dfe405d783d9317f52 | C++ | olejniczakmarcin/Implementacja-List | /ListaDwukierunkowa/main.cpp | UTF-8 | 578 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include "BidirectionalList.h"
int main()
{
BidirectionalList* head = new BidirectionalList(2);
head->AddToTheEnd(3);
head->AddToTheEnd(2);
head->AddToTheEnd(1);
head = head->AddToTheBegining(11);
head->PrintNext();
head->PrintPrev();
std::cout<<"rozmiar listy "<< head->Size() << "\n";
he... | true |
46e96889927a1732a181108c47024561940a44b8 | C++ | code0monkey1/Competitive | /unique_pairs.cpp | UTF-8 | 766 | 2.65625 | 3 | [] | no_license | /*input
abacaba
*/
#include<bits/stdc++.h>
using namespace std;
//defines
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll long long
#define vii vector< vi >
#define vi vector<int>
#define re(i,a,b) for(int i=int(a);i<int(b);i++)
#define pb push_back
#d... | true |
604b7a1ab06299cd8039a98b0992c57dc1730dae | C++ | rvolosenkov/TP-Patterns | /Game.h | UTF-8 | 5,378 | 2.765625 | 3 | [] | no_license | #ifndef GAME_GAME_H
#define GAME_GAME_H
class CUnit {
public:
virtual void set_strength(unsigned int strength) = 0;
virtual void set_health(unsigned int health) = 0;
virtual void set_intelligence(unsigned int intelligence) = 0;
virtual void set_charisma(unsigned int charisma) = 0;
virtual ... | true |
fcf9fed1736fed8a1e70ddb901ca8f47e2cbb447 | C++ | ForyMurguia/2048 | /2048/GameState.h | UTF-8 | 1,427 | 3.25 | 3 | [] | no_license | #pragma once
#include <stdint.h>
#include <stdlib.h>
#include <iostream>
#include <string>
using namespace std;
const uint8_t BOARD_SIZE = 4;
enum InputDirection {
UP, RIGHT, LEFT, DOWN, NONE, UNDO,
};
const string inputNames[6] = { "UP", "RIGHT", "LEFT", "DOWN", "UNDO", "NONE" };
const int64_t tilePoints[4][4] = ... | true |
664af144d6ec086a1e65a56dfb33e06ef0547c44 | C++ | netogallo/rainbow | /src/FileSystem/FileSystem.h | UTF-8 | 2,391 | 2.703125 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2010-16 Bifrost Entertainment AS and Tommy Nguyen
// Distributed under the MIT License.
// (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
#ifndef FILESYSTEM_FILESYSTEM_H_
#define FILESYSTEM_FILESYSTEM_H_
#include <system_error>
#include "FileSystem/Path.h"
namespace r... | true |
51fefdd4515a528eb9f1eadf4137fc80ae836fa5 | C++ | Synodiporos/TestC | /Test/src/Model/Task.h | UTF-8 | 633 | 2.5625 | 3 | [] | no_license | /*
* Task.h
*
* Created on: 27 �α� 2018
* Author: Synodiporos
*/
#ifndef MODEL_TASK_H_
#define MODEL_TASK_H_
class Task {
public:
Task(const char* name, unsigned short duration);
Task(const char* name, unsigned short duration, bool editable);
virtual ~Task();
void setName(const char* ... | true |
e216e6912d3c41eb9bb996fcbf69bf346a617376 | C++ | Miautawn/VU_OP_Uzduotis2_2 | /Extensions/student_functions.cpp | UTF-8 | 5,575 | 2.96875 | 3 | [] | no_license | #include "student_functions.hpp"
//funkcija, kuri palygina du studentus pagal pavardę ar vardą
bool student_compare_names(Student l_student, Student r_student)
{
return (l_student.get_last_name() == r_student.get_last_name()) ?
l_student.get_name() < r_student.get_name() :
l_student.get_last_name()... | true |
93c01c43ec01ece3e1be4066f3aa55ed84df5912 | C++ | souvikxyz/Algorithms | /binary-tree-problems/kth-largest-element.cpp | UTF-8 | 1,183 | 4 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *left, *right;
Node(int data);
};
Node ::Node(int data)
{
this->data = data;
}
void kth_largest_element(Node *root, int k, int &count)
{
if (root != NULL && count < k)
{
kth_largest_element(root->righ... | true |
19c2adb194c3e5aadcb19f08052c7517ce575022 | C++ | Makaronodentro/imperial | /cpp/revision/practice_tests/piglatin.cpp | UTF-8 | 2,372 | 3.046875 | 3 | [] | no_license | #include "piglatin.h"
int findFirstVowel(const char* str){
int c = 0;
if(tolower(str[0]) == 'y'){
str++;
c++;
}
while(str[0] && !isVowel(str[0])){
str++;
c++;
}
if(str[0] == 'y'){
str++;
if(!str[0]){
c++;
}
... | true |
d3265f3330f69614742cb4be560a6dcc76a8b75c | C++ | amrufathy/Interpreter | /src/Hash.cpp | UTF-8 | 2,522 | 3.578125 | 4 | [] | no_license | #include "Hash.h"
hash::hash() /**Constructor*/
{
for(int i=0; i<tablesize; i++)
{
hashtable[i]=new VAR;
hashtable[i]->name="empty";
hashtable[i]->value=0;
hashtable[i]->next=NULL;
}
}
/**must be changed*/
int hash::Hash(string key)
{
int hash=0;
int index;
fo... | true |
c7162b19548cc3d9f63360535e169cc3b2c23dc0 | C++ | PeymanJahangirlou/DSS_NCP_TAKE_HOME_EXERCISE_V5 | /Mproject/GLApp/GLApp/JsonParser.h | UTF-8 | 2,365 | 2.703125 | 3 | [] | no_license |
/*
* Disney DSS-NCP Take Home Exercise v5
*
* @author Peyman Jahangirlou
* @brief Json Parser class:
* - load json from web then read movies from home url (default mode)
* - load json from web then read movies from erf url (default mode)
* - then populates MovieContainer map.
*/
#ifndef JsonPa... | true |
5b6e8880d4d775aeccd43c69a2a6222ec3bfa0f2 | C++ | jpborsi/learn-cpp-codejam | /2017/1-B/1B-B.cpp | UTF-8 | 2,857 | 3 | 3 | [] | no_license | //2017 Round 1B, Problem B
#include <iostream>
#include <string>
#include <map>
#include <set>
using namespace std;
string illegalStrings[] = {"RR","OO","YY","GG","BB","VV",
"RO","OR","RV","VR","OY","YO","OG","GO","OV","VO","YG","GY",
"BG","GB","BV","VB","GV","VG"};
set<string> illegal(illegalStrings,illegalStrings+... | true |
45778d400b16d31a82ee2612520165f3954a52cf | C++ | DevwratJoshi/VolBot-Velocity-Verlet-sim | /src/test.cpp | UTF-8 | 13,744 | 2.734375 | 3 | [] | no_license | /*
* volbot_classes.cpp
* The force on the robot will edit the velocity, which will edit the position
* The functions will be run for all the particles, and the new values will edit the new frame
* of the simulation
* Created on: Oct 29, 2018
* Author: dev
*/
#include "volbot_classes.h"
#include<iostream>
... | true |
8427e553224412553464432214f76660aa37854d | C++ | DeepF02/Apnikaksha-C-DSA-Playlist | /code66.cpp | UTF-8 | 408 | 3.078125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int decimalToOctal(int n){
int ans=0;
int x=1;
while(x<n){
x*=8;
}
//x/=2;
while(x>0){
int lastdigit = n/x;
n -= lastdigit*x;
x/=8;
ans = ans*10 + lastdigit;
}
return ans;
}
int32_t main(){
int n... | true |
96edb289986adc550fe7178449cd7e37a22198c0 | C++ | blizmax/PSRayTracing | /src/Common.h | UTF-8 | 964 | 2.890625 | 3 | [
"Apache-2.0",
"CC0-1.0"
] | permissive | #pragma once
// A collection of things (most likely defines or datatypes) that should be common across the project
#include <limits>
// adding `noexcept` to your functions usually results in a perf. boost. It's here as a toggable flag
// to show the effects of it happening (or not)
#ifdef USE_NOEXCEPT
#define ... | true |
69de181779a89d2a1b8e33b7e42ccfc49b2c63d0 | C++ | graynet-dev/aHomeBus | /ahb_io_din.h | UTF-8 | 4,611 | 2.8125 | 3 | [] | no_license | /**
aHomeBus io module - digital inputs
@copyright 2019 Ivan Raspopov
Based on aSysBus - 2015-2017 Florian Knodt, www.adlerweb.info
Based on iSysBus - 2010 Patrick Amrhein, www.isysbus.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Gene... | true |
28e1fba43f84a801565f1d2523854aab724770b0 | C++ | fathonyfath/quez-cpp | /quez/bullet.h | UTF-8 | 891 | 2.875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "game_object.h"
class Bullet : public GameObject {
public:
Bullet(SpriteRenderer* renderer, Texture2D* sprite, glm::vec3 size, float speed) : GameObject(renderer, sprite, size), speed(speed) {
collider.p = colliderPos;
collider.r = 9.0f;
};
void update(GameEngine* e... | true |
97d76c2ad177664d76b7acc521abf15906272e1e | C++ | feelfreelinux/td | /td/telegram/files/ResourceState.h | UTF-8 | 2,488 | 2.609375 | 3 | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference",
"JSON"
] | permissive | //
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2018
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/common.h"
#include "td/utils... | true |
65164fc41fced925ace3c68ac5c8708eb9031f1d | C++ | Budziaszek/Macau-multiplayer-card-game | /src/graphics/CardsImages.cpp | UTF-8 | 3,439 | 2.796875 | 3 | [] | no_license | //
// Created by Magdalena on 18.09.2020.
//
#include "CardsImages.h"
bool CardsImages::load(const std::string &tileset, sf::Vector2u tileSize) {
if (!texture.loadFromFile(tileset))
return false;
vertex = new sf::VertexArray[52];
size = tileSize;
for (unsigned int tileNumber = 0; tileNumber ... | true |
0e7a64aec3c281ea90e83371c14c26a8a31c6db4 | C++ | ria317/cpp_workspace | /210615_study/inorder_tree.cpp | UTF-8 | 2,913 | 3.59375 | 4 | [] | no_license | #include <iostream>
#include <stack>
#include <queue>
using namespace std;
typedef struct Node {
int value;
Node *left;
Node *right;
Node(int val) {
value = val;
left = nullptr;
right = nullptr;
}
} Node;
char canvas[100+10] = {0};
void print_tree(Node* root) {
///... | true |
d239c8cc64d999564195c78491769cd37048c6f5 | C++ | SvyatVasik/OOP_LAB_02 | /Lab_02/Lab_02.task_02/Source.cpp | WINDOWS-1251 | 2,150 | 3.828125 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Time {
private:
int *hour;
int *minute;
int *second;
public:
Time();
Time(int h, int m, int s);
Time(const Time &one);
~Time();
void SetHour(int svhour);
void SetMinute(int svminute);
void SetSecond(int svsecond);
int GetHour();
int GetMin... | true |
e018c709ec81517165723b038bdb1a3a5704cec3 | C++ | yenjorda/BruinNav | /BruinNav/MyMap.h | UTF-8 | 3,888 | 3.578125 | 4 | [] | no_license | // MyMap.h
// Skeleton for the MyMap class template. You must implement the first six
// member functions.
#ifndef MYMAP_H
#define MYMAP_H
#include <string>
#include <queue>
#include "support.h"
template<typename KeyType, typename ValueType>
class MyMap
{
public:
MyMap();
~MyMap();
void clear();
int size() const... | true |
a936568dd7e165439cac0d64e4380fcf393cc67c | C++ | HoangNguyen174/ModelExporterLoader | /SoulStoneEngine/SimpleMaterial.cpp | UTF-8 | 1,457 | 2.59375 | 3 | [] | no_license | #include "SimpleMaterial.hpp"
#include "./Render/GLRender.hpp"
SimpleMaterial::SimpleMaterial(const std::string& name, OpenGLShaderProgram* shaderProgram)
{
m_materialName = name;
m_shaderProgram = shaderProgram;
}
void SimpleMaterial::SetUniformValues()
{
glUniform1i( m_shaderProgram->m_diffuseTextureUniformLoc, ... | true |
c2523147cb9b3d371ce3bbecabd036894843fe5d | C++ | yana87gt/procon | /atcoder/diverta2019/c.cpp | UTF-8 | 779 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
int main(void){
int n;
cin >> n;
int cnt = 0, x = 0, y = 0, z = 0;
rep(i,n){
string s;
cin >> s;
int m = s.size();
rep(j,m-1){
if (s[j] == 'A' && s[j+1] == 'B'){
... | true |
7857937ae9a7a376df6995e52cc72269ee575ab3 | C++ | haoping07/Leetcode-notes | /C++/83-Remove_Duplicates_from_Sorted_List.cpp | UTF-8 | 1,594 | 4.1875 | 4 | [] | no_license | /*
83. Remove Duplicates from Sorted List (Easy)
Notes:
1. fast-slow pointer - O(n)
Use Two pointers to scan the list, if the two pointers' value are the same, move fast pointer backward, else, slow
pointer's next points to fast pointer node, slow pointer points to fast pointer's node.
2. One poiner... | true |
04191a5dc676bdcaf362485272abce4a5c74e176 | C++ | theonenottaken/E-commerce-with-Cpp | /Server/UDP.cpp | UTF-8 | 2,078 | 3.109375 | 3 | [] | no_license |
/*******************************************************************************************
* Student Name: Caleb Shere Benjmin Wexler
* Exercise Name: Targil 5
* File Description: UDP.cpp
*******************************************************************************************/
#include "UDP.hpp"
#include <sy... | true |
0735abb4a988fdd736d5c7eca34851e2fe4c4c83 | C++ | Robotik-MOLQ/Robocup-Program | /robocupGreenlight_21_6/fahren.cpp | UTF-8 | 1,620 | 2.5625 | 3 | [] | no_license | #include <Arduino.h>
#include "fahren.h"
#include "meinePins.h"
#include <SPI.h>
byte PEData;
void schreibePEData(byte data) {
digitalWrite(LICHT_CS, LOW);
SPI.transfer(data);
digitalWrite(LICHT_CS, HIGH);
}
byte Taster=0;
int leseTaster() {
digitalWrite(LICHT_CS, LOW);
delayMicroseconds(10);
digitalWrite... | true |
6e7c545db27df6b93e04f7e11670a1a3ae48c02f | C++ | zhanll/LearnOpenGL | /LearnOpenGL/src/Mesh.h | UTF-8 | 685 | 2.65625 | 3 | [] | no_license | #pragma once
#include <glm/glm.hpp>
#include <string>
#include <vector>
#include <memory>
#include "Texture.h"
class Shader;
struct Vertex {
glm::vec3 Position;
glm::vec3 Normal;
glm::vec2 TexCoords;
glm::vec3 Tangent;
glm::vec3 Bitangent;
};
class Mesh {
public:
// mesh data
std::vector<Vertex> vertic... | true |
54c28a4d7fba37a1f5ca34356f83dcd1e4ade2b3 | C++ | divadsn/Codeforces | /358a.cpp | UTF-8 | 730 | 3.140625 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
long *L = new long[n - 1];
long *R = new long[n - 1];
long lp, cp;
cin >> lp;
for (int i = 0; i < n - 1; i++) {
cin >> cp;
if (cp < lp) {
L[i] = cp; R[i] = lp;
} else {
L[i] = lp; R[i] = cp;
}
lp = ... | true |
5dc5109a808231e81026d4e24a5284d9867db98b | C++ | ricardojamaia/FarmerFour | /lib/Controller/src/Controller.h | UTF-8 | 2,373 | 2.65625 | 3 | [
"MIT"
] | permissive | //
// Created by Ricardo Maia on 09/06/2020.
//
#ifndef FARMFOUR_CONTROLLER_H
#define FARMFOUR_CONTROLLER_H
#define CTRL_MAX_NUM_VALVES 3
#define CTRL_VALVE_OUT_PINS {24, 26, 28}
#define CTRL_PUMP_OUT_PIN 22
#define FF_CTRL_EEPROM_ADDR_CRC 0x00
#define FF_CTRL__EEPROM_ADDR_CONFIG 0x10
#include <TimeLib.h>
#incl... | true |
9e94acce308d1ba8d071a50c29625edcc2c6a21c | C++ | nowacoder/cpp-nowcoder | /HJ030_Proc_Comb_Str.cpp | UTF-8 | 1,465 | 3.265625 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <algorithm>
using namespace std;
char convert(char c) {
if ((c>=48 and c<=57) or (c>=65 and c<=70) or (c>=97 and c<=102)) {
if (c=='0' or c=='6' or c=='9') return c;
else if (c=='f' or c=='F') return 'F';
else if (c=='1') return '8';
e... | true |