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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e69c5fdb1fb30c25070fa375eee77a5677c8b9e9 | C++ | s-kramer/cpp_tests | /boost_training/examples/examples/module06_7.cpp | UTF-8 | 289 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <functional>
#include <algorithm>
int main(int argc, char* argv[]) {
int numerki[] = {1,2,3,4,5,6,7,8,9};
int ilosc;
ilosc = std::count_if(numerki, numerki+9,
std::bind2nd(std::greater_equal<int>(),4));
std::cout << "Jest " << ilosc << " liczb >=4\n";
}
| true |
a0f3bdec4d39e7b809fd4cc45c2caeba918aadd9 | C++ | willproj/willToys | /vendor/RenderX/RenderX/include/utils/Mouse.h | UTF-8 | 1,486 | 2.5625 | 3 | [] | no_license | #pragma once
#include "..//..//Common.h"
#include "..//event/MouseEvent.h"
namespace renderx::utils
{
enum REN_API MouseButton
{
RX_LEFT_BUTTON,
RX_RIGHT_BUTTON,
RX_MIDDLE_BUTTON
};
class REN_API Mouse
{
private:
bool m_LeftButton = false;
bool m_RightButton = false;
bool m_MiddleButton = true;
... | true |
6dcf52be4793846c632c9b70032c795d1bd092c5 | C++ | Zomega/VoroniExample | /transform.h | UTF-8 | 2,142 | 3.53125 | 4 | [] | no_license | #ifndef TRANSFORM_H
#define TRANSFORM_H
#include "vector.h"
#include <cmath>
class Rotation {
private:
float angle;
public:
Rotation() {
this->angle = 0;
}
Rotation( float angle ) {
this->angle = angle;
}
Rotation( const Rotation& rotation ) {
this->angle = rotation.getAngle();
}
Rotation operator=( R... | true |
8428c1e442537e9b4086d5dafb91ed2738c2bc43 | C++ | kshitij86/code-examples | /prac/01_knap.cpp | UTF-8 | 1,432 | 3.46875 | 3 | [] | no_license | // Program to implement 0-1 knapsack using DP
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
typedef vector<int> vec;
typedef vector<vector<int>> vecv;
void print_vec(vec x)
{
for (int i : x)
cout << i << " ";
cout << endl;
}
int dp(vec weights, vec values, int w, int n, vec mem)... | true |
c37819202d1998a1b946b2ca44d0e18311d0295d | C++ | elvircrn/ccppcodes | /pritnerqueue.cpp | UTF-8 | 1,282 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
using namespace std;
struct Job
{
int priority, location;
bool myJob;
Job () { }
Job (int _priority, int _location, bool _myJob) { priority = _priority... | true |
0df3a858aedc240bc07865df9fc37592dcc9a5e4 | C++ | slimek/Caramel | /include/Caramel/Android/JniClass.h | UTF-8 | 1,756 | 2.65625 | 3 | [] | no_license | // Caramel C++ Library - Android Facility - JNI Class Header
#ifndef __CARAMEL_ANDROID_JNI_CLASS_H
#define __CARAMEL_ANDROID_JNI_CLASS_H
#pragma once
#include <Caramel/Setup/CaramelDefs.h>
#include <Caramel/Android/Detail/JniConstructor.h>
#include <Caramel/Android/Detail/JniGlobals.h>
#include <Caramel/Android/Detai... | true |
8277ebb45fed9631e50a46ebf270131a23e3eaea | C++ | tychen5/NTU_ANTS-lab | /networkTA_project/submission/DemoI/b05705055.cpp | UTF-8 | 5,392 | 2.90625 | 3 | [] | no_license | #pragma comment(lib, "Ws2_32.lib")
#include <WinSock2.h>
#include <iostream>
#include <string>
using namespace std;
//Server IP: 140.112.107.194 port=33120
int main(){
const int MSG_SIZE = 100;
const int CMD_SIZE = 100;
WSAData wsa;
WORD version = MAKEWORD(2, 2);
int Result = WSAStartup(ver... | true |
48d208253151194ed0637ca1474631c8f93c7e55 | C++ | jolilj/suntracker | /arduino/servo_test/servo_test.ino | UTF-8 | 523 | 2.609375 | 3 | [] | no_license | #include <Servo.h>
#define SERVO_PIN 3
//hservo working range 10-160
//vservo working range 40-120
#define HSERVO_MIN 10
#define HSERVO_MAX 160
#define VSERVO_MIN 40
#define VSERVO_MAX 120
#define uToVPos(u) (VSERVO_MAX-VSERVO_MIN)/100.0*u + VSERVO_MIN
#define uToHPos(u) (HSERVO_MAX-HSERVO_MIN)/100.0*u + HSERVO_MIN
... | true |
327f15bc0e8d4b9cba88f08f1773423bbd81680a | C++ | 1998factorial/Codeforces | /contests/educationalRound92/D2.cpp | UTF-8 | 1,676 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int t; scanf("%d" , &t);
while(t--){
ll N , K , l1 , r1 , l2 , r2 , a , b , c , i;
scanf("%lld %lld" , &N , &K);
scanf("%lld %lld %lld %lld" , &l1 , &r1 , &l2 , &r2);
// assume l1 <= l2
if(l... | true |
0423a1b217cb2b2985e3f0be1a30d5fe8fca7ac3 | C++ | afeng0007/cpp11feature | /features/std_declval.cpp | UTF-8 | 332 | 3.703125 | 4 | [] | no_license | #include <utility>
#include <iostream>
struct Default {int foo()const{return 1;}};
struct NoDefault
{
NoDefault(const NoDefault&){}
int foo()const{return 1;}
};
int main()
{
decltype(Default().foo()) n1 = 1;
decltype(std::declval<NoDefault>().foo()) n2 = n1;
std::cout << "n1 = " << n1 << '\n'
<< "n2 = " << n... | true |
60a2e28e3050a07c9fc817b8542cff0c1ea6be75 | C++ | tatsy/tatsy-pppm | /sources/bbox.cc | UTF-8 | 2,999 | 2.890625 | 3 | [
"MIT"
] | permissive | #define BBOX_EXPORT
#include "bbox.h"
#include <algorithm>
#include "common.h"
BBox::BBox()
: _posMin(INFTY, INFTY, INFTY)
, _posMax(-INFTY, -INFTY, -INFTY)
{
}
BBox::BBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
: _posMin(minX, minY, minZ)
, _posMax(maxX, maxY, ... | true |
7cd4e38523c923e42200dc31d5779b9b0c04ee8f | C++ | krzysiek1105/_chess | /src/piece_legal_moves.cpp | UTF-8 | 6,661 | 2.953125 | 3 | [] | no_license | #include "chessboard.h"
std::vector<Chessboard::Move> Chessboard::getLegalMovesPawn(Position position, Position axis, Side side)
{
std::vector<Chessboard::Move> result;
bool guardian = axis.x || axis.y ? true : false;
int direction = (side == WHITE ? 1 : -1);
int current_x = position.x;
int current_y = position.y... | true |
b38b4da2059b220f3d9fa9f3e712a042c14b7edf | C++ | ganapathi7869/compilergenerateopcode | /compilergenerateopcode.cpp | UTF-8 | 11,401 | 2.625 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct symbol{
char name[20];
unsigned int address;
unsigned int size;
char constval;
};
struct block{
char name[20];
unsigned int address;
};
struct targetline{
unsigned int lineno;
unsigned int opcode;
unsigned int arg1;... | true |
8c95339a4f3f8dbd736b6ec5d505199fa631b6fc | C++ | wuggy-ianw/AoC2017 | /day12/testday12.cpp | UTF-8 | 1,587 | 3.21875 | 3 | [
"Unlicense"
] | permissive | //
// Created by wuggy on 21/12/2017.
//
#include "gtest/gtest.h"
#include "day12.h"
TEST(DAY12, TestParse)
{
std::string example = "0 <-> 2\n"
"1 <-> 1\n"
"2 <-> 0, 3, 4\n"
"3 <-> 2, 4\n"
"4 <-> 2, 3, 6\n"
"5 <-> 6\n"
"6 <-> 4, 5\n";
std::istringstream iss(example);
std::... | true |
672cc34a538b147197bb7fe324b1af1c1819e968 | C++ | bonorose/adspecto | /Specto-Light/Specto-Light.ino | UTF-8 | 3,824 | 2.796875 | 3 | [] | no_license | /*
Name: Specto_Light.ino
Created: 14-Sep-19 11:12:20 AM
Author: Simeon Marlokov
Brief: This project contains the source code for the Specto Light prototype testing module.
Hardware Components:
Solar Panel;
BME280 Temperature Sensor,
5V Relay JQC-3FF-S-Z,
TSL 2591 Dynamic Light Sensor
Microcontroller: Ard... | true |
6c79c00b6394970785a9c1971b590fbe1d3cb9e5 | C++ | lyl2000/CSP | /201709-1 打酱油.cpp | UTF-8 | 266 | 2.5625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int N,p=10,c1=5,d1=2,c2=3,d2=1,res=0;
cin>>N;
N/=p;
while(N/c1){
res+=(c1+d1)*(N/c1);
N%=c1;
}
while(N/c2){
res+=(c2+d2)*(N/c2);
N%=c2;
}
res+=N;
cout<<res<<endl;
return 0;
}
| true |
c4f372620742fd290a5720ce6cddde8a54f7c216 | C++ | siamcodes/c | /while1.cpp | UTF-8 | 145 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
main(){
int i;
printf("Enter Number:");
scanf("%d", &i);
while(i > 0){
printf("Hello World %d \n", i);
i--;
}
}
| true |
5c35a2d7daf5697315dab9583eb007290a0c97d4 | C++ | Frankie-2000-F/PAT_Advanced-Level | /1031/1031/源.cpp | UTF-8 | 525 | 2.671875 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
string s;
int N,k,n;
int main(){
cin >> s;
N = s.size();
switch ((N+2) % 3){
case 0:
k = n = (N + 2) / 3;
break;
case 1:
k = (N + 2) / 3;
n = (N + 2) / 3 + 1;
break;
case 2:
k = (N + 2) / 3;
n = (N + 2) / 3 + 2;
break;
}
for (int i = 0; i... | true |
bab0ae7d4638bcf3f689744fa11ad0683c4640d9 | C++ | sbaskar1997/PurdueTracSat | /src/LaserCom/Lasercom Library/receiver/receiver.ino | UTF-8 | 1,268 | 2.890625 | 3 | [] | no_license | #define SOLARPIN A0
#define THRESHOLD 30
int ascii = 0;
int ambientReading;
int k = 1;
void setup() {
// Setup Code.
pinMode(SOLARPIN, INPUT);
Serial.begin(9600);
ambientReading = analogRead(SOLARPIN);
Serial.println(ambientReading);//Set the ambient reading of the receiver.
}
void loop() {
int ... | true |
46ba495afc38d2c8cc9dd8fc86c1eafc1709d707 | C++ | waskerdu/Mercutio-Engine | /MercutioEngine/meBarrier.h | UTF-8 | 266 | 2.515625 | 3 | [] | no_license | #pragma once
#include "meEntity.h"
class Barrier :
public Entity
{
public:
Barrier();
~Barrier();
void OnCollision(Entity* ent);
Entity* Copy()
{
Barrier* copy = new Barrier(dynamic_cast<const Barrier&>(*this));
DeepCopy(this, copy);
return copy;
}
};
| true |
0abbe505eb9ae202b911a5e4e3452afa69b03d19 | C++ | ms-darshan/Competitive-Coding | /Google CodeJam/Google_CodeJAm_2018_Round_1B_Rounding_Error.cpp | UTF-8 | 2,780 | 2.546875 | 3 | [] | no_license | /*~~~~~~~~~~~~~~~~~~*
* *
* $DollarAkshay$ *
* *
*~~~~~~~~~~~~~~~~~~*/
//https://codejam.withgoogle.com/2018/challenges/0000000000007764/dashboard
#include <algorithm>
#include <assert.h>
#include <ctype.h>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#incl... | true |
380b91802ee49987bf20afdb9827129054339f28 | C++ | olethrosdc/beliefbox | /src/statistics/SparseTransitions.h | UTF-8 | 2,704 | 2.890625 | 3 | [] | no_license | /* -*- Mode: c++; -*- */
// copyright (c) 2009 by Christos Dimitrakakis <christos.dimitrakakis@gmail.com>
/***************************************************************************
* *
* This program is free software; you can redistribute it... | true |
6b7572f2f64bed96e39fdade3ff033c1c6dbc5e3 | C++ | senestone/ActionTimer | /src/ActionTimer.h | UTF-8 | 654 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /***********************************************************************
* Class: ActionTimer
*
* Author: Charles McKnight
*
* Description:
* This class provides a millis()-driven timer that can be used to
* control object states and actions.
********************************************************... | true |
ae10c9f1fd355fdb7b87d5745d6925ece73ee559 | C++ | sergiobravo-git/IPC202101 | /While5.cpp | ISO-8859-1 | 477 | 3.5 | 4 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
// while (<CONDICION>) for (<INICIALES>;<CONDICION>;<INCREMENTOS>)
// 1,2,3,4,5
int i;
cout<<"Usando el ciclo for"<<endl;
for(i=7;i<=5;i++)
cout<<i<<endl;
cout<<"****la variable i termino en, despus del ciclo for. "<<
i<<endl<<"Usando el ciclo do...... | true |
036aa5a8c8a585c1cdb5e796a6dfe8100e6dabdb | C++ | koochin/course-scheduler | /src/course_graph.cpp | UTF-8 | 535 | 3.171875 | 3 | [] | no_license | #include "../include/course_graph.h"
CourseGraph::CourseGraph(const std::vector<std::vector<int>>& graph, const std::vector<CourseNode>& nodes) {
this->graph = graph;
this->nodes = nodes;
this->V = nodes.size();
int edges{};
for (const auto& node : graph) {
edges += node.size();
}
t... | true |
55bb6a27b7c64dc0e40603e7d4a44932adf7b294 | C++ | jwarton/N-Technium-Libs | /NT-Template/ntechnium/libNtechnium/FEM/archive/ntNode_arm.h | UTF-8 | 3,796 | 2.578125 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////// ntNode_arm.h
// openGl scratch libs ///////////////////
// Element Class ///////////////////
// created by James Warton on 11/04/2014 ///////////////////
/////////////////////////////... | true |
30dd68e92faca66000fc3524f6c9e60d834530e5 | C++ | radtek/RetroCode | /FoxMediaCenter/FoxMediaCenter/Blowfish/Blowfish.h | UTF-8 | 3,772 | 3.125 | 3 | [
"MIT"
] | permissive |
////////////////////////////////////////////////////////////////////////////
///
// Blowfish.h Header File
//
// BLOWFISH ENCRYPTION ALGORITHM
//
// Encryption and Decryption of Byte Strings using the Blowfish Encryption Algorithm.
// Blowfish is a block cipher that encrypts data in 8-byte blocks. The algorit... | true |
ced4b630ad926bd08b055692496926e6699777b4 | C++ | ala24013/CA_SPR12 | /ASM/Converter.cpp | UTF-8 | 8,784 | 2.921875 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define FILEPATH ../testASM
string binary(int n)
{
//TODO
//handle negatives
string result;
do result.push_back( '0' + (n & 1) );
while (n >>= 1);
reverse( result.begin(), result.end() );
return result;
}
int Converter::parseI... | true |
73d567b7a158958803d38900b07d5ebcef0c5bab | C++ | leighfall/130-Projects | /lab1.cpp | UTF-8 | 3,372 | 4.03125 | 4 | [] | no_license | //Lab1
//COSC130
//Description: This program takes two values and an operation and converts values
//to integers, performs the operation and converts the value back to strings.
//Autumn Henderson
//January 18th, 2019
#include <iostream>
#include <string>
using namespace std;
int CharToInt(char v);
char IntToChar(int ... | true |
2602d664fd858489c888e8558f443b6b3614b897 | C++ | Yu-anan/ece551 | /068_circle/point.cpp | UTF-8 | 260 | 3.234375 | 3 | [] | no_license | #include "point.h"
#include <cmath>
Point::Point(){
x=0;
y=0;
}
void Point::move(double dx, double dy){
x=x+dx;
y=y+dy;
}
double Point::distanceFrom(const Point & p){
double distence = sqrt(((x-p.x)*(x-p.x))+((y-p.y)*(y-p.y)));
return distence;
}
| true |
3d6850b2de2da2f39c588f64ce73bcf51395e88f | C++ | Sebelino/Team18v2 | /bpt-sebelino/bpt.cpp | UTF-8 | 5,580 | 3.484375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <iterator>
#include <queue>
using namespace std;
// Read from stdin.
vector<string> readBoard() {
vector<string> board;
for (string line; getline(cin, line);)
board.push_back(line);
retu... | true |
509a23468e803302435fa676dc4d4ab2d3ec542f | C++ | Sionesevaki/SinglyLinkedList | /MovieNode.cpp | UTF-8 | 938 | 3.203125 | 3 | [] | no_license | //
// MovieNode.cpp
// SinglyLinkedListHW2
//
// Created by Sione on 10/10/17.
// Copyright © 2017 FangaiuihaCode. All rights reserved.
//
#include "MovieNode.hpp"
MovieNode::MovieNode(Movie movie)
{
this->movie = movie;
next = nullptr;
}
Movie MovieNode::getMovie() const
{
return movie;
}
MovieNod... | true |
f14a92e2688f5c37de57700fa372202858eb7c51 | C++ | cbaltingok98/Programming-Questions | /Questions/Coding Ability Test/Bronze 1/firstUniqueCharacter.cpp | UTF-8 | 707 | 3.40625 | 3 | [] | no_license | class Solution
{
public:
/**
* @param str: str: the given string
* @return: char: the first unique character in a given string
*/
char firstUniqChar(string &str)
{
// Write your code here
vector<int> charSet(27, 0);
bool stop = true;
char c = ' ';
int h... | true |
a58253211361e693f6d1839d43331ba739b88ac5 | C++ | btcup/sb-admin | /exams/2559/02204111/2/midterm/1_1_713_5920503351.cpp | UTF-8 | 2,166 | 2.9375 | 3 | [
"MIT"
] | permissive | //5920503351Katekanok Meeruang
#include<iostream>
using namespace std;
int main ()
{
int year,downpayment,a,b,c,j;
float Amount,Finan,;
char model;
cout<<"------- Car lease calculator -----------"<<endl;
cout<<"Enter car model : "<<model;
cin>>model;
cout<<"Enter number of years (1-6) :"<<ye... | true |
ca8b10c5fb093c3fc42aa02e4b6ac5c9d7604858 | C++ | brorica/Algorithm | /simulation/3048.cpp | UTF-8 | 846 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N1, N2, timer;
string antGroupA, antGroupB;
vector<char> ant, symbol;
cin >> N1 >> N2;
cin >> antGroupA >> antGroupB;
for (int i =... | true |
1c2fb45f01321587f5916ac8ae1ddb51fbc4f83c | C++ | 201524547/ACM-ICPC_Eat | /1026(sort).cpp | UHC | 892 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
int Multiple_Array(int* A, int* B, int N){
int Sum = 0;
for(int i = 0; i < N; i++){
Sum = Sum + A[i]*B[i];
}
return Sum;
}
int compare_inc(const void *a, const void *b)
{
return *(int *)b - *(int *)a; ... | true |
172ad1d3e8ece5e84888ef04f0a3bdebaab4b460 | C++ | pkhadilkar/compcode | /codechef/DEC14/CAPPLE/CAPPLE.cpp | UTF-8 | 566 | 2.921875 | 3 | [] | no_license | /*
* Codechef DEC14 challenge
* Chef and Apple
*/
#include <iostream>
#include <algorithm>
#include <fstream>
#define MAX 100001
using namespace std;
// we don't want to deal with changing offset here
bool apples[MAX + 1];
int main() {
ios_base::sync_with_stdio(false);
int t;
cin >> t;
int N;
int x; // tmp v... | true |
b01bb414c81b640c913f7d6b5ebf7518dcafc48e | C++ | vslavik/poedit | /deps/boost/libs/core/test/exchange_move_test.cpp | UTF-8 | 1,580 | 2.6875 | 3 | [
"GPL-1.0-or-later",
"MIT",
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
Copyright 2018 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/config.hpp>
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#include <boost/core/exchange.hpp>
#include <boost/core/lightweight_test.hpp>
cla... | true |
0fc07cd80cbc8e91fcedb938112345fd9fa2d162 | C++ | eagletmt/procon | /poj/1/1673.cc | UTF-8 | 1,089 | 3.03125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <complex>
#include <cstdio>
#define M_PI_2 1.570796326795
using namespace std;
const double EPS = 1e-8;
typedef complex<double> P;
struct L : public vector<P> {
L(const P& a, const P& b)
{
push_back(a);
push_back(b);
}
};
double cross(const P& a, const P& ... | true |
b07812865d812dbf7690074b1415026ad39a552a | C++ | ippilikaushik/competitive-coding | /permpal.cpp | MacCentralEurope | 1,441 | 4.03125 | 4 | [] | no_license | #include<iostream>
#include<iomanip>
using namespace std;
// A function swapping values using references.
void swap(int *x, int *y)
{
int temp;
temp = *x;
*x = *y;
*y = temp;
}
// A function to implement Heaps Algorithm for the permutation of N numbers.
void print(const int *v)
{
int i;
in... | true |
5ff165ab80456aa10a026ebc3eaf45499ebb6612 | C++ | michal-harish/hellocpp11 | /src/func.cpp | UTF-8 | 960 | 2.515625 | 3 | [] | no_license | #include "func.h"
#include <xmmintrin.h>
#include <vector>
#include <stddef.h>
void vectorAdd(float* a, float* b, float* c, size_t n) {
__m128 A, B, C;
for (size_t i = 0; i < n; i += 4) {
A = _mm_load_ps(&a[i]);
B = _mm_load_ps(&b[i]);
C = _mm_add_ps(A, B);
_mm_store_ps(&c[i], C);
}
}
void vectorSub(float*... | true |
ae8ebaff69b3ace813b7d78727d2fb4f09701e60 | C++ | uzh-rpg/flightmare | /flightlib/include/flightlib/common/logger.hpp | UTF-8 | 2,912 | 2.890625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // """credit: Philipp Foehn """
#pragma once
#include <cstdio>
#include <fstream>
#include <iostream>
#include <string>
namespace flightlib {
class Logger {
public:
Logger(const std::string& name, const bool color = true);
Logger(const std::string& name, const std::string& filename);
~Logger();
inline std:... | true |
46e0a90b052e1c0d93f66b6cafd427539ea1ca26 | C++ | dariosena/LearningCpp | /arrays/fsra.cpp | UTF-8 | 500 | 3.65625 | 4 | [] | no_license | // A fixed size raw array matrix (that is, a 2D raw array)
#include <iostream>
#include <iomanip>
using namespace std;
auto main() -> int
{
int const n_rows = 3;
int const n_cols = 7;
int const m[n_rows][n_cols] =
{
{1,2,3,4,5,6,7},
{8,9,0,1,2,3,4},
{4,3,5,2,1,6,7}
};... | true |
7842678cfdee29ffd798ed34694f82ea01ca5368 | C++ | Anjalikumari15/object_oriented_programs | /OOP14.CPP | UTF-8 | 1,197 | 3.390625 | 3 | [] | no_license | #include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
class players
{
protected:
int experience;
char *type_of_sport;
public:
void getdata()
{
cout<<"Enter experience of player in years : ";
cin>>experience;
cout<<"Enter associated type of sport : ";
gets(type_of_sport... | true |
818b37e26e6d1ad371d8b4ccc4e7816966484b4c | C++ | delivite/fractal | /FractalCreator.cpp | UTF-8 | 3,839 | 2.859375 | 3 | [] | no_license | /*
* FractalCreator.cpp
*
* Created on: 29 Jan 2020
* Author: Samuel Chinedu
*/
#include <cassert>
#include "FractalCreator.h"
void FractalCreator::run(std::string name) {
/*addZoom(Zoom(295, m_height - 202, 0.1));
addZoom(Zoom(312, m_height - 304, 0.1));*/
calculateIterations();
totalIterations();
c... | true |
14cf50898d16f9091f69443fca4222a934ba56cc | C++ | hekl0/Sliding-Puzzle | /MainScreen.cpp | UTF-8 | 1,622 | 2.859375 | 3 | [] | no_license | #include <main.h>
#include <iostream>
void MainScreen::start(SDL_Renderer* gRenderer, bool& quit) {
bool goBack = false;
//clear screen
SDL_SetRenderDrawColor( gRenderer, 0xFF, 0xFF, 0xFF, 0xFF );
SDL_RenderClear(gRenderer);
//load background
SDL_Surface* surface = IMG_Load("Picture/backgroun... | true |
dc387c2a196b92fbe2b4a7dc6ebc807bc366ea36 | C++ | TannerLow/Expression-Parser | /Validator.h | UTF-8 | 901 | 2.875 | 3 | [] | no_license | #ifndef VALIDATOR_H
#define VALIDATOR_H
#include <string>
#include <vector>
//Recursive descent parser for checking validity of expressions
class Validator
{
public:
Validator(std::vector<std::string> Tokens);
Validator(std::vector<std::string> Tokens, std::vector<std::string>::iterator start);
... | true |
4a1f5030681e08e630e59804f100e4411c984f32 | C++ | Starwolf-001/CAB401 | /CAB401_MatrixMultiply_Win_Thread/main.cpp | UTF-8 | 2,667 | 3.03125 | 3 | [] | no_license | #include <stdlib.h>
// Added stdlib.h to allow for gcc to compile using Code::Blocks
#include <stdio.h>
#include <chrono>
#include <Windows.h>
#include <algorithm>
#define N 1000
#define ElementType double
#define NUM_THREADS 4
ElementType** AllocateMatrix(int n, int m, bool initialize)
{
ElementType **matrix = (Ele... | true |
c7555739f136b78894999b3b4a3ed3b3101cbb25 | C++ | rkBrunecz/projectJR | /src/Game/Battle/Ogre.cpp | UTF-8 | 1,600 | 2.859375 | 3 | [] | no_license | #include "Game\Battle\Ogre.h"
#include "Game\Game.h"
/*
constructor
Parameters:
window: The game window. Used to get the window size.
Creates the main characters sprite and sets other important information.
*/
Ogre::Ogre()
{
// Initialize the height and width of the battle sprite
battleHeight = 96;
battleWidth = 9... | true |
09a0ebda5bde0697349a125900ba1ce6a558c49d | C++ | AnatolyDomrachev/aleksei_cpp | /socket/pthread.cpp | UTF-8 | 722 | 2.828125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <pthread.h>
void wait_thread (void);
void* thread_func (void*);
int main (int argc, char *argv[], char *envp[]) {
pthread_t thread;
if (pthread_create(&thread,NULL,thread_func,NULL)) return EXIT_FAILURE;
for (unsigned int i = 0; i < 20; i++... | true |
bf468b717c9a8db8edd31ed8314323017f79a0e8 | C++ | cehughes/calvr_plugins | /calit2/CaveCADBeta/Geometry/CAVEGeodeReference.cpp | UTF-8 | 8,166 | 2.578125 | 3 | [] | no_license | /***************************************************************
* File Name: CAVEGeodeReference.cpp
*
* Description:
*
* Written by ZHANG Lelin on Nov 30, 2010
*
***************************************************************/
#include "CAVEGeodeReference.h"
using namespace std;
using namespace osg;
const int CA... | true |
b270fe6d96d496dfe41525340e13155fedf841df | C++ | mcarlen/libbiarc | /tools/tangent_indicatrix.cpp | UTF-8 | 1,794 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | /*!
\file tangent_indicatrix.cpp
\ingroup ToolsGroup
\brief Write the tangent indicatrix of a given (open or closed) curve to
a PKF file.
Tangents for the tangent indicatrix are interpolated, therefore strange
points like cusps would not be visible! The default is for an open curve,
for closed curv... | true |
bde448ceac2a34185287483cbc9619ff787d1f0e | C++ | Xzzzh/cpplearn | /20170425/20170425.src/templateSingleton.cc | UTF-8 | 1,570 | 3.53125 | 4 | [] | no_license | ///
/// @file templateSingleton.cc
/// @author lemon(haohb13@gmail.com)
/// @date 2017-04-25 10:52:36
///
#include <stdio.h>
#include <iostream>
using std::cout;
using std::endl;
class Point
{
public:
Point(int ix = 0, int iy = 0)
: _ix(ix)
, _iy(iy)
{
cout << "Point()" << endl;
}
~Point()
{
... | true |
4a7ea3d5bb044be39ab5406839d1744c57ca4712 | C++ | SysuMadw/DataStructrue | /树/CreatetreeByPreandIn.cpp | UTF-8 | 1,673 | 3.296875 | 3 | [] | no_license | /*************************************************************************
> File Name: CreatetreeByPreandIn.cpp
> Author: 马定伟
> Mail: 1981409833@qq.com
> Created Time: 2019年01月26日 星期六 20时14分07秒
************************************************************************/
# include <iostream>
using names... | true |
eaf7a66d647086995682a33f9bf991016904a24e | C++ | rstratton/cs184-final-project | /BVH.h | UTF-8 | 1,164 | 2.53125 | 3 | [] | no_license | //
// BVH.h
// final
//
// Created by Kavan Sikand on 10/15/13.
// Copyright (c) 2013 Kavan Sikand. All rights reserved.
//
#ifndef __RayTracer__BVH__
#define __RayTracer__BVH__
#include "algebra3.h"
#include <iostream>
#include <vector>
class Ray;
//bounding volume hierarchy
#include "Shape.h"
class BoundingBo... | true |
f5e221097e98a2edc4ffa27982e3e4e42c1daa14 | C++ | tom1516/OpenGL-Tetris | /main.cpp | UTF-8 | 18,148 | 3.03125 | 3 | [] | no_license |
#include <GL/glut.h>
#include <math.h>
#include <sstream>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include "Cube.h"
#include "Object.h"
using namespace std;
// size of grid side
#define N 20
#define M 4
// width and height of initial window
#define width 500
#define height 500
// window initi... | true |
5d187e948ed5cf71bb01bba64bc3b8731fc3caff | C++ | Gfast2/esp32-snippets | /cpp_utils/JSON.h | UTF-8 | 1,569 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /*
* JSON.h
*
* Created on: May 23, 2017
* Author: kolban
*/
#ifndef COMPONENTS_CPP_UTILS_JSON_H_
#define COMPONENTS_CPP_UTILS_JSON_H_
#include <cJSON.h>
#include <string>
// Forward declarations
class JsonObject;
class JsonArray;
class JSON {
public:
static JsonObject createObject();
static JsonArray c... | true |
0f8ca52b8787a5999e8ba6a541d79909ba4c6dce | C++ | EthanSteinberg/SuperGunBros | /src/rendering/renderlist.cpp | UTF-8 | 11,726 | 2.859375 | 3 | [
"MIT"
] | permissive | #include "renderlist.h"
#include <glad/glad.h>
#include <cmath>
#include <iostream>
RenderList::RenderList(const char* filename): file(filename), wrapper(file) {
metadata.ParseStream(wrapper);
std::array<std::array<float, 3>, 3> mat = {{
{{1, 0, 0}},
{{0, 1, 0}},
{{0, 0, 1}}
}};
st... | true |
cadca6502143d91461c3697cd741aed4be487911 | C++ | bharathajay51/mrm-2020 | /bharath/joystick-differential-drive/joystic_differetial_v3.0/joystic_differetial_v3.0.ino | UTF-8 | 2,831 | 3.03125 | 3 | [] | no_license | const byte pot_Y = A1; //Analog Jostick Y axis
const byte pot_X = A0; //Analog Jostick X axis
const byte left_forward = 3; //(left motor forward)
const byte left_reverse = 4; //(left motor reverse)
const byte right_forward = 5; //(right motor forward)
const byte right_reverse = 6; //(right motor reverse)
const byt... | true |
5be7d62f24a875a17af09914a6bd0ccd8090aeac | C++ | KarpenkoDenis/tetris | /Field.cpp | WINDOWS-1251 | 1,254 | 3.03125 | 3 | [] | no_license | #include "Field.h"
Field::Field(unsigned size_h, unsigned size_w)
{
this->size_h = size_h;
this->size_w = size_w;
//
for (size_t i = 0; i < size_h; i++)
{
base_field.push_back(std::vector<short>());
for (size_t j = 0; j < size_w; j++)
{
base_field[i].push_back(0);
}
}
}
unsigned Field::get_size... | true |
272de8e06a0bcaad37f2eed3a13d5f6f1986e77d | C++ | Rushi-710/CipherSchools_Assignment | /Assignment1/Question-5.cpp | UTF-8 | 711 | 4.09375 | 4 | [] | no_license | //Toggle the case of every character of a string
#include<bits/stdc++.h>
using namespace std;
int main() {
string str1;
cout <<"\n Please Enter any String to Toggle : ";
cin >> str1;
int len = str1.length();
for (int i = 0; i < len; i++) {
//If the character is upper-cased
if(str1[i]... | true |
adb89db5353aeb427bc3abd825e6b6dc317793da | C++ | denis-gubar/Leetcode | /all/0071. Simplify Path.cpp | UTF-8 | 927 | 2.8125 | 3 | [] | no_license | class Solution {
public:
string simplifyPath( string path ) {
string result = "/";
path += "/";
int n = path.size();
int i = 0;
while (path.find( '/', i + 1 ) != string::npos)
{
int j = path.find( '/', i + 1 );
string s = path.substr( i + 1, j ... | true |
dfb605ebec9e3fd92c8940dca7250fa6ffdeb703 | C++ | ondrej008/Accelerator | /obstacles/moving.cpp | UTF-8 | 3,322 | 2.90625 | 3 | [] | no_license | #include "moving.hpp"
MovingObstacle::MovingObstacle(glm::vec3 pos, float speed, bool vertical)
: m_cuboid1(2.0, 2.0, 0.2), m_cuboid2(2.0, 2.0, 0.2), m_speed(speed), m_vertical(vertical)
{
glm::vec3 offset(1.25, 0.0, 0.0);
if(m_vertical)
{
offset = glm::vec3(0.0, 1.25, 0.0);
}
m_model1 = glm::translate(glm::... | true |
9d6aafb14ca407d9dee576ab07e69fc748e6b033 | C++ | MichalTurek/algorithms | /a-game-with-numbers-spoj.cpp | UTF-8 | 286 | 2.953125 | 3 | [] | no_license | #include <iostream>
using std::cout;
using std::cin;
#include <string>
using std::string;
int main()
{
string number;
cin >> number;
char last_digit = number[number.length() - 1];
if (last_digit != '0')
{
cout << "1\n";
cout << last_digit << "\n";
}
else cout << "2\n";
}
| true |
e564dc546bdba532eaa951421436799ffedecad5 | C++ | ingramali/hub | /unit_test/context_manager_test.hpp | UTF-8 | 1,248 | 2.703125 | 3 | [] | no_license | #ifndef __CONTEXT_MANAGER_TESTS_HPP
#define __CONTEXT_MANAGER_TESTS_HPP
#include <gtest/gtest.h>
#include "context_manager.hpp"
#include "system.hpp"
using namespace network;
class ContextManagerTest : public testing::Test
{
protected:
ContextManager * _sut = nullptr;
public:
void SetUp() over... | true |
f8b76d23889656031f5a37fdc3e5ac14a23b3551 | C++ | manikmayur/BatterySim | /src/algorithms/interpolate.cpp | UTF-8 | 670 | 3.203125 | 3 | [] | no_license | /*
* interpolate.cpp
*
* Created on: 08.02.2019
* Author: Manik
*/
#include "algorithms/algorithms.h"
double interpolate(double x, std::vector<double> xList, std::vector<double> fList)
{
double c;
// Assumes that "table" is sorted by .first
// Check if x is out of bound
if (x ... | true |
df7c0c93c235fc778eb22599e24b2e5ec3250e16 | C++ | Simon-Fuhaoyuan/LeetCode-100DAY-Challenge | /magicDict/main.cpp | UTF-8 | 1,506 | 3.703125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class MagicDictionary {
private:
vector<string> dict;
public:
/** Initialize your data structure here. */
MagicDictionary() {
dict.clear();
}
/** Build a dictionary through a list of words */
void buildDi... | true |
43fbbf0d5108ad31456b00fade332633d501db5d | C++ | xiaoquanjie/global_server_fk | /fk/slience/socket/linuxsock_init.ipp | UTF-8 | 728 | 2.515625 | 3 | [] | no_license |
class LinuxSockBase
{
protected:
struct data
{
int _init_cnt;
};
};
template<s_int32_t Version=1>
class LinuxSockInit : public LinuxSockBase
{
public:
M_SOCKET_DECL LinuxSockInit();
M_SOCKET_DECL ~LinuxSockInit();
protected:
static data _data;
};
template<s_int32_t Version>
LinuxSockBase::data LinuxSockIni... | true |
f4f4175e89ffaaa8ec3c6e755d242573301d2986 | C++ | nshaver/liambot | /liambot_4.ino | UTF-8 | 13,147 | 2.6875 | 3 | [] | no_license | /* This example shows how to smoothly control a single servo on a
Maestro servo controller using the PololuMaestro library. It
assumes you have an RC hobby servo connected on channel 0 of your
Maestro, and that you have already used the Maestro Control
Center software to verify that the servo is powered correctly and
m... | true |
153c33cb2e1b583975f903b0723518005e863560 | C++ | tuananhlai/dont_touch_the_spike | /Don't Touch The Spike/src/MainControl.cpp | UTF-8 | 4,383 | 2.8125 | 3 | [] | no_license | #include "MainControl.h"
using namespace std;
int MainControl::WIDTH;
int MainControl::HEIGHT;
Bird* bird = NULL;
Background* background = NULL;
Spike* spike = NULL;
MainControl::MainControl()
{
window = NULL;
renderer = NULL;
end_loop = false;
status = 0;
hit = false;
score = 0;
}
MainContr... | true |
494a3c47a03a169b9c08a6069495a87edb005c5c | C++ | issackpgit/Parallel-Processing | /Openmp Parallel Prefix/Parallel Prefix parallel/a0.hpp | UTF-8 | 1,808 | 2.640625 | 3 | [] | no_license | /* ISSAC KOSHY
* PANICKER
* issackos
*/
#ifndef A0_HPP
#define A0_HPP
template <typename T, typename Op>
void omp_scan(int n, T* in, T* out, Op op) {
int *temp;
// int *x;// = (int*) malloc ((n+1)*sizeof(int));
int numofthreads, work;
int i, tid, last;
int start ,end;
// x = const_cast<int... | true |
c14dedebf2bd20a64c7494bba7e0b955edd81261 | C++ | JavongChang/aphid | /btree/Array.h | UTF-8 | 1,266 | 2.828125 | 3 | [] | no_license | #pragma once
#include "Entity.h"
#include "Sequence.h"
namespace aphid {
namespace sdb {
template<typename KeyType, typename ValueType>
class Array : public Sequence<KeyType>
{
public:
Array(Entity * parent = NULL) : Sequence<KeyType>(parent) {}
virtual ~Array() {}
void insert(const KeyType & x, ValueT... | true |
245f76070ec943f1ed85d666d57791ff077543cd | C++ | vij-duggirala/ds_algos | /graph/min_capacity_cut.cpp | UTF-8 | 1,493 | 2.625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
bool bfs(vector<vector<int>> rg,int s,int t,int parent[]){
vector<bool> v(rg.size(),false);
queue<int> q;
v[s]=true;
q.push(s);
int k,i;
while(!q.empty()){
k=q.front();
q.pop();
for(i=0;i<rg.size();i++){
if(!v[i] && rg[k][i]>0){
v[i]=true;
parent[i]=k... | true |
b05984259c45f248307dae12b87a6b89a38b3cd3 | C++ | yoniescobar/CursoProgramacionC-4PC | /Primera Unidad/incremento.cpp | UTF-8 | 202 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
using namespace std;
int main(){
int a=0;
cout<<"El valor de a es: "<<a;
a--; // a = a - 1
cout<<"\nEl valor de a es: "<<a;
return 0;
getch();
}
| true |
68f66a91477dfffb9534b110e88cfd65007fb525 | C++ | PaulKrauseTeam/IntercomProject | /Communication/checkPermission.cpp | UTF-8 | 1,028 | 2.828125 | 3 | [] | no_license | #include <ctime>
#include <iostream>
#include <pqxx/pqxx>
#include <string>
#include <typeinfo>
using namespace std;
string getUserTime(string str) {
string user_time;
pqxx::connection c("dbname=intercomdb user=guilherme-fonseca");
pqxx::work txn(c);
time_t t = time(0); // get time now
struc... | true |
d8dc161dd5f7ff4bd508f438ab2cc9380fe751dc | C++ | maximaximal/legui | /include/legui/FontManagerAbstract.h | UTF-8 | 1,092 | 3.09375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <SFML/Graphics/Font.hpp>
#include <string>
namespace legui {
/**
* @brief This is the abstract base class of the legui font manager.
*
* It is ment to be derived from your font manager to use the same ressources
* you use.
*/
class FontManagerAbstract {
public:
/**
* @brief Gets the ... | true |
3083f1335ae2d2dd9471b6c8b23f8fa58eb6655f | C++ | bachsoda326/Mario | /DemoDirectX/GameObjects/Enemy/Enemy.cpp | UTF-8 | 2,668 | 2.65625 | 3 | [] | no_license | #include "Enemy.h"
#include "EnemyRunningState.h"
#include "../../GameComponents/GameCollision.h"
Enemy::Enemy(D3DXVECTOR3 position)
{
mAnimationDie = new Animation("Resources/enemy/die.png", 1, 1, 1, 0);
mAnimationRunning = new Animation("Resources/enemy/runningleft.png", 2, 1, 2, 0.4f);
this->mEnemyData = new ... | true |
50bd34ae385eaf32716fa39bf67104aff7da0433 | C++ | zybeasy/libevent_demo | /epoll/epoll_client_001.cpp | UTF-8 | 1,891 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
using namespace std;
#define MAX_LINE (1024)
#define SERVER_PORT ((7778)
void set_noblocking(int fd) {
int opts = fcntl(fd, ... | true |
23d9a6683b0ded0d46bba05c981a3b101d2bdc83 | C++ | xUhEngwAng/oj-problems | /leetcode/剑指 Offer 66. 构建乘积数组.cpp | UTF-8 | 536 | 3.015625 | 3 | [] | no_license | #include <vector>
using std::vector;
class Solution {
public:
vector<int> constructArr(vector<int>& a) {
if(a.empty()) return vector<int>();
int n = a.size(), prod = 1;
vector<int> ret(a.size(), 1);
for(int ix = 1; ix != n; ++ix){
prod = prod * a[ix-1];
... | true |
3cf67f4c987d78a66b9d1fa724fa8c7c6a3b5e71 | C++ | ibhawna/PRACTICE-DS | /leetcode dsa bootcamp kunal kushwaha/linked list/middle element.cpp | UTF-8 | 309 | 2.8125 | 3 | [] | no_license | class Solution {
public:
ListNode* middleNode(ListNode* head) {
ListNode* sp = head;
ListNode* fp = head;
while(fp and fp->next){
sp = sp->next;
fp = fp->next->next;
}
head = sp;
return head;
}
}; | true |
eee9f183900cb6f54964c94f8a095546d5d88bf6 | C++ | little-czy/csp | /2017/201709-5.cpp | GB18030 | 2,323 | 3.078125 | 3 | [] | no_license | // ͨ汾
// #include <iostream>
// #include <cstdio>
// #define MAXN 100005
// using namespace std;
// int n, m;
// long long a[MAXN];
// long long count1[MAXN];
// int main()
// {
// cin >> n >> m;
// int op, l, r, v;
// long long tmp_count = 0;
// for (int i = 1; i <= n; i++)
// {
// scan... | true |
6f03bdccac758a9cbdee33f87102a5263606a489 | C++ | seg449/CS3113 | /HW06/sprite.cpp | UTF-8 | 2,481 | 2.75 | 3 | [] | no_license | #include "sprite.h"
#include <iostream>
using namespace std;
sprite::sprite(GLuint ID, float u, float v, float w, float h, float x, float y, float velocityX, float velocityY, float constX, float constY, float s, float rotation, bool collidedTop, bool collidedBottom, bool collidedLeft, bool collidedRight){
this->x = x... | true |
a79b706fb351d6fbed76f0b1c5f7abd026efe154 | C++ | xxAtrain223/EmbGenParser | /src/Variable.cpp | UTF-8 | 2,387 | 2.859375 | 3 | [
"MIT"
] | permissive | #include "EmbGen/Parser/Variable.hpp"
#include <tinyxml2.h>
#include "EmbGen/Parser/Exceptions.hpp"
namespace emb
{
namespace gen
{
namespace parser
{
Variable::Variable(const tinyxml2::XMLElement* xml) :
XmlElement(xml)
{
m_type = getAttr... | true |
815668bca8379dd8d4b00d9e868a64b6f4c41148 | C++ | vishwaramm/Cplusplus-FlightSystem | /Phase_5.cpp | UTF-8 | 12,400 | 3.015625 | 3 | [] | no_license | // (c) s. trowbridge 2021
#include <iostream>
#include <iomanip>
#include "Flight.h"
// containers
MyArray<Airline*> airlines;
MyArray<Airport*> airports;
MyArray<Passenger*> passengers;
MyArray<Pilot*> pilots;
MyArray<Flight*> flights;
// store data into containers
void read() {
std::cout << "Airlines: " << air... | true |
19a491230720fc3add909d6b31d3bfbff99d3ea6 | C++ | andreas-volz/stateval-creator | /src/Vector2.h | UTF-8 | 5,328 | 3.65625 | 4 | [
"MIT"
] | permissive | #ifndef VECTOR2_H
#define VECTOR2_H
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
template <typename T>
class Vector2
{
private:
public:
T x, y;
Vector2() {}
/// copy constructor
Vector2(const Vector2<T> &v) : x(v.x), y(v.y) {}
/// construct given two values
/*!
* \param ... | true |
22429cd64061648eca86bdf330abe4e18fa8dcef | C++ | Dlol/reylub | /main.cpp | UTF-8 | 1,386 | 2.953125 | 3 | [] | no_license | #include <raylib.h>
#include <iostream>
#include <string>
#include <sstream>
#include <stdlib.h>
#include <time.h>
void centerRect(int x, int y, int width, int height, Color color) {
DrawRectangle((x - (width / 2)), (y - (height / 2)), width, height, color);
}
void statusBar(int height, int value) {
DrawRectangle(0... | true |
936bb99b0657e9cffe48090e7ffc63d0e73860a6 | C++ | Adam-/anope | /include/extensible.h | UTF-8 | 3,458 | 2.625 | 3 | [] | no_license | /*
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
*/
#pragma once
#include "anope.h"
#include "service.h"
#include "logger.h"
class Extensible;
class CoreExport ExtensibleBase : public Service
{
protected:
std::map<Extensible *, void *>... | true |
d138b4f294239c1e359daf59f9c7db56a21ff06f | C++ | danieleRocha/VolumesFinitos | /Problemas/Problema.cpp | ISO-8859-1 | 1,810 | 2.84375 | 3 | [] | no_license | #include "Problema.h"
Problema::~Problema(void)
{
}
void Problema::DefinirArquivo()
{
arquivo = ofstream("resultado.txt");
}
void Problema::ImprimirMensagemDeErro(int numeroDoErro)
{
switch(numeroDoErro)
{
case 1:
arquivo<<"Erro: \n"
"No foi possvel calcular a varivel independente: espao.\n\n";
cout<<"Er... | true |
033fdec51b0685f65601f9cf7d2f7f205f20df0a | C++ | umbesere/num_sim_lab | /LSN_2/es02_2.cpp | UTF-8 | 3,376 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <vector>
#include <cstdlib>
#include <numeric>
#include "random.h"
#include "random_walk.h"
using namespace std;
// error function to calculate standard deviation from mean and mean squared
double error(double ave, double av2, int n){
... | true |
941b4a8a86f06b2910904f9776e57bfe5c2118ce | C++ | Trigger2000/Computational-mathematics | /lab7/main.cpp | UTF-8 | 2,826 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <fstream>
#include <vector>
#include <functional>
#define STEP 0.001
struct point
{
double x = 0.0;
double y = 0.0;
double y1 = 0.0;
};
std::vector<point> solve(double b, std::function<double(double)> func);
std::vector<point> solve_with_rk3(double alpha, std... | true |
f96d0f0a72b6c6af74d37162400bb4fb476c5bc9 | C++ | mymichellle/Collage-Builder | /Utility.h | UTF-8 | 3,734 | 2.765625 | 3 | [] | no_license | //
// Utility.h
// Collage
//
// Created by Michelle Alexander on 10/02/11.
// Copyright 2011 ??? . All rights reserved.
//
#ifndef Utility_h
#define Utility_h
#include <GL/glut.h>
#include <string>
using namespace std;
#define WINDOW_WIDTH 800
#define WINDOW_HEIGHT 700
#define DISPLAY_FONT GLUT_BITMAP... | true |
684a6e90c5ed17cc4cf1c47227cf3dbc0be599df | C++ | yvson18/Roteiro_3 | /questao_1/Imoveis.cpp | UTF-8 | 409 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include "Imoveis.h"
Imoveis::Imoveis(std::string titulo,double valor,std::string disponibilidade){
this->titulo = titulo;
this->valor = valor;
this->disponibilidade = disponibilidade;
}
void Imoveis::exibir(){
std::cout << "Titulo: " << titulo << "\n"
<< "Valor: "... | true |
542261d7c708496ca681ffa396f4a7de58d718c4 | C++ | HristoHristov95/C-- | /481-str C++/481-str C++/Source1.cpp | UTF-8 | 1,509 | 3.25 | 3 | [] | no_license | #include<iostream>
#include<list>
#include<cstring>
using namespace std;
class Project{
public:
char name[40];
int days_to_completion;
Project(){
strcpy(name, "");
days_to_completion = 0;
}
Project(char *n, int d){
strcpy(name, n);
days_to_completion = d;
}
void add_days(int i){
days_to_completion += i... | true |
bac441ab18f7f28753ff0c1e12354beb9b201c68 | C++ | JinyuChata/leetcode_cpp | /leetcode/editor/cn/_l_c_pf01guess-numbers.cpp | UTF-8 | 1,072 | 3.15625 | 3 | [] | no_license | //小A 和 小B 在玩猜数字。小B 每次从 1, 2, 3 中随机选择一个,小A 每次也从 1, 2, 3 中选择一个猜。他们一共进行三次这个游戏,请返回 小
//A 猜对了几次?
//
// 输入的guess数组为 小A 每次的猜测,answer数组为 小B 每次的选择。guess和answer的长度都等于3。
//
//
//
// 示例 1:
//
//
//输入:guess = [1,2,3], answer = [1,2,3]
//输出:3
//解释:小A 每次都猜对了。
//
// 示例 2:
//
//
//输入:guess = [2,2,3], answer = [3,2,1]
//输出:1
//解... | true |
806fa3437b415aaaff7cf12f0279d7f0726cc378 | C++ | im-13/computer-vision | /02_EdgesAndLinesDetection/h4/h4.cpp | UTF-8 | 4,663 | 2.984375 | 3 | [] | no_license | /******************************************************************************************
Title : h4.cpp
Author : Ilona Michalowska
Created on : October 20, 2015
Description : The program finds lines in the image from its Hough Transform space using
a given threshold and... | true |
02daa645e28d6639fdc2d82fe6b12c45f60fe745 | C++ | ShepherdQR/programming | /codes/openglstudying/openglCollections/Basic/opengl0002qr/gl002blankwindow.cpp | UTF-8 | 4,200 | 2.984375 | 3 | [] | no_license |
// https://learnopengl-cn.github.io/
// /usr/include/GL/freeglut_std.h文件查看opengl version 4.13 . but is wrong. should be 4.2
// ln -s /usr/include /usr/x/y/z/x.h (假设缺少的头文件路径 /usr/x/y/z/,根据实际情况操作)
// extern "C"{
// #include <glad/glad.h>
// #include <GLFW/glfw3.h>
// }
#include <glad/glad.h>
#include <GLF... | true |
8c25d80bb7e128dd1ece7e0a5c7373919ab162e9 | C++ | zimw/coding-challenge | /q2/find-pair-bonus.cpp | UTF-8 | 2,039 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
int main(int argc, char **argv)
{
if (argc != 3)
return -1;
string fileName(argv[1]);
string nums(argv[2]);
int credits = stoi(nums);
//cout<< fileName<<" "<< credits<<endl;
ifstream infile(f... | true |
d3db7f16cb20b8e764e80a12297586f9186467c2 | C++ | germandiagogomez/the-cpp-abstraction-penalty | /benchmarks/skip-01-sieve/ranges_sieve.cpp | UTF-8 | 2,398 | 3.03125 | 3 | [
"MIT"
] | permissive | #include <algorithm>
#include <string>
#include <bitset>
#include <vector>
#include <chrono>
#include <iostream>
#include <tuple>
#include "range/v3/view/iota.hpp"
#include "range/v3/view/stride.hpp"
#include "range/v3/view/filter.hpp"
#include "range/v3/view/take.hpp"
#include "range/v3/algorithm/for_each.hpp"
#includ... | true |
7b990fb1a06064701578aac39aac2c942bc2e869 | C++ | shubham-shinde/code_library | /Check bipartite (by coloring)/main.cpp | UTF-8 | 1,721 | 2.75 | 3 | [
"Unlicense"
] | permissive | #include <bits/stdc++.h>
#define N 2010
#define endl '\n'
using namespace std;
vector <vector <int> >G(N);
int color[N];
bool checkbipartite(int s)
{
queue <int>q;
q.push(s);
color[s]=1;
while(!q.empty())
{
int u=q.front();
//cout<<u<<" "<<color[u]<<endl;
q.p... | true |
b93915fdf3fbf2a49048a5734f921a9ccee5e754 | C++ | Boussau/Genqual | /HDPP/SiteLikes.h | UTF-8 | 1,306 | 2.53125 | 3 | [] | no_license | #ifndef SiteLikes_H
#define SiteLikes_H
class Parm;
class SiteModels;
class SiteInfo {
public:
SiteInfo(void);
int getActiveState(void) { return activeLike; }
double getActiveLike(void) { return like[activeLike]; }
double getLike(int i) { return like[i]; }
... | true |