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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9f9e51f28f4c406af70c960fbd0771f91ad05560 | C++ | cms-sw/cmssw | /CondFormats/ESObjects/interface/ESADCToGeVConstant.h | UTF-8 | 822 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef CondFormats_ESObjects_ESADCToGeVConstant_H
#define CondFormats_ESObjects_ESADCToGeVConstant_H
#include "CondFormats/Serialization/interface/Serializable.h"
#include <iostream>
class ESADCToGeVConstant {
public:
ESADCToGeVConstant();
ESADCToGeVConstant(const float& ESvaluelow, const float& ESvaluehigh);
... | true |
12fea55429f975ef087b18ea5eb5b6c8ad8c1480 | C++ | Leputa/TsingPA | /PA1/Company.cpp | GB18030 | 1,759 | 2.9375 | 3 | [] | no_license | #include <stdio.h>
const int Max=10000005;
const int MAXBUFFER = 1 << 20;
struct fastio {
char inbuf[MAXBUFFER];
char outbuf[MAXBUFFER];
fastio() {
setvbuf(stdin, inbuf, _IOFBF, MAXBUFFER);
setvbuf(stdout, outbuf, _IOFBF, MAXBUFFER);
}
}io;
class Employee{
public :
int code;
int num;
Employee(){
c... | true |
2012d2a3cdb5336804f8c44d76656c1092efaa9d | C++ | halex2005/pjsettings | /tests/pjsettings-jsoncpp.tests.cpp | UTF-8 | 14,148 | 2.859375 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | #include <boost/filesystem/operations.hpp>
#include <catch/catch.hpp>
#include <iostream>
#include <pjsettings-jsoncpp.h>
#include <pjsua2/endpoint.hpp>
#include "SimpleClass.h"
using namespace Json;
using namespace pj;
using namespace pjsettings;
SCENARIO("read json from string", "[jsoncpp]")
{
const char *jsonS... | true |
3c8cd695d2c1c5e1abecf7b0fad1260fff54d4c9 | C++ | mviseu/Coursera_algorithms_I | /Week5/interval_tree/IntervalTree.h | UTF-8 | 1,091 | 3.265625 | 3 | [] | no_license | #pragma once
#include <algorithm>
#include <iostream>
#include <memory>
#include <utility>
#include <vector>
struct Interval {
Interval(int low, int high) : lo(low), hi(high) {}
int lo;
int hi;
};
bool operator==(const Interval& lhs, const Interval& rhs);
bool operator!=(const Interval& lhs, const Interval& rhs);
... | true |
2391710dea1e679ad76644b2b32fd3f4a49610fe | C++ | rishup132/Codeforces-Solutions | /educational/round1/B.cpp | UTF-8 | 602 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin >> s;
int m;
cin >> m;
while(m--)
{
int x,y,k;
cin >> x >> y >> k;
x--;
y--;
k %= (y-x+1);
string t = "";
for(int i=0;i<x;i++)
t += s[i];
i... | true |
67bd6561a73d2ad03edc8f280b07951f4d07b030 | C++ | JosiasWerly/Gumball | /GumballCore/WidgetOverlay.hpp | UTF-8 | 2,407 | 2.640625 | 3 | [] | no_license | #ifndef _widgetoverlay
#define _widgetoverlay
#include "RenderSystem.hpp"
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
class WidgetOverlay;
class Widget;
class WidgetOverlay :
public IRenderOverlay {
friend class Widget;
ImGuiIO *guiIO = nullptr;
std::list<Widget *>... | true |
d18b9a00db6d24203ea37c9dec090caa361365b1 | C++ | MrBattary/darkest-castle | /src/game/systems/collisionSubsystems/EnemyCollision.cpp | UTF-8 | 3,414 | 2.53125 | 3 | [
"MIT"
] | permissive | //
// Created by Battary on 03.08.2020.
//
#include "game/systems/collisionSubsystems/EnemyCollision.h"
void EnemyCollision::updateData(ecs::World& world, std::shared_ptr<ecs::Entity> first,
std::shared_ptr<ecs::Entity> second) {
auto playerPosComp = first->getComponent<LocationCompo... | true |
d8fdf1429d991c11d62bcecaaab637cb8e4dde60 | C++ | yananliu000/Projects | /GlarekEngineProject/Engine/Engine/Source/Application/Graphic/SFMLGraphic.cpp | UTF-8 | 5,579 | 2.609375 | 3 | [] | no_license | #ifdef _SFML
#include <SFML/Graphics.hpp>
#include "SFMLGraphic.h"
#include "../Window/IWindow.h"
#include "../Texture/SFMLSprite.h"
#include "../Texture/SFMLTexture.h"
#include "../../Utility/MyLogger.h"
//Warning: sfml-graphic-s-d works for debug x64
// -d not
using Engine::SFMLGraphic;
sf::RenderWindow* SFMLGra... | true |
486d415ea82c8353ae65246c86a205a62f3c2e4a | C++ | DaeunSim/coding-practice | /HackerRank/30 Days of Code (C++)/Day 05 Loop/Solution.cpp | UTF-8 | 450 | 2.71875 | 3 | [] | no_license | /*
Author: https://www.hackerrank.com/profile/AvmnuSng
Difficulty: Easy
Submitted By: https://www.hackerrank.com/challenges/30-loops/leaderboard
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
cin.ignore(numeric_limits<streamsize>::max(), '\n');
if (n < 2 || n > ... | true |
ffeb8eceeaa8f85312204f01415e6c1432330206 | C++ | bradelement/coding_exercise | /leetcode-master/055/main.cpp | UTF-8 | 281 | 2.625 | 3 | [] | no_license | class Solution {
public:
bool canJump(vector<int>& nums) {
int max_pos = 0;
for (int i=0; i<nums.size(); i++) {
if (i > max_pos) return false;
max_pos = max(max_pos, nums[i]+i);
}
return true;
}
}; | true |
03c1130afab35065e556aebf2231fb9da6817edf | C++ | colemancda/rhubarb-lip-sync | /src/animation/Viseme.cpp | UTF-8 | 1,712 | 2.703125 | 3 | [
"LicenseRef-scancode-other-permissive",
"WTFPL",
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"BSD-3-Clause",
"BSL-1.0",
"BSD-2-Clause"
] | permissive | #include "Viseme.h"
VisemeOption::VisemeOption(Shape shape) :
VisemeOption(shape, shape, shape, shape, shape)
{}
VisemeOption::VisemeOption(Shape nearB, Shape nearC, Shape nearD, Shape nearE, Shape nearF) :
VisemeOption(nearB, nearB, nearC, nearD, nearE, nearF, nearB, nearC, nearB)
{}
VisemeOption::VisemeOption(Sh... | true |
de4147498acf1ed336f21bc5e88f4a30d82a85f5 | C++ | jylongzhao/MyReXueShaCheng | /Classes/BgMapFloorTile.cpp | UTF-8 | 1,169 | 2.5625 | 3 | [] | no_license | #include "BgMapFloorTile.h"
BgMapFloorTile::BgMapFloorTile():m_fileName(NULL),m_sprite(NULL),m_nIsDisplay(false){
}
BgMapFloorTile::~BgMapFloorTile(){
CC_SAFE_DELETE(m_fileName);
}
void BgMapFloorTile::displayImageView(){
if(m_nIsDisplay==false){
m_nIsDisplay=true;
CCTextureCache::sharedTextureCache()->addIm... | true |
517ca75903af50e788ac753d7cf21b3294ce0aff | C++ | pastacolsugo/coderfarm-2021-avanzato | /lezioni/lezione1/ois_streetlights/ois_streetlights_70.cpp | UTF-8 | 835 | 2.71875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
ifstream fin("input.txt");
ofstream fout("output.txt");
int main() {
int n, m, k;
fin >> n >> m >> k;
// leggo i valori delle lampade
vector<int> v(n);
for(int &i : v) {
fin >> i;
}
// contiene la risposta (answer)
int ans = 0;
... | true |
d599c44d1c7bcac28ee85f5f103e9abc44f4d21d | C++ | Marinovsky/AlgorithmsUN2021I | /Data Structures/week3_hash_tables/3_hash_substring/hash_substring.cpp | UTF-8 | 2,271 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using std::string;
using std::vector;
using std::cout;
using std::cin;
using std::endl;
typedef unsigned long long ull;
struct Data {
string pattern, text;
};
Data read_input() {
Data data;
std::cin >> data.pattern >> data.text;
return data;
}
l... | true |
2acbd826effa887e42d0fca3d8b0eb390fcc97e6 | C++ | agabrielson/MatlabOpenSSL | /mexRandom.cpp | UTF-8 | 3,504 | 2.90625 | 3 | [] | no_license | /* mexEVP_Decrypt.cpp
* Examples:
* reference readme.txt
*
* Notes:
* Lots - reference readme.txt
*
* To Build:
* Reference buildMex
*
* Author:
* Anthony Gabrielson
* agabrielson@me.com
* 3/30/2010
*
* Modifications:
*
*/
#include "mex.h"
#include "matlabIO.hpp"
#inclu... | true |
f6d44cd0d2b27b4b1cc45009f25b9ae8057b7a6f | C++ | praneyrai/Online-Judge-Solns | /SPOJ/PIE.cpp | UTF-8 | 867 | 2.59375 | 3 | [] | no_license | #include "bits/stdc++.h"
using namespace std;
const double pi = acos(-1);
const double eps = 0.0000001;
int n, r[10010], f;
bool func(double v) {
int cnt = 0;
for (int i = 0; i < n; i++) {
double kk = 1.0 * pi * r[i] * r[i] / v;
cnt += (int)kk;
}
... | true |
cc3b77dc4d2a8640423f1d8c07f0d98c9b7814ae | C++ | ZihengZZH/Project_Cpp | /ConsoleGame_Dice/main.cpp | UTF-8 | 4,107 | 3.65625 | 4 | [] | no_license | #include <sstream>
#include <iomanip>
#include "autotest.h"
#include "autoplayer.h"
#include "player.h"
using namespace std;
/*
The sequence of the game should be specified explicitly
maybe in the generic sequence with which they were created
*/
// Function to receive a valid integer input
inline int... | true |
6be7325762b947c2b8c955c4a59c37262f255b1e | C++ | ikr/exercism | /cpp/allergies/allergies.cpp | UTF-8 | 853 | 2.953125 | 3 | [
"MIT"
] | permissive | #include "allergies.h"
#include <unordered_map>
namespace {
const std::unordered_map<std::string, unsigned int> bitcodes_by_substance{
{"eggs", 1}, {"peanuts", 2}, {"shellfish", 4}, {"strawberries", 8},
{"tomatoes", 16}, {"chocolate", 32}, {"pollen", 64}, {"cats", 128}};
} // namespace
namespace all... | true |
b9813e27c9b5b215a10dd24a343cd7fc0bea69e9 | C++ | yojoecool/ArchitectureProjects | /pipeSim.cpp | UTF-8 | 14,001 | 2.671875 | 3 | [] | no_license | /*
* Added:
* NOP Counter
* IC
* C
* Branch now adds a NOP - Done seperately from the normal NOP for 2 reasons:
* 1. Easy way to avoid increasing currentText
* 2. Easier to add things to this NOP if we need to, since it is a seperate case
* Fetch has been changed to handle this new NOP
* opA and opB have been added... | true |
e2290ce697b0f619cfcdce3268fb89c1c91c35fc | C++ | zhuwenboa/data_struct | /data/leetcode/codecc字节/113.cpp | UTF-8 | 1,186 | 3.546875 | 4 | [] | no_license | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *r... | true |
ddd910a0ea7fd66572f368ebe0c717e6e51b1158 | C++ | souravs17031999/data_structures_algorithms | /LINKED LISTS/doubly_linked_list_inserting_deletion.cpp | UTF-8 | 2,320 | 4.1875 | 4 | [] | no_license | // program for Insertion and deletion of nodes in doubly linked lists
// @author sourav kumar , 08-02-2019
#include<iostream>
using namespace std;
struct node{
int data;
node *next;
node *prev;
};
class linked_list{
private:
node *head;
public:
linked_list(){
head = NULL;
}
void insert_beg(int n){
... | true |
33610ef3d701720fa24984fa1e0b2204c7947296 | C++ | jonathan2222/SimpleLUACompiler | /AST/Symbols.hh | UTF-8 | 771 | 2.890625 | 3 | [] | no_license | #ifndef SYMBOLS_HH
#define SYMBOLS_HH
#include <unordered_map>
#include <string>
#include "Data.hh"
class BBlock;
struct Symbol
{
Symbol() {}
Symbol(Data::Type type) { data.type = type; }
unsigned int size = 0;
int arg = -1; // arg < 0: no argument, else argument at position arg.
std::string toString() const;
... | true |
bead5df562e9c0c34920943e1a8e235259d56e06 | C++ | T4G2/grx | /core/src/nodes/camera_node.cpp | UTF-8 | 4,796 | 2.546875 | 3 | [] | no_license | /**
* @file camera_node.cpp
* @author your name (you@domain.com)
* @brief
* @version 0.1
* @date 2021-05-22
*/
#include "camera_node.hpp"
#include "glm/gtx/transform.hpp"
#include "scene.hpp"
#include "GLFW/glfw3.h"
#include <glm/gtc/type_ptr.hpp>
#include "scene_manager.hpp"
#include "iapplication.hpp"
void Ca... | true |
24b20a16fb406d28e0f34fe81564d7913fe4c952 | C++ | sebacagnoni/juegoDeLaVida | /TPI-toroide/tests/EJ13_vistaTrasladadaTEST.cpp | UTF-8 | 2,417 | 3 | 3 | [] | no_license | #include "../ejercicios.h"
#include "gtest/gtest.h"
#include <algorithm>
using namespace std;
TEST(vistaTrasladadaTEST, muevoTerceraFilaParaArriba){
toroide t1 = {
{true, false, false}, // 1
{false, true, false}, // 2
{false, false, true}};// 3
toroide t2... | true |
c94a42289010744b49c2515645894b90fd5203a8 | C++ | GregoryAlbarian/PunnettSquares | /Gene.cpp | UTF-8 | 281 | 2.90625 | 3 | [] | no_license | #include "Gene.h"
Gene::Gene(char allele1, char allele2)
{
this->allele1=&allele1;
this->allele2=&allele2;
}
Gene::~Gene()
{
delete allele1;
delete allele2;
}
char Gene::getAllele1()
{
return *allele1;
}
char Gene::getAllele2()
{
return *allele2;
} | true |
d77b2c84aa4bff767c9f092f6cc81ca9ea873adb | C++ | Herbet-filho/pet_fera | /Entrega_final/src/classes_animal/mamifero_exotico.cpp | UTF-8 | 1,296 | 2.71875 | 3 | [] | no_license | #include "mamifero_exotico.hpp"
MamiferoExotico::MamiferoExotico(){}
MamiferoExotico::MamiferoExotico(string nutricao, string risco_extincao, bool periculosidade,
string id, string especie, string sexo, string fecundacao,
string pelagem, string deslocamento, string reg... | true |
1c4a347a5ced8f46d74895788a7416407fcb6826 | C++ | Gyubin-Lee/MineSweeper | /Array_ver/cellChained.h | UTF-8 | 2,077 | 3.4375 | 3 | [] | no_license | #ifndef C_CHAIN_H
#define C_CHAIN_H
#include "cell.h"
#include <iostream>
class cellChain;
class cellNode
{
friend class cellChain;
public:
cellNode(Cell *cell_)
{
cell = cell_;
next = 0;
down = 0;
}
private:
Cell *cell;
cellNode *next;
cellNode *down;
};
class ... | true |
089c8b76f841db211873cbce0f0a53cdf62a05c0 | C++ | RiverHamster/OI-Works | /testpack/wen/2018.1.4/src/吕毅/elephant.cpp | UTF-8 | 395 | 2.78125 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
freopen("elephant.in","r",stdin);
freopen("elephant.out","w",stdout);
int t,n;
cin>>t;
while(t--)
{
int ans=0;
cin>>n;
while(1)
{
if(n-10>=0){n-=10;ans++;}else break;
}
while(1)
{
if(n-5>=0){n-=5;ans++;}else break;
}
whi... | true |
52602ea81f710ce70ba54cd12aeb456b128315ca | C++ | jatin0101/Montecarlo-simulations | /MonteCarlo.cpp | UTF-8 | 973 | 2.78125 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<ctime>
#include<cstdlib>
using namespace std;
int main()
{
int timesteps = 30;
int volatility = 2; //2 %
int max_simulations = 5000;
float starting_price = 600;
float path[max_simulations][timesteps+1];
// Timesteps + 1 is for the starting price at... | true |
4d486f47e6295b71116acce020b9ab9ab2ef6d8c | C++ | harshadmanglani/Coursework | /OOPL/Virtual_Functions.cpp | UTF-8 | 1,669 | 3.765625 | 4 | [] | no_license |
/
*
Inheritance and virtual functions
*/
#include <iostream>
using namespace std;
// Base class
class Shape {
protected:
int width;
int height;
public:
virtual void displayArea()=0; //pure virtual function
void setWidth() {
cout<<"Enter parameter 2: "; ... | true |
3cb6ce4a6388de6ce151a9e18bb90756737477ea | C++ | sfofgalaxy/Summary-of-Software-Engineering-Coursework-in-Zhejiang-University | /2大二/面向对象程序设计/project/3170105860_彭子帆/source code/oop_image/oop_image/contrast.cpp | UTF-8 | 843 | 2.59375 | 3 | [] | no_license | #include"menu.h"
#include"factor.h"
#include"header.h"
void Menu::contrast_funtion()
{
int pixels = image->width() * image->height();
unsigned int *data = (unsigned int *)image->bits();
int red, green, blue, nRed, nGreen, nBlue;
float param = 1 / (1 - contrast_value) - 1;
for (int i = 0; i < p... | true |
be30b3d3b22a45366781aa27484be9dc02af9d9a | C++ | themagex1/DreamOS | /Pamiec.cpp | UTF-8 | 3,811 | 2.703125 | 3 | [] | no_license | //Made by Gregory Matczak
#include "Pamiec.hpp"
#include "PCB.hpp"
#include "Includes.hpp"
//funkcja koduj�ca adres
unsigned int Pamiec::zakoduj_adres(unsigned int index_strony, unsigned int offset)
{
return (index_strony << WIELKOSC_STRONY_WYKLADNIK) + offset;
}
//funkcja dekoduj�ca adres
void Pamiec::dekoduj_ad... | true |
364501efddf6b52e97534ec4e67237da493b22fc | C++ | MarkZH/Genetic_Chess | /src/Moves/Move.cpp | UTF-8 | 6,728 | 2.6875 | 3 | [
"MIT"
] | permissive | #include "Moves/Move.h"
#include <cassert>
#include <cctype>
#include <string>
#include "Game/Board.h"
#include "Game/Square.h"
#include "Game/Game_Result.h"
#include "Game/Piece.h"
#include "Utility/String.h"
Move::Move(const Square start, const Square end) noexcept : origin(start), destination(end)
{
assert(... | true |
2b3b423b03344ee3754f8da4e288d5e7072a024c | C++ | lucaschf/LP-2021 | /Lpas/Lpas/Lpas/MaquinaExecucao.cpp | UTF-8 | 7,509 | 2.796875 | 3 | [] | no_license | #include "MaquinaExecucao.h"
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include "Utils.h"
#include "Constants.h"
MaquinaExecucao::MaquinaExecucao()
{
numeroDeProgramas = 0;
registrador = 0;
}
bool MaquinaExecucao::carregar(Programa programa)
{
if ((numeroDeProgramas >= NUMER... | true |
588f6140894bffc07d70262df4c7354a6327bc62 | C++ | thomaslandry1/ComplexVectors | /ComplexVector.cpp | UTF-8 | 3,119 | 3.078125 | 3 | [] | no_license | //
// Created by Thomas Landry on 5/17/17.
//
#include "ComplexVector.h"
#include <iostream>
#include <iomanip>
#include <fstream>
using std::cout;
using std::cin;
using std::endl;
using std::setw;
const int PRECISION = 1;
const int WIDTH = 2;
ComplexVector::ComplexVector() {
}
ComplexVector::ComplexVector(double ... | true |
b12b598d86d0acf9e75028db69be81f928d0ddd8 | C++ | sirraghavgupta/cpp-data-structures-and-algorithms | /concepts/DP_reduceNumTo1.cpp | UTF-8 | 1,776 | 3.59375 | 4 | [] | no_license | /*##############################################################################
AUTHOR : RAGHAV GUPTA
DATE : 28 November 2019
AIM : find the minimum number of steps required to reduce a number to 1
operations permited are -
/ by 3
/ by 2
subtract 1
STATUS : !!! success !!!
##########################... | true |
d7b9717a646a59f41d9589bd2fac7c7bc4d4cf7c | C++ | Pacharoth/TP | /ex1.cpp | UTF-8 | 2,026 | 4.0625 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct Element{
int data;
Element *next;
};
struct List{
int n;
Element *head;
Element *tail;
};
//create empty list
List *createList(){
List *ls;
ls= new List();
ls->n =0;
ls->head=NULL;
ls->tail=NULL;
return ls;
}
//create functi... | true |
6ecc8820d9add25cec6bdefdfa4ee0b1b2613897 | C++ | Zamidation/CSE4600_HW1 | /Part 2/pipe4.cpp | UTF-8 | 1,534 | 3.078125 | 3 | [] | no_license | //pipe4.cpp (data producer)
//To run code
//g++ pipe4.cpp -o pipe4
//g++ pipe5.cpp -o pipe5
// ./pipe4 "write message here."
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
int data_processed;
int file_pipes[2];
char userinput[100]; //unini... | true |
29be40530b53a10064b4055a33e250e692baa216 | C++ | ellynhan/challenge100-codingtest-study | /hall_of_fame/c0np4nn4/boj/cpp/2_slv/slv5_4673/self_number.cpp | UTF-8 | 587 | 3.328125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int get_self_num(int a) {
int res = a;
while (a > 0) {
res += (a % 10);
a /= 10;
}
return res;
}
int main() {
int num_table[10001];
for (int i = 0; i < 10001; i++) {
num_table[i] = i;
}
for (int i = 1; i < 10001; i++) {
int t = i;
if ... | true |
340de447df92509c4571e8b4704e2d6cc741395d | C++ | NoahNode/AlgorithmsLinkedList | /practical7/ArrayList.h | UTF-8 | 6,847 | 3.859375 | 4 | [] | no_license | /**
* ArrayList.h
*
* Generic Dynamic ArrayList based on array
* with advanced copy and equality operators
* @author Aiden McCaughey
* @email a.mccaughey@ulster.ac.uk
* @version 1.2
*/
#ifndef ARRAYLIST_H
#define ARRAYLIST_H
#include "Array.h"
#include <exception>
#include <iostream>
template <class T>
c... | true |
f035272c61391feab4ab6a962752ade93b69575f | C++ | yangjietadie/db | /sqlite3/sqlite3query.hpp | UTF-8 | 955 | 2.65625 | 3 | [] | no_license | /*
** Copyright (C) 2015 Wang Yaofu
** All rights reserved.
**
**Author:Wang Yaofu voipman@qq.com
**Description: The header file of class Sqlite3Query.
*/
#pragma once
#include <vector>
#include <string>
#include "sqlite3.h"
// START_NAMESPACE
class Sqlite3Query {
public:
enum Status {
OK,
FAILE... | true |
68b115f87e30f565cb02e04d3fa0f165081c3451 | C++ | Bltzz/CPP_300 | /cpp_d13_2019/ex04/Toy.cpp | UTF-8 | 1,184 | 3.046875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2019
** cpp_pool
** File description:
** Toy.cpp
*/
#include "Toy.hpp"
Toy::Toy() : type(BASIC_TOY), name("toy"), pic(Picture()) {}
Toy::Toy(ToyType const type, std::string name, std::string const pic) : type(type), name(name), pic(Picture(pic)) {}
Toy::Toy(Toy const &t) : name(t.name), type(... | true |
96592b9d8e901dce624ff4dc0ce30e80aff4fd1a | C++ | samumartinf/Cplusplus | /Second Assignment/Assignment2.cpp | UTF-8 | 4,721 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <sstream>
#include <vector>
#include <fstream>
using std::vector;
using namespace std;
//Classes
class DNA_DB{
public:
string fileName;
DNA_DB();
string getFileName(){
return fileName;
}
void setFileName(string name){
fileName = name;
}
};
DNA_DB::DNA... | true |
fab31c9021dbc75f812f272ad73971f3da0998e5 | C++ | Dhruv-m-Shah/Competitive-Programming | /DMOJ/Stalactities/Stalactities.cpp | UTF-8 | 1,682 | 2.515625 | 3 | [] | no_license | #include <iostream>
using namespace std;
long long BIT[251][251][251];
long long ASIZE, num1, num2, num3, num4, num5, i, j, q, x1, y1, z1, x2, y2, z2;
char hold;
void update(long long x, long long y,long long z, long long val)
{
for(long long i = x; i<=ASIZE;i+=(i&-i))
{
for(long long j = y; j<=ASIZE;j+... | true |
12c63d9ab609edbd1b6b89114d6df1c3aabbf51f | C++ | Zuprex/CS103-Parameters | /CS103-Parameters.cpp | UTF-8 | 213 | 2.765625 | 3 | [] | no_license |
#include <iostream>
int minimumNum(int Array[], int max ) {
int minValue = 100;
}
int main()
{
const int maxCap = 5;
int value[maxCap] = { 1,2,3,4,5 };
minimumNum(value, maxCap);
} | true |
4a42d1c78669bc2348cb0df17cfe9ad578fb11d2 | C++ | sbhonde1/apex_simulator | /lsq_entry.cpp | UTF-8 | 3,297 | 2.59375 | 3 | [] | no_license | //
// @author: sonu
// @date: 12/10/18.
//
#include "lsq_entry.h"
#include "helper.h"
using namespace std;
int LSQ_entry::getM_index() const {
return m_index;
}
LSQ_entry::LSQ_entry(int which_ins, int dest_reg, int store_reg,
int store_reg_value, int is_store_reg_valid) {
this->m_which_ins = which_ins;
this->m... | true |
558a0412a90ddfb0fe8583033f32bf58b75d4b33 | C++ | misch-da/roof | /game/gamepanel.cpp | UTF-8 | 2,298 | 2.53125 | 3 | [] | no_license | #include "gamepanel.h"
#include "../game/objects/bulletbehavior.h"
GamePanel::GamePanel(QWidget *parent) : QWidget(parent)
{
health_txt.setText("health:");
health_txt.setAlignment(Qt::AlignRight);
health_count.setText("--");
health_count.setAlignment(Qt::AlignLeft);
weapon_txt.setText("weapon:");
... | true |
68b730e2263c075a41251373bc3b1377e20bdc7a | C++ | CedricGuillemet/Shatter | /Shatter.cpp | UTF-8 | 20,018 | 3.265625 | 3 | [
"MIT"
] | permissive | #include "Shatter.h"
#include <math.h>
#include <float.h>
#include <assert.h>
#include <memory.h>
struct Vec4
{
public:
Vec4(const Vec4& other) : x(other.x), y(other.y), z(other.z), w(other.w)
{
}
Vec4()
{
}
Vec4(float _x, float _y, float _z = 0.f, float _w = 0.f) : x(_x), y(_y), z(_z), w(_w)
{
}
Vec4(int _x... | true |
fd325d06da346f4301af231bdf44bdc446f461a7 | C++ | yaoyaoding/hidet-artifacts | /include/hidet/logging.h | UTF-8 | 949 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <iostream>
#include <sstream>
#include <hidet/common.h>
struct ErrorState {
bool has_error;
std::string error_msg;
static ErrorState *global();
};
struct HidetException: std::exception {
std::string file;
int line;
std::string msg;
HidetException(std::string file, i... | true |
89708f7395afb15f184280aba852120cca5903ff | C++ | juanfrandm98/PR_ED_2019 | /p3/solucion/pila_max_int/include/pila_max.h | UTF-8 | 3,035 | 3.625 | 4 | [] | no_license | /**
* @file pila_max.h
* @brief Fichero cabecera del TDA Pila max
*
* Gestiona una secuencia de elementos con facilidades para la inserción y
* borrado de elementos en un extremo.
*
*/
#ifndef __Pila_max_H__
#define __Pila_max_H__
#include "cola.h"
#include "pareja.h"
#include <cassert>
/**
*
* @br... | true |
093d8027f1877aa0a1e34b6318902d179e015a92 | C++ | Raghavan098/competitive-programming | /algos/Aho.cpp | UTF-8 | 680 | 2.53125 | 3 | [] | no_license | const int ms = 400;
const int eps = 10;
int c = 1;
int trie[ms][eps];
int fail[ms];
int addWord(std::string str) {
int on = 0;
for(auto ch : str) {
if(trie[on][ch - 'a'] == 0) {
trie[on][ch - 'a'] = c++;
}
on = trie[on][ch - 'a'];
}
return on;
}
void buildAho() {
std::queue<int> q;
q.push(0);
whil... | true |
ebc171147ef6635fc56dc60134c8cceccc2d5808 | C++ | sinomiko/56wlk | /cmmse/lab/libsource4/connectpool/output/strategy.h | GB18030 | 4,585 | 2.578125 | 3 | [] | no_license | /***************************************************************************
*
*
**************************************************************************/
/**
* @file strategy.h
* @brief
*
**/
#ifndef __STRATEGY_H_
#define __STRATEGY_H_
#include "connection.h"
namespace comcm{
enum{
//--- erre... | true |
984dbc775053bcfa7aaa8610ed9aea233422c29a | C++ | Johnny0179/ccr4 | /src/robot/r5_controllers/r5_controllers.h | UTF-8 | 944 | 2.515625 | 3 | [] | no_license | #pragma once
#include "inter_core_com.h"
class r5_controllers
{
private:
/* data */
// motor id
static const u8 kUpPalm_ID = 1;
static const u8 kUpWheel_ID = 2;
static const u8 kPulley1_ID = 3;
static const u8 kPulley2_ID = 4;
static const u8 kDownClaw1_ID = 5;
static const u8 kDownClaw... | true |
2f2a1f0664e8a900af931106a64dad483dd74952 | C++ | MaGnsio/100-days-of-code | /Problems/Codeforces/Codeforces Round #674 (Div. 3)/E. Rock, Paper, Scissors.cpp | UTF-8 | 1,049 | 2.6875 | 3 | [] | no_license | //https://codeforces.com/problemset/problem/1426/E
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
ll mod = 1e9 + 7;
int main ()
{
ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0);
int n;
cin >> n;
vector<int> a(3), b(3);
for (a... | true |
246d0ec3937000eb1c43411a4c1187443aed8903 | C++ | guzhen518/TryEngine | /Common/TryLinkList.cpp | GB18030 | 4,093 | 3.1875 | 3 | [] | no_license | #include "TryLinkList.h"
CLinkList::CLinkList()
{
}
CLinkList::~CLinkList()
{
}
LinkNode* CLinkList::CreateNode(int nData)
{
LinkNode* pNode = new LinkNode(nData);
return pNode;
}
bool CLinkList::AddNode(int nData)
{
LinkNode* pAddNode = CreateNode(nData);
if (NULL == pAddNode )
{
return false;
}
LinkNo... | true |
2a70857a1b66e65532f965f767d58515f1e488a6 | C++ | ysoftman/test_code | /cpp/korean_code_in_utf8_test.cpp | UTF-8 | 763 | 2.828125 | 3 | [
"MIT"
] | permissive | // ysoftman
// utf-8 인코딩으로 한글(11172자) 출력
#include <stdio.h>
using namespace std;
int main()
{
// utf-8 한글을 파일로 출력
FILE *fp = fopen("utf8-hangul.txt", "w");
// 한글 유니코드(UCS) 0xAC00(가) ~ 0xD7A3(힣) 11172자 -> utf-8 인코딩으로 변환
char hangul[3];
int cnt = 0;
for (unsigned short i = 0xAC00; i <= 0xD7A3; i++)
{
// 참고
... | true |
45f7018cc88100ab485a1fa21e0409f6a695252e | C++ | maidoufu/Coursera | /Structure/Week6_2.cpp | UTF-8 | 1,876 | 3.578125 | 4 | [] | no_license | //
// BST.cpp
// Structure
//
// Created by Song on 1/13/16.
// Copyright © 2016 Song. All rights reserved.
//
#include <iostream>
using namespace std;
template <class T>
struct BSTNode
{
BSTNode(const T& e, BSTNode* le=0, BSTNode* ri=0 )
{
el=e;left=le;right=ri;
}
T el;
BSTNode<T>*left... | true |
068575acfdab7479297bd3f26a2fd3ba012d4bd9 | C++ | lambdai/ssl-impl | /test/test_common.cc | UTF-8 | 959 | 2.78125 | 3 | [] | no_license | #include "test_common.h"
#include <stdio.h>
#include <stdlib.h>
#include "gtest/gtest.h"
void EXPECT_HEX_EQ(const std::vector<unsigned int> &lhs,
const std::string &rhs) {
const unsigned char *display_hash =
reinterpret_cast<const unsigned char *>(lhs.data());
std::vector<char> display(l... | true |
57f0a43405d2e69dcc262f6a48f45db7f1c9813f | C++ | kuonanhong/UVa-2 | /11952 - Arithmetic.cpp | UTF-8 | 22,859 | 2.90625 | 3 | [] | no_license | /**
UVa 11952 - Arithmetic
by Rico Tiongson
Submitted: June 13, 2013
Accepted 0.015s C++
O(16) time
*/
#include<cstdio>
#include<cstring>
#include<iostream>
#include<vector>
#include<list>
#include<deque>
#include<algorithm>
#include<functional>
using namespace std;
#define BIGINT_CONTAINER deque<i... | true |
d8b5bacd2433c8de17cd7882a27d582b904dd74e | C++ | AIS-Bonn/stillleben | /src/animator.cpp | UTF-8 | 1,358 | 2.84375 | 3 | [
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Animate a 6D pose
// Author: Max Schwarz <max.schwarz@ais.uni-bonn.de>
#include <stillleben/animator.h>
#include <Corrade/Containers/Array.h>
#include <Magnum/Math/Quaternion.h>
#include <stdexcept>
using namespace Magnum;
namespace sl
{
Animator::Animator(const std::vector<Matrix4>& poses, unsigned int ticks... | true |
363f599c471c691253d23b175f56e3c8f22df8d6 | C++ | consistent-loser/Dynamic-Programming | /weight job scheduling.cpp | UTF-8 | 1,337 | 2.828125 | 3 | [] | no_license | // weighted job scheduling using dynamic programming
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
pair<int,int>a[n]; // first for the ending time and second for the starting time
map<pair<int,int>,int>m; //map for storinfg the weights
for(int i=0;i<n;i++){
pair<int,int>p;
c... | true |
44d6d1fccdfc1462aa75c752b32ace71bf414343 | C++ | randreshg/RayTracer_Javeriana | /Anexo 3. RayTracer software/RayTracer/src/RayTracing/Scene.cpp | UTF-8 | 1,313 | 3.546875 | 4 | [] | no_license | /*---------------------------------CLASS DEFINITION--------------------------------*/
class Scene
{
public:
/*----------------------------------ATTRIBUTES---------------------------------*/
Color background;
Array<Primitive*> primitives;
Array<Light> lights;
/*---------------------------------... | true |
a894d76aceb1dd5298ad1058928378e1c02ddaaf | C++ | jeffamaxey/Heston-Hull-White | /HestonHullWhiteFiniteDifference/Schemes/European/Examples/BaseADIScheme/A3.h | UTF-8 | 1,787 | 2.53125 | 3 | [] | no_license | #ifndef HESTONHULLWHITEFINITEDIFFERENCE_SCHEMES_EUROPEAN_EXAMPLES_BASEADISCHEME_A3_H
#define HESTONHULLWHITEFINITEDIFFERENCE_SCHEMES_EUROPEAN_EXAMPLES_BASEADISCHEME_A3_H
// A3 implements the calculation of the partial terms in the r-direction the Heston-Hull-White PDE using an explicit scheme.
#include <memory>
... | true |
3fc46715a7a13b8c473c98e568d51e8270e30729 | C++ | SilvanVR/DX | /DX/Common/src/Include/OS/Threading/thread_pool.h | UTF-8 | 3,574 | 3.28125 | 3 | [] | no_license | #pragma once
/**********************************************************************
class: ThreadPool (thread_pool.h)
author: S. Hau
date: October 21, 2017
Manages a bunch of threads via a job system. A job is basically
just a function. A job will be executed by an arbitrary thread.
When... | true |
5e26613193d6dd3860873954dbd0d443705a7183 | C++ | Akamatsu21/CardCutter | /main.cpp | UTF-8 | 1,694 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <QDir>
#include <QImage>
const QString DIR(QDir::currentPath() + "/");
const int COLS = 10;
const int ROWS = 7;
int main(int argc, char *argv[])
{
if(argc != 2)
{
std::cout << "Need exactly one argument! Please provide the name of the file." << std::endl;
return 1... | true |
1c48eb037188eb4acee318bf096c50393a570168 | C++ | D3E0/RTA | /Solved/Multi-University Training Contest/H-Diff-prime Pairs.cpp | UTF-8 | 984 | 2.875 | 3 | [] | no_license | //============================================================================
//Name:牛客多校第三场 H Diff-prime Pairs 素数筛
//https://www.nowcoder.com/acm/contest/141/H
//============================================================================
#include<iostream>
#include<cstring>
using namespace std;
const int N = 7000... | true |
bcd35b1beaadcae5c1aeef3b7b7a8d9c0f68b21f | C++ | luckycoder-git/PUBG-Cheat-By-huoji-and-Lee | /ConsoleApplication1/scm.cpp | UTF-8 | 2,000 | 2.5625 | 3 | [] | no_license | #include "stdafx.h"
#include <stdio.h>
BOOL ScmCreateService(
_Out_ PHANDLE ServiceHandle,
_In_ LPCWSTR ServiceName,
_In_opt_ LPCWSTR DisplayName,
_In_ LPCWSTR BinPath,
_In_ ACCESS_MASK DesiredAccess,
_In_ ULONG ServiceType,
_In_ ULONG StartType,
_In_ ULONG ErrorControl
)
{
SC_HANDLE Scm;
WCHAR Qu... | true |
8de335c61ec566f1003251b447ee4263e0d19dad | C++ | bhargavchippada/CompilersLab | /lab5/test.cpp | UTF-8 | 710 | 2.78125 | 3 | [] | no_license | // #include <stdio.h>
int remake(int z, float u){
float x, y;
u = y;
z = 2;
return 0;
}
// int remake(int z, int u, float y){
// return 3.0*4;
// }
float swap(int p, int q){
int x;
x=1;
return 1;
}
int main()
{
int x, y;
// float z;
int p[4][5];
// int k[4];
y = 5;
x = y;
// t = x;
p[2][3] = 5;
// ... | true |
dc49351fd3c24f882ab051acc63f482454be0222 | C++ | K00226160/2019-c-plus-plus | /lect08-02-overidingboss/lect08-02-overidingboss/main.cpp | UTF-8 | 235 | 2.5625 | 3 | [] | no_license | #include "Enemy.h"
#include "overridingboss.h"
int main()
{
cout << "Enemy object:\n";
Enemy anEnemy;
anEnemy.Taunt();
anEnemy.Attack();
cout << "\n\nBoss object:\n";
Boss aBoss;
aBoss.Taunt();
aBoss.Attack();
return 0;
}
| true |
ad40ed5ec0148e578811dd9c4c337851a82ff76a | C++ | kevin57545/Shopping-Platform | /ShoppingPlatform.cpp | UTF-8 | 32,545 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <fstream>
using namespace std;
class Commodity;
class Store;
class InputHandler;
class InputHandler {
public:
/*
* The function is used to read a full line into a string variable.
* It read the r... | true |
fff17935182a5283075bb7ab8fd804637b64e064 | C++ | fuzzpault/UIndy-CSCI240-2018 | /W15-HashTables/Lab15-HashTable-Starter/HashTable.h | UTF-8 | 2,205 | 3.578125 | 4 | [] | no_license | #ifndef HASHTABLE_H
#define HASHTABLE_H
/* Name: // Fill me in
Date: Dec 3, 2018
Desc: Hash table implementation
*/
#include <string>
#include <sstream>
#include <iostream>
#include <stdexcept>
#include <cassert>
#include <vector>
using namespace std;
struct TableEntry_t{
string thing;
bool stored;
};
... | true |
c4a4929f784b3aad5fe5feadd9687f7849e47254 | C++ | Lee-DongWon/Baekjoon_Problems | /2753.cpp | UTF-8 | 319 | 2.546875 | 3 | [] | no_license | #include <stdio.h>
int main() {
int n;
int result;
scanf("%d", &n);
if (n % 4 != 0) {
result = 0;
}
else {
if (n % 100 != 0) {
result = 1;
}
else {
if (n % 400 == 0) {
result = 1;
}
else {
result = 0;
}
}
}
printf("%d", result);
return 0;
} | true |
ee5d2f540515c222b32ac23b0a7af748e6a6ae40 | C++ | rahuls-19/c | /cut_rod.cpp | UTF-8 | 578 | 2.65625 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
using namespace std;
int cut_rod(int p[],int n);
int memo_cut_rod_aux(int p[],int n,int r[]);
int main(void){
int p[100];
int n,i,t;
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&p[i]);
t=cut_rod(p,n);
printf("%d",t);
return 0;
}
int cut_rod(int p[],int n){
int r[100],i;
for(i=1... | true |
ff828a2272c925625b655f9d9ff0f8a3f2c5aaaf | C++ | BITXUJI/C---primer--code-note | /numbered-p448.cpp | UTF-8 | 598 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <random>
#include <cstdlib>
class numbered
{
public:
numbered() : mysn(std::rand()) {}
numbered(const numbered &s) : mysn(std::rand()) {}
numbered &operator=(const numbered &s)
{
mysn = std::rand();
return *this;
}
int mysn;
};
void f(const numbered ... | true |
a4115ebca92242d1b8f112d433eb390e2058137c | C++ | AljonViray/CPP_Coursework | /proj3/HashMap.cpp | UTF-8 | 9,236 | 3.359375 | 3 | [] | no_license | // HashMap.cpp
//
// Code made by Aljon Viray, ID: 86285526
// ICS 45C Winter 2019
// Project #3: Maps and Legends
#include "HashMap.hpp"
namespace
{
unsigned int myHasher(const std::string& string)
{
unsigned int hashNumber = 0;
//Sum up ascii/int value of each character in the string
... | true |
41a25c2704cc63903c697559d166baa204652aec | C++ | kylechow2580/GreyPhotoGenerator | /main.cpp | UTF-8 | 968 | 2.59375 | 3 | [] | no_license | #include <opencv2/core/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/opencv.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
using namespace cv;
int main(){
string folderName = "Input/"... | true |
bee788fcd03928336e6c556972cf88b091027d23 | C++ | DASnoeken/cppLinAlg | /MatrixException.h | UTF-8 | 311 | 2.71875 | 3 | [] | no_license | #pragma once
#include <string>
#include <exception>
class MatrixException: public std::exception
{
public:
MatrixException(const char* name);
const char* getWhat() const;
std::string toString();
friend std::ostream& operator<<(std::ostream& os, const MatrixException& me);
private:
std::string _what;
};
| true |
15ff35b7769957fde378b2f4b249228aa5aa4895 | C++ | leroy-0/Piscine_CPP | /cpp_d10/ex01/Character.cpp | UTF-8 | 1,554 | 2.9375 | 3 | [] | no_license | //
// Character.cpp for Project-Master in /home/tekm/tek1/cpp_d10/ex01
//
// Made by leroy_0
// Login <leroy_0@epitech.eu>
//
// Started on Fri Jan 13 13:07:10 2017 leroy_0
// Last update Fri Jan 13 13:07:10 2017 leroy_0
//
#include <iostream>
#include <string>
#include "Character.hh"
#include "AWeapon.hh"
Chara... | true |
be0e598d9dc5c007a68f040329d1d1d8a78a9627 | C++ | weld-project/clamor | /clamor/net-util.h | UTF-8 | 1,104 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | #ifndef NET_UTIL_H
#define NET_UTIL_H
#include <boost/functional/hash.hpp>
#include <stdint.h>
#include <string>
typedef struct Addr {
std::string ip;
uint32_t port;
Addr() {
ip = "";
port = 0;
}
Addr(std::string s_ip, uint32_t s_port) {
ip = s_ip;
port = s_port;
}
std::string str... | true |
2d8ce537343ba9d1dcecde98207bca79de41b215 | C++ | lurker0/PEkernel | /project/pipe_windbg/pipe_windbg/pipe_windbg.cpp | GB18030 | 1,721 | 2.59375 | 3 | [] | no_license | // pipe_windbg.cpp : ̨Ӧóڵ㡣
//
// NamedPipe_host.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include "windows.h"
HANDLE gPipeHnd = NULL;
BOOLEAN
BlComInitialize(
UINT8 PortNumber,
UINT32 BaudRate
)
{
return TRUE;
}
BOOLEAN
BlComSendByte(
UINT8 PortNumber,
UINT8 Byte
)
{
DWORD dwWritten;
if (!Wri... | true |
4d70beda01ae6c842992bbcd5e1b3f0bca632024 | C++ | Rasec09/Algorithms_and_Data_Structures | /Graph/TopologicalSort.cpp | UTF-8 | 2,512 | 2.96875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
const int INF = 1e9;
vector<vi> AdjList;
vi dfs_num, topologicalSort, dist, numPaths;
void OrdenTopologico(int u) {
dfs_num[u] = 1;
for (int i = 0; i < AdjList[u].size(); ++i) {
int v = AdjList[u][i];
if (dfs_num[v] == -1)
OrdenTopologico... | true |
2fef8509603abd2f25feb30dc29715da256dc93c | C++ | MatthewMcGonagle/ProgrammingExercises | /cpp/LeetCode002AddTwoNumbers/main.cpp | UTF-8 | 6,057 | 4.03125 | 4 | [] | no_license | /**
main.cpp
Author: Matthew McGonagle
LeetCode Problem 002: Add Two Numbers.
Numbers are represented as a linked list of digits in reverse order. The purpose is to then
make a function Solution::addTwoNumbers that will find the linked list representation of their sum.
Current solution passes a... | true |
36e67a34f0dc2275f157277cd03502d1b590610e | C++ | cuiopen/GameServer-11 | /tools/FileUtils.h | UTF-8 | 3,048 | 3.203125 | 3 | [] | no_license | /**
* @file FileUtils.h
* @brief 文件工具
* @author zhu peng cheng
* @version 1.0
* @date 2018-01-03
*/
#ifndef _FILE_UTILS_H
#define _FILE_UTILS_H
#include <INIReader.h>
#include <map>
#include <iostream>
#include <sys/stat.h> // stat()
//#include <sys/type.h> // S_IFDIR
//#include <
namespace GameTools
{
class ... | true |
f4a6aa59dcf4bf2a9e8c0806810788b8c97c99de | C++ | aasispaudel/Cplusplus-course-jacobs | /SEM_2/A1/try.cpp | UTF-8 | 575 | 3.21875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main () {
int** matrix = new int*[5];
for (int i = 0; i < 5; i++) {
matrix[i] = new int[8];
}
for (int i =0; i < 5; i++)
for (int j = 0; j < 10; j++)
matrix[i][j] = i*j;
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 10; j++) {
cout ... | true |
edc179ed9a2600c05d80bc26dbadf9e3153545e7 | C++ | thiagovas/QIF | /channel/vulnerability/guessing.h | UTF-8 | 1,071 | 2.703125 | 3 | [] | no_license | #ifndef _channel_vulnerability_guessing_h
#define _channel_vulnerability_guessing_h
#include "../channel.h"
#include "vulnerability.h"
namespace channel {
namespace vulnerability {
class Guessing : public Vulnerability {
public:
// V(X)
double VulnerabilityPrior(const Channel& channel) const override;
... | true |
4f6e21696d0ae22065e4805547a6153af2c6895b | C++ | kuningfellow/Kuburan-CP | /yellowfellow-ac/UVA/10646/14229596_AC_0ms_0kB.cpp | UTF-8 | 506 | 2.578125 | 3 | [] | no_license | //UVA 10646 What is the Card?
#include <bits/stdc++.h>
using namespace std;
int main(){
int tc,kas=1;
cin>>tc;
while (tc--){
string ar[52];
for (int i=0;i<52;i++){
cin>>ar[i];
}
int y=0;
int ptr=51-25;
for (int i=0;i<3;i++){
int x=10;
if (ar[ptr][0]>='2'&&ar[ptr][0]<='9')... | true |
4203894c095c9430189ff29fbafa21ccdf2f9590 | C++ | NathPrz/Intro-Cpp | /tinycar/mission5/question2.cpp | UTF-8 | 1,513 | 3.53125 | 4 | [] | no_license | //Programme pour gérer un panier
#include <iostream>
#include <string>
using namespace std;
//Fonction qui calcule et rajoute la TVA pour chaque accesoire.//
double calculePrixTTC(double prixHT)
{
double tva = 0.2;
return prixHT * (1 + tva);
}
int main()
{
//Inisialisation des pointeurs
string *acceso... | true |
17ed725dcc2f73ff8cfc66341185b37f97f64d4d | C++ | pablodavid97/cpp-projects | /Polynomial/Polynomial_Driver.cpp | UTF-8 | 1,917 | 3.390625 | 3 | [] | no_license | /*****************************************************
* Polynomial_Driver.cpp
*
* Manejador para pruebas de la clase Polynomial
*
* Crea varios objetos Polynomio y prueba sus
* capacidades.
*/
#include <iostream>
#include <cstdlib>
#include "Polynomial.h"
using namespace std;
Polynomial test1(int d);
Polynom... | true |
6c0a31f0a59a852a877bc5c19ad535a7c23bf43a | C++ | klanderfri/CardReaderLibrary | /CardReaderLibrary/WindowsMethods.cpp | UTF-8 | 3,748 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include "WindowsMethods.h"
#include <iomanip>
#include <windows.h>
#include <Lmcons.h>
#include "boost\filesystem\path.hpp"
using namespace std;
WindowsMethods::WindowsMethods()
{
}
WindowsMethods::~WindowsMethods()
{
}
string WindowsMethods::ToString(const wstring &wstringToConvert)
{
//Imple... | true |
a11c437b12fba313eb122235651bdc9205bfb7b1 | C++ | Elvis2000717/Cpp | /并查集.cpp | GB18030 | 530 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class UnionFindSet
{
UnionFindSet(int n)
{
//ռ仹ʼ
_v.resize(n, -1);
}
int FindRoot(int x)
{
while (_v[x] >= 0)
{
x = _v[x];
}
return x;
}
bool Union(int x1, int x2)
{
int index1 = FindRoot(x1);
int index2 = FindRoot(x2);
//ͬĸ
i... | true |
bf44e3a29c9a6a5b47992076ad50d34da77f29bc | C++ | FactorialN/chishiki | /include/computation/geometry/color.h | UTF-8 | 607 | 2.984375 | 3 | [] | no_license | /*
* This file defines the base class of color.
*/
#ifndef __COMPUTATION_GEOMETRY_COLOR_H__
#define __COMPUTATION_GEOMETRY_COLOR_H__
#include <computation/linear/linearhead.h>
/*
* Color class is from Vector class
*/
class Color : public Vector{
public:
/*
* Several Ways to Construct a Color Object
*/
... | true |
958460c551e72c6c6e9e71a9cabc8c86bb1cb241 | C++ | ZhenyingZhu/ClassicAlgorithms | /src/CPP/src/SolutionCollection.h | UTF-8 | 770 | 2.6875 | 3 | [] | no_license | #ifndef SRC_SOLUTIONCOLLECTION_H_
#define SRC_SOLUTIONCOLLECTION_H_
#include <vector>
namespace myutils {
class SmartPtr;
class SolutionCollection {
/* A singleton class
* Contain a vector of pointers of Solutions
*/
public:
static SolutionCollection* getInstance();
SolutionCollection() { }
... | true |
1ec3aba6cb89b44623c8bc903fbefcbd909a44bd | C++ | samahuja642/competitive-programming | /atcoder/contest/1st contest/180.cpp | UTF-8 | 390 | 2.53125 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie();
cout.tie();
string s;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.length();i++){
if(s[i]=='6'){
s[i]='9';
}
else if(s[i]=='9'){
... | true |
1947b95e6f4ae43be33eb1e8ad74e04d93d67b04 | C++ | prijuly2000/Data-Structure | /Assignment solution/Assignment 2/2/Node.cpp | UTF-8 | 373 | 3.484375 | 3 | [] | no_license | #include"Node.h"
Node::Node(Emp &employee)
{
this->employee=employee;//overload operator=
this->next=NULL;
}
Node *Node::getnext()
{
return next;
}
Emp Node::getdata()
{
return employee;
}
void Node::setnext(Node*next)
{
this->next=next;
}
void Node::display()
{
employee.display();
}
ostream & operator<<(o... | true |
f2f9f7335b4072bf265ef91e4c6041d70eaf1346 | C++ | SorcererX/SepiaStream | /defs/sepia/comm/observerbase.h | UTF-8 | 2,220 | 2.625 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef SEPIA_COMM_OBSERVERBASE_H
#define SEPIA_COMM_OBSERVERBASE_H
// thread
#include <thread>
#include <mutex>
#include <condition_variable>
// containers
#include <vector>
#include <list>
#include <unordered_set>
// protobuf
#include "header.pb.h"
namespace sepia
{
namespace comm
{
class ObserverBase
{
public:
... | true |
bd875f919f654e88043c825f633c9b3b048366cc | C++ | yaojingguo/book-reading | /programming_pearls/column4/5.cc | UTF-8 | 334 | 3.390625 | 3 | [] | no_license | // http://en.wikipedia.org/wiki/Collatz_conjecture
#include <stdio.h>
bool even(int x)
{
return (x & 1) == 0;
}
void f(int x) {
printf("x:\n");
while (x != 1) {
printf(" %d\n", x);
if (even(x))
x /= 2;
else
x = 3 * x + 1;
}
}
int main(int argc, const char *argv[])
{
f(2);
f(7);
... | true |
81c4e92c1064eaff10bbd52a192ce43847439073 | C++ | wrren/piston | /user/library/include/piston/process/injector.h | UTF-8 | 3,724 | 3.359375 | 3 | [] | no_license | #ifndef PISTON_PROCESS_INJECTOR_H
#define PISTON_PROCESS_INJECTOR_H
#include <piston/core/types.h>
#include <piston/process/process.h>
#include <filesystem>
#include <exception>
namespace Piston
{
/**
* @brief Facilitates injection of shared libraries into processes.
*
*/
class Injector
{
... | true |
d5dab8f0f4c2ad3f18917e7e5debb4277fd9e633 | C++ | fit087/scientific_programming | /binar.cpp | UTF-8 | 1,280 | 3.0625 | 3 | [] | no_license | /* @file binar.cpp
\brief arquivo binario
Vantagens menor espaco ocupado
Velocidade na Leitura ou escritura pois
poupa o parsing
Leitura direta nao sequencial
*/
#include <iostream> ///< Input and Output on screen and read keyboard
#include <fstream> ///< This library contains the methods ... | true |
4201ff14f1512640f119ece0ccc51b769382ed00 | C++ | william31212/uva | /uva579/uva579.cpp | UTF-8 | 629 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(void){
#ifndef ONLINE_JUDGE
freopen("uva579.in","r",stdin);
freopen("uva579.out","w",stdout);
#endif
float hour=0;
float min=0;
char garbage;
float tmp=0;
float ans=0;
while(cin >> hour >> garbage >> min... | true |
ae712e931de60e49f922411950c60303dcf854d2 | C++ | ferranmafe/PRO2-Text-Library | /Frase.cc | UTF-8 | 1,147 | 3.09375 | 3 | [] | no_license | /** @file Frase.cc
@brief Còdig de la classe Frase
*/
#include "Frase.hh"
Frase::Frase(){}
Frase::~Frase(){}
void Frase::modificar_frase( const list<string>& frase ){
//Canvia el contingut del paràmetre frase al que passem per referència.
this->frase = frase;
}
void Frase... | true |