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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ea58141c17f5d12cc084b2044c57c281610e4c16 | C++ | yair-go/sadna-examples | /lesson1/Rect.h | UTF-8 | 722 | 3.359375 | 3 | [] | no_license |
// name:
// ID:
#pragma once
#ifndef RECT_H
#define RECT_H
#include<iostream>
using namespace std;
class Rect
{
private:
int length, width;
public:
//ctor
//Rect(){length=width=1;}
////Rect(int a, int b){length=a; width=b;}
//Rect(int a, int b):length(a),width(b){}
//Rect(int x){length=width=x;}
//... | true |
1d7fac089ba96989de9840f63a941b656afe97a5 | C++ | omssp/CollegePracticals | /DAAP/EXP8.cpp | UTF-8 | 1,687 | 3.578125 | 4 | [] | no_license | // prim's algorithm
#include "iostream"
#include "bits/stdc++.h"
class Prim {
private:
int V;
int **graph;
int *key;
int *parent;
bool *MSTset;
public:
Prim( int V ) {
this->V = V;
graph = new int*[V];
for (int i = 0; i < V; ++i) {
graph[i] = new int[V];
}
key = new int[V];
parent = new int[V];
... | true |
aa36af3a0e9e3af3128e9c350c694b32396b22fe | C++ | hzhou/usaco | /1902/demo/revegetate_bronze.cpp | UTF-8 | 1,156 | 2.671875 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <cstdio>
#include <algorithm>
int main(int argc, char** argv)
{
FILE* In = fopen("revegetate.in", "r");
if (!In) {
fprintf(stderr, "Can't open In\n");
exit(-1);
}
int N;
int M;
fscanf(In, " %d %d" ,&N,&M);
int A[M];
int B[M]... | true |
1b5d1e1612d20c1fd2887e628b347be92831a35a | C++ | CE-02FED/HARFS | /diskNodes/storageBlock.h | UTF-8 | 732 | 2.75 | 3 | [] | no_license | #ifndef RES_STORAGEBLOCK_H_
#define RES_STORAGEBLOCK_H_
#include <string>
#include "../res/structs/linkedList.h"
#include "../res/vector.h"
using namespace std;
class StorageBlock {
private: //Atributos
string _name;
int _tipo;
int _tipoRaid;
Vector<string>* _esquema;
/** Estructuras posibles */
LinkedList* _l... | true |
860bbcddf576f249d47ba33c51db56811603ea30 | C++ | zzz1114/Learn_OOP | /OOP/案例:制作饮品.cpp | GB18030 | 1,327 | 3.46875 | 3 | [] | no_license | //#include <iostream>
//
//// boil ˮ
//// crew
//// pour in cup 뱭
//
//class AbstractDrinking
//{
//public:
// //ĸ裺ˮ - - 뱭 - 븨
// void Water() { std::cout << "ˮ" << std::endl; }
// virtual void Crew() = 0;
// void PourInCup() { std::cout << "ݺˮ뱭 " << std::endl; }
// virtual void AddOther() = 0;
/... | true |
d64068bb5036406b351ded9390be40146bd76b28 | C++ | emevonlou/philosophycpp | /src/06.cpp | UTF-8 | 734 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <locale.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "");
char eme[] = {0x1b, '[', '1', ';', '3', '4', 'm', 0};
cout << eme;
int i = 6;
const char n = 'n';
for (i = 0; i <= 6; i++)
{
if (n)
{
cout << i << endl;
}
cout << "Friedrich Nietzsch... | true |
99a58b8afdbd76ca005fdf91bc1d78ce2f027b01 | C++ | mrlzla/sarkisyan_labs | /lab3_2/customer.h | UTF-8 | 744 | 3.109375 | 3 | [] | no_license | #ifndef CUSTOMER_H
#define CUSTOMER_H
#include "basictypes.h"
class Customer
{
private:
std::map<std::string, boost::any> props;
public:
Customer(std::string name, std::string contact_phone, double revenue);
std::string GetName(){return boost::any_cast<std::string>(props["name"]);}
std::string GetCon... | true |
09a873f735d8fcd7d349dea6038d9b48890aacf7 | C++ | MikeS96/autonomous_landing_uav | /drone_controller/include/drone_controller/pid.h | UTF-8 | 1,961 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* @file pid.h
* @author Miguel Saavedra (miguel.saaruiz@gmail@gmail.com)
* @brief PID controller header files
* @version 0.1
* @date 05-01-2020
*
* Copyright (c) 2020 Miguel Saavedra
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associate... | true |
9144da044352202ce88d2c104d978122128ef8d9 | C++ | PrateekJain999/cpp-Codes | /B Multiple.cpp | UTF-8 | 601 | 3.28125 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
class College
{
public:
string name;
void getname(string n)
{
name=n;
}
};
class Year
{
public:
int years;
void getyear(int y)
{
years=y;
}
};
class Student:public College,public ... | true |
21964fd15d6264a6175b654a11c16dc5b9bb29b1 | C++ | Good-Morning/echo | /client.cpp | UTF-8 | 1,721 | 2.734375 | 3 | [] | no_license | #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <string>
#include <exception>
#include <algorithm>
#include "utils.h"
int _main(int argc, char** argv) {
u_int32_t addr_ip4;
if (argc >= 2) {
... | true |
56700af21a91716f2db97534a90b801c871e0fdd | C++ | Mumbaikar007/Code | /Logics/Arduino's map.cpp | UTF-8 | 260 | 2.859375 | 3 | [] | no_license | //
// Created by optimus on 8/1/18.
//
# include <iostream>
using namespace std;
int main(){
int a = 1;
int b = 10;
int c = 1;
int d = 100;
int x = 5;
int y = ( (double) (x-a) / (b-a) ) * (d-c) + c;
cout << y;
return 0;
} | true |
b84839fcb194083234f883f90ebd7158a272ff81 | C++ | StefanFabian/ros_babel_fish | /ros_babel_fish/include/ros_babel_fish/babel_fish.h | UTF-8 | 6,855 | 2.625 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2019 Stefan Fabian. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#ifndef ROS_BABEL_FISH_BABEL_FISH_H
#define ROS_BABEL_FISH_BABEL_FISH_H
#include "ros_babel_fish/generation/description_provider.h"
#include "ros_babel_fish/g... | true |
55eda0738aeebf554b0f7ea8e66bab67b0ae5f4a | C++ | E1P0TR0/Algorithms-and-Data-Structures_2 | /Hash Tables/Hashes.hpp | UTF-8 | 1,537 | 3.625 | 4 | [] | no_license | #pragma once
#ifndef __HASH_HPP__
#define __HASH_HPP__
#include <iostream>
#include <vector>
#include <cmath>
template <typename T>
class Hash
{
private:
std::vector<T> vect;
public:
Hash(int size);
int hash(T data);
void insert(T data);
int search(T data);
void dleted(T data);
bool primeN... | true |
4d95f2e17d0eccba781c4e8134e528010f837c50 | C++ | neizod/problems | /acm/uva/136-ugly-number.cpp | UTF-8 | 2,190 | 3.359375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
using namespace std;
long double pow(int base, int exponent) {
if (exponent == 0) {
return 1;
}
return (exponent % 2 == 0 ? 1 : base) * pow(base*base, exponent/2);
}
bool found_ugly(int index, vector<long double> numbe... | true |
95925ca754d5225970c8ec0f8dd2735e8e2a252c | C++ | Tomas-Homola/PG_cv8 | /src/SurfaceRepresentation.cpp | UTF-8 | 5,602 | 2.71875 | 3 | [] | no_license | #include "SurfaceRepresentation.h"
// Vertex stuff
Vertex::Vertex(double x, double y, double z, int index)
{
this->x = x;
this->y = y;
this->z = z;
this->index = index;
edge = nullptr;
}
void Vertex::setCoordinates(double newX, double newY, double newZ)
{
x = newX;
y = newY;
z = newZ;
}
void Vertex::setVert... | true |
36263098418a01c88c66ab5f84c084ba492a37b7 | C++ | dzamkov/ChronoTank | /ChronoTank/src/vehicle.h | UTF-8 | 564 | 2.515625 | 3 | [] | no_license | #ifndef CTANK_VEHICLE_H
#define CTANK_VEHICLE_H
#include <irrlicht.h>
#include "nullity/object.h"
namespace ctank {
/// Enumeration of vehicle control values that can be set.
enum VehicleControl {
VehicleControlFoward,
VehicleControlTurn,
};
/// Interface to a vehicle that moves n stuff.
class IVehicle : ... | true |
8a152c75cb8270e3e624d5eaa3bf9dbc78d840b5 | C++ | Kripash/CS-477 | /hw5/heap.cpp | UTF-8 | 1,822 | 4.4375 | 4 | [] | no_license | //author KRIPASH SHRESTHA
//CLASS CS 477
//ASSIGNMENT HOMEWORK 5
//FILE HEAP
//This program DOES CHECK FOR MAX HEAP.
#include <iostream>
bool isMaxHeap(int array[], int size);
//This function prints out the elements of the array and checks if it is a maxHeap or not by calling isMaxHeap and then properly o... | true |
6d7ec8befe03266462fa5671b47871881d36ad0b | C++ | lpxxn/code | /src/libs/comdatagui/detail/tableviewbase.cpp | UTF-8 | 2,564 | 2.5625 | 3 | [] | no_license | #include "tableviewbase.h"
#include <QDebug>
#include <QMouseEvent>
namespace ComDataGui
{
static const qreal ZoomInDelta = 1.2;
static const qreal ZoomOutDelta = 0.8;
TableViewBase::TableViewBase(QWidget *parent) :
QTableView(parent), m_lastRow(-1), m_zoomFactor(1.0)
{
}
void TableViewBase::resetLastRow()
{
... | true |
86d4fda3ca21ddf262241129031b44c051e7c5ef | C++ | gorylpe/FlexBisonCompiler | /cmds/CommandsBlock.h | UTF-8 | 4,141 | 2.90625 | 3 | [] | no_license | #pragma once
#include "Command.h"
class CommandsBlock : public Command {
public:
vector<Command*> commands;
CommandsBlock() = default;
CommandsBlock(const CommandsBlock& block2){
for(auto cmd : block2.commands){
addCommand(cmd->clone());
}
}
CommandsBlock* clone() co... | true |
9ad7a8a132c534133624cb0a2f46d959505a8d7f | C++ | lab132/PyBind | /PyBindUnit/src/BindingTests.cpp | UTF-8 | 5,783 | 2.953125 | 3 | [] | no_license | #include "catch.hpp"
#include "PyBindUnit.hpp"
#include <string>
bool calledFunction = false;
void TestFunction1()
{
calledFunction = true;
}
struct Function2Result
{
int i;
unsigned char b;
char B;
short h;
unsigned short H;
unsigned int I;
unsigned long long K;
long long L;
bool p;
std::stri... | true |
d1602bccca1ce20aa5274ee73790746c5156971f | C++ | FinixLei/leetcode_finix | /src/41_hard_FirstMissingPositive.cpp | UTF-8 | 1,493 | 3.921875 | 4 | [] | no_license | /*
Given an unsorted integer array, find the smallest missing positive integer.
Example 1:
Input: [1,2,0]
Output: 3
Example 2:
Input: [3,4,-1,1]
Output: 2
Example 3:
Input: [7,8,9,11,12]
Output: 1
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
int firstMissingPos... | true |
e5926577b3d43a53fefb16ec065158f6c69a5191 | C++ | maayan92/experis_C_basicCpp | /cpp/ds/inchToCentimeter/inch.cpp | UTF-8 | 400 | 2.953125 | 3 | [] | no_license | #include "inch.h"
#include "centimeter.h"
Inch::Inch()
: m_value() {
}
Inch::Inch(double a_value)
: m_value(a_value) {
}
Inch& Inch::operator=(const Inch& a_inch) {
if(this != &a_inch) {
m_value = a_inch.m_value;
}
return *this;
}
Inch::operator Centimeter() {
return Centimeter(m_va... | true |
d43714e116aab7aad8d24e2a5d9d6f2aca22d37c | C++ | ichyo/atcoder-submissions | /cpp/ABC006/C.cpp | UTF-8 | 604 | 2.828125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
bool calc(int n, int m, int& a, int& b, int& c){
int k = m - 2 * n;
for(int C = 0; 2 * C <= k; C++){
int B = k - 2 * C;
int A = n - B - C;
if(A >= 0 && B >= 0 && C >= 0){
a = A, b = ... | true |
cf8c44ca3a5e9e493ad052068cdc65c9d13c5a38 | C++ | maksverver/lynx | /cpp/Lynx3.cpp | UTF-8 | 25,564 | 2.875 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
// Simulation heuristics parameters
const int EDGE_BIAS_THRESHOLD = 50; // Avoid playing at the edge for this number of simulation steps
// Tree search parameters
const int SAMPLES = 32; ... | true |
9505da2df99b277d4b2eb2f9035e1568146d5a54 | C++ | jarble/transpiler | /translated_functions/translated_functions.cpp | UTF-8 | 684 | 3.53125 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
template <class T>
void print(T a) {
std::cout << a << "\n";
}
template <class T>
int abs(T a){
return std::abs(a);
}
template <class T>
int len(T a){
return a.size();
}
template <class t1,class t2,class t3>t3 add(t1 A,t1 B){
return A+B;
}
int main ()
{
std::vector... | true |
2f11a2968f75eed00c44939eb5d21f618357bfeb | C++ | Finkman/json-schema-validator | /src/string-format-check.cpp | UTF-8 | 13,654 | 3.140625 | 3 | [
"MIT"
] | permissive | #include <nlohmann/json-schema.hpp>
#include <algorithm>
#include <exception>
#include <iostream>
#include <regex>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
/**
* Many of the RegExes are from @see http://jmrware.com/articles/2009/uri_regexp/URI_regex.html
*/
namespace
{
template <ty... | true |
c43777fac6887ee1edabc64eb94c202f4d5d7377 | C++ | marsteen/mvobjreader | /project/include/CRectT.hpp | ISO-8859-1 | 3,880 | 3.078125 | 3 | [] | no_license | /**********************************************************************
*
* CRect Modul
*
* (c) 2003 Martin Steen / imagon GmbH
*
* Version 1.0
*
* 07-2003
*
* Rechteck Klasse
*
************************************************************************/
template<class T>
T maxT(T a, T b)
{
return (a > b... | true |
1882d68b6ea7325afbeb6019fd3953c802bd5a88 | C++ | cliff000/TeamProject2019 | /TeamProject2019/State.h | SHIFT_JIS | 689 | 2.6875 | 3 | [] | no_license | #pragma once
#include "Image.h"
//O錾
class Unit;
class AttackState;
class DefenseState;
class ThrowState;
class BlockState;
class State
{
protected:
int img;
Unit* owner; //statȅ
public:
State();
~State();
virtual void update() {}
virtual void draw(int x, int y, double extRate, bool turnFlag);
void setOwne... | true |
a6b120647fa624ad9b1f464e67ce01fde7d4961c | C++ | xyuan/Tempest | /src/matrix.cpp | UTF-8 | 10,087 | 2.921875 | 3 | [] | no_license | /*!
* \file matrix.cpp
* \brief Class for simplified matrix storage & manipulation
*
* \author - Jacob Crabill
* Aerospace Computing Laboratory (ACL)
* Aero/Astro Department. Stanford University
*
* \version 0.0.1
*
* Flux Reconstruction in C++ (Flurry++) Code
* Copyright (C) 2014 Jacob C... | true |
c8b35ba0ec033681d204f5fe4e89c2b169578bc2 | C++ | Al3xDu/RezolvariInfo2021 | /subiecte/asd/20sub3ex1.cpp | UTF-8 | 313 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int b, n, c, k = 0, S = 0;
cout << "n=";
cin >> n;
cout << "b=";
cin >> b;
while (n)
{
c = n % 10;
S = S + pow(b, k) * c;
k++;
n /= 10;
}
cout << "S=" << S;
return 0;
} | true |
7b60ddde44108a3de5ee7b6a2feff30c2fd627df | C++ | yuta1024/aoj | /Volume 1/0113.cpp | UTF-8 | 678 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int p, q;
while (cin >> p >> q) {
int loop = -1;
vector<int> rem;
rem.push_back(p%q);
while (p != 0) {
p *= 10;
int tmp = p / q;
p %= q;
cout << tmp;
if (find(... | true |
3334940382c0e761e12a74eb2bcae4ef04352f9a | C++ | fatmaashraframadan/Problem_Solving | /CodeForces_Solutions_2/ShaassAndOskols.cpp | UTF-8 | 631 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
const int MAX = 100;
int main()
{
int n , nom_of_shots;
int arr[MAX];
cin >>n;
for(int i = 0 ; i < n ; ++i)
{
cin >> arr[i];
}
cin >> nom_of_shots;
for(int i = 0 ; i < nom_of_shots ; ++i)
{
... | true |
912f030071c0a5c4888bd91f5f77bca21310725c | C++ | kamelCased/learningCplusplus | /hw10_timed/2.cpp | UTF-8 | 885 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int* findMissing(int arr[], int n, int& resArrSize);
int main() {
int arr[7] = {0,3,2,5,4,2,5};
int missCount;
int* miss = findMissing(arr, 7, missCount);
for (int i = 0; i < missCount; i++) {
cout << miss[i] << " " << endl;
}
return 0;
}
i... | true |
4b5d3625bd29948f86148f00d661c0f64fadf866 | C++ | WishSun/TeamDocShare | /TeamDocShare/server/src/GroupManage.cpp | UTF-8 | 2,202 | 2.828125 | 3 | [] | no_license | /*************************************************************************
> File Name: GroupManage.cpp
> Author: WishSun
> Mail: WishSun_Cn@163.com
> Created Time: 2018年08月23日 星期四 19时21分59秒
************************************************************************/
#include "./GroupManage.h"
#include <assert.h>
/... | true |
4285db1959e5006ccf7a27ff24b51f8aa416c7fd | C++ | AlexTuckner/School_Projects | /Software Engineering Voting System/src/userInput.cpp | UTF-8 | 2,220 | 2.9375 | 3 | [] | no_license | /**
* @file userInput.cpp
*
*
*/
/*******************************************************************************
* Includes
******************************************************************************/
#include <string>
#include <iostream>
#include "userInput.h"
/********************************************... | true |
d98f61e7eada1241404f0fef6b6dece0dc44d93d | C++ | Learpcs/HashMap | /Source.cpp | UTF-8 | 2,656 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <random>
using namespace std;
//unsigned types doesn't work properly
template <class key, class value>
class HashMap
{
//nested class pairs (like pair xd)
template<class key, class value>
struct pairs
{
key Key;
value Value;
pairs& operator=... | true |
7c38192fdaecd65f7c2d555a525cb031ffe8d28d | C++ | timepp/bdlog | /tplogview/colorselector.h | UTF-8 | 1,256 | 2.53125 | 3 | [] | no_license | #pragma once
class CColorSelector : public CWindowImpl<CColorSelector, CStatic>
{
public:
void SetColor(COLORREF cr)
{
m_color = cr;
InvalidateRect(NULL);
}
COLORREF GetColor() const
{
return m_color;
}
CColorSelector() : m_color(0)
{
}
public:
BEGIN_MSG_MAP(CColorSelector)
MES... | true |
5eae77791faf904b6ea63ffe1255971738c62c3a | C++ | hyunny0463/ProblemSolving | /BOJ/15650_N과_M_(2).cpp | UHC | 850 | 3.140625 | 3 | [] | no_license | /*
* 15650. N M (2)
*
* ð : O(nCm)
*
* combination
* ⺻
* N ڿ M Ѵ.
*
*/
#define fastio() ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#include <iostream>
using namespace std;
int N, M; // ڿ ,
int t[8] = { 0 }; // 迭
void dfs(int d, int idx) { // , ε
if (d == M) { // ̰ ũⰡ
... | true |
2473b87e50f8e59357d495561cf2958804e0b357 | C++ | peide/Gray | /test/test_viewable.cpp | UTF-8 | 4,042 | 2.546875 | 3 | [
"MIT"
] | permissive | /*
* Gray: A Ray Tracing-based Monte Carlo Simulator for PET
*
* Copyright (c) 2018, David Freese, Peter Olcott, Sam Buss, Craig Levin
*
* This software is distributed under the terms of the MIT License unless
* otherwise noted. See LICENSE for further details.
*
*/
#include "gtest/gtest.h"
#include <cmath>
#... | true |
b9ddfea7bbd1262396b90351b9682495f2a32fe3 | C++ | Ryednap/Contest | /Ujjwal/Halim/Ch2/Linear/10264.cpp | UTF-8 | 1,070 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "uj.h"
#endif
// O(2^n * n) complexity
// Look at the statement how bogus it is . It's actually want's to say that for any two adjacent corner sum of all the weights of the reachable corner
// from those. Hence once first compute the potency of each ... | true |
870acc483245fc9e4371c9ee9ae67f6fa88891c9 | C++ | Yoruichigo/SurvivalDungeon | /SurvivalDungeon/FileSaveClass.cpp | SHIFT_JIS | 962 | 2.921875 | 3 | [] | no_license |
#include <stdio.h>
#include "FileSaveClass.h"
using namespace std;
/*
dat`fileName.datf[^݂邩mF
*/
bool FileSaveClass::FileCheckDat(string fileName)
{
string datName = fileName + ".dat";
FILE *fp;
if(fopen_s(&fp,datName.c_str(), "rb") != 0)
{
return false; // s
}
// f[^݂
fclose(fp);
return true;
}
/*
... | true |
11d42591a8f9ec41051ce92a39c0df11a37b367d | C++ | sahil-rajput/Algorithm-Implementation | /Library/graph/euler_tour_tree.cc | UTF-8 | 3,987 | 3.015625 | 3 | [] | no_license | //
// Euler Tour Tree
//
// Description:
// Maintain dynamic unrooted tree with supporting
// - make_node(x) : return singleton with value x
// - link(u,v) : add link between u and v
// - cut(uv) : remove edge uv
// - sum_in_component(u): return sum of all values in the component
//
... | true |
aad208470d85d4f807f1e6eff4c6e6b03e454f66 | C++ | allandemiranda/linguagem_de_programa-ao_IMD_2018.2 | /Aula 12/questões/questao 2/main.cpp | UTF-8 | 1,190 | 4.0625 | 4 | [] | no_license | /**
* @brief Questão 2
*
* @file main.cpp
* @author Allan de Miranda Silva
* @date 2018-09-24
*/
#include <iostream>
#include <iterator>
#include <algorithm>
#include <cstring>
using byte = unsigned char;
/**
* @brief Function called reverse that reverses the order of the elements located in a range defined ... | true |
a404ad1e4372625e8015c36e3d9a5e2d4699155a | C++ | l-iberty/MyCode | /CandC++/对象引用.cpp | GB18030 | 643 | 3.640625 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Demo {
private:
int data;
public:
Demo(int inData) {
data = inData;
}
int getData() {
return data;
}
void setData(int inData) {
data = inData;
}
void setData(Demo &p) {
data = p.data;
}
};
int main() {
Demo d1 = Demo(3);
Demo &r1_Demo = d1; //
/* ... | true |
b56ce1b9e4d1438386825366f99c90a3b8131cd2 | C++ | xsafran1/pepmc2 | /lrparser/conflict.hpp | UTF-8 | 1,252 | 2.859375 | 3 | [] | no_license | #ifndef LRPARSER_CONFLICT_HPP
#define LRPARSER_CONFLICT_HPP
#include <exception>
#include "parsing_action.hpp"
template <typename Nonterminal, typename ReduceAction>
class conflict_error
: public std::exception
{
public:
typedef parsing_action<Nonterminal, ReduceAction> action_type;
conflict_error(action_type new... | true |
6b26dd9dce227fc3c65f14dd295beec99e674abe | C++ | kennykthoang/UTD-CS-Assignments | /CS1136 - Computer Science Lab/Lab6_Optional.cpp | UTF-8 | 1,626 | 4.15625 | 4 | [] | no_license | // Lab6_Optional
// Sum of all integers within a range
//
// Program by: Kenny Hoang
#include <iostream>
using namespace std;
int main()
{
int larger; // variable of type int that holds the "larger"(first) integer inputted by the user
int smaller; // variable of type int that holds the "smaller"(second) integ... | true |
db36f24c0e918a7b21f128be8a63e947cfe4f57c | C++ | akaplyar/Abstract_VM | /includes/Token.hpp | UTF-8 | 1,559 | 2.625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Token.hpp :+: :+: :+: ... | true |
4471bbb302d8c47a310b3c72bdaad5de4b0e8ab6 | C++ | hristoivanov/master-ucm-GC | /p2/allInOne/freeglut project 3D/Roble.cpp | UTF-8 | 1,319 | 2.6875 | 3 | [] | no_license | #include "Roble.h"
Roble::Roble() {
//trash
int divs = 40;
float ratioTronco = 0.7f;
GLfloat alturaTronco = 6.0f;
GLfloat anchuraCopa = 2.5f;
numHijos = 3;
hijos = new Objeto3D*[numHijos];
hijos[0] = new Cilindro(ratioTronco, divs, divs);
hijos[0]->mT->setEscala(1.0, 1.0f, alturaTronco + 1.0f);
hijos[0]->m... | true |
dfe517c35f31b8c63175e0b2c33d07892f59555d | C++ | conglanjun/algorithm1 | /datastructure/Link_clj.cpp | UTF-8 | 3,288 | 3.046875 | 3 | [] | no_license | //
// Created by conglj-a on 2019/7/4.
//
#include <malloc.h>
#include <cstdlib>
#include <cstdio>
#include "Link_clj.h"
LinkList Link_clj::CreateList1(LinkList &L){
LNode* s;
int x;
L = (LinkList)malloc(sizeof(LNode));
L->next = NULL;
scanf("%d", &x);
while (x != 9999){
s = (LNode*)ma... | true |
1ff4ae9c19cddf551bc6f4ba2d0689fbdbfbd409 | C++ | JaroslawSlabik/game-bfc | /game_app/gui_items/map_of_pawn.cpp | UTF-8 | 8,643 | 2.53125 | 3 | [] | no_license | #include "map_of_pawn.h"
MapOfPawn::MapOfPawn(QObject *parent)
{
m_selected_pawn = std::make_pair(-1, -1);
m_selected_cell = std::make_pair(-1, -1);
m_selected_enemy_pawn = std::make_pair(-1, -1);
m_do_something = false;
}
MapOfPawn::~MapOfPawn()
{
m_map_of_pawn.clear();
}
void MapOfPawn::setPosi... | true |
86d123201d7f5ae7a03267cd3a4b17de1e3171a0 | C++ | vtwireless/crts | /bin/stdoutOverride.cpp | UTF-8 | 3,145 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <unistd.h>
#include <stdbool.h>
#include "crts/crts.hpp"
#include "crts/debug.h"
// This gets called before we can know whither or not we really need to do
// this, because we cannot parse command-line options before libuhd.so is
// loaded.
// If libboost*.so and libuhd.so get fixed, and ... | true |
77743e7cca62d570274b5c4b2f34a82c8fee2814 | C++ | mchmilar/RiskGroup | /BuilderDirector.h | UTF-8 | 505 | 2.734375 | 3 | [] | no_license | #ifndef DIRECTOR_H
#define DIRECTOR_H
#include <string>
#include <iostream>
#include "Map.h"
#include "MapBuilder.h"
#include "Game.h"
using namespace std;
class Director //Director
{
public:
void setMapBuilder(MapBuilder* mapBuild)
{
mapBuilder = mapBuild;
}
Map* getMap()
{
return mapBuilder->getMap();
}
... | true |
9ddb582d4cee6c8a1c90eb6eba96b276ac412a22 | C++ | mziobro/scene_recognition | /config.h | UTF-8 | 802 | 2.78125 | 3 | [] | no_license | #ifndef CONFIG_H
#define CONFIG_H
#include <QString>
/*!
* \brief The Config class is responsible for storing
* paths and other configurable settings
*
* \details Klasa wczytująca ścieżki do plików modelu YOLO
* i do streamu video
*/
class Config
{
public:
Config();
void read();
void save();
... | true |
b3708eb431e1017055d54ac5feece9f121d90ef1 | C++ | JohnGoods/assembly | /汇编/012_无符号数条件转移指令JA JNBE(大于)/012_无符号数条件转移指令JA JNBE(大于).cpp | GB18030 | 363 | 2.859375 | 3 | [] | no_license | // 012_תָJA JNBE().cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
printf("begin\n");
int a = 3, b = -5;
unsigned int a2 = a, b2 = b; //
if (a2 <= b2)//ja{
{
if (a <= b) //jg
{
printf("do this");
}
}
printf("end");
return 0;
}
| true |
ffe6fbb830f94ac712753e6c2de0a1733c2b80e6 | C++ | ShravanCool/spoj-classical | /NegativeScore.cpp | UTF-8 | 1,616 | 3.015625 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define SIZE 100000
class SegmentTree {
int tree[4*SIZE];
int parents[SIZE];
vector<int> elements;
int size;
int mergeNodes(int a, int b) { return std::min(a, b); }
public:
SegmentTree(vector<int> arr) : size(arr.size()) {
e... | true |
ae7dbef40c848b0b1a78db549f08315170a8c7aa | C++ | VipulKhandelwal1999/Data-Structures-Algorithms | /Leetcode/Tree/Maximum Difference between Node and Ancestor.cpp | UTF-8 | 851 | 3.625 | 4 | [] | no_license | /*
Intution: To make sure min/max values belong to an ancestor, we track min/max from the root till the leaf, and pick the biggest difference among all leaves.
and check if the difference between the (max_value - min_value) is greater than the current difference in such a case update the diff
*/
class Solu... | true |
6703f6ffb554521355a022dc68c8032c7e98dec7 | C++ | MrFICAX/StrukturePodataka | /Tudji labovi/LabPraktikum/Lab2HashTabilice/StruktureLab2Zad4/HashObject.cpp | UTF-8 | 638 | 3.234375 | 3 | [] | no_license | #include"HashObject.h"
HashObject::HashObject()
{
this->key = 0;
record = NULL;
next = NULL;
}
HashObject::HashObject(int br)
{
this->key = br;
record = NULL;
next = NULL;
}
HashObject::HashObject(int br, char* ime)
{
this->key = br;
this->record = ime;
}
HashObject::HashObject(int br, char* ime, HashObject* ob... | true |
e088570e684cd9e91e474e9759de93849b43da31 | C++ | jlegendary/CPP-Practice-Programs | /Federal Tax Calculator/main.cpp | UTF-8 | 8,051 | 3.375 | 3 | [] | no_license | //
// main.cpp
// Federal Tax Calculator
//
// Created by JLegendary on 8/24/15.
// Copyright (c) 2015 JLegendary. All rights reserved.
//
#include <iostream> //Input and output
void getInfo(int &numPerson, int &salary, int &standardExemption, int &pretaxSavings);
int taxAmount(int numPerson, int salary, int... | true |
436a62a97ca1d96a3b78b41fe5231d979bcbd231 | C++ | agudeloandres/C_Struct_Files | /data_structures/FILE3.CPP | UTF-8 | 1,880 | 2.96875 | 3 | [] | no_license | #include<iostream.h> //CREAR REGISTRO , ES UN ARCHIVO BINARIO
#include<stdio.h> // NO SE PUEDE EDITAR ESTUD.DAT
#include<fstream.h> // SOLO SE PUEDE CONSULTAR CON EL PROGRAMA FILE 2
#include<string.h>
#include<stdlib.h>
#include<conio.h>
void inse_inde (float,int);
//programa para el manejo de archiv... | true |
6293a5d681b85737bd99525707e3706bced25506 | C++ | jwqe764241/http-server | /lib/get_option/src/option_not_found_exception.hpp | UTF-8 | 463 | 3.203125 | 3 | [] | no_license | #pragma once
#include <string>
#include <exception>
namespace cmd
{
class option_not_found_exception : public std::exception
{
private:
std::string msg;
std::string option;
public:
option_not_found_exception(const std::string& message, const std::string& option)
: msg(msg), option(option)
{
}
con... | true |
6cd45167c26dc0baeae8b7f50472fc71cdc6cfae | C++ | Shao-Group/rnabridge-align | /src/hyper_node.cc | UTF-8 | 473 | 2.5625 | 3 | [
"BSD-3-Clause",
"BSL-1.0"
] | permissive | /*
Part of rnabridge-align
(c) 2019 by Mingfu Shao and The Pennsylvania State University.
See LICENSE for licensing.
*/
#include "hyper_node.h"
#include <cstdio>
hyper_node::hyper_node(const vector<int> &a, const vector<int> &b, int c)
{
origin = a;
todate = b;
count = c;
}
int hyper_node::print(int index) const
... | true |
05e7331cd5fb2b58383f04a9ece804496fd686f4 | C++ | theoden8/snake | /Image.cpp | UTF-8 | 1,813 | 3.15625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <fstream>
#include <sstream>
#include "Image.hpp"
Image::Image()
{
width = 0;
height = 0;
id = 0;
}
bool Image::load(const std::string &filename) {
std::ifstream File(filename.c_str(), std::ios::in | std::ios::binary);
unsigned char header[20];
/* std::cerr << "TGA ... | true |
4c5f8110034b2eda8d63150e85e077074a1aa25f | C++ | thaddeusdiamond/Social-Hierarchical-Learning | /src/Primitives/Student/CreateSensor.cc | UTF-8 | 3,223 | 2.890625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* @file
* @author Thaddeus Diamond <diamond@cs.yale.edu>
* @version 0.1
*
* @section DESCRIPTION
*
* This is the implementation for create controller/sensor
*/
/** @todo This should really have a unit test, but it's not super important
* since this is a pretty dumb sensor **/
#include "Student/Cre... | true |
6773d22066e78eb3e7a8a6ee2c2533df0761becb | C++ | PabloTabilo/codeforces-challenge | /problems_A/p30/p23_A_BlackJack.cpp | UTF-8 | 905 | 2.59375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int cardsVals[9] = {2,3,4,5,6,7,8,9,10};
int kingJack[2] = {10, 10};
int rQ[1] = {10};
int a1[1] = {1};
int a11[1] = {11};
n -= 10;
int poss = 0;
int res=0;
for(int i=0;i<9;i++){
if(cardsVals[i]... | true |
5346b4c79a72fcb0aabe2b091b693da5623e5172 | C++ | ervivekbind/kineticball | /MasterProgram.ino | UTF-8 | 170,686 | 2.65625 | 3 | [] | no_license | // Include the AccelStepper library:
#include <AccelStepper.h>
// Define stepper motor connections and motor interface type. Motor interface type must be set to 1 when using a driver:
#define dirPin 22
#define stepPin 23
#define dirPin 24
#define stepPin 25
#define dirPin 26
#define stepPin 27
#define dirP... | true |
349cc885c47988a88354157b60083d1265c9362f | C++ | ArtemMinder/Parking-Lot | /Bussiness_logic/motorcyclespot.h | UTF-8 | 332 | 2.671875 | 3 | [] | no_license | #ifndef MOTORCYCLESPOT_H
#define MOTORCYCLESPOT_H
#include "parkingspot.h"
class MotorcycleSpot : public ParkingSpot
{
public:
MotorcycleSpot(int const& newNumberOfSpot);
int getNumberOfSpot() const;
private:
int numberOfSpot = 0;
Types::SpotType type = Types::SpotType::Motorcycle;
};
#endif // MOTOR... | true |
693c8d97ac07976c20e222865c07ab71e7c55c2f | C++ | mandyedi/craftinginterpreters-cpp | /interpreter/lox/lox/token.h | UTF-8 | 1,856 | 3.34375 | 3 | [
"MIT"
] | permissive | #ifndef TOKEN_H
#define TOKEN_H
#include "token_type.h"
struct Null
{
template<typename T>
bool operator==( T const& rhs ) const
{
return false;
}
bool operator==( Null const& rhs ) const
{
return true;
}
bool operator<( Null const& rhs ) const
{
return false;
}
};
typedef std::variant<Null, double... | true |
c10d22776f8c7b4b638704c7ac580e62251b002b | C++ | Kaldie/GeRoBot | /motor/JointController.cpp | UTF-8 | 8,043 | 2.640625 | 3 | [] | no_license | // Copyright [2014] Ruud Cools
#include <macroHeader.h>
#include <JointController.h>
#include <ArduinoMotorDriver.h>
#include <StateSequence.h>
#include <SequenceVector.h>
#include <BaseJoint.h>
#include <BaseMotor.h>
#include <PinState.h>
#include <EndStop.h>
JointController::JointController()
:m_jointPointerVector... | true |
092e87dd645d425fb897b68af07437fa1609f92d | C++ | thousandvoices/memb | /src/huffman_encoder.cpp | UTF-8 | 3,207 | 3.015625 | 3 | [
"MIT"
] | permissive | #include "huffman_encoder.h"
#include "bit_stream.h"
#include <queue>
namespace memb {
namespace {
struct TreeNode {
uint8_t key;
size_t count;
std::shared_ptr<TreeNode> left;
std::shared_ptr<TreeNode> right;
};
struct TreeNodeComparator {
bool operator()(std::shared_ptr<TreeNode>& lhs, std::sh... | true |
026d54fb9e09f53a622c854f5850240579df5bf4 | C++ | hyojin38/Algorithm-code | /BOJ-Code/05567_결혼식/05567_결혼식.cpp | UHC | 1,176 | 2.59375 | 3 | [] | no_license | // 5567 ȥ
// 20210112
// hyojin
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
#define endl "\n"
#define MAX 1000
int N,M,Answer;
int Map[MAX][MAX];
int check[MAX];
queue<pair<int,int>> Q;
void Solution() {
for (int i = 1; i <= N; i++) {
if (Map[1][i] == 1) {
Q.push(make_pair(i,... | true |
c53a0d43b4f656dfa0b6314aee407a21671d4e3c | C++ | 7kia/OOD | /Lab4/Shapes/ShapeFactory.cpp | UTF-8 | 2,781 | 3.125 | 3 | [] | no_license | #include "stdafx.h"
#include "ShapeFactory.h"
using namespace std;
namespace
{
const std::vector<std::string> COMMANDS_NAME =
{
"Triangle" ,
"Rectangle" ,
"Circle"
};
const std::vector<int> AMOUNT_ARGUMENTS_FOR_COMMAND =
{
9 ,
7 ,
6
};
const std::string MESSAGE_INCORRECT_COMMAND = "Incorrect comman... | true |
47b653b15e3f8990d0f193e024725546b4882e2d | C++ | Rufian55/Cpp | /A Public Library/Library.cpp | UTF-8 | 11,118 | 3.203125 | 3 | [
"MIT"
] | permissive | /**********************************************************************************************************
** Author: Chris Kearns
** Date: 12/3/2015
** Description: Library.cpp is the Library class function implementation file and as such has the
** Library.hpp specification file included. Program is geared towards a... | true |
1007dc00537428cf2ff4543220d3b2d4507b789a | C++ | kl4kennylee81/Canon | /source/InputController.cpp | UTF-8 | 1,958 | 2.59375 | 3 | [] | no_license | //
// InputController.cpp
// Canon
//
// Created by Kenneth Lee on 3/29/17.
// Copyright © 2017 Game Design Initiative at Cornell. All rights reserved.
//
#include <stdio.h>
#include "InputController.hpp"
using namespace cugl;
bool InputController::_touch;
bool InputController::_isPressed;
Vec2 InputController::... | true |
293abdb7ec1ffd9b4e5c61d7ca5a883e3cf36170 | C++ | TimSnedden138/BinaryFilesFin | /BinaryFiles/SaveData.cpp | UTF-8 | 1,052 | 2.859375 | 3 | [] | no_license | //#include<iostream>
//#include<fstream>
//#include<string>
//using namespace std;
//int main() {
// string saveFile;
// fstream sFile;
// string SaveName;
// string Output;
// string deathCounter;
// string charLevel;
// string timePlayed;
// cout << "What would you like to call your save file"<<endl;
// cout << "Name... | true |
4a068b5cdc9c4cc99ae44935acb65df1fd1f5afa | C++ | raulhsant/algorithms | /C++/tests/problems/0152_sequential_digits_test.cpp | UTF-8 | 498 | 3.09375 | 3 | [
"MIT"
] | permissive | #include "../../problems/0152_sequential_digits.hpp"
#include <bits/stdc++.h>
#include "../../frameworks/catch.hpp"
#include "../../frameworks/asserts.hpp"
using namespace std;
TEST_CASE( "Sequential Digits" ) {
Solution sol;
vector<int> result1 = {123,234};
REQUIRE( areVectorsEqual(sol.sequentialDig... | true |
42dca48c1f113c07289e51e66e9a361e386439fd | C++ | c-shewchuk/454-design-project | /Pong/Puck.cpp | UTF-8 | 739 | 2.890625 | 3 | [] | no_license | //
// Created by Alex on 2018-09-20.
//
#include "Puck.h"
Puck::Puck() {
xpos = xpos0;
ypos = ypos0;
srand (time(NULL));
xspeed = rand()% 3 + 1;
srand (time(NULL)*time(NULL));
yspeed = rand()% 3 + 1;
}
Puck::Puck(double x, double y, double vx, double vy){
xpos = x;
ypos = y;
xspe... | true |
709bed7e44cef15e2b4c935d678458e264428def | C++ | JustinMorritt/Indee-Games | /DopeWarz/Market.h | UTF-8 | 663 | 2.578125 | 3 | [] | no_license | #ifndef MARKET_H__
#define MARKET_H__
#include <map>
#include <vector>
#include <iostream>
#include "randgen.h"
using namespace std;
class Market
{
public:
Market();
~Market();
void BuildMarket();
void SetDrugMap(vector<pair<string, unsigned>> map);
void DisplayMarket();
unsigned GetPrice(int... | true |
5f6fe518feaea25ae90a0126b20022a89ae3f5d4 | C++ | 5cript/star-tape | /src/star-tape/tape_header.cpp | UTF-8 | 18,153 | 2.796875 | 3 | [
"MIT"
] | permissive | #include <star-tape/tape_core.hpp>
#include <star-tape/tape_header.hpp>
#include <star-tape/tape_utility.hpp>
#include <boost/filesystem.hpp>
#include <chrono>
namespace fs = boost::filesystem;
namespace StarTape
{
//#########################################################################################... | true |
21c28d468eacfb53d1b037a752725146b02d12f2 | C++ | duzhanyuan/BeeeOnIOTServer | /ada_server/sqlCommands.h | UTF-8 | 7,665 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* @file sqlCommands.h
*
* @brief definition of namespace SQLQueries
*
* @author Matus Blaho
* @version 1.0
*/
#ifndef SQLCOMMANDS_H_
#define SQLCOMMANDS_H_
#include <string>
/** @namespace SQLQueries
* @brief groups SQL queries to database used by application
*/
namespace SQLQueries
{
using namespace... | true |
3cd9c50e5acf61eed3f828ab47d1572703a8cc5a | C++ | thecodingwizard/competitive-programming | /POI/POI15-Three.cpp | UTF-8 | 8,018 | 2.6875 | 3 | [] | no_license | /*
* Same as editorial
*
* Make the following observation: The optimal subset is [i...j] where either:
* Case 1. 0 <= i < 3, i <= j < n
* Case 2. i <= j < n, j >= n-3
*
* Editorial has proof, here's how to set the proof up: Assume the contrapositive, that the optimal subset [i...j]
* doesn't meet one of the two... | true |
aa71b801f723a82d6bcf5b0c22fe8ac581854533 | C++ | HydrazineClient/Ghost-1-16-Old | /Horion/Menu/ClickGui.h | UTF-8 | 1,937 | 2.578125 | 3 | [] | no_license | #pragma once
#include <map>
#include <vector>
#include "../../Memory/GameData.h"
#include "../DrawUtils.h"
#include "../GuiUtils.h"
#include "../Module/ModuleManager.h"
struct ClickModule {
bool isExtended = false;
};
struct ClickWindow {
ClickWindow() {
pos.x = 0;
pos.y = 0;
size.x = 30;
size.y = 30;
}... | true |
c90b66c59b925298140d9294297cf7db963dcb4a | C++ | wudenghui/DX10Frame012202 | /CPP/Bullet.h | GB18030 | 1,162 | 2.546875 | 3 | [] | no_license | #ifndef BULLET
#define BULLET
#include"BulletObj.h"
#include"MeshCopyNew.h"
#define BULLET_TIME_GAP 0.1f
#define MAX_BULLET_TYPE 7
#define BULLET_LIFE_TIME 1.0f
#define MAX_BULLET_NUM 80 // 80ӵ
class Bullet : public GameObj
{
public:
Bullet();
~Bullet();
virtual void ActionUpdate(float dt);
void SetBulletList... | true |
e245c0a0160e8572a52b7430bc2e90328e172450 | C++ | liutingjieni/learn_cpp | /C++_learn/func_test.cpp | UTF-8 | 538 | 3.03125 | 3 | [] | no_license | /*************************************************************************
> File Name: func_test.cpp
> Author:
> Mail:
> Created Time: 2019年10月16日 星期三 14时27分27秒
************************************************************************/
#include<iostream>
using namespace std;
int *calc(int *);
double *calc(doub... | true |
d80deebb23fbc21b5548b7380d02de0375dfb743 | C++ | TRex22/COMS3008_Parallel_Computing | /Test/Test1_redux_rev/Question3.cpp | UTF-8 | 2,652 | 3.390625 | 3 | [
"MIT"
] | permissive | /*
COMS 3008 PC Test 1
Jason Chalom 711985
Question 3.1 and 3.2
*/
#include "stdio.h"
#include "omp.h"
#include <iostream>
#include <cmath>
#include <fstream>
#include "stdlib.h"
using namespace std;
//parameter values chosen as consts here to make code more explicit
const double analytical_ans = exp(50) - exp(5);
c... | true |
f5790bb6b1d415a04199a92866a0418afb4a2c44 | C++ | CooperXJ/VScode | /exercise/寻找第几个小的元素.cpp | UTF-8 | 759 | 3.09375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int paration(int a[],int low,int high)
{
int pivot = a[low];
int i = low;
int j = high;
while(i<j)
{
while(i<j&&a[j]>=pivot)j--;
a[i] = a[j];
while(i<j&&a[i]<=pivot)i++;
a[j] = a[i];
}
pivot = a[i];
return i;
}
int findkey(int a[],int start,int end,int k)
{... | true |
63cb3699aca92a869e53c3ffe3d62d265db50acb | C++ | Mesmeyy/web_server | /server2/src/server_fzjh.h | UTF-8 | 5,070 | 2.53125 | 3 | [] | no_license | /*************************************************************************
> File Name: server_fzjh.h
> Author: 朱紫钰
> Mail: zhuziyu1157817544@gmail.com
> Created Time: 2017年11月13日 星期一 19时56分37秒
************************************************************************/
#ifndef _SERVER_FZJH_H
#define _SERVER_FZJH_H
... | true |
f5a2c05464c08078b52203ac1ca0f887674e4b85 | C++ | IngInx747/xengine | /xengine/graphics/uniform_block.h | UTF-8 | 759 | 2.640625 | 3 | [] | no_license | #pragma once
#ifndef XE_UNIFORM_BLOCK_H
#define XE_UNIFORM_BLOCK_H
#include "uniform_buffer.h"
namespace xengine
{
class UniformBlock
{
public:
void Register(UniformBuffer* ub);
void SetBlock(unsigned int offset, unsigned int size);
// clear runtime status before committing data
void Refresh();
// pus... | true |
ed9933fe28ea08dfa13e391e8fb5354928a9e364 | C++ | dattapro001/C-Codes-3G | /task4/number-10.cpp | UTF-8 | 1,423 | 3.46875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *prev;
Node *next;
};
Node *wave;
Node *java;
Node *fact;
void create_doubly_linkedlist();
void display();
int search_item();
int main()
{
create_doubly_linkedlist();
display();
int x = sear... | true |
dee24184ccec99cadb1e4c373900701eb4aa1211 | C++ | PorygonSeizure/Complex-Game-Systems | /Projects/04_BehaviouralMathematics/src/BaseNPC.h | UTF-8 | 1,733 | 3.015625 | 3 | [] | no_license | #ifndef _BASE_NPC_H_
#define _BASE_NPC_H_
#include <glm/glm.hpp>
class World;
class BaseNPC
{
public:
//Don't want any base constructor
BaseNPC() = delete;
BaseNPC(World* world);
virtual ~BaseNPC() {};
void Update(float deltaTime);
void Render();
//This will just output the NPC's vitals and information to ... | true |
9f4ba2a846b83f5e40867cf26873cc74fdfbb362 | C++ | sk8erpunk/LeetCode-Solutions | /Number of Islands.cpp | UTF-8 | 1,453 | 3.703125 | 4 | [] | no_license | /*
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Example 1:
Input:
11110
11010
11000
00000
Output: 1
Exam... | true |
c05ff4215a5e03161945698d15ed93453fdaaece | C++ | ragusa/EV | /conservation_law/src/fct/MultipassLimiter.cc | UTF-8 | 6,842 | 3.125 | 3 | [] | no_license | /**
* \file MultipassLimiter.cc
* \brief Provides the function definitions for the MultipassLimiter class.
*/
/**
* \brief Constructor.
*
* \param[in] n_dofs_ number of degrees of freedom
* \param[in] limiter_ limiter for which multiple passes are to be made
* \param[in] sparsity_pattern_ sparsity pattern
... | true |
093b5b35b6379620750bc04c851a4abfd2d79d31 | C++ | ypizarroza1990/ACM | /Online Judges/TJU/3507.cpp | UTF-8 | 1,132 | 2.625 | 3 | [] | no_license | //============================================================================
// Name : Grundy_Cup.cpp
// Author : BeCrazy
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
... | true |
846bbc457baedc9bbb2e8dbbcb0364adb31f0520 | C++ | Hy4zin/bslab-tutorium | /includes/smart_ptr_demo.h | UTF-8 | 659 | 3.140625 | 3 | [] | no_license | //
// Created by Kai Siemek on 14.04.21.
//
#ifndef MODERN_CPP_DEMO_SMART_PTR_DEMO_H
#define MODERN_CPP_DEMO_SMART_PTR_DEMO_H
#include <iostream>
int smart_ptr_main();
class VeryLargeObj {
public:
int aLotOfData;
VeryLargeObj() : aLotOfData(0) {};
explicit VeryLargeObj(int data) : aLotOfData(data) {};
... | true |
6f319c1fae9ca9fe922cff15bae574dc3a4c30bc | C++ | sihrc/Personal-Code-Bin | /project-euler/problem_244.cpp | UTF-8 | 991 | 3.5 | 4 | [
"Apache-2.0"
] | permissive | /*
Sliders
Problem 244
You probably know the game Fifteen Puzzle. Here, instead of numbered tiles, we have seven red tiles and eight blue tiles.
A move is denoted by the uppercase initial of the direction (Left, Right, Up, Down) in which the tile is slid, e.g. starting from configuration (S), by the sequence LULUR we ... | true |
fdf02b238760b4520a54948592a1bb69a38e9801 | C++ | LuukSteeman/Themadevices-groep_7 | /src/project/applicationLogic/messageLogic.hpp | UTF-8 | 2,071 | 3.53125 | 4 | [] | no_license | #pragma once
/**
Message logic object. Used Troughout the system to comunicate messages
*/
class MessageLogic
{
private:
int _id; //0 = spelleider 1-31 = speler
int _data;
unsigned int _error = 0;
bool checkChecksum(short data);
public:
/**
Create a message object
@param Pl... | true |
ce00aef1baa21780dd4a03e64282dd894935b735 | C++ | NinoKudava/OOP-C- | /Token.cpp | UTF-8 | 866 | 3.3125 | 3 | [] | no_license | #include "std_lib_facilities.h"
class Token{
public:
char kind;
double value;
};
Token get_token();
vector<Token> tokens;
int main(){
for(Token t = get_token(); t.kind != 'q';t = get_token()){
tokens.push_back(t);}
for (Token tok:tokens){
if(tok.kind == '8')
cout << "A number of... | true |
73d3ab03ce47de38301ba0a7498b953eb166da3a | C++ | chvishu87/2D-Game | /main.cpp | UTF-8 | 566 | 2.75 | 3 | [] | no_license | /************************************************************
* Author : Viswanath Chennuru
* Framework : Provided by Dr Brian Malloy
* *********************************************************/
#include "menuManager.h"
Gamedata* Gamedata::instance;
int main(int, char*[]) {
try {
MenuManager game_manager... | true |
a7bb587dbfe91477bae86f8591cd33443a1b7a99 | C++ | RobJenks/rj-engine | /RJ/Frustum.h | UTF-8 | 5,390 | 2.546875 | 3 | [] | no_license | #pragma once
#include "DX11_Core.h"
#include "FastMath.h"
class iObject;
class OrientedBoundingBox;
class Frustum
{
public:
// Static constant data
static const size_t NEAR_PLANE; // Index into the plane collection
static const size_t FAR_PLANE; // Index into the plane collection
static const s... | true |
c98d779908dcf801f3aced8e8cbc0a688fc40b40 | C++ | MysticAdi/code.for.fun | /DP Practice/min_cost_to_n.cpp | UTF-8 | 657 | 3.796875 | 4 | [] | no_license | //Given a number N. Find minimal cost distance from 0 to N with the following conditions.
// 1 . P is the cost for X+1 operations
// 2 . Q is the cost for 2*X operations
#include<iostream>
using namespace std;
int minCost(int n, int p, int q)
{
int end_cost = 0;
while(n>0){
if(n&1){ end_cost+=p; n--;}
else{
int... | true |
6d5453269e5cad389a83d09d6f2614d711f0751f | C++ | davidc1/BasicShowerReco | /Pi0Ana/Selection/SelectionAlg.cxx | UTF-8 | 1,421 | 2.515625 | 3 | [] | no_license | #ifndef SELECTION_SELECTIONALG_CXX
#define SELECTION_SELECTIONALG_CXX
#include "SelectionAlg.h"
#include <algorithm>
namespace selection {
SelectionAlg::SelectionAlg()
{
}
selection::PI0 SelectionAlg::ApplySelection(const art::ValidHandle<std::vector<recob::Shower> >& shr_h) {
if (shr_h->size()... | true |