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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b735abb222bb16eb21daf12bd234ed52d683bb74 | C++ | mcohoe/group_game | /src/Game/tile.h | UTF-8 | 1,198 | 3.390625 | 3 | [] | no_license | //This file is the header file for a tile on the map.
#ifndef TILE_H
#define TILE_H
#include "Libraries/sprite.h"
#include "Libraries/graphics.h"
class Tile {
public:
enum Id{Empty, Sky, Stone}; //enum that holds every possible tile type
Tile(Id to_set = Empty, Graphics... | true |
6a1a7eb20c4ccc0211a19718bee32f382f34d594 | C++ | G-CR/acm-solution | /ACM/Prictise/牛客/2019湘潭大学程序设计竞赛(重现赛)/B.Number.cpp | UTF-8 | 343 | 2.765625 | 3 | [] | no_license | //https://ac.nowcoder.com/acm/contest/893/B
#include<iostream>
using namespace std;
int main()
{
int T,n,count;
cin >> T;
while(T--)
{
cin >> n;
count = 0;
while(n > 1)
{
if(n % 10 == 0)
{
n /= 10;
count++;
}
else
{
n++;
count++;
}
}
cout << ... | true |
22ae0c12e3cfc0e797dbfa8d84ec285017f40c84 | C++ | lockblox/blox | /test/block_test.cpp | UTF-8 | 1,626 | 3.109375 | 3 | [
"MIT"
] | permissive | #include <blox/block.h>
#include <gtest/gtest.h>
namespace test {
TEST(block, equal) {
auto a = blox::block("some data");
auto b = blox::block("some other data");
EXPECT_NE(a, b);
b = blox::block(a.key(), b.data()); // make keys match
EXPECT_EQ(a, b);
b = blox::block(a.key()); // no data in block b
EX... | true |
6015d1e4b5f16a5abfecc4d4e4a7b4cb99bae575 | C++ | PomeloFruit/MapperToo | /libstreetmap/src/fillStructs.h | UTF-8 | 4,378 | 2.609375 | 3 | [] | no_license | #pragma once
#include "globals.h"
#include "latLonToXY.h"
#include "LatLon.h"
#include <string>
#include "OSMID.h"
// class contains all functions needed to fill global.h info data structures
class populateData{
public:
// calls populate functions for critical map element structures
void initialize(infoSt... | true |
8706c9cc71a808b4294cdc20c6cb5ecb27de8007 | C++ | campbelljc/sokoban | /board.h | UTF-8 | 1,636 | 2.71875 | 3 | [] | no_license | #ifndef BOARD_H
#define BOARD_H
//Prevents out-of-bounds checking by boost::multi_array
#define BOOST_DISABLE_ASSERTS
#include <vector>
#include <iostream>
#include <string>
#include "coord.h"
#include "entity.h"
#include "solver.h"
#include <boost/multi_array.hpp>
class C_Entity;
class C_Player;
class C_Ball;
cla... | true |
d82061f46fb2444953ac86d59f9206a99688ccf4 | C++ | alonso-garrido/sorting | /CAlumno.h | UTF-8 | 783 | 3.390625 | 3 | [] | no_license | #pragma once
#include <string>
#include <iostream>
using namespace std;
class CAlumno
{
private:
string nombre;
string codigo;
string carrera;
int ciclo;
public:
CAlumno(string pnombre, string pcodigo, string pcarrera, int pciclo)
{
nombre = pnombre;
codigo = pcodigo;
carrera = pcarrera;
... | true |
acdeb9550e2d26d49755d00a240ee401116cc2f1 | C++ | narcisvladutu/CaphyonInternship | /internship/Car.cpp | UTF-8 | 3,809 | 3.453125 | 3 | [] | no_license | #include "Car.h"
//Descr: create a car
//In: -
//Out: an instance of Car
Car::Car()
{
this->_id = 0;
this->_length = 0;
this->_width = 0;
this->_height = 0;
this->_registraion_plate = "";
}
//Descr: create a flower
//In: an id and a registration plate
//Out: an instance (with info) of Car
Car::Car(unsigned long... | true |
002df9f6eaf817d7629dafcdcb1e32588a5693a8 | C++ | AnnaPotemkina/Laba3 | /Laba3/main.cpp | UTF-8 | 2,342 | 3.03125 | 3 | [] | no_license |
#include "tree.h"
#include <iostream>
#include "Complex.h"
using namespace std;
int plus0(int n) {
return n + 1;
}
Compl plus1(Compl numb){
return {numb.Getre()+1, numb.Getim()+1};
}
Compl getCompl(int i) {
int a,b;
a = i;
b = i+ 1;
return Compl(a,b);
}
bool func(int n) {
... | true |
34e6b8795f228f07e1c7d461b855c748cbfda838 | C++ | FloodProject/flood | /deps/NVIDIATextureTools/src/nvtt/bc7/arvo/Vec3.cpp | UTF-8 | 4,802 | 2.890625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | /***************************************************************************
* Vec3.C *
* *
* Basic operations on 3-dimensional vectors. This special case is useful *
* because ma... | true |
3d21b6d192ec0ab3f71334909125faf37931df31 | C++ | ZeroXCn/sLib | /sGraphics/SPen.cpp | GB18030 | 737 | 2.578125 | 3 | [] | no_license | #include "SPen.h"
SPen::SPen(SGdiObj Obj)
{
m_hGdiObj = (HPEN)Obj.GetHandle();
}
SPen::SPen(HPEN hPen)
:SGdiHandle<HPEN, LOGPEN>(hPen)
{
}
SPen::~SPen()
{
}
//ָʽȺɫ
BOOL SPen::Create(int nPenStyle, int nWidth, COLORREF crColor)
{
m_hGdiObj = (HPEN) ::CreatePen(nPenStyle, nWidth, crColor);
return (m_hGdiObj ? ... | true |
5ef694f2e5a189ee9903e21ac77eba76ffbd7fb7 | C++ | Takiwa-i/Atcoder | /ABC/180/C.cpp | UTF-8 | 401 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
int main(void)
{
long n;
std::vector<long> A;
std::cin >> n;
for (long i = 1; i * i <= n; i++)
{
if (n % i == 0)
{
A.push_back(i);
if (n / i != i)
A.push_back(n / i);
}
}
std::sort(A.begin(), A.end());
for (std::vector<long>::iterator... | true |
01dbc62c4729d22e0065d368904cec70cf1a1eff | C++ | YuilTripathee/CPP_programming | /Lesson 6 - Inheritance/010 - constructor in inheritance/main.cpp | UTF-8 | 663 | 3.609375 | 4 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
class Polygon
{
int x;
public:
Polygon(int j)
{
x = j;
cout << "Basic parameterized constructor: ";
cout << "Value of x = " << x << endl;
}
~Polygon()
{
cout << "Destructor from base class.";
}
};
... | true |
4a7f7e1b596213f06b20579c2d237461d782950f | C++ | PaulWzq/Interview-1 | /chapter_2_listproblem/Problem_02_RemoveLastKthNode.cpp | UTF-8 | 3,021 | 3.921875 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Node{
public:
Node(int data)
{
value = data;
}
~Node(){}
Node *next;
int value;
};
Node* removeLastKthNode(Node *head, int lastKth)
{
if(head == NULL || lastKth < 1)
{
return head;
}
Node* cur = head;
while(c... | true |
a970d89ef00d36d24225d04fa16753bcfdd6a6aa | C++ | Sam-Costigan/Games | /GameEngine/src/ErrorLogManager.cpp | UTF-8 | 979 | 2.953125 | 3 | [] | no_license | #include "ErrorLogManager.h"
ErrorLogManager ErrorLogManager::ErrorManager;
ErrorLogManager* ErrorLogManager::getErrorManager() {
return &ErrorManager;
}
void ErrorLogManager::create(std::string FileName) {
LogFile.open(FileName.c_str());
}
void ErrorLogManager::flush() {
LogFile << LogBuffer.str();
... | true |
516100e9d2b393fc55d71e54b4f64c9e6ba32ec2 | C++ | cherry2018box/testandtest | /test9.cpp | ISO-8859-7 | 502 | 3.234375 | 3 | [] | no_license | /*
*git change first!
*/
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
//9:쳲
long long Fibonacci(int n){
if(!(n>=0)){
printf("ERROR!");
return 0;
}
else if(n==0)
return 0;
else if(n==1)
return 1;
else {
long long s1=0,s2=1,s=0;
for(int i=2;i<=n;i++){
s=s1+s2;
s1=s2;
... | true |
fe13307ed5e243e568ad0073ae715266327295b2 | C++ | RomantsovS/Sadgewick | /15_Radix_search/15.03_Patricia_trees/examples/DST.h | UTF-8 | 2,055 | 3.21875 | 3 | [] | no_license | #include <cassert>
#include <iostream>
#include <stack>
const int bitsword = 5;
const int bitsbyte = 1;
const int bytesword = bitsword / bitsbyte;
const int R = 1 << bitsbyte;
inline int digit(long A, int B) {
return ((A - 'A' + 1) >> bitsbyte * (bytesword - B - 1)) & (R - 1);
}
template <class Item, class Key>
... | true |
0171d67df4aa8255a7a04d0f06d4c46f11570c11 | C++ | Ulixses/Game_Dev_R-type | /client/src/network.cpp | UTF-8 | 1,654 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include "network.hpp"
Network::Network(std::string hostname, unsigned short port)
: _socket(_io_context, udp::endpoint(udp::v4(), port+1))
// FIXME: what does the endpoint represent here? Why we need a different port number from the server?
{
// address type, hostname, service type (which ... | true |
81ffa138e81339b90b3bfcdca45335e56df13a40 | C++ | gwanhyeon/algorithm_study | /beakjoon_algorithm/beakjoon_algorithm/CodingTestExam/bubble_sort.cpp | UTF-8 | 735 | 3.828125 | 4 | [] | no_license | //버블 정렬
#include <stdio.h>
#include <iostream>
using namespace std;
void bubble_sort(int arr[],int num){
int temp;
for(int i=0; i<num; i++){
// 마지막은 비교하지 않기때문에 -1을 빼준다.
for(int j=0; j<num-i-1; j++){
// 오름차순 정렬이므로 arr[j]가 클경우 작은값과 바꿔주게된다.
if(arr[j] > arr[j+1]){
... | true |
0fe9dd637110f6ea7ca2c6b1717fcead810e76dc | C++ | scheeloong/Cpp | /RayTracer/raytracerLinux/light_source.cpp | UTF-8 | 4,667 | 2.890625 | 3 | [] | no_license | /***********************************************************
Starter code for Assignment 3
This code was originally written by Jack Wang for
CSC418, SPRING 2005
implements light_source.h
***********************************************************/
// Defines the basic light class. You could define... | true |
b07092317f52bbb846316688ae6eaa2bf9afcb76 | C++ | kassya-rosa/atividade_avaliativa5 | /Exercicio_02.cpp | ISO-8859-1 | 759 | 3.921875 | 4 | [] | no_license | // Desenvolva um programa em C que leia trs valores numricos e apresente o maior valor informado no
// meio de uma janela limpa.
#include<stdio.h>
#include<locale.h>
#include<stdlib.h>
int main(){
setlocale(LC_ALL, "Portuguese");
int maior,num1, num2, num3;
printf("Solicitamos informar 3 nmeros inteir... | true |
52083ff2113a76d064c9f929864a5511ae8beceb | C++ | WPISmartmouse/2016_Solvers | /lib/real/commands/LEDBlink.h | UTF-8 | 496 | 2.640625 | 3 | [] | no_license | #pragma once
#include "CommanDuino.h"
#include "RealMouse.h"
class LEDBlink : public Command {
public:
const static int B = RealMouse::LEDB;
const static int R = RealMouse::LEDR;
const static int G = RealMouse::LEDG;
const static int W = RealMouse::LEDGO;
LEDBlink(const int led_pin, unsigned l... | true |
b7b5c4c25b191c7c12de6ec3e06e80230b5fdafa | C++ | TG-yang/LeetCode | /209. Minimum Size Subarray Sum/main.cpp | UTF-8 | 1,015 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int minSubArrayLen(int s, vector<int>& nums) {
int temp = 0;
int tempLength = 0;
int minLength = INT_MAX;
for(int i = 0; i < nums.size(); ++i){
if(temp < s){
temp += n... | true |
235f64b97b96eefb520c4d0561501ea41d5d3654 | C++ | abd-cde/QsudokuScr | /Dialogs/explanatryDlg.cpp | UTF-8 | 4,502 | 3.171875 | 3 | [] | no_license | #include "explanatryDlg.h"
#include <QString>
explanatryDlg::explanatryDlg(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
m_page = 1;
switchPage();
this->setWindowTitle(QString(tr("操作说明")));
pBL->setVisible(FALSE);
connect(pBL,SIGNAL(clicked()),this,SLOT(previous()));
connect(pBR,S... | true |
d6b845b275fcc9875a64fea07ed3f3b7bfaecd8b | C++ | luizfirmino/cpluplus | /ICE03 Part2.cpp | UTF-8 | 647 | 3.359375 | 3 | [] | no_license | /*
LUIZ FILHO
INTRODUCTION TO C++
#include <iostream>
#include <string>
using namespace std;
int main() {
int x = 5;
float y = 0.999999,
z = 0.9999999;
cout << "Five divided by three is:\n";
cout << x / 3 << endl; //expected: _____1________________
cout << x / 3.0 << endl; //... | true |
5ac8b81c9740bb4690e74597a267ee4b56dc9560 | C++ | nik3212/challenges | /HackerRank/Interview Preparation Kit/Warm-up Challenges/Counting Valleys/Solution.cpp | UTF-8 | 2,521 | 3.78125 | 4 | [
"MIT"
] | permissive | /*
Gary is an avid hiker. He tracks his hikes meticulously, paying close attention to small details like topography. During his last hike he took exactly n steps. For every step he took, he noted if it was an uphill, U, or a downhill, D step. Gary's hikes start and end at sea level and each step up or down represents ... | true |
ab19cf637e231deb0d0025676256fbb3a5f3b6ef | C++ | hgreenlee/larlite | /UserDev/RecoTool/CMTool/CMTAlgMerge/corey_merging/HitToCluster.cxx | UTF-8 | 5,809 | 2.53125 | 3 | [] | no_license | #ifndef LARLITE_HITTOCLUSTER_CXX
#define LARLITE_HITTOCLUSTER_CXX
#include <list>
#include "HitToCluster.h"
#include "DataFormat/hit.h"
#include "DataFormat/cluster.h"
namespace larlite {
bool HitToCluster::initialize() {
//
// This function is called in the beggining of event loop
// Do all variable... | true |
99c756964ec57de0f2518a8647f8d21bd03c0d57 | C++ | huzhishan/RRT | /reachability/main.cpp | UTF-8 | 1,343 | 2.625 | 3 | [] | no_license | //============================================================================
// Name : Reach.cpp
// Author : Adel Ahmadyan
// Version :
// Copyright : (C) 2012 UIUC.
// Description :
//============================================================================
#include <iostream>
#include <search.... | true |
e79cf5073c1cd594f2526155996887e2aaaaeb52 | C++ | Soulei/GrenouilleCpp | /src/Modele/include/StrategieDopante.hpp | UTF-8 | 1,550 | 2.984375 | 3 | [] | no_license | #ifndef StrategieDopante_hpp
#define StrategieDopante_hpp
#include "StrategieAbstraite.hpp"
namespace grenouilloland {
/**
* @class StrategieDopante StrategieDopante.hpp
* @brief StrategieDopante du Jeu Grenouilloland.
*
* Declaration de la classe StrategieDopante réprésentant la stratégie dopante d'un nénuphar ... | true |
d80e3a0f162012acc3f0249f387f907b29f7ca46 | C++ | niesoft/leapp | /tools.cpp | UTF-8 | 1,058 | 2.515625 | 3 | [] | no_license | #include "tools.h"
Tools::Tools(){}
// Вывод сообщений в консоль
void Tools::debug(QString fname, const QVariant &v)
{
if (debugenable) {
qDebug() << "[" + getTime() + "] " + fname + "():";
qDebug() << v;
}
}
// Текущее время
QString Tools::getTime()
{
return QString::fromStdString(QTime::currentTime().toStrin... | true |
c0394d5daa6ae5c923ed3bc3d53c0d29c7e1aa50 | C++ | bq/aquaris-E5 | /mediatek/custom/mt6582/hal/inc/isp_tuning/isp_tuning_custom_instance.h | UTF-8 | 2,715 | 2.640625 | 3 | [] | no_license | #ifndef _ISP_TUNING_CUSTOM_INSTANCE_H_
#define _ISP_TUNING_CUSTOM_INSTANCE_H_
namespace NSIspTuning
{
/*******************************************************************************
*
*******************************************************************************/
template <ESensorDev_T const eSensorDev>
class CTIs... | true |
903c1d16413fb36aeb0b81e1f267fd2764be188c | C++ | vardhan688/VCFinder | /main.cpp | UTF-8 | 1,035 | 3.015625 | 3 | [] | no_license | /* Vertex Cover */
/* Implementation of a graph and a solution to the existential vertex cover problem */
/* Given a Graph G(V,E), is there a vertex cover of size <= k where k is > 0
- Vertex Cover - a subset of V such that at least one endpoint of each edge of G is present in VC.
- NP- Complete
*/
#include<... | true |
29b9b9e4c7dfd9d8a1816f1044490883eedfab9a | C++ | REMqb/cppquarium | /src/ecs/System.hpp | UTF-8 | 3,574 | 3.046875 | 3 | [] | no_license | #pragma once
#include "SystemBase.hpp"
#include "EntityComponentSystem.hpp"
#include "CovariantComponentMap.hpp"
#include <unordered_map>
#include <memory>
#include <functional>
namespace ecs {
template<typename ComponentOrSystemTypeT, typename ComponentTypeT = void>
class System : public
std::conditional<
... | true |
372ac1f952638ea99958d2b27acaa1eaaac83afc | C++ | gamer08/Battleship | /Battleship/Player.h | ISO-8859-1 | 734 | 2.84375 | 3 | [] | no_license | #ifndef _PLAYER_
#define _PLAYER_
#include "PlayerObserver.h"
#include "Board.h"
#include <vector>
class Ship; //dclaration avance pour eviter une redondance cyclique;
class Player : public PlayerObserver
{
private:
Player(const Player&) = delete;
Player& operator=(const Player& Player) = delete;
Board* _board;
... | true |
1d2448723d34ae94c2ffe22dceabd6375cad4de6 | C++ | rohithch21/Generic-codes | /createBST.cpp | UTF-8 | 1,228 | 3.578125 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node* right;
Node* left;
};
Node* newNode(int val){
Node* node = new Node;
node->data = val;
node->left = node->right = NULL;
}
Node* createBst(Node* root, int val){
if(root == NULL){
root = n... | true |
33a39f2ecabbff58e78db3d3ed3a0354351a4fff | C++ | malichao/Coding-Practice | /IO/ReadLastKLines.cpp | UTF-8 | 2,925 | 3.46875 | 3 | [] | no_license | /******************************************************************************
Author : Lichao Ma
Date : Apr 24,2016
Version : v0.1
Built : Sublime GCC, -std=c++11
Description :
Read last K lines from a file. Basic solution is to read the files two
times,first the number of lines and then locate the las... | true |
05cc37449dd3da1ff93e98637d7c86f00e473b98 | C++ | kostuss/PROI-2 | /src/Customer.cpp | UTF-8 | 524 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "Customer.h"
using namespace std;
Customer::Customer(const string name , bool vip ) {
this->name = name;
this->vip = vip;
this->paid =0;
}
Customer::~Customer() {};
string Customer::getName() {
return name;
}
void Customer::setName(const string name) {
... | true |
662191ecfb029cb37e90f7085f981996290a2561 | C++ | JoanWu5/WOJ | /problem7.cpp | GB18030 | 560 | 2.984375 | 3 | [] | no_license | //ÿСֵӵĺ
#include <stdio.h>
#define MaxAnimal 10000
int main(){
int n;
int i,j,m=0;
int Eat[8][MaxAnimal];
int result[1000];
while(scanf("%d",&n)==1){
for(i=0;i<8;i++){
for(j=0;j<n;j++){
scanf("%d",&Eat[i][j]);
}
}
int minEat[MaxAnimal];
for(int i=0;i<n;i++){
minEat[i]=10001;
}
int sum=0;
... | true |
d34dcc718be49f09e8970c62184ac1f6f608210c | C++ | grasingerm/PL | /inher2.cc | UTF-8 | 766 | 3.46875 | 3 | [] | no_license | #include <iostream>
class Base
{
protected:
int alpha;
public:
Base() {}
Base(int a) : alpha(a) {}
virtual int da() { return 2*alpha; }
int db() { return 2; }
};
class Derived : public Base
{
protected:
int beta;
public:
Derived() {}
Derived(int a, int b) : beta(b) { alpha = a;... | true |
e8fa966f34a433e6dd98e3a44e6ee448bbcdbc3a | C++ | Kevin-shc/leetcode-tencent | /链表突击/相交链表.cpp | UTF-8 | 1,362 | 3.515625 | 4 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
if(headA == NULL || headB == NULL) {
... | true |
3b5522586df24ca860f63989931bcf9459eabd3d | C++ | stranda/rmetasim | /src/TransMat.h | UTF-8 | 3,783 | 3 | 3 | [] | no_license | /*
$Modified: astrand $
Copyright (C) 1999 Allan E. Strand
This file is part of Metasim
*/
#ifndef TRANSMAT_H
#define TRANSMAT_H
/*
includes
*/
#include <metasim.h>
#include <RandLib.h>
#include <iostream>
using namespace std;
/// Generic transition matrix
/**
TransMat implements a generic transition matri... | true |
0c62318f637a66312b6106044079d7f6538747f0 | C++ | mbrain/MP | /Scanner.h | UTF-8 | 514 | 2.796875 | 3 | [] | no_license | #ifndef SCANNER_H
#define SCANNER_H
#include <string>
#include <vector>
#include "Token.h"
typedef std::vector<Token> TokenVec;
class Scanner
{
private:
std::string myInput;
unsigned int myPos;
unsigned int myVecPos;
char myCh;
TokenVec myTokenVec;
public:
Scanner(const std::stri... | true |
af288eda5f35861771b6bd83312bb9a3fceb80c4 | C++ | its-mash/Competitive-Programming | /Codeforces/DIV 2/A/122. Teams.cpp | UTF-8 | 504 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
int x,y,d;
cin>>x>>y;
/* if(x==0 || y==0){
cout<<0<<" "<<0<<endl;return 0;
logically without this part the solution should be wrong, but it's accepted
}*/... | true |
2ad36953bc0b08432e1f452da30a8d720fc49ab4 | C++ | federicoorsili/C-plus-plus | /cpp03/ex03/ClapTrap.hpp | UTF-8 | 2,047 | 2.6875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ClapTrap.hpp :+: :+: :+: ... | true |
ce60e95dbdda8f13abd1d89edc09a667c21383cd | C++ | georgiosdoumas/ProgrammingCplusplus- | /CplusplusPrimer_5thEd_2012/chapter10/Exercise10.13.cpp | UTF-8 | 1,284 | 3.953125 | 4 | [] | no_license | /* Exercise 10.13: The library defines an algorithm named partition that takes a predicate
and partitions the container so that values for which the predicate is true appear in the
first part and those for which the predicate is false appear in the second part.
The algorithm returns an iterator just past the last eleme... | true |
7d6b8fa852f492cf8e856bf5d9b1d58bfeb87627 | C++ | edwardwterry/15-466-f18-base2 | /server.cpp | UTF-8 | 2,364 | 2.8125 | 3 | [] | no_license | #include "Connection.hpp"
#include "Game.hpp"
#include <iostream>
#include <set>
#include <chrono>
#include <map>
int main(int argc, char **argv) {
if (argc != 2) {
std::cerr << "Usage:\n\t./server <port>" << std::endl;
return 1;
}
Server server(argv[1]);
Game state;
std::unordered_map< Connection *, G... | true |
80049e42d1eac8abe147f293323732f82cbcb1f5 | C++ | Niruz/vigilant-happiness | /test/test/World.cpp | UTF-8 | 782 | 3.203125 | 3 | [] | no_license | #include "World.h"
#include "Level.h"
World* World::Instance()
{
static World instance;
return &instance;
}
Level* World::GetLevelFromName(const std::string& name)const
{
//find the entity
LevelMap::const_iterator ent = myLevelMap.find(name);
//assert that the entity is a member of the map
assert((ent != myLe... | true |
5297866de4edd7ae1a70a49363e8d7e29ce69912 | C++ | Jeby057/Projet-OpenGL-Montre | /Projet OpenGL Montre/PieceVentilo.h | ISO-8859-1 | 2,852 | 3.4375 | 3 | [] | no_license | /**
* Classe PieceVentilo
* *******************
* Cette classe construit une turbine qui est dessine par la suite en dessous de la montre
* Le construction de la classe dessine une turbine avec une sphre violette transparente
* Elle est constitue de 9 tiges, un cylindre et une sphre violette
* La turbine es... | true |
4449b49c4e8e51a29354508af5989f695a68aea3 | C++ | DivyanshRoy/Competitive-Programming | /Codeforces/Referenced Solutions/369C.cpp | UTF-8 | 1,558 | 2.578125 | 3 | [] | no_license | // Problem Link: https://codeforces.com/contest/369/problem/C
#include<bits/stdc++.h>
using namespace std;
#define MAX 100005
vector< vector< pair<long long int,long long int> > > vec;
long long int below[MAX];
vector<long long int> ans;
void dfs1(long long int cur,long long int pre)
{
below[cur]=0;
... | true |
63f250c352657d2d757ada04a21351c181f123fc | C++ | cmorgoth/UCNA | /RootUtils/MultiGaus.hh | UTF-8 | 1,641 | 2.609375 | 3 | [] | no_license | #ifndef MULTIGAUS_HH
#define MULTIGAUS_HH 1
#include <TF1.h>
#include <TH1F.h>
#include "Types.hh"
/// class for fitting multi-peak gaussians
class MultiGaus {
public:
/// correlated subpeaks specification
struct corrPeak {
unsigned int mainPeak;
double relCenter;
double relHeight;
double relWidth;
};
... | true |
78bb4b1b9d11424c4e0bfdd0904b0f4812326065 | C++ | juanmaGHutchison/BraccioyJAVA | /Arduino/cogersoltarPunto/Punto.h | UTF-8 | 992 | 2.90625 | 3 | [] | no_license | #ifndef PUNTO_HPP_
#define PUNTO_HPP_
#include "stdio.h"
#include "Braccio.h"
#include <Arduino.h>
#include <Servo.h>
class Punto{
public:
//Constantes
static const int MaximoX = 1, MaximoY = 1;
//Constructores
Punto(int=0, int=0);
Punto(String, int&);
//Observadores
int x()const;
int y()cons... | true |
3c55ffa12980965edd6b4d8ad7eefdbe3dff4df6 | C++ | shortthirdman/code-eval-challenges | /quickstart/DetectingCycles.cc | UTF-8 | 1,705 | 3.640625 | 4 | [
"MIT"
] | permissive | /*
Detecting Cycles Share on LinkedIn
Description:
Given a sequence, write a program to detect cycles within it.
Input sample:
A file containing a sequence of numbers (space delimited). The file can have multiple such lines. e.g
2 0 6 3 1 6 3 1 6 3 1
Ensure to account for numbers that have more than one... | true |
299a9ba9da99b478bbf39985c733e0fc4acfab95 | C++ | mlz000/Algorithms | /UVA/Chapter 3. Data Structures/Fundamental Data Structures/Exercises Advanced/1517(计算几何).cpp | UTF-8 | 1,942 | 2.9375 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
using namespace std;
struct point{
int x,y;
point(int p=0,int q=0):x(p),y(q) {}
};
struct Line{
point x,y;
Line(point _x=point(),point _y=point()):x(_x),y(_y) {}
};
int sgn(int x){
if(x==0) return 0;
retur... | true |
cf1a5cd75e725f994e1d3b140490c4b7b24e9640 | C++ | Chaanks/Ashes | /include/Ashes/Enum/VertexInputRate.hpp | UTF-8 | 1,079 | 3.09375 | 3 | [
"MIT"
] | permissive | /*
This file belongs to Ashes.
See LICENSE file in root folder.
*/
#ifndef ___Ashes_VertexInputRate_HPP___
#define ___Ashes_VertexInputRate_HPP___
#pragma once
namespace ashes
{
/**
*\~english
*\brief
* Vertex layout input rates enumeration.
*\~french
*\brief
* Enumération des cadences d'entrée pour les layout... | true |
7edb4fc900af9fc2fa2f13fb9e4ee11e38df283c | C++ | OBIGOGIT/etch | /binding-cpp/runtime/include/util/EtchCircularQueue.h | UTF-8 | 6,237 | 2.5625 | 3 | [
"Apache-2.0",
"BSD-4-Clause-UC",
"Zlib",
"BSD-4-Clause",
"LicenseRef-scancode-other-permissive",
"ISC"
] | permissive | /* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version
* 2.0 (the "License"); y... | true |
1d0525b7a346da40b2f76a95cd33d44161393179 | C++ | nan0S/ultimate-tic-tac-toe | /src/UltimateTicTacToe.hpp | UTF-8 | 1,911 | 2.75 | 3 | [] | no_license | #ifndef ULTIMATE_TICTACTOE_HPP
#define ULTIMATE_TICTACTOE_HPP
#include "Common.hpp"
#include "Action.hpp"
#include "State.hpp"
#include "TicTacToe.hpp"
class UltimateTicTacToe : public State {
public:
using reward_t = State::reward_t;
typedef struct UltimateTicTacToeAction : public Action {
UltimateTicTacToeActi... | true |
86b21592ef2a6c2db3b95d2b41a059a04302bcf4 | C++ | MichaelGoldberg91/LinkedList | /Final_Project/Final_Project/Room.cpp | UTF-8 | 1,174 | 3.265625 | 3 | [] | no_license | #include "Room.h"
#include<iostream>
using namespace std;
//O(1)
Room::Room()
{
roomNumber = 000;
numOfBeds = 0;
roomType = "Default";
availibility = "Yes";
}
void Room::set_roomNumber(int rn)
{
roomNumber = rn;
}
void Room::set_numOfBeds(int nob)
{
numOfBeds = nob;
}
void Room::set_r... | true |
897a3974d242d8a40b358945e78bea2fb73071e9 | C++ | soelusoelu/20_10_kojin | /DirectX/Mesh/MeshManager.h | UTF-8 | 1,049 | 2.625 | 3 | [] | no_license | #pragma once
#include <list>
#include <memory>
class MeshRenderer;
class ShadowMap;
class Camera;
class DirectionalLight;
class MeshManager {
using MeshPtr = std::shared_ptr<MeshRenderer>;
using MeshPtrList = std::list<MeshPtr>;
public:
MeshManager();
~MeshManager();
void createShadowMap();
... | true |
bfb7c1b5ee30e47ea209b96af35fa7c7ac6fba22 | C++ | questor/git-ws | /extlibs/SSVUtilsJson/extlibs/SSVUtils/include/SSVUtils/Tests/TestsUtilsContainer.hpp | UTF-8 | 1,076 | 2.53125 | 3 | [
"AFL-3.0",
"LicenseRef-scancode-unknown-license-reference",
"AFL-2.1"
] | permissive | // Copyright (c) 2013-2014 Vittorio Romeo
// License: Academic Free License ("AFL") v. 3.0
// AFL License page: http://opensource.org/licenses/AFL-3.0
#ifndef SSVU_TESTS_TESTSUTILSCONTAINER
#define SSVU_TESTS_TESTSUTILSCONTAINER
SSVUT_TEST(UtilsContainersTests)
{
using namespace std;
using namespace ssvu;
std::ve... | true |
5afca70231c548aa32a86a2b1fe259d01d48f6b3 | C++ | TapanManu/cprogs | /cpp/swap.cpp | UTF-8 | 160 | 2.640625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int x=10;
int y=70;
x=x+y;
y=x-y;
x=x-y;
cout<<"X:"<<x<<"\n";
cout<<"Y:"<<y<<"\n";
return 0;
}
| true |
9e0e2ee53903366b4a3fafe4bda1428454655db0 | C++ | hellowshinobu/exercises | /cs11/lab1/exercise4.cc | UTF-8 | 827 | 3.25 | 3 | [] | no_license | // 1.remove even num
// 2.beacuse remove_if does not destroy any iterator, so out is wrong
// 3.erase the range [new_end, end)
#include <vector>
#include <algorithm>
#include <iterator>
#include <ext/functional>
#include <iostream>
using namespace std;
using namespace __gnu_cxx;
int main()
{
vector<int> v;
v.... | true |
8ef154ff28705018e058acbd29eeacfae70622e1 | C++ | wolfpld/tracy | /profiler/src/ConnectionHistory.hpp | UTF-8 | 721 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef __CONNECTIONHISTORY_HPP__
#define __CONNECTIONHISTORY_HPP__
#include <stdint.h>
#include <string>
#include <unordered_map>
#include <vector>
class ConnectionHistory
{
public:
ConnectionHistory();
~ConnectionHistory();
const std::string& Name( size_t idx ) const { return m_connHistVec[idx]->first;... | true |
2bcba5609aa02613c9ecba05da0a1c80a85b62b8 | C++ | IntroCSCI/colorvisionproject-MarioGarcia13 | /colorvision.h | UTF-8 | 275 | 2.578125 | 3 | [] | no_license | #ifndef ColorVis_H //Pre-processor directives
#define ColorVis_H
#include <string>
#include <iostream>
using std::string;
class Colors{
private:
string colorgen;
public:
Colors(string actualColor) : colorgen{actualColor} {}
string display();
};
#endif | true |
fb0c694e2bd53dc47a5148b3152a0799cd999b29 | C++ | LiangH011/KM | /algorithm/leetcode/binary-tree-level-order-traversal-ii.cc | UTF-8 | 1,545 | 3.8125 | 4 | [] | no_license | // URL: http://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/
//
// Problem: Given a binary tree, return the bottom-up level order traversal of
// its nodes' values. (ie, from left to right, level by level from leaf
// to root).
#include <algorithm>
#include <vector>
#include <iostrea... | true |
982fc70e2fd2fa7f3d3efb6f9813749e8b1d6ea4 | C++ | IraSoro/front-end-systems-engineering | /clickpoint.h | UTF-8 | 3,439 | 2.890625 | 3 | [] | no_license | #ifndef CLICKPOINT_H
#define CLICKPOINT_H
#include <QObject>
#include <QGraphicsItem>
#include <QPainter>
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
#include <QVector>
#include "system.h"
/*!
* \brief класс обрабатывает события нажатия мыши на сцене
*/
class ClickPoint: public QObject, public QGraphicsI... | true |
0879555ef55c7ac95cfec91ba1182ffc440dae6b | C++ | inderpreetsingh/programming | /newcircle.cpp | UTF-8 | 4,772 | 3.390625 | 3 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
char circle[150][150];
int graphWidth;
double graphHeight1,angle,radius;
cout<<"Enter Height of a graph: ";
cin>>graphHeight1;
cout<<"Enter Width of a graph: ";
cin>>graphWidth;
cout<<"Radius of circle you want: ";
... | true |
c85cd998bdba7ecf0102c387984932a54c05d4f3 | C++ | lavagater/mmo | /zone/components/terrain_component.h | UTF-8 | 740 | 2.796875 | 3 | [] | no_license | /**
* @brief This component should be on an object with no other components except a transform, this object will tell players
* about the terrain that wont change.
* @remarks There could be other terrain that can move or be created/destroyed that information will be sent in a different way.
*/
#ifndef TERR... | true |
4a182779e0b83f5da365ae1bb5b85f03db56d3ef | C++ | memset0/OI-Code | /白马湖OJ/1123 排队接水.cpp | UTF-8 | 542 | 2.546875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
struct People {
int n, i;
}a[maxn];
int n;
bool my_sort(People a, People b) {
if (a.n == b.n) return a.i < b.i;
return a.n < b.n;
}
int main()
{
cin >> n;
for (int i = 1; i <= n; i++)
scanf("%d", &a[i].n), a[i].i = i;
sort(a+1, a+n+1, my_sort... | true |
8e0d7cc93555befdb7221082e79be4d1d40c88ff | C++ | MicrosoftDocs/cpp-docs | /docs/parallel/concrt/codesnippet/CPP/how-to-use-the-context-class-to-implement-a-cooperative-semaphore_4.cpp | UTF-8 | 422 | 3 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | // Acquires access to the semaphore.
void acquire()
{
// The capacity of the semaphore is exceeded when the semaphore count
// falls below zero. When this happens, add the current context to the
// back of the wait queue and block the current context.
if (--_semaphore_count < 0)
... | true |
1e64125b9eccca3bb6b2563f2722efe43ca7f871 | C++ | chang861224/sorting_comparison | /sorting/MergeSort.cpp | UTF-8 | 2,040 | 3.921875 | 4 | [] | no_license | #include "MergeSort.h"
void merge(int* array, int const left, int const mid, int const right){
auto const subArrayOne = mid - left + 1;
auto const subArrayTwo = right - mid;
// Create temp arrays
auto *leftArray = new int[subArrayOne];
auto *rightArray = new int[subArrayTwo];
// Copy data to ... | true |
85525314d8b1942eef748a8e7483e0f716c1a5c1 | C++ | Oseas1995/Programacion-II | /Programacion-II/II Parcial/Programas Pedro Molina/clase matriz.cpp | UTF-8 | 5,329 | 3.453125 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<ctime>
#include<iomanip>
using namespace std;
class matriz{
friend matriz operator -(const matriz&,const matriz&);
friend ostream& operator <<(ostream&,const matriz&);
protected:
int dim,dim1;
float**elementos;
public:
matriz();
matriz(int,int);
~matriz();
... | true |
34836b494fbdcd475850aeaaff46393016a39c60 | C++ | YueLeeGitHub/algorithm | /leetcode/array/73.cpp | UTF-8 | 1,433 | 3.171875 | 3 | [] | no_license | // https://leetcode-cn.com/problems/set-matrix-zeroes/
// Created by admin on 2021/3/21.
// 复用原数组的技巧
class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int row = 0;
int col = 0;
if(matrix[0][0]==0){
row=col=1;
}else{
for(int i = 0;i<matrix... | true |
d9fc30a88489ad61c7653338018311001ccff437 | C++ | CleverFroge/EndlessWar | /FrogEngine/Scripts/EnemyAI/ChaseState.cpp | WINDOWS-1252 | 1,146 | 2.625 | 3 | [] | no_license | #include "AI.h"
#include "AITankController.h"
ChaseState::ChaseState(Tank* tank, AITankController* aiController)
{
_tank = tank;
_aiController = aiController;
}
ChaseState::~ChaseState()
{
}
void ChaseState::OnEnter()
{
}
void ChaseState::Tick()
{
//
if (_tank->GetHealthValue() == 0)
{
_aiController->SetSta... | true |
d7cb444a7d2e7f59b67856a659afa91f194dea8a | C++ | Braveboy04/myLearn | /step3/template/arrayT/myArray.hpp | UTF-8 | 2,564 | 3.171875 | 3 | [] | no_license | #ifndef __myArray_hpp
#define __myArray_hpp
#include <iostream>
#include <string>
#include "pause.h"
using namespace std;
template <class T>
class MyArray
{
public:
T* m_Arr = NULL;
int m_Num = 0;
int m_Len = 0;
MyArray(int len);
MyArray(const MyArray &ma);
~MyArray();
void showArr();
void setArr();... | true |
195ccead4057331c51ff6854f16e2a2e64303aef | C++ | mkut/aoj | /Volume00/0028/c++.cpp | UTF-8 | 740 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
map<int, int> data;
vector<int> ans;
int num = 0;
int tmp;
while(cin >> tmp)
{
if(data.find(tmp) != data.end())
{
(data.find(tmp)->second)++;
}
else
{
data.insert(pair<int, int>(tmp, 1));... | true |
992e80a737f0143a598a77f8f22f7cbd4de04749 | C++ | cqw5/CodingTraining | /CrackingTheCodingInterviews/Solution/2.6/entryNodeOfLoop.cpp | UTF-8 | 1,960 | 3.65625 | 4 | [] | no_license | /*! Author: qwchen
*! Date : 2017-01-02
*! 字符串与数组: 2.6
*!题目描述:
* 一个链表中包含环,请找出该链表的环的入口结点。
*/
struct ListNode {
int val;
ListNode *next;
ListNode(int x): val(x), next(NULL) {}
ListNode(int x, ListNode* theNext): val(x), next(theNext) {}
};
/*
* 思路:
* 设环的起始点距离链表起点的长度为k,环的长度为loopSize,两个指针fast... | true |
80ac7a4e66825eb37ea39d9d861029ec741b752b | C++ | enyolka/cpp | /lab45/child.cpp | UTF-8 | 1,095 | 3.78125 | 4 | [] | no_license | #include <cstdlib>
#include <iostream>
class Child{
std::string name;
int age;
std::string school;
friend class Parent;
public:
Child(){};
Child(std::string, int, std::string);
~Child(){};
void Print();
};
class Parent{
std::string name;
int age;
Child child;
public:
Pa... | true |
cfc9d85884249cd4df5b42f559fa757f78d23ecc | C++ | Nikolayrasputnyi/test1-Nikolayrasputnyi | /work1/main.cpp | UTF-8 | 929 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int prime(int n) {
vector <int> prime(n + 1);
for (int i = 0; i <= n; i++)
prime[i] = 1;
prime[0] = prime[1] = 0;
for (int i = 2; i <= n; ++i)
for (int j = i*i; j <= n; j += i)
prime[j] = 0;
if (prime[n] != 0)
return n;
else
return 0;
}
vector <... | true |
43a0e8bce8ca90efaa90a70ed003f3663f3b57be | C++ | hlebec-tukallec/ITMO-University | /Labs A&DS/dfs/D.cpp | UTF-8 | 1,911 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
vector<vector<pair<int, int>>> edges;
vector<bool> visited;
vector<bool> br;
vector<int> in;
vector<int> up;
vector<int> color;
int maxColor;
int timer;
void dfs(int v, int ind = -1) {
visited[v] = true;
in[v] = up... | true |
d978838f28a294d3902d9b658810a749995683b8 | C++ | yull2310/book-code | /www.cplusplus.com-20180131/reference/cwchar/wcsspn/wcsspn.cpp | UTF-8 | 233 | 2.953125 | 3 | [] | no_license | /* wcsspn example */
#include <wchar.h>
int main ()
{
int i;
wchar_t wcsText[] = L"129th";
wchar_t wcsSet[] = L"1234567890";
i = wcsspn (wcsText,wcsSet);
wprintf (L"The initial number has %d digits.\n",i);
return 0;
}
| true |
40e029905c0960e91660f26943c062d8ee7e9429 | C++ | jeffdaily/pagoda | /src/Slice.H | UTF-8 | 7,371 | 3.390625 | 3 | [] | no_license | #ifndef SLICE_H_
#define SLICE_H_
#include <stdint.h>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include "RangeException.H"
using std::ostream;
using std::istringstream;
using std::string;
using std::strtol;
using std::vector;
// predeclare Slice and friend oper... | true |
08f7434cb7a99a3a30e6814e5ce1b18f202f3fed | C++ | woschukasz68/SnakeGame | /SnakeController.cpp | UTF-8 | 949 | 2.59375 | 3 | [] | no_license |
#include <iostream>
#include "SnakeController.h"
SnakeController::SnakeController(SnakeView &v, SnakeLogic &s):view(v), snake(s)
{}
void SnakeController::handleEvent(sf::Event &event) {
if (event.type == sf::Event::KeyPressed) {
if (event.key.code == sf::Keyboard::Up) {
snake... | true |
4d38e12a73933c8809444af353b599bca59956e8 | C++ | marciogarridoLaCop/Arduino-sketchs | /RGBDuino/RGBDuino.ino | UTF-8 | 1,577 | 3.0625 | 3 | [] | no_license | /*
Test sketch for RGBDuino board
Rodrigo Feliciano
https://www.pakequis.com.br
*/
#include <Adafruit_NeoPixel.h>
int n = 0;
Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(1, 13, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(1, 12, NEO_GRB + NEO_KHZ800);
void setup() {
for (n = 2; n <= 13;... | true |
2ff158da0e332b2f600a45d80288d7d172774e5d | C++ | computer-graphics-fall-2018-2019-haifa/project-hufflepuff | /Viewer/src/Utils.cpp | UTF-8 | 7,962 | 3.140625 | 3 | [] | no_license | #include "Utils.h"
#include <cmath>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <math.h>
#define PI 3.14159265358979323846 / 180
glm::vec3 Utils::Vec3fFromStream(std::istream& issLine)
{
float x, y, z;
issLine >> x >> std::ws >> y >> std::ws >> z;
return glm::vec3(x, y, z);... | true |
195b202bd4d0993910f3e026c722eb03279b4a2e | C++ | mayank-raj15/CP-codes | /prograd/string & trie/frequentCharacter.cpp | UTF-8 | 338 | 3.109375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int mostFrequentCharacter(string s, int n)
{
vector<int> alpha(26, 0);
int ans = 0;
for (int i = 0; i < n; i++)
{
alpha[s[i] - 97]++;
ans = max(ans, alpha[s[i] - 97]);
}
return ans;
}
int main()
{
string s;
cin >> s;
int n = s.length();
cout << mostFrequent... | true |
7ef92a17dc0f8b12ca6d631aa5be23360dfcf777 | C++ | lbrl/sctau | /SCTauFW/Sim/SimPapas/src/SCTauDetector/SCTauEcal.h | UTF-8 | 4,312 | 2.609375 | 3 | [] | no_license | #pragma once
#include "papas/detectors/Calorimeter.h"
#include <vector>
namespace papas {
class Particle;
class Cluster;
/// SCTau specific ECAL calorimeter implementation
///
/// SCTauECAL inherits from calorimeter class and must implement
/// clusterSize/acceptance/energyResolution etc methods
class SCTauECAL : ... | true |
6b85ae055f4df470c8a0abbcd3f1a8280812d69f | C++ | matianci111/pixel-galaxy | /bullet.h | UTF-8 | 614 | 2.6875 | 3 | [] | no_license | //
// bullet.h
// FirstRPG
//
// Created by Tianci on 08/04/2014.
// Copyright (c) 2014 Tianci. All rights reserved.
//
#pragma once
#ifndef __FirstRPG__bullet__
#define __FirstRPG__bullet__
#include <iostream>
#include <SDL2/SDL.h>
#include <vector>
#endif /* defined(__FirstRPG__bullet__) */
class bullet
{
publ... | true |
00c8801836afa7156f35cd6f7b82209f0c66e742 | C++ | YashReddyS/ncrwork | /c++/assignment 2/5/5/Source.cpp | UTF-8 | 1,636 | 3.359375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class String {
char *sptr;
int len;
public:
String() {
sptr = NULL;
len = 0;
}
String(const char *c) {
len = strlen(c);
sptr = new char[len + 1];
strcpy_s(sptr, len + 1, c);
}
String(String &s) {
len = s.len;
sptr = new char[len + 1];
strcpy_s(... | true |
8d9b51cf90d7176cab79b7beb2ae78fe3b977988 | C++ | Assist96/algorithms_study | /offer/chapter2/6_PrintListInreverseOrder.cpp | UTF-8 | 1,564 | 3.328125 | 3 | [] | no_license | #include<stack>
#include<iostream>
#include<vector>
using namespace std;
struct ListNode{
int m_nKey;
ListNode *m_pNext;
};
vector<int> res;
vector<int>& list_print_reverse_r(ListNode *Head){
if (Head==nullptr)return res;
ListNode *p=Head;
if(p!=nullptr){
if(p->m_pNext!=nullptr) list_pr... | true |
c35f1537b7f9c3ad683eead7a9c30865bc52ca3b | C++ | safarisoul/ResearchProjects | /2015-GeoRich-RepresentativeTopk/RepresentativeTopk/data.h | UTF-8 | 1,742 | 2.875 | 3 | [] | no_license | #ifndef DATA_H
#define DATA_H
#include<sstream>
#include<fstream>
#include<assert.h>
#include<iostream>
#include "rstree.h"
#include "rstutil.h"
using namespace std;
typedef struct Point
{
double coord[DIM];
friend istream& operator >> (istream& in, Point& p)
{
for(int d=0; d<DIM; d++)
... | true |
133c2f27d3340f33563d7c1efbc8839ad8957408 | C++ | kodack64/koma2010 | /koma2010/fader.h | UTF-8 | 585 | 2.8125 | 3 | [] | no_license | #pragma once
#include "base.h"
#define FadeMax 256
class Fader{
private:
int fin;
int cur;
int sp;
CDirectX *dx;
public:
int Set(int sfin,int speed,int scur){
fin=sfin;
sp=speed;
cur=scur;
return 0;
}
bool CheckEnd(){
return fin==cur;
}
int GetCur(){return cur;}
int Init(CDirectX *cdx){
dx=cd... | true |
f4ec71ec270c318b6a322ba198c10cb57d18ed25 | C++ | caalive/CLearn | /OneHour/lesson4/exercise4_1.cpp | UTF-8 | 900 | 3.296875 | 3 | [] | no_license | /*************************************************************************
> File Name: exercise4_1.cpp
> Author:
> Mail:
> Created Time: Tue 21 Nov 2017 09:27:25 PM CST
************************************************************************/
#include <iostream>
using namespace std;
int main()
{
enum Squa... | true |
f163028830a3130be8f96fae0c89e9dd7137e3f5 | C++ | LaLlorona/Algorithms | /BOJ/10001To15000/10825.cpp | UTF-8 | 1,135 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <fstream>
#include <string>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int n;
bool compair(pair<vector<int>, string> a, pair<vector<int>, string> b) {
if (a.first[0] != b.first[0]) {
return a.f... | true |
410e7433961246addfdeac7cc57868a260d6ce72 | C++ | ARLM-Attic/peoples-note | /src/client/src/Animator.cpp | UTF-8 | 1,396 | 2.625 | 3 | [] | no_license | #include "stdafx.h"
#include "Animator.h"
using namespace boost;
using namespace std;
//----------
// interface
//----------
Animator::Animator()
: lastFps (0)
, lastId (AnimationNone)
{
}
//-------------------------
// IAnimator implementation
//-------------------------
int Animator::GetLa... | true |
d7a18cbf18e8751c8b326168aa21e0b31669ff63 | C++ | RodrigoGonzalezCalfin/Programacion_Computadores | /Laboratorio_5/Actividad_4.cpp | UTF-8 | 471 | 3.015625 | 3 | [] | no_license | # include <stdio.h>
float radio_circunferencia = 0;
float numero_pi = 3.14159 ;
float area = 0;
float perimetro;
int main() {
printf("Por favor ingrese el radio de una circunferencia: ");
scanf("%f", &radio_circunferencia);
area = numero_pi * radio_circunferencia * radio_circunferencia;
perimetro = 2 * nume... | true |
ea552af33e53f5fe5c3d71c30df3d71ff515366a | C++ | AggHim/SRIB | /Coin_Collection_Game.cpp | UTF-8 | 1,626 | 2.78125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int dx[] = {-1,-1,-1};
int dy[] = {0,1,-1};
int maxi = -1;
void dfs(int** arr, int n, int row, int col, int score, int bomb){
if(row==0){
if(score>maxi){
maxi = score;
}
return;
}
if(score<0){
return;
}
for(int i=... | true |
109a00b3335632c6067a4df2c203be8be37aa45e | C++ | Sondro/spear | /src/client/EffectSystem.cpp | UTF-8 | 4,903 | 2.546875 | 3 | [
"Zlib"
] | permissive | #include "EffectSystem.h"
#include "client/AreaSystem.h"
#include "game/DebugDraw.h"
#include "sf/Geometry.h"
namespace cl {
struct EffectSystemImp final : EffectSystem
{
struct Effect
{
float lifeTime = 1.0f;
uint32_t entityId;
uint32_t endingIndex = ~0u;
uint32_t parentId = ~0u;
sf::Vec3 attachOffset... | true |
8519bd1af69df51290f48943650da1740aaa4562 | C++ | maslaral/cs161 | /week8/smallSort2.cpp | UTF-8 | 1,458 | 4.15625 | 4 | [] | no_license | /*************************************************************
** Author: Alex Maslar
** Date: February 25, 2019
** Description: Function that takes three integer pointers as
it's argument and sorts them by their values from smallest
to largest. It uses temp variables to help swap the order
as it evaluates the... | true |
e2cb3d87a5343f86796e75c1f0cf74b67a6975fd | C++ | guydvir2/Arduino | /BuildingBlocks/closet_LedStrip/closet_LedStrip.ino | UTF-8 | 6,033 | 2.515625 | 3 | [] | no_license | #define SENSORPIN_1 1//0//0 //3//2
#define SWITCHPIN_1 3//3//2 //2//0
#define BUTTONPIN_1 3
#define SENSORPIN_2 8
#define SWITCHPIN_2 3
#define BUTTONPIN_2 0
#define PWRDOWN_TIMEOUT 30 // mins <----- NEED TO CHANGE BY USER
class SensorSwitch
{
#define RelayON true
#define ButtonPressed LOW
#define SENSOR_DETECT_DOOR... | true |
9755744dd7203ddd86c8024d192938b215366495 | C++ | ParvezAhmed111/Data-Structure-and-Algorithms-with-cpp | /20.0 TEMPLATES/Templates/tut65_Templates_with_Multiple_Parameters.cpp | UTF-8 | 686 | 3.8125 | 4 | [] | no_license | #include<iostream>
using namespace std;
/*
CLASS TEMPLATES WITH MULTIPLE PARAMETERS (ONE, TWO OR MORE THAN TWO)
template<class T1, class T2.......(comma seperated)>
class nameOfClass{
//body
}
*/
template<class T1, class T2>
class myClass{
public:
T1 data1;
T2 data2;
myClass(T1 a, T2 b)... | true |
c60da09d58418cf9142700bf86ff4e8baece8a17 | C++ | caixiaomo/leetcode-ans1 | /leetcode C++/Binary_Tree/Binary_Tree_Post_order_Traversal copy/right.cpp | UTF-8 | 1,176 | 3.671875 | 4 | [] | no_license | /*
Binary Tree Postorder Traversal Total Accepted: 7521 Total Submissions: 25256 My Submissions
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
\
2
/
3
return [3,2,1].
Note: Recursive solution is trivial, could you do it iterativ... | true |