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
79ea6994db04a56eaa25b5b00972a20a789ebc7a
C++
apgearhart1/EECS560Labs
/Lab1/Node.h
UTF-8
1,622
3.265625
3
[]
no_license
/*@author Aaron Gearhart @file Node.h @date 9/19/2018 @brief This file is the header file for the Node object. Contains methods to manipulate the each node in the list. */ #ifndef NODE_H #define NODE_H class Node { private: int m_entry; Node* m_next; bool m_first; public: /* @pre none * @post sets th...
true
cb448930522e18373ae5a95b991a7266b86a4a7b
C++
michaeloed/DecoderPro_app
/libPr3/defaultmemory.h
UTF-8
776
2.671875
3
[]
no_license
#ifndef DEFAULTMEMORY_H #define DEFAULTMEMORY_H #include "abstractmemory.h" class DefaultMemory : public AbstractMemory { Q_OBJECT public: explicit DefaultMemory(QString sysName, QString userName="", QObject *parent = 0); /** * Provide generic access to internal state. *<P> * This generally ...
true
8f9d33352c4d203b30194d62c5034255137d4026
C++
bmal/trash
/test_accumulate2.cpp
UTF-8
2,340
3.484375
3
[]
no_license
#include <iostream> #include <thread> #include <future> #include <vector> #include <algorithm> using namespace std; class join_threads { public: explicit join_threads(vector<thread>& threads) : threads_(threads) {} ~join_threads() { for(auto& elem : threads_) ...
true
fed24f0260849749f961f0fe5e2041c2755ddc8a
C++
jensecj/code-challenges
/hackerrank/cracking-the-coding-interview/10-stacks-balanced-brackets.cpp
UTF-8
1,096
4.125
4
[]
no_license
/* tags: stack, paren matching task: given a string of braces (parens, curly braces, and brackets), check if the string is balanced (each opening has a corresponding ending in a proper place) */ #include <iostream> #include <string> #include <stack> using namespace std; int main() { int n; // number of stri...
true
b780d1df1c2e1812574cfc4c8d8a57925f70d4b2
C++
Takos4Lunch/proyecto-II
/Materia.h
UTF-8
483
2.515625
3
[]
no_license
#ifndef MateriaH #define MateriaH #include <fstream> using namespace std; class Materia { // Private section public: int cod=0;//Codigo char tit[80],uc[1] ;//titulo de la materia, unidades de credito fstream y; Materia(); Materia(int cd, char tt[80],char *ucc); void save(int cd, char tt[80],char *uc,Mat...
true
5d926eb876067479469644675173e72817977d8f
C++
VibhorKanojia/Programming
/Codeforces/312_2/largeArray.cpp
UTF-8
1,204
2.75
3
[]
no_license
#include <bits/stdc++.h> using namespace std; #define MAXN 1000001 struct data{ int count; int start; int end; }; int main(){ ios::sync_with_stdio(false); int n; cin >> n; map<int, struct data> mymap; map<int, struct data>::iterator it; int index = 0; for (int i = 0 ; i < n ; i++){ index+...
true
4172cfed3fe2a89cd7e2d510a411bd85c467d751
C++
shasan247/LPG-MONITOR
/AlarmUnitV4_mqtt_final_pulled_up - OFFLINE STORAGE - No Debug/main/wifi_manager.ino
UTF-8
1,882
2.734375
3
[]
no_license
//for power and net status void toggleLed() { // digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // set pin to the opposite state digitalWrite(STATUS_LED, !digitalRead(STATUS_LED)); } void alwaysOnLed(){ // digitalWrite (LED_BUILTIN, LOW); digitalWrite(STATUS_LED, HIGH); } void...
true
db79ece2d4e39361e9c892b56d22ec535a974af5
C++
TankKingOne/NewCodeANDLeetCode
/牛客网-分解因数.cpp
GB18030
559
3.625
4
[]
no_license
#include <cstdio> #include <cmath> #include <iostream> int main() { unsigned int n; while (std::cin >> n) { printf("%d =", n); //90 = for (unsigned i = 2; i <= std::sqrt(n); i++) { while (n % i == 0 && n != i) //ͬһֱųպǸnη { printf(" %u *", i); //һδӡ 2 *,ڶδӡ 3 * n /= i; //޸nֵ } } printf(" %d...
true
924062bfdf3f9493f0739afc9615fb866aba769f
C++
borrislevin/TIL
/TIL/test.cpp
UTF-8
456
3.34375
3
[]
no_license
#include <iostream> #include <string> using namespace std; class Shape { public: virtual ~Shape() {} virtual void draw() = 0; virtual Shape* Clone() = 0; }; class Rect : public Shape { public: void draw() override { cout << "Rect draw" << endl; } Shape* Clone() override { return new Rect(*this); } }; int main(...
true
ec8743fdbbd30548fb998220f2f144342d7ba4bb
C++
xche03/CPP-Primer-5th
/Ch3/Exercise 3.44.cpp
UTF-8
1,154
4.15625
4
[]
no_license
/*Exercise 3.44: Rewrite the programs from the previous exercises using a C++ Primer, Fifth Edition type alias for the type of the loop control variables.*/ #include <iostream> #include <vector> #include <iterator> using namespace std; int main() { int ia[3][4] = { // three elements; each element is an array of size...
true
891f0edfabb167ea9ff2c2e89f1edb183ec8e964
C++
jcyesc/assembly-language-computer-architecture
/architecture/H1/chapter7/problem52/program_c.cpp
UTF-8
247
3.234375
3
[]
no_license
// Program 7.52 #include <iostream> using namespace std; int a = 5; void f(int x) { cout << "x = " << x << endl; cout << "a = " << a << endl; } int main() { f(a++); // is a incremented before f is executed ? YES return 0; }
true
7d7ac4e700df6ced444260412985ef6b8471dd0c
C++
i-n-d-i/msu-practicum-5semestr
/home3/2.cpp
UTF-8
2,817
3.640625
4
[]
no_license
#include <iostream> #include <vector> #include <cmath> const float INF = 1000000001.0; class TGraph { private: uint32_t VerticesNumber; std::vector<std::pair<uint32_t, uint32_t>> Cities; std::vector<std::vector<std::pair<uint32_t, uint32_t>>> SpecialCities; public: TGraph(); TGraph(uint32_t n); ...
true
411f6234a37ce525f38c3e881001201e3870980e
C++
YernurSFU/libflow
/example/leetcode1437.cpp
UTF-8
987
3.53125
4
[]
no_license
#include <flow.hpp> // Given an array nums of 0s and 1s and an integer k, return True if all 1's are // at least k places away from each other, otherwise return False. // https://leetcode.com/problems/check-if-all-1s-are-at-least-length-k-places-away/ constexpr auto k_length_apart = [](const auto& arr, int k) { ...
true
f78da060d8ec55e63f0c5b540a46be1d1f8b9662
C++
tylermccreary/CS420-Compilers
/buffer.cc
UTF-8
2,299
3.75
4
[]
no_license
#include "buffer.h" // Open the source file and initialize the buffer. Buffer::Buffer(char *filename) { source_file = new ifstream(filename); b = new list<char>(); fill_buf(); } // Close the file and cleanup. Buffer::~Buffer () { if(source_file -> is_open()) { source_file -> close(); } if(source_file !=...
true
5ad002f6da091d64647c694714ede86e5918b9f7
C++
aleks73337/Lib
/Autor.cpp
UTF-8
277
2.78125
3
[]
no_license
#include "Autor.h" void Autor::setAutName(const std::string& name_) { autName = name_; } std::vector<Book>& Autor::getAutorBooks() { return (Books); } const std::string& Autor::getAutName() { return autName; } void Autor::addBook(Book& book) { Books.push_back(book); }
true
cccef5420f11417c076745a94e42f35c3ca37e02
C++
shayslonim/MileStone
/Expression/EqualsExpression.cpp
UTF-8
462
2.921875
3
[]
no_license
// // Created by shira on 12/24/18. // #include "EqualsExpression.h" /** * Evaluate == * @return double 0 or 1 */ double EqualsExpression::calculate() { double result = this->getLeft()->calculate() == this->getRight()->calculate() ? TRUE : FALSE; return result; } /** * Constructor * @param left Expressi...
true
ced2d3d5c1daee09f16b9827d32168854ea4139c
C++
ghali/gcb
/GLOW/03/determinant.h
UTF-8
1,443
2.6875
3
[]
no_license
/* The following code example is described in the book "Introduction * to Geometric Computing" by Sherif Ghali, Springer-Verlag, 2008. * * Copyright (C) 2008 Sherif Ghali. This code may be freely copied, * modified, or republished electronically or in print provided that * this copyright notice appears in all...
true
1abe9eb3a9fa52bee2a784605c739c84af905709
C++
flexatone/arachnewarp
/awmonodim/src/core/aw_Output.cpp
UTF-8
3,539
2.59375
3
[]
no_license
/*! \file aw_Output.cpp \brief Object model of output stream Created by Christopher Ariza on 6/30/10. Copyright 2010 Flexatone HFP. All rights reserved. */ #include <sndfile.hh> #include <boost/scoped_array.hpp> #include "aw_Output.h" #include "aw_Generator.h" namespace aw { // =======================...
true
90aa8564de6bc31f08d788d697d842774eb0fe3f
C++
lljjff/PCA
/princomp.cpp
UTF-8
6,971
2.84375
3
[]
no_license
#include "princomp.h" #include <math.h> #include <QLineF> #include <QPointF> #include <QDebug> namespace pca { int PrinComp::m_dimension = 2; // Вычисление средних void PrinComp::computeMeans(vector<QPointF> points, vector<double> & means) { // Инициализация means[0] = 0; me...
true
4be3938898281df493911be56c7044d53e5ab990
C++
alexandrekcosta/cpp
/cprojects/mathOperations/main.cpp
UTF-8
463
3.703125
4
[]
no_license
#include <iostream> using namespace std; int n1,n2;//Global variables int main() { int n3,n4; //Local variables //Operators: + - / * % () int r,r1,r2; n1 = 11; n2 = 3; n3 = 5; n4 = 2; r = (n1+n2)*n4; r1 = n1/n2; r2 = n1%n2; ...
true
c983670b82fce01867c25ae64f4652150045f809
C++
dakins1/dabs
/hw5_FileLinkedList/ArrayListTestCode.cpp
UTF-8
1,937
3.046875
3
[]
no_license
#include <iostream> using namespace std; #include "FileArrayList.h" int main() { //testing opening FileArrayList<int> testOpen("myFile.txt"); //if (testOpen.size() != 0) cout << "initializer test failed\n"; //push_back for (int i=0; i!=10; i++) { testOpen.push_back(i); if (testOpen...
true
472f25b7a2cf613d9966663221f2720746bf7410
C++
shaosHumbleAccount/roso_viz
/roso_viz/Setting/settingcenter.cpp
UTF-8
999
2.6875
3
[ "MIT" ]
permissive
#include "settingcenter.h" #include <QMessageBox> SettingCenter* global_settingCenter_instance = NULL; SettingCenter::SettingCenter(QObject *parent) : QObject(parent), settings("rosoviz.ini",QSettings::IniFormat) { if(!settings.contains("network/port")) { QMessageBox::warning(NULL, "rosoviz.in...
true
8b1196fe47755e56e4c5d133cb2a9c8792de124f
C++
YannDubs/modellingBacterias
/src/Lab/TwitchingBacterium.hpp
UTF-8
2,222
2.71875
3
[]
no_license
#ifndef TWITCHINGBACTERIUM_HPP #define TWITCHINGBACTERIUM_HPP #include "Bacterium.hpp" #include "Grip.hpp" #include "Utility/Vec2d.hpp" //il faut prédeclarer chaque nutriment pour casser la dependance circulaire class Nutriment; class NutrimentA; class NutrimentB; enum States { IDLE, WAIT_TO_DEPLOY, ...
true
02d96df89c1bd728887719057d45857884799882
C++
deliangyang/Data-Structure
/chapter14/14.12/Dict.h
UTF-8
1,534
3.15625
3
[]
no_license
#ifndef __DICT_H__ #define __DICT_H__ #include "HashTable.h" #include "KeyValue.h" #include "HashTableIterator.h" #include "Linked.h" template<class K, class V> class Dict:public HashTable<KeyValue<K, V> > { public: // destructor Dict(const V &defval, unsigned long hashf(KeyValue<K, V> key)); // operator method ...
true
e2b7925a7a8b4cb99b0396f2f9c99b181409027d
C++
gitgaoqian/C
/BalanceBinaryTree/balancebinarytree.cpp
UTF-8
2,321
3.421875
3
[]
no_license
//关于平衡二叉树学习内容比较复杂一点.尤其是左平衡和右平衡函数.没有掌握 //平衡二叉树接口 #define LH 1 #define EH 0 #define RH -1 #define TREE_TYPE char //定义二叉树存储的数据类型 typedef struct BIT_NODE { TREE_TYPE data; int bf;//相比二叉树,增加BF因子 struct BIT_NODE *lchild; struct BIT_NODE *rchild; } BITNode, *BITree; //右旋函数 void R_Rotation(BITree *T)//传入最小非平衡树,...
true
ea55ea7a66b7a42ad81aee9649303b27aed8018a
C++
juwon0605/algorithm_basics
/1.코드구현력 기르기/07. 영어단어 복구.cpp
UTF-8
1,213
3.078125
3
[]
no_license
// #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<string> using namespace std; /* 7. 영어단어 복구 현수의 컴퓨터가 바이러스에 걸려 영어단어가 뛰어쓰기와 대소문자가 혼합되어 표현된다. 예를 들면 아름다운 이란 뜻을 가지고 있는 beautiful 단어가 “bE au T I fu L” 과 같이 컴퓨터에 표시되고 있습니다. 위와 같이 에러로 표시되는 영어단어를 원래의 표현대로 공백을 제거하고 소문자화 시켜 출력하는 프로그램을 작성하세요. */ int main() { // fr...
true
5fda5ae272f516ecf6df5ffb352a10ed781c908f
C++
SeoGB/exam
/GraphicEditor/GEllipse.cpp
UHC
14,035
2.546875
3
[]
no_license
/* [ GEllipse Ŭ by ] ** GEllipse Ŭ Ӽ ŬԴϴ. */ #include "StdAfx.h" #include "GEllipse.h" enum POSITION_LIST {TOPLEFT, HALFTOPLEFT, BOTTOMLEFT, HALFBOTTOMLEFT, BOTTOMRIGHT, HALFBOTTOMRIGHT, TOPRIGHT, HALFTOPRIGHT}; IMPLEMENT_SERIAL(GEllipse, GObject, 0) //-------------------------------------------------------...
true
74a17d718caf97c4ad66792226a71234fdcc246a
C++
fofoni/atfa
/src/utils.h
UTF-8
4,079
2.515625
3
[]
no_license
/* * Universidade Federal do Rio de Janeiro * Escola Politécnica * Projeto Final de Graduação * Ambiente de Teste para Filtros Adaptativos * Pedro Angelo Medeiros Fonini * Orientador: Markus Lima */ /** * * \file utils.h * * Holds convenient definitions and other utilities. * * \author Pedro Angelo Medeir...
true
9766377257df91a1d314947d881c8e12c6f93940
C++
varsanyikaroly/Munka
/amobaobjekt.cpp
UTF-8
4,710
3.265625
3
[]
no_license
#include <iostream> #include <vector> using namespace std; const int hossz = 9; // tárolja a bábukat, kirajzolja a táblát. class tabla { char helyek[hossz]; public: tabla(); void valaszthato(); void tablakiir (); bool lepes(int hova, char mit); char hely(int melyik); }; tab...
true
5875acb0d9b6028472ff74338b998258fc4c8888
C++
manojk16/Dream_2019
/cpp_src/Increment_op_ooverloading.cc
UTF-8
987
3.8125
4
[]
no_license
/* * Increment_op_ooverloading.cc * * Created on: Jul 23, 2019 * Author: user1 */ #include <iostream> using namespace std; class Time { int hours; int minutes; public: Time() { hours = 0; minutes = 0; } Time(int h, int m) { hours = h; minutes = m; } void display() { cout << "Total Time i...
true
7382acea0b30fe3e7c9c04dadb6acf03ff93d700
C++
STEllAR-GROUP/hpx_historic
/examples_07.16.13/gravity/gravity_dataflow/gravity_dataflow.hpp
UTF-8
2,944
2.65625
3
[]
no_license
/////////////////////////////////////////////////////////////////////////////// /////////////////// Gravity Dataflow Header File //////////////////////// //Copyright (c) 2012 Adrian Serio // //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www...
true
5beee550faa22fa46e3cd021218465e60e88cfb8
C++
leios/simuleios
/FDTD/inv_lens/geometrical.cpp
UTF-8
8,059
3.1875
3
[ "MIT" ]
permissive
/*-------------geometrical_optics.cpp-----------------------------------------// * * geometrical optics * * Purpose: to simulate light going through a lens with a variable refractive * index. Not wave-like. * * Notes: This file was mostly written by Gustorn. Thanks! * *--------------------------...
true
b884aab4b2621acae4f7b0e3c3515d6e16dde0f9
C++
joaopmatias/Competitions
/leetcode/1-50/720.h
UTF-8
882
2.78125
3
[]
no_license
class Solution { public: string longestWord(vector<string>& words) { vector < vector < string > > dic (33); vector < string > current, next; int i, j, k, n; for(i = 0; i < words.size(); i++) dic[words[i].size()].push_back(words[i]); current = dic[1]; for(i = 2; i < 33...
true
862b4dc0360c7060ceb3bc6fb7431fa783bc690d
C++
SaracenOne/renik
/renik/renik_limb.h
UTF-8
2,048
2.578125
3
[ "MIT" ]
permissive
#ifndef RENIK_LIMB_H #define RENIK_LIMB_H #include <scene/3d/skeleton.h> struct RenIKLimb : public Resource { GDCLASS(RenIKLimb, Resource); public: Transform upper; Transform lower; Transform leaf; BoneId leaf_id = -1; BoneId lower_id = -1; BoneId upper_id = -1; void set_leaf(Skeleton *skeleton, BoneId p_le...
true
43f20ad9a14c7e420b9da68809b34f04e66af9fe
C++
RaBuko/SzeregowanieZadan
/SzeregowanieZadan/GA.cpp
UTF-8
6,990
3
3
[]
no_license
#include "GA.h" string GA(vector <Task*> & problemData, int populationCount, int numberOfIterations, double percentChanceOfMutation, bool print) { string toReturn = ""; // generowanie populacji startowej vector <vector <Task*>> population; vector <vector <Task*>> nextGeneration; pair <vector<Task*>, vector<Tas...
true
a628ba5a1eedf3589cf3e2605c4b026b55f1419b
C++
lukaa12/TKOM-simple_language_interpreter
/src/stdlib/Functions.cpp
UTF-8
6,027
2.90625
3
[]
no_license
#include "Functions.h" #include "../Error.h" using namespace tkom; using namespace lib; GLuint compileShaders(); GLFWwindow* initWindow(GLuint w, GLuint h); // Shaders const GLchar* vertexShaderSource = "#version 330 core\n" "layout (location = 0) in vec2 position;\n" "uniform mat3 transform;\n" "void main()\n" "{\n...
true
e9cb4766eff567f1a55eb45fd43b471ab651feeb
C++
ezhangle/MinkowskiEngine
/src/broadcast.hpp
UTF-8
4,616
2.609375
3
[ "MIT" ]
permissive
#ifndef CPU_BROADCAST #define CPU_BROADCAST #include "math_functions.hpp" #include "utils.hpp" template <typename Dtype, typename Itype> void BroadcastForwardKernelCPU(const Dtype *p_in_feat, int in_nrows, const Dtype *p_in_feat_global, int in_nrows_global...
true
a950455144af37a2ef4201eb122e0f81dc10ed0e
C++
kaba2/pastel
/pastel/geometry/overlap/overlaps_plane_triangle.h
UTF-8
1,514
3.15625
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
// Description: Overlap tests between a plane and a triangle #ifndef PASTELGEOMETRY_OVERLAPS_PLANE_TRIANGLE_H #define PASTELGEOMETRY_OVERLAPS_PLANE_TRIANGLE_H #include "pastel/geometry/shape/plane.h" #include "pastel/geometry/shape/triangle.h" #include "pastel/sys/mytypes.h" namespace Pastel { //! Test...
true
fb2ffe1cfdb6dde645877f69772a0f61c5551a90
C++
RYNO8/BigInt-cpp
/sample.cpp
UTF-8
349
3.078125
3
[]
no_license
#include <iostream> #include <string> #include "BigInt.hpp" using namespace std; int main() { BigInt num1 = (string)"01189998819991197253"; BigInt num2; cin >> num2; cout << "Num2 is : " << num2 << "\n"; cout << num1 + num2 << "\n"; cout << num1 * num2 << "\n"; cout << num1 - num2 << "\n"; cout ...
true
778d26d4b9248d233620d18b256e304d4616bd72
C++
ackevil/TCP-Server
/main.cpp
UTF-8
513
2.515625
3
[]
no_license
/* * main.cpp * * Created on: 2017年2月27日 * Author: ackevil */ #include <iostream> #include <string> #include <unistd.h> #include <cstdlib> #include "tcpServer.h" using namespace std; int main(int argc,char* argv[]){ int opt=0; string ip="127.0.0.1"; int port=getuid()==0?80:8080; while((opt=getopt(argc,ar...
true
3ad716721dd8f995f6d67a7aa35e1fb6f582efe0
C++
mikehershey/bamf
/Bamf/SynchronousGameLoop.h
UTF-8
1,088
2.828125
3
[]
no_license
// // SynchronousGameLoop.h // Bamf // // Created by Matthew Hinkle on 2/1/13. // // #ifndef __Bamf__SynchronousGameLoop__ #define __Bamf__SynchronousGameLoop__ #include <SDL2/SDL.h> #include "GameLoop.h" namespace bamf { /** The instructions in a SynchronousGameLoop will execute each subsystem in order. Thi...
true
624ddaae674889624a67d31703844f715ffcaac6
C++
btrangcal/CS162-Final-Project-version-3
/Lounge.cpp
UTF-8
3,435
3.328125
3
[]
no_license
#include "Lounge.hpp" #include <iostream> char Lounge::sequence() { int userChoice; //rat is still alive and didn't speak to hostess if(!ratDead && !spokeHostess ) { std::cout << "\nPlease make a selection below.\n"; std::cout << "---------------------------------\n"; std::cout << "(1) Talk to t...
true
2f3bae7429e42f00c52a67ce80783354d436feae
C++
jiny9395/AlgorithmStudy
/ex17822.cpp
UTF-8
2,834
2.84375
3
[]
no_license
#include <stdio.h> #include <queue> #include <string.h> #define MAX 50 using namespace std; int N, M, T; int circle[MAX + 2][MAX + 2]; bool visited[MAX + 2][MAX + 2]; int dy[] = { 0,0,-1,+1 }; int dx[] = { -1,+1,0,0 }; int getSum() { int sum = 0; for (int i = 1; i <= N; i++) { for (int j = 1; j <= M; j++) { s...
true
4dbdef6b0c81176f8c3889846b922f47a0b148f7
C++
BlueSquid1/NANE
/NANE/src/NES/APU/ApuMemoryMap.cpp
UTF-8
7,823
2.546875
3
[]
no_license
#include "ApuMemoryMap.h" namespace { const int JOYSTICK_STROBE_ADDRESS = 0x4016; } ApuMemoryMap::ApuMemoryMap() : IMemoryRW(0x4000, 0x4017), sq1(false), sq2(true) { } bool ApuMemoryMap::PowerCycle() { bool regReturn = this->GetRegisters().PowerCycle(); if(regReturn == false) { return fal...
true
edc3a629e31db99f23bc791d86f99fd77de09126
C++
InjectiveSheaf/image-segmenter
/drawer.h
UTF-8
607
2.734375
3
[]
no_license
#ifndef DRAWER_H #define DRAWER_H #include <QImage> #include <QColor> /* Класс Drawer * Qimage Filter - медианный фильтр * Qimage Draw_Contours - рисует контуры цветом color * bool Is_boundary - определяет, находится ли пиксель на границе компоненты связности */ class Drawer{ public: QImage Filter(const QImag...
true
b55d9ff4f19986c1233ed525cc65061183d0ed44
C++
cetcjinjian/SysCtrl
/SysCtrl/CmdData.cpp
UTF-8
718
2.65625
3
[]
no_license
#include "stdafx.h" #include "CmdData.h" CCmdData::CCmdData() { m_length = sizeof(data1) + sizeof(data2) + sizeof(data3); } CCmdData::~CCmdData() { } int CCmdData::HandleData(unsigned char* ptr, int len) { int begin = 1; memcpy(&data1, ptr + begin, 4); begin += 4; memcpy(&data2, p...
true
d632e5db8c0c0539f2d0d9cafe9b25854279bc98
C++
yangzhilinAndy/algorithm-exercise
/bit manipulation/29_11_2018-338. Counting Bits.cpp
UTF-8
246
3.15625
3
[]
no_license
//Use a bit manipulation trick class Solution { public: vector<int> sol; vector<int> countBits(int num) { sol.push_back(0); for (int n=1; n<=num; n++) sol.push_back(sol[n/2]+n%2); return sol; } };
true
4c8c607525c5bd1cd9742af7d1ac0d4c4618d6d0
C++
Refuge89/WoWCraft
/directory.h
UTF-8
1,635
2.9375
3
[]
no_license
#ifndef DIRECTORY_H #define DIRECTORY_H #include <QDir> #include <QFileDialog> #include <QApplication> #include "config.h" class directory { private: QDir m_dir; public: directory(QString path) : m_dir(path) { } ~directory(){} void configure(QString path){ m_dir.setPath(path); } ...
true
be7b969eda9c5b1a6e65ee5d8cd28e05a353d6e5
C++
lock19960613/SCL
/SCL/Sort/MergeSort/mergeSort.cpp
UTF-8
1,332
3.15625
3
[]
no_license
#include <iostream> using namespace std; //归并排序分为三步 //1 选中间点 //2 归:递归的排序左半边的右半边 //3 并:利用一个额外的数组,合并两个已经排序的部分 const int N= 1e5 + 10; int q[N],temp[N]; //自底向上 void mergeSort(int q[],int l,int r){ if(l >= r){ return; } // >>的优先级是低于+的 int mid = l + r >> 1; //不建议使用mid - 1 分割 //因为向下取整的话,造成m...
true
ecbce7edddcb1d0f05dabb712db5b2e940fb3253
C++
pengjunjie1207/robot
/grayscale_sensor/grayscale_sensor.ino
UTF-8
8,178
2.875
3
[]
no_license
//const int linePin[0] = 22; //const int linePin[1] = 28; //const int linePin[2] = 34; //const int linePin[3] = 40; const int positionPin = 46; // four position and 46 is the leftest const int butPin = 52; const int grayPin = 0; const int seedPin = 1; // analog pin 1 should not be used const int pinNum = 32; const in...
true
65a1cbf6ce87604e58b06a8c3cb2407e74c13e53
C++
nat-chan/InteractiveCG
/Impressionist/impBrush.cpp
UTF-8
1,607
2.5625
3
[ "MIT" ]
permissive
// // impBrush.cpp // // The implementation of virtual brush. All the other brushes inherit from it. // #include "impressionistDoc.h" #include "impressionistUI.h" #include "impBrush.h" // Static class member initializations int ImpBrush::c_nBrushCount = 0; ImpBrush** ImpBrush::c_pBrushes = NULL; ImpB...
true
d9a928be3ba041582a1ac0be72aea54c6c53fdf4
C++
gianct79/bst
/ransom note (str).cpp
UTF-8
536
3.1875
3
[]
no_license
#include <iostream> using namespace std; bool ransom_note(string const &magazine, string const &ransom) { int count[128] = {0}; for (auto &c : magazine) { count[c]++; } for (auto &c : ransom) { if (!count[c]) { return false; } count[c]--; } return tr...
true
21e6816f618d834909b848febe1ead5893ea15ff
C++
Randl/CS
/External sort/filesize.cpp
UTF-8
347
2.734375
3
[]
no_license
// // Created by Evgenii on 28.09.2015. // #include <fstream> #include "filesize.h" int64_t file_size(const std::string filename) { std::ifstream file(filename.c_str(), std::ifstream::in | std::ifstream::binary); if (!file.is_open()) { return -1; } file.seekg(0, std::ios::end); int size = file.tellg(); file...
true
308e97dd48474414a1bece69d3148e68450a33b6
C++
LeBronWilly/Engineering_Cpp
/ch02/prog2_5.cpp
BIG5
488
3.671875
4
[]
no_license
// prog2_5, yN~{ #include <iostream> // tAiostreamɮ #include <cstdlib> // tAcstdlibɮ using namespace std; int main(void) { int num1=35; // ŧiܼ num1Aó]Ȭ35 int num2=28; // ŧiܼ num2Aó]Ȭ28 cout<<"I have "<<num1<<" books."<<endl; cout<<"You have "<<num2<<" books."<<endl; cout...
true
f93cd14c6b8ec767135063f103f19a94f75dbf9f
C++
SCOTT-HAMILTON/monetcours-app
/builder.h
UTF-8
1,815
2.515625
3
[]
no_license
#ifndef BUILDER_H #define BUILDER_H #include <QObject> #include <QString> #include <QThread> #include <QDir> #include <QDebug> #include <QCoreApplication> #include <QProcess> #include <iostream> class MonetbuildThread : public QThread { Q_OBJECT public: explicit MonetbuildThread(QObject* parent = nullptr) : ...
true
7982cf94846a6a3eb4aaec701c604858918553ca
C++
sailzeng/zcelib
/src/commlib/zcelib/zce/util/singleton.h
UTF-8
5,277
3.140625
3
[ "Apache-2.0" ]
permissive
/*! * @copyright 2004-2013 Apache License, Version 2.0 FULLSAIL * @filename zce_boost_singleton.h * @author Sailzeng <sailzeng.cn@gmail.com> * @version * @date 2013年1月1日 * @brief signleton的模版实现。 * * @details * * @note 我其实并不特别赞同使用signleton的的模版,特别是所谓的小技巧的signleton的的模 * 版。你可以看到我的代码里面大部...
true
3d20ad1bf8e35185e0ef568fa342e910a63e0d20
C++
tjdgus3537/algorithm
/baekjoon/DP/9095.cpp
UTF-8
602
2.609375
3
[]
no_license
#include <iostream> using namespace std; void solution(); int main() { #ifdef _DEBUG freopen("/home/ubuntu/workspace/input", "r", stdin); #endif solution(); return 0; } void solution() { int dp[11] = {0,}; int T, n; dp[1] = 1; dp[2] = 2; dp[3] = 4; ...
true
846a8243697664b2edc53fc257c0f3fa1b7ab655
C++
Vancasola/DataStructure
/DataStructure/A1028.cpp
UTF-8
1,156
2.890625
3
[]
no_license
// // A1028.cpp // DataStructure // // Created by vancasola on 2019/12/31. // Copyright © 2019 none. All rights reserved. // 4:49 5:04 /* #include <stdio.h> #include <iostream> #include <string> #include <cstring> #include <algorithm> #include <vector> using namespace std; struct record { int id; string na...
true
2bc8c5e57f3822aec36fd3495774fa34d0ad70cf
C++
krystianwozniak92/ZSSK
/Source/CourierDelivery/CourierDelivery/Edge.h
WINDOWS-1250
252
2.765625
3
[]
no_license
#pragma once class Edge { public: // Wierzchoki int vertexA; int vertexB; // Konstruktor Edge(); // Konstruktor Edge(int, int); // Destruktor ~Edge(void); // Operator porwnania friend bool operator==(const Edge&, const Edge&); };
true
f8e8525197b4099c19c21326537756e4b2861234
C++
Jiyoung-h/algorithm
/programmers/2 x n 타일링.cpp
UTF-8
304
2.859375
3
[]
no_license
#include <string> #include <vector> using namespace std; int solution(int n) { vector<int> d; for(int i=0; i<n; i++){ if(i==0) d.push_back(1); else if(i==1) d.push_back(2); else d.push_back((d[i-1]+d[i-2])%1000000007); } int answer = d[n-1]; return answer; }
true
ea69b01e62350438aa32b5a8248752d597cd644d
C++
marc-hanheide/cogx
/subarchitectures/conceptual.sa/branches/avs-iros11/src/c++/conceptual/components/PlaceholderPropertyUpdater/PlaceholderPropertyUpdater.h
UTF-8
3,441
2.859375
3
[]
no_license
/** * @author Andrzej Pronobis * * Declaration of the conceptual::PlaceholderPropertyUpdater class. */ #ifndef CONCEPTUAL_PLACEHOLDERPROPERTYUPDATER_H #define CONCEPTUAL_PLACEHOLDERPROPERTYUPDATER_H #include <cast/architecture/ManagedComponent.hpp> #include "ConceptualData.hpp" #include "DefaultData.hpp" #include...
true
2f94ff443545864ee272a07554e9b2ca991ea986
C++
sshjj/note
/leetcode/DFS,BFS/695.岛屿的最大面积.cpp
UTF-8
1,456
3.515625
4
[]
no_license
给定一个包含了一些 0 和 1 的非空二维数组 grid 。 一个 岛屿 是由一些相邻的 1 (代表土地) 构成的组合,这里的「相邻」要求两个 1 必须在水平或者竖直方向上相邻。你可以假设 grid 的四个边缘都被 0(代表水)包围着。 找到给定的二维数组中最大的岛屿面积。(如果没有岛屿,则返回面积为 0 。) 示例 1: [[0,0,1,0,0,0,0,1,0,0,0,0,0], [0,0,0,0,0,0,0,1,1,1,0,0,0], [0,1,1,0,1,0,0,0,0,0,0,0,0], [0,1,0,0,1,1,0,0,1,0,1,0,0], [0,1,0,0,1,1,0,0,1,1,1,0,0], [0...
true
14653ddfe143fa85c222dd6ab9de2d3701d80e2e
C++
CODARcode/MGARD
/src/unstructured/estimators.cpp
UTF-8
3,094
2.53125
3
[ "Apache-2.0" ]
permissive
#include "unstructured/estimators.hpp" #include <cassert> #include <limits> #include <stdexcept> #include "blas.hpp" #include "unstructured/MassMatrix.hpp" namespace mgard { // We might be able to obtain better bounds by using some information about // the hierarchy. If I recall correctly, our proofs depend on (a...
true
260dcb22f03486866d4ec99f72d2baf98df304ac
C++
jing-zhao/algorithm
/array/minRangeIn2DArray.cpp
UTF-8
1,680
3.53125
4
[]
no_license
#include <vector> using namespace std; // There is two dimensional array where each sub array (row) is sorted, i.e. // [1 10000 2000] // [20 10001 5000] // [55 10002 222222]] // Find a minimum range contain a number from each row. For above array it should be (10000-10002) range vector<int> minRange(vector<vector<i...
true
8b73f30d31669fc2578fc0012ee3631afb9b5c1c
C++
dsalearning/Nano33-AIoT
/arduino.c/button2_LED/button2_LED.ino
UTF-8
499
2.890625
3
[]
no_license
#define BTN 2 #define LED 13 void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(BTN,INPUT_PULLUP); //1.1 上拉電阻 pinMode(LED,OUTPUT); } void loop() { // put your main code here, to run repeatedly: bool btnState = digitalRead(BTN); Serial.println(String(btnState)); if(btn...
true
a8fab2f5bad1242c2b493d6d1cc30af9687dead2
C++
mfurkin/logger
/LoggerList.cpp
ISO-8859-7
2,899
2.984375
3
[]
no_license
/* * LoggerList.cpp * * Created on: 22 . 2017 . * Author: */ #include "LoggerList.h" LoggerList& LoggerList::getLoggerList() { static LoggerList list; return list; } void LoggerList::addLogger(std::string name, std::string fname) { EnterCriticalSection(&c_section); // printf("LoggerList...
true
3f854ccae5cae2a75e3b705e404c74e15853a126
C++
mridulraturi7/Algorithms
/Searching Algorithms/Searching Problems/Problem11.cpp
UTF-8
822
3.640625
4
[]
no_license
/* Search an element in an Array. This problem is taken from GFG. Problem Statement - https://practice.geeksforgeeks.org/problems/search-an-element-in-an-array/0/?category[]=Searching&difficulty[]=-1&page=1&query=category[]Searchingdifficulty[]-1page1 Difficulty - Basic */ #include<iostream> using nam...
true
029aef1d5183699f28de1e0f5ccbc6af7349f554
C++
ZeroNerodaHero/USACO-Training-Gateway
/dp120On1/treasures.cpp
UTF-8
1,955
2.78125
3
[]
no_license
/* ID: billyz43 PROG: treasures LANG: C++11 */ #include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <cstring> #include <climits> #include <unordered_map> #include <iomanip> #include <cmath> #define INF 160000 std::ifstream in("treasures.in"); std::ofstream out("treasures.out"); using n...
true
0ad5b29d775e15306fab99bb5a0f5e397f2c799b
C++
mi2think/DoPixel
/DpLib/DpLog.cpp
UTF-8
2,011
2.515625
3
[]
no_license
/******************************************************************** created: 2016/01/07 created: 7:1:2016 23:33 filename: D:\OneDrive\3D\DpLib\DpLib\DpLog.cpp file path: D:\OneDrive\3D\DpLib\DpLib file base: DpLog file ext: cpp author: mi2think@gmail.com purpose: Log *************************************...
true
cfc1767a4fa19a36e5c1f9a3a1e54a388b1a0699
C++
shinbyh/ns3-p2p-wmn
/route_flow_accept_request.cc
UTF-8
4,168
2.671875
3
[]
no_license
/* * route_flow_accept_request.cc * * Created on: Feb 17, 2018 * Author: bhshin */ #include "route_flow_accept_request.h" #include <sstream> #include "string_tokenizer.h" #include "my_config.h" FlowAcceptRequest::FlowAcceptRequest(Flow flow, int seqNo, uint32_t senderId, uint32_t nextHop, int TTL) { this...
true
71033f6c1ee0bc7cab8449abda3646c4850a1422
C++
zakar/LittleWorld
/src/math/Frustum.cpp
UTF-8
2,339
3
3
[]
no_license
#include "Frustum.h" using namespace std; void Frustum::update(Matrix4x4f projection) { // left clipping plane: planes[0].a = projection.m[3] + projection.m[0]; planes[0].b = projection.m[7] + projection.m[4]; planes[0].c = projection.m[11] + projection.m[8]; planes[0].d = projection.m[15] + pro...
true
ef0730a3bda64c365cf3bd9a328e8232d4c73643
C++
chwdy/6913-CSA-LAB
/LAB2/test.cpp
UTF-8
769
3.15625
3
[]
no_license
#include <iostream> #include <string> #include <vector> #include <bitset> #include <fstream> using namespace std; bitset<32> bitadd(bitset<32> a, bitset<32> b) { bitset<32> re = a; bitset<32> temp = b; bitset<32> newre; bitset<32> newtemp; do { newre = re ^ temp; newtemp = re & t...
true
c8e88799af061ab4fabd26841cf88bf653c1c674
C++
tameer7595/school-app
/test.cpp
UTF-8
2,287
3.421875
3
[]
no_license
// // Created by tameer on 9/5/19. // #include <iostream> #include "person.h" #include "student.h" #include "teacher.h" #include "school.h" #include <list> #include "test.h" #include "String.h" void Test::test() { std::cout << "Welcome To My School" << std::endl; std::vector<Person*> p = std::vector<Person*>(11...
true
23381801488d73653ce9f7992d371997b22da26e
C++
Skalwalker/CodeCollector
/source/A/BeautifulMatrix.cpp
UTF-8
512
2.859375
3
[ "MIT" ]
permissive
/* Beautiful Matrix - URL: https://codeforces.com/contest/263/problem/A - Tags: - implementation - 700 */ #include <bits/stdc++.h> using namespace std; int main(){ int mat[5][5]; int posx, posy, count = 0; for(int i = 0; i < 5; i++){ for(int j = 0; j < 5; j++){ cin >> mat[i][j]...
true
85a63c187c5830cdea9ce4c0a378b64e0d93062b
C++
ajorians/nHearts
/src/Metrics.cpp
UTF-8
3,039
2.953125
3
[]
no_license
#include "Metrics.h" Metrics::Metrics() { } bool Metrics::SetCardDimensions(int nWidth, int nHeight) { m_nCardWidth = nWidth; m_nCardHeight = nHeight; m_nTop = SCREEN_HEIGHT - nHeight - 35; return true; } void Metrics::SetNumCards(int nNumCards) { m_nNumCards = nNumCards; } int Metrics::GetNumCards...
true
b13b830f127c63d8d4b8db9917a0c7d399b0a8af
C++
asreepada/DS-Algo
/nthNodeFromLast.cpp
UTF-8
1,442
3.890625
4
[]
no_license
#include<stdio.h> #include<malloc.h> #include<iostream> using namespace std; typedef struct node { int data; struct node *link; }Node; Node* newNode(int data) { Node *newNode; newNode = (struct node *) malloc(sizeof(Node)); newNode->data = data; newNode->link = NULL; return newNode; } ...
true
d3279c4ba3c191435b6928f356528b0b230f9ce8
C++
ssh352/cppcode
/DotNet/ProVisualC++CLI/Chapter19/TcpServer_Stream/TcpServer_Stream.cpp
UTF-8
1,786
2.953125
3
[]
no_license
using namespace System; using namespace System::IO; using namespace System::Net; using namespace System::Net::Sockets; using namespace System::Threading; ref class TcpServer { public: void ProcessThread(Object ^clientObj); }; void TcpServer::ProcessThread(Object ^clientObj) { TcpClient^ client =...
true
23a1c2b9e53ec5e66962b642e1324163dbc15dc0
C++
a137748099/QtAnimation
/animaldemo1.cpp
UTF-8
3,893
2.625
3
[]
no_license
#include "animaldemo1.h" #include <QPushButton> #include <QPainter> #include <QSequentialAnimationGroup> AnimalDemo1::AnimalDemo1(int w, int h, QWidget *parent): QWidget(parent) { this->resize(w, h); initUi(); } void AnimalDemo1::initUi() { m_pBaseWidget = new QWidget(this); m_pBaseWidget->resiz...
true
81dcd18bc12b8fa037a188db7b0bc8c7cccf1ecb
C++
hugo-maker/til
/ezoe_cpp/bernoulli_distribution.cpp
UTF-8
3,851
3.09375
3
[]
no_license
// コンパイル時に all.h(コンパイル済みヘッダーファイルはall.h.gch) をインクルードする必要あり // g++ -std=c++20 -Wall --pedantic-error -include all.h <ソースファイル名> -o <実行ファイル名> // コイントス100回 template <typename Engine> auto coinflips100(Engine & e) { // t == 100, p == 0.5 std::binomial_distribution d(100, 0.5); return d(e); } // 6面ダイス60投 template <typ...
true
b3b9c0fa7d251d930de4df7dd90b68648174afd6
C++
sundsx/RevBayes
/src/core/datatypes/trees/TreeChangeEventHandler.cpp
UTF-8
1,607
2.515625
3
[]
no_license
// // TreeChangeEventHandler.cpp // RevBayesCore // // Created by Sebastian Hoehna on 8/27/12. // Copyright 2012 __MyCompanyName__. All rights reserved. // #include "TreeChangeEventHandler.h" #include "TreeChangeEventListener.h" #include <iostream> using namespace RevBayesCore; TreeChangeEventHandler::TreeChang...
true
7a75d5d1430cd6b4befe471a874e7bdb3e2c0a8d
C++
0x8000-0000/ftags
/src/db/record.cc
UTF-8
7,991
2.578125
3
[ "Apache-2.0" ]
permissive
/* Copyright 2019 Florin Iucha 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 wri...
true
f131d7647045098c33c848a2b9d927b6bb3f4994
C++
delta4d/AlgoSolution
/zoj/05/1429.cpp
UTF-8
1,492
2.5625
3
[]
no_license
#include <cmath> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define RIGHT 1 #define STRAIGHT 0 #define LEFT -1 const int MAXN = 50; struct point { int x, y; int index; point(int _x=0, int _y=0, int _index=0):x(_x), y(_y), index(_index) {} bool input() { retu...
true
c6c3e3feb97cdb7814302683454abad380a9ba03
C++
jose-joaquim/AcervoMaratona
/Maratona Regional 2017/Problema D/D.cpp
UTF-8
1,265
3
3
[]
no_license
//Autor: Joaquim //Complexidade: O(sqrt(N) + numero_divisores(N) * sqrt(max(divisor(N)))) #include <vector> #include <cstdio> #include <cmath> #include <iostream> #include <cstring> using namespace std; typedef long long ll; ll n; vector<ll> divisores; bool ehDespojado(ll numero){ //printf("verificando divisor %l...
true
7ba2f0a512dc18054e2416c93ed2ea83c3499b95
C++
NEJI12212/Pac_Man
/Pacman/PacTileMap.cpp
UTF-8
6,683
2.8125
3
[]
no_license
#include "PacTileMap.h" namespace { // txture size magic number constexpr float textureSize = 16.0f; // instance std::unique_ptr<PacTileMap> sInstance; } //---------------------------------------------------------------------------------- void PacTileMap::StaticInitialize() { // create the map ...
true
a6e2665a7cf8e569880a60492256442d188144a0
C++
kbc16b15/game
/GameTemplate/game/gameCamera.h
SHIFT_JIS
1,536
2.546875
3
[]
no_license
#pragma once class gameCamera:public IGameObject { public: //RXgN^ gameCamera(); //fXgN^ ~gameCamera(); // void Init(); //XV void Update(); //J̉] void RotCamera(); //Ǐ]J void TrackingCamera(); //{XX^[gJ@JoH void BossStartCamera(); //{XJ void BossCamera(); //{XGhJ void BossEndCamera(); //{XŒJ void...
true
c193b76ae1cb41a893f4b7ed80942e10e2a34640
C++
mschwartz/amos
/kernel/Types/BSparseArray.cpp
UTF-8
2,096
2.59375
3
[ "MIT" ]
permissive
#include <Types/BSparseArray.hpp> // constructor BSparseArrayNode::BSparseArrayNode(const char *aName, TInt64 aKey) : BNode(aName) { mSparseKey = aKey; } BSparseArrayNode::~BSparseArrayNode() { // } // constructor BSparseArray::BSparseArray(const TInt aSparseArrayBuckets) { mCount = 0; mSparseArrayBuckets = ...
true
41e0cc21bffdf773a1d1e8603a0fd3e320f464b8
C++
mcmellawatt/VectorGraphicsFramework
/Element.h
UTF-8
869
2.546875
3
[]
no_license
#pragma once #include "SharedPtr.h" #include <string> #include <vector> #include <map> namespace Xml { class Element; typedef Cst::SharedPtr<Element> HElement; typedef std::map<std::string, std::string> AttributeMap; typedef std::vector<HElement> ElementList; class Element { public: ...
true
e2f6c640b634265e05824e801fd80a7fe477421a
C++
oficialtavarez/Calculator-in-C-Calculadora-en-C-
/Dev c++/Calculadora.cpp
WINDOWS-1250
17,381
2.796875
3
[]
no_license
/* Gracias por bajar mi aplicacion en C++ */ /*Version 2.0 */ /*Ultima Actualizacion: 26/1/2021 */ /*Creado por Anderson Tavarez (Oficialtavarz)*/ /*Soporte Nevekley */ /* Aviso:(Puedes usar este programa cuando y donde des creditos al autor original del proyecto)*/ /* Inicio de bibliotec...
true
2b25bbca799020993facfc91424e05c397ca0ea3
C++
rustamNSU/FinalTest
/Executable/task2.cpp
UTF-8
389
3.078125
3
[]
no_license
// // Created by rustam on 22.05.2020. // #include <iostream> #include <iomanip> // for std::boolalpha #include "task2.h" using namespace std; int main() { auto a1 = close_enough(2.0, 3.0); auto a2 = close_enough(3, 3); auto a3 = close_enough(1.0f, 1.0000000001f); cout << boolalpha; cout << a1 <...
true
cb5c91ba1cae7ac6a655f0139fedab98657fe787
C++
ArturKal/SnakeGame
/source/repos/SnakeGameTdd/SnakeGameTdd/Coord.cpp
UTF-8
1,521
3.25
3
[]
no_license
#include "pch.h" #include "Coord.h" //Constructors: Coord::Coord() { Xcolumn = BOARDSIZE / 2; Yrow = BOARDSIZE / 2; } Coord::Coord(ICoord * _coord) : Icoord(_coord) { coords = Icoord; } Coord::Coord(int x, int y) { try { compare(x, y); } catch (std::runtime_error & e) { std::cout << "Runtime error: " ...
true
c6f14fb6eb49b84550b797ed1dcde28ce24379f8
C++
martakuzak/ASOD1
/Kamera/sources/utils/FileUtils.cpp
UTF-8
4,882
2.578125
3
[]
no_license
#include "stdafx.h" #include "FileUtils.h" #include "structs.h" BITMAPINFO* PrepareBitmapInfo(int w, int h) { BITMAPINFO *bip; bip = (BITMAPINFO*) new unsigned char[sizeof(BITMAPINFOHEADER)]; bip->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bip->bmiHeader.biWidth = w; bip->bmiHeader.biHeight = h; ...
true
a8a35d60643206cc899d969a8273bb55a393ebf4
C++
LaserStark/calculator
/parser.h
UTF-8
554
2.5625
3
[]
no_license
/* Calculator Interpreter & Compiler * Author: robin1001 * Date: 2015-07-03 */ #ifndef _PARSER_H_ #define _PARSER_H_ #include "utils.h" #include "lexer.h" #include "node.h" class Parser { public: Parser(const char *input = "", bool is_file = true): lexer_(input, is_file) {} Node *parse(); private: //recurs...
true
bdc4f88a64b48771f6f7282da938dd1472c6ff3a
C++
taketakeyyy/atcoder
/abc/263/d.cpp
UTF-8
2,650
2.515625
3
[]
no_license
#define _USE_MATH_DEFINES // M_PI等のフラグ #include <bits/stdc++.h> #define MOD 1000000007 #define COUNTOF(array) (sizeof(array)/sizeof(array[0])) #define rep(i,n) for (int i = 0; i < (n); ++i) #define intceil(a,b) ((a+(b-1))/b) using namespace std; using ll = long long; using pii = pair<int,int>; using pll = pai...
true
9b706b3e6b22c15e9d1d3045fa98eb95a52476f3
C++
shi1252/SeamlessVoxel
/SeamlessVoxel/Material.cpp
UTF-8
357
2.59375
3
[]
no_license
#include "Material.h" #include "Texture.h" Material::Material(std::string name, std::string shaderName, Texture* texture) : name(name), shaderName(shaderName) { textures.push_back(texture); } ID3D11ShaderResourceView* Material::GetTextureSRV(int index) { if (textures.size() > 0) return textures[index...
true
30f6dc4490814de5dc151d681216163bb3e6bf06
C++
Jerry-Terrasse/Programming
/比赛/校内/NOIP模拟试题/201810060830(50)/B.cpp
UTF-8
4,129
2.65625
3
[]
no_license
#include<iostream> #define MAXN 1000010 #define MAXA 70070 #define max(x,y) ((x)<(y)?(y):(x)) using namespace std; struct node { int val[2],l,r,mid,lazy,lst,cnt; node *son,*daughter; int build(int,int); int change(int,int); int set(int,int,int); int que(int,int,int); void output(); }*head; ...
true
9ea7ee8af8490917cf7089c49b763d035be95b47
C++
jcowles/effects-salad
/common/sketchUtil.cpp
UTF-8
1,011
2.5625
3
[]
no_license
#include "common/sketchScene.h" #include "common/sketchUtil.h" #include "glm/gtx/string_cast.hpp" #include "pez/pez.h" using namespace sketch; using namespace glm; using namespace std; vec3 sketch::AddOffset(vec2 p2, const Plane* plane) { vec3 p3 = plane->GetCenterPoint(); p3 += plane->GetCoordSys() * vec3(p2...
true
7b378e4c83375c12065c30046df215f953442ca7
C++
ParkYeoungJun/Algorithm
/Samsung/Expert/4012_expert_tast.cpp
UTF-8
1,315
2.71875
3
[]
no_license
#include<iostream> #include<cstdio> #include<climits> #include<cmath> #include<vector> #include<cstring> using namespace std; int arr[20][20]; bool visit[20]; int n, result = INT_MAX; int calc(vector<int> t) { int rtn = 0; for(int i = 0 ; i < n/2 ; ++i) { for(int j = 0 ; j < n/2 ; ++j) ...
true
25173a2df2ee5427ca18687fc81dc11a7759e4d6
C++
dimitrov-k/Chess
/source/chess.cpp
UTF-8
1,090
3.171875
3
[ "MIT" ]
permissive
#include "includes.h" #include "chess.h" #include "user_interface.h" // Chess class int Chess::getPieceColor(char piece) { if (isupper(piece)) { return WHITE_PIECE; } else { return BLACK_PIECE; } } bool Chess::isWhitePiece(char piece) { return getPieceColor(piece) == Chess::WHITE_PIECE ? true : false; } b...
true
25ad3484612521aa3857ada673da16e90652b711
C++
dh-wuho/myLeetCode
/C++/253_Meeting_Rooms_II.cpp
UTF-8
1,429
3.4375
3
[]
no_license
/** * Definition for an interval. * struct Interval { * int start; * int end; * Interval() : start(0), end(0) {} * Interval(int s, int e) : start(s), end(e) {} * }; */ class Solution { public: int minMeetingRooms(vector<Interval>& intervals) { map<int, int> table; for(int i =...
true
0bc79137734a196bf1c5174d176e69ffa5122929
C++
LeandroGuillen/rompebolas
/src/motor/motor.h
UTF-8
1,435
3
3
[]
no_license
#ifndef MOTOR_H_ #define MOTOR_H_ #define TAM_TABLERO 11 class Motor { public: Motor(); ~Motor(); int** getMatriz(); int** getAdyacentes(); int getPuntos(); int calcularPuntos(); int getTamTablero(){ return TAM_TABLERO; } int nSeleccionadas(){ return numero_seleccionadas; } void sustituirMatriz(int **); v...
true