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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
019273938aae6fb4a223aa50ba9b37e674041038 | C++ | weiiiyan/workspace | /300_Course_Students/course.cpp | UTF-8 | 1,367 | 3.609375 | 4 | [] | no_license | #include "course.h"
#include <iostream>
struct student_list{
string name;
double grade;
student_list* next;
};
Course::Course(const char* pName):num_students(0),head(NULL){
strncpy(name,pName,sizeof(name));
name[sizeof(name) - 1] = '\0';
}
Course::~Course(){
while(head != NULL){
current = head;
head = head-... | true |
72f03c7f1dbad75275d1e5c2da6ffea37bdee962 | C++ | carlos-shimabukuro/progra1-carlos_shimabukuro-hoja2c- | /Ejercicio 1.cpp | ISO-8859-1 | 630 | 3.046875 | 3 | [] | no_license | // ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
/* Test
Test1
c = 36*/
int main() {
//Entrada
int c;
//Restricciones
/*
c > 0 y entero
*/
// Variables
int n5;
int n2;
i... | true |
5f2ec2206cb432e07cdd6e41b4302372194bb0d2 | C++ | whztt07/ShaderEditor | /src/Commons.hpp | UTF-8 | 992 | 2.8125 | 3 | [] | no_license | #ifndef COMMONS_HPP
#define COMMONS_HPP
#include <QString>
namespace Qiwi{
/*
enum PortTypeEnum{ READER = 0x1
, WRITER = 0x2
, INPUT = 0x4
, OUTPUT = 0x8
};
*/
enum PortTypeEnum{
READER = 0x1
, WRITER = 0x2
, INPUT = 0x4
, OUTPUT = 0x8
... | true |
d22afeb7eada130dae659a20702631c6c4f61ad7 | C++ | parduman/lovebabbar450 | /dsaC++/array/alternatingPositiveAndNegative.cpp | UTF-8 | 857 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
bool fun(int a, int b){
return b < a;
}
int main() {
vector <int> v;
int size;
cout <<"vector size" <<endl;
cin >>size;
cout <<"enter elements now" <<endl;
for(int i=0;i<size;i++){
int j;
... | true |
5bd6246e5a089be4adb6a2081266d0a4621794ae | C++ | tobieder/SimplePandemicSimulation | /SimplePandemicSimulation/Utils/Random.cpp | UTF-8 | 1,019 | 3.3125 | 3 | [] | no_license | #include "Random.h"
#include <algorithm>
Random::Random()
{
srand(time(NULL));
}
QVector2D Random::RandomQVector2DBetween(QVector2D _min, QVector2D _max)
{
float random = ((float)rand()) / (float)RAND_MAX;
float diffX = _max.x() - _min.x();
float rX = random * diffX;
random = ((float)rand()) / (float)RAND_MAX;... | true |
0c23866ad44437af6cd641ab30402d518a682993 | C++ | LinasBeres/closest-point | /src/test.h | UTF-8 | 3,568 | 2.734375 | 3 | [] | no_license | #ifndef TEST_H
#define TEST_H
#include "ClosestPoint.h"
#include "Context.h"
#include <random>
#include <chrono>
void runTests(Context context)
{
const int n_tests = 500;
ClosestPoint finder(context.getVertices());
finder.constructKdTree();
// Average time for building kdtree
float durationBuild = 0;
for(int ... | true |
3acf8384c22ebe1b21f4a5c082acd4589dc5d0fc | C++ | LiQingMuBai/darks-jvm | /jvm/vm/executor/jmethod.cpp | UTF-8 | 1,062 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #include "stdafx.h"
#include "jmethod.h"
#include "descriptor.h"
Method::Method()
{
methodName = NULL;
methodDesc = NULL;
code_attr = NULL;
exception_attr = NULL;
jni_method_name = NULL;
}
Method::~Method()
{
if (code_attr)
{
delete[] code_attr;
code_attr = NULL;
}
if (exception_attr)... | true |
d19a432c2ebda5cfba9db15ac19d81cbecc092c2 | C++ | navidkpr/Competitive-Programming | /CodeForces/546/C[ Soldier and Cards ].cpp | UTF-8 | 969 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
queue <int> card1, card2;
int Fact(int n)
{
if (n == 1)
return 1;
else
return Fact(n - 1) * n;
}
int main()
{
int n, k1, k2;
cin >> n;
cin >> k1;
for (int i = 0; i < k1; i++)
{
int num;
cin >> num;
card1.push(num);
}
cin >> k2;
for (int i ... | true |
0e88d944274d38acbd09b4f98e7a71d2b6171654 | C++ | ordinary-developer/education | /cpp/std-17/i_cukic-func_progr_in_cpp/ch_03-function_objects/05-under_the_hodd_of_lambdas-2.cpp | UTF-8 | 554 | 3.15625 | 3 | [
"MIT"
] | permissive | #include <algorithm>
#include <vector>
#include <cassert>
#include <cctype>
namespace test {
void run() {
int count{0};
std::vector<std::string> words{ "An", "ancient", "pond" };
std::for_each(std::cbegin(words), std::cend(words),
[count](std::string const& word) mutable {
if (std::isu... | true |
8a17c89dafcb2b33bb3c6f2154e1d7335be93251 | C++ | doraneko94/AtCoder | /ABC/ABC091/test.cpp | UTF-8 | 214 | 2.765625 | 3 | [] | no_license | #include <vector>
#include <iostream>
using namespace std;
int main() {
vector<int> a(10);
for (int i=0; i<10; ++i) a[i] = i;
a.erase(a.begin()+2);
cout << a[2] << a.size() << endl;
return 0;
} | true |
8912974f18d9806aa3cf3bbff3756ec527abd063 | C++ | BrendanHenryGithub/simple-tcp-based-protocol-design | /inc/server.hpp | UTF-8 | 2,187 | 2.75 | 3 | [] | no_license | #pragma once
#include "protocol.hpp"
#include <boost/asio.hpp>
#include <unordered_map>
#include <set>
#include <queue>
#include <memory>
class Channel;
class Participant;
// ---------------- Class Server ------------------------------
class Server
{
private:
boost::asio::ip::tcp::acceptor acceptor;
public:
... | true |
cfe2e57fcb5e81636930572da212b35d3c83bd53 | C++ | AtuManikraoBhagat/OOP_with_CPP_Bala | /Beginning_with_CPP/program-e5.cpp | UTF-8 | 284 | 3.5 | 4 | [] | no_license | /* This program is written by "Atul M. Bhagat" */
#include <iostream>
using namespace std;
int main()
{
double f, c;
cout << "Enter temperature in Fahrenheit : ";
cin >> f;
c = (5.0/9.0)*(f-32.0);
cout << "Temperature in degree Celcius is '" << c << "'." << endl;
return 0;
}
| true |
f4c6e1fcb8b8add4049e69f32d5ec5cd1f0ab57f | C++ | moritzwinger/ABC | /src/visitor/IdentifyNoisySubtreeVisitor.cpp | UTF-8 | 3,168 | 2.6875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #include "ast_opt/ast/AbstractNode.h"
#include "ast_opt/ast/Literal.h"
#include "ast_opt/visitor/IdentifyNoisySubtreeVisitor.h"
#include <utility>
#include "ast_opt/ast/AbstractExpression.h"
SpecialIdentifyNoisySubtreeVisitor::SpecialIdentifyNoisySubtreeVisitor(std::ostream &os, std::unordered_map<std::string, int> n... | true |
6e2ad2a1c56151d883fa7ffef81a16d90b768354 | C++ | Jijidici/Hydro-Gene_IMAC2014_bk_07_12_2012 | /include/types.hpp | UTF-8 | 1,766 | 2.890625 | 3 | [] | no_license | #ifndef __TYPE_HPP__
#define __TYPE_HPP__
#include <glm/glm.hpp>
typedef struct s_vertex{
glm::dvec3 pos;
}Vertex;
typedef struct s_face{
Vertex *s1, *s2, *s3;
glm::dvec3 normal;
double bending;
double gradient;
double surface;
int drain;
}Face;
typedef struct s_cube{
double left;
double right;
double top... | true |
165ffa771f786e60435928763139ac5d1495ae33 | C++ | damiandiaz212/CS211_Fall-2018 | /Assignment2/main.cpp | UTF-8 | 2,251 | 4.65625 | 5 | [] | no_license | /*
CSCI 211 Assignment 2 - Right shift equivalence
Damian Diaz
This program will check if two arrays are right shift equivalent.
*/
#include <iostream>
/*
rightShift
Takes an array and shifts all the elements one space to the right.
Last element loops around to first index.
*/
void rightShift(int array[], ... | true |
612d462cd77c02b69de1c2073c7646fcf5b5038a | C++ | mbrzecki/julian | /src/mathematics/stochasticProcesses/arithmeticBrownianMotion.cpp | UTF-8 | 2,032 | 3.21875 | 3 | [] | no_license | #include <mathematics/stochasticProcesses/arithmeticBrownianMotion.hpp>
#include <mathematics/distributions/gaussianRandomVariable.hpp>
#include <cmath>
namespace julian {
/** \brief constructor
*/
ArithmeticBrownianMotion::ArithmeticBrownianMotion(double drift, double volatility) {
drift_ = drift;
vol... | true |
fa81c003f0f20b996098368472b9d59ae6b95112 | C++ | lcosta/um_uc_prog_tp1 | /varied.cpp | UTF-8 | 865 | 2.765625 | 3 | [] | no_license | #include "varied.h"
Varied::Varied() : Drug() {
// configure specific unit of product
setMeasureUnit("unidade(s)");
}
Varied::Varied(int const _id,
string const _name,
string const _laboratory,
Date const _date,
float const _price,
... | true |
19c356c00971006c423e77f7519027632f787cb9 | C++ | xogud3373/ros_mobile_robot | /joystick_ros_twsit/joystick_ros_twsit.ino | UTF-8 | 4,738 | 2.625 | 3 | [] | no_license | #define X A0
#define Y A1
#define LENGTH_BET_WHEEL 0.281 // 28.1cm = 0.281m
#define WHEEL_RADIUS 0.0625 // 6.25cm = 0.0625m
#include <ros.h>
#include <geometry_msgs/Twist.h>
char joy_flag = 0; // 모바일로봇 run flag
int lmotor_speed = 0;
int rmotor_speed = 0;
unsigned char sw1_on;
unsigned... | true |
623d91c0d8d6b459bef27baecf852d294d9adf6a | C++ | m561247/NUAA_PL0 | /pl_lex.h | UTF-8 | 4,639 | 2.546875 | 3 | [] | no_license | #ifndef __PL_LEX_H__
#define __PL_LEX_H__
#define IS_ID(c) (('a'<=(c) && (c)<='z') || ('A'<=(c) && (c)<='Z'))
#define IS_DIGIT(c) ('0'<=(c) && (c)<='9')
#define IS_OPR(c) ((c)=='+' || (c)=='-' || (c)=='*' || (c)=='/' || (c)=='=' || (c)==',' || (c)==';' || (c)=='(' || (c)==')')
#define IS_MOPR(c) ((c)==':' || (c)... | true |
e17cc2b899ce79b09f361f647f004b98d69abb3b | C++ | Theis97/AdventOfCode2020 | /Day22/Day22.cpp | UTF-8 | 4,867 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <set>
#include <map>
const bool partOne = false;
// Returns whether Player 1 won or not and the score of the winning player
std::pair<bool, int> PlayRecursiveCombat(std::vector<std::deque<int>> decks, std::map<std::ve... | true |
ef694c1feadabb0bca2e6c81fdbab1d353a8a1d3 | C++ | PapamichMarios/K-Clustering | /update.cpp | UTF-8 | 4,043 | 2.859375 | 3 | [] | no_license | #include <vector>
#include <iostream>
#include <climits>
#include "utilities.h"
#include "update.h"
//#define DEBUG
using namespace std;
vector<vector<double>> k_means(vector<vector<double>> data, vector<int> labels, vector<vector<double>> centroids, long double &objective_function, Metric<double>* metric_ptr)
{
v... | true |
356663ff36f45d3cd47d6728d3c97ac764937fbf | C++ | onievui/ChaosShaper | /ShareDataManager.cpp | SHIFT_JIS | 1,181 | 3.140625 | 3 | [] | no_license | #include "ShareDataManager.h"
/// <summary>
/// RXgN^
/// </summary>
ShareDataManager::ShareDataManager() {
initialize();
}
/// <summary>
/// f[^̏
/// </summary>
void ShareDataManager::initialize() {
finalFloor = 0;
playerName.clear();
enemyName.clear();
}
/// <summary>
/// f[^̕ۑ
/// </summary>
/// <param name... | true |
fb54c9a8ed219aa35b387c6bf28f60236e639a2e | C++ | universalvalue/RunTracker | /source/ClassRun.cpp | UTF-8 | 986 | 2.953125 | 3 | [] | no_license | #include "ClassRun.h"
#include "RunningAppFunctions.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Introduce class "Run"
////////////////////////////////////////////////////////////////////////////////////////////////////
std::string Run::getSpeed () {
std:... | true |
b233e418f4934c4eca0f3661b91049bc9c9196f3 | C++ | hjh4638/C-11 | /ST2_day4/2_스마트포인터12.cpp | UHC | 1,569 | 3.671875 | 4 | [] | no_license | #include <iostream>
using namespace std;
template<typename T> class sp
{
T* obj;
public:
sp(T* p = 0) :obj(p)
{
if (obj) obj->incStrong();
}
sp(const sp& p) :obj(p.obj)
{
if (obj) obj->incStrong();
}
~sp()
{
if (obj) obj->decStrong();
}
T* operator->(){ return obj; }
T& operator*(... | true |
ea8cfc5267cb3bf07cf3a669dfcf9877c3c1e1cd | C++ | ToTYToT/learn_c- | /c++_001/namespace2.cc | UTF-8 | 775 | 3.078125 | 3 | [] | no_license | ///
/// @file namespace2.cc
/// @author lemon(haohb13@gmail.com)
/// @date 2016-10-17 11:31:45
///
#include <iostream>
//using namespace std;//using编译指令,把名字空间里面所有的实体全部引入
using std::cout;
using std::endl;
namespace A
{
int num = 10;
void displayA()
{
cout << "displayA()" << endl;
}
}// end of names... | true |
5c6df9c95a4e35ee5378b95c18d41eb494adfec1 | C++ | MarcBeltran/Billar | /conjuntboles.cpp | UTF-8 | 934 | 2.765625 | 3 | [] | no_license | #include "conjuntboles.h"
/*
* Classe per a carregar
* les 15 boles
*/
conjuntBoles::conjuntBoles()
{
make();
}
conjuntBoles::~conjuntBoles()
{
//Omplir això!!!
}
void conjuntBoles::aplicaTGCentrat(mat4 m)
{
//Falta pa
for(int i = 0; i<15; i++){
boles[i]->aplicaTGPoints(m);
}
}
vo... | true |
81bf250c3bd975b8055608f2b08c709ba3c0662f | C++ | peterwilliams97/strings | /rolling_hash/timer.cpp | UTF-8 | 471 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | #include <windows.h>
#include "timer.h"
static double _freq;
static double _time0;
static double _get_absolute_time()
{
LARGE_INTEGER time;
QueryPerformanceCounter(&time);
return time.QuadPart * _freq;
}
void timer_init()
{
LARGE_INTEGER freq;
QueryPerformanceFrequency(&freq);
... | true |
d44e340d0c52cf4ec601db19d623af2cbd263298 | C++ | gaokewoo/boss | /ds/alg/Stack.hh | UTF-8 | 4,845 | 3.984375 | 4 | [] | no_license | #include <iostream>
using namespace std;
namespace StackList
{
template <typename T> class Stack;
template<typename T>
class Node
{
friend class Stack<T>;
T elem;
Node *next;
};
template<typename T>
class Stack
{
pu... | true |
c1e5da19adccfd71a6e53878604f94d10922d81b | C++ | COMP215/_jondunnett | /PS01/graph2main.cpp | UTF-8 | 609 | 2.546875 | 3 | [] | no_license |
#include "graph2.h"
#include <string>
#include <stdlib.h>
#include <time.h>
#include <sstream>
using namespace std;
int main()
{
srand(time(NULL));
graph G;
stringstream ss;
int edges = 4000;
int nodes = 300;
string A[nodes];
for (short i = 0; i < nodes; i++)
{
ss << i;
A[i] = ss.str();
ss.str("");
... | true |
9f95488de0f893773ea23e13849ece67c774e1a1 | C++ | Shibu778/LaDa | /vff/edge/pybase.h | UTF-8 | 1,470 | 2.703125 | 3 | [] | no_license | #ifndef PYLADA_VFF_EDGE_DATA_H
#define PYLADA_VFF_EDGE_DATA_H
#include "PyladaConfig.h"
//! \def check_structure(object)
//! Returns true if an object is an edge or subtype.
#define PyEdgeData_Check(object) PyObject_TypeCheck(object, Pylada::vff::edge_type())
//! \def PyNodeData_CheckExact(object)
//! Retur... | true |
5629a2d5cbd5771fa7ca94dc26e386042c190d49 | C++ | igortakeo/Algorithms-and-Data-Structures | /Algorithms/GenerateKeypadPermutations.cpp | UTF-8 | 1,516 | 3.0625 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
int main(){
map<int, string>keypad;
vector<int> numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9};
vector<string>permutations;
keypad[0] = "+";
keypad[1] = "";
keypad[2] = "ABC";
keypad[3] = "DEF";
keypad[4] = "GHI";
keypad[5] = "JKL";
keypad... | true |
68b18519c3cba9f5eb9e6095a944e41a55290181 | C++ | sidikone/cpp_reader | /csvreader.cpp | UTF-8 | 4,857 | 3.03125 | 3 | [] | no_license | #include "csvreader.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <iterator>
#include <tuple>
#include <map>
#include <numeric>
using namespace std;
// Constructors
CSVReader::CSVReader()
{
/* Constructor used to built the class
* Use the function open ... | true |
b092dba68957d710550debe1d4230fe0c4187def | C++ | abhatem/Samira3D | /Engine3/IndexedMesh.cpp | UTF-8 | 3,321 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "IndexedMesh.h"
IndexedMesh::IndexedMesh()
{
}
IndexedMesh::~IndexedMesh()
{
glDeleteBuffers(1, &m_vertexBufferID);
glDeleteBuffers(1, &m_indexBufferID);
glDeleteVertexArrays(1, &m_vertexArrayID);
}
void IndexedMesh::init(const std::vector<Vertex> &vertices, const std::vector<GLuint> indices)
{
m_vert... | true |
4820391f4bbaf0333d6c2dd21635388745299191 | C++ | GavinGYM/Rshell | /src/main.cpp | UTF-8 | 3,789 | 2.703125 | 3 | [] | no_license | #include "rshellbase.hpp"
#include <vector>
#include <iostream>
using namespace std;
int main() {
bool status = true;
while (status) {
vector<Connector*> con;
vector<Command*> com;
vector<ExeArgu*> ea;
string input;
cout << "$ ";
getline(cin, input);
Rshellbase *base = new Rshellbase(inpu... | true |
5879be766c101aed9b054118b72f6d645433e4c9 | C++ | emilianbold/netbeans-releases | /cnd.completion/test/unit/data/org/netbeans/modules/cnd/completion/cplusplus/hyperlink/TemplateSpecializationsTestCase/bug256700.cpp | UTF-8 | 1,324 | 2.609375 | 3 | [] | no_license | namespace bug256700 {
namespace some_ns256700 {
template <class _Tp>
struct _Nonconst_traits256700;
template <class _Tp>
struct _Nonconst_traits256700 {
typedef _Tp value_type;
typedef _Tp* pointer;
typedef _Nonconst_traits256700<_Tp> _NonConstTraits;
... | true |
f100dadb1dffcff6e5f610c02c1a6d125ad6ec79 | C++ | sufyansalim/parallel_programming | /Threads/threads_mutex.cpp | UTF-8 | 808 | 3.65625 | 4 | [] | no_license | //g++ threads_mutex.cpp -o threads_mutex.exe -std=c++11
#include <iostream>
#include <thread>
#include <mutex>
using std::cout;
using std::endl;
using std::thread;
using std::lock_guard;
//Our lock at global scope
std::mutex my_mutex;
void print_func(int id){
//my_mutex.lock();
lock_guard<std::mutex> g(my_mut... | true |
8cceddaab97f5a771ee1147d262737d4e5ce692a | C++ | sanaa-khan/covid-analysis | /Queue.h | UTF-8 | 2,582 | 3.8125 | 4 | [
"MIT"
] | permissive | #pragma once
#include <iostream>
#include <string>
using std::cout;
using std::string;
template <class DT>
class Queue {
template <class DT>
struct node {
DT data;
node* next;
};
node<DT>* front;
node<DT>* rear;
int size;
public:
Queue() : front(NULL), rear(NULL), size(0) {}
~... | true |
c7f04c0315d4db2df55945296efc44dd723e86f9 | C++ | Unatart/StegoMP3 | /mp3_SMC/mp3_decoder.cpp | UTF-8 | 2,868 | 2.75 | 3 | [] | no_license | #ifndef MP3_DECODER_CPP
#define MP3_DECODER_CPP
#include "mp3_decoder.h"
void mp3_decoder::skip_byte(std::ifstream &in) {
char bufbyte;
try {
in.get(bufbyte);
}
catch (std::istream::failure) {
throw common_exception("File fail.");
}
}
const std::string mp3_decoder::... | true |
acc9e1b11d5ce2e147d05b9a6b60c867e8fd07cf | C++ | bertobot/MyThread | /thread.h | UTF-8 | 1,165 | 2.515625 | 3 | [] | no_license | /////////////////////////////////////////////////
// thread.h
// robert beatty
// funkejunx@aim.com
//
// this code is GPL'd
//
#ifndef __thread_h_
#define __thread_h_
/////////////////////////////////////////////////
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include "mutex.h"
/////////////////////... | true |
3885894371a3ab440fe6bb58fa8cd08ad9aac736 | C++ | townboy/acm-algorithm | /HDOJcode/2082 2011-11-17 16 02 30.cpp | UTF-8 | 954 | 2.5625 | 3 | [] | no_license | ******************************
Author : townboy
Submit time : 2011-11-17 16:02:30
Judge Status : Accepted
HDOJ Runid : 5004143
Problem id : 2082
Exe.time : 421MS
Exe.memory : 208K
https://github.com/townboy
******************************
#include<stdio.h>
int a[30],ji;
void js(int x,... | true |
b761dfaacfe64fc5303c1e3cf6ca05846f24f893 | C++ | skelleher/CandyCritters | /source/common/Color.cpp | UTF-8 | 2,792 | 3.140625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Color.cpp
* Critters
*
* Created by Sean Kelleher on 9/4/10.
* Copyright 2010 Sean Kelleher. All rights reserved.
*
*/
#include "Color.hpp"
namespace Z
{
Color::Color()
{
Color( 1.0f, 1.0f, 1.0f, 1.0f);
}
/*
Color::Color( BYTE r, BYTE g, BYTE b, BYTE a )
{
bytes.r = r;
bytes.g = g... | true |
d912fdf02a966094ca5dd9d27d9c3bf72f2011cf | C++ | mdzobayer/Problem-Solving | /Codeforces/39 C.cpp | UTF-8 | 503 | 2.578125 | 3 | [] | no_license |
#include <bits/stdc++.h>
#define LLI long long int
using namespace std;
bool isPosible(string &str, LLI i) {
LLI i;
bool use[150];
memset(use, false, sizeof(use));
for (i = 0; i < str.size(); ++i) {
if (use[str[i - 1]] == false && str[i] > 'a' ) return false;
if (use[str[i]] == false)... | true |
40196356260c5a87b02514ac1f4934930429bdb3 | C++ | sandeeppoudel/cplusplusBucky | /AccessthroughPointer.cpp | UTF-8 | 273 | 2.53125 | 3 | [] | no_license | #include "AccessthroughPointer.h"
#include<iostream>
using namespace std;
AccessthroughPointer::AccessthroughPointer() // :: is binary scope resolution operator.
{
}
void AccessthroughPointer::PrintoutSomething() {
cout << "nepal is a beautiful country" << endl;
} | true |
f5c5a0cfcb2044833e020d3bd7f41623a028cac3 | C++ | jhaslowh/DG-Spotlight | /DG_Spotlight/Build/shader_vertex.cpp | UTF-8 | 1,078 | 2.796875 | 3 | [] | no_license | #version 100
precision highp float;
// Inputs
in vec4 position; // Position handle
in vec3 aNormal; // Normal handle
in vec2 aTexCoordinate; // Texture coord handle
uniform vec3 cam; // Camera location
// Matrix's
uniform mat4 modelm; // Model Matrix handle
uniform mat4 viewm; // View Ma... | true |
ba3d73e4455971217fd9a43c77e069aec6ea28ee | C++ | TaoSP/Professional | /LeetCode/h04_strTest.cpp | UTF-8 | 3,747 | 3.359375 | 3 | [] | no_license | /******************************************************************************
* h04_strTest.cpp
* Author : Huangtao
* Version: V1.0.0 2020-02-06 Create
* Description: 字符串相关
******************************************************************************/
#include <iostream>
#include <sstream>
#include <str... | true |
942d0e96876cb6fd2e52fa9be5f170a2fee98036 | C++ | k124k3n/competitive-programming-answer | /toki/[Versi Lama] Training Gate TOKI Learning Center/Bab 3. Ad Hoc/3C. Teori Bilangan/A.cpp | UTF-8 | 307 | 2.890625 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
int gcd(int a, int b){
if(a == 0){
return b;
}
return gcd(b%a, a);
}
int main(int argc, const char *argv[])
{
int n, a, b;
std::cin>>n;
for (int i = 0; i < n; i++) {
std::cin>>a>>b;
std::cout<<gcd(a, b)<<'\n';
}
return 0;
}
| true |
efc2d1eb7913a808d733de8d3a987766258cae36 | C++ | uKryuchenia/DoodleJump | /src/CompressionSpring.cpp | UTF-8 | 759 | 2.8125 | 3 | [] | no_license | #include "CompressionSpring.h"
CompressionSpring::CompressionSpring(Board &b) : board(b)
{
Texture1.loadFromFile("Images/Spring.png");
compressionSpring.setTexture(Texture1);
}
void CompressionSpring::newSpring()
{
platforms=board.getResetPlat();
z=1;
x=board.platformsX(platforms)+10+rand()%60;
... | true |
1169d66bb5db6ee7904c68b20a841ca2852dde8b | C++ | PR1V4T3/SPMS-v1.0 | /main.cpp | UTF-8 | 13,349 | 3.03125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <stdlib.h>
#include <fstream>
#include <ctime>
using namespace std;
/* COMMENTS & OTHERS
////// IMPORTANT /////////////////////////////////////////////////////////////////////////////////////
// ... | true |
5c2362f8623cd26dc67389b3840988a71c886210 | C++ | Aman-Dubey/InterviewBitSolutions | /Tree Data Structure/Path_Sum.cpp | UTF-8 | 399 | 2.734375 | 3 | [] | no_license | int t=0;
void findans(TreeNode *A,int B,int sum)
{
if(A->left==NULL && A->right==NULL && sum==B)
{
t=1;
return;
}
if(A->left) findans(A->left,B,sum+A->left->val);
if(A->right) findans(A->right,B,sum+A->right->val);
return;
}
int Solution::hasPathSum(TreeNode* A, int B) {
... | true |
44d8109e89d51b03c1af330f27ffbe8835c3e2db | C++ | jackflower/SCInfor | /SCInfor/source/Rendering/Animations/Animation.h | UTF-8 | 2,015 | 3.0625 | 3 | [] | no_license | // ______________________________________
// | Animation.h - class definition |
// | Jack Flower - March 2012 |
// |______________________________________|
//
#ifndef H_ANIMATION_JACK
#define H_ANIMATION_JACK
#include <vector>
#include "TimedAnimationFrame.h"
#include "../../RTTI/RTTI.h"
namespa... | true |
d3ca5a593a529777618fd72761fd6046977dba01 | C++ | siemens/drace | /drace-client/include/module/Metadata.h | UTF-8 | 3,032 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0"
] | permissive | #pragma once
/*
* DRace, a dynamic data race detector
*
* Copyright 2018 Siemens AG
*
* Authors:
* Felix Moessbauer <felix.moessbauer@siemens.com>
*
* SPDX-License-Identifier: MIT
*/
#include <dr_api.h>
#include "../globals.h"
#include "InstrFlags.h"
#include "ModTypeFlags.h"
namespace drace {
namespace mo... | true |
1bec12793b22d96980511ff4ca139ea2237695d0 | C++ | AnandEmbold/upcxx_1 | /example/prog-guide/view-accumulate.cpp | UTF-8 | 1,680 | 2.6875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause-LBNL"
] | permissive | #include <upcxx/upcxx.hpp>
#include <cassert>
//SNIPPET
upcxx::future<> add_accumulate(upcxx::global_ptr<double> remote_dst,
double *buf, std::size_t buf_len) {
return upcxx::rpc(remote_dst.where(),
[](const upcxx::global_ptr<double>& dst, const upcxx::view<double>& buf_in_rpc) {
... | true |
311e3abf7bd71d7a19e8635361fa3819de912b1d | C++ | HannahJHan/BlueNoiseSampling | /wei-noise-master/11-DiffSamp/src/code/Synthesis/WhiteNoise.cpp | UTF-8 | 508 | 2.625 | 3 | [
"MIT"
] | permissive | /*
WhiteNoise.cpp
Li-Yi Wei
09/01/2010
*/
#include "WhiteNoise.hpp"
#include "Exception.hpp"
WhiteNoise::WhiteNoise(const vector<float> & domain_size): _domain_size(domain_size)
{
// nothing else to do
}
WhiteNoise::~WhiteNoise(void)
{
// nothing else to do
}
int WhiteNoise::Get(Sample & output) con... | true |
e904c2716a29758542eb61290c6ca577ce2b3032 | C++ | homuwell/Algorithms | /1sem/lab3/classes/Tree.cpp | UTF-8 | 4,934 | 3.34375 | 3 | [] | no_license | #include "../headers/Tree.h"
Tree::Tree() {
head = nullptr;
};
bool Tree::contains(int value) {
Node *tmp_ptr = head;
while (tmp_ptr != nullptr && tmp_ptr->key != value) {
if (tmp_ptr->key > value) {
tmp_ptr = tmp_ptr->left;
} else {
tmp_ptr = tmp_ptr->right;
}
}
return tmp_ptr != null... | true |
b67a826f63c3110d7ca081fb2b8e9aa868be33de | C++ | Leacyn/PJSDV-A2 | /Code/RaspberryPi/Final/main.cpp | UTF-8 | 616 | 2.75 | 3 | [] | no_license | /*-----------------------------------
Main definition
version: 1.0
contributors:
Stijn van Es 17018498
----------------------------------*/
#include "Domotica.h"
/*Define SQL login data*/
#define DBPATH "tcp://127.0.0.1:3306"
#define USER "editor"
#define PASSWD "100%Domotics"
#define DB "domotics"
/*start ... | true |
8a241d84944be29fab68f1ef0967250c03809dd9 | C++ | changyuhang/ntoucs2b | /實習課/12/12/main.cpp | UTF-8 | 3,320 | 3.171875 | 3 | [] | no_license | #include "mystring.h"
using namespace std;
int _total_MyString = 0;
void main() {
/////////////////////////////////////////////////////////
cout << "Total_MyString is: " << MyString::total_MyString() << endl;
MyString str1("String"), str2("Test String 2"), str3(str1);
cout << "str1 is: " << str1 << endl;
co... | true |
2e28eb8c9b5abb9cecf1ba38a7a3d88540059b2b | C++ | Kourin1996/CompetitiveProgramming | /AtCoderProblems/ABC/044/a.cpp | UTF-8 | 170 | 2.59375 | 3 | [] | no_license | #include <iostream>
int N = 0, K = 0, X = 0, Y = 0;
int main(void){
std::cin >> N >> K >> X >> Y;
std::cout << ((N <= K) ? N*X : (K*X + (N-K)*Y)) << std::endl;
}
| true |
6f8604a65d6bd04a8ae130c26c0dad51f6117bcc | C++ | GilvanFarias/Exercicios | /Aula_09 Array(vetor)/exercicio 01/ex_01.cpp | ISO-8859-1 | 602 | 3.0625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <locale>
using namespace std;
int main(){
setlocale(LC_ALL, "ptb");
int numElementos = 5, i=0;
int vetor[10];
int num[10];
int tentativas=3;
for(int i=0; i<numElementos; i++){
cout<< "Digite "<<i+1<< " nmero ";
cin>> vetor[i];
system("CLS");
}
for(i; ... | true |
3278b3559c56fce02e6f2025040d4b995156610c | C++ | niuxu18/logTracker-old | /second/download/httpd/gumtree/httpd_repos_function_1675_httpd-2.3.8.cpp | UTF-8 | 291 | 2.609375 | 3 | [] | no_license | static int hb_server_sort(const void *a_, const void *b_)
{
hb_server_t *a = (hb_server_t*)a_;
hb_server_t *b = (hb_server_t*)b_;
if (a->ready == b->ready) {
return 0;
}
else if (a->ready > b->ready) {
return -1;
}
else {
return 1;
}
} | true |
d131cf3411a1b3a4fd15cb491cc8903c5aab4b82 | C++ | aarpi3/Just_Flower | /Just_Flower.ino | UTF-8 | 6,292 | 3.125 | 3 | [
"MIT"
] | permissive | // Just Flower
// By Tomas Heydal & Harald Martin Aarbogh
// 2019
//Libraries
#include <dht.h>
// mousture sensor
int threshold = 500; // an arbitrary threshold level that's in the range of the analog input (for reference, 660 is wet, newly watered).
int soilMoisture = A1; // pin that the soilMoisture analog ... | true |
979727eb33ffa7fa4a76c2a373bc777d09b01f9b | C++ | mmcgraw74/644-1284-Narrow | /examples/Endless_Serial_0_1/Endless_Serial_0_1.ino | UTF-8 | 827 | 3.140625 | 3 | [] | no_license | /*
Infinite loop serial test
Receives from the main serial port and sends back. The Tw signal is fed also to Serial 1 Rx.
Receives from serial port 1, sends to the main serial (Serial 0).
This example works only with boards with more than one serial like Arduino Mega, Due, Zero etc.
The circuit:
- A cabl... | true |
44023d022d2716461c67fbc96257b22b7733f2aa | C++ | pylot/balau | /src/main/cpp/Balau/Container/ArrayBlockingQueue.hpp | UTF-8 | 3,151 | 3.015625 | 3 | [
"BSL-1.0"
] | permissive | // @formatter:off
//
// Balau core C++ library
//
// Copyright (C) 2008 Bora Software (contact@borasoftware.com)
//
// Licensed under the Boost Software License - Version 1.0 - August 17th, 2003.
// See the LICENSE file for the full license text.
//
///
/// @file ArrayBlockingQueue.hpp
///
/// A blocking queue that us... | true |
0fd94f10eea70ea115a55add410ca0aaf38112c8 | C++ | NoTravel/wondertrader | /src/Includes/WTSDataDef.hpp | UTF-8 | 35,817 | 2.734375 | 3 | [
"MIT"
] | permissive | /*!
* \file WTSDataDef.hpp
* \project WonderTrader
*
* \author Wesley
* \date 2020/03/30
*
* \brief Wt行情数据定义文件,包括tick、bar、orderqueue、orderdetail、transaction等数据
*/
#pragma once
#include <stdlib.h>
#include <vector>
#include <deque>
#include <string.h>
#include<chrono>
#include "WTSObject.hpp"
#include "WTSTy... | true |
92a3f52d7e6a9fffc7d6bfff90b08b8be0771d8c | C++ | TimKingNF/leetcode | /editor/cn/_10_I.fei-bo-na-qi-shu-lie-lcof.h | UTF-8 | 1,200 | 3.40625 | 3 | [] | no_license | //写一个函数,输入 n ,求斐波那契(Fibonacci)数列的第 n 项。斐波那契数列的定义如下:
//
// F(0) = 0, F(1) = 1
//F(N) = F(N - 1) + F(N - 2), 其中 N > 1.
//
// 斐波那契数列由 0 和 1 开始,之后的斐波那契数就是由之前的两数相加而得出。
//
// 答案需要取模 1e9+7(1000000007),如计算初始结果为:1000000008,请返回 1。
//
//
//
// 示例 1:
//
// 输入:n = 2
//输出:1
//
//
// 示例 2:
//
// 输入:n = 5
//输出:5
//
//
//
/... | true |
bc6d9d644fcbb5081c6756d15e5ba66c5df9092a | C++ | ZephyrLFY/Leetcode | /15-3Sum/v1.cpp | UTF-8 | 1,150 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <unordered_map>
#include <set>
#include <vector>
using namespace std;
class Solution {
public:
vector<vector<int> > threeSum(vector<int>& nums) {
vector<vector<int> > result(0);
int rNum = -1;
int len = nums.size();
unordered_map<int, int> temp;
... | true |
88b8bc2ef5382912bbc8a4dab7d7cc7618250544 | C++ | unlibrosinpaginas/LABORATORIO-de-ciencias-de-la-computacion2 | /lab1.7/main.cpp | UTF-8 | 1,090 | 3.78125 | 4 | [] | no_license | //Implementar una funcion que reciba dos cadenas, s y t, la cual debe copiar los
//elementos de t en s. Implemente en dos formas, usando arreglos y usando SOLO punteros.
//Considere que s DEBE TENER EL TAMA~NO SUFICIENTE PARA CONTENER LOS
//ELEMENTOS DE t.
#include <iostream>
#include <conio.h>
#include <string.h>
#inc... | true |
157d3a244595e5888c8d07a44f2fb241b504820a | C++ | corona75/chapter3 | /chapter3-7.cpp | UHC | 384 | 3.203125 | 3 | [] | no_license | #include<stdio.h>
int main(void)
{
double value_double = 1.2;
int value_int = 0;
short value_short = 0;
value_int = value_double;
printf("Ǽ %f %d ȯǾϴ.\n",value_double,value_int);
value_int = 32769;
value_short = value_int;
printf("int %d short %d ȯǾϴ.\n",value_int,value_short);
return 0;
} | true |
171896a8632d479b360fc370addf83a5e3e54fd2 | C++ | XiFanHeNai/Leetcode | /Intersection/Intersection/Intersection/Intersection - 副本.cpp | GB18030 | 3,950 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
Solution(vector<int> n1, vector<int> n2)
{
nums1 = n1;
nums2 = n2;
}
vector<int> intersection(vector<int>& nums1, vector<int>& nums2)
{
vector<int> temp_1(nums1.size()),temp_2(nums2.size());
vector<int> result((nums1.si... | true |
3f7a5403b63afb142b9cfd6e94ab49904d5473d1 | C++ | yalpul/ceng | /ceng213/sort/count/shaker_c.cpp | UTF-8 | 1,596 | 3.859375 | 4 | [] | no_license | /*
* Shaker Sort Algorithm
* Optimized to remember
* the indexes of sorted parts at the edges
*/
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
static unsigned long compCount = 0, moveCount = 0;
template <class T>
void shaker(std::vector<T> &v)
{
int begin_i = 0, end_i = v.size() - 1;
... | true |
40ff78d54d980de7984d640a2cf73a2699dcb8c2 | C++ | mlja226/TeensyCAN | /MotorNode/src/TeensyNode.h | UTF-8 | 1,319 | 3 | 3 | [] | no_license | #ifndef TEENSY_NODE_H
#define TEENSY_NODE_H
#include <Arduino.h>
#include <FlexCAN.h>
#include <kinetis_flexcan.h>
#include "CANMessage.h"
#define MAX_ERRORS 10
/*TeensyNode: This class is meant to act as a parent class for current Teensy nodes
* and a template for future node development. This class handles the basi... | true |
468aac1709c4c5cd42312eb6170d58c858af26ec | C++ | ceschoon/Boids | /lib/Math.cpp | UTF-8 | 2,134 | 3.46875 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////
// //
// Source file for the implementation of //
// some mathematical functions //
// ... | true |
55dd58195b42fa98fe57632a27753e8c2d66cdd5 | C++ | nkcr7/Beginning-Algorithm-Contests | /exercise-2-4-subsequence.cpp | UTF-8 | 282 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
int main()
{
int n,m;
double sum=0;
int count = 1;
while(scanf("%d%d", &n, &m)==2 && !(n==0 && m==0))
{
sum = 0;
for(int i=n;i<=m;i++)
{
sum += 1.0 / pow(i,2);
}
printf("Case %d: %.5f\n", count, sum);
count++;
}
return 0;
} | true |
f176efdd3fa77ab66b3d830f2600397efe9653a1 | C++ | MatanelAbayof/6-Colors | /oop2_ex4/ClientThread.cpp | UTF-8 | 2,377 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | //---- include section ------
#include "ClientThread.h"
#include "NetworkException.h"
ClientThread::ClientThread()
: INetworkThread(), m_connected(false)
{ }
void ClientThread::start(const sf::IpAddress& serverIpAddress, const unsigned short port)
{
// check if thread is running already
if (getState() == State::R... | true |
263d5d8bf656c17ec547e6bdce9e3b43217d8b1f | C++ | evrimulgen/Studies | /L2/S4/HLIN401/TP/TP2/SolutionsFonctionMysterieuses.cpp | ISO-8859-1 | 1,354 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <cmath>
#include <stdlib.h> /* atoi */
#include "fonctionsMysterieuses.h"
int apuissanceb(int a, int b) {
// renvoie a puissance b
if (b==0) return 1;
if (b % 2 == 0) return apuissanceb(a * a, b / 2);
return a * apuissanceb(a,b-1);}
int main(int argv, char** argc){
int numer... | true |
44a02d2cf247bf3b2d506e4566c42ebba4687ffd | C++ | amironi/Interviews | /SmTcp/Common/IntBuffer.h | UTF-8 | 374 | 2.5625 | 3 | [] | no_license | #pragma once
#include <vector>
#include <list>
using namespace std;
class IntBuffer
{
public:
IntBuffer();
IntBuffer(vector<char>& aBuffer);
~IntBuffer();
vector<char> mBuffer;
int getInt(int aPos);
int getIntList(list<int>& aList);
void setIntList(list<int>& aList);
void addInt(int aVal);
char* get... | true |
eb07a91455f01c3bfc823cdf3bcf7caa3444b400 | C++ | arisk1/algorithm-problems | /twitter_project/silhoutte.cpp | UTF-8 | 2,675 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bits/stdc++.h>
#include "functions.h"
#include "classes.h"
#include "hashT.h"
#include "initialization.h"
#include "assignments.h"
#include "update.h"
#in... | true |
68b50e5cb180d5a0aca4cf7e717abb003af9f51f | C++ | vibhavjoshi123/interview-prep-cpp | /AlgoExpert/three-number-sum.cpp | UTF-8 | 670 | 3.234375 | 3 | [] | no_license | #include <vector>
#include <algorithm>
using namespace std;
vector<vector<int> > threeNumberSum(vector<int> array, int targetSum) {
// Write your code here.
sort(array.begin(), array.end());
int curr = 0;
vector<vector<int>> result = {};
while (curr != array.size()-2) {
int left = curr + 1;
... | true |
d4527cb82308b70a1ef1d0984c53ca9bf953a839 | C++ | hadley-siqueira/hdc | /src/ast/types/Int16Type.cpp | UTF-8 | 394 | 2.5625 | 3 | [] | no_license | #include "ast/types/Int16Type.h"
using namespace hdc;
Int16Type::Int16Type() {
this->kind = AST_INT16_TYPE;
}
Int16Type::Int16Type(Token& token) {
this->token = token;
this->kind = AST_INT16_TYPE;
}
Type* Int16Type::clone() {
return new Int16Type(token);
}
int Int16Type::getRank() {
return 6;
}... | true |
7e6c81f72bf82770973b9a47e7b41f6f8c9c3af3 | C++ | MMMinoz/algorithm.problem.code | /CodeForces906D.cpp | UTF-8 | 1,074 | 2.59375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=1e5+5;
ll a[maxn];
map<int,int> mp;
ll qpow(ll a,ll b,ll mod)
{
ll res=1;
while(b)
{
if(b&1)
res=res*a>mod?res*a%mod+mod:res*a;
a=a*a>mod?a*a%mod+mod:a*a;
b>>=1;
}
return res;
}
ll p... | true |
96dd26174b5311354b14006b3643e3ffac39a26e | C++ | MassimilianoRozza/EserciziLaboratorio | /Esercizi0/0.7_PariDispari.cpp | UTF-8 | 624 | 3.640625 | 4 | [] | no_license | /*
Scrivere un programma che prende un intero e verifica se questo è pari o dispari e scrive qualcosa a proposito.
*/
using namespace std;
#include <iostream>
int main(int argc, char const *argv[])
{
int numero;
cout<<"inserire un numero per verificare se sia pari, inserire 0 per uscire"<<endl;
cin>>numero... | true |
6d11b440956140a59be6ecce19cb49a4dc90c64c | C++ | SilverHL/Leetcode | /474.一和零.cpp | UTF-8 | 1,062 | 2.6875 | 3 | [] | no_license | #include <vector>
#include <string>
#include <cstring>
using namespace std;
/*
* @lc app=leetcode.cn id=474 lang=cpp
*
* [474] 一和零
*/
// @lc code=start
class Solution {
public:
int* cnt1(string& s)
{
int count[2];
for (auto c : s) {
count[c-'0']++;
}
return co... | true |
7f44c1a6090cb940700de0c18bd88a87ffb07c9d | C++ | sh4062/PAT | /A/1123.cpp | UTF-8 | 2,778 | 3.21875 | 3 | [] | no_license | /*
* File: 1123.cpp
* Project: A
* File Created: Tuesday, 26th February 2019 12:00:29 pm
* Author: max (mx0666@163.com)
* -----
* Last Modified: Tuesday, 26th February 2019 1:49:40 pm
* Modified By: max (mx0666@163.com>)
* -----
* Copyright 2018 - 2019 Your Company
*/
//这个题好难啊 写出4种旋转
#include <bits/stdc++.h>
... | true |
81df484e7af1f295a9e9f441b72902e51f8166bf | C++ | Tsunuky/Rtype | /Client/includes/Graph/Objects.hpp | UTF-8 | 2,131 | 2.84375 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2020
** Visual Studio Live Share (Workspace)
** File description:
** Objects
*/
#ifndef OBJSPRITE_HPP
#define OBJSPRITE_HPP
#include "IObject.hpp"
class ObjSprite: public PrimaryObj {
public:
ObjSprite(std::shared_ptr<std::map<std::string, Sprite>> Sprites, std::shared_ptr<std::map<std::s... | true |
c48f8fc3b87793ba3c5265537f07fff481d83246 | C++ | Rutvik1999/CPP_NCERT_class12 | /C++89 Standard/Binary.search.cpp | UTF-8 | 773 | 3.3125 | 3 | [] | no_license |
#define max 100
int Bsearch(int a[],int s,int ele)
{ int beg=0,last = size -1,mid;
for(int i =0;i<size;i++)
{ mid = (beg + last)/2;
if(ele==a[mid])
return mid;
elseif(ele>a[mid])
beg = mid + 1;
else
la... | true |
619b7cf3f8e8dbe9a06b075203c03c38d2d7cd2e | C++ | okokme/server- | /C++/gtest测试/my_class.h | UTF-8 | 173 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
class MyClass {
public:
MyClass(int x) : x_(x) {}
void SetX(int x) {
x_ = x;
}
int GetX() const {
return x_;
}
private:
int x_;
};
| true |
c33bd490dde71c4a20d72ae95a0b6e28ac232732 | C++ | Howard0o0/design-patterns-in-cpp | /src/observer/observertest.cc | UTF-8 | 645 | 3.046875 | 3 | [] | no_license | #include "observer.h"
#include <iostream>
#include <string>
void ObserverTest();
int main() {
ObserverTest();
return 0;
}
void ObserverTest() {
class BlogFollower : public observer::Observer {
public:
BlogFollower(const std::string& name) : name_(name) {
}
virtual void update() override {
std::cou... | true |
2d11a1eba3113b055ce1083c5ed4929d653f978e | C++ | HsuJv/Note | /Code/C/College/Data Structure/h/seqList.h | UTF-8 | 1,765 | 3.484375 | 3 | [] | no_license | #ifndef SEQ_LIST_H
#define SEQ_LIST_H
#ifndef LINEAR_LIST_H
#include "linearList.h"
#endif // LINEAR_LIST_H
template <class T>
class seqList : public linearList<T>
{
public:
seqList(int mSize){
maxLength = mSize;
elements = new T[maxLength];
n = 0;
}
~seqList() { delete[] elements;}
bool IsEmpty() const ... | true |
4a747a71ef5f83a3b10ca001c6b3af5c0c3efc02 | C++ | Nickick-ICRS/dmt_project | /mbed/cynaptix_mbed/Web/messages.h | UTF-8 | 1,068 | 2.625 | 3 | [] | no_license | #ifndef __MESSAGES_H__
#define __MESSAGES_H__
/**********************************************
* This contains a bunch of definitions used *
* by any networking class to know standard *
* message contents *
**********************************************/
// This is used in a few other ... | true |
2d6c504d6a9289a82c4d3f6f83d258f06a48f37a | C++ | firepro20/labyrinthoftime | /Cell.h | UTF-8 | 769 | 2.625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "modelclass.h"
#include "pch.h"
using namespace DirectX;
class Cell {
private:
int cellState;
DirectX::SimpleMath::Vector3 cellPosition;
DirectX::SimpleMath::Vector3 cellCentre;
DirectX::SimpleMath::Vector3 cellDimensions;
public:
Cell();
~Cell();
void SetPosition(Direc... | true |
ab516cb42f43cea8da34dd948db082643b050e21 | C++ | mob141043/Leetcode_Solutions | /leetCode_solution/leetCode_solution/TwoSum.cpp | UTF-8 | 516 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include<vector>
#include<map>
using namespace std;
vector<int> twoSum(vector<int>& nums, int target) {
map<int, int> map;
int size = nums.size();
int complement = 0;
for (int i = 0; i < size; i++) {
map[nums[i]] = i;
}
for (int i = 0; i < size; i++) {
complement = target - nums[i];
if ... | true |
a13a5fd0dc4d26989c4bd70e093ba2384dc16f4b | C++ | s-e-a-70/Balls | /one_ball.cpp | UTF-8 | 1,877 | 3.015625 | 3 | [] | no_license | #include "TxLib.h"
void Balls_Move();
void Draw_Ball (int x, int y, COLORREF border_color, COLORREF fill_color);
void Physics_Ball (int *x, int *y, int *vx, int *vy, int ax, int ay, int dt);
void Control_Ball (int *x, int *y, int *vx, int *vy);
//-----------------------------------------------------
int m... | true |
80752d71d5b8bfa4813239cff72d7e13f7a86363 | C++ | jgalfaro/mirrored-tbridge-modbus | /cpp/cpp/TollSim.cpp | UTF-8 | 1,468 | 2.703125 | 3 | [] | no_license | #include <stdio.h>
#include <cstdio>
#include <jni.h>
#ifdef _WIN32
#define PATH_SEPARATOR ';'
#include <tchar.h>
#else
#define PATH_SEPARATOR ':'
#endif
int main() {
JavaVM *jvm; /* denotes a Java VM */
JNIEnv *env; /* pointer to native method interface */
JavaVMInitArgs vm_args; /* JDK/... | true |
900f9d43b6860782340ccbf0b67fea992937e5de | C++ | kabukunz/meshlib | /algorithm/riemannian/Delaunay/DelaunayRefineMesh.h | UTF-8 | 2,514 | 3.046875 | 3 | [] | no_license | /*! \file DelaunayRefineMesh.h
* \brief Mesh Refinement using Delaunay Triangulation
* \date Documented on 10/15/2010
*
* Adding Steiner points to an existing mesh to improve the mesh quality. The input mesh must not have
* flipped faces. In practice, we prefer to use harmonic mapping result as the input mesh,... | true |
12046575e702f6f054157a363ca4da420e8909e4 | C++ | cdessers/Effect-of-electromagnetic-radiation-on-the-brain | /Array_3D_Template.h | UTF-8 | 1,011 | 3.40625 | 3 | [] | no_license | #ifndef ARRAY_3D_TEMPLATE_H
#define ARRAY_3D_TEMPLATE_H
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
template <typename T>
class Array_3D_Template{
private:
// Data:
T *data = NULL;
// Sizes along x, y and z:
size_t Nx, Ny, Nz;
// Boolean to check if data has already been a... | true |
e142c82f0cbb65aa658fb24a55c881baf9664b19 | C++ | mohitnitrr/Competitive-Programming | /HackerRank/ConsoleApplication1/ConsoleApplication1/KthSmallest.cpp | UTF-8 | 915 | 3.171875 | 3 | [] | no_license | #include"bits_stdc.h"
void heapify(vector<int> &A, int i = 0) {
while (i <= (A.size()-1)/2) {
int left = 2 * i + 1;
int right = 2 * (i + 1);
int largest = i;
if (left < A.size() && A[left] > A[largest])
largest = left;
if (right < A.size() && A[right] > A[largest])
largest = right;
if (largest != i... | true |
f9653f11c9201fe1e3cea320592dd59c7c510b1b | C++ | FireFoxPlus/CrackInterview | /c++ code/CCrackCodeInterview/reverse.cpp | UTF-8 | 297 | 2.875 | 3 | [] | no_license | #include "reverse.h"
char *reverseString::reverseStr(char *str , int length)
{
char *rs = new char[length + 1];
rs[length] = '\0';
int ends = length - 1 , start = 0;
while(start < length)
{
rs[start] = str[ends];
start++;
ends--;
}
return rs;
}
| true |
5fb9ee0fd1c2f3e2d829300ca9719c31cea6df1c | C++ | api7/mod_dubbo | /utils/utils.cc | UTF-8 | 3,032 | 2.890625 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include "utils.h"
#include <string>
#include <sstream>
#include <ostream>
#include <inttypes.h>
namespace hessian {
using namespace std;
int ngx_hessian_is_big_endian() {
const int n = 1;
if(*(char *)&n) {
return 0;
}
return 1... | true |
531c1356e1e6e3002a5d8fd5219dac03c6ef63d9 | C++ | 007atulpandey/COMPETITIVE_PROGRAMMING_TEMPLATE | /template_extra/templates/graph.cpp | UTF-8 | 783 | 2.8125 | 3 | [] | no_license | struct graph {
int n;
vector<bool> vis;
vector<vector<int> > edges;
void init(int size) {
n = size;
vis = vector<bool>(n);
edges = vector<vector<int> >(n);
}
void readGraph(int numEdges, bool isTheGraphUndirected) {
f0r(i, numEdges) {
int u, v; cin >> u >> v;
--u; --v;
... | true |
e2f5c367ef1201594062db28489bbf0635531199 | C++ | cats9rule/sp-lab | /Stack/Stack/main.cpp | UTF-8 | 151 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
string njanja = "HELLO WORLD";
for (char c : njanja)
{
cout << c;
}
} | true |
f51dffb1dcec89b999aee92f42904d9ad676a389 | C++ | HiTech2019/dsa | /datastructure/depthFirstSearch.cpp | UTF-8 | 3,088 | 3.734375 | 4 | [] | no_license | /*
* http://www.cnblogs.com/dolphin0520/archive/2011/08/25/2153720.html
* 树的3种深度遍历:前、中、后
* 递归和非递归
*/
class DepthFirstSearch{
void preTravel(BiTree* root) {
if(!root){
return;
}
cout << root->data;
preTravel(root->left);
preTravel(root->right);
}
void i... | true |