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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9b27936c6337cdaff5b565cef294ffcfc286d73f | C++ | gwonii/algorithm | /Code/c++/Backjun/HappyAlgo/1_dataStructure_base/11655/code_11655.cpp | UTF-8 | 1,040 | 3.140625 | 3 | [] | no_license | //
// Created by hoho on 2019-08-19.
//
#include "code_11655.h"
#include <iostream>
#include <stack>
#include <string>
using namespace std;
string inputString_11655;
char lowerChanger(char content) {
int tempContent = (int) content;
for (int i = 0; i < 13; i++) {
if (tempContent == 122) {
... | true |
b02223e6b6cf2b65d3837a2d4a3d4fb9f2f250a3 | C++ | bernatixer/PRO2-Practice | /ParCrom.cc | UTF-8 | 1,228 | 3.453125 | 3 | [] | no_license | #include "ParCrom.hh"
ParCrom::ParCrom() {
//
}
void ParCrom::reproduir(const int li, const int k, vector<int> mare, vector<int> pare) {
for (int i = k; i < li; ++i) {
int aux = mare[i];
mare[i] = pare[i];
pare[i] = aux;
}
parell.first = mare;
parell.second = pare;
}
void ParCrom::llegir(const ... | true |
f8ea9a5654d94eedfbd4a4f1df71c50410c4a6e1 | C++ | enryu100/ICT397_Main_Project | /BiteClub/BiteClub/ObjLoader.cpp | UTF-8 | 2,689 | 3.03125 | 3 | [] | no_license | #include "ObjLoader.h"
#include <fstream>
#include <string>
#include <sstream>
using namespace loader;
using namespace std;
using namespace types;
bool loader::loadObj(const char* path, vector<Vector3D> & outVertices, vector<Vector2D> & outUVs, vector<Vector3D> & outNormals){
vector<unsigned int> vertexIndices, uvIn... | true |
a6e66855248c1936b21b2cd3cd4a21ed00478ad8 | C++ | skdn159/BattlesProj | /BattleShip_pp/BattleShip_pp.cpp | UHC | 1,714 | 2.890625 | 3 | [] | no_license | // BattleShip_pp.cpp : ܼ α մϴ.
#include "stdafx.h"
#include<iostream>
#include<string>
#include<vector>
#include <time.h>
#include<ctime>
#include<cstdlib>
#include<list>
#include"Destroyer.h"
#include"GameManager.h"
#include"player.h"
int _tmain(int argc, _TCHAR* argv[])
{
/*
srand((unsigned int)time(NULL)); ... | true |
0c3c7b5b59242739999550f1d0a1277d763e1784 | C++ | meyerpa/CPlusPlus | /CSIS 252/Brekke's Files/func3.cpp | UTF-8 | 1,803 | 3.75 | 4 | [] | no_license | #include <iostream>
using namespace std;
const int arraysize=5;
const int sentinel=-999;
// function prototypes
// comment: in prototypes, parameter names are not needed
int biggest(const int numbers[],int count);
void output(const int numbers[],int count);
int search(const int numbers[],int count, int searchValue);
v... | true |
1dca27cec132d169d6fcf60671a690b0c28dafd0 | C++ | YangboLong/CLRS | /ch8.cpp | UTF-8 | 2,070 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <vector>
class Solution{
public:
// clrs p195
void CountingSort(std::vector<int> &A, int B[], int k){
std::vector<int> C;
for(int i = 0; i <= k; i++){
C.push_back(0);
}
for(int j = 0; j < A.size(); j++){
C[A[j]]++;
}
for(int i = 1; i <= k; i++){
C[i] += C[i-1];
}
... | true |
c13d9813017f7aed7f75ce5a50ea713ce91f651e | C++ | NikitaBalasahebRaut/ThisPointer | /DemoThisPtr.cpp | UTF-8 | 1,330 | 4.78125 | 5 | [] | no_license | //program to demonstrate the concept of this pointer
//if you want to assign the local variable value to the data members then you won’t be able to do until unless you use this pointer
//because the compiler won’t know that you are referring to object’s data members
#include <iostream>
using namespace std;
class... | true |
72baab31f3333047443a3cd4d361fb61dbc86321 | C++ | FattyMieo/GameEngine | /GameEngine/TransparencyAffectorOverLifespan.cpp | UTF-8 | 696 | 2.59375 | 3 | [] | no_license | #include "TransparencyAffectorOverLifespan.h"
TransparencyAffectorOverLifespan::TransparencyAffectorOverLifespan() : ParticleAffectorOverLifespan<unsigned int>()
{
lifespanValue[0.0f] = 255;
lifespanValue[1.0f] = 255;
}
TransparencyAffectorOverLifespan::~TransparencyAffectorOverLifespan()
{
}
void TransparencyAff... | true |
81197c196d63a5f69d760fc15376d5130bf89abf | C++ | rickarkin/PyMesh-win | /tests/tools/MeshUtils/IsolatedVertexRemovalTest.h | UTF-8 | 1,928 | 2.71875 | 3 | [] | no_license | /* This file is part of PyMesh. Copyright (c) 2015 by Qingnan Zhou */
#pragma once
#include <iostream>
#include <MeshUtils/IsolatedVertexRemoval.h>
#include <TestBase.h>
class IsolatedVertexRemovalTest : public TestBase {
protected:
void add_extra_vertex_and_check(MeshPtr mesh) {
const size_t ... | true |
6ac750b89463dbfda284002b65e2e03cc3d47e69 | C++ | abicorios/MyCppExercises | /c6e16atoi/c6e16atoi/c6e16atoi.cpp | WINDOWS-1251 | 1,077 | 3.296875 | 3 | [
"Unlicense"
] | permissive | // c6e16atoi.cpp: .
//
#include "stdafx.h"
#include <iostream>
//#include <string>
using namespace std;
int main()
{
int atoi(char*);
cout << atoi("45") << " " << 45 << '\n';
cout << atoi("077") << " " << 077 << '\n';
cout << atoi("0xf")<<" "<< 0xf << '\n';
}
int atoi(char*c)
{
int l= strlen(c);
int numbe... | true |
940e7a68e508e325d072acd3b838158d0dca56e1 | C++ | iiSky101/rmsk2 | /permutation.h | UTF-8 | 5,917 | 3 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /***************************************************************************
* Copyright 2017 Martin Grap
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org... | true |
8cd74bb90993450b723f613acc917edd906efee9 | C++ | Demongo2009/TIN_TorrentLikeP2P | /src/structs/ResourceInfo.cpp | UTF-8 | 2,711 | 3.3125 | 3 | [] | no_license | #include "../../include/structs/ResourceInfo.h"
ResourceInfo ResourceInfo::deserializeResource(const char *message, bool toVector,int *dataPointer) {
std::string resourceName;
unsigned long long sizeInBytes;
std::size_t revokeHash;
std::string builder;
unsigned short charIndex=0;
char currChar... | true |
54d059c732b9de20cf7b04a87558342de1ea611f | C++ | mavaL/MiniCraft | /Kratos/Src/AI/BehaviorTree/Behavior.h | GB18030 | 846 | 2.609375 | 3 | [] | no_license | /********************************************************************
created: 28:3:2013 1:35
filename Behavior.h
author: maval
purpose: BehaviorʾActionNodeִеһΪ.
пܵΪ,λκʱһijһΪ
*********************************************************************/
#ifndef Behavior_h__
#define Behavior_h__
#include "KratosPre... | true |
59f1826901b9bddde9afff77f852e9cbf306323a | C++ | 2youngjae/Programmers | /메뉴리뉴얼.cpp | UTF-8 | 1,927 | 3.328125 | 3 | [] | no_license | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
void addSubSet(map<string, int> &m, string &s, int idx, string subStr)
{
if (idx == s.size())
return;
string cur = subStr + s[idx];
if (m.count(cur) == 0)
{
m... | true |
701be6f03d778b539450761d61a93f2b9c00ab1a | C++ | tonyzhang1231/data-structure-and-alg-practice-cpp-java | /cpp/001. two sum.cpp | UTF-8 | 453 | 2.8125 | 3 | [] | no_license | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int,int> v2i;
vector<int> res;
for (int i=0;i<nums.size();i++){
if (v2i.find(nums[i])!= v2i.end()){
res.push_back(v2i[nums[i]]);
res.push_back(i);
... | true |
97b8218342e12ceed127d9d73d8c220860ccef10 | C++ | RealAlpha/ArduCOSMOS | /src/linkedlist.h | UTF-8 | 7,012 | 3.546875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*
* This file contains a simple implementation of a linked list, and will be used in the code when the C++ Standard Library has not been marked as available by the user.
* If your toolchain supports the C++ Standard Library, and more specifically, std::vector, then please uncomment the WITH_STD_LIB define in arducos... | true |
365bbf176cc8ef10e633904dc8310a0c7dcc58d3 | C++ | ChristianLebeda/HomSub | /homomorphism/include/homomorphism/spasm_decomposition.h | UTF-8 | 1,201 | 2.59375 | 3 | [
"MIT"
] | permissive | #ifndef HOMOMORPHISM_SPASMDECOMPOSITION_H_
#define HOMOMORPHISM_SPASMDECOMPOSITION_H_
#include "homomorphism/graph.h"
#include "homomorphism/spasm.h"
#include "homomorphism/tree_decomposition.h"
#include "homomorphism/tree_width_solver.h"
struct SpasmDecompositionEntry : SpasmEntry {
std::shared_ptr<TreeDec... | true |
f71e4c1f3ac5a88e4a7f0e2b74f1061a7159f46a | C++ | fylr/algorithm | /codeup/100000576/D.cpp | UTF-8 | 455 | 2.515625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int N, M, i, j, num, num_list[102];
while (scanf("%d", &N) != EOF) {
for (i = 0; i < N; i++) {
scanf("%d", &num_list[i]);
}
scanf("%d", &M);
for (i = 0; i < M; i++) {
scanf("%d", &num);
for (j = 0; j < N; j++) {
if (nu... | true |
d876de060a54a60bd6a28e7904d664f9965a7d1a | C++ | jeliser/sandbox | /interview/fibonacci/src/fibonacci.cpp | UTF-8 | 288 | 2.90625 | 3 | [] | no_license | #include <iostream>
////////////////////////////////////////
// Put instructions here.
////////////////////////////////////////
int main() {
// Print out the results from [0, 20) for template types: uint16_t, int32_t, string, and float.
std::cout << "Hello World!";
return 0;
}
| true |
2796186babfa791b9b010eb880baa4a5d691e3e1 | C++ | aerosayan/xndarr | /src/xndarr/expression/vecexpr.cpp | UTF-8 | 819 | 2.734375 | 3 | [] | no_license | //-//////////////////////////////////////////////////////////////////////////-//
// @file vecexpr.cpp
// @info Vector expression.
// @author Sayan Bhattacharjee
// @date 4-AUG-2019
//-//////////////////////////////////////////////////////////////////////////-//
// Constructor
XNDARR_EXPRESSION_LTSIG
XNDARR_EXPRESSION_... | true |
db43ae4f31f98a8c4bcaa01545afd268b608bac4 | C++ | tannalynn/CST211-DataStructs | /Lab - Hash Table/L7 - Hash Table/Source.cpp | UTF-8 | 2,102 | 3.109375 | 3 | [] | no_license | /***************************************************************************************************
* Author: Tanna McClure
* File: Source.cpp
* Date Created: 3/10/2015
*
* Overview:
* tests hash table class
*
* Input:
* none
*
* Output:
* results of test
*
*****************************************... | true |
68d5253a985ef431a77563e4c7b25d72b2699cb4 | C++ | GA239/robolabwp | /RoboLabWP/RoboLabWPComp/Model/Game/Game Objects/MZRotatingCell.cpp | UTF-8 | 1,371 | 3.09375 | 3 | [] | no_license | #include "pch.h"
#include "MZRotatingCell.h"
MZRotatingCell::MZRotatingCell(MZPosition* position, MZCell* cell, MZRotationDirection rotationDirection)
{
_position = new MZPosition(*position);
_cell = cell;
_rotationDirection = rotationDirection;
}
MZRotatingCell::~MZRotatingCell(void)
{
if(_cell != NULL)
... | true |
c95975e34f3c3fddef9adc02dc94f03fec2fe4a1 | C++ | turoniol/MapCreator | /scene/scene.cpp | UTF-8 | 2,901 | 2.625 | 3 | [] | no_license | #include "scene.h"
#include <QDebug>
#include <QPicture>
bool Scene::createMap(const int w, const int h, QString &name)
{
_width = w;
_height = h;
if (map != nullptr)
delete map;
if (editBlock != nullptr)
delete editBlock;
map = new Map;
editBlock = new BlockEditor();
if (map->loadMapFromFile(na... | true |
7072f42cfcfb13afbef1ffcbba9d26d980fe430a | C++ | aary/buck-shared-library-error-report | /test.cpp | UTF-8 | 276 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <cassert>
#include <tbb/concurrent_queue.h>
int main() {
auto q = tbb::concurrent_queue<int>{};
q.push(1);
auto top_value = int{};
assert(q.try_pop(top_value));
assert(top_value == 1);
assert(q.empty());
return 0;
}
| true |
801d5a50362ac6c5b7db4fbbdc6fe4d49e25f9b3 | C++ | SkilletHalestorm/Kuzmenko_Oleg | /PACMAN 2.0/GameLoop.cpp | UTF-8 | 556 | 2.5625 | 3 | [] | no_license | #include "GameLoop.h"
#include "Player.h"
#include <conio.h>
#include "Field.h"
void GameLoop::Start()
{
Player player;
player.PlaceOnField(1, 1);
Field field;
field.CreateField();
while (true)
{
if (_kbhit())
{
keyButton = _getch();
switch (keyButton)
{
case 'd':
{
pla... | true |
09c246a3ca2cf86ac688010a5e61d5f0836285aa | C++ | wataruiwabuchi/competitive_programming | /atcoder/abc137_c.cpp | UTF-8 | 648 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
using namespace std;
#define MOD int(1e9 + 7)
int main()
{
int N;
vector<string> S;
map<string, long long> mp;
long long count = 0;
cin >> N;
for (int i = 0; i < N; i++)
{
s... | true |
7613309c144561d022efbd1e6f26b6bb47007547 | C++ | Oksanatishka/42_Piscine_CPP | /D08 - STL/ex03/includes/Minus.hpp | UTF-8 | 368 | 2.609375 | 3 | [] | no_license | #ifndef MINUS_HPP
#define MINUS_HPP
#include <ICommands.hpp>
class Minus : public ICommands {
public:
Minus( void );
Minus( std::list<int>::iterator & );
Minus( const Minus &toCopy );
virtual ~Minus( void );
Minus &operator=( const Minus &toCopy );
virtual void exec( void );
private:
std::list<int>::it... | true |
c600fb371036a120b82ed3eed7c8a7e97f77ac69 | C++ | topcodingwizard/code | /zerojudge/d579.cpp | UTF-8 | 689 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
int main() {
char a[50];
while (memset(a, -1, sizeof(a)) && fgets(a, sizeof(a), stdin)) {
int i, count = 5;
for (i = 0; a[i] != '.' && a[i] > 0 && a[i] != '\n'; i++)
;
if (a[i] != '.') {
a[i] = '.';
count--;
... | true |
cbb879fa65e7547a33f34c8a635f42921a151824 | C++ | Kheya28/CPP | /Graph/Graph problem solutions/LightOJ - 1049(One Way Roads).cpp | UTF-8 | 1,280 | 2.578125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vec2 vector<vector<ll> >
#define vec1 vector<ll>
ll maxNode=101;
ll total=0;
ll c[101][101];
ll mark[101];
ll ans;
ll s;
void bfs(vec2 &g)
{
ll tot1=0;
vector<ll>mark(maxNode);
queue<ll>q;
q.push(s);
mark[s]=1;
while(q.em... | true |
7df1274b6134855910fcb399403d80060425da0c | C++ | claytongreen/Compiler | /Source/Compiler/semantic_analyzer.cpp | UTF-8 | 3,185 | 2.5625 | 3 | [] | no_license | // Author: Clayton Green (kgreen1@unbc.ca)
// Visual Studio complains about using fopen() because it is deprecated and
// suggests using fopen_s() but G++ only has fopen().
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "ast_node_full_visitor.h"
#include "ast_node_init_visitor.h"
#include "semantic_... | true |
deb48ebdfed956a7ae218154a76caeca3446ee27 | C++ | juicetin/superstickmanpt2 | /obstacle.cpp | UTF-8 | 516 | 2.75 | 3 | [] | no_license | #include "obstacle.h"
Obstacle::Obstacle(obstacleInfo obstacle_info, gameInfo *game_info) :
m_y(obstacle_info.start_y), m_spacing(obstacle_info.spacing),
m_speed(obstacle_info.speed), m_game_info(game_info),
m_obstacle_info(obstacle_info)
{
}
int Obstacle::getY() const
{
return m_y;
}
int Obstacle::get... | true |
8c913e6089f6b30c74f7a4d574f6d622b48c5d68 | C++ | payaldhakulkar/cv_code | /blend.cpp | UTF-8 | 1,324 | 2.515625 | 3 | [] | no_license | #include<opencv/highgui.h>
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(int argc, char **argv)
{
int i, j;
Mat image1, image2;
image1 = imread("/home/payald/opencv/opencv/samples/data/board.jpg", IMREAD_GRAYSCALE);
image2 = imread("/home/payald/opencv/ope... | true |
32180c1d9d43911ef6a0f8f0c39ae71cf3e38d22 | C++ | ksaveljev/UVa-online-judge | /10299.cpp | UTF-8 | 550 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int phi(int n) {
int result = n;
if (n == 1)
return 0;
if (n % 2 == 0) {
while (n % 2 == 0)
n /= 2;
result -= result / 2;
}
for (int i = 3, sq = sqrt(n); i <= sq; i += 2) {
if (n % i == 0) {
while (n % i == 0)
n ... | true |
e8b4ffcfd3cfe8a9615c74de7662ac573022a394 | C++ | jesuswr/Multilayer-Perceptron | /src/multilayer_perceptron.cpp | UTF-8 | 5,361 | 2.625 | 3 | [
"MIT"
] | permissive | #include "multilayer_perceptron.hpp"
#include "perceptron.hpp"
#include <stdlib.h>
#include <time.h>
#include <vector>
#include <iostream>
using namespace std;
multilayer_perceptron::multilayer_perceptron(int inp_sz, int hidden_sz, int out_sz,
long double etha, long double alpha, long double w_range, long dou... | true |
f5250b65be5c1ece0a50fd0850c7c30408b174da | C++ | binism/MyPainter | /src/lineclip.cpp | UTF-8 | 3,734 | 2.84375 | 3 | [] | no_license | #include "lineclip.h"
LineClip::LineClip(QObject *parent) : Shape(parent){
shapeName = "LineClip";
shapeCode = Shape::LineClip;
isUsedTag = false;
}
OutCode LineClip::ComputeOutCode(QPoint p){
OutCode code;
code = INSIDE; // initialised as being inside of [[clip window]]
if (p.x() <... | true |
5137192044526b2a951bd070363751b95cfceca1 | C++ | davisking/dlib | /tools/imglab/src/convert_idl.cpp | UTF-8 | 4,269 | 2.671875 | 3 | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
#include "convert_idl.h"
#include "dlib/data_io.h"
#include <iostream>
#include <string>
#include <dlib/dir_nav.h>
#include <dlib/time_this.h>
#include <dlib/cmd_line_parser.h>
using namespace std;
using namespace dlib;
namespace
{
using namespace dlib::image_dataset_metadata;
// -------------------------------... | true |
6d1ca0b8cc5a58ebc48ec16427cae4eeaf8f0f4f | C++ | rkokan/HackerRank | /Search/Sherlock and Array/main.cpp | UTF-8 | 940 | 2.734375 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int T;
cin >> T;
while(T--){
int N ;
cin >> N;
int *A;
A = (int*)malloc(N*sizeof(int));
long long int sum = 0;
fo... | true |
c1c0812f1ccd109aa7dc18884e56f9ce64c49c70 | C++ | abel-souss/aurora | /math/mathlib/src/geometry/triangle/triangle2.cpp | UTF-8 | 9,018 | 2.90625 | 3 | [] | no_license | #include "geometry/triangle/triangle2.h"
tri2_t tri2_new (const vec2_t* pt1_pi, const vec2_t* pt2_pi, const vec2_t* pt3_pi)
{
tri2_t tri;
vec2_copy(&(tri.pts[0]), *pt1_pi);
vec2_copy(&(tri.pts[1]), *pt2_pi);
vec2_copy(&(tri.pts[2]), *pt3_pi);
return tri;
}
void tri2_set (tri2_t* tri_po, const ve... | true |
2f27ff42d1d5ff938354c5508e4c166f72ab0c37 | C++ | loobahpng/programming_practice | /CPE/20170523_Q2.cpp | UTF-8 | 931 | 2.9375 | 3 | [] | no_license | // 2017/05/23 Q2 12195: Jingle Composing
#include <iostream>
#include <string>
using namespace std;
int main(){
string input;
cin>>input;
while (input!="*"){
int correct=0; //number of measures with correct duration
int duration=0; //make full duration 64
for (int i=0;i<input.size()... | true |
090fa606553a0d30b7e878a221314e8c2e64fc26 | C++ | Gokula-Krish/Practice | /m2.cpp | UTF-8 | 1,037 | 3.3125 | 3 | [] | no_license | #include<iostream>
#define r 1000
#define c 1000
void Spiral(int a[r][c],int m,int n)
{
int k=0,l=0;
while(k<m && l<n)
{
for(int i=k;i<n;i++)
{
printf("%d ",a[k][i]);
}k++;
for(int i=k;i<m;i++)
{
printf("%d ",a[i][n-1]);
}n--;
i... | true |
32e89d3151de2c5c575d7c4894456a822236547a | C++ | aschiffer186/Analysis | /include/wrappers.hh | UTF-8 | 906 | 2.59375 | 3 | [] | no_license | #ifndef WRAPPERS_HH
#define WRAPPERS_HH
#include <gsl/gsl_spline.h>
#include <gsl/gsl_roots.h>
#include <memory>
#include <vector>
struct spline_deleter
{
void operator()(gsl_spline* ptr) const
{
gsl_spline_free(ptr);
}
};
struct root_fsolver_deleter
{
void operator()(gsl_root_fsolver* ptr) ... | true |
a4555406988bd3187f01d3cb4b3d6f289b8813ae | C++ | cheerayhuang/leetcode | /isomorphic-word/isomorphic-word.cc | UTF-8 | 1,015 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
class Solution {
public:
bool isIsomorphic(string pattern, string str) {
//if (pattern.size() == 0 && str.size() == 0) return true;
if (str.size() != pattern.size()) return false;
... | true |
dcc4efdcccfa41668007f88dbf6b7938cb09e3ed | C++ | mlong-abb/libdlibxx | /src/dlibxx.cxx | UTF-8 | 996 | 2.578125 | 3 | [
"BSD-2-Clause",
"BSD-2-Clause-Views"
] | permissive | #include <dlibxx.hxx>
namespace dlibxx {
handle::handle(std::string const& name)
: name_(name)
{
this->load(name_);
}
handle::~handle()
{
this->close();
}
void handle::resolve_policy(::dlibxx::resolve rt)
{
resolve_time_ = rt;
}
void handle::set_options(::dlibxx::options opts)
{
resolve_options_ = opts;
}
vo... | true |
344d2ad759287ccaee17e0ba51d0570155005029 | C++ | snshamwow/CSC-1101-Labs | /Lab10-02.cpp | UTF-8 | 2,289 | 3.203125 | 3 | [] | no_license | //==========================================================
//
// Title: Planet Calculator
// Course: CSC 1101
// Lab Number: 10-02
// Author: Sadeem Shamoun
// Date: 10/21/19
// Description:
// Planet calclulator
//
//==========================================================
#include <... | true |
34543b2a99e75f238cc23e7c4d0f5e1b4f466531 | C++ | siargey-pisarchyk/AICup-2015 | /Cell.h | UTF-8 | 692 | 2.890625 | 3 | [] | no_license | #ifndef CELL_H
#define CELL_H
#include "CommonDefines.h"
using namespace model;
struct Cell
{
public:
Cell() = default;
Cell(int x, int y);
bool operator<(Cell const & other) const;
bool operator==(Cell const & other) const;
bool operator!=(Cell const & other) const;
Cell GetNeibor(Direction c... | true |
4b38ab6d086a66a9ff76579f62d384bc03eb1a73 | C++ | shafitek/Parallel-Seam-Carving-on-GPU | /src/CPUCarver.cpp | UTF-8 | 2,304 | 2.703125 | 3 | [] | no_license | #include "CPUCarver.h"
CPUCarver::CPUCarver(const char *img_path, const bool &reduce)
: SeamCarver(img_path, reduce){};
void CPUCarver::computeEnergyImage() {
auto start = std::chrono::high_resolution_clock::now();
const cv::Mat img = getImage();
cv::Mat efm(img.rows, img.cols, img.type());
for(i... | true |
a22f9c354ba7e91812ab0cdf35b8de324f90df2e | C++ | mtaost/serial-controlled-relay-board | /arduino/Serial_Controlled_Relay_board/Serial_Controlled_Relay_board.ino | UTF-8 | 12,102 | 3.3125 | 3 | [
"MIT"
] | permissive | /*
Serial Relay Controller
Author: Michael Tao
Date: 8/9/2018
Credit to https://github.com/kroimon/Arduino-SerialCommand for inspiration for serial command line interpreter
*/
#include <SoftwareSerial.h>
#define NUM_COMMANDS 5
#define BUFFER_SIZE 64
#define MAX_COMMAND_SIZE 16
#define MAX_JUMPER_NAME_SIZ... | true |
2f026fbb44650ad1f67064aaf023cf1639c45961 | C++ | tlvb/dmx512usb_software | /src/serial.cc | UTF-8 | 2,209 | 2.515625 | 3 | [] | no_license | #include <fcntl.h>
#include <termios.h>
#include <errno.h>
#include <linux/serial.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "serial.hh"
namespace dmx512usb_software {
Serial::Serial(const std::string &device, int baudrate) {
portopen = false;
sfd = open_port(device);
if (ok)
config_port(sfd, b... | true |
13149d4b36a6697b918bd7f76d7c52b048652f6e | C++ | gaodechen/OI_History | /problems/luogu1265.cpp | UTF-8 | 880 | 2.796875 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
const int N = 5e3 + 5;
struct Point
{
double x, y;
} p[N];
struct Item
{
int v;
double d;
Item( int v, double d ): v( v ), d( d )
{
}
... | true |
f452d8a8da74a5077eee42e33c7d3837ccbbcba4 | C++ | 66112/Signal | /Sigchild/test.cc | UTF-8 | 677 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
using namespace std;
void handler(int signo)
{
if(pid_t ret=(wait(NULL)) != -1)
{
cout << "child exit process" << ret <<endl;
}
}
int main()
{
struct sigaction act,oact;
act.sa_handler=h... | true |
2118ea50176a484ce5171e9eda9a2fc91508d9ba | C++ | Jia-Joe/OJ_hihoCoder_LeetCode_Sword2Offer | /LeetCode160_166_191_198_206/L160.cpp | UTF-8 | 978 | 3.125 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode *p1=headA, *p2=headB, *ps, *pl;
if(!p1||!... | true |
e642732b79ffc4bd6230beef81aac89a8e94738a | C++ | eduaglz/RoboticsTec | /Control/Robotics/PWM.cpp | UTF-8 | 4,366 | 3.015625 | 3 | [] | no_license | /*
* PWM.cpp
*
* Created: 9/20/2015 11:58:15 PM
* Author: Eduardo
*/
#include "PWM.h"
#include <avr/io.h>
PWM::PWM() {
}
// default constructor
PWM::PWM(Timer timer, Channel channel, int frequency, int dutyCycle, int prescaler) :Frequency(frequency), DutyCycle(dutyCycle), Prescaler(prescaler)
{
// Get the address ... | true |
2daddec177e12f58f60d40f41b62011c884cc1d3 | C++ | heromapwrd/DesignPattern | /BehevioralPatterns/Command/Invoker.cpp | UTF-8 | 449 | 2.859375 | 3 | [] | no_license | #include "Invoker.h"
#include <iostream>
using namespace std;
Invoker::Invoker()
{
cout << endl << "Invoker Constructor!" << endl;
}
Invoker::~Invoker()
{
cout << endl << "Invoker Destructor!" << endl;
}
void Invoker::SetCommand(Command* pCommand)
{
m_pCommand = pCommand;
}
Command* Invoker::GetCommand()
{
retu... | true |
6a26005757e32bc167c885b727863d6e82db4fb1 | C++ | Thejulfi/Ouiv_Deep_Sleep | /DeepSleep_ZeroPowerConsumption/DeepSleep_ZeroPowerConsumption.ino | UTF-8 | 1,237 | 2.59375 | 3 | [] | no_license | #include "ZeroPowerManager.h"
const byte interruptPin = 1;
//FLags de gestion du mode de fonctionnement
volatile int SLEEP_FLAG; //1 si autorisé à dormir, 0 sinon
#define Rled 2
void blink() {
SLEEP_FLAG = 0;
}
void setup()
{
zpmRTCInit();
pinMode(Rled, OUTPUT);
/*
* To get to datash... | true |
73694f17fcf400707475c64bb15bdc2f7171568a | C++ | srane96/Data-Structure-and-Algorithms-Using-Cpp-and-Python | /Cpp/permutations_recursion.cpp | UTF-8 | 836 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <vector>
// print the permutations
void printPerm(std::vector<int> arr) {
for(int a:arr)
std::cout << a << " ";
std::cout << std::endl;
}
// calculate permutation of all elements of a sequence recursively
void displayPermutations(std::vector<int> arr, std::vector<int> perm, std::... | true |
760426b87c12a885f6d51c8ee31922fa604019ce | C++ | ihchoi95/codereview | /node.cc | UTF-8 | 1,456 | 3.46875 | 3 | [] | no_license | // Copyright 2018 <Author>
#include "node.h"
Node::Node(char data) {
prev = next = nullptr;
value = data;
return;
}
char Node::GetData() {
return value;
}
Node* Node::GetPreviousNode() {
return this->prev;
}
Node* Node::GetNextNode() {
return this->next;
}
Node* Node::InsertPreviousNode(char data) {... | true |
f96899668fde59dad0ea7b7dc338e0762ba63bb5 | C++ | marc-hanheide/cogx | /subarchitectures/comsys/branches/stable-for-binder-7/src/mercury-c++/abduction/server-mk2/StringToSlice.cc | UTF-8 | 6,093 | 2.953125 | 3 | [] | no_license | #include "StringToSlice.h"
using namespace std;
using namespace Abducer;
void
parseAndAddTermSeq(vector<Token *>::iterator & it, vector<TermPtr> & args)
{
vector<Token *>::iterator orig = it;
TermPtr arg = parseTerm(it);
if (arg) {
args.push_back(arg);
if ((*it)->type() == Comma) {
it++;
parseAndAddTer... | true |
7250c06e9b241792094679e2bfc17d256aacd4a7 | C++ | codingzhoushuai/lesson | /hello_namespace/Main.cpp | GB18030 | 955 | 3.265625 | 3 | [] | no_license | #include<iostream>
// #include<stdlib.h> system("pause"); ʹ÷ֹ̨
// #include<windows.h> Sleep("5000"); ʹ÷ֹ̨
using namespace std;
namespace Computer
{
int i;
void f()
{
cout << "Computer ::f " << endl;
}
}
namespace Information
{
int i;
void f()
{
cout << "Informationr ::f " << endl;
}
}
/*using namesp... | true |
b05e8cd23344bb1018ac8a6e4870328cca2cc811 | C++ | GDMiao/Class8 | /Class8Online/CNetwork/Protocols/MobileConnectClassReq.h | UTF-8 | 1,301 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef __GNET_MOBILECONNECTCLASSREQ_H
#define __GNET_MOBILECONNECTCLASSREQ_H
#include "rpcdefs.h"
#include "state.hxx"
namespace GNET
{
class MobileConnectClassReq : public GNET::Protocol
{
public:
enum { PROTOCOL_TYPE = 1034 };
int64_t userid;
Octets devicename;
Octets code;
public:
MobileConne... | true |
a1584701c3df7a2004374fa6ec5c8eea785202da | C++ | Vermeille/Kulay | /ast/instr.cpp | UTF-8 | 456 | 2.796875 | 3 | [] | no_license | #include "ast.h"
Instr::Instr(Decls* let, InstrBody* body, Decls* where)
: let_(let), body_(body), where_(where) {
}
void Instr::PrettyPrint() const {
std::cout << "{";
if (let_) {
std::cout << "let [";
let_->PrettyPrint();
std::cout << "] in ";
}
body_->PrettyPrint();
... | true |
2a5038abcfdf548e132c66d166f0aebcf6b8922f | C++ | Anne-ClaireFouchier/ImageProcessingComputerVision | /AVSA/Foreground_segmentation/src/fgseg.cpp | UTF-8 | 8,423 | 2.546875 | 3 | [] | no_license | /* Applied Video Sequence Analysis (AVSA)
*
* LAB1.0: Background Subtraction - Unix version
* fgesg.cpp
*
* Authors: José M. Martínez (josem.martinez@uam.es), Paula Moral (paula.moral@uam.es) & Juan Carlos San Miguel (juancarlos.sanmiguel@uam.es)
* VPULab-UAM 2020
*/
#include <opencv2/opencv.hpp>
#include "fgs... | true |
152829e21d67f0dfa03a51b2426b67ada6dbba3c | C++ | AYOKINYA/Algorithm | /leetcode/Binary/countBits.cpp | UTF-8 | 455 | 3.078125 | 3 | [] | no_license | // #include <vector>
class Solution {
public:
vector<int> countBits(int num) {
vector<int> res;
res.push_back(0);
for (int i = 1; i <= num; ++i)
{
int count = 0;
int val = i;
while (val != 0)
{
if (val & 1)
... | true |
a6d0633ed4084c2a253a2dca3ec852e3284c9791 | C++ | ShinoharaYuuyoru/In-Class_Projects | /Projects in Grade 1 (VS2013)/School Projects/88.PID2 - 开心的金明/88.PID2 - 开心的金明/源.cpp | GB18030 | 629 | 2.78125 | 3 | [] | no_license | #include "stdio.h"
#define X 30
int N, m;//N:Ǯ<30000 mԹĶ<25
int price[X], level[X];//ӦƷ۸͵ȼ
int sum[30000] = { 0 };
int main()
{
int mcnt;//Ʒ
int money;
scanf("%d%d", &N, &m);//Ϣ
for (mcnt = 0; mcnt < m; mcnt++)
{
scanf("%d%d", &price[mcnt], &level[mcnt]);
}
for (mcnt = 0; mcnt < m; mcnt++)
{
for (mon... | true |
8b890c3333c9d37921c1ccc05183c78a523af9d8 | C++ | Sissinothere/New_Calculator | /StringReader.cpp | UTF-8 | 6,377 | 2.953125 | 3 | [] | no_license | //============================================================================
// Name : StringReader.cpp
// Author : John Harrison
// Version :
// Copyright : Do not distribute
// Description : Hello World in C++, Ansi-style
//==========================================================================... | true |
1a7bc8f8f6dd56193fe12b232f756af48fdf1bd0 | C++ | lysgwl/QtProject | /QDemo1/widget/ScreenShotView.cpp | UTF-8 | 5,197 | 2.59375 | 3 | [] | no_license | #include "ScreenShotView.h"
CScreenShotView::CScreenShotView(QWidget *parent)
: QWidget(parent)
{
m_pSpinBox = nullptr;
m_pCheckBox = nullptr;
m_pScreenImageLabel = nullptr;
m_pNewScreenShotBtn = nullptr;
m_pSaveScreenShotBtn = nullptr;
}
void CScreenShotView::initUI()
{
QVBoxLayout *pLayou... | true |
6d16e5cec61f51e427078b2997b00b8df402b73b | C++ | mclaughlinpeter/c_primer_plus | /playground/cppstrings.cpp | UTF-8 | 736 | 3.609375 | 4 | [] | no_license | #include<iostream>
#include<sstream>
#include<string>
int main()
{
std::string a = "hello ";
char temp[] = {'w', 'o', 'r', 'l', 'd', '!', '\0'};
std::string b(temp);
a[0] = 'H';
std::string c = a + b;
std::cout << "The string c is: " << c << std::endl;
std::cout << "The length of c is: " <<... | true |
6b25f1305902e1c2492539c07e0de6637de1cacd | C++ | LYHyoung/BaekJoon | /BOJ solve/1000~9999/1000~1999/1719/main.cpp | WINDOWS-1252 | 2,714 | 2.578125 | 3 | [] | no_license | /*
#include <iostream>
#include <queue>
#define MAX 200
#define INF 10000
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
int MAP[MAX][MAX];
int ans[MAX];
int dist[MAX];
for (int i = 1; i < MAX; i++) {
for (int j = 1; j < M... | true |
2ea475be94cc4491b539c10481c8eb5364f6ae6f | C++ | admantium-sg/learning-cpp | /ccc/28_variadic_templates.cpp | UTF-8 | 634 | 3.09375 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* ---------------------------------------
* Copyright (c) Sebastian Günther 2021 |
* |
* devcon@admantium.com |
* |
* SPDX-License-Identifier: BSD-3-Clause |
* ---------------------------------------
*/
#include ... | true |
8d2eef431d4de4a93b3d3b216b4cf5b593c8367d | C++ | mhunicken/icpc-team-notebook-el-vasito | /data_structures/linkcut2_test3.cpp | UTF-8 | 3,940 | 2.640625 | 3 | [] | no_license | /*
* Contest: XVIII Open Cup named after E.V. Pankratiev
* Grand Prix of Korea
* Problem: G
*
* An example of adapting linkcut for queries of max edge in a path.
* Change are mostly (if not all) in how Node_t does update and returns
* value
*/
#include <bits/stdc++.h>
#define fore(x,a,b) for(int x=a,... | true |
8372d8cda3aefe81dba2a3e38facc077db5eedc4 | C++ | SamChien/Competitive-Programming | /uva_online_judge/11727-Cost_Cutting.cpp | UTF-8 | 490 | 3.046875 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
using namespace std;
int main() {
int caseNum;
scanf("%d", &caseNum);
for (int caseCount=1; caseCount<=caseNum; caseCount++) {
int empNum = 3;
int salArr[empNum];
for (int i=0; i<empNum; i++) {
int salary;
scanf("%d",... | true |
9fef4f9aa3af1051b07d8f8ac0a60658723328f8 | C++ | JunHaoSu/Algorithm | /For_course/rent.cpp | UTF-8 | 1,589 | 3.125 | 3 | [] | no_license | /*************************************************************************
> File Name: rent.cpp
> Author: sujunhao
> Mail: sujunhao0504@gmail.com
> Created Time: 2017年11月14日 星期二 19时15分51秒
************************************************************************/
/* 该算法的思想是,如果单步租用小于连续租用的钱,就用单步租用的钱替换掉连续租用的钱。即本例的1站->... | true |
ad4fe8205935b5c4f89bc9878c61492cc3867dde | C++ | Sashkoiv/yandex-cpp-belts | /white/Task_7/accessory.cpp | UTF-8 | 552 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "accessory.hpp"
using namespace std;
vector<string> PalindromFilter(vector<string> words, int minLength) {
vector<string> result;
for (string word : words) {
if (word.length() >= minLength) {
if (word == string(word.rbegin(), word.rend())) {
... | true |
5e6f3065c5a94f032fad3fc9760369e67be88f3d | C++ | zjingcong/pba | /pba/include/Triangle.h | UTF-8 | 1,290 | 2.90625 | 3 | [] | no_license | //
// Created by jingcoz on 9/18/17.
//
#ifndef PBA_TRIANGLE_H
#define PBA_TRIANGLE_H
# include "Vector.h"
# include "Color.h"
namespace pba
{
class Triangle
{
public:
Triangle(const pba::Vector& P0, const pba::Vector& P1, const pba::Vector& P2);
~Triangle() {}
void setColor(pba... | true |
81549d24201e5cdf9c6a4fa8ece9489bd2a4927c | C++ | tofergregg/CodeReview | /course/cs106b/1176/midterm/p2/cgregg.cpp | UTF-8 | 610 | 3.15625 | 3 | [] | no_license | string decode(string seq) {
// create a stack to hold the values
Stack<int> s;
// create a string for the result
string result;
// we need to iterate n+1 times
for (int i=0; i <= (int)seq.length(); i++) {
s.push(i+1);
// if we have processed all characters or the character
... | true |
98a0db9a560ce73ff45a2f3907c271a23b7c4b9f | C++ | JackyHan/Human-Body-Temperature-Simulation | /Time-dependent simulation/main.cpp | UTF-8 | 5,584 | 2.546875 | 3 | [
"MIT"
] | permissive | /*
MIT License
Copyright (c) 2016 - Jacky Han
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, pu... | true |
f06405f77c8b093b0b6ae76e55a662cd3316d50e | C++ | niloufar60/cpp-codes | /p432-varaddr.cpp | UTF-8 | 282 | 2.578125 | 3 | [] | no_license | //
// p432-varaddr.cpp
//
//
// Created by Niloufar on 2018-08-17.
//
#include <iostream>
using namespace std;
int main ()
{
int var1=11;
int var2=22;
int var3=33;
cout << &var1 << endl
<< &var2 << endl
<< &var3 << endl;
return 0;
}
| true |
6146912a7080067cc850bde6f3885a3dbe371b12 | C++ | sawarn/Captcha_Generator | /main.cpp | UTF-8 | 890 | 3.140625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool checkCAPTCHA(string &captcha,string &user_CAPTCHA)
{
if(captcha==user_CAPTCHA)
return true;
else
return false;
}
string generateCAPTCHA(int n){
char *ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
... | true |
5b8092e122aaa40424e0ca25874a2f9779991597 | C++ | HaythemBenMechichi/test | /congee.cpp | UTF-8 | 2,298 | 2.53125 | 3 | [] | no_license | #include "congee.h"
congee::congee()
{
cin=0;
}
congee::congee(int a,QDate d,QDate e)
{
cin=a;
date_d=d;
date_e=e;
}
int congee::getcin(){
return cin;
}
QDate congee::getdate_d(){
return date_d;
}
QDate congee::getdate_e(){
return date_e;
}
bool congee::ajouter(){
QSqlQuery query;
query.prepar... | true |
6e523d91f4029b0139a57df2ca9087c63eea6af5 | C++ | rohitbhatghare/c-c- | /Sept-25-20/assignment158.cpp | UTF-8 | 295 | 3.015625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int i,j;
int sum=1,avg;
cout<<"Enter the Number ";
cin>>j;
for(i=1;i<=j;i++)
{
sum=sum*i;
}
cout<<"Odd natural numbers and their sums are"<<j<<" "<<sum<<endl;
return 0;
}
| true |
a9ccb17dcc30fdc8e1f7042b2bafd5182903bfc1 | C++ | dragonir/Sicily | /1199. GCD(欧拉函数).cpp | UTF-8 | 731 | 3.125 | 3 | [] | no_license | #include<algorithm>
#include <iostream>
#include <cmath>
using namespace std;
int data[40000];
int Euler(int n){
int temp=n;
for(int i=2;i*i<=n;i++)if(n%i==0){
temp=(temp/i)*(i-1);
for(;n%i==0;n/=i);
}
if(n>1)temp=(temp/n)*(n-1);
return temp;
}
int main(){
int t;cin>>t;
while(t--)... | true |
4d729964de4335a6243e225659cea03a29177901 | C++ | ChickYQ/Leetcode | /121.cc | UTF-8 | 1,544 | 3.953125 | 4 | [] | no_license | /*
121. 买卖股票的最佳时机
给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。
如果你最多只允许完成一笔交易(即买入和卖出一支股票一次),设计一个算法来计算你所能获取的最大利润。
注意:你不能在买入股票前卖出股票。
示例 1:
输入: [7,1,5,3,6,4]
输出: 5
解释: 在第 2 天(股票价格 = 1)的时候买入,在第 5 天(股票价格 = 6)的时候卖出,最大利润 = 6-1 = 5 。
注意利润不能是 7-1 = 6, //因为卖出价格需要大于买入价格;同时,你不能在买入前卖出股票。
示例 2:
输入: [7,6,4,3,1]
输出: 0
解释: 在这种情况下, 没有交... | true |
996834d6d48ccc54ef17ee1e01fb672df4a0a404 | C++ | Kaldie/GeRoBot | /math/Line2D.h | UTF-8 | 766 | 2.796875 | 3 | [] | no_license | // Copyright [2015] Ruud Cools
#ifndef MATH_LINE2D_H_
#define MATH_LINE2D_H_
#include <Point2D.h>
class Line2D {
private:
GETSET(Point2D, m_startPoint, StartPoint);
GETSET(Point2D, m_endPoint, EndPoint);
public:
bool operator==(const Line2D& i_rhs) const;
Line2D();
Line2D(Point2D i_startPoint,
... | true |
ecb0bb1577c00c4f4469653aa360fe741dfdc723 | C++ | lizizatt/TicTacToe | /source/Cube.h | UTF-8 | 1,662 | 2.546875 | 3 | [] | no_license | #pragma once
#include <glad/glad.h>
#include <gl/GL.h>
#include <GLFW/glfw3.h>
#include <stdio.h>
#include <string>
#include <glm.hpp>
#include <gtc/matrix_transform.hpp>
#include <vector>
#include <unordered_map>
#include <chrono>
using Clock = std::chrono::steady_clock;
using std::chrono::time_point;
using std::chr... | true |
1a9e64017aba7c65581df84920a8cb2a06761e11 | C++ | davidjacobo/Competencias | /HackerRank/find_digits.cpp | UTF-8 | 493 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <cstring>
#define MAX_N 12
using namespace std;
typedef long long ll;
int main(){
ll N;
char line[MAX_N];
int T, len, counter;
cin>>T;
while(T--){
cin>>line;
N = atoi(line);
len = strlen(line);
counter = 0;
for... | true |
192b440e51c6cbf778bb094baa3a06eba6066f5a | C++ | Meaple-SFKY/Programming | /C_Folder/Data_Structure/Graph_Experiment/createGrpAdjLinkedList.h | GB18030 | 11,036 | 3.15625 | 3 | [] | no_license | #ifndef _CREATGRPADJLINKEDLIST_H_
#define _CREATGRPADJLINKEDLIST_H_
#include<iostream>
#include<cstring>
#include"grpAdjLinkedList.h"
using namespace std;
void strLTrim(char* str); //ɾַ߿ո
//***************************2 ļͼ****************************//
//* ܣıļڽӾʾͼ *//
//* ڲ char f... | true |
cca0b6622e49c3437fd83041c9f07b4b79d71b01 | C++ | dronekit/dronekit-la | /analyzer.h | UTF-8 | 9,417 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /**
* @file
* @author Peter Barker <peter.barker@3drobotics.com>
*
* @section DESCRIPTION
*
* Base class for all analyzers; provides facilities to register results
*/
#ifndef ANALYZER_H
#define ANALYZER_H
#include <jsoncpp/json/json.h> // libjsoncpp0 and libjsoncpp-dev on debian
// #include <jsoncpp/json/write... | true |
72705f89fe9b5bf57182e61304728d8864bed169 | C++ | AlexUnderMoscow/DSP | /_DSP150217/arrow.cpp | UTF-8 | 3,802 | 2.53125 | 3 | [] | no_license |
#include <QtGui>
#include "arrow.h"
#include <math.h>
const qreal Pi = 3.1428;
Arrow::Arrow(QWidget *startItem, QWidget *endItem, unsigned short _startID, unsigned short _stopID,
QGraphicsItem *parent, QGraphicsScene *scene)
: QGraphicsLineItem(parent)
{
myStartItem = startItem;
myEndItem = endI... | true |
0f3bef35db94f0245d9cd82b66b5ebcb94a201ed | C++ | dlotko/SComplex | /inc/redHom/complex/BasicCellProxy.hpp | UTF-8 | 2,397 | 3.046875 | 3 | [] | no_license | #ifndef CELL_PROXY_HPP
#define CELL_PROXY_HPP
#include <boost/ref.hpp>
template<typename CellImplT>
class BasicCellProxy {
protected:
// boost::reference_wrapper<CellImplT> nonConstImpl;
mutable CellImplT impl;
public:
typedef typename CellImplT::Color Color;
typedef typename CellImplT::Dim Dim;
typede... | true |
fd862c0279ea3a6644a308dcc21d634b8b33d78a | C++ | PierreLeBlond/Orangutan | /src/object/mesh.cpp | UTF-8 | 17,689 | 3.203125 | 3 | [] | no_license | #include "object/mesh.h"
Mesh::Mesh(std::string name) : Asset(name)
{
_indexes = new unsigned int ;
_positions = new float;
_normals = new float;
_texCoords = new float;
}
Mesh::Mesh(const Mesh & mesh) : Asset(mesh.getName()){
const float* texCoords = mesh.getTexCoords();
const float* normal... | true |
fc41f6b63d9dbf01fba8d62f57840a0f38059ca0 | C++ | AniruddhaSadhukhan/C-Plus-Plus-Programs | /File Handling/eofFile.cpp | UTF-8 | 339 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include<fstream>
using namespace std;
/*Write a C++ program to read and display contents of file. Use eof( ) function.*/
// by Aniruddha
int main()
{
string name;
int age;
char c;
ifstream in ("text.txt");
while(in.eof()==0)
{
in>>c;
cout<<c;
}
in.close();
return 0;
}
/*Sample Ou... | true |
476cc807f66b1adeb1e81a8d30936b58e5f3e1ce | C++ | jordanlee008/Code | /USACO/Oct2015Bronze/speeding/speeding.cpp | UTF-8 | 1,054 | 2.671875 | 3 | [] | no_license | /*
ID: jorlee
PROG: speeding
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main () {
ifstream fin ("speeding.in");
ofstream fout ("speeding.out");
int N, M;
fin >> N >> M;
vector< vector<int> > n (N), m (M);
for (int i = 0; i < N; i++) {
vector<int... | true |
1af70b09a8bae1f0b7957381930d2edc0f983384 | C++ | Solomia-Ratushna/oop2.4.1 | /Source.cpp | WINDOWS-1251 | 1,050 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include "Matrix.h"
#include <Windows.h>
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
Matrix A(3), B(3), z;
int x;
cout << " 1" << endl;
cin >> A;
cout << " 1:" << endl;
cout << A;
cout << " 1:" << A.MatrixNorm() << endl;
cout << " 2" << endl;
cin >> B;
cout << "... | true |
005e65250845a6c65488ad9d0fa41b1d91565e4d | C++ | THLEE-KR/Baekjoon-Online-Judge_THLEE | /20200731_1149/main.cpp | UTF-8 | 707 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int v[1010][10];
int ans[1010][10];
int main() {
int n;
cin >> n;
for(int i=0; i<n; i++){
cin >> v[i][0] >> v[i][1] >> v[i][2];
}
for(int i=0; i<3; i++)
ans[0][i] = v[0][i];
for(int i=1; i<n; i++){
for(int ... | true |
c10688eac1d18230515c8431149dbef62840b261 | C++ | Gobukgol/Algorithm | /DP/B1463.cpp | UTF-8 | 1,448 | 2.859375 | 3 | [] | no_license | //
// B1463.cpp
// 23rdSoptAlgo
//
// Created by Minhyoung on 2019. 2. 4..
// Copyright © 2019년 Minhyoung. All rights reserved.
//
#include <cstdio>
#include <algorithm>
using namespace std;
int result[1000001] = {-1,};
void setMinValue(int n){
int minValue = -1;
if(n%2 == 0 && n%3 == 0){
if... | true |
7cebe11f806143674fe484742b89bef82d263ad2 | C++ | sparkfiresprairie/cpc | /dfs_bfs/word_search.cpp | UTF-8 | 1,440 | 3.46875 | 3 | [] | no_license | //
// Created by Xingyuan Wang on 4/13/17.
//
/*
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where
"adjacent" cells are those horizontally or vertically neighboring. The same
letter cell may not be used more ... | true |
4370c5a6b15016f7b5c36e5db59e57315adf794e | C++ | yashart/neva_offline_gps_check_module | /drone_angle_header.cpp | UTF-8 | 1,315 | 2.71875 | 3 | [] | no_license | #include "drone_angle_header.h"
#include "drone_angles.h"
#include "stdio.h"
#include <stdlib.h>
DroneAngleHeader read_angles() {
DroneAngleHeader droneAngleHeader;
droneAngleHeader.angles = (DroneAngle*) calloc (10000, sizeof(*(droneAngleHeader.angles)));
FILE* textAngles = fopen("angles.txt", "r");
... | true |
6cd5c3d6dc40e3a4fd1e494f1739dfcaef0962f8 | C++ | Madness-D/CodeUp | /3 入门模拟/3.2 查找元素/E 学生查询.cpp | UTF-8 | 699 | 2.671875 | 3 | [] | no_license | #include<iostream>
#include<cstring>
using namespace std;
struct Student {
char xuehao[100];
char name[100];
char sex[100];
int age;
}stu[20];
int main() {
int m;
cin >> m;
while(m--) {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> stu[i].xuehao... | true |
2299bd69bd4b0716fc0c6241083ef9ca3882f292 | C++ | Pallesnik/Portfolio | /Game_Library/Developer.h | UTF-8 | 521 | 2.828125 | 3 | [] | no_license |
#include <string>
#include <iostream>
#include <vector>
#ifndef DEVELOPER_H_
#define DEVELOPER_H_
using namespace std;
class Developer{
protected:
string DevName;
int games;
float salary;
public:
Developer();
Developer(string a);
void setDeveloperName(string n);
void setnofGamesReleased(int no... | true |
f86180aab2c22be16f82ab159e56228b8ed52cbd | C++ | Shaykat/Data-Structure | /link list delete(complete).cpp | UTF-8 | 2,658 | 3.8125 | 4 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
class node{
int data;
node *next;
public:
node *start,*np,*p,*ptr,*delt,*prev;
void Add()
{
int v;
cin >> v;
np = new node;
np->data = v;
np->next=NULL;
if(start == NULL)
{
start = np;
}
else
... | true |
054c83ed55a14de198986c01e68026562a9aeabf | C++ | dipendughosh/programs | /MSc_CompSc/3rd_sem/multimedia/quesn_3.c | UTF-8 | 4,129 | 2.859375 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#define ALL -1
#define MAXCITIES 10
enum BOOL{FALSE,TRUE};
long *visited;//visited nodes set here
long *min_circuit;//min inner circuit for given node as start node at position indexed 0
long *ham_circuit;//optimal circuit with length stored at position indexed 0
long min_circuit_le... | true |