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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b47ee86c80f120e32712de91cba460a15dd65493 | C++ | qiuyongchen/code_saver | /C++/AccountAgainAgain/PersonalAccount.cpp | UTF-8 | 662 | 2.71875 | 3 | [] | no_license | #include "PersonalAccount.h"
#include <iostream>
using namespace std;
int PersonalAccount::_total_per_account = 0;
int PersonalAccount::_acc_id_ptr = 12010000;
int PersonalAccount::get_total_per_account() {
return _total_per_account;
}
PersonalAccount::PersonalAccount() {
_id = _acc_id_ptr;
_balance = 10;
_... | true |
21b47e4fcda2c902c38449f0bee5a876968ccfd3 | C++ | nerds-coding/CPP_DSandAlgo_and_CP | /DSA/Algorithms/DynamicProgramming/RodCuttingProfit.cpp | UTF-8 | 975 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
#define vec vector<ll>
/*
This problem similar like knapsack problem
*/
void rodCutting(int rods[], int rodSize, int size)
{
vector<vector<int> > dp(size + 1, vector<int>(rodSize + 1));
for (int i = 1; i <= s... | true |
86527db176abed4d2ede90a5f7865483eb34fa29 | C++ | nigulo/dev | /Cpp/base/pointer.h | UTF-8 | 658 | 3.375 | 3 | [] | no_license | #ifndef POINTER_H
#define POINTER_H
namespace base {
template <typename T> class Pointer;
/**
* Smart pointer. If this object goes out of scope,
* underlying object is deleted
*/
template <typename T> class Pointer<T*>
{
public:
// class constructor
Pointer(... | true |
d26059b77cfe0fd40c69047fb75e13fa787316cc | C++ | AdithyaMukesh/arduino | /projects/Dht_Library/Dht.cpp | UTF-8 | 4,352 | 2.640625 | 3 | [] | no_license | /*
* Dth.cpp
*
* Author: Rob Tillaart (modified by Andy Dalton)
* Version: 0.2
* Purpose: Implementation of common functionality across DHT-based temperature
* and humidity sensors.
* URL: http://arduino.cc/playground/Main/DHTLib
*
* History:
* 0.2 - by Andy Dalton (14/09/2013) refactored... | true |
b78417d2476409d887e3b4201793609d710245b2 | C++ | yataw/folio | /C++/mccme/problem_166.cpp | UTF-8 | 1,199 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <stack>
#include <string>
#include <list>
#include <limits.h>
#include <cmath>
#include <climits>
using namespace std;
static int t(1);
int dfs(int v, vector<list<int>>& G, vector<int>& used, vector<int>& out)
{
//in[v] = t++;
... | true |
316a05a0e6c0221445ae092d31aab991ed4c1cc2 | C++ | harlleyaugusto/collaborativeMovieRecommendation | /CMR/Predictor.cpp | UTF-8 | 1,529 | 2.859375 | 3 | [] | no_license | #include "Predictor.h"
#include <map>
#include "Item.h"
#include "Similarity.h"
#include <iostream>
using namespace std;
Predictor::Predictor()
{
//ctor
}
Predictor::~Predictor()
{
//dtor
}
double Predictor::itemBasedPredictor(int userId, int itemId, map<int, Item> &matUtility, map<int, User> &users,
... | true |
edae8630fdd32b5882db7d386a71ca89fc85d408 | C++ | stanleytsang-amd/rccl_ipc_prototype | /barrier.h | UTF-8 | 3,943 | 3.046875 | 3 | [] | no_license | #include <string>
#include <semaphore.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
class SMBarrier
{
public:
SMBarrier(int rank, int numProcs, int uniqueId)
{
this->numProcs = numProcs;
std::string uniqueIdString = std::to_string(uniq... | true |
f7630271fd0a7cc102ccab9a150a5c857257a59a | C++ | dmontag23/Neural-Network-Training-With-Multigrid | /src/neural_network/neural_network.cpp | UTF-8 | 1,617 | 3.28125 | 3 | [] | no_license | #include "neural_network.h"
float NeuralNetwork::getAlpha() const
{
return alpha;
}
weightType NeuralNetwork::getWeights() const
{
return weights;
}
NeuralNetwork::NeuralNetwork(float my_alpha, weightType my_weights) : alpha{my_alpha}, weights{my_weights}{}
void NeuralNetwork::setAlpha(float my_... | true |
9611b7b8d15b52b1a6130d049734197108ec1315 | C++ | Garrybest/coding-interviews | /src/heap.cpp | UTF-8 | 949 | 3.515625 | 4 | [] | no_license | /*
* 大顶堆
* @Author: garryfang
* @Date: 2019-09-06 22:08:46
* @Last Modified by: garryfang
* @Last Modified time: 2019-09-07 09:45:57
*/
#include <vector>
#include <stdexcept>
std::vector<int> heap;
void swim(unsigned k)
{
while (k > 0)
{
if (heap[k] <= heap[(k - 1) / 2])
break;
... | true |
679f2d22686c0e16a2f5f7086cfc1c22de0db2f1 | C++ | DariuszPawlicki/chip8 | /CHIP8/main.cpp | UTF-8 | 2,317 | 3.1875 | 3 | [] | no_license | #include "chip8.hpp"
#include "display.hpp"
#include <chrono>
#include <iostream>
int main(int argc, char* argv[])
{
std::string rom_name;
float delay;
int scale_factor;
if (argc == 4) {
rom_name = argv[1];
delay = std::stoi(argv[2]);
scale_factor = std::stoi(argv[3]);
... | true |
039b49916ee3715577ed9d109316fe0a2f22bc14 | C++ | sakshikakde17/DAA_Programs | /Quick Sort/Quick_Sort.cpp | UTF-8 | 1,597 | 3.734375 | 4 | [] | no_license | /* Program For QUICK SORT
Complexity : Best case ::O(nLogn)
Worst case :: O(n^2)
Algorithm:
QuickSort(array,low,high)
{
if(low<high)
{
j=Partition(array,low,high);
QuickSort(low,j);
QuickSort(j+1,high);
}
}
Partition(array,low,high)
{
pivot=Array[... | true |
8f6b70d48a897efb7d130e66cc566d7cd54e0a82 | C++ | Tarunverma504/C-concepts | /String/to delete the spaces in the string.cpp | UTF-8 | 310 | 3.1875 | 3 | [] | no_license | // to delete the spaces in the string
#include<string.h>
#include<stdio.h>
int main()
{
char arr[100];
int i,k;
printf("Enter the string: ");
gets(arr);
while(arr[i]!='\0')
{
if(arr[i]==' ')
{
k=i;
while(arr[k]!='\0')
{
arr[k]=arr[k+1];
k++;
}
}
i++;
}
printf("%s",arr);
}
| true |
085ef0e5bf5193c1fc1ae3cabff7c72a036d3bc5 | C++ | SKMBOSS/CPP_Tetris | /TETRIS/SBLOCK.cpp | UTF-8 | 2,039 | 2.78125 | 3 | [] | no_license | //SBOLCK
#include "SBLOCK.h"
void SBLOCK::setBoard(GameBoard& gameboard)
{
if(rotateForm%2==0)
{
gameboard.board[r][c]=4;
gameboard.board[r+1][c]=4;
gameboard.board[r+1][c+2]=4;
gameboard.board[r+2][c+2]=4;
}
else
{
gameboard.board[r][c]=4;
gameboard.board[r+1][c]=4;
gameboard.board[r][c+2]=4;
gam... | true |
fcf8741830ee0715346f648c63e5ef59dc45834f | C++ | LiuYuancheng/KeyExchangeApp | /app/src/main/cpp/generic_service/kems/CKem.h | UTF-8 | 858 | 2.65625 | 3 | [] | no_license | /*
* CKem.h
*
* Created on: 20 Feb 2020
* Author: yiwen
*/
#ifndef INCLUDE_CPP_CKEM_H_
#define INCLUDE_CPP_CKEM_H_
#include <iostream>
#include <string>
#include <inttypes.h>
using namespace std;
class CKem
{
public:
string MajorName;
string MinorName;
string PubKey;
string PrivKey;
string CipherT... | true |
c38264cfe8ecffc9918198c91b24184ac89f4b46 | C++ | kazach7/fraction-interpreter | /src/main.cpp | UTF-8 | 3,170 | 3.015625 | 3 | [] | no_license | #include "../include/modules/Source.h"
#include "../include/modules/Scanner.h"
#include "../include/modules/Parser.h"
#include "../include/Token.h"
#include "../include/program-tree/program-tree-includes.h"
#include "../include/environment/environment-includes.h"
#include "../include/exceptions/SourceException.h"
#incl... | true |
2d303b24c47f0c98cd20c17af5d8e85469ecf89d | C++ | jpucilos/classwork_archive | /EE553/Homework/HW2/HW2f_JoePuciloski.cpp | UTF-8 | 323 | 3.03125 | 3 | [] | no_license | #include<iostream>
#include<fstream>
using namespace std;
double average(int x[], int n){
double sum = 0;
for (int i=0; i < n; i++)
sum += x[i];
sum = sum / n;
return sum;
}
int main(){
ifstream f("2f.dat");
int n;
f >> n;
int x[n];
for (int i = 0; i < n; i++)
f >> x[i];
cout << average(x, n);
return 0... | true |
d7b984c04eee28e06134f3fe738bf35dee89bd2d | C++ | ArachnidJapan/ThreadWar | /RiguruLib/RiguruLib/Src/Actor/Collision.cpp | SHIFT_JIS | 35,097 | 2.59375 | 3 | [] | no_license | #include "Collision.h"
#include "../Math/Converter.h"
#include "../Graphic/Graphic.h"
//Ƃ``aâ蔻
bool ColSphereBox(CubeParameter& aabb, Vector3& spherePos, Matrix4 mat, float& radius){
Matrix4 invMat = RCMatrix4::inverse(mat);
Vector3 spherePosA = RCMatrix4::transform(spherePos, invMat);
Vector3 scale = RCMatrix4::ge... | true |
6da3137023d5e81c7fdcacc34e137aebd65cda47 | C++ | securesocketfunneling/ssf | /src/common/boost/fiber/detail/fiber_id.hpp | UTF-8 | 4,500 | 2.75 | 3 | [
"BSD-3-Clause",
"OpenSSL",
"MIT",
"BSL-1.0"
] | permissive | //
// fiber/detail/fiber_id.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2014-2015
//
#ifndef SSF_COMMON_BOOST_ASIO_FIBER_DETAIL_FIBER_ID_HPP_
#define SSF_COMMON_BOOST_ASIO_FIBER_DETAIL_FIBER_ID_HPP_
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#... | true |
24c9906bc6f64c7e612b45d6654af0eb73b8bec7 | C++ | glpuga/cpp_examples | /examples/iterators_and_for_range/example.cpp | UTF-8 | 6,848 | 3.953125 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <map>
#include <unordered_map>
#include <vector>
int main() {
std::vector<int> vector_int{11, 22, 33, 44, 55, 66};
// Old c-style for-loop:
// Note that `vector_int.size()` and `index` are not the same type.
std::cout << "----- Old For-loop style ------" << std::endl;
for (int i... | true |
2de64b467f410870e68df0e4e09b7ee188cc617c | C++ | grzegorz-otworowski/Algorithms | /SPOJ/978. Stos.cpp | UTF-8 | 437 | 2.921875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int s, S[11], k, f=0;
char x;
while(cin>>x){
if(x=='+'){
cin>>s;
if(f>9){
cout<<":("<<endl;
}
else{
S[f]=s;
f++;
k=1;
cout<<":)"<<endl;
}
}
else if(x=='-'){
if(k==1){
f--;
k=0;
}
if(... | true |
796f47d3a00672710f59dfe1f7878b4ce4da012d | C++ | SwamyDev/ModernEasyCuda | /AddFold.hpp | UTF-8 | 299 | 2.53125 | 3 | [] | no_license | #ifndef CUDA_ADD_FOLD_H
#define CUDA_ADD_FOLD_H
#include "Array.hpp"
void add_on_gpu(std::size_t n, const float *src, float *dst);
template <typename T, std::size_t N>
void add_fold(const Array<T, N> &src, Array<T, N> &dst) {
add_on_gpu(N, src.data(), dst.data());
}
#endif //CUDA_ADD_FOLD_H
| true |
c5deab9c398afb22fd7ed40bdff7c05d33dd4ca0 | C++ | AndAccioly/UnBanco | /BaseUnit.h | UTF-8 | 4,090 | 3.453125 | 3 | [] | no_license | #ifndef _BASEUNIT_H_
#define _BASEUNIT_H_
#include <string>
#include <stdexcept>
/** A base de derivação de todas as classes de tipos básicos.
Suas diferentes instâncias servem de base para a construção de todos os outros tipos básicos.
Seus métodos setValue() e getValue() garantem o acesso ao seu parâmetro Value.
... | true |
beaf6430213dec8bd9a7907ccbc968316fb693be | C++ | 7heDuk3/newGitTest | /dugga1_16/main.cpp | UTF-8 | 672 | 2.96875 | 3 | [] | no_license | using namespace std;
#include <iostream>
#include <string>
#include <iomanip>
#include "Date.h"
#include "Boosted_Array.h"
ostream& operator<<(ostream& os, const Date& d);
ostream& operator<<(ostream& os, const Boosted_Array& ba);
int main()
{
Boosted_Array ba1(Date(1,6,2016), 5, "hej");
Boosted_Array ba2(D... | true |
11415a88cfcceff702a56dde144c6dbf6bac3f51 | C++ | jsj2008/hideous-engine | /HideousGameEngine/include/he/Utils/Frame.h | UTF-8 | 1,304 | 2.546875 | 3 | [
"MIT"
] | permissive | //
// Frame.h
// HideousGameEngine
//
// Created by Sid on 13/06/13.
// Copyright (c) 2013 whackylabs. All rights reserved.
//
#ifndef HideousGameEngine_Frame_h
#define HideousGameEngine_Frame_h
#include <he/Utils/Transform.h>
#include <he/Utils/GLKMath_Additions.h>
#include <he/Vertex/VertexData.h>
namespace he {... | true |
bd6907ce799ce4cbe2159ecb2d16559d8aeffeed | C++ | shriyajalana/programming | /practice2.cpp | UTF-8 | 635 | 3.9375 | 4 | [] | no_license | #include <iostream>
using namespace std;
void Double(int *A, int size) // *A == A[]
{
int i;
for (i = 0; i < size; i++)
{
A[i] = A[i]*2; // *(A+i) == A[i]
}
}
int main()
{
int A[] = {1, 2, 3, 4, 5};
int size = sizeof(A); // sizeof(A[0]); //... | true |
86fbbe9214e246581121ee09f7e6f8cf990a2d50 | C++ | H-Shen/Collection_of_my_coding_practice | /Leetcode/1344/1344.cpp | UTF-8 | 230 | 3.015625 | 3 | [] | no_license | class Solution {
public:
double angleClock(int hour, int minutes) {
double a = minutes*6;
double b = minutes/2.0+30.0*hour;
while (b > 360) b -= 360;
return min(abs(a-b), 360-abs(a-b));
}
}; | true |
7936cc88abe49c259c6391c6c8eca5d6387d37aa | C++ | materlai/leetcode | /126_word_ladder_3.cpp | UTF-8 | 2,575 | 3.1875 | 3 | [] | no_license | /*
leetcode algorithm 126:
find the word ladder II
*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;
class Solution {
public:
struct ladder_node {
... | true |
3d59be80f5f502b41f055e83d8f1a6265db218c0 | C++ | king1495/My_OpenGL_Program_Framework | /Program_Framework/Widget/TestWidget.cpp | UTF-8 | 2,504 | 2.65625 | 3 | [] | no_license | #include "stdafx.h"
#include "TestWidget.h"
int ThreadFunc(int temp) {
for (int i = 0; i < temp; i++)
{
cout << temp << " : " << i << endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
return temp * temp;
}
TestWidget::TestWidget(const std::wstring& _title)
:IWidget(_title)
{
t0 = 0;
for (int i... | true |
2a36fddaae84d1cd28c6e8fb48241429e48e9337 | C++ | HemantKr79/CB-Competitive-Programming-Solutions | /2. Bit Manupulation/bit manipulation.cpp | UTF-8 | 658 | 3.375 | 3 | [] | no_license | #include<iostream>
using namespace std;
bool isOdd(int n) {
return (n | 1);
}
bool getBit(int n,int i) {
return ((n & (1<<i)) > 0);
}
int setBit(int n,int i) {
int mask = 1<<i;
int ans = (n | mask);
return ans;
}
int clearBit(int n,int i) {
int mask = ~(1<<i);
int ans = (n & mask);
return ans;
}
void updat... | true |
602479fea9d3d23ae50ee43e8612ea352d8fc689 | C++ | olegoks/Windows-Library | /EventBuilder.hpp | UTF-8 | 976 | 2.640625 | 3 | [] | no_license | #pragma once
#include "Window.hpp"
#include "Control.hpp"
#include "Event.hpp"
union EventMemory {
System::Window::Event window_event_;
System::Control::Event control_event_;
~EventMemory()noexcept {}
};
class EventBuilder final {
private:
explicit EventBuilder()noexcept {}
public:
static EventBuilder& Get... | true |
5aa49109a1b21ed3e68527e05ec3fa5c63a670f8 | C++ | tech-team/NeonHockey | /Server/Server/logic.h | UTF-8 | 1,246 | 2.875 | 3 | [] | no_license | #ifndef LOGIC_H
#define LOGIC_H
#include <mutex>
#include <chrono>
#include <vector>
#include "player.h"
#include "puck.h"
class Logic
{
public:
static Logic &getInstance();
enum class StopReason { ClientDisconnected, GameOver, ServerStopped, LogicException };
void start();
void setPos(int clientId... | true |
4bc6cfa6368cf26cc0ca74cfbb955f7ed0501b39 | C++ | Aeogor/CS-141- | /CS 141/Programs/Program 4/Program 4/main.cpp | UTF-8 | 14,014 | 3.46875 | 3 | [] | no_license |
//Headers
#include <iostream>
#include <cstring>
#include <fstream>
#include <cassert>
#include <algorithm>
#include <cstdio>
#include <cctype>
/* ------------------------------------------------
*
*
* Class: CS 141, Spring 2016. Tuesday 10am lab.
* System: Mac OS X, Xcode
* Author: Srinivas Lingutla and Mic... | true |
5e68a0a460035b2895b54bd49268f10c3e174e5c | C++ | dpetek/algorithms | /z-trening/stepen.cpp | UTF-8 | 594 | 2.5625 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <cmath>
#define pb push_back
#define fs first
#define sc second
using namespace std;
double a;
double b;
int main(void){
cin >> a >> b;
int n = (int)sqrt(b);
for (int ... | true |
5dd5e18a5b93e36cf79f3195a790730662d06fda | C++ | vivahome/automatic_plate_recognition_system | /include/PossibleChar.hpp | UTF-8 | 1,228 | 3.125 | 3 | [] | no_license | #ifndef POSSIBLECHAR_HPP
#define POSSIBLECHAR_HPP
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
class PossibleChar
{
public:
PossibleChar();
PossibleChar(std::vector<cv::Point> _contour);
~PossibleChar();
double distanceBetwe... | true |
bc3c4f5db6ac62e6618dda35810fabbde18f5408 | C++ | cy20lin/.spacemacs.d | /layers/c-c++/test/a.cpp | UTF-8 | 445 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <cstdint>
#include <functional>
#include <boost/asio.hpp>
#include <boost/algorithm/algorithm.hpp>
#include <boost/winapi/waitable_timer.hpp>
struct A {
int x;
int y;
int z;
};
namespace cy {
int add(int, int) {
return 0;
}
}
int main() {
A a = {1, 2, 3};
cy::add... | true |
6f238e15a2932426f737fd445c3ce276be8cc20a | C++ | jhpy1024/PerlinNoise | /include/MapRenderer.hpp | UTF-8 | 645 | 2.734375 | 3 | [
"MIT"
] | permissive | #ifndef MAP_RENDERER_HPP
#define MAP_RENDERER_HPP
#include "Map.hpp"
#include <SFML/Graphics.hpp>
#include <vector>
class MapRenderer
{
public:
MapRenderer(Map* map);
void draw(sf::RenderTarget& target);
void changeMap(Map* newMap);
private:
void buildVertexArray();
pri... | true |
6e3afc183f2683834620e7eca48736b6f9391427 | C++ | iPhreetom/ACM | /BOJ/team12/J.cpp | UTF-8 | 524 | 2.515625 | 3 | [] | no_license | /*
a3 >= 2
a2 >= 3
1 a3
1 a2
1 a3
2 a2
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
int n;
a[312345];
int a2=0,a3=0,a1=0;
for(int i=0;i<n;i++){
cin>>a[i];
if(a[i] == 1)a1++;
if(a[i] == 2)a2++;
if(a[i] == 3)a3++;
}
if(a3>=2){
co... | true |
9a7802b46b1f5efd450fcf8ad275e600b2f603af | C++ | londonhackspace/acnode-cl | /src/door.cpp | UTF-8 | 707 | 2.953125 | 3 | [] | no_license | #include "door.h"
#include <Energia.h>
#define KEEP_OPEN_MILISECONDS 1500
Door::Door(int pin, int initialState, uint16_t holdTime) {
this->pin = pin;
this->initialState = initialState;
this->openedAt = 0;
this->holdTime = holdTime;
pinMode(this->pin, OUTPUT);
digitalWrite(this->pin, this->initialState);
}... | true |
b40bc80435dff06411a9025c3ff33e44b0d646d2 | C++ | j-renggli/core | /src/random/random.cpp | UTF-8 | 1,615 | 2.765625 | 3 | [] | no_license | #include <include/random.h>
namespace core {
const uint64_t IRandom::maskDouble = 0xFFFFFFFFFFFFFULL;
////////////////////////////////////////////////////////////////
const uint64_t IRandom::getUniform()
{
return (getNext() - 1);
}
////////////////////////////////////////////////////////////////
const int64_t I... | true |
7a8e9ccc38e79cb9f0c27503dcaf892816256262 | C++ | Alaxe/noi2-ranking | /2017/solutions/A/HCM-Sofia/stories.cpp | UTF-8 | 1,330 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<set>
#include<list>
using namespace std;
typedef unsigned long long ull;
struct ltstr
{
bool operator()( int s1, int s2) const
{
return s1 > s2;
}
};
int main(){
short kon[100000];
set<int, ltstr> fun;
list<int> all;
int k,n;
cin >>... | true |
12cefd1d151d71dd4b2069ec42b0f01874599cf2 | C++ | weimingtom/krkrz_android_research | /environ/android/GLTexture.h | UTF-8 | 1,517 | 2.90625 | 3 | [
"Libpng",
"Zlib",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"BSD-2-Clause-Views",
"FTL",
"Apache-2.0",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
#ifndef __GL_TEXTURE_H__
#define __GL_TEXTURE_H__
#include <EGL/egl.h>
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
class GLTexture {
protected:
GLuint texture_id_;
GLint format_;
GLuint width_:
GLuint height_;
private:
void create( GLuint w, GLuint h, const GLvoid* bits, GLint format=... | true |
c3cc53941ed57125136ad2f06a81c771cf5d0b4c | C++ | KarelStudnicka/Twotris | /Twotris/Gfx.h | UTF-8 | 2,482 | 2.671875 | 3 | [] | no_license | #pragma once
#include<allegro5/allegro_font.h>
enum RenderPrimitiveType {
none,
clear,
puttext,
putbitmap,
putfilledrectangle,
putrectangle
};
struct RenderPrimitiveDataClear {
ALLEGRO_COLOR color;
};
struct RenderPrimitiveDataPutText {
char *text;
int x, y;
ALLEGRO_COLOR color;
int align;
};
struct Ren... | true |
6cdada5da65fe485f159ade8fd7e36f3007d5b7c | C++ | joohongkeem/Cpp_Self_Study | /_015_Constructor.cpp | UTF-8 | 5,137 | 3.65625 | 4 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
/*
* 생성자(Constructor)
- 클래스의 객체가 선언될 때 자동으로 호출되는 멤버 함수
-> 몇 개 또는 모든 멤버 변수의 값을 초기화하는 데뿐만 아니라
그 외, 다른 종류의 초기화에도 사용된다.
- 생성자는 다음 두 가지 점을 제외하고는 다른 멤버 함수 정의와 같은 방법으로 정의한다.
1) 생성자는 클래스와 똑같은 이름을 가져야 한다.
예를 들어, 클래스의 이름이 BankAccount라면... | true |
15322df311e89de98fb5ddc0f1f4905c921e56bd | C++ | sahil32/DataStructureandAlgorithm | /buy and cell.cpp | UTF-8 | 805 | 3.078125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int find_max(vector<int> prices,int l,int m,int r)
{
int i=l;
int j=m+1;
int profit=0;
while(i<=m&&j<=r)
{
profit=max(profit, prices[j]-prices[i]);
}
cout<<profit;
return profit;
... | true |
bd3358c8f4a321f84449c50d818e3484dec78854 | C++ | mpfeil/senseBoxMCU-core | /arduino/samd/libraries/FlashStorage/examples/StoreNameAndSurname/StoreNameAndSurname.ino | UTF-8 | 2,411 | 3.6875 | 4 | [
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"Apache-2.0"
] | permissive | /*
Store and retrieve structured data in Flash memory.
This example code is in the public domain.
Written 30 Apr 2015 by Cristian Maglie
*/
#include <FlashStorage.h>
// Create a structure that is big enough to contain a name
// and a surname. The "valid" variable is set to "true" once
// the structure is fill... | true |
1fd6e5e035bae5fd66602532a396baa740933cc0 | C++ | Clotonervo/Data-Structures | /Pokemon/Map.h | UTF-8 | 1,134 | 3.203125 | 3 | [] | no_license | //
// Map.h
// Pokemon
//
// Created by Sam Hopkins on 6/15/18.
// Copyright © 2018 Sam Hopkins. All rights reserved.
//
#ifndef Map_h
#define Map_h
#include "MapInterface.h"
#include <string>
template <typename K, typename V>
class Map : public MapInterface<K, V> {
public:
static const int HashTableSize = 31... | true |
825d0a777c67def21affcbffb13b4a1b0e07423e | C++ | Shivam0001/Competitive-Programming | /Question Bank with Solution/Loops/2.cpp | UTF-8 | 181 | 2.625 | 3 | [] | no_license | #include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int i,n,sum=0,a;
cin>>n;
while(n!=0)
{
a=n%10;
sum+=a;
n=n/10;
}
cout<<sum;
}
| true |
45614f1eee1e427e08f401e18726468e589852cd | C++ | mmatrosov/FKN2020 | /home2/by_user/Королёв Фёдор Сергеевич-83084811/B-34551162-gcc_docker2-OK.cpp | UTF-8 | 816 | 3.1875 | 3 | [] | no_license | #include <unordered_set>
#include <set>
#include <iostream>
const int MOD = 1e9 + 7;
int hash_func(const std::string& s) {
long h = 0, st = 1;
for (char c : s) {
h = (h + (c - 'a' + 1) * st) % MOD;
st = (st * 27) % MOD;
}
return h;
}
int main() {
std::unordered_set <int> strings;
... | true |
d6cdb88769feddac6ec18a645d0abb08bf496eff | C++ | karlg100/Adafruit_EMC2101 | /examples/lut_test/lut_test.ino | UTF-8 | 2,366 | 2.796875 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | // Basic demo for readings from Adafruit EMC2101
#include <Wire.h>
#include <Adafruit_EMC2101.h>
Adafruit_EMC2101 emc2101;
void setup(void) {
Serial.begin(115200);
while (!Serial) delay(10); // will pause Zero, Leonardo, etc until serial console opens
Serial.println("Adafruit EMC2101 test!");
// Try to... | true |
8d388cb2576988a96852f9882f1b3f58f85d7ce3 | C++ | anhero/BaconBox | /BaconBox/Input/GamePad/NullGamePad.h | UTF-8 | 463 | 2.609375 | 3 | [] | no_license | /**
* @file
* @ingroup Input
*/
#ifndef BB_NULL_GAME_PAD_H
#define BB_NULL_GAME_PAD_H
namespace BaconBox {
/**
* Null game pad device. Used when the platform doesn't have a game pad.
* @ingroup Input
*/
class NullGamePad {
public:
/**
* Default constructor.
*/
NullGamePad();
/**
* Destructor.
... | true |
384d606f8fb6a500e92ccf09a9d187d36f65a6df | C++ | danjr26/game-engine | /Geometry/src/line_segment.cpp | UTF-8 | 3,745 | 2.890625 | 3 | [] | no_license | #include "../include/internal/line_segment.h"
#include "../include/internal/line.h"
#include "../include/internal/ray.h"
template<class T, uint n>
LineSegment<T, n>::LineSegment(const Vector<T, n>& i_point1, const Vector<T, n>& i_point2) :
mPoint1(i_point1),
mPoint2(i_point2) {}
template<class T, uint n>
LineSegmen... | true |
f89360b7dc3bbccfda777e73bdccafd3441593d4 | C++ | VKislyakov/Neuron-Network | /Neuron Network/src/DataSet.h | WINDOWS-1251 | 1,935 | 2.6875 | 3 | [] | no_license | #pragma once
#ifndef DATASET_H
#define DATASET_H
#include <map>
#include <vector>
#include <string>
#include <iterator>
#include <iostream>
#include <fstream>
#include <ctime>
#include <boost/filesystem.hpp>
using namespace boost::filesystem;
using namespace std;
double divider(double a);
void divisionComponents(vec... | true |
f5422874c52c68904e2f7ca416df3f8c9f8179e3 | C++ | chenzt2020/correction | /findRect.h | GB18030 | 1,564 | 3.0625 | 3 | [] | no_license | #pragma once
/// <summary>
/// ͼsrcɫΪ_colorͨԾʽ浽vRect
/// </summary>
/// <param name="src">ͼ</param>
/// <param name="vRect"></param>
/// <param name="_color">ɫ</param>
/// <returns>θ</returns>
int bfs(const cv::Mat src, std::vector<cv::Rect>& vRect, const uchar _color = 0) {
int height = src.rows;
int width = src.... | true |
369f85ab69d84a8c2c0fbed3e9a030ada3d1945f | C++ | kkoltunski/designPatterns | /creationals/builder/builder/carInfoBuilder.h | UTF-8 | 1,426 | 2.5625 | 3 | [] | no_license | #ifndef CARINFOBUILDER_H
#define CARINFOBUILDER_H
#include "carIngridients.h"
#include <iostream>
#include <memory>
//builder interface
class carInfoBuilder {
protected:
virtual void chassisAssemble(short _axlesNumber, int _wheelbase, long _bearingCapacity);
virtual void bodyAssemble(bodyType _type, string _color, ... | true |
176c553972fe735bc350f831680d384d9e354d3a | C++ | spiralgenetics/biograph | /modules/io/loop_io.h | UTF-8 | 615 | 3.015625 | 3 | [
"BSD-2-Clause"
] | permissive |
#ifndef __loop_io_h__
#define __loop_io_h__
#include "modules/io/io.h"
#include <deque>
class loop_io : public readable, public writable
{
public:
loop_io() {}
size_t size() { return m_buffer.size(); }
size_t read(char* buf, size_t len) override
{
if (len > size())
len = size();
for(size_t i = 0; i < len... | true |
cc885bc25ad5c534474dd724334b95ace2ffd545 | C++ | priya2006/Algorithms | /CP/Knapsack.cpp | UTF-8 | 931 | 2.84375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int Knapsack(int n,int W,int *val,int *wt)
{
if(n==0||W==0)
return 0;
int a;
if(wt[n-1]<=W)
{
int x=Knapsack(n-1,W,val,wt);
int y=Knapsack(n-1,W-wt[n-1],val,wt)+val[n-1];
a=max(x,y);
}
else
{
a=Knapsack(n-1,W,val... | true |
f740327278d7cf51cf569d73c09144e3b1c3a7f9 | C++ | mew18/DS-ALGO-plus-plus | /Recursion/Exercise/permute_dict_large.cpp | UTF-8 | 714 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#include <set>
#include <iterator>
using namespace std;
char temp[1000];
set<string> s;
void permute(string in, int i)
{
if (in[i] == '\0')
{
s.insert(in);
return;
}
for (int j = i; in[j] != '\0'; j++)
{
swap(i... | true |
d831a4b26021dd68ff7f318a303402f7b1dba3e6 | C++ | eXceediDeaL/OI | /Problems/Codevs/其他/1738.cpp | UTF-8 | 383 | 2.609375 | 3 | [] | no_license | /*
打印机
*/
#include<stdio.h>
int main(){
int n,i,j;
scanf("%d",&n);
for(i=1;i<=n/2;i++){
for(j=1;j<=n-i;j++)
if((i==j)||(j==n-i+1))printf("X");
else printf(" ");
printf("X\n");
}
for(i=1;i<=n/2;i++)printf(" ");
printf("X\n");
for(i=n/2;i>=1;i--){
for(j=1;j<=n-i;j++)
if((i==j)||(j==n-i+1))printf("X"... | true |
233a22fcf624e5299f01dee0db742cb302587fe5 | C++ | shadolite/skeet | /tBird.cpp | UTF-8 | 724 | 2.890625 | 3 | [] | no_license | /*************************************************************
* File: tBird.cpp
* Author: Amy Chambers
*
* Description: Contains the function bodies for Tough Bird
*************************************************************/
#include "tBird.h"
#include <cassert>
tBird :: tBird()
{
point.setX(-200);
poi... | true |
2d1a85e49f531379f8ea93cbcc6ebb706d62d407 | C++ | chinmayjog13/Image-Processing | /Bilinear_Interpolation.cpp | UTF-8 | 2,756 | 3.359375 | 3 | [] | no_license | /* Image resizing using Bilinear Interpolation
This code is for square images, but it can be used for all images with a few simple changes
Pass arguments in following order- InputImage.raw OutputImage.raw BytesPerPixel Input_Size Output_Size
Author- Chinmay Jog
*/
#include <stdio.h>
#include <iostream>
#incl... | true |
4d44dba082aab8558cfc7d0a4b603ce20d8e96f0 | C++ | sebastian/firmament | /src/base/job.h | UTF-8 | 1,553 | 2.515625 | 3 | [] | no_license | // The Firmament project
// Copyright (c) 2011-2012 Malte Schwarzkopf <malte.schwarzkopf@cl.cam.ac.uk>
//
// Common job functionality and data structures.
// TODO(malte): Refactor this to become more shallow and introduce a separate
// interface class.
#ifndef FIRMAMENT_BASE_JOB_H
#define FIRMAMENT_BASE_J... | true |
280f9cdbd8745ed8a76b7951d94c10beb4da9023 | C++ | AlinMedianu/The-Last-Dawn | /Project/TheLastDawn/TheLastDawn/ScrollingImage.cpp | UTF-8 | 795 | 2.796875 | 3 | [] | no_license | // P4G - Semester 2 - Group Project 2019
// CS4G : Group F
// Charlie Batten - 27012619, Nico Caruana - 27022205, Alin Medianu - 27005327
#include "ScrollingImage.h"
ScrollingImage::ScrollingImage(const TexCache::Data& texture)
: textureData_(texture)
{
}
ScrollingImage::~ScrollingImage()
{
}
Vector2 ScrollingIma... | true |
13d02d9f6921a51c1676a76c5f16207fb9280a39 | C++ | NiallMcGinness/shape-gen | /src/gen_shape/generatePNG.cpp | UTF-8 | 5,580 | 2.671875 | 3 | [] | no_license |
#include "generatePNG.h"
#include <iostream>
#include <fstream>
#include <random>
#include <string>
#include <unistd.h>
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
GeneratePNG::GeneratePNG() {
this->outputDirectory =... | true |
df654c4cf7d2950f0b9629b259d4910fd56947a4 | C++ | zhuli19901106/hdoj | /HDU2523(AC).cpp | UTF-8 | 710 | 2.515625 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
const int MAXN = 2001;
int a[MAXN];
int b[MAXN];
int myabs(int a)
{
return (a >= 0 ? a : -a);
}
int main()
{
int t, ti;
int n, k;
int i, j;
while(scanf("%d", &t) == 1){
for(ti = 0... | true |
bd4949a7c65758a81b59db73a8ba8cc236f7a2e2 | C++ | findNextStep/myCompilingPrincipleExperiment | /src/lib/token.cpp | UTF-8 | 426 | 2.703125 | 3 | [] | no_license | #include "struct/token.hpp"
namespace theNext {
::nlohmann::json token::toJson() const {
::nlohmann::json ans;
ans["type"] = this->type;
ans["content"] = this->content;
return ans;
}
token token::fromJson(::nlohmann::json json) {
token ans;
if(json.find("content") != json.end()) {
an... | true |
cd76503420a970750df2efdc7a9edfb343aef758 | C++ | akh5113/Fantsy-Combat-Game-Tournament | /menu.cpp | UTF-8 | 4,575 | 3.609375 | 4 | [] | no_license | /*********************************************************************
** Program name: menu.cpp
** Author: Anne Harris
** Date: May 19, 2017
** Description:
*********************************************************************/
#include<iostream>
#include"menu.hpp"
/****************************************... | true |
31508d377f7e393718979b4e8ab5c58e93058ef7 | C++ | carlosgeos/polynomial-cpp | /PolyAbs.hpp | UTF-8 | 1,590 | 3.515625 | 4 | [] | no_license | #ifndef POLYABS_H
#define POLYABS_H
#include "IVect.hpp"
template<typename TYPE>
class PolyAbs: public virtual IVect<TYPE>
{
template <typename T>
friend std::ostream& operator<<(std::ostream&, const PolyAbs<T>&);
template <typename T>
friend std::istream& operator>>(std::istream&, PolyAbs<T>&);
... | true |
8f59038fb390cdb8757297314cbeda61c98bcc1b | C++ | 2-complex/g2c | /engine/fattening.cpp | UTF-8 | 4,166 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "fattening.h"
using namespace std;
namespace cello
{
void Fattening::clear()
{
position.clear();
texcoord.clear();
indices.clear();
}
void Fattening::add(const Vec2& v, const Vec2& u)
{
position.push_back(v.x);
position.push_back(v.y);
position.push_back(0.0);
texcoord.push_bac... | true |
998752d9073b0bd4e45cb8ff2fe7343f267766b2 | C++ | yandaomin/network | /network/src/network/udpNetwork.cpp | UTF-8 | 1,417 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | #include "udpNetwork.h"
#include "logWriter.h"
#include "udpNetworkPrivate.h"
UdpNetwork::UdpNetwork(Loop* loop)
{
private_ = std::make_shared<UdpNetworkPrivate>(loop);
}
UdpNetwork::~UdpNetwork() {
}
void UdpNetwork::setAddr(std::string addr) {
private_->setAddr(addr);
}
std::string UdpNetwork::getAddr() {
re... | true |
6b8297d8abb48bb55c43b218466cc8169718620d | C++ | imagicwei/for-magicwei-depplearning-gaze-control | /GazeControl/GazeControl/Functions.cpp | BIG5 | 5,727 | 2.953125 | 3 | [] | no_license | // stdafx.cpp : ȥ]tз Include ɪl{
// Standard Form.pch |sĶY
// stdafx.obj |]tsĶOT
#include "stdafx.h"
/*
void Rgb2Hsv::RGB2HSV(float R, float G, float B)
{
double min, max, delta;
max=System::Math::Max(System::Math::Max(R,G),B);
min=System::Math::Min(System::Math::Min(R,G),B);
V = max; ... | true |
0ab48a3608d2a7724340e10478771540dbec7371 | C++ | johnny6464/UVA | /UVA10000-10999/UVA10050.cpp | UTF-8 | 585 | 3.109375 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int main()
{
int cases = 0;
cin >> cases;
while (cases--)
{
int days = 0;
cin >> days;
int hartals = 0;
cin >> hartals;
vector<int> v;
for (int i = 0; i < hartals; i++)
{
int num = 0;
cin >> num;
v.push_back(num);
}
int lost = 0... | true |
d1b5aa6fd7952c6008b0482398205f28cbce4c65 | C++ | imbaqian/c-plus-plus | /class/stock.h | UTF-8 | 693 | 3.296875 | 3 | [] | no_license | /*
stock类
*/
#ifndef STOCK_H_
#define STOCK_H_
#include <string>
class Stock{
private:
std::string m_company;//公司名称
long m_shares; //所持股票数量
double m_share_val;//每股的价格
double m_total_val;//股票总价
void set_tot(){
m_total_val = m_shares * m_share_val;
}
public:
Stock(); //default co... | true |
edf5ec68eb70feb5545840b1ae64a0becdf05a3f | C++ | Lywx/CppLeetcodeAlgorithm | /144. Binary Tree Preorder Traversal AC 2.cpp | UTF-8 | 1,104 | 3.484375 | 3 | [
"MIT"
] | permissive | #include <cstddef>
using namespace std;
/**
Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
*/
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNod... | true |
534c282f0af7395953668c44445936c9004786b5 | C++ | TySag/Skill | /Exception/excep.h | UTF-8 | 1,764 | 2.5625 | 3 | [] | no_license | #ifndef __EXCEP_YX_HH__
#define __EXCEP_YX_HH__
#include <execinfo.h>
#include <stdlib.h>
#include <cxxabi.h>
#include <stdio.h>
#include <stdarg.h>
#include <iostream>
#include <sstream>
#include <exception>
#include <string>
using namespace std;
#define YX_THROW(ExClass, args, ...) \
do ... | true |
40380e820396d8b4df91a0ebc4dfd106e3c43d22 | C++ | anchalchopra/LeetCode | /Palindrome.cpp | UTF-8 | 901 | 3.78125 | 4 | [] | no_license | /*
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.
Follow up: Could you solve it without converting the integer to a string?
Example 1:
Input: x = 121
Output: true
Example 2:
Input: x = -121
Output: false
Explanation: From left to right, it rea... | true |
cd5d435a0c4128b41e1b437a5423290281e2bf82 | C++ | chosumin/CharacterTool | /Framework/Collider/cBoxCollider.cpp | ISO-8859-9 | 3,824 | 2.578125 | 3 | [] | no_license | #include "stdafx.h"
#include "cBoxCollider.h"
#include "cRayCollider.h"
#include "./Helper/cMath.h"
#include "./Mesh/cBox.h"
#include "./Graphic/ConstBuffer/cColliderBuffer.h"
#include "./Transform/sTransform.h"
cBoxCollider::cBoxCollider(weak_ptr<sTransform> parent,
D3DXVECTOR3 min, D3DXVECTOR3 max)
:cColli... | true |
aa011a4c3558c3ac1d53225c33b865eeda267131 | C++ | HaletckyYakov/SBD_121_Base | /shooter/shooter.cpp | UTF-8 | 841 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include<conio.h>
using namespace std;
#define Escape 27
#define UpArrow 72
#define DownArrow 80
#define LeftArrow 75
#define RightArrow 77
void main()
{
setlocale(LC_ALL, "rus");
char key;
do
{
key = _getch();
//cout << (int)key << "\t" << key << endl;
switch (key)
{
case UpArrow:... | true |
b2dfeb8110351b3f34fcdeb97d2fe9c2d899dfd1 | C++ | Suhailkhn/Leetcode | /Hard/MinAddToMakeParenthesesValid/main.cpp | UTF-8 | 1,155 | 3.421875 | 3 | [] | no_license | #include <stdio.h>
// Similar to Longest Valid Parentheses
class Solution {
public:
int minAddToMakeValid(string s) {
int i{0};
std::vector<int> opening_braces_index; // Stack where opening braces are pushed.
// Indicates whether the brace at an index in the string has a pair... | true |
c9050c41224fad492399220c1a6f90fa1a1fb402 | C++ | xianjimli/Elastos | /Elastos/LibCore/inc/Elastos/Text/RuleBasedCollator.h | UTF-8 | 4,971 | 2.734375 | 3 | [] | no_license | #ifndef __RULEBASEDCOLLATOR_H__
#define __RULEBASEDCOLLATOR_H__
#include "cmdef.h"
#include "Elastos.Text_server.h"
#include "Collator.h"
class RuleBasedCollator : public Collator
{
protected:
CARAPI Init(
/* [in] */ IICUCollator* wrapper);
/**
* Constructs a new instance of {@code RuleBasedColl... | true |
80bec2afa64e16f921bceb897b8fba12f9110a38 | C++ | AntonStark/spikard | /lib/mathlang/basics/complex.cpp | UTF-8 | 1,170 | 2.8125 | 3 | [] | no_license | //
// Created by anton on 20.01.19.
//
#include "complex.hpp"
bool ComplexTerm::comp(const AbstractTerm* other) const {
if (auto otherComplex = dynamic_cast<const ComplexTerm*>(other))
return (_symbol == otherComplex->_symbol && _args == otherComplex->_args);
else
return false;
}
const Abstrac... | true |
dfb965319e138d41310bf824bf942cdabb24e347 | C++ | luanpereira00/LP-Lab7 | /src/q4.cpp | UTF-8 | 1,398 | 3.671875 | 4 | [] | no_license | /**
* @file q4.cpp
* @brief Funcao principal que imprime todo os primos entre 1 e o valor digitado pelo usuario
* @author Luan Pereira (luanpereira00@outlook.com)
* @since 15/05/2017
* @date 15/05/2017
*/
#include <iostream>
using std::cout;
using std::endl;
#include <vector>
using std::vector;
... | true |
b701d4479ae569806c4a9615302c1f6caefb911b | C++ | dictcore/paragon_slovoed_ce | /data/Compiler/Compiler/MorphoDataManager.cpp | WINDOWS-1251 | 1,875 | 2.859375 | 3 | [] | no_license | #include "MorphoDataManager.h"
#include <algorithm>
#include <iterator>
#include "Log.h"
#include "Tools.h"
/***********************************************************************
*
*
* @param aLangCode -
* @param aFilename -
*
* @return
****************************************************************... | true |
7f71fddd1fc3b40b6b7bdb968c7a0773aa9bf2fe | C++ | Labil/OpenGL_stuffz | /src/FrameBuffer.cpp | UTF-8 | 2,538 | 2.984375 | 3 | [] | no_license | #include "FrameBuffer.h"
FrameBuffer::FrameBuffer()
:mId(0), mWidth(0), mHeight(0), mColorBuffers(0), mDepthBufferId(0), mbUseStencilBuffer(false)
{
}
FrameBuffer::FrameBuffer(int width, int height, bool useStencilBuffer)
:mId(0), mWidth(width), mHeight(height), mColorBuffers(0), mDepthBufferId(0), mbUseStenc... | true |
e8f65d5dde769c5d0585c9e8c5590a850cda8ef7 | C++ | tshaw18/HW05 | /12.8 source.cpp | UTF-8 | 614 | 3.53125 | 4 | [] | no_license | #include "Vector.h"
#include "Vector.cpp"
#include <vector>
using namespace std;
int main() {
Vector<int> vInt(5);
for (int i = 0; i < 5; i++){
vInt.push_back(i);
}
cout << "Size: " << vInt.size() << endl;
cout << "At position 4: " << vInt.at(4) << endl;
vInt.pop_back();
cout << "New size: " << vInt.size() <<... | true |
4adba8e02c33cd3ee7b52ec12bb1dd17e4ee10ad | C++ | Map1eUM/OI-Problem-Codes-rqy | /BZOJ/BZOJ3211.cpp | UTF-8 | 1,667 | 2.609375 | 3 | [] | no_license | /**************************************************************
* Problem: BZOJ3211
* Author: Rqy
* Date: 2018 Feb 24
* Algorithm:
**************************************************************/
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cmath>
typedef long long LL;
const int N = 100050;
in... | true |
58bcc14237befd9f59877a2ee68dd81b26124ee3 | C++ | daversun/fastqueue | /src/main.cpp | UTF-8 | 3,464 | 2.734375 | 3 | [] | no_license | #include <fastqueue.h>
#include <chrono>
#include <numeric>
#include <unistd.h>
#include <signal.h>
#define DATA_LEN 64
uint8_t data[DATA_LEN] = {"hello_world"};
uint32_t consumer_num = 6, producer_num = 6, p[64] = {0}, c[64] = {0};
FastQueue* fastqueue = NULL;
std::chrono::steady_clock::time_point start;
void sigInt(i... | true |
c92d3277a7bcd1855ab0db22a0596ba1cfb3c544 | C++ | honoriocassiano/cfpmm | /src/Instance.h | UTF-8 | 1,315 | 2.796875 | 3 | [
"MIT"
] | permissive | /*
* Instance.h
*
* Created on: 23 de out de 2016
* Author: cassiano
*/
#ifndef INSTANCE_H_
#define INSTANCE_H_
#include <cstddef>
#include <vector>
#include "Item.h"
namespace cfpmm {
class Solution;
class Ant;
class Colony;
class Instance {
public:
/**
* @param nItems Number of items
* @param nK... | true |
52a74bc769cdf5de685aac268c16cd37f8c70732 | C++ | george16886/30-Day-LeetCoding-Challenge | /202004/12 Last Stone Weight.cpp | UTF-8 | 2,295 | 3.546875 | 4 | [] | no_license | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
class Solution1 {
public:
int lastStoneWeight(vector<int>& stones) {
while (stones.size() > 1) {
sort(stones.begin(), stones.end());
int diff = stones[stones.size() - 1] - stones[ston... | true |
e01f11e81319132eab007587243f99984c08edaa | C++ | shubham1592/force | /C/fileHandling.cpp | UTF-8 | 961 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
ifstream obj("file1.txt");
char arr1[100];
obj.getline(arr1,100);
cout<<"The file contains: "<<endl<<arr1;
cout<<"\nFile read operation successful!";
template <typename U, typename T>
U add(U x, T y)
{
return ... | true |
90f549a9c077bdd108435637ae54eb5f3151bc75 | C++ | sumeshnb/progPuzzles | /template_alias.cpp.cpp | UTF-8 | 296 | 2.796875 | 3 | [] | no_license | //
// Created by sumesh on 1/8/2016.
//
#include <vector>
#include <iostream>
using namespace std;
int main(){
using intvec = vector<int,allocator<int>>;
intvec a{1,2,3,4,5};
//for(auto &i: a)cout<<i<<endl;
for(auto &j: {1,2,3,4,5,6,7,8,9,10})cout<<j<<endl;
}
| true |
05f7f4f9625a61f2ad3a4f3dc524f4e01bb5eb43 | C++ | RoboDK/Plug-In-Interface | /PluginBallbarTracker/PluginBallbarTracker.cpp | UTF-8 | 15,892 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "PluginBallbarTracker.h"
#include <QAction>
#include <QStatusBar>
#include <QMenuBar>
#include <QtMath>
// Get the list of parents of an Item up to the Station, with type filtering (i.e. [ITEM_TYPE_FRAME, ITEM_TYPE_ROBOT, ..]).
static QList<Item> getAncestors(Item item, QList<int> filters = {}){
Item par... | true |
5e072b0f9102f1ae46b187526df493934efc2e1e | C++ | taboege/libpropcalc | /core/dimacs.cpp | UTF-8 | 2,887 | 2.515625 | 3 | [
"Artistic-2.0"
] | permissive | /*
* dimacs.cpp - DIMACS CNF files
*
* Copyright (C) 2020 Tobias Boege
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Artistic License 2.0
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the impli... | true |
f7dc3a47c8227f03732601135ef32035ce06cb8e | C++ | Sashank1991/ObjectOrientedConcepts | /filerdwr.cc | UTF-8 | 5,350 | 3.59375 | 4 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <iterator>
using namespace std;
//function declaration for reading the file
void FunRead(string strFileName);
//function declaration for writing he file
void FunWrite(string strFileName,string... | true |
9fbc9cca69d236ea5be1d6c6ea23929ff314af11 | C++ | weisberger/DNA-Analyzer-System | /DNA/Controller/Pair.cpp | UTF-8 | 1,519 | 2.671875 | 3 | [] | no_license | //
// Created by wiseberg on 1/5/19.
//
#include <sstream>
#include "Pair.h"
#include "PairDecorator.h"
void Pair::action(DnaData &dnaData, char **args)
{
std::string subId = args[0];
size_t id;
subId = subId.substr(1);
std::stringstream ss(subId);
ss >> id;
DnaMetaData & dnaMetaData = dnaDat... | true |
7c5ecde58b4ddd10aaa2ef1ba4069062758e7e3e | C++ | matthewschallenkamp/Euler | /C++/u78.cpp | UTF-8 | 3,092 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <gmp.h>
using namespace std;
void pilesm(int n, int m, mpz_t &out);
long long piles(long long n);
set<multiset<long long> > splits(long long s, long long n);
int main()
{
int i;
//long long n;
mpz_t n;
mpz_init(n);
... | true |
4510af717dcbe27900ba3f0ebeda78d8d7368842 | C++ | treepobear/HelloWorld | /OS课程设计/模拟银行家算法/模拟银行家算法.cpp | UTF-8 | 7,363 | 2.625 | 3 | [] | no_license | #include "pch.h"
#include<stdio.h>
#define resourceNum 3
#define processNum 5
//系统可用(剩余)资源
int available[resourceNum] = { 3,3,2 };
//进程的最大需求
int maxRequest[processNum][resourceNum] = { {7,5,3},{3,2,2},{9,0,2},{2,2,2},{4,3,3} };
//进程已经占有(分配)资源
int allocation[processNum][resourceNum] = { {0,1,0},{2,0,0},{3,0... | true |
54e9f794cfc13b609fa32b772e49e48a524138bc | C++ | WojciechKroczak/MPGK | /GrafikaKroczakZadanie0/Source.cpp | UTF-8 | 19,670 | 2.71875 | 3 | [] | no_license | #include "Header.h"
#include<iostream>
#include<fstream>
#include<string>
#include <sstream>
GLuint ProgramMPGK::VAO;
GLuint ProgramMPGK::VBO;
GLuint ProgramMPGK::IBO;
GLuint ProgramMPGK::programZShaderami;
GLuint ProgramMPGK::vertexShaderId;
GLuint ProgramMPGK::fragmentShaderId;
GLint ProgramMPGK::zmiennaShader;
GL... | true |
fc348c5636f249f87ef39d380682397872ccaa87 | C++ | zhangq49/JianzhiOffer | /array/42.max_sum_of_sequence_sub_array.cpp | UTF-8 | 739 | 3.40625 | 3 | [] | no_license | #include <vector>
#include <iostream>
using namespace std;
int FindGreatestSumOfSubArray2(vector<int> array) {
int maxSum = 0x80000000, prevSum = 0;
for (int i = 0; i < array.size(); i++) {
prevSum = (prevSum > 0) ? prevSum + array[i] : array[i];
maxSum = max(maxSum, prevSum);
}
return maxSum;
}
int FindGr... | true |
7bf2ba699a257803ada63097d99423bc0e542e0a | C++ | tauhrick/Competitive-Programming | /Contests/Codeforces/Ed-R-106/1499E.cpp | UTF-8 | 3,553 | 2.75 | 3 | [] | no_license | #ifndef LOCAL
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#else
#include "Debug.hpp"
#endif
template <uint32_t mod>
class Modular {
public:
Modular(int64_t _n = 0) : n(uint32_t((_n >= 0 ? _n : mod - (-_n) % mod) % mod)) {}
uint32_t get() const { return n; }
bool operator==(const Modular... | true |
5155b9666bba3b9bc1af33441ce5c6eaebd1cb6e | C++ | shiva-6/Codeforces | /Ed_84/B.cpp | UTF-8 | 967 | 2.640625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int tt;
int main(){
cin>>tt;
while(tt--){
int n;
cin>>n;
vector<vector<int> > queens(n+1);
unordered_set<int> king;
unordered_set<int> queen;
for(int i=1,k;i<=n;i++){
cin>>k;
for(int j=0,c;j<k;j... | true |