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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
26b9487a1dbd9351c94211faabf37e5456f37493 | C++ | azimmomin/Fluid_Simulation | /scene.h | UTF-8 | 746 | 2.59375 | 3 | [] | no_license | #ifndef SCENE_H
#define SCENE_H
#include "grid.h"
#include "Renderer.hpp"
#include "particle.h"
#include "simulator.h"
#include "source.h"
#include "object.h"
#include "point.h"
#include <string>
#include <vector>
class Scene {
public:
vector<Object> objects;
vector<Particle> particles;
vector<Source*> sources;
G... | true |
032a3f711da18c3848b58a5f23b00774386a8069 | C++ | tudautroccuto741/Castlevania | /Castlevania/Items.cpp | UTF-8 | 1,152 | 3.21875 | 3 | [] | no_license | #include "Items.h"
#include "debug.h"
CItems * CItems::__instance = NULL;
// Add the corresponding item with the item name
void CItems::Add(int itemName, LPGAMEOBJECT item)
{
items[itemName].push_back(item);
}
// Check if the object is holding item, drop it if has
void CItems::CheckAndDrop(LPGAMEOBJECT object)
{
... | true |
2373fdf01460cb9cd668b06789224a88d3301a7a | C++ | seesealonely/leetcode | /sort/2512.RewardTopKStudents.cc | UTF-8 | 3,844 | 3.359375 | 3 | [] | no_license | /*
You are given two string arrays positive_feedback and negative_feedback, containing the words denoting positive and negative feedback, respectively. Note that no word is both positive and negative.
Initially every student has 0 points. Each positive word in a feedback report increases the points of a student ... | true |
456aab74479a1507aa82e02c72a55df6f3215390 | C++ | Bur0k/D45az | /Client/Unit.h | UTF-8 | 1,079 | 2.625 | 3 | [] | no_license | #ifndef UNIT_H
#define UNIT_H
#include <SFML\Graphics.hpp>
#include "IDrawable.h"
#include "IClickable.h"
#include "graphic_globals.h"
//#define UNIT_WIDTH 60
//#define UNIT_HEIGHT 90
static const float UNIT_WIDTH = 60.0f;
static const float UNIT_HEIGHT = 90.0f;
using namespace sf;
enum class UnitStrategy{DEFENSI... | true |
0788301305937cfb9b01a256bf1442afcdb22c33 | C++ | AtharvaPanegai/GeeksForGeeksCpp | /Practice/getMin/program.cpp | UTF-8 | 1,722 | 3.703125 | 4 | [] | no_license | #include "bits/stdc++.h"
using namespace std;
struct myStack
{
stack<int> s;
int minEle;
void getMin()
{
if (s.empty())
{
cout << "Stack is Empty";
return;
}
else
{
cout << "The min element is : " << minEle<<"\n";
... | true |
0d13e138aa96317a8cc2b7987c20d4f87e3b35ef | C++ | Gaurav9784/Data-Structures | /Graph/BFS.cpp | UTF-8 | 423 | 3.03125 | 3 | [] | no_license | vector <int> bfs(vector<int> g[], int N) {
queue<int> q;
q.push(0);
bool visited[N]={false};
vector<int> ans;
while(!q.empty()){
int t=q.front();
q.pop();
ans.push_back(t);
for(int i=0;i<g[t].size();i++){
if(visited[g[t][i]]==false){
v... | true |
96ca046ee17e130570db1777ec09ff6edee9eff6 | C++ | am-lola/lepp3 | /src/lepp3/obstacles/object_approximator/split/CompositeSplitStrategy.cpp | UTF-8 | 686 | 2.71875 | 3 | [
"MIT"
] | permissive | #include "CompositeSplitStrategy.hpp"
bool lepp::CompositeSplitStrategy::shouldSplit(int split_depth, const PointCloudConstPtr& point_cloud) {
size_t const sz = conditions_.size();
if (sz == 0) {
// If there are no conditions, do not split the object, in order to avoid
// perpetually splitting it, since th... | true |
8fb7216b5009af2a562bcd112d00c237260aa18d | C++ | KriszAime/Neuro2 | /Neuro2/NeuroNetwork.cpp | UTF-8 | 4,489 | 2.546875 | 3 | [] | no_license | #include "NeuroNetwork.h"
#include <iostream>
NeuralNet::NeuralNetwork::NeuralNetwork(NeuralImportData* TrainingData, int HiddenCount)
{
Memory = new NeuralMemory[TrainingData->PatternCount];
//- Output Weights
Memory->WeightHO = new double* [HiddenCount];
for (int i = 0; i < HiddenCount; i++)
Memory->WeightHO[i... | true |
50c65bcb74e01af4570589ba3297bb1912a37b22 | C++ | KevinLimon/Actividad_16 | /main.cpp | UTF-8 | 2,538 | 3.625 | 4 | [] | no_license | #include<iostream>
#include"laboratorio.h"
using namespace std;
int main(){
Laboratorio k;
string opcion;
while (true)
{
cout<<"1) Agregar computadora"<<endl;
cout<<"2) Mostrar computadoras"<<endl;
cout<<"3) Respaldar"<<endl;
cout<<"4) Recuperar"<<endl;
cout<<"5... | true |
421bce758cb230761584eb8c4cbe8ea596b007c3 | C++ | som-thing/CPP-lessons | /GuessGame/main.cpp | UTF-8 | 889 | 3.046875 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "helper.h"
/* UwU */
int main(int argc, char** argv)
{
cout << "Hello, guess for digits\n";
int randomDigits[4];
for(int i = 0; i < 4; i++) {
bool result = true;
int chich;
while (result==true){
chich = randint();
result = proverka(randomDig... | true |
5d2ee17cc10a99c025c5912397fc320447d6b9d6 | C++ | Zakatos/Component-Game-Engine | /Minigin/ThreadManager.h | UTF-8 | 316 | 2.765625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Singleton.h"
#include "ThreadRaii.h"
#include <memory>
#include <vector>
class ThreadManager : public Singleton<ThreadManager>
{
public:
void AddThread(std::shared_ptr<ThreadRaii> thread)
{
m_Threads.push_back(thread);
}
private:
std::vector<std::shared_ptr<ThreadRaii>> m_Threads;
};
| true |
afb64e4e80d6287bb1e5745466f7cf665c3b1246 | C++ | melkiorr/prolaz | /Source10.cpp | UTF-8 | 649 | 3.109375 | 3 | [] | no_license | // U ovom zadatku smo trebali napraviti txt file s nekim brojevima i iz tih brojeva izvuc parne i neparne i zapisati ih u svoje filove.
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
ifstream in("brojevi.txt");
ofstream parni("parni.txt");
ofstream neparni("... | true |
265ca7a7aa9fdf51bb29f8ea5d470ccf88eb27a0 | C++ | gammasoft71/xtd | /tests/xtd.core.unit_tests/src/xtd/tests/generic_stream_output_tests.cpp | UTF-8 | 8,206 | 2.84375 | 3 | [
"MIT"
] | permissive | #include <xtd/console.h>
#include <xtd/tunit/assert.h>
#include <xtd/tunit/string_assert.h>
#include <xtd/tunit/test_class_attribute.h>
#include <xtd/tunit/test_method_attribute.h>
using namespace std;
using namespace xtd;
using namespace xtd::tunit;
namespace xtd::tests {
class test_class_(generic_stream_output_te... | true |
e8156a85eb6cec27cc5624ea21463a207bee205d | C++ | aametwally/MC_MicroSimilarities | /src/include/LUT.hpp | UTF-8 | 1,554 | 2.875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | //
// Created by asem on 04/12/18.
//
#ifndef MARKOVIAN_FEATURES_LUT_HPP
#define MARKOVIAN_FEATURES_LUT_HPP
#include "common.hpp"
template<typename K, typename V>
class LUT
{
static_assert( std::numeric_limits<K>::is_integer, "T must be of integer type." );
static constexpr auto LOWEST = std::numeric_limits... | true |
9ec639bd7c80e1a223d085606a6011449c1a62cc | C++ | janmarthedal/kanooth-numbers | /kanooth/numbers/generate_random_bits_number.hpp | UTF-8 | 1,794 | 2.875 | 3 | [
"BSL-1.0"
] | permissive | #ifndef KANOOTH_NUMBERS_GENERATE_RANDOM_BITS_NUMBER_HPP
#define KANOOTH_NUMBERS_GENERATE_RANDOM_BITS_NUMBER_HPP
#include <kanooth/make_unsigned.hpp>
#include <kanooth/numbers/integer_binary_logarithm.hpp>
namespace kanooth {
namespace numbers {
namespace {
template <typename T>
typename make_unsigned<T>::typ... | true |
6164dc18c7a0ad9eccb848c14443533aaf806c79 | C++ | CalebMueller/Light_Stick_Firmware_3 | /src/PowerManagement.cpp | UTF-8 | 2,175 | 3.21875 | 3 | [] | no_license | #include "PowerManagement.h"
#define LED_EN_PIN GPIO_NUM_14
#define MPU_EN_PIN GPIO_NUM_33
// PowerRail instantiations
PowerRail led_rail(LED_EN_PIN, false);
PowerRail mpu_rail(MPU_EN_PIN, false);
//////////////////////////////////////////////
// FUNCTION DEFINITIONS
void PowerRail::setup() {
pinMode(_enPin, OUTP... | true |
f6858e11f21317e2060fc6b8f19c01fe1aaa6f38 | C++ | JensD1/Space_Invaders | /Main_Classes/main.cpp | UTF-8 | 523 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include "../Abstract/AFactory.h"
#include "../SDL/SdlFactory.h"
#include "Game.h"
/**
* The main method. Here we will create an abstract factory that will actually contain an SDL factory.
*/
int main(int argc, char* args[]) {
std::cout << "Begin" << std::endl;
SI::AFactory* aFactory = ne... | true |
d4cbfb2d7dd135b54a11605a86d033d06150f08a | C++ | BehaviorTree/BehaviorTree.CPP | /tests/gtest_ports.cpp | UTF-8 | 8,289 | 2.8125 | 3 | [
"MIT"
] | permissive | #include <gtest/gtest.h>
#include "behaviortree_cpp/bt_factory.h"
using namespace BT;
class NodeWithPorts : public SyncActionNode
{
public:
NodeWithPorts(const std::string& name, const NodeConfig& config) :
SyncActionNode(name, config)
{
std::cout << "ctor" << std::endl;
}
NodeStatus tick() override
... | true |
ac681a9b09211c9071dd1a211e2a7bf2d3cc7a98 | C++ | SankalpMe/cs101project | /GameObjects/MO/MovingObject.cpp | UTF-8 | 1,560 | 2.65625 | 3 | [] | no_license |
#include <simplecpp>
#include "MovingObject.h"
void MovingObject::nextStep(double t) {
// check if parented
if (parent != nullptr) {
// running parented mode updated i.e move acc. to parent child
position = parent->getPosition() + parentOffset;
velocity = parent->getVelocity();
... | true |
40db7d2d3084a06ead344ac3a8934bdaeda83fab | C++ | wwwwodddd/Zukunft | /luogu/P4281.cpp | UTF-8 | 1,392 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void read(int&x)
{
char ch;
while((ch=getchar())&&(ch<'0'||ch>'9'));
x=ch-'0';
while((ch=getchar())&&ch>='0'&&ch<='9')
x=x*10+ch-'0';
}
int n, m;
int f[500020][20];
int d[500020];
struct Edge {
int next;
int to;
} e[1000020];
int h[500020], tot;
void add(int x, in... | true |
9bda566de96bac3b62f593ff65ecc281ca56dbe4 | C++ | IraShinking/CPP-Programming-Homework | /Lab4_3/Point.h | UTF-8 | 284 | 2.75 | 3 | [] | no_license | //Point.h
#ifndef _POINT_H_
#define _POINT_H_
class Point
{
public:
Point();
Point(float xx, float yy);
Point(Point &p);
void setPoint(float xx, float yy);
void showPoint();
float calculate_distance(Point p1);
private:
float x, y;
};
#endif//_POINT_H_
| true |
2364ff658173b05f5a3034fa5da47950e27c5418 | C++ | junseublim/Algorithm-study | /baekjoon/1967.cpp | UTF-8 | 765 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
vector<pii> edges[10001];
int visited[10001];
int furthest;
int dist = -1;
void dfs(int x, int d) {
if (visited[x] != -1) return;
visited[x] = 1;
if (d > dist) {
furthest = x;
dist = d;
}
for (int i =0; i<edge... | true |
e1c16abd75e59ff47217333581f8e22ce3d235b8 | C++ | MoonPresident/PowerGrid | /src/games/opengl_examples/CameraExample.h | UTF-8 | 8,807 | 2.609375 | 3 | [] | no_license | #ifndef CAMERAEXAMPLE_H
#define CAMERAEXAMPLE_H
#include "WorldData.h"
bool exampleFirstMouse;
float lastX = 400, lastY = 300;
float yaw = -90.0f;
float pitch = 0.f;
float fov = 45.f;
float deltaTime = 0.0f; // time between current frame and last frame
float lastFrame = 0.0f;
glm::vec3 cameraPos = glm::vec3(0.0f... | true |
c5406090d82a22846460218de918ca5b0bd7a8d0 | C++ | Tracy-Han/Cplusplus | /objLoaderSimple/primitives/shapeGenerator.cpp | UTF-8 | 4,478 | 2.984375 | 3 | [] | no_license | #include "shapeGenerator.h"
#include "vertex.h"
#include <iostream>
#define NUM_ARRAY_ELEMENTS(a) sizeof(a) / sizeof(*a)
using glm::vec3;
shapeData shapeGenerator::makeTriangles()
{
shapeData Triangle;
Vertex triVerts[] =
{
glm::vec3(-1.0f, -1.0f, +0.0f),
glm::vec3(+0.0f, +1.0f, +0.0f),
glm::vec3(+0.0f, +0.0... | true |
f13440f492186a02d6421baf7a677bf1708887a8 | C++ | ja754969/Cplusplus-Programming | /上課檔案/課本範例檔/chapter 07_陣列/範例7-24.cpp | BIG5 | 424 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
string str;
float digit;
cout << "Jr:" ;
cin >> str ;
digit=atof(str.c_str()) ;
//str.c_str() : NstringArꪫܼstr
//ഫcharAr}C`
cout << "\"" << str << '\"'
<< "eBIƭȬ" << digit << '\n' ;
system("PAUSE... | true |
20529cd2041f2e08cbdd82c52bdb6dcf0d7dc8a7 | C++ | vanpana/LMDB | /common/array.h | UTF-8 | 1,453 | 3.703125 | 4 | [] | no_license | #ifndef ARRAY_H
#define ARRAY_H
#include <string>
using namespace std;
template <class T>
class DynArr{
T* array;
int capacity;
int length;
public:
//default constructor
DynArr();
//constructor with parameters
DynArr(int cap);
//copy constructor
DynArr(const DynArr<T>& other)... | true |
0646859ace2f08b2a240df5b8fbb31cec6b21f33 | C++ | m-krivov/MiCoSi | /Sources/Libs/Mitosis.API/Objects/ManagedChromosomePair.h | UTF-8 | 1,435 | 2.71875 | 3 | [
"MIT"
] | permissive |
#pragma once
#include "Mitosis.Objects/ChromosomePair.h"
#include "ManagedChromosome.h"
#include "ManagedSpring.h"
#include "IObjectWithID.h"
#include "MappedObjects.h"
namespace Mitosis
{
public ref class ChromosomePair : public IObjectWithID
{
private:
::ChromosomePair *_pair;
Spring ^_spring;
... | true |
debb3fd1421a74e8afb1d8d628c275eb0d38c3f4 | C++ | liiamarl/alphabetise | /static_exchange.cpp | UTF-8 | 7,837 | 2.53125 | 3 | [] | no_license | #include "bit_function.hpp"
#include <iostream>
#include "structs.hpp"
#include "chessboard.hpp"
#include <array>
#include <vector>
#include <cmath>
#include <algorithm>
#include <bitset>
//static exchange evaluation
//first functions are used in the main one
//checks if a sliding piece might capture the target s... | true |
8629227dbc523556a4549999db5087de088fefec | C++ | lmatsuki/LEM-Engine | /LEM Engine/src/DefaultImageOrder.h | UTF-8 | 253 | 2.59375 | 3 | [] | no_license | #pragma once
// Specify the z-order for when the image is rendered.
// Made explicitly as old-style enum to keep the implicit conversion to int.
namespace ImageOrder
{
enum DefaultImageOrder
{
Background,
Static,
Dynamic,
GUI,
Camera,
};
} | true |
77ab2865e27903bed166c6df790b1086eafac5d3 | C++ | masdelmon/openFrameworksApp13 | /src/Enemy.h | UTF-8 | 670 | 2.703125 | 3 | [] | no_license | #pragma once
#ifndef _ENEMY // if this class hasn't been defined, the program can define it
#define _ENEMY // by using this if statement you prevent the class to be called more than once which would confuse the compiler
#include "ofMain.h" // we need to include this to have a reference to the openFrameworks framew... | true |
163a984d65cb4568551c5fe214c29f844cf2d06d | C++ | jteixeira00/EA-1 | /Trabalho1.cpp | UTF-8 | 11,208 | 3.015625 | 3 | [] | no_license | //g++ -std=c++17 -Wall -Wextra -O2 "Trabalho1.cpp" -lm
#include <iostream>
#include <unordered_map>
#include <list>
#include <algorithm>
#include <vector>
using namespace std;
int min_moves;
int maxSlides;
void MergeCompress(vector<vector<int>>, int, int, vector<vector<int>>);
void checkSolved(vector<vector<int>> &... | true |
bb80b5a306624a0852c8347565bef9a7366eebf7 | C++ | jellyr/2dFluidSimulation | /2dFluidSimulation/util/ExtrapolateField.h | UTF-8 | 3,822 | 2.921875 | 3 | [] | no_license | #pragma once
#include <queue>
#include "VectorGrid.h"
///////////////////////////////////
//
// ExtrapolateField.h/cpp
// Ryan Goldade 2016
//
// Extrapolates field from the boundary
// of a mask outward based on a simple
// BFS flood fill approach. Values
// are averaged from FINISHED neighbours.
// Note that because... | true |
b2f0085649cf215a459d5cac5ff165b6e20ff00a | C++ | asdacap/agvc | /arduino/machine/states.h | UTF-8 | 1,415 | 2.734375 | 3 | [
"MIT"
] | permissive | #include "ConnectionManager.h"
#include "debounce.h"
#ifndef STATES
#define STATES
namespace States{
bool outOfCircuit = false;
Debounce<String> outOfCircuitDebouncer(ConnectionManager::sendData, 10000);
void sendOutOfCircuitStatus(){
if(outOfCircuit){
outOfCircuitDebouncer.call("outOfCircuit:1", 2);... | true |
1ed489adbf9d24229d59e3afd00c11a337fc2a45 | C++ | Muff1nz/ParticleStorm | /ParticleStorm/EventEngine.cpp | UTF-8 | 2,878 | 2.671875 | 3 | [] | no_license | #include "EventEngine.h"
#include "Queue.h"
Queue<double> EventEngine::scrollEvents{};
EventEngine::EventEngine(MessageSystem* messageQueue) {
window = nullptr;
this->messageQueue = messageQueue;
}
EventEngine::~EventEngine() = default;
void EventEngine::Init(GLFWwindow* window) {
this->window = window;
glfwSet... | true |
556d5361a78600f48a61f5839124422d153296e0 | C++ | jhstjh/StenGine | /StenGine/include/Graphics/Animation/Animator.h | UTF-8 | 2,164 | 2.75 | 3 | [] | no_license | #pragma once
#include <unordered_map>
#include "Graphics/Animation/Animation.h"
#include "Scene/Component.h"
namespace StenGine
{
class Animation;
class Animator : public Component
{
public:
Animator();
virtual ~Animator();
inline void SetAnimation(Animation* anim)
{
mAnimation = anim;
}
const Mat4 GetTra... | true |
0da595e876ee760314dc365b9abc0be942cb9084 | C++ | palestar/medusa | /File/File.h | UTF-8 | 2,322 | 2.984375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*
File.h
File Abstract class
Concrete versions: FileDisk and FileMemory
(c)2005 Palestar, Richard Lyle
*/
#ifndef FILE_H
#define FILE_H
#include "Standard/Types.h"
#include "Standard/Exception.h"
#include "Standard/Reference.h"
#include "MedusaDll.h"
//---------------------------------------------------------... | true |
a542fefe1ec76ad9c36a28f3d6ff80fd18ab346f | C++ | m0nkeykong/PersonalProjects | /SuperMarket/ICommand.h | UTF-8 | 2,100 | 3.03125 | 3 | [] | no_license | #ifndef ICOMMAND_H
#define ICOMMAND_H
#include <string>
#include <fstream>
#include <iostream>
#include "Database.h"
using namespace std;
class ICommand //this is the command center
{
public:
virtual bool execute() = 0;
};
class ShowAvaillItems : public ICommand //shows all av... | true |
39a5382b38bf3475a85a67b224fb5631b27b705f | C++ | hirasaha-backcountry/Codes | /Min Sum Path in Matrix.cpp | UTF-8 | 1,392 | 3.734375 | 4 | [] | no_license | /*
Problem Description : https://www.interviewbit.com/problems/min-sum-path-in-matrix/
-------------------------------------------------------------------------------------------------------
Given a 2D integer array A of size M x N, you need to find a path from top left to bottom right which minimizes the sum
of all n... | true |
1d4a9daf8dd31aba71d2e0e38bceeeb7946923ad | C++ | Malonyz/lab3 | /lab3_1.cpp | UTF-8 | 206 | 2.578125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int x=2,y;
cout << "Enter y";
cin >> y;
while(x<50){
cout << x << endl;
x=x+y;
}
cout <<"Malony";
return 0;
} | true |
02b6cc6902a349a6ec57d8257aa76ccdea7d74b1 | C++ | VegetableArt/papaya2 | /python/python.hpp | UTF-8 | 2,193 | 2.8125 | 3 | [
"BSL-1.0"
] | permissive | #pragma once
#include <Python.h>
#include <memory>
#include <string>
namespace papaya2 {
namespace python {
struct RefDeccer
{
void operator()(PyObject *ref) { Py_XDECREF(ref); }
};
struct UniquePyPtr : std::unique_ptr<PyObject, RefDeccer>
{
using base_t = std::unique_ptr<PyObject, RefDeccer>;
using bas... | true |
3dbddcea6236bdde9ae287e6858305e6e8e4d457 | C++ | fawkesrobotics/fawkes | /src/libs/fvmodels/shape/circle.cpp | UTF-8 | 3,776 | 2.578125 | 3 | [] | no_license |
/***************************************************************************
* circle.cpp - Implementation of a circle shape finder
*
* Created: Thu May 16 00:00:00 2005
* Copyright 2005 Tim Niemueller [www.niemueller.de]
* Hu Yuxiao <Yuxiao.Hu@rwth-aachen.de>
*
*********************... | true |
e04a4e02417cd62373245423eb3472efdec37d4c | C++ | Chunchunhao/2014_FALL_OOP | /hw1/HW1_dist/1-2-v1.cpp | UTF-8 | 1,377 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include "Sales_item.h"
#include <vector>
#ifdef _WIN32 || WIN32 || defined(_WIN32) || defined(WIN32)
#define OS_Windows
#include <process.h>
// http://msdn.microsoft.com/en-us/library/1kxct8h0.aspx
#else
#include <unistd.h>
#endif
using namespace std;
int main () {
/... | true |
6e3665afea33194810e2120c0b08b041c1d3b63d | C++ | green-fox-academy/marsaltamas | /week-06/TaDaaAppSandbox/fileio.cpp | UTF-8 | 1,448 | 3.125 | 3 | [] | no_license | #include "fileio.h"
void FileIO::write_to_file(vector<Task> *task_vector_pointer)
{
this->task_vector_pointer = task_vector_pointer;
ofstream out_file;
string file_path = "fileToRead.txt";
out_file.open(file_path, ios::out | ios::trunc);
for (unsigned int i = 0; i < task_vector_pointer->size(); +... | true |
642bdcee1dec4d6ac0000fd604c49ab2607f4c83 | C++ | agudeloandres/C_Struct_Files | /C_Tutorships/data_structures_Cplusplus/GRAFOS/P587.CPP | UTF-8 | 2,411 | 2.78125 | 3 | [] | no_license | #include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "alloc.h"
#define MAXIMO 20
#define PR(x) printf ("%s",x)
#define SALTO printf ("\n")
void main() {
int M[MAXIMO][MAXIMO],T[MAXIMO][MAXIMO];
int suma, marcas[MAXIMO],padres[MAXIMO],minimo [MAXIMO];
int nv,i;
void DIJKSTRA (int M[][MAXIMO],int N,in... | true |
34c25f9626b3b5d43242130fb2fd936c91145a66 | C++ | syawalrdn/STRUKTUR-DATA | /Laporan (2)/laporan2.2 (bil.ganjil).cpp | UTF-8 | 248 | 2.78125 | 3 | [] | no_license | #include <iostream>
using namespace std;
main()
{
int a,b;
cout<<"PROGRAM CETAK DERET BILANGAN GANJIL";
cout<<"\nMasukkan Batas Bilangan = "; cin>>b;
cout<<"\nBilangan Genap = ";
for(a=1;a<=b;a++)
if (a%2==1)
cout<<a<<" ";
}
| true |
6ccea51e40611df43a15f83e3355806c654f1369 | C++ | guithin/BOJ | /9663/Main.cpp | UTF-8 | 852 | 2.59375 | 3 | [] | no_license | #include<stdio.h>
int dx[8] = { 0,0,-1,1,1,-1, 1, -1 };
int dy[8] = { 1,-1,0,0,1,-1, -1, 1 };
int map[30][30] = { 0 };
long long cnt = 0;
void dfs(int n, int idx) {
if (idx == n + 1) {
cnt++;
// printf("%d\n", cnt);
return;
}
for (int i = 1; i <= n; i++) {
if (map[idx][i] <0)continue;
map[idx][i] = 1;
... | true |
66ebf1ecf1ee5256f397e346c3a2146dc2493522 | C++ | andr-ec/realEstate | /Real Estate/Farm.cpp | UTF-8 | 1,259 | 3 | 3 | [] | no_license | //
// Farm.cpp
// Real Estate
//
// Created by Apple Mac on 12/8/15.
// Copyright © 2015 Andre Carrera. All rights reserved.
//
#include "Farm.h"
using namespace std;
Farm::Farm( bool rentalIn, double priceIn, int daysIn, string addressIn)
:Property( rentalIn, priceIn, daysIn, addressIn)
{
rate = 0.4;//set... | true |
2452fe3404550c92555bf906de07540a73b1dc5a | C++ | ArutoriaWhite/Competitive-programming | /cf1257b.cpp | UTF-8 | 347 | 2.578125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int T;
cin >> T;
while(T--)
{
int x, y;
cin >> x >> y;
if (x>=4)
cout << "Yes\n";
else if ((x==2||x==3)&&(y<4))
cout << "Yes\n";
else if (x==y)
cout << "Yes\n";
else
cout << "No... | true |
be23520926bb787d510f58edb62b11fa8a4dc58a | C++ | miroslavradojevic/bigneuron | /Advantra/seed.h | UTF-8 | 2,360 | 2.859375 | 3 | [] | no_license | #ifndef SEED_H
#define SEED_H
#include <vector>
using namespace std;
struct Puv { // offset point in 2d cross-section
Puv(int u1, int v1) : u(u1), v(v1) {}
int u, v;
};
struct Puwv { // offset point in 3d cross-section
Puwv(int u1, int w1, int v1) : u(u1), w(w1), v(v1) {}
int u, w, v;
};
struct seed... | true |
18f3c3cac1f658d46e635d1a6cc13e252dff8c33 | C++ | zxczzx/myRPG | /myRPG/ObjectSpawn.h | UTF-8 | 872 | 2.59375 | 3 | [] | no_license | #pragma once
#include "libraries.h"
#include "Filesystem.h"
#include "ItemSlot.h"
class Inventory;
class Abilities;
class Requirements;
class Resistance;
class Player;
class ObjectSpawn
{
public:
ObjectSpawn();
~ObjectSpawn();
std::shared_ptr<Filesystem> filesystem;
typedef std::map<std::stri... | true |
b78c351b20aef67db417f2c896f2faf5a9c7e1cc | C++ | seunghyukcho/algorithm-problems-solved | /baekjoon/previous/2490/main.cpp | UTF-8 | 323 | 2.53125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
for(int i = 0; i < 3; i++){
int num = 0;
for(int j = 0; j < 4; j++){
int n;
cin >> n;
if(!n)num++;
}
if(!num)cout << 'E' << '\n';
else printf("%c\n", 'A' + num - 1);
}
return 0;... | true |
f32d497c10a636c32fcdcd4d5db8ff3b0c9a7af1 | C++ | ibesora/cg-notes-code | /Examples/01_GLFW/src/main.cpp | UTF-8 | 1,673 | 2.921875 | 3 | [
"MIT"
] | permissive | #include <glad/gl.h>
#include <glfw/glfw3.h>
#include <stdio.h>
#include <stdlib.h>
GLFWwindow *createWindow(int majorVersion, int minorVersion, int profile, int width, int height,
const char *title, GLFWmonitor *monitor = nullptr, GLFWwindow *share = nullptr) {
glfwSetErrorCallback(
[](int error, const char *des... | true |
d573b0ca7d1408eda7af2397c82b8f64ed35ea4a | C++ | MathProgrammer/AtCoder | /Contests/Educational DP Contest/Programs/Longest Path.cpp | UTF-8 | 1,128 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
const int MAX_N = 1e5 + 5;
int longest_path[MAX_N];
vector <int> graph[MAX_N];
int dfs(int v)
{
if(longest_path[v] != -1)
{
return longest_path[v] ;
}
int longest_child_path = 0;
for(int i =... | true |
f9edd416aed5203c6cc516d4b0b7feee0ce49519 | C++ | p-freire/CompProg | /URI/1021.cpp | UTF-8 | 968 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#define NUM_COINS 5
#define NUM_BILLS 7
using namespace std;
int main()
{
int bills[] = {100, 50, 20, 10, 5, 2, 1};
int coins[] = {50, 25, 10, 5, 1};
int num_coins[NUM_COINS], num_bills[NUM_BILLS];
double value;
int int_value, cents;
scanf("%lf", &valu... | true |
45478c0261958f72244b0fd3849891413ce7d5e3 | C++ | yougaindra/A2oj_ladder11 | /96a.cpp | UTF-8 | 239 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
if(s.find("1111111") != string::npos || s.find("0000000") != string::npos)
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
} | true |
1462035fe8dec9b15d54124a17e07159d8d88be6 | C++ | L-Elyse/csc17a_2017 | /Project/Project 1/Versions/Project_v3/main.cpp | UTF-8 | 2,925 | 3.53125 | 4 | [] | no_license | /*
* File: main.cpp
* Author: Laurie Guimont
* Created on April 10, 2017, 4:00 PM
* Purpose: War Card Game
*/
//System Libraries
#include <iostream> //Input/Output Stream Library
#include <iomanip> //Formatting Library
#include <ctime> //Unique Seed Value Library
#include <cstdlib> //Random Value Library
... | true |
afe15aa2c127ca98ae75ecd2fafe05dbd53c2c55 | C++ | lzs4073/color | /src/color/hsl/make/tan.hpp | UTF-8 | 1,860 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | #ifndef color_hsl_make_tan
#define color_hsl_make_tan
// ::color::make::tan( c )
namespace color
{
namespace make
{ //RGB equivalents: std::array<double,3>( { 34.2857, 43.75, 68.6275 } ) - rgb(210,180,140) - #d2b48c
inline
void tan( ::color::_internal::model< ::color::category::hsl_uint8 > & co... | true |
18df57ed038eb7c1b97b5eafb1d30306720df571 | C++ | AndrewMar007/Labs | /CPP/cpa_lab_8_2_3_(1)-C.cpp | UTF-8 | 3,489 | 4 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Date {
public:
int day, month, year;
enum weekday { THURSDAY, FRIDAY, SATURDAY, SUNDAY, MONDAY, TUESDAY, WEDNESDAY };
enum month { january = 1, february, march, april, may, june, july, august, september, oktober,november, december };
s... | true |
5d3acc9d4ff78bf8667ba317a258fbf7ce034f35 | C++ | kedixa/LeetCode | /C++/264.cpp | UTF-8 | 456 | 2.859375 | 3 | [] | no_license | class Solution {
public:
int nthUglyNumber(int n) {
if(n < 1) return 0;
vector<long long> vec(n);
vec[0] = 1;
int p2 = 0, p3 = 0, p5 = 0;
for(int i = 1; i < n; ++i) {
vec[i] = min({vec[p2] * 2, vec[p3] * 3, vec[p5] * 5});
if(vec[i] == vec[p2] * 2) ++p2... | true |
3b6dd63212faac679b415f08ee538af4454fa80e | C++ | tonyganchev/cpp-build-tools-playground | /main.cpp | UTF-8 | 938 | 2.703125 | 3 | [] | no_license | #include "server_config.hpp"
#include <iostream>
#include <cpprest/http_listener.h>
#include <cpprest/json.h>
#include <cpprest/asyncrt_utils.h>
#include <cpprest/uri.h>
using namespace web;
using namespace web::http;
using namespace web::http::experimental::listener;
class server {
public:
server(uri endpoint_uri... | true |
b75f76d3169ee091be5b79739d12f4152e2463f4 | C++ | NUbots/NUPresenceClient | /module/visualisation/OculusViewer/src/GameObject.h | UTF-8 | 1,388 | 2.6875 | 3 | [] | no_license |
#include <GL/OOGL.hpp>
#include <string>
#include <vector>
#include <iostream>
#include "RenderMesh.h"
#include <memory>
#ifndef MODULES_VISUALISATION_NUPRESENCE_GAME_OBJECT_H
#define MODULES_VISUALISATION_NUPRESENCE_GAME_OBJECT_H
namespace module {
namespace visualisation {
class GameObject {
public:
std::ve... | true |
48813ca8fb4c52b6cceccf93ac4e7e4c877e0290 | C++ | JeG99/Queue_implementation | /Queue.h | UTF-8 | 1,116 | 3.703125 | 4 | [] | no_license | #include "Node.h"
template <class T>
class Queue {
public:
Queue();
~Queue();
void push(T data);
void pop();
T front();
bool isEmpty();
int size();
private:
Node<T>* tail;
int length;
};
template <class T>
Queue<T>::Queue() {
tail = NULL;
length = 0;
}
template <class T>
Queue<T>::~Queue() {
if(tail !... | true |
50e22369aa23f54673ed6e3f56dab0c6f2c0d5b2 | C++ | ht1204/repo_algoritmos | /c++/practicas varias c++/modelo trabajo/Descomponer Dígitos/Digitos.cpp | UTF-8 | 460 | 2.875 | 3 | [] | no_license | #include <stdio.h>
#define N 19
int main( void )
{
int c, i, n;
int digitos[N];
unsigned long long int num;
printf( "Escribe un numero de %d digitos como maximo: ", N );
fflush( stdout );
num = 0;
for( n = 0; n < N && (c = getchar()) != '\n'; n++ )
{
digitos[n] = c - '0';
num *= ... | true |
f4a0b6acf5b1668ee1d18e4e6a6b4fccfba92701 | C++ | NullStudio/NoNameGame | /src/SCredits.cpp | UTF-8 | 2,688 | 2.890625 | 3 | [] | no_license |
#include "SCredits.hpp"
#include "SMenu.hpp"
SCredits::SCredits(Game* game) :
GameState(game),
mCreditsBG(NULL),
mCredits1(NULL)
{
}
SCredits::~SCredits()
{
}
void SCredits::Init()
{
std::cout << "-- SCredits::Init()" << std::endl;
SetRunningState(true);
mCreditsBG = new sf::Sprite;
m... | true |
0ef364ab0fcdb1a102a659de46e42a48bc747e56 | C++ | andre-b-fernandes/aeda-the-voice | /Competition.cpp | UTF-8 | 1,241 | 2.875 | 3 | [] | no_license | /*
* Competition.cpp
*
* Created on: 31/10/2016
* Author: user
*/
#include "Competition.h"
#include <string>
#include <iostream>
#include <vector>
using namespace std;
/*Competition::Competition(int y){
this->year=y;}
*/
void Competition ::setInitial(vector<Participant*> p)
{
for(unsigned int i = 0; i ... | true |
fdd5e1235f13255f531c4cfb122746499190d419 | C++ | Alexxx111/Voxel | /Grundgerüst/project/Window.cpp | UTF-8 | 556 | 2.921875 | 3 | [] | no_license | #include "Window.h"
Window::Window(int w, int h)
{
this->width = w;
this->height = h;
SDL_Init(SDL_INIT_EVERYTHING);
window = SDL_CreateWindow(".. ", 600, 100, width, height, SDL_WINDOW_OPENGL);
context = SDL_GL_CreateContext(window);
glClearColor(0.f, 0.1f, 0.3f, 1.0f);
}
Window::~Window()
{
SDL_GL_Del... | true |
78b65231d839de53bfad8c00aa21496b3aeaee76 | C++ | silverthreadk/leetcode | /Cpp/1800_Maximum_Ascending_Subarray_Sum.cpp | UTF-8 | 370 | 2.8125 | 3 | [] | no_license | class Solution {
public:
int maxAscendingSum(vector<int>& nums) {
int sum = nums[0];
int result = sum;
for(int i=1; i<nums.size(); ++i) {
if(nums[i] <= nums[i-1]) {
sum = 0;
}
sum += nums[i];
result = max(result, sum);
... | true |
1727b7a39368c1fb80f6e6560d3da7b7b298f2be | C++ | Nasker/RTPLib | /RTPRotaryClick.cpp | UTF-8 | 561 | 2.59375 | 3 | [] | no_license | /*
RTPRotaryClick.cpp - Class for reading and managing a Rotary Encoder with click button.
Created by Oscar Martínez Carmona @ RockinTechProjects, October 6, 2017.
*/
#include "Arduino.h"
#include "RTPRotaryClick.h"
void RTPRotaryClick::callbackOnRotation( void (*userFunc)(String,int) ){
long newPosition = read... | true |
71fde6d8f86b76ede38491e6a9e73bd719081f0b | C++ | pranshu-09/Launchpad-Coding-Blocks | /Binary Tree/20_minimum_distance_between_2_nodes.cpp | UTF-8 | 2,647 | 3.75 | 4 | [] | no_license | #include<iostream>
#include<queue>
#include<stack>
using namespace std;
class node {
public:
int data;
node*left;
node*right;
node(int data) {
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
node*build_tree() {
int d;
cin >> d;
if (d == -1) {
return NULL;
}
node*root = new node(d... | true |
0b964d28cdd3c39005eb5303bee938fef0b2ee51 | C++ | amandasambawa/FrackMan | /StudentWorld.cpp | UTF-8 | 24,339 | 2.875 | 3 | [] | no_license | // Author: Amanda Sambawa
#include "StudentWorld.h"
#include "GameController.h"
#include "Actor.h"
#include <string>
#include <iostream>
#include <iomanip>
#include <random>
#include <math.h>
#include <cstdlib>
#include <ctime>
using namespace std;
GameWorld* createStudentWorld(string assetDir)
{
return new Stude... | true |
0d18195a0e23a6886c5eced7da89ac8129c989d1 | C++ | drmilde/oFWorkShop | /src/RectAngleManager.cpp | UTF-8 | 1,103 | 3 | 3 | [] | no_license | #include "RectAngleManager.h"
RectAngleManager::RectAngleManager() {
// do something useful here
}
RectAngleManager::~RectAngleManager() {
// clean up the pointers
}
void RectAngleManager::addRect(int x, int y, int w, int h) {
rects.push_back(new ofRectangle(x,y,w,h));
}
void RectAngleManager::draw() {
in... | true |
f5619139e206260c2a1378d6e4e90338bb2eac56 | C++ | SoumyaMalgonde/Data-Structures-and-Algorithms | /C++/Data-Structures/Tree/ExpressionTree.cpp | UTF-8 | 1,804 | 4.125 | 4 | [
"MIT"
] | permissive | /*
Given a postfix expression.Your task is to complete the method constructTree().The output of the program will print the infix expression of the given postfix expression.
Approach Used - Create a stack and as you will be traversing the postfix expression , if the expression contains operand , create a node and ins... | true |
fdab5bff7899d8b7aecc784d37acccbb1862ad87 | C++ | ElxFuego/Different_scripts | /Password_Generator/MenuOptions.cpp | UTF-8 | 476 | 3 | 3 | [] | no_license | //szkielet do robienia menu
#include <iostream>
#include <conio.h>
int MenuOptions() {
int choice;
bool state;
std::cout<<"\n1. Generate Passwords"<<std::endl;
std::cout<<"2. Exit"<<std::endl;
do{
choice = getch();
state = true;
switch(choice)
{
case '1':
ret... | true |
93a501498934bf3200bb6d0f46e0b38ee892260b | C++ | razorshultz/SDL2Engine | /SDL2Engine/Player.h | UTF-8 | 1,004 | 2.75 | 3 | [] | no_license | #ifndef PLAYER_H
#define PLAYER_H
#include "Entity.h"
#include <string>
#include "Sound.h"
class Player : public Entity
{
public:
Player();
Player(std::string texfilename, SDL_Renderer* renderer);
Player(std::string texfilename, SDL_Renderer* renderer, float x, float y);
~Player();
void Update(const float& UPDAT... | true |
0f6706f11d8d4afe5873cdb8557bb954a270d5e9 | C++ | ntu6stef/BmpGenerator | /src/bmp.cpp | UTF-8 | 7,595 | 2.90625 | 3 | [] | no_license | #include "bmp.h"
inline INT_32 Palette::GetColor(INT_8 b,INT_8 g,INT_8 r)
{
INT_32 temp=0x00000000;
temp=(temp|(INT_32) b);
temp=(temp<<8|(INT_32) g);
temp=(temp<<8|(INT_32) r);
return temp;
}
inline Palette Palette::GetPalette(INT_32 color)
{
Palette temp(color);
return temp;
}
inline Pal... | true |
727842a3f19dbebdb402aedad05ac64b35334dec | C++ | WZFish/RVD-with-mutithread | /MyMesh.h | UTF-8 | 5,045 | 2.65625 | 3 | [] | no_license | #ifndef _MY_MESH_
#define _MY_MESH_
#include "Mesh\Vertex.h"
#include "Mesh\Edge.h"
#include "Mesh\Face.h"
#include "Mesh\HalfEdge.h"
#include "Mesh\BaseMesh.h"
#include "Mesh\boundary.h"
#include "Mesh\iterators.h"
#include "Parser\parser.h"
#ifndef M_PI
#define M_PI 3.141592653589793238
#endif
... | true |
e1acbda210dafeb908731d47be590f1bb42af24a | C++ | l740416/Arduino-Log | /Log.cpp | UTF-8 | 2,857 | 2.8125 | 3 | [] | no_license |
#include "Arduino.h"
#include <stdarg.h>
#include "Log.h"
Log::Log()
{
memset( buf, '\0', sizeof(buf) );
idx = 0;
m_pHourFunc = NULL;
m_pMinuteFunc = NULL;
m_pSecondFunc = NULL;
m_overridesHeading = false;
m_lastHour = -1;
m_lastMinute = -1;
m_lastSecond = -1;
}
Log::Log(LOG_TIME_FUNC hour_func, LOG_... | true |
de3309ae6d1971cd5611ec59cdd6105e52ba6cf2 | C++ | UFRN-IFRN/IOAC-cache | /include/files.h | UTF-8 | 594 | 2.75 | 3 | [] | no_license | /**
* @file files.h
* @brief Arquivo cabecalho com a definicao de funcoes para leitura do
arquivo com os dados de entrada
* @author Bianca Santiago (bianca.santiago72@gmail.com)
* @since 07/06/2017
* @date 14/06/2017
*/
#ifndef FILES_H
#define FILES_H
#include "cache.h"
#include <iostream>
us... | true |
1d47e158b26ca6df73b386ee59872ac2342b6769 | C++ | rrodriguez125/RodriguezRicardo_CSC5_41202 | /homework/assignment 3/finished folder/Savitch_9thEd_Chap3_ProjectProb 2/main.cpp | UTF-8 | 2,606 | 3.375 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Ricardo Rodriguez
* Created on January 4, 2016, 10:18 AM
* Purpose: solving quadratic equation
*/
//System Libraries
#include <iostream>
#include <cmath>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here
int main(int argc,... | true |
062f3f75c82598d2262a39a2f082508eacce972a | C++ | AnkaChan/MyTestCodes | /PointerVSIndex/main.cpp | UTF-8 | 1,207 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <ctime>
using std::cout;
using std::endl;
using std::vector;
typedef std::vector<int> MyVec;
#define NUM 100000000
#define LOOP 1000
struct WithPointer
{
int * p;
};
struct WithIndex
{
int index;
};
int main(int argc, char** argv) {
MyVec vec(NUM)... | true |
d87d7cdb442dd11f2ad463f10f6cb1827c95a95b | C++ | zhouhesheng/ndisapi | /examples/cpp/dns_proxy/dns_proxy.cpp | UTF-8 | 1,719 | 2.78125 | 3 | [
"MIT"
] | permissive | // dns_proxy.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
void log_printer(const char* log)
{
static std::mutex log_lock; // NOLINT(clang-diagnostic-exit-time-destructors)
std::lock_guard<std::mutex> lock(log_lock);
std::cout << l... | true |
eff72479205c136ffd6c7dcbe4a340938a31bf36 | C++ | Lumingei/Summer | /数组16-不同路径 .cpp | GB18030 | 1,521 | 4.15625 | 4 | [] | no_license | /*ͬ·
һλһ m x n Ͻ ʼͼбΪStart
ÿֻ»ƶһͼﵽ½ǣͼбΪFinish
ܹжͬ·
磬ͼһ7 x 3 жٿܵ·
ʾ1:
: m = 3, n = 2
: 3
:
Ͻǿʼܹ 3 ·Ե½ǡ
1. -> ->
2. -> ->
3. -> ->
*/
int uniquePaths(int m, int n){
int **a=(int **)malloc(sizeof(int*)*m); //̬ά飬öָʵ֣
for(int i=0;i<m;i++){ ... | true |
c0bdda1c07803e2838dbf5276ae4af5d6f024927 | C++ | mkbiltek/WISeID-For-Windows | /FaceSDK/ColourNormalisation.cpp | UTF-8 | 7,885 | 2.671875 | 3 | [] | no_license | #include "ColourNormalisation.h"
CColourNormalisation::CColourNormalisation()
{
}
CColourNormalisation::~CColourNormalisation()
{
}
//Single channel images
//calculate mean of value pixels
float CColourNormalisation::mean(const IplImage *pIplImage)
{
int w = pIplImage->width;
int h = pIplImage->height;
//int ws =... | true |
6548c481a7aadef112f300a5870a7be97c645396 | C++ | PeterZosch/ti2_cpp_projects | /Aufgabe1/src/versions/main_v1.0.cpp | UTF-8 | 3,132 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <cstdlib>
using namespace std;
//Funktionsprototypen
void fileHandling(int);
void tableFunc();
void inlineEdit();
void changeLine();
void insertLine();
void deleteLine();
void searchString();
int main()
{
char key;
int mode=0; //... | true |
8f6769b74efff832f711ce2ed8204f83e408a227 | C++ | siberiy4/comp_prog | /ABC031/second.cpp | UTF-8 | 320 | 2.609375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int L,H;
int N;
cin>>L>>H>>N;
for(int i=0;i<N;++i){
int tmp;
cin>>tmp;
if(L>tmp){
cout<<L-tmp<<endl;
}else if(H<tmp){
cout<<-1<<endl;
}else{
cout<<0<<endl;
}
}
} | true |
9e636936653f2e4c6e495461605aab8b9eaaf29b | C++ | Huvok/Competitive-Programming | /Codeforces/800/869/C. The Intriguing Obsession.cpp | UTF-8 | 2,163 | 2.515625 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <functional>
#include <queue>
#include <bitset>
#include <sstream>
#include <set>
#include <iomanip>
#include <string.h>
#include <unordered_map>
#inc... | true |
67563aa86f15e1d6004d07b90b7681fda38313f1 | C++ | zinsmatt/test-Neural-Net | /Neural_Networks/hiddenlayer.h | UTF-8 | 462 | 2.65625 | 3 | [] | no_license | #ifndef HIDDENLAYER_H
#define HIDDENLAYER_H
#include "layer.h"
class HiddenLayer : public Layer
{
public:
HiddenLayer(NeuralNet* _neuralNet, int numberofneurons, ActivationFunction fnc, int numberofinputs);
/**
* @brief setPreviousLayer
* @param prev
*/
virtual void setPreviousLayer(Layer* ... | true |
5175b014c080fe4d8cbe59c60faaf4f3422995fa | C++ | JFengWu/Cpp-homework | /cpp-homework3/Q112/Source.cpp | UTF-8 | 1,526 | 3.65625 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Operation {
private:
double NumberA;
double NumberB;
public:
virtual double GetResult() {
return 0;
};
double getA() {
return NumberA;
}
void setA(double _NumberA) {
NumberA = _NumberA;
}
double getB() {
return NumberB;
}
void setB(double _NumberB) {
... | true |
e7e9d6f2eab8a0d72c3da574a8e68e8b3de2353f | C++ | ClysmiC/RTWeekend | /src/main.h | UTF-8 | 5,623 | 2.53125 | 3 | [] | no_license | #pragma once
#include "als/als.h"
#include <ostream>
struct IHittable;
struct IMaterial;
struct BvhNode;
enum KZERO
{
kZero
};
struct Vector3
{
union
{
struct
{
float x;
float y;
float z;
};
float elements[3];
... | true |
888c1e565b6d1dbb03f6a3456ee91f22c1e1e480 | C++ | Coolxer/Logomotive-X | /Logomotive/CmdManager.cpp | UTF-8 | 930 | 2.953125 | 3 | [] | no_license | #include "stdafx.h"
#include "CmdManager.h"
CmdManager::CmdManager()
{
}
void CmdManager::checkCommand()
{
isGood = true;
if (command == "exit")
onExit();
else if (command == "help")
onHelp();
else if (command == "a")
std::cout<<"a";
else if (command == "b")
std::cout << "b";
else if (command == "c")
... | true |
23a2ac8b64d3a20fc3c15909e54a932574438b5a | C++ | amahi2001/335-project-4 | /spell_check.cc | UTF-8 | 5,135 | 3.46875 | 3 | [] | no_license | // Abrar Mahi.
#include "quadratic_probing.h"
#include "linear_probing.h"
#include "double_hashing.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int testSpellingWrapper(int argument_count, char **argument_list)
{
const string document_filename(argument_list[1]);
const string... | true |
5821ae36893633354fdc0ec3992be326bda779d3 | C++ | jharshman/minor3 | /main.cpp | UTF-8 | 1,290 | 2.921875 | 3 | [] | no_license | /**
* main.cpp
* written by Joshua Harshman
* 08/08/15
* */
#include <iostream>
#include <fstream>
#include "Truck.h"
#include "PackageFactory.h"
using namespace std;
int main() {
fstream infile;
infile.open("/home/voodoo/ClionProjects/minor3-5/manifest.txt", ios::in);
string driver_name;
string... | true |
094d21eb518997a81009fee6147d01b17ec7fd72 | C++ | zzaassaa2/MazeRunner | /src/engine/Utility.cpp | UTF-8 | 683 | 2.8125 | 3 | [
"MIT"
] | permissive | //
// Created by George Zorn on 3/16/21.
//
#include "engine/Utility.h"
bool mz::isIntersecting(glm::vec3 p1, glm::vec3 p2, glm::vec3 q1, glm::vec3 q2){
return (((q1.x-p1.x)*(p2.y-p1.y) - (q1.y-p1.y)*(p2.x-p1.x))
* ((q2.x-p1.x)*(p2.y-p1.y) - (q2.y-p1.y)*(p2.x-p1.x)) < 0)
&&
(((p1... | true |
15ee034eaa84ca29298850ad1153fa11d2320084 | C++ | ManuWer/INF-450 | /Trabalho 2/Parte II/compilador/200_cat1.cpp | UTF-8 | 4,635 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <unordered_map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
// mapeia uma string de estado do jogo em uma sequencia de
// movimentos de como chegar neste estado
unordered_map<string,string> m;
// os movimentos verticais ... | true |
b78748cbc99a320b89aa5f6bb1c8be1264d1aae8 | C++ | hardikdosi/Spoj | /CPRMT-12151415-src.cpp | UTF-8 | 893 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
using namespace std;
int main()
{
char str1[10050], str2[10050];
int a[130], b[130];
while (scanf("%s\n%s", str1, str2) != EOF) {
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
int tmp;
for (int... | true |
0b9228c53a3693021ff6e621979f5fea68be8c3f | C++ | ocslegna/algo3 | /TP2/Ej1/ej1.cpp | UTF-8 | 6,105 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <time.h>
#include <vector>
#include <string>
#include <cassert>
#include <cstdlib> // atoi
using namespace std;
typedef struct ProblemInstance {
int n_works;
vector< vector<unsigned int> > cost_matrix;
ProblemInstance(int n_works) : n_works(n_works), cost_matrix(n_works +... | true |
9ce576e6c28ec59d1c97cf8eb8a304784a8f2c17 | C++ | MaguRaam/wave | /wave-quadratic/fv/include/quadratic.h | UTF-8 | 7,307 | 3.21875 | 3 | [] | no_license | #pragma once
namespace fv
{
namespace polynomial
{
template <int dim>
struct Quadratic
{
};
// template specialization for dim = 2;
template <>
struct Quadratic<2>
{
using CellItr = typename dealii::Triangulation<2>::active_cell_iterator;
// constructor
Quadratic... | true |
82472433c72e564dbb4903ffd6f36166cf386d0f | C++ | zeroshade/Conn4 | /BitBoard.cpp | UTF-8 | 3,690 | 2.90625 | 3 | [] | no_license | /*
* File: BitBoard.cpp
* Author: zeroshade
*
* Created on November 4, 2011, 6:20 PM
*/
#include "BitBoard.h"
#include <sstream>
inline int bitcount(bitboard n) {
int count = 0;
while (n > 0) {
count += (n & 1);
n >>= 1;
}
return count;
}
BitBoard::BitBoard() : swap(false) { ... | true |
b8e09703e3fda1be4869b831df7b831e9f566361 | C++ | sheepjian/algo_house | /OJ/leetcode/RotateList/RotateList.cpp | UTF-8 | 1,460 | 3.859375 | 4 | [] | no_license | /*
File Name : RotateList.cpp
Author: Jerry DENG (jerrydeng.windfly@gmail.com)
Time: 2014-11-16 15:45:22
Question:
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
Tags: Linked List; Two Pointers
Answer:
Th... | true |
6fce0db25ea5fc58c9d7213756a7a2cbf22129e7 | C++ | fresher96/competitive-programming | /Union_find DS/main.cpp | UTF-8 | 1,008 | 2.5625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true){
#ifdef LOCAL_TEST
freopen("in.in", "rt", stdin);
if(outToFile)
freopen("out.out", "wt", stdout);
#endif
}
//
typedef vector <int> vi;
//
struct union_find{
vi par, rnk;
union_find(int n = 0){ // O(n)
rnk.ass... | true |