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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0d119f5f447af20f2cbd2b4db4cec216541e305b | C++ | Acka1357/ProblemSolving | /BeakjoonOJ/16000/16115_팬이에요.cpp | UTF-8 | 1,119 | 2.890625 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include <algorithm>
using namespace std;
const double eps = 1e-13;
const double PI = acos(0.0) * 2.0;
struct Point{
long long x, y;
Point(){};
Point(long long x, long long y): x(x), y(y){}
long long operator * (const Point &o)const{
return (x * o.x) + (y * o.y);
}
Point o... | true |
bf62bc237998fe9004ae0aca1764c988a0ce35f5 | C++ | invrev/hello_world_ints | /linked_list/reorder_linked_list.cpp | UTF-8 | 2,257 | 3.859375 | 4 | [] | no_license | #include<iostream>
using namespace std;
struct ListNode {
int val;
struct ListNode *next;
ListNode (int x) : val(x),next (NULL) {}
};
//L : l0->l1->l2->.....->ln-1->ln
//l0->ln->l1->ln-1
//In place w/o altering the node values
//1. break the list into half
//2. reverse the second half
//3. merge the link... | true |
12e695040b1adc802b28a78e95ebb62a485c78b7 | C++ | KVSG-Keerthika/Smart-Door-Lock-System-During-Covid-19-Pandemic | /Smart-Door-Lock-System-During-Covid-19-Pandemic.ino | UTF-8 | 4,281 | 2.984375 | 3 | [] | no_license | //smartdoorlock system
#include <LiquidCrystal.h>
#include <Servo.h>
#include <Keypad.h>
Servo myservo;
int pos=0; // position of servo motor
LiquidCrystal lcd(13,12,11,10,8,7);
const byte rows=4;
const byte cols=3;
int temp;
char key[rows][cols]={
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte ro... | true |
b3c6de5cc46f549c5105297bfc630e3781ae33b3 | C++ | D000M/Games | /UnderWorldRun2/engine/Window.h | UTF-8 | 3,425 | 3.09375 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Window.h
* Author: DooM
*
* Created on July 28, 2018, 8:41 PM
*/
#ifndef WINDOW_H
#define WINDOW_H
#pragma once
#... | true |
beeb6132b3fb1f9a6cd64c6b88fe7b5d5ca66f2f | C++ | TaintedGear/MiniLD-RTS | /MiniLD_RTS Source/miniLD_RTS/healthBarObject.cpp | UTF-8 | 773 | 2.734375 | 3 | [] | no_license | #include "HealthBarObject.h"
HealthBarObject::~HealthBarObject()
{
}
void HealthBarObject::Update( float dt, float _posX, float _posY, float offset, float maxHealth, float currHealth )
{
mPosX = _posX;
mPosY = _posY - offset;
if (currHealth >= PercentageOf(maxHealth, 75.0f))
{
mFrame = 0;
}
else if (currHe... | true |
e61a67929bb92e91ca7273cc2b19340f9f5304f9 | C++ | dnvtmf/ACM | /DataStruct/数据结构经典题目.cpp | UTF-8 | 2,517 | 3.28125 | 3 | [] | no_license | /*区间的rmq问题
* 在一维数轴上,添加或删除若干区间[l,r], 询问某区间[ql, qr]内覆盖了多少个完整的区间
* 做法:离线,按照右端点排序,然后按照左端点建立线段树保存左端点为l的区间个数,
* 接着按排序结果从小到大依次操作,遇到询问时,查询比ql大的区间数
* 遇到不能改变查询顺序的题,应该用可持久化线段树
*/
/*数组区间颜色数查询
问题: 给定一个数组,要求查询某段区间内有多少种数字
解决: 将查询离线, 按右端点排序; 从左到右依次扫描, 扫描到第i个位置时, 将该位置加1, 该位置的前驱(上一个出现一样数字的位置)减1, 然后查询所有右端点为i的询问的... | true |
d1f80a390973bfd98e019278de83626e4a2bf952 | C++ | kmnj951/study | /Baekjoon-OJ/11729_hanoi.cpp | UTF-8 | 459 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <sstream>
using namespace std;
stringstream ss;
int tower(int num, int src, int dst) {
if( num == 1 ) {
ss << src << " " << dst << "\n";
return 1;
}
int count = 0;
int pre_dst = 6-src-dst;
count += tower(num-1, src, pre_dst);
ss << src << " " << dst << "\n";
count += tower(nu... | true |
e0c799406274af19811562a13bb08c9c6b08d4d5 | C++ | KohlDeng/livox_hikrobot_fusion | /map_to_cloud/include/map_to_cloud/common.h | UTF-8 | 6,038 | 2.8125 | 3 | [] | no_license | #ifndef COMMON_H
#define COMMON_H
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <stdio.h>
#include <Eigen/Core>
#include <chrono>
using namespace std;
string float2str(float num);
float str2float(string str);
double str2double(string str);
string double2str(d... | true |
2d30952c1d49a8f3b959f975ee3444fb6b053030 | C++ | bmjoy/teleports | /sisyphus/VulkanRenderer/src/Components/VulkanComponent.h | UTF-8 | 442 | 2.75 | 3 | [] | no_license | #pragma once
#include "ECS/Component.h"
namespace Sisyphus::Rendering::Vulkan {
template<typename VulkanType>
class IVulkanComponent : public ECS::IComponent {
public:
virtual VulkanType GetVulkanObject() const = 0;
operator VulkanType() const {
return GetVulkanObject();
}
};
template<typename T, type... | true |
c3585e246d8062ef9c1ba0c36f443651245df484 | C++ | njusegzyf/AtgProjs | /CallCPP-CLFF/Programs_FSE14/dart_power_ray_sine_stat_tcas_tsafe/MathSin.cpp | UTF-8 | 10,983 | 2.609375 | 3 | [] | no_license | /*
* MathSin.cpp
*
* Created on: Feb 12, 2015
* Author: zy
*/
//class MathSin {
//public:
static int IEEE_MAX = 2047;
static int IEEE_BIAS = 1023;
static int IEEE_MANT = 52;
static double sixth = 1.0/6.0;
static double half = 1.0/2.0;
static double mag52 = 1024.*1024.*1024.*1024.*102... | true |
0ebba7a2bafa17721db8bf53a062a4357e641b46 | C++ | csyezheng/LeetCode | /292. Nim Game/nimGame.cpp | UTF-8 | 251 | 2.65625 | 3 | [] | no_license | #include "NimGame.h"
#include <iostream>
using namespace std;
int main()
{
Solution instance;
bool result = instance.canWinNim(10);
if (result)
cout << "Nim will win" << endl;
else
cout << "Nim can't win" << endl;
}
| true |
16d4bd0943d6ede898d627cc137dd413cee587b3 | C++ | aliverobotics/Pumas-SmallSize | /PUMA_Vision/StillCapFjrg_2503_prueba/VisionEntrenamiento/draw.h | UTF-8 | 814 | 2.921875 | 3 | [] | no_license | /**
* \file draw.h
* \author fjrg76
* \date 29-09-05
*/
/**
* This class implements the methods needed to draw into the working area
*/
/* RGB --> ColorDefs.h
Point --> PointDefs.h
byte --> GeneralDefs
*/
class Draw
{
public:
Draw( int resx, int resy, int bsize );
void Blob( int x0, ... | true |
931b4e06b1c958a69a3655ad8117500a203f1c11 | C++ | ThisIsRWTH/CPP_Tutorial | /Project4.6.1/Vector.h | ISO-8859-1 | 2,015 | 3.390625 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////////////
// Praktikum Informatik 1
// Versuch 04: Einfhrung in die Klasse
//
// Datei: Vektor.h
// Inhalt: Headerdatei der Klasse Vektor
//////////////////////////////////////////////////////////////////////////////
/**
* @file Vector.h
*
* Provide... | true |
093a9ea9bd7a140745bff5565f36d69fe260873b | C++ | tokar-t-m/lippman | /Part_1/Chapter_7/learn_7_5/Person.h | UTF-8 | 153 | 2.671875 | 3 | [] | no_license | #include <string>
struct Person{
std::string name;
std::string adress;
std::string get_name() const;
std::string get_adress() const;
}; | true |
92b4d09ce09b23c9b9bf9faea03acfe22c9c96b7 | C++ | romanbelowski/op-lab4cpp | /decompressor.cpp | UTF-8 | 2,150 | 3.09375 | 3 | [] | no_license | #include "decompressor.hpp"
#define EOF_CODE 256
using namespace std;
// Збергіає зжатий алгоритмом LZW файл in в файл out
void DecompressorLZW::decompress(const char *in, const char *out) {
ifstream input(in, ios::in | ios::binary);
ofstream output(out, ios::out | ios::binary);
if (!input || !output) {
c... | true |
db242c412547e54e8881185184f0f2ee7660e248 | C++ | kancve/mr4c | /native/src/cpp/impl/keys/DataKeyBuilder.cpp | UTF-8 | 2,587 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | true |
5051eb9874f13273f893f90e49368a506ebdb507 | C++ | evanmkim/TX2_QT_UI1 | /utils/qtpreviewconsumer.h | UTF-8 | 2,452 | 2.828125 | 3 | [] | no_license | #ifndef QTPREVIEWCONSUMER
#define QTPREVIEWCONSUMER
#include <Argus/Argus.h>
#include "EGLGlobal.h"
#include "GLContext.h"
#include "Thread.h"
#include "Window.h"
namespace ArgusSamples
{
using namespace Argus;
/*******************************************************************************
* Preview consumer thre... | true |
6e4fa8d7543730cbbb6f99e5327744c9809c1498 | C++ | jadenpadua/Data-Structures-and-Algorithms | /C++/concepts/intro/sameAscii.cpp | UTF-8 | 276 | 3.046875 | 3 | [] | no_license | bool sameAscii(std::string a, std::string b) {
int ascii_a = 0;
int ascii_b = 0;
for(int i = 0; i < a.length(); i++) {
ascii_a += int(a[i]);
}
for(int i = 0; i < b.length(); i++) {
ascii_b += int(b[i]);
}
if(ascii_a == ascii_b) {
return true;
}
return false;
}
| true |
3db915117e006f16663fc22aa9360bf9f0b61bee | C++ | Sejdii/library_project | /mainwindow.cpp | UTF-8 | 9,952 | 2.59375 | 3 | [] | no_license | #include "mainwindow.h"
#include <lib/dbmanager.h>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
DBManager::initial_database(DATABASE_PATH); // INITIAL THE DATABASE FILE IF NOT EXIST
DBManager database(DATABASE_PATH);
this->setWindow();
this->setStage("homepage");
}
void MainWind... | true |
e08ef39d39bba810f5184c9df9ee2b6296615d40 | C++ | manaswinibehera1/mana.lab5 | /lab5_q2.cpp | UTF-8 | 423 | 3.859375 | 4 | [] | no_license | //using library
#include<iostream>
using namespace std;
//using main function
int main (){
//declaring variables
int a,b,c;
cout << "Enter three numbers : " << endl;
cin >> a >> b >> c;
//condition
if ((a > b) && (a > c)){
cout << a << "is the maximum number." << endl;
}
else if ((b > a) && (b > c)){
cout << b ... | true |
92f886f4974ffae10362f2572120dc894376d7d2 | C++ | tdm1223/Algorithm | /programmers/source/2-12.cpp | UTF-8 | 445 | 3.1875 | 3 | [
"MIT"
] | permissive | // 구명보트
// 2019.06.28
#include<vector>
#include<algorithm>
using namespace std;
int solution(vector<int> people, int limit)
{
int answer = 0;
// 오름차순 정렬 후 탐욕법으로 풀이
sort(people.begin(), people.end(), greater<int>());
int size = people.size();
for (int i = 0; i < size; i++)
{
if (people[i] + people[size - 1] <=... | true |
d046d05e0bb61e18f520536107915005eae69265 | C++ | LuanQBarbosa/ray-tracer-university-project | /scene.cpp | UTF-8 | 4,632 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "scene.h"
Scene::Scene( void )
{}
Scene::~Scene( void )
{
if ( bvh_ )
{
delete bvh_;
bvh_ = nullptr;
}
}
// bool Scene::intersect( const Ray &ray,
// IntersectionRecord &intersection_record ) const
// {
// bool intersection_result = false;
// Intersect... | true |
00fb61a4af100b6dffbcc5aadac81eeac868929b | C++ | Olesenka18/LAB_OP | /11/11.2/11.2/11.2.cpp | UTF-8 | 497 | 2.71875 | 3 | [] | no_license | #include <stdio.h>
#include <locale.h>
int main(void) {
setlocale(LC_ALL, "Russian");
int A, B, C, S;
printf("Введите значение A \n");
scanf("%i", &A);
printf("Введите значение B \n");
scanf("%i", &B);
printf("Введите значение C \n");
scanf("%i", &C);
if (A >= B) {
if (B >= C) {
S = A + B;
}
else {
... | true |
06710a33d5c403510f7824c3f66a1b50355ec4cd | C++ | GPUOpen-Tools/qt_common | /custom_widgets/colored_legend_scene.h | UTF-8 | 2,206 | 2.703125 | 3 | [
"MIT"
] | permissive | //=============================================================================
/// Copyright (c) 2016-2020 Advanced Micro Devices, Inc. All rights reserved.
/// \author AMD Developer Tools Team
/// \file
/// \brief Headerfor a class that contains colored legends
//======================================================... | true |
6ae261985be014654191d6456b157769ebff78f5 | C++ | abdullahfarwees/HackerEarth | /MonkTakesAWalk.cpp | UTF-8 | 567 | 3.046875 | 3 | [] | no_license | #include<iostream>
/* https://www.hackerearth.com/practice/algorithms/searching/linear-search/practice-problems/algorithm/monk-takes-a-walk/ */
using namespace std;
void fun()
{
string str;
cin>>str;
int count = 0;
for(int i=0;i<str.size();i++)
{
if( str[i] == 'a' || str[i] == 'e' || str[i] == 'i' |... | true |
cd5ea8caa4f34efe2ea08f7b0e1765eb4c031b8a | C++ | Pluto-Jin/fromZero2GrandMaster | /610~619/619/A.cpp | UTF-8 | 313 | 2.75 | 3 | [] | no_license | #include "bits/stdc++.h"
using namespace std;
int main()
{
int t;
cin>>t;
while (t--) {
string a,b,c;
cin>>a;
cin>>b;
cin>>c;
int flag;
for (int i=0;i<a.size();i++) {
if (c[i]==a[i] or c[i]==b[i]) flag=1;
else {flag=0;break;}
}
if (flag) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}
| true |
0143426b2730ba5c5858c21cee2d9c3ea4343fbc | C++ | MCSH/rumi | /src/ast/While.h | UTF-8 | 318 | 2.546875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #pragma once
#include "Statement.h"
#include "Expression.h"
class While: public Statement{
public:
Expression *condition;
Statement *st;
While(Expression *condition, Statement *st);
virtual void prepare(CC *cc) override;
virtual void compile(CC *cc) override;
virtual void codegen(CC *cc) override;
};
| true |
5164bf1ff7cf26c60f5cc4afe84e102ce730d0f0 | C++ | cyberway/cyberway | /contracts/eosiolib/symbol.hpp | UTF-8 | 5,819 | 3.015625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <eosiolib/core_symbol.hpp>
#include <eosiolib/serialize.hpp>
#include <eosiolib/print.hpp>
#include <eosiolib/system.h>
#include <tuple>
#include <limits>
namespace eosio {
/**
* @defgroup symbolapi Symbol API
* @brief Defines API for managing symbols
* @ingroup contractdev
*/
... | true |
990ed3e788cfd3fcbe058d5e4bef79e6dc43cb0d | C++ | s1042992/Leetcode_practice | /34.cpp | UTF-8 | 817 | 2.921875 | 3 | [] | no_license | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
vector<int> ans;
vector<int> arr;
arr.push_back(-1);
arr.push_back(-1);
bool flag=true;
for(int i=0;i<nums.size();i++)
{
if(nums[i]==target&&flag)
... | true |
23c42a21ede34806dbcc471d0a9e475899ac68c4 | C++ | The-Fire-Ferrets/Paramourus-Rex | /include/EventInterface.h | UTF-8 | 491 | 2.65625 | 3 | [
"Zlib"
] | permissive | #ifndef EVENTINTERFACE_H
#define EVENTINTERFACE_H
#include "Constants.h"
class EventInterface {
public:
virtual const EventType& getEventType(void) const = 0;
virtual float getTimeStamp(void) const = 0;
virtual void Serialize(const std::ostream& o) const = 0;
virtual EventInterface* copy(void) = 0;
virtual... | true |
47dad6e25c61eff2708a5169dfc207acab58695d | C++ | VLiamin/spbu | /sem1/hw4/4.2/head.cpp | UTF-8 | 1,986 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include "head.h"
List *createList()
{
return new List {nullptr};
}
void push(ListElement *&tmp, char information[length])
{
if (tmp == nullptr)
{
tmp = new ListElement;
tmp->next = nullptr;
int i = 0;
while (information[i] != '\0')
{
tmp->information[i] = in... | true |
fb9bdb7919fbd4ba1b0c919f1e4baa8305523421 | C++ | lightionight/DirectX12Remaster | /Include/self/Box2dSceneManager.cpp | UTF-8 | 1,957 | 2.890625 | 3 | [] | no_license | #include "Box2dSceneManager.h"
#if defined (DEBUG) | defined (_DEBUG)
#include <iostream>
#endif // d (DEBUG) | defined (_DEBUG)
#include <algorithm>
Box2dSceneManager::Box2dSceneManager()
{
}
Box2dSceneManager::~Box2dSceneManager()
{
}
void Box2dSceneManager::Initialize(float gravity, float posX, float p... | true |
2572ee09e8f5a2d973996d3417dcfcc252537fd8 | C++ | shobhitjawa/dsAlgos | /searchalgorithms/pairwithadiff.cpp | UTF-8 | 442 | 2.765625 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[]={1, 8, 30, 40, 100};
int n=5;
int x=60;
int max=arr[0];
int i=0; //pair with a difference
int j=1;
while(i<n&&j<n)
{
if(i!=j&&arr[j]-arr[i]==x)
{
cout<<"pair fo... | true |
2a6d76e3b512f2d73b78537a1f8244402de52cff | C++ | notherland/ilab_2course | /Triangles/tests.cpp | UTF-8 | 4,668 | 2.6875 | 3 | [] | no_license | #define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <boost/test/included/unit_test.hpp>
#include "Triangles.h"
BOOST_AUTO_TEST_CASE(Triangles_line_t_proj1)
{
point_t pl1{4, 3, 1}, pl2{6, 2, 1}, p1{4, 10, 7}, p2{1, 4.5, 1};
line_t l{pl1, pl2}; //(x-4)/2 = (y-3)/-1 = (z-1)/0;
point_t p1_proj = l.pr... | true |
c14a51b7d34d01c025f7dcc1d641822ccaf3abc4 | C++ | valfvo/punyduck | /src/litequarks/include/litequarks/LQHash.hpp | UTF-8 | 602 | 3.0625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <functional> // std::hash
template<class T>
inline void lqHashCombine(std::size_t &seed, const T& v) {
std::hash<T> hasher;
seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
#ifndef LQ_NO_PAIR_HASH
namespace std {
template<class T1, class T2>
struct hash... | true |
b37454d8d7906fd5d247cccb3e994e15cbbfa73c | C++ | rpbrandau/OSU-Coursework | /162 - Intro pt 2 - Labs/LabE/list.hpp | UTF-8 | 706 | 2.859375 | 3 | [] | no_license | /*****************************************************************
** Program Filename: list.h
** Author: Riley Brandau - brandaur@oregonstate.edu
** Date: 7/19/16
** Description: Header file for List class
*****************************************************************/
//#pragma once
#ifndef LIST_HPP
#def... | true |
5dcfbd746817efdf19ab8e5cf45c8ed991bfa4e6 | C++ | imxingquan/hotelMIS | /Samples/hotel/hotelMIS/HRoomCtrl.cpp | GB18030 | 3,795 | 2.734375 | 3 | [
"MIT"
] | permissive | #include "stdAfx.h"
#include "HRoomCtrl.h"
#include <cassert>
using namespace std;
namespace hotelMIS{
HRoomCtrl::HRoomCtrl(mysqlpp::Connection *pCon )
{
_pCon = pCon;
}
bool HRoomCtrl::isExistRoom(int roomid)
{
try{
mysqlpp::Query query = _pCon->query();
query << "SELECT room_id FROM t_roomSet WHERE... | true |
fa208267950be4559b6f021a15a2fa19c990f6e2 | C++ | EoinGorman/FinalYearProject | /Classes/include/PlayerManager.h | UTF-8 | 910 | 2.96875 | 3 | [] | no_license | #pragma once
#include "Player.h"
class PlayerManager {
public:
//Functions
static PlayerManager* GetInstance();
~PlayerManager()
{
instanceFlag = false;
}
void ResetPlayerManager();
void SetNumberOfPlayers(int num);
void AddPlayer(Player::Faction);
Player* GetCurrentPlayer();
void CycleToNextPlayer();
in... | true |
00549098dc280b3e620c217607ecad091e2347ba | C++ | pid011-study-archive/oop-study-2 | /study/10/04_cube/main.cpp | UTF-8 | 671 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Cube {
double _x;
double _y;
double _z;
public:
Cube(double x, double y, double z)
: _x(x), _y(y), _z(z) { }
Cube operator+(const Cube& other) {
double x = _x > other._x ? _x : other._x;
double y = _y > other._y ? _y : other.... | true |
41688167cb115dd417eda1f624da6cb6e7c57586 | C++ | maliksh7/C-from-Crack | /Pointers/intial/ptr1.cpp | UTF-8 | 426 | 3.1875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int a =10;
int *p;
int **p1;
p = &a;
p1 = &p;
cout << "Address of a(by a): " << &a << endl;
cout << "Address of a(by p): " << p << endl;
cout << "Address of a(by p1): " << *p1 << endl;
cout << "Value of a(by a): " << a << endl;
cout << "Val... | true |
cd55879104ac4a9c58325d5a3579bdc6709a248a | C++ | hanayashiki/pythonic | /pythonic/pythonic_elem_value.h | UTF-8 | 2,906 | 3.15625 | 3 | [] | no_license | #pragma once
#include <any>
#include <iostream>
#include <typeinfo>
#include <typeindex>
#include <string>
#include "log.h"
#include "pythonic_basic_types.h"
#include "pythonic_container.h"
#include "pythonic_utils_match.h"
namespace pythonic
{
class list;
class elem_value
{
std::any value;
std::shared_ptr<co... | true |
b701804b0e88cdfe0e41292f575b31dd49eed95e | C++ | shivambhushan/Codes | /XOR Profit Problem.cpp | UTF-8 | 368 | 3.46875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int XOR_Profit(int a, int b)
{
int max_xor = 0;
for (int i = a; i < b; ++i)
{
int check_xor;
for (int j = a+1; j <= b; ++j)
{
check_xor = i^j;
if (check_xor>max_xor)
{
max_xor=check_xor;
}
}
}
return max_xor;
}
int main()
{
int a,b;
cin>>a;
cin>... | true |
2be557add50d2d8a897307c8f53c0d1c9faca499 | C++ | glencornell/xdg-mini-launcher | /src/abstract_entry.hpp | UTF-8 | 579 | 2.890625 | 3 | [] | no_license | #pragma once
#include <string>
namespace xdg {
// The base class for all xdg desktop entry files
class AbstractEntry
{
public:
enum type_t { Unknown, Application, Link, Directory };
static type_t cvt(std::string const &str);
static std::string cvt(type_t const t);
public:
virtual ~Abstr... | true |
3ab78b1bbd6cc61c6e1d9abc22143cc7e876d2cb | C++ | Harmon758/kolibrios | /programs/develop/libraries/libGUI/SRC/control_text.inc | UTF-8 | 4,651 | 2.78125 | 3 | [] | no_license | /*
control Text
*/
gui_text_size_t GetStringSize(font_t *font,char *s)
{
long len;
gui_text_size_t size;
len=strlen(s);
if (font->size==FONT_CONSTANT_SIZE)
{
if (font->flags & FONT_FLAG_ORIENTATION_HORIZONTAL_FROM_LEFT_TO_RIGHT_ON)
{
size.sizex=len*font->sizex;
size.sizey=font->siz... | true |
a7037f5fde10201c143ce812b2a09e479942f4e8 | C++ | shani24levi/MazeGenerator_andSolver | /Command.h | UTF-8 | 3,974 | 2.921875 | 3 | [] | no_license | #pragma once
#include "Maze2d.h"
#include "View.h"
#include "Model.h"
#include <string>
#include <map>
using namespace std;
class Command
{
public:
Command() {
v = new View(_out);
mo = new Model(_out);
}
virtual void execute() = 0;
void setCommend(std::string& s) { currComand = s; }
void inOut(std::istream*... | true |
ee1b144663fe03d9cd846dfe5b58f56efeccdab0 | C++ | Girl-Code-It/Beginner-CPP-Submissions | /syeda reeha quasar/milestone 7/octal to decimal.cpp | UTF-8 | 406 | 3.046875 | 3 | [] | no_license | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
long long octal , tempoctal, decimal=0;
int rem , place=0;
cout<<"enter the octal number:";
cin>>octal;
tempoctal=octal;
while(tempoctal!=0)
{
rem = tempoctal%10;
decimal+= pow(8, place)*rem;
tempoctal/=10;
place++;
}
place*=10... | true |
cb33e9475deb699943de84b4c79c29a6b6d7a751 | C++ | RPMiller/CSC190Ryan_Miller | /GameSolution/Game/ParticleEffect.h | UTF-8 | 532 | 2.640625 | 3 | [] | no_license | #pragma once
#include "Core.h"
#include "Particle.h"
#include "RandomGenerator.h"
#include "Vector2.h"
class ParticleEffect
{
protected :
Particle* particles;
RandomGenerator randomGenerator;
Vector3 origin;
int numberOfParticles;
Color color;
public:
ParticleEffect(int numParticles,Vector3 origin);
~ParticleEf... | true |
ea1339327106040a060d906fa816f67a8fdb15a7 | C++ | Hao1Zhang/OOP | /practical-04/function-2-1.cpp | UTF-8 | 146 | 3.078125 | 3 | [] | no_license | #include<iostream>
void print_sevens(int *nums,int length){
for (int i=0;i<length;i++){
std::cout<<*(nums+i)*7<<std::endl;
}
} | true |
a25258cff873cf8799449f2e85b665e77e3c57aa | C++ | bootchk/nRF5x | /src/drivers/clock/compareRegister.h | UTF-8 | 1,829 | 2.90625 | 3 | [] | no_license |
#pragma once
/*
* Types of initializer parameters are platform independent types so API is platform independent.
* Implementation uses platform specific types
*/
#include <stddef.h> // size_t
#include "counter.h" // OSTime type on Counter
/*
* Thin wrapper/facade on HW compare register of Nordic RTC device.
... | true |
7837b085fb78541f9fb16a945ba1c2c5f82655b4 | C++ | itsme-aparna/Coding-Notes | /C++/GraphsCPP/courseSchedule2.cpp | UTF-8 | 1,077 | 2.640625 | 3 | [] | no_license | Course Schedule II - LeetCode 210
class Solution {
public:
vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) {
vector<int> adj[numCourses];
vector<int> in(numCourses, 0);
vector<int> res;
for(auto x: prerequisites){
adj[x[1]].push_back(... | true |
913d0100e1ad37b6ff94cd238fe7e0af81078a00 | C++ | madingx/leetcode-cpp | /algorithms/cpp/exclusiveTimeofFunctions/ExclusiveTimeofFunctions.cpp | UTF-8 | 3,192 | 3.578125 | 4 | [] | no_license | // Source : https://leetcode.com/problems/exclusive-time-of-functions/
// Author : Mading
// Date : 2019-05-29
/**********************************************************************************
* 636. Exclusive Time of Functions [Medium]
* On a single threaded CPU, we execute some functions.
* Each function h... | true |
89de32ded99669410e1dcf8fd5d66df253b84330 | C++ | arknave/sph_fluid_simulation | /src/simulation.cpp | UTF-8 | 6,358 | 2.703125 | 3 | [] | no_license | #include "simulation.h"
#include "parameters.h"
#include <functional>
#include <igl/viewer/Viewer.h>
using namespace std;
using namespace Eigen;
// anonymous namespace to handle LibIGL viewer.
namespace {
bool key_down(igl::viewer::Viewer& viewer, unsigned char key, int mod,
Simulation *sim) {
if (... | true |
988b3469a70040f8f927f91d0a1c20065f733d82 | C++ | SaeanSavin/Pac-man-SDL2-Exam | /PG4401_Eksamen/Animation.cpp | UTF-8 | 605 | 2.875 | 3 | [] | no_license | #include "Animation.h"
Animation::Animation(SDL_Renderer* r, std::string path, int tickRate) {
length = 0;
rate = tickRate;
startTime = SDL_GetTicks();
for (const auto& entry : std::filesystem::directory_iterator(path)) {
length++;
auto tm = std::make_unique<Texture_Manager>();
if (entry.path().has_extension... | true |
0392fe6437a0b497cc341b2e020be21539a5c15f | C++ | Marcelo-Alarcon/Assignment5 | /PscToC++/backend/interpreter/RuntimeStack.h | UTF-8 | 1,956 | 3.15625 | 3 | [] | no_license | /**
* <h1>RuntimeStack</h1>
*
* <p>The interpreter's runtime stack.</p>
*
* <p>Copyright (c) 2020 by Ronald Mak</p>
* <p>For instructional purposes only. No warranties.</p>
*/
#ifndef RUNTIMESTACK_H_
#define RUNTIMESTACK_H_
#include <string>
#include <vector>
#include "RuntimeDisplay.h"
#include "StackFrame.h"... | true |
723a0d5120aea93403c0ea884fb71885647b9b00 | C++ | jhongpananon/Quadcopter | /L5_Application/quadcopter/quadcopter.hpp | UTF-8 | 946 | 2.828125 | 3 | [] | no_license | /**
* @file
*/
#ifndef QUADCOPTER_HPP_
#define QUADCOPTER_HPP_
#include "quadcopter_base.hpp"
#include "lpc_pwm.hpp"
/**
* The quadcopter class
*
* This provides the interface to set the rotor PWMs
*/
class Quadcopter : public QuadcopterBase, public SingletonTemplate<Quadcopter>
{
publ... | true |
2c6db8e85887a2dc027588dee28eb051a8b70732 | C++ | Tomaat132/ProjectThirdPerson | /uGE/Colliders/SphereCollider.hpp | UTF-8 | 547 | 2.671875 | 3 | [] | no_license | #ifndef SPHERECOLLIDER_H
#define SPHERECOLLIDER_H
#include "..\Collider.hpp" //the " .." means that the file is in the folder above
namespace uGE {
class SphereCollider : public Collider
{
public:
SphereCollider(GameObject * aParent, float aRadius, std::string aName = "Sphere"... | true |
afaeb183fde58d71d3da641936f4f15517e00c9f | C++ | artyomdmitriev/cpp-labs | /hw15/task1/main.cpp | UTF-8 | 403 | 3.125 | 3 | [] | no_license | #include <iostream>
#include "Point.h"
using namespace std;
int main() {
Point p(3, 4);
Point p2(5, 6);
cout << "X: " << p.getX() << endl;
cout << "Y: " << p.getY() << endl;
cout << "d0 distance: " << p.d0() << endl;
cout << "Distance between p1 and p2: " << p.d(p2) << endl;
cout << p << e... | true |
20869385cfe77b5ceba03592236de5ba331d1601 | C++ | TheiloT/Projet-COVD | /edition.cpp | UTF-8 | 12,247 | 2.609375 | 3 | [] | no_license | #include "edition.h"
#include "correspondance.h"
#include "jeu.h"
void affiche_grille(int H, int L, int taille_case){
for (int i=0; i<=H; i++){
drawLine(0, i*taille_case, L*taille_case, i*taille_case, BLACK, 2);
}
for (int j=0; j<=L; j++){
drawLine(j*taille_case, 0, j*taille_case, H*taille_... | true |
08fcdb12f9bb84b930b866490b295f9ba962cbf0 | C++ | moevm/oop | /8382/Rocheva_Anna/lab5/landscapes/Forest.hpp | UTF-8 | 399 | 2.703125 | 3 | [] | no_license | #ifndef LABOOP_FOREST_HPP
#define LABOOP_FOREST_HPP
#include "Landscape.hpp"
class Forest : public Landscape{
public:
Forest() : Landscape() {landName = FOREST;};
char getName() final {return 'F';};
void changeAttribute(Unit *unit) final {unit->changeAttributes(-10, 0, 0);};
Land getLandName() final {... | true |
1a7fea35ffdf0782522350a3f0e04b3f7319eb63 | C++ | Xiao-MM/CProject | /sort/MergeSort.cpp | UTF-8 | 1,050 | 3.4375 | 3 | [] | no_license | #include<iostream>
using namespace std;
void Merge(int*,int,int,int);
//分解+合并
void MergeSort(int *arr, int start, int end){
int mid = (start + end)/2;
if (start >= end){
return;
}
MergeSort(arr, start, mid);
MergeSort(arr, mid+1, end);
Merge(arr,start,mid,end);
}
//归并
void Merge(int *arr... | true |
44f8db6aa6be48e62ac762ef37a399fe3e204c37 | C++ | surbhit-sinha/1_d_combat_simulator | /1_d_combat_simulator.cpp | UTF-8 | 2,349 | 3.578125 | 4 | [] | no_license | #include<iostream>
#include<string>
#include<random>
using namespace std;
int main()
{
mt19937 randGenerator(time(0)); // random number generator
uniform_int_distribution<int> humanPower(50,100); // damage caused by human
uniform_int_distribution<int> robotPower(30,60); // damage caused by robot
// chance of h... | true |
2361ace8367d8a6435af47ee2777218fa16cb6d2 | C++ | George-Creekbed/Nand2Tetris | /08/CodeWriter.cpp | UTF-8 | 21,049 | 2.953125 | 3 | [] | no_license | #ifndef CODEWRITER_CPP_INCLUDED
#define CODEWRITER_CPP_INCLUDED
#include <iostream>
#include <string>
#include <algorithm>
#include "CodeWriter.h"
using std::string; using std::endl;
using std::transform;
CodeWriter::CodeWriter(const string& filename, const char* argv)
{
string argument(a... | true |
2e4b801343b68e4cf9abce0eb99865c63bb371c8 | C++ | TheSableCZ/geParticle | /geParticleGL/src/geParticleGL/GPUParticleEmitter.cpp | UTF-8 | 1,108 | 2.65625 | 3 | [] | no_license | /** @file GPUParticleEmitter.cpp
* @brief Particle emitter accelrated on GPU.
* @author Jan Sobol xsobol04
*/
#include <geParticleGL/GPUParticleEmitter.h>
ge::particle::GPUParticleEmitter::GPUParticleEmitter(std::string shaderSource, int particlesPerSecond)
: GPUParticleEmitter(shaderSource, std::make_shared<Co... | true |
03f59bf516c8d085f0784a30a6a89dd469a0980d | C++ | Eric-GR-N/WeatherInfo_STI | /WeatherInfo.cpp | UTF-8 | 8,209 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <algorithm>
using namespace std;
struct WeatherData {
string date = "0";
double temperature = 0;
double insideTemp = 0;
double insideHum = 0;
double humidity = 0;
double mold = 0;
double insideMold = 0;
};
bool compareInsideTemp(WeatherData a, W... | true |
16ace563bbb356c8fff3f7f476cadb3f3c97e7a6 | C++ | MaxiFly29/ASD2_6 | /ASD2_6/RBT.h | UTF-8 | 8,092 | 3.40625 | 3 | [] | no_license | #pragma once
#include <vector>
#define RED false
#define BLACK true
#define LEFT 0
#define RIGHT 1
template<class T>
class RBT_node {
public:
T data;
bool color; //false - red, true - black
RBT_node<T>* parent;
RBT_node<T>* left;
RBT_node<T>* right;
RBT_node(T data, bool color) {
this->data = data;
this-... | true |
1ecb3172d8e85f346ac1e20fc606006ecb0f11e7 | C++ | niuxu18/logTracker-old | /second/download/httpd/gumtree/httpd_old_hunk_2947.cpp | UTF-8 | 1,026 | 2.71875 | 3 | [] | no_license | * @return APR_SUCCESS or error
*/
apr_status_t ajp_msg_create(apr_pool_t *pool, apr_size_t size, ajp_msg_t **rmsg)
{
ajp_msg_t *msg = (ajp_msg_t *)apr_pcalloc(pool, sizeof(ajp_msg_t));
if (!msg) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
"ajp_msg_create(): can't all... | true |
b63afb645225fe0a1629819b30e09d1320c4dcde | C++ | nikolausmayer/cmake-templates | /generic-ros-catkin-cplusplus-messages-cmake-example/src/server.cpp | UTF-8 | 919 | 3.015625 | 3 | [
"MIT"
] | permissive | #include <chrono>
#include <string>
#include <thread>
// ROS
#include <ros/ros.h>
// THIS PACKAGE'S MESSAGES
#include <generic_package/GenericMessage.h>
typedef generic_package::GenericMessage MSG;
int main(int argc, char** argv)
{
/// Initialize node
ros::init(argc, argv, "generic_server");
ROS_INFO("generic... | true |
cbe1583007fea1f4d38c662ee43199834c3866be | C++ | ozzi/alabina-game | /sessionmodel.cpp | UTF-8 | 2,504 | 2.5625 | 3 | [] | no_license | #include "sessionmodel.h"
#include <QDebug>
#include <cassert>
#include <numeric>
#include "crashlogger.h"
SessionModel::SessionModel(QObject *parent) :
QAbstractListModel(parent), _totalPoints(0), _levelsNumber(0)
{
QHash<int, QByteArray> role_names;
role_names.insert(ResultNameRole, "resultLevelName");
... | true |
50d183366a5be601b3d60095cc86e1e2f349ca6a | C++ | Tigrolik/git_workspace | /cpp/stroustrup_exercises/data_n_algos/drills/algos_examples.cpp | UTF-8 | 3,238 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <list>
#include <numeric>
#include <algorithm>
#include <iterator>
using veci = std::vector<int>;
using vecd = std::vector<double>;
using listd = std::list<double>;
struct Record {
double unit_price;
int units;
};
constexpr double price(const double v, const Rec... | true |
65bbaa405bfe2548e4b243a69bb23ae49573c11a | C++ | xieofxie/Cognitive-Services-Voice-Assistant | /samples/clients/cpp-console/include/LinuxAudioPlayer.h | UTF-8 | 9,119 | 2.640625 | 3 | [
"MIT",
"LicenseRef-scancode-generic-cla",
"LGPL-2.1-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"MS-PL",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include <alsa/asoundlib.h>
#include <condition_variable>
#include <list>
#include <thread>
#include <mutex>
#include "AudioPlayer.h"
#include "AudioPlayerEntry.h"
#include "speechapi_cxx.h"
namespace AudioPlayer
{
/// <summary>
/... | true |
eb3d0d8f810eba62dd9097a633f78f73f4279211 | C++ | Lisprez/asteria | /asteria/rocket/cow_vector.hpp | UTF-8 | 24,713 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | // This file is part of Asteria.
// Copyleft 2018 - 2020, LH_Mouse. All wrongs reserved.
#ifndef ROCKET_COW_VECTOR_HPP_
#define ROCKET_COW_VECTOR_HPP_
#include "compiler.h"
#include "assert.hpp"
#include "throw.hpp"
#include "utilities.hpp"
#include "allocator_utilities.hpp"
#include "reference_counter.hpp"
namespac... | true |
1e1f79d1dab6411af71385429e498aedb5c97bc5 | C++ | DokyeongLee-3/MetalSlug | /MetalSlug/Include/Object/Character.cpp | UTF-8 | 727 | 2.609375 | 3 | [] | no_license |
#include "Character.h"
CCharacter::CCharacter() :
m_CharacterInfo{}
{
}
CCharacter::CCharacter(const CCharacter& obj) :
CGameObject(obj)
{
m_CharacterInfo = obj.m_CharacterInfo;
}
CCharacter::~CCharacter()
{
}
void CCharacter::Start()
{
CGameObject::Start();
}
bool CCharacter::Init()
{
if (!CGameObject::Init... | true |
adfb8f2c83f1e7c46ec25fee57c5317e9b2d4a03 | C++ | cedreg/dipRepo | /ROT/ROT/rottestclass.cpp | UTF-8 | 1,284 | 2.953125 | 3 | [] | no_license | #include "rottestclass.h"
#include <QDebug>
#include <iostream>
int rotTestClass::getActSize() const
{
return actSize;
}
rotTestClass::rotTestClass(int maxSize)
{
actSize = 0;
size = maxSize;
a = new int [size];
}
rotTestClass::rotTestClass(const rotTestClass &other)
{
if(this != &other)
{
... | true |
0e088d4454ded10b3ff0a91e53cddc6b873ef258 | C++ | Jamil132/DSA-COMPLETE-SERIES | /Array/Union.cpp | UTF-8 | 1,105 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <bits/stdc++.h>
#define N 100
using namespace std;
// Merging is Done when Array is Sorted
// Time Complexity is Theta(n+m)
// Overall O(n)
void Union_Sort(int A[],int B[],int n,int m)
{
int C[N];
int i=0,j=0,k=0;
while(i<n && j<m)
{
if(A[i]<B[j])
... | true |
047a16b2ab16a73077b7afdb393078d5667981cd | C++ | dongb94/algorithm | /Data Structure/Stack.h | UTF-8 | 731 | 3.578125 | 4 | [] | no_license | #include <iostream>
template<typename T>
class Stack {
private:
T *start;
int nOfE;
int size;
public:
Stack() {
start = new T[10];
nOfE = 0;
size = 10;
}
Stack(int N) {
start = new T[N];
nOfE = 0;
size = N;
}
void push(T n) {
if (nOfE == size) {
T *sizeIncreaseStack = new T[size * 2];
si... | true |
9c901c17b3cf79bef91a784294536b2aae3c5b53 | C++ | zarif98sjs/Competitive-Programming | /CodeForces/Virtual Contest/Round 641/D.cpp | UTF-8 | 3,048 | 2.546875 | 3 | [] | no_license |
/**
If there is any subset of size 3 , which has at least 2 elements >=k we can make it .
The idea is intuitive .
**/
/** Which of the favors of your Lord will you deny ? **/
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define MP make_pair
#d... | true |
e98255f39b81657a6b3a37e0fb94423a282ad7cd | C++ | guzhaolun/LeetCode | /LeetCode/MyCode/67. add_binary.h | UTF-8 | 626 | 3.0625 | 3 | [] | no_license | #include <string>
#include <algorithm>
using namespace std;
class Solution67{
public:
string addBinary(string a, string b) {
int decade = 0;
int sum = 0;
int ones = 0;
int as = a.size(), bs = b.size();
int size = max(as, bs);
if (as < bs)
{
for (int i = 0; i < bs - as; i++)
a.insert(a.begin(), '0... | true |
bec23573be36c2b1ebf3e388e3fcb88b988dff06 | C++ | ChaseCarthen/simphys | /quiz5/src/test/tests.cpp | UTF-8 | 3,028 | 3.046875 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "mat22.h"
#include "mat33.h"
#include "mat44.h"
#include <iostream>
using namespace simphys;
class matTest2 : public ::testing::Test {
protected:
mat22 a2;
mat22 b2;
vec2 v2;
matTest2()
: a2{1,2,3,4}
, b2{1,2,3,4}, v2{1,1} { }
};
class matTest3 : public ::testing::Tes... | true |
6b2aa60fbdfc3502881676e98f514544c6f3262a | C++ | Bekaryss/LeetCode-Old | /Bit Monipulation/Convert a Number to Hexadecimal 405/Convert a Number to Hexadecimal 405/Convert a Number to Hexadecimal 405.cpp | UTF-8 | 2,091 | 3.078125 | 3 | [] | no_license | // Convert a Number to Hexadecimal 405.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
string toHex(int num) {
if (num == 0) {
return "0";
}
vector<string> hex = ... | true |
110cb7cff7081792a14165d7a95aed1c2d3241b9 | C++ | pytorch/pytorch | /c10/cuda/CUDADeviceAssertionHost.h | UTF-8 | 6,394 | 2.875 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause",
"LicenseRef-scancode-secret-labs-2011",
"LicenseRef-scancode-generic-cla",
"BSL-1.0",
"Apache-2.0"
] | permissive | #pragma once
#include <c10/cuda/CUDAMacros.h>
#include <memory>
#include <mutex>
#include <string>
#include <vector>
#ifdef USE_CUDA
#define TORCH_USE_CUDA_DSA
#endif
/// Number of assertion failure messages we can store. If this is too small
/// threads will fail silently.
constexpr int C10_CUDA_DSA_ASSERTION_COUN... | true |
2fd98db21e1a396cfc3a2e0b1890a64529f82947 | C++ | wzhFeng/HydrusExecuterTools | /HydrusFiles/Stringhelper.h | UTF-8 | 1,986 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <utility>
#ifndef STRINGHELPER_H
#define STRINGHELPER_H
#include <string>
#include <vector>
class Stringhelper
{
public:
Stringhelper(const std::string& s):_str(s) {}
Stringhelper(const char* c):_str(c){}
Stringhelper(const Stringhelper& rhs)
{
if(this!=&rhs)
{
_... | true |
3c989e4a9121426e916899d2e2a9126da487c455 | C++ | datamsh/cpp | /2018_studied_C++/문성환_201427519_과제10사원_오버로딩.cpp | UHC | 1,592 | 3.765625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
enum EmployeeLevel{,븮,,,};
class Employee {
string name;
EmployeeLevel level;
public:
Employee(string name, EmployeeLevel employee)
:name(name), level(employee){
}
string getName() const {
return name;
}
int g... | true |
897dfe231940bf4141b8c6bfed3d2be737508f69 | C++ | parksangji/Coding-Test | /Programmers/Level1/Level1-28.cc | UTF-8 | 303 | 2.6875 | 3 | [] | no_license | #include <string>
#include <vector>
using namespace std;
int solution(int num) {
int answer = 0;
long long num1 = num;
while(num1 != 1)
{
if(answer >= 500 ) return -1;
if(num1 & 1) num1 = num1* 3 + 1;
else num1 /= 2;
answer++;
}
return answer;
} | true |
874f3276624ae675a39bbf7fb746abe41fa0b94d | C++ | lukasnymsa/WildCard | /src/PlayerAI.hpp | UTF-8 | 1,349 | 2.984375 | 3 | [] | no_license | #ifndef WILDCARD_PLAYERAI_HPP
#define WILDCARD_PLAYERAI_HPP
#include "Player.hpp"
/**
* Represents AI player
* Its cards, health, cursor_position etc.
*/
class PlayerAI : public Player {
public:
/**
* Creates a new AI player
* @param max_health maximal health of the player
* @param health starti... | true |
a4d7415b96e1587e3d8512abb74e0d9873b66ab3 | C++ | varshakrishnakumar/Amazon-Customer-Data-Analysis | /main.cpp | UTF-8 | 1,981 | 3.109375 | 3 | [] | no_license | #include "Graph.h"
int main() {
Graph graphtemp;//graph object to read data.csv file
std::vector<std::pair<int, int> > Grr = graphtemp.readcsvresult("/home/NETID/aiushem2-lisamp2-rgyanm2-varshak3/data.csv");
//obtaining max number of nodes in the data
int nodes = graphtemp.readcsvtemp("/home/NETID/ai... | true |
230cd233e4a1961e84a7e7aa03385df22fe22fca | C++ | reidaruss/Reid_Russell_CS3353 | /Lab4/src/Node.h | UTF-8 | 459 | 2.90625 | 3 | [] | no_license | //
// Created by Reid Russell on 11/23/2019.
//
#ifndef LAB4_NODE_H
#define LAB4_NODE_H
#include <iostream>
#include <vector>
class Node {
private:
int nodeId;
std::vector<float> position;
public:
Node();
void setPos(std::vector<float> pos);
void setId(int id) {nodeId = id;}
int getId()con... | true |
66ad90a7454e144a509931bf5689b850fc4ffe10 | C++ | tommy-russoniello/cpp-tic-tac-toe | /board.h | UTF-8 | 2,997 | 3.65625 | 4 | [] | no_license | #ifndef BOARD_H
#define BOARD_H
#include <random>
#include <vector>
using std::mt19937;
using std::pair;
using std::vector;
class Board
{
private:
bool won;
char spaces [10];
vector<int> winningRow;
vector<int> movesX;
vector<int> movesO;
mt19937 gen;
// Sets given value at given position of board ... | true |
ab4d539a43a5343d041ed14dc725b8c348b80b56 | C++ | Hennessey-ak/Stephen-prata-solutions | /golf.cpp | UTF-8 | 721 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include "golf.h"
using std::cout;
using std::cin;
using std::endl;
void setgolf(golf &g, const char *name, int hc)
{
std::strcpy(g.fullname,name);
g.handicap = hc;
}
int setgolf(golf &g)
{
cout<<"Enter the name (Enter nothing to quit): ";
cin.get(g.fullname,Le... | true |
d47b6fa93831b6318e826833d44a32f257c417f5 | C++ | akshaymishra5395/GeeksforGeeks | /Row with max 1s.cpp | UTF-8 | 426 | 3.125 | 3 | [] | no_license | // https://practice.geeksforgeeks.org/problems/row-with-max-1s0023/1
class Solution{
public:
int rowWithMax1s(vector<vector<int> > arr, int n, int m) {
int j=arr[0].size()-1;
int index=-1;
for (int i=0;i<arr.size();i++)
{
while(j>=0 && arr[i][j]==1)
{
j--;
... | true |
7c58c8f336f0c7d32e66cf0ea1dc22b201b4472a | C++ | prudentboy/leetcode | /Solutions/102.binary-tree-level-order-traversal.cpp | UTF-8 | 1,153 | 3.21875 | 3 | [] | no_license | /*
* @lc app=leetcode id=102 lang=cpp
*
* [102] Binary Tree Level Order Traversal
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector... | true |
f831e5a97ba6685585ea216ab87973dd2694a4c4 | C++ | RafaelOstertag/gangof4 | /src/game/game.hh | UTF-8 | 1,263 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef __GAME_HH
#define __GAME_HH
#include "../board/board.hh"
#include "../board/boardrenderer.hh"
#include "../scorer/scorer.hh"
#include "../sdl/fontfactory.hh"
#include "../sdl/renderable.hh"
#include "../sdl/window.hh"
#include "../tetrimino/tetriminostock.hh"
#include "../sdl/text.hh"
#include "labelvalue.hh"
... | true |
b9f9c7b64ff4c01579d8596a27bb1dc3b2481d04 | C++ | facebook/openbmc | /common/recipes-qin/ipc-interface/files/Ipc.h | UTF-8 | 2,820 | 3 | 3 | [] | no_license | /*
* Copyright 2014-present Facebook. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*... | true |
72b17585c84f4bbcc0aec401924dbc0843cc64bd | C++ | CameronJMurphy/AI-Repo | /Dinosaur Sim/inc/dijkstrasSearch.h | UTF-8 | 1,298 | 2.859375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <vector>
#include<list>
#include <math.h>
struct Vector2
{
Vector2() : x(0), y(0){}
Vector2(float X, float Y) : x(X), y(Y) {}
float x;
float y;
float Magnitude()
{
return sqrt(x * x + y * y);
}
};
namespace Pathfinding
{
struct Edge... | true |
5ac348df2767f2f26405135e66065756bba0ad41 | C++ | Mayank-Parasar/leetcode | /pointer_to_array_of_matrices.cpp | UTF-8 | 2,013 | 3.546875 | 4 | [] | no_license | //
// Created by Mayank Parasar on 11/9/20.
//
/* Given by user input
* create multiple matrices
* with values; of dimension given by user
* For example:
* ./leetcode <num-matrix> <dim-of-mat-0> <dim-of-mat-1> <dim-of-mat-2> ...
* This will print matrices:
* Matrix-0: <dim-of-mat-0> X <dim-of-mat-0>
* Matrix-1:... | true |
aba7558f3f4972f7f06e5af374ab9c4e217f339c | C++ | ChuankunZhang/blastani | /DataInputClass.cpp | UTF-8 | 2,103 | 2.671875 | 3 | [] | no_license | #include "DataInputClass.h"
DataInputClass::DataInputClass(){
m_Path = " ";
m_Query1 = " ";
m_Query2 = " ";
}
DataInputClass::~DataInputClass(void){
}
DataInputClass::DataInput(){
cout<<"*********************"<<endl<<"[ANI CALCULATOR v1.0]"<<endl<<"*********************"<<endl<<endl;
cout<<"Please enter the... | true |
a48e2e9908d8932f4457632437a6d9589c6f62c7 | C++ | WULEI7/WULEI7 | /数据结构作业/12.3 图的实现.cpp | GB18030 | 8,157 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#define maxn 105
#define inf 999999999//
using namespace std;
typedef struct
{
int arcs[maxn][maxn];//ڽӾ
int vexnum;//Ŵ1vexnum
int arcnum;//ߣ
int Graphkind;//ͼࣨ1Ϊͼ2Ϊ3Ϊͼ4Ϊ
}MGraph;/... | true |
5f3e6432c87499034bbd88f308b724ce55d3409f | C++ | JJBBB/Cplusplus-Library-based-on-the-single-list | /DATA/genDLList.h | UTF-8 | 1,305 | 3.484375 | 3 | [] | no_license | #ifndef DOUBLY_LINKED_LIST
#define DOUBLY_LINKED_LIST
#include "stdafx.h"
template<class T>
class DLLNode
{
public:
DLLNode()
{
next = prev = 0;
}
DLLNode(const T& el, DLLNode *n = 0, DLLNode *p = 0)
{
info = el; next = n; prev = p;
}
T info;
DLLNode *next, *prev;
};
template<class T>
class DoublyLinkedL... | true |
204efa0ed56cfef6f19b602ae5edc3ef0e40ba98 | C++ | LuckyGrx/CppPrimer | /ch13/ex13_18.h | UTF-8 | 488 | 2.828125 | 3 | [] | no_license | ///
/// @file ex13_18.h
/// @author zack(18357154046@163.com)
/// @date 2017-09-08 19:04:58
///
#ifndef __CP5_EX13_18_H__
#define __CP5_EX13_18_H__
#include <string>
class Employee{
public:
Employee();
Employee(const std::string&);
private:
std::string _name;
int _id;
static int _id_increase;
};
int E... | true |
f8aa27236b1913bba0b87b10597504d68be7d2e4 | C++ | nmicht/ejercicios-progra-cpp | /Secuenciales/practica9.cpp | UTF-8 | 472 | 3.171875 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define HORA 6.875
int main (int argc, char* argv[])
{
float horastotales, hraextras, extras, salario;
cout << "Cuantas horas trabajaste en la quincena? ";
cin >> horastotales;
hraextras = horastotales - 80;
salario = 80 * HORA;
extras = hraextras *... | true |
9ed60aee39815c16085ed45d7fe2e37cd50aa7de | C++ | TsufCohen/AVL-Tree | /TreeNode.h | UTF-8 | 17,646 | 3.4375 | 3 | [] | no_license | //
// Created by Tsuf Cohen on 2019-06-15.
//
#ifndef TESTFORTREEAVL_TREENODE_H
#define TESTFORTREEAVL_TREENODE_H
#include <cstdio>
#include <iostream>
using std::size_t;
/**
*
* @tparam T - must have 'operator=','operator<' and 'operator=='.
* note: 'T information' is the node's key, so the field... | true |