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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4af1451f9c5b154f49eea67efd915c27d4212e8e | C++ | Juan14-mart/Tarea-I | /Ejercicio_003.cpp | UTF-8 | 347 | 3.015625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main () {
int a,b,c;
printf ("Ingrese el numero");
scanf ("%d",&a);
b=a%2;
if (b==0){
printf("El numero es par");
}if(b>0) {
printf ("El numero es impar\n");
c=a%3;
if(c==0){
printf ("El numero es divisible entre 3");
}else{
printf ("El numero no es divisi... | true |
1d97825017dffb75c1eac3ca680b16be7f055b52 | C++ | andrewreeman/SpectralSuite | /shared/utilities.cpp | UTF-8 | 1,735 | 2.984375 | 3 | [
"BSD-3-Clause",
"Unlicense"
] | permissive | #include "utilities.h"
namespace utilities {
int ms2Samps(int ms, int sRate) {
return ms * (sRate / 1000);
}
int wrap(int index, int limit) {
if (index < 0) {
return index + limit;
}
else {
return index % limit;
}
}
void car2Pol(std::vector<Cpx> cpxIn, PolarVector& polOut, int size){
... | true |
cadeed59cd92834c238cd37f748a3dd3f6ee6716 | C++ | sauloandradegames/EDA | /Dlist.h | UTF-8 | 1,193 | 3.328125 | 3 | [] | no_license | // Dlist.h
// Cabecalho: lista duplamente encadeada
#ifndef DLIST_H
#define DLIST_H
#include "Dnode.h"
class Dlist
{
private:
/*---------------------------- ATRIBUTOS -----------------------------*/
Dnode *head; // Ponteiro para o primeiro elemento da lista (cabeca da lista)
public:
/*--------------------------... | true |
0e870db333a34cf2425949f51f823ac3b7c7d605 | C++ | GEMINEM98/LeetCode | /[编程题]解读密码/[编程题]解读密码/test.cpp | UTF-8 | 472 | 2.703125 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS 1
// https://www.nowcoder.com/questionTerminal/16fa68271ee5448cafd504bb4a64b482
// write your code here cpp
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
string s = "";
while (getline(cin, s))
{
vector<int> v;
for (int i = 0; i < s.lengt... | true |
8b457d674cc17bed20f869f11cad3457b8b49f37 | C++ | ponomarr85/OPPO123 | /references_table.cpp | UTF-8 | 1,686 | 2.796875 | 3 | [] | no_license | #include "references_table.h"
#include <QVBoxLayout>
#include <QDateTime>
#include <QLineEdit>
ReferencesTable::ReferencesTable(bool isEditable, int workerId, References *references, QWidget *parent) : QWidget(parent)
{
this->references = references;
this->workerId = workerId;
QVBoxLayout *mainLayout = ne... | true |
3193f99d16a356e3990a728fe477f288a6ed2d34 | C++ | paddygoat/Weather-Station | /Arduino/rain.cpp | UTF-8 | 856 | 2.96875 | 3 | [] | no_license | #include <Arduino.h>
const int rainPin = A0;
int rainValuex1 = 0;
int rainReading =0;
void setupRain()
{
rainReading = analogRead(rainPin); // If rain detected, capacitor discharges.
Serial.println("");
Serial.print("rainReading 0: "); Serial.println(rainReading);
}
void rainDetect()
{
// Capacitor i... | true |
3e42ffa712169a3f2faec92408b22f13674887fa | C++ | bryan0806/Arduino | /bt_recv/bt_recv.ino | UTF-8 | 385 | 2.78125 | 3 | [] | no_license | int iLedPin=13;
void setup() {
// put your setup code here, to run once:
pinMode(iLedPin,OUTPUT);
Serial.begin(38400);
}
void loop() {
// put your main code here, to run repeatedly:
while(Serial.available()){
char cCmd=Serial.read();
Serial.println(cCmd);
if(cCmd=='o'){
digitalWrite(iLedPin,HIGH);
}else ... | true |
d13cbed98d89c76c48ed2291f44365b36f562207 | C++ | JamesAhsam/ConwaysGameofLife | /SOILTEST/main.cpp | UTF-8 | 6,126 | 2.859375 | 3 | [] | no_license | //
// main.cpp
// Game of Life BBC
//
// Created by James Ahsam on 06/02/2019.
// Copyright © 2019 James Ahsam. All rights reserved.
//
#include "main.h"
int mousex = 0;
int mousey = 0;
int font;
bool leftclick;
bool leftclick_flag;
bool rightclick;
bool rightclick_flag;
bool paused = true;
int fps = 60;
float... | true |
a981e22d4f0252f3981708c2e41a6589b6f83f74 | C++ | TangXiaofui/LeetCode-txh | /Ch02/2.1/2.1.16.cpp | UTF-8 | 490 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution{
public:
void PlusOne(vector<int> &num)
{
int temp = 1;
vector<int>::reverse_iterator it;
for(it = num.rbegin();it != num.rend();it++)
{
*it += temp;
temp = *it / 10;
*it = *it % 10;
}
if(temp)
num.insert(num.begin(),te... | true |
7392bb08ac4acb3e2bbe8f404855d9c8f6114d99 | C++ | vppatil/temVijMods | /src/ecodomain/horizon/Moss.h | UTF-8 | 610 | 2.625 | 3 | [] | no_license | /*! \file
*/
#ifndef MOSS_H_
#define MOSS_H_
#include "../layer/MossLayer.h"
class Moss{
public:
Moss();
~Moss();
int num; // num of moss layers
int type; // moss types: 1: sphagnum; 2: feathermoss; 3: other (including lichen)
double dmossc; // dead moss C (kg/m2), which not included... | true |
609444b5f1cec22e6ced584d6800695191b417ae | C++ | EosBandi/TeensyRadio | /golay.cpp | UTF-8 | 2,508 | 2.65625 | 3 | [] | no_license | ///
/// @file golay23.c
///
/// golay 23/12 error correction encoding and decoding
///
#include <stdarg.h>
#include "radio.h"
#include "golay23.h"
// intermediate arrays for encodeing/decoding. Using these
// saves some interal memory that would otherwise be needed
// for pointers
static uint8_t g3[3], g6[6];
// en... | true |
67d27df647a8ba949691a82d47f8ba7387eb08a8 | C++ | bahlo-practices/pa | /semester1/practice4/exercise1/myerror.h | UTF-8 | 347 | 2.5625 | 3 | [
"WTFPL",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* File: myerror.h
* Author:
*
* Created on 31. Oktober 2012, 10:42
*/
#ifndef ERROR_H
#define ERROR_H
#include <iostream>
#include <stdexcept>
using std::string;
using std::runtime_error;
using namespace std;
void error (string s) {throw runtime_error(s);}
void error (string s1, string s2) {error (s1+s2... | true |
d4d102d6150638958a274c2d489262ab909cee78 | C++ | mbrzecki/julian | /src/marketData/ForwardCurve.hpp | UTF-8 | 2,380 | 3.1875 | 3 | [] | no_license | #ifndef JULIAN_FORWARDCURVE_HPP
#define JULIAN_FORWARDCURVE_HPP
#include <vector>
#include <utils/SmartPointer.hpp>
#include <mathematics/interpolation/interpolation.hpp>
#include <dates/date.hpp>
#include <dates/yearFractions/yearFraction.hpp>
#include <utils/utils.hpp>
#include <boost/serialization/export.hpp>
names... | true |
782a1100459d72509c691e400abc0a1d70e93b9c | C++ | mRooky/Rooky | /Source/Core/Math/MathViewport.h | UTF-8 | 1,704 | 2.671875 | 3 | [] | no_license | /*
* RenderViewport.hpp
*
* Created on: Mar 14, 2019
* Author: rookyma
*/
#ifndef SOURCE_CORE_RENDER_RENDERVIEWPORT_HPP_
#define SOURCE_CORE_RENDER_RENDERVIEWPORT_HPP_
#include "MathRect.h"
#include "MathExtent3.h"
namespace Math
{
class Viewport
{
public:
Viewport(void) = default;
~Viewport(void) = de... | true |
8ca112ebf7f9bb11d7ac14da9a51bc3d8fc30643 | C++ | saulius/croaring-rs-testgen | /cpp/src/main.cpp | UTF-8 | 1,031 | 2.609375 | 3 | [] | no_license | #include <roaring.hh>
#include <assert.h>
#include <climits>
#include <iostream>
#include <fstream>
int main() {
Roaring64Map outBitmap;
// write
for (uint64_t i = 100; i < 1000; i++) {
outBitmap.add(i);
}
outBitmap.add((uint64_t) UINT_MAX);
outBitmap.add((uint64_t) ULLONG_MAX);
ui... | true |
d4841a0b64563445645af02d99b74888569bbf16 | C++ | joajasi/FifoBasedList | /List.h | UTF-8 | 204 | 2.75 | 3 | [] | no_license | typedef struct Node {
int val;
Node* next;
} Node;
class List {
public:
List(Node* head, Node* tail);
void push(int val);
void pop();
void show();
private:
Node* head;
Node* tail;
};
| true |
29131768ce0682fc0d285efb7b6794f96472f3bf | C++ | paulsammut/learn | /learn_cpp/extra0/ex03/main.cpp | UTF-8 | 1,722 | 4.21875 | 4 | [] | no_license | // Function Pointer Extra Lesson!
// http://www.newty.de/fpt/intro.html
// Lesson 2.8 How to use Arrays as Function Pointers!
//
//
#include <iostream>
using namespace std;
// type-definition: 'pt2Member' now can be used as type
typedef int (TMyClass::*pt2Member)(float, char, char);
// illustrate how to work with ... | true |
bbde39ba8412166022a6a3ad1f46e090a40d644d | C++ | andreasbuetler/ChurchSketch2 | /churchSketch_DistanceVariable/churchSketch_DistanceVariable.ino | UTF-8 | 3,818 | 2.78125 | 3 | [] | no_license | /* Things to implement/problems:
- endStopper: Tempo, Stops when Endstopper == true
- reading pir when on the Top >> if movmement add delay
- set position after endStop() == true
- set final variables
*/
#include <dummy.h>
#include <Arduino.h>
#include <analogWrite.h>
#define pirInputPin 27
#... | true |
d4f6b372b952547b272fad6b5629070c20ac5989 | C++ | Daibingh/MyAlgoLearning | /算法与数据结构/cpp_leetcode/012 整数转罗马数字/main.cpp | UTF-8 | 1,707 | 3.328125 | 3 | [] | no_license | #include "utils.hpp"
using namespace std;
/*
- 第二种写法更优
*/
class Solution {
public:
string intToRoman(int num) {
unordered_map<int, string> strMap = {{1, "I"},{5, "V"},
{10, "X"}, {50, "L"}, {100, "C"}, {500, "D"}, {1000, "M"},
{4, "IV"}, {40, "XL"}, {400, "CD"}, {9, "IX"}, {90, "XC"}, {... | true |
3d25d382b79ed9a268322760f177d14512052ed1 | C++ | linzhangfeng/MuMuQiPai | /jianlimajiang/CardPool_ReadJson.cpp | UTF-8 | 2,420 | 2.8125 | 3 | [] | no_license | #include "CardPool_ReadJson.h"
#include <fstream>
#include <iostream>
#include <stdlib.h>
using namespace std;
CardPool_ReadJson::CardPool_ReadJson():m_MaxCount(0)
{
}
CardPool_ReadJson::~CardPool_ReadJson()
{
}
void CardPool_ReadJson::ReadJsonFile(std::string str_file_name)
{
m_TestFileName =... | true |
967c03e84342ebd46c129d37a91df15d350e59ea | C++ | derisan/stl | /Day17/Day17/Source2.cpp | UTF-8 | 450 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include "../../String.h"
using namespace std;
template<typename Iter, typename T>
Iter my_find(Iter first, Iter last, const T& value)
{
while(first != last)
{
if(value == *first)
{
return first;
}
++first;
}
return last;
}
int main()
{
vec... | true |
0ed083ac4f077cf249067eb86bea7d7f900c7d35 | C++ | gganis/xrdping | /xrdping.cc | UTF-8 | 9,249 | 2.59375 | 3 | [] | no_license | #include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <string>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/times.h>
//_________________________________________________________________... | true |
a396ae45b4249584264d1d450b118c137da1403c | C++ | tirtawr/arduino-sketches | /uno-stepper/uno-stepper.ino | UTF-8 | 2,095 | 2.8125 | 3 | [
"MIT"
] | permissive | #define STEPPER_PIN_1 9
#define STEPPER_PIN_2 10
#define STEPPER_PIN_3 11
#define STEPPER_PIN_4 12
int step_number = 0;
void setup() {
pinMode(STEPPER_PIN_1, OUTPUT);
pinMode(STEPPER_PIN_2, OUTPUT);
pinMode(STEPPER_PIN_3, OUTPUT);
pinMode(STEPPER_PIN_4, OUTPUT);
}
void loop() {
oneStep(true);
delay(2);
... | true |
433a2f5ba4b7743c1f7b6d4f951afe189893f00d | C++ | KalimovAleksey/Kalimov1 | /Kalimov_dz_aip/hw_4/main.cpp | UTF-8 | 403 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <math.h>
/*Вычислите значение выражения:|x| + x^5, если x=−2. Ответ: -30*/
int main()
{
float x;
float c;
std::cout<< "|x| + x^5, if x=−2. Answer: -30" <<std::endl;
std::cout<< "Enter number" <<std::endl;
std::cin>> x ;
c=abs(x)+(x*x*x*x*x);
std:... | true |
7cc5a2ae97569076dae19430d8dc0abed2cc3625 | C++ | apoorv-j/Data-Structures-Cpp | /strings/testString.cpp | UTF-8 | 435 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
bool isPalindrome(string &s)
{
string rev = s;
reverse(rev.begin(), rev.end());
return s == rev;
}
int main()
{
int n;
cin >> n;
string arr;
for (int i = 0; i < n; i++)
{
int x;
cin >> x;
... | true |
15511d172e84a7bda7e0049fdb7ff51cb16e964b | C++ | Flytte/flytte | /backend/drone_ros_ws/src/drone_app/include/common/Pose.hpp | UTF-8 | 720 | 3.265625 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef POSE_HPP_
#define POSE_HPP_
#include <iostream>
/**
* Describes a pose, that is a 6D vector with 3 position coordinates
* as well as 3 orientation values.
*/
struct Pose
{
Pose(double posX = 0, double posY = 0, double posZ = 0,
double rotX = 0, double rotY = 0, double rotZ = 0) :
posX... | true |
fa3ee32035b5e7ba5d47614dcabb7ff658a13ec0 | C++ | congdeptrainhat/OLP_Training | /C++/Bai20.cpp | UTF-8 | 1,433 | 3.828125 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Point
{
int x, y;
void input()
{
cin >> x >> y;
}
float distance(Point p)
{
return sqrt(pow(p.x - x, 2) + pow(p.y - y, 2));
}
};
struct Circle
{
Point center;
int R;
void input()
{
// Cái này gọ... | true |
897c0e0716c3c42ff126dd0b0594ac3aaaf82a46 | C++ | JacquesDonnelly/advent-of-code-2020 | /src/day_13.cpp | UTF-8 | 1,011 | 3.015625 | 3 | [] | no_license | #include "day_13.h"
int day_13_part_1_main(std::string file_input){
BusNotes bus_notes = read_bus_notes(file_input);
int min_wait_time = std::numeric_limits<int>::max();
int selected_bus_id = std::numeric_limits<int>::max();
for (Bus bus : bus_notes.busses){
int wait_time = bus.id - (bus_notes.earliest % b... | true |
81c7a63ef91e59f80b309a81f89b441013ab0f35 | C++ | GeneralStudy/studymuduo | /reactor/Timer.h | UTF-8 | 739 | 2.703125 | 3 | [] | no_license | #ifndef MUDUO_NET_TIMER_H
#define MUDUO_NET_TIMER_H
#include <boost/noncopyable.hpp>
#include "../datetime/Timestamp.h"
#include "Callbacks.h"
namespace muduo
{
class Timer: boost::noncopyable
{
public:
Timer(const TimerCallback& cb, Timestamp when, double interval):
m_callback(cb),
m_expiratio... | true |
139deac476b018cf59f084383d00d9c0d5353b56 | C++ | vxl/vxl | /contrib/mul/pdf1d/pdf1d_gaussian_sampler.cxx | UTF-8 | 3,236 | 2.515625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | // This is mul/pdf1d/pdf1d_gaussian_sampler.cxx
//:
// \file
// \author Tim Cootes
// \brief Sampler class for univariate Gaussian classes.
#include "pdf1d_gaussian_sampler.h"
#include <cassert>
#ifdef _MSC_VER
# include "vcl_msvc_warnings.h"
#endif
#include <pdf1d/pdf1d_gaussian.h>
//=============================... | true |
aabef9d63d67ed5aecdf3d0171b43cd3b5e71bc4 | C++ | TLaviron/mehetia | /src/vulkan_mehetia/utilities.cpp | UTF-8 | 2,364 | 2.6875 | 3 | [
"MIT"
] | permissive | #include "vulkan_mehetia/utilities.h"
#include <string>
namespace vulkan_mehetia {
VkResult resultCheck(VkResult _result, std::string_view _sourceFile, int32_t _line) {
std::string errorMessage(_sourceFile);
errorMessage += ":" + std::to_string(_line) + " ";
switch (_result) {
case VK_SUCCESS:
... | true |
7aec1fe9c8568fe51a05348d5821d08666cec80e | C++ | senior-bull/google-benchmark-tutorial | /source/core/try_catch_overhead.cpp | UTF-8 | 604 | 2.515625 | 3 | [] | no_license | #include <benchmark/benchmark.h>
#include <vector>
#include <string>
#include <exception>
#include <cstdint>
using namespace std;
int doSome() {
if (std::rand() < 0) {
throw 2;
}
return 1;
}
static void TryCatch(benchmark::State& state) {
for (auto _ : state) {
try {
benc... | true |
7872de85ef9c0b8304c3e42d796cb2bb24a38fa9 | C++ | geetheshtg/Octabrix | /LED_Serial/LED_Serial.ino | UTF-8 | 259 | 2.59375 | 3 | [] | no_license | int incomingByte = 0;
void setup() {
pinMode(13,OUTPUT);
Serial.begin(115200);
}
void loop() {
incomingByte = Serial.read();
if(incomingByte=='0')
{
digitalWrite(13,LOW);
}
else if(incomingByte=='1')
{
digitalWrite(13,HIGH);
}
}
| true |
4ff3f273b883fd2898a622f5ef8feed4881666d2 | C++ | fys445089968/qt-magic_tower-21- | /dialogwindow.cpp | UTF-8 | 40,209 | 2.578125 | 3 | [] | no_license | #include "dialogwindow.h"
#include "ui_dialogwindow.h"
DialogWindow::DialogWindow(QWidget *parent) :
QWidget(parent),
ui(new Ui::DialogWindow)
{
ui->setupUi(this);
Count_Num = 0;
Init();
}
void DialogWindow::Init()
{
Hide_Window();
if(Braver.Dialog_state_num == 0)//首次和仙子对话
{
th... | true |
efac9fd76a1a73f50423e41d271fd39ad30f21ae | C++ | WhiZTiM/coliru | /Archive2/2d/485ad0d852eb2d/main.cpp | UTF-8 | 3,970 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <memory>
#include <stdexcept>
struct person : std::enable_shared_from_this<person> {
virtual ~person() = default ;
virtual std::string name() const { return "'" + name_ + "'" ; }
protected:
person() = default;
explicit person ( co... | true |
c98c2cea8bfec176629bf2ce0107c78b699af0fe | C++ | HesslerY/exafmm-t | /tests/p2p_helmholtz.cpp | UTF-8 | 2,910 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | #include <algorithm>
#include <random>
#include <type_traits>
#include "exafmm_t.h"
#include "helmholtz.h"
#include "timer.h"
using namespace exafmm_t;
void helmholtz_kernel(RealVec& src_coord, ComplexVec& src_value,
RealVec& trg_coord, ComplexVec& trg_value, complex_t wavek) {
complex_t I = s... | true |
38a9325f2de9ee4263456de78a7d54de5b57335f | C++ | chriskarlsson/1DV433 | /1DV433.S5.L13_BlackJack/11DV433.S5.L13_BlackJack/Blackjack.cpp | UTF-8 | 26,169 | 3.125 | 3 | [
"MIT"
] | permissive | //-----------------------------------------------------------------------
// File: Blackjack.cpp
// Summary: Blackjack game
// Version: 1.1
// Owner: Christoffer Karlsson
//-----------------------------------------------------------------------
// Log: 2017-12-30 File created by Christoffer. Initial version only... | true |
55f314f8589a021cae727a4db3a613f7e304c819 | C++ | simmon2014/RuiLi | /ansys/Tolerance.cpp | GB18030 | 4,954 | 2.609375 | 3 | [] | no_license | // Tolerance.cpp : ʵļ
//
#include "stdafx.h"
#include "Tolerance.h"
#include "Psapi.h"
#include <tlhelp32.h>
// CTolerance
CTolerance::CTolerance()
{
m_PageCount=0;
}
CTolerance::~CTolerance()
{
this->RemovePage();
}
// CTolerance Ա
int CTolerance::Load()
{
_Application ExcelApp;
Workbooks wbsMyBooks;
_W... | true |
139be9c0e721a147a91012ddf2641ae324fb507f | C++ | Benner727/SquareRPG | /Sandbox/src/Game/World/Map/Cell.h | UTF-8 | 592 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include "Game/World/Map/Tile.h"
#include "Game/World/Map/GroundItem.h"
class Cell : public Square::GameObject
{
private:
std::shared_ptr<Tile> mTile;
std::vector<std::shared_ptr<GroundItem>> mGroundItems;
public:
Cell(std::shared_ptr<Tile> tile = nullptr, std::vector<std::shared_ptr<Item>> groundIte... | true |
f9bdfb77ca379660cb042f1a4bb1e94de5366907 | C++ | Kose-i/Euclear_Project | /clear_box/Problem039.cpp | UTF-8 | 661 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int main() {
int n {1000};
map<int, int> mp_square;
for (int i=1;i<=n;++i) mp_square[i*i] = i;
map<int, int> mp;
for (int a=1;a<=n;++a) {
for (int b=1;b<=n;++b) {
if (n*n < a*a + b*b) break;
... | true |
025de63d439312bddb31cec082db5cd894e9b599 | C++ | J0RDYL33/arcade-top-down-shooter | /JC_GameProgramming_Assignment/JC_EnemyList.cpp | UTF-8 | 1,018 | 2.796875 | 3 | [] | no_license | #include "JC_EnemyList.h"
JC_EnemyList::JC_EnemyList()
{
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "EnemyList constructed with Param(%p)", this);
}
JC_EnemyList::~JC_EnemyList()
{
//printf("EnemyList destroyed with Param(%p)", this);
}
void JC_EnemyList::Init(SDL_Renderer* aRenderer)
{
/... | true |
725985fe97fb79770c3a04d85439c60c8166e6af | C++ | TheSheepKing/Swords-Scrolls-and-Knuckles | /source/PyEvaluate.cpp | UTF-8 | 2,536 | 2.90625 | 3 | [] | no_license | #include <algorithm>
#include "PyEvaluate.hpp"
PyEvaluate::PyEvaluate(std::vector<Player> &players,
std::vector<Enemy> &enemies, Terrain &terrain)
: players(players), enemies(enemies), terrain(terrain), attack(false)
{
}
Vect<2u, double> PyEvaluate::closestPlayer(Vect<2u, double> pos) const
{
auto it (std::min_... | true |
3c715cad744345b92590c4178be8479acd03357e | C++ | loangodard/projet-cpp-raytracing | /source/vector3f.cpp | UTF-8 | 1,815 | 3.765625 | 4 | [] | no_license | #include "vector3f.h"
Vector3f::Vector3f(float x_, float y_, float z_){
x=x_;
y=y_;
z=z_;
}
Vector3f::Vector3f(const Vector3f & v){
x=v.get_x();
y=v.get_y();
z=v.get_z();
}
float Vector3f::get_x() const{
return x;
}
float Vector3f::get_y() const{
return y;
}
float Vector3f::get_z()const {
return z;
}
voi... | true |
d0f849f3751ecd717cab542994e88a7293a02adc | C++ | agerasev/hypertrace | /kernel/ocl/material/test/modifier.cpp | UTF-8 | 2,786 | 2.875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | #ifdef UNITTEST
#include "../transparent.hh"
struct ColoredTransparent {
// Transparent inner;
color3 color;
};
__global const Transparent *colored_transparent__inner__gc(__global const ColoredTransparent *self) {
return NULL;
}
#define $Self ColoredTransparent
#define $self colored_transparent
#define $... | true |
893af8a7426e2f111e58bb2668a064b6cdf5c377 | C++ | wendybalaja/Syntax-Error-Recovery | /parse.cpp | UTF-8 | 20,634 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <iterator>
#include <string>
#include "scan.h"
#include <set>
#include <map>
#include <list>
using namespace std;
/*
Dictionary:
SL - stmt_list
S -stmt
*/
/* construct treeNode struct to build AST tree */
class treeNode{
public:
stri... | true |
2030b38c7d861d5cf140ae331079fb7fa50f4a92 | C++ | 0214sh7/procon-library | /algorithm/slide minimum.cpp | UTF-8 | 429 | 2.765625 | 3 | [] | no_license | std::vector<long long> slide_minimum(std::vector<long long> A,int K){
std::vector<long long> R;
int N = A.size();
std::deque<int> D;
for(int i=0;i<N;i++){
while(!D.empty() && A[D.back()]>=A[i]){D.pop_back();}
D.push_back(i);
if(i-K+1>=0){
R.push_back(A[D.front()]);
... | true |
608ce4d845ebb7b12591ee1ce453630b928f2883 | C++ | danielfinke/cpsc425 | /ASTLiteralNode.h | UTF-8 | 986 | 2.625 | 3 | [] | no_license | /*
* File: ASTLiteralNode.h
* Author: daniel
*
* Created on October 8, 2013, 9:08 AM
*/
#ifndef ASTLITERALNODE_H
#define ASTLITERALNODE_H
#include "ASTExpressionNode.h"
/*ASTLiteral Node represents literals in the language, such as 4 or true.
* It is a subclass of ASTExpressionNode and overrides the print m... | true |
a8c918c230db64c755c3df7c16916e3d086e167e | C++ | adam4321/Final-maze | /Empty.cpp | UTF-8 | 1,556 | 2.8125 | 3 | [] | no_license | /***********************************************************************
** Program name: Maze Game
** Author: Adam Wright
** Date: 5/30/2019
** Description: File that implements the Empty derived class
***********************************************************************/
#include "Empty.hpp... | true |
0a969597d915bc6407ebaf9f711f80e5a4239d3d | C++ | Wolframe/SMERP | /src/logLevel.cpp | UTF-8 | 1,016 | 2.703125 | 3 | [] | no_license | //
// logLevel.cpp
//
#include "logLevel.hpp"
#include <string>
#include <boost/algorithm/string.hpp>
namespace _SMERP {
LogLevel::Level LogLevel::str2LogLevel( const std::string str )
{
std::string s = boost::algorithm::to_upper_copy( str );
boost::algorithm::trim( s );
if( s == "DATA" ) return LogLevel::... | true |
eaac64e3091a39fbdfcb1e229e70472205d5639c | C++ | arnabxero/online-judges-problem-solutions | /Codeforces/Contests/0675/A.cpp | UTF-8 | 534 | 2.59375 | 3 | [] | no_license | // Problem name: Infinite Sequence
// Problem link: https://codeforces.com/contest/675/problem/A
// Submission link: https://codeforces.com/contest/675/submission/25079517
#include <iostream>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
ll a, b, c, r... | true |
3d226d97aeac896594ec6f4b011903b755ac5e8f | C++ | thejasonhsu/Exercises | /fibonaccidriver.cpp | UTF-8 | 691 | 3.6875 | 4 | [] | no_license | //===========fibonaccidriver.cpp==============
//takes as in put an integer and calls on the function fibonacci
//======= ===================================
//Returns the nth number of the fibonacci sequence
// =========================================================
#include <iostream>
#include <stdlib.h>
#includ... | true |
627b4f422814e52d8cae48a4308d439ecfb74d63 | C++ | dr0pdb/External-Merge-Sort | /src/utils.cpp | UTF-8 | 1,121 | 3.796875 | 4 | [
"Apache-2.0"
] | permissive | #include <utils.h>
/*
Generates a random text file with the name and the size provided as arguments.
*/
void generate_random_text_file(std::string file_name, int file_size) {
std::ofstream created_file;
created_file.open(file_name.c_str());
int current_size = 0; // stores the current size of the generated file.
... | true |
a5b7349d509cec1b2ccbaf089e527aafb8fd34ce | C++ | oligagne/GreenLight | /GL.Objects/light.h | UTF-8 | 490 | 2.578125 | 3 | [] | no_license | #ifndef LIGHT_H
#define LIGHT_H
#include <string>
#include "coordinates.h"
using namespace std;
class Coordinates;
class Light
{
public:
Light();
~Light();
public:
void SetId(string id);
void SetDescription(string description);
void SetCoordinates(Coordinates intersection);
string GetId();
... | true |
eda2dd2af7d878ba419dd0baa0bc51344db77254 | C++ | xXHachimanXx/Grafos | /includes/Grafo.h | UTF-8 | 928 | 2.6875 | 3 | [
"MIT"
] | permissive | using namespace std;
class Grafo
{
public:
int vertices; //numero de vertices
int arestas; //numero de arestas
int ** matriz; //matriz de adjascência (int)
float ** fmatriz; //matriz de adjascência (float)
int componentes; //numero de componentes conectados
~Grafo()... | true |
e0deb9b7abca97f671e0c44f71796615cbe193e8 | C++ | JitenWhatever/CSES-Problem-Set | /Graph Algorithms/Round Trip II.cpp | UTF-8 | 2,305 | 3.328125 | 3 | [] | no_license | /*
Time limit: 1.00 s Memory limit: 512 MB
Byteland has n cities and m flight connections.
Your task is to design a round trip that begins in a city, goes through one or more other cities, and finally returns to the starting city.
Every intermediate city on the route has to be distinct.
Input
The first inpu... | true |
643eeaedf06fc53ae28db6ca948c01242e29d8cb | C++ | VPintaric/AdventOfCode2019 | /d03/s02.cpp | UTF-8 | 3,953 | 3.5 | 4 | [] | no_license |
#include <iostream>
#include <vector>
#include <sstream>
#include <limits>
struct Line {
int first, second, common, steps;
};
void fillFirstWireLinesData( std::vector< Line > &vertical, std::vector< Line > &horizontal ) {
std::string inputLine;
std::getline( std::cin, inputLine );
std::stringstream s... | true |
584eab797aa977b5c029c6c9bd27b9c6e380f15d | C++ | thien926/Thien | /UPCoder/CH25.cpp | UTF-8 | 260 | 2.53125 | 3 | [] | no_license | #include <iostream>
using namespace std;
typedef unsigned long long int ll;
ll n;
void nhap(){
cin >> n;
}
void solve(){
if(n % 2 == 0 || n % 5 == 0) cout << "Có";
else cout << "Không";
}
int main(){
nhap();
solve();
return 0;
}
| true |
037f921fc8649a86860b11e6ca143090421928c9 | C++ | small-cat/myCode_repository | /statusCheck/src/dbmanager/DBManager.cpp | UTF-8 | 10,241 | 2.8125 | 3 | [] | no_license | /**************************************************
> File name: DBManager.cpp
> Author: wzhenyu
> mail:
> Create Time: 2016-03-28 14:44
****************************************************/
#include "dbmanager/DBManager.h"
#include <stdlib.h>
/*********************************************************... | true |
375601acec0c53442dae0ddc67e64980e8a6d331 | C++ | 1779296311/leetcode | /19.cpp | UTF-8 | 863 | 2.9375 | 3 | [] | no_license | /*********************************************
* ------------------------
* ------------------------
* file name: 19.cpp
* author : @ JY
* date : 2019--09--27
**********************************************/
#include <iostream>
#include <stdlib.h>
using namespace std;
struct ListNode {
in... | true |
29cfea5ddf83d95865246baf8c0e3ee5f6a332f1 | C++ | BorisSchaeling/boost-meta-programming-2020 | /22_concepts_for_template_parameters/main.cpp | UTF-8 | 368 | 3.4375 | 3 | [
"BSL-1.0"
] | permissive | #include <iostream>
template <typename T>
concept negatable = requires(T v) { -v; };
template <typename T>
concept dereferencable = requires(T v) { *v; };
template <negatable T>
void print(T t)
{
std::cout << t << '\n';
}
template <dereferencable T>
void print(T t)
{
std::cout << *t << '\n';
}
int main()
{
int ... | true |
03a7b31754844416e81fc75523baa78488c113ad | C++ | enci/Raymond | /Raymond/Source/Light.cpp | UTF-8 | 928 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "Light.h"
#include "Utils.h"
using namespace glm;
using namespace Raymond;
LightInfo PointLight::GetLightInfo(const glm::vec3& position)
{
LightInfo info;
//vec3 direction = (Position + RandomOnUnitSphere() * Radius) - position;
vec3 direction = Position - position;
info.Distance = length(direction);
d... | true |
92e35fbef5c0c7ccbc4f4c2824a62f997ff60697 | C++ | sambennion/CS_236_Lab4 | /UndefinedStringAutoma.cpp | UTF-8 | 1,149 | 2.84375 | 3 | [] | no_license | //
// Created by Samuel Bennion on 2/1/21.
//
#include "UndefinedStringAutoma.h"
int UndefinedStringAutoma::Start(const string &input) {
// bool isMatch = true;
inputRead = 0;
this->newLines = 0;
if(input.at(0) == '\''){
inputRead++;
return s0(input);
}
else{
return 0;
... | true |
36388034766db1f7cd03b4b5280fbca8a54f6476 | C++ | YipengUva/cpp_primer_solutions | /chapter6_functions/main.cpp | UTF-8 | 1,268 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class Sales_data
{
private:
/* data */
public:
string bookNo;
unsigned units_sold = 0;
double revenue = 0.0;
string isbn() const
{
return this->bookNo;
}
Sales_data& combine(const Sales_data&);
double avg_price()... | true |
6e4cfc3a75f1b8bee9fbec03bdb864cd3c383ff4 | C++ | aikudo/compiler | /src/ocfiles/scannertest/53-insertionsort.oc.cpp | UTF-8 | 1,664 | 2.859375 | 3 | [] | no_license | # 1 "ocfiles/53-insertionsort.oc"
# 1 "<command-line>"
# 1 "ocfiles/53-insertionsort.oc"
# 1 "ocfiles/oclib.oh" 1
# 30 "ocfiles/oclib.oh"
void __assert_fail (string expr, string file, int line);
void putb (bool b);
void putc (char c);
void puti (int i);
void puts (string s);
void endl ();
int getc ();
string get... | true |
2d684c39144fd5907768a981ff7192bc893d185e | C++ | favedit/MoCross3d | /Source/Cross/Common/MoCommon/FStreamBlockPool.cpp | GB18030 | 3,280 | 2.65625 | 3 | [] | no_license | #include "MoCmPipe.h"
MO_NAMESPACE_BEGIN
//============================================================
// <T>컺п顣</T>
//============================================================
FStreamBlockPool::FStreamBlockPool(){
_capacity = 0;
_blockCapacity = 0;
MO_CLEAR(_pAllocator);
_pBlocks = MO_CREATE(FStreamB... | true |
a2e71453805bc5b4abe00d59171d87772e41aef4 | C++ | ryannuti/PoNNg | /paddle.cpp | UTF-8 | 338 | 2.75 | 3 | [] | no_license | #include "paddle.h"
using namespace std;
Paddle::Paddle(float x)
{
this->position = new Point(x, 0.0);
}
Point* Paddle::getPos()
{
return this->position;
}
void Paddle::setY(float y)
{
this->position->set(this->position->getX(), y + this->offset);
}
void Paddle::randOffset()
{
this->offset = rand() % 100 / 1... | true |
71101963e746cd8617fd7687c715fc82726596dd | C++ | bartoszWesolowski/university-projects | /openGL/OpenGL/OpenGLTutorial1/ball.cpp | UTF-8 | 633 | 3 | 3 | [] | no_license | #include "ball.h"
#include <iostream>
Ball::~Ball()
{
}
void Ball::moveBall() {
m_transform->getPos().x += velX;
m_transform->getRot().z -= velX * 1000;
if (m_transform->getPos().x > maxX || m_transform->getPos().x < 0.0f) {
velX *= -1.0;
}
}
void Ball::moveInACircle(float radius) {
m_transform->getPos().x ... | true |
5e040a5b38a95cd05ffe792da960f28a302e863f | C++ | JsKim4/BOJ-BaekJoon-Online-judge- | /cpp/2000/2700/P2738.cpp | UTF-8 | 468 | 2.578125 | 3 | [] | no_license | #include<iostream>
#pragma warning (disable:4996)
using namespace std;
// 2738 행렬 덧셈
int a1[100][100], a2[100][100];
int main(){
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> a1[i][j];
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> a... | true |
6f8e6b510ce7c2abd9eef7bdb5f5500385c640cc | C++ | jrondanv/algo | /library/Graph/hungarian.cpp | UTF-8 | 1,619 | 2.734375 | 3 | [
"Unlicense"
] | permissive | // Entrada: nh, nm, número de vértices nos lados esquerdo e direito
// dist[h][m], custo das arestas
// Saída: h[], par do vértice i do lado esquerdo
int augment(int curman) {
int i,j;
vm[curman] = mark;
for (int i = 0; i < nh; i++) {
if (newdist[curman][i] == 0 && m[i] == -1) {
m[i] = curman; ... | true |
8d1d6faac881ae1cfe2c1427bec104da9aebff63 | C++ | jsjose/katas-Cpp | /countDuplicates.cpp | UTF-8 | 1,729 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
#include <stdio.h>
// using namespace std;
size_t duplicateCount(const std::string& in); // helper for tests
size_t duplicateCount(const char* in)
{
int i, n;
size_t rc = 0;
int dup[26+33+4+6] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,
... | true |
948852039a57a600ff981b15c296c99baf7d32f9 | C++ | lyh458/InteractionModels_DemoCode | /src/iModGripper/c_interface.cpp | UTF-8 | 3,317 | 2.71875 | 3 | [] | no_license | #include "gripper/GripperController.h"
#if defined(__cplusplus)
extern "C" {
#endif
extern void GC_init(void) __attribute__((constructor));
extern void GC_term(void) __attribute__((destructor));
GripperController *gripper = NULL;
//! Library Constructor
void GC_init() {
if (gripper == NULL) {
gripper = new Gripp... | true |
96dbc42a1b44fa86a78e272fdb60900478590547 | C++ | Maserhe/LeetCode | /55.跳跃游戏.cpp | UTF-8 | 874 | 3.09375 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=55 lang=cpp
*
* [55] 跳跃游戏
*/
// @lc code=start
class Solution {
public:
/* 方法一, 差一个用例。
vector<bool> st;
bool dfs(vector<int>& nums, int index) {
if (index == nums.size() - 1) return true;
for (int i = 1; i <= nums[index]; i ++ ) {
if (index + i >... | true |
36ad217f6e2a5dd79f76439358264c9b12030d8a | C++ | ongbe/midas | /midas_ctp/midas/CtpConfig.cpp | UTF-8 | 3,459 | 2.65625 | 3 | [] | no_license | #include "CtpProcess.h"
#include "utils/FileUtils.h"
/**
* first check env value, then check config value
* if still not found, change config path to lower case
* if still not found ,then use default value and log warning
*/
template <typename T>
T get_cfg_value(const string& root, const char* key, const T& defaul... | true |
a05800d9283dcd82f23b09cfe1a61a711aae4f7d | C++ | xtrm0/PO-LEIC-2015 | /P08/CPP/main.cpp | UTF-8 | 651 | 3.9375 | 4 | [
"WTFPL"
] | permissive | #include "Cat.hpp"
int main() {
//1) cria dois gatos (“Tareco” com 2 anos e “Pantufa” com 6 meses);
Cat *g1, *g2;
g1 = new Cat(24, "Tareco");
g2 = new Cat(6, "Pantufas");
//2) escreve os gatos para um std::stringstream
stringstream ss;
ss << *g1 << *g2;
//3) cria dois gatos não inicializados;
Cat *... | true |
1c8b355bdee932ae9d8d1e22309e7f32bf45b8dd | C++ | mtbehisseste/intelligent_surveillance | /lab1-rgb_to_hsv_log_and_invlog/rgb-to-hsv-log-and-invlog.cpp | UTF-8 | 2,164 | 2.578125 | 3 | [] | no_license | #include "opencv2/opencv.hpp"
#include <vector>
#include <math.h>
using namespace cv;
using namespace std;
int main() {
Mat img = imread("lena.jpg");
imshow("jpg", img);
Mat hsvImg;
cvtColor(img,hsvImg,CV_BGR2HSV);
int h = img.rows;
int w = img.cols;
Mat hsvImgSp[3];
split(hsvImg, hsvImgSp)... | true |
baffb922000d2fbe5dc138041d6c76cf1725ab96 | C++ | Phinease/OpenCV-Learning | /week3-cpp/implementationOfMorphologicalOperations.cpp | UTF-8 | 2,709 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include "dataPath.hpp"
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <time.h>
using namespace std;
using namespace cv;
int main() {
Mat demoImage = Mat::zeros(Size(10, 10), CV_8U);
cout << demoImage << endl;
imshow("image", demoImage);
waitKey(0);
demo... | true |
012dbf4efc68a4095e3499fbd3d184f33b7ec2c9 | C++ | IvanShevchenko135/ForCFU | /Алгоритмы и структуры данных/Первый семестр/12) Разные/ВA_12.cpp | UTF-8 | 796 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main() {
int hours, minutes, T;
string time;
cin >> T;
while (T--) {
cin >> time;
hours = (int)(time[0] - '0');
if (hours != 0) {
hours *= 10;
}
int tmp;
tmp = (int)(time[1] - '0');
hours += tmp;
minutes = (int)... | true |
32c90931301c503cc1a769efd3bf7fafb5879fbf | C++ | flavmodan/school_projects | /bancnote.cpp | UTF-8 | 923 | 2.671875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int n,sol[101],counter=1;
int monezi[]={5,10,20,25};
void print(int v[],int k){
for(int i=k;i>=0;i--){
cout<<v[i]<<" ";
}
cout<<endl;
}
int sum(int v[],int k){
int total=0;
for(int i=0;i<=k;i++){
total=total+v[i];
}
return total;
}
int Min[100],mk=1000... | true |
040327441f6b91bbc6c3bbcf179d45a10e2188cb | C++ | ShahzadHafeez/My_Alpha | /assn1.cpp | UTF-8 | 4,428 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include<unistd.h>
#include <cstring>
using namespace std;
void merge(int arr[], int L[], int R[], int n1,int n2,int l)
{
int i=0, j=0, k=l;
while (i < n1 && j < n2)
{
if (L[i] < R[j])
... | true |
ef545af654a469b2ea7440de123016168665a6b9 | C++ | AdityaRana-01/Bunk_Planner | /Subject.h | UTF-8 | 656 | 2.703125 | 3 | [] | no_license | //
// Created by Aditya Rana on 13-01-2020.
//
#ifndef BUNK_PLANNER_SUBJECT_H
#define BUNK_PLANNER_SUBJECT_H
#include <iostream>
class Subject {
public:
Subject();
std::string get_name_of_subject();
static void set_min_attendance_percentage(int);
void add_class_attended();
void add_class_missed()... | true |
d44d523698f3a77af20a917b72565ebbb5c83454 | C++ | Plopounet13/GAP | /LevelGenerator/Instance/Vec3.h | UTF-8 | 3,490 | 2.96875 | 3 | [] | no_license | #ifndef Vec3_h
#define Vec3_h
#include <iostream>
#include "../../WorldGenerator/geometrie.h"
template <class T>
class Vec3 {
T x;
T y;
T z;
public:
Vec3();
Vec3(const Vec3<T>& v);
Vec3(const Point& p);
Vec3(T v);
Vec3(T mx, T my, T mz);
void rotate(const Vec3<float>& dr);
void rotate(float cosx, float c... | true |
0f3d516e8f7190e7a64453bce9b27a912d5fd85b | C++ | Naveed-Naqi/Cool-Questions | /OSTest.cpp | UTF-8 | 246 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include<unistd.h>
#include <sys/types.h>
using namespace std;
int main() {
pid_t pid;
pid = fork();
if (pid > 0) {
cout << "I am a parent\n";
} else if (pid == 0) {
cout << "I am a child\n";
}
return 0;
} | true |
1c6f8f9805738c7408dfdbdaed30acb4c3c60d30 | C++ | NCAR/lrose-core | /codebase/apps/Radx/src/RadxModelQc/Clutter2dQualFilter.hh | UTF-8 | 1,129 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* @file Clutter2dQualFilter.hh
* @brief The clutter 2 dimensional quality filter
* @class Clutter2dQualFilter
* @brief The clutter 2 dimensional quality filter
*/
#ifndef CLUTTER2D_QUAL_FILTER_H
#define CLUTTER2D_QUAL_FILTER_H
#include <string>
#include <vector>
class RadxAppRayLoopData;
class RadxRay;
cla... | true |
a0dc8cd62e3c502ffa644771ef200cc97828e9a0 | C++ | jamilligioielli/LG1-LinguagemC | /Lista4Vetores/Lista4SalaExer7.cpp | UTF-8 | 323 | 2.75 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
int main ()
{
int a[10], b[10], o, m;
printf ("Entre com 9 numeros:\n");
for (o=0; o<10; o++)
{
scanf ("%d", &a[o]);
m=9-o;
b[m]=a[o];
}
printf ("\n os valores invertidos:\n");
for (m=0; m<10; m++)
{
printf ("%d \n", b[m]);
}
getch ();
return 0;
... | true |
d9c0a5c9efd06a06f121e447d55033fb317c5072 | C++ | usamanadeemrm7/LARAVELC | /tx.hpp | UTF-8 | 1,863 | 3.046875 | 3 | [] | no_license |
#ifndef TRANSACTION_H
#define TRANSACTION_H
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include <stdexcept>
#include "json.hh"
using json = nlohmann::json;
class Transaction {
public:
Transaction(string txhash, string chash, string vhash);
string gettxhash(void)... | true |
8439e848f806ba2a83d48a959c84af21e94e5711 | C++ | yaspoon/SearchGraphs | /branch-search-src/include/Pair.h | UTF-8 | 747 | 3.359375 | 3 | [] | no_license | /*Pair.h
Brock York 14840261
AMI 300 Assignment Greedy Search
Pair object implemented as a template class
It is used to pass back more then on object upon return
It can hold upto two different objects whose type are
declared when the pair is created
i.e Pair<Vertex, bool> will create a pair that holds
a vertex in first... | true |
20b699847e3f913e90d9bea1ec3f2c2abcf4bf07 | C++ | fsamuels/highschool-coursework | /linux.davidson.cc.nc.us/student/public/WITHDEST.CPP | UTF-8 | 558 | 3.375 | 3 | [] | no_license | #include "withdest.h"
#include <iostream.h> // for cout
#include <string.h> // for strlen and strcpy
withDestructor::withDestructor(char* initText)
{
my_chars = new char[strlen(initText) + 1];
strcpy(my_chars, initText);
cout << "In constructor, my_chars: '" << my_chars << "'" << endl;
}
withDestructor::~wit... | true |
b1322807f165d42a8bdc8b2c4953327fab950600 | C++ | dwelman/mod1 | /src/Map.class.cpp | UTF-8 | 413 | 2.625 | 3 | [] | no_license | #include <Map.class.h>
Map::Map(int x, int y)
{
this->x = x;
this->y = y;
}
Map::addPoint(float x, float y, float z)
{
this.points.push_back(new Point(x, y, z));
this->countPoints++;
}
Map::addPoint(float x, float y, float z, int reinterpolate)
{
this.points.push_back(new Point(x, y, z));
this->countPoints++;
... | true |
4bb152e2c2a129789417b6d24e5334508d376fc6 | C++ | algbio/br-index-mems | /src/utils.hpp | UTF-8 | 1,722 | 2.890625 | 3 | [] | no_license | #ifndef INCLUDED_BRI_UTILS_HPP
#define INCLUDED_BRI_UTILS_HPP
#include "definitions.hpp"
namespace bri {
std::string get_time(ulint time){
std::stringstream ss;
if(time>=3600){
ulint h = time/3600;
ulint m = (time%3600)/60;
ulint s = (time%3600)%60;
ss << time << " seconds. ("<< h << "h " << m <... | true |
55166532cba205379feef583c3ba693384b92a03 | C++ | bharatm11/beginner_tutorials | /src/talker.cpp | UTF-8 | 1,737 | 2.8125 | 3 | [
"BSD-3-Clause"
] | permissive | // "Copyright [2018] <Bharat Mathur>"
/** @file talker.cpp
* @brief talker.cpp is a node publishes a string to chatter topic
*
* @author Bharat Mathur (bharatm11)
* @bug No known bugs.
* @copyright GNU Public License.
*/
#include <ros/console.h>
#include <sstream>
#include "std_msgs/String.h"
#include "ro... | true |
0486611ab239e30cd1261214531a872e1fe5bb0d | C++ | lxyzzzZZZ/practice | /剑指/5.8/5.8/源.cpp | GB18030 | 1,971 | 3.875 | 4 | [] | no_license | #include <iostream>
#include <stack>
#include <queue>
#include <deque>
using namespace std;
struct BinaryTreeNode
{
int val;
BinaryTreeNode* left;
BinaryTreeNode* right;
};
//ջѹ뵯
static bool IsPoporder(const int* pPush, const int* pPop, int length)
{
if (pPush == nullptr && pPop == nullptr && length == 0)
{
... | true |
f982550022242238aee8e10b639edd38ad598c6f | C++ | droidroot1995/DAFE_CPP_014 | /implementation_vector/vector/vector19.cpp | UTF-8 | 3,120 | 3.171875 | 3 | [] | no_license | #include "../vector/vector19.hpp"
#include <exception>
template <typename T, typename A>
Vector19<T, A>::Vector19(int s)
{
if (s < 0)
throw std::bad_alloc();
elem = alloc.allocate(s);
space = s;
sz = s;
}
template <typename T, typename A>
Vector19<T, A>::Vector19(const Vector19<T, A> &v)
{
... | true |
d58de60276a82747b648e75ccf3ae92878e352fd | C++ | masa-k0101/Self-Study_Cpp | /Cp7/7-2-1_trainning.cpp | UTF-8 | 687 | 3.390625 | 3 | [] | no_license | #include<iostream>
namespace A
{
class samp
{
//デフォルトでプライベート
int a;
protected: //sampについてはプライベートのまま
int b;
public:
int c;
samp(int n, int m) { a = n; b = m; }
int geta() { return a; }
in... | true |
cd73a595bc1bee73d720921d5a2db36db7273a85 | C++ | greyfrog/DFSM_SIM | /Testbed/Testbed.h | UTF-8 | 2,012 | 2.65625 | 3 | [] | no_license | /*
* Testbed.h
*
* Created on: Jun 27, 2021
* Author: Nutzer
*/
/*! \file Testbed.h
* \brief Definition der Klasse Testbed
* \author Thai Nguyen, Dung Tran
* \date 2020
*/
#include "../source/Clock.h"
#include "../source/Constant.h"
#include "../network/Network.h"
#include "../plot/BMPPlot.h"
#include... | true |
458c244eabb4003f105d76d94f042b9746ca64d1 | C++ | aleksandraniksic/MATF-ConstructCrusade | /src/init_platforms.hpp | UTF-8 | 8,331 | 2.8125 | 3 | [] | no_license | #ifndef INIT_PLATFORMS_HPP
#define INIT_PLATFORMS_HPP
void init_platforms_and_enemies(std::vector<BigPlatform> &big_platforms,
PlayerClass &player,
Sprite &platform_sprite,
std::vector<ImpEnemyClass> &imps,
std::vector<WitchEnemyCla... | true |
7f425fe213441e509e52ca516b9ec633b4520954 | C++ | JoshRWinter/win | /win/include/win/Targa.hpp | UTF-8 | 474 | 2.65625 | 3 | [] | no_license | #pragma once
#include <win/Stream.hpp>
namespace win
{
class Targa
{
public:
Targa();
Targa(Stream);
Targa(const Targa&) = delete;
Targa(Targa&&) = default;
void operator=(const Targa&) = delete;
Targa &operator=(Targa&&) = default;
int width() const;
int height() const;
int bpp() const;
const unsigned c... | true |
fbb3e26b123ffc2a32880018f21f15c22b9270f9 | C++ | vstdio/ood | /Command/Editor/EditorTests/ImageFileStorageMock.h | WINDOWS-1251 | 1,163 | 3.09375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "../IImageFileStorage.h"
// :
//
class ImageFileStorageMock : public IImageFileStorage
{
public:
ImageFileStorageMock(std::ostream* output = nullptr)
: m_output(output)
{
}
std::string AddImage(const std::string& imagePath)override
{
m_copyFlags.emplace(imagePath, true);
r... | true |
f387d9d9ca9a149b3c0da58d90f751a627caab71 | C++ | INF112-Programacao2/20202-team-2 | /cliente.cpp | UTF-8 | 737 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "cliente.h"
Cliente::Cliente(int id, std::string nome, std::string telefone, std::string endereco) :
_id(id), _nome(nome), _telefone(telefone), _endereco(endereco) {}
int Cliente::getId(){
return _id;
}
void Cliente::setId(int id){
_id = id;
}... | true |
f9ea3741dbf884044fd966468e6f9b60da96c84c | C++ | bluespeck/OakVR | /src/Core/ResourceManager/EmptyResource.h | UTF-8 | 582 | 2.65625 | 3 | [
"MIT"
] | permissive | // this is a placeholder resource, used to keep track of
// a resource through the loading process; under normal
// circumstances, it shouldn't be used in user code
#pragma once
#include "ResourceManager/IResource.h"
namespace oakvr
{
class EmptyResource : public IResource
{
public:
EmptyResource(const oakvr::S... | true |
76e8c838107db1e696a59e51fc07e12eab7a66dd | C++ | omya2003/SEM-III | /nmimsmarks.cpp | UTF-8 | 1,613 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
using namespace std;
class TEE;
class ICA
{
float math;
float oop;
float se;
float ds;
public:
void readIcaMarks(void)
{
cout << "\n\nENTER ICA MARKS" << endl;
cout << "\nEnter ICA Marks obtained in Maths: ";
cin >... | true |