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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
edf7d6402d6b46be25962bd69341b48288bbfb9f | C++ | damarbo33/crosslib | /src/rijndael/rijndael.cpp | ISO-8859-7 | 12,651 | 3.015625 | 3 | [] | no_license | #include "rijndael.h"
/**
* Constructor
*/
Rijndael::Rijndael(){
b = NULL;
k = NULL;
//setKeyBlockLength(ks128/8, ks128/8);
}
/**
* Destructor
*/
Rijndael::~Rijndael(){
}
/**
* cifrar: Se encarga de cifrar el bloque recibido
*/
void Rijndael::cifrar(){
//Creacion de claves
//cout << "************... | true |
c5e43552d6b7f7e129e6e6760691a4ae547024c3 | C++ | MatheusFerreiradeOliveira/Codes | /Questões Aleatórias/Circuito bioquimico.cpp | UTF-8 | 783 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int c,l,palito;
cin>>c>>l>>palito;
while(c!=0 and l!=0 and palito!=0)
{
int matriz[l][c];
for(int i =0; i < l; i++)
{
for(int j=0; j < c;j++)
{
cin>>matriz[i][j];
}
... | true |
9aba87f64937cb2b78394b144e5157777ca9e3fd | C++ | shader-slang/slang | /source/core/slang-crypto.h | UTF-8 | 4,799 | 3.03125 | 3 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | #pragma once
#include "../../slang.h"
#include "../core/slang-string.h"
#include "../core/slang-blob.h"
#include "../core/slang-list.h"
namespace Slang
{
struct DigestUtil
{
/// Convert a binary digest to a string (lower-case hexadecimal).
/// Returned string is double the length of the digest.... | true |
861686590db328218100ec99e2b4ef687ee3073c | C++ | andeplane/molecular-dynamics | /src/atomlist.cpp | UTF-8 | 4,328 | 2.859375 | 3 | [] | no_license | #include <atomlist.h>
#include <utility>
#include <iostream>
#include <includes.h>
using CompPhys::Utils::at;
AtomList::AtomList(int initialAtomCount) :
m_atomsDirty(false),
m_onAtomMoved(0),
m_isIterating(false)
{
m_atoms.reserve(initialAtomCount);
}
AtomList::~AtomList()
{
m_indexMap.clear();
... | true |
7e6ba18221475541173b8cfa1a77ee98134dffbb | C++ | Streamlet/ZLibWrap | /src/encoding_win.cc | UTF-8 | 2,791 | 2.59375 | 3 | [
"MIT"
] | permissive | #include "encoding.h"
#include <Windows.h>
#if MSC_VER < 1600
#define nullptr NULL
#endif
namespace encoding {
namespace {
std::wstring ANSIToUCS2(const char *ansi, size_t length, UINT code_page) {
std::wstring ucs2;
int size = ::MultiByteToWideChar(code_page, 0, ansi, (int)length, nullptr, 0);
... | true |
ad459fefd26c3e104427e67746ae75ffaa7776aa | C++ | rebiscov/ACM | /S12/11506-vrebisco.cpp | UTF-8 | 2,550 | 2.890625 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <queue>
/* C'est comme le premier exo sauf qu'on double les noeuds (hors s et t) en deux noeuds, un noeud "in" ou les flux entre et un noeud "out" ou les flux sortent et entre les deux une arrete qui represente le cout pour retirer la machine */
unsigned int s, t, n, count... | true |
57fef8555154ada13202a67b3261e0270df888dd | C++ | BearZerk/Old-Code-Samples | /C Scripts/C++ OpenGL/Building.cpp | UTF-8 | 11,122 | 2.96875 | 3 | [] | no_license | #include "Building.h"
Building::~Building()
{
}
Building::Building() : xrot (0.0f), yrot(0.0f), zrot(0.0f), scale(0.5)
{
//Set up the 3 dfferent textures that's going to be used
tex_wall_id = Scene::GetTexture("./Brick.bmp");
if (tex_wall_id != NULL)
{
toTexture_wall = true;
}else{
toTexture_wall = false;
}... | true |
8106e59f53b41c0ac4ab8a2dc5be882c9823c2ef | C++ | XFeiF/DataStructures | /7-Tree/BinaryTree/biTreeFunc.cpp | UTF-8 | 1,796 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
// judge empty
bool isEmpty(BTree T){
if(!T) return true;
else return false;
}
// find the size of the binary tree
void findSize(BTree T, int &size){
if(!isEmpty(T)) {
size++;
findSize(T->left, size);
f... | true |
b81d1d1c66fe10450511ab4cade753630474eff6 | C++ | gzsus/COMP345-PROJECT | /COMP345 - PROJECT/assignment1/MapLoader.h | UTF-8 | 2,715 | 3.09375 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////////////////////////////////////
//
// MapLoader.h Samuel Renaud
//
//////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include<string>
#include<vector>
#include "Map.h"
class ... | true |
c12c08df14496672f538f2987d2256829a7beb68 | C++ | ascheglov/tile_game | /tests/regression_tests/move_tests.cpp | UTF-8 | 6,018 | 2.734375 | 3 | [] | no_license | #include "Game.hpp"
#include "catch.hpp"
#include "test_printers.hpp"
#include "test_game_config.hpp"
#include "TestClient.hpp"
TEST_CASE("move alone", "[game]")
{
Game game{TestGameCfg};
TestClient A(game, "A", {3, 2});
REQUIRE(A.m_state == PlayerState::Idle);
A.requestMove(Dir::Right);
game.t... | true |
73adf6540783d898f64c3cb279e7e0018507cf1c | C++ | ytong3/coding_practice | /leetcode/two_sum.cpp | UTF-8 | 883 | 3.125 | 3 | [] | no_license | class Solution {
public:
vector<int> twoSum(vector<int> &numbers, int target) {
multimap<int,int> valIdx;
for(int i=0;i<numbers.size();i++){
valIdx.insert(make_pair(numbers[i],i+1));
}
multimap<int,int>::iterator it1,it2;
it1=valIdx.begin();
it2=valIdx.end... | true |
a8ea4ea657f788f3a2a4755d91a2213a8d4f6da1 | C++ | rykvlv/Console-Match3 | /ConsoleMatch3/src/Model.cpp | UTF-8 | 7,521 | 2.796875 | 3 | [] | no_license | #include "Model.h"
namespace RBW {
Model::Model() :
_g{_rd()} {
_distro = {std::uniform_int_distribution<int>{0, COUNT_OF_CRYSTALLS - 1}};
_map.resize(HEIGHT);
for (auto& row : _map) {
row.resize(WIDTH);
}
}
void Model::Init() {
f... | true |
2bce87883a7295a616ac2a1fd0d43676558f5b7d | C++ | nadarb/Competitive-Coding | /Old/Gravity Guy/Gravity Guy/Gravity Guy.cpp | UTF-8 | 794 | 2.734375 | 3 | [] | no_license | // Gravity Guy.cpp : Defines the entry point for the console application.
//
#include <stdio.h>
int main()
{
long T, i, j, ans;
int willCross, lane;
char str[2][200001];
scanf("%ld", &T);
while (T--)
{
scanf("%s%s", str[0], str[1]);
i = 0;
ans = 0;
willCross = 1;
lane = -1;
while (str[0][i] != '\0'... | true |
609c761213c11c4c0429a39fe30a5c4d1eefcfbb | C++ | santosh7961/Competitive-programming | /Divide and Prune/Guess Number - leetcode 374.cpp | UTF-8 | 1,206 | 3.6875 | 4 | [
"MIT"
] | permissive | // Problem Description @ https://leetcode.com/problems/guess-number-higher-or-lower/description/
// Forward declaration of guess API.
// @param num, your guess
// @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
// C++
int guess(int num);
class Solution {
public:
int guessNumber(int n... | true |
ed033c1321ecff74fa7c6b2539e15cf60647626d | C++ | techmatt/d3d11-interceptor | /mLib/include/core-base/grid3.h | UTF-8 | 5,151 | 3.15625 | 3 | [
"MIT"
] | permissive |
#ifndef CORE_BASE_GRID3D_H_
#define CORE_BASE_GRID3D_H_
namespace ml
{
template <class T> class Grid3
{
public:
Grid3();
Grid3(size_t dimX, size_t dimY, size_t dimZ);
Grid3(size_t dimX, size_t dimY, size_t dimZ, const T &value);
Grid3(const vec3ul& dim) : Grid3(dim.x, dim.y, dim.z) {}
Grid3(const vec3ul... | true |
de5e932503296913d61bd48156cd51c6bee09bc9 | C++ | imoverflow/mycode | /3C/main.cpp | UTF-8 | 990 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int s[3]={0};
int res[3]={0};
void dfs(int b,int g,int r)
{
if(res[0]&&res[1]&&res[2])
return;
if(b+g+r<2)
{
if(b==1)
res[0]=1;
if(g==1)
res[1]=1;
if(r==1)
res[2]=1;
return... | true |
4ee31c427c8f140d9e283f16c7f11499f5655486 | C++ | trarck/yhgui | /yhgui/control/NormalButton.h | UTF-8 | 1,980 | 2.6875 | 3 | [] | no_license | #ifndef COCOS_YHGUI_CONTROL_NormalButton_H_
#define COCOS_YHGUI_CONTROL_NormalButton_H_
#include "Button.h"
NS_CC_YHGUI_BEGIN
/**
* 普通的按钮
* 尽量减少资源占用
* 只有一个label,根据不同的状态来改变label属性。
* 背景会有多个,根据不同状态来切换。
*/
class NormalButton:public Button
{
public:
NormalButton();
~NormalButton();
bool i... | true |
931f5848a3d8dde4ab0d8857eb8637ceeba0e15a | C++ | e-dzia/pea_3 | /Timer.cpp | UTF-8 | 882 | 2.984375 | 3 | [] | no_license |
#include "Timer.h"
Timer::Timer() {
}
Timer::~Timer() {
}
LARGE_INTEGER Timer::getTime() {
LARGE_INTEGER timer;
QueryPerformanceCounter(&timer);
return timer;
}
void Timer::start() {
time_start = getTime();
time_state = TIMER_STARTED;
}
void Timer::stop() {
if(time_state != TIMER_STARTED... | true |
c2c3cf4a9bbdf46ccad8416acb644c3b45aed8ad | C++ | JiangWeiGitHub/Trial | /C/DesignPattern/SimpleFactory/factory.h | UTF-8 | 686 | 3.703125 | 4 | [] | no_license | #include <iostream>
using namespace std;
enum PRODUCT_TYPE
{
TYPE_A,
TYPE_B
};
class product
{
public:
virtual void show() = 0;
};
class productA: public product
{
public:
void show(void)
{
cout<<"I'm product A!"<<endl;
}
};
class productB: public product
{
public:
void show(voi... | true |
0db8dc06f1e0b0db699aac42e4d6c4d86a4f8865 | C++ | shiyishiaa/DiskC | /Stack.h | UTF-8 | 407 | 3.546875 | 4 | [] | no_license | #pragma once
#include "Vector.h"
template<typename ElemType>
class Stack : public Vector<ElemType> {
public:
void push(ElemType const &elem) {
this->insert(this->size(), elem);
}
ElemType pop() {
return this->remove(this->size() - 1);
}
ElemType &top() {
return (*this)[th... | true |
7e73dbe166900f065f4baa2546230fb927d3fd8d | C++ | Zeimd/crender-mt | /software-renderer/include/ceng/datatypes/release-deleter.h | UTF-8 | 577 | 2.65625 | 3 | [] | no_license | /*****************************************************************************
*
* release-deleter.h
*
* Created By Jari Korkala 2/2015
*
*****************************************************************************/
#ifndef CENG_RELEASE_DELETER_H
#define CENG_RELEASE_DELETER_H
namespace Ceng
{
template<class t_Elem... | true |
a5cf84295c7192fe7a52d3518737d3e134e6ef22 | C++ | forest1102/Co-Sci-136 | /classwork7.cpp | UTF-8 | 601 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <random>
using namespace std;
string randomString(default_random_engine &e, uniform_int_distribution<int> &uchrs,
uniform_int_distribution<int> &ulens) {
int rlength = ulens(e);
int rchr = uchrs(e);
string rstring(rlength, rchr);
return rstring;
}
... | true |
dc6d3e83cf5bf5188f94f246106281184590e46f | C++ | OhSeungJin/GIFT | /GIFT_FUSE_prototype/util.cpp | UTF-8 | 1,058 | 3.171875 | 3 | [] | no_license | #include <cassert>
#include <cstdlib>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
ssize_t
writeAll(int fd, const void *buf, size_t len)
{
const char *ptr = (const char *)buf;
size_t num_written = 0;
do {
ssize_t rc = write(fd, ptr + num_written, len - num_written);
if (rc == -1) {
if... | true |
17d2b52008500fa407c6eae1a2bf6a17c7d118c8 | C++ | prepare/fog | /branches/stefanvt/Fog/Fog/Core/Misc.h | UTF-8 | 3,991 | 2.796875 | 3 | [
"LicenseRef-scancode-boost-original",
"LicenseRef-scancode-public-domain",
"BSD-3-Clause",
"MIT",
"X11",
"HPND"
] | permissive | // [Fog-Core Library - Public API]
//
// [License]
// MIT, See COPYING file in package
// [Guard]
#ifndef _FOG_CORE_MISC_H
#define _FOG_CORE_MISC_H
// [Dependencies]
#include <Fog/Build/Build.h>
#include <Fog/Core/Assert.h>
#include <Fog/Core/Constants.h>
#include <Fog/Core/Memory.h>
namespace Fog {
//! @brief This... | true |
4df3b24b28b337af0710f76e361945f07f244004 | C++ | sillyamao/alphatree | /libalphatree/bi/basebi.h | UTF-8 | 12,911 | 2.71875 | 3 | [] | no_license | //
// Created by godpgf on 18-9-4.
//
#ifndef ALPHATREE_BASEBI_H
#define ALPHATREE_BASEBI_H
#include "../base/normal.h"
#include "string.h"
#include <iostream>
using namespace std;
void callstsq_(const float *x, const float *y, int len, float &beta, float &alpha) {
float sumx = 0.f;
float sumy = 0.f;
fl... | true |
6fbcae3d977777d77aba37469ddd5815062eb2a5 | C++ | shash04/General_Coding | /Companies/Microsoft/OA_questions/Min_Steps_2_Piles_Equal_Height.cpp | UTF-8 | 1,165 | 3.640625 | 4 | [] | no_license | // Alexa is given n piles of equal or unequal heights. In one step, Alexa can remove any number of boxes
// from the pile which has the maximum height and try to make it equal to the one which is just lower
// than the maximum height of the stack. Determine the minimum number of steps required to make all of
// the ... | true |
98f93d148f9fdca6cbde6e969c73d2c9388a96b1 | C++ | darenlin49/ACM_Algorithm_Templates | /Math/generating_function.cpp | GB18030 | 4,500 | 3.34375 | 3 | [] | no_license | /*
ͨĸӦ---֣
HDU 1398 300ȫƽֵӲң1Ԫ4Ԫ9ԪмַƴnԪ(n <= 300)
(1+x+x^2+x^3+x^4+x^5+)(1+x^4+x^8+x^12+x^16+)(1+x^9+x^18+x^27+) = a1+a2*x+a3*x^2++an*x^n+
x^nϵΪ
resÿγһʽpro
*/
int a[17] = {1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289};
/* generating_function */
const int MAX = 400;
struct generatin... | true |
9827c23d71b206f13780a1bfe2d3eb108411e590 | C++ | pavlovandy/ft_retro | /src/AEnemy.hpp | UTF-8 | 1,527 | 2.546875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* AEnemy.hpp :+: :+: :+: ... | true |
9c23d58e8e6a838deafa170469a2de69b46ed283 | C++ | TrackPlatformTeam/trackPlatform-hardware | /Arduino/management/CommandManager.h | UTF-8 | 1,464 | 2.515625 | 3 | [] | no_license | #pragma once
#include <Arduino.h>
#include "../peripheral/SensorManager.h"
#include "../peripheral/EngineManager.h"
#include "../peripheral/ServoManager.h"
#include "../config/CommandsEnum.h"
#include "../utils/Converter.h"
/**
* @brief Peripheral manager class (parse commands and execute it)
* @attention First cal... | true |
1ebf733c3123c73642798a8fbc8a2c77cd390e9b | C++ | arabhiar/InterviewBit | /Tree Data Structure/inorder-traversal-of-cartesian-tree.cpp | UTF-8 | 1,105 | 3.53125 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define COUNT 3
struct TreeNode
{
int val;
TreeNode *left, *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
// Visualization of Tree
void print2DUtil(TreeNode *root, int space)
{
if (root == NULL)
return;
space += COUNT;
pri... | true |
ae3b8822051b44264c7688e459e1455686249baa | C++ | 0of/WebOS-Magna | /src/basedef/private/Comparer_p.h | UTF-8 | 3,826 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | #ifndef COMPARER_P_H
#define COMPARER_P_H
#include "../BaseTypes.h"
#include "../StaticTypeTrait.h"
#include "../CompilerTimeAssert.h"
//STL
#include <limits>
#include <cmath>
namespace Magna{
namespace Core{
template<
typename _Type
, class _TypeTrait = DigitStaticType... | true |
6b36a5d992330d1d4e207a189ca59c3eae1e1c6b | C++ | gitqwerty777/Nonogram-Solver | /dfsboard.cpp | UTF-8 | 7,125 | 2.703125 | 3 | [] | no_license | #include "board.h"
#include "dfsboard.h"
#include <cstdlib>
#define INF 2147483647
bool LimitFiller::getNextFillStart(){
if(fillStart.size() == 0){//this row is not tried yet, return original fs
fillStart.resize(l.size());
for(int i = 0; i < l.size(); i++){
fillStart[i] = l[i].fs;
}
} else {//get... | true |
9754ef084165205976f60a5cc2183fc7c1e83337 | C++ | cyyself/OILife | /POJ/3258 - River Hopscotch.cpp | UTF-8 | 558 | 2.546875 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
using namespace std;
int l,n,m;
int d[50005];
bool check(int x) {
int last = 0;
int cnt = 0;
for (int i=0;i<=n && cnt <= m;i++) {
if (d[i] - last < x) cnt ++;
else last = d[i];
}
return cnt <= m;
}
int main() {
scanf("%d%d%d",&l,&n,&m);
for (int i=0;i<n;i++) scanf("%d",... | true |
820724d6c7c66717134d5d9150c35a9b456c9c4d | C++ | rubyAce71697/machine_learning | /nsticksrectangle/main.cpp | UTF-8 | 767 | 3.671875 | 4 | [] | no_license | /*given n sticks of 1 unit each design a rectangle of maximum area
*/
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n;
float area;
cout<<"ENter the number of sticks";
cin>>n;
if(n%2 )
{
//if n is odd make it even
n = n-1;
cout<<"Only "<<n... | true |
26a932b9f61ffac6a5d0d9552e0bf3f537ed19d1 | C++ | wwuhn/wwuhn.github.io | /notes/notes/算法/Dijkstra.cpp | GB18030 | 7,369 | 3.609375 | 4 | [] | no_license | #include <iostream> // Dijkstra Ͻ˹
#include <stack> // ·
using namespace std;
//1 ݽṹ
const int N = 100; // еĸڳʼ̶
const int INF = 1e7; // ʼΪ10000000ʾһ㵽һ㲻ͨ
int map[N][N]; // ȨڽӾʾͨ;
int n,m; // nʾеĸmΪм·ߵѭ
int dist[N]; // ʾԴuj·Ϊdist[j]мֵ
int p[N]; // ʾԴuj·ǰڵΪp[j]мֵ
bo... | true |
e268df5733da995bfcfb771ef0203780d313d782 | C++ | albertZhangTJ/regression_based_machine_learning_to_predict_wind_power_generation | /dimension.h | UTF-8 | 692 | 2.515625 | 3 | [] | no_license | #ifndef DIMENSION_H
#define DIMENSION_H
#include <vector>
#include <string>
#include "structs.h"
using namespace std;
class dimension{
public:
int exp;
string name;
vector<double>* params;
vector<point>* data;
float l_bndry;
float r_bndry;
dimension(string ... | true |
eb87d32ec7ba6cec8cac3403ef2c80e44db7d6ce | C++ | captainwong/DSA | /include/dtl/hashtable.h | UTF-8 | 4,757 | 2.90625 | 3 | [] | no_license | #pragma once
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "bitmap.h"
#include "dictionary.h"
#include "entry.h"
#include "prime.h"
#include "release.h"
#include <string.h> // strlen, memset
namespace dtl
{
/**************散列函数*************/
//! 通用散列函数模板
template <typename T>
inl... | true |
3361f12bb04530bedb58b89ef8c2b4decc2ceae9 | C++ | xuejingao/schoolProjects235 | /project3/og/PlayList3.cpp | UTF-8 | 3,907 | 3.359375 | 3 | [] | no_license | /*
Author: JiaLe Qiu
Course: CSCI-235 Fall 2018
Instructor: Tiziana Ligorio
Assignment: Project 3
This is the implementation of "PlayList.h".
*/
#include <iostream>
#include <vector>
using namespace std;
#include "PlayList.h"
PlayList::PlayList(){
tail_ptr_ = nullptr;
} //default constructor
Play... | true |
123a7f10da991da129423d1a3fa9540e866186fa | C++ | geranium12/Numerical-Analysis | /SuccessiveOverRelaxation/SuccessiveOverRelaxation/LES.cpp | UTF-8 | 1,093 | 2.609375 | 3 | [] | no_license | #include "LES.h"
LES::LES(ExtendedMatrix exMatrix)
: mSize_(exMatrix.size()), matrix(exMatrix) {
curSol_ = new float[mSize_];
prevSol_ = new float[mSize_];
state = "LinearEquationsSystem";
}
int LES::findSolRelaxationMethod(int kMax, double accuracy, double option) {
state = "RelaxationMethod" + std::to_string... | true |
f3d60960a38869c9c19656547f285c2f276634f0 | C++ | farzadb/Arduino_BLE_iOS_CPP | /Arduino_Bluetooth_BLE/Arduino_Bluetooth_BLE.ino | UTF-8 | 2,354 | 3.4375 | 3 | [
"MIT"
] | permissive | #include <SoftwareSerial.h>
//This is a very simple sketch for chatting with the iPhone, iPad, or Desktop
//It will get a HELLO command to turn the light on or GOODBYE to turn it off.
//AT commands can be sent through the IDE Monitor command. Or just data can be sent back to the phone.
SoftwareSerial BLE_Serial(3, 4); ... | true |
a3fad49645ef4768123266dd6dc3f294283d66dd | C++ | DeMeiring/COS214-Project | /Engineering.cpp | UTF-8 | 1,201 | 2.625 | 3 | [] | no_license | #include "Engineering.h"
Engineering::~Engineering() {}
Engineering::Engineering(string RNDName, bool isDept)
{
this->RnD_Name = RNDName;
this->isDept = isDept;
}
string Engineering::getRnDName() {
// TODO - implement Engineering::getRnDName
return RnD_Name;
}
int Engineering::getCost()
{
return Cost;
}
int E... | true |
03fb1cc4863de3c9e95452a33eb6df1ab8dd4466 | C++ | haoxu686/Syntax-Parser | /State.h | UTF-8 | 754 | 2.6875 | 3 | [] | no_license | #pragma once
#include <vector>
#include "Project.h"
#include "Edge.h"
using namespace std;
class State
{
private:
vector<set<int> *> * pvAcceptedSets;
vector<set<int> *> * pvCascadeSets;
vector<Project *> * pvProjects;
Edge * pNextEdge;
int index;
public:
State(int);
~State(void);
void addToAcceptedSet(int,... | true |
ea1400647563b2d3d05061e0ca9fda486d46381b | C++ | tssavita/geeksforgeeks_solutions | /easy-level/sort-an-array-of-0s-1s-and-2s.cpp | UTF-8 | 983 | 2.640625 | 3 | [] | no_license | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | true |
4bc7722f12b264e2bb869ced250ddbb665b52ae3 | C++ | dougnobrega/Biblioteca | /Codigo/Matematica/polyFFT.cpp | UTF-8 | 3,530 | 3 | 3 | [] | no_license | // FFT
//
// Exemplos na main
//
// Soma O(n) & Multiplicacao O(nlogn)
template<typename T> void fft(vector<T> &a, bool f, int N, vector<int> &rev){
for (int i = 0; i < N; i++)
if (i < rev[i])
swap(a[i], a[rev[i]]);
int l, r, m;
vector<T> roots(N);
for (int n = 2; n <= N; n *= 2){
T root = T::rt(f, n, N);
... | true |
482e7f1f3f77fe61ac860b10debb4a8183f5286f | C++ | codyjrivera/cs403 | /exams/cilk/reduce.cpp | UTF-8 | 1,021 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <cilk/cilk.h>
template <typename T>
T reduce(T* array, int n, T (*op)(T, T), T id) {
if (n < 1) return id;
else if (n == 1) return array[0];
T* work1 = new T[n];
T* work2 = new T[n];
cilk_for (int i = 0; i < n; ++i) {
work1[i] = array[i];
... | true |
e25fba9ffc569230c90a5d73534bf0f28129fb86 | C++ | MathProgrammer/LeetCode | /Contests/Weekly Contest 291/Programs/Total Appeal of A String.cpp | UTF-8 | 1,060 | 2.921875 | 3 | [] | no_license | class Solution {
public:
long long appealSum(string S)
{
const int NO_OF_ALPHABETS = 26, NOT_FOUND = -1;
long long answer = 0;
vector <int> first_index(NO_OF_ALPHABETS, NOT_FOUND);
vector <long long> contribution(S.size(), 0);
for(int i = 0; i < S.size(); i++)
... | true |
5a054037b0c3a614dc782498bf37f5e7bcd273bc | C++ | changzeng/BasicAlgorithm | /bytedance/robot_DOS_game.cpp | UTF-8 | 364 | 3.09375 | 3 | [] | no_license | #include<vector>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int ans=0, building_num;
cin>>building_num;
vector<int> height_vec(building_num);
for(int ind=0; ind<building_num; ind++){
cin>>height_vec[ind];
}
for(int ind=building_num-1; ind>=0; ind--){
ans = ceil((ans+height_vec[ind]... | true |
ad00c2c0762c0ea513950603a921151bc67347ac | C++ | johnerlandsson/mcv | /QCornerGuardInspector/barcodesettings.cpp | UTF-8 | 1,162 | 2.578125 | 3 | [] | no_license | #include "barcodesettings.h"
#include <QSettings>
#include <QFile>
#include <iostream>
#include <QRegularExpression>
#include <QTextStream>
BarcodeSettings::BarcodeSettings() : timeout_s{ 10 }, n_error_frames{ 2 }
{
QSettings s;
valid_barcodes_path = s.fileName();
valid_barcodes_path.remove( QRegularExpres... | true |
929b98797eff47da1eb4d6cf97342127b9761472 | C++ | ViKoWW/Project-Euler- | /Problem2-Even_Fibonacci_Numbers.cpp | UTF-8 | 987 | 3.9375 | 4 | [] | no_license | #include "pch.h"
#include <iostream>
int start1 = 0;
int start2 = 1;
const int limit = 4000000;
int evenSum = 0;
//funktion som räknar ut fibonacci sekvensen samt identifierar om ena parametern, num2, är jämnt, isåfall läggs det till i summan evenSum.
void evaluateFibonacci(int num1, int num2) {
//checkar om talet är... | true |
9102b7e21a5a26913c93d75fc106ca741622acff | C++ | MayRiv/lab8CHMI | /lab8CHMI/calculator.cpp | UTF-8 | 8,322 | 2.546875 | 3 | [] | no_license | #include "calculator.h"
#include "ui_calculator.h"
#include <math.h>
#include <stdio.h>
#include <iostream>
#include <QDebug>
#include <QFile>
using namespace std;
/*Calculator::Calculator(QWidget *parent) :
QDialog(parent),
ui(new Ui::Calculator)
{
a=1.0/400;
n=5;
ui->setupUi(this);
}*/
Calculator:... | true |
1ce7c73251192b01b0ef9acb5e104c4e41040ff3 | C++ | pthom/BabylonCpp | /src/BabylonCpp/include/babylon/meshes/base_sub_mesh.h | UTF-8 | 1,214 | 2.515625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | #ifndef BABYLON_MESHES_BASE_SUB_MESH_H
#define BABYLON_MESHES_BASE_SUB_MESH_H
#include <memory>
#include <babylon/babylon_api.h>
#include <babylon/babylon_common.h>
namespace BABYLON {
class Effect;
struct MaterialDefines;
using EffectPtr = std::shared_ptr<Effect>;
using MaterialDefinesPtr = std::shared_pt... | true |
bd41c4441953ff62ef90327c546fa86152bf0353 | C++ | croccanova/CS162 | /Project 3 - Fantasy combat/Vampire.cpp | UTF-8 | 1,153 | 3.5 | 4 | [] | no_license | /******************************************************
Program Name: Project3 - Fantasy Combat
Author: Christian Roccanova
Date: 5/8/2017
Description: Header file for the Harry Potter subclass- inherits from Creature, contains virtual attack and defense functions
**************************************************... | true |
f47a0885d3710fed9db5ef6262aa1cfe47193e76 | C++ | rafarubim/Simulador-de-fluxo | /main.cpp | UTF-8 | 5,319 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "vectorPlus.hpp"
#include "matrix.hpp"
#include "numericalMethods.hpp"
#include "interface.hpp"
#include <thread>
#include "glut.h"
using namespace std;
#define EVER ;;
int _n = 0;
matrix<double> _A;
vector<double> _b;
vector<double> _x0;
vector<double> _x1;
vector<doubl... | true |
5a2e06c46bd417e456a4d01a8d49d77089348de7 | C++ | rahmatcmos/laravelstuff | /CityGisProcess/source/process/ParseCSV.cpp | UTF-8 | 3,807 | 2.625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <istream>
#include <sstream>
#include <fstream>
#include <string>
#include <libpq-fe.h>
#include <FileWatcher.h>
#include <ParseCSV.h>
#include <Positions.h>
#include <Events.h>
#include <Connections.h>
#include <Monitoring.h>
#include <Database.h>
using namespace std;
Positions p1;
Events... | true |
54a4c5dbd2be1f81ff35fdced22848931307d2eb | C++ | vietjtnguyen/ucla-winter09-cs174a-opengl-engine | /Vector4.h | UTF-8 | 7,330 | 3.09375 | 3 | [] | no_license | #ifndef VECTOR4_H
#define VECTOR4_H
#include "Generic.h"
#include "MathWrapper.h"
using namespace Degrees;
// Forward declarations
template <class T> class Vector2;
template <class T> class Vector3;
template <class T> class Vector4;
template <class T> class Matrix33;
template <class T> class Matri... | true |
54f8e4d3b5cd8077e585f8c6ae08181581e33e11 | C++ | anthonywei/FxRobot | /FxRobot/FxContact.h | UTF-8 | 1,750 | 2.546875 | 3 | [] | no_license | // -*- C++ -*-
//=============================================================================
/**
* @file FxContact.h
*
* $Id: FxContact.h 2009-11-05 aotain $
*
* @author anthony.wei <weishuo1999@hotmail.com>
*/
//=============================================================================
#... | true |
11afa69b040cb22384720a63556f7975b3e0fc29 | C++ | X-DataInitiative/tick | /lib/include/tick/array_test/array_test.h | UTF-8 | 16,978 | 2.765625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifndef LIB_INCLUDE_TICK_ARRAY_TEST_ARRAY_TEST_H_
#define LIB_INCLUDE_TICK_ARRAY_TEST_ARRAY_TEST_H_
// License: BSD 3 clause
#include "tick/base/base.h"
//
// Simple tests on ArrayDouble
//
/**
* @brief Testing test_ArrayDouble_creation : Test that we can create
* ArrayDouble with different constructors, Assign v... | true |
d6306322db405700f29424765a37a36ec8e7f02b | C++ | wu1274704958/gld | /include/tools/executor.h | UTF-8 | 2,111 | 3.015625 | 3 | [] | no_license | #pragma once
#include <functional>
#include <vector>
#include <mutex>
#include <chrono>
#include <cassert>
namespace gld {
enum class TaskType : uint8_t {
NextFrame = 0x0,
DelayFrame,
DelayMS
};
struct Task {
Task(std::function<void()> func):func(func){}
Task(std::function<void()> func, TaskType ty... | true |
4d6f58a3d7e7165fdcd3a13af83c49e42edc0766 | C++ | seleti/sid_alien_game | /game/drawable.h | UTF-8 | 2,112 | 3.328125 | 3 | [] | no_license | #ifndef DRAWABLE__H
#define DRAWABLE__H
#include <SDL.h>
#include <iostream>
#include "vector2f.h"
#include "frame.h"
using std::string;
// Drawable is an Abstract Base Class (ABC) that
// specifies the methods that derived classes may
// and must have.
class Drawable {
public:
Drawable(const Vector2f& pos, const Ve... | true |
4922c47ef8578217298acfe691f2570812d4a6d6 | C++ | hnlylmlzh/cs | /template/qeue_template/qeue_template/queue_template.h | UTF-8 | 458 | 3.40625 | 3 | [] | no_license | template <class Type>
class QueueItem {
public:
QueueItem() : item (0), next (0)
{
}
private:
Type item;
QueueItem* next;
};
template <class Type>
class Queue {
public:
Queue() : front (0), back (0)
{
}
~Queue()
{
while (!is_empty())
{
remove();
}
}
Type& remove();
... | true |
88c5f90871e8951d67acf17d60d73ce7ffe6b56f | C++ | rishabv90/High-performance-compute-project | /src/map1Proc5.cpp | UTF-8 | 1,460 | 2.59375 | 3 | [] | no_license | #ifndef MAP1PROC5
#define MAP1PROC5
#define CHANNELS 3 // we have 3 channels corresponding to RGB
__global__ void map1Proc5(float * redData, float * greenData, float * blueData, float * eroded_shadow, float * eroded_light, float * shadowRedArray, float * shadowGreenArray, float * shadowBlueArray, float * lightRedArray... | true |
2e788dbda5e609a5371f6b14a143ee4a624ec654 | C++ | doc-cloud/cpp | /container/begin-end-search.cpp | UTF-8 | 185 | 2.625 | 3 | [] | no_license | auto
begin_end_search(vector<int>const_iterator begin, vector<int>const_iterator end, int value)
{
for (; begin != end; ++begin)
if (*begin == value)
return begin;
return end;
}
| true |
9bc98d8cb27df3cc9e2a89f617f55afd67db8d84 | C++ | JustinWeq/Vulkan-Instanced-Quad | /Render Instanced Quad/Device.h | UTF-8 | 559 | 2.75 | 3 | [] | no_license | #pragma once
#include <vulkan.h>
// Used to manage a vk device
class Device
{
public:
// defualt constructor-- construct a new instance of Device
Device();
//initializes the vk device
//physicalDevice- the physical device to use for this Device
bool Init(VkPhysicalDevice physicalDevice);
//cleans up dynamically... | true |
317ae333ed3f0e7d8205cf01e53ed58f9a3a62af | C++ | tonycao/CodeSnippets | /C-CPP/Leetcode/pascals triangle ii.cpp | UTF-8 | 408 | 2.78125 | 3 | [] | no_license | class Solution {
public:
vector<int> getRow(int rowIndex) {
// Note: The Solution object is instantiated only once and is reused by each test case.
vector<int> array;
for(int i=0; i <= rowIndex; i++){
for(int j = i-1; j >0; j--){
array[j] = array[j-1] + array[j];
... | true |
07f6be17e261303e7a3d5b3627554d58516a51f1 | C++ | smilofoundation/ClaveChain | /Clave/Test/testMbedMktime.cpp | UTF-8 | 3,487 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | #include "stdafx.h"
#include "CppUnitTest.h"
#include <time.h>
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
typedef uint64_t sgx_time_t;
typedef struct mbedtls_x509_time
{
int year, mon, day;
int hour, min, sec;
} mbedtls_x509_time;
sgx_time_t mbedMktime(const mbedtls_x509_time *t);
#defin... | true |
ca66021cce826ce9fffd3758f3a4bec28888f126 | C++ | akshayaggarwal/LeetCode | /Q_734.cpp | UTF-8 | 1,059 | 2.828125 | 3 | [] | no_license | class Solution {
public:
bool areSentencesSimilar(vector<string>& words1, vector<string>& words2, vector<pair<string, string>> pairs) {
if(words1.size()!=words2.size())
return false;
map<string,vector<string>> mymap;
int i,j;
vector<string> vec;... | true |
a2c7029dcfbea566d48af9bfbd95523d78755ee9 | C++ | 11aman/c- | /inserting into array.cpp | UTF-8 | 500 | 3.234375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int arr[50],size,pos,num,i;
cout<<"size of array:"<<endl;
cin>>size;
cout<<endl;
cout<<"enter elements:"<<endl;
for(i=0;i<size;i++)
{
cin>>arr[i];
}
cout<<endl;
cout<<"insert number:"<<endl;
cin>>num;
cout<<endl;
cout<<"enter pos:"<<endl;
cin>... | true |
99f8ed88358051884c24c8624e65710dd19aa07b | C++ | koellsch/youbot_mechatroniklabor | /oberstufenlabor_mechatronik_robot/src/oberstufenlabor_mechatronik_robot/exercise04_collector_node.cpp | UTF-8 | 1,370 | 2.8125 | 3 | [] | no_license | #include <ros/ros.h>
#include "oberstufenlabor_mechatronik_robot/CollectBallsAction.h"
#include <actionlib/client/simple_action_client.h>
//############## MAIN ##################################################################################################
int main(int argc, char* argv[])
{
std::string color;
... | true |
9a3f1ce80bc78f1d96bf0aafc4c558357f1c3ee9 | C++ | theyimster/Class-Work | /AddressBook/addressbook.cpp | UTF-8 | 13,147 | 3.34375 | 3 | [] | no_license | // Description:
// Program allows user to use a file to keep an address book. This address book can be
// manipulated by the user in different ways. These include: displaying, editing, deleting, and searching the contacts.
// Program utilizes an array of structures which handles the manipulations. Also, the program ... | true |
4af79d8c6810f8d97a2f7b4f1252f0be5d24a16a | C++ | pawjasinski/multithreadTestStructure | /include/baseClass.h | UTF-8 | 279 | 2.53125 | 3 | [] | no_license | #ifndef BASECLASS_H
#define BASECLASS_H
#include "packet.h"
class Server;
class BaseClass {
protected:
Priority prior;
Server* serv;
public:
virtual ~BaseClass() {}
virtual void update() = 0;
void attach(Server* s) {serv = s;}
void detach() {serv = nullptr;}
};
#endif | true |
1a94cf5c2cd1de1c2ec3c77f1043f5ea451c766a | C++ | rusek/abb-cpp | /tests/success.cpp | UTF-8 | 1,201 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "helpers/base.h"
#include <string>
abb::void_block testVoid() {
EXPECT_HITS(1);
return abb::success().pipe([]() {
HIT();
});
}
abb::void_block testInt() {
EXPECT_HITS(1);
return abb::success(5).pipe([](int value) {
REQUIRE_EQUAL(value, 5);
HIT();
});
}
abb... | true |
1ee20eb7db564854b530acc25c50ff09eecf3b19 | C++ | nebsar/xmlRead | /deneme/readXML.cpp | UTF-8 | 785 | 2.53125 | 3 | [] | no_license | #include "pch.h"
#include "readXML.h"
#include <fstream>
#include<iostream>
readXML::readXML()
{
}
readXML::~readXML()
{
}
void readXML::setFile(std::string fileName) {
mfileName = fileName;
}
void readXML::readFile() {
std::ifstream inputFile(mfileName);
std::string row;
if (inputFile.is_open()) {
while (... | true |
02ee5b137a1625b2ccc435a44de9db94644dda64 | C++ | jeanpierrethach/Design-Patterns | /src/main/c++/patterns/iterator/main.cpp | UTF-8 | 1,976 | 4.03125 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
class Iterator;
class Aggregate
{
public:
virtual Iterator* createIterator() = 0;
};
class ConcreteAggregate : public Aggregate
{
private:
std::vector<int> m_vector;
public:
ConcreteAggregate(const unsigned int size)
{
m_v... | true |
9126e2924c5f3add0ffb6a54330aa995aa0ecba5 | C++ | BIGBALLON/NCTU_TCG | /FIb2584_EVAL_AI/Fib2584/Random.h | UTF-8 | 549 | 2.703125 | 3 | [] | no_license | #ifndef __RANDOM_H__
#define __RANDOM_H__
#include <ctime>
class Random
{
private:
struct RanCtx
{
unsigned long long a;
unsigned long long b;
unsigned long long c;
unsigned long long d;
};
public:
Random();
Random(unsigned long long seed);
~Random();
unsigned long long get_rand_num();
private:
in... | true |
0866619af88b7da99cfb29d9530baf71478fe2e1 | C++ | Emilio007/texasholdemsim | /Texas Holdem Sim/TexasHoldEmSim/TexasHoldEmSim/player.cpp | UTF-8 | 16,145 | 2.65625 | 3 | [] | no_license | // Player.cpp
#include "player.h"
using namespace std;
Player::Player()
{
}
Player::Player(double m, map<string, double>& preFlop, string Name): job(-1), fold(false),
bust(false), allIn(false), raised(false), myBet(0), decision(-1), dealHighBet(0), odds(-1), raiseAmt(-1)
{
money = m;
preF... | true |
8cf42be79d704e9a3ebbc5c6f59dcdf7fa009410 | C++ | arbainrahat/CPU-Scheduling-Algorithms-OS | /Bakery.cpp | UTF-8 | 1,292 | 2.734375 | 3 | [] | no_license | #include(pthread.h)
#include(stdio.h>
#include(unistd.h>
#include (assert.h>
volatile int NUM_THREADS = 10;
volatile int Number[10] = {0};
volatile int count_cs[10] = {0};
volatile int Entering[10] = {0};
int max()
{
int i = 0;
int j = 0;
int maxvalue = 0;
for(i = 0; i < 10; i++)
{
if ((Number[i]) > ma... | true |
c323be0b7b518a10e8c658baa78340c2b4a19811 | C++ | VoreWind/CommentOrganizer | /commentparser_test.cpp | UTF-8 | 9,543 | 3.015625 | 3 | [] | no_license | #include <QString>
#include <doctest.h>
#include <commentparser.h>
SCENARIO("Rewriting single comments according to code style") {
GIVEN("Simple single-line code enclosed in /*...*/") {
QString wrong_source_code = "/*mycool test comment*/";
WHEN("Run the wrong code through comment parser") {
auto pa... | true |
e9f23110770e0688313e5e1cddc259a43fdf25b1 | C++ | EnigmaSwanAdams/CS201-HW6 | /random-map.cpp | UTF-8 | 2,666 | 3.4375 | 3 | [] | no_license | /*
* Enigma Swan Adams
* CS201-HW6
* 4/7/21
*
* file name: random-map.cpp
* main program as described in the homework assignment on blackbuard
* calling the function randomMap() from main runs the full main program
*
*/
#include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include <random>
#include ... | true |
cdd489c36389e10800c3219043cf0869ed6f6b00 | C++ | leeeyupeng/leeeyupeng.github.io | /project/algorithm/leetcode2021/src/lcof.12.exist.cpp | UTF-8 | 1,505 | 2.734375 | 3 | [] | no_license | #include"leetcode.h"
class Solution {
private:
int offset[4][2]={{0,1},{0,-1},{1,0},{-1,0}};
int m,n;
int length;
vector<vector<vector<char>>> dp;
vector<vector<char>> visit;
bool dfs(vector<vector<char>>& board,string& word,int i,int j,int index){
if(visit[i][j] == 1){return false;}... | true |
812a7f39efccf42773c15eedb2d60a3726067e47 | C++ | MutantEel/Artemis-Cpp | /src/Entity.cpp | UTF-8 | 3,598 | 2.640625 | 3 | [
"BSD-2-Clause"
] | permissive | #include <Artemis/Entity.hpp>
#include <sstream>
#include <Artemis/Component.hpp>
#include <Artemis/World.hpp>
#include <Artemis/ComponentRegistry.hpp>
using namespace std;
namespace artemis
{
Entity::Entity(World* world, int id)
{
this->world = world;
this->entityManager = world->getEntityManager();
this->i... | true |
279def2852cd2f0698524cebc53aa14028993f22 | C++ | michaeljdietz/UniverseSimulator | /UniverseSimulator/GalaxyFactory.cpp | UTF-8 | 1,354 | 2.5625 | 3 | [] | no_license | #include "GalaxyFactory.h"
#include "Random.h"
#include "Game.h"
#include "Galaxy.h"
#include "Cluster.h"
GalaxyFactory* GalaxyFactory::_instance;
GalaxyFactory::GalaxyFactory(Game* game) {
_game = game;
}
GalaxyFactory* GalaxyFactory::getInstance() {
if (_instance) {
return _instance;
}
return _instance = ne... | true |
a5e6b5c21fbea361fba8ad45771e7a55b2af371e | C++ | BreadBasket95/Infix-to-Postfix-Converter | /Stack.h | UTF-8 | 1,124 | 3.25 | 3 | [] | no_license | /*******************************************************************************
* Stack.h
*
* author: Rikk Anderson
* date created: 9/27/2017
* last updated: 9/27/2017
*
* This files defines a Stack class used for infix to postfix conversion
*
******************************************************************... | true |
99f80bc49910b2679b468e7176d4e23054adb318 | C++ | PeachIcetea29/AlgorithmProblem | /baekjoon/2225. 합분해.cpp | UTF-8 | 439 | 2.703125 | 3 | [] | no_license | #include <stdio.h>
#define DIV 1000000000
int main() {
int N, K; scanf("%d %d", &N, &K);
long long d[201][201] = { 0, };
for (int i = 0; i <= N; i++) d[1][i] = 1;
for (int i = 2; i <= K; i++) {
for (int j = 0; j <= N; j++) {
for (int k = 0; k <= j; k++) {
d[i][j] += d[i - 1][k];
d[i][j] %= DIV;
}... | true |
88ce1d8dd7621b7f0e94c50d1b76475d47535e40 | C++ | rohitrtk/OpenGL | /OpenGL/src/Render/VertexBuffer.h | UTF-8 | 286 | 2.9375 | 3 | [] | no_license | #pragma once
class VertexBuffer
{
public:
VertexBuffer(const void* data, unsigned int size);
~VertexBuffer();
void bind() const;
void unbind() const;
unsigned int getID() const { return this->ID; }
void setID(unsigned int ID) { this->ID = ID; }
private:
unsigned int ID;
};
| true |
ac361a139bafe131417757683f04fa9620800913 | C++ | baiumbg/assignments | /fmi/oop/homework2/prog2/Conditional.h | UTF-8 | 373 | 2.890625 | 3 | [] | no_license | #pragma once
#include "Formula.h"
class Conditional : public Formula
{
private:
Formula* condition;
Formula* whenTrue;
Formula* whenFalse;
public:
Conditional(Formula*, Formula*, Formula*);
Conditional(const Conditional&);
double value() const;
void print();
Formula* clone() const;
Conditional&... | true |
29b864ce7499e9dd02c7a9d5121fc703547b637b | C++ | yular/CC--InterviewProblem | /LeetCode/leetcode_island-perimeter.cpp | UTF-8 | 876 | 3.0625 | 3 | [] | no_license | /*
*
* Tag: Implementation
* Time: O(nm)
* Space: O(1)
*/
class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
int ans = 0;
if(grid.size() == 0)
return ans;
int n = grid.size(), m = grid[0].size(), x = 0, y = 0;
for(int i = 0; i < n; ++ i){
... | true |
95deac62ce6a7821633810c71b39794b726adbed | C++ | Ritalin4Kidz/Map-Of-The-SYDE | /Map Of The SYDE/Map Of The SYDE/Player.h | UTF-8 | 2,954 | 2.6875 | 3 | [] | no_license | #pragma once
#include "SYDEstdafx.h"
#include "Inventory.h"
class MOTS_Player {
public:
MOTS_Player() {}
virtual ~MOTS_Player() {}
Inventory _Inventory = Inventory();
void setHealth(int newHP) { play_health = newHP; }
int getHealth() { return play_health; }
void setMaxHealth(int newHP) { play_max_health = newH... | true |
7f9a8fd81e752f9d2b5eb1053e3e189754d8739f | C++ | LingerDavid/UVA | /uva_brute_force/12325.cpp | UTF-8 | 1,024 | 3.046875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int N,S1,V1,S2,V2;
int result;
void solve(){
int M1 = N / S1, M2 = N / S2;
int T = 50;
int res;
if(M1 > T && M2 > T){
//Volume:S2 * S1, S1 * S2
//Value:S2 * V1, S1 * V2
if(S2 * V1 < S1 * V2){
for(int i = 0;i < S2; i++){
res = i * V1 + (N - i * S1) / S2 * V2;
... | true |
e27072ea0f58131e2d7e2c0c9e204f788e4861ef | C++ | Z21459/OtherDemo | /SortAlgorithm/ReferenceAndPointer/StringOperator.cpp | GB18030 | 2,843 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <vector>
using namespace std;
//Ӵ ö̬滮
char * findMax(char*s1, char* s2) {//"baucbaud";"baudbaud"
int len = strlen(s1) <= strlen(s2) ? strlen(s1) : strlen(s2);//ȡС
int i, j, m = 0;
int p, q;
int length = strlen(s2);
//char a[100] = { 0 };
char *a = new char[100]{0... | true |
4a65bc303a931134f14579cbc061bd0b5e9655c2 | C++ | Hybrid-Music-Lab/Unicycle | /Source/Timeline.cpp | UTF-8 | 4,353 | 2.5625 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2019 Christoph Mann (christoph.mann@gmail.com)
#include "Timeline.h"
using namespace unc;
using namespace lnf;
// Timeline
unc::Timeline::Timeline( double viewStart_, double viewLength_ ) :
viewStart( viewStart_ ),
viewLength( viewLength_ )
{
static_assert( spacing > 1 ); // spacing is used as div... | true |
a7f9fbb8dce45dc1233d56df7653991ec5d3650e | C++ | jizhuoran/spatial_data_processing | /histogram_drawing/getResults.cpp | UTF-8 | 4,774 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cstring>
#include <stdlib.h>
#define AGE_RANGE 81
#define BINS_NUMBER 8
#define THRESHOLD_NUMBER 7
using namespace std;
double estimate_eqWidth(int LEFT, int RIGHT, char * histogram_path)
{
unsigned int person_of_bin[BINS_NUMBER];
for (int i = 0; i < B... | true |
ccf843213caa7491b27f6bc8fc2e1e0a8574bf61 | C++ | AlasdairH/Batoidea | /Batoidea/src/BoundingBox.cpp | UTF-8 | 990 | 2.65625 | 3 | [] | no_license | #include "BoundingBox.h"
namespace Batoidea
{
bool BoundingBox::intersect(const Ray &_ray)
{
float tmin, tmax, tymin, tymax, tzmin, tzmax;
tmin = (bounds[_ray.sign[0]].x - _ray.origin.x) * _ray.inverseDirection.x;
tmax = (bounds[1 - _ray.sign[0]].x - _ray.origin.x) * _ray.inverseDirection.x;
tymin = (bounds... | true |
837db768df5dedebfa60ebc04cc44d9b785b3bd4 | C++ | AnabaenaQing/Source-Code_ShaderX_GPU-Pro_GPU-Zen | /GPU Pro5/06_Compute/Object-order Ray Tracing for Fully Dynamic Scenes/beCore/source/beValueTypes.cpp | UTF-8 | 2,807 | 2.625 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | /*****************************************************/
/* breeze Engine Core Module (c) Tobias Zirr 2011 */
/*****************************************************/
#include "beCoreInternal/stdafx.h"
#include "beCore/beValueTypes.h"
#include "beCore/beTextSerializer.h"
#include <lean/logging/errors.h>
namespace b... | true |
77b042f556d1e2c6d6424b9b7fd5aa81fe43ee1e | C++ | psj01/PersonalProjects | /The Josephus Problem/TheJosephusProblem.h | UTF-8 | 1,794 | 3.21875 | 3 | [] | no_license | /***************************************************************************************************
The Josephus Problem
The problem is known as the Josephus problem and postulates a group of soldiers of size
N surrounded by an overwhelming enemy force. There is no hope for victory without
reinforcements, ... | true |
fc84e9c27ac4ae548251cb24f1020870bf8ac2c0 | C++ | yyzYLMF/myleetcode | /33_search_in_rotated_sorted_array.cc | UTF-8 | 1,525 | 3.84375 | 4 | [] | no_license | /*
@yang 2015/3/9
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).
You are given a target value to search. If found in the array return its index, otherwise return -1.
You may assume no duplicate exists in the array.
*/
#include <iostream>
... | true |
2abacefb5d522865e68a999f82405cb5764ffecf | C++ | myhumankit/declic | /code/arduino/experimentations/detectcontractio_/detectcontractio_.ino | UTF-8 | 2,490 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <Mouse.h>
#include <MHK_Button.h>
VirtualButton bouton(LOW);
#define HOLD_RIGHT_TIME 500
#define SEUIL 50
unsigned long start_time = 0;
bool is_hold = 0;
bool is_long_press = 0;
bool long_press_end = 0;
int seuil = 400;
void setup()
{
// put your setup code here, to run once:
Serial.begi... | true |
393f626a5e4867d933d5d713bc04ca08f86b78c3 | C++ | Gaurav-71/Ballot-Box | /V_INPUT.CPP | UTF-8 | 2,948 | 2.671875 | 3 | [] | no_license | void captains :: getinfo()
{
gtype("\20",15+BLINK,6,14);
gotoxy(10,14);char_chk(c1,10,14);
gtype(" ",0,6,14);
gtype("\20",15+BLINK,6,15);
gotoxy(10,15);char_chk(c2,10,15);
gtype(" ",0,6,15);
gtype("\20",15+BLINK,6,16);
gotoxy(10,16);char_chk(c3,10,16);
gtype(" ",0,6,16);
}
void vice_captains :: getinfo()
... | true |
d2167e112a56fff1785ff15e35290030936a161c | C++ | fangyoujun/PathFinding-by-PRM | /sources/grid.cpp | UTF-8 | 1,451 | 3.140625 | 3 | [] | no_license | #include "grid.h"
Grid::Grid()
{
for (int x = top_left_x; x < max_x; x+=edge)
{
for (int y = top_left_y; y < max_y; y+=edge)
{
Node* node = new Node();
GridNode[x/edge][y/edge] = *node;
}
}
}
vector<Node> Grid::neighbors(const Node& node)
{
std::vector<... | true |
4e37ea2346c377b58acaa2f8cc4f86b6e561c27a | C++ | js2664118/StanleyJonathan_CSCCIS5_Spring2018 | /Assignments/Assignment 6/Gaddis_8thEd_Ch8_Prob2_LotteryWinner/main.cpp | UTF-8 | 1,180 | 3.109375 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Jonathan Stanley
* Created on March 15, 2018, 12:30 PM
* Purpose: This is your template for your Mac
*/
//System Libraries Here
#include <iostream>
using namespace std;
//User Libraries Here
//Global Constants Only, No Global Variables
//Like PI, e, Gravity, or conversions
//Fu... | true |
84082c49ad7d64f5e11ef9a2b631302210e997c7 | C++ | ZackMisso/NailString | /stringpart.h | UTF-8 | 400 | 2.75 | 3 | [] | no_license | #pragma once
class StringPart
{
private:
int startNail;
int endNail;
int endSide;
public:
StringPart();
StringPart(int sn, int en, int es);
// getter methods
int getStartNail();
int getEndNail();
int getEndSide();
// setter methods
void setStartNail(int... | true |