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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30a1d25e9bb0626c1bc5a5b66422155bc83efe53 | C++ | andyroiiid/harujion | /src/renderer/vertex_array.cpp | UTF-8 | 1,285 | 2.8125 | 3 | [] | no_license | //
// Created by andyroiiid on 6/14/2021.
//
#include "renderer/vertex_array.h"
VertexArray::VertexArray() {
glCreateBuffers(1, &vbo);
glCreateVertexArrays(1, &vao);
glVertexArrayVertexBuffer(vao, 0, vbo, 0, sizeof(Vertex));
glEnableVertexArrayAttrib(vao, 0);
glVertexArrayAttribBinding(vao, 0, 0... | true |
d0d3d7ed87614df77dc9c5f7e54cb4bf312b9272 | C++ | tmigimatsu/symbolic | /include/symbolic/utils/hash_set.h | UTF-8 | 8,372 | 3.234375 | 3 | [
"MIT"
] | permissive | /**
* hash_set.h
*
* Copyright 2021. All Rights Reserved.
*
* Created: April 15, 2021
* Authors: Toki Migimatsu
*/
#ifndef SYMBOLIC_UTILS_HASH_SET_H_
#define SYMBOLIC_UTILS_HASH_SET_H_
#include <algorithm> // std::max, std::swap
#include <iostream> // TODO: remove
#include <vector> // std::vector
#incl... | true |
184bd3a215215077592e53c6ba95d242ab58b513 | C++ | prime21/tasks | /testdata/demarcation/4/genHard.cpp | UTF-8 | 738 | 2.65625 | 3 | [] | no_license | #include <cstdio>
using namespace std;
const int Maxl = 24999;
const int a = 501;
const int b = 20000000;
const int c = 10;
const int d = 53;
int main()
{
printf("%d\n", 4 * (Maxl + 1));
int nilx = 10, nily = 20;
int curx = nilx, cury = nily;
printf("%d %d\n", curx, cury);
cury += Maxl * a + (Maxl - 1) * (a - 2 ... | true |
d7e4a9d87e39e4499556a15b8119a25293d722c4 | C++ | gregsouza17/cppweekly | /cpt7greg/cpt77tst.cpp | UTF-8 | 191 | 2.921875 | 3 | [] | no_license | #include <iostream>
void printStuff(int x=2, int y=10);
int main(void){
printStuff();
return 0;
}
void printStuff(int x, int y){
std::cout<< x << "\t" << y << std::endl;
}
| true |
aabe816c138b700db0d6598d07e7abbc52f0d3c1 | C++ | subreto-roy/C-programming | /structure,loop,string problem/first and last number.cpp | UTF-8 | 280 | 2.75 | 3 | [] | no_license | #include<stdio.h>
int l,f;
void number(int n)
{
int rem;
l = n % 10;
while (n != 0)
{
rem = n % 10;
n= n / 10;
}
f = rem;
//printf("%d, %d",rem,l);
}
int main()
{
int n;
scanf("%d", &n);
number(n);
printf("first: %d\nlast: %d",f,l);
} | true |
b687d3321507c64332e46ca4cef2461c21b1c5f0 | C++ | oroosvall/LitetSpelprojekt | /Spelprojekt/Spelprojekt/src/game/Audio.h | UTF-8 | 2,688 | 2.671875 | 3 | [] | no_license | #ifndef AUDIO_H
#define AUDIO_H
#include <conio.h>
#include <stdlib.h>
#include <vector>
#include <..\glm\glm.hpp>
#include <AL\alut.h>
#include <AL\alext.h>
#include <AL\efx.h>
//states
#define A_PLAYING 0
#define A_PAUSED 1
#define A_FADEIN 2
#define A_FADEOUT 3
#define FADEINTIME 0.15f
#define FADEOUTTIME 0.4f
#d... | true |
fe5b35bb906f8cbd90db2bed4dedbb9d561c2618 | C++ | ARuiz93/lectures | /Classes/Pokemon4/Pokemon.h | UTF-8 | 2,244 | 4.0625 | 4 | [
"MIT"
] | permissive | #ifndef __POKEMON_H
#define __POKEMON_H
#include <iostream>
#include <string>
/*
Design a class to represent a single Pokemon.
We will keep things simple. The Pokemon class will define these state variables:
- string Name
- int HP, Attack, Defense
- a single Move that it can attack with
and these operations:
... | true |
480f77d140ec427c6a0eaddf1462cbc4ca31d21a | C++ | ConnorMacDonell/Interview_Preparation_Solutions | /src/CoinChange.cpp | UTF-8 | 823 | 3.34375 | 3 | [] | no_license | /*
* CoinChange.cpp
*
* Created on: Mar 28, 2019
* Author: Connor
*/
#include "CoinChange.h"
void coinChange(std::vector<int> coins, int target){
if(coins.empty() || target <= 0){
return;
}
std::stack<int> buffer;
printCombos(coins, buffer, 0, 0, target);
}
void printCombos(std::vector<int> coins, ... | true |
d59fc13bdcc2d9ecb19b92559eec5a05a832c79b | C++ | graphffiti/PopHead | /src/GameObjects/NonDrawableGameObjects/spawner.cpp | UTF-8 | 744 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "GameObjects/DrawableGameObjects/Characters/Enemies/zombie.hpp"
#include "GameObjects/NonDrawableGameObjects/spawner.hpp"
#include "Utilities/spawn.hpp"
namespace ph {
Spawner::Spawner(GameData* const gameData, const std::string& spawnerName, const ObjectType objectType,
const sf::Time spawnFrequency, cons... | true |
5ae6a797ef893bdbefc60f33bd8488846362c91b | C++ | minD3D/Algorithm_study | /42885_boat.cpp | UTF-8 | 693 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> people, int limit) {
int answer = 0;
sort(people.begin(),people.end());
int pnt=people.size()-1;
for(int i=0;; ){
if(pnt<=i){
answer++;
... | true |
ac84a35ccb00d77c9299252383a8d4b1dbc7a119 | C++ | veljko-dj/SS_Projekat_V2 | /Projekat_SS/Projekat_SS/RelTable.h | UTF-8 | 554 | 2.625 | 3 | [] | no_license | #pragma once
#ifndef REL_TABLE_H
#define REL_TABLE_H
#include <list>
class RelEntry;
class RelTable {
static std::list<RelEntry*> table; // Radim sa pokazivacem da ne bi doslo do nekih kopiranja neplaniranih
public:
static void addEntry(RelEntry* symbolPtr);
static int getLastOrdNum();
static RelEnt... | true |
34a3d098ae096a075f6270ef1e43998e9d103303 | C++ | ljuillen/RelationBasedSoftware | /source/Analyse.cpp | UTF-8 | 2,721 | 2.609375 | 3 | [
"MIT"
] | permissive | //
// Analyse.cpp
// Relation-Based Simulator (RBS)
//
// Created by Ali Jenabidehkordi on 08.03.18.
// Copyright © 2018 Ali Jenabidehkordi. All rights reserved.
//
#include "Analyse.h"
#include "report/Logger.h"
namespace rbs {
Analyse &Analyse::current() {
static Analyse single;
return single;
}
const... | true |
7e94f8d836396ed21fb6dc5d85d548b552e0ef64 | C++ | shaynachhari/basic_c- | /Enums.cpp | UTF-8 | 415 | 3.34375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
enum Meal { breakfast, lunch, dinner, snake, monkey, lion};
// instances of enum get values from zero
cout<<breakfast<<endl;
cout<<lunch<<endl;
cout<<dinner<<endl;
Meal a = breakfast;
cout<<a<<endl;
// we can not update enum variable
... | true |
6559f210a0c37ba5f97d2272e4ac1be763e6bec3 | C++ | siukwan/apue | /practice/283. Move Zeroes.cpp | UTF-8 | 273 | 3.015625 | 3 | [] | no_license | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int zeroIdx = 0;
for (int i = 0; i<nums.size(); ++i)
{
if (nums[i] != 0)
nums[zeroIdx++] = nums[i];
}
for (; zeroIdx<nums.size(); ++zeroIdx)
{
nums[zeroIdx] = 0;
}
}
}; | true |
dcdaf0ce950c91f59c3a4cb2baf22bac4004bab7 | C++ | tuxerman/badokevast-sandbox | /testval.cc | UTF-8 | 1,506 | 3.390625 | 3 | [] | no_license | #include "common.h"
#include <iostream>
#include <map>
#include "value.h"
#include "dict.h"
using namespace std;
void testrun(int times)
{
int keyPrefix = 123400;
map<int, Value*> hashtable;
for (int i = 0; i < times; i++)
{
// GENERATE KEY
int keyUid = keyPrefix*100 + i;
// GENERATE RANDOM VALUE JSON
... | true |
1ff065d4dd6bb32dfe2780b4504d38a27a96634b | C++ | StevenGroves/css1_final_fa15 | /css1_final_fa15/prog1/driver.cpp | UTF-8 | 1,268 | 3.484375 | 3 | [] | no_license | // Steven Groves
// 17 Dec 2015
// CSS-1 Fa15 Final Exam Prog 1
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <vector>
using namespace std;
void fillVector(vector<string>& PW, ifstream& A_in);
bool isCracked(vector<string> PW, string str, int n);
int main()
{
const int SIZE = 6... | true |
d82619f20e9ccae221b6921ba4fae000857c6b28 | C++ | dak98/SocketIO | /src/client.cpp | UTF-8 | 2,328 | 2.734375 | 3 | [] | no_license | #include <client.hpp>
#include <netinet/in.h>
#include <stdexcept>
#include <sys/socket.h>
#include <typeinfo>
#include <sys/types.h>
#include <utility>
#include <communication.hpp>
#include <connection.hpp>
#include <utils.hpp>
namespace socket_io
{
static inline auto connect(socket const& not_connected, sockaddr*... | true |
aff2248303d1f48c4cd9a8b54042e7695162ef60 | C++ | charlieSewell/ICT397-Game-Engine | /src/Model/Components/Camera.cpp | UTF-8 | 681 | 2.515625 | 3 | [
"MIT"
] | permissive | #include "Camera.hpp"
#include "Controller/EventManager.hpp"
Camera::Camera()
{
registerViewMatrix();
registerPerspective();
}
glm::mat4 Camera::getViewMatrix()
{
return glm::lookAt(m_position, m_position + m_frontDirection, m_upDirection);
}
void Camera::registerViewMatrix()
{
auto viewMatrix = [&... | true |
81bddfcd2ff13fb5a2e3f039ad55b7f55e900a4b | C++ | CppIsGreat/CLionProjects | /Week2/Homework4/main.cpp | UTF-8 | 852 | 3.1875 | 3 | [] | no_license | /**
* @file main.cpp
* @author Neil Burman (nburma01)
* @date 2017-10-15
* @version 1.0
*
* @brief Print a series of n Fibonacci numbers
*
* @section Print Fibonacci numbers using static
* libraries.
*
*/
#include <iostream> // std::cin, std::cout
#include <vector> // std::vector
#include... | true |
44d6f685f8aa220c04e77e895f091384f27b1be2 | C++ | maximbobrov/PlasmaSilver2d | /plasmaSilver2D/mon/fft.cpp | UTF-8 | 3,320 | 2.796875 | 3 | [] | no_license | #include <math.h>
#include "mcm.h"
#define SWAP(a, b) tempr=(a); (a)=(b); (b)=tempr
/***************************************************************/
/* Replace `data' by its discrete Fourier transform, if `isign'is
input as 1, or by its inverse discrete Fourier transform, if
`isign' is input as -1. `data' is a com... | true |
56ee284e1151690df6d4b4293ef7616fa45ceb85 | C++ | ParadoxChains/C3JI5D-Evan-Sitt-BSc-Thesis | /C3JI5D-Synthesiser/Google Unit Testing/OscillatorUnitTests.cpp | UTF-8 | 5,720 | 2.875 | 3 | [] | no_license | #include "pch.h"
#include "WaveformSynthesis.h"
class OscillatorPhaseTest : public ::testing::Test {
protected:
oscillator osc1;
};
TEST_F(OscillatorPhaseTest, TestConstructorPhase) {
EXPECT_FLOAT_EQ(osc1.getPhase(), 0);
}
TEST_F(OscillatorPhaseTest, TestResetPhase) {
osc1.resetPhase();
EXPECT_FLOAT_EQ(osc1.getPh... | true |
44cac996d3c5fd37714b78d746293b5f9f7dd278 | C++ | niello/deusexmachina | /DEM/Low/src/Render/ShaderParamStorage.cpp | UTF-8 | 8,746 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "ShaderParamStorage.h"
#include <Render/ShaderParamTable.h>
#include <Render/GPUDriver.h>
#include <Render/ConstantBuffer.h>
#include <Render/Texture.h>
#include <Render/Sampler.h>
namespace Render
{
CShaderParamStorage::CShaderParamStorage() = default;
//-----------------------------------------------------... | true |
bc42ffb96105a0ef189a5465d03402aeba861312 | C++ | Relag/Binary_Trees | /testing/Battle System Test/ConsoleApplication1/Hero vs. Goblin/Player.cpp | UTF-8 | 1,377 | 3.015625 | 3 | [] | no_license | #include "Player.h"
#include <Windows.h>
#include <conio.h>
Player::Player() {
m_Stats.m_Agility = 4 + (rand() % 3);
m_Stats.m_MaxHealth = 12 + (rand() % 8);
m_Stats.m_Strength = 3 + (rand() % 4);
m_Stats.m_Health = m_Stats.m_MaxHealth;
m_Name = "Player";
isFoe = false;
}
Player::~Player() {
std::cout << "\nYo... | true |
92c85317b27c39f1ab8cdac4fc208ace07f771af | C++ | No-Face-the-3rd/MathEngine | /Math/vec2.cpp | UTF-8 | 3,662 | 3.09375 | 3 | [] | no_license | #pragma once
#include "vec2.h"
meow::vec2 &meow::vec2::operator=(const float &a)
{
this->x = a;
this->y = a;
return *this;
}
meow::vec2 &meow::vec2::operator=(const vec2 &a)
{
this->x = a.x;
this->y = a.y;
return *this;
}
meow::vec2 &meow::vec2::operator+=(const float &a)
{
this->x += a;
this->y += a;
retur... | true |
514f2af91c70de25ab27dfc2cb66b891c753899e | C++ | RabeebIbrat/Data-Structures | /disjoint_set_forest.h | UTF-8 | 1,290 | 3.125 | 3 | [] | no_license | #ifndef DISJOINT_SET_H
#define DISJOINT_SET_H
#include<iostream>
using namespace std;
template<class Type>
class SetLinker {
SetLinker<Type>* parent;
int size;
int rank;
public:
Type value;
SetLinker() { ///aka makeSet()
parent = NULL;
size = 1;
rank = 0;
... | true |
b5c2cad511e60e45aaaa3e9f19e070be98dc1da0 | C++ | jaysonlong/memalloc | /main.cpp | UTF-8 | 2,110 | 3.328125 | 3 | [] | no_license | /**
* Author: Github/JaysonLong
* Desciption: a memory alloc test utils
*/
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<getopt.h>
#include<string.h>
// alloc memory arguments
struct my_arg {
int size; // memory size
bool init; // if init by zero immediately after allocated
int keep_time; ... | true |
1701f22b7c33073b8443b905c0996abb9499f422 | C++ | satr/Robot-vacuum-cleaner-with-servos-as-motors-controlled-by-Arduino | /Robot_vacuum_cleaner_with_servos_as_motors_controlled_by_Arduin/Robot_vacuum_cleaner_with_servos_as_motors_controlled_by_Arduin.ino | UTF-8 | 2,549 | 3.359375 | 3 | [] | no_license | // This example code is in the public domain.
#include <Servo.h>
//Pins where servos are connected
int pinLeftServo = 9;
int pinRightServo = 10;
//Pins where bumpers are connected
int pinLeftBumper = 6;
int pinRightBumper = 7;
//Pin for LED
int pinLED = 13;
// create servo object to control a left servo
Servo rig... | true |
9312f9d0254fb9d3695007444f20e486b96b4109 | C++ | timurrrr/mipt-cs-timurrrr | /2ndyear/codestyle/copy_and_assign_are_bad.cpp | UTF-8 | 873 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
class Foo {
public:
Foo() {
array_ =... | true |
f5d958e9f064f6e8104c9e97482030965b54328d | C++ | ByeDream/RayTracingInAWeekend | /RayTracer/RayTracer/Hitables.h | UTF-8 | 3,065 | 2.859375 | 3 | [] | no_license | #pragma once
#include "Vec3.h"
#include "AABB.h"
class Ray;
class IMaterial;
struct HitRecord
{
float m_time;
Vec3 m_position;
Vec3 m_normal;
float m_u;
float m_v;
IMaterial * m_hitMaterial;
};
// General hitable interface
class IHitable
{
public:
IMaterial * m_material{ null... | true |
bdc63f5768511174331f8f94678bd409fe8200f1 | C++ | Chervony/MARIO_2.0 | /Project7/Project7/Fuctions.h | WINDOWS-1251 | 1,571 | 2.53125 | 3 | [] | no_license | #pragma once
extern bool GAME_OVER;
extern bool restart;
void CheckRec(Mario& mario) {
std::fstream file("record.txt", std::ios::in | std::ios::out);
int temp;
if (file.is_open()) {
file >> temp;
if (temp < mario.score) {
std::fstream file("record.txt", std::ios::in | std::ios::out | std::ios::trun... | true |
1f5a98a6a35de2bc97212a795c0231019922d5d0 | C++ | chibicitiberiu/goblin-engine | /GoblinEngine with SFML/Engine/ResourceManager.h | UTF-8 | 2,447 | 2.78125 | 3 | [] | no_license | #pragma once
#include "../Core/IResourceManager.h"
#include "../Core/Exception.h"
#include "../Core/Log.h"
#include <SFGUI/SFGUI.hpp>
#include <SFML/Audio.hpp>
#include<queue>
#include<map>
#include<fstream>
namespace Goblin
{
class DLLEXPORT ResourceManager : public IResourceManager
{
public:
private:
/// <s... | true |
bd9741468c78a0b6709902887d06cedf46508738 | C++ | hagonzal/tiempo | /regression/regression.h | UTF-8 | 1,330 | 2.6875 | 3 | [] | no_license | // Copyright (c) 2012 The Tiempo Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
// Author: Hector Gonzalez (hagonzal@gmail.com)
#ifndef REGRESSION_REGRESSION_H_
#define REGRESSION_REG... | true |
f4046cceab8927b46e18e9ac2e982818c5e14473 | C++ | robotics-upo/plane_detector | /include/plane_detector/ros_detected_plane.hpp | UTF-8 | 3,031 | 2.609375 | 3 | [
"MIT"
] | permissive | #ifndef _ROS_DETECTED_PLANE_HPP__
#define _ROS_DETECTED_PLANE_HPP__
#include "detected_plane.hpp"
#include <visualization_msgs/Marker.h>
#include <ros/ros.h>
#include <eigen3/Eigen/SVD>
#include <eigen3/Eigen/Core>
#include <eigen3/Eigen/Jacobi>
class DetectedPlaneROS:public DetectedPlane {
public:
DetectedPlaneROS... | true |
92faa3e79c00ac2a86c5428319b1fa1b4e3ac030 | C++ | erhemdiputra/codeforces | /problemset/hq9+/main.cpp | UTF-8 | 512 | 2.84375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main() {
string str;
char list[] = {'H', 'Q', '9'};
int lenList;
bool found = false;
cin>>str;
lenList = sizeof(list)/sizeof(list[0]);
for(int i = 0; i < str.size(); i++) {
for(int j = 0; j < lenList; j++) {
if(str[i] ... | true |
cb58e7aeb55bf6ee4c9be6fdb3b6e969ff3f00d2 | C++ | kkeijuro/shared_mutex | /test_objects.cpp | UTF-8 | 4,566 | 2.890625 | 3 | [] | no_license | #include <cstddef>
#include <functional>
#include <iostream>
#include <stdint.h>
#include <string.h>
#include <thread>
#include <unistd.h>
#include "test_objects.hpp"
#include "shared_lock.hpp"
uint32_t MemorySpace::DEFAULT_SIZE = 1024*1024*1024; //1M
static MemorySpace* _memory_space = NULL;
uint32_t MemorySpace::_... | true |
51278921217c6433a9b76ed8f876a598315b4997 | C++ | bytian/scheduler | /oldestFirst.cpp | UTF-8 | 2,337 | 2.6875 | 3 | [] | no_license | //
// Created by Jamie Wu on 10/5/16.
//
#include "oldestFirst.h"
#include "object.h"
#include "simulator.h"
#include "transaction.h"
OldestFirst::OldestFirst() : Scheduler() {}
OldestFirst::OldestFirst(Simulator* sim) : sim(sim) {}
void OldestFirst::init()
{
exclTrans.resize(sim->getTotalObj());
inclTrans... | true |
f98fe3f403143ce98b9b4254a6fdb089da77e4f6 | C++ | rajat189/Competetive_programming | /Hackerrank/Contest/countercode/Poisonous Plants.cpp | UTF-8 | 597 | 2.796875 | 3 | [] | no_license | /*
link :- https://www.hackerrank.com/contests/countercode/challenges/poisonous-plants
problem :- Poisonous Plants
*/
#include <bits/stdc++.h>
using namespace std;
int main () {
int n,x,i;
vector<int> v, pos;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&x);
v.push_back(x);
}
int days=0,count=0;
while... | true |
8d3842b64ee6a4122b9cda24fd2d4f944edb4463 | C++ | bitounu/libOttoHardware | /src/devices/disk.cpp | UTF-8 | 972 | 2.546875 | 3 | [] | no_license | #include <otto/devices/disk.hpp>
volatile unsigned long long __ottoDiskUsage_total = 0;
volatile unsigned long long __ottoDiskUsage_used = 0;
/*static void read_disk( uint64_t *total, uint64_t *used ) {
char buffer[ 2048 ];
// call df with a blocksize of 512 bytes and return just the last line of the
// output ... | true |
0888ca74cc8240772214dac246377d0ae32709e8 | C++ | klarmann2018/sams_teach_c-_in_one_hour_a_day | /sams_teach_c++_in_one_hour_a_day/18/ex18_02.cpp | UTF-8 | 1,127 | 3.578125 | 4 | [] | no_license | /*
* =====================================================================================
*
* Filename: ex18_02.cpp
*
* Description: Using a short program, domostrate that an iterator pointing to an element in
a list continues to remain valid even after another element has been inserted
before it... | true |
31c2f2881e86449700861df2d40f1ea1c0e022a0 | C++ | ivanenkomaksym/CityStat | /citystatmodel.h | UTF-8 | 1,913 | 2.515625 | 3 | [] | no_license | #ifndef CITYSTATMODEL_H
#define CITYSTATMODEL_H
#include "cityitem.h"
#include <QAbstractTableModel>
#include <QList>
#include <QString>
#include <memory>
#include <limits>
class DataLoader;
class CityStatModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit CityStatModel(QObject *parent = nullptr... | true |
855367054827753c20381a39403aba324483e674 | C++ | PiotrKowandy/CourseDashboard_US1_old | /src/CourseDashboard.cpp | UTF-8 | 5,668 | 3.234375 | 3 | [] | no_license | #include "CourseDashboard.hpp"
#include <stdexcept>
#include <iostream>
#include <vector>
#include<algorithm>
#include <iterator>
#include <cstdlib>
#include <unistd.h>
CourseDashboard::CourseDashboard()
{
}
CourseDashboard::~CourseDashboard()
{
}
void CourseDashboard::addStudent()
{
Student student;
std:... | true |
bb7aab5f0ba3843c3e0e0622d1fb78777c8e1895 | C++ | northWindPA/cpp_modules | /Module_04/ex01/Ghoul.cpp | UTF-8 | 448 | 3.109375 | 3 | [] | no_license | #include "Ghoul.hpp"
Ghoul::Ghoul(): Enemy(100, "Ghoul")
{
std::cout << "Ghaa Ghaa Ghaa!" << std::endl;
}
Ghoul::~Ghoul()
{
std::cout << "Ghaargh..." << std::endl;
}
Ghoul::Ghoul(Ghoul const ©)
: Enemy(copy)
{}
Ghoul &Ghoul::operator = (Ghoul const ©)
{
_hp = copy._hp;
_type = copy._type;
return *this;... | true |
1477092649915f77aa2b529b006df8fa8ff6f2ba | C++ | strategist922/fpga_env | /libethash-fpga/FPGAMiner.cpp | UTF-8 | 3,401 | 2.53125 | 3 | [] | no_license |
#include "FPGAMiner.h"
bool Miner::init()
{
cl_int err;
std::vector<cl::Platform> platforms;
cl::Platform::get(&platforms);
if (platforms.empty())
{
printf("\nno platforms\n");
return false;
}
// GET XILINX PLAT
cl::Platform xilinx_platform;
int pIdx;
for(pI... | true |
3e1153352966115068f3903633c64607b2586d47 | C++ | nahallacman/CST420 | /CST420_Assignment03/CST420_Assignment03/raceAnalyzer.cpp | UTF-8 | 1,531 | 2.671875 | 3 | [] | no_license | #include "raceAnalyzer.h"
RaceAnalyzer::RaceAnalyzer(const string &stageFilename,
const string &riderFilename)
{
}
size_t RaceAnalyzer::numStages() const
{
return size_t();
}
string RaceAnalyzer::getTeam(const string &riderName) const
{
return string();
}
//
// Returns the team name for a specified ride... | true |
f340b05d5130dc7cdaab79a678d2b359ce536011 | C++ | djeriko/codewars | /6kyu/stop_gninnips_my_sdrow/my_solution.cpp | UTF-8 | 633 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string spinWord(const string str)
{
string result = "";
string word = "";
for (auto c : str)
{
if (c == ' ')
{
result += word + ' ';
word = "";
continue;
}
if (word.size() > 4)
{
revers... | true |
8d18d30b766eb8d86e9b261d73d407451418b3b8 | C++ | verfallen/wang-dao | /chapter2/CircleDLinkList/CircleDLinkList.cpp | UTF-8 | 795 | 3.375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
/**
* 循环双链表
*/
typedef int ElemType;
typedef struct DNode
{
ElemType data;
DNode *next, *prior;
} DNode, *DLinkList;
//初始化循环双链表
bool InitList(DLinkList &L)
{
L = (DNode *)malloc(sizeof(DNode));
if (L == NULL)
return false;
L->prior = L;
L->next = L;
return true;
}
//判... | true |
6950bc3fc407141595bd94689ce2bcf0aeb38b4f | C++ | ForPertP/Strange-Counter | /Strange-Counter.cpp | UTF-8 | 317 | 3.171875 | 3 | [] | no_license | long strangeCounter(long t)
{
long result = 3;
while (t > result)
{
t -= result;
result *= 2;
}
return result - t + 1;
}
long strangeCounter1(long t)
{
long result = 4;
while (t >= result)
{
result = result * 2 + 2;
}
return result - t;
}
| true |
2370b4ae5367397c1bdcf1da91397e2933b37338 | C++ | 1165048017/CMPUT-414-MoCap-Project | /Library/DistanceMap.cpp | UTF-8 | 9,787 | 2.734375 | 3 | [] | no_license | #include <Library/DistanceMap.hpp>
#include <Graphics/Graphics.hpp>
#include <Vector/VectorGL.hpp>
#include <Vector/QuatGL.hpp>
#include <cstring>
#include <cassert>
#include <algorithm>
#define UNINITIALIZED -1.0f
using namespace Character;
using namespace std;
namespace Library
{
DistanceMap::DistanceMap(const M... | true |
bbf204d01ba09a8188e228deb86d008cb89c8f4c | C++ | myk502/ACM | /Codeforces/796C.cpp | UTF-8 | 1,390 | 2.6875 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#include<cmath>
#include<vector>
#include<climits>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
using namespace std;
const int maxn=300000+10;
int n,a[maxn];
vector<int> G[maxn];
vector<int> A,B;//A stores the Node whose value is max-1,B stores the Node
//wh... | true |
1017214ac4ccad09679d74e14fa51fba017e1213 | C++ | Anosy/C-Primer5 | /Chapter7/Section2/Exercise7_32/Window_mgr.h | GB18030 | 653 | 3.4375 | 3 | [] | no_license | #include<string>
#include<vector>
#include<iostream>
class Window_mgr
{
public:
void clear();
};
class Screen
{
friend void Window_mgr::clear();
private:
unsigned height = 0, width = 0;
unsigned cursor = 0;
std::string contents;
public:
Screen() = default;
Screen(unsigned h, unsigned w, char c) :height(h), wid... | true |
98205fa6b03c38ee04db36894cb784b1a3597d5d | C++ | Thuney/modern_opengl_programs | /SharedGLClasses/headers/Shader.h | UTF-8 | 1,403 | 2.859375 | 3 | [] | no_license | #ifndef SHADER_H
#define SHADER_H
#include <glm/glm.hpp>
#include <string>
enum ShaderColor
{
WHITE,
RED,
GREEN,
BLUE,
PURPLE,
YELLOW,
ORANGE,
CYAN,
BLACK,
GRAY,
GOLD
};
class Shader
{
public:
unsigned int ID;
Shader(const char* vertexPath, const char* fragmentPath);
Shader(const char* vertexPath, con... | true |
8d5b818c69df8940f5970678e1af7501f5e28804 | C++ | katipogluMustafa/CppLangTraining | /03_CodeSnippets/00_LanguageFundamentals/02_Operators/01_new_and_delete/Main.cpp | UTF-8 | 1,050 | 4 | 4 | [] | no_license | #include<iostream>
void print(int* a) {
std::cout << *a << std::endl;
}
void printArr(float* arr, int len) {
for (int i = 0; i < len; i++)
std::cout << *(arr + i) << " ";
std::cout << std::endl;
}
class Object {};
int main() {
// Allocate int
int* x = new int;
*x = 7;
print(x);
// Allocate and init
in... | true |
1ffe2b0dd1925e20d37f1079081f786b378618ec | C++ | skizzay/nfirspp | /business/values/address.h | UTF-8 | 16,427 | 2.734375 | 3 | [] | no_license | // vim: sw=3 ts=3 expandtab cindent
#ifndef NFIRSPP_BUSINESS_ADDRESS_H__
#define NFIRSPP_BUSINESS_ADDRESS_H__
#include "business/bits/value_component.h"
#include <utility>
namespace firepp {
namespace business {
namespace details_ {
struct street_name_tag final : length_validation_and_assignment {
static inline ... | true |
d3f10934d08f51c8541ede66afb6a580fd411e59 | C++ | WhiZTiM/coliru | /Archive2/b0/e0bbb90373105d/main.cpp | UTF-8 | 258 | 2.796875 | 3 | [] | no_license | int main() {
int x = 2147447412;
int base = 1;
while (base * 10 <= x)
base *= 10; // this loop will run forever.
while ((long long)(base * 10) <= (long long)(x))
base *= 10; // this loop still will run forever
} | true |
4d5a0b27c0bfa841e5f1481c3aafacb863255664 | C++ | MohammadFakhreddin/dot-product-2d-collision-simulation | /Engine/shape_generator/ShapeGenerator.cpp | UTF-8 | 1,634 | 3.3125 | 3 | [] | no_license | #include "ShapeGenerator.h"
#include <math.h>
#include "../Constants.h"
#include <assert.h>
std::vector<VecFloat> ShapeGenerator::star(
float innerRadius,
float outerRadius,
int numberOfAngles
) {
std::vector<VecFloat> polyLines;
return polyLines;
}
std::vector<VecFloat> ShapeGenerator::gear(
const float radius... | true |
d637e2bd90821c5bd5e0b6f435f06b9050577461 | C++ | Nunkiii/node-fits | /qk/exception.cpp | UTF-8 | 739 | 2.734375 | 3 | [] | no_license | //#include "object.hh"
#include "exception.hh"
namespace qk {
exception::exception(const std::string& me, int info) throw()
: mess(me), ex_info(info){
}
exception::~exception() throw()
{}
const char* exception::what() const throw(){
return mess.c_str();
}
void exception::raise() const... | true |
33763c8ae29f01dfe4828f4ffabea59207f1b141 | C++ | HEP2019/hep2019 | /oop/Shchedrolosiev/I/I.cpp | UTF-8 | 1,124 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <bits/stdc++.h>
int main()
{
int n_edges, n_ribs;
int start, destination;
std::cin>>n_edges>>n_ribs>>start>>destination;
std::vector< std::vector<int> > edges (n_edges+1);
for(int i=0; i<n_ribs; ++i){
int a,b;
std::cin>>a;
std... | true |
c6754e3bf1619e60d7672ceccfba398c09c24b87 | C++ | andoporto/Programacion2014 | /UNIVERSIDAD/programacion/matrices/funci1.cpp | UTF-8 | 1,361 | 3.375 | 3 | [] | no_license | #include <stdio.h>
#define MAX 10
void leermat (int a[MAX] [MAX],int m, int n);
void sumamat(int a[][MAX], int b[][MAX], int c[MAX][MAX], int m, int n);
void escrmat(int a[][MAX], int m, int n);
void main()
{
int m,n;
int a [MAX][MAX],b[MAX][MAX],c[MAX][MAX];
printf("Ingrese el numero de filas de las dos matrices:... | true |
6b791378a0d01e64b99b974de7d2e33e565c8a7a | C++ | Monmoy042/Arduino | /Robotic Basics/Project-4/arduinoBasics04_Arduino_with_Ultrasonic_Sensor_/arduinoBasics04_Arduino_with_Ultrasonic_Sensor_.ino | UTF-8 | 573 | 2.765625 | 3 | [] | no_license | int echoPin = 9;
int trigPin = 10;
int ledPin = 13;
void setup(){
Serial.begin(9600);
pinMode(echoPin,INPUT);
pinMode(trigPin,OUTPUT);
pinMode(ledPin,OUTPUT);
}
void loop(){
long duration, distance;
digitalWrite(trigPin,HIGH);
delayMicroseconds(1000);
digitalWrite(trigPin, LOW);
duration=pulseIn(echo... | true |
a5f1c3eb25f0ccf9145d3350ca14168fb02d6e13 | C++ | liyonghelpme/dota-replay-manager | /old_src/ListCtrlEx.cpp | UTF-8 | 7,178 | 2.59375 | 3 | [] | no_license | #include "stdafx.h"
#include "ListCtrlEx.h"
#define OFFSET_FIRST 2
#define OFFSET_OTHER 6
// CListCtrlEx inline functions
BEGIN_MESSAGE_MAP(CListCtrlEx, CListCtrl)
//{{AFX_MSG_MAP(CColorListCtrl)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
inline CListCtrlEx::CListCtrlEx() : CListCtrl()
... | true |
45aa613e727acc58d2c1421ea7543e1ef146c839 | C++ | eprj453/algorithm | /C++/Algorithm/Algorithm/SW_1267_작업순서.cpp | UTF-8 | 1,879 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <stack>
using namespace std;
string ans;
bool visited[1001] = {false,};
void taskCount(stack <int> stk, vector <vector <int>> targeting, vector <vector <int>> targeted) {
while (stk.size() > 0) {
int x = stk.top();
//cout << "node : " << ... | true |
6c9d7ff4dd333456bcfbb5a9f140e08159130a3c | C++ | zhouxm/cards | /unittest/CardSet_UT.cpp | UTF-8 | 4,033 | 3 | 3 | [
"FSFAP"
] | permissive | #include "CardSet.h"
#include "Card.h"
#include "gtest/gtest.h"
#include <stdexcept>
using std::runtime_error;
using std::cout;
using std::endl;
TEST(CardSet, DefaultConstructor)
{
CardSet cs;
EXPECT_EQ(true, cs.Is_empty());
EXPECT_EQ(0, cs.Size());
}
TEST(CardSet, CtorFullCardSet)
{
CardSet cs(2, fal... | true |
d3cd02b8fc5470add8b1d75897dec65fcee7b4f7 | C++ | davidsansome/gait-modelfitting | /modelfitting/vis4d/image.hh | UTF-8 | 2,887 | 2.765625 | 3 | [] | no_license | // image.hh
// Richard Seely 2007
#ifndef _IMAGE_HH
#define _IMAGE_HH
#include "util.hh"
typedef unsigned char IMG_DTYPE;
class ImageL;
class ImageRGB
{
public:
IMG_DTYPE * data;
int x_size;
int y_size;
ImageRGB( int x, int y );
ImageRGB( IMG_DTYPE * buf, int x, i... | true |
7a2a1727a3d7936d5bd828c97c69f64802ebea79 | C++ | onelang/TestArtifacts | /CompilationTest/ConstructorTest/results/ConstructorTest.cpp | UTF-8 | 587 | 3.484375 | 3 | [
"MIT"
] | permissive | #include <iostream>
class ConstructorTest {
public:
int field2;
int field1;
ConstructorTest(int field1) {
this->field1 = field1;
this->field2 = field1 * this->field1 * 5;
}
private:
};
class TestClass {
public:
void testMethod() {
auto test = std::make_shared<Constr... | true |
0269f7064ebac025a893b4ff4754a961bb54484a | C++ | popebx/yal | /example/yal.cpp | UTF-8 | 506 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | #include "sink/debug_sink.h"
#include "sink/file_sink.h"
#include <yal/manager.hpp>
int main() {
yalog::yal_manager manager{};
manager.add_new_logger("debug", std::make_unique<debug_sink>(), yalog::log_level::DEBUG);
manager.add_new_logger(
"file", std::make_unique<file_sink>(std::filesystem::path{"log"}, ... | true |
a8979652717e8259d69441e1d7c5b74e60dd6b35 | C++ | gauravcse/Codes | /Newton.cpp | UTF-8 | 636 | 2.75 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define f(x) (x*x-x-6)
#define df(x) (2*x-1)
int main(void){
int z=1;
float x,x1=0.0;
printf("Please input The value for x: ");
scanf("%f",&x);
printf("\n\n Iteration no\t X\t\t X1\t\t f(X1)\t |X-X1| \n");
//printf("-----------------------------... | true |
c646b280c0826711371f0f87fd23983b6e0ed657 | C++ | michizhou/automatic-octo-waddle | /cs-202/proj3.cpp | UTF-8 | 15,413 | 3.953125 | 4 | [] | no_license | /* Michael Zhou, Project 3, CS 202 Section 1102 */
/* The input for the program is a certain input file that lists all the data for a list of agencies in an unsorted order. The data for each agency includes its name, zipcode, and inventory of car objects. Each of these car objects includes the car's year, make, model, ... | true |
5cc2c1777fcbbc0d5d860c0fd64ecdd9a3ec2cb9 | C++ | akinomyoga/libmwg | /src/mwg/bits/mpl.util.h | UTF-8 | 1,338 | 2.515625 | 3 | [
"MIT"
] | permissive | // -*- mode: c++; coding: utf-8 -*-
#ifndef MWG_BITS_MPL_UTIL_H
#define MWG_BITS_MPL_UTIL_H
#include <cstddef>
#include <mwg/std/type_traits>
namespace mwg {
namespace mpl {
// deprecated (originally located in mwg/mpl.h)
//============================================================================
// type_for... | true |
bc773f0feb833f961679eeb99eee36663edea890 | C++ | Yaroslav-Lahtachev/mp2-lab4 | /src/queue.cpp | UTF-8 | 548 | 2.625 | 3 | [] | no_license | #include "queue.h"
QueueHeap::QueueHeap(int d)
{
heap = new Tree(d);
}
QueueHeap::QueueHeap(Data **keys, int num, int d)
{
heap = new Tree(d);
heap->inputGroup(keys, num);
}
QueueHeap::~QueueHeap()
{
delete heap;
}
void QueueHeap::add(Data *&key)
{
heap->input(key);
}
Data* QueueHeap::popidx(int i)
{
return he... | true |
d1d70e5a746cf8d5c69267750eba2d173ba4d8c0 | C++ | liuhaowen478/color_test | /checker.cpp | UTF-8 | 3,674 | 3.0625 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
void readInput(string file, vector<vector<char>> &cmap, char &num);
void readOutput(string file, map<char, int> &result, char num);
int main() {
for (int i = 0; i != 10; i++) {
vector<vector<char>> cmap;
... | true |
0356074f314feb0a323aa12d629a29f2fae3be89 | C++ | akivajp/seraf | /src/lev/string.hpp | UTF-8 | 1,861 | 2.625 | 3 | [] | no_license | #ifndef _STRING_HPP
#define _STRING_HPP
/////////////////////////////////////////////////////////////////////////////
// Name: lev/string.hpp
// Purpose: header for string classes
// Author: Akiva Miura <akiva.miura@gmail.com>
// Modified by:
// Created: 09/14/2011
// Copyright: (C) 2010-2011 Aki... | true |
1a1fb9b7d60d975076ed1191798108638b60ed6d | C++ | AntonioGodoyUGR/Fundamentos-de-la-Programacion | /sesion7/AlbertoSesion7/42 done.cpp | UTF-8 | 648 | 3.53125 | 4 | [] | no_license | /*
Escriba un programa que lea cuatro valores de tipo char
e imprima las parejas que pueden formarse con un elemento del conjunto. El programa
debe imprimir las parejas que pueden formarse con un elemento.
*/
#include <iostream>
using namespace std;
int main(){
char min_izda, max_izda, min_dcha, max_dcha... | true |
e87a7c74626655aeed9c8f0d0a670bf00cefd58e | C++ | 770027697/cpp | /分段函数.cpp | WINDOWS-1252 | 269 | 2.890625 | 3 | [] | no_license | #include <iostream>
using namespace std;
void main() {
int x, y;
cout << "X:";
cin >> x;
if ((x >= -5 && x <= 5) && x != 0)
y = x - 1;
else if (x > 5 && x <= 10)
y = x + 5;
else if (x == 0) y = x + 1;
else y = 100;
cout << "y=" << y << endl;
} | true |
aa1c7d2c6f66745b260bfd1b0b6a0cb29299a41f | C++ | MarvinEstrada21/Semana4 | /MiClase.h | UTF-8 | 330 | 2.890625 | 3 | [] | no_license | #include <iostream>
#ifndef MICLASE_H
#define MICLASE_H
class MiClase {
private:
int* pointer;
int size;
public:
MiClase(); //por defecto
MiClase(int); //recibe un size
int get(int); //retorna el valor de una casilla
void set(int, int); //establece el valor indicado en la casilla indicada
~MiClase();
... | true |
9515aa01f648f62812379694a4cd9e6e376e3925 | C++ | QtLab/RaptorEngine | /Game/GameObject.cpp | UTF-8 | 5,450 | 2.625 | 3 | [] | no_license | /*
* GameObject.cpp
*/
#include "GameObject.h"
#include <cstddef>
#include "Num.h"
#include "RaptorGame.h"
#define SMOOTH_RADIUS 128.
GameObject::GameObject( uint32_t id, uint32_t type_code, uint16_t player_id ) : Pos3D()
{
ID = id;
TypeCode = type_code;
PlayerID = player_id;
Data = NULL;
Fwd.Set( 1., 0.,... | true |
42c1947dc7786ee243e24f7ccc0d0e1c5c816981 | C++ | look234/Green-World | /greenworld_Src/Ai.cpp | UTF-8 | 1,756 | 2.9375 | 3 | [] | no_license | /// \file ai.cpp
/// Code for the intelligent object class CIntelligentObject.
/// Copyright Ian Parberry, 2004.
/// Last updated August 20, 2004.
#include "ai.h"
extern int g_nScreenWidth;
CIntelligentObject::CIntelligentObject(ObjectType object, char* name,
D3DXVECTOR3 location, float xspeed, float yspeed):
CGam... | true |
c1a29ca6ac56f640f006e0715188192e1ae22050 | C++ | whguo/LeetCode | /C++/Dynamic Programming/62.Unique Paths.cpp | UTF-8 | 604 | 3.703125 | 4 | [] | no_license | /*
二维数组,从左上到右下有多少种路径(只能往下和往右移动)。
*/
/*
思路:第一列和第一行都是1,然后其余位置对左边和上边求和即可。
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int uniquePaths(int m, int n) {
vector<vector<int>> matrix(m,vector<int> (n,1));
for(int i=1; i < m; ++i)
for(int j=1; j < n; ++j)
... | true |
b646e987b8c1105777fc432e8d29db18de8bd034 | C++ | onikazu/WhatILearned | /CppProject/Robe/main56_2.cpp | UTF-8 | 421 | 2.84375 | 3 | [] | no_license | //
// Created by 増村和季 on 2019/03/21.
//
#include <iostream>
using namespace std;
int main(){
cout << "int : " << sizeof(int) << endl;
cout << "char : " << sizeof(char) << endl;
cout << "double : " << sizeof(double) << endl;
cout << "int* : " << sizeof(int *) << endl;
cout << "char* : " << si... | true |
0d114c94c7677a6d790a1e5a4f08970340dd30ff | C++ | sakamotojin/My-CP-Directory | /C++/DataStructres/segtree_normal.cpp | UTF-8 | 1,521 | 3.515625 | 4 | [] | no_license | // segtree begins
// Required
// Identity Function ==> X = X * I
// Comp Funcntion Z = X * Y
template <typename T>
class segtree {
vector<T> val;
int n;
T identity;
function<T(T, T)> comp;
void build(vector<T> &v, int node, int l, int r) {
if (l == r) {
val[node] = v[l];
return;
}
... | true |
ea76fb02c3dfd37b03692449a614556de17fcb53 | C++ | BRAINIAC2677/Lightoj-Solutions | /1045 - Digits of Factorial.cpp | UTF-8 | 553 | 2.875 | 3 | [
"MIT"
] | permissive | /*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/
#include<bits/stdc++.h>
using namespace std;
double arr[1000003];
int main()
{
int t;
cin >> t;
for (int a = 1; a<= 1000000; a++)
arr[a] = arr[a -1] + log10(a);
for (int i = 1; i <= t ; i++)
{
int n , b;
... | true |
f6d9b2be7df8b251b161123da34806024bd0868f | C++ | IvanovaD/State_Examination | /SDP/SDP_2014_09/SDP_2014_09/Source.cpp | WINDOWS-1251 | 2,752 | 3.40625 | 3 | [] | no_license | #include <iostream>
using namespace std;
struct Node
{
Node *next, *prev;
int data;
Node(int data, Node* next, Node* prev)
{
this->data = data;
this->next = next;
this->prev = prev;
}
};
bool join(Node* L1, Node* &L2)
{
while (L1->next != nullptr)
L1 = L1->next;
Node* L1_ptr = L1;
Node *L2_ptr ... | true |
90f0c9e0ccf1f9fe046b5eeddab8912905c303a2 | C++ | sam1018/tests | /file_size.cpp | UTF-8 | 1,309 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <filesystem>
#include <fstream>
#include <iterator>
#include <string>
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <boost/algorithm/string/case_conv.hpp>
namespace fs = std::experimental::filesystem;
i... | true |
73b25bb8f7406e8c8c5aeff62b1fb79b81a0f7a4 | C++ | tiagodsp/sparkengine | /src/modules/sparkengine/Source/Public/Spark/Core/GenericPlatform/GenericPlatformFile.h | UTF-8 | 4,233 | 2.90625 | 3 | [] | no_license | #pragma once
#include "Spark/Core/CoreTypes.h"
#include <string>
#include <vector>
#include "sparkengine.api.gen.h"
namespace Spark
{
enum class EPlatformFileRead : uint8
{
None = 0x0,
AllowRead = 0x01
};
ENUM_ENABLE_BITMASK_OPERATORS(EPlatformFileRead);
enum class EPlatformFileWr... | true |
398f645b3159b532f8bfbc92d3eca257d8faab8b | C++ | 1is0/Lavrenovich | /CSLabs/lab4CS/4.2/CircleOps.cpp | UTF-8 | 483 | 2.890625 | 3 | [] | no_license | // dllmain.cpp : Определяет точку входа для приложения DLL.
#include "pch.h"
#include <math.h>
#include <utility>
#include <limits.h>
#define DLL_EXPORTS extern "C" __declspec(dllexport) double
DLL_EXPORTS __stdcall Perimeter(double r)
{
return 2.0 * M_PI * r;
}
DLL_EXPORTS __cdecl Area(double r)
{
return M_PI *... | true |
c2d6c26fbb9a517f0bc477f9c48db0c29bf7a96d | C++ | mransing/OnlIne_contest_solutions | /CodeChef/FEB12/Count of Maximum/MaxCount.cpp | UTF-8 | 2,617 | 2.8125 | 3 | [] | no_license | #include <ext/hash_set>
#include <queue>
#include <vector>
#include <iostream>
int lInputBufferLength=500000;
char *InOrigBuf;
int kCount;
typedef struct _val_freq
{
int val;
int freq;
}val_freq;
struct hash_func
{
int operator()(const val_freq& vTrip) const
{
__gnu_cxx::hash<int> hashTable;
return ... | true |
d0acd816f4d96dc2670c59509df2646ad6f80504 | C++ | dbetm/algoritmia-programacion-y-estructuras-datos | /estructuras/Prácticas/Práctica_TAD_formales/Programa_8.cxx | UTF-8 | 2,499 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <cstdio>
/* Nombre: David Betancourt Montellano
* NL: 3
* Fecha: 18/02/2017
* UA: Estructuras de datos
* Programa académico: ISC
* Evidencia: Práctica TAD (formales)
* Maestra: M. en Ed. Karina Rodríguez Mejía
* Grupo: 2CM1.
*/
using namespace std;
class Edades {... | true |
056228719757159afa54c56599e9514c4a5f5fae | C++ | Yariee/2430Homework | /homework3/MusicLibrary.h | UTF-8 | 705 | 2.9375 | 3 | [] | no_license | #ifndef MUSICLIBRARY_H
#define MUSICLIBRARY_H
#include <string>
#include "Song.h"
#include "HashTable.h"
using namespace std;
class MusicLibrary
{
private:
int maxBuckets;
int numSongs; // number of Songs in library
HashTable *mySongs; // hash table storing all Songs
public:
MusicLibrary(int maxsongs);
~M... | true |
81739b6684ce91dce0b1c1c8cea74df3f7e97e55 | C++ | isac322/BOJ | /2217/2217.cpp14.cpp | UTF-8 | 284 | 2.53125 | 3 | [
"MIT"
] | permissive | #include <cstdio>
#include <algorithm>
using namespace std;
short arr[100001];
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%hd", arr + i);
sort(arr, arr + n);
int w=0;
for (int i = 0; i < n; i++) w = max(w, arr[i] * (n - i));
printf("%d", w);
} | true |
421a60ffeeb14300ae4c3f0cd3495352a0bb68bc | C++ | liambansal/Centipede | /RetroGame/Includes/Spider.h | UTF-8 | 1,520 | 2.765625 | 3 | [] | no_license | /////////////////////////////
// Author: Liam Bansal
// Date Created: 26/05/2020
/////////////////////////////
#ifndef SPIDER_H
#define SPIDER_H
#include "Animator.h"
#include "Enemy.h"
class BugBlaster;
class GameplayState;
class Grid;
class SpiderManager;
class Spider : public Enemy
{
public:
Spider();
virtual ... | true |
d1f3cee580e2aae30f3b3b993ec2fd3bf42119c6 | C++ | pauline-ly/databases_gpu | /GPU/old_version/cuckoo_gtest/Main_back.cpp | UTF-8 | 11,918 | 2.578125 | 3 | [] | no_license | //
// Created by jing on 2018/7/1.
//
#include "cuckoo.h"
#include "api.h"
#include "mt19937ar.h"
#include "gtest/gtest.h"
extern float mytime;
using namespace std;
void check_search_result(TTT* key,TTT* check,TTT* value,TTT size) {
TTT tmp = 0;
for (TTT i = 0; i < size; i++) {
if (check[i] != valu... | true |
f69ed1335fadf8ae537006ee9da407bbbd5fe230 | C++ | kulSuj/C_Assignments | /Find_Missing_Digit.cpp | UTF-8 | 4,628 | 3.578125 | 4 | [] | no_license | #include "pch.h"
#include "stdio.h"
#include "string.h"
#include "malloc.h"
#include "math.h"
void split_expression(char user_expression[], char *operator_operand[20]);
void find_missing_digit(char *operator_operands[20]);
void buildDigits(char *operator_operands[20], int arr_operands[3], int digit);
int main()
{
ch... | true |
655a1968a54dad1ce64d229beca41145419920ac | C++ | 3DTK/3DTK | /testing/scanio/zipreader.cc | UTF-8 | 2,289 | 2.59375 | 3 | [] | no_license | #define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE scanio
#include <boost/test/unit_test.hpp>
#include <scanio/helper.h>
#include <scanio/scan_io.h>
#include "slam6d/io_types.h"
BOOST_AUTO_TEST_CASE(zipreader) {
PointFilter filter;
std::vector<float> reflectance;
std::vector<float> temperature;
std::vector<flo... | true |
1de9a4d49e5b41523b82d6c8e49dc9adff7cddca | C++ | kugwzk/ACcode | /Leetcode Weekly Contest/Biweekly Contest 7/C.cpp | UTF-8 | 485 | 2.859375 | 3 | [] | no_license |
class Solution {
public:
int connectSticks(vector<int>& sticks) {
priority_queue<int>que;
for(int i=0;i<sticks.size();i++) que.push(-sticks[i]);
int ans = 0;
while(!que.empty()) {
int tmp =0 ;
tmp += que.top();que.pop();
if(!que.empty()) {
... | true |
fa0c8b89ae9bbaf1ffaac93667e049e66ad3ac6c | C++ | inada-s/procon | /atcoder/arc001/a.cpp | UTF-8 | 458 | 2.984375 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
using namespace std;
int main() {
int n;
string s;
while(cin >> n) {
cin >> s;
int a = count(s.begin(), s.end(), '1');
int b = count(s.begin(), s.end(), '2');
int c = count(s.begin(), s.end(), '3');
int d = count(s.begin... | true |
f5c5973753e00ba170b19f20eff5327767e076b0 | C++ | seanchung2001/Hotel-Reservations | /GuestRecorder.cc | UTF-8 | 893 | 3.171875 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include <string>
#include <iomanip>
#include <vector>
#include <sstream>
#include "GuestRecorder.h"
/*
Purpose of this program:
Stores informative strings about Guests who made a reservation for a premium or suite room in a vector of strings.
Complex or critical members:
u... | true |
abbdd99460f61795881fea99e6fcf6edbae69703 | C++ | pal-0123/Competitive-Database | /Codeforces/Round/round_586_div2_B.cpp | UTF-8 | 766 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define int long long int
int gcd(int a, int b) {
if (b == 0){
return a;
}
return gcd(b, a % b);
}
signed main(){
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to ou... | true |
9886b7332b7a6e4166844c0b796cbb00eea35ba3 | C++ | m0stlyharmless/synthesis | /emulation/fake_HAL/src/I2C.cpp | UTF-8 | 977 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /**
* \file i2c.cpp
* minimal implmentation of i2c protocol.
* the current implementation simply returns 0 or false or
* nothing depending on function header.
* read functions do not change the buffers params
*/
#include "HAL/I2C.h"
extern "C" {
void HAL_InitializeI2C(uint8_t port, int32_t* status){}
int32_t... | true |
c1426c90a705ab61212eebee54db258ac1946a0e | C++ | mewbak/go2cpp | /example/ebiten/glfwdriver.h | UTF-8 | 2,251 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | // SPDX-License-Identifier: Apache-2.0
#ifndef GLFWGAME_H
#define GLFWGAME_H
#include "autogen/game.h"
#include <condition_variable>
#include <functional>
#include <map>
#include <mutex>
#include <string>
#include <thread>
#include <vector>
struct GLFWwindow;
class GLFWDriver : public go2cpp_autogen::Game::Driver ... | true |
638425ad056c678b48cba9c02efcd29ce461d344 | C++ | MarkTheIronMan/oop | /Lab3/CTVSet.h | UTF-8 | 1,094 | 2.890625 | 3 | [] | no_license | #pragma once
#include <cctype>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <sstream>
#include <string>
#include <algorithm>
using Channels = std::map<int, std::string>;
class CTVSet
{
public:
CTVSet();
~CTVSet();
bool IsTurnedOn() const;
void TurnOn();
void TurnOff();
... | true |
de2918387db82597a3ad0a2ddb69a04fee3634b0 | C++ | cyberaktiv/some_solutions | /number_to_words.cpp | UTF-8 | 2,217 | 3.84375 | 4 | [] | no_license | /*
Convert a integer to its english words representation.
For example:
0 -> "Zero"
123 -> "One Hundred Twenty Three"
12345 -> "Twelve Thousand Three Hundred Forty Five"
1234567 -> "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"
-123 -> "Negative One Hundred Twenty Thr... | true |