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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4e303d9e6a277be98be4210e795aaeadac1897ac | C++ | Mallocsizeofint/Praktikum | /laplace_matrix_IC.hpp | UTF-8 | 925 | 2.8125 | 3 | [] | no_license | #ifndef LAPLACE_MATRIX_IC_HPP
#define LAPLACE_MATRIX_IC_HPP
#include "laplace_matrix.hpp"
#include <iostream>
namespace FDM {
class LaplaceMatrixIC : public LaplaceMatrix {
private:
mutable estd::vector_t<double> diag_;
mutable estd::vector_t<double> subdiag_;
mutable estd::vector_t<double> subsubdiag_;
//Applie... | true |
bf891d254f82d4b3e895072beb34cc01b5e95b0d | C++ | keisuke-kanao/my-UVa-solutions | /Problem Set Volumes/Volume 9 (900-999)/UVa_939_Genes.cpp | UTF-8 | 1,929 | 2.953125 | 3 | [] | no_license |
/*
UVa 939 - Genes
To build using Visual Studio 2012:
cl -EHsc -O2 UVa_939_Genes.cpp
*/
#include <iostream>
#include <string>
#include <map>
using namespace std;
const int N_max = 3100;
map<string, int> names;
enum {non_existent, recessive, dominant};
const int nr_status = dominant - non_e... | true |
522657a1d7bdb8c8042428776dbd4409585784eb | C++ | GameOrga/RepositoryName | /Sample/GameProgramming/CCharacter.cpp | SHIFT_JIS | 887 | 2.578125 | 3 | [] | no_license | #include"CCharacter.h"
#include"CTaskManager.h"
CCharacter::CCharacter()
:mpModel(0), mTag(ENONE)
{
//^XNXgɒlj
TaskManager.Add(this);
}
//XV
void CCharacter::Update(){
//gks̐ݒ
mMatrixScale.Scale(mScale.mX, mScale.mY, mScale.mZ);
//]s̐ݒ
mMartixRotate =
CMatrix().RotateZ(mRotation.mZ)*
CMatrix().R... | true |
4025a8dcda088ef283d8396c80af5e022c87cf1f | C++ | AlexaAndreas99/Faculty | /ObjectOrientedProgramming/test7/test7/UI.cpp | UTF-8 | 1,708 | 3.109375 | 3 | [] | no_license | #include "UI.h"
void UI::add()
{
char name[50] ,country[50];
std::cout << "----------Adding a team----------\n";
std::cout << "Team name: ";
std::cin >> name;
std::cout << "Team country: ";
std::cin >> country;
if (this->ctrl.add_team(name, country, 0))
std::cout << "Added succesfully\n";
else
std::cout... | true |
338008b5f58e54e4ace7e74549204c2139e2fde8 | C++ | wai2016/pa3_rt | /src/scene/light.h | UTF-8 | 3,341 | 2.984375 | 3 | [] | no_license | #ifndef __LIGHT_H__
#define __LIGHT_H__
#include "scene.h"
class Light
: public SceneElement
{
public:
virtual vec3f shadowAttenuation(const vec3f& P) const = 0;
virtual double distanceAttenuation( const vec3f& P ) const = 0;
virtual vec3f getColor( const vec3f& P ) const = 0;
virtual vec3f getDirection( const v... | true |
902d9be301ecb85de833fedb781e2826992bfa5f | C++ | lint89/TestOpengGL | /TestOpenGL/OpenGLIntroduce/CH12_AlphaTest.cpp | WINDOWS-1252 | 4,633 | 2.71875 | 3 | [] | no_license | #include <gl/glut.h>
#include <stdio.h>
#include <stdlib.h>
#define WindowWidth 400
#define WindowHeight 400
#define WindowTitle "OpenGL "
#define BMP_Header_Length 54
int power_of_two(int n)
{
if (n <= 0)
{
return 0;
}
return(n & (n-1)) == 0;
}
GLuint load_texture(const char* file_name)
{
GLint width, he... | true |
9adde6c0c9a367acf2fcb8787e4988ef7c0e897b | C++ | tkekan/programming | /wordbreak_bfs.cpp | UTF-8 | 881 | 3.328125 | 3 | [] | no_license | #include<iostream>
#include<queue>
#include<unordered_set>
using namespace std;
bool wordBreak(string s, vector<string>& wordDict) {
unordered_set<string> myset;
queue<int> myq;
if (s.length() == 0)
return false;
myq.push(0);
for (const string &s: wordDict){
... | true |
c67d98bae2e33534cd9da37ba553d31606806062 | C++ | Tackwin/Poker | /src/IA/Genome.cpp | UTF-8 | 9,010 | 2.625 | 3 | [] | no_license | #include "Genome.hpp"
#include "Random/Random.hpp"
#include <algorithm>
void Genome::add_connection_mutation() noexcept {
size_t in = random(node_genes.size());
size_t out = std::max(n_inputs, in) + random(node_genes.size() - std::max(n_inputs, in));
auto& n_in = node_genes[in];
auto& n_out = node_genes[out];
... | true |
5bda5958a0ca91325b315228238929ee4b13d787 | C++ | yosupo06/library-checker-problems | /graph/min_cost_b_flow/gen/anti_ssp.cpp | UTF-8 | 1,022 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | #include "common.h"
Graph gen_anti_ssp(const size_t k) {
const Flow max_flow = 5 * ((Flow)(1) << (k-2)) - 2;
const Flow inf = max_flow + 2;
const size_t n = 2 * k + 2;
Graph graph(n);
graph.bs[0] += max_flow;
graph.bs[n-1] -= max_flow;
rep(i, k) {
graph.add_edge(0, i + 1, 0, i == 0 ... | true |
cb80c32727e21364fc44ce07a30086f4897b3937 | C++ | dmargala/turbo-octo-spice | /turbooctospice/ThreadPool.h | UTF-8 | 830 | 2.875 | 3 | [] | no_license | #ifndef TURBOOCTOSPICE_THREAD_POOL
#define TURBOOCTOSPICE_THREAD_POOL
#include <list>
#include <boost/smart_ptr.hpp>
#include <boost/function.hpp>
namespace turbooctospice {
class ThreadPool {
public:
/// Creates a new thread pool with the specified number of threads.
/// @param nthreads Number of threads to u... | true |
436c282d8791cd080436bfc5de819719b7347d3b | C++ | nathalie-raffray/GameEngine | /src/System.h | UTF-8 | 1,784 | 2.6875 | 3 | [] | no_license | #pragma once
#include "Entity.h"
#include "EventManager.h"
/*
struct EntityCompareDefault {
static bool cmp(const EntityHandle& lhs, const EntityHandle& rhs) {
return lhs.m_index < rhs.m_index;
}
};
*/
//template<class Comparator>
class System
{
public:
//System() : m_entities(std::set<EntityHandle, bool(*)(cons... | true |
3a52ba76fb09b1a88f9ce6d2b109c138228542ec | C++ | dilawar/eyesthatblink | /core/helpers.cpp | UTF-8 | 4,677 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <queue>
#include <stdio.h>
#include <thread>
#include <chrono>
#include <boost/algorithm/string.hpp>
#include <boost/regex.hpp>
#include <iomanip>
#include <ctime>
#in... | true |
a8b21cc9a80fa5dd98d5cd365f305dccac24644a | C++ | dechimal/desalt | /include/desalt/format/detail/numeric_formatter.hpp | UTF-8 | 7,828 | 2.546875 | 3 | [
"WTFPL"
] | permissive | #if !defined DESALT_FORMAT_DETAIL_NUMERIC_FORMATTER_HPP_INCLUDED_
#define DESALT_FORMAT_DETAIL_NUMERIC_FORMATTER_HPP_INCLUDED_
#include <type_traits>
#include <desalt/require.hpp>
#include <desalt/format/constexpr/algorithm.hpp>
#include <desalt/format/detail/make_charset_pred.hpp>
#include <desalt/format/detail/... | true |
14182271d596dd0151ab209d6f62d14b9129b959 | C++ | DoubleTimeOnly/Battleship-Puzzle- | /ship.cpp | UTF-8 | 1,097 | 3.34375 | 3 | [] | no_license | // File: board.cpp
#include "ship.h"
#include <iostream>
using namespace std;
//sorts by length,then row, then column
bool longest_first(Ship s1,Ship s2){
if (s1.length>s2.length) {
return true;
} else if( s1.length==s2.length && s1.row<s2.row) {
return true;
} else if (s1.length==s2.length && s1... | true |
2ec0df72c1c3c6b177f1e2b7c5cbef717852d780 | C++ | vsmreddy/TessySamples | /CppCmdLine/source/point.cpp | UTF-8 | 326 | 3.390625 | 3 | [
"MIT"
] | permissive | #include "point.h"
Point::Point() :
X(0), Y(0) {
}
Point::Point(int x, int y) :
X(x), Y(y) {
}
Point::Point(Point &p) :
X(p.X), Y(p.Y) {
}
bool Point::operator==(Point &p) {
return (X == p.X && Y == p.Y);
}
void Point::move(Point &p) {
X += p.X;
Y += p.Y;
}
void Point::move(int x, int y) {
X += x;
Y +=... | true |
646a1e6d6d520ab933412df6154aa5ea7cea870d | C++ | h6294443/2DFDTD-CUDA-Hexagons-VBO | /user_input.cpp | UTF-8 | 2,675 | 3.0625 | 3 | [] | no_license | /* This source file belongs to project "Ch8_8.4 (TMz Example) */
#include <stdio.h>
#include <stdlib.h>
#include "global.h"
void initialize_parameters(Grid g*) {
//double src_f;
//double Sc;
//double X, Y;
//double N_lambda;
// Step 1: Specify source frequency
printf("Enter source frequency in kHz: ");
sca... | true |
d7b40d4cee177df5206cae6226ca2128c5168fc9 | C++ | bonfa/ACTR_Cpp_VisualModule | /BaseClass/src/utils.h | UTF-8 | 1,504 | 2.703125 | 3 | [] | no_license | /*
* utils.h
*
* Created on: 02/nov/2012
* Author: enrico
*/
#ifndef UTILS_H_
#define UTILS_H_
#define MAX_X 1
#define MAX_Y 2
#define MIN_X 3
#define MIN_Y 4
#define EPSILON 0.00001
#include <opencv/cv.h>
#include <vector>
#include <math.h>
#include <ios>
#include "MyPoint.h"
#include "StraightLine.h"
#... | true |
c3b57a1a84e15c5d92bf10e023a324d0c61bbaa8 | C++ | sergiobanegas/ShoppingList-cpp | /src/ItemProcessor.cpp | UTF-8 | 1,670 | 3.140625 | 3 | [] | no_license | /*
* ItemProcessor.cpp
*
* Created on: Dec 19, 2015
* Author: sergio
*/
#include "ItemProcessor.h"
ItemProcessor::ItemProcessor() {
this->items=NULL;
this->numberOfItems=0;
}
ItemProcessor::~ItemProcessor() {
for (int i=0;i<this->numberOfItems;i++){
delete this->items[i];
}
delete [] this->items;
}... | true |
53ed10fc56681895eccf30ba8b3590db41fabf77 | C++ | stevenGarciaDev/MessageQueue | /MessageQueue/ProbeA.cpp | UTF-8 | 3,223 | 2.78125 | 3 | [] | no_license | //
// ProbeA.cpp
// MessageQueue
//
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <cstring>
#include <iostream>
#include <unistd.h>
#include <sys/wait.h>
#include <cstdlib>
#include <limits>
#include <string>
#include <stdlib.h> /* srand, rand */
#include <time.h> ... | true |
09c33df91c8c720d220b8a32239f25a634bb5015 | C++ | Crayzero/LeetCodeProgramming | /Solutions/Path Sum II/main.cpp | UTF-8 | 2,180 | 3.546875 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x): val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
bool hasPathSum(TreeNode *root, int sum) {
if (root == NULL) {
return false;
... | true |
0d0d383fc174548e3a1c03715516e4ec28baeeb0 | C++ | Dhanush123/Lab6 | /inputValidation.cpp | UTF-8 | 1,060 | 3.421875 | 3 | [] | no_license | // Lab 6
// Programmer: Dhanush Patel
// Editor(s) used: Eclipse
// Compiler(s) used: Eclipse
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
#include <cmath>
int main()
{
cout << "Programmer: Dhanush Patel" << endl;
cout << "Description: This program calculates a mortgage given a p... | true |
287f0c1b39382cfac911b47b20711168b736135e | C++ | DanyFids/Business-of-Bandits | /BoB-FileHandler_CPP_CODE/BoB-FileHandler/Object.cpp | UTF-8 | 974 | 2.828125 | 3 | [] | no_license | #include "Object.h"
Object::Object(std::string i, std::string p, Transform t)
{
id = i;
prefab = p;
transform = t;
}
Object::Object(std::string i, std::string p, Vector3 pos, Vector3 rot, Vector3 siz)
{
id = i;
prefab = p;
transform = Transform(pos, rot, siz);
}
std::string Object::GetId()
{
return id;
}
std... | true |
bba3022c3beb81aac24872b7dde754d62dc49f99 | C++ | kevinawongw/CSCI1300-IntroToProgrammingCPP | /Homework/hmwk10EC/Program.cpp | UTF-8 | 2,866 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <vector>
#include <regex>
#include <algorithm>
#include "Program.h"
#include "Words.h"
using namespace std;
Program :: Program (){
}
void Program :: readVocabulary(string fileName){
st... | true |
6bb1d63ee43234acbb770403b304b889e2ba12d9 | C++ | possientis/Prog | /poly/DesignPatterns/Decorator/decorator.cpp | UTF-8 | 4,454 | 3.96875 | 4 | [] | no_license | // Decorator Design Pattern
#include <iostream>
#include <iomanip> // std::setprecision
#include <string>
#include <assert.h>
// interface or abstract class of components
class Pizza {
protected:
Pizza(){}
public:
virtual ~Pizza(){}
virtual std::string getDescription() const = 0;
virtual double g... | true |
e5c5ec13b024646349412132a0b0293c7215b0fb | C++ | iurisevero/Exercicios-PPC | /LeetCode/missingNumber.cpp | UTF-8 | 340 | 2.78125 | 3 | [] | no_license | class Solution {
public:
int missingNumber(vector<int>& nums) {
int actual_sum = 0, real_sum = 0;
for(int n : nums)
actual_sum += n;
int _size = nums.size();
real_sum = (_size % 2? _size * ((_size + 1) / 2) : (_size / 2) * (_size + 1));
return real_sum - ... | true |
0ec194b89723a15b5ffce0df23d8e80c21a6d7ef | C++ | Rohitm911/1BM17CS079_ADA | /lab10_dijkstra.cpp | UTF-8 | 1,375 | 3.03125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int getMinV(bool* visi, int* dist, int n){
int minV = -1;
for (int i = 0; i < n; i++){
if (!visi[i] && (minV == -1 || dist[i] < dist[minV]))
minV = i;
}
return minV;
}
void dijkstra(int** edges, int n){
bool visi[n];
int dist[n];
int... | true |
2de87f437b73ecef0c6c5d4c27f4956e426b9306 | C++ | Chandrika372/snapCode | /_submissions/18UEI056_Prashun/Day10/Evalute_exp.cpp | UTF-8 | 1,392 | 3.3125 | 3 | [] | no_license | /*bool isOperator(string a)
{ if(a=="+"||a=="*"||a=="-"||a=="/")
return true;
else
return false;
}
string opSum(string a,string b,string op)
{ int n1=stoi(a);
int n2=stoi(b);
// n1=max(n1,n2);
// n2=min(n1,n2);
if(op=="+")
return to_string(n1+n2);
if(op=="-")
return to_string(abs(n1-n2));
if(op=="*")
... | true |
3bc45f4f627a4311efde9f43f59cbd1502c1a5dd | C++ | fablab02/shipinlab_teensy | /gps_reader.cpp | UTF-8 | 3,611 | 2.75 | 3 | [] | no_license | #include "gps_reader.h"
#include "WProgram.h"
GpsReader::GpsReader()
:m_lastFix(0)
{
resetBuffer();
}
void GpsReader::resetBuffer(){
m_bufferIndLast = 0;
}
bool GpsReader::readChar(char c){
if(c == '$'){
Serial.printf("readChar $\n");
resetBuffer();
} else if(c == '\n'){
S... | true |
f039954f6c87dddb3077fecb6f891104f54312be | C++ | osamahatem/CompetitiveProgramming | /Codeforces/917A. The Monster.cpp | UTF-8 | 859 | 2.71875 | 3 | [] | no_license | /*
* 917A. The Monster.cpp
*
* Created on: Jan 29, 2018
* Author: Osama Hatem
*/
/*
Greedily try to always replace all '?' with ')', and swap them later as needed.
*/
#include <bits/stdtr1c++.h>
#include <ext/numeric>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("in.in", "r", stdin);
... | true |
f8ebad4d5fd38392ad0b2483b2db49364d90fbc7 | C++ | msrLi/portingSources | /ACE/ACE_wrappers/protocols/ace/INet/HTTP_Status.inl | UTF-8 | 1,155 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | // -*- C++ -*-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE
{
namespace HTTP
{
ACE_INLINE
void Status::set_status(Code status)
{
this->code_ = status;
}
ACE_INLINE
Status::Code Status::get_status() const
{
return this->code_;
}
ACE_INLINE
void S... | true |
b25a589785386ac066d89564dd21f56501f1c1eb | C++ | CDPS/Competitive-Programming | /UVA/10474 - Where is the Marble.cpp | UTF-8 | 920 | 2.890625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int a[1000000];
int binarySearch(int l, int h, int t){
while(l <= h){
int m = (l+h)/2;
if(a[ m] == t) return m;
else if( t < a[m]) h = m-1;
else l = m+1;
}
return -1;
}
//also solvable with lower_bound function
//just practic... | true |
a4a7501ba6c9d9062cc1c620368c4c45907a5ca4 | C++ | ShakilAhammed/OnlineJudge | /UVA OJ/12468.cpp | UTF-8 | 606 | 2.5625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
int a,b;
while(cin>>a>>b)
{
int diffChannel=0;
if(a==-1 || b==-1)break;
if((a==0 && b==99 )|| (a==99 && b==0))
{
diffChannel=1;
cout<<diffChannel<<endl;
}
else if((a-b)... | true |
beb3a5e2330c3f1699bcfb3710be4f1c5a0262a3 | C++ | devmichalek/Skipper | /Commands/cmd_rename.h | UTF-8 | 1,413 | 3.03125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "cmd.h"
class Command_Rename final : public Command
{
bool m_bEmpty;
bool m_bHelp;
bool m_bDirectory;
bool m_bRecursive;
bool m_bIgnore;
bool m_bOmit;
std::string m_sDirectory;
std::string m_sRegex;
std::string m_sNewName;
public:
explicit Command_Rename(std::vector<std::string> option... | true |
038c8b910a22c6ef60d39f57fc810e4a7fc77ea3 | C++ | xeon2007/LightSDK | /Source/Branch/MediaUICommon/Src/Include/AudioVolumeChangeHandler.h | UTF-8 | 1,095 | 2.609375 | 3 | [] | no_license | /*!
* @file AudioVolumeChangeHandler.h
*
* @brief This file defines class AudioVolumeChangeHandler, which defines functions for notification when
* volume is changed.
*
* Copyright (C) 2010, Toshiba Corporation.
*
* @author Li Hong
* @date 2011/03/08
*/
#ifdef __cplusplus
#ifndef _AUDIOVOLUMECAL... | true |
6a2b7fb78ff7f250bfd442b4de779d83984d85d1 | C++ | rikonor/smallstuff | /particle_tmp36/tmp36.h | UTF-8 | 727 | 2.984375 | 3 | [] | no_license | #ifndef TMP36_H
#define TMP36_H
const float tempSensorVoltageDivider = 4095.0;
const float tempSensorReferenceVoltage = 3.3;
const float tempSensorOffsetVoltage = 0.5;
class TMP36TemperatureSensor {
public:
TMP36TemperatureSensor(int sensorPin);
float temperatureCelcius();
private:
int tempSensorPin;
};
TMP36... | true |
b3a8e71d566601507ff5398a8055c159ab942bd0 | C++ | gkishard-workingboy/Algorithm-challenger | /kuangbin专题/专题一_简单搜索/POJ-3087.cc | UTF-8 | 1,144 | 2.71875 | 3 | [
"MIT"
] | permissive | /*
* Author : OFShare
* E-mail : OFShare@outlook.com
* Created Time : 2020-02-05 18:25:20 PM
* File Name : POJ-3087.cc
*/
#include <iostream>
#include <queue>
#include <set>
#include <cstring>
#include <string>
void debug() {
#ifdef Acui
freopen("data.in", "r", stdin);
freopen("data.out", ... | true |
6d1437851b3526f80435ac93af67e0eefa451350 | C++ | TarekHasan011/Problem-Solving | /CodeForces/754B/31591104_AC_31ms_8kB.cpp | UTF-8 | 1,951 | 2.796875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
const int INF = 0x7f7f7f7f;
char arr[4][4];
bool valid(int i, int j)
{
return i>=0 && i<4 && j>=0 && j<4;
}
bool win()
{
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
if(arr[i][j]=='x')
{
int first_i = i; ... | true |
21c639ef3b4e45cd2462a1ee9dde5085a080965e | C++ | distroman/code | /search-rotated.cpp | UTF-8 | 970 | 3.640625 | 4 | [] | no_license | //https://leetcode.com/problems/search-in-rotated-sorted-array/
class Solution {
public:
int searcher(vector<int>& nums, int beg, int end, int target) {
if(beg > end)
return -1;
if(beg == end)
return nums[beg] == target ? beg : -1;
int mid = (beg + end) / 2;
... | true |
a769bdf9f83c9ee81e38e806fef3faaa624f011a | C++ | jgarciapueyo/stoc | /src/AST/ASTPrinter.cpp | UTF-8 | 8,128 | 2.828125 | 3 | [] | no_license | //===- src/AST/ASTPrinter.cpp - Implementation of a printer for AST -----------------*- C++ -*-===//
//
//===------------------------------------------------------------------------------------------===//
//
// This file implements the ASTPrinter class.
// It prints the AST in a pretty way with information about every ... | true |
f37c5127f544d06fb1c62830943d53eaea6886ab | C++ | maverick-zhang/Algorithms-Leetcode | /leetcode_day5/Q131_partition_palindrome.h | UTF-8 | 1,481 | 3.46875 | 3 | [] | no_license | //
// Created by maverick on 2020/1/6.
//
#ifndef ALGORITHMS_Q131_PARTITION_PALINDROME_H
#define ALGORITHMS_Q131_PARTITION_PALINDROME_H
//给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串。
//
//返回 s 所有可能的分割方案。
//输入: "aab"
//输出:
//[
//["aa","b"],
//["a","a","b"]
//]
#include <vector>
#include <string>
using namespace std;
//回溯法
c... | true |
5c241b7aba3765669081f06746823760d5882077 | C++ | Accacio/matcg | /src/matcg.cpp | UTF-8 | 1,063 | 2.671875 | 3 | [] | no_license | #include <game.hpp>
#include <cemetery.hpp>
#include <card.hpp>
#include <monster.hpp>
#include <player.hpp>
#include <deck.hpp>
#include <vector>
#include <iostream>
int main(int argc, char *argv[]) {
Monster guerreiro2("guerreiro2", 2, 4, 0);
Monster goblin("goblin", 1, 1);
Monster guerreiro3("guerreiro3", 2,... | true |
6d1929f6172598639ed3b4c9a273970eab3b0f4e | C++ | amarjotgill/Vector-Explainer | /tempCodeRunnerFile.cpp | UTF-8 | 18 | 2.515625 | 3 | [] | no_license | Nathenael Dereb on 2/8/21. | true |
286a2e61a06838ab0a6e3051f50ee7b119711fe7 | C++ | sniper0110/image_processing_GUI | /functions.cpp | UTF-8 | 6,721 | 2.890625 | 3 | [] | no_license | #include "functions.h"
void salt(cv::Mat &image, int n) {
for (int k=0; k<n; k++) {
// rand() is the MFC random number generator
// try qrand() with Qt
int i= rand()%image.cols;
int j= rand()%image.rows;
if (image.channels() == 1) { // gray-level image
image.at<uchar>(j,i)= 255;
}... | true |
3d593e21bf7383c1842f25669aa001af1a327a78 | C++ | ddayzzz/algorithm-and-basic-apps | /data-structure/03.Sort/Node.h | GB18030 | 5,277 | 3.390625 | 3 | [] | no_license | #pragma once
#include "../stdafx.h"
#include <stdexcept>
#include <initializer_list>
template<typename T> struct Node
{
template<typename X> Node(X e):pdata(e){}
T pdata;
Node *next=nullptr;
Node *operator++(int) { return next; }
Node *operator++() { return next; }
};
template<typename T> class List
{
public:
t... | true |
bb213ffd2f43b4cc70b96a589a46500033b954ee | C++ | ssraghuvanshi/FP_AOA_CodeToFlowchart | /test_case/Test Cases/testcase18.cpp | UTF-8 | 642 | 3 | 3 | [] | no_license | int input;
int i=30;
int j=10;
cout << "enter number :";
cin >> input;
if (input > 10){
while(j < 20){
if( i < j){
cout << "What is this";
}
cout << "Hello";
cout << "No";
}
cout << "Added";
while( i < 5){
cout << "Still smaller than 5";
}
co... | true |
0b28bce40986cb54d1f4f78b15aa575450461753 | C++ | hope-kim/Course3 | /pa1/zombies.cpp | UTF-8 | 3,750 | 3.5 | 4 | [] | no_license | /********************************************************
* CS 103 Zombie-pocalypse PA
* Name: Hope Kim
* USC email: hopekim@usc.edu
* Comments (you want us to know):
* Runs similuations that determine the average, minimum,
* and maximum # of nights that it will take for a
* zombie-pocalypse to take ove... | true |
b315d0dd647c508247b62b88c9c58fef3d53d681 | C++ | HTBalazs/raylite | /src/Plane.cpp | UTF-8 | 1,949 | 2.53125 | 3 | [] | no_license | /*
Copyright 2016-2017 Balazs Toth
This file is part of Raylite.
Raylite is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) ... | true |
5b0a335ecc6fe9d69f11000cbcc0d8d8dab0762f | C++ | zach-pike/BrainFuckInterpreter | /src/main.cpp | UTF-8 | 2,062 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <algorithm>
#include "Interp.hpp"
#include "argparse.hpp"
std::string LoadStringFromFile(const char* filename) {
std::stringstream ss;
ss << std::ifstream(filename).rdbuf();
return ss.str();
}
template <typename T>
... | true |
f58f600474dbef2bc79040e164fb2138c209f560 | C++ | wenjing219/Cpp-How-To-Program-9E | /Chapter09/exercises/9.05/Complex.h | UTF-8 | 1,158 | 3.15625 | 3 | [] | no_license | /*
* =====================================================================================
*
* Filename: Complex.h
*
* Description: Exercise 9.05 - Complex Class
* Complex number class representation
*
* Version: 1.0
* Created: 09/06/16 14:20:47
* Revision: n... | true |
5bffcb84940ee037e266f955e0c1b526484773f0 | C++ | manishrdmishra/Code | /programming_contest/12th-week/treasure_hunt.cpp | UTF-8 | 21,855 | 2.921875 | 3 | [] | no_license | #include<iostream>
#include<cmath>
#include<vector>
#include <stdio.h>
#include <iostream>
#include <math.h>
#include<cstring>
// http://www.softwareandfinance.com/CPP/Matrix_Inverse.html
using namespace std;
const int POINTS = 9;
struct Point
{
double x;
double y;
double z;
Point( double x_ , double y_... | true |
c4304ad14b247eb5d079d233e83aebe08fe7d1dc | C++ | BITERP/PinkRabbitMQ | /src/amqpcpp/linux_tcp/tcpparent.h | UTF-8 | 2,211 | 2.75 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | /**
* TcpParent.h
*
* Interface to be implemented by the parent of a tcp-state. This is
* an _internal_ interface that is not relevant for user-space applications.
*
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
* @copyright 2018 - 2021 Copernica BV
*/
/**
* Include guard
*/
#pragma once
... | true |
5a713afa43f8be634da3d94b63af06ecfea3f0d3 | C++ | deskata666/UPupr | /Upr3_5.cpp | UTF-8 | 532 | 3.34375 | 3 | [
"MIT"
] | permissive | #include<iostream>
using namespace std;
int main()
{
int array[20], length,value;
cout << "Length of the array: ";
cin >> length;
for (int i = 0; i < length; i++)
{
cout << "array[" << i + 1 << "]= ";
cin>>array[i];
}
for (int i = 1; i < length ; i++)
{
value = array[i];
int j = i - 1;
while ((j >= 0)... | true |
bf624daf23fb3e186b81f553fd483dd5535e9da4 | C++ | kyabe2718/sandbox_coroutine | /include/coro/utility/concepts.hpp | UTF-8 | 3,050 | 3.109375 | 3 | [] | no_license | #pragma once
#if __has_include(<coroutine>)
#include <coroutine>
#elif __has_include(<experimental/coroutine>)
#include <experimental/coroutine>
namespace std {
using namespace std::experimental;
}
#else
#error cannot include a header for coroutine
#endif
#include "type_traits.hpp"
namespace coro {
template<typenam... | true |
95aa51c66aa145ebd2fa8ae8946502474b77a852 | C++ | UTNuclearRoboticsPublic/temoto2 | /temoto_2/src/tools/broken_node_1.cpp | UTF-8 | 662 | 2.84375 | 3 | [
"BSD-3-Clause"
] | permissive | #include "ros/ros.h"
#include <vector>
int main(int argc, char **argv)
{
ros::init(argc, argv, "language_input");
ros::NodeHandle nh;
int n = 3;
std::vector<int> test_vec(n);
try
{
// Access the vector by index and deliberately
// try to access values out of the size range
... | true |
37f285198a8f160806b54ed20c5097fafafa0905 | C++ | mousse2cell/SimulationPlus4000 | /Simul/Triangle.cpp | UTF-8 | 3,905 | 2.8125 | 3 | [] | no_license | /*
* Triangle.cpp
*
* Created on: 8 févr. 2012
* Author: mobilette
*/
#include "Triangle.h"
#include "Arete.h"
#include "CentreFace.h"
#include "Sommet.h"
#include "Segment.h"
#include "Ligne.h"
Triangle::Triangle() {
// TODO Auto-generated constructor stub
}
Triangle::Triangle(int id):ID(id){
}
Triang... | true |
8bebc031b53337e80c5b7885a3c590525bfa4bd7 | C++ | GIBIS-UNIFESP/BIAL | /bial/inc/Adjacency.hpp | UTF-8 | 4,729 | 2.96875 | 3 | [] | no_license | /* Biomedical Image Analysis Library
* See README file in the root instalation directory for more information.
*/
/**
* @date 2012/Jul/05
* @brief Adjacency relation to be used over an image or matrix.
*/
#include "Common.hpp"
#include "Matrix.hpp"
#include "Vector.hpp"
#ifndef BIALADJACENCY_H
#define BIALADJ... | true |
c47c2aa96721250a72810da81556baab2bbc8eac | C++ | mutexre/SceneGraph | /SceneGraph/Object.cpp | UTF-8 | 726 | 2.5625 | 3 | [] | no_license | //
// Created by mutexre on 22/10/15.
// Copyright © 2015 mutexre. All rights reserved.
//
#include <SceneGraph/SceneGraph.hpp>
using namespace SG;
using namespace std;
using namespace glm;
Object::Object() : name("")
{}
Object::Object(const string& name) : name(name)
{}
Object::Object(string&& name) : name(move... | true |
f7969886792f9b8e41a4aa53e71e4daf7330c262 | C++ | peterwzhang/DCP-Solutions | /solutions/011/Peter/main.cpp | UTF-8 | 735 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <set>
#include <vector>
using namespace std;
// O(nk) n = size of set, k = length of s
vector<string> return_autocomplete(set<string> set, string s) {
auto start = set.upper_bound(s);
if (start == set.end()) return {};
vector<string> ans;
for (auto it = start; it != set.end... | true |
90391eb9906ecbaf505cdd993eb34db09cc66635 | C++ | lineCode/darcel | /library/source/syntax_tests/literal_expression_tester.cpp | UTF-8 | 375 | 2.625 | 3 | [
"MIT"
] | permissive | #include <catch.hpp>
#include "darcel/syntax/literal_expression.hpp"
using namespace darcel;
using namespace std;
TEST_CASE("test_literal_expression", "[LiteralExpression]") {
LiteralExpression e(Location::global(), *parse_literal("3.1415"));
REQUIRE(e.get_literal().get_value() == "3.1415");
REQUIRE(*e.get_lite... | true |
e4a17111a0466e543c39831cdc5db0ab63ce94f1 | C++ | rane1700/ex4 | /DriverData.cpp | UTF-8 | 307 | 2.53125 | 3 | [] | no_license | //
// Created by ran on 01/01/17.
//
#include "DriverData.h"
DriverData::DriverData(int id,Node* loc) {
driverId = id;
location = loc;
}
DriverData::~DriverData(){
delete location;
}
int DriverData::getDriverId() {
return driverId;
}
Node* DriverData::getLocation() {
return location;
} | true |
a992b1813685e7782053814a524284ee3c9e3325 | C++ | deltj/advent_of_code_2020 | /day3/part1.cpp | UTF-8 | 1,767 | 3.5 | 4 | [
"MIT"
] | permissive | /**
* Given a map describing the locations of trees (#), identify the number of
* trees encountered by traversing a path from the top-left to the bottom right
* with a slope of -1/3.
*/
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <vector>
#include <sstream>
#include <opencv2/core.hpp>
void... | true |
6a0a31caff107f7a51b7210ee5f307eb476c8007 | C++ | YgorCruz/Listas-de-C | /Lista 04/Ex15.cpp | ISO-8859-1 | 279 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
main(){
int num;
float h=0;
setlocale(LC_ALL,"Portuguese");
printf("Digite um nmero : ");
scanf("%i",&num);
for(int cont = 1; cont <= num; cont ++){
h+=(float)1/(cont);
}
printf("O valor de H %.2f",h);
}
| true |
7c66636ee4bc7bbce5afdcc5e8ad8fd6e1308daa | C++ | Murami/rtype | /Server/include/Util/Vec2.hh | UTF-8 | 752 | 3 | 3 | [] | no_license | #ifndef UTIL_VEC2
#define UTIL_VEC2
namespace Util
{
class Vec2
{
public:
float x;
float y;
public:
Vec2();
Vec2(const Vec2& vec);
Vec2(float p_x, float p_y);
~Vec2();
const Vec2& operator=(const Vec2& vec);
const Vec2& operator+=(const Vec2& vec);
const Vec2& operator-=(c... | true |
158be6ac19ea3aff6cfa76cbb3a1f25cc39c9fa6 | C++ | nicomatex/taller_argentum | /client/engine/components/position_component.h | UTF-8 | 1,289 | 3.328125 | 3 | [] | no_license | #ifndef POSITION_COMPONENT_H
#define POSITION_COMPONENT_H
#include <mutex>
#include "../ECS/component.h"
#include "../SDL/sdl_timer.h"
/**
* @brief Componente de posicion. Usada en NPCs y jugadores.
*
*/
class PositionComponent : public Component {
private:
int x;
int y;
std::mutex m;
/* Indi... | true |
e4c8ac4f5e324d8d175432bff401eb4b164c31cc | C++ | tituswinters/hmc-clinic-examples | /auto/ex5.cc | UTF-8 | 172 | 2.8125 | 3 | [] | no_license | #include <map>
void f() {
std::map<int, int> some_map;
int count = 0;
for (const std::pair<int, int> item : some_map) {
count += item.first + item.second;
}
}
| true |
ccc8499f49433794f72d3806acb0317573a04f9a | C++ | pratyushvatsalshukla/CodeForces | /A. In Search of an Easy Problem.cpp | UTF-8 | 310 | 2.53125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std ;
int main(){
int n ;
cin >> n ;
int arr[n] ;
for(int i = 0 ; i < n ; i++)
{
cin >> arr[i] ;
}
sort(arr,arr+n) ;
// for(int i = 0 ; i < n ; i++)
// {
// cout << arr[i] ;
// }
if(arr[n-1] == 1)
{
cout << "HARD" ;
}
else
{
cout << "EASY" ;
}
}
| true |
cb3ec0508e29dce47cb05aebfdf1497876b961fb | C++ | someoneAlready/ZZU | /personal/contest1/F.cpp | UTF-8 | 618 | 2.53125 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
typedef long long ll;
struct P{
ll x, y;
P(){}
P(ll x, ll y):x(x),y(y){}
P operator + (const P&p)const{
r... | true |
ea1f8b54b0dc7e97085873a821540afcf5d62c92 | C++ | Sunil2120/Coding_questions | /geeks_for_geeks/binary_trees/diagonal_view.cpp | UTF-8 | 680 | 3.328125 | 3 | [] | no_license |
// diagonal view
// same as top view,left view,bottom view,right view
// only difference is when we go left increament and when we go right do nothing.
void solve(Node* root,int d,map<int,vector<int>>& hash)
{
if(root==NULL)
{
return ;
}
hash[d].push_back(root->data);
//left
solve(root-... | true |
9a32ad615565db55c1fa223938c0b76e69a4aa38 | C++ | yangjietadie/db | /mysql/MySQLConn.hpp | UTF-8 | 765 | 2.703125 | 3 | [] | no_license | /*
** Copyright (C) 2015 Wang Yaofu
** All rights reserved.
**
**Author:Wang Yaofu voipman@qq.com
**Description: The header file of class MySQLConn.
*/
#pragma once
#include <string>
#include <mysql.h>
// START_NAMESPACE
class MySQLConn {
public:
enum Status {
OK,
FAILED
};
struct Options... | true |
c443f83ec66c82380dbf9fc3cf4bfdac5838ab65 | C++ | paweldata/Technologie-sieciowe | /lista3/zad2/src/Frame.h | UTF-8 | 461 | 2.96875 | 3 | [] | no_license | #ifndef FRAME_H
#define FRAME_H
#include "Direction.h"
class Frame {
public:
Frame(int owner, Direction direction, bool collision);
int getOwner() const;
Direction getDirection() const;
bool ifCollision() const;
bool operator==(const Frame &frame) const {
return (frame.owner == this->own... | true |
4eae727d0cf40c2c640644975491b66890e56294 | C++ | Zcc/Algorithms | /Chap4_BinSearch/main.cpp | GB18030 | 842 | 3.859375 | 4 | [] | no_license | #include <iostream>
using namespace std;
//arrдfirstlocationlastlocationλünum
int BinSearch(const int arr[],int firstlocation,int lastlocation,const int num)
{
int mid = (firstlocation+lastlocation)/2;
if(firstlocation>lastlocation)
{
return -1;
}
if(num==arr[mid-1])
{
return mid;
}
if(num<arr[mid-1])
{
... | true |
51ac7a35c262f22c9de09fd8e9c6772ef3f6019f | C++ | PauloFer1/VisualAutomationWin7 | /VisualAutomation/Constants.cpp | UTF-8 | 2,658 | 2.796875 | 3 | [] | no_license | #include "stdafx.h"
#include "Constants.h"
Constants::Constants()
{
}
Constants::~Constants()
{
}
bool Constants::instanceFlag = false;
Constants* Constants::single = NULL;
Constants* Constants::getInstance(){
if (!instanceFlag)
{
single = new Constants();
instanceFlag = true;
return(single);
}
else
re... | true |
de4558a467ffa854d2a6217c9cb2b51863462c61 | C++ | rdzhao/LeetCode | /024SwapNodesInPairs/code.cpp | UTF-8 | 693 | 3.5625 | 4 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* swapPairs(ListNode* head) {
ListNode* fir = NULL;
ListNode* sec = NULL;
ListNode* thi = NULL;
ListNode* fou = NULL;
if (!... | true |
fbe26560a1d918d65bdc0090b90fe08c0118a1d5 | C++ | theshrewedshrew/BakerLabsC | /PROB#10.CPP | UTF-8 | 1,416 | 3.390625 | 3 | [] | no_license | // Program: Even
// By: Bryan J. Baker
#include <iostream.h>
#include <conio.h>
#include <iomanip.h>
#include <apstring.h>
//Const Section
//Var Section
int Hours;
apstring F_Name, L_Name, Address, Ssn;
char Answer;
double Cost;
void main()
{ clrscr();
cout<<setiosflags(ios::showpoint)<<s... | true |
613bfe703fb0e7b2aa4a170671151cd83df4e01b | C++ | zzzmfps/PAT | /Basic-Level-Practice/1005 继续(3n+1)猜想 (25).cc | UTF-8 | 1,205 | 3.109375 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
using namespace std;
static int x = []() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
return 0;
}();
class Solution
{
private:
// -1: temp important, 0: not mentioned yet, 1: not important
int marks[10000]{}; // may larger than 100... | true |
20e07461a0b7ead83b2d0ff4231ac038ee42858a | C++ | malavikarajeshvikraman/DS-basics | /Trees/Basics/traversals.cpp | UTF-8 | 2,023 | 4.15625 | 4 | [
"Apache-2.0"
] | permissive | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
using namespace std;
struct node
{
int data;
struct node* left;
struct node* right;
};
void inorder (struct node* root)
{
if(root==NULL)
return;
inorder(root->left);
cout<<root->data;
inorder(root->right);
}
void pr... | true |
01ab681d2cd1af09756889bbbc7e1b17bd91aa42 | C++ | daneshvar-amrollahi/JomeBazaar | /Shop.cpp | UTF-8 | 37,697 | 2.625 | 3 | [
"MIT"
] | permissive | #include "Shop.hpp"
#include "Admin.hpp"
#include "BadRequestException.hpp"
#include "PermissionDeniedException.hpp"
#include "NotFoundException.hpp"
#define ADMIN_EMAIL "admin@gmail.com"
#include "Product.hpp"
#include "Mobile.hpp"
#include "Car.hpp"
#include "Tv.hpp"
#include <iostream>
#include <fstream>
#include... | true |
4e75b65a32f950c61c83f28874f3278169fbdd72 | C++ | balintdbene/Chess | /Final/move.cc | UTF-8 | 1,083 | 3.296875 | 3 | [] | no_license | #include"move.h"
Move::Move(){ //constructor for move
start = " ";
end = " ";
capLocation = " ";
capType = ' ';
promotedTo = ' ';
thisHasMoved = false;
capturedHasMoved = false;
castling = false;
}
bool Move::operator==(const Move& other){ //equality overload
bool startSame = other.start == start;
bool... | true |
b15ad8ac51f4407d264726fefa6fb3e28983eab9 | C++ | adamtew/USU | /2014/CS1400/Challenges/Chapter 4/4.6_Change_for_a_Dollar_Games.cpp | UTF-8 | 1,365 | 4.0625 | 4 | [] | no_license | /*Create a change-counting game that asks the user to enter what coins to use to make
exactly one dollar. The program should ask the user to enter the number of pennies,
nickels, dimes, and quarters. If the total value of the coins entered is equal
to on dollar, the program should congratulate the user for winning the ... | true |
74ab9ef523692f944b14fd64462f77e4ecf08497 | C++ | marciz1/Analyzing-the-intensity-of-road-traffic | /functions.cpp | UTF-8 | 5,681 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "functions.h"
void on_trackbar_blur(int alpha_slider, void* param) {
Parameters* p = (Parameters*)param;
p->medianImage.copyTo(p->blurImage);
alpha_slider = alpha_slider + 1;
blur(p->blurImage, p->blurImage, Size(alpha_slider, alpha_slider));
//imshow("blurImage", p->blurImage);
}
void on_tr... | true |
bacef95eeff395e30ce6dad4b9566a9c53cc7ee4 | C++ | lsils/mockturtle | /test/networks/crossed.cpp | UTF-8 | 4,086 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <catch.hpp>
#include <mockturtle/algorithms/cleanup.hpp>
#include <mockturtle/networks/buffered.hpp>
#include <mockturtle/networks/crossed.hpp>
#include <mockturtle/networks/klut.hpp>
using namespace mockturtle;
TEST_CASE( "type traits", "[crossed]" )
{
CHECK( !is_crossed_network_type_v<klut_network> );
... | true |
76f785aabcf0e9a034494bfa76fc955e8edc74d9 | C++ | huangzsdy/my_code | /c++/stl/src/test_func_obj.cpp | UTF-8 | 1,185 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <set>
#include <iterator>
#include <algorithm>
using namespace std;
/*
* 1.函数对象,可以达到类似静态变量的功能,m_a,每次调用add都会累加
* 2.generate_n (iter,n,op),调用n次的op(),返回值赋给iter,且iter++
* 3.lambda 表达式,[]代表传参的作用域及传参的方式,()代表参数,-> 代表返回值
*/
class Sort1{
public:
Sort1(int a):m_a(a){... | true |
8d7c877e1f59650510ec832e7793b2da96a21470 | C++ | jstiefel/ThorlabsTDC_ROS | /src/CommunicationFunctions.cpp | UTF-8 | 17,617 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | //============================================================================
// Name : CommunicationFunctions.cpp
// Author : Julian Stiefel
// Version : 1.0.0
// Created on : 28.03.2018
// Copyright : BSD 3-Clause
// Description : Device communication class for Thorlabs stages with
// ... | true |
4fcf56bd1b81e32b2015e055faa861988ef72588 | C++ | FreeLike76/kpi_pa_3 | /Ant.cpp | UTF-8 | 380 | 2.546875 | 3 | [] | no_license | #include "Ant.h"
void Ant::calcAntPath(Graph& graph)
{
_pathLen = 0;
for (int i = 0; i < pathHist.size()-1; i++)
{
_pathLen += graph.adj[pathHist[i]][pathHist[i + 1]];
}
_pathLen += graph.adj[pathHist.back()][pathHist.front()];
}
int Ant::getPathLen()
{
return _pathLen;
}
void Ant::clearMemory()
{
_pathLen... | true |
5ab8cddc64ee40805f8ce3988baf1f2a10dc1074 | C++ | smhemel/Codeforces-Online-Judge | /Codeforces Round #206 (Div. 2) - A. Vasya and Digital Root/Codeforces Round #206 (Div. 2) - A. Vasya and Digital Root/main.cpp | UTF-8 | 438 | 2.640625 | 3 | [] | no_license | //
// main.cpp
// Codeforces Round #206 (Div. 2) - A. Vasya and Digital Root
//
// Created by S M HEMEL on 3/12/17.
// Copyright © 2017 Eastern University. All rights reserved.
//
#include <iostream>
using namespace std;
int main()
{
int k, d;
cin >> k >> d;
if (d == 0 && k > 1)
cout << "No sol... | true |
e7d34a8629e2b92255e2cce7df1440fa16c5c90d | C++ | Dimbelio/Programming-Principles-and-Practice-Using-C-by-Bjarne-Stroustrup- | /Visual Studio 2010/Projects/bjarneStroustrupC++PartIII/bjarneStroustrupC++PartIII/Chapter21TryThis6.cpp | WINDOWS-1252 | 1,554 | 3.28125 | 3 | [
"MIT"
] | permissive | /*
TITLE Iostream Iterators Chapter21TryThis6.cpp
"Bjarne Stroustrup "C++ Programming: Principles and Practice.""
COMMENT
Objective: Get the program from 21.7.2 to run and test with
small files of few hundred words.
Try (the not recommended) guessing of the input size,
potentially leading t... | true |
f617e83760efd7083eb5f85414eebdd8d9a9d3d7 | C++ | l19g2004/Computer-Vision | /Sheet01/src/sheet01.cpp | UTF-8 | 17,076 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <opencv2/opencv.hpp>
#include <math.h>
using namespace std;
using namespace cv;
int main(int argc, char** argv) {
// ==================== Load image =========================================
// Read the image file - bonn.png is of type CV_8UC3
... | true |
85abe58550750b27f8de18b50002d8919954fd35 | C++ | nazgob/sexp_cpp | /src/Func.hpp | UTF-8 | 878 | 2.578125 | 3 | [
"MIT"
] | permissive | #ifndef ADD_FUNC_H
#define ADD_FUNC_H
#include "Utils.hpp"
#include "Procedure.hpp"
#include "ValExp.hpp"
#include "EmptyListExp.hpp"
#include <string>
#include <stdexcept>
#include <boost/lexical_cast.hpp>
namespace sexp_cpp
{
class Context;
class Func : public Exp
{
public:
Func(pProc add) : mProc... | true |
8a8a219399d625e61d2d341aa63ea35fe8d3ee0b | C++ | stuckat1/CPP_Design_Patterns_and_Derivatives_Pricing | /ch04/Ex4.1_new_performance/Ex4.1_new_performance/Main.cpp | UTF-8 | 397 | 3.28125 | 3 | [] | no_license |
#include <iostream>
#include <time.h>
#include <cmath>
using namespace std;
int main()
{
clock_t t_start = clock();
double* ptr;
for (int i = 1; i < 8; i++)
{
int k = (int)pow(10, i);
for (int j = 0; j < 10000; j++)
{
ptr = new double[k];
delete[] ptr;
}
clock_t t_delta = clock() - t_start;... | true |
57d8484b0fc3bbbd128c68e2388ee0666fb74c23 | C++ | Bartlomiej-Kochutek/symulator-zycia-w-oceanie | /src/K_pozostale.h | WINDOWS-1250 | 14,821 | 2.96875 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include <fstream>
#include <math.h>
#include <limits>
#include <vector>
#include <iterator>
#include <stdlib.h>
#include <ctime>
#include <thread>
#include <SFML/Graphics.hpp>
//Funkcja pobierajca od uytkownika liczb z zadanego przedziau domknitego
unsigned int pobie... | true |
42cb40989af6e6582775c882789fb48f710ba7fa | C++ | apache/trafficserver | /lib/swoc/include/swoc/string_view_util.h | UTF-8 | 2,408 | 3.140625 | 3 | [
"TCL",
"LicenseRef-scancode-proprietary-license",
"BSD-3-Clause",
"LicenseRef-scancode-openssl",
"LicenseRef-scancode-ssleay-windows",
"ISC",
"OpenSSL",
"MIT",
"HPND",
"Apache-2.0",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain",
"Licen... | permissive | // SPDX-License-Identifier: Apache-2.0
// Copyright Apache Software Foundation 2019
/** @file
Additional handy utilities for @c string_view and hence also @c TextView.
*/
#pragma once
#include <bitset>
#include <iosfwd>
#include <memory.h>
#include <string>
#include <string_view>
#include <memory>
#include <limit... | true |
307b9b80f31237b9c295aaf15a7a938b64c9414d | C++ | jaybroker/dstore | /dstore/network/epoll.cpp | UTF-8 | 4,084 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "epoll.h"
#include <errno.h>
#include "errno_define.h"
#include "log.h"
#include "memory.h"
#include "event_loop.h"
using namespace dstore::common;
using namespace dstore::network;
EpollAPI::EpollAPI(EventLoop *lop)
: epfd_(0), events_(nullptr), loop_size_(0), loop_(lop)
{
}
EpollAPI::~EpollAPI()
{
dest... | true |
90b11940b8f9677290b90322628bb4962d0852b1 | C++ | ankitsharma1999/CPP | /1005B.cpp | UTF-8 | 620 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int solve(string, string);
int main()
{
string str1 = "", str2 = "";
cin >> str1;
cin >> str2;
cout << solve(str1, str2) << "\n";
}
int solve(string str1, string str2)
{
reverse(str1.begin(), str1.end());
reverse(str2.begin(), str2... | true |
beacae294e05db3a3bfd31b784a029ca651958dc | C++ | rickarkin/PyMesh-win | /tests/tools/Wires/Parameters/OffsetParameterTest.h | UTF-8 | 3,927 | 2.609375 | 3 | [] | no_license | /* This file is part of PyMesh. Copyright (c) 2015 by Qingnan Zhou */
#pragma once
#include <WireTest.h>
#include <Wires/Parameters/OffsetParameters.h>
#include <Wires/Parameters/ParameterCommon.h>
class OffsetParameterTest : public WireTest {
};
TEST_F(OffsetParameterTest, DefaultValue) {
WireNetwork::Ptr wire_... | true |
15918714212604e788ebe22f321b66af333c3db5 | C++ | lokeon-university/AAED | /TADS/Lista/ListaCircular.hpp | UTF-8 | 5,147 | 3.609375 | 4 | [] | no_license | #ifndef LISTA_CIRCULAR
#define LISTA_CIRCULAR
#include <cassert>
#include <cstdio>
#define POS_NULL NULL
template <typename T>
class ListaCir
{
struct nodo; // declaraci�n adelantada privada
public:
typedef nodo *posicion; // posici�n de un elemento
ListaCir(); ... | true |
91d301f854bfe84a5d2efd6c0528bb73a042b8b2 | C++ | fernandafallas/progra | /untitled/Professor.cpp | UTF-8 | 654 | 3.25 | 3 | [] | no_license | //
// Created by mafef on 11/08/2020.
//
#include "Professor.h"
Professor::Professor(){
this->salary = 0.0;
}
Professor::Professor(double salary) {
this->salary = salary;
}
Professor::Professor(const string& name, string& id, double ) : Person (name, id){
this->salary = salary;
}
do... | true |
6f817e7904676cd2188c4657b2583be01e934aa8 | C++ | brycelelbach/agency | /agency/execution/executor/concurrent_executor.hpp | UTF-8 | 5,127 | 2.84375 | 3 | [] | no_license | #pragma once
#include <agency/future.hpp>
#include <agency/execution/execution_categories.hpp>
#include <agency/detail/invoke.hpp>
#include <agency/detail/type_traits.hpp>
#include <thread>
#include <vector>
#include <memory>
#include <algorithm>
#include <utility>
namespace agency
{
class concurrent_executor
{
... | true |
7456d589608709abdd76db488f981cb1f9e3c046 | C++ | ProCodersfromIS/JiMP2-zad2 | /aghMatrix.h | WINDOWS-1250 | 14,714 | 3.5625 | 4 | [] | no_license | /**
* \file aghMatrix.h
* \author Kamil Dawidw & Beata Giebaga
* \date 15.5.2014
* \brief Szablon klasy aghMatrix, zadanie numer 2 na JiMP2, IS2014
*/
// ------------------------------------------------------
#ifndef AGHMATRIX_H
#define AGHMATRIX_H
// ---------------------
using namespace std;
// --------------------... | true |
41f36a8e476f67bb6292107170696fb6f1e2b10e | C++ | Speedclocker/StayInTheLight | /includes/game/Character.h | UTF-8 | 2,970 | 2.921875 | 3 | [] | no_license | #ifndef __CHARACTER_H__
#define __CHARACTER_H__
#include <SFML/Graphics.hpp>
#include <iostream>
#include <math.h>
#include "collision.h"
#include "Animation.h"
#include "Entity.h"
#define PI 3.14159
class Character;
// Class Attack
class Attack
{
public:
//Constructeurs et Destructeurs
Attack();
Attack... | true |
97440c4d2f2423ba593c49f96fccdce8b04fe4d0 | C++ | KevinHaoranZhang/Leetcode | /Sequence/q1-q99/q40-q49/q41/q41.cpp | UTF-8 | 1,550 | 3.21875 | 3 | [] | no_license | class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
// change elements that are less than 1 to 1//
// at the same time, check if 1 is in the array//
// if not, return 1;
int count = 0;
for (int i = 0; i < nums.size(); i++)... | true |