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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
445fdfd142c0d9d7cb9a2c6a81410a812bb2e8f6 | C++ | ryszard-raby/IoT | /Arduino/Firebase/src/main.cpp | UTF-8 | 2,932 | 2.5625 | 3 | [] | no_license | #if defined(ESP32)
#include <WiFi.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#endif
#include <Arduino.h>
#include <FirebaseService.h>
#include <DateTime.h>
#include <time.h>
#include <cstdlib>
#include <iostream>
#include <Timer.h>
#include <C:/Users/ryszard.raby/OneDrive/auth/auth.h>
uint8_t builtInLed = 2;... | true |
8286c4f74489bacce03b9d287c40521160ae726d | C++ | KadirIsk/Snake | /Snake/Ssnake.cpp | UTF-8 | 2,684 | 3.046875 | 3 | [] | no_license | #include "Ssnake.h"
Ssnake::Ssnake(int x = 0, int y = 0)
{
this->gameIsOver = new bool(false);
Block block(x, y);
listOfBlock.push_back(block);
block = Block(x, y + 1);
listOfBlock.push_back(block);
}
Ssnake::Ssnake(deque<Block> listOfBlock) {
this->gameIsOver = new bool(false);
this->listOfBlock = listOfBlo... | true |
484f6cdf4e519ad266087eba6b053013c139708a | C++ | hitrich/Autonomous_Car_Lane_Det | /LaneDetector/Raw.cpp | UTF-8 | 1,273 | 2.8125 | 3 | [
"MIT"
] | permissive | //
// Created by crypton on 01.06.2021.
//
void TimeAnalyze::Start(){
if(debug){
clk_start = clock();
}
}
void TimeAnalyze::Stop(){
if(debug){
clk_duration = clock() - clk_start;
clk_total += clk_duration;
if( clk_maxtime < clk_duration )
clk_maxtime = clk_du... | true |
53cde9ff7802e8108eb93571877c07a6ce7c9131 | C++ | tayaharshuk/HW3 | /Backup/UniqueArray.h | UTF-8 | 1,403 | 2.90625 | 3 | [] | no_license | #ifndef MTMPARKINGLOT_UNIQUEARRAY_H
#define MTMPARKINGLOT_UNIQUEARRAY_H
#include <cstdio>
#include <functional>
#include "UniqueArrayExceptions.h"
template <class Element, class Compare = std::equal_to<Element>>
class UniqueArray {
unsigned int size;
Element** arr;
int next;
const Compare compare;
p... | true |
240a041d98b9a39a497481c626642ca244685bbd | C++ | aksrit/Covid-19-Market-Scheduler | /Code.cpp | UTF-8 | 3,611 | 3 | 3 | [] | no_license | #include <iostream>
#include <vector>
#define pb push_back
#define ll long long int
#define fi first
#define se second
#define vi std::vector<int>
#define vl vector<ll>
#define vd vector<long double>
#define vvd vector<vector<long double> >
#define vvi std::vector<vi>
#define pii pair<int,int>
#define pll pair<ll,ll>
u... | true |
a41aad07b05ad6ba804a54ae732570f2a454673c | C++ | sumanthkv-bmsce/ADA | /longPalin.cpp | UTF-8 | 703 | 2.796875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int t[100][100];
int longPalin(string s1,string s2,int n,int m) {
for(int i=0;i<n+1;i++) {
t[i][0] = 0;
}
for(int i=0;i<m+1;i++) {
t[0][i] = 0;
}
for(int i=1;i<n+1;i++) {
for(int j=1;j<m+1;j++) {
if(s1[i]==s2[j]) {... | true |
e9e9705a7e4b1e7acca51e159ed4ec399b31875f | C++ | Happy-Ferret/WikiAdventure | /WikiAdventure/Source/WA-SDL/SDLDebugQueueList.cpp | UTF-8 | 887 | 2.53125 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive |
#include "SDLDebugQueueList.h"
CSDLDebugQueueList::CSDLDebugQueueList(): CSDLSizedQueueList( 300 )
{
//DebugInfo( "CSDLBaseObject", "CSDLBaseObject", "Info", "Creating base SDL object.", FILE_INFO );
m_iPosX = 5;
m_iPosY = 5;
m_iAlpha = 150;
m_iCountdownTime = 0;
m_iTimeThreshold = 2000; // 1000 miliseconds = 1... | true |
8ec52e7f9043a65658b5d2c9e2c5a2c53ae3dbb1 | C++ | du-dung/algorithm | /BOJ_17406_배열돌리기4_200206.cpp | UTF-8 | 2,706 | 3.609375 | 4 | [] | no_license | /* 17406. 배열 돌리기 4 Gold 5
https://www.acmicpc.net/problem/17406
- 가능한 회전 연산 실행 순서를 모두 실행하며 최솟값 갱신하기
-> 연산 수행 순서에 따라 배열의 모양이 다르다
*/
#include <iostream>
#include <tuple>
#include <vector>
#include <climits>
using namespace std;
int N, M, K;
vector<tuple<int, int, int>> turnOp;
int answer = INT_MAX;
vector<vector<int... | true |
4aa2ed20a99a0561d66274711757fea25ee48bd9 | C++ | mirmik/malgo | /malgo/matrix.h | UTF-8 | 13,055 | 2.71875 | 3 | [] | no_license | #ifndef MALGO_MATRIX_H
#define MALGO_MATRIX_H
#include <malgo/util.h>
#include <malgo/vector.h>
#include <malgo/algo/multiply.h>
#include <malgo/algo/inverse.h>
#include <malgo/raw/basealgo.h>
#include <nos/trace.h>
#include <linalg/linalg.h>
namespace malgo
{
template <class M> struct matrix_iterator1;
template ... | true |
1256acb65565a97acbccc78ad6b13bd7e5c327af | C++ | xianghuade/Challenge_Programming_Contest_2nd_Edition | /chapter_02/sub2.3/lisequence.cpp | UTF-8 | 432 | 2.84375 | 3 | [] | no_license | //最长上升子序列
#include <iostream>
#include <algorithm>
using namespace std;
const int MAX_N = 1000;
int n;
int num[MAX_N + 1];
int dp[MAX_N + 1];
int main(){
int res = 0;
cin >> n;
for(int i=0; i<n; i++)
cin >> num[i];
for(int i=0; i<n; i++){
dp[i] = 1;
for(int j=0; j<i; j++){
if(num[j] < num[i]){
dp[i]... | true |
f13b59654e9f39d46cb97613b4fb0120e8416b15 | C++ | josesaldanavi/upn_funAlg | /Fundamentos de programaciòn/Semana5.cpp | ISO-8859-1 | 669 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n1,n2,opc;
int op=1;
char opc1;
while(op>0)
{
cout<<"Ingrese el primer nmero : ";
cin>>n1;
cout<<"Ingrese el nmero de desplazamiento: ";
cin>>n2;
cout<<"Ingrese que tipo de desplazamiento desea en numeros indicados:"<<endl;
cout<<"1)<<(izquier... | true |
6c1ef320d2304c71fb07f56114425c491a422190 | C++ | niyaznigmatullin/nncontests | /utils/IdeaProject/archive/unsorted/2015.01/2015.01.16 - SNWS 2015 Round 2/g.cpp | UTF-8 | 752 | 2.796875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
template<typename T> void printerr(T a) {
auto i = begin(a);
auto j = end(a);
cerr << "[";
while (i != j) {
cerr << *i << ", ";
i++;
}
cerr << "]";
cerr << endl;
}
ostream_iterator<int> debug(cerr, ", ");
int b[123213];
int mai... | true |
35b74a696629babce316e83c3f9c7c3dad5cd3f3 | C++ | LeTobi/tobilib | /database/tools/basetransfer.cpp | UTF-8 | 4,186 | 2.59375 | 3 | [] | no_license | #define TC_DATABASE_INTERN
#include "../database.h"
#include <iostream>
#include <cmath>
using namespace tobilib;
using namespace database_detail;
Database sourcedb;
Database targetdb;
void transfer_data(Member src, Member tgt)
{
if (src.memtype.blockType != tgt.memtype.blockType)
return;
if (src.mem... | true |
bdda6022a87e9ee182e300cb92a5930f082320a7 | C++ | kbrauss/FMM2D | /src/Box.cc | UTF-8 | 27,950 | 3.265625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | /** Box.cc
*
* Created on: Jun 21, 2016
* Author: Keith D Brauss
*/
#include <complex>
#include <vector>
#include <iostream>
#include <string>
#include "Box.h"
#include "Util.h"
using namespace std;
/**
* The Problem Type
*
* We want to apply the FMM to a problem that has the following properties
* - ... | true |
3923ad1c70eccbb76b105cd4354c30c6e71ec06d | C++ | alphamale327/Arduino | /SmartHome/security_camera_project/Security_Camera_Sleep140515/SleepMode_UNO/SleepMode_UNO.ino | UTF-8 | 4,266 | 2.75 | 3 | [] | no_license | #include <avr/sleep.h> // powerdown library
#include <avr/interrupt.h> // interrupts library
#include <Adafruit_VC0706.h> // camera library
#include <SoftwareSerial.h> // camera serial change
// On Uno: camera TX connected to pin 6, camera RX to pin 8:
SoftwareSerial cameraconnection = SoftwareSerial(6, 8);
Ada... | true |
8c9e80e214f8382e4c8818949bc3b3e6163d57f3 | C++ | timi-liuliang/echo | /thirdparty/google/ruy/ruy/blocking_counter.h | UTF-8 | 2,447 | 2.71875 | 3 | [
"MIT"
] | permissive | /* Copyright 2019 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | true |
f4b3904990e12828ae7dfa7bed2327a7e4e55c59 | C++ | mkrum/neuralnet | /c++/neuron.cpp | UTF-8 | 1,243 | 3.015625 | 3 | [] | no_license | //Neuron Class Implemention
// mkrum
#include "Neuron.h"
//default activation functions
double sigmoid(double);
double sigmoidDer(double);
Neuron::Neuron(int size){
std::random_device r;
std::default_random_engine gen(r());
std::uniform_real_distribution<double> dist(0, 1);
for(int i = 0; i < size; i+... | true |
9e4ebfa8e14d8f3b898a56cc02bb44e0ab77be8b | C++ | AmaranthYan/RayMarching | /Light2D/source/Shader.h | UTF-8 | 1,166 | 2.65625 | 3 | [] | no_license | #pragma once
#include <glad/glad.h>
#include <iostream>
#define MAX_SHADER_SIZE 16384 // single shader file cannot exceed 16 kb
class Shader
{
public:
Shader(const char *vertex_file, const char *fragment_file);
Shader(const char *compute_file);
// remove copy constructor/assignment
Shader(const Shader &) = delete... | true |
129c860b2e35a0f66c7957ae2d8540eb82297d2d | C++ | GBelzoni/workspace | /CppRate_Curve_tests/Tests/LinearZeroesInnerCurve_test.cpp | UTF-8 | 2,194 | 2.65625 | 3 | [] | no_license | /*
* LinearZeroesInnerCurve_test.cpp
*
* Created on: Jun 5, 2013
* Author: phcostello
*/
#include "LinearZeroesInnerCurve.h"
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include "InstrumentDF.h"
#include <vector>
//#include "BaseInnerCurve.h"
using namespace std;
BOOST_AUTO_TEST_SUIT... | true |
9fde523f8d5ffc289b89a0d1a4d69b977e7e05c2 | C++ | GyosunShin/ProblemSolving | /백준 유형별 문제풀이/이분탐색/2805나무 자르기(3rd).cpp | UHC | 938 | 2.890625 | 3 | [] | no_license | // M ؼ ܱ ִ ִ ϴ α ۼϽÿ.
// (1 N( ) 1,000,000, 1 M( ) 2,000,000,000)
#include <cstdio>
#include <algorithm>
using namespace std;
int N, M;
int pan[1000000];
int mmax = -1;
int ans;
bool check(int input){
long long tmp_cnt = 0;
for(int i = 0 ; i < N ; ++i){
int tmp = pan[i] - input;
if(tmp < 0) co... | true |
34459c1a9f75590d91bb9225664c87f6ddf4613c | C++ | redfox5557/Replit-Stuff | /Weekly-Challenges/Week 1/Week1-C++.cpp | UTF-8 | 1,276 | 3.859375 | 4 | [] | no_license | #include <iostream>
int main()
{
int square = 0;
int squareRoot = 2;
int beforeSquareRoot = squareRoot;
int previousNum = 1;
std::cout << "Enter a number(preferably a perfect square): ";
std::cin >> square;
if (square == 0 || square == 1)
{
std::cout << "Your number inputted is " << square << " ,... | true |
5b1860378053e89be02a4d26e5a3b4cd3d987820 | C++ | prestonf136/Steem | /STEEM/src/library/VertexBuffer/VertexBuffer.hpp | UTF-8 | 462 | 2.6875 | 3 | [] | no_license | #pragma once
#include <glad/glad.h>
#include "../steem_macros.hpp"
namespace Steem {
struct VertexBufferInfo
{
GLuint size;
GLfloat *VertexArray;
};
}
namespace Steem {
class VertexBuffer
{
private:
GLuint m_BufferID;
public:
VertexBuffer(Steem::VertexBufferInfo info);
~VertexBuffer();
inlin... | true |
c24ae0b82b3e2dc095b5b67c0fbf17c0c3979669 | C++ | QinHaoChen97/VS_C | /DFS/51.n-皇后.cpp | UTF-8 | 2,734 | 3.015625 | 3 | [] | no_license | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include "commoncppproblem51.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=51 lang=cpp
*
* [51] N 皇后
*/
// @lc code=start
#include<iostream>
#include<vector>
using namespace std;
//皇后可以走横竖斜三个方向
class Solution ... | true |
1ee27f5904f7d2712489f87a18504c1759e120a8 | C++ | SenorGato/script_bot | /include/string_util.hpp | UTF-8 | 1,863 | 3.40625 | 3 | [
"MIT"
] | permissive | #ifndef LIPH_STRING_UTIL_HPP
#define LIPH_STRING_UTIL_HPP
#include <cctype>
#include <cstddef>
#include <string>
#include <string_view>
// yes, overloading operators for std::string and std::string_view combinations is not allowed, but
// i don't care
template<typename Char, typename Traits, typename Alloc>
std::basi... | true |
b5633dc1b94a5a0266b6efc793698d829e34fcab | C++ | Scronty/bitcoin-sv | /src/test/threadpool_tests.cpp | UTF-8 | 3,979 | 2.78125 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2018 The Bitcoin SV developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/test/unit_test.hpp>
#include <threadpool.h>
#include <atomic>
#include <iostream>
#include <task.h>
#include <task_... | true |
dea8d59649abafd9bd6672c7f36c0aa13c250e26 | C++ | jtrfid/C-Program | /2019/2019上机/备选题目/57 Fibonacci数列 函数与递归 ok/Fibonacii.cpp | GB18030 | 1,107 | 3.859375 | 4 | [] | no_license | /*****************************************************************
43
Fibonacci
ʱ: 2
ڴ: 10000MB
һʽFibonacciж£
F(0)=7
F(1)=11
F(n)=F(n-1)+F(n-2)n>=2
nֵжF(n)Ƿܱ3
˵
ݣݵһΪt(t<100)ʾΪtУÿһn0<=n<=100
˵
ÿݣF(n)ܱ3yesno
3
1
2
3
no
yes
no
ʾϢ
************************************************... | true |
950feb75057b3db637f58603278ca0bf9bab4899 | C++ | DavutK/SEP2 | /Milestone 3/Se2PM2/Hal.cpp | UTF-8 | 3,404 | 2.546875 | 3 | [] | no_license | /*
* Ampeln.cpp
*
* Created on: 15.04.2013
* Author: Davut
*/
#include "Hal.h"
Mutex* Hal::halMutex = new Mutex();
Hal* Hal::instance = NULL;
Hal::Hal() {
halMutex->lock();
// Initialisierung der Digitalen IO Karte
out8(DIO_BASE + DIO_OFFS_CTRL, 0x8A);
out8(DIO_BASE + DIO_OFFS_A, 0x00);
out8(DIO_BAS... | true |
f3c7566b7596af3b6145b75fdf794e4b77fe5aa4 | C++ | 1816013/guratan | /myGame/Classes/obj/Player.h | SHIFT_JIS | 2,163 | 2.640625 | 3 | [] | no_license | #pragma once
#include"Obj.h"
enum class Ability
{
PowerUp,
SpeedUp,
Heal,
ChargeLevel,
ChargeSpeed,
MAX
};
enum class PlayerAct
{
IDLE,
MOVE,
ATTACK,
CHARGE,
MAX
};
enum class ChargeType
{
SHOT,
TWISTER,
FLONTAL,
MAX
};
using AbilityPair = std::pair<std::string, Ability>; //O, AreB
class Player : pu... | true |
257b79f96bc17c8c19075ba2c34c4f9551b8527c | C++ | HyangRim/Algorithm_Back | /2485.cpp | UTF-8 | 687 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int arr[100001];
int art[100001];
int gcd(int a, int b) {
return b ? gcd(b, a%b) : a;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int N;
cin >> N;
for (int x = 0; x < N; x++) {
cin >> arr[x];
}
for (int x = 1; x < N; ... | true |
3c7f3696fea7325cfcb0a6953291c77809f305e2 | C++ | mzhg/opengl_study | /ant_vr_sdk/geometry3d.h | UTF-8 | 1,873 | 3.453125 | 3 | [] | no_license | #pragma once
#include <glm.hpp>
namespace jet
{
namespace util
{
/**
* <code>Plane</code> defines a plane where Normal dot (x,y,z) = Constant.
* This provides methods for calculating a "distance" of a point from this
* plane. The distance is pseudo due to the fact that it can be negative if the
* point is ... | true |
e0fe1d18a2c9a084f1038856e94c79c05bebb3dc | C++ | rajputsher/CPP_CriticalSkills | /7_MultidimensionalArrays/Arrays/MultidimensionalArrays.cpp | UTF-8 | 2,281 | 3.5625 | 4 | [] | no_license | #include<iostream>
using namespace std;
int mainA1() {
double grades[7][6] = {0};
// Danny Grades
grades[0][0] = 50, grades[0][1] = 33, grades[0][2] = 40, grades[0][3] = 30;
// Joe Grades
grades[1][0] = 35, grades[1][1] = 50, grades[1][2] = 40, grades[1][3] = 30;
// And so on
// Juli Grades
grades[6][0] =... | true |
a7223c0f8ee95443359e514ce1eef7d1c70510b8 | C++ | gusenov/examples-cpp | /crtp/example-5/Overriding.h | UTF-8 | 334 | 2.671875 | 3 | [
"MIT"
] | permissive | #ifndef OVERRIDING_H
#define OVERRIDING_H
#include "Base.h"
#include <iostream>
struct Overriding: Base<Overriding>
{
void f() { std::cout << "Special case" << std::endl; }
// This method must exists to prevent endless recursion in Base::f
void pure() { std::cout << "pure() from Overriding" << std::endl;... | true |
4f1ce14a2879fceb8388cfbba44adb20a22e431c | C++ | nishantprajapati123/Computer-Graphics-Lab | /openGL with freeGLUT/Bresenham.cpp | UTF-8 | 3,005 | 2.953125 | 3 | [] | no_license | #if 0
#include <Windows.h>
#include <iostream>
#include <GL\glew.h>
#include <GL\freeglut.h>
#include <cmath>
#define PI 3.14159265358979324
using namespace std;
int x1, y1, x2, y2;
void draw_pixel(int x, int y) {
glBegin(GL_POINTS);
glVertex2i(x, y);
glEnd();
}
// Drawing (display) routine.
void drawScene(void)
{
... | true |
0623c9975f40653d778f4792674c0a11aa3cdac5 | C++ | Byeong-Chan/ByeongChan_PS_Note | /C:C++/2055.cpp | UTF-8 | 590 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
int gcd(int a, int b) {
if (a % b == 0) return b;
else return gcd(b, a%b);
}
long long comb3(long long a) {
long long tmp = (a*(a - 1)*(a - 2));
return tmp / 6;
}
int main() {
int i, j;
int n, m;
int x, y;
int tmp;
long long ans;
long long k;
long long all;
scanf("%d %d", &n, &m);
all = ... | true |
4e14cc1e4d5bc9bb6d43d753698a89a904073192 | C++ | SahilMadan/chip8_emu | /system/char_sprite_map.cc | UTF-8 | 4,147 | 2.546875 | 3 | [] | no_license | #include "char_sprite_map.h"
#include <stdexcept>
#include <string>
namespace chip8_emu {
namespace system {
namespace char_sprite_map {
void InitCharSpriteInMemory(Memory* memory) {
int memory_addr = 0;
// Sprite 0
memory->WriteByte(memory_addr++, 0xF0);
memory->WriteByte(memory_addr++, 0x90);
memory->Wr... | true |
1c3d68e57f4c1aee38f71b169bddaf2deb065c20 | C++ | csobaistvan/OpenLensFlare | /LensPlanner/src/GhostSerializer.cpp | UTF-8 | 8,274 | 2.734375 | 3 | [] | no_license | #include "GhostSerializer.h"
////////////////////////////////////////////////////////////////////////////////
GhostSerializer::GhostSerializer(QIODevice* io, QMap<float, OLEF::GhostList>* ghosts):
m_ioDevice(io),
m_ghosts(ghosts)
{}
/////////////////////////////////////////////////////////////////////////////... | true |
81598e7a80b5bae046e671a776c9dd9a94fd160b | C++ | eikofee/projetALcpp | /projetALcpp/src/Maths/Color.cpp | UTF-8 | 160 | 2.578125 | 3 | [] | no_license | #include <Maths/Color.hpp>
Color::Color(short red, short green, short blue, short alpha) {
r = red;
g = green;
b = blue;
a = alpha;
}
Color::~Color() {
} | true |
895391a19fd6d5d77ef6cf28e50a6b534caa51be | C++ | LuisSilva96/proximity_detector | /Qt Graphics/player.cpp | UTF-8 | 7,369 | 2.6875 | 3 | [] | no_license | # include "player.h"
Player::Player()
{
player.load(":/simulation/sprites/circulito.png");
sensor[0][0].load(":/simulation/sprites/UP3.png");
sensor[0][1].load(":/simulation/sprites/UP2.png");
sensor[0][2].load(":/simulation/sprites/UP.png");
sensor[1][0].load(":/simulation/sprites/DOWN3.png");
sensor[1][1... | true |
34bed902df2d088771fc79c45cb3723ded62bdd0 | C++ | ak672676/BinaryTree-Graph-Implementation | /BST.cpp | UTF-8 | 2,564 | 3.5 | 4 | [] | no_license | #include<iostream>
#include<queue>
using namespace std;
struct node{
int data;
node *l,*r;
node(int data){
this->data=data;
l=NULL;
r=NULL;
}
};
node *root;
static int i=0;
node* insert(node *p,int x){
node *q=p;
if(p==NULL){
node *new1=new node(x);
new1->data=x;
new1->l=NULL;
... | true |
bf2edd6308364b1bdf8243669dd9dbac8f96b34d | C++ | Miserlou/RJModules | /src/DelayA.h | UTF-8 | 6,727 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef STK_DELAYA_H
#define STK_DELAYA_H
#include "Filter.h"
namespace stk {
/***************************************************/
/*! \class DelayA
\brief STK allpass interpolating delay line class.
This class implements a fractional-length digital delay-line using
a first-order allpass filter. If th... | true |
141eb18e0b87626c81a8632e045cc79ab73ac42a | C++ | trungvdhp/master-ntou | /Test/13/330.cpp | UTF-8 | 418 | 2.5625 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
char check[256];
int main()
{
char a[256];
char b[256];
gets(a);
gets(b);
int n=strlen(a);
int m=strlen(b);
if(n!=m)
printf("no");
else
{
for(int i=0;i<n;i++)
{
check[a[i]]++;
check[b[i]]++;
}
for(int i=0;i<n;i++)
{
if(check[a[i]... | true |
39c25dc672bafa6b33e08117c7b0d18005690afb | C++ | wangruici/pat_doing | /pat_a1052/pat_a1052_0.cpp | UTF-8 | 1,065 | 3.140625 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
using std::sort;
const int maxn=100010;
struct Node {
int address;
int data;
int next;
bool flag;
}node[maxn];
bool cmp(Node a,Node b){
if(a.flag==false||b.flag==false)
return a.flag>b.flag;
else{
return a.data<b.data;
}
}
int main(){
int begin_... | true |
a80b8cd373704b04221f294d89b64630f86e7514 | C++ | il1ya/Algorithm | /1.Grokking_algorithms/Quicksort/LoopSum.cpp | UTF-8 | 348 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <vector>
// суммирует все числа и возвращает сумму.
int sum(std::vector<int> arr){
int total = 0;
for(int x = 0; x < arr.size(); x++){
total += arr[x];
}
return total;
}
int main()
{
std::vector<int> arr {1,2,3,4};
std::cout << sum(arr);
return 0;
} | true |
e5e35b32afaeee771111ad1d2a6fdb715427f4c0 | C++ | LaureenL/rm_game | /Text_Based_Interactive_Game/Text.cpp | UTF-8 | 1,495 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include "Text.h"
#include <sstream>
#include "Globals.h"
int wrap (std::string* text)
{
char c = 0;
unsigned int width = 78;
unsigned int n = 0;
unsigned int i = 0;
unsigned int r = 0;
unsigned int rStart[M_ROW];
for (i = 0; i < M_ROW; i++) {
rStart[i] = 0;... | true |
9a60ee37bf1a1c72560e8ffea2d063defb0191a2 | C++ | ccion/design_pattern | /design_pattern/B_composite_pattern/composite_pattern.h | UTF-8 | 3,317 | 3.640625 | 4 | [] | no_license | /*****************************************************************************
* 文件名: composite_pattern.h
*
* @功能描述:组合模式,又叫整体模式,是用于把一组相似的对象当做一个单一的对象,组合模式依据
树形结构来组合,用来表示部分以及整体层次
*
* @意图:
将对象组合合成树形结构以表示"部分-整体"的层次结构,组合模式使得用户对单个对象和组合对象
的使用具有一致性
* @主要解决:
它在我们树型结构的问题中,模糊了简单元素和复杂元素的概念,客户程序可以像处理简单元素一... | true |
9d3f3e6f5f703c0a949b94e54b1fbf8217dff483 | C++ | yotam-medini/cj | /2020/ks-round-H/rugby.cc | UTF-8 | 6,907 | 2.6875 | 3 | [] | no_license | // CodeJam
// Author: Yotam Medini yotam.medini@gmail.com --
#include <algorithm>
#include <fstream>
#include <iostream>
#include <array>
#include <string>
#include <utility>
#include <vector>
#include <cstdlib>
using namespace std;
typedef unsigned u_t;
typedef unsigned long ul_t;
typedef unsigned long ul_t;
typ... | true |
a60afaf479eebe3be7ca925594272addcd42ec4b | C++ | cypress777/dltrace_cyp | /utils/funcmsg.hpp | UTF-8 | 1,726 | 2.59375 | 3 | [] | no_license | #ifndef _DLTRACE_FUNCMSG_H_
#define _DLTRACE_FUNCMSG_H_
#include <string>
#include <unordered_map>
#include "breakpoint.hpp"
namespace dltrace {
class FuncMsgIndexHash;
class FuncMsgIndex {
friend class FuncMsgIndexHash;
private:
unsigned long m_addr;
std::string m_funcName;
... | true |
d403a490a13a6792c204bb5d3de5d7a4f635d32b | C++ | jpoirier/x-gauges | /Nesis/Common/Geometry/Line2D.h | UTF-8 | 8,785 | 3.046875 | 3 | [] | no_license | #pragma once
#ifndef __GEOMETRY_LINE2D_H
#define __GEOMETRY_LINE2D_H
/***************************************************************************
* *
* Copyright (C) 2006 by Kanardia d.o.o. [see www.kanardia.eu] *
* Writen by: ... | true |
e80718d0e529c93e3af39af58f80f89fd7da40cc | C++ | claq2/adventofcode2018 | /AdventOfCode2018/MsUnitTest/Day07Tests.cpp | UTF-8 | 1,564 | 2.71875 | 3 | [] | no_license | #include "stdafx.h"
#include "CppUnitTest.h"
#include "../AdventOfCode2018Lib/Day07/Day07.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace std;
namespace MsUnitTest
{
TEST_CLASS(Day07Tests)
{
public:
TEST_METHOD(ReadInput)
{
Day07 day7;
vector<string> coords(day7.ReadI... | true |
b92174c34ef01a322df82d5dd4557ca252dd8998 | C++ | RizkiAlhamid/Composer-List-Database- | /LinkedList.h | UTF-8 | 5,562 | 3.984375 | 4 | [] | no_license | #ifndef LinkedList_h
#define LinkedList_h
#include <stdio.h>
#include <iostream>
#include "Node.h"
using namespace std;
template <class T>
class LinkedList{
private:
Node<T>* first;
Node<T>* last;
public:
LinkedList();
~LinkedList();
void printList() const;
void append(const T data);
void ... | true |
580fecb9b6acd8114d69289dbda821e00d3609f7 | C++ | GCZhang/Profugus | /packages/Utils/utils/Vector_Lite.hh | UTF-8 | 6,551 | 2.96875 | 3 | [
"BSD-2-Clause"
] | permissive | //----------------------------------*-C++-*----------------------------------//
/*!
* \file Utils/utils/Vector_Lite.hh
* \author Derived from Rob Lowrie's Vector_Lite (LANL)
* \date Thu Jan 3 11:39:29 2008
* \brief Vector_Lite class definition.
* \note Copyright (C) 2008 Oak Ridge National Laboratory, UT-B... | true |
4d037dd70832fa69e9e256f97828c623d9d84b37 | C++ | matthiasholl/R3BRoot | /r3bdata/pspData/R3BPspxPrecalData.h | UTF-8 | 1,456 | 2.703125 | 3 | [] | no_license | #ifndef R3BPSPXPRECALDATA_H
#define R3BPSPXPRECALDATA_H
#include "TObject.h"
/**
* Class containing PSPX detector data on Precal level.
* Originally, this class was introduced for the analysis of jun16, but it should also work for later experiments.
* @author Ina Syndikus
* @since March 2017
*/
class R3BPspxPre... | true |
2cbfca580fa4599e96b7a00d555dc7b07082ccec | C++ | rehno-lindeque/Flower-of-Persia | /src/models/roof.h | UTF-8 | 3,763 | 3.09375 | 3 | [
"MIT"
] | permissive | #ifndef __ROOF_H__
#define __ROOF_H__
class Roof : public Model
{
protected:
// Warning: this is actually a reverse cylinder
void extrudeHalfZCylinder(float* position, uint divisions, float* radia, float* heights, uint heightSegments)
{
float a = PI / divisions; // half cylinder
for(uint cz... | true |
c4d04595ec590a37386e70b829ea4e5699d3cf5b | C++ | andyyang200/CP | /Competitive Programming/Contests/USACO/Contests/2016 - 2017/US Open/Bronze/Lost Cow 2/lostcow.cpp | UTF-8 | 587 | 2.75 | 3 | [] | no_license |
#include <iostream>
using namespace std;
int main(void)
{
freopen("lostcow.in", "r", stdin);
freopen("lostcow.out", "w", stdout);
int x;
int y;
cin >> x >> y;
int dis = 0;
int cur = x;
int change = 1;
while (true)
{
int end = x + change;
while (cur < end)
{
cur++;
dis++;
... | true |
acf4c14a9869d1e6dc825bcf816e776b3c501c7f | C++ | henryoier/leetcode | /052_N-QueensII/052_N-QueensII.cpp | UTF-8 | 1,128 | 3.359375 | 3 | [] | no_license | /*************************************************************************
> File Name: 052_N-QueensII.cpp
> Author: Sheng Qin
> Mail: sheng.qin@yale.edu
> Created Time: Fri Sep 2 01:09:08 2016
************************************************************************/
#include<iostream>
using namespace std;
cla... | true |
b59cac534c1c9199a4d698ad85f6e7ab1b104c0c | C++ | AMROZIA-MAZHAR/function_tasks | /function_task4.cpp | UTF-8 | 991 | 3.375 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
string input();
int check(string part_num);
string deliverymethod(string part_num);
int main(){
string part_num=input();
int str_length=check(part_num);
if(str_length==4 || str_length==5){
cout<<"part number contain "<<str_length<<" characters"<<e... | true |
3f47ef4a68b8f3e61456d53dd015cd4feec5a5c8 | C++ | suffisme/CC-Solutions | /Hackerearth/Prime-Interval.cpp | UTF-8 | 481 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
#define ll long long
using namespace std;
bool P[10001];
void SieveOfErasthothenes()
{
int n = 10001;
for(int i=0;i<n;i++)
P[i]=true;
for(int i=2;i*i<n;i++)
{
if(P[i])
{
for(int j=i*i; j<=n; j += i)
P[j] = false;
}
}
P[1]=false;
}
int main()
{
ios::sync_wi... | true |
db65e24271a97d1ff3eaa0239a80f4880d6cf9ed | C++ | bhavinisehgal18/geeksforgeeks | /zeroandone.cpp | UTF-8 | 744 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
void segregate(int arr[], int n)
{
int count = 0;
for (int i = 0; i < n; i++) {
if (arr[i] == 0)
count++;
}
for (int i = 0; i < count; i++)
arr[i] = 0;
for (int i = count; i < n; i++)... | true |
a0df5e07c86b885529e0c8ff5836017d53ba6152 | C++ | dcheng289/Class-Projects | /wxWidgets-Paint-Program/PaintModel.h | UTF-8 | 2,176 | 2.71875 | 3 | [] | no_license | #pragma once
#include <memory>
#include <vector>
#include "Shape.h"
#include "Command.h"
#include <wx/bitmap.h>
#include <stack>
class PaintModel : public std::enable_shared_from_this<PaintModel>
{
public:
PaintModel();
// Draws any shapes in the model to the provided DC (draw context)
void DrawShapes(wxDC& dc, b... | true |
e37400ebbe402d62b8575c70bc272952e9f01177 | C++ | aman-ahluwalia/Spoj-solutions | /FCTRL2.cpp | UTF-8 | 485 | 2.8125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,i,j,arr[200];
cin>>n;
arr[0] = 1;
int m=0;
for(i=1;i<=n;i++)
{
int temp = 0;
for(j=0;j<=m;j++)
{
temp = arr[j] * i + temp;
arr[j] = temp%10;
temp/=10;
}
... | true |
ac9d6fb344793699824cb098b1b356db52f615b2 | C++ | BarArbel/Software-Engineering-Methods | /FinalProject/FinalProject/Source.cpp | UTF-8 | 1,649 | 2.515625 | 3 | [] | no_license | #include "../Common/Border/Border.h"
#include "../Common/Border/DoubleBorder.h"
#include "../Common/Border/NullBorder.h"
#include "../Common/Border/SingleBorder.h"
#include "../Common/EventEngine.h"
#include "../Common/Graphics.h"
#include "../Controls/Button.h"
#include "../Controls/CheckList.h"
#include "../Controls/... | true |
7ad7456a15c8c361556691b9e9da07c691d92f2f | C++ | Chet8n/InterviewPrep | /6.Backtracking 2/Vertical and Horizontal Sums.cpp | UTF-8 | 3,049 | 3.859375 | 4 | [] | no_license | /*
Vertical and Horizontal Sums
Problem Description
Given a matrix B, of size N x M, you are allowed to do at most A special operations on this grid such that there is no vertical or horizontal contiguous subarray that has a sum greater than C.
A special operation involves multiplying any element by -1 i.e. changing ... | true |
45b70016b25a368a9a54cec9ef45e76207df1706 | C++ | TheEgghead27/Lets_Learn_Cpp | /LLCPP_Solutions/LLCPP_013_Solutions/13_Solution_01/main.cpp | UTF-8 | 571 | 3.328125 | 3 | [] | no_license |
#include <iostream>
#include <string>
using namespace std;
enum Flower
{
Poppy,
Daisy,
Rose,
Dandelion,
Daffodil
};
void Flower_Printer(Flower f) {
switch (f) {
case Poppy:
cout << "Poppy" << endl;
break;
case Daisy:
cout << "Daisy" << endl;
break;
case Rose:
cout << "Rose" << endl;
break;
case... | true |
9770c1adb26b25697b0e556fbb676421a8e6bf0a | C++ | PROgram52bc/Elevator | /eleGraphics/testEleGraphics.cpp | UTF-8 | 453 | 2.78125 | 3 | [] | no_license | /*
* testconio.cpp: test program for the conio function set
*/
#include <iostream>
#include "eleGraphics.h"
#include "conio.h"
using namespace std;
using namespace conio;
int main() {
cerr << clrscr() << flush;
for (int i=5; i>1; i--) {
cout << clrscr();
elegraphics::drawFloor(7);
elegraphics::drawElevato... | true |
ce883e54530d6d234623515a3880c0eb5ecab6f9 | C++ | Marukyu/RankCheck | /src/Shared/Utils/Utilities.cpp | UTF-8 | 7,983 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <SFML/Config.hpp>
#include <SFML/System/Time.hpp>
#include <SFML/System/Vector2.hpp>
#include <Shared/Utils/MiscMath.hpp>
#include <Shared/Utils/StrNumCon.hpp>
#include <Shared/Utils/Utilities.hpp>
#include <Shared/Utils/OSDetect.hpp>
#include <Poco/File.h>
#include <Poco/Path.h>
#include <Poco/DirectoryIterat... | true |
b8f5fbd851dfe3469d4b2c7ca7a8352013943849 | C++ | CreativeMachinesLab/softbotEscape | /base/hyperneat/JGTL/include/JGTL_Variant.h | UTF-8 | 8,615 | 2.515625 | 3 | [] | no_license | #ifndef VARIANT_H_INCLUDED
#define VARIANT_H_INCLUDED
#include <iostream>
#include "JGTL_LocatedException.h"
namespace JGTL
{
template <class Type,bool condition, Type Then, Type Else>
struct TYPEIF
{
static const Type RESULT=Then;
};
template <class Type,Type Then, Type Else>
struct TYPEIF<Type,false, Then... | true |
72a0670ea43a1771e7990127a4d784574eed4555 | C++ | SachioKuro/Breakout | /Breakout/Ball.cpp | UTF-8 | 2,605 | 3.046875 | 3 | [] | no_license | #include "Ball.hpp"
#include <algorithm>
#include <iostream>
#include "Game.hpp"
namespace Breakout {
Ball::Ball(Game* game, float size, Color color)
: MovableGameObject(game, game->BoundsW() / 2, game->BoundsH() - 100, color),
engine(dev()), random_alpha(0, 360 * M_PI / 180),
size(size) {}
Ball::Ball(G... | true |
56029a165d15a3e5b7b05cc4899b945688873e3b | C++ | Steenall/morpion3D-C-PlusPlus | /player.cpp | UTF-8 | 1,488 | 3.15625 | 3 | [] | no_license | #include "player.hpp"
#include <string>
#include <iostream>
Player::Player(){
pColor=new Color(Color::BLUE);
pName=new std::string("Player");
}
Player::Player(const std::string name, const Color color){
pName= new std::string(name);
pColor=new Color(color);
pHouse=new short int(0);
short int t... | true |
83a027d75d3709dc63bf5d4f4f27b18f3f46544e | C++ | t9jaje00/Olio-ohjelmointi | /tehtava17/main.cpp | UTF-8 | 375 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> vektori;
for(int i=1; i <= 100; i++) //työnnetäät luvut 1-100 vektoriin
vektori.push_back(i);
for (auto i = vektori.begin(); i != vektori.end(); i++) // tulostetaan vektori alusta loppuun, i:tä osoittimena käyttä... | true |
a50abd12b6a26430689e2e3bfaefc8699feb5a14 | C++ | JiekangHuang/Arduino | /p2_4_1Segment_7_LED/p2_4_1Segment_7_LED/p2_4_1Segment_7_LED.ino | UTF-8 | 1,715 | 2.984375 | 3 | [] | no_license | // Arduino pin: 2,3,4,5,6,7,8
byte seven_seg_digits[10][7] = { { 0,0,0,0,0,0,1 }, // = 0 x
{ 1,0,0,1,1,1,1 }, // = 1 x
{ 0,0,1,0,0,1,0 }, // = 2 x
{ 0,0,0,0,1,1,0 }, // = 3 x
{ 1,0,0,1,1,0,0 }, // = 4 x
{ 0,1,0,0,1,0,0 }, /... | true |
b8bc98b97537575a994d98d23b96b9471b91e6dd | C++ | Zugzwangs/Gomina | /src/gui/graphicshitboxitem.cpp | UTF-8 | 2,297 | 2.5625 | 3 | [] | no_license | /*******************************************************/
//
//
/*******************************************************/
#include "graphicshitboxitem.h"
#include <QPen>
#include <QDebug>
graphicsHitboxItem::graphicsHitboxItem(QGraphicsItem* parent) : QGraphicsRectItem(parent)
{
initialisation();
}
graphicsHitb... | true |
dae9e2ee0f74f5a31facb0128fc1ccf442e3a913 | C++ | DamonAknuh/Bmp2Excel-Image-Converter | /BMP2EXCEL.hpp | UTF-8 | 921 | 2.953125 | 3 | [] | no_license | #ifndef __BMP2EXCEL_HPP__
#define __BMP2EXCEL_HPP__
//SECOND VERSION
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <cstring>
#include "Byte2Int.hpp"
class triplet
{
public:
triplet()
{
first = 0;
second = 0;
third = 0;
}
void make_triple... | true |
227aa4fd1c452f6c121e368ba9675cd6a534561a | C++ | codeAligned/acm-icpc-1 | /archived/2014-NEERC-Northern/G.cc | UTF-8 | 558 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
int w, h;
bool ok(int x1, int y1, int x2, int y2) {
return x2 - x1 >= w && y2 - y1 >= h;
}
int main() {
freopen("grave.in", "r", stdin);
freopen("grave.out", "w", stdout);
int x1, y1, x2, y2, x3, y3, x4, y4;
sca... | true |
e654a1c74fa113f015284669c32a15706b45aad0 | C++ | INTechSenpai/sumobot | /programmation/testPathfindingSimple/pathfinding.cpp | UTF-8 | 6,142 | 2.796875 | 3 | [] | no_license | #include "pathfinding.h"
#include <iostream>
#include <math.h>
Pathfinding::Pathfinding()
{}
Trajectory Pathfinding::computePath(Position start, Position pointIntermediaire, Position goal) {
float xCentre, yCentre, rayonCourbure, distanceParcourue;
Trajectory trajectoire;
xCentre = -1*(
(p... | true |
fb4526d9dd4bd3d6999c7b5bc77870f863ddc80f | C++ | Inyu/CCC-CCryptChat | /CCC-VS/Main.cpp | IBM852 | 770 | 2.625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <conio.h>
#include <time.h>
void output(const char logpath[100]);
struct User {
char name[50];
time_t lastloginTimestamp;
};
typedef struct User User;
int main(void) {
User test;
const char logpath[100] = "testlog.txt";
const char key[100] = "rB880$561k9xs0n6Zk917d59F3R7e30$2L7674F1... | true |
908e6d891c28048d085421e648761bde0edb982f | C++ | BaomingRose/Algorithms | /day7/换肉.cpp | GB18030 | 859 | 2.765625 | 3 | [] | no_license | /*mһǮԹԼ룬
n꣬iҪJ[i]⣬
ȫԻF[i]𣬵Ȼѡijֻһ֣
ܻö*/
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 1000 + 5;
struct node {
int j, f;
double d;
friend bool operator < (node a, node b) {
return a.d > b.d;
}
} dp[maxn];
int main() {
int m, n;
cin >> m >> n;
for(int i = 0; i < n; ++i) {
cin... | true |
68730bd5db1263a5e13b6653389fc1f4daa3834b | C++ | alexlambson/graphics-programming | /ASS_08/ASS_08/Terrain.h | UTF-8 | 809 | 2.75 | 3 | [] | no_license | #pragma once
#include <cstdlib>
#include <vector>
#include "Helpers.h"
using namespace std;
enum Color
{
RED,
GREEN,
BLUE
};
enum TerrainType{
GROUND,
WATER
};
class Terrain{
public:
Terrain(int x, int y, bool store = false);
void Draw(TerrainType terrain);
WorldSize size;
double static GenerateHeight(double ... | true |
46b1bd073190f97b33976323faae797362eba92f | C++ | AnabaenaQing/Source-Code_ShaderX_GPU-Pro_GPU-Zen | /GPU Pro5/06_Compute/Object-order Ray Tracing for Fully Dynamic Scenes/beMath/header/beMath/beSphere.h | UTF-8 | 842 | 2.546875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | /*****************************************************/
/* breeze Engine Math Module (c) Tobias Zirr 2011 */
/*****************************************************/
#pragma once
#ifndef BE_MATH_SPHERE
#define BE_MATH_SPHERE
#include "beMath.h"
#include "beSphereDef.h"
#include "beVector.h"
#include "beMatrix.h"
n... | true |
551913160e620f071bfa0fe55b4074cb673ae907 | C++ | jmg217/maxwell_dev | /dot_prod_test.cpp | UTF-8 | 563 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <stdio.h>
#include <math.h>
double inner_product(int N, std::vector<double>& first_vector, std::vector<double>& second_vector);
int main(){
int N=10000000;
std::vector<double> first_vector(N);
std::vector<double> second_vector(N);
for(int i=0 ; i < N ; i++)
{
... | true |
ee22802421271ba63948f46ce0207a82df4079b3 | C++ | Br3nder/ADS_lab2 | /SortAlgorithms.cpp | UTF-8 | 3,534 | 3.71875 | 4 | [] | no_license | #include <iostream>
using namespace std;
bool isSorted(int* array, int size)
{
for (int i = 0; i < size - 1; i++)
if (array[i] > array[i + 1]) return false;
return true;
}
void shuffle(int *array, int size)
{
for (int i = 0; i < size; i++)
swap(array[i], array[rand() % size]);... | true |
7d6d37bde12b8b4392cde49cad740c22eec34e3f | C++ | shahin-fotowat/College-Tour | /collegetour-master/src/distance.h | UTF-8 | 1,035 | 3.484375 | 3 | [] | no_license | #ifndef DISTANCE_H
#define DISTANCE_H
#include "college.h"
/**
* @brief The Distance class
* Represents two colleges and their distances
*/
class Distance {
private:
College startCollege;
College endCollege;
int distance;
public:
Distance();
/**
* @brief Distance constructor
* @param ... | true |
c1b92821e058c56c7fa0b594f3482e38612b77ff | C++ | tnakaicode/jburkardt | /mpi/sum_mpi.cpp | UTF-8 | 4,228 | 2.546875 | 3 | [] | no_license | # include <cstdlib>
# include <iostream>
# include <iomanip>
# include <ctime>
# include <mpi.h>
using namespace std;
int main ( int argc, char *argv[] );
void timestamp ( );
//****************************************************************************80
int main ( int argc, char *argv[] )
//*********************... | true |
94cf2d08db6105b98b2ea4c01d18eb39237f45ec | C++ | 237K/DataStructure | /List_ArrayList.cpp | UTF-8 | 2,465 | 3.65625 | 4 | [] | no_license | //
// OS Windows
// 2019.02.23
//
// [자료구조]
// <1. Linked List>
// 1) 배열 기반 리스트
//
#include <iostream>
#include <cstdio>
using namespace std;
const static int LIST_LEN = 100;
template <typename T>
class List
{
private:
T arr[LIST_LEN];
int NumOfData;
int CurPosition;
public:
void ListInit(List *plist);
void... | true |
77423df72d86b42a7b6dfd07f2de6034a2c95948 | C++ | rogers140/leetcode-oj | /String to Integer/Solution.cpp | UTF-8 | 1,506 | 3.28125 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;
class Solution {
public:
int atoi(const char *str) {
int length = strlen(str);
int sign = 1;
int start = 0;
for (int i = 0; i < length; i++) {
if (str[i] == ' ' || str[i] == 0x9) {
start++;
}
else {
break;
}
... | true |
a4e00101c1b14b52059f67b0a0e52b7937bb50b2 | C++ | josecarreno/Solitariopp | /solitario_0_3/VecJugadores.cpp | UTF-8 | 2,431 | 2.9375 | 3 | [] | no_license | #include "StdAfx.h"
#include "VecJugadores.h"
CVecJugadores::CVecJugadores(void)
{
N = 0;
leeDeArchivo();
if ( N == 0 )
vec = NULL;
}
CVecJugadores::~CVecJugadores(void)
{
if (N>0)
{
guardaEnArchivo();
for(int i=0; i<N; i++)
{
delete vec[i];
}
delete [] vec;
}
}
void CVecJugadores::leeDeArchivo()... | true |
3650a76b907da929a9120f7167773294ba515eed | C++ | Saadmalik16/OOP | /1st assignment ch no 2 Exercise problems/2.20.cpp | UTF-8 | 512 | 3.78125 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int radius, diameter;
double constantValue, circumference, area;
cout << "Radius of the circle: ";
cin >>radius ;
diameter = radius * 2;
cout << "The diameter is: "<< diameter << "\n";
constantValue = 3.14159;
circumference = consta... | true |
64a622dfbdf45146796fe9e0eb7e7a56ae5180cd | C++ | hanrick2000/LeetCode-7 | /Power of Two/Method.cpp | UTF-8 | 356 | 3.21875 | 3 | [] | no_license | //Given an integer, write a function to determine if it is a power of two.
//
//傻逼题
class Solution {
public:
bool isPowerOfTwo(int n) {
int mask = 1;
for(int i = 0; i < 31; ++i) {
if(n == mask) return true;
mask<<=1;
}
r... | true |
a835396c317ff3602de739f8536b3d489d6da69a | C++ | NorbertNiebieski/Public_Transport_System | /Przystanki.h | WINDOWS-1250 | 1,836 | 3.203125 | 3 | [] | no_license | #ifndef Przystanki_H
#define Przystanki_H
#include <iostream>
#include <vector>
#include <string>
#include "Line.h"
#include <map>
using namespace std;
class Przystanek
{
private:
string m_bus_stop_name;
bool m_on_demand;
bool m_frist_zone;
vector<string> m_line_list;
public:
//Konstruktor domylny
Przyst... | true |
d28bc0f984282ba21669d01e2ed1b4ba784b4465 | C++ | yottacto/competitive-programming | /poj/1947.cc | UTF-8 | 1,169 | 2.703125 | 3 | [] | no_license | // ml:run = $bin < input
// ml:std = c++03
#include <iostream>
#include <algorithm>
#include <vector>
int const inf = 1 << 29;
int const maxn = 200;
int f[maxn][maxn];
int n, size;
int ans = inf;
std::vector<std::vector<int> > g;
void add_edge(int x, int y)
{
g[x].push_back(y);
g[y].push_back(x);
}
void dp... | true |
4c389119e8c348abfa8f1dfc9985f12f60753432 | C++ | lmh760008522/ProgrammingExercises | /北大推免10题/2018软件考试/g.cpp | GB18030 | 1,057 | 3 | 3 | [] | no_license | //С
/*
ĸPѸ·R
RУ
id id ·ij
p=0
50㣬100
*/
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
typedef struct node{
int a,b;
int len;
};
bool comp(node a1,node a2){
if(a1.len<a2.len){
return true;
}
return false;
}
int main(){
int p,r;
scanf("%d",&p);
... | true |
2134c47774081e92cc2ddcc11d5e6673358afede | C++ | danielkrupinski/GOESP | /GOESP/Linux/LinuxFileMap.h | UTF-8 | 597 | 2.9375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <cstddef>
#include <sys/mman.h>
class LinuxFileMap {
public:
LinuxFileMap(void* address, std::size_t length, int protection, int flags, int fileDescriptor, off_t offset) : map{ mmap(address, length, protection, flags, fileDescriptor, offset) }, length{ length } {}
[[nodiscard]] bool isV... | true |
7065cc3dc271c7ebd2eeffe6c8295e323266cd03 | C++ | 7NGU/Compiler | /Lexical_Analyzer.cpp | UTF-8 | 4,582 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX_LINE 255
#define Key "KETWORD_END"
struct opt{
char att[MAX_LINE];
int spe;
};
opt analyze(char *input);
void pop(char *str, int x);
void push();
int isDigit(char x);
int isLetter(char x);
int isCharacter(char x);
int isSpace(char x);
char... | true |
7d3e42b372834379f09948ff6d2ac574d4619d1a | C++ | Ervie/Danmaku | /Implementacja/Danmaku/StageConst.h | WINDOWS-1250 | 1,010 | 2.625 | 3 | [] | no_license | #pragma once
/// <summary>
/// Przestrze staych
/// </summary>
namespace StageConst
{
/// <summary>
/// Stae wykorzystywane w grze
/// </summary>
static struct StageConsts
{
//// ==== STAE
static const unsigned short BUTTON_NUM = 2;
static const unsigned short TEX_NUM = 3;
static const unsigned short ST... | true |
13ab842485a0bd4b90700711cdca6f119538577b | C++ | gpevnev/cplusplus-2017 | /homework/2nd term/2/printer.cpp | UTF-8 | 1,904 | 3.203125 | 3 | [] | no_license | //
// printer.cpp
// ASCII Printer
//
// Created by Greg Pevnev on 16/03/2017.
// Copyright © 2017 Greg Pevnev. All rights reserved.
//
#include "printer.hpp"
void Printer::putCharacter(char c)
{
line.push_back(c);
}
void Printer::putInteger(int i)
{
string number;
if(i < 0)
{
putCharacte... | true |
f48e3f4e2a248b1df6cc859ea06efede9d9e1f09 | C++ | Lovepreet-Singh-ACET/Data-Strucutres-cpp | /arrays/binarySearch.cpp | UTF-8 | 685 | 3.046875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int binarySearch(int arr[], int size, int key){
int s = 0;
int e = size;
while (s <= e)
{
int mid = (s+e)/2;
if (arr[mid] == key){
return mid;
}else if (arr[mid] < key){
s = mid +1;
}else{
e... | true |
b56e7f03d949fdf844452d443f615741ba08c677 | C++ | Lil-Lexus/rrrrrrrr | /ConsoleApplication5/ConsoleApplication5.cpp | UTF-8 | 588 | 2.984375 | 3 | [] | no_license | // ConsoleApplication5.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
using namespace std;
int main()
{
const int n = 10;
double m[n]{ 1, 2, 5, 6, -1, 4, 5, 5, -8, -10 };
int indlast;
double sum = 0;
for (int i = n - 1; i > 0; i--)
{
i... | true |
a260a4aebe1c72cb581ef618e52abb1c0bc1bbf0 | C++ | volsungdenichor/cpp_essentials | /include/cpp_essentials/core/detail/repeat_iterator.hpp | UTF-8 | 1,621 | 2.9375 | 3 | [] | no_license | #ifndef CPP_ESSENTIALS_CORE_DETAIL_REPEAT_ITERATOR_HPP_
#define CPP_ESSENTIALS_CORE_DETAIL_REPEAT_ITERATOR_HPP_
#pragma once
#include <cpp_essentials/cc/cc.hpp>
#include <cpp_essentials/core/iterator_facade.hpp>
#include <cpp_essentials/core/detail/iterator_func_helper.hpp>
namespace cpp_essentials::core
{
namespac... | true |
acbef5b504820945d55bbc146201c2faf3ebf282 | C++ | abhijeetgu/LPMNOIDA11JUNE | /Lecture-8/ReadANumberAndString.cpp | UTF-8 | 266 | 2.921875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int n;
char a[100];
// Read number
cin>>n;
// cin.get(); // ' ' or '\n' will not get stored i.e. ignored
cin.ignore();
// Read string
cin.getline(a,100);
cout<<n<<endl;
cout<<a<<endl;
return 0;
}
| true |
e9aad3f4832bebb7a8ac9517224a15a380f2c8c4 | C++ | krishauser/KrisLibrary | /math/sample.h | UTF-8 | 2,252 | 3.34375 | 3 | [] | permissive | #ifndef MATH_SAMPLE_H
#define MATH_SAMPLE_H
#include <vector>
/** @file math/sample.h
* @brief Functions for random sampling of various sets.
*/
namespace Math {
/** @addtogroup Math */
/*@{*/
struct Interval;
struct ClosedIntervalSet;
/** @brief Samples an integer with weighted probability.
*
* The probabi... | true |
655cdb455dc7d1d9522876a3ff9168ea5e90faf5 | C++ | zjkang/ITint5 | /001_新手入门--元素累加.cpp | GB18030 | 568 | 3.140625 | 3 | [] | no_license | /*
: Annie Kim, anniekim.pku[at]gmail.com
ʱ: Sep 12, 2013
Ŀ: --Ԫۼ
Ѷ: Easy
: http://www.itint5.com/oj/#1
: һnarrԪ֮͡
мԼսᳬ32λз͵ķΧ
Solution: ۼӡ
*/
//arrԪ֮
//Ҫmain!
int arrSum(const vector<int> &arr) {
int sum = 0, N = arr.size();
for (int i = 0; i < N; ++i)
sum += arr[i];
return sum;
} | true |