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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
210e35a5fb8babda0c58a22c99a3f939f1245f27 | C++ | robmayger/Neural-Net | /Net.cpp | UTF-8 | 10,435 | 2.671875 | 3 | [] | no_license | #include "Net.h"
#include "Neuron.h"
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <fstream>
void Net::load_data() {
ifstream inputs;
inputs.open("C:/Users/Rob/Documents/Essex/NNaDL/NN/NN/In.csv");
if (!inputs.is_open())
{
cout << "***Error!***\n" << "Could Not ... | true |
af33d2ffed51713b8fc2f7ae159eb80794fd65e5 | C++ | DhruvSharma845/topcoder | /cpp/health_food_3118.cpp | UTF-8 | 6,872 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
class HealthFood {
private:
auto findMeal(std::string diet, int dietIndex, std::vector<int>& protein, std::vector<int>& carbs, std::vector<int>& fat, std::vector<int>& calories, std::vector<int>& positions) -> int {
... | true |
9dc9c3541cfd9b5c08ddf93702ee9a758193ab0e | C++ | Workspace2110/University_Arduino | /單晶片系統實作/作業2_1071_3B_王政弘/Source Codes/hw02_1/hw02_1.ino | UTF-8 | 1,836 | 3.171875 | 3 | [] | no_license | /*
Coded by Jheng-Hong Wang (2018)
E-mail : workspace2110@gmail.com
Description:
題目: 數位時鐘(基本版)
接腳:
P11B(1~4) : 分別接微控板的 2 、3 、4 、5 腳
P11A(a~g) : 分別接微控板的 6 、7 、8 、9 、10 、11 、12 腳
P14 : 接微控板的 13 腳
DD : 接微控板的 A0 腳
P5-1 : 接微控板的 A1 腳
P6-5~P6-... | true |
f916fded01d9adee8d3a72d6ba71e56eb651dac2 | C++ | draaronv/daily_programs | /leetcode/number_good_pairs/main.cpp | UTF-8 | 336 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int numIdenticalPairs(vector<int>&nums)
{
int count=0;
for(int i=0;i<nums.size();i++)
{
for(int j=i+1;j<nums.size();j++)
{
if(nums[i]==nums[j])
{
count++;
}
}
}
return count;
}
int main()
{
vector<int> nums={1,1,1,1};
cout<<numIdenticalPairs(nums)<<end... | true |
c3408cac6e9882a4ffc32ff16e3ae75ed5024d17 | C++ | Adriantega12/PPD-Algoritmos | /line.cpp | UTF-8 | 2,309 | 3.375 | 3 | [] | no_license | #include "line.h"
// Recta dada una pendiente y una ordenada al origen
Line::Line(double _m, int _b, std::string _l) :
m(_m), b(_b), label(_l) { }
// Recta punto-pendiente
Line::Line(double m, int x, int y) :
Line(m, b = Line::calculateYCross(x, y, m)) { }
// Recta con dos puntos
Line::Line(int x1, int y1, int... | true |
3a77dcfd3c98fe1f2cc8a7f442566db5116aba39 | C++ | LunevAE/blackjack | /blackjack/deck.cpp | UTF-8 | 789 | 3.296875 | 3 | [] | no_license | #include "deck.h"
#include <random>
#include <iostream>
deck::deck()
{
cards.reserve(52);
createDeck();
}
deck::~deck()
{}
void deck::createDeck()
{
clear();
for (int s = card::CLUBS; s <= card::SPADES; s++)
{
for (int r = card::ACE; r <= card::KING; r++)
{
add(new card(static_cast<card::rank>(r),
s... | true |
736b5b229f4ac98f994c8ebeba1f530d448f66c9 | C++ | Lime5005/epitech-1 | /tek2/C++/Pool/cpp_d06/ex02/sickkoala.cpp | UTF-8 | 1,442 | 2.765625 | 3 | [] | no_license | /*
** sickkoala.cpp for cpp_d06 in /home/gogo/rendu/tek2/cpp_d06/ex02/sickkoala.cpp
**
** Made by Gauthier CLER
** Login <gauthier.cler@epitech.eu>
**
** Started on Mon Jan 09 14:14:19 2017 Gauthier CLER
** Last update Mon Jan 09 14:14:19 2017 Gauthier CLER
*/
#include <iostream>
#include <string>
#include <algorit... | true |
b794dc4395e8bf341e12b7873c265605bc2c63c7 | C++ | JuncoDH/CompetitiveProgramming | /Online_Judges/UVA/11402 - Ahoy, Pirates!.cpp | UTF-8 | 4,068 | 2.640625 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
//#pragma GCC diagnostic ignored "-Wsign-compare"
using namespace std;
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define LSB(x) ((x) & (-(x)))
typedef long long ll;
typede... | true |
5afad1eab1361ebe819410a0eab2f4814a048b6c | C++ | cokoyoh/cpp-pass-by-reference-using-pointers | /main.cpp | UTF-8 | 418 | 3.78125 | 4 | [] | no_license | #include <iostream>
using namespace std;
void cubeByReference(int*); //function prototype that takes a pointer
int main() {
int number{5};
cout << "The original value of number is " << number;
cubeByReference(&number);
cout << "\nThe new value of number is " << number << endl;
}
void cubeByReferen... | true |
eb6fdabda44dfbe72cbcd15cc52cd124de0260c6 | C++ | codingEzio/code_cpp_beginning_cpp17 | /Part_01/standalone_sizeof.cpp | UTF-8 | 409 | 3.59375 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int height{50};
// Well.. Just use `sizeof()` is fine ...
cout << "The height occupies " << sizeof height << " bytes.\n"
<< "Type 'long long' occupies " << sizeof(long long) << " bytes.\n"
<< "The result of the expr 'height * height /... | true |
03aa4874098507f7287b95cece54d0ece5b64060 | C++ | Nurbain/CPOA | /csg/BoundingBox.h | UTF-8 | 2,177 | 3.421875 | 3 | [] | no_license | /**
* @author Nathan Urbain
* @date 22/11/2017
*/
#ifndef BOUNDINGBOX_H
#define BOUNDINGBOX_H
#include "../vectorMatrix/vector.h"
class BoundingBox{
protected:
// y _____p2
// | | |
// | | |
// | p1_____|
// |____________x
//
//
Vec2d pointMin; //p1
Vec2d po... | true |
42092669793ed1c73554c883e2d249f2852209c4 | C++ | antsaukk/cpp-red | /week_5/priority_collection2.cpp | UTF-8 | 4,453 | 3.28125 | 3 | [] | no_license | #include "test_runner.h"
#include <algorithm>
#include <iostream>
#include <iterator>
#include <memory>
#include <queue>
#include <map>
#include <cmath>
#include <utility>
#include <vector>
using namespace std;
template <typename T>
class PriorityCollection {
public:
using Id = size_t;/* identificator type */
Pr... | true |
86253c18a291c2089cbd510b04abeeb35134fded | C++ | MohabAyoub10/Problems-solutions | /Codeforces/A - Sereja and Dima.cpp | UTF-8 | 586 | 3.0625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, Spoints = 0, Dpoints = 0;
cin >> n;
deque<int> card;
for (int i = 0; i < n; ++i)
{
int x;
cin >> x;
card.push_back(x);
}
for (int i = 0; !card.empty(); ++i)
{
if (i % 2 == 0)
... | true |
7e5bdc7ff492f17fd3ccb7862adf68ecc13e2b04 | C++ | JoaoRMaia/URI | /Lista 1/12545.cc | UTF-8 | 266 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main () {
int n;
int moves;
string s1;
string s2;
cin >> n;
for ( int i = 0 ; i < n ; i++){
cin >> s1 >> s2;
cout << s1 << " " << s2 << endl;
}
return 0;
}
| true |
9c0c769cb8f14fdec7cd58979de8ec92d49e669e | C++ | ATEC-Mikas/programacao-cpp | /Mikas/FT 01/exercicio4.cpp | UTF-8 | 242 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
int x;
cout << "Digite um numero:";
cin >> x;
cout << "Antecedente: " + to_string(x-1) + "\nSucessor:" + to_string(x+1);
return 0;
}
| true |
fadc834c0b95d96e6abcc414feee6fd1cb34f639 | C++ | DT3264/ProgrammingContestsSolutions | /Codeforces/1257B.cpp | UTF-8 | 445 | 3.015625 | 3 | [
"MIT"
] | permissive | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
int x, y;
bool can;
scanf("%d", &t);
while(t--){
can=true;
scanf("%d%d", &x, &y);
if(x==1 && y>1){
can=false;
}
if(x<=3 && y>3){... | true |
2dd2079f6ae3074c5adbff5cb7a5b50eb0f6a8a8 | C++ | Maddy0669/GeeksForGeeks-Problems | /Linked List/Detect loop in LL.cpp | UTF-8 | 324 | 2.765625 | 3 | [] | no_license | bool detectLoop(Node* head)
{
Node* slow=head;
Node* fast=head->next;
bool ans=false;
while(fast!=NULL and fast->next!=NULL and slow!=NULL){
if(fast==slow){
ans=true;
break;
}
fast=fast->next->next;
slow=slow->next;
}
return ans; ... | true |
72a860c1f3fe768467bf8cb43c79449cbfc03613 | C++ | HuangChiEn/open_datastructure | /main.cpp | UTF-8 | 1,286 | 2.65625 | 3 | [] | no_license | #include<iostream>
using std::cout;
#include<ctime>
#include<cstdlib>
#include<cstdint>
#include<string>
// DS-include
#include"header/DataStructure.h"
#include"source/DataStructure.cpp"
#include"testing/Blkbox_Tester.h"
int main(){
const uint32_t MAXLEN = 200;
const int32_t DIGRNG = 300;
srand(time(NULL));
in... | true |
73facd8a2dc7f54ae725a4221c5fe96bfc2748a0 | C++ | jordsti/stigame | /StiGame/gui/ItemValue.h | UTF-8 | 390 | 2.65625 | 3 | [
"MIT"
] | permissive | #ifndef ITEMVALUE_H
#define ITEMVALUE_H
#include "Item.h"
namespace StiGame
{
namespace Gui
{
enum ItemValueType {
IVT_Integer,
IVT_String,
IVT_ValueObject
};
class ItemValue
{
public:
ItemValue(Item *m_parent);
virtual ~ItemValue();
virtual ItemValueType getType(void) = 0;
Item* getP... | true |
5b1f0d428b47f0d895040975f466b4cf10ee6256 | C++ | heechan3006/CS | /BOJ/BOJ_2331/BOJ_2331/소스.cpp | UTF-8 | 477 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <math.h>
#define MAX_N 300000
using namespace std;
int A, P;
int visited[MAX_N];
int ans;
int compute_num(int A, int P,int ans) {
if (A== 0) return ans;
compute_num(A / 10, P,ans+pow(A%10,P));
}
void dfs(int A) {
visited[A] += 1;
if (visited[A] == 3) return;
dfs(compute_num(A, P,0));... | true |
21e8226c8b5452fbd5e21dba31d48a459e0a8315 | C++ | moevm/oop | /5382/lonchina/lab5/Figures/Rectangle.h | UTF-8 | 742 | 2.9375 | 3 | [] | no_license | #ifndef LONCHINA_RECTANGLE_H
#define LONCHINA_RECTANGLE_H
#include "AbstractShape.h"
#include "Point.h"
#include <vector>
#include <iostream>
#include <cmath>
class Rectangle: public AbstractShape
{
private:
std::vector<Point> coord;
Point center;
public:
// конструктор Треугольника
Rectangle(std::ve... | true |
94d314681a2636f7a97ece3c25f9674984bfa490 | C++ | rohitativy/turicreate | /src/platform/parallel/execute_task_in_native_thread.hpp | UTF-8 | 1,957 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | /* Copyright © 2017 Apple Inc. All rights reserved.
*
* Use of this source code is governed by a BSD-3-clause license that can
* be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
*/
#ifndef TURI_PARALLEL_EXECUTE_TASK_IN_NATIVE_THREAD_HPP
#define TURI_PARALLEL_EXECUTE_TASK_IN_NATIVE... | true |
b46bd09ce5b91777a4be216f60a11a44642f3987 | C++ | yao4ming/codeeval | /moderate/C++/RemoveCharacters/main.cpp | UTF-8 | 965 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
using namespace std;
string trim(string str) {
string trimmedStr;
int i, j;
//trim left end
for (i= 0; i < str.size(); ++i) {
if (str[i] != ' ')
break;
}
trimmedStr = str.substr(i);
//trim rig... | true |
ae11d29c65ad8782126ff3b4fdb3ac886b0318ca | C++ | LemonSpike/enigma | /reflector.cpp | UTF-8 | 2,063 | 3.28125 | 3 | [] | no_license | #include "reflector.h"
using namespace std;
int Reflector::read_reflector_config(const char *filename) {
ifstream input(filename);
if (input.fail()) {
err_stream << "Error opening reflector configuration file.";
return ERROR_OPENING_CONFIGURATION_FILE;
}
FileReader reader(err_stream);
int error_... | true |
02ce3a1800724fcd6785549ac33fe3abf275fd77 | C++ | lzabry/quantnet_cpp | /Level 1/Section 1.3/HW1.3/1.3.7/1.3.7/1.3.7.cpp | UTF-8 | 318 | 3.125 | 3 | [] | no_license | // 1.3.7.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <stdio.h>
void main()
{
int n=4;
int number=243;
int number2;
number2 = number << n;
printf("After mutiply %d by 2 to the power of %d, the final answer is %d", number, n, number2);
}
| true |
73c39d1d0d74b3c0f560b3bc34534e1b7535959c | C++ | PaulMcClernan/Forge | /CCommandNode.cpp | UTF-8 | 1,965 | 2.609375 | 3 | [
"Zlib"
] | permissive | /*
* CCommandNode.cpp
* HyperCompiler
*
* Created by Uli Kusterer on 10.05.07.
* Copyright 2007 M. Uli Kusterer. All rights reserved.
*
*/
#include "CCommandNode.h"
#include "CValueNode.h"
#include "CParseTree.h"
#include <assert.h>
#include "CNodeTransformation.h"
namespace Carlson
{
void CCommandNode::... | true |
71de3c941be96c026a41a15b8972ec33350ee828 | C++ | JohnLFX/COP3331-Final-Project | /myprogram/src/commands/CommandCreateNewUser.h | UTF-8 | 899 | 2.796875 | 3 | [
"MIT"
] | permissive | #ifndef INC_3331PROJECT_COMMANDCREATENEWUSER_H
#define INC_3331PROJECT_COMMANDCREATENEWUSER_H
#include "types/AuthenticatedCommand.h"
class CommandCreateNewUser : public Command {
public:
CommandCreateNewUser(FinalProject *finalProject) : Command(1, finalProject) {}
void execute() {
cou... | true |
42fdafa614dbf6400c227baebda82e33bf5fe238 | C++ | ailyanlu1/Contests | /DMOJ C++/dmopc16c3p6_long_lost_love/DMOPC16C3P6.cpp | UTF-8 | 3,218 | 2.609375 | 3 | [] | no_license | /*
* DMOPC16C3P6.cpp
*
* Created on: May 30, 2017
* Author: Wesley Leung
*/
#include <bits/stdc++.h>
#define MAXN 100000
#define MAXQ 500000
using namespace std;
int arr[MAXN + 1];
int revInd = 0;
int N, Q, x, y;
char c;
struct Node {
public:
Node* left;
Node* right;
i... | true |
4b8b3f1b93db5af4e3fc559d7ad2f21a266a2406 | C++ | ritukeshbharali/ofeFRAC | /src/util/ObjectFactory.h | UTF-8 | 2,596 | 3.203125 | 3 | [] | no_license | /*
*
* Copyright (C) 2007 TU Delft. All rights reserved.
*
* This class implements a rather simple but generic object
* factory, following a column in gamedev.net.
*
* Usage:
*
* 1. Define a factory for a concrete super class:
*
* ObjectFactory<Material,int> MaterialFactory;
*
* 2. Regist... | true |
88f38b9cdaf9afa335dba48919967a60b26817dc | C++ | luiarthur/ucsc_litreview | /cytof/src/model3/sims/tests/bla.cpp | UTF-8 | 236 | 2.90625 | 3 | [] | no_license | #include <vector>
struct Bla {
Bla(int x, int y) : vec_x(2), vec_y(2) {
for (int z=0; z<2; z++) {
vec_x.resize(x);
vec_y.resize(y);
}
}
std::vector<int> vec_x;
std::vector<int> vec_y;
}
auto bla = Bla(3,5)
| true |
85bea85f5b709861eb14c72a7062b25db2e097c1 | C++ | ANKITPODDER2000/cpp | /basic/prog23.cpp | UTF-8 | 423 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int coef(int ,int );
int main()
{
int n,k;
cout << "Enter value of n & k = " ;
cin >> n >> k;
cout << "C(n,k) is : " << coef(n,k);
return 0;
}
int coef(int n,int k)
{
int matrix[n+1][k+1],i,j;
for(i=0;i<n+1;i++)
{
for(j=0; j<=i;j++)
{
if(j==0 || i==j)
matrix[... | true |
27e78817e0d1665049a0f1e754a330438a964a59 | C++ | FellowshipOfTheGame/Castella | /include/Input.hpp | UTF-8 | 668 | 2.828125 | 3 | [] | no_license | #ifndef INPUT_H
#define INPUT_H
#include <SDL/SDL.h>
//Handles the input
class Input
{
public:
enum InputValue{
NO_INPUT = 0,
UNDEFINED_INPUT,
QUIT,
MOUSE_LEFTCLICK,
};
public:
//Get the next input from the queue
static int get_input... | true |
6678f0e81aaa5347a906a8b06e047712ae3059ed | C++ | Rthiskidw/Project1-CollegeTouring | /souvenirshop.cpp | UTF-8 | 4,810 | 2.625 | 3 | [] | no_license | #include "souvenirshop.h"
#include "ui_souvenirshop.h"
#include "endtour.h"
#include <QMessageBox>
#include <QVBoxLayout>
using namespace std;
souvenirShop::souvenirShop(double distance, QVector<QString> collegesVector, QWidget *parent) :
QWidget(parent),
ui(new Ui::souvenirShop)
{
ui->setupUi(this);
... | true |
936b118b1e04d3e4e530bbbd9330c62e87c945d9 | C++ | denkoRa/cses | /fenwick.cpp | UTF-8 | 5,819 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <queue>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#define endl '\n'
#define sync_cin \
ios_base::sync_with_stdio(f... | true |
80bf576a1173a839b677d4f44be9d35b8139f49a | C++ | hhool/cmakelist_examples | /projects/l_project_cpugpu/picture.h | UTF-8 | 4,251 | 2.640625 | 3 | [] | no_license | #pragma once
#pragma pack (1)
class Picture
{
public:
typedef struct tag_BMP_FILEHEADER
{
unsigned short bfType; //2Bytes,必须为"BM",即0x424D 才是Windows位图文件
unsigned int bfSize; //4Bytes,整个BMP文件的大小
unsigned short bfReserved1; //2Bytes,保留,为0
unsigned short bfRes... | true |
6c08f182fd7b1f0a1c2dbc04674000e677c62c16 | C++ | greenjava/fw4spl-swig | /fwBinding/include/fwBinding/Data.hpp | UTF-8 | 592 | 2.5625 | 3 | [] | no_license | #ifndef __FWBINDING_DATA_HPP__
#define __FWBINDING_DATA_HPP__
#include "fwBinding/config.hpp"
#include <string>
namespace fwBinding
{
/**
* @class Data
*/
class FWBINDING_CLASS_API Data
{
public:
/// Constructor.
FWBINDING_API Data(const std::string& objectType, const std::string& uid = "");
/// De... | true |
65ebdbd6c3fb280cd2a7c3aada82156c73a463d6 | C++ | belyaev-mikhail/dddos | /Util/macros.h | UTF-8 | 2,507 | 2.53125 | 3 | [] | no_license | /*
* macros.h
*
* Created on: Dec 7, 2012
* Author: belyaev
*/
// GUARDS ARE NOT USED FOR A REASON!
// #ifndef MACROS_H_
// #define MACROS_H_
#ifdef CALLOPHRYS_MACROS_DEFINED
#error "macros.h included twice!"
#endif
#define CALLOPHRYS_MACROS_DEFINED
/*
* Macro for quick-writing one-liners with tricky ty... | true |
02055cd4ee1686f6b22825fe168c689a9ed64ae6 | C++ | DaehyunPY/lma2root | /lma2root/BinaryDump.cpp | UTF-8 | 1,234 | 2.796875 | 3 | [] | no_license | #include "BinaryDump.h"
#include<iostream>
BinaryDump::BinaryDump(const string fileName) :hitsFile(MyArchive::ArWriting)
{
hitsFile.newFile(fileName.data());
if (!hitsFile.fileIsOpen())
std::cout << "Can not open the Dump file: " << fileName;
}
BinaryDump::~BinaryDump()
{
if (hitsFile.fileIsOpen())
hitsFile.C... | true |
06008d205143ab289cab1491b573479e227f6b04 | C++ | zacharygking/BoulderBlast | /BoulderBlast/Actor.cpp | UTF-8 | 12,422 | 2.84375 | 3 | [] | no_license | #include "Actor.h"
#include "StudentWorld.h"
// Students: Add code to this file (if you wish), Actor.h, StudentWorld.h, and StudentWorld.cpp
//gets keypress, in the case of up down left or right the
//player checks if it can move in that direction, if it can
//it moves, if it is blocked it checks if it’s a boulder, i... | true |
be0064918c3616b5686f2ea85eb674d534c8ba98 | C++ | piyush2011257/GFG | /AMAZON/167/r1_q1.cpp | UTF-8 | 2,047 | 3.453125 | 3 | [] | no_license | /*
http://www.geeksforgeeks.org/amazon-interview-experience-set-167-sde-1-year-6-months-experience/
Given a list of N coins, their values (V1, V2, … , VN), and the total sum S. Find the minimum number of coins the sum of which is S (we can use as many coins of one type as we want), or report that it’s not possible to s... | true |
8f24f27eb3225149dfe3c022f1e11dfa87d431aa | C++ | CapSmollet/Info | /5/main.cpp | UTF-8 | 1,119 | 3.15625 | 3 | [] | no_license | #include <iostream>
using namespace std;
void put_snake(int** &a, int k, int s)
{
for (int i = 0; i < k; i++)
{
for (int j = 0; j < s; j++)
a[i][j] = 0;
}
a[0][s - 1] = 1;
int c = 1, i = 0, j = s - 1;
while (c < k * s)
{
while (j >= 1 && a[i][j - 1] == 0)
... | true |
696590f6946e1265b1ad3c3dcbeb5a825a065997 | C++ | CoffeeIsLife87/Abstact_Class_Example_for_CPP | /AbstractClassExample/ActualImple.h | UTF-8 | 1,305 | 2.828125 | 3 | [
"MIT"
] | permissive | #include "BasicInterface.h"
/*-------------------------------------------------------------------------------------------------------------------------------------*\
| This file contains the class with the actual implementation of the functions |
| For ActualImplementation to get added to a vector of... | true |
ef10c4940ebd1ca1e6c78d9e06e5ceb1e9f81c0a | C++ | jesmur/HumansVsZombies | /Organism.h | UTF-8 | 1,042 | 2.90625 | 3 | [] | no_license | #ifndef HUMANSVSZOMBIES_ORGANISM_H
#define HUMANSVSZOMBIES_ORGANISM_H
#include <iostream>
#include "GameSpecs.h"
using namespace std;
class City;
enum species {HUMAN, ZOMBIE};
struct coord {
int x;
int y;
coord(int x, int y) {
this->x = x;
this->y = y;
}
};
class Organism {
prot... | true |
cdf3430de5b3c6aa865998829ed01851dbe4e0f6 | C++ | StrelokCH/woipv | /LocalSolverSat/LocalSolver/lsoperator.h | UTF-8 | 22,848 | 3.046875 | 3 | [] | no_license | // Copyright (C) 2018 Innovation 24, Aix-Marseille University, CNRS. All rights reserved.
#ifndef LS_LSOPERATOR_H
#define LS_LSOPERATOR_H
namespace localsolver {
/**
* Mathematical operators available for modeling. These operators are used to type
* the expressions created in a %LocalSolver mathematica... | true |
2dcb5a426e83d0d3c1881fe587d001e7f22b4b93 | C++ | hfutcgncas/ppqCode | /TabletennisCln/colorCamera/colorCamera/dataStruct.h | GB18030 | 1,451 | 2.71875 | 3 | [] | no_license | #pragma once
#include <vector>
using std::vector;
/*************************************************
class: BallPoint
Description: ƹ״̬
ļ¼ 2015/11/30
*************************************************/
class BallPoint
{
public:
#pragma region State x,y,z,Vx,Vy,Vz,Wx,Wy,Wz,t
double x; double y;... | true |
6df1f29a38db40f37a3e9fd43a0bcdb39ac1a173 | C++ | MasahiroOgawa/programmingcontest_challengebook | /2-4/stlmap.cpp | UTF-8 | 529 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <map>
using namespace std;
int main(){
map<int,string> m;
m.insert(make_pair(1,"one"));
m.insert(make_pair(10,"ten"));
auto it = m.find(1);
if(it != m.end()) cout << it->second << endl;
else cout << " 1 not found.\n";
it = m.find(2);
if(it != m.end()) cout... | true |
5a5ae58c2fa0980544c99d869cf4c10a4b1ee204 | C++ | lucifer1004/codeforces | /1402/a/a.cc | UTF-8 | 1,100 | 2.734375 | 3 | [
"CC-BY-4.0"
] | permissive | #include <iostream>
#include <stack>
#include <vector>
#define MOD 1000000007
using namespace std;
typedef int64_t ll;
struct Segment {
ll h, w;
};
stack<Segment> st;
ll ans = 0;
void insert(ll h, ll w) {
if (st.empty() || st.top().h < h)
st.push({h, w});
else if (st.top().h == h)
st.top().w += w;
}
v... | true |
e3f87a59ff9719a7ee13b02fa7b0556e4d04055c | C++ | BlockJJam/MyCppStudy | /Chapter7_14(단언하기assert)/Chapter7_14.cpp | UHC | 582 | 3.375 | 3 | [] | no_license | /*
Assert - ܾϱ
뿡 Ȱϴ ִ
*/
#include <iostream>
#include <cassert> // assert.h
#include <array>
using namespace std;
void printValue(const array<int, 5> &my_array, const int& ix)
{
assert(ix >= 0);
assert(ix <= my_array.size() - 1);
cout << my_array[ix] << endl;
}
int main()
{
array<int, 5> my_array{ 1,2,3,4... | true |
0fbee4531193a492b58b784fac7b8ba907e4427d | C++ | mailset/YingXiaohaoShengChengQi | /营销号生成器.cpp | UTF-8 | 944 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
string 参与者, 事件, 另一种说法;
cout << "营销号生成器 by mail_set\n";
cout << "请输入参与者:";
cin >> 参与者;
cout << "\n请输入事件:";
cin >> 事件;
cout << "\n请输入另一种说法:";
cin >> 另一种说法;
cout << "\n " << 参与者<< 事件 << "是怎么回事呢?" << 参与者 << "相信大家都很熟悉,但是" << 参与者 << 事件 <<... | true |
8d1d16c7404fc08e5522c04a4e1dc4cf50ea9d02 | C++ | shauryauppal/Algo-DS-StudyMaterial | /Algorithm important/LCM.cpp | UTF-8 | 511 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | #include <bits/stdc++.h>
using namespace std;
/*int main()
{
int a,b;
cin>>a>>b;
cout<<"\nLcm->";
for(int i=1;i<=a*b;i++)
if(i%a==0 && i%b==0)
{
cout<<i;
break;
}
}*/
//METHOD 2
int gcd(int a,int b)
{
if(b==0)
return a;
return gcd(b,a%... | true |
db0b6d4779f71eefa04382511b9bd1774c9f30e1 | C++ | JonasEira/lab5 | /projects/assignment/code/Square.cpp | UTF-8 | 2,274 | 2.75 | 3 | [] | no_license | #include "Square.h"
#include "assignmentapp.h"
#include <iostream>
Square::Square() {}
Square::Square(float width, float height)
{
this->width = width;
this->height = height;
}
void Square::setColor(float r, float g, float b) {
this->c.r = r;
this->c.g = g;
this->c.b = b;
}
void Square::setPosition(Vector2D v)
... | true |
8bb09024677624674df1b24a0616cb0307da6763 | C++ | SWSEP/Aspen | /src/attribute.cpp | UTF-8 | 2,091 | 2.75 | 3 | [
"MIT"
] | permissive | #include <string>
#include "mud.h"
#include "conf.h"
#include "attribute.h"
#include "world.h"
Attribute::Attribute(AttributeType type, AttributeApplication application, int mod, int id):
_type(type), _application(application), _mod(mod), _id(id)
{
}
AttributeType Attribute::GetType() const
{
return _type;
}
... | true |
7338d2c8134c5e07432e063a81b021062c1b0b36 | C++ | arangodb/arangodb | /3rdParty/boost/1.78.0/libs/multi_array/example/subview2.cpp | UTF-8 | 1,246 | 2.65625 | 3 | [
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | // Copyright 2002 The Trustees of Indiana University.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Boost.MultiArray Library
// Authors: Ronald Garcia
// Jeremy ... | true |
a0512ed3e8a86c4328752a575204bc10ea7026bd | C++ | Xnco/Data-Structures-and-Algorithms | /TitleProject_Cpp/0110_平衡二叉树.cpp | UTF-8 | 1,340 | 3.578125 | 4 | [] | no_license |
#include "pch.h";
#include <iostream>;
#include <vector>;
#include <sstream>;
#include <stack>;
#include <math.h>
using namespace std;
#pragma region 110_平衡二叉树
/*
给定一个二叉树,判断它是否是高度平衡的二叉树。
本题中,一棵高度平衡二叉树定义为:
一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过1。
示例 1:
给定二叉树 [3,9,20,null,null,15,7]
3
/ \
9 20
/ \
15 7
返回 true 。
... | true |
c34ea788400e581e573aa57cbcd9a34a5b9ad1ec | C++ | dipu-kr-sah/OOPS-BT-CSE-405 | /program-6/program-6.cpp | UTF-8 | 1,111 | 3.4375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class String
{
private:
string test;
public:
friend String operator +( String s1, String s2)
{
String s3;
s3.setTest(s1.getTest()+" "+s2.getTest());
return s3;
}
public:
void setTest(string name)
{
test=name;
}
void display()
{
cout<<getTest()... | true |
721a56a4863ce8e056685e0bf0bcd3c859c73c83 | C++ | showmic96/Online-Judge-Solution | /Gym/101652S/13586975_AC_30ms_3552kB.cpp | UTF-8 | 1,211 | 2.8125 | 3 | [] | no_license | // In the name of Allah the Most Merciful.
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string ar;
cin >> ar;
int l1 = 0 , r1 = 0 , l2 = 0 , r2 = 0 , now = 0 , mx1 = 0 , mx2 = 0 , last = 0;
for(int i=0;i<ar.size();i++){
... | true |
e8b0fb3ec7d3fc5e51e5d2e1baf34694aa068f74 | C++ | gwanhyeon/algorithm_study | /beakjoon_algorithm/beakjoon_algorithm/브루트포스/NM시리즈(11).cpp | UTF-8 | 1,202 | 2.5625 | 3 | [] | no_license | //
// NM시리즈(11).cpp
// beakjoon_algorithm
//
// Created by kgh on 01/10/2019.
// Copyright © 2019 kgh. All rights reserved.
//
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
using namespace std;
int n,m;
int arr[10001];
int check[10001];
vector<int... | true |
eeed913264b0b6f4899d2931bc9fabaa1b4a55c3 | C++ | 4laconic/MiAPR | /First_K-means/kmeans.cpp | UTF-8 | 3,247 | 2.90625 | 3 | [] | no_license | #ifndef kmeanscpp
#define kmeanscpp
#include "Kmeans.h"
#define sqr(x) (x)*(x)
#define TCluster list<point>
#define TClusters vector<TCluster >
Kmeans::Kmeans(int countPoint, int countClus, int w, int h, TImage *pImg) {
n = countPoint;
k = countClus;
width = w;
height = h;
pImage = pImg;
}
inline... | true |
b09e42d35273c2ffdd59996822ffc5237e1c8ed5 | C++ | arthurarp/Maratonas-de-programacao | /tep/10/contest/B/main.cpp | UTF-8 | 386 | 2.75 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
int n; cin >> n;
vector<int> v;
for(int i = 0; i < n; ++i)
{
int number; cin >> number;
v.push_back(number);
}
double divisor = 0;
for(int i = 0; i < n; ++i)
divisor += (1.0 / v[i]);
double ... | true |
6d2805ade9c9a0546a0a098e6c5295c548782292 | C++ | Pyerce/301Assignment4 | /person.cpp | UTF-8 | 583 | 2.984375 | 3 | [] | no_license | //
// person.cpp
// Assignment4
//
// Created by Pierce Findlay on 4/16/19.
// Copyright © 2019 Pierce Findlay. All rights reserved.
// Pierce Findlay
// Section 2
#include "person.h"
Person::Person()
{
payRate = 0;
hoursWorked = 0;
}
string Person::getFirstName()
{
return firstName;
}
string Person:... | true |
d9c0ef94c560fccd3374385f793af3c8f1e864a8 | C++ | ChunkyPastaSauce/LabVIEW-libsvm | /cpp/LVUtility.cpp | UTF-8 | 1,709 | 2.890625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | #include "stdafx.h"
#include "LVUtility.h"
#include "LVTypeDecl.h"
#include "LVException.h"
#include "extcode.h"
#include <codecvt>
void LVWriteStringHandle(LStrHandle &strHandle, const char* c_str, size_t length) {
// Check if handle state is good.
if (DSCheckHandle(strHandle) == noErr) {
// Reserve (resize) eno... | true |
d62e13f7d011d435a45a488c0c995fab5e7415de | C++ | c-pages/dia2code---Maxscript | /exemple/codeCPP_exemple 1/Gadget.cpp | UTF-8 | 1,560 | 2.515625 | 3 | [] | no_license | /////////////////////////////////////////////////
// Headers
/////////////////////////////////////////////////
#include <Gadget.h>
namespace gui {
public:
/////////////////////////////////////////////////
Gadget::Gadget ()
: m_actif ( true )
, m_visible ( true )
{
}
/////////////////////////////////////////... | true |
bc06ff9c92e6aba2179aff175cae6886a6d2ffa8 | C++ | pomagma/pomagma | /src/platform/worker_pool_test.cpp | UTF-8 | 1,076 | 3.109375 | 3 | [
"MIT"
] | permissive | #include <pomagma/platform/util.hpp>
#include <pomagma/platform/worker_pool.hpp>
using namespace pomagma;
struct Task
{
std::chrono::milliseconds duration;
};
struct Processor
{
void operator() (const Task & task)
{
POMAGMA_DEBUG("sleeping for " << task.duration.count() << "ms");
std::thi... | true |
999f250d52d679401bed55a7513a5b4cc0d4e674 | C++ | ShashankSaumya123/CS-141 | /lab5_q12.cpp | UTF-8 | 592 | 3.859375 | 4 | [] | no_license | // Ask for month number and print number of days in that month
// including library
#include<iostream>
using namespace std;
int main()
{
// defining variables
int month;
// Asking for input
cout << "Please write the month number" << endl;
cin >> month;
// if else
if ((month == 1)||(month == 3)||(month == 5)||(mo... | true |
ed0afddffa2eb40fe0f3a6932442776b713a9207 | C++ | jtran8/Langtons-Ant | /ant.hpp | UTF-8 | 733 | 2.71875 | 3 | [] | no_license | /*******************************************************************************
** Author: Jacky Tran
** Date: 04/15/2019
** Description: This is the specification file for the ant class. This class
** keeps track of the ant's location and direction. This class
** also r... | true |
8bd580354a1b49f6070009fab7db006c6dc234b9 | C++ | vuongsoi/baitap | /baithiso2.cpp | UTF-8 | 395 | 2.65625 | 3 | [] | no_license | #include<stdio.h>
int main(){
int sonam;
float tongvon,tylesolai;
printf("tongvon la:\n");
scanf("%f",&tongvon);
printf("tylesolai la:\n");
scanf("%f",&tylesolai);
printf("sonam la:\n");
scanf("%d",&sonam);
for(int i=1;i<=sonam;++i){
float lai=(tongvon*tylesolai)/100;
tongvon+=lai;
printf("so... | true |
4639336d3e1e388b17b4b28fec5705d0be2458c4 | C++ | RubisetCie/mario-constructor-master | /Sources/Miscs/effect_shard.cpp | UTF-8 | 895 | 2.71875 | 3 | [] | no_license | /* Creator : Matthieu (Rubisetcie) Carteron
Language: C++
*/
#include <SFML/Graphics.hpp>
#include "../../Headers/Miscs/effect_shard.hpp"
#define SHARD_ROTATESPEED 25
using namespace sf;
Effect_Shard::Effect_Shard(Texture* shardTexture, Vector2f speed, Vector2f position, float startangle, float height) : Effect(p... | true |
c60258f71d6bdaddca8ae95d773e51f7c62615f0 | C++ | rotanov/fefu-mmorpg | /3rd/deku2d/2de_Math.cpp | UTF-8 | 6,237 | 2.875 | 3 | [] | no_license | #include "2de_Math.h"
#include <cstring>
#include <cstdio>
#include <limits>
#include <algorithm>
#include "2de_Vector2.h"
#include "2de_Matrix2.h"
namespace Deku2D
{
unsigned g_seed = 152406923;
//unsigned g_seed = time(NULL);
static float SineTable[Const::Math::SINE_COSINE_TABLE_DIM], CosineTable[Const::Math::... | true |
deb4e77e1ac676de65706bacad24bf7b10ab8341 | C++ | mahdialikhasi/Sharif-AI-Challenge-2019 | /myClient/client/src/Model/Interface/Hero.cpp | UTF-8 | 3,512 | 3.015625 | 3 | [
"CC0-1.0"
] | permissive | //
// Created by dot_blue on 1/23/19.
//
#include <iostream>
#include "Hero.h"
Hero::Hero(bool _isNull) {
if(_isNull) {
// this->_id = -1;
this->isNull = true;
}
}
Hero::~Hero() {// Check the vectors
for (std::vector<Ability *>::iterator it = _abilities.begin() ; it != _abilities.end(); ... | true |
7f54ae112e250ed88314261ded0972aee15676dd | C++ | IvanDimitrov2002/school | /c/11/hw2/server/main.cpp | UTF-8 | 1,326 | 2.609375 | 3 | [] | no_license | #include "server.h"
#include "processauth.h"
#include "processusers.h"
#include <iostream>
int main(){
std::vector<std::string> paths;
paths.push_back("/login.html");
paths.push_back("/home.html");
paths.push_back("/api/login");
paths.push_back("/api/get_users");
std::vector<Process*> processes... | true |
37fc00b498f8cb79aafcdbab42df8191ed46f96e | C++ | zuozhoulin/cpp | /note小知识/7-point_to_function_point指向函数指针的指针.cpp | UTF-8 | 1,350 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <functional>
using namespace std;
//定义func为函数
typedef int func(int);
//等价定义。
typedef int (*func2)(int);
//定义指向函数的指针
typedef func *func_ptr;
//定义指向函数指针的指针
typedef func_ptr *func_ptr_ptr;
/*
int (**p)(int);
(**p)(int)是个整数。**p 是个函数,返回一个整数。
于是 *p 是个函数的指针。 p 是个函数指针的指针。
按定... | true |
f3323b98ff1a9992cfce3211467f3d2028aa87c5 | C++ | CompPhysics/ComputationalPhysics | /doc/Programs/OOExamples/solar-system/vec3.cpp | UTF-8 | 2,935 | 3.703125 | 4 | [
"CC0-1.0"
] | permissive | #include "vec3.h"
#include <cmath>
#include <iostream>
using namespace std;
vec3::vec3()
{
zeros();
}
vec3::vec3(double x, double y, double z)
{
components[0] = x;
components[1] = y;
components[2] = z;
}
void vec3::print()
{
// Will print matlab syntax vector. Output will be like: [2.09, 5.3, 9.1... | true |
395a60106f186c28674c2dafdff499447b851708 | C++ | ProfJust/TIN | /_Kap 05 - Quellcode/5_06_passwort.cpp | ISO-8859-1 | 1,054 | 2.96875 | 3 | [] | no_license | // ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
// passwort.cpp : Definiert den Einstiegspunkt fr die Konsolenanwendung.
// BSP02_06
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h> //exit()
#include <windows.h> ... | true |
362e74fda41506c8837b91fae75124f2f5b1388f | C++ | zarif98sjs/Competitive-Programming | /CodeForces/Contest/Round 649/D.cpp | UTF-8 | 4,739 | 2.8125 | 3 | [] | no_license |
/**
Start with an empty graph and keep adding vertices from 1 to K in increasing order, using a DSU to keep track of connected components. If you ever add an edge that joins two vertices that were already joined, you have a cycle of length at most K.
Otherwise, you have a forest of size K, and can split it into vert... | true |
d5965b6f6a8f6e1c6b554775bb5b41a77fd41de7 | C++ | saswatsamal/I2C_LCD_Arduino | /i2c_lcd.ino | UTF-8 | 623 | 2.640625 | 3 | [] | no_license | //Sample Code for I2C LCD Display
// Saswat Samal
// Libraries included: <........>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() {
lcd.begin(16, 2);
}
void loop()
{
lcd.print("PUT YOUR TEXT HERE");
lcd.setCursor(0, 0);
delay(1500);
l... | true |
9eb9d1b959e9a1943082ea02ae48bcc00a8795a7 | C++ | sm99012/TextRPG.Ex2 | /TextRPG.Ex2/Entity_Moster.cpp | UHC | 2,053 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <conio.h>
#include <ctime>
#include "Entity.h"
#include "Entity_Monster.h"
#include "Entity_Player.h"
#include "Item.h"
//
Monster::Monster(string name, int lv, int hp, int mp, int sp, int dp, int speed, int exp, int gold = 0) : Entity(name, lv, hp, mp, sp, dp, speed)
{
... | true |
15e43666cd02135e7aaf750955304fdda66b0af7 | C++ | zjslj/Blue-Lotus-Platform | /blp/base/sample/Thread_test.cpp | UTF-8 | 643 | 2.609375 | 3 | [] | no_license | //Thread_test.cpp
#include "inc.h"
#include "Thread.h"
#include <iostream>
using namespace blp;
using namespace std;
void* threadPrint(void * para)
{
cout << "threadPrint==>" << endl;
return NULL;
}
void threadTest()
{
CThread oThread(&threadPrint, "zjslj");
oThread.start();
cout << oThread.name() << ... | true |
4d18e66a5287f6ac8d873386b3d4fe3338c30e2b | C++ | Hakudon/DSA-Project-Visualization | /src/main.cpp | UTF-8 | 699 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <SFML/Graphics.hpp>
#include "../include/screens.hpp"
//#include "../include/background.hpp"
int main()
{
//Applications variables
std::vector<cScreen*> Screens;
int screen = 0;
//Window creation
sf::RenderWindow App(sf::VideoMode(800, 600), "DSA PROJECT");
//Back... | true |
3cf309017fd4ab898b32a478b66149785de97fa3 | C++ | zenoalbisser/chromium | /third_party/WebKit/Source/core/animation/VisibilityStyleInterpolationTest.cpp | UTF-8 | 2,534 | 2.640625 | 3 | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"MIT",
"Apache-2.0"
] | permissive | #include "config.h"
#include "core/animation/VisibilityStyleInterpolation.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/StylePropertySet.h"
#include <gtest/gtest.h>
namespace blink {
class AnimationVisibilityStyleInterpolationTest : public ::testing::Test {
protected:
static PassOwnPtr<Interpola... | true |
40b079265162efe1163a196f1ab9c5f5f732510b | C++ | Filet-de-S/c_plusplus_yandex | /white/incognizable.cpp | UTF-8 | 362 | 2.734375 | 3 | [] | no_license | #include <algorithm>
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
using namespace std;
class Incognizable {
public:
Incognizable() {}
Incognizable(int i) {}
Incognizable(int i, int j) {}
};
int main() {
Incognizable a;
Incognizable b = {};
Incognizable c = {0};
... | true |
54f4091e0bd7f26c40156465be98d2e4988ff8e1 | C++ | aisenn/CPP_Piscine | /d07/ex02/Array.tpp | UTF-8 | 1,340 | 3.546875 | 4 | [] | no_license | #ifndef ARRAY_TPP
#define ARRAY_TPP
# include <exception>
#include <istream>
template<typename T>
class Array
{
private:
unsigned int _size;
T *_data;
public:
Array<T>(void) : _size(0) , _data(new T[_size]()) { return; }
Array<T>(int size) : _size(size < 0 ? 0 : size) , _data(new T[this->_size]()) { return; }... | true |
d77d7149ece5fad57021ee9302f92f9f5a7e3dc9 | C++ | stumathews/2DGameDev | /2DGameDevLib/GameObjectMoveStrategy.cpp | UTF-8 | 4,547 | 2.90625 | 3 | [] | no_license | #include "pch.h"
#include "GameObjectMoveStrategy.h"
#include "Player.h"
#include "Room.h"
#include <Direction.h>
#include <common/Logger.h>
#include <exceptions/EngineException.h>
#include <util/SettingsManager.h>
#include "../game/LevelManager.h"
#include "movement/IMovement.h"
GameObjectMoveStrategy::GameObjectMov... | true |
3de3a094444f171f494eee3f0a684eb97ff51c95 | C++ | Connellj99/GameArch | /Bakaleinik.David/MidTerm/Unit.h | WINDOWS-1252 | 1,216 | 2.796875 | 3 | [] | no_license | #pragma once
#include <string>
#include "Animation.h"
#include "Trackable.h"
class System;
class Sprite;
class Unit : public Trackable //A class to hold state information for a game entity for now, it holds location info for an animation
{
friend class Game;
protected:
int mSourceY;
int mSourceX;
Animation m... | true |
a9b0941ba837ffa8a45c1a8453ba65512c6afa37 | C++ | gocpplua/awesome-book | /深入应用C++11:代码优化与工程级应用/src/1.6.2.cpp | UTF-8 | 784 | 3.875 | 4 | [
"MIT"
] | permissive | // 1.6.2 声明式的编程风格,简洁的代码
#include<iostream>
#include<functional>
#include<algorithm>
#include<vector>
using namespace std;
class CountEven
{
int &count_;
public:
CountEven(int& count):count_(count){
cout << __FUNCTION__ << endl;
}
void operator()(int val)
{
if (!(val & 1))
{... | true |
e4302d6a13638777dc6c533750fc70f508d8c3ff | C++ | hello-lx/CodingTest | /3/894.cpp | UTF-8 | 1,050 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <vector>
#include <math.h>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <list>
#include <queue>
#include <stack>
using namespace std;
#define INT_MIN -99999999999
#define INT_MAX 99999999999
class Solution {... | true |
5c2c4c738c4cd2c16713334cedb489b2fc429555 | C++ | kurihara-lab-b4/algorithm_data_structure | /data_structure/4_4_doubly_linked_list_2.cpp | UTF-8 | 1,699 | 3.515625 | 4 | [] | no_license | /*
4.4 連結リスト
g++ -o 4_4_doubly_linked_list_2.exe 4_4_doubly_linked_list_2.cpp
./4_4_doubly_linked_list_2.exe
*/
#include <iostream>
#include<string>
using namespace std;
struct Node {
int key;
Node *prev, *next;
};
Node *nil;
void init();
void init() {
nil = (Node *)malloc(sizeof(Node));
nil -> next... | true |
d586162362dbd7bcf28dd93ad39fb373d20935c3 | C++ | Dedis23/SGBE | /src/gb/mmu.h | UTF-8 | 3,233 | 2.625 | 3 | [] | no_license | /************************************************************
* Created by: Dedi Sidi, 2020 *
* *
* The gameboy memory management unit *
************************************************************/
/*
The memory map of the gameboy:
0x000-0x00FF: 256 bytes of the bootstrap - after re... | true |
18c6c9d7e3e32929d68295dc4dbe273e63ebdc3a | C++ | Girl-Code-It/Beginner-CPP-Submissions | /Rishika/MILESTONE4/m4q4.cpp | UTF-8 | 280 | 3.046875 | 3 | [] | no_license | //q4- wap to calculate HCF of two numbers.
#include<iostream>
using namespace std;
int main()
{
int n1,n2,i,hcf=1,m;
cout<<"Enter two numbers- ";
cin>>n1>>n2;
m=min(n1,n2);
for(i=1;i<=m;i++)
{
if(n1%i==0 && n2%i==0)
{
hcf=i;
}
}
cout<<"hcf of number is= "<<hcf;
}
| true |
0b505163e89ce29aa05b0ca8970ed0462029681d | C++ | amit-shahwal/interviewbit-Hackerrank_questions | /journey_tomoon.cpp | UTF-8 | 1,491 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
vector<int>tt[1000000];
int visited[1000000];
int tocheck[1000000];
vector<int>same;
queue<int>q;
long long int bfs(int s)
{ int count=0;
q.push(s);
while (!q.empty()) {
int curr=q.front();
q.pop();
c... | true |
00c39a89d38e0a429f0a4fa54e524c25a05d2557 | C++ | mohsani/Geometry | /Geometry/Square.h | UTF-8 | 293 | 2.828125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "TwoDimensional.h"
class Square :
public TwoDimensional
{
private:
float side;
public:
Square(string color, float centerX, float centerY, float side);
float perimeter() override;
float area() override;
float getSide();
void setSide(float side);
};
| true |
e3a390c3f6783bd2a89952a0b74ae5179902efac | C++ | fmejbah/Code-Library | /Graph/Stable_Marriage_Problem.cpp | UTF-8 | 953 | 2.609375 | 3 | [] | no_license | /*
* Biborno
* fb.com/mfmejbah
* fmejbah@gmail.com
*
* Graph: Stable Marriage Problem
* Stable_Marriage_Problem.cpp
* Date: 27 Aug 2016
*/
#include <bits/stdc++.h>
using namespace std;
int n, x, y, m, m1, w, M[501][501], W[501][501], woman[501], m2w[501], w2m[501];
queue<int> fre;
bool engaged_man[501], enga... | true |
945e27a89a842573f15f110df97483aaf4ad7344 | C++ | tz924/cs38 | /Homework3/ps3_p2.cpp | UTF-8 | 1,345 | 4 | 4 | [] | no_license | /**
* Assignment name: Problem Set 3
* File name: ps3_p2.cpp
* Author: Jing Zhang
*/
#include "ps3.h"
using namespace std;
/* Fibonacci Sequence using Vector */
void problem2()
{
const int MIN_NUM_TO_DISPLAY = 1;
const int FST_EL = 0;
const int SND_EL = 1;
const int START_INDEX = 2;
// Ask the user how m... | true |
efd90ad7787298cd2950adabf84c95fb1c3f0f78 | C++ | rajajitendra-b/Interview-Bit | /Hashing/Hash Search/Colorful Number.cpp | UTF-8 | 1,775 | 3.734375 | 4 | [] | no_license | /**************** QUESTION **************
For Given Number N find if its COLORFUL number or not
Return 0/1
COLORFUL number:
A number can be broken into different contiguous sub-subsequence parts.
Suppose, a number 3245 can be broken into parts like 3 2 4 5 32 24 45 324 245.
And this number is a COLORFUL number, s... | true |
79889771fab619ae0c0dd1ca839e3df7436f2283 | C++ | GertVercruyssen/GameEngine | /ShapeColorNormalCube.cpp | UTF-8 | 5,547 | 2.625 | 3 | [] | no_license | #include "StdAfx.h"
#include "ShapeColorNormalCube.h"
#include "D3D10DeviceWrapper.h"
#include "DXWindow.h"
ShapeColorNormalCube::ShapeColorNormalCube(float width, float height, float depth, D3DXCOLOR color):
m_Width(width),m_Height(height),m_Depth(depth),m_Color(color)
{
BuildVertexBuffer();
BuildIndexBu... | true |
3b93edd8f823d4d8825582e0422fffdbbcde824d | C++ | marc-hanheide/cogx | /tools/hardware/stereo/branches/stable-1/src/c++/components/StereoServer.h | UTF-8 | 3,176 | 2.53125 | 3 | [] | no_license | /**
* @author Michael Zillich
* @date June 2009
*/
#ifndef STEREO_SERVER_H
#define STEREO_SERVER_H
#include <stdexcept>
#include <vector>
#include <map>
#include <string>
#include <cast/core/CASTComponent.hpp>
#include <VideoClient.h>
#include "StereoCamera.h"
#include "Math.hpp"
#include "Stereo.hpp"
#include "gp... | true |
e8a8bb29e5542de3e04081add7cd8f56484df987 | C++ | Alexklkv/base_server | /ability/effects/PiercingStrikeEffect.h | UTF-8 | 548 | 2.515625 | 3 | [] | no_license | #pragma once
#include "basic/CardAttackEffect.h"
#include "basic/NegativeEffect.h"
#include "misc.h"
class PiercingStrikeEffect final : public CardAttackEffect, public NegativeEffect
{
private:
mutable uint16_t start_target_health;
combatant_ptr_t get_target(combatant_ptr_t old_target) const;
protected:
bool on... | true |
cdfba5e4128d85460e6f5cd4baa09a964e0b4e42 | C++ | kolak33/kryptoVol2 | /lista1/zad1/LCG and LFSR - crypto1/LCGBreaker.cpp | UTF-8 | 2,716 | 2.953125 | 3 | [] | no_license | #include "stdafx.h"
#include "LCGBreaker.h"
#include <iostream>
LCGBreaker::LCGBreaker()
: m_bPredictedParams(false)
{
}
void LCGBreaker::FindLCGParameters(std::vector<LL> &states)
{
LL lModulus = CompModulus(states);
LL lMultiplier = CompMultiplier(states, lModulus);
LL lIncrement = CompIncrement(states, lModul... | true |
7aa6895bc0a66d18e1f9f6ac2c3db0729a64629a | C++ | exposedtalent/CodingBlocks | /Assignment-2/permutations.cpp | UTF-8 | 526 | 3.265625 | 3 | [] | no_license | #include<iostream>
#include<set>
#include<cstring>
using namespace std;
void generatePermutations(char inp[], int i, set<string>&s){
if(inp[i] == '\0'){
s.insert(string(inp));
return;
}
for(int j = 0; j < strlen(inp); j++){
swap(inp[i], inp[j]);
generatePermutations(inp,i+... | true |
ca322621843e3204c4f93bd98a5978d9d931ac73 | C++ | idesign0/robotics | /OOP With C++/Chapter 15 'Manipulating Strings'/Programming Exercise/15.3 Print names which start with names 'B' and 'C'/main.cpp | UTF-8 | 446 | 3.046875 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<string>
using namespace std;
int main(){
char shorting[]={'B','C','A'};
string names[5];
names[0]="Chan";
names[1]="Book";
names[2]="Arial";
names[3]="Banana";
names[4]="Zoom";
for(int j=0;j<(sizeof(shorting)/sizeof(char));j++){
for(int i=0;i<5;i+... | true |
541843f2c015f61b51a01fa21b4ead5b93b14a95 | C++ | iByster/Agenda | /Repository.h | UTF-8 | 2,918 | 2.859375 | 3 | [] | no_license | #pragma once
#include "Activity.h"
#include "MyList.h"
#include <string>
#include <ostream>
//#include <vector>
#include <unordered_map>
using std::string;
using std::ostream;
class DefaultRepo {
protected:
double err;
public:
virtual void store(const Activity & a) = 0;
virtual void storeCurr(const... | true |