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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a357c53991eb79b3035b16ad09c9160bf7c606b4 | C++ | benardp/Radium-Engine | /src/Engine/Scene/SpotLight.hpp | UTF-8 | 1,739 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <Core/Math/Math.hpp>
#include <Engine/RaEngine.hpp>
#include <Engine/Scene/Light.hpp>
namespace Ra {
namespace Engine {
namespace Scene {
class Entity;
/** Spot light for rendering.
*
*/
class RA_ENGINE_API SpotLight final : public Ra::Engine::Scene::Light
{
public:
EIGEN_MAKE_ALIGNED_... | true |
8c2ed6638ad32914b52ea3e9260bdc8b73a5c327 | C++ | joarley/_riskemu | /shared/minilzo/MiniLZO.h | UTF-8 | 1,624 | 2.71875 | 3 | [] | no_license | #ifndef _RISKEMULIBRARY_MINILZO_MINILZO_H_
#define _RISKEMULIBRARY_MINILZO_MINILZO_H_
#include "stdtypes.h"
#include <vector>
class MiniLZO
{
public:
static bool Compress(byte *src, size_t srcLen, byte *&dst, size_t &dstLen);
static bool Decompress(byte *src, size_t srcLen, byte *&dst, size_t &dstLen);
privat... | true |
88f54583d7dc401dc3d903dc5551c32d08ca75a8 | C++ | vipsinha/CPlusPlus | /HackerRank/2_Variable_Sized_Arrays.cpp | UTF-8 | 907 | 3.140625 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n,q;
int index, jndex;
//cout << "Input the array size and query" << endl;
cin >> n >... | true |
c1d2027c71070e16c1a2b779f4ba7e9d076dc56a | C++ | NNNILabs/SimpleArduinoCLI | /sketch_feb02a.ino | UTF-8 | 3,599 | 3.484375 | 3 | [] | no_license | #define BUF_WIDTH 30
#define newline Serial.print('\n')
//Array 'input' holds the string taken from the serial buffer '
//'Holder' contains three strings, one for the operation and two for the operands.
char input[BUF_WIDTH], holder[3][BUF_WIDTH];
//Calling 'reset()' anywhere in the program software resets the... | true |
47bfc71dd37ab3adcc19e98fcc1826b20c3d3ed5 | C++ | dcxcn/MyMap | /MyMap/src/operation/operationlist.h | UTF-8 | 1,198 | 2.78125 | 3 | [
"MIT"
] | permissive | /*************************************************************
** class name: OperationList
**
** description: Record operations(Move, Delete, rotate features)
** Support undo and redo.
**
** last change: 2020-03-26
**************************************************************/
#ifndef OPERATIONLIST_H
#d... | true |
1aa819ea2946c9536cacd659190e844e1fc062ba | C++ | JordanSamhi/VoronoiDiagramTurtleShell | /modele/triangulation/equationdroitebase.h | UTF-8 | 482 | 2.828125 | 3 | [
"MIT"
] | permissive | #ifndef EQUATIONDROITEBASE_H
#define EQUATIONDROITEBASE_H
#include <iostream>
#include <string>
#include "modele/point.h"
using namespace std;
class EquationDroiteBase{
public:
EquationDroiteBase();
virtual operator string() const = 0;
virtual EquationDroite * getEquationDroitePerpendiculairePassantParPo... | true |
385788168470752c962e0389d3ce3d7ad0f379d8 | C++ | 1share/onecodeoneday | /20171115/game.cpp | UTF-8 | 497 | 2.9375 | 3 | [] | no_license | #include<iostream>
#include "game.h"
using namespace std;
using namespace mycode;
gameboard::gameboard(int w, int h):mw(w),mh(h) {
msheet = new sheet(mw,mh);
}
gameboard::~gameboard() {
delete msheet;
}
void gameboard::setCell(int x, int y, const cell &data) {
msheet->setCell(x, y, data);
}
cell &gameboard::get... | true |
932ea7b3d9753eb9810ae117d6c908053a379f53 | C++ | anntom/Matrix | /main.cpp | UTF-8 | 1,140 | 3.3125 | 3 | [] | no_license | #include <fstream>
#include <vector>
#include <iostream>
#include <string>
#include "Matrix.h"
#include "time.h"
using namespace std;
bool read(const char * path, Matrix &mat)
{
ifstream f(path);
if (f.is_open())
{
try{
f>>mat;
}
catch(const char* str){
cout << str << endl;
return false;
}
retur... | true |
80890f12f0970cb0fc61d1f9c2be4c5f52f5dec5 | C++ | very-indecisive-studios/chaos-chef | /src/game/entity/player/player.h | UTF-8 | 1,606 | 2.578125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include "core/sprites/animatedSprite.h"
#include "game/resources.h"
#include "playerHand.h"
#include "game/entity/gameEntity.h"
#include "core/audio/audio.h"
class Player : public GameEntity
{
private:
UCHAR playerKeyUp = VK_UP;
UCHAR playerKeyDown = VK_DOWN;
UCHA... | true |
284272756ce92a7c233110becd05df8640607061 | C++ | ASharpy/AI-Project | /project2D/StateManager.cpp | UTF-8 | 1,904 | 3.140625 | 3 | [
"MIT"
] | permissive | #include "StateManager.h"
#include "State.h"
#include "Exception.h"
StateManager::StateManager()
{
}
StateManager::~StateManager()
{
}
void StateManager::updateState(float deltaTime)
{
doCommands();
for (auto &var : activeStates)
{
var->update(deltaTime);
}
}
void StateManager::RenderState()
{
for (auto... | true |
865e87699704fb66f9ac10c236513835eaf47036 | C++ | Rakatashii/cpp_ch11 | /P11_7/P11_7/util.hpp | UTF-8 | 549 | 2.84375 | 3 | [] | no_license | #ifndef util_hpp
#define util_hpp
#include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
#include <cstdlib>
#include <time.h>
namespace UTIL{
extern void swap(int& x, int& y);
extern void print_vector(std::vector<int> v, std::string name = "v");
extern void print_two_vectors(std::vecto... | true |
533ee0b48a756ebfcb01712dddfa540ed1883159 | C++ | thefux/hwp_fuchse | /Aufgabe2/setmotorspeed_a_b.ino | UTF-8 | 1,001 | 2.734375 | 3 | [] | no_license | #define A_Backwards 10
#define A_Forward 11
#define B_Forward 6
#define B_Backwards 9
bool forward = true;
uint8_t spd = 50;
bool motor = false;
void setMotorSpeed(bool forward);
void setup() {
// put your setup code here, to run once:
pinMode(A_Forward, OUTPUT);
pinMode(A_Backwards, OUTPUT);
pinMode(B_F... | true |
45fe3c1d9ca2ff46ddd951ff0ec9768d8fc37822 | C++ | mkarppa/deann | /src/AnnEstimator.hpp | UTF-8 | 14,780 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef DEANN_ANN_ESTIMATOR
#define DEANN_ANN_ESTIMATOR
#include "RandomSampling.hpp"
#include "FastRNG.hpp"
#include "KdeEstimator.hpp"
#include "Kernel.hpp"
#include "Array.hpp"
#include <unordered_set>
#include <random>
#include <iostream>
/**
* @file
* This file implements the DEANN estimator.
*/
namespace de... | true |
3698d4a9753a69d8c5c5dddbb251e3d1a024dd58 | C++ | Marito-R-T/Arboleda | /QArboleda/programa.cpp | UTF-8 | 2,461 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | #include "programa.h"
Programa::Programa()
{
}
void Programa::leerTexto(QString nombre) {
nombre += "n";
}
void Programa::setSeguir(bool seguir) {
this->seguir = seguir;
}
void Programa::setPID(int pid) {
this->pid = pid;
}
int Programa::getPID() {
return this->pid;
}
void Programa::setEliminar(b... | true |
6f892fda02a7105010cda22716a3cb62aa38aead | C++ | humeaua/CVATools | /CVATools/UtilitiesTests.cpp | UTF-8 | 3,700 | 2.8125 | 3 | [] | no_license | //
// UtilitiesTests.cpp
// CVATools
//
// Created by Alexandre HUMEAU on 28/02/15.
//
//
#include "RegressionTests.h"
#include "DoublePrecision.h"
#include <cmath>
#include "ConfigLoader.h"
#include "OWGRWrapperLoader.h"
#include "CSVReader.h"
#include "StringUtilities.h"
#include "ConfigReader.h"
#include "Playe... | true |
bcbb5fd4e237d4e58354dd024de9e4ddc4a41389 | C++ | shinbyh/ns3-p2p-wmn | /route_flowcheck.h | UTF-8 | 1,583 | 2.578125 | 3 | [] | no_license | /*
* route_flowcheck.h
*
* Created on: Jan 16, 2018
* Author: bhshin
*/
#ifndef SCRATCH_P2P_BHSHIN_ROUTE_FLOWCHECK_H_
#define SCRATCH_P2P_BHSHIN_ROUTE_FLOWCHECK_H_
#include <vector>
#include <string>
#include "source_route_stat.h"
#include "flow.h"
using namespace std;
class FlowCheck {
private:
int msg... | true |
8a3db9e1330d1ad8ec41a913bf670b78bea9cc38 | C++ | pingxiyan/MovementObjectExtract | /extract_obj_lib/src/extract_obj_auto_param.cpp | UTF-8 | 1,432 | 2.8125 | 3 | [] | no_license | /**
* Part 1: Auto get parameter.
* Sandy Yann, Nov 14, 2017
*/
#include <string>
#include <iostream>
#include "extract_obj.h"
#include "extract_obj_auto_param.h"
/**
* @brief Create Handle of auto get parameter.
* @param width : image width.
* @param height : image height.
* @param maxframenum : max frame number is... | true |
2d1c1710607240749f5ef51e2a065352e68c3c09 | C++ | SunatP/ITCS381_Multimedia | /Lab Teacher Worapan/6Lab_Left.cpp | UTF-8 | 9,664 | 2.546875 | 3 | [] | no_license | #include<stdio.h> // Standard io
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream> // for output
#include <cmath> // Calculate mathmatic
#include<fstream> // Write file output
#include <windows.h> // Add this header for waiting output before... | true |
4a7360b6c83c3fdbd586f7286ad142f4bde12318 | C++ | cjoshmartin/Intro-to-Programming-Vb-C- | /Work/Selection Statement Exercises/Gravity.cpp | UTF-8 | 1,780 | 3.921875 | 4 | [] | no_license | // Josh Martin
// Exercise 1 - Selection Statement Exercises
// Period 2
// 2/25/2014
// Purpose - to calcute the weight of a person on other plants
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
//Naming variable
double weight;
char firstletter;
char secondletter;
// Getting weight... | true |
f9e12b95ade328f383c291cb599b306cab020d5a | C++ | gorobot/symmath | /test/numerics/test_variable.cc | UTF-8 | 994 | 3.109375 | 3 | [] | no_license | #include <catch2/catch.hpp>
#include <symmath/numerics/real.hpp>
#include <symmath/numerics/variable.hpp>
using namespace sym;
TEST_CASE("Variables: operations", "[numerics]") {
Real a(1.0);
Variable<Real> x(2.0);
Variable<Real> y(1.0);
// REQUIRE(a == y);
// z = x + y;
SECTION("should be able to assi... | true |
33189ff58027ea28df43a350b75faf35daa2a8fa | C++ | yitati/LCProject | /Leetcode/JumpGameII.cpp | UTF-8 | 2,111 | 3.71875 | 4 | [] | no_license | /******************************************************************************
* Question: #45 Jump Game II
* Given an array of non-negative integers, you are initially positioned at the first index of the array.
* Each element in the array represents your maximum jump length at that position.
* Your goal is to reach ... | true |
ba04b88847b4bfa6d8768793b6166576a1d5f9ff | C++ | syoch/NotepadSh | /NotepadSh/MyFrame.cpp | UTF-8 | 3,333 | 2.546875 | 3 | [] | no_license | #include "pch.h"
#include "widgetids.h"
#include "MyFrame.h"
// clang-format off
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_OpenFile, MyFrame::OnOpenFile)
EVT_MENU(ID_SaveFile, MyFrame::OnSaveFile)
EVT_TEXT(ID_TextEditor, MyFrame::EnterTextEditor)
EVT_MENU(wxID_EXIT, MyFrame::OnExit)
EVT_MEN... | true |
ec83c13d7d6b292438588bd7786165d9b10979d8 | C++ | JuanPabloRN30/Competitive_Programming | /UvaOnlineJudge/686.cpp | UTF-8 | 901 | 2.546875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector < int > primes;
void sieve(ll N)
{
bitset<10000010> bs;
bs.set();
for( ll i = 2 ; i <= N ; i++ )
{
if( bs[ i ] )
{
primes.push_back( i );
for( ll j = i*i ; j <= N ; j+= i )
bs[j] = false;
}
}
}
in... | true |
1f5118e3113550dfa93c9d1e1b448d99f91af36c | C++ | jayin92/code-of-TIOJ | /C.cpp | UTF-8 | 505 | 2.765625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int n;
int h = 0;
cin >> n;
int arr[n][2];
int temp[2];
for(int i = 0;i<n;i++){
cin >> arr[i][0] >> arr[i][1];
}
for(int i = 0;i<n;i++){
h = 0;
for(int j=0;j<2;j++){
temp[j] = arr[i][j];
}
if(temp[1] % 2 == 1){
temp[1]+... | true |
83e06ca5857c45d3d34bf3909a2a5260314e544f | C++ | scaussin/abstract_vm | /src/Factory.cpp | UTF-8 | 3,122 | 3.21875 | 3 | [] | no_license | #include "main.hpp"
Factory::Factory()
{
_tabFactoryOperand[eInt8] = &Factory::createInt8;
_tabFactoryOperand[eInt16] = &Factory::createInt16;
_tabFactoryOperand[eInt32] = &Factory::createInt32;
_tabFactoryOperand[eFloat] = &Factory::createFloat;
_tabFactoryOperand[eDouble] = &Factory::createDouble;
}
Factory::... | true |
01bd11c306efa017bb4528673225cac3dae5bf95 | C++ | blockspacer/swordbow-magic | /include/commandcomponent.hpp | UTF-8 | 1,274 | 3.171875 | 3 | [
"MIT"
] | permissive | #ifndef COMMANDCOMPONENT_HPP
#define COMMANDCOMPONENT_HPP
#include <unordered_map>
#include <forward_list>
//Forward declaration could work instead of inclusion but that leads to
//undefined behaviour when deleting a pointer to ICommand
#include "icommand.hpp"
//This component allows each entity to do it's own thing... | true |
7eb3fa78852e98118dca861f9f51fd9ae62cb5a4 | C++ | lopez-jose/Euler | /Problem18/MaximumPathSum.cpp | UTF-8 | 937 | 3.265625 | 3 | [] | no_license | // Problem18-MaximumPathSumI.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include<fstream>
#include <string>
using namespace std;
int height = 0;
const int width = 15;
int store[width][width] = { 0 };
void printOut()
{
for (int i = 0; i < width; i++)
{
for (int j = 0; j < ... | true |
c460fe3b61a4a29dedfc707cad3518820b290ddf | C++ | colin9597/Cpp_Programming | /02주차/sum.cpp | UTF-8 | 224 | 3.09375 | 3 | [] | no_license | #include <iostream>
int main()
{
int score[5] = {10, 30, 40, 60, 90};
int sum = 0;
for(int i=0; i<5; i++)
{
sum += score[i];
}
std::cout << sum << std::endl;
return 0;
} | true |
d178d0de0738233c5355f8496ad41e3312306833 | C++ | lebiednik/PhoenixSim | /ioComponents/DRAMsim/RowBuffer.h | UTF-8 | 257 | 2.515625 | 3 | [] | no_license |
class RowBuffer {
public:
RowBuffer();
int status; /* Three choices. IDLE, OPEN, PENDING */
int completion_time; /* this is used with counters to decide how long to keep a row buffer open */
int rank_id;
int row_id;
int bank_id;
};
| true |
be8f532d853cc414715762ede3b9aa0f6bbf8432 | C++ | Ahren09/CS32 | /Projects/Project2/Set.cpp | UTF-8 | 4,813 | 3.671875 | 4 | [] | no_license | // Set.cpp
#include "Set.h"
Set::Set()
: head(nullptr),tail(nullptr),m_size(0)
{}
Set::~Set()
{
//Empty list, return directly
Node *p=head;
while(head)
{
head=head->next;
delete p;
p=head;
}
}
Set::Set(const Set& other)
{
if(other.empty())
{
head=tail=nullpt... | true |
87b095ff413f3fb3239db34a77017c43e6b7ed75 | C++ | tangenta/CppLexer | /lexer.cpp | UTF-8 | 13,473 | 3.03125 | 3 | [
"MIT"
] | permissive | #include "lexer.h"
#include <cctype>
#include "keywords.cpp"
#include "abstractscanner.h"
#include "tokenhandler.h"
static const char blank = ' ';
Lexer::Lexer(std::shared_ptr<AbstractScanner> scanner) {
if (!scanner) throw std::runtime_error("scanner unavailable");
this->scanner = scanner;
}
void Lexer::set... | true |
fae6dc8cdfe44469d437eb263ed6eeef8f04c15b | C++ | rlon9/C- | /Exercise07_05.cpp | UTF-8 | 930 | 3.359375 | 3 | [] | no_license | //
// Exercise07_05.cpp
// CSCI2490
//
// Created by Phil on 1/25/16.
// Copyright © 2016 Phil. All rights reserved.
//
#include <iostream>
using namespace std;
int main() {
cout << "Enter 10 numbers" << endl;
double array[10];
for (unsigned i = 0; i < 10; i++) {
cin >> array[i];
}
dou... | true |
9313cd35bc17ced958b80a9262431d49762659ae | C++ | wonghoifung/tips | /leetcode/easy_hamming_distance.cpp | UTF-8 | 562 | 2.90625 | 3 | [] | no_license | #include <vector>
#include <queue>
#include <stack>
#include <iostream>
#include <sstream>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
class Solution {
public:
int hammingDistance... | true |
70c2cab6b453bbb52d15070fd116fb7ffe51f57b | C++ | thinkmariale/3D-Puzzle-Maze | /KinectProject/src/testApp.cpp | UTF-8 | 13,335 | 2.59375 | 3 | [] | no_license | #include "testApp.h"
#include <gl\glu.h>
static float smoothPct = 0.75f;
static int tolerance = 4;
bool flag=false;
int footF=0;
int directionF=0;
/*
1 = right
2 = left
1 = foward
2 = back
*/
//--------------------------------------------------------------
void testApp::setCalibrationOffset(float x, float y) {
ofxM... | true |
9853ac7479faecc8cd5e1c12d030f323926712ad | C++ | enra64/PKES | /aufgabe4_float_serial_input_clion_funktioniert_ein_rad_drehung/average_ring.h | UTF-8 | 656 | 2.75 | 3 | [] | no_license | /*
* arnes_fifo_buffer.cpp
*
* Created: 22-Oct-15 14:36:21
* Author: Arne
*/
#ifndef flav
#define flav
//generic includes
#include <stdbool.h>//bool
#include <avr/io.h>//uint8_t
#define SIZE 3
class AverageRing{
float _buffer[SIZE];
uint8_t _head = 0;
public:
bool write(float newValue){
... | true |
802bf4c387051a3a2f0bdfbf7f0d6b3a0f976047 | C++ | gbrlas/AVSP | /CodeJamCrawler/dataset/14_7385_55.cpp | UTF-8 | 1,169 | 3.140625 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<math.h>
#include<stdlib.h>
using namespace std;
int compare (const void * a, const void * b)
{
return ( (*(double*)a > *(double*)b)? 1 : -1 );
}
//a,b sorted
int dw(double *a,double *b,int n)
{
int i=0,j=0,re=0;
while(i<n){
if(*(a+i)>... | true |
59480e88cf0b815db24799396db27493fcb6733e | C++ | PhilipHannemann/ObjectCollision | /project/Source/Quantum/PhysicEngine/SphereTreeNode.h | UTF-8 | 1,085 | 2.65625 | 3 | [] | no_license | #pragma once
#include <glm\glm.hpp>
#define _SphereTreeNode_NUM_CHILDREN_ 8
namespace physics
{
class SphereTreeNode
{
public:
enum SphereFlag
{
LEAF,
INNER_NODE,
ROOT
};
static const int num_children;
int64_t update_tick;
glm::vec3 center;
float radius;
glm::vec3 original_center;
f... | true |
e074ec232f68c5e5e54038a40c80209aff26d803 | C++ | Alex4386-vault/clang-programming | /06/06/shortIfStatement.cpp | UTF-8 | 398 | 3.1875 | 3 | [] | no_license | #include <stdio.h>
int main() {
// This is how to give a FUCK to your
// coworkers by using shitty indentations
int hours;
scanf("%d", &hours);
/*
if (hours > 40)
printf("Good");
else
printf("bad");
*/
//puts((hours > 40) ? "Good" : "Bad");
//printf((hours > 40) ? "Good" : "Bad");
// hours > 40 ? p... | true |
fa34ac484522b7fba2d728a85d9698c3326fd2dd | C++ | YouDad/test_finger | /test_finger/MyThread.cpp | GB18030 | 1,961 | 3.125 | 3 | [] | no_license | #include "stdafx.h"
// tmpΪ,ô߳̽Զͷ,ֻnewûdelete
MyThread::MyThread(ThreadFunction_t pFunction,bool tmp){
pf=pFunction;
temporary=tmp;
}
// ͷŵĽṹ
struct temporaryParam{
ThreadFunction_t pf;
MyThread* beDelete;
};
// Ҫͷŵʱ߳
std::vector<temporaryParam> TPVec;
// ͣסֱ̻߳߳size֮ټ
MyLocker getSize(0,1);
// ߳
bo... | true |
792c5abd1f257f1933ca42a30aa0efcdb6655068 | C++ | Andydas/Vysledky-parlamentnych-volieb-AUDS | /Semestralka2/uzemna_jednotka.cpp | UTF-8 | 1,305 | 2.828125 | 3 | [] | no_license | #include "uzemna_jednotka.h"
UzemnaJednotka::UzemnaJednotka(int kod, wstring nazov, TypUJ typ, UzemnaJednotka* predok) :
kod_(kod), nazov_(nazov), typ_(typ), predok_(predok)
{
volici_ = 0;
zucastneni_ = 0;
odovzdaneObalkyOsobne_ = 0;
odovzdaneObalkyCudzina_ = 0;
platneHlasy_ = 0;
}
int UzemnaJednotka::getOdovz... | true |
85428acedb0241da6b284c3b9c4b57806f7a7016 | C++ | metiscus/gameengine | /map.hpp | UTF-8 | 4,712 | 2.875 | 3 | [] | no_license | #ifndef GAME_ENGINE_MAP_HPP
#define GAME_ENGINE_MAP_HPP
#include <SFML/Graphics.hpp>
#include <functional>
class Game;
class Object;
struct Game_Action
{
Game_Action(std::string t_description, std::function<void (const float, const float, Game &)> t_action)
: description(std::move(t_description)), action(std:... | true |
100e9b1db0559b8e02c1d345d57779cdc8016dbd | C++ | ViPErCZ/snake3d | /Manager/EatManager.cpp | UTF-8 | 727 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "EatManager.h"
namespace Manager {
EatManager::EatManager(EatLocationHandler *handler) : handler(handler) {}
EatManager::~EatManager() {
delete handler;
}
void EatManager::run(EatManager::eat_EVENT event) {
switch (event) {
case eatenUp:
handler->o... | true |
da6804fc0e8266ccf69bf3e92f70c6fe1798fb0b | C++ | antoniocaia/cp20-21 | /code/kadane.cpp | UTF-8 | 1,007 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <vector>
/*
time complexity: O(n)
space complexity: O(1)
While iterating the input array, we refer to all the element
previusly scanned as prefix.
If the sum of the prefix is negative, the prefix must be excluded,
because simply doing that we can optain a sub array whose sum is bigger. ... | true |
21daed18bbdd4523dcf23df02650561442166c91 | C++ | syfchao/quick-start-app | /libsrvkit/src/async_task.cc | UTF-8 | 2,357 | 2.84375 | 3 | [] | no_license | #include <async_task.h>
extern int g_svr_exit;
async_routine_t* malloc_async_routines(int cnt, size_t max_pending_task)
{
async_routine_t* routines = (async_routine_t*)calloc(cnt, sizeof(async_routine_t));
if(NULL == routines){
LOG_ERR("Out of memory");
return NULL;
}
for(int i = 0; i < cnt; ++i){
async_... | true |
cf62ecf18bee11659538bb5f6444a998cb866319 | C++ | Mic-Tartaglia/Tartaglia_NumSimExercises | /Week1/es1_3/es1_3.cpp | UTF-8 | 2,721 | 2.796875 | 3 | [] | no_license | #include "random.h"
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
double StdDev(double mean, double sq_mean, int n);
int main(){
//**********************************************************************//
//SETTING UP GENERATOR
Random rnd;
int seed[4];
int p1, p2;
//import see... | true |
402947a162d8f1e61d38e45be76e5666a86ae2b3 | C++ | dkwired/coursework | /cs130/project1/main.cpp | UTF-8 | 6,081 | 2.984375 | 3 | [] | no_license | // Name: David Klein
// Quarter, Year: Fall 2013
// Lab: 021
//
// This file is to be modified by the student.
// main.cpp
////////////////////////////////////////////////////////////
// FRONT VIEW - Drop z axis
// SIDE VIEW - Drop x axis
// TOP VIEW - Drop y axis
#include <GL/glut.h>
#include <math.h>
#include <iostr... | true |
a70b99085c011eb48c8b708b3dbefb4f9b569f05 | C++ | wishihab/KelasAlgoritmaDasar | /ProyekTugasUjian2014/Tugas5.5.cpp | UTF-8 | 284 | 2.671875 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
using namespace std;
main(){
int input, bagi, sisa;
cout<<"masukkan input : ";
cin>>input;
cout<<"masukkan pembagi: ";
cin>>bagi;
sisa = input%bagi;
if(sisa==0){
cout<<" ";
}
else{
cout<<"sisa hasil: "<<sisa;
}
}
| true |
e39626fd1c2c9ecf9745883f5d00f8abf9f7d6c4 | C++ | xardas110/BlackJack | /BlackJack/Math.h | UTF-8 | 391 | 3.078125 | 3 | [] | no_license | #pragma once
namespace Math
{
template<typename T>
inline T Abs(T val)
{
val < 0 ? val *= -1 : 0;
return val;
};
template<typename T>
inline T Max(T val1, T val2)
{
T result;
val1 > val2 ? result = val1 : result = val2;
return result;
}
template<typename T>
inline T Min(T val1, T val2)
{
T resul... | true |
15912869c488fbcfb34ee1c7435596f503a30240 | C++ | joseiguti/CursoCppPoo | /CursoCppPoo/Clases/Animal.h | UTF-8 | 361 | 2.609375 | 3 | [] | no_license | //
// Abstracta.h
// CursoCppPoo
//
// Created by José Ignacio Gutiérrez Guzmán on 4/14/18.
// Copyright © 2018 José Ignacio Gutiérrez Guzmán. All rights reserved.
//
#ifndef Abstracta_h
#define Abstracta_h
#endif /* Animal_h */
class Animal {
public:
void /*non-virtual*/ move(void) {
std::cout << "... | true |
2cf5dc193806b723a052143244c8f2ddad320258 | C++ | Risgrynsgrot/SDL2OpenGl | /source/Math.h | UTF-8 | 195 | 2.65625 | 3 | [] | no_license | namespace Math
{
template <class T>
inline T clamp(T value, T min, T max)
{
const T t = value < min ? min : value;
return t > max ? max : t;
}
} // namespace Math
| true |
b9b2f45ab88226445482049f086072b4e8f7b886 | C++ | KiAlexander/LeetCode_Note | /math/1103_distribute-candies-to-people.cpp | UTF-8 | 912 | 2.953125 | 3 | [] | no_license | class Solution {
public:
vector<int> distributeCandies(int candies, int num_people) {
long k=1;
while(k*(k+1)/2<=candies)
++k;
--k; // 计算出当前糖果最多可以发给多少个人(如果有无限个同学的话
int last = candies - (k+1)*k/2; // 计算出最后一个人需要发给多少个(剩余的那些
vector<int> res(num_people, 0);
in... | true |
fd7034e529085d34df6947b439d57548631c85cf | C++ | ulinka/tbcnn-attention | /github_cpp/19/14.cpp | UTF-8 | 946 | 2.578125 | 3 | [] | no_license | #include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <utility>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
#include <cstring>
#include <cassert>
#include <ctime>
#include <stdbool... | true |
281f861be664cbc79d8769e0dbbc91a7fa0a994a | C++ | aoquan/leetcode | /tree/binaryTree1.cpp | UTF-8 | 3,805 | 3.5625 | 4 | [] | no_license | #include<iostream>
#include<fstream>
#include<stack>
using namespace std;
ifstream ifs("input.txt");
class node{
public:
node * l,*r;
int val;
bool isfirst;
node():val(0),l(NULL),r(NULL),isfirst(true){}
node(int a):val(a),l(NULL),r(NULL),isfirst(true){}
};
class vnode{
pu... | true |
5c395555bd8b72ec868e16e5db6cd6977df2dad6 | C++ | pyridine/LAWRENTIAN | /team4/handin/P 2.2/Actual Class Diagrams/lud server/FileSystemI.h | UTF-8 | 1,497 | 2.578125 | 3 | [] | no_license | #ifndef FILESYSTEMI_H
#define FILESYSTEMI_H
#include <Ice/Ice.h>
#include "FileSystem.h"
class FileSystemI : public FileSystem::File
{
private:
std::string main_dir;
bool dirExists(const std::string& dirName_in);
std::string extractFileName(const std::string& str);
std::string extractNodeName(const st... | true |
b42e8ac2f8aea0f58a3ee4e6b26e3f71853601c3 | C++ | luchenqun/leet-code | /problems/632-smallest-range.cpp | UTF-8 | 1,338 | 3.640625 | 4 | [] | no_license | /*
* [632] Smallest Range
*
* https://leetcode-cn.com/problems/smallest-range/description/
* https://leetcode.com/problems/smallest-range/discuss/
*
* algorithms
* Hard (46.51%)
* Total Accepted: 20
* Total Submissions: 43
* Testcase Example: '[[4,10,15,24,26],[0,9,12,20],[5,18,22,30]]'
*
* 你有 k 个升序排列的整... | true |
513f2affbfc5915168c57ef0748e3a2d9748435f | C++ | jpdef/rmon | /src/nwin/nwindow.h | UTF-8 | 1,625 | 2.703125 | 3 | [] | no_license | #ifndef __NWINDOW_H_INCLUDED__
#define __NWINDOW_H_INCLUDED__
#define MAXCHAR 256
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <typeinfo>
extern "C"
{
#include <ncurses.h>
}
using namespace std;
enum COLOR{red, white, blue};
class Nwindow{
int po... | true |
f33f23c46a03e3f122723106783157515223b941 | C++ | changsongzhu/leetcode | /C++/per_day/06-27-2017/057_h.cpp | UTF-8 | 1,735 | 3.703125 | 4 | [] | no_license | /**
57[H]. Insert Interval
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Example 1:
Given intervals [1,3],[6,9], insert and merge [2,5] in as [1,5],[6,9].
Example 2:
Given ... | true |
f80bf08a474663869c8a185cd5082bd0a8d27cba | C++ | katiaap/katiateste | /prjKatiaTeste/prjKatiaTeste/main.cpp | UTF-8 | 329 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
void main () {
int val1 = 0, val2 = 0;
cout << "\ttabuada" << endl;
cout << "\t-------" << endl;
cout << "Enter value 1: ";
cin >> val1;
cout << "Enter value 2: ";
cin >> val2;
cout << "Multiplication of " << val1 << " x " << val2 << " = " << (val1 * val2) << endl... | true |
5223ea7fe1b62ad6d63603dfe20d6b8ce153d343 | C++ | kk2491/CPP_Quick_Tour | /Examples/oop_140.cpp | UTF-8 | 2,160 | 3.953125 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
class Account {
private:
std::string name_;
double balance_;
public:
void SetName(std::string name) {
name_ = name;
}
void SetBalance(double balance) {
balance_ = balance;
}
std::string GetName() {
... | true |
2b921db2c8532183c52ecdb5b6f4d5998cf2b9d7 | C++ | XunZhiyang/TTRS | /backend/BplusTree/test.cpp | UTF-8 | 3,022 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <ctime>
#include <map>
#include "NewBptree.hpp"
using std::cout;
sjtu::Bptree<int, int, 101, 101> a("train_record");
void QueryTest();
void BigDataTest() {
// 300000 with defult pagesize = 5 takes 9.81 seconds
// 240000 with pagesize = 4096 takes about 13.06 seconds
for (int... | true |
67189a0da751b21cccf1a7df848a8f398cdb2433 | C++ | Mrhuangyi/leetcode-Solutions | /Cpp/Easy/38. 报数.cpp | UTF-8 | 998 | 3.8125 | 4 | [] | no_license | /*
报数序列是指一个整数序列,按照其中的整数的顺序进行报数,得到下一个数。其前五项如下:
1. 1
2. 11
3. 21
4. 1211
5. 111221
1 被读作 "one 1" ("一个一") , 即 11。
11 被读作 "two 1s" ("两个一"), 即 21。
21 被读作 "one 2", "one 1" ("一个二" , "一个一") , 即 1211。
给定一个正整数 n ,输出报数序列的第 n 项。
注意:整数顺序将表示为一个字符串。
示例 1:
输入: 1
输出: "1"
示例 2:
输入: 4
输出: "1211"
*/
class So... | true |
8923db61bd40868ad1041f180ac36fda35c176f9 | C++ | the-badcoder/Competitive-Programming | /Graph/DFS/DFS.cpp | UTF-8 | 1,612 | 3.28125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
/* This Programm Is For Basic DFS \
And It Will Find \
Connect Components Of An Undirected Graph.
Practice Problem: UVA 459 --> Graph Connectivity.
*/
#define DFS_BLACK 1
#define DFS_WHITE 0
typedef vector <int> vi;
typedef pair <int, int> ii;
typedef vector < ... | true |
288ecf75ccb85aed780da353dca789e4aab05511 | C++ | rocketeerbkw/DNA | /Main/Source/Ripley/ExtraInfo.cpp | UTF-8 | 16,950 | 2.765625 | 3 | [] | no_license | // ExtraInfo.cpp: implementation of the CExtraInfo class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ExtraInfo.h"
#include "tdvassert.h"
#include "XMLObject.h"
//////////////////////////////////////////////////////////////////////
// Construction/... | true |
a37f33d253ff3ed0179accbcf14430e888897f3f | C++ | bobstine/lang_C | /regression/observation.test.cc | UTF-8 | 581 | 2.921875 | 3 | [] | no_license | // $Id: observation.test.cc,v 1.3 2003/02/09 20:03:13 bob Exp $
#include "observation.h"
int main (void)
{
std::cout << "Enter the data to record in an observation as wt x1 x2 x3...: " << std::endl;
Observation obs1(std::cin);
std::cout << obs1 << std::endl;
std::cout << "Enter the data to record: " << std::... | true |
f786306ddce5e940dd333511996c18803f623918 | C++ | spalduing/CPP-for-Beginners | /CPP_Beginners_Course/Pointers_and_Arrays/main.cpp | UTF-8 | 1,982 | 4.25 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
string texts[] = {"one", "two", "three"};
string *pTexts = texts;
int s = sizeof(texts)/sizeof(string);
cout <<"There are " << s <<" elements in the array"<< endl;
cout << endl<< endl;
cout<<"Iterating by index"<<endl;
cout<<"========... | true |
95ad6a1316bfd7599b775c42d616bcbecc8b3154 | C++ | nagyistoce/saving-face | / saving-face --username 1900Geek@gmail.com/SavingFaceW32GUI/SavingFaceW32GUI.cpp | UTF-8 | 11,681 | 2.625 | 3 | [] | no_license | // SavingFaceW32GUI.cpp : Defines the entry point for the application.
//
#include <windows.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include "SavingFaceW32GUI.h"
#include "GlobalVars.h"
#include "AddUser.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINST... | true |
b1696e504e5e82f70c3f4ffea9f860989844e715 | C++ | fanzhaoyun/LeetCode | /RemoveNthNodeFromEndofList.cpp | GB18030 | 604 | 3.265625 | 3 | [] | no_license | #include"leetCode.h"
/*
İ취ʵڵһܵʱһָ룬ͿֱӴӺǰҡʱ临Ӷһ
*/
ListNode* Solution::removeNthFromEnd(ListNode* head, int n) {
if (head == nullptr)
return head;
ListNode* temp = head;
int total = 1;
while (temp->next) {
temp = temp->next;
total++;
}
if (total == n) {
return head->next;
}
total -= n; //ʵλӦټ1
total--;
... | true |
258eb04ec6c860f82a7de7b68cae6d49b6f02adf | C++ | PegasusScourge/DarkSun | /src/ApplicationSettings.hpp | UTF-8 | 1,427 | 2.890625 | 3 | [] | no_license | #pragma once
/**
File: ApplicationSettings.hpp
Description:
Stores settings for the application in a central place
Thread safed
*/
#include "LuaEngine.hpp"
#include <atomic>
using string = std::string;
namespace darksun {
class ApplicationSettings {
public:
ApplicationSettings(string settingsFile);
std:... | true |
ee7a8f7f57d8d8a6b3dbbd08a15317be11019880 | C++ | sidgupta234/Interview-Questions-Wiki | /Strings/longestComPrefix.cpp | UTF-8 | 437 | 3.34375 | 3 | [] | no_license | // https://www.interviewbit.com/problems/longest-common-prefix/
string longestCPrefix(string a, string b){
string ans="";
for(int i=0,j=0;i<a.length() && j<b.length() &&a[i]==b[j];i++,j++){
ans+=a[i];
}
return ans;
}
string Solution::longestCommonPrefix(vector<string> &A) {
... | true |
9449b373aad3546777573409eac17449c7ddc6be | C++ | futuramagica/alchemy | /thirdparty/Softkinetic/include/iisu/Foundation/Services/Commands/Command.h | UTF-8 | 106,255 | 2.59375 | 3 | [] | no_license |
#pragma once
#include <Framework/Types/RefTypeTrait.h>
#include <Foundation/Services/Types/RawData.h>
#include <Foundation/Services/Types/FunctionTypeInfo.h>
#include <Foundation/DataTypes/MetaInformation/MetaInfoImpl.h>
namespace SK
{
class CommandManager ;
/**
* \brief Interface of a generic Command.
*/
... | true |
3414fbe6e2e96bdbf4fa3851390955890b42418b | C++ | aabhas-sao/DSA-CB-CPP | /binary_search/painter.cpp | UTF-8 | 1,073 | 3.578125 | 4 | [] | no_license | #include<iostream>
#include<climits>
using namespace std;
#define ll long long int
bool isPossible(ll a[], ll mid, ll k, ll n) {
ll pallersUsed = 1;
ll boardTime = 0;
for(ll i = 0; i < n; i++) {
if(boardTime + a[i] > mid) {
pallersUsed++;
boardTime = a[i];
if(pallersUsed > k) {
... | true |
0658fd4d88d71116011a78b84efbbbf8fecb259a | C++ | lstyrtmrnbd/qtqst | /src/pather.hpp | UTF-8 | 834 | 2.75 | 3 | [] | no_license | #ifndef PATHER_INCLUDE
#define PATHER_INCLUDE
#include <functional>
#include <iostream>
#include <queue>
#include "pathgraph.hpp"
#include "pathnode.hpp"
#include "region.hpp"
// mapping of nodes to the node visited before them
// outer vector is y, inner x
using Previousmap = std::vector<std::vector<st... | true |
7a5435208ccf25fdf7510be182f0081f6fbfe4f3 | C++ | blairesc/Data-Structures-and-Algorithm-Analysis | /BQUEUE.cpp | UTF-8 | 3,930 | 3.765625 | 4 | [] | no_license | //Function Definition
#include <iostream>
#include <string>
#include "BQUEUE.h"
using namespace std;
//*************************************************************************************
//Name: default constructor
//Precondition: none.
//Postcondition: initialize state variables. front is set to 0.
//Description:... | true |
196b55d5b3bba497c8aeebf7d8f5a0ff47b21e5d | C++ | Devansh-Maurya/Object-Oriented-Programming-and-Design | /PackageDelieveryService/package_details.cpp | UTF-8 | 1,507 | 3.1875 | 3 | [] | no_license | //
// Created by devansh on 17/11/18.
//
#include <iostream>
#include "TwoDayPackage.cpp"
int main() {
double costPerKg = 100, twoDayCharge = 50, overnightCharge = 80;
Package *packages[2];
double costs[2];
Client client1("Devansh Maurya", "Mahanagar", "Lucknow", "Uttar Pradesh", 226006);
Clien... | true |
ae5cb25656c78beef3ed4da1e8ed3a968aa76f21 | C++ | alalaaa/zadanie-liczby-pierwsze | /pppppp.cpp | WINDOWS-1250 | 437 | 3 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
bool pierwsza(int liczba)
{
ifstream plik;
plik.open("a.txt");
ofstream plik2;
plik2.open("wynik.txt");
plik>>liczba;
for (int i=2; i<liczba/2; i++)
if (liczba %i == 0)
{
cout << "zoona";
return false;
}... | true |
6c4ee8f2e8d2a20b3cff4020519ecfb7440d3bb1 | C++ | rollrat/old-library | /src/other/Lately/Byte Assembler/rac.h | UHC | 6,918 | 2.609375 | 3 | [] | no_license | /*************************************************************************
*
* ROLLRAT SOFTWARE LIBRARY
* ALLOCATOR COLLECTION
*
* (C) Copyright 2014
* rollrat
* All Rights Reserved
*
***********************... | true |
e5df08f428997352381a7c3f0636171aa3a67fb3 | C++ | miriambt/BasicProgramming | /8_Recursivity/P45102 - Completely parenthesed expression.cc | UTF-8 | 905 | 4.28125 | 4 | [] | no_license | /* Completely parenthesed expression
Write a program that reads a completely parenthesed expression, and prints the result of evaluating it. The three possible operators are sum, substraction and multiplication.
The operands are natural numbers between 0 and 9 (both included).
*/
#include <iostream>
#include <cassert... | true |
a014dcdbaf224a49d95e83402695266c731a4ccb | C++ | Caryn-Walker0114/Pokemon-Battle-Sim | /Game.cpp | UTF-8 | 5,421 | 3.4375 | 3 | [] | no_license | #include "Game.h"
#include "Pokemon.h"
#include <iostream>
#include <string>
#include <thread>
#include <chrono>
#include <random>
#include <ctime>
Game::Game()
{
//ctor
}
Game::~Game()
{
//dtor
}
//------------------------------------GAME FUNCTION----------------------------------------... | true |
31bc10b141bfbe463b4cacc9818c110dda8514a6 | C++ | rileynat/Cplusplus | /euler23.cpp | UTF-8 | 825 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int sum_of_divisors( int n ) {
int total = 0;
for ( int i = 1; i < n / 2 + 1; i++ ) {
if ( n % i == 0 ) {
total += i;
}
}
return total;
}
int main () {
vector<bool> bit_vector(28225, true);
vector<int> abundant_nums;
for ( int i = 11; i <... | true |
0bd8bf6d982357668c9233f0088a1ab605c4eaf6 | C++ | atelyshev/vosvideoserver | /VosVideo.Communication/TypeInfoWrapper.cpp | UTF-8 | 1,664 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include <cassert>
#include "TypeInfoWrapper.h"
using vosvideo::communication::TypeInfoWrapper;
TypeInfoWrapper::TypeInfoWrapper()
{
class Nil {};
tInfo_ = &typeid(Nil);
assert(tInfo_);
}
TypeInfoWrapper::TypeInfoWrapper(const std::type_info& tInfo) : tInfo_(&tInfo)
{
assert(t... | true |
c3b1705d6856d19f435d8739bf591053d94c9fe7 | C++ | rpuntaie/c-examples | /cpp/types_is_signed.cpp | UTF-8 | 919 | 2.984375 | 3 | [
"MIT"
] | permissive | /*
g++ --std=c++20 -pthread -o ../_build/cpp/types_is_signed.exe ./cpp/types_is_signed.cpp && (cd ../_build/cpp/;./types_is_signed.exe)
https://en.cppreference.com/w/cpp/types/is_signed
*/
#include <iostream>
#include <type_traits>
class A {};
enum B : int {};
enum class C : int {};
int main()
{
std::cout << std::... | true |
0a9ae432e6a68be9d494278aaf13707d7b3e6d85 | C++ | LRLauriane/Projets | /Simulateur de système de carburant d'un avion/hh/entrainement.hh | UTF-8 | 661 | 2.953125 | 3 | [] | no_license | #ifndef _ENTRAINEMENT_HH_
#define _ENTRAINEMENT_HH_
#include "systeme.hh"
#include "dessiner_systeme.hh"
#include <iostream>
using namespace std;
class entrainement
{
private:
/*Système*/
systeme * sys;
/*Représentation du système*/
dessiner_systeme * draw_sys;
public:
/*Constructeur*/
... | true |
2cf4de79efa1c4e74949b1f18da6d03a4b7d8728 | C++ | arcticpi/fibonacci | /fibonacci.cpp | UTF-8 | 549 | 3.859375 | 4 | [] | no_license | #include <iostream>
using namespace std;
int fibonacci(int n)
{
if (n < 0)
{
return 0;
}
else if (n == 1)
{
return 1;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
int main(int argc, char* argv[])
{
if (argc < 2)
{
std::cout << "usage : fibonacci.exe <numb... | true |
0dcc11ba0d86b533368d10db176d028ef54f6d5d | C++ | ryanbennettvoid/quad-tree-cpp | /qt-server/src/Misc/Helpers.h | UTF-8 | 467 | 3 | 3 | [] | no_license | #ifndef HELPERS_H
#define HELPERS_H
#include <iostream>
#include <random>
namespace Helpers
{
// https://stackoverflow.com/questions/7560114/random-number-c-in-some-range
static int generateRandomNumberInRange( int a, int b )
{
std::random_device rd; // obtain a random number from hardware
std::mt19937... | true |
074919de6fa439c3200e156211fe9cd7613687bb | C++ | DevelopersGuild/flappybird | /Source/Arrows.cpp | UTF-8 | 927 | 2.75 | 3 | [] | no_license | #include "Arrows.h"
#include "Assets.h"
#include "Constants.h"
#include "Score.h"
#include <cmath>
#include <iostream>
using namespace std;
Arrows::Arrows()
{
arrowOffTexture.loadFromFile(GetAssetPath("Assets/ArrowOff.png"));
arrowOffSprite.setTexture(arrowOffTexture);
arrowOffSprite.setScale(1.5, 1.5);
arrowOffS... | true |
fd28f3adc4af5b5d883787cc75ba19252e114028 | C++ | Biggamer11/Nova | /Game.cpp | UTF-8 | 996 | 2.53125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Game.cpp
* Author: jake
*
* Created on May 17, 2019, 9:32 PM
*/
#include "Game.h"
Game::Game() {
}
Game::Game(c... | true |
a8fd74c289595e01e73d687eb216e96fcc2741e9 | C++ | Chuncheonian/DataStructure | /Lab/Lab08/src/Application.cpp | UTF-8 | 31,721 | 3.1875 | 3 | [] | no_license | #include "Application.h"
// Program driver.
void Application::Run() {
while(1) {
m_command = GetCommand();
switch(m_command) {
case 1: // Add new record into masterList.
AddContents();
break;
case 2: // Get a createTime from keyboard and delete the rocord with same create Time.
DeleteContents();
... | true |
a3daa0a69a67196ce44de2cf169ef99bf966a0c8 | C++ | SirAbsolute0/EDL-Coding-Team-24 | /EDLPart1.cpp | UTF-8 | 525 | 2.5625 | 3 | [] | no_license | #include "EDLPart1.h"
double Aeroshell_A(double Aeroshell_r)
{
return ( M_PI * pow(Aeroshell_r,2) );
}
double Mass()
{
return ( M_Rover + M_EDL + M_Lander + M_Aeroshell );
}
double Temp(double Altitude)
{
if (Altitude >= 7000)
{
return( -23.4 - .00222 * Altitude );
}
else
{
return (-31 - .00998 * Altitude... | true |
3f216ed016983a45fec19ef87aefc7e3a0e53819 | C++ | Mishin870/MHSCpp | /mhscript/commands/ScriptBlock.cpp | UTF-8 | 1,306 | 2.609375 | 3 | [
"MIT"
] | permissive | //
// Created by Mishin870 on 28.07.2018.
//
#include "ScriptBlock.h"
#include "../engine/ScriptLoader.h"
#include "ScriptUtils.h"
ScriptBlock::ScriptBlock(Stream *stream) {
this->commands = loadBlock(stream, this->commandsCount);
this->isRoot = stream->readByte() == 1;
if (this->isRoot) {
this->functionsCount =... | true |
34c9da5d6c97d900614bec7e761205493602d3c6 | C++ | anlijiu/node-can | /src/can/can.h | UTF-8 | 1,748 | 2.953125 | 3 | [
"MIT"
] | permissive | #ifndef CAN_CAN_H
#define CAN_CAN_H
#define CAN_MAX_DLEN 8
#include <iostream>
#include <cstring>
namespace can {
/**
* struct can_frame - basic CAN frame structure
* @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
* @can_dlc: frame payload length in byte (0 .. 8) aka data length code... | true |
4cce35f2bc8fc6584ea7dd719875e4e143eddeb9 | C++ | spfrood/CPP-references | /Chapters/Assignment_2/Gaddis_8thEd_Chap3_Prob8_Widgets/main.cpp | UTF-8 | 1,357 | 3.515625 | 4 | [] | no_license |
/*
* File: main.cpp
* Author: Scott Parker
* Created on January 11, 2017
* Purpose: Gaddis, 8thEd, Chapter 3, Problem 8, Widgets
* Calculate the number of widgets on a pallet based on the weight of the
* loaded pallet and the weight of the pallet itself if widgets weigh 12.5
* pounds each
*/
//System Lib... | true |
9951d307bfc5e1d4d0dd3b55b187a1aa036c32da | C++ | Itaperam/Laboratorio-LPI | /Roteiro04/exercise4-03.cpp | UTF-8 | 1,869 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int face = -1;
int qtdLancamentos = 0;
double pcnt1 = 0;
double pcnt2 = 0;
double pcnt3 = 0;
double pcnt4 = 0;
double pcnt5 = 0;
double pcnt6 = 0;
int face1 = 0;
int face2 = 0;
int face3 = 0;
int face4 = 0;
int f... | true |
db29f2c3058c2a009996c084f125138c6c542185 | C++ | PacktPublishing/CPP-Reactive-Programming | /Chapter06/source_code/Streams-master/test/AlgebraTest.cpp | UTF-8 | 7,898 | 3.046875 | 3 | [
"MIT"
] | permissive | #include <Stream.h>
#include <gmock/gmock.h>
using namespace testing;
using namespace stream;
using namespace stream::op;
// Arithmetic operators
TEST(AlgebraTest, Negate) {
EXPECT_THAT(-MakeStream::from({1, 2, 3}) | to_vector(),
ElementsAre(-1, -2, -3));
}
TEST(AlgebraTest, Addition) {
EXP... | true |
a2a66ff417d2aab3f9f0b549c8d742f951f4155b | C++ | ldcduc/CS202 | /Week_5/ex01/function.h | UTF-8 | 1,184 | 3.0625 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
using namespace std;
class Staff{
private:
int type;
protected:
string name;
static int base_salary, paper_support, project_salary;
double salary = 0;
public:
virtual void print() = 0;
virtual void ... | true |
920a240d912fc9d1ec134d29bea782433570c035 | C++ | aparvizi/parking | /Sensors/Parking_Sensor.ino | UTF-8 | 3,115 | 2.78125 | 3 | [] | no_license | /*
An Arduino code example for interfacing with the HMC5883
by: Jordan McConnell
SparkFun Electronics
created on: 6/30/11
license: OSHW 1.0, http://freedomdefined.org/OSHW
Analog input 4 I2C SDA
Analog input 5 I2C SCL
*/
const float ALPHA = 0.2;
const float BASELINE_ALPHA = 0.001;
//const int THRESHOLD = 10; //or... | true |
30b2878fa27e0984fb6aa966335f1f50b6ac0664 | C++ | SVBoyadzhieva18/TheGods | /Application/Aqua/presentation.cpp | UTF-8 | 7,216 | 3.28125 | 3 | [] | no_license | <<<<<<< HEAD:Application/Aqua/Aqua/presentation.cpp
#include "presentation.h"
#include <iostream>
using namespace std;
void showDolphin(DOLPHINS dolphin, DATE date)
{
cout << endl;
cout << "Sea station: " << dolphin.seaStation << endl;
cout << "Dolphin Type: " << dolphin.dolphinType << endl;
cout << "Chip Number: ... | true |
32515057602c93bb9a14b898485816c751ce26db | C++ | matheusbg8/SonarGraph | /trunk/SonarGaussian/CSVReader/CSVData.cpp | UTF-8 | 3,329 | 3.015625 | 3 | [] | no_license | #include <CSVReader/CSVData.h>
#include <string>
CSVData::CSVData():
m_currentMsgID(0u)
{
}
CSVData::~CSVData()
{
clearMsgs();
}
unsigned CSVData::fieldCount()
{
return m_types.size();
}
unsigned CSVData::msgCount()
{
return m_values.size();
}
CSV_TYPE CSVData::fieldType(unsigned fieldID)
{
if... | true |
51109f17849e34d2007a1ceb4d79f499a4a8795e | C++ | douglasbravimbraga/programming-contests | /UVa Online Judge/10264 - The Most Potent Corner/main.cpp | UTF-8 | 594 | 2.78125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
vector<int> v;
for (int i = 0; i < pow(2, n); i++) {
int num;
cin >> num;
v.push_back(num);
}
vector<int> potent;
for (int i = 0; i < pow(2, n); i++) {
int pot = 0;
for (int j = 0; j < n; j++) {
pot... | true |
7429bc54e528e7f76336966957d0bdc6ccb83347 | C++ | maidoufu/sim_path_planner | /src/StateGrid.h | UTF-8 | 1,396 | 2.640625 | 3 | [] | no_license | #ifndef STATEGRID_H
#define STATEGRID_H
#include <boost/unordered_map.hpp>
#include "Grid2D.h"
#include "State.h"
#include "OrientationLUT.h"
class StateCell
{
public:
StateCell()
{
}
void insert(const StatePtr& s)
{
m_stateVector.push_back(s);
}
bool find(const StatePtr& s) c... | true |
7c0c4cd7c8c4e80582261d4dd475108538347888 | C++ | ft-yjh/c- | /c++7/c++7/Point.cpp | GB18030 | 214 | 2.5625 | 3 | [] | no_license | #include"point.h"
//x
void Point:: set_x (int x)
{
m_x = x;
}
//ȡx
int Point:: get_x()
{
return m_x;
}
//y
void Point:: set_y(int y)
{
m_y = y;
}
//ȡy
int Point:: get_y()
{
return m_y;
}
| true |