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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4cc2fc2ebe2af547150ae361f00e954359dd7229 | C++ | csclyde/TGL | /Model/ResourceController.cpp | UTF-8 | 4,183 | 2.640625 | 3 | [] | no_license | #include "../Model/ResourceController.h"
ResourceController::ResourceController()
{
undo = new QUndoStack;
undo->setUndoLimit(500);
clipboard = new Clipboard;
}
ResourceController::~ResourceController()
{
delete clipboard;
}
void ResourceController::PurgeUndoStack()
{
undo->clear();
}
int Resou... | true |
e5629f59048a808c2f0dc2649567444b66235e76 | C++ | Twinklebear/tray | /src/material/fresnel.cpp | UTF-8 | 1,870 | 2.84375 | 3 | [
"MIT"
] | permissive | #include <cmath>
#include "linalg/util.h"
#include "material/fresnel.h"
Colorf fresnel_dielectric(float cos_i, float cos_t, float eta_i, float eta_t){
Colorf r_par = (eta_t * cos_i - eta_i * cos_t) / (eta_t * cos_i + eta_i * cos_t);
Colorf r_perp = (eta_i * cos_i - eta_t * cos_t) / (eta_i * cos_i + eta_t * cos_t);
... | true |
a97eae59e1180f7fc784f32a183d085e11d59c91 | C++ | Im-Rudra/LightOJ-Solutions | /1311-Unlucky-Bird.cpp | UTF-8 | 614 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
double v1;
double v2;
double a1;
double a2;
double v3;
int t;
double tim;
double ans;
double dis;
double tim1;
double tim2;
scanf("%d", &t);
for (int cs = 1; cs <= t; cs++) {
scanf("%lf", &v1);
scanf("%lf", &v2);
scanf("%lf"... | true |
92c01d75dc3f392bb0623c7e0326d8e8e8d10af8 | C++ | cocahack/Missions | /cs23/step2/alu.h | UTF-8 | 856 | 2.84375 | 3 | [] | no_license | //
// Created by MCC on 11/04/2019.
//
#ifndef STEP2_ALU_H
#define STEP2_ALU_H
#include <cstdint>
#include "register.h"
class ALU
{
public:
Word add_impl(const Reg& r1, const Reg& r2)
{
return r1.get_value() + r2.get_value();
}
Word add_impl(const Reg& r1, const Word value)
{
... | true |
3ca748289b1e8814b7ba77e946ae050537f8056d | C++ | kamyu104/LeetCode-Solutions | /C++/build-binary-expression-tree-from-infix-expression.cpp | UTF-8 | 1,715 | 3.21875 | 3 | [
"MIT"
] | permissive | // Time: O(n)
// Space: O(n)
// Support +, -, *, /.
class Solution {
public:
Node* expTree(string s) {
static const unordered_map<char, int> precedence = {{'+', 0}, {'-', 0}, {'*', 1}, {'/', 1}};
stack<Node *> operands;
stack<char> operators;
int64_t operand = 0;
for (int ... | true |
5980287a1274e6b1f0ca971b6829efa8c1d51f8c | C++ | Jason0803/Algorithm_ProblemSolving | /Algorithm_cpp/14501_prac/main.cpp | UTF-8 | 667 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int N, ans;
pair<int, int> days[16];
void dfs(int current, pair<int, int> node, int current_sum) {
if(current + node.first > N+1) return;
current_sum += node.second;
if(ans < current_sum) ans = current_sum;
for(int next = current + node.... | true |
99836c19c51460f31a538f2df448058cb34a3c4f | C++ | ddeka0/CP | /2018-2019/ilya_and_Sticks.cpp | UTF-8 | 1,692 | 3.234375 | 3 | [] | no_license | // http://codeforces.com/contest/525/problem/C
#include <bits/stdc++.h>
using namespace std;
/*template code starts*/
typedef unsigned long long ULL;
typedef long long LL;
template<typename T>
void LOG(T const& t) {
std::cout << t<<endl;
}
template<typename First, typename ... Rest>
void LOG(First const& first, Rest ... | true |
bba0f4949a9e5ba3714c0b36f7c5a9557663f8ad | C++ | tuanacetinkaya/Daily-Leetcode-Challenge | /January 2021/27.01.2021/vedat.cpp | UTF-8 | 438 | 2.953125 | 3 | [] | no_license | class Solution {
public:
int sumOddLengthSubarrays(vector<int>& arr) {
vector<int> pref;
pref.push_back(0);
for (int i=0; i<arr.size(); i++) {
pref.push_back(arr[i] + pref[i]);
}
int ans = 0;
for (int i=1; i<=arr.size(); i+=2) {
for (int j=i; ... | true |
f9383255558de2283df1aee228548066fc35e5e3 | C++ | muhammad-ur-rehman/3x3-Sliding-Tile-Puzzle | /puzzle.cpp | UTF-8 | 3,451 | 3.4375 | 3 | [] | no_license | //Matthew Joyce
#include<iostream>
#include<cassert>
using namespace std;
enum game_status { uncompleted, completed };
struct spacePosition
{
int row, col;
};
struct puzzle
{
game_status status;
int board[3][3];
spacePosition position;
int numberOfMoves;
};
void initializeGoal(puzzl... | true |
b70639d1e585f84c3f1d057921f9e1791088d703 | C++ | dmayna/Sudoku | /sudoku/Levels.cpp | UTF-8 | 8,983 | 2.703125 | 3 | [] | no_license | #include "pch.h"
#include "Levels.h"
#include <fstream>
#include <sstream>
#include <iomanip>
#include <iostream>
#include <Windows.h>
using namespace std;
Levels::Levels()
{
filename = "sudokuVeryEasy.txt";
scoreFilename = "veryEasyScore.txt";
playing = true;
score = 100;
average = getAverage();
}
void Levels::... | true |
d66d9a33224fe98633fc9ef505a5a41df943c774 | C++ | donkaban/grasshopper | /jni/microGL/logger.h | UTF-8 | 1,551 | 2.5625 | 3 | [] | no_license | #ifndef __GRASSHOPPER_LOGGER__
#define __GRASSHOPPER_LOGGER__
#include <android/log.h>
#include <iostream>
#include <cstdlib>
#include <sstream>
#define _MODULE(tag) static auto LOCAL_LOGGER = std::make_shared<logger>(tag)
#define INFO(...) LOCAL_LOGGER->info(__VA_ARGS__)
#define ERROR(...) LOCAL_LOGGER->error(__... | true |
b80672c4cd8abaf8efab235c984136f2a85cb7f7 | C++ | blizmax/synthese_image | /Camera.h | ISO-8859-1 | 8,635 | 2.546875 | 3 | [] | no_license | #pragma once
#include "Component.h"
#include "DirectionalLight.h"
#include "mat.h"
#include "wavefront.h"
#include "texture.h"
#include "program.h"
#include "uniforms.h"
#include <vector>
class Skybox;
using namespace std;
class Camera : public Component
{
private:
Transform projectionMatrix;
int frameWidth = 80... | true |
72b12bef36e73827d34c5d4ad0b111000b970c57 | C++ | Leo-778/wangdao | /915/2021t1.cpp | UTF-8 | 1,239 | 2.96875 | 3 | [] | no_license | /*
* @Description: 寻找马鞍点
* @Author: Leo
* @Date: 2021-10-26 19:13:46
* @LastEditTime: 2021-10-27 06:44:00
*/
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
int a[100][100];
int m, n;
cin >> m >> n;
for (int i = 0; i < m; i++)
... | true |
41c2c9d309433fef90806f76ee8ac55d2fff5ccd | C++ | mmaricic/FilesystemManagement | /projekat2/ComplexCommandContainer.cpp | UTF-8 | 815 | 3.390625 | 3 | [] | no_license | #include "ComplexCommandContainer.h"
void ComplexCommandContainer::add(string name, ComplexCommand* cc) {
newCommands.insert(make_pair(name, cc));
}
void ComplexCommandContainer::operator()(const vector<string> &elem) {
int i = newCommands.find(elem[0])->second->argNum();
if (i != elem.size() - 1) {
cout << "In... | true |
110b782e53dd9f0a19956e36c82eaf3b76dac804 | C++ | SayaUrobuchi/uvachan | /UVa/10703.cpp | UTF-8 | 754 | 2.8125 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int a,b,c,d,e,f,g,h,i,j;
bool k[500][500];
while(scanf("%d%d%d",&a,&b,&h)==3)
{
if(a==0&&b==0&&h==0)
{
break;
}
for(c=0;c<a;c++)
{
for(d=0;d<b;d++)
{
k[c][d]=1;
}
}
for(h;h>0;h--)
{
scanf("%d%d",&c,&d);
scanf("%d%d",&e,&f);
if(c>e)
{
g=c... | true |
593737c7955ef11444035144765bea44d023d78c | C++ | ojaster/first_project | /structure/massive86.cpp | UTF-8 | 398 | 2.84375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
const int n=8;
int k[n];
for(int i =0; i<n; i++){
cin>>k[i];
}
int j=0;
for(int i =0; i<n; i++){
if(k[i]==2){
j++;
}
}
cout<<"-----"<<endl;
cout<<"kolv="<<j<<endl;
cout<<"-----"<<endl;
if... | true |
b66cce3c8574349556a549965d6a0e0b8c61b8c3 | C++ | johnnyflame/RANSACPlanefinder | /planeFinder.cpp | UTF-8 | 1,845 | 3.265625 | 3 | [] | no_license | #include "SimplePly.h"
#include <iostream>
int main (int argc, char *argv[]) {
// Check the commandline arguments.
if (argc != 6) {
std::cout << "Usage: planeFinder <input file> <output file> <number of planes> <point-plane threshold> <number of RANSAC trials>" << std::endl;
return -1;
}
int nPlanes =... | true |
c62fadeff58a47576d0fa4ce48ab78de3df17bb5 | C++ | engyebrahim/CompetitiveProgramming | /Topcoder/SRM373-D2-1000.cpp | UTF-8 | 2,694 | 3.125 | 3 | [] | no_license | /*
first case
for every rectangle if any end poit inside it (check by cross product) sum its area and mark it as visited
second case
1- if rec is not visited and a point exist in any of its sides
2- if rec is not vis and any of its sides intersect with any segment
*/
#include<bits/stdc++.h>
using namespace std;
struct... | true |
7b373d7105938378672948241eb17e04c8f927af | C++ | djuanbei/graphmodel | /ftma/include/domain/dbmset.hpp | UTF-8 | 5,850 | 2.8125 | 3 | [] | no_license | /**
* @file DBMset.h
* @author Liyun Dai <dlyun2009@gmail.com>
* @date Sun Mar 31 21:58:00 2019
*
* @brief A dbm matrix set class.
*
*
*/
#ifndef DBM_SET_H
#define DBM_SET_H
#include <algorithm>
#include <map>
#include <vector>
#include "domain/dbm.h"
#include "util/dbmutil.hpp"
namespace graphmodel {
//... | true |
1076a1c62ef7c450096d91448655e6861c7b32a0 | C++ | arturomf94/of-experiments | /meshImage/ofApp.cpp | UTF-8 | 3,252 | 2.65625 | 3 | [] | no_license | #include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
image.load("example.jpg");
image.resize(300,200);
mesh.setMode(OF_PRIMITIVE_POINTS);
mesh.enableColors();
float intensityThreshold = 150.0;
int w = image.getWidth();
int h = image.getH... | true |
bab5cef010c61b20a60c67758d3a00c8c8dd595f | C++ | thulsadum/openbot | /include/IRC.h | UTF-8 | 1,626 | 2.703125 | 3 | [] | no_license | #ifndef IRC_H
#define IRC_H
#include "include/Socket.h"
#include <queue>
#include <string>
#include <ctime>
#include <sstream>
using std::string;
using std::queue;
using std::ostringstream;
#define CRLF "\r\n"
#define RBUF_SIZE 4096
class IRC
{
public:
/** Default constructor */
IRC();
/... | true |
0392ac245b413dafce6807b9fbbab13deafee4ea | C++ | jericho31/ProblemSoving | /solved/swea.1215 3일차 - 회문1/main.cpp | UTF-8 | 900 | 3.046875 | 3 | [] | no_license | // 22min
#include <iostream>
#include <string>
using std::cin; using std::cout; using std::string;
string table[8] = {};
bool isPalindrome(string s)
{
int a = 0, b = (int)s.size() - 1;
for (int i = 0; i < (int)s.size() / 2; ++i) {
if (s[a + i] != s[b - i]) return false;
}
return true;
}
int main()
{
std::io... | true |
30531282378d72e5eec9245bf62e0b79d80cac69 | C++ | panguangze/Ibalance | /include/Vertex.hpp | UTF-8 | 1,598 | 2.984375 | 3 | [] | no_license | #ifndef _VERTEX_H_
#define _VERTEX_H_
#include <vector>
#include "Edge.hpp"
#include "Segment.hpp"
#include "Weight.hpp"
using namespace std;
class Segment;
class Edge;
class Weight;
class Vertex {
protected:
int mId; // vertex id
char mDir; // +/-
b... | true |
bec5935f04f77930b8917f983c40264e4e31a8a0 | C++ | ruslanchistov/different-tasks_2 | /zadacha_1.cpp | UTF-8 | 821 | 3.34375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class Array
{
int Content [6];
public:
const int Length;
//------------------------------------------
Array(int theMass [], int theNum) : Length(theNum)
{
for (int i = 0; i < Length; i++)
Content[i] = theMass[i];
}
//------------------... | true |
7495ba2ea1e8c2d6e3c06bf2a2997308fe9b751a | C++ | xchuki00/PGP | /geCore/include/GPUEngine/geCore/CopyOp.h | UTF-8 | 638 | 2.640625 | 3 | [] | no_license | #ifndef GE_COPYOP
#define GE_COPYOP
#include <GPUEngine/geCore/gecore_export.h>
namespace ge
{
namespace core
{
class Object;
class GECORE_EXPORT CopyOp
{
public:
enum Options
{
SHALLOW_COPY = 0,
DEEP_COPY_OBJECTS = 1<<0,
DEEP_COPY = 0x7FFFFFF... | true |
002dcd9b68cf3a5cb047c6662bc1557b31bedcc3 | C++ | aldgoff/DP4 | /DP4/src/Skeletons/bridge.cpp | UTF-8 | 4,666 | 3.109375 | 3 | [] | no_license | /*
* bridge.cpp
*
* Created on: Feb 2, 2015
* Author: aldgoff
*/
#include <iostream>
#include <map>
using namespace std;
#define COUNT(x) (sizeof(x)/sizeof(*x))
namespace skeleton {
class BridgeImplementation { // If multiple elements need to vary independently...
public: virtual ~BridgeI... | true |
f21c4fdb0ea080c70ae74248e29d771356c2d7c7 | C++ | Diego10HDZ/CUFICO-2018-2 | /TallerJuegoDeLaVida/JuegoDeLaVida_comented_2especie.cpp | UTF-8 | 8,115 | 3.671875 | 4 | [] | no_license | #include <iostream> //incluir libreria para operaciones de entrada y salida
#include <cstdlib> //Incluir libreria para control de memoria
#include <vector> //Inicializar un vector vacio
#include <unistd.h> //Incluir la libreria unistd.h
using namespace std; //Incluir las palabras del diccionario estandar de C++
c... | true |
9dbfda74ac2cf1fb29b0eaa6e03d287b7221a50e | C++ | ecepep/smallcppsoft | /src/GUI/propwindow.h | UTF-8 | 1,420 | 2.671875 | 3 | [] | no_license | #ifndef PROPWINDOW_H
#define PROPWINDOW_H
#include <QWidget>
#include <QDate>
#include <memory>
#include <QEvent>
#include "dbconnection/dbprop.h"
namespace Ui {
class PropWindow;
}
/**
* @brief The PropLoadFail class
* @details
* Child of QEvent. A PropLoadFail of type (QEvent::Type) eventPLF,
* will be sent b... | true |
a9983645d38b074d88a75fd43c3eee46a3f30751 | C++ | honeysuckcle/Garden.github.io | /algorithm/algorithm/algorithm/week2/p107-4/matrix.h | GB18030 | 906 | 3.1875 | 3 | [] | no_license | #pragma once
class SparseMatrix {
public:
SparseMatrix();
SparseMatrix Transpose();
private:
int Rows, Cols,Terms;
MatrixTerm smArray[5];
};
class MatrixTerm {
friend SparseMatrix;
private:
int row, col, value;
};
SparseMatrix SparseMatrix::Transpose() {
int *RowStart = new int[Cols];
Sp... | true |
a720fa76025b749522c00a2ab4f118bf6eb87238 | C++ | MayaPosch/NymphCast | /src/server/gui/core/components/TextEditComponent.cpp | UTF-8 | 7,691 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | #include "components/TextEditComponent.h"
#include "resources/Font.h"
#include "utils/StringUtil.h"
#define TEXT_PADDING_HORIZ 10
#define TEXT_PADDING_VERT 2
#define CURSOR_REPEAT_START_DELAY 500
#define CURSOR_REPEAT_SPEED 28 // lower is faster
TextEditComponent::TextEditComponent(Window* window) : GuiComponent(wi... | true |
cecd79b6a800b03c92d1c8415676b5506ca760a8 | C++ | Uniyalatul/tic-tac-toe | /tictac.cpp | UTF-8 | 5,238 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include<string.h>
#include<stdlib.h>
using namespace std;
int main()
{
char ttt[9]; // for the array
char x[20]; //first player name
char y[20]; // second player name
char fst[20]; // name(who'll play first)
int count=0 ; // counting index filled in array
int pos; // position to enter t... | true |
6f98b4b68154f5bf41928a4d16c1e2280784f8a7 | C++ | noliaoliao/leetcode | /219/219.cpp | UTF-8 | 463 | 2.953125 | 3 | [] | no_license | class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
unordered_map<int,int> hashmap;
unordered_map<int,int>::iterator it;
int count = 0;
for(int i = 0; i < nums.size(); i++){
it = hashmap.find(nums[i]);
if(it != hashmap.end()){
... | true |
5849a43a63de278ddd3e92bb3e51c949d394f7ec | C++ | KuibinZhao/MonocularSfM | /include/Reconstruction/Initializer.h | UTF-8 | 6,660 | 2.75 | 3 | [] | no_license | #ifndef __INITIALIZER_H__
#define __INITIALIZER_H__
#include <cstddef>
#include <vector>
#include <opencv2/opencv.hpp>
namespace MonocularSfM
{
class Initializer
{
public:
struct Parameters
{
size_t rel_pose_min_num_inlier = 100; // 2D-2D点对应的内点数量的阈值
double rel_pose_ransac_confidenc... | true |
f6b8b53cb592a27d2b5c0a9869aa830a4fbb7500 | C++ | sora-k/coding-problems | /551-student-attendance-record-i-[easy]/solution.cpp | UTF-8 | 717 | 3.125 | 3 | [] | no_license | // 4/22/17 6:17PM - 6:40PM
class Solution {
public:
bool checkRecord(string s) {
bool condition_1 = false; //more than one 'A' (absent)
bool condition_2 = false; //more than two continuous 'L' (late).
int a_count = 0;
int l_count = 0;
string::iterator it;
... | true |
feb02414605fee4eb8f2b3b3f646e0aa37ec2739 | C++ | igordotsenko/Army-CPP | /Abilities/Ability.h | UTF-8 | 471 | 2.75 | 3 | [] | no_license | #ifndef ABILITY_H
#define ABILITY_H
#include "../Units/Unit.h"
#include "../States/State.h"
class Unit;
class Spell;
class Ability {
protected:
Unit* actionUnit;
public:
Ability(Unit* actionUnit);
virtual ~Ability() = 0;
virtual void attack(Unit* actionUnit);
virtual void counterAttack(Unit* actionUnit)... | true |
751ddb222e2b78400d0ed0b55ece1da0ef5eb874 | C++ | PatrikOkanovic/ETH-AlgoLab-2020 | /week10/Worldcup/world_cup.cpp | UTF-8 | 2,692 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
#include <CGAL/Gmpz.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Delaunay_triang... | true |
48a05d30c516fe117b4a06702a3bca972328473b | C++ | devilzCough/Algorithm | /Algorithm_xcode/Algorithm_c++/Algorithm_c++/BFS/acm5427.cpp | UTF-8 | 2,918 | 3.25 | 3 | [] | no_license | //
// acm5427.cpp
// Algorithm_c++
//
// Created by 이승진 on 2021/06/01.
//
#include <iostream>
#include <queue>
using namespace std;
int N, w, h;
char map[1005][1005];
bool canEscape;
// up, down, left, right
int dx[] = {0, 0, -1, 1};
int dy[] = {-1, 1, 0, 0};
int bfs();
void expandFire();
void move();
queue<p... | true |
cf36358de6a46939bd55286eb8e82996feb0b23f | C++ | darlinghq/xcbuild | /Libraries/plist/Tests/test_String.cpp | UTF-8 | 1,385 | 2.6875 | 3 | [
"LicenseRef-scancode-philippe-de-muyter",
"BSD-3-Clause",
"NCSA",
"Zlib",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | /**
Copyright (c) 2015-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
*/
#include <gtest/gtest.... | true |
bb79fb120069cfd2be7d3187cd3fffa6dd811aad | C++ | YoungHJ203/NumericalAnalysis | /Structure Analysis/201110756_정영훈/Polynominal.h | UHC | 1,518 | 3.640625 | 4 | [] | no_license | #pragma once
#include<iostream>
#define FMAX 3.402823466e+38 // float ڷ ִ ִ
using namespace std;
class Polynominal {
public:
// n
Polynominal(int);
// n
Polynominal(float[]);
// copy
Polynominal(Polynominal&);
// Ҹ
~Polynominal();
// Լ ( Էؼ )
void makePoly();
// ̺
void diffPoly();
... | true |
3ffd6db500c25e615e841f172c4430873934dbf6 | C++ | RealChaser/Rasterizer | /xtozero/Texture.cpp | UHC | 4,544 | 2.6875 | 3 | [] | no_license | #include "stdafx.h"
#include "Texture.h"
#include "FileHandler.h"
#include <iostream>
namespace xtozero
{
CTexture::CTexture( const unsigned int width, const unsigned int height )
: m_width( width ), m_height( height )
{
assert( width > 0 && height > 0 );
m_texture.resize( width * height );
}
CTexture::CTe... | true |
10a8c11477ac79e25f2ca51e8407cd1d8592fe71 | C++ | Mshardul/gfg | /01. Data Structure/02. TopicWise DS/03. stack/01. Design and Implementation/008. Design a stack that supports getMin() in O(1) time and O(1) extra space.cpp | UTF-8 | 926 | 3.6875 | 4 | [] | no_license | #include <iostream>
#include <stack>
using namespace std;
void Display(stack<int> temp){
while(!temp.empty()){
cout<<temp.top()<<" ";
temp.pop();
}
cout<<endl;
}
int main(int argc, char const *argv[])
{
stack<int> s;
int temp, minEle, ch, ele=0;
cin>>temp;
s.push(temp);
minEle=temp;
while(1){
cout<... | true |
9142ed0d0117000955cbd4595a2ca116fabb2fde | C++ | luisenriquelemals/Board-game | /Board.cpp | UTF-8 | 7,493 | 3.34375 | 3 | [] | no_license | /**
* Name: Luis Lema Date: 6/10/2020
* project: game
*/
#include "Board.h"
#include "Exceptions.h"
#include <typeinfo>
#define MIN(a,b) (((a)< (b)? (a) : (b) ))
Board * Board::theBoard = NULL;
Board::Board( ) : nRows(NROWS), nCols(NCOLS), currentTurn(1) {
// Initiliaze the whole table
for (int r = 0; ... | true |
f4792dd9d3bde997d7f898ad543fa931eabf092c | C++ | dylanmpeck/CPP-Piscine | /rush00/StaticEntity.cpp | UTF-8 | 951 | 2.96875 | 3 | [] | no_license | #include "StaticEntity.hpp"
StaticEntity::StaticEntity()
{
this->speed = 1;
lastmove = 0;
}
StaticEntity::StaticEntity(int speed)
{
this->speed = speed;
lastmove = 0;
}
StaticEntity::StaticEntity(int speed, Vector & position)
{
this->speed = speed;
this->position = position;
}
StaticEntity::StaticEntity(const... | true |
40808d6ee24ec993311ff3b93ed23aa032269ca8 | C++ | JayBeavers/bigbird | /capture/capture.cpp | UTF-8 | 540 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | #include<iostream>
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
VideoCapture capture(0);
capture.set(CV_CAP_PROP_FRAME_WIDTH, 640);
capture.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
if(!capture.isOpened()){
cout << "Failed to connect to the camera." << end... | true |
1da2f987601b0027865757016fa46ebb3f3a27f8 | C++ | jooyoung0525/Algorithm_Study | /20201013/수영대회결승전.cpp | UHC | 2,103 | 2.859375 | 3 | [] | no_license | //ּҽð ϱ.
/*
BFS (ġ,ð,ҿ뵹̱ٸ)
1. BFS¿ -
*/
#include<iostream>
#include<cstring>
#include<queue>
#include<algorithm>
# define MAX 987654321
using namespace std;
struct info { int x, y; };
struct info2 { int x, y, time; bool storm; };
int T;
int N;
int Map[20][20];
bool check[20][20];
int dx[] = { -1,1,0,0 };
int dy[]... | true |
4417202191227540f6e030ad8544a144ba5dcb9a | C++ | theJinFei/C-Test | /PAT-Advanced/Spell It Right/main.cpp | UTF-8 | 597 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
string N;
cin>>N;
string str[10]={"zero","one","two","three","four","five","six","seven","eight","nine"};
int sum = 0;
vector<string> v1;
for(int i=0;i<N.size();i++){
sum+=N[i]-'0';
}
wh... | true |
b9b7411673093b510bdf396948fc2f1827ce51d8 | C++ | TheMarlboroMan/platformer-astronaut | /class/base_proyecto/cargador_recursos_base.h | UTF-8 | 2,148 | 2.734375 | 3 | [
"Unlicense"
] | permissive | #ifndef CARGADOR_RECURSOS_BASE_H
#define CARGADOR_RECURSOS_BASE_H
/*Un cargador de recursos gráficos y de audio. Para cargar los recursos usa
ficheros en disco, localizados en las rutas de turno. Tiene un rollo autoload,
bien para proyectos pequeños, mal para proyectos grandes, puesto que lo que
cargas se queda para s... | true |
4bc3fe754d74f96d5fe958aa7158caad44a6dc5f | C++ | tortoisedoc/calculator | /src/Parser.h | UTF-8 | 568 | 2.515625 | 3 | [] | no_license | #pragma once
#include "stdafx.h"
#include "Errorclass.h"
class Parser: public ErrorClass
{
private:
t_token PopList(t_token_list * _token_list);
bool isAddOp(char _digit);
int ParseNumber(t_token_list * _token_list);
int ParseAddOp(t_token_list * _token_list);
int ParseExpression(t_token... | true |
42ab7cb23fbe49fb90cd3e3c6de31693dbaf00ce | C++ | diptu/Teaching | /CSE 225L Data Structures and Algorithms/Resources/Codes Previous/Spring-2019-CSE225 1/Assignment(Student Database)/main(16).cpp | UTF-8 | 479 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <string>
#include <iostream>
using namespace std;
#include "student.h"
int main()
{
StudentDB s(6);
string name;
cout << "Enter name to search: ";
cin >> name;
int t=s.searchStudent(name);
if(t>=0)
s.st[t].print();
else cout<<"student not found\n";
int id;
cout << "... | true |
5d493e8530931c299167e12546f7d8172c95de67 | C++ | Roout/acst | /common/SwitchBuffer.hpp | UTF-8 | 1,499 | 3.34375 | 3 | [
"MIT"
] | permissive | #include <string>
#include <array>
#include <vector>
#include <boost/asio.hpp>
class SwitchBuffer {
public:
SwitchBuffer(size_t reserved = 10) {
m_buffers[0].reserve(reserved);
m_buffers[1].reserve(reserved);
m_bufferSequence.reserve(reserved);
}
/**
* Queue data to passibe b... | true |
df58ef50f315782d4f2c330144e0cb2ca3bb03bd | C++ | Red-Portal/nast_hpx | /src/util/triple.hpp | UTF-8 | 1,209 | 3.265625 | 3 | [] | no_license | #ifndef NAST_HPX_UTIL_TRIPLE_HPP_
#define NAST_HPX_UTIL_TRIPLE_HPP_
#include <iostream>
namespace nast_hpx {
template<typename T>
struct triple {
triple() : x(), y(), z() {}
triple(T value) : x(value), y(value), z(value) {}
triple(T x_value, T y_value, T z_value) : x(x_value), y(y_value), z(z_value) {... | true |
fce44eecf18c44fbd225d602d9b09781f9397c84 | C++ | iZhangHui/CppPrimer | /CH16_TemplatesAndGenericProgramming/exercises/ex16_12_13.h | UTF-8 | 6,535 | 3.671875 | 4 | [
"Unlicense"
] | permissive | #include <vector>
#include <memory>
#include <initializer_list>
#include <iterator>
// forward declarations needed for friend decalarations in Blob
template <typename>
class BlobPtr;
template <typename>
class Blob; // needed for parameters in operator==
template <typename T>
bool operator==(const Blob<T>&, const Blo... | true |
ce98e6044228e46ec4ca876b06bdc41b5408eee1 | C++ | iridium-browser/iridium-browser | /buildtools/third_party/libc++/trunk/test/std/utilities/expected/expected.void/ctor/ctor.move.pass.cpp | UTF-8 | 3,376 | 2.84375 | 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 |
1c8d2e3869c4b188dc5f3fc0488b1d0143aefc6a | C++ | q4a/GLKeeper | /src/GuiHierarchy.h | UTF-8 | 2,143 | 2.53125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "GuiDefs.h"
class GuiHierarchy: public cxx::noncopyable
{
public:
// readonly
GuiWidget* mRootWidget = nullptr;
public:
~GuiHierarchy();
// load widgets hierarchy from json document
// @param fileName: File name
bool LoadFromFile(const std::string& fileNa... | true |
f0c2062b8eea7a77ffd853394379b0ed4512f7c5 | C++ | AndreiGolovatskii/sportprog | /lksh2017/Day12/C.cpp | UTF-8 | 1,944 | 3.1875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Vector{
long double x, y;
Vector() {}
Vector(long double cx, long double cy) {
x = cx;
y = cy;
}
long double len() const {
return hypot(x, y);
}
long double dot_product(Vector b) {
return x * b.x + y * b.... | true |
632f5964eb520754a4582edbf19e2e7987473d12 | C++ | SavaDtrv/Object-oriented-programming-school-works | /Project made during the semester/Deck.cpp | UTF-8 | 758 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include "Deck.h"
using namespace std;
const int DEFAULT_CAPACITY = 10;
const int DEFFAULT_CURRENTCARD = 0;
Deck::Deck()
{
capacity = DEFAULT_CAPACITY;
currentCard = DEFFAULT_CURRENTCARD;
cards = new Card*[capacity];
}
Deck::Deck(const Deck& other) {
copyDeck(other);
}
Dec... | true |
f8c945402b4d99d41c5af161172005c15018f626 | C++ | rharel/cpp-efficient-reformation | /demo/sources/model/World.cpp | UTF-8 | 1,230 | 2.8125 | 3 | [
"MIT"
] | permissive | #include <assert.h>
#include <glm/geometric.hpp>
#include "World.h"
using namespace rharel::efficient_reformation::demo;
World::World(const unsigned int vehicle_count)
: vehicles(vehicle_count)
{}
void World::step(const float duration)
{
if (duration <= 0) { return; }
for (auto& vehicle : vehicles)
... | true |
3e85fa8d52ad707e3aa8614b7ccd9d39e6c1fdaf | C++ | biqar/interviewbit | /Math/Adhoc/Prime Sum/prime_sum.cpp | UTF-8 | 418 | 3 | 3 | [
"MIT"
] | permissive | //
// Created by aislam6 on 11/27/19.
//
bool is_prime(int a) {
for(int i=2; i*i<=a; i+=1) {
if(a % i == 0) return false;
}
return true;
}
vector<int> Solution::primesum(int A) {
vector<int> ret;
for(int i=2; i<=(A/2)+1; i+=1) {
if(is_prime(i) && is_prime(A-i)) {
ret.p... | true |
334da48783c0073ef1131b1ce514ddc471786e2e | C++ | TimoninaDaria/msu_cpp_spring_2020 | /09/test.cpp | UTF-8 | 1,102 | 2.796875 | 3 | [] | no_license | #include "merge.h"
#include <cassert>
using namespace std;
void generator(const string& namefile){
ofstream fout;
uint64_t v;
fout.open(namefile, ios::binary);
for (int i = 0; i < 100001; ++i){
v = std::rand() + 1;
fout.write(reinterpret_cast<char *>(&v), sizeof(uint64_t));
}
}
v... | true |
615526e0583b49fca6d4b058270083e49d782166 | C++ | glynos/url | /include/skyr/v2/unicode/ranges/views/unchecked_u8_view.hpp | UTF-8 | 3,904 | 2.546875 | 3 | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Copyright 2019-20 Glyn Matthews.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef SKYR_V2_UNICODE_RANGES_VIEWS_UNCHECKED_U8_VIEW_HPP
#define SKYR_V2_UNICODE_RANGES_VIEWS_UNCHECKED_U8_VIEW_HPP
#include... | true |
7aea2d89e8bf4c61f6ccd75008923ef53a9d5a41 | C++ | GRBurst/gates | /src/DeferredShading.cpp | UTF-8 | 6,467 | 2.671875 | 3 | [] | no_license | #include "DeferredShading.h"
DeferredShading::DeferredShading(const GLint& gBufferProgram, const GLint& deferredShadingProgram, Camera *const camera)
: mGBufferProgram(gBufferProgram)
, mDeferredShadingProgram(deferredShadingProgram)
, mGBuffer(0)
, mGDepth(0)
/* , mCamera(camera) */
, mGPositi... | true |
c2fc3add25d8c042925433a2c0a76cffac2ec54c | C++ | paksas/Tamy | /Code/Engine/gl-Renderer/GLRProceduralTextureResourcesStorage.cpp | UTF-8 | 2,500 | 2.515625 | 3 | [] | no_license | #include "gl-Renderer\GLRProceduralTextureResourcesStorage.h"
#include "gl-Renderer\GLRenderer.h"
#include "gl-Renderer\GLRDefinitions.h"
#include "gl-Renderer\GLRErrorCheck.h"
#include "SOIL.h"
#include "core\Log.h"
///////////////////////////////////////////////////////////////////////////////
word g_format_1 [] =... | true |
93260369aa4a3a067b1fd37fb3fb136c876422ad | C++ | ovr/scratchpad | /EMallocAllocator.h | UTF-8 | 1,566 | 3.015625 | 3 | [] | no_license | #ifndef EMALLOCALLOCATOR_H_
#define EMALLOCALLOCATOR_H_
#include <cstddef>
#include <limits>
#include <new>
extern "C" {
#include <Zend/zend.h>
}
template<typename T>
class EMallocAllocator {
public:
typedef T value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& r... | true |
e2e96d77e2f5a4bd962d3b78e4f6c0a37aa63fb5 | C++ | gaurav497/DAA | /Insertion_sort.cpp | UTF-8 | 847 | 3.25 | 3 | [] | no_license | #include<iostream>
using namespace std;
void insertion_sort(int arr[],int n)
{
int i,j,key,shifts=0,comparisons=0;
for(i=1;i<n;i++)
{
j=i-1;
key=arr[i];
while(j>=0 && arr[j]>key)
{
arr[j+1]=arr[j];
shifts++;
comparisons++;
j--;
}
ar... | true |
9516d4c6b001eb5bc45d84f4c99d7c6a599d635a | C++ | hansj66/micro-bot | /Firmware/microbit/microbit-dal/inc/types/ManagedType.h | UTF-8 | 6,659 | 2.796875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /*
The MIT License (MIT)
Copyright (c) 2016 British Broadcasting Corporation.
This software is provided by Lancaster University by arrangement with the BBC.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the... | true |
3c2a3d575e4b44c2765ad101a7e7c3343981bf7f | C++ | comran/cs32 | /homework_3/maze.cpp | UTF-8 | 1,326 | 3.28125 | 3 | [] | no_license | bool pathExists(std::string maze[], int nRows, int nCols, int sr, int sc, int er,
int ec) {
if(sr == er && sc == ec) return true;
maze[sr][sc] = '%';
if (sr > 0 /* there is a row above */ &&
maze[sr - 1][sc] != 'X' /* can move north */ &&
maze[sr - 1][sc] != '%' /* have not already vi... | true |
e3b8e2f4275e7a94308753c5d7be50405707be53 | C++ | ebender17/Galactic-Guardian- | /SceneGame.cpp | UTF-8 | 7,817 | 3.078125 | 3 | [] | no_license | #include "stdafx.h"
#include "SceneStateMachine.h"
#include "Protagonist.h"
#include "Bullet.h"
#include "SceneGame.h"
SceneGame::SceneGame(SceneStateMachine& sceneStateMachine)
: sceneStateMachine(sceneStateMachine), activateCount(0),currLevel(1), numLevels(3), playerState(ALIVE), secPlayerDeath(0.f), secEnemiesDea... | true |
b74f20342724fb372f338f61d541dcfb38ba1756 | C++ | krashton1/PixelArtGenerator | /src/PAG_CPP/PAG_CPP/AssetGenerator.cpp | UTF-8 | 14,609 | 2.65625 | 3 | [
"MIT"
] | permissive | #define _USE_MATH_DEFINES
#include "AssetGenerator.h"
#include <cmath>
#include <algorithm>
#include <deque>
namespace godot
{
AssetGenerator::AssetGenerator(Vector2 size /*= Vector2(1024,1024)*/, int numPixels /*= 64*/)
: mSize(size)
, mAssetSize(numPixels)
, mScreenSize(Vector2(1280, 720))
, mPixelSize(std:... | true |
d26ea523e175d0a10740fbf0cb4228c33d50e2c0 | C++ | JSY1988/Boost_USE | /memory/intrusive_ptr/intrusive_ptr.cpp | UTF-8 | 692 | 3.234375 | 3 | [] | no_license | #include <boost/smart_ptr.hpp>
using namespace boost;
int main(){
typedef intrusive_ptr<counted_data> counted_ptr; //类型定义
counted_ptr p(new counted_data); //创建智能指针
assert(p); //bool转型
assert(p->m_count == 1); //operator->
counted_ptr p2(p); //指针拷贝构造
assert(p->m_count == 2); ... | true |
b258eef75fdb7e60eb227b15b6fff66778bae579 | C++ | Swatigupta-droid/Data_Structures | /DSA PRACTICALS/MATRICES/sparselinked.cpp | UTF-8 | 1,574 | 3.625 | 4 | [] | no_license | #include<iostream>
using namespace std;
template<class T>
class sparselinked;
template<class T>
class node
{
int i;
int j;
T value;
node<T>* next;
friend class sparselinked<T>;
node(const T& val, int i,int j)
{
this->i=i;
this->j=j;
value=val;
}
};
template<class T>
class spars... | true |
0097a09ed6679aaaffd47ad596f9dcba37a9ce03 | C++ | Soplia/Codes | /JfF/CODE-JfF-B/Devcpp/devcpp1/枚举求素数.cpp | GB18030 | 982 | 3.15625 | 3 | [] | no_license | /*
Subject:ö
Compiler:Devcpp
Description:
Author:JiaruiXie
Id:4-6-2
Date_Begin:11/01/17 21:14
Date_End:11/01/17 21:58
*/
#include <stdio.h>
bool a[10001];
int main()
{
int n;
bool isOutput;
while(scanf("%d",&n)!=EOF)
{
//ûкʵʱ-1
isOutput=false;
for(int i=1;i<=n;i++)
a[i]=t... | true |
30ee9a807d50f06ac95326532c28614587291a2c | C++ | cbuchxrn/argus_utils | /argus_utils/include/argus_utils/random/UniformEllipse.hpp | UTF-8 | 2,576 | 2.734375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"AFL-3.0",
"AFL-2.1"
] | permissive | #pragma once
#include <Eigen/Core>
#include <Eigen/Cholesky>
#include <boost/random/random_device.hpp>
#include <boost/random/random_number_generator.hpp>
#include <boost/random/uniform_real_distribution.hpp>
#include <boost/random/mersenne_twister.hpp>
#include "argus_utils/utils/LinalgTypes.h"
namespace argus
{
/... | true |
daae2b9e143048599bb33df19d8639917db61ea7 | C++ | iceblinux/iceBw_GTK | /buhg_g/rnn_d5w.h | UTF-8 | 3,511 | 2.78125 | 3 | [] | no_license | /*$Id: rnn_d5w.h,v 1.4 2014/02/28 05:21:01 sasa Exp $*/
/*20.01.2015 03.04.2008 Белых А.И. rnn_d5w.h
Реквизиты для расчёта "Розшифровки податкових зобов'язань та податкового кредиту в розрізі контрагентів"
*/
class rnn_d5
{
public:
/*полученные налоговые накладные - податковий кредит********************/
cl... | true |
cf37d6c62a403ff4fd11e325392324e367581578 | C++ | kuronekonano/OJ_Problem | /广工 质方数.cpp | UTF-8 | 806 | 2.609375 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
bool zhishu(int x)
{
for(int i=2;i<x;i++)
{
if(x%i==0)
{
return false;
}
}
return true;
}
int main()
{
int i,j=0,n;
long long a[100005];
for(i=1;i<=100005;i++)
{
if(zhishu(i))
{
... | true |
0799e9eb3639f2978de4bf368a73ef4ccbdaf04d | C++ | ICS3U-Programming-Layla-M/Assign-03-CPP | /monthDays.cpp | UTF-8 | 11,620 | 3.75 | 4 | [] | no_license | // Copyright (c) Year Layla Michel All rights reserved.
//
// Created by: Layla Michel
// Date: May 13, 2021
// This program asks the user to input a month and year
// and then displays how many days are in that month on that year
#include <iostream>
#include <string>
// declare global variables
std::string month, mo... | true |
c7336c042865585c0199fde4f0a5febe7935fbd0 | C++ | qasimraheem/cpp11 | /2.Classes and Objects/14.std.move Function /main.cpp | UTF-8 | 438 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include "Integer.h"
using namespace std;
Integer add(const Integer &a, const Integer &b){
Integer temp;
temp.setvalue(a.getvalue()+b.getvalue());
return temp;
}
int main() {
Integer x(1);
std::cout<<x.getvalue()<<std::endl;
Integer y(std::move(x));//std move
std::cout<<... | true |
2cb4f62a43ec902eda067dfb4956b3de63ffda0f | C++ | Muzer/tmp-talk | /examples/ast/main.cpp | UTF-8 | 298 | 3.109375 | 3 | [] | no_license | #include "vectoradd.h"
#include <iostream>
#include <vector>
int main()
{
std::vector<int> a;
std::vector<int> b;
a.push_back(1);
a.push_back(2);
a.push_back(3);
b.push_back(4);
b.push_back(5);
b.push_back(6);
std::cout << ((a + a) + b)[1] << " (should be 9)" << std::endl;
}
| true |
9766bd4b72b9d5a05105852599964fd4626853dd | C++ | Song1996/Leetcode | /p222_Count_Complete_Tree_Nodes/p222.cpp | UTF-8 | 1,276 | 2.78125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <memory>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <string>
#include <assert.h>
#include <stdlib.h>
#include <fstream>
#include <algorithm>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : v... | true |
5887239dfe3fa3aa75c871ab62cb7ca15aacd458 | C++ | arkud/C-plus-plus-modern-development-basics | /White belt/3 week/First&second names-1/main.cpp | UTF-8 | 5,506 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
struct Name {
std::string first_name;
std::string last_name;
};
class Person {
private:
std::map<int, Name> pf_year_to_name;
std::vector<int> pf_years;
std::map<int, std::pair<bool, bool>> pf_is_name_set;
... | true |
8ffc7c10b0ab624feef4c0c93e2191f8cb149a61 | C++ | 210183/CP | /Contest & Online Judge/Kattis/Problems/ecocover.cpp | UTF-8 | 2,782 | 2.71875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Dinic {
static const int N = 10005;
struct Edge {
int from;
int to;
int flow;
};
vector<Edge> elist;
vector<int> adj[N];
int saiz;
int ptr[N];
int dist[N];
int source,sink;
int num;
Dinic(int _s = 0,int _t = 0,int _num = 0) {
source =... | true |
f9e75ff1d843a0db2f9fab7624d8f3f55e53ac09 | C++ | choi1019/utility | /parser/src/Lex.h | UTF-8 | 5,219 | 2.9375 | 3 | [] | no_license | /*
* Lex.h
*
* Created on: 2017. 3. 30.
* Author: choi.techwin
*/
#ifndef LEX_H_
#define LEX_H_ "LEX_H_"
#include "Exception.h"
#include <string>
#include <fstream>
using namespace std;
#define BLANKS " \t\n\r"
#define SPACE ' '
#define TAB '\t'
#define NEWLINE '\n'
#define BEGIN '{'
#define END '}'
#def... | true |
88fb05f8e44171902a7c8802c9fdec799c9749a3 | C++ | michelleferd/CS112-1 | /lab03/Vec.cpp | UTF-8 | 2,308 | 3.265625 | 3 | [] | no_license | /* Vec.cpp defines the methods for Vec, a simple vector class.
* Student Name:
* Date:
* Begun by: Joel C. Adams, for CS 112 at Calvin University.
*/
#include "Vec.h"
#include <stdexcept>
using namespace std;
Vec::Vec() {
mySize = 0;
myArray = NULL;
}
Vec::Vec(unsigned size) {
mySize = size;
(size > 0)? myAr... | true |
f7444e4ed9367ce3d2760ad73939792de758a0b0 | C++ | rickyharis39/nolf2 | /Game/ClientShellDLL/ClientShellShared/VarTrack.h | UTF-8 | 2,466 | 2.5625 | 3 | [] | no_license |
// Console variable tracker.. makes it easy to get and set the value of
// console variables.
#ifndef __VarTrack_H__
#define __VarTrack_H__
#include <stdio.h>
#include "iltclient.h"
#include "ILTStream.h"
class VarTrack
{
public:
VarTrack()
{
m_hVar = LTNULL;
m_pClientDE = L... | true |
8bc4d9f56b6e8ad35169c3d34e1c082f80a8b994 | C++ | Aminul1811/Engineers-Management-System | /PROJECT 1.cpp | UTF-8 | 20,810 | 3.109375 | 3 | [] | no_license | /**********header files**********/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
/************structure***********/
struct engineer_db{
char engineer_name[100];
char engineer_id[100];
int engineer_age;
char engineer_gender[100];
char engineer_hometown[100];
char engineer_add... | true |
aa843dec45679bb1415ebf4c7794f1b34f0f48d1 | C++ | gzc/leetcode | /cpp/1001-10000/1031-1040/Minimum Score Triangulation of Polygon.cpp | UTF-8 | 985 | 2.796875 | 3 | [
"MIT"
] | permissive | class Solution {
int dfs(vector<int>& A, map<pair<int, int>, int>& cache, int start_index, int end_index) {
pair<int, int> key = {start_index, end_index};
auto it = cache.find(key);
if (it != cache.end()) return it->second;
if (end_index - start_index < 2) {
... | true |
6d15f5e18df84a6f64f26676ce36d8e2e5a36a12 | C++ | KonradKap/Minecamp | /tests/Button/ButtonTests.cc | UTF-8 | 4,080 | 2.71875 | 3 | [] | no_license | /*
* ButtonTests.cc
*
* Created on: 4 cze 2016
* Author: konrad
*/
#include <boost/test/unit_test.hpp>
#include "Button/Button.h"
BOOST_AUTO_TEST_SUITE(ButtonTests);
BOOST_AUTO_TEST_CASE(pointsWithinButtonShouldBeRecognized)
{
ofImage image;
image.allocate(10, 10, ofImageType::OF_IMAGE_COLOR);
ButtonP... | true |
736876e9ed0b76009b3b2bbe21a6d47bf911df1e | C++ | zhiltsov-max/tower-defense | /modules/Game/Buildings/turret_bullet.cpp | UTF-8 | 1,399 | 2.75 | 3 | [] | no_license | #include "bullet.h"
TBuilding::Bullet::Bullet(const Point2f& pos_, float damage_, float acceleration_, TMob const* target_, ushort size_) :
pos(pos_),
damage(damage_),
acceleration(acceleration_),
target(target_),
size(size_),
color(DEFAULT_COLOR)
{}
static Graphics::ZIndex TBuilding::Bullet::getZIndex() const... | true |
5b6ae7682286cbed1625e6241fcde794a6deb53e | C++ | francis0407/SQL-Engine-On-LSM | /test/execution/SQLStatementSuite.cpp | UTF-8 | 4,996 | 2.5625 | 3 | [] | no_license | #include "gtest/gtest.h"
#include <map>
#include <stdio.h>
#include <dirent.h>
#include "expressions/Literal.h"
#include "expressions/AttributeReference.h"
#include "expressions/Comparison.h"
#include "operators/Scan.h"
#include "operators/Project.h"
#include "operators/Filter.h"
#include "operators/Join.h"
#includ... | true |
f0f6156b534bd8fc6d04b0c98e5385a707d00b32 | C++ | valentinjacot/backupETHZ | /Scientific programming/fib_2.cpp | UTF-8 | 390 | 2.6875 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<Eigen/Dense>
using namespace Eigen;
using namespace std;
int main () {
unsigned int n;
cout << "state n" << endl;
cin >> n;
Matrix2d m;
m << 0,1,1,1;
Vector2d v;
v << 0, 1;
//cout << v << endl << " " << m << endl;
for (unsigned int i= 0;i<n-1; i++){
v=m*v;
}
cout << "The "... | true |
44ea08353c115118b53704831d1372a1aad64e5a | C++ | thongngo3301/Codeforces | /Key races.cpp | UTF-8 | 299 | 3.078125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main() {
int s, v1, v2, t1, t2;
int sum1 = 0, sum2 = 0;
cin>>s>>v1>>v2>>t1>>t2;
sum1 = s*v1 + t1*2;
sum2 = s*v2 + t2*2;
if (sum1 == sum2)
cout<<"Friendship";
else {
if (sum1 < sum2)
cout<<"First";
else
cout<<"Second";
}
return 0;
}
| true |
b2033440758fd7fd2074f0e64e1637764b87ddde | C++ | ThomK1429/cpp_workshop2_2017 | /file_io_v1.cpp | UTF-8 | 444 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <fstream> // 1
using namespace std;
int main() {
// declare the in/out files
ifstream inFile; //2a
ofstream outFile; //2a
// open the files
inFile.open("inputFile.txt"); //3
outFile.open("outputFile.txt"); //3
// processing goes here
// close the files
... | true |
f6c280142640e14e416007f1bce859ca4a00737b | C++ | a-bezruchenko/prob_theory_lab | /element.h | WINDOWS-1251 | 2,997 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <list>
#include <string>
#include "canvas.h"
enum Type {TypeParallel, TypeSerial, TypeReal, TypeAbstract};
class abstractElement
{
public:
abstractElement();
Type getType(); // ; typeOf
bool operator==(abstractElement& other);
virtual long double prob_breaks() = 0; //
virtual Canvas* getImage... | true |
8f9356d64ca4d7174e6cbb4050da3e830c4fb7dc | C++ | zcily/test | /C++Primer/base/md5.cpp | UTF-8 | 2,814 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#include <fstream>
#include <stdlib.h>
#include <vector>
using namespace std;
struct md5_file
{
char *md5_file_value;
char *md5_file_name;
};
void find_same_value(md5_file *all_md5_file, int length) {
vector<md5_file*> same_file;
vector<vector<md5_file*> > sa... | true |
c939b4c3baf024c0b2f54ba1e236be4b8539e465 | C++ | KimHwon/Teamnote | /archive/2021 ICPC - fresh water/code/calipers.cpp | UTF-8 | 767 | 2.84375 | 3 | [] | no_license | //+ 정수 컨벡스 헐
void calipers(vector<point>& pt) {
sort(pt.begin(), pt.end(), [](const point& a, const point& b) {
return (a.xx == b.xx) ? a.yy < b.yy : a.xx < b.xx;
});
vector<point> up, lo;
for (const auto& p : pt) {
while (up.size() >= 2 && ccw(*++up.rbegin(), *up.rbegin(), p) >= 0)
up.pop_back();
while... | true |
89727da40e57c30ca6c1c660559405300353eb5b | C++ | davidsanchezg21/proyecto | /Proyec/obstaculos.cpp | UTF-8 | 1,170 | 2.5625 | 3 | [] | no_license | #include "obstaculos.h"
obstaculos::obstaculos()
{
posx=0;
posy=0;
vx=0;
vy=0;
r=0;
limite=0;
}
obstaculos::obstaculos(double _posx, double _posy,int _r, int _limi,int _vx, int _vy)
{
posx=_posx;
posy=_posy;
vx=_vx;
vy=_vy;
r=_r;
limite=_limi;
}
QRectF obstaculos::boun... | true |
4997bd2e0db6c8ee2e91a06c0ad1324f805f9bc9 | C++ | rodchenkov-sn/CLoxx | /ReiLang/Function.hpp | UTF-8 | 767 | 2.578125 | 3 | [] | no_license | #pragma once
#include "Callable.hpp"
#include "Environment.hpp"
#include "Ast.hpp"
class Function : public Callable
{
public:
explicit Function(Stmt::Function* declaration, std::shared_ptr<Environment> closure);
explicit Function(Expr::Lambda* declaration, std::shared_ptr<Environment> closure);
[[nodiscar... | true |
a6cb6a50639d6e02ec670873607ccb35ce29e8db | C++ | ssnhrytsiv/manager_task | /BL/Menu.cpp | UTF-8 | 1,294 | 2.921875 | 3 | [] | no_license | //
// Created by Nazar on 21.02.2017.
//
#include "../Entity/Task.h"
#include "../main.cpp"
int FirstMenu();
void add_new_task();
void menu()
{
int your_choice = 0;
while(your_choice != 5){
your_choice = FirstMenu();
switch (your_choice){
case 1:
{
add_ne... | true |
6872b48cbaacd80c07f2354a3cb66d9e7fd9788b | C++ | rlabrecque/RLEngine | /Core/src/ConVar.hpp | UTF-8 | 1,261 | 3.234375 | 3 | [] | no_license | #pragma once
class ConVar {
public:
inline ConVar(const char* name, const char* description, int value) : m_value(value), m_name(name), m_description(description), m_min(INT32_MIN), m_max(INT32_MAX) {
AddToList();
}
inline ConVar(const char* name, const char* description, const int value, const int min, ... | true |
0474a745cf6a6b68fd86359b202f1c9765b32b1e | C++ | weidongguo/ecs175_computer_graphics | /p3/graph.h | UTF-8 | 1,677 | 2.828125 | 3 | [] | no_license | #ifndef GRAPH_H
#define GRAPH_H
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include "vector.h"
#include "common_type.h"
class Graph {
friend class Polygon; //not used
friend class Line; //not used
friend class Polyhedron ;
int window_width;
int window_height;
public:Color b... | true |
80889904ca3574f3ba94a38495914c84a7bb867b | C++ | litityum/EventQueueSmilator | /main.cpp | UTF-8 | 9,574 | 3.03125 | 3 | [] | no_license | #include "Passenger.h"
#include "Event.h"
#include <sstream>
#include <fstream>
#include <vector>
#include <queue>
bool first_fly = true;
struct mycmp
{
bool operator()(Event*& p1, Event*& p2)
{
return *p1>*p2;
}
};
struct first_fly_cmp{
bool operator() (Passenger*& p1, Passenger*& p2){
... | true |