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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b2fe7e5e0e167b6fe01040fd10c668965b6dc605 | C++ | lscooperlee/guitarbox | /drum/src/DrumkitPlayer.cpp | UTF-8 | 736 | 2.59375 | 3 | [] | no_license | #include "DrumkitPlayer.h"
#include "AudioPlayer.h"
#include "DrumPattern.h"
#include "Rhythm.h"
#include <chrono>
DrumkitPlayer::DrumkitPlayer(Rhythm &rhythm_, AudioPlayer &player_)
: rhythm(rhythm_), player(player_){};
void DrumkitPlayer::play(const DrumPattern &pattern_) {
pattern = pattern_;
auto call =... | true |
db69114006b85e825ec8c312439040eec0a3b23c | C++ | GuillaumeBouchetEpitech/experiment-md3-loader | /main.cpp | UTF-8 | 877 | 3.203125 | 3 | [] | no_license |
#include <iostream>
#include "Game.hh"
#include "RuntimeException.hh"
int main(int argc, char** argv, char** env)
{
static_cast<void>(argc);
static_cast<void>(argv);
bool display = false;
const std::string cmp("DISPLAY=:0.0");
const std::string cmp2("DISPLAY=:0");
for (int i = 0; env[i]; ++i)
i... | true |
5335f6328de8b551b48b8666eadaa9e0bd8483c8 | C++ | Gigahawk/cpen333 | /Assignments/Assignment 2/Assignment 2 - Part D, E/Assignment 2 - Part D/Logger.h | UTF-8 | 627 | 2.65625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include <stdarg.h>
using namespace std;
void show_log(bool enable);
class LogMgr {
public:
static LogMgr* get_instance() {
if (inst == nullptr) {
inst = new LogMgr();
}
return inst;
}
bool enable = true;
private:
static LogMgr* inst;
LogMgr() {}
};
c... | true |
df7916ce81c72a6315ce3492c77ec884c4daeb0c | C++ | CurrentResident/IncrediBoard | /Core/SuperModifier.h | UTF-8 | 5,772 | 2.734375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-stlport-4.5",
"LicenseRef-scancode-mit-old-style",
"BSL-1.0"
] | permissive | #ifndef SUPER_MODIFIER_H_
#define SUPER_MODIFIER_H_
#include <boost/fusion/algorithm.hpp>
#include <boost/fusion/iterator.hpp>
#include "BoardState.h"
#include "Decorators.h"
#include "Key.h"
#include "Platform.h"
namespace SuperModifier
{
struct PressKeys
{
BoardState& state;
... | true |
07957ba3f897fcf258fdb249a9ecf2abd21c0351 | C++ | hsleung95/gameStruct | /enemyChar.cpp | UTF-8 | 1,034 | 2.8125 | 3 | [] | no_license | //
// enemyChar.cpp
// gameStruct
//
// Created by Wilson Leung on 25/7/2017.
// Copyright © 2017年 Wilson Leung. All rights reserved.
//
#include "enemyChar.hpp"
#include <string>
#include <iostream>
enemyChar::enemyChar(){
expContain = maxHP * 0.5 + maxMP * 0.1 + attack * 4 + defense * 4;
eq = equipment();
eq... | true |
1afed8caaeccc575271e029d76c0573451043884 | C++ | GilgameshxZero/Computer-Monitor | /Computer Monitor/Utility.cpp | UTF-8 | 2,033 | 2.984375 | 3 | [] | no_license | #include "Utility.h"
namespace CM
{
namespace Utility
{
std::string IntToString (int number)
{
std::ostringstream outstream;
outstream << number;
return outstream.str ();
}
int StringToInt (std::string string)
{
std::istringstream instream (string);
int number;
instream >> number;
re... | true |
d555f9f18981f83d77577bd8d246841ef2abc3a2 | C++ | jjsuper/leetcode | /leetcode-viewer/solutions/361.bomb-enemy/bomb-enemy.cpp | UTF-8 | 941 | 2.8125 | 3 | [] | no_license | class Solution {
public:
int maxKilledEnemies(vector<vector<char>>& grid) {
if(grid.empty()) return 0;
int row=0;
vector<int> col(grid[0].size(), 0);
int result=0;
for(int i=0; i<grid.size(); ++i)
for(int j=0; j<grid[0].size(); ++j) {
... | true |
1076c7baec8b7d9214f9bc48dff43e9bed6ec23b | C++ | ChestnutHeng/LeetCode | /103.binary-tree-zigzag-level-order-traversal.cpp | UTF-8 | 1,416 | 3.1875 | 3 | [] | no_license | /*
* @lc app=leetcode id=103 lang=cpp
*
* [103] Binary Tree Zigzag Level Order Traversal
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(in... | true |
c509aeb0a9fd676c87b65185714ae9bc79fe2273 | C++ | ullasreddy-chennuri/GeeksforGeeks | /Count zeros in a sorted matrix.cpp | UTF-8 | 1,953 | 4.125 | 4 | [] | no_license | /*
Given a Binary Square Matrix where each row and column of the matrix is sorted in ascending order.
Find the total number of Zeros present in the matrix.
Input:
The first line of input will be the no of test cases then T test cases will follow.
The second line of each test case contains an integer N denoting the di... | true |
3db2401696f9872ff8d1e73208d79e74c5196841 | C++ | GoGoCom/ESP8266 | /1.3 sample/VariableAddress/VariableAddress.ino | UTF-8 | 1,026 | 2.5625 | 3 | [] | no_license |
long weight = 10000;
//char tname[5] = "nest";
char tname[5] = { 'n','e','s','t' };
static char day = 'a';
void test(int ar1, char ar2 )
{
day = 'b';
Serial.print("char day ");
Serial.println( (unsigned long ) &day, HEX);
Serial.print("int ar1 ");
Serial.println( (unsigned long ) &ar1, HEX);
Ser... | true |
2c17d0fec08cee7d8d555dcf28303c97532a6ead | C++ | Connor-Bowley/neuralNetwork | /include/MSILocations.h | UTF-8 | 1,477 | 2.609375 | 3 | [] | no_license | #include <string>
#include <map>
#include <unordered_map>
#include <vector>
struct Box
{
int32_t species_id;
int32_t x; // top left corner x
int32_t y; // top left corner y
int32_t w; // width
int32_t h; // height
int32_t cx; // center point x
int32_t cy; // center point y
int32_t ex; // bottom right corne... | true |
54950ef83662d9b4d9af64ac810be19cbec9eadc | C++ | y2kiah/nebulous | /source/Render/Texture_D3D9.h | UTF-8 | 4,582 | 2.578125 | 3 | [] | no_license | /*----==== TEXTURE_D3D9.H ====----
Author: Jeff Kiah
Orig.Date: 06/21/2009
Rev.Date: 07/07/2009
--------------------------------*/
#pragma once
#include <string>
#include "Resource_D3D9.h"
#include "../Utility/Typedefs.h"
using std::string;
///// STRUCTURES /////
struct IDirect3DTexture9;
struct IDirect3DCubeT... | true |
71c8939da67fbaf4f131730377a4508099b5ea2e | C++ | clairedemars1/Python_Interpreter_Partial | /turn_in/includes/symbolTable.h | UTF-8 | 931 | 2.859375 | 3 | [] | no_license | #ifndef SYMBOLTABLE__H
#define SYMBOLTABLE__H
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
class Literal;
class FuncNode;
class Node;
class SymbolTable {
// i.e. scope
public:
SymbolTable() : vars(), funcs(), enclosingScopeIndex(-1) {}
void setVar(const std::string& name, const L... | true |
6b312888a714e31f0179c6e5efc8a604f6b34033 | C++ | mateuszkretek/c_cpp | /Zbiory/Zbiory/Zbiory/odczyt.cpp | WINDOWS-1250 | 3,750 | 3.3125 | 3 | [] | no_license | /** @file */
#include <fstream>
#include <iostream>
#include "funkcje.h"
using namespace std;
bool argument(int argc, char* argv[], string& name) // sprawdzanie poprawnoci argumentu programu
{
for (int i = 1; i < argc; i++)
{
if (strcmp(argv[i], "-i") == 0)
{
++i;
if (i < argc)
{
name.assign(arg... | true |
061dc55945cee430f15e40f0b3d132910cc637b3 | C++ | acoustictime/CollegeCode | /Riverside Community College (RCC)/CIS-5/Data Files/Chapter 19/Source Code/linkedQueue/testProgLinkedQueue.cpp | UTF-8 | 547 | 3.515625 | 4 | [] | no_license | //Test Program linked queue
#include <iostream>
#include "linkedQueue.h"
using namespace std;
int main()
{
linkedQueueType<int> queue;
int x, y;
queue.initializeQueue();
x = 4;
y = 5;
queue.addQueue(x);
queue.addQueue(y);
x = queue.front();
queue.deleteQueue();
queue.addQueue(x + 5);
... | true |
ccd2372981737355465bd99fdab50375dcc43fd0 | C++ | Hitonoriol/Methan0l | /src/util/containers.h | UTF-8 | 1,809 | 2.984375 | 3 | [] | no_license | #ifndef SRC_UTIL_CONTAINERS_H_
#define SRC_UTIL_CONTAINERS_H_
#include <type_traits>
#include <type.h>
#define FWD_VAL std::forward<T>(val)
#define LIST_T decltype(c.push_back(FWD_VAL), void())
#define SET_T decltype(c.insert(FWD_VAL), void())
namespace mtl
{
template<typename C>
using iterator_of = decltype(std::... | true |
87e9f3568392dbfcca92e245f3a7f56f58420480 | C++ | AccessDenied1/Competitive_Coding | /codechef/CHANDF2.cpp | UTF-8 | 2,378 | 2.640625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int cc(long x,long y,long l,long r)
{
long p = (x&l)*(y&l);
int gh = l;
for(long i = l+1;i<=r;i++)
{
long p_n = (x&i)*(y&i);
if(p_n > p)
{
p = p_n;
gh = i;
}
}
return gh;
}
string decToBinary(long n)
{
string s = "";
while (n > 0)
{
... | true |
3a2e1008c6d5e9db7f62f1a0619a59c6536c9267 | C++ | markuskr/raytracer | /StandardOperatorFactory.cpp | UTF-8 | 7,038 | 2.6875 | 3 | [] | no_license | //----------------------------------------------------------------------
/// Filename: StandardOperatorFactory.cpp
/// Group: 20
/// \brief : factory for producing the standard operators
/// Last Changes: 22.06.2008
//----------------------------------------------------------------------
#include "StandardOpera... | true |
9722fd1a876169f12d6349586db72e19b35948a8 | C++ | sunbinbin1991/myfirstcode | /example/leetCode/187_findRepeatedDnaSequences.h | UTF-8 | 596 | 2.625 | 3 | [] | no_license | class Solution187 {
public:
vector<string> findRepeatedDnaSequences(string s) {
if(s.empty()) return {};
set<string> strSets;
set<string> res;
for (int i = 0; i <= s.size() - 10 && s.size() >= 10; i++){
string sub = s.substr(i, 10);
// cout << "sub :" << sub <... | true |
39f4a99788fa43cb90e670629be3792d9f2e7e8e | C++ | artcampo/2013_3D_unfinished_game | /Game/Entities/Ship/Ship.hpp | UTF-8 | 2,053 | 2.515625 | 3 | [] | no_license | #ifndef _SHIP_HPP_
#define _SHIP_HPP_
#include "dx_misc.hpp"
#include <memory>
class Physics;
class RigidBody;
class TimeForce;
class TimeTorque;
class ShipDescription{
public:
float fwdModule;
float bckModule;
float sidModule;
float pitchModule;
float yawModu... | true |
c33822cc3f96cd710d9fd905b73456c2ab1772e0 | C++ | AvatarSenju/Competitive | /cpp/max-snake-matrix.cpp | UTF-8 | 501 | 3.0625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void amax(T &x, U y)
{
if (x < y)
x = y;
}
int mymax(vector<vector<int>> a,int i,int j,int n,int m)
{
if(i>=n || j>=m)
return 0;
return(a[i][j]+max(mymax(a,i+1,j,n,m),mymax(a,i,j+1,n,m)));
}
int main... | true |
0c3e47b17a0fb4d09ce8b8c9a453088debc8f16f | C++ | StrategFirst/ConsoleColor | /consolecolor.hh | UTF-8 | 1,164 | 3.234375 | 3 | [] | no_license | #include <iostream> // std::ostream
#include <math.h> // abs
namespace console {
enum class mode { RGB , HSL , HSV };
class color {
private: //custom types
using color_component_t = unsigned int;
struct RGB {
color_component_t r;
color_component_t g;
color_component_t b;
};
private: //conver... | true |
d76931ab6874df8085725a897e25895042a59e99 | C++ | fengshen024/Algorithm | /aoapc_uva/aoapc-code/ch04/UVA512.cpp | UTF-8 | 3,400 | 2.625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef struct Pos{
int x, y;
Pos(int _x=0, int _y=0): x(_x), y(_y){} // 默认值表示默认构造函数
// bool operator < (const Pos& b) const { // map需要排序,必须加const,否则编译报错
// if (x == b.x) return y < b.y;
// else return x < b.x;
// }
friend bool operator < ... | true |
58c3fb6ce199c1ddb4144feda61f92b8aae7a058 | C++ | true-dude/second | /cut_tree_2d_sum.cpp | WINDOWS-1251 | 2,925 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int log(int n){
int x = 1, c =0;
while (x < n){
x *= 2;
c ++;
}
return x;
}
void update(vector<vector <int>> &a, int x, int y, int inc){ //
int tx=x, ty = y;
while (tx > 0){
ty = y;
whi... | true |
83851b10c3e97b2aa81f7c2ba1901bc8e5ef7396 | C++ | dmatseku/piscine_cpp | /day03/ex01/ScavTrap.hpp | UTF-8 | 822 | 2.8125 | 3 | [] | no_license | #ifndef SCAVTRAP_HPP
#define SCAVTRAP_HPP
#include <string>
class ScavTrap
{
private:
unsigned int _hit_points;
unsigned int _max_hit_points;
unsigned int _energy_points;
unsigned int _max_energy_points;
unsigned int _level;
std::string _name;
unsigned int _melee_attac... | true |
8e506bdfad44a621f60c44b6228f98bdbc111813 | C++ | shuhua833/static | /static.cpp | UTF-8 | 195 | 2.5625 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
void increment();
int main()
{
back:
increment();
getch();
goto back;
return 0;
}
void increment()
{
static int x=1;
printf("x:=%d\n",x);
x++;
}
| true |
d1d2bf6131ff0fc197cd55da0a378838fa4892eb | C++ | davnils/kattis-skeleton | /include/KattisTask.hpp | UTF-8 | 1,216 | 3.0625 | 3 | [] | no_license | /**
* KattisTask interface file.
* Part of the public kattis-skeleton project.
*/
#pragma once
#include <cassert>
#include <iostream>
/**
* Generic interface implemented by solvers, written for specific
* Kattis problems. Serves the purpose of cleaning up initialization,
* ensuring proper termination and reduc... | true |
caa6d824924cce0c0fb30f7f346ca226c69781cd | C++ | lonski/amarlon | /src/actor/actor_actions/use_skill_action.cpp | UTF-8 | 693 | 2.53125 | 3 | [] | no_license | #include "use_skill_action.h"
#include <skill.h>
namespace amarlon {
UseSkillAction::UseSkillAction(SkillPtr skill, Target target)
: _skill(skill)
, _target(target)
{
}
UseSkillAction::~UseSkillAction()
{
}
ActorActionResult UseSkillAction::perform(ActorPtr user)
{
_user = user;
ActorActionResult r = ActorA... | true |
e37f198f9e37ae28217094913c21f75d3fb37cd7 | C++ | AniaRuchala/PSI | /perceptron/psi1/Neuron.cpp | WINDOWS-1250 | 1,649 | 3.15625 | 3 | [] | no_license | #include "Neuron.h"
#include <cstdlib>
#include <iostream>
#include <ctime>
double randFun(double fMin, double fMax){
double f = (double)rand() / RAND_MAX;
return fMin + f * (fMax - fMin);
}
Neuron::Neuron(){
srand(time(NULL));
waga = NULL;
funcAct = NULL;
}
Neuron::Neuron(int m_n) : n(m_n){
srand(time(NULL));... | true |
c1e25b3a08f839a9ef9bfe670c8bbeeb55d52a34 | C++ | eslam-99/programming-abstractions | /Chapter_09/Exercise_07/9_07.cpp | UTF-8 | 3,600 | 3.234375 | 3 | [] | no_license | //
// File: 9_07.cpp
// Programming Abstractions C++
//
// Exercise Description:
//
// Created by Ben Mills on 10/8/14.
//
//
#include <stdio.h>
#include "cube.h"
#include "console.h"
#include "vector.h"
#include "set.h"
#include <stdlib.h>
#include "strlib.h"
using namespace std;
const int TOTAL_CUBES = 4;
cons... | true |
baac241c716f175d47e7bc62453646a31927c618 | C++ | Nheko-Reborn/mtxclient | /include/mtx/responses/well-known.hpp | UTF-8 | 986 | 2.546875 | 3 | [
"MIT"
] | permissive | #pragma once
/// @file
/// @brief Response for .well-known lookup.
#include <optional>
#if __has_include(<nlohmann/json_fwd.hpp>)
#include <nlohmann/json_fwd.hpp>
#else
#include <nlohmann/json.hpp>
#endif
namespace mtx {
namespace responses {
//! The info about this server.
struct ServerInformation
{
//! Requir... | true |
45cca9c3ac130771bd1291dd14f4174089b90569 | C++ | shoamco/Cpp-under-the-hood | /SmartPointer/Test/TestSharedtPointer.cpp | UTF-8 | 2,164 | 2.984375 | 3 | [] | no_license | //
// Created by shoam on 2/13/20.
//
#include "TestSmartPointer.h"
#include "SharedPointer.h"
void testControlBlock(){
std::cout<<"\n\n\n************** testControlBlock *******\n";
ReferenceCounter referenceCounter();
std::cout<<referenceCounter;
}
void testCtorSmartPtr(){
std::cout<<"\n\n\n************** ... | true |
e577ea9b9f20b2ab8c51e94e814483cc148424d9 | C++ | BrandeisMakerLab/Arduino_Education | /extras/Projects/workshopResults/Dariel_7-25-2019/Dariel_7-25-2019.ino | UTF-8 | 1,530 | 2.984375 | 3 | [] | no_license | //imports the library that must be used to run this program
#include <DHT.h>
#include <DHT_U.h>
#define BLUEPIN 4
#define REDPIN 3
//initializes the part so that the program knows what to expect to run
DHT dht(2, DHT22);
float initHumid;
void setup() {
//initialize serial port (allows for commuication with arduino by... | true |
7149df12ec6ec86390cbd5e6e2ac66e2a9f80835 | C++ | khantra/schoolwork | /Accelerated Intro to Programming/week6/boxSort.cpp | UTF-8 | 1,799 | 3.8125 | 4 | [] | no_license | /*********************************************************************
** Author:/ Khandakar Shadid
** Date: / 2/8/2017
** Description:/ Sorting an array of "Box" objects using a bubble sort.
**************** To do so I just had to edit the bubble sort to accept
**************** a Box object. I then tested it using ra... | true |
c2ae966455af8b5c65991fdefa1c38d2d810da2e | C++ | cksharma/coding | /cpp/c++17/unordered_map/order.cpp | UTF-8 | 3,122 | 3.46875 | 3 | [] | no_license | #include <bits/stdc++.h>
class Order
{
public:
std::string ticker_; // name of the company, e.g., MSFT, IBM, GOOG
int userId_; // id of the user working on the order
std::string side_; // "BUY" - order to buy, "SELL" - order to sell
int qty_; // number of shares to buy/sell
do... | true |
2f325a82d07b1ed9fe91d094e5aa6711cb188555 | C++ | yuxiang660/little-bee-socket | /src/internal/EventTimerHandlerQueue.h | UTF-8 | 987 | 2.515625 | 3 | [] | no_license | #pragma once
#include "internal/system/EventModifierInterface.h"
#include "internal/system/EventTimerFd.h"
#include "internal/system/Event.h"
#include "internal/system/Timestamp.h"
#include "TimerHandler.h"
#include <map>
#include <vector>
namespace cbee
{
class EventTimerHandlerQueue
{
public:
EventTimerHandler... | true |
c1cca1d1512fce6ea61f090c68ab651d3db4d588 | C++ | south-potato/poseidonos | /test/unit-tests/lib/counter_timeout_checker_test.cpp | UTF-8 | 1,136 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | #include "src/lib/counter_timeout_checker.h"
#include <gtest/gtest.h>
namespace pos
{
TEST(CounterTimeoutChecker, CounterTimeoutChecker_)
{
//When: Create target object in stack
CounterTimeoutChecker ctc;
//Then: Do nothing
//When: Create target object in Heap
CounterTimeoutChecker* pCtc = new C... | true |
c6616f9f55f5601e3f744fa2a7236bb4bd9a59c9 | C++ | FinancialEngineerLab/quantnet-baruch-certificate-cpp | /Level 5_Inheritance_Generalisation_Specialisation/Section 3_5/Exercise 4/Exercise 4/TestExercise4.cpp | UTF-8 | 862 | 3.078125 | 3 | [] | no_license | //Test inheritance concepts.
#include <iostream>
#include "stdlib.h"
#include <ctime>
#include "Shape.h"
#include "Point.hpp"
#include "Line.hpp"
#include "Circle.hpp"
using namespace std;
using namespace Shihan;
using namespace CAD;
int main ()
{
srand( time(0)); //The pseudo-random number generator is i... | true |
8e0f9bfaf8f04c8b1008bd5efc37d9794e8b3c22 | C++ | afikur/UVA-Solutions | /11799 Horror Dash.cpp | UTF-8 | 524 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int maximum(int *a, int n) {
int max_val = a[0];
for(int i=1; i<n; i++) {
if(max_val < a[i]) {
max_val = a[i];
}
}
return max_val;
}
int main()
{
int testCase, n, *a;
cin>>testCase;
for(int i = 1; i ... | true |
c13b752c0a905c24bb9699f9fa271b544afeb6fa | C++ | jsl4980/Guessing | /src/mainwindow.cpp | UTF-8 | 1,984 | 2.765625 | 3 | [] | no_license | #include "mainwindow.h"
#include "./ui_mainwindow.h"
#include "round.h"
#include <QStackedWidget>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_startButton_clicked()
{
// ... | true |
a0a64a8648d2ba209ea92e8be70118c63ca55bbe | C++ | CSID-DGU/2018-2-CCD-Dreamocon-1 | /sketch_CAP_IRsend_dec11_2.ino | UTF-8 | 2,618 | 2.609375 | 3 | [] | no_license | #include <IRremote.h>
IRsend irsend;
int khz = 38;
void setup() {
//for sending IR
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("on");
turnOn();
delay(10000);
Serial.println("up");
tempUp();
delay(10000);
Serial.println("down");
tempDo... | true |
91175ddf41faac59d566a4f684c72a49e7073e29 | C++ | ProkopHapala/SimpleSimulationEngine | /cpp/tests/lua/test_Lua_callback.cpp | UTF-8 | 3,357 | 2.703125 | 3 | [
"MIT"
] | permissive | // see tutorial
// https://csl.name/post/lua-and-cpp/
#include <stdio.h>
#ifdef __cplusplus
# include <lua5.2/lua.hpp>
#else
# include <lua5.2/lua.h>
# include <lua5.2/lualib.h>
# include <lua5.2/lauxlib.h>
#endif
#include "Vec3.h"
#include "Mat3.h"
#include "LuaHelpers.h"
//lua_State *state = NULL;
extern "C"
int... | true |
9b8cb312bda871e4a34a28f369c609e1b994c7bf | C++ | cjr310/leetcode | /494_Target Sum.cpp | UTF-8 | 2,064 | 3.703125 | 4 | [] | no_license | // You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.
// Find out how many ways to assign symbols to make sum of integers equal to target S.
// Example 1:
// Input: nums is [1, 1, 1, 1... | true |
efdeaa5477f651de276192170a86af9129b0655d | C++ | kaliningleb25/stl | /lab8_1/main.cpp | UTF-8 | 1,125 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
/* Калинин Глеб (23531/21-1)
*
*
* Разработать программу, которая, используя только стандартные алгоритмы и функторы,
* умножает каждый элемент списка чисел с плавающей точкой на число PI
*/
class Mult {
public:
Mult():n(0),res(0)... | true |
009f677ccc1fceebd22743726c7f4a8064d6e524 | C++ | YurieCo/GO | /geomtest/Dot.cpp | UTF-8 | 1,081 | 2.65625 | 3 | [] | no_license | /*
* Dot.cpp
*
* Created on: 09-10-2011
* Author: ghik
*/
#include "commons.h"
#include "Dot.h"
#include <cairo/cairo.h>
Dot::Dot() {
}
Dot::Dot(double _x, double _y) :
x(_x), y(_y), size(POINT_SIZE) {
setColor(fillColor, lineColor);
}
Dot::~Dot() {
}
void Dot::draw(cairo_t *cr) const {
beginDraw(cr... | true |
08688c3244efe96fd0f0a2958a2630ccefc1af7b | C++ | MohitSingh2002/CompleteCpp | /Data Structires And Algorithms/7_graph/1_graph.cpp | UTF-8 | 4,435 | 3.21875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void printDFS(int**, int, int, bool*);
void printBFS(int**, int, int, bool*);
void printDFSUnconnectedGraph(int**, int);
void printBFSUnconnectedGraph(int**, int);
// bool hasPathDFS(int**, int, int, int, int*);
// bool hasPathDFS(int**, int, int, int);
int main() {
... | true |
be4e06a1465ec00fa5df82791a4c7c7ecb020548 | C++ | zhanghuanzj/cpp | /剑指Offer/JZOffer44.cpp | UTF-8 | 520 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | class Solution {
public:
bool IsContinuous( vector<int> numbers ) {
if(numbers.size()<5) return false;
int max = INT_MIN,min = INT_MAX;
int zeroCount = 0;
for(auto v : numbers)
{
if(v!=0)
{
if(v>max) max = v;
if(v<min) min = v;
}
else
{
++zeroCount;
}
}
if(max-min>4) return ... | true |
3b9c7df0e71dc7c6c621f5863d3c45b0429702d7 | C++ | EvanMorcom/Software | /src/software/primitive/stop_primitive.h | UTF-8 | 1,602 | 3.40625 | 3 | [
"LGPL-3.0-only"
] | permissive | #pragma once
#include "software/primitive/primitive.h"
class StopPrimitive : public Primitive
{
public:
static const std::string PRIMITIVE_NAME;
/**
* Creates a new Stop Primitive
*
* Stops the robot with the option to coast to a stop rather than stop immediately
*
* @param robot_... | true |
90e6d318fbc35d233e56464525e9feb5d3067af0 | C++ | 0003088/libelektra-qt-gui-test | /src/tools/kdb/merge.hpp | UTF-8 | 1,117 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef MERGE_HPP
#define MERGE_HPP
#include <command.hpp>
#include <kdb.hpp>
using namespace std;
class MergeCommand : public Command
{
kdb::KDB kdb;
public:
MergeCommand();
~MergeCommand();
virtual int execute (Cmdline const& cmdline);
virtual std::string getShortOptions()
{
return "iHtsvf";
}
virtua... | true |
19f3d667ae90b4b7126047f05e3cff5e4f8358ea | C++ | shanky1947/Data-Structures-and-Algorithm | /Coding Ninjas/Binary Tree/4_mirror.cpp | UTF-8 | 1,110 | 3.859375 | 4 | [] | no_license | /*
Code : Mirror
Send Feedback
Mirror the given binary tree. That is, right child of every nodes should become left and left should become right.
Alt text
Note : You don't need to print or return the tree, just mirror it.
Input format :
Line 1 : Elements in level order form (separated by space)
(If any node does not... | true |
97da039966bd755f5ebbb2ea37c89e17c5e7f247 | C++ | ajayt6/AlgoPractice | /c++/WildCardMatch.cpp | UTF-8 | 1,002 | 3.09375 | 3 | [] | no_license | /*
https://leetcode.com/problems/wildcard-matching/
Not correct answer yet
*/
#include<iostream>
#include<string>
using namespace std;
bool isMatch(string s, string p) {
int i = 0, j = 0,starFlag=0,solidPointer = 0;
while (i < p.length() && j < s.length())
{
switch (p[i])
{
case '*':
i++;
starFlag = 1... | true |
3cbc6873333b7908fa08ee3269319ca9f1d6758c | C++ | bryanlawsmith/Raytracing | /Raytracer (Offline)/KdTreeGeometry.cpp | UTF-8 | 3,962 | 2.59375 | 3 | [
"MIT"
] | permissive | #include "KdTreeGeometry.h"
#include "KdTreeStackTraversal.h"
#include "KdTreeNode.h"
#include "NaiveSpatialMedian.h"
#include "SAH.h"
#include <MemoryAllocatorAligned.h>
#include <Geometry.h>
#include <cassert>
using namespace MathLib;
using namespace Assets;
using namespace Core;
namespace Raytracer
{
KdTreeGeomet... | true |
a3fb3cdab05b99f303828d79d98af0fbcb10a7ce | C++ | sadanjon/meow | /src/entities/position_mesh/iposition_mesh_generator_factory.h | UTF-8 | 1,293 | 2.578125 | 3 | [] | no_license | #ifndef IPOSITION_MESH_GENERATOR_H
#define IPOSITION_MESH_GENERATOR_H
#include <memory>
#include "model.h"
namespace meow {
class IPositionMesh {
public:
IPositionMesh() {}
virtual ~IPositionMesh() {}
IPositionMesh(const IPositionMesh&) = delete;
IPositionMesh &operator=(const IPositionMesh &) ... | true |
5e3bae6ab7982e421674cb5eb26ed076822ee4bd | C++ | Bolpat/Hermite | /src/hermite.cpp | UTF-8 | 14,686 | 2.640625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | #include "polynomial.hpp"
#include <cstdlib>
#include <cctype> // isspace
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <utility> // pair
#include <map>
#include <vector>
using namespace std;
using namespace Modulus;
typedef Polynomial<double> Poly;
map<d... | true |
eeba01a8defa7e688f6132f73666d69e64ad9cd3 | C++ | sknjpn/From-the-Planet | /Region.h | UTF-8 | 1,613 | 2.59375 | 3 | [] | no_license | #pragma once
class PlanetManager;
class FacilityAsset;
class FacilityState;
class TerrainAsset;
class Road;
class Region
: public enable_shared_from_this<Region>
{
friend class PlanetManager;
Vec3 m_position;
Array<Vec3> m_polygon;
weak_ptr<PlanetManager> m_planet;
Array<weak_ptr<Region>> m_connecteds;
Arr... | true |
700397ad8bfb0e8285c02bd9b3432ad94b66def7 | C++ | JorgeAugusto/Cars_AI | /includes/line.h | UTF-8 | 1,349 | 3.296875 | 3 | [] | no_license | #ifndef LINE_H
#define LINE_H
#include <SFML/Graphics.hpp>
class Line
{
public:
sf::RectangleShape rectangle;
sf::CircleShape left;
sf::CircleShape right;
Line();
Line(const Line& line);
Line(const Vector& point_1, const Vector& point_2, const double& width, const sf::Color& color);
Line(const double... | true |
0c1992c84f44f64faa634b68d6b187f30a9d8918 | C++ | yuzec/luogu | /P1739/main.cpp | UTF-8 | 318 | 2.78125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int ans=0;
char x;
cin>>x;
while(x!='@'&&ans>=0) {
if(x=='(')
++ans;
else if(x==')')
--ans;
cin>>x;
}
if(ans==0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}
| true |
56ba30f32e8872290a0f89fbec367e2ace7baa76 | C++ | Hector-Dominguez/myoelectric-473 | /src/SystemCode/xmcCode/CircularBuffer/MyoDataCollector.hpp | UTF-8 | 1,070 | 2.890625 | 3 | [] | no_license | //
// CircularBuffer.hpp
// CircularBuffer
//
// Created by Hector Dominguez on 10/24/18.
// Copyright © 2018 Hector Dominguez. All rights reserved.
//
#ifndef MyoDataCollector_hpp
#define MyoDataCollector_hpp
#include <stdio.h>
class FourTuple
{
public:
int thumb;
int index;
int middle;
int ... | true |
6af949b6f5439f2ca2420ffd3185a0d15757f6ba | C++ | dvphuonguyen/IT003.K26 | /BT_Tuan_5/Linear_Search_Closest/Source.cpp | UTF-8 | 697 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
struct arr {
int* A;
int c;
int n;
};
void input(arr& a) {
cin >> a.n;
a.c = a.n + 1;
a.A = new int[a.c];
for (int i = 0; i < a.n; ++i) {
cin >> a.A[i];
}
}
int Linear_Search(arr a, int x) {
int gan_nhat = 0;
int m = 200000000;
f... | true |
2ed8b62213d7c911c8b2e0f80bd2816ff244c079 | C++ | Tursh/OctoWorld | /src/States/DebugState.cpp | UTF-8 | 1,891 | 2.609375 | 3 | [] | no_license | /*
* DebugState.cpp
*
* Created by tursh on 8/16/20.
*/
#include <States/DebugState.h>
#include <GUI/Panel.h>
#include <GUI/GUIManager.h>
#include <IO/Input.h>
#include <GUI/Text/TextRenderer.h>
#include <Utils/TimeUtils.h>
namespace OW
{
using namespace CGE;
DebugState::DebugState()
{
IO::in... | true |
5c87a6b6551edeaf1a532584667464e0bace40d8 | C++ | mina37/Data-Mining | /Customer.h | UTF-8 | 890 | 3.265625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include<vector>
//implemented headers :
#include "dsList.h"
#include "Enums.h"
#include "string"
class Customer {
private:
Gender gen;
Place pl;
dsList<Product>prodList; //list of customer products
public:
//constructor :
Customer(int gInt, int pInt, dsList <P... | true |
c1118dddef7046e61cd60996d2a572a61b176c59 | C++ | venkatesh551/goals | /c++14/variadicTemplates/parameter_pack_loci.cpp | UTF-8 | 593 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <vector>
template <typename... Ts>
void createMap(Ts... args) {
std::map<Ts...> mp;
mp.insert (std::pair<Ts...>(args...));
auto lst = {std::pair<Ts...>(args, 'a')...};
for (auto ele : lst) {
mp.insert(ele);
}
for (auto ele : mp) {
std:... | true |
09350dde7ca72f11a583b01390382275ff133654 | C++ | J4m3sC95/CAN_LEDS | /ATtiny2313_LED_cube++/ATtiny2313_LED_cube++/LED_Cube.cpp | WINDOWS-1252 | 5,751 | 2.84375 | 3 | [] | no_license | /*
* LED_Cube.c
*
* Created: 15/09/2017 20:49:47
* Author: James
*/
#include "LED_Cube.h"
// Global Variables
volatile uint8_t interrupt_layer;
volatile uint16_t *display_buffer[3];
volatile uint16_t buffer0[4];
volatile uint16_t buffer1[4];
volatile uint8_t active_buffer;
void cube_setup(){
uint8_t n;
//tu... | true |
66f8bb7b7dcf079fa55a1644a647cc4fc5db9828 | C++ | ECE3400Team17/ECE3400_Team17 | /Code/Milestone2/wall_detection/wall_detection.ino | UTF-8 | 1,906 | 2.75 | 3 | [] | no_license | #include <Servo.h>
#include "Adafruit_VL53L0X.h"
Adafruit_VL53L0X lox = Adafruit_VL53L0X();
Servo servoL;
Servo servoR;
int s2 = A2;
int s3 = A3;
int s0 = A0;
int s5 = A5;
int val0;
int val2;
int val3;
int val5;
int thres = 90;
void setup(){
Serial.begin(115200);
servoL.attach(10);
servoR.attach(11);
serv... | true |
fdd0fde1d1597eeaf51c200d9186967b83a4244b | C++ | catterer/memsug | /include/text.hh | UTF-8 | 2,598 | 2.765625 | 3 | [] | no_license | #pragma once
#include <save.hh>
#include <unordered_map>
#include <set>
#include <vector>
namespace text {
using Number = std::string;
class Alphabet:
public std::unordered_map<std::string, uint8_t>,
public save::serializable
{
public:
static auto classic_ru() -> Alphabet;
static auto classic_en() ->... | true |
36e124915dcf41353ea32990298cc7ed5eb42d5a | C++ | AbdelrahmanMohamedd/DataStructure-Assig1 | /A1_P6_20170148_20170301_20170379_/StudentName.h | UTF-8 | 373 | 2.59375 | 3 | [] | no_license | #ifndef STUDENTNAME_H
#define STUDENTNAME_H
#include <string>
#include <iostream>
#include <vector>
using namespace std;
class StudentName
{
public:
StudentName();
void MakeName(const string&);
void Print();
bool Replace();
virtual ~StudentName();
private:
... | true |
31ba291963c2f1d2dd07af3971df90e5702927b0 | C++ | saket2508/DS | /selectionSort.cpp | UTF-8 | 815 | 3.71875 | 4 | [] | no_license | #include<iostream>
using namespace std;
void swapInt(int*a, int*b){
int temp = *a;
*a = *b;
*b = temp;
}
void SelectionSort(int*arr, int m){
for(int i=0;i<m-1;i++){
for(int j=i+1;j<m;j++){
if(arr[i]>arr[j]){
swapInt(arr+i,arr+j);
}
}... | true |
d5e8802e279dde1db2c0a827fdb2653eb8835c72 | C++ | vlvanchin/learn | /learn_others/cpp/arraydemo.cpp | UTF-8 | 642 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main () {
int myarray [7] = {
12, 23,45,66,77,80,100
};
for (int c=0; c < sizeof(myarray)/sizeof(myarray[0]); c++) {
cout << "myarray [" << c << "] = " << myarray[c] << endl;
}
myarray [3] = 333;
cout << "modified array is " << endl;
for (unsigned i... | true |
5c80daa2c425ddd00623bbb4e88a965d58abd058 | C++ | Mr-zhang-in-Harbin/LeetCode | /Easy/Find Pivot Index.cpp | UTF-8 | 425 | 2.71875 | 3 | [] | no_license | class Solution {
public:
int pivotIndex(vector<int>& nums) {
if (nums.size() <= 2)
return -1;
for (int i = 1;i < nums.size(); i++) {
nums[i] = nums [i] + nums[i-1];
}
long long int Res = nums[nums.size() - 1];
for (int i = 0;i < nums.size();i++)
... | true |
9710e5c748e109cf81a6cbdd6504d2c4edc38346 | C++ | tyut-zhuran/cpp_learn | /202001/类和对象/类和对象/2继承方式.cpp | GB18030 | 1,038 | 3.15625 | 3 | [] | no_license | //# include <iostream>
//
//using namespace std;
//
//class Base
//{
//public:
// int m_A;
//protected:
// int m_B;
//private:
// int m_C;
//};
//
//
//class Class1:public Base
//{
//public:
// void func()
// {
// m_A = 1;//public-->public
// m_B = 2;//protected-->protected
// //m_C = 3;//private-->ɷ
// }
//};
//
/... | true |
6e0bcabd6d2f73c4787a6b2537e4fa5cecc3dbf3 | C++ | pantasito/Bomberman | /Bomberman/Object/Point.h | UTF-8 | 1,001 | 3.171875 | 3 | [] | no_license | // ☕ Привет
#pragma once
namespace Bomberman
{
namespace Object
{
struct Point {
int _row_num;
int _col_num;
Point(int row_num, int col_num) : _row_num(row_num), _col_num(col_num) {}
bool operator==(const Point point) const {
... | true |
a81bed8bb80eea5d4fd272e328bf0986bd5b9733 | C++ | mattrudder/AckZombies | /Src/AIStateGaseousFollow.cpp | UTF-8 | 2,447 | 2.53125 | 3 | [] | no_license | /**
* @file AIStateGaseousFollow.cpp
* @author Jonathan "Awesome" Zimmer
* @date Created April 7, 2006
*
* This file contains the implementation of the CAIStateGaseousFollow class
*/
#include "AIStateGaseousFollow.h"
#include "AIStateGaseousAttack.h"
#include "AIStatePathFollow.h"
#include "AIManager.h"
#i... | true |
b4eb5e0c1d0324779a90a1854773ed55682bcd87 | C++ | roomyroomy/algorithm | /algospot/PICNIC.cpp | UTF-8 | 1,394 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <set>
using namespace std;
int C, N, M;
vector<set<int>> studentList(10);
int maskingCount = 0;
bool masking[10];
int traverseCase(int start = 0)
{
int result = 0;
if(start == 0)
{
for(int idxMask = 0; idxMask < 10; idxMask++)
masking[idxMask] = 0;
maskingCo... | true |
90eeed0a7736de66008ea77e3e30da43d1148965 | C++ | Rolight/ACM_ICPC | /Not_Classified/ZOJ_1117.cpp | UTF-8 | 1,817 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <iomanip>
#include <string>
#include <cstdlib>
#include <cstring>
using namespace std;
const int sigma_size = 27;
const int maxn = 8000;
struct TreeNode {
int lson,rson,data,id;
TreeNode(int lson = 0,int rson = 0,int data = -1,int id = 0):
lson(lson),rson(rson),data(... | true |
ecd17804a35ad9310d946fdbc75942fc468411dd | C++ | juliolugo96/competitive-programming | /codeforces/two_pointers/sereja_dima.cpp | UTF-8 | 451 | 2.84375 | 3 | [] | no_license | # include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> a;
for (int i{0}; i < n; i++)
{
int p;
cin >> p;
a.push_back(p);
}
int i{0}, j{n - 1}, sereja{0}, dima{0};
while(i <= j)
{
sereja += max(a[i], a[j]);
a[i] > a[j] ? i++ : j--;
if (i >... | true |
a1621ab65bb2bbd0fb4d88f3ee9b2c1dca982e17 | C++ | gembancud/CompetitiveProgramming | /uva/intro/getting started/easy/summingdigits/a.cpp | UTF-8 | 334 | 2.9375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int concat(int a){
int sum=0;
while(a/10!=0){
sum += a%10;
a/=10;
}
sum += a;
return sum;
}
int main(){
int n;
while(cin >>n){
if(n==0) break;
while(n>=10){
n = concat(n);
}
cout << n <... | true |
ec6230e5527cbbd58fcecb0fe243c20d4d220e8e | C++ | thallium/acm-algorithm-template | /src/data_structure/fenwick_range_update.hpp | UTF-8 | 904 | 3.3125 | 3 | [] | no_license | #pragma once
#include <vector>
// fenwick tree with range update and range sum query
class fenwick_rg {
int n;
std::vector<int64_t> sum1, sum2;
void add(int i, int x) {
assert(i >= 0 && i < n);
i++;
int64_t v = (int64_t)i * x;
for (; i <= n; i += i & -i)
sum1[i]... | true |
17b67f981bdac0175b7d5781f619dca2784aa3c5 | C++ | jacob-hegna/jhcrypto | /src/buffer.cpp | UTF-8 | 6,173 | 3.140625 | 3 | [] | no_license | /**
* buffer.cpp
* @author: jacob hegna <jacobhegna@gmail.com>
* @date: April 2017
* @comment: a high-level interface for a buffer of bytes
*/
#include "buffer.h"
const char jhc::buffer::b64_table[64] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', '... | true |
bb658d6bfdf0f62aec44bf0be408c54cbfce699e | C++ | Void13/GolovanovNotPrivate | /Lab2/BigInt.h | UTF-8 | 1,679 | 2.53125 | 3 | [] | no_license | #ifndef _H__BIGINT
#define _H__BIGINT
#include <memory.h>
#include <iostream>
#include <deque>
#include <string>
//#define DEBUG_CONSTR 1
class CBigInt
{
private:
typedef std::deque<char> CHARDEQ;
public:
CBigInt();
CBigInt(int const _nNumber);
CBigInt(std::string const _sNumber);
CBigInt(CBigInt const &_Source... | true |
14ec72d3b173fb8ab01db9f40516cbb9343af850 | C++ | iamslash/learntocode | /leetcode/MinimumAbsoluteDifferenceinBST/a.cpp | UTF-8 | 841 | 3.015625 | 3 | [] | no_license | /* Copyright (C) 2019 by iamslash */
#include <cstdio>
#include <limits>
#include <cstdlib>
#include <algorithm>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
// 16ms 93.34% 21.7MB 100.00%
// inorder
// O(N) O(lgN)
class S... | true |
af9b7bbd8a5d0b84dce5488db48c5fc41f463efc | C++ | Sepsad/AP-FinalProject | /Money/Money.cpp | UTF-8 | 267 | 2.796875 | 3 | [] | no_license | #include "Money.h"
Money::Money(User* _user, Film* _film, int _amount)
{
user = _user; amount = _amount; film = _film;
}
User* Money::get_user()
{
return user;
}
Film* Money::get_film()
{
return film;
}
int Money::get_amount()
{
return amount;
}
| true |
4931a08d8edcde8d7678f23ad9323630bf4f6fdf | C++ | ttyang/sandbox | /sandbox/logging/boost/logging/detail/raw_doc/workflow.hpp | UTF-8 | 7,403 | 3.015625 | 3 | [
"BSL-1.0"
] | permissive | namespace boost { namespace logging {
/**
@page workflow Logging workflow
- @ref workflow_introduction
- @ref workflow_filter
- @ref workflow_processing
- @ref workflow_2a
- @ref workflow_2b
- @ref workflow_formatters_destinations
@section workflow_introduction Introduction
What happens when a message is ... | true |
3023ef6bfcedaee7d94835438da8f1fa2300516d | C++ | lucasbivar/object-oriented-programming | /U2A5/11/Agenda.cpp | UTF-8 | 1,590 | 2.984375 | 3 | [] | no_license | #include "Agenda.h"
#include "Pessoa.h"
#include <iostream>
using std::cout;
using std::endl;
Agenda::Agenda(int tamanho){
this->quantidadeDeContatos = 0;
this->tamanhoDaAgenda = tamanho > 0 ? tamanho : 10;
this->agenda = new Pessoa*[tamanhoDaAgenda];
}
Agenda::~Agenda(){
for(int i = 0; i < quantidadeDeCont... | true |
2755552006aeb8db2d5282f4fd48f684835a05eb | C++ | lawu103/tiny_raytracer | /src/tiny_raytracer.cpp | UTF-8 | 5,054 | 2.9375 | 3 | [] | no_license | //============================================================================
// Name : tiny_raytracer.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#in... | true |
7d3bcb1c712e39f07959669699cdef34e296d723 | C++ | AndreasPatakis/Programs-Projects | /DataStructures_1(2o Semester)/Failed_17-18/dentro.cpp | UTF-8 | 2,635 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
class tour{
public:
int infos[4];
tour(){
fstream file;
file.open("t103.txt");
string line;
int p=0;
while(!file.eof()) {
getline(file,line);
istringstream iss(line);
string word;
... | true |
61580b35f9d7c476923061f6c1c01bd5c18cb611 | C++ | AriPerkkio/Bluetooth-And-Wifi-Scanner | /ServerBtWifiScan/src/Btresult.h | UTF-8 | 558 | 2.609375 | 3 | [] | no_license | /*
* Btresult.h
*
* Created on: 27.4.2016
* Author: AriPerkkio
*/
#ifndef BTRESULT_H_
#define BTRESULT_H_
#include <iostream> // for std
using namespace std;
class Btresult {
string name;
string address;
string type;
string rssi;
string location;
public:
Btresult(string, string, string, string, strin... | true |
b33aa426baabbe353def41e54fb1a46104f24665 | C++ | nikhil9402/lab_6_assignment | /lab_6_question03.cpp | UTF-8 | 427 | 3.484375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main () {
int arr[10],*p;
cout << "Enter the elements of the array; \n";
for (int i=0;i<10;i++)
{
cin >> arr[i];
}
cout << "The array is : \n";
//using normal index method
for (int i=0;i<10;i++)
{
cout << arr[i] << endl;
}
cout << "The array is : \n";
... | true |
8a657493981d920adff409c398b126acdb98812c | C++ | michaeloverton/fourth-world-lasers | /tlc5947test/tlc5947test.ino | UTF-8 | 2,736 | 2.859375 | 3 | [] | no_license | /***************************************************
MUKE
****************************************************/
#include "Adafruit_TLC5947.h"
// How many boards do you have chained?
#define NUM_TLC5974 1
#define data 4
#define clock 5
#define latch 6
#define oe -1 // set to -1 to not use the enable pin (it... | true |
1ca620adeea0dc14975038b0254675dc62d97344 | C++ | oPensyLar/karos-algos | /rosh-cplus/arg2_string_ptr.h | UTF-8 | 19,528 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <vector>
std::vector<int> *arg2_string_ptr = new std::vector<int>;
void initArg2_string_ptr()
{
// vector arg2_string_ptr
arg2_string_ptr->push_back(0xa5);
arg2_string_ptr->push_back(0xd9);
arg2_string_ptr->push_back(0xad);
arg2_string_ptr->push_back(0xba);
arg2_s... | true |
bf86b4981ba894756887d8888fb674d8a7b5616e | C++ | leonardean/RayTracer | /Config.h | UTF-8 | 1,019 | 2.6875 | 3 | [] | no_license | #ifndef __CONFIG_H
#define __CONFIG_H
#include "Definition.h"
#include "SimpleString.h"
#pragma warning( push )
#pragma warning( disable : 4512 )
class Config {
private:
void * m_pVariables;
void * m_pSections;
const SimpleString m_sFileName;
SimpleString m_sCurrentSection;
bool m_... | true |
63461cb3c37699ae3623a7000f786119e897bcc9 | C++ | muhammadbilalakbar021/Cplus_ | /prob14/test/unittest.cpp | UTF-8 | 6,091 | 3.125 | 3 | [
"MIT"
] | permissive | #include "../cash_debit_card.hpp"
#include "gtest_ext.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
TEST(CashCard, OutputFormatNormal) {
std::ostringstream test_output;
std::ostringstream test_input;
std::string name = generate_string(10);
int choice;
double amount_due, balance;
test_output << "Ente... | true |
b2ec9a69e334dd2a2cae319eae67a1eff3311b97 | C++ | vamsiteja/kr_sir | /kr sir/linked lists/linkedlists split.cpp | UTF-8 | 1,415 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
struct node
{int data;
struct node*next;
};
typedef struct node* lptr;
void pushend(lptr *l,int x)
{
lptr t=*l,t2=new node;t2->data=x;t2->next=NULL;
while(t->next!=NULL)
t=t->next;
t->next=t2;
}
void split(lptr *l1,lptr *l2)
{
lptr t1,t2;
int fl... | true |
e57f8db9b0decf30aca8821550b59dc028723816 | C++ | Xsardas1000/Algorithms-and-Data-structures | /ht4-2.cpp | UTF-8 | 1,626 | 3.203125 | 3 | [] | no_license | //
// ht4-2.cpp
// sphere
//
// Created by Максим on 09.04.16.
// Copyright © 2016 Максим. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
/*Унимодальный массив
На вход подаётся число N ≤ 1000 и унимодальный массив a размера N: элементы a ра... | true |
642b98874a4650770abe042e872eaa8f040c083f | C++ | Areustle/heasoft-6.20 | /Xspec/src/XSFunctions/vgaussDem.cxx | UTF-8 | 2,861 | 2.5625 | 3 | [] | no_license | #include <stlToCArrays.h>
#include <xsFortran.h>
#include <functionMap.h>
#include <XSUtil/Utils/XSutility.h>
#include <XSUtil/Numerics/Numerics.h>
#include <xsTypes.h>
#include <cmath>
void cxxsumdem(int itype, int swtch, const RealArray& energyArray, const RealArray& abundances, Real density, Real redshift, const Re... | true |
a87af63906fd5225ab57da8ba3392fa95c92806b | C++ | simon0987/global_router | /src/router.cpp | UTF-8 | 10,003 | 2.9375 | 3 | [] | no_license | /**************************************************************************
* File [ main.cpp ]
* Author [ wlkb83 ]
* Synopsis [ demonstration for the usage of parser.h ]
* Usage [ ./parser [inputfileName] ]
* Date [ 2014/12/28 created ]
************************************************... | true |
b2a79ba1a3e0d745b7de81e1b932a8c1fadc6e4a | C++ | Dyzing/Composition-images | /Composition-images/Composition-images/corona.cpp | UTF-8 | 4,915 | 2.671875 | 3 | [] | no_license | #include "Initialisation-Conversion.hpp"
#include "Filtres.hpp"
#include "Masques.hpp"
#include <windows.h>
#include <tuple>
#include<vector>
#include <numeric>
#include "corona.hpp"
int tolerance = 0;
int main(int argc, char* argv[])
{
std::cout << std::endl << "---------------------" << std::endl << "Initialisati... | true |
2f8b42eba303c6a33a9cea101dabaa87f4aa8bce | C++ | institution/nn5 | /src/ext/fail.hpp | UTF-8 | 817 | 2.78125 | 3 | [] | no_license | #pragma once
#include <stdlib.h>
#include <cassert>
#include "format.hpp"
namespace ext{
extern bool FAIL_THROWS;
template <class... Args>
[[noreturn]]
void fail(char const* fmt, Args... args) {
print(stderr, fmt, args...);
if (FAIL_THROWS) {
throw std::exception();
}
else {
assert(0);
exit(-1... | true |
ce83401596055c8b964628eec5fe38ea62d3b48c | C++ | lonelam/SolveSet | /cf853C.cpp | UTF-8 | 2,265 | 2.640625 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int inf = 0x3f3f3f3f;
const int maxn = 200000 + 100;
struct node
{
int L, R;
int l, r;
int val;
node() : L(-1), R(-1), l(-1), r(-1), val(0) {}
node (int _... | true |
2020e652d5d35e5fa7d5bd6c0f0be4bac5d6fd46 | C++ | asibatian/CS205 | /Assignment4/main.cpp | UTF-8 | 644 | 3.1875 | 3 | [] | no_license | //main.cpp
#include <iostream>
#include "matrix.hpp"
using namespace std;
int main()
{
float a[6]={1.0f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f};
float b[6]={1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f};
Matrix A = Matrix(2, 3, a);
Matrix B = Matrix(3, 2, b);
Matrix C = A*B;
cout << "Matrix C = " << C << endl;
... | true |
a4e056c354ee399c24dfde28af620bf336886e8c | C++ | qiuqingyun/shuffle | /src/Mod_p.h | UTF-8 | 2,045 | 3.015625 | 3 | [] | no_license | #ifndef MOD_P_H_
#define MOD_P_H_
#include "G_mem.h"
#include <NTL/ZZ.h>
NTL_CLIENT
class Mod_p : public G_mem {
private:
ZZ val; //Value of the element
ZZ mod; //Modular value
public:
//Constructors and destructor
Mod_p();
Mod_p(long p);
Mod_p(ZZ p);
Mod_p(long v, long p);
Mod_p(ZZ v, long p... | true |