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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
70078ac12649e7d9f4222947544e3b01493ff035 | C++ | ShuoWillWang/EE569_HW4 | /C/Kmeans2_main.cpp | UTF-8 | 10,743 | 2.734375 | 3 | [] | no_license | // EE 569 Homework #4
// date: Apr. 23th, 2017
// Name: Shuo Wang
// ID: 8749390300
// email: wang133@usc.edu
// Compiled on WINDOWS 10 with Visual C++ and Opencv 3.2
// solution for Problem 1 (c) The K-means for the second convolution layer
// Directly open the Kmeans2.exe to run the program
#include <ios... | true |
f904ee6542b1764b12a5da0e9e9aa7d1705d7709 | C++ | punkproger/Project-Euler | /Problem 52/main.cpp | UTF-8 | 945 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cmath>
using ull = unsigned long long;
size_t countDigits(ull number) {
size_t digs{0};
do {
++digs;
} while(number/=10);
return digs;
}
bool haveSameNumbers(ull f_num, ull s_num) {
int f_digs[10] = {0};
int s_digs[10] = {0};
while(f_num) {
++f_digs[f_n... | true |
328eb3442e648fd5a68686b64df8dc118941a04e | C++ | kangdaeki/windowsnetworkprogramming | /WinThread/ExThread2.cpp | UTF-8 | 559 | 2.796875 | 3 | [] | no_license | #include <windows.h>
#include <stdio.h>
DWORD WINAPI MyThread(LPVOID arg)
{
while (1) ;
return 0;
}
int main (int argc, char *argv[])
{
SYSTEM_INFO si;
GetSystemInfo(&si);
fprintf(stdout, "# of CPUs = %d\n",(int)si.dwNumberOfProcessors);
for (int i=0; i<(int)si.dwNumberOfProcessors; i++)
{
HANDLE hThread =... | true |
4c61242dca2df6133f3b3ab2423c5616638c5027 | C++ | atheros/arcade-paic | /paic.ino | UTF-8 | 8,417 | 2.765625 | 3 | [] | no_license | #include <EEPROM.h>
#include "Cmd.h"
#define VERSION "1.0.0"
// maximum input lines
#define MAX_INPUT 12
// keyboard values
char outputKeys[MAX_INPUT];
// pin numbers
char inputPins[MAX_INPUT];
// the state of pressed buttons
int16_t inputState = 0;
// is debugging on
bool debug = false;
// has the serial con... | true |
b0c9b29bdb26110529d523eac9f833ecfd6f4a33 | C++ | arnisritins/Olimps | /pulkst.cpp | UTF-8 | 910 | 3.265625 | 3 | [] | no_license | #include <fstream>
#include <string>
#include <sstream>
using namespace std;
bool same_chars(string str1, string str2){
int pos;
for(int i = 0; i < 4; i++){
pos = str2.find(str1[i]);
if(pos != -1)
str2.erase(pos, 1);
}
return str2.size() == 0;
}
void plus_minute(int &h, int &m){
if(m == 59){
m = 0;... | true |
fc4a1c5ee967194323d83805e714791c70dc6612 | C++ | Gerwand/opengrl | /OpenGRL/include/grl/track/TrackRecorderQueue.h | UTF-8 | 2,619 | 3.28125 | 3 | [] | no_license | #pragma once
#include <grl/track/TrackRecorder.h>
#include <grl/track/TrackOffsets.h>
namespace grl {
/**
* This implementation of the recorder is meant to be used as a buffer for
* all points with possibility to quickly remove oldest point whenever newer one
* must be added.
*/
class TrackRecorderQueue : privat... | true |
2e3ae837f8d67a0436b64c14fad41c8f407bd84e | C++ | zhongershun/data-structure | /MyQueue/main.cpp | UTF-8 | 370 | 2.90625 | 3 | [] | no_license | #include"MyQueue.h"
#include"MyQueue.cpp"
#include<iostream>
using namespace std;
int main()
{
MyQueue<int> Q;
int n;
cin>>n;
int item;
for (int i = 0; i < n; i++)
{
cin>>item;
Q.append(item);
}
for (int i = 0; i < n; i++)
{
Q.serve(item);
cout<<item<... | true |
d8b0850a42b6a1c68d3c5cd5230274ad11d211a4 | C++ | Habil-Ndiamoun/420-W48-SF | /Module11_ESP32_ServeurWeb/AMOC_Module11_ServeurWebPrepExercices/include/Actionneur.h | UTF-8 | 343 | 2.671875 | 3 | [
"CC0-1.0"
] | permissive | #pragma once
#include <Arduino.h>
class Actionneur {
public:
Actionneur(int const &p_id, String const& p_description);
const String& description() const;
int id() const;
virtual void allumer() = 0;
virtual void eteindre() = 0;
virtual bool estAllume() const = 0;
private:
int m_id;
S... | true |
62d4dee80a001cc45ace6830c069b954fe65e47d | C++ | Hepta4413/PLD_COMP | /src/Ligne.cpp | UTF-8 | 726 | 2.703125 | 3 | [] | no_license | #include "Ligne.h"
#include <iostream>
using namespace std;
Ligne::Ligne()
{
#ifdef MAP
cout << "Appel au constructeur vide de Ligne" << endl;
#endif
typeContenu = _LIGNE;
}
void Ligne::AddLigneColonne(int ligne,int colonne)
{
#ifdef MAP
cout << "Appel a la fonction AddLigneColonne de Ligne(int ligne, int co... | true |
826c520a74f5bfed5342f6d12858883cd334314c | C++ | LeeJehwan/Baekjoon-Online-Judge | /code/01644_소수의 연속합.cpp | UTF-8 | 768 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int prime[4000001];
bool count_p[4000001];
int cnt = 0;
void eratos() {
for (int i = 2; i <= 4000000; i++) {
if (count_p[i] == false)
prime[cnt++] = i;
for (int j = i * 2; j <= 4000000; j += i)
c... | true |
5aafc5bd9e5b1841c99c1e371179a0b985cac7f9 | C++ | xiaogaogaoxiao/SP-dock | /src/graph/patch.cpp | UTF-8 | 4,805 | 2.578125 | 3 | [] | no_license | #include "../../inc/graph/patch.h"
#include "../../inc/math/linalg.h"
#include <iostream>
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/matrix_access.hpp>
#include <glm/gtx/string_cast.hpp>
#include <gsl/gsl_math.h>
#include <gsl/gsl_eigen.h>
#include <gsl/gsl_blas.h>
//--------------------... | true |
50773d8a2e1d5b1f311f33d917a377c6fd8964b5 | C++ | Amartaivan/nest_coding | /competitive/dp/ladder.cpp | UTF-8 | 739 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
#define long_t unsigned long long
long_t calculate(int n, vector<long_t>& dp){
if (n < 3)
return 1;
if (dp[n - 1] == -1)
dp[n - 1] = calculate(n - 1, dp);
if (dp[n - 3] == -1)
dp[n - 3] = calculate(n - 3, dp);
d... | true |
b267bb175fb9c4f002ad116342cf5f9c7ff03d6e | C++ | shendibrani/MGE_Phong | /src/mge/core/Timer.hpp | UTF-8 | 468 | 2.8125 | 3 | [] | no_license | #ifndef TIME_H
#define TIME_H
#include <SFML/System.hpp>
//Wrapper around sf::Clock to provide the elapsed time overall, and elapsed time since the last frame update
class Timer
{
private: // data members
static sf::Clock _clock;
static float _currentTime;
static float _deltaTime;
private: // disable creati... | true |
fe58c99e245d5fd9d917c63b7ab157c88167ee81 | C++ | cnbeiyu/Algorithm | /LanQiaoExercise/02 字符串和日期/190228字符串反转.cpp | UTF-8 | 235 | 2.59375 | 3 | [] | no_license | #include <cstdio>
#include<cstring>
char s[1000];
int main(int argc, char const *argv[])
{
int len;
scanf("%s", &s);
len = strlen(s);
printf("%d\n", len);
for (int i = len - 1; i > -1; --i)
{
printf("%c", s[i]);
}
return 0;
} | true |
114f77781a27f6f9057cc6a882ec65fa334beb0d | C++ | grtwall/kigs | /tools/BundleList/Sources/BundleList.cpp | UTF-8 | 4,228 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "BundleList.h"
#include "ModuleThread.h"
#include "Thread.h"
#include <iostream>
#include <windows.h>
#include <stdlib.h>
#include <fstream>
void BundleList::usage()
{
std::cout << "Usage :" << std::endl;
std::cout << "BundleList [-i inputPath] [ -o outputfile ]" << std::endl;
std::cout << "-i inputPath : ... | true |
fcbbde69b333adf20f89d68a5c75fde11b7a4bc4 | C++ | ofthedove/cecs130 | /Lab 10/GameBoard.cpp | UTF-8 | 3,275 | 3.328125 | 3 | [] | no_license | #include "GameBoard.h"
#include <iostream>
GameBoard::GameBoard()
{
for(int i=0; i<3; i++) {
for(int j=0; j<3; j++) {
board[i][j] = ' ';
}
}
gameOver = false;
whoWon = ' ';
}
GameBoard::~GameBoard()
{
}
bool GameBoard::checkMoveValid(int xCord, int yCord)
{
if(board[xCord][yCord] == ' ') {
return tr... | true |
1b3ffab784dba13f3bb6a3722b38f74edd52abb3 | C++ | samiratzn/patent-classification | /parse.cpp | UTF-8 | 3,889 | 2.546875 | 3 | [] | no_license | #include <pugixml.hpp>
#include <sqlite3x-master/sqlite3x.hpp>
#include <iostream>
#include <string>
#include <thread>
#include <future>
#include <vector>
#include <boost/program_options.hpp>
#include <xmlpatentparser.hpp>
#include <pftapsparser.h>
using namespace std;
using namespace sqlite3x; // because it uses pre... | true |
7f11d589da61d01a7d139a362e354f434894fe3a | C++ | sugawaray/filemanager | /record_readers.h | UTF-8 | 1,162 | 2.921875 | 3 | [
"MIT"
] | permissive | #ifndef __RECORD_READERS_H__
#define __RECORD_READERS_H__
#include <sqlite3.h>
#include "record_receiver.h"
namespace ml {
namespace db {
template<class T, class U>
class Record_collector : public Record_receiver {
public:
Record_collector(T inserter, const U& converter)
: inserter(inserter),
converter(converte... | true |
6f67d81bc46dade1e6ab4970d35f85c588c8cce5 | C++ | Arozzal/TowerDefenseGame | /TowerDefeneseGame/Map.cpp | UTF-8 | 3,975 | 2.953125 | 3 | [] | no_license | #include "Map.hpp"
Map::Map(int sizex, int sizey, std::string path)
{
this->sizex = sizex;
this->sizey = sizey;
data = new byte[sizex * sizey];
memset(data, 0, sizex * sizey * sizeof(byte));
data[3] = 1;
isused = new bool[sizex * sizey];
memset(isused, 0, sizex * sizey * sizeof(bool));
if (path != "") {
map... | true |
8f1fdf726dbf8aadc631414258bdc23c22c3822a | C++ | InsightSoftwareConsortium/ITK | /Modules/ThirdParty/MetaIO/src/MetaIO/src/tests/testMeta7Line.cxx | UTF-8 | 1,887 | 3.046875 | 3 | [
"IJG",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"SMLNJ",
"BSD-3-Clause",
"BSD-4.3TAHOE",
"LicenseRef-scancode-free-unknown",
"Spencer-86",
"LicenseRef-scancode-llnl",
"FSFUL",
"Libpng",
"libtiff",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive",
... | permissive | #include <iostream>
#include <metaLine.h>
int
main(int, char *[])
{
std::cout << "Creating test file ...";
auto * Line = new MetaLine(3);
Line->ID(0);
LinePnt * pnt;
unsigned int i;
for (i = 0; i < 10; i++)
{
pnt = new LinePnt(3);
pnt->m_X[0] = static_cast<float>(0.2);
pnt->m_X[1] = i;
... | true |
032500a0f6d043f846717587971f3c2a66b406e8 | C++ | ahmad-saeed/arduino | /checkButtonsAndLEDs/checkButtonsAndLEDs.ino | UTF-8 | 951 | 2.59375 | 3 | [] | no_license | const int LED1 = 9 ;
const int LED2 = 10 ;
const int LED3 = 11 ;
const int LED4 = 12 ;
const int button1 = 5 ;
const int button2 = 6 ;
const int button3 = 7 ;
const int button4 = 8 ;
boolean isButton4Up = true;
void setup() {
// put your setup code here, to run once:
pinMode(LED1,OUTPUT);
pinMode(LED4 ,OUTPUT);
... | true |
15683db0b9e1484e5c0cd99a744b5a93ab5d8bb6 | C++ | rileyzzz/TrainzMapFiles | /TrainzMapFiles/GNDFile.cpp | UTF-8 | 11,095 | 2.71875 | 3 | [] | no_license | #include "GNDFile.h"
#include <stdio.h>
#include <iostream>
#include <iomanip>
GNDFile::GNDFile(const char* path)
{
IOArchive Arch(path, IODirection::Import);
Serialize(Arch);
}
GNDFile::~GNDFile()
{
}
bool GNDFile::Serialize(IOArchive& Ar)
{
if (Ar.IsSaving())
{
Ar.Serialize("GND", 3);
}
else
{
char Read... | true |
17723b9c688ebcd3811f0f2c6a9c6a00203fe43c | C++ | Kh4ster/chess | /tests/unit_tests/possible_move_test.cc | UTF-8 | 2,330 | 2.640625 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "chess_engine/board/chessboard.hh"
#include "parsing/perft_parser/perft-parser.hh"
#include "chess_engine/board/move-generation.hh"
using namespace board;
using namespace move_generation;
using namespace std;
/*
TEST(PossibleMove, Queen)
{
// This is the subject example
Ches... | true |
170ff3c871efddc929cd9153d0227e8f92c4d650 | C++ | jford22/sigpro | /include/TxRxMeta.h | UTF-8 | 4,932 | 2.890625 | 3 | [] | no_license | #pragma once
#include "Constants.h"
// This Class Should Contain Information about The Transmit Waveform, it's timing and the receive window
enum Modulation {
LFM,
NLFM,
DPC,
TEST};
class TxRxMeta
{
private:
// Transmit (TX) Parameters
double tx_start_time_seconds;
double tx_stop_tim... | true |
63b59a874cf59b8f71a31b9f0f9efb50d9a74d9c | C++ | Daineeeng/Practice | /토마토.cpp | UTF-8 | 1,551 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
char graph[50][50];
int visit[50][50];
int dx[] = { -1,1,0,0 };
int dy[] = { -1,1,0,0 };
int R, C, moveCnt;
queue<pair<int, int>> hedge_q;
queue<pair<int, int>> water_q;
void bfs() {
while (!hedge_q.empty()) {
int wq_size = water_q.size();
while (wq_... | true |
9ba15e001bc4d696a55bf4892e8f4a9fa49e6869 | C++ | pekashy/mini-java-compiller | /src/SymbolTree/ScopeNode.cpp | UTF-8 | 1,182 | 2.65625 | 3 | [] | no_license | #include <SymbolTree/ScopeNode.h>
#include <SymbolTree/Scope.h>
std::shared_ptr<ScopeNode> ScopeNode::Create(const std::shared_ptr<ScopeNode>& pParentNode)
{
auto ptr = std::shared_ptr<ScopeNode>(new ScopeNode(pParentNode));
ptr->Init();
return ptr;
}
std::shared_ptr<ScopeNode> ScopeNode::CreateBasicOuterScope()
... | true |
4b94a9822fff1ea1c209b6e18519c248fb746186 | C++ | Sparksidy/A-star-Pathfinding | /Pathfinding/Pathfinding/Source/AStar.cpp | UTF-8 | 6,907 | 2.90625 | 3 | [] | no_license | #include <Stdafx.h>
#include <iostream>
#include <movement.h>
#include "AStar.h"
AStar::AStar()
{
//Initialize the lists
}
AStar::~AStar()
{
//Clear the open and closed lists
_ClosedList.clear();
_OpenList.clear();
}
bool AStar::FindAStarPath( Node* start, Node* end, WaypointList& waypointList)
{
//TODO: If s... | true |
33574dc09b978436953a99988ac559cdfe707f37 | C++ | WajeehAlbasha/first-c--projects | /C++ dönem 1 Odevleri/C_g181210552_2/C_g181210552_2.cpp | UTF-8 | 4,064 | 2.75 | 3 | [] | no_license | //***************************
//* SAKARYA ÜNİVERSİTESİ
//* BİLGİSAYAR VE BİLİŞİM BİLİMLERİ FAKÜLTESİ
//* BİLGİSAYAR MÜHENDİSLİĞİ BÖLÜMÜ
//* ÖĞRENCİ NUMARASI => g181210552
//* ÖĞRENCİNİN ADI => waje... | true |
5a9216535e3a6f1ada84b4af85475c9889f5e239 | C++ | huhuhu1092/test-server | /SEHome/seengine/src/game/cchess/SE_Pipe.cpp | UTF-8 | 4,984 | 2.640625 | 3 | [] | no_license | #include "SE_Pipe.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "SE_Log.h"
#include "SE_Application.h"
#include "SE_ChessCommand.h"
#include "./base/pipe.h"
#if defined(WIN32)
const int PATH_SEPERATOR = '\\';
#else
const int PATH_SEPERATOR = '/';
#endif
//static PipeStruct pipeStd;
SE_PipeStruc... | true |
2b3ac1b1e6beb4f960199c773986bf778d67adba | C++ | GeorgeNav/Learning | /C++/ProgrammingFundamentalsI_1336/LAB 5/PROJECTS/Task2 and 3 Chapter 5/Task2 and 3 Chapter 5/Source.cpp | UTF-8 | 1,043 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
const int SENTINEL = -1;
signed int count, dataItems;
double dollars, total, average;
ifstream infile;
infile.open("C:\GOOGLE DRIVE\SCHOOL\LONESTAR\PROGRAMMING FUNDAMENTALS I 1336\LABS\LAB 5\PROJECTS\Task2 and 3 Chapter 5\Salesd... | true |
295779c6b3e59318af3083a8ab9da54eb546de03 | C++ | xh286/leetcode | /228-Summary-Ranges/solution.cpp | UTF-8 | 975 | 3.15625 | 3 | [] | no_license | class Solution {
private:
void insertRange(vector<string>& ret, int start, int end)
{
ostringstream ss;
// assert(end>=start);
ss << start;
if(end>start)
ss << "->" << end;
ret.push_back(ss.str());
}
public:
vector<string> summaryRanges(vector<int>& nu... | true |
e1d495e7636b6353e5dce2d72ca86b1f23feb1ef | C++ | 5fe6eb50c7aa19f9/OJ | /zj/b417.cpp | UTF-8 | 1,535 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
struct Quest{
int i,l,r;
};
int sep;
int data[100000];
Quest quest[1000000];
int ans[1000000][2];
char buff[10000000];
int cnt[1000000];
int num[1000000];
int l,r,biggest;
bool cmp(Quest &a,Quest &b){
if(a.l/sep!=b.... | true |
d8d652845a5bf0516071ebce9502031166a49e80 | C++ | metux/chromium-suckless | /v8/src/identity-map.h | UTF-8 | 2,971 | 2.640625 | 3 | [
"BSD-3-Clause",
"SunPro",
"bzip2-1.0.6"
] | permissive | // Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_IDENTITY_MAP_H_
#define V8_IDENTITY_MAP_H_
#include "src/base/functional.h"
#include "src/handles.h"
namespace v8 {
namespace internal {
/... | true |
51bf29a8fea728eff06bccb5c90a045589271493 | C++ | Ryan-rsm-McKenzie/CommonLibSSE | /include/RE/B/BSTCaseInsensitiveStringMap.h | UTF-8 | 492 | 2.5625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "RE/N/NiTStringMap.h"
namespace RE
{
// 28
template <class T>
class BSTCaseInsensitiveStringMap : public NiTStringMap<T>
{
private:
using base = NiTStringMap<T>;
public:
using key_type = typename base::key_type;
virtual ~BSTCaseInsensitiveStringMap(); // 00
// override (NiTStri... | true |
a1f60f9eb74472141971ad587c65c269c6cee203 | C++ | tomazos/wt | /database/sqlite/sqlite_test.cc | UTF-8 | 1,221 | 2.625 | 3 | [] | no_license | #include "database/sqlite/connection.h"
#include <boost/filesystem.hpp>
#include "core/env.h"
#include "core/file_functions.h"
#include "core/must.h"
#include "gtest/gtest.h"
namespace database {
namespace sqlite {
TEST(Sqlite3Test, Connection) {
filesystem::path source_root = GetEnv("SOURCE_ROOT");
filesystem:... | true |
6bfc32fd2cdb4d87f3386fac36fcd312a65f4ffd | C++ | bence7999/OOP_CPP | /OOP_CPP/ChapterThirteen.cpp | UTF-8 | 21,839 | 4.25 | 4 | [] | no_license | #include "ChapterThirteen.h"
using namespace std;
namespace ChapterThirteen {
/// 13.1 Polymorphism: a simple example
// Write a program to study polymorphism. Use the following specifications: Create a base class called creatures.
// It should have a constructor and method move to tell about how that creature... | true |
53fa09556bb020452ec881920883826842b4cd6e | C++ | colinblack/game_server | /server/app/data/MineManager.cpp | UTF-8 | 4,968 | 2.609375 | 3 | [] | no_license | /*
* MineManager.cpp
*
* Created on: 2016-11-15
* Author: dawx62fac
*/
#include "MineManager.h"
#include "DataInc.h"
MineHole::MineHole() : uid_(0), level_(0), donate_cnt_(0)
{
}
void MineHole::Reset()
{
uid_ = 0;
level_ = 0;
donate_cnt_ = 0;
memset(donate_user_, 0, sizeof(donate_user_));
memset(na... | true |
4600130cc595989c3223772d1cadc85b3d789721 | C++ | chenxiaohui/leetcode | /leetcode/TrappingRainWater.cpp | UTF-8 | 507 | 3.109375 | 3 | [] | no_license | /*
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
For example,
Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6.
The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain... | true |
885e3ffa322fb7ccf7327c646c18a2a79873ec86 | C++ | MorgFost96/School-Projects | /Data Structures/Labs/LinearSearch/LinearSearch.cpp | UTF-8 | 1,299 | 3.90625 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int num;
//User Input of Array Size
cout << "Enter in a Number: ";
cin >> num;
int array[1000];
int i, key;
for (int z = 0; z < num; z++)
{
cout << "Enter " << z << " Number: ";
cin >> array[z];
}
//Index
for (int x = 0; x <... | true |
6b2d29ab82303de709e5b6885ebd9bc5bcb8b98f | C++ | madhok/Craftsmanship | /Arrays/Rotation_ntimes.cpp | UTF-8 | 991 | 3.921875 | 4 | [] | no_license | /*
Given a sorted array which is rotated 'N' times. Find the value of 'N'.
Input:
The first line contains an integer T, depicting total number of test cases.
Then following T lines contains an integer N depicting the size of array and next line followed by the value of array.
Output:
Print the value of 'n'.
C... | true |
3e49a3ddab3517260a93077c367af876cdec9b63 | C++ | biqar/interviewbit | /Tree Data Structure/Level order/ZigZag Level Order Traversal BT/zigzag_levelorder.cpp | UTF-8 | 1,542 | 3.015625 | 3 | [
"MIT"
] | permissive | //
// Created by Islam, Abdullah Al Raqibul on 11/26/19.
//
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
vector<vector<int> > Solution::zigzagLevelOrder(TreeNode* A) {
// D... | true |
3c4ec770279979f87188d040e24a66d3fa0de154 | C++ | shubhampathak09/dynamic-programming-and-arrays | /CP guide/reverse a linked list.cpp | UTF-8 | 761 | 3.328125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node*next;
node(int data)
{
this->data=data;
next=NULL;
}
};
struct node* reverse(struct node*root)
{
struct node*curr=root;
struct node*temp=NULL;
struct node*prev=NULL;
while(curr!=NULL)
{
temp=curr->next;
curr->nex... | true |
f762bf1f2596540b7480d766304795a2595450b9 | C++ | danineamati/RoboticsDitchDay2019 | /LCDDisplayCode/LCDDisplayCode.ino | UTF-8 | 1,688 | 3.171875 | 3 | [] | no_license | #include <Wire.h>
#include <LiquidCrystal_PCF8574.h>
#include "LCD_functions.h"
LiquidCrystal_PCF8574 lcd(0x27);
// set the LCD address to 0x27 for a 16 chars and 2 line display
int show;
void setup()
{
int error;
Serial.begin(115200);
Serial.println("LCD...");
// See http://playground.arduino.cc/Main/I2... | true |
362a8317f639882ab8fbae2dc944d3ae724827a6 | C++ | wangfuli217/ld_note | /cheatsheet/ops_doc-master/Service/cfaq/example_c/timer/LinkList.h | UTF-8 | 1,531 | 2.765625 | 3 | [] | no_license | /**
* @brief: Ò»¸ö°üÀ¨¶¨Ê±Æ÷½áµãµÄË«ÏòÁ´±í
* Ò»¸öÂÖ×Ó£¬²å²Û´óСΪm_size,±íʾÿһ¸ö²å²Û¶¼ÓÐÒ»¸öË«ÏòÁ´±í¡£
*
* @Author:Expter
* @date: 03/01/2010
*/
#ifndef __LINK_LIST_H_
#define __LINK_LIST_H_
#include "TypeDef.h"
#include "tools.h"
///
/// Ò»¸öÂÖ×Ó,Ò»¸öÑ»·¶ÓÁÐ
///
///
class CLinkList
{
pub... | true |
792f4a2e99741b7cff4164ac7682448c8c65baeb | C++ | jainsourav43/DSA | /dsa/General Questions/hw 3.cpp | UTF-8 | 695 | 3.109375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int maxe=0,mini,avg,sum1=0;int k=0;
void sum(int *p,int s)
{
if(s==0)
{cout.setf(ios::fixed);
cout.precision(2);
cout<<"average\n"<<float(sum1)/k<<endl;
return ;
}
else
{
k++;
if((*p)> maxe)
{
maxe=*p;
}
if((*p)<mini)
{
mini=*p;
}
su... | true |
0e72009cfe3884579931fdeeae312fafa5351d5d | C++ | JuliaYu2002/HunterDE | /Comp Sci 135+136/box.cpp | UTF-8 | 657 | 3.359375 | 3 | [] | no_license | // Author: Julia Yu
// Date: February 23, 2020
// Course: CSCI-135
// Instructor: Prof. Maryash
// Assignment: Lab 4A
#include <iostream>
using namespace std;
int main(){
int width, height;
cout << "Enter width: ";
cin >> width;
cout << "Enter height: ";
cin >> height;
cout << e... | true |
abd5020f7094244731907f0f60966e0deb6a6bbb | C++ | hantengx/LeetCode | /src/string/ReverseInteger.h | UTF-8 | 427 | 2.796875 | 3 | [] | no_license | //
// Created by hanteng on 2018/9/9.
//给定一个 32 位有符号整数,将整数中的数字进行反转。
//
//示例 1:
//
//输入: 123
//输出: 321
//
// 示例 2:
//
//输入: -123
//输出: -321
//
//示例 3:
//
//输入: 120
//输出: 21
#ifndef LEETCODE_REVERSEINTEGER_H
#define LEETCODE_REVERSEINTEGER_H
class ReverseInteger
{
public:
static int reverse(int x);
};
#endif //L... | true |
1bd6f1b53a33774d1417392eb0b01f18eb31939e | C++ | MasterWangdaoyong/My-C--Primer-Plus | /Learn/程序清单 6-6.cpp | UTF-8 | 731 | 3.078125 | 3 | [] | no_license | // more and
// 程序清单 6-6.cpp
// C++ Primer Plus
//
// Created by 王道勇 on 2017/5/29.
// Copyright © 2017年 王道勇. All rights reserved.
//
#include <iostream>
const char * qualify[4] =
{
"10,000-meber race.\n",
"mud tug-of-war.\n",
"masters canoe jousting.\n",
"pie-throwing festival.\n"
};
int main()
{... | true |
891bd93e21ff458c1cd86697ef6866ba9e9b6217 | C++ | vlongle/HuffmanCompression | /Encoder/HuffmanEncoder.h | UTF-8 | 880 | 2.859375 | 3 | [] | no_license | //
// Encoder.h
//
//
// Created by Le Nguyen VIet Long on 3/13/18.
//
#ifndef Encoder_h
#define Encoder_h
#include "HuffmanPriorityQueue.h"
#include <map>
// Implemementation of Queue needed for BFS tranversal
// Because the implementation of Queue is quite short, it's included in the header
#define CAPACITY 999... | true |
d2e598f43d863bf4767421cddf5c30793f14bffd | C++ | BlueHorn07/ProblemSolving | /solutions/BAEKJOON/9020.cpp | UTF-8 | 772 | 3 | 3 | [] | no_license | #include<bits/stdc++.h>
#define MAX 10005
using namespace std;
bool isPrime[MAX];
void goldbach() {
int n;
scanf("%d", &n);
for (int i = 2; i <= n / 2 + 1; i++) {
if (!isPrime[i]) continue; // prime이 아니라면, 패스
for (int j = i + i; j <= n; j += i) {
isPrime[j] = false;
}
}
int ans... | true |
5a6443ba9de10e6c4b4a8e2fe878635dc2eaeb4b | C++ | jjzhang166/BOSS_ExternalLibs | /BOSS/Identifier/BesDetectorID.cxx | UTF-8 | 2,202 | 2.5625 | 3 | [] | no_license | #include "Identifier/BesDetectorID.h"
#include <iostream>
#include <stdio.h>
#include <assert.h>
BesDetectorID::BesDetectorID(void) :
m_MdcId(BesDetectorID::MDC_ID),
m_TofId(BesDetectorID::TOF_ID),
m_EmcId(BesDetectorID::EMC_ID),
m_MucId(BesDetectorID::MUC_ID),
m_HltId(BesDetectorID::HLT_ID),
... | true |
070631ac98cfb482d8d904167fbff325c5c0f9af | C++ | MBU-Team/OpenMBU | /engine/source/gfx/gfxResource.h | UTF-8 | 2,267 | 2.625 | 3 | [] | no_license | //-----------------------------------------------------------------------------
// Torque Game Engine Advanced
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
#ifndef _GFX_GFXRESOURCE_H_
#define _GFX_GFXRESOURCE_H_
#include "platform/types.h"
cla... | true |
920558362826934f75fdb8194f541a3bb7c688ab | C++ | mghosal10/Design-Analysis-And-Algorithms | /Programming Assignment 6/BinarySearchTree/BST.cpp | UTF-8 | 4,875 | 3.578125 | 4 | [] | no_license | #include <iostream>
//#include <iomanip>
using namespace std;
#include "BST.h"
//--- Definition of constructor
BST::BST()
: myRoot(0)
{}
bool BST::empty() const
{ return myRoot == 0; }
bool BST::search(const int & item) const
{
BinNode * locptr = myRoot;
bool found = false;
while (!found && locptr != 0)
... | true |
73c65f2ca289db9acfdd85b401a8388e3cd5c059 | C++ | Dwarfius/GP1 | /Coursework/cSettings.cpp | UTF-8 | 1,689 | 3.25 | 3 | [] | no_license | #include "cSettings.h"
#include <iostream>
#include <fstream>
#include <string>
#pragma warning(disable : 4244)
using namespace std;
cSettings* cSettings::singleton = 0;
cSettings::cSettings()
{
//basic settings
drawBackground = true;
volume = 0.5f;
memset(scores, 0, sizeof(scores));
Deserialize(); //attempt ... | true |
3b076088ec22344b68f380ed0524e353d2396704 | C++ | taku-xhift/labo | /c++/boost/Mutex/WriteLockWithOtherThreadRead.cpp | UTF-8 | 971 | 2.703125 | 3 | [
"MIT"
] | permissive |
#include <iostream>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/shared_mutex.hpp>
#include <Windows.h>
typedef boost::shared_mutex Mutex;
typedef boost::shared_lock<Mutex> ReadLock;
typedef boost::upgrade_lock<Mutex> ... | true |
86c88d4b85b9c32446ba61a8284a0fac9f859832 | C++ | powellm123/letsmakeagame | /LetsMakeAGame/src/DateTime.h | UTF-8 | 1,525 | 3.140625 | 3 | [] | no_license | #pragma once
#include <time.h>
#include <iostream>
struct DateTime
{
int year;
int month;
int day;
int hour;
int minute;
int second;
static DateTime Now()
{
time_t theTime = time(0);
tm *atm = new tm();
localtime_s(atm, &theTime);
DateTime dt;
dt.year = atm->tm_year;
dt.month = atm->tm_mon;
dt.da... | true |
d26defcad819c1f9df7bb826f555b58ee49aac35 | C++ | malirod/cpputils | /src/core/general_error.h | UTF-8 | 827 | 2.671875 | 3 | [
"MIT"
] | permissive | // Copyright [2018] <Malinovsky Rodion>
#pragma once
#include <string>
#include <system_error>
namespace rms {
namespace core {
enum class GeneralError {
Success,
InternalError,
WrongCommandLine,
StartupFailed,
};
class ErrorCategory : public std::error_category {
public:
const char* name() const noexce... | true |
d106b75b0b56348e6b71feaf34deda985a179de3 | C++ | viZu/nasca | /src/main/resources/root_helper.h | UTF-8 | 818 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef ROOT_HELPER_H
#define ROOT_HELPER_H
#include <string>
#include <sstream>
#include <vector>
#include <fstream>
#include <memory>
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems) {
std::stringstream ss(s);
std::string item;
while (std::getline(ss, it... | true |
ce995190075518f6a253ec4959b57e977809e5f9 | C++ | dodo0095/Color-Balancing2015 | /src/graph.cpp | UTF-8 | 23,895 | 3.203125 | 3 | [] | no_license | #include "graph.h"
#include <iostream>
#include <fstream>
#include <queue>
#include <algorithm>
#include <cmath>
#include <limits>
#include <bitset>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
using namespace std;
//把input。x1 y1 x2 y2放進來
void Graph::addNode( Node* nptr)
{
nodesMap[nptr->id]=nptr;
nod... | true |
8c374cbaa2674d159d81dab6bf273ceb8e8a6273 | C++ | MannyP31/CompetitiveProgrammingQuestionBank | /Recursion/All_indices_of_element.cpp | UTF-8 | 1,463 | 3.609375 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // CPP program to find all indices of a number
#include <bits/stdc++.h>
using namespace std;
// A recursive function to find all indices of a number in array.
int allIndexes(int input[], int size,
int x, int output[])
{
// If size of array is 0 then return 0
if (size == 0) {
return 0;
}
/... | true |
7ce01c4e31484a55115117deecf5c4b4a7dc57df | C++ | ko19951231/Sdorica_AI | /enemy.cpp | UTF-8 | 6,852 | 3.046875 | 3 | [] | no_license | #include "enemy.h"
#include "state.h"
#include <iostream>
using namespace std;
void Enemy::init(int s, state *st)
{
this->stage = s;
this->game = st;
if(this->stage == 0){
this->init_amount = this->amount = 3;
this->enemies[0].setEnemy(0);
this->enemies[1].setEnemy(0);
... | true |
41481c49b66437267ca4546b0055a85c8be7ada1 | C++ | skaupper/cpp-telegrambot | /include/telegram/Command.h | UTF-8 | 1,474 | 2.546875 | 3 | [] | no_license | #ifndef COMMAND_H_
#define COMMAND_H_
#include <functional>
#include <string>
#include "jsonserializer/Generated.h"
#include "CommandException.h"
namespace telegram
{
enum class CallType {
NOTHING = 0,
DIRECT = 1,
INDIRECT = 2,
QUIT = 4
};
enum class... | true |
454a17b07f32801179861f147a75d268c45e6a6c | C++ | zhengjinwei123/cplusplus | /recastnav/inc/Aoi/room.h | GB18030 | 4,814 | 2.921875 | 3 | [] | no_license | #pragma once
#ifndef _AOI_ROOM_H__
#define _AOI_ROOM_H__
#include "player.h"
#include "point3f.h"
#include "defines.h"
#include <unordered_map>
#include <assert.h>
namespace aoi
{
template<typename PLAYER_TYPE,typename MONSTER_TYPE,typename PLAYER_ID_TYPE,typename MONSTER_ID_TYPE>
class Room
{
using tPlayerMap ... | true |
e44b66fae2ac2398be1d52db39e2a0e1b6a4239e | C++ | OarabileMwiya/HacktoberFest2020-1 | /Basic Programs/generate_string.cpp | UTF-8 | 325 | 3.25 | 3 | [] | no_license | //This program generates a string of given length.
#include<bits/stdc++.h>
using namespace std;
int main(){
int len;
cout<<"Enter the length of string to be generated : ";
cin>>len;
string s="""";
for(int i=0;i<len;i++){
int x=rand()%26;
char c='a'+x;
s+=c;
}
cout<<... | true |
af05cf893bf52e954a143b14a6e8e788c6ed91f0 | C++ | trmrsh/cpp-colly | /src/read_molly_head.cc | UTF-8 | 9,316 | 2.984375 | 3 | [] | no_license | #include <fstream>
#include <vector>
#include <string>
#include "trm/subs.h"
#include "trm/header.h"
#include "trm/colly.h"
/**
* read_molly_head reads in the headers and arc poly
* (if set) of a molly spectrum. It assumes that the stream is
* just positioned at the start of the header and leves it just
* as the d... | true |
a64d8a2af06bd6f21186fa464aefd67006632f8c | C++ | HoYoungChun/Algorithm_PS | /Data_Structure/BOJ_15828.cpp | UTF-8 | 501 | 2.75 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int N; cin >> N; // 라우터 내부의 버퍼의 크기
queue<int> que;
while(true){
int input; cin >> input;
if(input == -1) break;
else if(input == 0){
que.pop();
}
else if(que.size()<N){
... | true |
01469c0a8bebcaef8a5356d0cd07d1d71631e7fe | C++ | sguazt/boost-ublasx | /boost/numeric/ublasx/operation/which.hpp | UTF-8 | 3,765 | 2.53125 | 3 | [
"BSL-1.0"
] | permissive | /* vim: set tabstop=4 expandtab shiftwidth=4 softtabstop=4: */
/**
* \file boost/numeric/ublasx/operation/which.hpp
*
* \brief Find the positions of the elments of a given container which satisfy
* a given unary predicate.
*
* \author Marco Guazzone (marco.guazzone@gmail.com)
*
* <hr/>
*
* Copyright (c) 201... | true |
e7acea062278c124053f2ae1c7ca6033f6dd05c2 | C++ | SoC-OpenGL/soc-assignment-1-ritik02mandal | /Assignment 1/Q1/Disk.cpp | UTF-8 | 2,643 | 2.546875 | 3 | [] | no_license | #include "GL_Framework/gl_framework.hpp"
#include "Shader/shader_util.hpp"
#include <math.h>
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 800;
float points[]={0.8f,0.8f,0.0,0.8f,-0.8f,0.0f,-0.8f,0.8f,0.0f,-0.8f,-0.8f,0.0f,0.8f,-0.8f,0.0f,-0.8f,0.8f,0.0f};
GLuint shaderProgram;
GLuint vbo, vao;... | true |
e43f2bd931dcf06311ceeb6e98529deba12af983 | C++ | menisadi/Assignment2 | /src/Printer.cpp | UTF-8 | 2,805 | 2.75 | 3 | [] | no_license | /*
* Printer.cpp
*
* Created on: Dec 2, 2014
* Author: Ofer Caspi
*/
#include "Printer.h"
Printer::Printer() {
}
Printer::Printer(const Printer& printer) {
}
Printer& Printer::operator=(const Printer& printer) {
return *this;
}
Printer::~Printer() {
}
void Printer::print(int currentTimeSlice) {
int m... | true |
7d530180f66583ecfaf94cfed7d60df933ade156 | C++ | barrylawson/cmsc240_f2018_lab6_cyan | /VectorTester.cpp | UTF-8 | 10,252 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include "IntegerVector.h"
#include "DoubleVector.h"
#include "CharacterVector.h"
#include <exception>
#include <string>
#include <stdexcept>
int main()
{
IntegerVector iv;
DoubleVector dv;
CharacterVector cv;
//---------------------------------------------------------------------... | true |
c9ef2e4aaf5ed5ffa8a9f8a37c205b0ea2f9de38 | C++ | sandeepgupta007/ACinCP | /Strings/RomanToIntger.cpp | UTF-8 | 896 | 3.078125 | 3 | [] | no_license | int value(char r){
if (r == 'I')
return 1;
if (r == 'V')
return 5;
if (r == 'X')
return 10;
if (r == 'L')
return 50;
if (r == 'C')
return 100;
if (r == 'D')
return 500;
if (r == 'M')
return 1000;
return -1;
}
int Solution::romanToI... | true |
9c462c47ef0c92c21786d58c7dab253b6f8c30f4 | C++ | Nanoteck137/Seek | /Seek/Source/Seek/UI/Transition/ValueDriver.cpp | UTF-8 | 899 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "SeekPCH.h"
#include "Seek/UI/Transition/ValueDriver.h"
namespace Seek
{
ValueDriver::ValueDriver(float length) : m_Length(length), m_StartTime(0) {}
ValueDriver::ValueDriver(float startTime, float length)
: m_StartTime(startTime), m_Length(length)
{
}
float ValueDriver::Update(f... | true |
e41a9bfbb0e5e0f2031571ff9405f9963cbc22e0 | C++ | Shanghai-/3DGameEnginesFinal | /src/engine/components/ColEllipsoid.cpp | UTF-8 | 656 | 2.5625 | 3 | [] | no_license | #include "ColEllipsoid.h"
#include "engine/graphics/Graphics.h"
#include "engine/components/CTransform.h"
ColEllipsoid::ColEllipsoid(std::shared_ptr<GameObject> parent, glm::vec3 radii) : Component(parent),
m_radii(radii)
{
}
ColEllipsoid::~ColEllipsoid()
{
}
void ColEllipsoid::drawWireframe()
{
Graphics *... | true |
3136f88d7a32a007b5f5103955edd38bdc70d511 | C++ | Anubhav12345678/competitive-programming | /MINSWAPSTOGROUPALLONESTOGETHERVVVVVIMPGFG.cpp | UTF-8 | 1,351 | 3.828125 | 4 | [] | no_license | // C++ program to find minimum swaps
// required to group all 1's together
#include <iostream>
#include <limits.h>
using namespace std;
// Function to find minimum swaps
// to group all 1's together
int minSwaps(int arr[], int n) {
int noOfOnes = 0;
// find total number of all in the array
for (int i = 0;... | true |
8055ecd016627eb726babb34e8b1ab596d9e8e86 | C++ | emmerich-research/new-contaminant-detection | /libstorage/database.cpp | UTF-8 | 3,014 | 2.5625 | 3 | [] | no_license | #include "storage.hpp"
#include "database.hpp"
#include <libutil/util.hpp>
NAMESPACE_BEGIN
namespace storage {
static Storage init_storage(const std::string& path) {
using namespace sqlite_orm;
fs::path p = path;
auto parent_path = p.parent_path();
if (!parent_path.empty())
fs::create_directory(pare... | true |
2b27a28061028b621099fa22c0afe000018ea98b | C++ | AlfavilleLM/souliss | /frame/vNet/feelbrave/vNet_example1_chibi_TX/vNet_example1_chibi_TX.ino | UTF-8 | 1,461 | 2.65625 | 3 | [] | no_license | /* vNet Example 1, Data Transmission
A standard Node (TX) send data to a device out of its subnet (RX),
data are sent via the SuperNode (SN).
The received message is printed-out by RX node, you can see the
message IN/OUT activating the VNET_DEBUG functionality.
*************************Definitions***********... | true |
dbe5d789f957212dc513cb5ab85d68bec3047ce4 | C++ | robert333/steiner_trees | /source/steiner_trees/SteinerTreeCut.cpp | UTF-8 | 2,301 | 2.84375 | 3 | [] | no_license | #include "SteinerTreeCut.hpp"
namespace steiner_trees {
SteinerTreeCut::SteinerTreeCut(graph::Graph const& graph, graph::Net const& net) :
_graph(graph),
_net(net),
_characteristic_vector(graph.num_nodes(), false)
{
while (not is_valid()) {
next_characteristic_vector();
}
}
bool SteinerTreeCut::next()
{
do {... | true |
f94f53c65d2524102d6f5d9c611d5f3eb06a61c2 | C++ | lukasz-m-maciejewski/arcimboldo | /qml-ver/src/TargetDirectoryGenerator.cpp | UTF-8 | 1,067 | 2.84375 | 3 | [] | no_license | #include "TargetDirectoryGenerator.hpp"
TargetDirectoryGenerator::TargetDirectoryGenerator(QObject* parent)
: QObject(parent)
{
connect(this, &TargetDirectoryGenerator::currentDirectoryChanged, this,
&TargetDirectoryGenerator::onCurrentDirectoryChanged);
}
QString TargetDirectoryGenerator::current... | true |
9b855aef3ca98685efa2fbcbd81377953994aace | C++ | scriptkid23/design-ftp-client | /include/tcpclient.h | UTF-8 | 614 | 2.65625 | 3 | [
"MIT"
] | permissive | #ifndef _TCP_CLIENT_H_
#define _TCP_CLIENT_H_
#include "tcpsocket.h"
class TcpClient
{
protected:
TcpSocket localsocket;
bool connected;
public:
TcpClient();
bool isConnected() { return connected;}
bool open(const string& serverHost, unsigned short port);
bool open(const string& serverHost, co... | true |
0b195b92772dd9d831a1274d2bb18d7f508513e4 | C++ | DanielVillena/2-EVA | /ANTONIO HITGUB/PRINTF Y SCANF.cpp | ISO-8859-1 | 635 | 3.515625 | 4 | [] | no_license | #include <stdio.h> //nombre de la biblioteca es = siempre
int main(){
int num1 = 10;
char mensaje[] = "Hola"; //char es usado para guardar palabra
printf("%s, soy el nmero %d. \n", num1, mensaje); //printf es = a cout. %s=num1 porque lo pone al final y %d=mensaje
return 0;
}
%d numero entero
%f nume... | true |
8bea2bf649ad036d7d0cab8b9bb120dc429eb77a | C++ | libp2p/cpp-libp2p | /src/basic/varint_prefix_reader.cpp | UTF-8 | 1,557 | 2.515625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /**
* Copyright Soramitsu Co., Ltd. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include <libp2p/basic/varint_prefix_reader.hpp>
namespace libp2p::basic {
namespace {
constexpr uint8_t kHighBitMask = 0x80;
// just because 64 == 9*7 + 1
constexpr uint8_t kMaxBytes = 10;
} // na... | true |
79d4a8f5504561c32a4de8394a5c291bf5f364c1 | C++ | arangodb/arangodb | /3rdParty/boost/1.78.0/libs/spirit/example/lex/lexer_debug_support.cpp | UTF-8 | 3,439 | 2.578125 | 3 | [
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | // Copyright (c) 2001-2011 Hartmut Kaiser
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// #define BOOST_SPIRIT_LEXERTL_DEBUG 1
#include <boost/spirit/include/lex_lexertl.hpp>
#include <boost/spirit/incl... | true |
a51c6c8dc100ca27b744eb6244431f84a9e3b17c | C++ | ccquan/C-program-exercises | /5.13-字符串连接.cpp | GB18030 | 511 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
int main()
{
int i, j = 0;
char str1[20] = {"ַ1"};
char str2[20] = {"ַ2"};
char new_str[40];
// һѭȻжiiѭstr1ٽstr2ֵֵnew_str
for(i = 0; i < (strlen(str1) + strlen(str2)); i++)
{
if(i < strlen(str1))
{
new_str[i] = str1[i];
}
else
{
new_str[i] = str2[j];
... | true |
3c7721c1f5ab019b101822e03a6a42d1ae0fdd1e | C++ | HenryTraynor/Bike-Computer | /bikeComputer.ino | UTF-8 | 1,302 | 2.65625 | 3 | [] | no_license | #include <Arduino.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <LiquidCrystal.h>
const int hallPin=2;
const double circumference=84.823; //in
const int rs = 12, en = 11, d4 = 6, d5 = 5, d6 = 4, d7 = 3;
int totalRev=0;
double distance=0;
int timeAtLastRev=0;
double velocity=0.0;
d... | true |
520837e824f0e32a069c1708089936396a2232b1 | C++ | zmichaels11/gloopcpp | /gloop/enums/src/blend_func.cpp | UTF-8 | 1,256 | 2.78125 | 3 | [] | no_license | #include "blend_func.hpp"
#include <iostream>
namespace gloop {
namespace enums {
std::ostream& operator<<(std::ostream& os, blend_func enumval) {
switch (enumval) {
case blend_func::ZERO:
return os << "ZERO";
case blend_func::ONE:
return os << "ONE";
case blend_func::SRC_COLOR:
retur... | true |
e48d18f0ea2a6ec06b874c4e3aebec352d6f44ef | C++ | anagma/ofxTimebasedControl | /ofxTimebasedControlExample/src/ofApp.cpp | UTF-8 | 3,231 | 2.703125 | 3 | [] | no_license | #include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
frameRate = 60;
ofBackground(0, 0, 0);
ofSetVerticalSync(false);
ofSetFrameRate(frameRate);
ofSetLogLevel(OF_LOG_NOTICE);
ofSetRectMode(OF_RECTMODE_CENTER);
ofNoFill();
ofEnableBlendMode(OF_BLENDMODE_AD... | true |
7cc593489f0f33b4c143041ae070822b2d541398 | C++ | santospdaniel/techreach-c-assignment-pub | /src/Loader.cpp | UTF-8 | 2,859 | 2.703125 | 3 | [] | no_license | #include <c-assignment/Loader.hpp>
#include <c-assignment/LoadersProcessor.hpp>
#include <c-assignment/Processor.hpp>
#include <c-assignment/FcCommand.hpp>
#include <c-assignment/OutCommand.hpp>
#include <c-assignment/RdtCommand.hpp>
#include <c-assignment/RfcCommand.hpp>
#include <sstream>
namespace cassign
{
const ... | true |
c7e0948d1a8ac257e85011e8e4adf7db94fb86cd | C++ | Icay12/LeetCode | /Cpp/200_NumberofIslands.cpp | UTF-8 | 4,433 | 3.171875 | 3 | [] | no_license | //DFS
public:
int numIslands(vector<vector<char>>& grid) {
int res = 0;
if(grid.size() == 0 || grid[0].size() == 0 )
return res;
for(int i = 0 ; i < grid.size(); ++i) {
for(int j = 0; j < grid[0].size(); ++j) {
if(grid[i][j] == '1') {
... | true |
f118c248bbc1f702438e8dcc158f3acedd1d23fa | C++ | labodejuguete/gamelin | /sketchbook/gamelin_USB_comentado/gamelin_USB_comentado.ino | UTF-8 | 4,269 | 2.578125 | 3 | [] | no_license | /*
_____ _ __ _ _ _____ ____
/ ____| | |/_/ | | | |/ ____| _ \
| | __ __ _ _ __ ___ ___| |_ _ __ | | | | (___ | |_) |
| | |_ |/ _` | '_ ` _ \ / _ \ | | '_ \ | | | |\___ \| _ <
| |__| | (_| | | | | | | __/ | | | | | | |__| |____) | |_) |
\_____... | true |
e24574638c93d406dac46f0eeaa8619d4fe1226d | C++ | Stephenhua/CPP | /interview_Code/Code/DiDi-8-30-1.cpp | UTF-8 | 788 | 3.34375 | 3 | [] | no_license | /*
题目:在字符串中找出4位整数;
*/
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int Find4Int( string str) {
int maxLen = -1;
int start = 0 ;
int tempIndex = 0 ;
for(int i = 0 ; i< str.length() ;i ++){
if( str[i] >'0' && str[i] <= '9'){
int tempLen = 0 ;
... | true |
8e9656154171b832c5875ec3393f0be7fb4434d7 | C++ | zhangyiwen5512/myleetcode | /cleetcode/headers/mergeKLists.h | UTF-8 | 1,707 | 3.234375 | 3 | [] | no_license | //
// Created by zhangyiwen on 2020/12/11.
//
#ifndef CLEETCODE_MERGEKLISTS_H
#define CLEETCODE_MERGEKLISTS_H
#include <vector>
#include <queue>
/*
* 给你一个链表数组,每个链表都已经按升序排列。
* 请你将所有链表合并到一个升序链表中,返回合并后的链表。
* 输入:lists = [[1,4,5],[1,3,4],[2,6]]
* 输出:[1,1,2,3,4,4,5,6]
* [
* 1->4->5,
* 1->3->4,
* 2->6
* ]
* 将它们合并... | true |
e8b9d521e4d735a22cd5b4036848a38b6e693c14 | C++ | dormon/prj | /boxes/StructDescription.h | UTF-8 | 805 | 2.671875 | 3 | [] | no_license | #pragma once
#include<vector>
#include"Defines.h"
#include"TypeDescription.h"
class StructDescription: public TypeDescription{
public:
std::vector<TypeId>elementsTypes;
StructDescription(std::string const&name,std::vector<TypeId>const&elements):TypeDescription(name,STRUCT){
PRINT_CALL_STACK(name,eleme... | true |
ce9545cbe27edc16cf1365ee4356553f111b42e6 | C++ | cxy229/dshomework | /graph/src/Graph.h | UTF-8 | 4,421 | 3.625 | 4 | [] | no_license | /*
* Graph.h
*
* Created on: Dec 17, 2015
* Author: cxy229
*/
#ifndef GRAPH_H_
#define GRAPH_H_
#include<iostream>
#include<iomanip>//声明一些流操作符
using namespace std;
//最大权值
#define MAXWEIGHT 100
//用邻接矩阵实现图
class Graph
{
public:
//numV顶点数,isWeighted是否带权值,isDirected是否有向
Graph(int numV, bool isWeighted , boo... | true |
c2c2e6ef4a7095353f0b411d6328a8046f61dfbe | C++ | Driven-Mad/PGAG | /PGAG_ASS/PGAG_ASS/Camera.h | UTF-8 | 811 | 3.09375 | 3 | [] | no_license | #ifndef CAMERA_H
#define CAMERA_H
//------------------------------------------------------------------
/// \file Camera.h
/// \author Lloyd Phillips
/// \brief This is the Camera class
//------------------------------------------------------------------
#include "Vec2.h"
class Camera{
public:
/// \brief Construc... | true |
c70ccb1a175bc1819937a48deb4afa1618d221f0 | C++ | SeanHorner/cpp | /financial_simulator/monthlyFinancials.hpp | UTF-8 | 2,452 | 3.546875 | 4 | [] | no_license | /**
* Creator: Sean Horner
* Date: 03/11/2020
* Updated: 03/23/2020
* Purpose: This is the header file defining the monthlyFinancials class type,
* used to hold monthly expenditures.
* Requires: None
**/
#ifndef monthlyFinancials_HPP
#define monthlyFinancials_HPP
#include <iostream>
#include <strin... | true |
a67d52ba5721e254523cc87106b653484ff06bc5 | C++ | bn90207/Fuji_log_parser | /score_matrix/sources/score_matrix.cpp | UTF-8 | 8,009 | 2.84375 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<dirent.h>
#include<string>
#include<vector>
#include<sys/stat.h>//stat(), S_ISDIR()
#include<algorithm>//remove_if, find
#include<boost/filesystem.hpp>//remove_all
#include <unistd.h>//rmdir
#include"windows.h"//CreateDirectory
using namespace std;
string dest_... | true |
a4a1d389c3d64b19394e1760d28a7b697e5fc57c | C++ | utec-cs-aed-2021-2/circular-array-IsaacVera10 | /circulararray.h | UTF-8 | 3,927 | 3.859375 | 4 | [] | no_license | #include <iostream>
using namespace std;
template <class T>
class CircularArray
{
private:
T *array;
int capacity;
int back, front;
public:
CircularArray();
CircularArray(int _capacity);
virtual ~CircularArray();
void push_front(T data);
void push_back(T data);
void insert(T da... | true |
5eb742fed63a2956fd82ace0e4dbc33761a01d19 | C++ | dcheng289/Class-Projects | /Twitter-Data-Structures/tweet.cpp | UTF-8 | 1,855 | 3.609375 | 4 | [] | no_license | #include "tweet.h"
#include "heap.h"
/*struct Hashtag
{
string text;
int val;
Hashtag(string a, int b) : text(a), val(b) {};
bool operator == (Hashtag& other)
{
return text == other.text;
}
void operator *=(int other)
{
val++;
}
};
struct HashtagComp
{
bool operator()(Hashtag a, Hashtag... | true |
d22c3f0bbfafecf0f11a94c5525fac2af6ab3d3a | C++ | erikfritas/Hacktoberfest2021 | /Recursive Reverse of Linked List.cpp | UTF-8 | 5,987 | 3.78125 | 4 | [] | no_license | #include <iostream>
#include <list>
using namespace std;
class node
{
public:
int data;
// one pointer to the next node
node *next;
// parameterized constructor for taking data stored
node (int d)
{
data = d;
next = NULL;
}
};
void InsertAtHead (node * &head, int d)
{
if (head == NUL... | true |
eb4a97f01715bd68e04b82cf7e034a400aa3c469 | C++ | SterbenDa/NYOJ-Linda | /STL练习/找球号(一)/Untitled1.cpp | WINDOWS-1252 | 666 | 2.96875 | 3 | [] | no_license | #include "cstdio"
#include "set"
using namespace std;
int main(){
int n,m,a,i;
set<int> s;
scanf("%d%d",&m,&n);
for(i=0;i<m;i++)
{
scanf("%d",&a);
s.insert(a);
}
for(i=0;i<n;i++){
scanf("%d",&a);
if(s.count(a)==0)
printf("NO\n");
else
printf("YES\n");
}
s.clear();
return 0;
}
... | true |