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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
02bf41a01870787d9a3e22b7d719fe07e14ee55e | C++ | amauryESGI/4A_COLMANT_LOQUET_BATTLE_IA | /BattleIA_V2/BattleIA_V2/BattleIA_V2/Util.hpp | UTF-8 | 240 | 2.71875 | 3 | [] | no_license | #ifndef __UTIL_HPP__
#define __UTIL_HPP__
#include <algorithm>
class Util
{
public:
static float width;
static float heigth;
static float clip(float n, float limit)
{
return std::max(0.f, std::min(n, limit));
}
};
#endif | true |
5660cefa29d5acab85ffc62a160d63ca58159fc4 | C++ | vvvictorlee/eossmartcontractssafeframeworks | /contractscxx/crowdsale/distribution/PostDeliveryCrowdsale.hpp | UTF-8 | 1,188 | 2.796875 | 3 | [] | no_license | //
#include "../validation/TimedCrowdsale.hpp"
#include "../../token/ERC20/ERC20.hpp"
#include "../../math/SafeMath.hpp"
/**
* @title PostDeliveryCrowdsale
* @dev Crowdsale that locks tokens from withdrawal until it ends.
*/
class PostDeliveryCrowdsale : TimedCrowdsale {
// using SafeMath for uint256_t;
// ... | true |
545a07bd9f06dca924125a08ee3996aae123b85c | C++ | trevinwong/space_pearates | /src/DataLoaders/player_data_loader.cpp | UTF-8 | 1,052 | 2.53125 | 3 | [] | no_license | #include "player_data_loader.hpp"
PlayerData PlayerDataLoader::playerData;
void PlayerDataLoader::loadPlayerData()
{
std::ifstream ifs(player_path("player_data.txt"));
checkValidFilename(ifs, player_path("player_data.txt"));
float sizeX, sizeY;
float maxVelocityX, maxVelocityY;
float maxAccelX, maxAccelY;
... | true |
c86c0f083fd2cf9842a486dcb2beeefa8683e761 | C++ | pkufahl/sample | /SimpleString.cpp | UTF-8 | 4,760 | 3.375 | 3 | [] | no_license | //
// Created by Peter Kufahl on 8/21/15.
//
#include "SimpleString.h"
#include <algorithm>
std::pair<char *, char *> SimpleString::allocate_and_copy(const char *first, const char *last) {
auto str = _alloc.allocate(last - first);
return { str, std::uninitialized_copy(first, last, str) };
}
void SimpleString::r... | true |
3cb8d0c20853bbf8b862fc07dfb153ac421a04fa | C++ | ceosss/coding | /LeetCode/Array/3Sum.cpp | UTF-8 | 1,318 | 3.0625 | 3 | [] | no_license | class Solution
{
public:
vector<vector<int> > threeSum(vector<int> &nums)
{
// TC - o(n^2)
// SC - o(1)
vector<vector<int> > res;
int n = nums.size();
sort(nums.begin(), nums.end());
for (int i = 0; i < n; i++)
{
if (i > 0 && nums[i] == nums[... | true |
dd1fd73253160b167c1bb273c71b39ec9bdafd38 | C++ | jennydvr/NeuralNet | /NeuralNet/SuperFang.cpp | UTF-8 | 610 | 2.625 | 3 | [] | no_license | //
// SuperFang.cpp
// Neuralmon_Mac
//
// Created by Jenny Valdez on 30/03/13.
// Copyright (c) 2013 Universidad Simon Bolivar. All rights reserved.
//
#include "SuperFang.h"
SuperFang::SuperFang() : Move(10)
{
name = "SuperFang";
}
void SuperFang::effect(Pet *me, Pet *foe)
{
// Chequea cuantos pp queda... | true |
4abc2cfed578e14b74c850ae84444419c5fe176d | C++ | Sindisil/ray-tracer-challenge-cpp | /tests/test_transformations.cpp | UTF-8 | 1,504 | 2.84375 | 3 | [
"MIT"
] | permissive | #include "transformations.h"
#include "doctest.h"
#include "matrix.h"
#include "primitives.h"
using raytrace::identity_matrix;
using raytrace::Matrix4;
using raytrace::Point;
using raytrace::Vector3;
TEST_CASE("A transformation matrix for the default orientation") {
auto from = Point{0.0f, 0.0f, 0.0f};
auto to ... | true |
4ea39522bb30876aa45aeb7a96835e6494e2f158 | C++ | SamridhG/Queue | /queue implement with stack in opps.cpp | UTF-8 | 1,444 | 3.484375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class node{
public:
int data;
node *next;
node(int data)
{
this->data=data;
this->next=NULL;
}
};
class stack{
private:
node *head;
public:
stack()
{
head=NULL;
}
void push(int data)
{
if(head==NULL)
{
head=new node(data)... | true |
3e9c70f7608d09e1fa2cc64e5d9fbe6c3473b0e9 | C++ | 81120/trival-s-exp-interpreter | /Block.cpp | UTF-8 | 632 | 2.75 | 3 | [
"MIT"
] | permissive | #include "./Block.hpp"
#include <string>
std::string toy_lang::Block::to_string() {
if (block_type_ == BlockType::Symbol) {
return ":" + raw_val_;
}
if (block_type_ == BlockType::Number) {
return raw_val_;
}
if (block_type_ == BlockType::String) {
return "\"" + raw_val_ + "\"";
}
if (block_t... | true |
67696990fc62112a40b943fa5a413c394f1b0ef2 | C++ | richiMarchi/Follow-The-Light | /follow_the_light/AnalogLed.cpp | UTF-8 | 199 | 2.703125 | 3 | [] | no_license | #include "AnalogLed.h"
#include "Arduino.h"
AnalogLed::AnalogLed(int pin){
this->pin = pin;
pinMode(pin,OUTPUT);
}
void AnalogLed::setIntensity(int intensity){
analogWrite(pin,intensity);
}
| true |
44547a1b1cd6ed330200888d5328ba165a3b576f | C++ | SanctuaryComponents/layer_management | /LayerManagerBase/include/GraphicalSurface.h | UTF-8 | 7,091 | 2.59375 | 3 | [
"BSD-3-Clause",
"Zlib",
"MIT",
"Apache-2.0"
] | permissive | /***************************************************************************
*
* Copyright 2010,2011 BMW Car IT GmbH
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.ap... | true |
a14b93a6047a66d1aa508d059100526d27e0c983 | C++ | ENSTABretagneRobotics/ardupilot2ros | /ardupilot2ros/src/iboolean.h | UTF-8 | 1,549 | 2.75 | 3 | [] | no_license | // Simple interval library from Luc JAULIN, with minor modifications from Fabrice LE BARS and Jeremy NICOLA.
#ifndef IBOOLEAN_H
#define IBOOLEAN_H
// IBOOLEAN is an interval Boolean. Used for a trivalued logic
// if x=[0,0]=ifalse : certainly false
// if x=[0,1]=iperhaps: don't know
// if x=[1,1]=itrue : certainly ... | true |
928dd68301067bc287315291097627882ab86481 | C++ | BlueSpells/MapGen | /Common/PendingList.h | UTF-8 | 3,295 | 2.953125 | 3 | [] | no_license | #pragma once
#include <map>
#include "TimeStamp.h"
#include "LogEvent.h"
#include "Common/CriticalSection.h"
template<typename PendingItem>
class CPendingList
{
public:
CPendingList(): m_CurrentRequestId(0), m_LastGeneratedId(0)
{
}
void ClearAll()
{
CCriticalSectionLocker Locker(m_Pendin... | true |
7603401a42b7f8fdcda9d71904a3d7dbd29615f9 | C++ | Zillit/ARC | /src/test.cpp | UTF-8 | 254 | 2.59375 | 3 | [] | no_license | #include "test.h"
#include <iostream>
using namespace std;
class Test;
Test::Test()
{
number_of_calls_=0;
}
int Test::test()
{
number_of_calls_++;
cout << "Number of test calls: " << number_of_calls_ << endl;
return number_of_calls_;
}
| true |
710ddb51cc6ba9f5f0c8d6ae50ef5c5dc6609eb0 | C++ | Hanray-Zhong/Computer-Science | /hust C语言学习/第七章/strstr.cpp | UTF-8 | 560 | 3.296875 | 3 | [] | no_license | #include <stdio.h>
int strlen(char []);
int strstr(char [],char []);
int main(void)
{
char cs[20],ct[20];
scanf("%s",cs);
scanf("%s",ct);
printf("%d",strstr(cs,ct));
return 0;
}
/*************strstr()************/
int strstr(char cs[],char ct[])
{
int j=0,k;
for(;cs[j]!='\0';j++)
if(cs[j]==ct[0])
{
... | true |
1911b7b0c2742953811844a29d1627ef69b8f193 | C++ | AguaClara/sensor_dev | /code/MIA/turbidity_sensor5.ino | UTF-8 | 3,203 | 3.0625 | 3 | [] | no_license | /*
* THIS CODE IS FOR AGUACLARA SENSOR_DEV
* This code's function is to take the input voltage from the turbidity sensor
* and translate it into a numerical value for turbidity
*/
//global variables
int ledPin = 13; //declaration for LED
int button = 11; //digital input of the pushbutton
int off... | true |
1c67f38994e45d5014e0b7ca80bc2feca92a501e | C++ | adiM3344/ex3 | /DefineVarCommand.cpp | UTF-8 | 1,340 | 3.046875 | 3 | [] | no_license |
#include "DefineVarCommand.h"
/**
* defines a variable according to the data provided and adds it to the symbol table
* @return the number of indexes to move in the commands map
*/
int DefineVarCommand::execute() {
Singleton* singleton = Singleton::getInstance();
// gets the data the belongs to this variab... | true |
400f687490dea31a2ac2f64fb8158970a8eb613d | C++ | tinglai/Algorithm-Practice | /LeetCode/Unique Binary Search Trees II/main.cpp | UTF-8 | 2,413 | 3.6875 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct TreeNode{
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL){}
};
class Solution{
public:
vector<TreeNode *> generateTrees(int n){
vector<TreeNode*> result;
if(n <= 0){
result.pu... | true |
9d45ddb1b677356f14e937ca632a1987148875d1 | C++ | matvey1997/MetProgHomeworks | /metProghome1.cpp | UTF-8 | 1,476 | 3.125 | 3 | [] | no_license | #include<tuple>
#include<vector>
#include<string>
#include<iostream>
#include<cstdio>
using namespace std;
template<int N>
class tupleReader {
public:
template<class T1, class ... otherClasses>
static tuple<T1, otherClasses ...> readTuple(tuple<T1, otherClasses ...> *temp) {
T1 a;
cin >> a;
... | true |
f731a3aa84b0de20b3de605cdec8b6769772eae4 | C++ | stormbreaker07/CodingQuestions | /problem set 3/codeforcesdivision_2_11.cpp | UTF-8 | 633 | 2.765625 | 3 | [] | no_license | #include <bits/stdc++.h>
#include<iostream>
#include<string>
#include<deque>
using namespace std;
int main()
{deque<char> d;
int n;
cin>>n;
string s;
cin>>s;
d.push_back(s[0]);
if(s.length()%2!=0)
{for(int i=1;i<s.length();i++)
{if(i%2!=0)
{d.push_front(s[i]);}
else
{d.push_... | true |
0aa60e1da3f8d7a4382670e41468ce66fedcef6e | C++ | byJunKim/GIS | /libstreetmap/src/m4.cpp | UTF-8 | 19,095 | 2.640625 | 3 | [] | no_license | #include <thread>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include "map_list.h"
#include "m3.h"
#include "m2.h"
#include "m4.h"
//// generates path from start point using greedy algo
//Seg_array path_gen(const IntersectionIndex intersect_id_start,
// ... | true |
6d927a1301414c25ca6c05a482f375f2e2ba746e | C++ | royyjzhang/leetcode_cpp | /189_RotateArray.cpp | UTF-8 | 844 | 3.015625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<queue>
#include<stdlib.h>
#include<string>
#include<algorithm>
#include<map>
#include<math.h>
using namespace std;
class Solution {
public:
void rotate(vector<int>& nums, int k) {
int len = nums.size();
if (len == 0)
return;
int maxindex = k % len,... | true |
43ef523eb55d92bc66f656500f9766ed3a3fc74b | C++ | Luiz6ustav0/competitiveProgramming | /codeforces/632A.cpp | UTF-8 | 731 | 2.75 | 3 | [] | no_license | #include <bits/stdc++.h>
#define _ \
ios_base::sync_with_stdio(0); \
cin.tie(0);
int main() {
int numberOfTests = 0;
int lines = 0, columns = 0;
std::cin >> numberOfTests;
char black = 'B', white = 'W';
for (int i = 0; i < numberOfTests; ++i) {
std::cin >>... | true |
3d4807bea8bb59fd25343a41435954c6ae124ad6 | C++ | eshamidi/2010_CS | /carRental/car rental.cpp | UTF-8 | 465 | 2.84375 | 3 | [] | no_license | //Car Rental 9/8
#include <iostream.h>
#include <apstring.h>
main()
{
apstring make, model;
//Make and Model
cout<< "Enter in the model and make of your car.\n"
<<"Make:";
cin>> make;
cout<< "Model:";
cin>> model;
//License Plate Code
char c1,c2,c3;
long num1;
cout<< "Enter in the license plate of ... | true |
befb7c156d9f66052b8114a2ec90fdaab905a98e | C++ | runngezhang/sword_offer | /sword_offer/cpp/36_两个链表的第一个公共结点.cpp | UTF-8 | 2,691 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <map>
#include <stdio.h>
#include <sys/time.h>
#include "ListNode.h"
#include "my_vector.h"
/*
typedef struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(nullptr) {}
} ListNode;
*/
class Solution {
public:
// 1. hash方式
// 时间复杂度O(n + m),空间复杂度O(n)... | true |
11782725650475bc53360ea6a043d9a6feab2a6d | C++ | wzAdmin/Graph | /WoodHome/UIFrame/EffectFactory.cpp | UTF-8 | 929 | 2.53125 | 3 | [] | no_license | #include "EffectFactory.h"
#include "Trace.h"
#include "EffectFadeto.h"
CEffectFactory::CEffectFactory(void)
{
Register(Effect_FadeTo, CEffectFadeto::Create);
}
CEffectFactory::~CEffectFactory(void)
{
}
bool CEffectFactory::Register( EffectType effect , CreateFunc func )
{
CreaterIt it = mCreaterMap.find(effect);
... | true |
cb63118649368b51e91ac337bc72ab1c1ed54806 | C++ | alaminbhuyan/CPP-Programming | /OPARETOR/Tarnary operator/Untitled1.cpp | UTF-8 | 172 | 2.890625 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
int main()
{
int num = 18;
string result = (num<20) ? "Good morning" : "Good evening";
cout<<result;
}
| true |
888731621528bf1307bce3ed16b409c0b2d66c1a | C++ | sikotidis/SmartGridMarket | /SmartGridMarket/Producer.h | UTF-8 | 1,517 | 2.890625 | 3 | [] | no_license | #pragma once
#ifndef PRODUCER_H
#define PRODUCER_H
#include <thread>
#include "Bank.h"
#include "Energy.h"
class Producer : public Bank{ // Producer inherits from Bank
private:
std::thread producer_thread;
int type;
int id; // Producer id
int credits; // Credits a producer has
int time... | true |
e5ca3bb5a9176a57b3725363f87ff91778f31ffe | C++ | NeymarL/LeetCode | /1007-1013/#24 Swap Nodes in Pairs.cpp | UTF-8 | 1,191 | 3.859375 | 4 | [] | no_license | /**
* #24 Swap Nodes in Pairs
* https://leetcode.com/problems/swap-nodes-in-pairs/
*
* Given a linked list, swap every two adjacent nodes and return its head.
*
* Example:
*
* Given 1->2->3->4, you should return the list as 2->1->4->3.
*
* Note:
* Your algorithm should use only constant extra space.
* ... | true |
c06e31cbe1ea77f2c512f31c3688c79bedf1e7e7 | C++ | HimanshuGunjal10/CPP-Programs | /LeetCode/Tag-Hash/1078. Occurrences After BigramNOTOPTIMIZED.cpp | UTF-8 | 1,141 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <unordered_map>
using namespace std;
{
stringstream ss(text);
string prev2,prev1,curr;
vector<string> res;
while(ss >> curr)
{
if(prev2 == first && prev1== second)
res.push_back(curr);
prev2 = prev1;
prev1 = curr;
}
ret... | true |
1255bf1b0ef3377fc810a098df2c85187f770e2d | C++ | shubhendra/HyperMarketInventory | /Jobs.cpp | UTF-8 | 4,867 | 3.03125 | 3 | [] | no_license | #include "Jobs.h"
Jobs::Jobs(){}
Jobs::Jobs(string _code)
{
code=_code;
}
string Jobs::getjobcode()
{
return code;
}
bool Jobs::readjobDetails(ifstream *readFile)
{
if( code == "ADD")
{
job_add(readFile);
return true;
}
else if(code == "DELETE")
{
job_delete(readFile);
return true;
}
else if(code ... | true |
75899a5d2b2cd50270b5c6a51bfee3dce61732ad | C++ | chenmin1116/my_data_struct | /stack_and_queue/DoubleQueue_To_Stack.h | GB18030 | 1,841 | 4.3125 | 4 | [] | no_license | //ʹʵһջ
//ջȽУȽȳ
#pragma once
#include<iostream>
#include<queue>
using namespace std;
template<class T>
class Stack
{
private:
queue<T> queue1;
queue<T> queue2;
public:
void Push(const T& node)
{
if(queue1.empty() == true && queue2.empty() == true)//оΪʱ,ݵʱѡqueue1
{
queue1.push(node);
}
else
{
if(queu... | true |
7b77ca66fed2bbf7087842229ae01b53d999fc37 | C++ | boschglobal/iceoryx | /iceoryx_hoofs/include/iceoryx_hoofs/internal/relocatable_pointer/relative_pointer.hpp | UTF-8 | 4,574 | 2.515625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-export-compliance",
"BSD-3-Clause",
"EPL-2.0",
"MIT"
] | permissive | // Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http:... | true |
5741265362ca1e10f907f571cc15a9d13b99502d | C++ | avmal0-Cor/xr2-dsgn | /xr2-dsgn/sources/xray/maya_animation/sources/sisl/s1940.cpp | UTF-8 | 18,421 | 2.796875 | 3 | [] | no_license | #include "pch.h"
#define S1940
#include "sislP.h"
#if defined(SISLNEEDPROTOTYPES)
void
s1940(SISLCurve *oldcurve, sisl_double eps[], int startfix, int endfix, int iopen,
int itmax, SISLCurve **newcurve, sisl_double maxerr[],
int *stat)
#else
void
s1940(oldcurve, eps, startfix, endfix, iopen, itmax, newc... | true |
57cb46abdac6ebdc284fc0724eeb6d0a0cca6efb | C++ | bryanmlyr/School-Projects | /cpp_pool/cpp_d08/ex01/DroidMemory.cpp | UTF-8 | 1,077 | 3.078125 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2018
** piscine
** File description:
** ex01
*/
#include "DroidMemory.hpp"
#include <iostream>
DroidMemory::DroidMemory()
{
Exp = 0;
FingerPrint = random();
}
size_t DroidMemory::getFingerPrint()
{
return FingerPrint;
}
size_t DroidMemory::getExp()
{
return Exp;
}
void DroidMemory::setFi... | true |
372c61d8c7228cca26a86386b7a3ab4bff8b6228 | C++ | lockskywalker/EquivalanceRelationManager | /testequiv.cpp | UTF-8 | 1,388 | 3.46875 | 3 | [] | no_license | // CSCI 2530
// Assignment: 3
// Author: Nigel Smith
// File: testequiv.cpp
// Tab stops: 4
// **Say what this program does here. (replace this comment)**
#include <cstdio>
#include <iostream>
#include "equiv.h"
using namespace std;
int main(int argc, char** argv)
{
int n = 7;
int *... | true |
ca0a7d0b41dd0daec8811f27573b0a51de0b1032 | C++ | jenyu7/CS11-cpp | /lab1/units.h | UTF-8 | 353 | 3.21875 | 3 | [] | no_license | #include <string>
/* Immutable class that holds a value and its units */
class UValue {
// value of the object
double value;
// units of the value
std::string units;
public:
UValue();
UValue(double value, std::string units);
double get_value();
std::string get_units();
};
UValue convert_to(UVal... | true |
29b9e56d9e84fabb8f15a2b03ed76ff13b5337e3 | C++ | led-sudare/sudare_package | /lib/converter.h | UTF-8 | 905 | 2.640625 | 3 | [] | no_license | #pragma once
#include "polar.h"
#include "rectangular.h"
namespace sudare {
class converter {
public:
virtual ~converter() {}
virtual void operator()(rectangular const& rect, polar& polar) const = 0;
};
/** 直交座標から極座標へ変換する。補間はバイリニア。 */
class bilinear_converter : public converter {
std::vector<double> m_sin;
... | true |
c1cbbbbb95face24c2ecd9a4d617fa835a638118 | C++ | wangcy6/weekly | /KM/03code/book/Thinking-In-C-resource-master/C08/c0823.cpp | UTF-8 | 846 | 3.984375 | 4 | [
"Apache-2.0"
] | permissive | /*
*本题主要考查const对象和const成员函数之间的调用
*const对象只能调用const成员函数,这样才能保证
*成员函数不会修改const对象,编译器也会阻止你这
*么做.
*非const对象则任何成员函数都能够调用,因为成员
*函数无需保证任何事情,只需要它能够被正确调用即可.
*/
class ConstFunc {
int i;
public:
ConstFunc(int ii);
int noneConstFunc();
int constFunc() const;
};
ConstFunc::ConstFunc(int ii)
:i(ii)
{}
//非const成员函数
in... | true |
4d815d30b2d43d2a7937cef13cededbbf598c34c | C++ | yular/CC--InterviewProblem | /LeetCode/leetcode_binary-tree-maximum-path-sum.cpp | UTF-8 | 695 | 3.34375 | 3 | [] | no_license | /*
*
* Tag: Tree DP
* Time: O(n)
* Space: O(n)
*/
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int maxPathSum(TreeNode *root) {
res = INT_MI... | true |
53b1821ac5b9385445b46226639c904ce2c558ca | C++ | mengweimw/My-Plan | /2022/Learn/Class/4.1 封装/01.封装的意义_学生系统.cpp | UTF-8 | 479 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class Student
{
public:
string name; //!< 姓名
string id; //!< 学号
void setStudent(string in_name, string in_id)
{
name = in_name;
id = in_id;
}
void showStudent()
{
cout << "name: " << name <... | true |
e2aff750818edf0141f90ab1910e0f4d6e96cbe8 | C++ | Cryrivers/SPA | /SPA/Utility.cpp | UTF-8 | 964 | 2.53125 | 3 | [] | no_license | #include "stdafx.h"
#include "Utility.h"
#include "CFGNode.h"
#include "PKBController.h"
int indexOf(vector<int> list, int val)
{
for (int i = 0; i < list.size(); i++) {
if (list.at(i) == val) {
return(i);
}
}
return(-1);
}
int indexOf(vector<CFGNode*> list, CFGNode* val)
{
for (int i = 0; i < list.size();... | true |
c414a96008aa19e9fedc8c19e860046364b3c77b | C++ | terminator-128/BUAA-compilers2020 | /cxylex.cpp | UTF-8 | 4,939 | 3.046875 | 3 | [
"MIT"
] | permissive | #include<stdio.h>
#include<stdlib.h>
#include<string>
#include<vector>
#include<iostream>
#include<fstream>
using namespace std;
enum lexType
{
UNKOWNSY,// 0
BEGINSY,// 1
ENDSY,// 2
FORSY,// 3
IFSY,// 4
THENSY,// 5
ELSESY,// 6
IDENTSY,// 7
INTSY,// 8
COLONSY,// 9
PLUSSY,// 10
STARSY,// 11
COMMASY,// 12... | true |
655d0d8a190677905af5a270099d2f267e73376f | C++ | RobertasJan/hello-github | /main.cpp | UTF-8 | 234 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
int main()
{
std::ofstream output ("HelloTxt.txt");
for (int i=0; i<1000; i++) {
output << "Hello GitHub!" << '\n';
}
output << std::flush;
return 0;
}
| true |
4c3bfb3e110facf4daf40b1ac7931730ebb68a8e | C++ | TeachMeHow/TSP-genetic-algorithm | /PEA_3/MeasurementEngine.cpp | UTF-8 | 894 | 3.03125 | 3 | [] | no_license | #include "MeasurementEngine.h"
MeasurementEngine::MeasurementEngine()
{
}
MeasurementEngine::~MeasurementEngine()
{
}
void MeasurementEngine::poll(std::chrono::milliseconds elapsed_time, int gen_cnt, int mut_cnt, int best_val)
{
data.emplace_back(elapsed_time, gen_cnt, mut_cnt, best_val);
}
void MeasurementEngi... | true |
a7c2b352323a24023bdeeecb196f794f68dba2c3 | C++ | syrilzhang/CSU-Projects | /CS253/P2/fRead.h | UTF-8 | 478 | 2.625 | 3 | [] | no_license | /* Name: Luke Burford
* Date: 09/08/17
* Email: lburford@rams.colostate.edu
*/
#ifndef FREAD_H_INCLUDE
#define FREAD_H_INCLUDE
#include <string>
using namespace std;
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
using std::cerr;
#include <fstream>
using std::ifstream;
using std::ws;
// fRe... | true |
f934b16b881fb7e4c87398e4ef1a629039c9b3b1 | C++ | Klarksonnek/FIT | /IPK_2/common.h | UTF-8 | 2,262 | 2.625 | 3 | [] | no_license | /**
* Projekt: IPK - projekt 2: Prenos souboru
* Modul: common.cpp
* Autor: Klara Necasova
* Email: xnecas24@stud.fit.vutbr.cz
* Datum: duben 2016
*/
#ifndef COMMON_H
#define COMMON_H
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cerrno>
#include <sys/types.h>
#include ... | true |
d9ff7a21f3fae328e572517f8b090a46a7f09099 | C++ | mrdrivingduck/leet-code | /Offer63.BestTimeToBuyAndSellStock.cpp | UTF-8 | 1,981 | 3.734375 | 4 | [
"MIT"
] | permissive | /**
* @author Mr Dk.
* @version 2021/03/04
*/
/*
You are given an array prices where prices[i] is the price of a given
stock on the ith day.
You want to maximize your profit by choosing a single day to buy one
stock and choosing a different day in the future to sell that stock.
Return the maxi... | true |
007514d1481c124abbc1222ae2425dd4fd7254da | C++ | goldDaniel/Plug-N-Play | /Src/Game/Systems/PlayerWeaponSystem.h | UTF-8 | 1,994 | 2.8125 | 3 | [
"MIT"
] | permissive | #ifndef PLAYER_WEAPON_SYSTEM_H
#define PLAYER_WEAPON_SYSTEM_H
#include <Core.h>
#include "Graphics/Texture.h"
class PlayerWeaponSystem : public System
{
public:
PlayerWeaponSystem(ECSController * const ECS) : System::System(ECS) {}
void Update(float dt)
{
for(const auto& entity : entities)
... | true |
ab8e669b8519dbb5d6528479d092ab4add23db7e | C++ | cha63506/archive-45 | /U/old/graphics/grid.h | UTF-8 | 6,728 | 3.40625 | 3 | [] | no_license | #include <fstream>
/*+
* class grid
*
*//*#########################################################################*/
class grid
{
private:
int pen_i, pen_j;
color **pos;
void construct()
{
array = new (color *) [rows*cols];
pen_i=0;
pen_j=0;
pos=array;
}
public:
color **array;
co... | true |
6f3019de6fef03849d9d5961f701c56b7fc5d0d7 | C++ | gjmistkawi/file-transfer-system | /ftserver.cpp | UTF-8 | 12,353 | 3 | 3 | [] | no_license | /*
George Mistkawi
ftserver.cpp
Description:
Server opens and waits for a client to connect and send a command. Once a
command is recieved the server will either send the current working directory
or the contents of a specified file. Once the transaction is complete, the
connection is closed and the server continues to... | true |
c1a33893ccfb90da9df8ceb48a6992e1cf164cd5 | C++ | francoisludewig/SolidMechanics | /GeometricalSolid/Include/Disk.h | UTF-8 | 1,236 | 2.828125 | 3 | [] | no_license | #pragma once
#include "Shape.h"
#include <Matrix.h>
namespace GeometricalSolid{
class Disk: public Shape{
public:
RetDiskangle(const double radius, const double thickness, const double density):radius(raidus), thickness(thickness), density(density) {
this->init();
}
double Density() const { return thi... | true |
4923bc9241d81fb7933626aed46cd00dd0b6b4a2 | C++ | lruiz5/testrepo | /challenges/1NthSmallest/1NthSmallest/main.cpp | UTF-8 | 1,227 | 4.03125 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int findNthSmallest(vector<int> numbers, int n)
{
if (numbers.empty())//check for emtptyness
{
return 0;
}
else if (n > numbers.size())
{
cout << n << " is out of vector range." << endl;
return n;
}
//set minimum = first element in vector
//set... | true |
dba22e8a92aa42d30a15512d3990f11daa80d147 | C++ | chris-blackburn/plotscript | /threaded_interpreter.cpp | UTF-8 | 2,630 | 3.359375 | 3 | [] | no_license | #include "threaded_interpreter.hpp"
ThreadedInterpreter::ThreadedInterpreter(InputQueue* iq, OutputQueue* oq): m_iq(iq), m_oq(oq) {
start();
}
// evaluate a stream directly
ThreadedInterpreter::ThreadedInterpreter(OutputQueue* oq, std::istream& stream): m_oq(oq) {
if (!m_thread.joinable()) {
m_thread = std::threa... | true |
0861ad82cd32c39f8c334346a8a5fe56048ccdc0 | C++ | ivanliu1989/Helping-Santas-Helpers | /C++ code/exp1/Driver.cpp | UTF-8 | 1,049 | 2.640625 | 3 | [] | no_license | /**
* My version of the Naive Solution from
* https://github.com/noahvanhoucke/HelpingSantasHelpers
*
* Written by Rick Bischoff
* but I claim no license or copyright.
* https://github.com/rdbisch/Santa2014
**/
#include "Score.h"
#include "Naive.h"
#include <iostream>
#include <iomanip>
#include <string.h>
usi... | true |
d198a5a0d346aff59142b30e6a59124688ea13ec | C++ | khjoony/CPP_lesson | /CPP_lesson/CPP_lesson/struct_string_bookLibraryManagement.cpp | UTF-8 | 8,390 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | // Book Library Management
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
enum BOOKMAX {BOOK = 1000, NAME = 25, DESCRIPTION = 500 };
enum MENU {MENU_EXIT, MENU_CREATE, MENU_READ, MENU_UPDATE, MENU_SEARCH, MENU_DELETE };
enum ITEM { ITEM_PRICE = 1, ITEM_RENTAL };
struct _Book {
long lI... | true |
3819f5136c611b2018f8b577b7e4dab1795f80fa | C++ | LucasEBSkora/jogo-tecnicas | /Managers/GraphicsManager.hpp | UTF-8 | 1,305 | 2.640625 | 3 | [] | no_license | #ifndef GRAPHICSMANAGER_HPP
#define GRAPHICSMANAGER_HPP
#include <utility> // std::pair
#include <map>
#include <string>
#include <SFML/Graphics.hpp>
#include "../Utils/GeometricVector.hpp"
namespace DIM {
namespace Managers {
class GraphicsManager {
private:
std::map<std::string, sf::Texture*> asset... | true |
1455a128389b6f912ab2d7445622116c98e905b3 | C++ | TTashev/Cpp-Programming | /JudgeAssingment2/ClosestTowns/main.cpp | UTF-8 | 2,347 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include "Vector2D.h"
using namespace std;
int main()
{
int NumberOfTowns;
cin >> NumberOfTowns;
vector<string> Towns;
vector<double> TownCoordinatesX;
vector<double> TownCoordinatesY;
cin.ignore();
... | true |
08e33bbbb961d06f0111ed8274edaff50e92909c | C++ | kshashwat/Cpp-Basics | /Completed USACO Problems/crosswords.cc | UTF-8 | 1,607 | 3.03125 | 3 | [] | no_license | /*
ID: kshashw1
PROG: crosswords
LANG: C++11
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <math.h>
#include <utility>
using namespace std;
int main() {
ifstream fin ("crosswords.in");
ofstream fout ("crosswords.out");
long long N;
long long M;
string input_str;
f... | true |
6b149cb84069288d7f3e688d67edd58e08196d9d | C++ | binzume/cppfl | /include/encode.h | UTF-8 | 5,832 | 2.703125 | 3 | [] | no_license | #ifndef _ENCODE_H
#define _ENCODE_H
#include <string>
namespace Encode{
#ifdef _WIN32
#include <windows.h>
typedef int ENCODE;
static const ENCODE AUTO=0; // NOT SUPPORT
static const ENCODE SJIS=932;
static const ENCODE UTF8=CP_UTF8;
static const ENCODE EUCJP=51932; // NOT SUPPORT
static std::string encode(const ... | true |
42348fc1e9b291e5e38089da0e68a4a10f138826 | C++ | erekc/cartesian-data-generator | /src/test/test.cpp | UTF-8 | 1,466 | 3.203125 | 3 | [] | no_license | #include "../../headers/test/nndatatest.h"
#include "../../headers/test/nntrainingdatatest.h"
void acceptNNTrainingDataByValue(NNTrainingDataTest data){
std::cout << "Accepted NNTrainingData by value" << std::endl;
// data destructs
}
void test1(){
NNTrainingDataTest data1 = NNTrainingDataTest(50, 2, 3); ... | true |
f7e3dbb4eddc1475cfa4cb2cefcf1d38c9d67e4e | C++ | MokraneAc/TicTacToe_cpp | /tictactoe++/Logic.cpp | UTF-8 | 4,612 | 3.109375 | 3 | [] | no_license | #include "Logic.h"
bool Logic::isMovesLeft(char board[3][3])
{
for (int i = 0; i<3; i++)
for (int j = 0; j<3; j++)
if (board[i][j]=='_')
return true;
return false;
}
int Logic::game_over(sf::RenderWindow &window ,char board[3][3]){
string path2;
char result = evaluate(board,player,opponent);
if (result... | true |
bd56ff531f2c1b4b399a08941060b63d7c8f3e14 | C++ | KeinR/APPC_term_project | /src/nocopylazy.h | UTF-8 | 519 | 2.796875 | 3 | [] | no_license | #ifndef NOCOPYLAZY_H_INCLUDED
#define NOCOPYLAZY_H_INCLUDED
// Extended if the reason for no copy or move constructors/operators
// is because it's not worth the time and effort due to them
// not being used, rather than any technical reason.
class nocopylazy {
public:
nocopylazy();
virtual ~nocopylazy() = 0;
... | true |
bcad01fa220f16d7274a362d9ffda27308e44379 | C++ | tamyiuchau/competitve_programming_pratice | /poj/3253-fence_repair(not_tested).cpp | UTF-8 | 765 | 3.125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <set>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
vector<int> fence;
int search(const vector<int>::iterator begin,const vector<int>::iterator end) {
if (end - begin == 1)return 0;
if (end-begin==2)return accumulate(begin, end, 0);
int sum = accumulat... | true |
6e1db727619eacfbe0f51ce90a469b769bd6b4a0 | C++ | FeiZhao0531/PlayLeetCode | /LinkedList/0445-Add-Two-Numbers-II/main-20ms.cpp | GB18030 | 2,144 | 3.421875 | 3 | [
"MIT"
] | permissive | /// https://leetcode.com/problems/add-two-numbers-ii/
/// Author : Fei
/// Time : Jun-4-2019
#include <iostream>
#include "../SingleLinkedList.h"
#include "../SingleLinkedList.cpp"
#include <vector>
using namespace std;
class Solution {
public:
// 1.ת002ͬ
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2)... | true |
e5cbc24b7c0ba423ea89496d20aa81108ee798c5 | C++ | ImAbdollahzadeh/GenericLinkedList_HashTable | /GenericLinkedList.h | UTF-8 | 2,046 | 2.765625 | 3 | [
"MIT"
] | permissive | #pragme once
#ifndef GENERICLISTLIST_H_
#define GENERICLISTLIST_H_
template<typename T> struct Node
{
Node<T>* nextPointer;
Node<T>* backPointer;
T Value;
};
template<typename T, typename U> struct SameType
{
static constexpr bool result = false;
};
template<typename T> struct SameTyp... | true |
9ecf1ca6e23f47c61708f226598b81796b01609d | C++ | shadowcomer/CatLing | /Source/Task.h | UTF-8 | 2,153 | 3.15625 | 3 | [] | no_license | /*
This file contains the Task abstract class and specific
implementations of it.
A Task is a piece of code to be executed, accompanied by its
execution parameters.
This allows for deferred execution of a Task.
Tasks are scheduled for execution inside a TaskManager's queue.
*/
#ifndef TASK_H... | true |
a300dfaffc847f19556c814b7b3bf7354efb8126 | C++ | devedu-AI/Back_to_Basics | /Arrays/matrix_search.cpp | UTF-8 | 671 | 3.421875 | 3 | [] | no_license | //Optimized Search
#include<iostream>
using namespace std;
int main()
{
int n, m;
cin>>n>>m;
int arr[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cin>>arr[i][j];
}
}
int target;
cin>>target;
bool flag = false;
int r = 0, c... | true |
8dbfd1c6b42f8d376c2519964c67ed1c1f6ff335 | C++ | zeffrin/Zesmi | /ZesmiCore/initialize.cpp | UTF-8 | 1,569 | 2.5625 | 3 | [] | no_license |
#include "initialize.hpp"
Initialize* Initialize::_instance = NULL;
Initialize::Initialize()
{
}
Initialize* Initialize::getInstance()
{
if(_instance)
return _instance;
return ((_instance = new Initialize()));
}
bool Initialize::doInitialization()
{
#ifdef TARGET_OS_MAC
#error "TODO initializ... | true |
e9ee77ef3f1c62f478d3f195a48747f5373350ba | C++ | priety33/hashmaps | /Counting Elements.cpp | UTF-8 | 1,077 | 3.46875 | 3 | [] | no_license | class Solution {
public:
int countElements(vector<int>& arr) {
unordered_map<int,int> m;
for(int i=0;i<arr.size();i++) m[arr[i]]++;
int count=0;
for(int i=0; i<arr.size(); i++)
{
if(m.find(arr[i]+1)!=m.end())
{
count++;
... | true |
0f6cac8ad14f3ef2da45eef2de8153073a6ab28c | C++ | prudentboy/leetcode | /Solutions/999.available-captures-for-rook.cpp | UTF-8 | 1,562 | 2.921875 | 3 | [] | no_license | /*
* @lc app=leetcode id=999 lang=cpp
*
* [999] Available Captures for Rook
*/
class Solution {
public:
int numRookCaptures(vector<vector<char>>& board) {
int ans(0);
int i(0), j(0), x(0), y(0);
for (x = 0; x < board.size(); ++x)
{
for (y = 0; y < board[0].size(); ++... | true |
ff232f3fa5cbf88d1672e3db75b122308ff90497 | C++ | Alvarez-Rivera-Jorge-Adrian/Repo1B | /A_B_C_EN_C.cpp | UTF-8 | 543 | 3.09375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <cmath>
int main (){
float a, b, c, res, ress, resss;
printf("VALOR DE A: ");
scanf("%f", &a);
printf("VALOR DE B: ");
scanf("%f",&b);
res=a+b;
printf("\nLA SUMA DE A+B: %f: ",res);
ress=res*res*res;
printf("\nLA SUMA DE A+B ELEVADO AL CUBO: %f ", ress);
... | true |
6b9ad24a0124f8ba7d344af63501c9e8b0df1a77 | C++ | dirmich/MonkSWF | /src/tags/RemoveObject.h | UTF-8 | 979 | 2.5625 | 3 | [] | no_license | /*
* RemoveObject.h
* MonkSWF
*
* Created by Micah Pearlman on 5/7/09.
* Copyright 2009 MP Engineering. All rights reserved.
*
*/
#ifndef __RemoveObject_h__
#define __RemoveObject_h__
#include "mkTag.h"
#include <iostream>
using namespace std;
namespace MonkSWF {
class RemoveObjectTag : public IRemoveObje... | true |
cbc960da2c8655051098ff3a8e612b8abffe3ca6 | C++ | SpyrosLahanas/Alpha-Vantage-API-CPP | /sources/Instrument.cpp | UTF-8 | 4,087 | 3.015625 | 3 | [] | no_license | #include "Instrument.hpp"
void DayInfo::print()
{
std::cout << "Open: " << open << std::endl;
std::cout << "High: " << high << std::endl;
std::cout << "Low: " << low << std::endl;
std::cout << "Close: " << close << std::endl;
std::cout << "Adjusted Close: " << adjclose << std::endl;
std::cout <... | true |
26e4a9b790cac88615d3451ef046f304910d81b2 | C++ | Jackpon/Data-Structures | /school_acm/cpp/排队打水问题.cpp | UTF-8 | 1,061 | 3.609375 | 4 | [] | no_license | /*
1120: 排队打水问题
题目描述
算法提高 排队打水问题
时间限制:1.0s 内存限制:256.0MB
问题描述
有n个人排队到r个水龙头去打水,他们装满水桶的时间t1、t2………..tn为整数且各不相等,应如何安排他们的打水顺序才能使他们总共花费的时间最少?
输入格式
第一行n,r (n< =500,r< =75)
第二行为n个人打水所用的时间Ti (Ti< =100);
输出格式
最少的花费时间
样例输入
3 2
1 2 3
样例输出
7
*/
#include<iostream>
#include<algorithm>
#includ... | true |
50d8abc4f4cad5e297e7cafcd17a691e8bce6143 | C++ | mworley2/UVa | /uva00278.cpp | UTF-8 | 523 | 2.75 | 3 | [] | no_license | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
using namespace std;
int main() {
int cases;
scanf("%d", &cases);
for(int i=0; i<cases; i++) {
char piece;
int rows, cols;
scanf("\n%c %d %d", &piece, &rows, &cols);
switch(piece) {
case 'r':
printf("%d\n",min(rows, cols));
... | true |
60b4fc0e8c4c3517f63f5cf2a6e49be46199520b | C++ | gunzigun/CodingInterviews | /面试题66/面试题66/面试题66.cpp | UTF-8 | 739 | 3.9375 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
void multiply(const vector<int>& array1, vector<int>& array2)
{
int length1 = array1.size();
int length2 = array2.size();
if (length1 == length2 && length2 > 1)
{
array2[0] = 1;
for (int i = 1; i < length1; ++i)
{
array2[i] = array2[i - 1] * arra... | true |
8cc0b25162b75a671c71884ebfcc78cad7d26370 | C++ | rolandbernard/task-planner | /optimizer/src/permutation-genetic-algorithm.h | UTF-8 | 2,492 | 2.734375 | 3 | [
"MIT"
] | permissive | #ifndef PERMUTATION_GENETIC_ALGORITHM_H
#define PERMUTATION_GENETIC_ALGORITHM_H
#include <vector>
#include <algorithm>
#include <array>
#include <random>
#include <map>
#include <cstdlib>
#include <climits>
#include <thread>
#include "genetic-algorithm.h"
#include "util.h"
class PermutationGeneticAlgorithm : public ... | true |
4e60873ad115a55f8860d89ad28724bf3f90f34e | C++ | demadewe/first-repo | /Node.cpp | UTF-8 | 193 | 2.890625 | 3 | [] | no_license | class Node {
private:
Item item;
Node *next;
public:
Node(Item a)
{ item = a; next=NULL }
Node* getNext() {return next; }
void setNext(Node *n) { next = n; }
Item getItem() { return Item; }
};
| true |
5be0b28a4d7a039d5be6a6ad54a384384b5acfb4 | C++ | anmsg98/CG_OPGL | /CG_OPENGL_term/debug.h | UTF-8 | 797 | 2.65625 | 3 | [] | no_license | /*
made by sunkue.
*/
#pragma once
#include<time.h>
#include<crtdbg.h>
#include<assert.h>
namespace timer {
clock_t d_start{ 0 };
void start() {
d_start = clock();
}
void start_mes(const char message[] = "timer start :") {
std::cout << message << '\n';
d_start = clock();
}
clock_t end() {
retur... | true |
27be3693a151c5f97d204c3fbc2f34e54cff8128 | C++ | NinoRataDeCMasMas/HashTrie | /HashCollection/HashCollection.h | UTF-8 | 2,210 | 3.09375 | 3 | [] | no_license | /**
* @author Giovanny Alfonso Chávez Ceniceros (310831)
* Julieta Navarro Rivera (311012)
* Sebastián De la Riva Rivera (301608)
* Christopher Ochoa Gutierrez (310853)
*
* @file HashCollection.h
* @date Nov 25, 2018
* @version 1.0
* @brief... | true |
bd324f1dcc87735c80df485eba8161a9d7500941 | C++ | WeAreChampion/notes | /c/learn/CharOperate.cpp | IBM852 | 1,164 | 3.671875 | 4 | [
"Apache-2.0"
] | permissive | #include<iostream>
using namespace std;
//delete the ' ' from the string where start and ending
string trim(string str)
{
string newStr = "";
int start;
for(int i = 0; i < str.size(); i++) {
if(str[i] != ' ') {
start = i;
break;
}
}
int end;
for(int i = str.size() - 1; i >= 0; i--) {
if(str[i] != ' ')... | true |
5251eefd372d83de926fddadf00fb4ad3c471713 | C++ | BullDog481/Data_Structures | /Data_Struct/Data_Struct/Stack_Array.h | UTF-8 | 921 | 3.59375 | 4 | [
"MIT"
] | permissive | #pragma once
#define MAX_SIZE 101
int A[MAX_SIZE];
int top = -1;
//Last in First Out Collection (LIFO)
//a list with the restriction that insertion and deletion can
//be performed from only one end, called the top
/*Operations:
* Push(x) -> void
* Pop() -> elem
* Top() -> elem
* IsEmpty() -> boolean
* The... | true |
fb4028338c0614c0e1b370b013b70c0aafd221e9 | C++ | tfilla1/Universe | /Universe/ShaderUtils.cpp | UTF-8 | 2,779 | 2.71875 | 3 | [] | no_license | // ShaderUtils.cpp
// Universe
//
// Created by Aquilla Sherrock on 11/18/14.
// Copyright (c) 2014 Aquilla Sherrock. All rights reserved.
#include "ShaderUtils.h"
GLuint ShaderUtils::createShaderFromFile(const GLchar* path, GLenum shaderType) {
GLuint shaderID = glCreateShader(shaderType);
// Open i... | true |
e2ac333ff0d183c60c385461979d8bbebed2ace3 | C++ | uabti/coolfluid3 | /cf3/mesh/Reconstructions.hpp | UTF-8 | 12,803 | 2.5625 | 3 | [] | no_license | // Copyright (C) 2010-2011 von Karman Institute for Fluid Dynamics, Belgium
//
// This software is distributed under the terms of the
// GNU Lesser General Public License version 3 (LGPLv3).
// See doc/lgpl.txt and doc/gpl.txt for the license text.
#ifndef cf3_mesh_Reconstructions_hpp
#define cf3_mesh_Reconstructions_... | true |
8147b20dea6162a171932caef9708edd9853b738 | C++ | davmac909/MaciasDavid_CSC5_41202 | /Class/Monthly_Payment/main.cpp | UTF-8 | 1,516 | 3.109375 | 3 | [] | no_license | /*
* File: main.cpp
* Author: David Macias
* Purpose: Check out IDE
* Created on January 4, 2016, 10:18 AM
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here
int main(int argc, char** argv) {
//Declare and Init... | true |
a0b254036ab6096ba23e9f578f7ebeec2d8f0ab1 | C++ | nasa/EMTG | /emtg/src/Utilities/maneuver_spec_line.cpp | UTF-8 | 1,191 | 2.578125 | 3 | [] | no_license | //Jacob Englander 6/22/2018
//a box to put maneuver spec items in
#include "maneuver_spec_line.h"
namespace EMTG
{
void maneuver_spec_line::append_maneuver_spec_item(const std::string& frame,
const doubleType& epoch,
const math::Matrix<doubleType>& ControlVector,
const doubleType& StartMas... | true |
f4bd49b8abe3e27688076ea249044f455ef8b33c | C++ | baoxuezhao/solution_set | /string/patternMatching2.cpp | UTF-8 | 1,742 | 3.09375 | 3 | [] | no_license | //source: http://www.careercup.com/question?id=19587667
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
bool isMatch(char *str, char *pat)
{
int m = strlen(pat);
int n = strlen(str);
bool dp[m+1][n+1];
memset(dp, false, sizeof(dp));
dp[0][0] = true;
for(int j=1; j<=n; j++)
dp[0... | true |
2626acca5d7b72e44af5331ba452c57dc9f6c4c4 | C++ | navi-cs467/cubeRunner | /SOURCE/printMenu.cpp | UTF-8 | 2,832 | 2.71875 | 3 | [] | no_license | /***************************************************
** Program name: printMenu.cpp
** CS467 Capstone - 2D Runner - "Cube Runner"
** Team: NAVI
** Date: 4/23/2019
** Description: Source file for printMenu function.
****************************************************/
#include "../HEADER/printMenu.hpp"
//Pr... | true |
c8a74eba560e2a604c443e4c60833cd8f178f41d | C++ | sam12321/Wiley_Training_Programs | /dataStructs/sortAlgo/sortPrac.cpp | UTF-8 | 859 | 3.203125 | 3 | [] | no_license | #include<iostream>
using namespace std;
void quick_sort(int *a,int low,int high)
{
int pivot=a[low];
int i=low;
int j=low+1;
if(low>=high) return;
while(j<high)
{
if(a[j]<pivot)
{
i++;
int temp=a[i];
a[i]=a[j];
a[j]=temp;
}
j++;
}
int t=a[i];
a[i]=pivot;
a[low]=t;
quick_so... | true |
11bb83bc922a79b828df5e4ba5100061ffb5ab1a | C++ | guithin/BOJ | /13460/Main.cpp | UTF-8 | 1,624 | 2.609375 | 3 | [] | no_license | #include<stdio.h>
#include<vector>
#include<stdlib.h>
using namespace std;
struct pos {
int x, y;
pos() {}
pos(int q, int w) {
x = q; y = w;
}
};
int n, m;
char inp[15][15];
int dx[4] = { 0, 1, 0, -1 };
int dy[4] = { -1, 0, 1, 0 };
int ans = 10000000;
pos O;
void back(pos r, pos b, int cnt, int j) {
if (cnt >... | true |
79172fc901750510d64de900e5090f942e16c239 | C++ | gyuseon/Cplusplus | /Chapter2_01/Chapter2_01/Chapter2_02.cpp | UHC | 7,134 | 2.75 | 3 | [] | no_license | #include ".h"
//void print(int temp[5][5])
//{
// for (int i = 0; i < 5; i++)
// {
// for (int j = 0; j < 5; j++)
// cout << setw(3)<<temp[i][j];
// cout << endl;
// }
// cout << endl;
//}
//
//
//
//void main()
//{
// int k,cnt, tab[5][5];
// while (1)
// {
// cout << "The four type of matrix <1> <2> <3> <4>" << ... | true |
0d3aeca3c40eaa793fda81fc81bfd4f47f7e7a99 | C++ | wrapdavid/c-_Primer_book- | /src/Main16.cpp | UTF-8 | 213 | 2.9375 | 3 | [] | no_license | #include<iostream>
int main() {
std::string str;
std::string resault;
while(std::cin >> str)
{
for (char c : str)
{
if (!ispunct(c)) {
resault += c;
}
}
}
std::cout << resault << std::endl;
} | true |
21c4ff2ddeff99a943abd63a37d95dc1e2c72b54 | C++ | AlienCowEatCake/tet_mesh_gen | /src/geometry.h | UTF-8 | 1,352 | 3.046875 | 3 | [] | no_license | #ifndef GEOMETRY_H
#define GEOMETRY_H
#include <cstdlib>
// Класс точка с номером
class point
{
public:
double x, y, z;
size_t num;
point(double x = 0, double y = 0, double z = 0, size_t num = 0 )
{
this->x = x;
this->y = y;
this->z = z;
this->num = num;
}
};
/*
... | true |
6afc1bdab439de0a956f61b91692e6ac9b25a2c4 | C++ | limoiie/audittools | /src/core/common/str.cpp | UTF-8 | 2,642 | 2.84375 | 3 | [] | no_license | #include <common/str.h>
#include <Windows.h>
#define CP_GB2312 936
#define CP_GB18030 54936
namespace str {
UINT codepage(ansi_encoding_e const encoding) {
switch (encoding) {
case ACP:
return CP_ACP;
case UTF8:
return CP_UTF8;
case UTF7:
return CP_UTF7;
case GBK:
return CP... | true |
017265c5b57111f19410edf86c6ef1da96194ee3 | C++ | burntham/varsity.CSC3022H.assignment4 | /cmdline_parser.h | UTF-8 | 1,974 | 2.640625 | 3 | [] | no_license | /*
* cmdline_parser.h
*
* Created on: 22 Feb 2012
* Author: simon
*/
#ifndef CMDLINE_PARSER_H_
#define CMDLINE_PARSER_H_
#include <iostream>
#include <list>
#include <string>
#include <boost/program_options.hpp>
//---------------------------------------------------------------------------//
class cmdline... | true |
4088ef4a4a75340b7a884cf12e608bb491be4d6e | C++ | simmito/micmac-archeos | /src/uti_image/CPP_Ann.cpp | UTF-8 | 2,091 | 2.734375 | 3 | [] | no_license | #include <iomanip>
#include "AnnSearcher.h"
using namespace std;
inline bool ann_read_sift_file( const string &i_filename, vector<SiftPoint> &array )
{
if ( !read_siftPoint_list( i_filename, array ) ){
cerr << "ERROR: Ann: unable to read file " << i_filename << endl;
return false;
}
return true;
}
int An... | true |
108b490edc903f09634fc1049a7a7941d4997d7c | C++ | vbugaevskii/msu.supercomputers.course | /parallel-hw2-03/parallel-no/main.cpp | UTF-8 | 10,863 | 2.828125 | 3 | [] | no_license | #include <memory>
#include <cmath>
#include <iostream>
#include <fstream>
#include <chrono>
int N = 128, K = 5;
double hx, hy, hz, tau;
int dx, dy, dz;
const int LAYERS = 3;
class Timer {
public:
Timer() : t_delta(0) {}
virtual void start() = 0;
virtual void pause() = 0;
virtual double delta() = 0;... | true |
e852e6bb4d137dc0279e1af61219c2bdab957105 | C++ | ElephantT/TelegramBot_cpp | /bot/telegram/client.h | UTF-8 | 2,571 | 2.890625 | 3 | [] | no_license | // #pragma once
#include <stdexcept>
#include <optional>
#include <string>
#include <variant>
#include <vector>
#include <queue>
#include <memory>
struct TelegramAPIError;
class AbstractCPPClass {
public:
virtual ~AbstractCPPClass() = default;
};
class NewMessage : public AbstractCPPClass {
public:
NewMessag... | true |
e64a7c4e7d109ef70f4a6bee0ca154044faeb0c5 | C++ | abrdej/pigeon-war | /src/turn_based/move.h | UTF-8 | 1,043 | 2.90625 | 3 | [] | no_license | #pragma once
#include <turn_based/move_ability.h>
#include <turn_based/turn_system.h>
/**
* @brief Standard ability to move the entity.
*/
class move final : public move_ability, turn_callback_helper {
public:
enum class types { path, straight };
explicit move(std::int32_t range, types type = types:... | true |