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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
650997f919e507d4e030362e35977fe9f2190f59 | C++ | adarshkumar8225/practice_c- | /remove_loop.cpp | UTF-8 | 1,985 | 3.734375 | 4 | [] | no_license | //removal of loop present in linked list in O(N) complexity.........................
//detect loop using two pointer one incremented by one position and other by two position
//count the number of nodes in the loop by keeping one pointer at meeting point and other incrementing
//now take a pointer pointing to node and ... | true |
d9f663882f144c465d74342686d8ebeb46a70552 | C++ | chen8913w/my-acm-solutions | /algo/sort/quicksort.hpp | UTF-8 | 3,101 | 3.5625 | 4 | [] | no_license | /**
* QuickSort
*
* Divide:
* Partition (rearrange) the array A[p..r] into two (possibly empty)
* subarrays A[p..q-1] and A[q+1..r] such that each element of A[p..q-1]
* is less than or equal to A[q] which is, in turn, less than or equal to
* each elemen of A[q+1..r]. Compute the index q as part... | true |
e9c440dcdef5487ba9f628b7900d52b08ec98de5 | C++ | davidad/kokompe-old | /engine/gui_console.h | UTF-8 | 1,265 | 2.75 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <list>
class gui_console
{
private:
std::vector< std::string > screen_buffer;
std::string command_buffer;
int cursor_position;
std::vector< std::string > command_history;
int command_history_... | true |
9d972596e8dffcf4db42ad149eb2b748978d4d41 | C++ | schick/TrafficSim | /scenario_ref/include/model/Lane.h | UTF-8 | 1,228 | 2.96875 | 3 | [] | no_license | //
// Created by oke on 07.12.18.
//
#ifndef PROJECT_LANE_H
#define PROJECT_LANE_H
#include <vector>
#include <inttypes.h>
#include <iostream>
#include <algorithm>
#include <mutex>
#include "TrafficLight.h"
class Car;
class Road;
class Lane {
public:
void sortCars();
std::vector<Car *> const &getCars() ... | true |
6b957ad35a1a37196fd7126825cb02fb75736632 | C++ | NGPONG/code | /cpp/CPP-Study-01/TEST/TEST_14/main.cpp | UTF-8 | 1,378 | 3.515625 | 4 | [] | no_license | #include <iostream>
using namespace std;
#include <string.h>
class BASE {
friend ostream &operator<<(ostream &out, BASE _base) {
for (size_t i = 0; i < _base.m_capacity; i++) {
cout << _base.m_container[i] << "\t";
}
return out;
};
public:
BASE(int _capactiy) {
cout << "BASE CONSTRUCTOR" ... | true |
ef4d0b83391099acde9d2325804ce5f4303166c4 | C++ | liyupi/poj | /easy/3672.cpp | UTF-8 | 784 | 2.515625 | 3 | [] | no_license | // http://poj.org/problem?id=3672
#include <iostream>
using namespace std;
const int MAXN = 100001;
int M, T, U, F, D;
char c[MAXN];
int main() {
while (~scanf("%d%d%d%d%d", &M, &T, &U, &F, &D)) {
int res = 0;
int sum = 0;
for (int i = 0; i < T; ++i) {
scanf("\n%c", &c[i]);
... | true |
a8ab67b9662aec94c6e59662a975d8c93e139991 | C++ | king1224/Cheng_Kung_University | /data_structure/hw/hw3/資結Hw3_1.cpp | BIG5 | 1,834 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
int main()
{
int i,j,n,k,pos=1,rec=0,temp=0,count_word=1,opr[100]={0};
//oprϤBl B⤸ count_wordΨxs@XչB⤸+Bl
//recΨӼȦsUչB⤸ tempΨxsչB⤸Xb@_ɪ
//posbBɹm
int a[100]={0}; //sinput
int b[100]={0}; //BȦs
printf("Please input a prefix expression.\n");
i=1;
do{ //rJ0
... | true |
d5547ba2908ca1d73d05729728d3bd7b84abe67a | C++ | GABRIELMUTTI/utl | /include/utl/memory/Handle.hpp | UTF-8 | 789 | 3.0625 | 3 | [] | no_license | #pragma once
#include "IPool.hpp"
namespace utl
{
using uint = unsigned int;
template<class T>
class Handle
{
protected:
IPool<T>* pool;
uint index;
bool validity;
public:
Handle() :
pool(nullptr),
index(0),
validity(false)
{
}
Handle(IPool<T>& pool, uint in... | true |
5d6949bba07a4d361209bf1fdb14340fae09c567 | C++ | qsphan/the-omega-project | /basic/include/basic/Collection.h | UTF-8 | 1,315 | 3.09375 | 3 | [
"BSD-2-Clause"
] | permissive | #if !defined Already_Included_Collection
#define Already_Included_Collection
//#include <basic/enter_Iterator.h>
//#include <basic/enter_Collection.h>
namespace omega {
template<class T> class Iterator;
template<class T> class Any_Iterator;
/*
* protocol for any kind of collection
*/
template<class T> class Co... | true |
eaa67ab4976f15033016747ccd20a301cce40b65 | C++ | patentfox/PPPCpp | /ch6/ex2.cpp | UTF-8 | 3,302 | 3.5625 | 4 | [] | no_license | #include "std_lib_facilities.h"
class Token
{
public:
char kind;
double value; // only relevant if kind is '8'
Token() { }
Token (char ch): kind(ch) { }
Token (char ch, double val): kind(ch), value(val) { }
};
//-------------------------------------------------------
class Token_stream
{
public:
Token_... | true |
0b812bf902c9044b1366c5ddb2ad71ed0fddf910 | C++ | Binyamin-Brion/L-System-Visualizer | /GUI/Output/L_System/ScriptOutputEntry.h | UTF-8 | 2,260 | 2.59375 | 3 | [] | no_license | //
// Created by binybrion on 5/8/20.
//
#ifndef VOXEL_L_SYSTEM_SCRIPTOUTPUTENTRY_H
#define VOXEL_L_SYSTEM_SCRIPTOUTPUTENTRY_H
#include <QtWidgets/QWidget>
namespace Ui
{
class ScriptOutputEntry;
}
namespace GUI
{
namespace Output
{
namespace L_System
{
/**
* Rep... | true |
fc05a7580dc2755286c4a69bae8cb30cc3851cc5 | C++ | tajirhas9/Problem-Solving-and-Programming-Practice | /Codeforces/867-A.cpp | UTF-8 | 547 | 2.8125 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <cstring>
using namespace std;
int main()
{
int n,fromFransisco=0,fromSeatle=0;
char s[200],now;
scanf("%d %s",&n,s);
now = s[0];
for(int i=1;i<n;i++)
{
if(s[i] != now)
{
if(now == 'S')
{
fromSeatle++;
//cout << "Flew from Seatle on day " << i << endl;
now =... | true |
53910e70417d87fa896c89f634539fc159601b07 | C++ | DevMomo/Diffie-Hellman-Arduino | /Diffie_Helman.ino | UTF-8 | 5,202 | 3.0625 | 3 | [] | no_license | /* CMPUT 296/114 - Assignment 1 Part 2 - Due 2012-10-03
Version 1.2 2012-10-01
By: Monir Imamverdi
Michael Nicholson
This assignment has been done under the full collaboration model,
and any extra resources are cited in the code below.
Note on wiring:
grnd->grnd
digital 10 -> digital 11
digitall 11-... | true |
c5a12bea16ce802633bf48ba2a5cd1ca8de5bca4 | C++ | abhinashjain/codes | /codechef/Unionset.cpp | UTF-8 | 2,160 | 3.03125 | 3 | [] | no_license | #include "vector"
#include "iostream"
#include "algorithm"
#define FOR(i,begin,end) for(i=begin;i<end;i++)
#define dontsync() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
int main()
{
dontsync()
int t,n,k,i,j,x,len,tmp,cnt;
cin >> t;
FOR(i,0,t)
{
cin >> n ... | true |
2bc6f3df3fe3e0f087c2fac061179ccc1b6d8c5a | C++ | jbaldwin/libwingmysql | /src/Row.cpp | UTF-8 | 645 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | #include "wing/Row.hpp"
#include <cstring>
namespace wing {
Row::Row(
MYSQL_ROW mysql_row,
size_t field_count,
unsigned long* lengths)
: m_column_count(field_count)
{
m_values.reserve(field_count);
for (size_t i = 0; i < field_count; ++i) {
auto* mysql_value = mysql_row[i];
st... | true |
f6672dcd107d8fa4afab615de1b1ee2c8c93bc1a | C++ | wzit/Srl | /src/tests/Misc.cpp | UTF-8 | 9,795 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "Tests.h"
#include "BasicStruct.h"
#include <list>
#include <memory>
using namespace std;
using namespace Srl;
using namespace Tests;
bool test_node_api()
{
string SCOPE = "Api test";
print_log("\tNode api...");
try {
Tree tree;
auto& root = tree.root();
root.insert("fi... | true |
7c8ed788e46600ee1eafedc738c06c3e27241b34 | C++ | ianCSMajor/lab3 | /op_test.hpp | UTF-8 | 730 | 2.859375 | 3 | [] | no_license | #ifndef __OP_TEST_HPP__
#define __OP_TEST_HPP__
#include "gtest/gtest.h"
#include "op.hpp"
TEST(OpTest, OpEvaluateNonZero) {
Op* test = new Op(8);
EXPECT_EQ(test->evaluate(), 8);
}
TEST(OpTest, OpPrintNonZero) {
Base* test = new Op(8);
EXPECT_EQ(test->stringify(), "8.000000");
}
TEST(OpTest, OpEvalua... | true |
419e6ba40e0dd8557f3948e540ffc034f7336991 | C++ | Stiffstream/habrhabr_article_2_ru | /dev/common/io_agent.hpp | UTF-8 | 3,374 | 2.8125 | 3 | [] | no_license | #pragma once
#include <common/stuff.hpp>
//
// Сообщения, которые необходимы для взаимодействия IO-агента с внешним миром.
//
// Запрос на загрузку содержимого файла.
struct load_email_request
{
// Имя файла для загрузки.
string email_file_;
// Куда нужно прислать результат.
mbox_t reply_to_;
};
// Успешный... | true |
329656643a711b405066b0d57155e7bd5901d516 | C++ | matt-barron/lab_review | /test.cpp | UTF-8 | 512 | 2.734375 | 3 | [] | no_license | #include <iostream>
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "funcs.h"
#include "doctest.h"
// Write test cases here
TEST_CASE("Task A"){
REQUIRE(removeLeadingSpaces(" int x = 1; ") == "int x = 1; ");
REQUIRE(removeLeadingSpaces(" hello .") == "hello .");
REQUIRE(removeLeadingSpaces(" wor... | true |
89eced553798f6b7a88ddbc5ae2d451331722e90 | C++ | Debashish-hub/100-Days-Of-Coding | /Day 70/check if string is rotated by 2 places.cpp | UTF-8 | 1,261 | 3.90625 | 4 | [] | no_license | // Check if string is rotated by two places
// Given two strings a and b. The task is to find if the string 'b' can be obtained by rotating another
// string 'a' by exactly 2 places.
// { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
/... | true |
629491f67c158c71f7be2c34daf37e2bdf35805a | C++ | JustLikeTT/DarkChess | /DarkChess/main.cpp | UTF-8 | 2,338 | 2.59375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include "KAI.h"
#include <iostream>
using namespace std;
// commands enumerate
enum COMMANDS {
PROTOCOL_VERSION = 0, // 0
NAME, // 1
VERSION, // 2
KNOWN_COMMAND, // 3
LIST_COMMANDS, // 4
QUIT, // 5
BOARDSIZE, // 6
... | true |
0d23185d5c67a3c48c1bb3a93528c8d29f86228e | C++ | Wanna-SSJ/Coding-Interviews | /ZY - Coding-Interviews Of Order/面试题24:反转链表/ReverseList.cpp | GB18030 | 1,315 | 3.953125 | 4 | [] | no_license | // 24ת
// Ŀһһͷ㣬תת
// ͷ㡣
#include<stdio.h>
#include<stdlib.h>
#include "LinkList.h"
BNode* ReverseList(BNode* pHead)
{
if (pHead == NULL)
{
return NULL;
}
BNode *pReversedHead = NULL;
BNode *pNode = pHead;
BNode *pPrev = NULL;
while (pNode != NULL)
{
BNode *pNext = pNode->next;
if (pNext == NULL)
{
... | true |
0a4ce6958c92b1245c3bbeef52abcaae9843ed52 | C++ | jonathan-mcmillan/csci4650_lab2 | /Part_2/part_2.cpp | UTF-8 | 10,862 | 2.875 | 3 | [] | no_license | // Oliver Grassmann & Jonathan McMillan
// 1 Nov 2019
// CSCI 4650 - Computer Security
// Programming Assignment 2 - Part 2
/*
1. Take the filenames of the plaintext message, the encrypted session key, the third-party public key, and your private key as command-line parameters.
2. Use the third-party public key to decr... | true |
9b38e4fcfd4ddee96ff73d9bd2cb36cbd8094c84 | C++ | yycccccccc/Leetcode | /061.Rotate List.cpp | UTF-8 | 2,100 | 3.796875 | 4 | [] | no_license | 题意:
根据指定值n旋转链表n次。
思路:
1.设置一个dummy头结点便于最后返回操作,p指针指向当前结点,pre指向p之前的结点
2.依次循环,当p不存在的时候把pre指向NULL,p->next = 头结点,注意是头结点不是head,因为head没有根据旋转同步更新
3.直到k=0的时候输出dummy->next
4.因为k值有可能非常大,因此需要首先计算出链表的长度,用k对链表的长度取余,即最小旋转次数。
计算链表长度的时候需要从1开始计数。
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNo... | true |
1ad725e17c6133c32af5e464c4351caaf35b493d | C++ | bdobrzycki/NAVEX | /dualQuat.h | UTF-8 | 3,223 | 2.953125 | 3 | [] | no_license | #ifndef __DUAL_QUATERNION_H__
#define __DUAL_QUATERNION_H__
#include <assert.h>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include "quat.h"
//#include "vector3.h"
//#include "vector4.h"
namespace GrapheneMath
{
template <typename Scalar>
class DualQuaternion
... | true |
910b42e5d0467a68f63144a754d0476b92e0da55 | C++ | FoolBit/ssA | /Section4/1.cpp | UTF-8 | 1,169 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <string>
#include <set>
using namespace std;
struct Pattern
{
int size;
set<int> p[51];
void init(string s)
{
size = 0;
int len = s.length();
int i=0;
for( ; i<len; ++i)
{
if(s[i]!='[')
{
... | true |
38267cd5c4c01230e034a40323d5e9e40b9501f6 | C++ | katlegoEnoch/AntiPede | /game-source-code/GameController.cpp | UTF-8 | 8,530 | 3 | 3 | [] | no_license | //File_name: GameController.cpp
//Author: Stax The Engipreneur
//Date: 31 August 2018
//Details:
#include "GameController.h"
#include <iostream>
using namespace std;
/*Ran into scope issues and window was only open in the function in which the renderWindow function is called*/
//window dimensions
//func... | true |
8ad027c72ca8064f6a252f2a83c22c155492b8b4 | C++ | TeamProjectTCA/CommunicationEvent2018 | /Mirror/Common/Drawer.h | SHIFT_JIS | 2,407 | 2.546875 | 3 | [] | no_license | #pragma once
#include "smart_ptr.h"
#include "Base.h"
#include "const.h"
#include <list>
#include <array>
PTR( Drawer );
PTR( Color );
class Drawer : public Base {
public:
enum FONTSIZE_TYPE {
SMALL,
NORMAL,
LITTLE_BIG,
BIG,
SUPER_BIG,
FONT_TYPE_MAX
};
public:
Drawer( );
virtua... | true |
a647c80c08312dd72f423453d3e94e0c4a6e0d7c | C++ | ClickHouse/ClickHouse | /src/Storages/System/StorageSystemTableFunctions.cpp | UTF-8 | 1,251 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #include <Storages/System/StorageSystemTableFunctions.h>
#include <TableFunctions/TableFunctionFactory.h>
#include <DataTypes/DataTypesNumber.h>
namespace DB
{
namespace ErrorCodes
{
extern const int UNKNOWN_FUNCTION;
}
NamesAndTypesList StorageSystemTableFunctions::getNamesAndTypes()
{
return
{
... | true |
113c6018ab1948b4e664193d35b8efc47dafa9d2 | C++ | Murami/rtype | /Server/src/Util/WindowDynamicFile.cpp | UTF-8 | 2,021 | 2.640625 | 3 | [] | no_license | #include <stdexcept>
#if defined (WIN32) || defined (_WIN32)
# include <iostream>
# include "WindowDynamicFile.hh"
namespace DynamicFile
{
WindowDynamicFile::WindowDynamicFile()
{
_isOpen = false;
}
WindowDynamicFile::WindowDynamicFile(const std::string& filename)
{
_isOpen = false;
... | true |
6d2f90e7012f1cc9c295a7732f875a825d8a0d9c | C++ | pqnelson/last1120c-cc | /tests/ASTTests/ModifierTests.cc | UTF-8 | 442 | 2.953125 | 3 | [] | no_license | #include <gtest/gtest.h>
#include "AST/Modifier.h"
TEST(ModTest, Ctor)
{
Modifier mod;
ASSERT_EQ(mod.as_int(), 0);
}
TEST(ModTest, OrEq)
{
Modifier arg(Modifier::FuncArgs);
Modifier aut0(Modifier::Auto);
arg |= aut0;
ASSERT_EQ(arg.as_int(), 5);
}
TEST(ModTest, Is_)
{
Modifier mod(Modi... | true |
b6a1ce2a972b7e8bb9cd4c9861f7bd02c282bced | C++ | Arvy1998/Calculus-and-Play-with-New-Syntax | /Sorting_Array_LAB3.cpp | UTF-8 | 794 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int NuskaitytiSeka(int masyvas[], int &kiekis) {
cin >> kiekis;
for (auto i = 0; i < kiekis; i++) {
cin >> masyvas[i];
}
return *masyvas;
}
void SurikiuotiElementus(int masyvas[], int &kiekis) {
int i, j, temp;
for (i = 1; i < kiekis; i++) {
j = i;... | true |
c4211e5499b1d3abf1f730dc00b4638b147d2f38 | C++ | RubensPetrovich/ELEC4cpp | /tp1nico/histogram.cpp | UTF-8 | 2,019 | 3.484375 | 3 | [] | no_license | //
// header-start
//////////////////////////////////////////////////////////////////////////////////
//
// \file histogram.cpp
//
// \brief TP1 histogram
//
// \author Doens Nicolas
//
//////////////////////////////////////////////////////////////////////////////////
// header-log
//
// $Autho... | true |
4117091ac7d4b8939cc5479be349e28b1363f2d3 | C++ | nerzhul250/Marathons | /cppProblems/Conservation.cpp | UTF-8 | 1,688 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define ff first
#define ss second
#define fore(i,a,b) for(int i=a,colchin=b;i<colchin;++i)
#define pb push_back
#define ALL(s) s.begin(),s.end()
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define SZ(s) int(s.size())
using namespace std;
typedef long long int ll;
typedef pa... | true |
ed78005b75661b60c87a7af7bdde7c7b3f3279ad | C++ | wyx150137/wyx-infinity37-ac-code-on-BZOJ | /3613_37.cpp | UTF-8 | 753 | 2.546875 | 3 | [] | no_license |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int mod;
typedef long long LL;
const int N = 5000005;
int a[N],sa,sb,sc,sd,n;
int F(int x)
{
LL ans = 0;
LL x2 = (LL)x*x%mod;LL x3 = x2*x%mod;
ans = (((ans+(LL)sa*x3%mod)%mod+(LL)sb*x2%mod)%mod+(LL)sc*x%mod)%mod+sd;... | true |
25052cdc611274965eedaf9339f5ce0731d3932d | C++ | kaulszhang/base | /include/util/serialization/NVPair.h | GB18030 | 1,633 | 2.890625 | 3 | [] | no_license | // NVPair.h
#ifndef _UTIL_SERIALIZATION_NV_PAIR_H_
#define _UTIL_SERIALIZATION_NV_PAIR_H_
#include "util/serialization/Serialization.h"
namespace util
{
namespace serialization
{
template <typename T> // TǷconst
struct NVPair
: wrapper
{
char const * name_;
... | true |
341d079b0554eb7db8591fa425137e641a891256 | C++ | kimeyongchan/MobileStar | /Client/MobileStar/Classes/GameMap.cpp | UTF-8 | 7,102 | 2.671875 | 3 | [] | no_license | #include "GameMap.h"
#include "NavGraphNode.h"
//생성자
GameMap::GameMap()
: m_pNavGraph(NULL)
, m_pCellSpace(NULL)
, m_iTileX(0)
, m_iTileY(0)
, m_fCellSpaceNeighborhoodRange(1024)
{
}
//소멸자
GameMap::~GameMap()
{
Clear();
}
//맵에서 로드된 것들을 삭제한다.
void GameMap::Clear()
{
//NavGraph를 제거한다.
delete m_pNavGr... | true |
1cfe864053280c466c2ea7c883d2dac89ced1570 | C++ | richard-stern/13PeoplesSky | /13PeoplesSky/project2D/TextureManager.cpp | UTF-8 | 1,776 | 3.40625 | 3 | [
"MIT"
] | permissive | #include "TextureManager.h"
// initialise the instance to nullptr so we know it hasn't been created
TextureManager* TextureManager::m_instance = nullptr;
TextureManager::TextureManager() { }
TextureManager::~TextureManager()
{
// delete all the textures
for (auto pair : m_textures)
delete pair.second;... | true |
7d4e5a7c2f2057bab2204401d4769e14c4d0e9b0 | C++ | antoni-heredia/ED-COMPARTIDO | /Practica2/include/Vector_Dinamico.tpp | UTF-8 | 1,794 | 3.359375 | 3 | [
"MIT"
] | permissive | #ifndef VectorDinamico_tpp
#define VectorDinamico_tpp
#include <cassert>
template <class T>
Vector_Dinamico<T>::Vector_Dinamico(int n){
assert(n>=0);
if (n>0)
datos = new T[n];
nelementos = n;
}
template <class T>
Vector_Dinamico<T>::Vector_Dinamico(const Vector_Dinamico<T> & original){
nelementos = orig... | true |
d7dd810328d567e006a51b82a5606b28e827d3ed | C++ | MajaGruca/CppClass | /lab3/smarttree/SmartTree.cpp | UTF-8 | 3,201 | 3.484375 | 3 | [] | no_license | //
// Created by ktr on 18.03.2017.
//
#include "SmartTree.h"
#include <sstream>
#include <string>
#include <memory>
namespace datastructures{
std::unique_ptr <SmartTree> CreateLeaf(int value)
{
std::unique_ptr<SmartTree> leaf = std::make_unique<SmartTree>();
leaf->value=value;
leaf-... | true |
aba07e0ae169b242b9fe79f7f6add8b946e70c60 | C++ | ZhenyingZhu/ClassicAlgorithms | /src/CPP/src/leetcode/NQueens.cpp | UTF-8 | 3,706 | 3.421875 | 3 | [] | no_license | /*
* [Source] https://leetcode.com/problems/n-queens/
* [Difficulty]: Hard
* [Tag]: Backtracking
*/
#include <iostream>
#include <vector>
#include <string>
using namespace std;
// [Solution]: Use a vector of int to indicate how previous queens locate. Then place queens to available positions.
// [Corner Case]:
c... | true |
2abdc0cdc21d58889809414e8db22960f8e72f5b | C++ | kidlatmc29/cs2430 | /pas/pa4/pa4.cpp | UTF-8 | 1,644 | 3.828125 | 4 | [] | no_license | // Ovalles, Isabel
// pa4.cpp
// 11-2-2020
// DESCRIPTION: Pa 4 creates a Word Heap on a user given size. It is filled up
// with words given by the user as well. Then it prints out the children of
// a given key. Following that, testing for class functions and then the heaps
// are emptied.
// SOURCES: Textbook c... | true |
359d5b8b8961983cfce7824da8c6df7f042e86b8 | C++ | jysandy/exoredis | /binary_string.cpp | UTF-8 | 773 | 2.75 | 3 | [] | no_license | #include "binary_string.hpp"
binary_string::binary_string()
: expiry_set_(false)
{
}
binary_string::binary_string(const std::vector<unsigned char>& bdata)
: expiry_set_(false), bdata_(bdata)
{
}
binary_string::binary_string(const std::vector<unsigned char>& bdata,
long long expiry_milliseconds)
: bda... | true |
c84252427c648f946be0c5986e39b83e3c9b7642 | C++ | EsauPR/NeuralNetwork-ModeladoFuncionesBooleanas-RedMadaline | /src/ModeladoFunciones.cpp | UTF-8 | 5,178 | 2.890625 | 3 | [] | no_license | /*
Modelado de Funciones Booleanas
@author Oscar Esaú Peralta Rosales
@email esau.opr@gmail.com
*/
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string.h>
#include <time.h>
#include "processInput.cpp"
using namespace std;
void readParams( int *T, double *miu, double *factorMiu ); //... | true |
aab3655cc5cb2d6821efd75d29df0be37023eb20 | C++ | KEN8111git/cpp-practice | /main.cpp | UTF-8 | 895 | 3.34375 | 3 | [] | no_license | #include "subclass.hpp"
using namespace std;
int main()
{
int input1, input2;
string mathtype;
string confirm = "yes";
while (confirm == "yes")
{
cout << "What would you do? [add, subtract, multiply, divide]";
cin >> mathtype;
cout << "type the value";
cin >> input1 >> input2;
if (mathty... | true |
1417642ea89d87cf0284d9a73a9587da01ecee3e | C++ | aSimpleUsername/weatherLog | /classes/date/date.h | UTF-8 | 2,488 | 3.703125 | 4 | [] | no_license | // date.h - date class declaration
// author Connor Nicholson - 28 APR 20
#ifndef DATE_H
#define DATE_H
#include <string>
#include <sstream>
/**
* @class Date
* @brief Creates Date object
*
*
* @author Connor Nicholson
* @version 03
* @date 28/04/2020
*
* @todo Nil
* @bug Nil
*
*/
class Da... | true |
792ecaaa0fd83a6731f52db35422513ccf695e2c | C++ | MyCodingLair/arduinoMazeRunner | /mazeRunner2.ino | UTF-8 | 5,641 | 2.90625 | 3 | [] | no_license | /*
=====================================================
Maze Runner 2 !!!!!!
=====================================================
*/
#include <stdbool.h>
#include <AFMotor.h>
//AF_DCMotor motor(2);
AF_DCMotor motor(3, MOTOR12_8KHZ); //left motor
AF_DCMotor motor2(4, MOTOR12_1KHZ); //right mot... | true |
3a12a27c1510466a9b716b617318e37814a816c5 | C++ | matjukov-nikolaj/OOP | /lw02/HTMLEncode/HTMLEncode/HtmlEncode.cpp | UTF-8 | 912 | 3.171875 | 3 | [] | no_license | #include "stdafx.h"
#include "HtmlEncode.h"
const std::unordered_map<std::string, std::string> HTML_ENTITIES = {
{ ">", ">" },
{ "&", "&" },
{ "'", "'" },
{ "<", "<" },
{ "\"", """ }
};
std::string EncodeHtmlEntityInString(const std::string& str, const std::string& searchStr, const std::strin... | true |
4258242d7d3a66592fe23a29434c042e5ae53906 | C++ | the-rect0r/Random | /CP/library/graph/graph.h | UTF-8 | 1,260 | 3.109375 | 3 | [] | no_license | #pragma once
#include "../general.h"
#include "../range/range.h"
template <class Edge>
class Graph {
public:
int vertexCount;
int edgeCount = 0;
private:
vector<vector<Edge>> edges;
public:
Graph(int vertexCount) : vertexCount(vertexCount), edges(vertexCount, vector<Edge>()) {}
template <typenam... | true |
b077e732c4ac3491a0aecf8e4388f742fd6c13a9 | C++ | 3232731490/CPP | /输入输出流/员工信息的输入输出.cpp | GB18030 | 6,965 | 3.546875 | 4 | [] | no_license | //Լдģfun1,fun2,fun3ʹãfun4
//#include <iostream>
//#include <fstream>
//#include<string>
//using namespace std;
//
//class epoloyee
//{
// friend istream& operator>>(istream& cin, epoloyee& p);//">>"
//public:
// epoloyee() {};
// epoloyee(int a, string name, int age, float w) :m_num(a), m_name... | true |
116c071e155e734b251073d546ddadf38f9d7717 | C++ | giniyat202/shapeshift | /shader.cpp | UTF-8 | 2,524 | 2.8125 | 3 | [] | no_license | #include "shader.h"
#include <gl/glew.h>
#include <assert.h>
#include "program.h"
Shader::Shader(const std::string &source, bool createShader, unsigned int shaderType) :
m_id(0),
m_created(false),
m_compiled(false),
m_type(shaderType)
{
if (createShader)
create();
setSource(source);
}
... | true |
0be793430086a19311e6e5a182bf0cc49470ef5d | C++ | JohnMurray/pembroke | /pembroke/src/pembroke/event/delayed_test.cpp | UTF-8 | 1,974 | 2.953125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <catch2/catch.hpp>
#include <thread>
#include <type_traits>
#include "pembroke/reactor.hpp"
#include "pembroke/event/delayed.hpp"
using namespace std::chrono_literals;
using namespace pembroke::event;
TEST_CASE("Schedule zero-wait delayed event", "[event][delayed][execution]") {
auto r = pembroke::reac... | true |
4fa34c476811469db520fbf6e9139b2694a1a276 | C++ | changjixiong/program_forest | /exmaple/io/epoll_input.cpp | UTF-8 | 2,561 | 2.796875 | 3 | [] | no_license | #include<string.h>
#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<sys/epoll.h>
#include<errno.h>
#include<unistd.h>
#define MAX_BUF 1024
#define MAX_EVENTS 5
int main(int argc, char * argv[]){
int epfd, ready, fd, s, numOpenfds;
struct epoll_event ev;
struct epoll_event evlist[MAX_EVENTS]... | true |
982f0f1c3955948ba07bfeba54b18daba42a808a | C++ | jamiepg18/maze3dflyer | /HighScoreList.h | UTF-8 | 2,698 | 3 | 3 | [] | no_license | #ifndef __HighScoreList_h__
#define __HighScoreList_h__
#include <map>
#include <string>
#include "Maze3D.h"
using namespace std;
struct compareDims
{
// comparison function for dims
// "The key comparison function, a Strict Weak Ordering whose argument type is key_type;
// it returns true if i... | true |
543db37a7871807dd9dcbba9227f936d0ac6ea2d | C++ | sanwan/AlgorithmExercises | /四、递归和动态规划/3.最长递增子序列相关问题/最长递增子序列_dp优化.cpp | GB18030 | 2,316 | 3.921875 | 4 | [
"MIT"
] | permissive | /*
⣺һ
ONlogNĽⷨ(dpʱ临Ӷ,ҪöֽŻ)
1ʹøend[]end[i]¼i+1ȵĵеСĩβάһУԿԶֲ
2dp[i]ֵΪendλöӦijȣΪǰ涼Сģ
dpɵõǶ٣ȶӦ
1Ӻǰdp[i]ǰ
2dp[j]=dp[i]-1 a[j]<a[i]Ϊ
3......
*/
#include <stdio.h>
#include <stack>
using namespace std;
//õdp
void getdp(int *a,int *dp,int len)
{
int end[len];//end
end[0]=a[0];//һλΪa[0]
dp[0]=1;//dpһλΪ1
int r... | true |
c4cef5822d4d30f6125a77bedc716c407f100a79 | C++ | lindacesari/LSN | /01/2/func.h | UTF-8 | 954 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <iomanip>
using namespace std;
double error(vector<double> ave, vector<double> ave2, int n) {
if (n == 0) {
return 0.;
}
else {
return sqrt( (ave2[n] - pow(ave[n], 2)) / n );
}
}
void... | true |
c53e0be6cfe12f54cb8dc47141dd2e79621751f3 | C++ | liujk/edami-gsp | /src/gsp_common.h | UTF-8 | 1,964 | 3.078125 | 3 | [] | no_license | /* -*- mode: cc-mode; tab-width: 2; -*- */
/**
* @file gsp_common.h
*
* @brief Common type definitions used within project
*
* @author: Tomasz Gebarowski <gebarowski@gmail.com>
* @date: Fri May 18 15:13:25 2012
*/
#ifndef __GSP_COMMON_H__
#define __GSP_COMMON_H__
#include <string>
#include <sstream>
#include... | true |
80c52dd025e010c8b03aeefa535ad1425fd98463 | C++ | MultivacX/leetcode2020 | /algorithms/easy/0163. Missing Ranges.h | UTF-8 | 1,997 | 3.40625 | 3 | [
"MIT"
] | permissive | // 163. Missing Ranges
// https://leetcode.com/problems/missing-ranges/
// Runtime: 0 ms, faster than 100.00% of C++ online submissions for Missing Ranges.
// Memory Usage: 7.4 MB, less than 69.73% of C++ online submissions for Missing Ranges.
class Solution {
public:
vector<string> findMissingRanges(vector<i... | true |
8ee4aa37622d055be920c7943dd56ff9f22a5286 | C++ | masayuki-fuseya/GameEngineTK | /GameEngineTK/Player.h | SHIFT_JIS | 2,364 | 2.546875 | 3 | [] | no_license | //߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁
//! @file Player.h
//!
//! @brief vC[NX̃wb_t@C
//!
//! @date 2017/06/01
//!
//! @author Masayuki Fuseya
//߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁߁
// dCN[h̖h~ ==================================================
#pragma once
// wb_t@C̓ǂݍ ===========================================... | true |
dcae0b33039fe118895e03fc5021566ccf407ae4 | C++ | pedrocunial/DesafiosDeProgramacao | /revisao3/massas/ll_sort/linked_list.hxx | UTF-8 | 543 | 3 | 3 | [] | no_license | #ifndef __LINKED_LIST_HXX__
#define __LINKED_LIST_HXX__
template<typename T>
struct node_t {
node_t *next;
T value;
};
template<typename T>
class LinkedList {
private:
node_t<T> *front;
node_t<T> *back;
std::size_t _size;
public:
LinkedList();
~LinkedList();
void push_back(T value);
T get(std::size... | true |
2f59f005ed592ac53911590459a5abd6a74c501a | C++ | edmundmk/pomelo | /pomelo/actions.cpp | UTF-8 | 26,210 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// actions.cpp
// pomelo
//
// Created by Edmund Kapusniak on 28/01/2018.
// Copyright © 2018 Edmund Kapusniak.
//
// Licensed under the MIT License. See LICENSE file in the project root for
// full license information.
//
#include <assert.h>
#include "actions.h"
#include "search.h"
actions::actions( err... | true |
47acb92f026c51312c764d3b5f625689e89ce25a | C++ | PsymonLi/sw | /platform/drivers/windows/Tools/IonicConfig/NetCfg.cpp | UTF-8 | 9,110 | 2.9375 | 3 | [] | no_license | #include "NetCfg.h"
#define LOCK_TIME_OUT 5000
// Function: ReleaseRef
// Purpose: Release reference.
// Arguments:
// punk [in] IUnknown reference to release.
// Returns: Reference count.
// Notes:
VOID ReleaseRef(IN IUnknown* punk) {
if (punk) {
punk->Release();
}
return;
}
// F... | true |
4915ba9381212e4b8fdce968e95fdf40a214620f | C++ | yakirzhang/Learnning_project | /DesignModel/MainSecen.cpp | UTF-8 | 276 | 2.53125 | 3 | [] | no_license | #include <IntFloatPort.h>
#include <iostream>
#include <string>
#include <memory>
using namespace std;
int main() {
IntFloatPort port(5557);
int a=0;
float b=0;
while(cin>>a>>b){
auto s = std::make_shared<IntFloatPort::Sendingthings>(a,b);
port.Send(s);
}
} | true |
6965e32fb8b60fcaf011a8842c9704231e9a06ac | C++ | FenrisChimera8898/2020-10-27-GD1P04-SUMMATIVE3-BaileyJohnson | /Source/Summative3/main.cpp | UTF-8 | 3,312 | 2.78125 | 3 | [] | no_license | //
// Bachelor of Software Engineering
// Media Design School
// Auckland
// New Zealand
//
// (c) 2020 Media Design School
//
// File Name : main.cpp
// Description : Main driver code. runs the opengl Render, Update, and Shutdown Fucntions. Also pass through keyboard input.
// Author : Bailey Jo... | true |
cf04b3fada4ba01f8aeab5566b48865dd2ea3864 | C++ | cies96035/CPP_programs | /Kattis/AC/outofsorts.cpp | UTF-8 | 883 | 2.65625 | 3 | [] | no_license | #include<iostream>
using namespace std;
using ll = long long;
const int MAX_N = 1000100;
ll n, m, a, c, x, cnt;
int arr[MAX_N];
bool Search(const int &x, const int &pos, int l, int h){
int m = (l + h) / 2;
if(arr[m] == x){
return true;
}
if(arr[m] > x && m > pos){
return Search(... | true |
9368356a29e356b4b8105d2da23a4805a4a1e56d | C++ | cloudplugs/rest-arduino | /examples/CloudPlugsESP8266Example/CloudPlugsESP8266Example.ino | UTF-8 | 1,936 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | #include <ESP8266WiFi.h>
#include <CloudPlugs.h>
#define AUTH_PLUGID "dev-xxxxxxxxxxxxxxxxxx" /**< The device plug ID */
#define AUTH_PASS "your-password" /**< The master password */
#define AUTH_MASTER true
char ssid[] = "YOUR_SSID"; /* your network SSID (name) */
char pass[] = "YOUR_WIFI_PASSPHRASE"; /* your net... | true |
cfbce5e5ed71c08736d3f81bc0d6bec5e6cb2238 | C++ | Williams3DWorld/ExileEngine | /Editor/LogicManager.cpp | UTF-8 | 715 | 2.625 | 3 | [] | no_license | #include "LogicManager.h"
void LogicManager::CloneDynamics()
{
if (!_dynamic_actors.empty())
_dynamic_actors.clear();
for (std::shared_ptr<Actor> a : World::map->GetActors())
{
if (a->IsDynamic())
{
_dynamic_actors.reserve(1);
_dynamic_actors.emplace_back(a); // Clone instance of actor
}
}
}
void L... | true |
2a0e5202af4a0345197a28bf2f98c62001f8d40e | C++ | stomachacheGE/leetcode | /73.矩阵置零.cpp | UTF-8 | 2,022 | 3.734375 | 4 | [] | no_license | /*
* @lc app=leetcode.cn id=73 lang=cpp
*
* [73] 矩阵置零
*/
// @lc code=start
class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
// Solution one
// 用两个set分别记录哪些行和哪些列需要置为0
// 但是额外空间是O(m+n)不符合题目要求
// Solution two
// Ref.:https://leetcode-cn.com/problems/s... | true |
b154203e90a143dcd8e80d0d36dc7235a746988e | C++ | secretBackupThatDefinitelyWontBeFound/shhhhh | /MatrixToString.cpp | UTF-8 | 1,565 | 3.21875 | 3 | [] | no_license | //
// Created by to on 1/14/19.
//
#include "MatrixToString.h"
string MatrixToString::problemToString(SearchableMatrix &p) {
std::string answer = p.matrixToString();
pair<int, int> temp_pair = p.getInitialState()->getValue();
answer += "/" + to_string(temp_pair.first) + "," + to_string(temp_pair.second);... | true |
61e168d0befdffc2176cbf8a281c8fbadae5512c | C++ | MikeMitterer/cpp-gpio | /include/GPIO.h | UTF-8 | 2,289 | 2.8125 | 3 | [] | no_license | //
// Created by Mike Mitterer on 22.07.16.
//
#ifndef RASPIHELLOWORLD_GPIO_H
#define RASPIHELLOWORLD_GPIO_H
//#include <RF24/nRF24L01.h>
//#include <RF24/RF24.h>
#include <functional>
/*! was 1 - This means pin HIGH, true, 3.3volts on a pin. */
#undef HIGH
/*! was 0 - This means pin LOW, false, 0volts on a pin. */
... | true |
53dcd4bcd00912798c9b9cc247a35ec01e72d515 | C++ | DoraSzasz/registration | /itk_source/lib/StackIOHelpers.hpp | UTF-8 | 3,946 | 2.609375 | 3 | [
"MIT"
] | permissive | #ifndef STACKIOHELPERS_HHP_
#define STACKIOHELPERS_HHP_
#include <assert.h>
#include "boost/filesystem.hpp"
#include "itkTransformFileReader.h"
#include "itkTransformFileWriter.h"
#include "itkTranslationTransform.h"
#include "itkTransformFactory.h"
#include "Stack.hpp"
#include "StackTransforms.hpp"
#include "Dirs.... | true |
c3978dcac9263ecc6d1c7c01d75ddef07934ebaf | C++ | dbriemann/lemon | /BitBoard.hpp | UTF-8 | 42,790 | 2.8125 | 3 | [] | no_license | #ifndef BITBOARD_HPP
#define BITBOARD_HPP
#include <sstream>
#include <cstring> //memcpy
using namespace std;
#include "lemon.hpp"
#include "utility_functions.hpp"
#include "utility_constants.hpp"
#include "Move.hpp"
#include "MoveList.hpp"
struct BitBoard {
/*
* BitBoards
*/
//TODO combine to on... | true |
32e58bbddb43f8cea7a5d30f0c6e5df66b84bcce | C++ | egg0315/USACO-Solution | /ch1/ride.cpp | UTF-8 | 624 | 2.984375 | 3 | [] | no_license | /*
ID: codefor3
TASK: ride
LANG: C++
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const int mod = 47;
int get(string s) {
long product = 1;
for(auto& c : s) {
product = (product * (c-'A... | true |
4c1420c8a86d6886e950486a7d0772e436a09c3c | C++ | michaelellison/Mike-s-Demo-App | /lib/CAT/CATVariant.h | UTF-8 | 1,716 | 2.65625 | 3 | [
"Libpng",
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"Zlib",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /// \file CATVariant.h
/// \brief Variant type for databases
/// \ingroup CAT
///
/// Copyright (c) 2010 by Michael Ellison.
/// See COPYING.txt for license (MIT License).
///
// $Author: mike $
// $Date: 2011-05-30 17:06:23 -0500 (Mon, 30 May 2011) $
// $Revision: 3 $
// $NoKeywords: $
#ifndef _CATVariant_H_
#define _... | true |
a2bbb924ad01a8bddd316e04781919e1562cc582 | C++ | kerbless/oii2021 | /_exercises/40_missioni/dpGuida.cpp | UTF-8 | 897 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
ifstream in("input.txt");
ofstream out("output.txt");
int n, max = 0;
in >> n;
int d[n], s[n];
for (int i = 0; i < n; i++) {
in >> d[i] >> s[i];
if (s[i] > max) max = s[i];
}
max++; // using days as indexes means... | true |
da9c04e07bd6d82733ae4d3542fbd36b2153445e | C++ | HekpoMaH/Olimpiads | /9 klas - B/Тема 1 - STL @/bitset.cpp | UTF-8 | 457 | 3.390625 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include <bitset>
int main() {
const bitset<12> mask(2731);
cout << "mask = " << mask << endl;
bitset<12> x;
cout << "Enter a 12-bit bitset in binary: " << flush;
if (cin >> x) {
cout << "x = " << x << endl;
cout << "As ulong: " << x.... | true |
7c0a2a990a25edd27b1d495b5b3023f89b9063b7 | C++ | childhood/libAiml | /include/Stream.h | UTF-8 | 405 | 2.609375 | 3 | [] | no_license | #ifndef STREAM_H
#define STREAM_H
#include <map>
#include <string>
using namespace std;
class Stream
{
public:
virtual void Read(const char *str);
virtual void Write(const char *str);
};
class StreamProvider
{
public:
virtual Stream *getStream(const char *str);
};
Stream* getStream(const ... | true |
4adbe865558b3b62ec4715692d9dc71014647e96 | C++ | intfloat/AlgoSolutions | /gcj/gcj2015_round1C/B.cpp | UTF-8 | 1,542 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
map<char, double> prob;
string board, target;
int K, L, S;
bool check(string board, string target) {
set<char> s;
FOR(i, board.size()) s.insert(board[i]);
FOR(i, target.size()) {
if (s.... | true |
8f2b2066d547f72c2e64f0876870b7be3913e09f | C++ | GonzaM21/portal | /src/client/client_communicator.cpp | UTF-8 | 2,164 | 3.015625 | 3 | [] | no_license | #include <thread>
#include <vector>
#include "client_communicator.h"
ClientCommunicator ::ClientCommunicator(DataContainer &data_container) :
data_container(data_container) {
this->continue_running = true;
}
void ClientCommunicator::set(SocketConnect socket,
std::string mode, std::string room_name,
... | true |
84ea5d828c631461a236f9db9ef3a615cc9c5d2c | C++ | cjacques42/cpp | /d07/ex02/Array.cpp | UTF-8 | 896 | 3.25 | 3 | [] | no_license | #include "Array.hpp"
template<typename T>
Array<T>::Array(void) {
this->_array = new T[0];
this->_len = 0;
}
template<typename T>
Array<T>::Array(T const &src) {
*this = src;
}
template<typename T>
Array<T>::Array(unsigned int len) {
this->_array = new T[len];
this->_len = len;
}
template<typename T>
Array<T> ... | true |
640a5c761148798aa842af3e4b9b4e271c630aea | C++ | Bavya333/Coding | /C++/reversewordsll.cpp | UTF-8 | 492 | 3.0625 | 3 | [] | no_license | #include<iostream>
using namespace std;
struct node
{
string s;
node *next;
};
int main()
{
node *head,*m;
char a;
string s,a;
head->next=NULL;
int i=0;
cin>>a;
while(a[i]!='\n')
{
if(a[i]!='.')
{
s+=a[i];
}
else
{
m... | true |
a56a6b81aa128c547ca3581b224d4cf66377bf5e | C++ | Konnie789/BlackjackBot | /Blackjack_Bot - Version 3/Card.h | UTF-8 | 414 | 2.953125 | 3 | [] | no_license | //reference: C++ Programming 49 - Deck of Cards
//https://www.youtube.com/watch?v=NAAEMILMt-Q
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <string>
using std::cout;
using std::cin;
using std::string;
using std::endl;
class Card{
private:
char suit;
string value;
pub... | true |
21bc9d3d0d196be3c256c30732cd7d1d65e2057b | C++ | CamiloOrbes/Proyecto-final | /SINCRONO/main.cpp | UTF-8 | 4,027 | 2.53125 | 3 | [] | no_license | #include <QDebug>
#include <QTextStream>
#include <QFile>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(){
QSerialPort serial;
serial.setPortName("COM5"); //Poner el nombre del puerto, probablemente no sea COM3... | true |
57fe101abdecea1a489ed2ff0954fed34639990d | C++ | esaurez/cppmetrics | /src/statistics.hpp | UTF-8 | 4,996 | 3.171875 | 3 | [] | no_license | #ifndef _STATISTICS_H_INCLUDED
#define _STATISTICS_H_INCLUDED
#include <algorithm>
#include <chrono>
#include <iostream>
#include <numeric>
#include <vector>
namespace MetricsCpp{
template <class DataType, class AverageType>
class Statistics{
public:
AverageType average;
DataType min,max,p... | true |
dbf3884a9454f35389643cba4216e37d8a16ed71 | C++ | trmcnealy/Kokkos.NET | /runtime.Kokkos.NET/Analyzes/GeoJson.hpp | UTF-8 | 14,377 | 2.90625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "runtime.Kokkos/ViewTypes.hpp"
#include "runtime.Kokkos/Extensions.hpp"
#include <MathExtensions.hpp>
#include <StdExtensions.hpp>
#include <Print.hpp>
#include "Analyzes/Variant.hpp"
#include <unordered_map>
namespace Spatial
{
struct empty
{
}; // this Geometry type represen... | true |
91abd4b0c044d83c03bb66d26669fd3adc0b9221 | C++ | Gci04/ITLab_MiniComputationalGeometry | /Vor_Diagram/t_point/TPoint.h | WINDOWS-1251 | 1,664 | 2.921875 | 3 | [] | no_license | #include <cmath>
enum Position{LEFT, RIGHT, BEYOND, BEHIND, BETWEEN, ORIGIN, DESTINATION}; //
//, C, , , , ,
// ""
class TPoint
{
protected:
double x; //
double y;
public:
TPoint(double _x = 0.0, double _y = 0.0);
//
TPoint operator+(const TPoint& P);
TPoint operator-(const TPoint& P);
fri... | true |
6d8f1c352ff21195dba4c0b08d5bace168e746c7 | C++ | zivlakmilos/games | /games2/rpg1/game.cpp | UTF-8 | 3,753 | 2.796875 | 3 | [] | no_license | /*
game.cpp
code for game, main loop, window drawing, handle events
*/
// Include headers
#include "main.h"
#include "player.h"
#include "game.h"
Game::Game()
{
this->x = 100;
this->x = 100;
this->width = 640;
this->height = 480;
this->caption = "";
this->isRunning = true;
this... | true |
38e0aba97c8e39a22d9552f93c8cd6a186ec6944 | C++ | sapizi4/flightsim_project | /OpenServerCommand.cpp | UTF-8 | 778 | 2.625 | 3 | [] | no_license | //
// Created by maor on 29/01/2020.
//
/*#include "OpenServerCommand.h"
#include <iostream>
#include <thread>
#include "Shuntingyard.h"
void OpenServerCommand::execute(const vector<string>&cur_lex) {
Shuntingyard shuntingyard;
int port, freq;
try {
//shunting yard algorithm returns double..
... | true |
6c72c4923600c052965fdc8a8708d34796f3863e | C++ | mxaviersmp/algorithms | /PAA/3_Algoritimos_Gulosos/ciclistas.cpp | UTF-8 | 1,363 | 3.328125 | 3 | [] | no_license | /*
Duas cidades irão competir juntas na regional de ciclismo este ano. As equipes são de duas pessoas, que
usarão uma bicicleta de dois lugares para a corrida. As duplas devem ser formadas com um membro
de cada cidade. A velocidade de uma dupla é determinada pela velorcidade da pessoa mais rápida, já
que a mais lenta n... | true |
37ef179cecae9a0d71a4b524a81b8cd9156a4aa3 | C++ | Yeaseen/AngryBirds_Igraphics | /IGraphics/IGraphics/IGraphics/n.cpp | UTF-8 | 2,942 | 2.796875 | 3 | [] | no_license | /*
author: S. M. Shahriar Nirjon
last modified: August 8, 2008
*/
//#include<stdio.h>
#include<conio.h>
# include "iGraphics.h"
//# include "gl.h"
#include<math.h>
#include<time.h>
int ball_x=100, ball_y=100;
int dx, dy;
int vx,vy,t;
int vel=50,ang=0;
int x=1;
/*
function iDraw() is called again and again by the ... | true |
8398b7040c462c1c8faf57ec70e1cdf2232ae1b8 | C++ | wxxlouisa/FeatureGenerator | /fg_lite/feature/LookupFeatureSparseEncoder.h | UTF-8 | 7,491 | 2.734375 | 3 | [] | no_license | #pragma once
#include "autil/bitmap.h"
#include "autil/ConstString.h"
#include "autil/MurmurHash.h"
#include "fg_lite/feature/LookupFeatureEncoder.h"
namespace fg_lite {
template <typename KeyType, typename ValueType>
class SparseFormatter {
// format
// keyNum | key1, key2,...,keyN | offset1,...,offsetN | <b... | true |
17b704ba6263271cccc354b91d72807e41bdc955 | C++ | nmrodrigues/animal-shelter-file-based | /Dog.h | UTF-8 | 558 | 2.84375 | 3 | [] | no_license | //
// Created by Nicole Rodrigues on 5/3/19.
//
#ifndef ANIMALSHELTER_DOG_H
#define ANIMALSHELTER_DOG_H
#include "Animal.h"
#include <fstream>
class Dog : public Animal {
private:
static int nbrOfDogs;
string breed;
string type = "dog";
int myDogNumber;
public:
Dog();
void setBreed(string &d... | true |
8716667dfc7abe788785d061ff81ffaa74f2c3c6 | C++ | MelvinSalcedo/topicosBaseDatosCompartida | /comparacion/Bases pequeñas y BX/Distancias.h | UTF-8 | 3,203 | 2.96875 | 3 | [] | no_license | #ifndef DISTANCIAS_H
#define DISTANCIAS_H
#include <iostream>
#include <functional>
#include "Utils.h"
typedef function<ValType(ValVec &, ValVec &)> DistanceFunction;
ValType manhattanDistance(ValVec & x, ValVec & y){
if(x.size() != y.size()) return 0;
ValType res = 0;
for(int i = 0; i < x.size(); i++){
if(x[i]... | true |
ade0d5a0ad28cd574d604fddb64cc7b7c0c32cc5 | C++ | yananfan/CodeTest | /Offer/35_DeleteStr2InStr1.cpp | UTF-8 | 763 | 3.53125 | 4 | [] | no_license | //#define _DeleteStr2InStr1_
#ifdef _DeleteStr2InStr1_
#include<iostream>
#include<cstring>
using namespace std;
char * DeleteStr2InStr1(char * const str1, const char * const str2);
int main()
{
char str1[] = "we are students.";
cout << "str1 = " << str1 << endl;
char str2[] = "aeiou";
cout << "str2 = " << str2 <... | true |
d8df6955ef4fac57b097c77a2be80f453af79e75 | C++ | denis-gubar/Leetcode | /all/1056. Confusing Number.cpp | UTF-8 | 281 | 2.875 | 3 | [] | no_license | class Solution {
public:
bool confusingNumber(int N) {
vector<int> to{ 0, 1, -1, -1, -1, -1, 9, -1, 8, 6 };
int other = 0;
int x = N;
while (x)
{
int k = to[x % 10];
if (k < 0)
return false;
x /= 10;
other = other * 10 + k;
}
return N != other;
}
}; | true |
08aea13fe71a483fe18dae905221186992ad1b2e | C++ | finestgreen/qUAck | /qUAck/Game.h | UTF-8 | 845 | 2.515625 | 3 | [] | no_license | #ifndef _GAME_H_
#define _GAME_H_
#include "EDF/EDF.h"
class Game
{
public:
Game();
virtual ~Game();
virtual char *ContentType() = 0;
bool IsRunning();
bool IsEnded();
bool IsCreator();
int ServiceID();
virtual EDF *CreateOptions();
virtual EDF *JoinOptions();
virtual EDF *StartOptions();
virtual... | true |
2d93e8eac5b0453d2f483894b894237209bc8fec | C++ | LaCulotte/chinko_bot | /chinko_bot/types/game/context/roleplay/HumanOptionFollowers.h | UTF-8 | 878 | 2.546875 | 3 | [] | no_license | #ifndef HUMANOPTIONFOLLOWERS_H
#define HUMANOPTIONFOLLOWERS_H
#include "HumanOption.h"
#include "IndexedEntityLook.h"
class HumanOptionFollowers : public HumanOption {
public:
// Constructor
HumanOptionFollowers() {};
// Copy constructor
HumanOptionFollowers(const HumanOptionFollowers& other) = default;
// Cop... | true |
6cc966c0dee08393b9901faab86183dcfb70f78d | C++ | ArturMania/Personal_Wallet | /DateUsageMethods.cpp | UTF-8 | 7,222 | 3.203125 | 3 | [
"Unlicense"
] | permissive | #include "DateUsageMethods.h"
int DateUsageMethodes::getCurrentYear() {
time_t now =time(&now);
struct tm*dt =localtime(&now);
int currentYear =(dt->tm_year+1900);
return currentYear;
}
int DateUsageMethodes::getCurrentMonth() {
time_t now =time(&now);
struct tm*dt =localtime(&now);
int cu... | true |
32c3ed06c68e46882907f04f114c8a2c998418d3 | C++ | thejasonfisher/voxelTerrain | /apps/math/source/blub/math/vector3int32map.hpp | UTF-8 | 3,011 | 2.921875 | 3 | [] | no_license | #ifndef VECTOR3INT32MAP_HPP
#define VECTOR3INT32MAP_HPP
#include "blub/math/axisAlignedBoxInt32.hpp"
#include "blub/core/noncopyable.hpp"
namespace blub
{
template <typename dataType>
class vector3int32map : public noncopyable
{
public:
vector3int32map()
: m_data(nullptr)
{
;
}
~vec... | true |
2d25a63c26c3a4080f5e94e18dbe867f0b12c949 | C++ | xieshiyao/SimpleSQL | /TuplePool.h | UTF-8 | 5,073 | 2.75 | 3 | [] | no_license | #pragma once
#ifndef TUPLEPOOL_H
#define TUPLEPOOL_H
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "myassert.h"
#include "Tuple.h"
//template <size_t max_size = 1024>
class TuplePool {
int fd; // 表文件的描述符
size_t... | true |