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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3967b0978c4ced52caa7499da39aa8b09ab85986 | C++ | SaraElbesomy4/Castle-game---Data-structure | /Castle/Enemyheap.h | UTF-8 | 4,505 | 4 | 4 | [] | no_license | #ifndef ENEMYHEAP_H
#define ENEMYHEAP_H
#include "..\Enemies\Enemy.h"
#include <iostream>
using namespace std;
template <int const MAX_HEAP_SIZE=100>
class Enemyheap
{
private:
Enemy* Elements[MAX_HEAP_SIZE]; // Array of pointers
int size; // Number of elements in the heap
public:
Enemyheap()... | true |
9a158ce6eec414cea35a03175fbeea7b411fcc49 | C++ | skrphv/ITVDN-Advanced | /lesson10_main.cpp | UTF-8 | 1,018 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <cassert>
#include <deque>
#include <stack>
#include <sstream>
#include <algorithm>
#include <iterator>
void reverse_text (std::string& text)
{
//1) split to words
std::istringstream test_stream {text};
std::deque<std::string> text_in_words {};
std::string... | true |
a514d0da4b7ddd8f815aba9afe229a638b3860d6 | C++ | marromlam/lhcb-software | /Online/Online/OMAlib/algorithms/OMACompareToReference.cpp | UTF-8 | 1,549 | 2.640625 | 3 | [] | no_license | #include <TH1F.h>
#include <TF1.h>
#include "OMAlib/OMAAlgorithms.h"
#include "OMAlib/OMAlib.h"
#include <sstream>
OMACompareToReference::OMACompareToReference(OMAlib* Env) :
OMACheckAlg("CompareToReference", Env) {
m_ninput = 1;
m_inputNames.push_back("Test"); m_inputDefValues.push_back(1.f);
m_npars = 1;
... | true |
487a087f33873802be064ca5cff8bbc3e5b2bd99 | C++ | Balnian/Technique_Nouvelle_Image | /Image/Source.cpp | WINDOWS-1250 | 1,553 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <memory>
using namespace std;
class Image
{
bool original = true;
protected:
Image(const Image&) = default;
public:
Image() = default;
void modifier() { original = false; }
bool est_modifier() const { return !original; }
virtual Image* cloner() const = 0;
virtual vo... | true |
7e45435ed850741b261d273de96f4895187e183a | C++ | EduardoVaz06/n2 | /Pessoa.hpp | UTF-8 | 476 | 2.75 | 3 | [] | no_license | #include <iostream>
using namespace std;
#ifndef PESSOA_hpp
#define PESSOA_hpp
class Pessoa
{
public:
Pessoa(){};
Pessoa(string n, string en, int tel);
void setNome(string n);
string getNome();
void setEndereco(string en);
string getEndereco();
void setTelefone(int... | true |
9325335da4af38167d579d8e20ffec8a170f3a50 | C++ | knavite/LeetCode | /Happy Number/solution.cpp | UTF-8 | 469 | 2.828125 | 3 | [] | no_license | class Solution {
public:
bool isHappy(int n) {
map<int,int> m;
int flag=0;
while(m[n]==false) {
m[n]=true;
int newN=0;
while(n!=0) {
int d=n%10;
newN+=d*d;
n=n/10;
}
n=newN;
... | true |
c8a2611b380dfdbd4700cfe4698316808e5c7c60 | C++ | YiBasuo/BackTest | /Utility.cpp | UTF-8 | 2,634 | 3 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <ctime>
#include <cstring>
#include "Constants.h"
#include "Utility.h"
using namespace std;
string Error::GetMsg()
{
return msg;
}
ostream& operator<<(ostream& os, const DataLineT& dataline)
{
stringstream iss;
iss << GetDateTimeStr(dataline.dateTime);
if (datali... | true |
45d642538be748b7b81e1a930c50f2862a8fd962 | C++ | zhufeizhu/Process | /src/PriorityQueue.cpp | UTF-8 | 1,706 | 3.59375 | 4 | [] | no_license | #include "PriorityQueue.h"
#include "ListItem.h"
#include "Node.h"
PriorityQueue::PriorityQueue():front(nullptr),back(nullptr),size(0){};
bool PriorityQueue::isEmpty(){
return size == 0;
}
void PriorityQueue::enqueue(ListItem *item){
// special case: adding to empty queue
if(front == nullptr){
front = new Nod... | true |
65d73e9c280b84f7c75831d10a154e77bfd4d287 | C++ | walterfreeman/phy211 | /_site/slides/lec12/gas3d.cpp | UTF-8 | 21,730 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include "vector.h"
#include <omp.h>
int ilist_size=1000000; // how much memory to allocate for the list of possible interactions
int N=2000; // default number of particles (probably changed later)
double L=1; // box width
double r0=0.015; // i... | true |
1420a37be4bc17af55e5d72ac5674df77da1964b | C++ | robertcal/cpp_competitive_programming | /AtCoder/ABC/114/D_after1.cpp | UTF-8 | 949 | 2.890625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int cnt[110] = {};
// n - 1以上の数がある個数
int num(int n) {
int res = 0;
for (int i = 0; i < 110; ++i) {
if (cnt[i] >= n - 1) res++;
}
return res;
}
void prime_f... | true |
00b18f22f2c97763a9ef595e57c32be9bc0477e4 | C++ | Brukols/Epitech-Arcade | /lib/sfml/src/ListScores/ListScoresEvent.cpp | UTF-8 | 1,831 | 2.59375 | 3 | [
"MIT"
] | permissive | /*
** EPITECH PROJECT, 2020
** OOP_arcade_2019
** File description:
** ListScoresEvent
*/
#include "sfml/ListScores.hpp"
void arc::ListScores::event(const sf::Event &event, sf::RenderWindow &window)
{
if (event.type != sf::Event::MouseWheelScrolled)
return;
sf::Vector2i pos = sf::Mouse::getPosition(w... | true |
9fa157c1667cebadc187283abae2b0a8ef077c47 | C++ | RootVirtual/Ard-Mux-Dimmer | /Ard_Mux_Dimmer/Ard_Mux_Dimmer.ino | UTF-8 | 2,027 | 2.703125 | 3 | [] | no_license | // Testing sketch for 50Hz !!!
#include <TimerOne.h>
#include <Mux.h>
Mux mux(2,3,4,5,4); // initialise on construct...
int counter=0;
unsigned char CH1, CH2, CH3, CH4;
unsigned char i=0;
unsigned int delay_time=2500; // delay ms or SPEED
unsigned char clock_tick; // variable for Timer1
void setup() {
Serial.begin(... | true |
7f4b977e84e749f97c4a4c583e23ffc9b999dc28 | C++ | barte525/tep1 | /TEP1mod.cpp | UTF-8 | 3,968 | 3.0625 | 3 | [] | no_license | using namespace std;
#include <iostream>
#include "CTable.h"
static const int ADDITION_NUMBER = 5;
static const int MAX_TAB_LENGTH = 100000;
bool vAllocTableAdd5(int iSize) {
if (iSize > 0 && iSize <= MAX_TAB_LENGTH) {
int* table;
table = new int[iSize];
for (int i = 0; i < iSize... | true |
ae22bf454387add18cad67ef365327d4b0296708 | C++ | Pavlete/ModularSynth | /src/UI/common/juceaudionode.h | UTF-8 | 1,027 | 2.53125 | 3 | [] | no_license | #pragma once
#include "socket.h"
class JuceAudioNode: public Component
, public ButtonListener
{
public:
JuceAudioNode(const SharedNode& model,int inputNumber, int outputNumber);
virtual ~JuceAudioNode() = default;
virtual void setContent(Rectangle<int> &r) = 0;
virtual std::strin... | true |
4525565e9937f3e5026a801cb281cd54f12cb1be | C++ | knightfox75/ngine | /Tools/NGN_CollisionMap/source/convert_to_map.cpp | UTF-8 | 15,023 | 2.59375 | 3 | [
"MIT"
] | permissive | /******************************************************************************
Conversor de PNG a Mapa de Colisiones (.map) para N'gine
- Convierte un archivo PNG en tiles -
Proyecto iniciado el 11 de Febrero del 2016
(c) 2016 - 2023 by Cesar Rincon "NightFox"
https://nightfoxandco.com
contac... | true |
760e925860f72db92ec81be97d7b0bc5a16fe60d | C++ | Path000/Hector | /controleur/StateMove.cpp | UTF-8 | 1,444 | 2.75 | 3 | [] | no_license | #include "StateMove.h"
void StateMove::setData(String strafeDirection, String rotationDirection) {
_robot->computeMove(strafeDirection.toInt(), rotationDirection.toInt());
_robot->_ecran.clear();
_robot->_ecran.set(0, String("St:")+strafeDirection);
_robot->_ecran.set(1, String("Ro:")+rotationDirection);
_ro... | true |
682b708932cbef297d6a696b1dfdc7607f93f960 | C++ | tpetrina/rp1 | /2012/4/kvadrat/main.5.cpp | UTF-8 | 3,417 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
#include "kvadrat.h"
using namespace std;
class MainKvadrat : public Kvadrat
{
int __brojPoziva;
int __M[ 16 ];
void __rot( int perm[], int duljina )
{
int temp = __M[ perm[ duljina-1 ] ];
for( int i = duljina-1; i > 0; --i )
__M[ perm[ i ] ] = __M... | true |
557ad3c2fc5d2f0854bc8c8265773db6d227f91f | C++ | rskelly/geotools | /src/pcnorm.cpp | UTF-8 | 8,295 | 2.59375 | 3 | [] | no_license | /*
* pcnorm2.cpp
*
* Created on: May 5, 2019
* Author: rob
*/
#include <limits>
#include <fstream>
#include <liblas/liblas.hpp>
#include "geo.hpp"
#include "util.hpp"
using namespace geo::util;
void getBounds(liblas::Reader& rdr, double* bounds) {
double x, y, z;
rdr.Reset();
while(rdr.ReadNextPoin... | true |
d4511d9939ccbaa77eed62578821bec3612c51a8 | C++ | Thornhill-GYL/mycompiler | /lexdll/sematic.cpp | GB18030 | 15,656 | 2.53125 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<cstring>
#include "stdafx.h"
#include "lex.h"
#include <iostream>
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
class lexword
{
public:
int num;
char word[10];
int type;
} ;
class Temp
{
public:
char newtemp;
int newtemp_num;
Temp()
... | true |
ea24b635272e3083135bb61fc04adad6a8cb608a | C++ | Pechenkya/GameProject | /ConsoleApplication1/Pathfinding.h | UTF-8 | 2,732 | 2.734375 | 3 | [] | no_license | #pragma once
#include <list>
#include <queue>
#include <memory>
#include <functional>
#define OUT
class Vector2D;
class Object;
class Node
{
private:
int HCost = 0;
int GCost = 0;
int SCost = 0;
float PriorityScore = 0; // // For Querying
int GridX;
int GridY;
Node * PathRoot = nullptr;
bool Walkable = t... | true |
4e7decaf2324c5378d1946db4866de82980c74c2 | C++ | iUmarov/acm-tuit-uz | /0046. Inversiyalar soni.cpp | UTF-8 | 1,377 | 2.890625 | 3 | [] | no_license | #include <iostream>
using namespace std;
__int64 inv = 0, helper[1000001];
void Merge(__int64 a[], __int64 left, __int64 middle, __int64 right)
{
__int64 i, j, size;
i = left;
j = middle;
size = middle - left;
for (__int64 k=left;k<ri... | true |
4bfbd75c0756d915cffa9eee4a9cb1bddb525da7 | C++ | Szelethus/cpp_courses | /2022-23-1/monday12-14/12gy/minh_interface.cpp | UTF-8 | 551 | 3.390625 | 3 | [] | no_license | #include <iostream>
struct Printable {
virtual void print() const = 0;
virtual int getId() { return -1; }
};
struct Drawable {
virtual void draw() const { }
virtual int getId() { return -1; }
};
void print(Printable *p) {
p->print();
}
class Shape : public Printable, public Drawable {
protected:
i... | true |
cc4f4b9b14db7eebf4665f17d67bd74ecc93c769 | C++ | steppobeck/rgbd-recon | /framework/DataTypes.cpp | UTF-8 | 3,923 | 2.8125 | 3 | [
"MIT"
] | permissive | #include "DataTypes.h"
namespace kinect{
uv interpolate(const uv& a, const uv& b, float t){
uv r;
r.u = (1.0f - t)*a.u + t*b.u;
r.v = (1.0f - t)*a.v + t*b.v;
return r;
}
xyz interpolate(const xyz& a, const xyz& b, float t){
xyz r;
r.x = (1.0f - t)*a.x + t*b.x;
r.y = (1.0f - t)*a.y ... | true |
caaad2ba4bd7c02a0aa48abf5303b2095c2673f7 | C++ | kljoshi/C_plus_plus | /Exercise/Chapter7/implicitArray.cpp | UTF-8 | 238 | 2.75 | 3 | [] | no_license |
#include <iostream>
#include <cstdlib>
#include <stdlib.h>
#include <time.h>
#include <fstream>
using namespace std;
int main()
{
int num[] = {1,2,3,4,5,6,7,8,9};
for(int value: num){
cout << value << endl;
}
return 0;
}
| true |
0f4cfafde81acfb9b23dc50b7da36144c68ba0c9 | C++ | bizzehdee/neuro | /neuro/ActivationNeuron.h | UTF-8 | 572 | 2.71875 | 3 | [] | no_license | #pragma once
#include "Neuron.h"
#include "IActivationFunction.h"
namespace neuro {
class ActivationNeuron : public Neuron
{
public:
ActivationNeuron(int inputCount, IActivationFunction *activationFunction);
double Threshold() const { return this->threshold; }
void Threshold(const double x) { this->threshol... | true |
dfd0a489d88253bea3e2984aa734df95a6ccb53d | C++ | SamRuckley/Temp | /Players.h | UTF-8 | 2,668 | 3.375 | 3 | [] | no_license | #ifndef PLAYERS_H
#define PLAYERS_H
//
// @summary Contains the information for the Players
//
class Players
{
/////////////////////////////////////////////////////////////////////////
// Public
/////////////////////////////////////////////////////////////////////////
public:
//////////////////////... | true |
45285ca126347f726351629afd4edd66328d5ee7 | C++ | hp-peti/ofApps | /HexTile/src/ViewCoords.h | UTF-8 | 1,681 | 2.953125 | 3 | [] | no_license | /*
* ViewCoords.h
*
* Created on: 11 Feb 2018
* Author: hpp
*/
#ifndef SRC_VIEWCOORDS_H_
#define SRC_VIEWCOORDS_H_
#include <ofVec2f.h>
#include <ofRectangle.h>
#include <ofGraphics.h>
struct ViewCoords
{
float zoom = 1.0;
ofVec2f offset { 0, 0 };
ViewCoords() = default;
ViewCoords(float ... | true |
26cd0f2b2f6400442d0c623ce719fb4fca616025 | C++ | UniqueZHY/ZHY | /LeetCode/111_二叉树的最小深度.cpp | UTF-8 | 599 | 3.140625 | 3 | [] | no_license | /*************************************************************************
> File Name: 111_二叉树的最小深度.cpp
> Author:
> Mail:
> Created Time: 2020年02月28日 星期五 15时21分31秒
************************************************************************/
int minDepth(struct TreeNode* root) {
if (root == NULL) return 0;
... | true |
039ad502cb256db98b0f65b61e98bccebec76b77 | C++ | githubcai/hiho | /1/1040.cpp | UTF-8 | 1,221 | 3.21875 | 3 | [] | no_license | #include <cstdio>
struct Node{
int x, y;
bool operator==(const Node &a) const{
return x == a.x && y == a.y;
}
};
Node nodes[8];
bool check(){
int cnt = 8;
for(int i = 0; i < 8; ++i){
for(int j = i + 1; j < 8; ++j){
if(nodes[i] == nodes[j]) --cnt;
}
}
i... | true |
3fbc4c22a7948d51d30679c4b21c32fb8862dd2d | C++ | anderra57/1maila | /2. KUATRI/KE/ARDUINO/KE/SADFSD/Arduino_Lana_erm/Arduino_Lana_erm.ino | UTF-8 | 3,204 | 2.625 | 3 | [] | no_license | // include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
const int inputPin = A0; // buttons array analog input
uint16_t inputValue = 0; // value read from buttons array
int hrs=23;
int mins=58;
int sec=55;
int c... | true |
a9f9946dbb3737d3001a646622843e4e629655fb | C++ | am009/PAT | /A1086-Tree-Traversals-Again/main.cpp | UTF-8 | 2,068 | 3.25 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <stack>
#include <cstring>
struct node {
int data;
struct node* lchild;
struct node* rchild;
};
typedef struct node node;
node* head;
int N;
char buf[11];
int * preO;
int *inO;
// 先序和中序构建树,包含端点
node* construct(int inOl, int inOr, int preOl, int preOr) {
... | true |
d26ebceb1a62a4d92c2b421f7a67efbcc9de02ce | C++ | heshamOuda1/FHNW-Java-Projekte | /prcpp/Vector/VectorTest/unittest1.cpp | UTF-8 | 2,855 | 3.15625 | 3 | [] | no_license | #include "stdafx.h"
#include "CppUnitTest.h"
#include "Expression.hpp"
#include "Array.hpp"
#include "Scalar.hpp"
#include "Operations.hpp"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace VectorTest
{
TEST_CLASS(Vector)
{
public:
TEST_METHOD(Construction)
{
double a_data[] = { ... | true |
11fcac7c464c30fc9707aab5454b290c679d3801 | C++ | yuhaim/PTA | /basic/1047.cpp | UTF-8 | 487 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <map>
using namespace std;
int main()
{
int N;
cin >> N;
map<int, int> data;
while(N--){
int team, id, score;
scanf("%d-%d %d", &team, &id, &score);
data[team] += score;
}
int max_team, max_score = 0;
for(auto x=data.begin(); x!=data.end... | true |
4fa5c4034b252f705d4a0c722c10985f0d29924f | C++ | akotadi/Competitive-Programming | /Interview/LeetCode/TopInterviewQuestions/Array/Remove Duplicates from Sorted Array.cpp | UTF-8 | 2,451 | 3.453125 | 3 | [] | no_license | /*
* Copyright (c) 2019 ManuelCH.
*
* This file is part of Interview-solutions
* (see https://github.com/akotadi).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of ... | true |
59f0a1b8ee8404252b37164340a9b21478feeb96 | C++ | theAnton-forks/Competitive-Programming-Portfolio | /Ability To Convert/src/Ability To Convert.cpp | UTF-8 | 1,901 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int max_digs = 105;
const int maxn = 65;
ll dp[max_digs][maxn];
ll n;
ll biggest = 1000000000000000000;
string s_biggest = "1000000000000000000";
string k;
ll smaller(string s, ll num){
if(s.size() > s_biggest.size() or (s.size() == s_biggest... | true |
baa3bfdb08be99fe5ee665819467bbe5cb82e810 | C++ | brainexcerpts/MDD_file_exporter | /point_cache_export.hpp | UTF-8 | 2,150 | 2.625 | 3 | [
"MIT"
] | permissive | #ifndef ASSET_POINT_CACHE_EXPORT_HPP
#define ASSET_POINT_CACHE_EXPORT_HPP
#include <vector>
#include <string>
// =============================================================================
namespace asset {
// =============================================================================
// ==============... | true |
4fe45a023d78f57a1112aec99f5050d5ceaf3bd3 | C++ | vijayapradap/Arduino_Programs | /Arduino_Programs/button/button.ino | UTF-8 | 267 | 2.703125 | 3 | [] | no_license | void setup() {
// put your setup code here, to run once:
pinMode(0, INPUT);
pinMode(1, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(0) == 1) {
digitalWrite(1, HIGH);
} else {
digitalWrite(1, LOW);
}
}
| true |
439bf221f77974e3a13b7059dcbf0d9f24b821bd | C++ | Dzzirt/Game | /CBook/CBook/1.15.cpp | WINDOWS-1251 | 751 | 3.53125 | 4 | [] | no_license | #include <stdio.h>
/* ,
. */
int fromFahrToCels(float fahr);
int main()
{
float fahr, celsius;
int lower, upper, step;
lower = 0; /* */
upper = 300; /* */
step = 20; /* */
fahr = lower;
printf("%3s %9s\n", "Fahren", "Cels");
while (fahr <= upper) {
celsius = fromFahrToCels(fahr);
printf("... | true |
82924919462ae8b34b88414697c42c9059a06326 | C++ | wcc17/untitled-game | /src/npc/NpcManager.cpp | UTF-8 | 5,226 | 2.71875 | 3 | [] | no_license | #include "../../includes/npc/NpcManager.h"
static const std::string NPC_TYPE_HUMAN = "human";
static const std::string NPC_TYPE_CAT = "cat";
static const std::string NPC_TYPE_MONSTER = "monster";
void NpcManager::initialize(const std::shared_ptr<EventBus> eventBus,
const std::vector<Collid... | true |
dc8911025b8f93a9b94c3a15951dd09d55929911 | C++ | HSaddiq/IDP | /Physical Programs/tests/angle_turned_test/angle_turned_test.ino | UTF-8 | 1,402 | 3.09375 | 3 | [] | no_license | #include <Ultrasonic.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include <motor.h>
using namespace std;
String bearing_string = "";
int bearing_value = 0;
int current_bearing = 0;
int direction = 0;
void setup() {
Movement mov;
//mov.get_threshold();
}
void rotate(int direction, int bearing)... | true |
2083f6ea5b4d521a301c674e52f717e89d92c50e | C++ | eglrp/myds | /Stack/ArrayStack/ArrayStack.h | GB18030 | 3,400 | 3.71875 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
#include "Stack.h"
using namespace std;
/**
* ArrayStack: ջ
*/
template<typename T>
class ArrayStack: public Stack<T>
{
public:
// 1. public constructor
static ArrayStack<T> *arrayStackFactory(int max_size);
// 2. copy/move_controller
... | true |
5b67d35334b95ed1d4b1ce58b563639de3687f2a | C++ | WladWD/AndroidGame | /AGame/GlobalMove.cpp | UTF-8 | 860 | 2.6875 | 3 | [] | no_license | #include "GlobalMove.h"
GameEngine::GlobalMove::GlobalMove(float fMoveStep, float fMoveSpeed) : fMoveStep(fMoveStep), fMoveSpeed(fMoveSpeed), fDiv(1.0f / 1000.0f)
{
fMoveValue = 0.0f;
flag = 0;
fDMove = 0.0f;
}
GameEngine::GlobalMove::~GlobalMove()
{
}
void GameEngine::GlobalMove::Move(float fDeltaTimeMs, float ... | true |
1e4b64059878d6e06509b6ba4f2a4d8e2d63e600 | C++ | arapson/PortalGame | /Code/Portal.cpp | UTF-8 | 8,212 | 3.203125 | 3 | [
"MIT"
] | permissive | // Nov, 17 2015
// Portal.cpp
// Jacob London Avery Rapson
// This Class handles 95% of the portal logic. It needs to be initialized in main, and requires 10 portals to be passs in.
//
#include "Portal.h"
using namespace std;
class Portal{
private:
/** Storage of all portals**/
array<float,7> Portal1;
... | true |
494114f142f47ed110f48203150786dd9200ab6a | C++ | SzymonPietraszek00/OOP | /Labs/Lab9/src/FlatPoint.cpp | UTF-8 | 691 | 3.390625 | 3 | [] | no_license | #include "FlatPoint.h"
bool FlatPoint::operator<(const FlatPoint &f2)const{
return _d < f2._d;
}
void FlatPoint::FunctionPrintY(const FlatPoint& point){
std::cout << "Function print y=" << point.getY() << std::endl;
}
void FlatPoint::PrintPoint(const FlatPoint& point){
point.Print();
}
void FlatPoint::Print... | true |
d2b1000cb0bef8e5fb1719ae9bde095b496e0c8a | C++ | WSU-CS1410-AA/in-class_examples | /src/chp11-Streams_and_files/ex02-hello_append.cpp | UTF-8 | 195 | 2.96875 | 3 | [] | no_license | // FILE: ex02-hello_append.cpp
#include <fstream>
using namespace std;
int main () {
ofstream out("hello.txt", ios::app);
out << "Hello World!" << endl;
out.close();
return 0;
}
| true |
97c926aae93a595aa48b300aae22609769c440de | C++ | The-Final-Cookie/ece2031-proj | /simulation/Vector.hpp | UTF-8 | 22,680 | 3.1875 | 3 | [] | no_license | #ifndef VECTOR_HPP
#define VECTOR_HPP
#include <array>
#include <cmath>
#include "Util.hpp"
namespace TFC {
template<typename T, size_t N>
class Vector : public std::array<T, N> {
public:
typedef std::array<T, N> Base;
template<size_t P, typename T2=void>
using Enable2D = typename std::enable_if<P == 2 && N ... | true |
10e0368ca3dffd4519694307ca2ecdd759add879 | C++ | Tudor67/Competitive-Programming | /LeetCode/Problems/Algorithms/#112_PathSum_sol3_bfs_O(N)_time_O(W)_extra_space_17ms_21.7MB.cpp | UTF-8 | 1,213 | 3.390625 | 3 | [
"MIT"
] | permissive | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : v... | true |
fbb16b665fc1d751197aa42dacf2471571a50e99 | C++ | hypoactiv/pdp | /multipart.h | UTF-8 | 3,803 | 2.75 | 3 | [] | no_license | #ifndef MULTIPART_H
#define MULTIPART_H
#include "consts.h"
#include "stdint.h"
namespace PDP {
typedef struct {
uint8_t sequenceNum;
uint16_t messageId;
uint8_t protocolVersion;
uint32_t messageLength;
} MultipartHeader;
// MultipartSplitter creates multipart messages from a buffer, to be
// recombined usi... | true |
eceb6f0d3b9384726439821ee4066c417ee810c5 | C++ | grigp/a-analyser | /metodics/dynamic_tests/triangle/triangletemplate.h | UTF-8 | 1,749 | 2.703125 | 3 | [] | no_license | #ifndef TRIANGLETEMPLATE_H
#define TRIANGLETEMPLATE_H
#include <QObject>
#include "metodictemplate.h"
/*!
* \brief Класс шаблона теста "Треугольник" TriangleTemplate class
*/
class TriangleTemplate : public MetodicTemplate
{
Q_OBJECT
public:
explicit TriangleTemplate(QObject *parent = nullptr);
/*!
... | true |
4f4ae36e6b589b8cc6d7dc04536c9306e5759dd6 | C++ | kryzthov/gooz | /store/values_test.cc | UTF-8 | 2,433 | 2.875 | 3 | [] | no_license | #include "store/values.h"
#include <gtest/gtest.h>
#include "base/stl-util.h"
#include "combinators/oznode_eval_visitor.h"
using combinators::oz::ParseEval;
namespace store {
const uint64 kStoreSize = 1024 * 1024;
// -----------------------------------------------------------------------------
// Value graph expl... | true |
75243714c4d0a7b870fbcdec152a9da868414a6e | C++ | PalliativeX/Chess | /Chess/src/Board.h | UTF-8 | 2,300 | 3.25 | 3 | [] | no_license | #pragma once
#include "ChessPiece.h"
#include <vector>
#include <algorithm>
const int BOARD_LENGTH = 8;
class Board
{
private:
Point prevMove;
// separate move methods for each chess piece,
bool moveKnight(Point& from, Point& to);
void displayPawnTransformWindow(const Point& to);
void attemptToTransformPawn... | true |
249c27ab0c6a7b1d5eb464417b81c53b95dd6f96 | C++ | Mark-Mamdouh/Complier | /Phase 2/include/ParsingTable.h | UTF-8 | 1,066 | 2.71875 | 3 | [] | no_license | #ifndef PARSINGTABLE_H
#define PARSINGTABLE_H
#include "phase2.h"
using namespace std;
class ParsingTable
{
public:
ParsingTable(vector<struct PR_ELEM> all_elem,map<int, vector<vector<int>>> prod_rules );
virtual ~ParsingTable();
vector<struct PR_ELEM> elements; /*list for the structs of term... | true |
817a0118397ebc1f8eb2dc7a5c1a5e370c0c3ef6 | C++ | asdlei99/TweedeFrameworkRedux | /Source/Framework/Core/Physics/TeConeTwistJoint.h | UTF-8 | 973 | 2.734375 | 3 | [
"Zlib",
"MIT",
"RSA-MD"
] | permissive | #pragma once
#include "TeCorePrerequisites.h"
#include "Physics/TeJoint.h"
namespace te
{
struct CONE_TWIST_JOINT_DESC;
/**
* To create ragdolls, the conve twist constraint is very useful for limbs like the upper arm. It is a special
* point to point constraint that adds cone and twist axis limits... | true |
555f62f10db98c75311995fbe996f5ebceec0975 | C++ | Tiger1994/LeetCode | /Q19.cpp | UTF-8 | 1,731 | 3.4375 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* removeNthFromEnd_1(ListNode* head, int n) {
int idx = 0;
vector<ListNode... | true |
47436ee82e34a5367909cc9c7048580243fd428e | C++ | aaron-ng/CS4500_Project | /src/ea2/kvstore/kvstore.cpp | UTF-8 | 4,257 | 2.8125 | 3 | [] | no_license | // Language C++
#include "kvstore.h"
#include "../../dataframe/dataframe.h"
#include "../dataframe_description.h"
KVStore::KVStore(in_addr_t ip, uint16_t port, in_addr_t serverIP, uint16_t serverPort): _byteStore(ip, port, serverIP, serverPort) {}
/**
* Retrieves the dataframe with the given key from the key value ... | true |
53aab81a32fc4380e896e8694c5a200f5ec01944 | C++ | browe/hspace-old | /HSFileDatabase.cpp | UTF-8 | 7,115 | 2.578125 | 3 | [] | no_license | // -----------------------------------------------------------------------
// $Id: HSFileDatabase.cpp,v 1.4 2006/04/04 12:37:11 mark Exp $
// -----------------------------------------------------------------------
#include "pch.h"
#include <cstdio>
#include "HSFileDatabase.h"
CHSFileDatabase::CHSFileDatabase():
m_p... | true |
d145613e81d5f5e6b21f96a47a3148e003d6ae72 | C++ | sischkg/nxnsattack | /tests/test-readbuffer.cpp | UTF-8 | 3,861 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "readbuffer.hpp"
#include "gtest/gtest.h"
#include <cstring>
#include <iostream>
#include <boost/log/trivial.hpp>
class ReadBufferTest : public ::testing::Test
{
public:
virtual void SetUp()
{
}
virtual void TearDown()
{
}
};
TEST_F( ReadBufferTest, readUInt8 )
{
uint8_t buf[] =... | true |
c1ccb2d3f87110312b377306fb1f54e26c1de564 | C++ | fferegrino/ukranio | /clase1/ejercicio3.cpp | UTF-8 | 253 | 2.984375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main ()
{
double c ;
c= 20;
double f;
cout <<"Programa para convertir grados centigrados a Farenheit \n";
f = (9/5 *c )+ 32;
cout <<"El resultado es : " << f << "\n" ;
}
| true |
e4be3ec05767fd44c7d67ecf0feb3c2d040b7cd5 | C++ | fuzzwaz/Fuzzy2D-Game-Engine | /Fuzzy2D/Polygon.cpp | UTF-8 | 3,924 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive | #include "Common.h"
#include "Polygon.h"
#include "Vector2.h"
Polygon::Polygon()
{
_vertices.reset(new std::vector<Vector2>());
_perpendiculars.reset(new std::vector<Vector2>());
}
void Polygon::operator=(const Polygon& source)
{
if (this == &source)
return;
_vertices->clear();
_perpendiculars->clear();
_ve... | true |
ebfb034fa06f7f69d004c18d97dc933b26317732 | C++ | clearoff/DataStruct | /BinaryTest.cpp | GB18030 | 4,807 | 3.453125 | 3 | [] | no_license | #include "BinaryTree.hpp"
#include "BinarySearchTree.hpp"
#include <cassert>
//Test1:һŶԶڵ֮ľ
//typedef BinaryTreeNode<int> Node;
//size_t DepthOfNode(BinaryTreeNode<int>* node)
//{
// if (node == NULL)
// {
// return 0;
// }
//
// //ֱ
// size_t Left = DepthOfNode(node->_Left) + 1;
// size_t Right = DepthOfNode(node->_... | true |
39c1d4d80b758667af643b0712c8e0c2d508b166 | C++ | simple-user/cpp | /tempik011 vector/tempik011 vector/Source.cpp | UTF-8 | 588 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <Windows.h>
#include <conio.h>
#include <vector>
using namespace std;
class A
{
int a;
public:
A(int _a) : a(_a) {}
virtual void f() { cout << "In A. a = " << a << endl; }
};
class B : public A
{
int b;
public:
B(int _a, int _b) : A(_a), b(_b) {}
final void f()
{
cout << "In ... | true |
1780a44b93ef125bb14edb07ede95aa0eff7ddc5 | C++ | Breush/evilly-evil-villains | /inc/dungeon/command/trapinterpreter.hpp | UTF-8 | 1,171 | 2.65625 | 3 | [] | no_license | #pragma once
#include "context/command.hpp"
#include "dungeon/structs/room.hpp"
#include "dungeon/command/facilityinterpreter.hpp"
#include <functional>
namespace dungeon
{
// Forward declarations
class Inter;
//! Interprets a room-wide command.
class TrapInterpreter
{
public:
//!... | true |
7d5b326a2aefc3e9443ed511c10b1859cac94f31 | C++ | daffa-d/Smart_IoT | /lib/Firebase/Firebase.cpp | UTF-8 | 3,051 | 2.796875 | 3 | [] | no_license | #include "Firebase.h"
/**
* @file Firebase.cpp
*
* @mainpage Library For Get data, Send data, and activate relay from firebase
*
*/
FirebaseData fbdo;
void FB::begin(const String Host, const String Auth)
{
Firebase.begin(Host, Auth);
}
void FB::sendDataInt(int time, const String &path_db, int value)
{
//... | true |
909377bb52e5876b6055b106a0ab0dc3742b2397 | C++ | proxenek/supremacy-csgo | /element.h | UTF-8 | 2,101 | 2.609375 | 3 | [] | no_license | #pragma once
// pre-declares.
class Element;
class Tab;
class Form;
enum ElementFlags : size_t {
NONE = 0 << 0,
DRAW = 1 << 0,
CLICK = 1 << 1,
ACTIVE = 1 << 2,
SAVE = 1 << 3,
DEACIVATE = 1 << 4,
};
enum ElementTypes : size_t {
CHECKBOX = 1,
SLIDER,
KEYBIND,
DROPDOW... | true |
1c18127c2451b66459ce31e3f66ec1a1e8695a9a | C++ | avinashvrm/Data-Structure-And-algorithm | /Dynamic Programming/Minimum Cost For Tickets.cpp | UTF-8 | 908 | 2.859375 | 3 | [] | no_license | class Solution {
public:
vector<int> dp;
int sub(vector<int> &day, vector<int> &cost, int si) // si denotes starting index
{
//cout<<"| ";
int n = day.size();
if(si>=n)
return 0;
if(dp[si])
return dp[si];
int cost_day = cost[0] +... | true |
ea0b73b8e21a8beddca373a69047453ad79139de | C++ | MatthewRodriguez/GridGraph | /GridGraph.h | UTF-8 | 1,241 | 2.8125 | 3 | [] | no_license | //
// GridGraph.h
// GridGraph
//
// Created by Matt Rodriguez on 4/6/20.
// Copyright © 2020 Matthew Rodriguez. All rights reserved.
//
#ifndef GridGraph_h
#define GridGraph_h
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <random>
#include <unordered_set>
#include <unordered_m... | true |
c3c4f6f25a406a076757cca55fc0f5cb354a3155 | C++ | jmcabornero/TrabajoInformatica2 | /Cofres.cpp | UTF-8 | 923 | 2.90625 | 3 | [] | no_license | #include "Cofres.h"
Cofres::Cofres(float x, float y, int t)
{
i = x; j = y; tipo = t;
}
void Cofres::Dibuja()
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
if (tipo==1)
glBindTexture(GL_TEXTURE_2D, ETSIDI::getTexture("imagenes/Cofres/Cerrado.png").id);
if (t... | true |
0c0479d8f17c023d29976c83f5c71b31cf3005c7 | C++ | tusharkashyap2768/Data-Structures | /linked_list-main/insert at sorted in sorted pos.cpp | UTF-8 | 1,101 | 3.265625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node * next;
}*first=NULL;
void create (int a[],int n)
{
int i;
struct Node *t,*last;
first=new Node;
first->data=a[0];
first->next=NULL;
last=first;
for(i= 1; i <n; i++)
{
t=new Node;
t... | true |
5e5e25e9ccedaae486a4dbe69a06bf9ac3668e77 | C++ | gregoryfikator/RTS_Foundation | /RTS_Foundation.Core/Framework/TextureManagerClass.cpp | UTF-8 | 1,756 | 2.890625 | 3 | [] | no_license | #include "TextureManagerClass.h"
TextureManagerClass::TextureManagerClass()
{
m_TextureArray = nullptr;
}
TextureManagerClass::TextureManagerClass(const TextureManagerClass& other)
{
}
TextureManagerClass::~TextureManagerClass()
{
}
bool TextureManagerClass::Initialize(int count)
{
m_textureCount = count;
// Cr... | true |
146303f5d1f8becbdb1cbdd55f53bba53ecfe766 | C++ | ysyesilyurt/Metu-CENG | /242/hw3/Miner.cpp | UTF-8 | 5,958 | 3.09375 | 3 | [
"MIT"
] | permissive | #include <iomanip>
#include "Miner.h"
#include "Utilizer.h"
/*
YOU MUST WRITE THE IMPLEMENTATIONS OF THE REQUESTED FUNCTIONS
IN THIS FILE. START YOUR IMPLEMENTATIONS BELOW THIS LINE
*/
int Miner::getNextAvailableBlockchainID() const
{
return last_blockchainID + 1;
}
Miner::Miner(std::string name)
{
minerChai... | true |
7c516f847090aec19b3044ace91df841cd5d4630 | C++ | JacobJBublitz/Orion | /Core/Private/Win32/Platform.cc | UTF-8 | 1,720 | 2.640625 | 3 | [] | no_license | #include "Orion/Platform.hh"
#include <system_error>
extern "C" {
#include <Windows.h>
}
namespace Orion {
namespace {
constexpr std::size_t kEnvBufferSize = 64;
} // namespace
std::optional<Stl::String> EnvironmentVariable(Stl::StringView variable) {
wchar_t name_stack_buffer[kEnvBufferSize];
wchar_t value_... | true |
8bb5c9a715d2566b4d897ba1b8c154b8432478cb | C++ | RebelOfDeath/CP | /DSA/recursion/rope_cutting_problem.cpp | UTF-8 | 417 | 2.625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int solve(int n, int a, int b, int c){
if(n==0)
return 0;
if(n < 0)
return -1;
int res = max({solve(n-a, a, b, c), solve(n-b, a, b, c), solve(n-c, a, b, c)});
if(res == -1)
return -1;
return res+1;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL... | true |
3b0db7a6c5e697807fff624e8698991a517618b5 | C++ | diaoshaoyou/Computer-Network-Project | /Lab7/Client/Client/Client_main.cpp | UTF-8 | 5,031 | 2.6875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#include "client.h"
/*
*Only support sending data once!! When sending data the second time, please input "6" again.
*/
int main(void) {
//Initialize socket
InitSocket();
//Create main thread
HANDLE MainThread = NULL;
DWORD ThreadId = 0;
//C... | true |
d9a9a89c648eef83e973d355d6232f5fe0927114 | C++ | xchmwang/algorithm | /uva/uva12657/uva12657/main.cpp | UTF-8 | 1,402 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <list>
using namespace std;
int main()
{
int n, m;
while (cin >> n >> m)
{
list<int> l;
for (int i = 1; i <= n; i++)
l.push_back(i);
int op, x, y;
for (int i = 0; i < m; i++)
{
cin >> op;
if (op <= 3) cin >> x >> y;
list<int>::iterator iter = l.begin();
if (op ... | true |
1ad009d0b788a980c0353d7e75341bcfbb149e24 | C++ | epiccoleman/aoc-2018 | /day-19/Elfcode.cpp | UTF-8 | 1,710 | 2.859375 | 3 | [] | no_license | #include "Elfcode.h"
#include <iostream>
#include <sstream>
#include <iterator>
Elfcode::ElfcodeInterpreter::ElfcodeInterpreter(std::map<std::string, Operation> code_map, int ip_reg)
: ip_value(0),
ip_register(ip_reg), // gets set when evaluating a program
opcodes(code_map),
registers { 0, 0, 0, 0, 0, 0 ... | true |
99dba68719b6b0bcb932b319ee081da6fe78c803 | C++ | Stormcross/AISP_vjezba | /krug/krug/krug.cpp | UTF-8 | 764 | 2.859375 | 3 | [] | no_license | #include "krug.h"
//definicija klase
double krug::getPovrsina() const
{
return radius * radius*PI; //r^2 x PI
}
void krug::setPovrsina(double _povrsina)
{
radius = sqrt(_povrsina / PI);
}
double krug::getOpseg() const
{
return 2 * radius*PI;
}
void krug::setOpseg(double _opseg)
{
radius = ... | true |
50a88208c6351b5901e59583f21234edc6a46d61 | C++ | cyhan1004/Algorithm | /cpp/1212.cpp | UTF-8 | 878 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
string octal;
int temp;
string temp_str;
string ans = "";
int r;
cin >> octal;
int size = octal.size();
bool b = false;
for (int i = 0 ; i < size; i++)
{
temp = (octal[i] - '0');
tem... | true |
5b123be43870abfa2d9ed80a9c1700f6ed98a94e | C++ | cmt218/Compiler | /lexer.h | UTF-8 | 428 | 2.671875 | 3 | [] | no_license | /*
CSE109
Cole Tomlinson
cmt218
Lexer Program
Program #4
*/
#ifndef LEXER_H
#define LEXER_H
#include <iostream>
#include "token.h"
using namespace std;
class Lexer {
public:
//Member variables
istream &input;
int lineNum;
int linePos;
//Constructor
Lexer(istream&);
//Member functions
To... | true |
de6023841c6ed51d4a0a377a205c84c6dc0e2f20 | C++ | Abhijeet1990/NS3_CUNB | /cunb/helper/cunb-interference-helper.h | UTF-8 | 4,697 | 2.6875 | 3 | [] | no_license | #ifndef CUNB_INTERFERENCE_HELPER_H
#define CUNB_INTERFERENCE_HELPER_H
#include "ns3/nstime.h"
#include "ns3/simulator.h"
#include "ns3/object.h"
#include "ns3/traced-callback.h"
#include "ns3/callback.h"
#include "ns3/packet.h"
#include "ns3/logical-cunb-channel.h"
#include <list>
namespace ns3 {
/**
* Helper for ... | true |
7575e058e09653b33cc0c91f48cb9384ca8aaea9 | C++ | Houssk/Synthese-d-images-avec-OpenGL | /Basics/03-2D-reshape/C++/Triangle.cpp | UTF-8 | 2,989 | 3.0625 | 3 | [] | no_license | // Définition de la classe Triangle
#include <iostream>
#include <GL/glew.h>
#include <GL/gl.h>
#include <math.h>
#include <utils.h>
#include <Triangle.h>
/** constructeur */
Triangle::Triangle() throw (std::string)
{
/** Shader */
const char* srcVertexShader =
"#version 300 es\n"
"in ve... | true |
d09eca939ddb644cb409c340ee888965e8a2686b | C++ | Xoliper/SpaceRivals | /Sources/Engine/Common/Objects/Object.hpp | WINDOWS-1250 | 1,643 | 2.59375 | 3 | [] | no_license | #ifndef ENGINE_COMMON_OBJECTS_OBJECT_HPP_
#define ENGINE_COMMON_OBJECTS_OBJECT_HPP_
#include "ObjTemplate.hpp"
#include "../Drawable.hpp"
#include "../Shaderloader.hpp"
#include "../Graphics/Texture.hpp"
#include "../World.hpp"
#include "../Exceptions.hpp"
#include <math.h>
#include <algorithm>
#include <glm/glm.hpp>... | true |
1152f01190dda5c8fe86542730eb184e8b6cad74 | C++ | Teabeans/CrackingTheCodingInterview | /S09_Ch01_ArraysAndStrings/01_07_RotateMatrix.cpp | UTF-8 | 8,071 | 3.421875 | 3 | [] | no_license | //-----------------------------------------------------------------------------|
// Authorship
//-----------------------------------------------------------------------------|
//
// Tim Lum
// twhlum@gmail.com
// Created: 2018.07.15
// Modified: 2018.08.22
//
/*
1.7 - RotateMatrix() - P.91
Given an image ... | true |
9b3c649aaeb8bea3f4521858d9aaac1f59b53870 | C++ | uditabose/Collectibles | /MSCS/Compiler/include/Token.h | UTF-8 | 666 | 3.203125 | 3 | [] | no_license | /**
* Class to represent a token class
*/
#ifndef TOKEN_H
#define TOKEN_H
#include <string>
class Token
{
public:
Token(std::string tokType, std::string tokRegEx);
virtual ~Token();
/**
* returns the token type
*/
std::string getTokenType();
/**
* r... | true |
60611029ac3748b4577b4caee5f1aad6e643ae44 | C++ | Croer01/GameEngine | /editor/GameComponentsProvider.cpp | UTF-8 | 6,336 | 2.609375 | 3 | [] | no_license | //
// Created by adria on 23/11/2019.
//
#include <game-engine/geEnvironment.hpp>
#include "GameComponentsProvider.hpp"
#include "ViewModels.hpp"
using namespace GameEngine;
void GameComponentsProvider::updateNames()
{
namesCached_ = env_->getRegisteredPropertiesIds();
}
std::vector<std::string> GameComponentsP... | true |
a93e5f3264e71124f702922e62c758b6bec531eb | C++ | andrejlevkovitch/KaliLaska | /src/events/sdl/MousePressEventSdl.hpp | UTF-8 | 754 | 2.71875 | 3 | [] | no_license | // MousePressEventSdl.hpp
#pragma once
#include "events/imp/MousePressEventImp.hpp"
#include <SDL2/SDL.h>
namespace KaliLaska {
class MousePressEventSdl final : public MousePressEventImp {
public:
MousePressEventSdl(Mouse::Button button, Mouse::Click click, Point clickPos);
/**\param buttons mask of currently p... | true |
55fa0c4448c0298719174f4de40cb65a1a4dcda2 | C++ | wadejong/Summer-School-Materials | /MPI/exercises/recursive_master_worker.cc | UTF-8 | 4,715 | 2.75 | 3 | [
"BSD-3-Clause"
] | permissive | /***
This implements a master-worker model to parallelize the recursive quadrature example.
In this 1-D example, it is unlikely master-worker decomposition will
give a a performance benefit since there is so little computation per
task compared to the amount of communication. However, it is instructive to
adopt th... | true |
c72ac6be805f23d1cfbce6cba8fb033cc4a7493a | C++ | Saumya1507/DSA-SHEET | /kthmaxandmin.cpp | UTF-8 | 359 | 2.859375 | 3 | [] | no_license |
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
//the number of elements you want
cout<<"enter the number of elements"
cin>>n;
cout<<"enter the kth number";
cin>>k;
int arr[n];
// enter the array elements
for(int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
//kth min
cout<<arr[k-1]<<endl;... | true |
ea6992a74c1bc43ccff5f3e25586be8c3aba3979 | C++ | jvtaufner/stable-matching | /lib/person.hpp | UTF-8 | 348 | 2.5625 | 3 | [] | no_license | #ifndef PERSON_H
#define PERSON_H
#include <cmath>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
class Person{
public:
int age;
int index;
pair<int, int> coordinates;
Person(int age, int x, int y, int index);
static bool comparePeople(Person p1,... | true |
b773be51d793f2317dd56446d47d14d01d6ec474 | C++ | Lukas19/Tarea4 | /funciones.cpp | UTF-8 | 1,848 | 3.671875 | 4 | [] | no_license | /*
list: Lista todos los tags contenidos en el tag actual
change x: donde x es un numero mayor o igual a 1, indicando el tag al cual queremos navegar
back: ir al tag anterior en la jerarquia
position: indica el tag en el cual estamos situados actualmente
exit: salir del programa
*/
#include <iostream>
#include <string... | true |
1514de134cca202abae8beac9843fee8d24369c6 | C++ | FrankBATMAN/Soft-Shadows-Rendering-with-Split-screen | /SourceCode/SSRS/LBBML/LBBML/LBBML/DataSimulator/Distances/ManhattanDistance.cpp | UTF-8 | 522 | 3.125 | 3 | [] | no_license | #include "ManhattanDistance.h"
//*************************************************************
//Function:
float CManhattanDistance::distanceV(const std::vector<float>& vVec1, const std::vector<float>& vVec2)
{
_ASSERT(!vVec1.empty() && !vVec2.empty(), "empty vector");
_ASSERT(vVec1.size() == vVec2.size(), "vectors ... | true |
9de1b49cf1e2a38e9e453a470d0d9091e920c3af | C++ | puma3/IA-tictactoe | /util.cpp | UTF-8 | 11,206 | 2.875 | 3 | [] | no_license | #include "util.h"
Position::Position(size_t _x, size_t _y) :
x(_x),
y(_y)
{}
Position::Position(const Position &_other) :
x(_other.x),
y(_other.y)
{}
Position Position::operator =(const Position &_other)
{
x = _other.x;
y = _other.y;
return *this;
}
void Position::print()
{
cout << "... | true |
37827c935d9c41dc3747dcda4812c96048fce064 | C++ | harshitmuhal/InterviewBit | /Backtracking/Permutations.cpp | UTF-8 | 1,022 | 3.546875 | 4 | [] | no_license | /*
Given a collection of numbers, return all possible permutations.
Example:
[1,2,3] will have the following permutations:
[1,2,3]
[1,3,2]
[2,1,3]
[2,3,1]
[3,1,2]
[3,2,1]
NOTE
No two entries in the permutation sequence should be the same.
For the purpose of this problem, assume that all the numbers in the collec... | true |
019d08f441cb8934dd8356a5dd4169f94becca07 | C++ | finalitylabs/snark-challenge-prover-reference | /ocl_kernels/kernel.hpp | UTF-8 | 4,784 | 2.5625 | 3 | [
"MIT"
] | permissive | // #define __CL_ENABLE_EXCEPTIONS
#include <CL/cl.h>
#define DATA_SIZE (131072)
#define limbs_per_elem (12)
#include <chrono>
#include <typeinfo>
#include <unistd.h>
#include <string.h>
#include <errno.h>
class Kernel {
public:
char* program_source_code;
size_t program_source_code_size;
int err; ... | true |
6c7981b53127c275653be0f1c6f766fbb1d755e4 | C++ | fjh658/MachOExplorer | /libmoex/node/MachSection.h | UTF-8 | 5,071 | 2.828125 | 3 | [
"MIT"
] | permissive | //
// Created by everettjf on 2017/4/2.
//
#ifndef MACHOEXPLORER_MACHSECTION_H
#define MACHOEXPLORER_MACHSECTION_H
#include "Node.h"
MOEX_NAMESPACE_BEGIN
class MachHeader;
// Section wrapper : unifiy section and section_64 into one struct
class moex_section{
private:
section *s=nullptr;
section_64 *s64=nul... | true |
7e7e668a90f8a2a3862112847543bf8dfd33df36 | C++ | Heongilee/Inflearn_Cpp_Proj | /TBCppStudy/Chapter4-5/main.cpp | UHC | 1,127 | 3.78125 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
#include <limits>
#include <typeinfo>
int main()
{
using namespace std;
/* //Pra1.
int a = 123;
// 4.0̶ Literal ڷ ִ ش.
cout << typeid(4.0).name() << endl;
cout << typeid(a).name() << endl;
//Numeric Promotion ( ū )
float a = 1.0f;
double d = a;
//Numeric Conv... | true |
00ee1390b9fabe6b4e0ac5a65cc064cffdef536b | C++ | ssyuva/Algorithms-And-Data-Structures | /Stacks/08_Evaluate_Postfix_Stack.cpp | UTF-8 | 2,967 | 3.90625 | 4 | [] | no_license | //Evaluation of postfix expression using stack
//Author: Yuvaraja Subramaniam ( www.linkedin.com/in/yuvaraja )
#include <iostream>
#include <stack>
#include <vector>
#include <string>
#include <ctype.h>
#include <cmath>
using namespace std;
int evaluate_postfix_exp_stack(string pexp);
int main () {
cout << " ... | true |
f213653c47aebd325e1a9e8efb76c36cd75feb4b | C++ | hmeyer/facetype | /typewriter.h | UTF-8 | 1,340 | 2.96875 | 3 | [] | no_license | #include <string>
enum Boldness {
kNormal,
kBold
};
class BaseTypewriter {
public:
BaseTypewriter() {}
virtual ~BaseTypewriter() {};
virtual void print_char(char, Boldness =kNormal) {}
virtual void print_string(const std::string&, Boldness =kNormal) {}
virtual void print_align_right(const s... | true |
254af3fa17c129b5d0037713040368f5fe10c7b4 | C++ | alexandraback/datacollection | /solutions_2705486_1/C++/Lutyj/h.cpp | UTF-8 | 2,051 | 2.53125 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
using namespace std;
const int MAXS = 6000;
struct tree_node
{
bool end;
tree_node* link[26];
};
char S[MAXS+1];
int N, res[MAXS+1][5];
void go(tree_node* T, int p... | true |
bb843e1501983cb9aaa7cd741e705355744b1ee0 | C++ | renedekluis/HBO-ICT_jaar_2_Blok_B_C_plus_plus | /week2-opgave/windowHandler.hpp | UTF-8 | 594 | 2.515625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <SFML\Graphics.hpp>
#include "ball.hpp"
#include "player.hpp"
const struct {
sf::Keyboard::Key Key;
float x; float y;
}actions[] = {
{ sf::Keyboard::Left, -1, 0 },
{ sf::Keyboard::Right, +1, 0 },
{ sf::Keyboard::Up, 0, -1 },
{ sf::Keyboard::Down, 0, +1 }
};
clas... | true |
bc714e1fddc4a21d42ee2a2b40c1211257fd317f | C++ | Markweese/CreativeCoding | /Song Map/src/ofApp.h | UTF-8 | 1,781 | 2.75 | 3 | [] | no_license | #pragma once
#include "ofMain.h"
struct State;
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
// this get's called when a state was clicked
void stateClicked(string name);
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x... | true |