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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2300ece83238e0fe51a66dba443618b803e660e4 | C++ | BrandtArcaneAviator/ProjectEuler | /Problem61_CyclicFigurateNumbers/AlternativeMethods.cpp | UTF-8 | 4,607 | 3.0625 | 3 | [] | no_license | ///* For loops for polygonal values: */
//for (lint_t trin{ 45 }; trin <= 140; ++trin)
//{
// tempTri = calculatePolygonalValue(trin, PolygonalType::triangular);
// for (lint_t squaren{ 32 }; squaren <= 99; ++squaren)
// {
// tempSquare = calculatePolygonalValue(squaren, PolygonalType::square);
// if (chec... | true |
5a27618e30f5498a919fd7f522580d4fd6dca5d0 | C++ | hassanjallow/isis3 | /src/base/objs/ObliqueCylindrical/unitTest.cpp | UTF-8 | 5,155 | 2.6875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain"
] | permissive | #include <iostream>
#include <iomanip>
#include <cmath>
#include "iException.h"
#include "ObliqueCylindrical.h"
#include "ProjectionFactory.h"
#include "Preference.h"
using namespace std;
int main (int argc, char *argv[]) {
Isis::Preference::Preferences(true);
cout << "UNIT TEST FOR ObliqueCylindrical" << endl <<... | true |
540f05a90ab8b37e80f1484b6338f255fd75577f | C++ | FrolovNikolay/MathRedactor-PAKETA- | /MathRedactorPaketa/MathRedactorPaketa/WinPlotter/FormulaParser.cpp | UTF-8 | 13,142 | 3.0625 | 3 | [] | no_license | // Автор: Федюнин Валерий
#include "FormulaParser.h"
#include <assert.h>
#include <vector>
#include <set>
#include <algorithm>
namespace {
// возвращает размер пространства, в котором задается формула
int GetSpaceDimension( const std::vector<std::string>& equations )
{
if( equations.size() == 2 || ( equatio... | true |
bcadf9ada69d1d142f1a6d1faf7e9ea1b96fe665 | C++ | Pradnyan-ACM-Student-Chapter-DYPCOE/Contest-Solutions | /October Dawn 2020/Manasi's Algorithm/manasi_algo.cpp | UTF-8 | 542 | 2.890625 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int t;
cin>>t;
while(t--)
{
string s1, s2;
cin>>s1>>s2;
... | true |
a8245a74326df31705434bca814e409fdd6f5f53 | C++ | danorel/World-of-Cpp | /Swap/main.cpp | UTF-8 | 3,012 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <random>
using namespace std;
const int Counter = 8;
// functions
template <typename T>
void QuickSort(T, int, int);
template <typename T>
bool LookFor(T, int, int, int);
/*
template<typename T1, typename T2>
void Swap(T1 *t1, T2 *t2){
auto temp = *t1;
*t1 = *t2;
*t2 = temp;
};... | true |
eddba505e6180d2780bae6fd994e652cbd2b42ca | C++ | kdavison/ranbam | /source/engine/math/random/volume/ellipsoid.h | UTF-8 | 1,310 | 2.96875 | 3 | [] | no_license | #pragma once
#include "sphere.h"
#include <random>
#include <boost/math/constants/constants.hpp>
#include <tuple>
namespace ranbam::math::volume
{
class ellipsoid
{
public:
typedef std::tuple<float,float,float> result_type;
public:
ellipsoid(
const double min_a, const double min_b, const double min_c,
co... | true |
5831c708a756bd384ec19b6d8809e985a08ad0fb | C++ | suharto1980/C | /daimon my.cpp | UTF-8 | 412 | 2.84375 | 3 | [] | no_license | #include<stdio.h>
int main(){
int i,j,k;
for ( i=1;i<=5;i++)
{
for (k=1;k<=5-i;k++)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("* ");
}
printf("\n");
}
for(i=1;i<=5;i++)
{
for (k=1;k<i;k++)
{
printf(" ");
}
for ( j=5;j>=i;j--)
... | true |
492510d3f9d9409666fac6f162defd44674dac15 | C++ | haitaox/quora | /v7.cpp | UTF-8 | 5,561 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct event {
int id;
int time;
int score;
int height;
event() {}
event(int i, int t, int s, int h): id(i), time(t), score(s), height(h) {}
};
class idList {
public:
vector<int> v;
bool operator <(const idList& other) const {
... | true |
09ac30bce852a90fb4182a3f6fad6d9762a8389d | C++ | green-object/Course_work-Lab_3- | /activity.h | UTF-8 | 576 | 2.90625 | 3 | [] | no_license | #ifndef ACTIVITY_H
#define ACTIVITY_H
#include <QString>
//Базовый класс, достижение
class Activity
{
//Наименование
QString name;
//направление
QString trend;
public:
Activity();
//расчет итоговых баллов
virtual int calculateFinishBalls() const = 0;
virtual QString class... | true |
8fa7c03879f38fdbbbdafb3cc0e07a34a79a71c2 | C++ | GaleaStefan/puzzle-solver | /State.h | UTF-8 | 492 | 2.859375 | 3 | [] | no_license | #pragma once
#include <vector>
#include <string>
struct State
{
int gridSize;
int mDistance;
std::vector<int> tiles;
State();
State(int gridSize, std::vector<int> tiles);
State(const State& previous, int emptyMoveDirection);
bool isGoalState() const;
void calculateManhattanDistance();
int calculateInvers... | true |
9ee061c8b71962d1f6e9fda010ed279ae0b7d4e0 | C++ | frozenca/PPP-CPP | /src/18/18-1.cpp | UTF-8 | 375 | 3.171875 | 3 | [] | no_license | #include <cstddef>
#include <iostream>
char* strdup(const char* str) {
size_t len = 0;
const char* s = str;
while (*s) {
len++;
s++;
}
char* dst = new char[len + 1];
char* d = dst;
while ((*dst++ = *str++)) ;
return d;
}
int main() {
const char* str... | true |
8a13cc89eec8282db1850abb018a2bac532f321b | C++ | bencikpeter/HTWG_shark_cage | /Shark Cage/Shark Cage/Shark Cage.cpp | UTF-8 | 1,308 | 2.703125 | 3 | [] | no_license | // Shark Cage.cpp : Entry point for the program.
#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include "ProcessHandler.h"
// Start as LocalSystem
int main(int argc, char* argv[]) {
// Create CageService
ProcessHandler pc;
LPTSTR desktopName = L"desktopName";
LPTSTR appName = _tcsdup(TE... | true |
fb53a98d4dbab6230ce9837a6d0067ae8f83eef3 | C++ | brookejbarton/animation-toolkit | /libsrc/atkui/framework.h | UTF-8 | 1,475 | 2.515625 | 3 | [
"MIT"
] | permissive | #ifndef ATKUI_Framework_H_
#define ATKUI_Framework_H_
#include "atk/toolkit.h"
#include "agl/window.h"
#include "agl/aglm.h"
#include <vector>
namespace atkui {
enum Display { Orthographic, Perspective };
class Framework : public agl::Window {
public:
Framework(Display type, int width = 500, int height = 500);
... | true |
5f2593116c4df05fbff6b8ee4408682988848562 | C++ | zuselegacy/leetcode | /tree/662-max-width-tree.cpp | UTF-8 | 972 | 3.203125 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | true |
eeb5b2a5d136bfa3fa73913d04cc5f330468866f | C++ | xunilrj/sandbox | /courses/kth-distributed-algorithms-1/crtd/counter.005.cxx | UTF-8 | 3,028 | 3.6875 | 4 | [
"Apache-2.0"
] | permissive | #include <cassert>
#include <array>
#include <string>
#include <iostream>
#include <algorithm>
#include <numeric>
template<size_t N>
class Counter{
public:
Counter(size_t index):Index(index),
Increments(),
Decrements()
{
assert(index < N);
}
Coun... | true |
76a926c08856d7eb8bd5c70c812f648380b170df | C++ | Sitispeaks/turicreate | /src/toolkits/pattern_mining/fp_node.cpp | UTF-8 | 2,486 | 2.765625 | 3 | [
"BSD-3-Clause"
] | permissive | /* Copyright © 2017 Apple Inc. All rights reserved.
*
* Use of this source code is governed by a BSD-3-clause license that can
* be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
*/
#include <toolkits/pattern_mining/fp_node.hpp>
namespace turi {
namespace pattern_mining {
// FP-N... | true |
38543bd08b13c8198b4d8708e2ebe1af0f3d6721 | C++ | CaspianA1/S2CPP | /Std_Lib/Lists/lists.cpp | UTF-8 | 1,852 | 2.796875 | 3 | [] | no_license | #include <string>
#include <variant>
#include <regex>
#include <ostream>
#include <iostream>
#define print(var) std::cout << var << std::endl
#define print2(var, var2) std::cout << var << var2 << std::endl
#define SEXPRESSO_OPT_OUT_PIKESTYLE
#ifdef SEXPRESSO_OPT_OUT_PIKESTYLE
#ifndef SEXPRESSO_HEADER
#define SEXPRESSO... | true |
4f464bb68e7406b27ed4369af35a04533dc89286 | C++ | alu0100406122/SSI-RSA | /rsa.cpp | UTF-8 | 12,740 | 3.625 | 4 | [] | no_license | // Seguridad en Sistemas Informáticos.
// María Nayra Rodríguez Pérez.
#include <vector>
#include <stdlib.h>
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <istream>
#include <cmath>
using namespace std;
// Exponenciación Rápida.
double exponenciacion(int base, int exponente, int mod){
doub... | true |
99dc36fc57d13d8f43655fb471559ec873eded53 | C++ | ckdwns9121/Programing-assignment | /DiscreteMathematics2018/exam.cpp | UHC | 2,556 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <string>
#include <string.h>
#include <fstream>
using namespace std;
#pragma warning(disable:4996)
char Good_word[27]; //
char P_word[1001]; //
char Q_word[1001]; //Q
int func(int P_size, int Q_size, int G_size) {
int index = 0; // ? ġ Ž ε
int star_count = 0; //ִ ڿ ... | true |
28fc00c62632d6517d5c6564a1923017427ce991 | C++ | gui2one/wasm_cave_generator | /cpp/cave_generator.cpp | UTF-8 | 5,919 | 2.71875 | 3 | [] | no_license | #include "cave_generator.h"
#include "emscripten/bind.h"
#include <cstdlib>
#include <iostream>
#include <chrono>
// using namespace emscripten;
EMSCRIPTEN_KEEPALIVE
CaveGenerator::CaveGenerator()
{
m_seed = 0;
m_grid.setResX(32);
m_grid.setResY(32);
printf("--- C++ Cave Generator ---\n");
for (si... | true |
5c318b7d2b553e09aa411571bf42b4807ff21037 | C++ | fliphyyY/semestralkaAUS-2 | /SEM222/Hlavna.cpp | UTF-8 | 31,775 | 2.625 | 3 | [] | no_license | #include "Hlavna.h"
//komparatory,musia byt aj pre int aj pre double
// sluzia na rozhodovaniu quick sortu ci bude roztriedenie vzostupne alebo zostupne
// cize podla coho ma triedit udaje
int vzostupnyKomparator(TableItem<string,int> &a,TableItem<string,int> &b) {
if (a.getData() > b.getData()) { return -1; }... | true |
9b3f45a8100451e8335a213be96ea1dd2941a87a | C++ | Altudy/chang-rok | /Algorithm/swea/5293. 이진 문자열 복원.cpp | UTF-8 | 1,077 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
#include<stack>
#include<set>
#include<queue>
#include<map>
#include<string>
#include<cstdlib>
#include<limits.h>
#include<cstring>
#include<math.h>
#include<string.h>
using namespace std;
int T;
int A, B, C, D;
string res;
void solve(int a, int b, int c, int d,... | true |
5b4cb793508ea187a433b7db05a1186d6b458494 | C++ | cjlcarvalho/maratona | /URI/1276.cpp | UTF-8 | 948 | 2.703125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
int b, e;
bool letras[26];
string s;
while(getline(cin, s)){
vector<string> v;
memset(letras, false, sizeof(letras));
for(int i = 0; i<int(s.size()); i++){
if(isalpha(s[i]))
letras[s[i] - 97] ... | true |
b524708612aa2d5813ff0e87651cb02ce3dee0ae | C++ | dshipps/RadChipReleaseBin | /RadCli/CSE125/JSON_Parse.h | UTF-8 | 2,229 | 2.8125 | 3 | [] | no_license | #ifndef JSON_PARSE_H
#define JSON_PARSE_H
#include "rapidjson/document.h"
#include "rapidjson/filestream.h"
#include <stdio.h>
#include <iostream>
class JSON_Parser
{
public:
JSON_Parser(const char* FileName){
fopen_s(&pFile, FileName, "r");
rapidjson::FileStream is(pFile);
document.ParseStream<0>(is);
if (... | true |
ad9e264967225efed832ce7aeaec91114da5cbea | C++ | melihcicek/cpp-kursu-kodlar | /STL/optional/value_03.cpp | UTF-8 | 270 | 3.109375 | 3 | [] | no_license | #include <optional>
#include <iostream>
int main()
{
std::optional<int> opt = {};
try {
int ival = opt.value();
std::cout << "ival = " << ival << "\n";
}
catch (const std::bad_optional_access& e)
{
std::cout << "hata yakalandi : " << e.what() << '\n';
}
}
| true |
579e7e2ccf3f7833f3d5c767b50ae1b54c20c92f | C++ | ekaterin17/Leetcode | /22. Generate Parentheses.cpp | UTF-8 | 571 | 3.078125 | 3 | [] | no_license | class Solution {
public:
vector<string> parenthesis;
vector<string> generateParenthesis(int n) {
getParenthesis(n, 0, 0, "");
return parenthesis;
}
void getParenthesis(int n, int open, int close, string str) {
if (str.length() == 2*n) {
parenthesis.push_back... | true |
c3707b58231572d84fa0fccd59f65451e58a49b8 | C++ | joeyuan19/CodeEval | /moderate/cash_register_newtyn.cpp | UTF-8 | 1,888 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
void process(string line) {
int idx = line.find(";");
double pp, ch;
stringstream(line.substr(0,idx)) >> pp;
stringstream(line.substr(idx+1,line.size()-(idx+1))) >> ch;
int p = (int)(pp*100);
int c... | true |
7fa37a8e53a727881b049bbba855b6fb650ec879 | C++ | vstflugel/tinykactl | /test/tinystl/orig/10354.cpp | WINDOWS-1252 | 2,745 | 2.96875 | 3 | [] | no_license | /******************************************
*
* @JUDGE_ID: 25719RJ 10354 C++
*
* Problem 10354 "Avoiding the Boss"
*
* David Rydh, <f99-dry@nada.kth.se>
* POPUP Tvling 3 (Valladolid), 2002-09-13
*****************************************/
#include <iostream>
#include <cstdio>
#include <algorithm>
//#include <st... | true |
87f5b7cba74aaa6d689b2b17269857bfb7cd67af | C++ | mangopudding12/OpenFrameWorks_IAD2_PartTwo_2016 | /Nature_of_Code_oefeningen/Example_h4_3/src/Partical.cpp | UTF-8 | 609 | 2.96875 | 3 | [] | no_license | #include "Partical.h"
Partical::Partical(ofVec2f location_)
{
// Varible een waarde geven
accelaration.set(0, 0.05);
velocity.set(ofRandom(-1, 1), ofRandom(-2, 0));
location = location_;
lifespan = 255.0;
radius = 12;
}
void Partical::run()
{
move();
display();
}
void Partical::move()
{
velocity += accelar... | true |
fbf16bee83ab08e8bb99d41a11de9dcf4f453d67 | C++ | limengjie/leetcode | /cpp/51_2_3.cpp | UTF-8 | 1,651 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include "bin_tree.h"
using namespace std;
////only print
//void preorderTrav(TreeNode * root) {
// //base condition
// if (root == nullptr) return;
// //print root first
// cout << root->_val << " ";
// //print left subtree
// preorderTrav(root->_left);
// //print right subtree
// preorderTrav(ro... | true |
20cf5e7f5dc478acffba6f952bad6bdeec2be5e4 | C++ | kestoc/SisoperParcial2 | /sjf.h | UTF-8 | 3,943 | 3.5 | 4 | [] | no_license | /*
Algorithm: Shortest Job First (SJF)
Members:
- Santiago Collantes Zuluaga
- Kevin Steven Ocampo M.
*/
#include<bits/stdc++.h>
#include <thread>
using namespace std;
struct process3{
int pid; //ID process
int at; //Arrival Time
int bt; //Burst Time
};
// Function to sort the proc... | true |
44678db98662d01d7b03a86997be18e4a6370c46 | C++ | mhotwagner/weather-server | /srv/srv.ino | UTF-8 | 2,687 | 2.625 | 3 | [] | no_license | #include <ESP8266WiFi.h>
#include <SimpleDHT.h>
#include <ESP8266WebServer.h>
const int dhtPin = D5;
// sensor info
SimpleDHT22 dhtSensor(dhtPin);
const int dhtSampleFrequency= 5000;
unsigned long dhtLastSampleTime = 0;
byte temperature = 0;
byte humidity = 0;
// wifi info
const char* wifi_ssid = "Hotswag Manor";
co... | true |
fa1a347303e326dfd39fd9ce031823b67885f1a1 | C++ | sommars/DEMiCs | /polySys/polyGen/prism.cpp | UTF-8 | 2,249 | 2.890625 | 3 | [] | no_license | //////////////////////////// probGenerate.cpp ////////////////////////////
#include <fstream>
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
void outData1(int xDim, int height);
int main (int argc, char* argv[])
{
int i, xDim, height;
if ... | true |
02bf7ccf63cf00d8d00a09277c46bc22010f4068 | C++ | presscad/cib | /demo/client-calls/client/main.cpp | UTF-8 | 343 | 2.828125 | 3 | [
"MIT"
] | permissive | #include "A.h"
#include <iostream>
void TestClientCallingLibrary(A* pA)
{
std::cout << "a.F() returned " << pA->F() << std::endl;
std::cout << "a.F(5) returned " << pA->F(5) << std::endl;
std::cout << "a.V() returned " << pA->V() << std::endl;
}
int main(int argc, char* argv[])
{
A a;
TestClientCallingLibr... | true |
ced4ad00b56b15f2ef6415b1a7c3adf458646847 | C++ | Avdeenko-Dasha/1-cours | /Option 6/8.1/Vector.h | UTF-8 | 2,553 | 3.6875 | 4 | [] | no_license | #pragma once
template<typename T>
class Vector
{
int size;
T* arr;
public:
Vector();
Vector(int n);
Vector(int n, T value);
Vector(const Vector& other);
int Size();
void resize(int n);
void random();
void push_back(int value);
void pop_back();
void clear();
T& operator[] (int n);
const T& operator[] (i... | true |
cb78c01da61d2a2b3aea1f66df080bffd4030642 | C++ | licarijd/udemy-advanced-cpp | /4. Operator Overloading/c. Complex Number Class/Complex.h | UTF-8 | 792 | 3.015625 | 3 | [] | no_license | #ifndef COMPLEX_H_
#define COMPLEX_H_
#include <iostream>
using namespace std;
namespace justinlicari {
class Complex {
private:
double real;
double imaginary;
public:
Complex();
Complex(double real, double imaginary);
Complex(const Complex &other);
const Com... | true |
d1ec14b0260a30691a0dbfd1b4ddbcb6856f333b | C++ | yuehuhu/POJ-dynamic-programming | /POJ3624 Charm Bracelet3.cpp | GB18030 | 581 | 2.671875 | 3 | [] | no_license | //ʹö̬滮һά飬emmmmmacceptˣ
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int N, M;
int w[3500], d[3500];
int dp[12888];
int S = 0;
void solve()
{
for (int i = 0; i < N; i++)
{
for (int j = M; j >= 0; j--)
{
if (w[i] <= j)
{
dp[j] = max(dp[j], dp[j - w[i]] ... | true |
9afb9ffecfa63e9cf16f0640dc44b34c62967138 | C++ | orel1108/hackerrank | /practice/cpp/classes/class_template_specialisation.cpp | UTF-8 | 675 | 2.890625 | 3 | [] | no_license | template<>
struct Traits<Color>
{
static string name(int i_idx)
{
if (i_idx == 0)
{
return "red";
}
if (i_idx == 1)
{
return "green";
}
if (i_idx == 2)
{
return "orange";
}
return "unk... | true |
4cac3f0551b6ccea9f3f0163e21a1dfba1ca4eca | C++ | splinterofchaos/Gravity-Battle | /Config.h | UTF-8 | 810 | 2.921875 | 3 | [] | no_license |
#include <string>
#include <map>
#include <fstream>
class Config
{
//static std::ofstream out;
void set_defaults();
public:
typedef std::map< std::string, std::string > Vars;
Vars vars;
Config( const std::string& filename );
Config();
bool reload( const std::string& filename );
... | true |
46d8c47a077dabf4433fd26401aa8ceab48d80b7 | C++ | iridium-browser/iridium-browser | /buildtools/third_party/libc++/trunk/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp | UTF-8 | 5,409 | 2.890625 | 3 | [
"BSD-3-Clause",
"NCSA",
"MIT",
"LLVM-exception",
"Apache-2.0"
] | permissive | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | true |
6723c3d376a30c128d058f5d71966bbb0f1ebafa | C++ | steprevolution/stepmaniax-sdk | /sdk/Windows/SMXPanelAnimation.cpp | UTF-8 | 17,167 | 2.640625 | 3 | [
"MIT"
] | permissive | // Handle playing GIF animations from inside SMXConfig.
//
// This can load two GIF animations, one for when panels are released
// and one for when they're pressed, and play them automatically on the
// pad in the background. Applications that control lights can do more
// sophisticated things with the lights, but th... | true |
90f5429644e77c8595f3a07dfe45d34a2db6cb30 | C++ | Dawid-Kaluzny/HomeBudget | /Finance.h | UTF-8 | 747 | 3.03125 | 3 | [] | no_license | #ifndef FINANCE_H
#define FINANCE_H
#include <cstdlib>
#include <iostream>
using namespace std;
class Finance {
int userId;
int date;
string item;
float amount;
public:
Finance(int userId = 0, int date = 0, string item = "", float amount = 0.0) {
this -> userId = userId;
this -> ... | true |
288e47e06115d509f7813fe3aecbf5e3c99c880d | C++ | notsocertain/PasswordManager | /projectOOP/include/newUser.h | UTF-8 | 1,088 | 2.703125 | 3 | [] | no_license | #ifndef NEWUSER_H
#define NEWUSER_H
#include <SFML/Graphics.hpp>
#include<string>
#define maxoption 2
using namespace sf;
class newUser
{
public:
void moveDown();
void moveUp();
int option()
{
return optionSelected;
}
newUser(float width,float height);
void draw_new... | true |
a2191459f468d8b356b3046f0522eea351716346 | C++ | jjocram/sydevs | /src/sydevs/systems/interactive_system.h | UTF-8 | 8,460 | 2.71875 | 3 | [
"BSL-1.0",
"Apache-2.0"
] | permissive | #pragma once
#ifndef SYDEVS_SYSTEMS_INTERACTIVE_SYSTEM_H_
#define SYDEVS_SYSTEMS_INTERACTIVE_SYSTEM_H_
#include <sydevs/systems/collection_node.h>
namespace sydevs {
namespace systems {
/**
* @brief A base class template for all interactive closed system nodes intended
* to be used at the highest level of ... | true |
7e0bd0eb4a5ee1c70d81d3d80e7fb3a23a922f07 | C++ | TenFifteen/SummerCamp | /lbc_leetcode/331-verify-preorder-serialization-of-a-binary-tree.cc | UTF-8 | 2,480 | 3.609375 | 4 | [] | no_license | /*
题目大意:
问一个字符串是否是一个二叉树的先序遍历的序列化的结果。
解题思路:
只是一个普通的二叉树,所以不需要比较各节点直接的大小,只是判断是否是一棵完整的二叉树即可。
我就是利用的当前有多少个空余的link来计算是否合理。如果当前是一个#,则说明link减一;
如果当前是一个数字,表示link加一
遇到的问题:
没有太大问题。
再次阅读:
看了一下DISCUSS,感觉这种解法已经算是不错的解法了。
*/
class Solution {
private:
vector<string> split(const string &str) {
stringstream ss(str);
... | true |
01f6d9536389b630f74ffea613f98d1b7c389d2c | C++ | leand-santos/Judge | /uri/1026.cpp | UTF-8 | 498 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <math.h>
// status: Accepted
// problem type: AD-HOC
using namespace std;
int main() {
long long int a, b;
while (scanf("%lld %lld", &a, &b) != EOF) {
long long int n = 0, result = 0;
while (a != 0 || b != 0) {
if ((a % 2 == 1 && b % 2 == 0) || (a % 2 =... | true |
3a1af25850ee8bfbbef6d85b636b7097b6db67b1 | C++ | Goldiorl/OJCodingPractice | /3Sum.cpp | UTF-8 | 1,146 | 3.234375 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<iterator>
#include<cmath>
#include<climits>
#include<map>
using namespace std;
class Solution {
public:
vector<vector<int> > threeSum(vector<int> &num) {
vector<vector<int> > result;
if(num.size()<3) return result;
sort(num.begin(), num.end());
/... | true |
4d33c3d4adae7717fcfe9b430d930e197cb1d30b | C++ | Fahroni/YRpp | /YRMathVector.h | UTF-8 | 4,078 | 3.46875 | 3 | [] | no_license | //pd's Vector classes (math sense)
#ifndef VECTOR_H
#define VECTOR_H
#include <math.h>
/*==========================================
============ 2D Vector =====================
==========================================*/
template <typename T> class Vector2D
{
public:
static const Vector2D Empty;
//no constructor... | true |
43bf895397172051e90627ab289c64bb200d750a | C++ | Huimintai/algorithm | /myC++/calculateScore.cpp | UTF-8 | 629 | 3.15625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int calculateScore(int* score, int* judgeType, int n)
{
int judge1 = 0;
int score1 = 0;
int judge2 = 0;
int score2 = 0;
int finScore = 0;
for(int i=0; i<n; i++)
{
if(judgeType[i] == 1)
{
score1 = score1 + score[i];
judge1 ++;
}
else
{
score2 = score2 +... | true |
d71ea44980f0fb0812f86ed295fd5a8d1c172490 | C++ | Cookiefan/ZigZag | /Template/1 Math/EulerFunction.cpp | UTF-8 | 202 | 2.71875 | 3 | [] | no_license | //欧拉函数
long long phi(long long x)
{
long long cnt=x;
for (long long i=2;i*i<=x;i++)
if (x%i==0)
{
cnt=cnt/i*(i-1);
while (x%i==0) x=x/i;
}
if (x>1) cnt=cnt/x*(x-1);
return cnt;
} | true |
ec3ba0488e4ce1e583f6ff34a2a0ad5fdb4188cc | C++ | PhebeJ/Learning-CPP | /single_inheritance.cpp | UTF-8 | 805 | 3.828125 | 4 | [] | no_license | #include<iostream>
using namespace std;
class employee
{
protected:
char n[20],d[20];
int sal;
public:
void name();
void desgn();
void display();
void sala();
};
void employee::name()
{
cout<<"enter name";
cin>>n;
}
void employee::desgn()
{
cout<<"enter designation";
cin>>d;
}
void employee::sala()
... | true |
fc4d92810d24afab4ff21be4c4e00d93abd768d8 | C++ | samruddhi-coder/datastructure | /exp4.cpp | UTF-8 | 1,788 | 3.453125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int are[100],k;
void displayData(int n)
{
int i;
for(i=0;i<n;i++)
{
cout<<are[i]<<" ";
}
}
void linearSearch(int n)
{
int item,i,flag=0,pos;
cout<<"\nEnter the Element to be Searched\n";
cin>>item;
for(i=0;i<n;i++)
{
if(are[i]==item)
{
flag=1;
pos=i+1... | true |
5daf05120058ad8c639436faa675f64d3bd193b2 | C++ | iliyanavitanova/Cpp | /cpp_templates/task5.cpp | UTF-8 | 450 | 3.140625 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<string.h>
using namespace std;
template<typename T>
double fmax(T f, T g, double x)
{
if(f(x)>g(x))
{
cout<<"f(x)=";
return f(x);
}
cout<<"g(x)=";
return g(x);
}
double g(double x)
{
return x*2;
}
double f(double x)
{
return x*20;
... | true |
3c82ff29e5ec772d9d3055d6e533fa1053861608 | C++ | Senryoku/BasicGUI | /src/GUIText.hpp | UTF-8 | 1,499 | 2.796875 | 3 | [] | no_license | #pragma once
#include <string>
#include <memory>
#include <functional>
#include <glm/glm.hpp>
#include <Buffer.hpp>
#include <VertexArray.hpp>
#include <Resources.hpp>
#include <GUIElement.hpp>
class Font
{
public:
struct Glyph
{
glm::vec2 dim = glm::vec2(0.0);
glm::vec2 offset = glm::vec2(0.0);
glm::vec2 u... | true |
940edd707e0b3790e497f953d53468f5380f536b | C++ | shivam04/codes | /code-interview-questions/first-duplicate-value.cpp | UTF-8 | 241 | 3.03125 | 3 | [] | no_license | #include <vector>
using namespace std;
int firstDuplicateValue(vector<int> array) {
for(int i=0;i<array.size();i++) {
int p = abs(array[i])-1;
if(array[p] < 0) {
return abs(array[i]);
}
array[p] = -1*array[p];
}
return -1;
}
| true |
d63dcf64e85fe623d8d2b84f7921b29ac98a3d5c | C++ | ASharpy/AI-Project | /project2D/Cohesion.cpp | UTF-8 | 872 | 2.515625 | 3 | [
"MIT"
] | permissive | #include "Cohesion.h"
#include "Setting.h"
Vector2 Cohesion::update(float deltaTime)
{
float speed = 100.0f;
int neighbourCount = 0;
for (auto &var : SETAPP->players)
{
if (SETAPP->playerCircleCheck(Myself, var, (300 + 300)*0.9f))
{
if (Myself == var)
{
continue;
}
point.x = point.x + var->positi... | true |
9b129522119f1f825d3e0f5e4874544f406fc227 | C++ | DegtyarevPaul/vector-plus-plus | /cms/tasks_for_02_21/Warehouse/solver.cc | UTF-8 | 1,423 | 2.8125 | 3 | [
"Unlicense"
] | permissive | #include <bits/stdc++.h>
using namespace std;
map<int,vector<pair<int, int> > > data;
int k; // jump height
bool isNear(pair<int, int> p1, pair<int, int> p2){
return (p1.first-p2.first)*(p1.first-p2.first) +
(p1.second-p2.second)*(p1.second-p2.second) <= 2;
}
int path(int lvl, pair<int, int> point){
... | true |
4041aec01da1a02a9bab0048e779d4c263208198 | C++ | kaat0/OpenLinTim | /src/core/cpp/include/exception/StatisticTypeMismatchException.hpp | UTF-8 | 426 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
*/
#ifndef STATISTICTYPEMISMATCHEXCEPTION_HPP
#define STATISTICTYPEMISMATCHEXCEPTION_HPP
class StatisticTypeMismatchException : public std::runtime_error{
public:
StatisticTypeMismatchException(std::string key, std::string type, std::string value) :
std::runtime_error("Error ST1: Statistic key " + key... | true |
043cc31a786ce41c09768715353642b4083c3d97 | C++ | metaphysis/Code | /UVa Online Judge/volume008/833 Water Falls/program.cpp | UTF-8 | 2,458 | 3.078125 | 3 | [] | no_license | // Water Falls
// UVa ID: 833
// Verdict: Accepted
// Submission Date: 2016-12-09
// UVa Run Time: 0.000s
//
// 版权所有(C)2016,邱秋。metaphysis # yeah dot net
#include <bits/stdc++.h>
using namespace std;
struct point
{
int x, y;
};
struct segment
{
point left, right, lower;
int flag;
bool operator<(cons... | true |
8b1b4d18573519168adb53c6d842d81f4973fb31 | C++ | ramchandra94/datastructures_in_cpp | /pointer_stuff/null_pointers.cpp | UTF-8 | 363 | 3.109375 | 3 | [
"MIT"
] | permissive | #include<iostream>
using namespace std;
int main(){
int *i;
// this prints some garbage address
cout << i << endl;
// the below will print some garbage value in the garbage address
cout << *i << endl;
int *j = 0;
// this will print 0 i guess
cout << j << endl;
// this will compile but throws error at ru... | true |
d9ffd4302ccd294c895e1e598167f5f92291715f | C++ | niuxu18/logTracker-old | /second/download/collectd/gumtree/collectd_repos_function_574_collectd-5.6.2.cpp | UTF-8 | 253 | 2.609375 | 3 | [] | no_license | static int my_asprintf(char **str, const char *fmt, ...) {
int size = 0;
va_list args;
// init variadic argumens
va_start(args, fmt);
// format and get size
size = my_vasprintf(str, fmt, args);
// toss args
va_end(args);
return size;
} | true |
0f1b4ffa3ed7a6bc6bb3a3ac70a4765e52960de2 | C++ | friskareliv/metal | /include/metal/number/if.hpp | UTF-8 | 2,035 | 2.765625 | 3 | [
"BSL-1.0"
] | permissive | // Copyright Bruno Dutra 2015-2016
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt
#ifndef METAL_NUMBER_IF_HPP
#define METAL_NUMBER_IF_HPP
#include <metal/config.hpp>
namespace metal
{
/// \cond
namespace detail
... | true |
fccf144a06b58cef56b517e4b73ab8fcf25313a5 | C++ | pwwpche/X-Locate-OpenCV | /clear.cpp | UTF-8 | 1,087 | 2.53125 | 3 | [] | no_license | #include"cv.h"
#include"highgui.h"
#include<iostream>
using namespace std;
double focus(IplImage* image);
int main_cl() {
IplImage* previous1;
previous1=cvLoadImage("E://Mask//zhishidao_mask.jpg",1);
if(previous1!=0) {
cvNamedWindow("previous1",1);
cvShowImage("previous1",previous1);
cout<<"The defi... | true |
bd12e35b95524c237372d15b093609d246792b1d | C++ | AntSan813/Google_Code_Jam_Solutions | /GCJ-Tidy_Numbers/main.cpp | UTF-8 | 5,505 | 3.78125 | 4 | [] | no_license | /******************************************************************************
* Antonio Santos
* 5/12/17
* Google Code Jam - 2017 Qulification Round B. Tidy Numbers. A tidy number as
* described in the problem, is a number that if you were to read from left to
* right, would be in ascending order. This program t... | true |
1ce52e003459bb3c9c83302893d6eddc5e998a02 | C++ | AlexApps99/sead | /modules/src/hostio/seadHostIONode.cpp | UTF-8 | 1,397 | 2.609375 | 3 | [] | no_license |
#include "hostio/seadHostIONode.h"
#include "hostio/seadHostIOReflexible.h"
#include "hostio/seadHostIOThreadLock.h"
namespace sead::hostio
{
Node::Node()
{
mTreeNode.value() = this;
}
Node::Node(Heap* heap, IDisposer::HeapNullOption heap_null_option)
: Reflexible(heap, heap_null_option)
{
mTreeNode.valu... | true |
3bcaa67d7ecd49ecaf85b71f53e02d9328a904a9 | C++ | kravtsun/au-opencl | /lection1/reduce/main.cpp | UTF-8 | 3,263 | 2.703125 | 3 | [
"MIT"
] | permissive | #define CL_HPP_ENABLE_EXCEPTIONS
#include <CL/cl.h>
#define CL_HPP_MINIMUM_OPENCL_VERSION 120
#define CL_HPP_TARGET_OPENCL_VERSION 120
#include "cl2.hpp"
#include <vector>
#include <fstream>
#include <iostream>
#include <iterator>
#include <iomanip>
#include "../vector_add/cl.hpp"
int main()
{
std::vector<cl::Pl... | true |
72bb61ad0d3835b5433b1d7696651f10d73a98d1 | C++ | YusufDrymz/Cargo-Delivery-Company-Project | /Stack.hpp | UTF-8 | 687 | 3.375 | 3 | [] | no_license | #ifndef STACK_HPP
#define STACK_HPP
#include "List.hpp"
template<class T>
class Stack{
List<T> l;
public:
T top()const;
void pop();
void push(const T& data);
bool isEmpty()const;
};
template<class T>
T Stack<T>::top()const{
if(isEmpty())
throw "Hata : Stack::top() methodunda olustu (sta... | true |
430ff4bdd58cf308a152245d49588d5b88d48fba | C++ | cncoffer/CodingStudy | /Leetcode/Mid/SearchA2DMatrixII/solution.cpp | UTF-8 | 2,692 | 3.203125 | 3 | [] | no_license | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
if (matrix.empty()) return false;
if (matrix[0].empty()) return false;
return recSearch(matrix, target, 0, 0, matrix.size(), matrix[0].size());
}
private:
bool recSearchMatrix(vector<vector<int>> &m... | true |
f9ebf56cca4707632c161252be613eb8e7d66af5 | C++ | gypsyfeng/CSC443-Assignments | /a1/test.cc | UTF-8 | 1,388 | 3.15625 | 3 | [] | no_license | #include "library.h"
#include <iostream>
#include <cstring>
using namespace std;
// void test_fixed_len_sizeof() {
// Record *r = new Record();
// int numattr = 100;
// char attr[10+1] = "aaaaaaaaaa";
// while (numattr > 0) {
// r->push_back(attr);
// numattr--;
// }
// cout <<... | true |
58989145c371be3a787ef735044c8ab8059ae88b | C++ | annaMagpie/semesterarbeitWS201718 | /tokenlib.cpp | UTF-8 | 6,704 | 2.796875 | 3 | [] | no_license | /*
#######################
Parser aus Vorlesung:
(12.12.2017 - BSP 9)
--------------------
Druckfunktion
(ab line 145):
#######################
*/
#include <iostream>
using namespace std;
#include <fstream>
#include <string.h>
#include "token.h"
#include <string>
ClToken::ClToken()
{
*tokenName='\0';
tok... | true |
bae180db8408d9fa500529a07ebb7fb031696689 | C++ | Kavaldrin/adv | /przyklady/Przyklad 1 rodzaje referencji/main.cpp | UTF-8 | 1,332 | 3.578125 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
struct A {
std::string m_napis = "Oryginal";
A() { std::cout<<"Tworze A\n"; }
~A() { std::cout<<"Kasuje A\n"; }
};
//ulatwienie notacji, moze przyjac i lvalue i rvalue i je wypisac!
std::ostream& operator<<(std::ostream& o,const A& a) {
o << a.m_napis << std::end... | true |
932c2a74c4f73927581ef864c91ab451267882da | C++ | adamtew/USU | /2014/CS1400/Challenges/Chapter 7/7.3_Widget_Factory/Widget_Factory.cpp | UTF-8 | 256 | 2.703125 | 3 | [] | no_license | #include "Widget_Factory.h"
using namespace std;
WidgetFactory::WidgetFactory(){
widgets = 0;
}
void WidgetFactory::setWidgets(int n){
widgets = n;
}
int WidgetFactory::daysToProduce(){
productionTime = (widgets / 160) + 1;
return productionTime;
} | true |
523bd8f0a0f3847586114af80bea141fd052965e | C++ | LuckyPigeon/LuckyPigeon | /Data_Hiding/程式/程式 3_JPEG/Version 2 (OK)/main.cpp | UTF-8 | 2,280 | 2.8125 | 3 | [] | no_license | //============================================================================
// Name : jpeg.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#incl... | true |
9fcd8185ea3d6c09abf1215d037f98595041ce8b | C++ | Leeseonwoo11/ProgrammersAlgorithm | /Level2/Fibonacci numbers/Fibonacci numbers/Fibonacci numbers.cpp | UTF-8 | 1,563 | 3.046875 | 3 | [] | no_license | // Fibonacci numbers.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <string>
#include <vector>
using namespace std;
int fibo(int n)
{
long long pre = 0;
long long next = 1;
long long temp = 0;
int count = 1;
if (n == 0)
return 0;
else if (n == 1)
return 1;
while (count != n)
{
temp... | true |
81cd84cfe7d31f5a6e3a40dfe1b572ad9cbac72a | C++ | jwfloyd42/Lab-03 | /Password.h | UTF-8 | 1,215 | 2.53125 | 3 | [] | no_license | #if !defined PASSWORD_H
#define PASSWORD_H
#include "CSC2110/ListArrayIterator.h"
#include "CSC2110/Permutation.h"
#include "CSC2110/ReadFile.h"
#include "CSC2110/Random.h"
#include "CSC2110/Integer.h"
#include "CSC2110/Double.h"
#include "CSC2110/ListArray.h"
#include "CSC2110/Text.h"
#include "CSC2110/HighPerformanc... | true |
02be6a79c6333c698d7a26961e7adf913925794e | C++ | yzbx/opencv-qt | /linux/src/objectTracking/extern/UrbanTracker/include/IObject.h | UTF-8 | 987 | 2.859375 | 3 | [] | no_license | #ifndef IOBJECT_H
#define IOBJECT_H
#include <string>
#include "ObjectState.h"
#include <opencv2/opencv.hpp>
#include "Logger.h"
//Object interface
class ApplicationContext;
class ObjectModel;
class IObjectModel;
class IObject
{
public:
IObject(ApplicationContext* context, cv::Scalar color = cv::Scalar(0,0,255));
v... | true |
ffeb98f9b13da493f549b7c7bb19cdf2b35eb826 | C++ | mr1r/Basic-Codes | /xor.cpp | UTF-8 | 353 | 3.765625 | 4 | [] | no_license | //evaluating XOR operation
//(x ^ y) = ~(x & y) & (~x & ~y)
#include <stdio.h>
int bitXor(int x,int y){
int a, b, result;
a = x & y; //AND
b = ~x & ~y; //NOR
result = ~a & ~b; //NOR
return result;
}
int main()
{
int x, y, result;
while(scanf("%d %d", &x, &y)==2){
result = bitXor(x,y);
printf("%d\... | true |
44c5a229c0fc908b5146c15e2f062900b63282c0 | C++ | dinextw/snell_law | /cuboid.cpp | UTF-8 | 6,651 | 2.890625 | 3 | [] | no_license | //
// snell.cpp
// Snell_TeacherIII
//
// Created by 施俊宇 on 2016/10/18.
// Copyright © 2016年 NCU. All rights reserved.
//
#include <utility>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include "cuboid.hpp"
using namespace std;
void Cuboid::SetValue(double x_low,
... | true |
e335782b45313ad58b3d3ae165f241c5abc72fef | C++ | vslavik/poedit | /deps/boost/libs/utility/identity_type/test/paren.cpp | UTF-8 | 1,168 | 2.515625 | 3 | [
"GPL-1.0-or-later",
"MIT",
"BSL-1.0"
] | permissive |
// Copyright (C) 2009-2012 Lorenzo Caminiti
// Distributed under the Boost Software License, Version 1.0
// (see accompanying file LICENSE_1_0.txt or a copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/utility/identity_type
#include <boost/utility/identity_type.hpp>
#include <boost... | true |
cdb8e1bf18480cfdba0713ad8f2919f30e3b558e | C++ | Ginfoo/mystl | /mystl/mystl/malloc_i.h | UTF-8 | 2,112 | 3.3125 | 3 | [] | no_license | #pragma once
#include <new>
#include <cstdlib>
#ifndef _THROW_BAD_ALLOC
#if defined(__STL_NO_BAD_ALLOC) || !defined(__STL_USE_EXCEPTIONS)
#include <cstdio>
#include <cstdlib>
#define _THROW_BAD_ALLOC \
fprintf(stderr, "out of memory"); \
exit(1)
#else
#include <new>
#define _THROW_BAD_ALLOC throw std::ba... | true |
bcc5677cb08e330063af5ff3386bcaced1ecdc99 | C++ | Archana550/SDE_30_180 | /DAY2/8_pascal_triangle_ll.cpp | UTF-8 | 788 | 3.640625 | 4 | [] | no_license | /*
Given an integer rowIndex, return the rowIndexth row of the Pascal's triangle.
Notice that the row index starts from 0.
In Pascal's triangle, each number is the sum of the two numbers directly above it.
Follow up:
Could you optimize your algorithm to use only O(k) extra space?
Example 1:
Input: rowIndex = ... | true |
38970c1017c08608bbe6772f6a300191841e7e4e | C++ | coderwhocode/ccrma | /256a/flyingdream/Matrix.h | UTF-8 | 3,232 | 3.453125 | 3 | [] | no_license | /* 4x4 Matrix
Last Modified 14/4/00
*/
#ifndef __MATRIX_H_
#define __MATRIX_H_
class Vector3D;
class Point3D;
//////////////////////////////
class Matrix
{
private:
float m[16]; // RIGHT HANDED column major matrix
inline void Verify_Matrix(); // force last row of matrix to be 0 0 0 1 to... | true |
69a83a508d5df29f7e34c6b6fd8e38c84ad2a2a9 | C++ | YongHoonJJo/BOJ | /2564.cpp | UTF-8 | 806 | 3.0625 | 3 | [] | no_license | #include <stdio.h>
int abs(int x)
{
return x > 0 ? x : -x;
}
int Min(int a, int b)
{
return a < b ? a : b;
}
int main()
{
int row, col, n, ans=0;
int i, r[101], c[101];
scanf("%d%d%d", &col, &row, &n);
// dir == 1:north, 2:south, 3:west, 4:east
for(i=0; i<=n; i++) {
int dir, dist;
scanf("%d%d", &dir, &d... | true |
2ed0b7352120f53e801bcf518b835fcc298d194a | C++ | gravfu/OOP_arcade_2019 | /lib/SFML/Lib_arcade_sfml.cpp | UTF-8 | 4,796 | 2.671875 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2020
** Visual Studio Live Share (Workspace)
** File description:
** Lib_arcade_ncurse
*/
#include "Lib_arcade_sfml.hpp"
#include <string>
#include "Print_mat.cpp"
#define LEFTMARGINE 40
void Lib_arcade_sfml::printInColor(int index, sf::RectangleShape &box)
{
printlib(index, game, box);
... | true |
e85fff6a472462e532acf4fcebbee51ae7a74810 | C++ | tnsts/IndexFiles | /methods.cpp | UTF-8 | 4,166 | 2.828125 | 3 | [] | no_license | #include "files.h"
Index_files::Index_files(){
proc = 5, amount = 10; // proc of zapas, amount of blocks
block_interval = 1000;
size = 0;
}
Index_files::~Index_files(){
for(int i = 0; i < proc*amount; i++){
delete [] index[i];
}
delete [] index;
for(int i = 0; i < size; i++){
delete [] main... | true |
953b9388aef780736096ca1ab022f1741da2e477 | C++ | ShayanMirzaei/Utrip | /code/hotel/RoomManager.cpp | UTF-8 | 5,854 | 3.28125 | 3 | [] | no_license | #include "RoomManager.hpp"
#include "Room.hpp"
#include "StandardRoom.hpp"
#include "DeluxeRoom.hpp"
#include "LuxuryRoom.hpp"
#include "PremiumRoom.hpp"
#include <vector>
#include <string>
#include "../Exception.hpp"
#include "Reservation.hpp"
#include <iostream>
#define STANDARD "standard"
#define DELUXE "deluxe"
#d... | true |
4b31e95c992baede1175d2e333576cfd0134c82e | C++ | veer11997/DSA | /CB-stl/Unordered map/hasfuncustomclass.cpp | UTF-8 | 1,099 | 3.28125 | 3 | [] | no_license | #include<iostream>
#include<cstring>
#include<unordered_map>
using namespace std;
class student
{
public:
string firstname;
string lastname;
string rollno;
student(string f,string l, string no)
{
firstname=f;
lastname=l;
rollno=no;
}
bool operator==(const student &s) const
{
return rollno==s.ro... | true |
99b948b5ae50770df5de585d441d2e3fab8150e5 | C++ | xxvms/MemberVariable | /Resource.h | UTF-8 | 553 | 3.0625 | 3 | [] | no_license | //
// Created by tombr on 17/08/2017.
//
#ifndef CASTING_RESOURCE_H
#define CASTING_RESOURCE_H
#include <string>
class Resource {
private:
std::string name;
public:
Resource(std::string n); // default constructor that takes string
Resource(const Resource& r); // copy constructor to make one resoure from ... | true |
9c477163871b93443278a5bd08b32207b3f32469 | C++ | michalg9/WPT | /PowercastSolutions/libraries/PowercastReceiver/PowercastTxMeasurementLayer.cpp | UTF-8 | 2,842 | 2.6875 | 3 | [] | no_license | #include "PowercastTxMeasurementLayer.h"
PowercastTxMeasurementLayer::PowercastTxMeasurementLayer()
{
timerMeasurement = 0;
currentState = STATE_IDLE;
measurementObject = NULL;
}
void PowercastTxMeasurementLayer::setMeasurementObject(MeasurementObject *measObject)
{
measurementObject = measObject;
}
void Powerc... | true |
bfc3ddb6df9fb30141e10fa59a88bd6105850dfd | C++ | anastasiak2512/CLion2016.3Demo | /Doxygen/Doxygen_generation.cpp | UTF-8 | 642 | 2.96875 | 3 | [] | no_license |
template<typename T>
struct Maybe;
template<typename T>
Maybe<T> maybe(T *context)
{
return Maybe<T>(context);
}
// Press /// and type Enter to get Doxygen comments generated
template<typename T>
struct Maybe {
T *context;
Maybe(T *context) : context(context)
{}
// Press /// and type Enter ... | true |
f280ea4da878b047cd2cdb348ebeb61214f60a80 | C++ | ziglang/zig | /lib/tsan/sanitizer_common/sanitizer_lfstack.h | UTF-8 | 2,130 | 2.609375 | 3 | [
"LLVM-exception",
"Apache-2.0",
"MIT"
] | permissive | //===-- sanitizer_lfstack.h -=-----------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | true |
d2a6542719dae3841af27a93feda6cf82ceb6233 | C++ | ivan-magda/cppClassProjects | /SortUsingBinaryTree/SortUsingBinaryTree/main.cpp | UTF-8 | 3,006 | 3.875 | 4 | [] | no_license | #include <iostream>
#include <cmath>
#include <algorithm>
#include <ctime>
using namespace std;
template <class T> class BinaryTree {
private:
struct node {
node *left, *right;
T data;
node () : left(NULL), right(NULL) {}
node (T x) : left(NULL), right(NULL), data(x) {}
};
... | true |
d31af3fb3ed89b0f12e9e15a1fa47d0072ec7197 | C++ | stepanmracek/face | /src/appAutoTrainer/src/settingsbase.h | UTF-8 | 4,013 | 2.765625 | 3 | [] | no_license | #pragma once
#include <string>
#include "faceCommon/helpers/cmdlineargsparser.h"
#include "faceCommon/settings/settings.h"
namespace Face {
namespace AutoTrainer {
class SettingsBase
{
public:
enum class AlignType { None, ICP, Landmark };
AlignType alignType;
int ICPiters;
float smoothCoef;
int... | true |
b29f8754006458e134eec3959db0f2ccdbb55103 | C++ | m1h4/AudioAnalyzer | /Font.cpp | UTF-8 | 6,899 | 2.640625 | 3 | [
"MIT"
] | permissive | // Copyright 2004/2006 Marko Mihovilic
#include "Globals.h"
#include "Kernel.h"
#include "Font.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
Font::Font(void) :
mCreated(false)
{
ZeroMemory(&mHeader,sizeof(mHeader));
ZeroMemory(mElements,sizeof(mElements));
}
Font::~Font(void)
{
Destroy();
}
bool Font::Create(co... | true |
df0623cd00527913a2411c8a83e221ae405271be | C++ | Jimallan/CxlCap | /taksi-code-187/main/src/dll/HotKeys.h | UTF-8 | 1,797 | 2.515625 | 3 | [] | no_license | //
// HotKeys.h
//
#ifndef _INC_Input
#define _INC_Input
#if _MSC_VER > 1000
#pragma once
#endif
#ifdef USE_DIRECTI
struct CTaksiDI : public CDllFile
{
// Direct input keys.
// NOTE: Process/thread specific interface.
public:
CTaksiDI();
HRESULT SetupDirectInput();
void ProcessDirectInput();
void CloseDirectInp... | true |
ffc439a07961cc6604ea62d17d73232b5e5fa897 | C++ | rizwan3413/RizwanSampleRepo | /exercise1.cpp | UTF-8 | 790 | 3.25 | 3 | [] | no_license | #include<iostream>
using namespace std;
/*Static,Const Cast,Re-Interpret Casting,Dynamic Cassting*/
/*Static Cast- Mostly used for Implicit Conversion */
class GooglePlus
{
public:
string Name;
void print(string name) const
{
const_cast<GooglePlus*>(this)->Name = name;
cout<< " This is GooglePlus Sample...... | true |
bf6dc5998fe96dbf9ea4d369a934d98ea20cb9c0 | C++ | shuyabin/x5mgc | /x5mgcBase/NetWork/NetBuffer/MemoryPool.h | UTF-8 | 2,096 | 3.21875 | 3 | [] | no_license | #ifndef MEMORY_POOL_H
#define MEMORY_POOL_H
#include <climits>
#include <cstddef>
template <typename T, size_t BlockSize = 4096>
class MemoryPool
{
public:
/* Member types */
typedef T value_type;
typedef T* pointer;
typedef T& reference;
typedef const T* const_poin... | true |
e5d90655ed6452b0570f22aa3aedf17ff51d3ddb | C++ | asdlei99/ggj16 | /src/app/Globals.h | UTF-8 | 1,763 | 2.53125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <vector>
#include <random>
#include "onut.h"
class Player;
class DanceMove;
class Entity;
typedef std::vector<Player*> PlayerVect;
typedef std::vector<DanceMove> DanceMoveVect;
typedef std::vector<onut::GamePad::eGamePad> DanceMoveButtonVect;
typedef std::v... | true |
f8c93e5b700c76f1fc44f86b9e71e327ac813529 | C++ | fabiolaborchi/Lavori_Cpp | /MasterMind.cpp | UTF-8 | 1,206 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
/*
*MasterMind
*Author: Fabiola Borchi
*Date: 05/03/2021
*/
class MasterMind{
private:
int test[5];
int mappa[5];
void init(){
srand(time(NULL));
for(int i=0; i<5; i++){
mappa[i]=(rand()%10)+1;
for (int j=0; j... | true |
7014ce9bc4e060a53ca649bbb8ab5a7b612c485b | C++ | ganeshbhandarkar/leetcode | /shuffle-the-array/shuffle-the-array.cpp | UTF-8 | 340 | 2.796875 | 3 | [] | no_license | class Solution {
public:
vector<int> shuffle(vector<int>& nums, int n) {
//int x = nums.size();
vector<int> sol;
int i=0;
int j=n;
while(i<n && j<2*n){
sol.push_back(nums[i]);
sol.push_back(nums[j]);
i++;
j++;
}
... | true |