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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0345257a9b5b4285b0c7c00965c42dac13b52a66 | C++ | Huangxy0106/CXCEngine | /Include/Engine/Core/CObject.h | UTF-8 | 796 | 2.546875 | 3 | [] | no_license | #ifndef CXC_COBJECT_H
#define CXC_COBJECT_H
#include "Core/EngineCore.h"
#include <memory>
namespace cxc
{
class World;
class LogicFramework;
/* CObject is the base class for all the engine core class */
class CXC_ENGINECORE_API CObject
{
public:
friend class LogicFramework;
CObject();
virtual ~CObject(... | true |
fdeb8a3468975325369d1fc72ced791167071994 | C++ | zpfbuaa/Algorithm-Data-Structures | /数据结构/3.书上数据结构代码/第3章/程序3-6(顺序栈退栈操作的实现).cpp | GB18030 | 484 | 3.578125 | 4 | [] | no_license | //3-6˳ջջʵ֣
int Pop(SeqStack &S,SElemType &x)//ջջΪ0
//ջջָһջԪͨͲxأջɹ1
{
if(S.top==-1)return 0;
x=S.elem[S.top--];
return 1;
};
/* (1)жǷΪգջʱջǿյģܽջ0
(2)ջգȽջָջȡȻtopָһ
*/
| true |
b3e43a2a373d67a39cf56a2485ea948139302fd5 | C++ | DanielM08/C-lculo-Num-rico | /calculoNumerico_atvd5/1_3simpson.cpp | UTF-8 | 1,674 | 3.765625 | 4 | [] | no_license | #include <iostream>
#include <cmath>
#include <stdlib.h>
#include <math.h>
double funcao(double );
double (*func) (double) = funcao; //Ponteiro para a função
double um_tres_simpson(double , double , int , double (*func)(double)); //Método 1/3 simpson
int main()
{
//Pre-definindo o numero de iteracoes e os intervalos... | true |
85f02fe27a94b08828c00027f5d416737c2a09b5 | C++ | dengjun/GrB | /deeplogger.cpp | UTF-8 | 2,010 | 2.859375 | 3 | [] | no_license | #include"deeplogger.h"
#include<list>
DeepLogger::DeepLogger(const char* fName) : BaseLogger(fName)
{
}
DeepLogger::~DeepLogger()
{
}
void DeepLogger::writeToLogNodes(std::map<Cell, node_ptr, CellComparator>& open, std::map<Cell, node_ptr, CellComparator>& close)
{
if (!gotoRoot())
{
return;
}
... | true |
f9a4523b38d3d2ce61d35ae43b470423df56fe65 | C++ | LBluu/1708SEM_ISIM | /大二下/C语言/部分作业/第七周作业/5.249_12.cpp | GB18030 | 822 | 2.84375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
void Print(int n);
int main(){
srand(time(NULL));
int n;
int i;
int memory[6];
for(i=0;i<6;i++){
memory[i] = 0;
}
int total = 0;
printf("û:");
while(true){
n = rand()%26+1;
Print(n);
total+=1;
if((n==20&&memory[0]==1)||(n==19&&memory[2]==1)||(n==... | true |
7895114280b226be3e7e6ca25050dfa150ff8caa | C++ | py2many/py2many | /tests/expected/lambda.cpp | UTF-8 | 230 | 2.96875 | 3 | [
"MIT"
] | permissive | #include <iostream> // NOLINT(build/include_order)
inline void show() {
auto myfunc = [](auto x, auto y) { return x + y; };
std::cout << myfunc(1, 2);
std::cout << std::endl;
}
int main(int argc, char** argv) { show(); }
| true |
d1110f51a61c80b5e8f3a121c03ff24b96deaec6 | C++ | amedhi/dmrg | /scheduler/inputparams.h | UTF-8 | 3,156 | 2.578125 | 3 | [] | no_license | /*---------------------------------------------------------------------------
* InputParameter: Classes for processing input parameters.
* Copyright (C) 2015-2015 by Amal Medhi <amedhi@iisertvm.ac.in>.
* All rights reserved.
* Date: 2015-08-17 13:33:19
* Last Modified by: amedhi
* Last Modified time: 2015-09-29 16:... | true |
889ff9b4e796457eacc316b5d61ddd522323e851 | C++ | tchen0123/Solutions-to-CLRS | /Chapter06-Heapsort/heap.cpp | UTF-8 | 1,499 | 3.625 | 4 | [] | no_license | #include "heap.h"
void maxHeapify(std::vector<int> &array, std::size_t size, std::size_t index)
{
std::size_t left = LEFT(index), right = RIGHT(index);
std::size_t largest;
if (left < size && array[left] > array[index]) {
largest = left;
}
else {
... | true |
89909767fb748be5ac38bf0cf1bfb7cc20140c52 | C++ | Hunger-Prevails/fluid_simulation | /include/particle_sampler.h | UTF-8 | 4,690 | 2.875 | 3 | [] | no_license | #pragma once
#include <storage.h>
using namespace std;
namespace learnSPH{
/*
* samples border particles on a triangular face
* Args:
* vertex_a - corner A of the triangular face
* vertex_b - corner B of the triangular face
* vertex_c - corner C of the triangular face
* samplingDistance - dista... | true |
7f543ff83385c75bcc5e03cd5441f1efe47061e5 | C++ | opentechschool-zurich/cpp-co-learning | /programming-principles-and-practice/12-display-model/ale/presentation/02-square/main.cpp | UTF-8 | 213 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include "Square.h"
using namespace std;
int main()
{
Square square{};
square.setWidth(10);
square.setHeight(5);
cout << "Area: " << square.getArea() << endl;
return 0;
}
| true |
f6ef8dbdeea256febdd1dcd6bf34cd7d785f7840 | C++ | yeodongbin/CppLecture | /09.1.2.TemplateParam.cpp | UHC | 818 | 3.875 | 4 | [] | no_license | #include <iostream>
using namespace std;
template <typename T, int nSize = 10> //ø Ű 2 Ƶ ȴ.
class CMyArray
{
private:
T* m_pData;
public:
CMyArray() { m_pData = new T[nSize]; }
~CMyArray() { delete[] m_pData; }
//迭
T& operator[](int nIndex)
{
if (nIndex < 0 || nIndex >= nSize)
{
cout << "ERROR: 迭 踦 ... | true |
92ee98b85cbe4ed876a41c1efa3d57aeca17ecf5 | C++ | AlexZhanghao/Algorithm--notes | /程序代码/LeetCode/double pointer/removeElement.cpp | UTF-8 | 871 | 3.390625 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int nsize = nums.size();
if (nsize == 0) {
return 0;
}
int fast = 0, slow = 0;
while (fast < nsize) {
if (nums[fast] == val) {
Exchange(nums[fast], nums[slow]);
+... | true |
f7dc3470dd721cb5864c499ac08cc7b911f91dde | C++ | TheUnicum/MathForGameDevelopers | /MathForGameDevelopers/src/mfgd/matrix.cpp | UTF-8 | 9,608 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | #include "matrix.h"
#include <string> // for std::memset
Matrix4x4::Matrix4x4(const Vector & v0, const Vector & v1, const Vector & v2, const Vector & v3)
{
v[0] = { v0.x, v0.y, v0.z, 0.0f };
v[1] = { v1.x, v1.y, v1.z, 0.0f };
v[2] = { v2.x, v2.y, v2.z, 0.0f };
v[3] = { v3.x, v3.y, v3.z, 1.0f };
}
Matrix4x4::Matr... | true |
b7ec3e9ae6c0cae84efdb6211d40df7f8044fd3c | C++ | Durand-Chuante/Programmierung-C-PlusPlus | /Aufgaben/vererbung2/main.cpp | UTF-8 | 393 | 3.25 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Animal
{
public:
double poid;
int patte;
};
class chat : public Animal
{
public:
string nom;
void affiche();
};
void chat::affiche()
{
poid = 21.3;
cout << " nombre de patte: " << patte << "weight: " << poid << " nom: " << ... | true |
3293275e5eb58abfb25194bbeeeb230c28ca92d0 | C++ | vieirajlt/FEUP-IART-P2 | /Project/Project/Genetics.cpp | ISO-8859-1 | 4,180 | 3.125 | 3 | [] | no_license | #include "Genetics.h"
#include <random>
#include <iostream>
#include <map>
#include <set>
#include <iterator>
#include <chrono>
Genetics::Genetics()
{
}
Genetics::Genetics(Data* data, Node initial) : Genetics(data, initial, 30)
{
}
Genetics::Genetics(Data* data, Node initial, int mutationProbability) : Geneti... | true |
2e924f9a3117ac001a2882098a177a76424030b4 | C++ | njustbyq/Algorithms | /LeetCode/128.最长连续序列.cpp | UTF-8 | 1,270 | 3.421875 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=128 lang=cpp
*
* [128] 最长连续序列
*/
// @lc code=start
/*
* Solution 1: HashTable: (key, len)
* Case 1: no neighbor
* h[key] = 1
*
* Case 2: has a single neighbor, extend
* l = h[key +- 1]
* h[key +- 1] = h[key] = l + 1
*
* Case 3: has 2 neighbors, a bridge... | true |
8e7077637177413213fea55db289adfdb209cdf1 | C++ | ca2/app | /acme/filesystem/filesystem/listing.cpp | UTF-8 | 1,463 | 2.65625 | 3 | [] | no_license | #include "framework.h"
namespace file
{
listing::listing()
{
m_nGrowBy = 128;
}
listing::listing(const listing & listing) :
patha(listing)
{
m_nGrowBy = 128;
}
listing::~listing()
{
}
relative_name_listing::relative_name_listing()
{
}
... | true |
774a8f2a93f1481660b1e7dad5eaa104b2e6d93b | C++ | chrisoldwood/XML | /Writer.hpp | UTF-8 | 1,938 | 2.984375 | 3 | [
"MIT"
] | permissive | ////////////////////////////////////////////////////////////////////////////////
//! \file Writer.hpp
//! \brief The Writer class declaration.
//! \author Chris Oldwood
// Check for previous inclusion
#ifndef XML_WRITER_HPP
#define XML_WRITER_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include "Document.hpp"
#in... | true |
313ceaa474f9c891cf712714237eedfc454a6797 | C++ | jariasf/Online-Judges-Solutions | /LeetCode/30-Day Challenge/April/Week 1.5 Best Time to Buy and Sell Stock II.cpp | UTF-8 | 518 | 3.25 | 3 | [] | no_license | /*******************************************
***Problema: Best Time to Buy and Sell Stock II
***ID: Week1.5
***Juez: LeetCode
***Tipo: Greedy
***Autor: Jhosimar George Arias Figueroa
*******************************************/
class Solution {
public:
int maxProfit(vector<int>& prices) {
int sz = pr... | true |
6749d6cbdd67e3fef83390eadf3e1539c60221e5 | C++ | RichezA/progHELHA | /2eme/Programmation/Codes/C++/10-15/c++1stpart.cpp | UTF-8 | 1,556 | 3.6875 | 4 | [] | no_license | //Ceci est un commentaire
/* un commentaire
sur plusieurs lignes
*/
#ifdef commentaire
sur plusieurs lignes
#endif
#include <iostream>
//using namespace std;
void f(int m)
{
// passage par valeur int& pour référence si on passe par ref => i = 1 si par valeur => i = 0
cout << ++m << endl;
}
int main()
{
... | true |
615f47fa98e087e71c54be29bd3fa1cbc14af221 | C++ | akowalew/tiva-freertos | /src/buttons.cpp | UTF-8 | 3,418 | 2.765625 | 3 | [
"MIT"
] | permissive | ///////////////////////////////////////////////////////////////////////////////
// Buttons management
///////////////////////////////////////////////////////////////////////////////
//
// Global variables
//
//! Queue to store buttons presses events
static QueueHandle_t buttons_queue = nullptr;
//
// Private functio... | true |
eb8b000090f35f963e8a6e453c9f7fff10d53d6d | C++ | Sidetalker/CGTermProject | /CGTermProject/BubbleProjectile.cpp | UTF-8 | 3,180 | 2.859375 | 3 | [] | no_license | #include "BubbleProjectile.h"
#include <cmath>
#include "Target.h"
#include "Plane.h"
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
const static uint SLICES_AND_STACKS = 10;
BubbleProjectile::BubbleProjectile( Vector center, float radius, float speed ) :
BaseProjectile( center, speed... | true |
9042baa0e4b7545d4a7c50574e396dcdbf6979fc | C++ | Leobuaa/LeetCode | /C++/Bulls and Cows/main.cpp | UTF-8 | 611 | 2.796875 | 3 | [
"MIT"
] | permissive | class Solution {
public:
string getHint(string secret, string guess) {
int len = int(secret.length());
int a = 0, b = 0;
vector<int> count1(10, 0), count2(10, 0);
for (int i = 0; i < len; i++)
{
if (secret[i] == guess[i])
a++;
... | true |
e5167c6bd4b000e76038d2381bd303f3c2b90995 | C++ | BinyuHuang-nju/leetcode-implement | /all115/all115/main.cpp | UTF-8 | 1,396 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <cstring>
class Solution_false { //exceeds time limitation
public:
int numDistinct(string s, string t) {
int num = 0;
son_pattern(num, s, t, 0, 0);
return num;
}
void son_pattern(int& num, string ... | true |
60fd9318b54dff0280091dcd0683220a7845eb2a | C++ | zhaoyuRobotics/BeautiOfProgram | /1.CpuLine/Cpuline1.cpp | UTF-8 | 932 | 2.953125 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
// 我的电脑主频是1.6Ghz, 1.6*10的9次方个始终周期每秒,现在cpu每个时钟周期可以执行两条以上汇编代码,我们取平均两条,于是有(1600000000*2)/5=540000000(循环/秒),除以5是因为for循环执行了五条汇编代码。我们不能简单的循环540000000次,然后sleep1秒,cpu波形很可能就是先达到峰值(>50%),然后跌到一个很低的占用率(锯齿状)。我们缩小两个数量级(10ms左右,正好是时间片段大小),这样我们看到的cpu曲线效果大概就是百分之50附近。因为还有其他程序在运行,所以还需要微调。
// 查看方式:ca... | true |
c0a0c3e4d2ce4d389275e9cc0f8dd94130553a52 | C++ | noobneo/NoobEngine | /engine/maths/mat4.cpp | UTF-8 | 11,552 | 2.9375 | 3 | [] | no_license | #include "Mat4.h"
#include "vec3.h"
#include "vec4.h"
#include <string>
#include "math-common.h"
#ifdef TEST_MODE
#include "../enginelogger/enginelogger.h"
#endif
namespace enginecore {
namespace maths {
Mat4::Mat4()
{
memset(elements, 0, 4 * 4 * sizeof(float));
}
Mat4::Mat4(float diagonal)
{
m... | true |
4098d59553ae6e4cc2deda9105b1a006a9be9340 | C++ | RemmyChen/RemoteProcedureCall | /testarray1.cpp | UTF-8 | 287 | 2.578125 | 3 | [] | no_license |
#include "testarray1.idl" // include the idl file
#include <cstdio>
int sqrt(int x[24], int y[24]) {
printf("server sqrt invoked with: \n");
int res = 0;
for (int i=0; i<24; i++) {
printf("%d\n", x[i]);
res += x[i];
}
printf("returning %d\n", res);
return res;
}
| true |
2e926cd928caf193f2389ca89906bbbab8242efe | C++ | atbaird/ProceduralSystemsForNonCombatRPG | /Thesis/RPGWithNoCombat/Code/Game/Quest/QuestEvents/QuestTrigger.hpp | UTF-8 | 874 | 2.671875 | 3 | [] | no_license | #pragma once
#ifndef QUESTTRIGGER_HPP
#define QUESTTRIGGER_HPP
#include "Engine/EventSystem/NamedProperties.hpp"
#include "Engine/Core/StringUtils.hpp"
#include "Engine/Core/EngineXMLParser.hpp"
class Quest;
class QuestTrigger
{
private:
protected:
std::string m_TriggerName = "";
Quest* m_owningQuest = nullptr;
pub... | true |
8df9a7b528d7d6b6a53d23a182c50d03080f5bb8 | C++ | hoilus/LeetCode | /001-1-Two Sum.cpp | UTF-8 | 334 | 2.75 | 3 | [] | no_license | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> tmap;
for (int i = 0; i < nums.size(); i++) {
auto p = tmap.find(target-nums[i]);
if (p!=tmap.end())
return {p->second,i};
tmap[nums[i]] = i;
... | true |
bd099547aece1fff5a125c21dd272bbe8d055340 | C++ | ilyamoskalev/Algorithms | /7_1/main.cpp | UTF-8 | 2,912 | 3.25 | 3 | [] | no_license | //7_1. Атлеты.
//В город N приехал цирк с командой атлетов. Они хотят удивить горожан города N — выстроить из своих тел
//башню максимальной высоты. Башня — это цепочка атлетов, первый стоит на земле, второй стоит у него на
//плечах, третий стоит на плечах у второго и т.д.Каждый атлет характеризуется силой si
//(kg) и... | true |
39cfca69ee59cff3b71adb94316577bde8c838b7 | C++ | team3990/TechBot2014 | /GamepadXbox.cpp | UTF-8 | 1,519 | 2.546875 | 3 | [] | no_license | /*----------------------------------------------------------------------------*/
/* Copyright (c) TechForKid 2014. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
/*-----... | true |
b093f450db1a3e739c7a6c35854baced55c88471 | C++ | guiOsorio/C-CPP-DataStructs | /Queue/main.cpp | UTF-8 | 2,889 | 4.125 | 4 | [] | no_license | // Implementation of queue using an array
#include<iostream>
using namespace std;
#define N 10
class Queue
{
private:
int A[N];
int front, rear;
public:
Queue()
{
front = -1;
rear = -1;
}
bool isEmpty() {
// checks if queue has at least one element
return (front == -1 && rear == -1);
}
... | true |
a1ca2d45c54de0d9f28b56cb0a0f6575d43009d7 | C++ | 99002537/Linux_assignment | /Activity_5/Q2.cpp | UTF-8 | 3,806 | 2.6875 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#define NUM_ELEM 15 /* Number of elements in shared memory buffer */
#define SEM_MUTEX 0
#define SEM_EMPTY 1
#define SEM_FULL 2
... | true |
a6ef5994909bfb0896419da70b7f99d3e42ed7af | C++ | vrcordoba/NewsClustering | /src/NewsDiscriminator.cpp | UTF-8 | 1,464 | 2.859375 | 3 | [] | no_license |
#include "NewsDiscriminator.h"
NewsDiscriminator::NewsDiscriminator() : firstReceived(TypeOfNews::notDetermined),
secondReceived(TypeOfNews::notDetermined)
{
}
NewsDiscriminator::~NewsDiscriminator()
{
}
NewsDiscriminator::DiscriminatorResult NewsDiscriminator::discriminateType(
const std::shared_ptr<News>& f... | true |
f6e7f498a76249414714ae3b23ec56226a2b0799 | C++ | nathanshaw/SNES_Circuit_Bending | /Firmware/automated_switcher/automated_switcher.ino | UTF-8 | 2,690 | 2.84375 | 3 | [] | no_license | /*
* Dirty POC program for operating the automated video switcher
* Sketch for controlling the AV switcher using an Arduino Nano and 8 relay switches
*/
// Arduino Pins (NANO)
uint8_t relayPins[] = {2, 3, 4, 5, 6, 7, 8, 11};
uint8_t rgbLedPins[] = {9, 10, 12};
int buttonPin = A0;
int potPin = A1;
// sensors
uin... | true |
84dc1510090b522063118cb34d0f1f20dfeee1f5 | C++ | jhryu1208/MiniGame-BaseballGame | /BaseballGame/BaseballGame/BBG1.cpp | UHC | 1,631 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <time.h>
using namespace std;
enum SRP
{
SRP_S = 1,
SRP_R,
SRP_P,
SRP_END
};
int main()
{
//̺
srand((unsigned int)time(0));
int iPlayer, iAI;
while (true)
{
cout << "1. " << endl;
cout << "2. " << endl;
cout << "3. " << endl;
cout << "4. " << endl;
cout << " ϼ :" <... | true |
06e7ddbd567e241b50b94d0bc044142fc1d8e565 | C++ | Miracle-cl/Algorithms | /BinarySearch/RussianDollEnvelopes.cpp | UTF-8 | 2,300 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using std::vector;
class Solution {
public:
int maxEnvelopes_0(vector<vector<int>>& envelopes) {
if (envelopes.empty()) return 0;
std::sort(envelopes.begin(), envelopes.end());
int maxl = 1, n = envelopes.size();
int dp[n]... | true |
41b8de44708b6a2d4e8cc39a156ca931578a2ecb | C++ | MISSCHERYLWANG/leetcode | /tree/btLevelTraversalII.cc | UTF-8 | 1,375 | 3.625 | 4 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
// 先求depth,然后dfs从depth-1开始
vector<vector<int>> levelOrderBottom(TreeNode* root)... | true |
6807eb3171b97ccc5e445a86c9f5b965445dc5f1 | C++ | rlaqlc/Tic-Tac-Toe | /Tic Tac Toe/Board.cpp | UTF-8 | 11,869 | 3.046875 | 3 | [] | no_license | #include "Board.h"
#include <iostream>
Board::Board()
{
renderer = NULL;
}
void Board::setRenderer(SDL_Renderer * renderer)
{
this->renderer = renderer;
texture.setRenderer(renderer);
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
tile[i][j].setRenderer(renderer);
}
}
writings[ROUND]... | true |
dffb83f333bc95531070175c00401a1a1b459b79 | C++ | seanballais/foxy-journey-port | /code/biomManager.cpp | UTF-8 | 2,793 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "biomManager.h"
biomManager::biomManager(physicsObject * pPlayer)
{
int idx = rand() % 3 + 1;
switch (idx)
{
case HILLS:
biomsToDraw.push_back(new biom("hills_start", "hills"));
biomsToDraw.push_back(new biom("hills", "hills"));
biomsToDraw.push_back(new biom("hills_end", "hills"));
... | true |
1ef264ab9386332ee96e6871ac202aede4d40f1f | C++ | micmacIGN/micmac | /MMVII/src/UtiMaths/uti_fonc_analytique.cpp | UTF-8 | 5,922 | 2.796875 | 3 | [
"LicenseRef-scancode-cecill-b-en"
] | permissive |
#include "MMVII_Ptxd.h"
namespace MMVII
{
/*
template TYPE Sqrt(const TYPE & aSin);
template <typename Type> Type Sqrt(const Type & aX)
{
MMVII_INTERNAL_ASSERT_tiny((aX>=0),"Bad value for arcsinus");
return std::sqrt(aX);
}
*/
template <typename Type> Type DerSqrt(const Type & aX)
{
MMVII_INTERNAL_... | true |
a3426f51e4dd71273ba54c062c287cba98169428 | C++ | memmaprofeten/dungeoncrawler4 | /src/room.hpp | UTF-8 | 5,929 | 3 | 3 | [] | no_license | #ifndef ROOM_HH
#define ROOM_HH
#include "tile.hpp"
#include <vector>
#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>
#include "monster.hpp"
class Projectile;
class Character;
class Weapon;
class Npc;
class Room {
public:
/**
* Constructor creating the room by loading it from the given file.
... | true |
c3b428be9058310bc423dab2a57d9ab1665cdbca | C++ | Aashutosh97/Launchpad17-Fasttrack | /21_graphs/graph.cc | UTF-8 | 1,449 | 3.203125 | 3 | [] | no_license | // Deepak Aggarwal, Coding Blocks
// deepak@codingblocks.com
#include <iostream>
#include <vector>
using namespace std;
class Graph {
typedef vector<vector<int> > vvi;
vvi vtxList;
int nVertices;
void dfs(int src, vector<bool>& visited) {
// if (visited[src] == true) return;
cout << s... | true |
2c053cee074b5fb425538aff5f585d4065fa6309 | C++ | RMoraffah/hippo-postgresql | /src/include/izenelib/include/util/compression/ordered/Compressor.h | UTF-8 | 5,943 | 3.203125 | 3 | [
"Apache-2.0",
"PostgreSQL"
] | permissive | /**
* @file Compressor.h
* @brief The header file of Compressor.
* @author Peisheng Wang
* @date 2008-10-22
*
* This file defines class Compressor.
*
* Change from jiazeng's work:
* ============================
* 1. When compressing a file, it stores bitPattern instead of alphabet tree in compressing.
*... | true |
bca65c9c096d1a27cf66570af5947152e164a9a4 | C++ | bluemix/Online-Judge | /POJ/2986 A Triangle and a Circle.cpp | UTF-8 | 3,604 | 3.0625 | 3 | [] | no_license | /* 14126892 840502 2986 Accepted 168K 1407MS C++ 2933B 2015-04-24 22:58:43 */
#include<bits\stdc++.h>
#define EPS 1e-9
#define PI acos(-1.0)
using namespace std;
struct Point{
double x, y;
Point(){}
Point(double x, double y) :x(x), y(y){}
Point operator +(const Point &a) const{
return Point(x + a.x, y + a.y);
}
... | true |
cd3015aebba90d2f5708b3e7edcc85f1f9043696 | C++ | anveshh/cpp-book | /src/Leetcode/830_positions-of-large-groups.cpp | UTF-8 | 770 | 3.25 | 3 | [] | no_license | // https://leetcode.com/problems/positions-of-large-groups/
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
vector<vector<int>> largeGroupPositions(string s)
{
vector<vector<int>> res;
int count = 1, len = s.length();
for (int i = 1; i < len; i++)
... | true |
16af9f6e74eeb66427d018eb851ef1bd87628e74 | C++ | Ubaid-Manzoor/Interview_Practice | /Data Structures Problems/Stack/Medium/check_if_parenthesis_are_balanced_or_not/main.cpp | UTF-8 | 1,147 | 3.859375 | 4 | [] | no_license | #include <iostream>
#include <stack>
using namespace std;
bool check_is_balanced(string arr){
stack<char> stack;
for(int i = 0 ; i < arr.size() ; i++){
if(arr[i] == '{' || arr[i] == '(' || arr[i] == '['){
stack.push(arr[i]);
continue;
}
if(stack.empty())
... | true |
2e75bcb8dd24dab48670b36c395b39f45044f956 | C++ | Jay-Ppark/Algorithm | /1406_에디터_리스트_stl.cpp | UTF-8 | 615 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<list>
using namespace std;
int main(void){
string s;
cin>>s;
list<char> l;
for(int i=0;i<s.size();i++){
l.push_back(s[i]);
}
auto cursor=l.end();
int order;
cin>>order;
for(int t=0;t<order;t++){
char c;
cin>>c;
if(c=='P'){
char tmp;
cin>>tmp;
l.inse... | true |
f3fd0805d4443173714b79d3675eeec64ae939df | C++ | kdoggdev/cncn_m2 | /srcs/server_src/game/src/item_manager.h | UHC | 13,049 | 2.53125 | 3 | [
"Unlicense"
] | permissive | #ifndef __INC_ITEM_MANAGER__
#define __INC_ITEM_MANAGER__
#ifdef M2_USE_POOL
#include "pool.h"
#endif
// special_item_group.txt ϴ Ӽ
// type attr ִ.
// Ӽ ̿ ִ special_item_group.txt Special type ǵ 쿡 UNIQUE ITEM̴.
class CSpecialAttrGroup
{
public:
CSpecialAttrGroup(DWORD vnum)
: m_dwVnum(vnum)
{}
struct ... | true |
c34133040d2a5a581ff45f6b116ebcddd31aa2c2 | C++ | cpe102/practica-exam-rehearsal-theeramet0793 | /rehearsal_1.cpp | UTF-8 | 299 | 2.90625 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
int main(){
string name;
float grade;
cout<<"What is your name?: ";
cin>>name;
cout<<"What is your GPA?: ";
cin>>grade;
if(grade>=3.5){
cout<<name<<" InW Jrim Jrim!!!";
}
else
{
cout<<"Try harder, "<<name<<"!!!";
}
return 0;
}
| true |
957330b1c05bf8057848579bc81a3b479c277d14 | C++ | Kannupriyasingh/CPP-files | /twoDishes.cpp | UTF-8 | 302 | 2.859375 | 3 | [] | no_license | /**
* Problem Code: TWODISH
*/
#include <iostream>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, a, b, c;
cin >> n >> a >> b >> c;
if ((n > b) || n > (a + c))
cout << "NO\n";
else
cout << "YES\n";
}
return 0;
} | true |
09bd1e0b6e5095767603fbfc77d4da4997e58b74 | C++ | liangdahanay/al | /lowestCommonAncestor.cpp | UTF-8 | 4,389 | 3.359375 | 3 | [] | no_license | /*
* lowestCommonAncestor.cpp
*
* Created on: Feb 8, 2015
* Author: liang
*/
#include "lowestCommonAncestor.h"
#include <iostream>
#include <time.h>
#include "tree.h"
int count(Node* root, Node* p, Node* q){
if(root==nullptr) return 0;
int match = count(root->left, p, q) + count(root->right, p, q);
if(r... | true |
f69469db43d1550acb49566419b35e4cd843ae05 | C++ | cocoa-xu/evision | /c_src/ArgInfo.hpp | UTF-8 | 445 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | #ifndef ARGINFO_HPP
#define ARGINFO_HPP
class ArgInfo
{
public:
const char* name;
bool outputarg;
bool has_default;
// more fields may be added if necessary
ArgInfo(const char* name_, bool outputarg_, bool has_default_ = false) :
name(name_), outputarg(outputarg_), has_default(has_default_) {... | true |
e211cbef3ca3ef84fdc40396d039bcb3242b5677 | C++ | HuangDave/MP3 | /L5_Application/MP3/UI/View.hpp | UTF-8 | 1,015 | 3.015625 | 3 | [] | no_license | /*
* View.hpp
*
* Created on: Apr 6, 2018
* Author: huang
*/
#ifndef VIEW_HPP_
#define VIEW_HPP_
#include "../gfx.h"
/**
* The View class the base class for displaying views on the LCD Display.
*
* The frame of the view determines the origin of the view as well as the width and height it occupies on th... | true |
d11b4a7b0750612c4937a481e806f06cf2ee51a0 | C++ | alwaystiys/OpenGL | /ogl3.3/src/LightTest.cpp | GB18030 | 17,075 | 2.53125 | 3 | [] | no_license | #include "LightTest.h"
#include "Common/lib_transform.h"
#include <iostream>
using namespace LightTest;
TextureShader::TextureShader(const char *vertexShaderSource, const char *fragmentShaderSource, const char *vsFilePath, const char *fsFilePath) {
this->vertexShaderSource = vertexShaderSource;
this->fragmentS... | true |
6afbd5be0796884aecbebd2f225a5746feb11ff0 | C++ | zpoint/Reading-Exercises-Notes | /C++ Primer/11_Associative_Containers/11_10.cpp | UTF-8 | 908 | 3.421875 | 3 | [] | no_license | #include <map>
#include <vector>
#include <list>
#include <iostream>
int main()
{
std::vector<int> ivec{1, 2};
std::cout << (ivec.end() < ivec.begin()) << std::endl;
std::list<int> lst{1, 2};
// std::cout << (lst.end() < lst.begin()) << std::endl;
std::map<std::vector<int>::iterator, int> vec_iter_map;
std... | true |
21998a32f4c81e96bfd6dc833743d2fb0788fca7 | C++ | mxmz/json-cpp-lib | /jsonlib/src/mxmz/json/v4/json_writer.hxx | UTF-8 | 7,281 | 2.546875 | 3 | [] | no_license | #ifndef json_writer_hxx_374827627653726346239234029302039029309489884842
#define json_writer_hxx_374827627653726346239234029302039029309489884842
#include <string>
namespace mxmz {
namespace json {
namespace v4 {
struct json_element_writer_default_features {
typedef ::std::string string_t;
typedef char c... | true |
dd24f6851130e050f449b84bd1d687f7c7de600b | C++ | aeremin/Codeforces | /alexey/Solvers/6xx/604/Solver604A.cpp | UTF-8 | 1,156 | 2.953125 | 3 | [] | no_license | #include <Solvers/pch.h>
#include "iter/range.h"
#include "algo/io/readvector.h"
using namespace std;
// Solution for Codeforces problem http://codeforces.com/contest/604/problem/A
class Solver604A
{
public:
void run();
};
void Solver604A::run()
{
auto times = readVector<int>(5);
auto tries = readVector<i... | true |
eb9538ed4affd67b78258db003e1f3d2a1626234 | C++ | ThatCoolCoder/sfml-tictactoe | /src/miniengine/utils.cpp | UTF-8 | 273 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "utils.hpp"
namespace miniengine::utils
{
void centerAlignText(sf::Text& text)
{
sf::FloatRect textRect = text.getLocalBounds();
text.setOrigin(textRect.left + textRect.width/2.0f,
textRect.top + textRect.height/2.0f);
}
} | true |
987de29af763df99c9869171dc802473c86c373a | C++ | Karan-MUJ/SPOJ_300 | /The_Cats_and_the_Mouse_282.cpp | UTF-8 | 3,187 | 3.25 | 3 | [] | no_license | /*#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int mdist[100][100];
int cdist[100][100];
int n, m;
struct cord
{
int x;
int y;
};
void cbfs(cord cat)
{
bool visited[n][m];
int i, j;
for (i = 0; i < n; ++i)
{
for (j = 0; j < n; ++j)
{
visited[i]... | true |
33af8d1af7ddad6c2e46614af43a604e04140aef | C++ | mostarr/CSE-111 | /Lab5/shape.cpp | UTF-8 | 6,543 | 2.640625 | 3 | [] | no_license | // $Id: shape.cpp,v 1.2 2019-02-28 15:24:20-08 - - $
#include <typeinfo>
#include <unordered_map>
#include <GL/freeglut.h>
#include <cmath>
using namespace std;
#include "shape.h"
#include "util.h"
static unordered_map<void *, string> fontname{
{GLUT_BITMAP_8_BY_13, "Fixed-8x13"},
{GLUT_BITMAP_9_BY_15, "Fixe... | true |
18adc4f2a22ddff4feaf1a9989aad0fc5c7cff4b | C++ | saich/cpp-practice | /Library/src/encoding/Base64.cpp | UTF-8 | 2,409 | 2.953125 | 3 | [] | no_license | #include "Base64.h"
#include <stdint.h> // TODO: Use <cstdint>
#include <stdexcept>
std::string Base64::ENCODING_MAP =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
std::string Base64::encode(std::string in) {
std::string out;
out.resize((((in.size() - 1) / 3) + 1) * 4);
for (size_t i = 0, ... | true |
9c396db95e5c085ec9417d9f54541deae89d3e55 | C++ | lukevand/kattis-submissions | /doubleplusgood.cpp | UTF-8 | 819 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(XXX) cerr << #XXX << ": " << XXX << '\n'
int digits[20];
int main()
{
unordered_set<ll> s;
int plus=0;
for ( ; scanf("%d+", &digits[plus]) != EOF; plus++);
int limit = 1<<plus;
for (int i=0; i < limit; i++) {
... | true |
37612fd2ca94120306c3ff829c38d42414fd625e | C++ | yianshu/LFGame | /src/LFServerLib/QueueService.cpp | GB18030 | 8,490 | 2.640625 | 3 | [] | no_license | #include "QueueService.h"
#include "DataStorage.h"
//////////////////////////////////////////////////////////////////////////
//캯
CQueueServiceThread::CQueueServiceThread(void)
{
m_hCompletionPort=NULL;
memset(m_cbBuffer,0,sizeof(m_cbBuffer));
}
//
CQueueServiceThread::~CQueueServiceThread(void)
{
}
//ú
bool CQue... | true |
76dd3c96dffc2de4d11a160e23f6843dfe486a08 | C++ | vule12345/ETF-OS1 | /inc/PCB.h | UTF-8 | 1,367 | 2.59375 | 3 | [] | no_license | // File: PCB.h
#ifndef _PCB_H_
#define _PCB_H_
#include "thread.h"
#include "list.h"
#include "PCBlist.h"
#include "utility.h"
#include "kernel.h"
#define SP_DISP 20
#define SS_DISP 22
#define STACK_DISP 12
#define STACK_SIZE_DISP 4
#define OWNER_THREAD_SIZE_DISP 16
const StackSize MAX_STACK_SIZE =... | true |
fa02dfb30ec04462764b5213b92409fd736c7e1d | C++ | humbertodias/challenges | /uri/2 - Ad-Hoc/1845/main.cpp | UTF-8 | 692 | 2.671875 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <map>
#include <cstdio>
using namespace std;
int main(){
char X, aux;
while (scanf("%c", &X) != EOF) {
if(X=='s' || X=='v' || X=='p' || X=='x' || X=='b' || X=='j' || X=='z' || X=='f') {
if(aux != 'f' && aux != 'F') {
printf(... | true |
ea1bd620ed16dbf8ae228d0077716513a97f7ba7 | C++ | erik-jenkins/Breakout | /include/texture.hpp | UTF-8 | 425 | 2.6875 | 3 | [] | no_license | #pragma once
#include <GL/glew.h>
class Texture2D
{
public:
GLuint id;
GLuint width, height;
GLuint internalFormat;
GLuint imageFormat;
GLuint wrapS;
GLuint wrapT;
GLuint filterMin;
GLuint filterMax;
Texture2D();
// generate texture from image data
void generate(GLuint width, GLuint height, unsigned char... | true |
e6909f9439987d9ad89bd644275e578fbbed93cd | C++ | yaluen/Robotics2015 | /AssignmentIII/part_b/main.cpp | UTF-8 | 7,334 | 2.890625 | 3 | [] | no_license | // This program is a simple template of an C++ program loading and showing image with OpenCV.
// You can ignore this file and write your own program.
// The program takes a image file name as an argument.
#include <stdio.h>
#include "opencv2/opencv.hpp"
using namespace std;
using namespace cv;
float calculateMoment(M... | true |
3b67c5c1aa700cdf9cbc1ecb59fecd6b593d2389 | C++ | internetofthingsgolem/ITGJava | /trie.h | UTF-8 | 317 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class trie
{
public:
struct node
{
node* Zero ;
node* One ;
bool is_prefix;
node()
{
Zero = NULL;
One = NULL;
is_prefix = false;
}
};
node* root;
trie();
void insert_ip(string netAddress, int subnetlength);
int find_ip(string ip_find);
};
| true |
5070040345333c67a5dff1db83bb6dd42ef95f95 | C++ | rahulnairiit/VisualStudiocodes | /algocoding/algocoding/permuteRecursive.cpp | WINDOWS-1252 | 1,609 | 3.875 | 4 | [] | no_license | /*
Implement a function that prints all possible combinations of the characters in a string.
These combinations range in length from one to the length of the string. Two combinations
that differ only in ordering of their characters are the same combination. In other words,
12 and 31 are different combinations from the... | true |
692e8bb0c04ee92862e5c255dc984d8dcc252ce9 | C++ | agaucher/Arduino | /Micrologiciel_cpy.ino | UTF-8 | 3,165 | 2.859375 | 3 | [] | no_license | #include <SPI.h>
#include <Ethernet2.h>
const int PIN = 6;
const unsigned int MAX_DATA_LENGTH = 300;
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
const int PORT = 9800;
EthernetServer server(PORT);
void setup() {
Serial.begin(9600);
Serial.println("Initialization");
pinMode(PIN, OUTPUT);
while (E... | true |
1e64c2fa799722d135ce25fd97f5cb26e20a7d11 | C++ | mohit3112/FullMetalEngine | /FMEGraphics/inc/RenderComponent.h | UTF-8 | 750 | 2.71875 | 3 | [
"MIT"
] | permissive | #ifndef IRENDERCOMPONENT_H_
#define IRENDERCOMPONENT_H_
#include "IComponent.h"
#include "IModel.h"
namespace FME
{
namespace Graphics
{
enum GameType
{
RENDER2D,
RENDER3D
};
/** \class RenderComponent
* \brief a component dedicated to rendering objects
*/
class RenderComp... | true |
e2c005ef74ef4d34fe33daa86ee8aff1e23679b2 | C++ | ffamilyfriendly/teamsDLL | /test/helpers.cpp | UTF-8 | 933 | 2.84375 | 3 | [] | no_license | #include "helpers.h"
#include <sstream>
#include <fstream>
size_t utils::split(const std::string &txt, std::vector<std::string> &strs, char ch)
{
size_t pos = txt.find( ch );
size_t initialPos = 0;
strs.clear();
// Decompose statement
while( pos != std::string::npos ) {
strs.push_back( txt... | true |
8772a51af9757871e30b776f854466983fd4ce8d | C++ | kounelisagis/Text-Compression---Huffman-Coding | /source codes/help_library.cpp | UTF-8 | 2,440 | 3.140625 | 3 | [
"MIT"
] | permissive | #include "help_library.h"
bool CustomCompare:: operator() (const TreeNode* first_node, const TreeNode* second_node)
{
return first_node->frequency > second_node->frequency;
}
/*int get_index_of(vector<TreeNode*> myvector, char a) {
vector<TreeNode*>::iterator ptr;
for (ptr = myvector.begin(); ptr < myv... | true |
525d6eb78ed29d35cae8dbcc3762ad9303d68826 | C++ | MtMindSculptz95/Minh-Tran | /h31/h31.cpp | UTF-8 | 647 | 2.53125 | 3 | [] | no_license | /**
@file h31.cpp
@author your name here
@version what day and meeting time
*/
#include <string>
#include <stdexcept>
using namespace std;
#include "h31.h"
string STUDENT = "mtran362"; // Add your Canvas/occ-email ID
// Add your implementation here
bool find(const string& s, const string& t)
{
size_t... | true |
dfe1e62510097cac0416f4cd14f09fd79223f45e | C++ | ajnirp/binarysearch | /linked-list-deletion.cpp | UTF-8 | 511 | 3.484375 | 3 | [] | no_license | // https://binarysearch.com/problems/Linked-List-Deletion
// Explanation: https://stackoverflow.com/questions/12914917/using-pointers-to-remove-item-from-singly-linked-list
/**
* class LLNode {
* public:
* int val;
* LLNode *next;
* };
*/
LLNode* solve(LLNode* node, int target) {
LLNode**... | true |
e2c6d58152a42ee4011d33a8b9734e954e0d5faf | C++ | zhidateh/fusionparser | /mathfunction.cpp | UTF-8 | 1,601 | 3.234375 | 3 | [] | no_license | #include "mathfunction.h"
MathFunction::MathFunction()
{
}
void MathFunction::rotationMatrix(double &x, double &y, double angle)
{
double _x = x*cos(angle) - y*sin(angle);
double _y = x*sin(angle) + y*cos(angle);
x = _x;
y = _y;
}
QVector<double> MathFunction::calculateHeading(QVector<double> &x,... | true |
7cf9fe20238bf7ca6e4546c9e9a6d103fa2128ea | C++ | jmppmj/3dgameengine_jillplatts | /core/MousePicker.cpp | UTF-8 | 2,118 | 3.046875 | 3 | [
"MIT"
] | permissive | #include "MousePicker.hpp"
#include <iostream>
#define GLM_ENABLE_EXPERIMENTAL
#include "glm/gtx/string_cast.hpp"
MousePicker::MousePicker(Camera *cam) {
camera = cam;
projMatriX = camera->getProjectionMatrix();
viewMatriX = camera->getViewMatrix();
}
glm::vec3 MousePicker::getCurrentRay() {
return currentRay;
}
... | true |
9c964f2f748c6c68b0dcd4df324131b92cc174c2 | C++ | yaito3014/UECRayTracing | /yk/color.hpp | UTF-8 | 3,156 | 2.984375 | 3 | [] | no_license | #pragma once
#ifndef YK_RAYTRACING_COLOR_H
#define YK_RAYTRACING_COLOR_H
#include <algorithm>
#include <cstdint>
#include "concepts.hpp"
namespace yk {
template <concepts::arithmetic T>
struct alignas(T) color3 {
using value_type = T;
T r, g, b;
template <concepts::arithmetic U>
constexp... | true |
74fc50e1348bfb0e3ee5a77f90467f2b0e57928a | C++ | ORNL-QCI/exatn | /src/numerics/tensor_leg.hpp | UTF-8 | 2,977 | 3.078125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /** ExaTN::Numerics: Tensor leg (connection)
REVISION: 2020/10/09
Copyright (C) 2018-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2018-2019 Oak Ridge National Laboratory (UT-Battelle) **/
/** Rationale:
(a) A tensor leg associates a tensor mode with a mode in another tensor
by carrying the id of another tensor, i... | true |
f501c042372703817f3727c4d74a85f4d8a5e797 | C++ | Iten-No-404/Snakes-and-Ladders-with-a-hint-of-Monopoly | /DeleteGameObjectAction.h | UTF-8 | 659 | 2.78125 | 3 | [] | no_license | #pragma once
#include "Action.h"
class DeleteGameObjectAction : public Action
{
// Always add action parameters as private data members
// [Action Parameters]
CellPosition PostionToDelete; // The postion of the cell whose game object will be deleted
// Note: This parameter should be read in ReadActionParameters(... | true |
870b678e34bf2b6818181cba27ce90d1474d3980 | C++ | senli123/tensorrt-pythonv1 | /model/classification/classification_utils.cpp | UTF-8 | 788 | 2.578125 | 3 | [] | no_license | #include "classification_utils.h"
bool ClassificationUtils::TopNums(std::vector<std::vector<std::pair<float, int>>> &class_index, int topnum, std::vector<image_info>& outputinfo)
{
for (int batch = 0; batch < class_index.size(); batch++)
{
std::vector<std::pair<float, int>> one_batch_class_index = class... | true |
0bdc3ae4181f0adc12ead9e4f5b1db5b17c0c85b | C++ | quantity123/CoinFlipGame | /CoinFlipGame/mainwindow.cpp | UTF-8 | 2,797 | 2.515625 | 3 | [] | no_license | #include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, mWidth(320)
, mHeight(588)
, mWidget(this)
, mVBoxLayout(this)
, mMenuBar(this)
, mLevelConfig(this)
, mBackBtnMovePoint(mWidth-77, mHeight-57)
, mStartScene(this)
, mChooseLevelScene(this)
... | true |
64930addebe32722fb955850ce9d4f9403852db6 | C++ | sankar96/Competitive_Programming | /A2OJ/Ladder/Eighteen.cpp | UTF-8 | 600 | 2.890625 | 3 | [] | no_license | /****
*
* Description : http://codeforces.com/problemset/problem/155/A
* Created by : Sankaranarayanan G
* Date : 2018-03-13 15:01:28
*
****/
#include <iostream>
using namespace std;
int main () {
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
cin >> arr[i];
int maxV = arr[... | true |
dcfa86e7d9af9edfdb35134befe4b534780c2447 | C++ | pqros/leetcode-exercices | /03LongestSubstring.cpp | UTF-8 | 655 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
int lengthOfLongestSubstring(string s) {
if (s.empty()) return 0;
int maxlen = 0;
int start = 0;
unordered_map <char, int> m;
for (int i = 0; i < s.size(); ++i) {
char c = s[i];
if (m.find(c) ==... | true |
66ceb93ab74d28a27931ecee72b232bb9ff56484 | C++ | sakshi-chauhan/CodechefCppCodes | /EASY/DIVIDING.cpp | UTF-8 | 281 | 2.609375 | 3 | [] | no_license | #include<iostream>
int main(){
long long n,c,sum=0;
std::cin>>n;
for(int i=0;i<n;i++){
std::cin>>c;
sum+=c;
}
if(sum==n*(n+1)/2)
std::cout<<"YES\n";
else
std::cout<<"NO\n";
return 0;
}
| true |
abdd77de9611ef33b7ff25877ffc22a583874909 | C++ | everescent/drqst | /Production/DragonAttack/DragonAttack/Input_Handler.cpp | WINDOWS-1252 | 1,502 | 2.890625 | 3 | [] | no_license | /* Start Header ************************************************************************/
/*!
\file Input_Handler.cpp
\project Dragon Attack
\author William Yoong
\par email: william.yoong\@digipen.edu
\brief
Cpp file for Input_Handler
All content 2018 DigiPen (SINGAPORE) Corporation, all rights reserved... | true |
1c6e2d1cbaf606b081b7e47ab61b3a117f06eca1 | C++ | Andydiaz12/Estructura-de-Datos-con-Muratalla | /Ejercicios de parciales/3 parcial/CH05_2_180416_24500468.cpp | ISO-8859-1 | 2,023 | 3.390625 | 3 | [] | no_license | /* Jos Andrs Daz Escobar
18 de Abril del 2016
Ahora haremos una pila un poco ms prctica. Vas a realizar un administrador de tareas para un
sistema operativo para esto necesitars almacenar dos datos: clave del proceso (entero), nombre del proceso (cadena)
y aplicacin que lo ejecuta (cadena). Lo que tendrs que ... | true |
cdb7a60874fdaa7afabe1b940f2b6a6987e9a222 | C++ | Mikhaelyes/4-semester | /2sem/vector2D.h | UTF-8 | 1,291 | 2.8125 | 3 | [] | no_license | class Vector2D
{
double x, y;
public:
Vector2D();
Vector2D(double x);
Vector2D(double x, double y);
double get_x();
double get_y();
void set_x(double x);
void set_y(double y);
Vector2D *plus(Vector2D *A);
Vector2D *minus(Vector2D *A);
double mod();
friend double mod(Vector2D &A);
friend Vector2D opera... | true |
a1479dbc0fd7b14651a351ad15662ae2817e218b | C++ | xiaoruiwei1998/XRW | /swarm.cpp | UTF-8 | 7,081 | 2.578125 | 3 | [] | no_license | #include<iostream>
#include<time.h>
#include<stdlib.h>
#include<cmath>
#include<fstream>
#include<iomanip>
#include "benchmark.h"
#include "Algorithm.h"
using namespace std;
/*******主函数*******/
int main()
{
/*
ofstream output;
output.open("dataABC.txt");
*/
srand((unsigned)time(NULL));
initilize();//初始化
Memori... | true |
1389f27cf2a322bae8b4d753a8025fc61d149f3a | C++ | thanhvietgl/lthdt-18clc6-18127252 | /18127252_w07_03/Ball/function.cpp | UTF-8 | 190 | 2.5625 | 3 | [] | no_license | #include "Header.h"
Ball* Ball::instance = nullptr;
Ball* Ball::getInstance()
{
if (!instance)
instance = new Ball;
return instance;
}
void Game::play()
{
cout << "Ready!" << endl;
} | true |
045b2a1515a2bd83ce36d3104f06952a1553c71a | C++ | alok0366/Programs | /cpp/copytemplate.cpp | UTF-8 | 899 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
template<class T>
class vector
{
T v[3];
public:
vector(){
for(int i=0;i<3;i++)
v[i]=0;
}
vector(T* a)
{
for(int i=0;i<3;i++)
v[i]=a[i];
}
T operator*(vec... | true |
4215568f17353d1813db7c7b95c86d317d0b25e1 | C++ | WireCell/wire-cell-gen | /inc/WireCellGen/Fourdee.h | UTF-8 | 2,064 | 2.578125 | 3 | [] | no_license | #ifndef WIRECELL_FOURDEE_H
#define WIRECELL_FOURDEE_H
#include "WireCellIface/IApplication.h"
#include "WireCellIface/IConfigurable.h"
#include "WireCellIface/IDepoSource.h"
#include "WireCellIface/IDepoFilter.h"
#include "WireCellIface/IDrifter.h"
#include "WireCellIface/IDuctor.h"
#include "WireCellIface/IFrameSour... | true |
f0b355ec597bcae99230f5e942bae697b6ab551b | C++ | tkalani/CodeChef | /April Challenge 2019/KLPM.cpp | UTF-8 | 1,064 | 3.546875 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
bool isPalindrome(string str)
{
int l = 0;
int h = str.length() - 1;
while (h > l)
{
if (str[l++] != str[h--])
{
return false;
}
}
return true;
}
int SECONDSUBSTR(string S, int start, string first_subs... | true |
4365ff68f3af4476ef83fceabced03ef834a44da | C++ | eduardoschk/QT-2DCad | /src/command/CommandCreateArc.cpp | UTF-8 | 2,145 | 2.875 | 3 | [] | no_license | #include "CommandCreateArc.h"
#include "Data.h"
#include "File.h"
#include "ArcShape.h"
#include "Coordinate.h"
#include "UserInterface.h"
void CommandCreateArc::exec(Data& data,UserInterface& ui)
{
if (data.hasFile()) {
id= data.getCurrentFile().generateIdShape();
ui.markArcOptionAsSelected();
ui... | true |
457a25f1f68b480d1a3433046a8ce3928cfcf350 | C++ | rafa7loza/computer_networks_lab | /proyecto_final/includes/ICMPv4.h | UTF-8 | 487 | 2.5625 | 3 | [] | no_license | #ifndef ICMPV4_H
#define ICMPV4_H
#include <iostream>
#include <string>
// ICMPv4 Protocol
#define ICMPV4_TYPE "icmpv4_type"
#define ICMPV4_CODE "icmpv4_code"
#define ICMPV4_CHECKSUM "icmpv4_checksum"
#define ICMPV4_OTHER "icmpv4_other"
using namespace std;
class ICMPv4{
public:
ICMPv4();
ICMPv4(string data);
... | true |
4e2379ceccb00a149cea278dab140a2d4b12ce14 | C++ | IliyaKarkamov/Warrior | /Warrior/Warrior.Engine/src/Graphics/OpenGL/Program.cpp | UTF-8 | 3,494 | 2.65625 | 3 | [] | no_license | #include "Engine/Graphics/OpenGL/Program.h"
#include "Engine/Graphics/OpenGL/Shader.h"
#include "Utils/ErrorHandler.h"
#include "Engine/Core.h"
#include <GL/glew.h>
namespace WarriorEngine::Graphics::OpenGL
{
Program::Program() noexcept { GL_CALL(id_ = glCreateProgram()); }
Program::Program(const Shader& vertex, cons... | true |
2e93ebdc86ce9898f56dddfbd33f7b7bcc91ac4f | C++ | fpga-tom/pcb_sat | /Circuit.cpp | UTF-8 | 521 | 2.578125 | 3 | [] | no_license | //
// Created by tomas on 12/26/18.
//
#include "Circuit.h"
namespace solg {
namespace circuit {
bool operator==(const edge_t &a, const edge_t &b) {
return a == b;
}
bool operator==(const node_t &a, const node_t &b) {
return a == b;
}
bool operat... | true |
f4582086ac1cab203bac7bf0a3d457aed633a07d | C++ | teju85/teditor | /src/core/lrucache.hpp | UTF-8 | 2,097 | 3.53125 | 4 | [
"WTFPL"
] | permissive | #pragma once
#include <unordered_map>
namespace teditor {
/**
* @brief LRU Cache implementation
* @tparam K key type
* @tparam V value type
*/
template <typename K, typename V>
class LRUCache {
public:
/**
* @brief ctor
* @param c capacity of the cache
*/
LRUCache(size_t c) : objs(), cap(c), head(nu... | true |
047df7f9eb4012a1c16491f81b3b5085312f976c | C++ | nicosuarez/pacmantaller | /client/src/Camara.cpp | UTF-8 | 3,953 | 3.171875 | 3 | [] | no_license | #include "Camara.h"
#include <iostream>
using namespace std;
Camara::Camara():posOjo(0,0,0),posCentro(0,0,0),dirArriba(0,1,0){
}
Camara::Camara(Coordenada posOjo,Coordenada posCentro ,Coordenada dirArriba): posOjo(posOjo),posCentro(posCentro),dirArriba(dirArriba) {
cSpeed = 0.5;//mientras mas alto mas velocidad... | true |