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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3c21d06d4fdf35ef9b14158dc8e7ab0b1b558c7f | C++ | greenfox-zerda-sparta/katbtr | /week-02/day-1/Exercise25.cpp | UTF-8 | 750 | 3.3125 | 3 | [] | no_license | //============================================================================
// Name : Exercise25.cpp
// Author : katbtr
// Version :
// Copyright : Your copyright notice
// Description : Week-02 Day-1 Exercise25
//============================================================================
#includ... | true |
debd0e7882aed5d7776a35ca8b7c3b0184b26c49 | C++ | pratikdas44/codingPratice_cpp | /greedy & dp/coin_change.cpp | UTF-8 | 1,621 | 3.28125 | 3 | [] | no_license | //unlimited number of coins present.
//find number of ways different coins chosen such that
//sum equals to m.
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll dp(int a[],int n,int m){
ll table[m+1];
memset(table,0,sizeof(table));
table[0] = 1;
for(int i=0;i<n;i++)
for(... | true |
259d218df76c36dc5e5e20315900e4cae0565d59 | C++ | betarixm/CSED451 | /ASSN/ASSN4/Shader.cpp | UTF-8 | 3,383 | 2.625 | 3 | [] | no_license | #include "Shader.h"
#include <glm/gtc/type_ptr.hpp>
#define NUM_SHADER 2
Shader *shader;
Shader *shaders[NUM_SHADER];
bool shader_index = 0;
void initShader() {
shaders[0] = new Shader((char *)"shader/Shader.vert", (char *)"shader/Shader.frag");
shaders[1] = new Shader((char *)"shader/Shader_g.vert", (char *... | true |
9eda90aea601535d6e8670868e96832539ae3feb | C++ | leoleoasd/oi | /senior/124/p193.cpp | UTF-8 | 1,894 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
//using namespace std;
using std::cin;
using std::cout;
using std::vector;
using std::ios;
using std::endl;
#define MAXN 5050
vector<int> output;
int data[MAXN][MAXN]={0};
int n,m,q;
struct p{
p(){}
p(int x,int y,int z){
a=x;
b=y;
... | true |
0c3fd371d0a6e58ac80fe19ee7ec75f21178d0b2 | C++ | kenuosec/MPPT-charger | /#0 Out-of-date and other files/Charger-Software_BT_IV/Charger-Software_BT_IV.ino | UTF-8 | 4,258 | 3 | 3 | [] | no_license | /* Name: MPPT Solar Charger with Bluetooth communication | Main software file
* Author: Karol Wojsław
* Date: 02/04/2021 (last release)
*/
#include <SoftwareSerial.h>
/*Define pin allocations on Arduino board */
#define BAT_VOLT_PIN A0
#define PV_VOLT_PIN A1
#define PV_CURRENT_PIN A2
#define PWM_PIN ... | true |
24c623b339e0c6deccd87b677d4673fe929264c5 | C++ | PaulEcoffet/roborobo3 | /roborobo3/include/core/Observers/WorldObserver.h | UTF-8 | 1,467 | 2.859375 | 3 | [] | no_license | /*
* WorldObserver.h
* roborobo-online
*
* Created by Nicolas on 20/03/09.
* Copyright 2009. All rights reserved.
*
*/
#ifndef WORLDOBSERVER_H
#define WORLDOBSERVER_H
#include "Observers/Observer.h"
class World;
class WorldObserver : public Observer
{
//private:
protected:
World *_world;
public... | true |
b9041b3ce098ff55e15b8ad5fefcd21ab80280ee | C++ | whing123/C-Coding | /NewCoder/97.cpp | UTF-8 | 741 | 3.125 | 3 | [] | no_license | /*
97
滑动窗口最大值
*/
class Solution {
public:
vector<int> maxInWindows(const vector<int>& num, unsigned int size)
{
vector<int> res;
if (size < 1 || num.size() < size) {
return res;
}
deque<int> qmax;
for (int i = 0; i < num.size(); ++i) {
... | true |
d87d690be4133d47f0da6c3c0036b5b3acade605 | C++ | Dusting0/LeetCode | /150.逆波兰表达式求值/evalRPN.cpp | UTF-8 | 1,077 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <stack>
using namespace std;
class Solution {
public:
int evalRPN(vector<string>& tokens) {
stack<int> stk;
for(int i=0; i<tokens.size(); i++) {
try {
int num = stoi(tokens[i]);
... | true |
28f205d636e1cff782d7f35e211f3e02dc17a46c | C++ | aminnezarat/KTT | /source/api/stop_condition/tuning_duration.h | UTF-8 | 2,105 | 2.96875 | 3 | [
"MIT"
] | permissive | /** @file tuning_duration.h
* Stop condition based on total tuning duration.
*/
#pragma once
#include <algorithm>
#include <chrono>
#include <api/stop_condition/stop_condition.h>
namespace ktt
{
/** @class TuningDuration
* Class which implements stop condition based on total tuning duration.
*/
class TuningD... | true |
52240cbb6badbdb485aec4aafbc27c7a9d7c8a02 | C++ | NoCodeBugsFree/RTS | /Source/RTS/RTS_CameraPawn.cpp | UTF-8 | 2,134 | 2.546875 | 3 | [] | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "RTS_CameraPawn.h"
#include "Components/BillboardComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/FloatingPawnMovement.h"
// Sets default values
ARTS_CameraPawn... | true |
f8fb885db05ceb086e51f69ce269b3a5cadfaf05 | C++ | TamakiRinko/High_Level_Programme | /OJ/Exam5/exam5/OpSeq.h | UTF-8 | 744 | 2.5625 | 3 | [] | no_license | //
// Created by rinko on 2019/11/8.
//
#ifndef EXAM5_OPSEQ_H
#define EXAM5_OPSEQ_H
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
class List{
vector<int> list;
int len;
public:
List(int* a,int len);
void show();
List& operator=(List x);
in... | true |
f4aca1a229a2a8b885b8e50db27a4869e6a7df4d | C++ | himanshu-802/CP1_CIPHERSCHOOLS | /Dynamic Programming/Partial Equal Subset Sum.cpp | UTF-8 | 682 | 2.71875 | 3 | [] | no_license | class Solution {
public:
bool func(vector<int>nums, int sum, int n, unordered_map<int,int>&dp)
{
if(sum==0){
return true;
}
if(n==0){
return false;
}
if(dp.find(sum)!=dp.end()){
return dp[sum];
}
int result= func(nums,su... | true |
61458822798f89bdfea429c0ecfcc1c28346945a | C++ | s-kramer/cpp_tests | /t28_aggregate_sequential_initialization.cpp | UTF-8 | 1,306 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
struct Widget {
public:
Widget(int num = Widget::count++) :
value(num)
{
// std::cout << "Widget default constructor\n";
// std::cout << "Count: " << count << '\n';
}
... | true |
24d2b818de84568248fd0a95c17b8644e1cb2f03 | C++ | MLoktev/Bin_Tree | /Bin_Tree/Tests/Bin_Tree_Tests/main.cpp | UTF-8 | 884 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include "bin_tree.h"
#include <gtest/gtest.h>
TEST(Bin_Tree_Test, addNode){
//Input
BinTree<int> binTree;
//Expected
size_t expextedSize = binTree.getSize() + 1;
//Actual
binTree.add(10);
size_t actualSize = binTree.getSize();
//Check
ASSERT_EQ(expextedSize, ... | true |
19d78cdafa85c235f20a417a67c0c405d2a6321b | C++ | tsingfun/cpp | /C++常用算法/查找(Search)/顺序查找和二分查找.cpp | UTF-8 | 1,151 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | #include<iostream>
#include<windows.h>
using namespace std;
class int_Arr
{
int *std;
int maxsize;
public:
int_Arr(int size);
~int_Arr();
int &operator[](int i);
int length(){return maxsize;}
};
int_Arr::int_Arr(int size)
{
maxsize=size;
std=new int[maxsize];
}
int_Arr::~int_Arr()
{
delete []std;
}
int &int_Ar... | true |
0b6435b44431388686cf36d638ccf74e6522b772 | C++ | Twila27/SimplerMiner | /Engine/Code/Engine/Math/Vector3.hpp | UTF-8 | 5,763 | 3.359375 | 3 | [] | no_license | #pragma once
#include <math.h>
#include "Engine/Error/ErrorWarningAssert.hpp"
class Vector3
{
public:
inline Vector3();
inline Vector3( float initialX, float initialY, float initialZ );
inline Vector3( const Vector3& vectorToCopy );
inline void GetXYZ( float& out_x, float& out_y, float& out_z ) const;
inlin... | true |
f326388f73b8850041ad1c3297823bf2b15d9322 | C++ | dubrousky/binomial | /include/thread_pool.h | UTF-8 | 7,327 | 3.125 | 3 | [] | no_license | //
// Created by Aliaksandr Dubrouski on 6/8/15.
//
#ifndef BINOMIAL_THREADPOOL_H
#define BINOMIAL_THREADPOOL_H
#include <thread>
#include <mutex>
#include <condition_variable>
#include <vector>
#include <future>
#include <queue>
#include <iostream>
#include <numeric>
#include <memory>
class thread_pool;
/**
* @clas... | true |
b8c12b6f3e79abbfa237f744343c0f831e787e5f | C++ | Vortez2471/Dynamic_Programming | /Wine_problem.cpp | UTF-8 | 913 | 3.0625 | 3 | [] | no_license | //Wine problem
#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int memo[1000][1000];
int wine(int arr[],int s,int e,int year)
{
if(s>e)
return 0;
if(memo[s][e]!=-1)
return memo[s][e];
int q1=INT_MIN;
int q2=q1;
q1=arr[s]*year+wine(arr,s+1,e,year+1);
q2=arr[e]*year+wine(a... | true |
f5c3132af29f394d4b4a8ce45c8bca4c7457488e | C++ | varun-sundar-rabindranath/matmul-HPC | /matmul_cpp.cpp | UTF-8 | 2,177 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include <cstdlib> // malloc
#include <cassert> // assert
#include "utils.hpp"
#include "timer.hpp"
using namespace std;
#define G 1000000000
#define M 1000000
void matmul(float* A, float* B, float* C, int n) {
for (int i = 0; i < n; i++) { // Iterates the rows
for (int j = 0; j < n;... | true |
37e6414aba72ca0f4b9e1e2fb53e8013b616eac7 | C++ | festiveBean/Titan-Voyager-Custom-Game-Engine | /Game Engine - Titan Voyager - Rony Hanna/Voyager/PointLight.h | UTF-8 | 1,074 | 2.90625 | 3 | [] | no_license | #pragma once
#ifndef __POINTLIGHT_H__
#define __POINTLIGHT_H__
#include "Dependencies\glm-0.9.9-a2\glm\glm.hpp"
#include "Dependencies\glm-0.9.9-a2\glm\gtx\transform.hpp"
class PointLight
{
public:
PointLight();
~PointLight();
void Configure(glm::vec3 ambient, glm::vec3 diffuse, glm::vec3 specular, float constant... | true |
bd3761a5b1dd73d7e2f2f7713247c993ccc464b4 | C++ | yuhsuanyang/leetcode | /integer_to_roman.cpp | BIG5 | 1,114 | 3.734375 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <map>
using namespace std;
//bC++rꪺOѦrҲզ}CAæb̫[W@Ӫš]null^r'\0'
class Solution {
public:
map<int, string>m[4];
Solution(){
m[0][1]="M";
m[1][1]="C";
m[2][1]="X";
m[3][1]="I";
m[1][5]="D";
m[2][5]="L";
m[3][5]="V";
for(int i=0;i<4;i++){
... | true |
5b4664f1bbb70f89c6e17c2d6d010c1820e69052 | C++ | ScienceIsNeato/escape_room_radio | /include/trigger.h | UTF-8 | 407 | 2.6875 | 3 | [] | no_license | #ifndef TRIGGER_H
#define TRIGGER_H
#include <functional>
class Trigger
{
// This class manages a triggered event (i.e. button press) that initiates the checks throughout the program
private:
bool _debug_condition = false;
public:
Trigger();
~Trigger();
void Listen... | true |
12e57a49b1d20aa471b22fbd2a698fe591f3f09e | C++ | violetfeline/cppBasic | /03/25/main.cpp | UTF-8 | 537 | 2.859375 | 3 | [] | no_license | #include <iostream>
int main() {
const int size = 10;
const int merged = size * 2;
int a[size];
int b[size];
int c[merged];
for(int i = 0; i < size; i++) std::cin >> a[i];
for(int i = 0; i < size; i++) std::cin >> b[i];
int i = 0;
int j = 0;
int k = 0;
while(i < size && j < size) {
if(a[i] <= b[j]) {
c... | true |
ecc1a3f4a315d4c9db65a5afab3de1e45ec63e72 | C++ | DaDaMrX/ACM | /Code/Dynamic Programming/Codeforces 337D Book of Evil (子树直径).cpp | UTF-8 | 1,332 | 2.640625 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
const int INF = 0x7f7f7f7f;
const int N = 1e5 + 10;
struct Edge
{
int to, next;
} e[N * 2];
int head[N], num;
int n, m, d;
int p[N], dis1[N], dis2[N];
void add(int u, int v)
{
e[num].to = v;
e[num].next = head[u];
he... | true |
d2e87f4d948db685a1cd4970ddea2688a537b39d | C++ | mediabuff/Lumino | /Source/LuminoEngine/Include/Lumino/Scene/TextBlock.h | UTF-8 | 2,609 | 2.75 | 3 | [
"MIT"
] | permissive |
#pragma once
#include <Lumino/Graphics/Texture.h>
#include "VisualNode.h"
LN_NAMESPACE_BEGIN
LN_NAMESPACE_SCENE_BEGIN
namespace detail { class Paragraph; }
class TextBlock2DComponent;
using TextBlock2DComponentPtr = Ref<TextBlock2DComponent>;
/**
@brief
*/
class TextBlock2DComponent
: public VisualComponent
{
LN... | true |
01f4f82498d8f049d26985ab58b5e1d4cab6fcb0 | C++ | DFLovingWM/leetcode-solving | /problems/413-arithmetic-slices/math.cpp | UTF-8 | 667 | 3.5 | 4 | [] | no_license | /**
* 数学:计算每一段等差子数组的个数(用求和公式),累加即可
*
* 时间:`O(N)`, 8ms
*/
class Solution {
public:
int numberOfArithmeticSlices(vector<int>& A) {
int res = 0;
int acc = 0, d;
// 找连续的等差子数组
for (int i = 2; i < A.size(); ++i) { // 技巧:这里从2开始
if (A[i] - A[i-1] == A[i-1] - A[i-2]) { // 可... | true |
a5b273a80e7ba94a4319fe648e1c48f2528ceaa3 | C++ | yzbx/surveillance-video-system | /objectTracking/src/objectTracking/yzbxLib/ObjectTrajectoryProcessing.h | UTF-8 | 2,121 | 2.625 | 3 | [] | no_license | #ifndef OBJECTTRAJECTORYPROCESSING_H
#define OBJECTTRAJECTORYPROCESSING_H
#include <QtCore>
#include <iostream>
#include <yzbx_config.h>
class ObjectTrajectoryProcessing
{
public:
ObjectTrajectoryProcessing(QString inputFile,QString outputFile);
private:
float distanceThreshold=100;
class object{
publi... | true |
8efad9d8763ab330f64baf14eab605578e04f135 | C++ | gabrielgbs/Pel-eterno | /Jogador.cpp | UTF-8 | 12,326 | 2.671875 | 3 | [] | no_license | #include "Jogador.hpp"
Jogador::Jogador(){
posX = posZ = posY = 0;
}
Jogador::Jogador(double x, double y, double z){
posX = x;
posY = y;
posZ = z;
//criaListas();
}
void Jogador::setPos(double x,double y,double z){
posX = x;
posY = y;
posZ = z;
}
double Jogador::getPosX(){
return posX;
... | true |
7fa204c8b2f470eeb0bb9c61c9aad556023dd2f8 | C++ | mike-sherman1/parser | /parser3/lexan.cpp | UTF-8 | 2,660 | 2.9375 | 3 | [] | no_license |
#include <iostream>
#include <fstream>
#include <cctype>
#include "token.h"
#include "functions.h"
using namespace std;
extern ifstream ifs; // input file stream to read from
extern SymTab symtab; // global symbol table
static int lineno = 1; ... | true |
acff69a459ad497c0a3820e575c8b5947ab8cfca | C++ | CaiyuhangChina/- | /乙级/1026. 程序运行时间(15).cpp | GB18030 | 461 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
unsigned c1, c2, c;
cin >> c1 >> c2;
unsigned h, m, s;
unsigned diff = (c2 - c1);
if (diff % 100 >= 50)//˳β
c = 1;
else c = 0;
diff = diff / 100 + c;
s = diff % 60;
diff /= 60;
m = diff % 60;
diff /= 60;
h = diff;
... | true |
dd4c43c277bbb8eff9c7df3e0a8ab9f12ad7d020 | C++ | ftlka/data-structures | /week 3/mergingTables.cpp | UTF-8 | 2,964 | 3.75 | 4 | [] | no_license | /*
There are n tables stored in some database. The tables
are numbered from 1 to n. All tables share the same set
of columns. Each table contains either several rows with
real data or a symbolic link to another table. Initially,
all tables contain data, and i-th table has r_i rows.
You need to perform m of the fo... | true |
e97ed5abe0b4c3dc30104fd1db55f89519338865 | C++ | rlavaee/sesc-src | /libll/HeapManager.cpp | UTF-8 | 4,445 | 2.71875 | 3 | [] | no_license | #include "HeapManager.h"
#include "ReportGen.h"
HeapManager::HeapManager(Address base, size_t size)
: refCount(0), begAddr(base), endAddr(base){
// The base and the size need to be non-zero multiples of MinBlockSize
I(base&&!(base&MinBlockMask));
I(size&&!(size&MinBlockMask));
BlockInfo *blockInfo=ne... | true |
46aed592408aece16b8e63479fefea2be99f9501 | C++ | frontseat-astronaut/Competitive-Programming | /UVa/10443.cpp | UTF-8 | 1,628 | 2.59375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int r,c,n;
cin>>r>>c>>n;
char grid[2][r][c];
for(int i=0; i<r; ++i)
for(int j=0; j<c; ++j)
cin>>grid[0][i][j];
int g=0, k=0;
for(k=0; k<n; ++k, g=(g+1)%2)
{
for(int i=0; i<r; ++i)
{
for(int j=0; j<c; ... | true |
52295d294701b7ebee921b4d84a8e6e320b78b2a | C++ | GABRIELMUTTI/mtecs | /include/mtecs/group/GroupManager.hpp | UTF-8 | 815 | 2.59375 | 3 | [] | no_license | #pragma once
#include "mtecs/group/Group.hpp"
#include "mtecs/entity/EntityManager.hpp"
#include "mtecs/component/ComponentManager.hpp"
namespace mtecs::internal
{
class GroupManager
{
private:
std::vector<Group*> groups;
const EntityManager& entityManager;
const ComponentManager& componentManager;
v... | true |
fa0f0d5b25573b62cba4e9389a8abd1743dd6b2e | C++ | liweiliv/DBStream | /sqlParserV2/token.cpp | UTF-8 | 536 | 2.6875 | 3 | [] | no_license | #include "token.h"
namespace SQL_PARSER {
DLL_EXPORT bool token::compare(const token& t)
{
if (type !=t.type)
return false;
switch (type)
{
case tokenType::identifier:
break;
case tokenType::keyword:
case tokenType::specialCharacter:
case tokenType::symbol:
if (value.compare(t.value) != 0)
... | true |
f83e88bb07484dbcf902991f9be671b6b724bb41 | C++ | cats9rule/sp-lab | /BinarnaStabla/BinarnaStabla/Stack.h | UTF-8 | 216 | 2.90625 | 3 | [] | no_license | #pragma once
#include "BSTNode.h"
class Stack {
public:
virtual void push(BSTNode* el) = 0;
virtual BSTNode* pop() = 0;
virtual bool isEmpty() = 0;
virtual bool isFull() = 0;
virtual int numOfElements() = 0;
}; | true |
1bc6adbdec745cd2bb5a27e3d360ef4567f032bb | C++ | damansh/Arduino-Code | /Appmotor/Appmotor.ino | UTF-8 | 1,453 | 2.578125 | 3 | [] | no_license | int ltPowerOne = 6;
int ltFwdOne = 7;
int ltBwdOne = 8;
int ltPowerTwo = 1;
int ltFwdTwo = 2;
int ltBwdTwo = 3;
int LEDpin = 13;
int estado ;
void setup() {
Serial.begin(9600);
pinMode(ltPowerOne, OUTPUT);
pinMode(ltFwdOne, OUTPUT);
pinMode(ltBwdOne, OUTPUT);
pinMode(ltPowerTwo, OUTPUT);
pi... | true |
b6e633ee9b0e8cbe0c374ce540923463de839158 | C++ | hvariant/LICAgent | /demo/controller/main.cc | UTF-8 | 2,922 | 2.53125 | 3 | [] | no_license | #include "yapcontroller.h"
#include "parser.h"
#include <string>
#include <stdlib.h>
using std::string;
//#define KIF_FILE "tic.kif"
//#define PL_FILE "tic.pl"
//#define COMPILED_GGP "tic.ggp"
//#define KIF_FILE "pentago.kif"
//#define PL_FILE "pentago.pl"
//#define COMPILED_GGP "pentago.ggp"
//#define KIF_FILE "bu... | true |
34f56e49d2b403f779d2b95a811a9e744e4abe66 | C++ | TCC-Grupo-19/Sistema-IoT-de-Tratamento-de-gua-de-Chuva-para-Mini-hortas-Inteligentes | /TCC - GRUPO 19/Codigo_DHT11_ThingSpeak/Codigo_DHT11_ThingSpeak.ino | UTF-8 | 1,394 | 2.6875 | 3 | [] | no_license | #include "ThingSpeak.h"
#include <WiFi.h>
#include <Wire.h>
#include "DHT.h"
#define DHTPIN 23
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
char ssid[] = "NAME"; // Nome da Rede que será usada
char pass[] = "PASSWORD"; // Senha da Rede que será usada
WiFiClient client;
unsigned long myChannelNumber =... | true |
a2ed62990f85f53e160b4342fe5ad40de76f1438 | C++ | loohcs/LookForPlace | /LookForPlace/include/htl/htl_uninitialized.h | UTF-8 | 1,979 | 2.734375 | 3 | [] | no_license |
/*
* htl-lite - a basic data structures and algorithms.
* Copyright (C) 2009 leon hong. All rights reserved.
* authors:
* leon hong <codeblocker@gmail.com>
*/
#ifndef __HTL_UNINITIALIZED__
#define __HTL_UNINITIALIZED__
#include "htl_construct.h"
__HTL_BEGIN_NAMESPACE
template<typename Forward... | true |
e0225e95b0132c1bce8ce28e5e9e62c72fd7ca52 | C++ | dgg5503/Game-Graphics-Programming-Project | /LightRenderer.cpp | UTF-8 | 9,598 | 2.640625 | 3 | [] | no_license | #include "LightRenderer.h"
// --------------------------------------------------------
// Constructor
//
// Creates a light renderer which will use the context and
// device found in the given renderer.
//
// renderer - Reference to renderer object in which to render
// light to.
// -------------------------------... | true |
0ce6f5701285c6fcbe42c927adf4c36c61f4864d | C++ | ragrag/Competitive-Programming-Library | /Problems(UVA_CF)/Codeforces/9A.cpp | UTF-8 | 802 | 2.609375 | 3 | [] | no_license | #include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
int main()
{
int x, y;
cin >> x >> y;
vector <int> ar;
for (int i = 0; i < 6; i++)
{
if (i + 1 >= max(x, y))
... | true |
1dbdbe97c4eb4df378efb188e649a106368fac6b | C++ | adityajain17/CPP-Codes | /OCTAL_TO_DECIMAL.cpp | UTF-8 | 409 | 3.75 | 4 | [] | no_license | /*WAP to convert from octal format to decimal format using do-while loop*/
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int octal,d,c=0;double dec=0;
cout<<"Enter the number in octal "<<endl;
cin>>octal;
do
{
d=octal%10;
dec=dec+d*pow(8,c);
c++;
octal=octal/10;
}
... | true |
e6a2f0e9f64a0deaef0d0331b2a6466673e2a480 | C++ | bhavya2026/practice-questions | /linked list/KthElement2pointer.cpp | UTF-8 | 1,245 | 3.5 | 4 | [] | no_license | #include<iostream>
using namespace std;
struct node{
int data;
node *next;
}*head=NULL;
void create(){
int tests,x;
do{
node *newnode=new node;
node *temp;
cout<<"\t\t\t\tenter the value ";
cin>>x;
newnode->data=x;
newnode->next=NULL;
if(head==... | true |
085573da99f603966b4e4b26c7de9301aeb84dbb | C++ | elfmedy/vvdn_tofa | /mdk_release_18.08.10_general_purpose/mdk/common/components/kernelLib/MvCV/kernels/bitwiseAndMask/unittest/bitwiseAndMask_unittest.cpp | UTF-8 | 8,352 | 2.890625 | 3 | [] | no_license | //bitwiseAndMask kernel test
//Asm function prototype:
// void bitwiseAndMask_asm(u8** in1, u8** in2, u8** out, u8** mask, u32 width);
//Asm test function prototype:
// void bitwiseAndMask_asm_test(unsigned char **input1, unsigned char **input2, unsigned char **output, unsigned char **mask, unsigned int wi... | true |
1906faae37c0adae9698fb03daabafc3804592d5 | C++ | siljeanf/TDT4102_OOP | /Øving 3/std_lib_facilities_mac/std_lib_facilities_mac/cannonball.cpp | UTF-8 | 2,978 | 3.109375 | 3 | [] | no_license | //
// cannonball.cpp
// std_lib_facilities_mac
//
// Created by Silje Anfindsen on 22/01/2019.
// Copyright © 2019 Lars Musaus. All rights reserved.
//
#include "std_lib_facilities.h"
#include "cannonball.hpp"
#include <math.h> /* pow */
double acclY() {
double acc = -9.81;
return acc;
}
dou... | true |
3424fecc0ee4d2e04f0adb3024c365dea78f6720 | C++ | tbaekk/cs343 | /final/boundedbufferEXT.cc | UTF-8 | 936 | 2.921875 | 3 | [] | no_license | #include <uC++.h>
#include <iostream>
using namespace std;
_Task BoundedBuffer {
int front, back, count;
int Elements[20];
public:
BoundedBuffer() : front(0), back(0), count(0) {}
_Nomutex int query() { return count; }
void insert( int elem ) {
Elements[back] = elem;
back ... | true |
b30723c2a1430eeb99d95f3027cc6445c1906bf1 | C++ | kir156/projects | /wavelet_alghoritm/mathematic.cpp | UTF-8 | 1,242 | 2.546875 | 3 | [] | no_license | #include "mainwindow.h"
std::vector<float> MainWindow::pairConv(std::vector<float> &data,std::vector<float> &CL, std::vector<float> &CH, int delta) {
if(CL.size() == CH.size()) {
std::vector<float> out;
int N = CL.size();
int M = data.size();
for(int i = 0; i != M; i += 2) {
... | true |
ab5f107affafed319e720b7c73a3d2ab2449c6bf | C++ | BullynckVictor/VulkanRave | /VulkanRave/Engine/General/Window/Mouse.h | UTF-8 | 611 | 2.59375 | 3 | [] | no_license | #pragma once
#include "Engine/Utilities/Flag.h"
#include "Engine/Utilities/Vector.h"
namespace rv
{
class Mouse
{
public:
class Button
{
public:
bool Pressed() const;
bool Flagged();
bool Peek() const;
private:
bool pressed = false;
Flag<bool> flag;
friend class Window;
};
const Poi... | true |
718e84675794a93d8a3f1e1c907ff98334320f6e | C++ | hoangpham95/3d-tetris | /include/Tetromino.h | UTF-8 | 685 | 2.625 | 3 | [] | no_license | #ifndef TETROMINO_H
#define TETROMINO_H
#include <Constants.h>
#include <Cube.hpp>
class Tetromino {
public:
Tetromino(Shape, const int&);
std::vector<Cube*> getCubes();
void Move(Direction);
void Rotate(Rotation);
private:
std::vector<Cube*> m_Cubes;
Cube* m_Center;
void genCubeCoords(float* cubeC... | true |
b24f221c0c2ce2451d36822c421a868e4fb053ce | C++ | Boringmanzr/boringmanzr-git-test | /cpppointer/cpp-pointer-array.cpp | UTF-8 | 394 | 3.53125 | 4 | [] | no_license | #include <iostream>
using namespace std;
const int MAX = 3 ;
int main()
{
int var[MAX]={10,20,30};
for(int i=0; i<MAX;i++)
{
*(var + i ) = i ; //*操作的必须是指针
/*
使用*var[i]就是错误的,
*/
//var++; //常量不能使用++计算
cout << "指针所指的数组var["<<i<<"]" << var[i] << endl;
}
... | true |
bd11718ad4dbc1816e8e7d37cdebc83e3fe86690 | C++ | CaptainTPS/LeetCodeRep | /LeetCode/lc394.cpp | UTF-8 | 798 | 3.25 | 3 | [] | no_license | #include <string>
using namespace std;
class Solution394 {
public:
string dfs(string& s, int& sptr){
string re = "";
if (sptr >= s.length())
return re;
if (isdigit(s[sptr])){
int n = 0;
while (sptr < s.length() && isdigit(s[sptr])){
n = n * 10 + s[sptr] - '0';
sptr++;
}
string temp;
s... | true |
2c2b5bf9f60a8bd22d9d5bca628d0e74c63d0d85 | C++ | kimshgood/DRAMsim3 | /tests/test_config.cc | UTF-8 | 2,998 | 2.5625 | 3 | [
"MIT"
] | permissive | #define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "configuration.h"
TEST_CASE("Address Mapping", "[config]") {
dramsim3::Config config("configs/HBM1_4Gb_x128.ini", ".");
SECTION("TEST address mapping set up") {
REQUIRE(config.address_mapping == "rorabgbachco");
// COL width is not necess... | true |
987de8a4777738c44afc69a659f454004a2f9e7c | C++ | OpenBoardView/OpenBoardView | /src/openboardview/utils.cpp | UTF-8 | 3,516 | 3.078125 | 3 | [
"MIT"
] | permissive | #include "utils.h"
#include <SDL.h>
#include <algorithm>
#include <cctype>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iterator>
#include <sstream>
#include <cstdint>
#ifndef _WIN32
#include <dirent.h>
#endif
#include <sys/stat.h>
#include <sys/types.h>
// Loads an entire file in to memory
std... | true |
25bcb48557844fa71bc95fa8e52c3a4eaf6a026c | C++ | dasmysh/OGLFrameworkLib_uulm | /OGLFramework_uulm/gfx/Material.h | UTF-8 | 1,416 | 2.9375 | 3 | [
"MIT"
] | permissive | /**
* @file Material.h
* @author Sebastian Maisch <sebastian.maisch@googlemail.com>
* @date 2013.12.31
*
* @brief Contains the material class
*/
#ifndef MATERIAL_H
#define MATERIAL_H
#include "main.h"
namespace cgu {
class GLTexture2D;
/**
* @brief Class describing materials.
*
*... | true |
d097519b97fd538ca8883d264d1f8adcab7b7127 | C++ | yh1807/data_struct | /string.h | UTF-8 | 939 | 3.296875 | 3 | [] | no_license | #pragma once
#include <string.h>
#include <ostream>
class string
{
public:
string(const char *cstr = 0);
string(const string &rhs);
string& operator=(const string &s);
~string()
{
delete[] data_;
}
char* get_c_str() const { return data_; }
private:
char *data_;
};
strin... | true |
1e9936900f913aa423121cc5f39840c4b55928c8 | C++ | Naruell/BAEKJOON | /2742.cpp | UTF-8 | 308 | 2.828125 | 3 | [] | no_license | // 2742 기찍 N
#include <iostream>
int main()
{
std::cin.tie(NULL);
std::ios_base::sync_with_stdio(false);
int printNumberFrom;
std::cin >> printNumberFrom;
printNumberFrom++;
while(printNumberFrom-- > 1)
{
std::cout << printNumberFrom << '\n';
}
return 0;
} | true |
9ab7d0585f5a567a7235390281071476b6ea742d | C++ | xminjie/TSOJ | /1363类斐波那契终极版(谢).cpp | GB18030 | 3,693 | 3.265625 | 3 | [] | no_license | 1363:쳲
Ѷȣ ʱƣ 1000MS ռƣ 64MB ύ 242 ͨ 8 ĿԴ: admin
Ŀ
[2017 տƼѧ ƾ]
C. 쳲 (ı)
Ŀ
ѧУһĵƹʽΪ쳲ƹʽѧʣѧѧΪйѧڿͨ F(n) ʾһ쳲еĵ n ļ㹫ʽǣ
q a * F(n - 2) + b * F(n - 1) (n > 2)
F(n) = | p (n = 1)
t q (n = 2)
Уa, b, p, q, Ϊȷij
ij쳲еĵ i Ƕ١
жݣÿռС
ڵһУһոָ a, b, p, q, ȷ쳲еĵƹʽ
ڵڶУһ mʾУҪ m F(n)
ڵУ m ÿոָ n1, n2, n3, ... ... | true |
843f0cccb8ba2ba2f6254342b77b9a80b046f2da | C++ | realfan-1s/LeetCodeHard | /Union-find Sets/InvertPairs.cpp | UTF-8 | 2,961 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <unordered_map>
using namespace std;
// 归并排序
class Solution1 {
public:
int reversePairs(vector<int>& nums) {
if (nums.size() < 2)
return 0;
return RescursiveSort(nums, 0, nums.size() - 1... | true |
c071296a89c6e6094e6112fddf38cf66f240e5f6 | C++ | peter88037/LeetCode | /62. Unique Paths.cpp | UTF-8 | 542 | 2.890625 | 3 | [] | no_license | class Solution {
public:
int uniquePaths(int m, int n) {
vector<vector<int>> ans(m,vector<int>(n));
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
if(i==0 || j==0)
{
ans[i][j]=1;
}
... | true |
7bac5d12ae8c0cc4922b6dcf20b2a660bbbadc9c | C++ | zengmmm00/DSAA | /week6/MatchingProbelm/main.cpp | UTF-8 | 1,352 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
char s[200001];
char t[200001];
int main() {
int T;
scanf("%d", &T);
for (int i = 0; i < T; ++i) {
int n, m;
scanf("%d %d", &n, &m);
scanf("%s\n%s", s, t);
int location = -1;
for (int j = 0; j < n; ++j) {
... | true |
4e37894d355310944fc26f78642d663d70d294e1 | C++ | FungluiKoo/CodeForceSolutions | /88C.cpp | UTF-8 | 488 | 3 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <numeric>
#include <queue>
int main(){
long long dasha_interval, masha_interval;
std::cin >> dasha_interval >> masha_interval;
long long gcd = std::gcd<long long,long long>(dasha_interval, masha_interval);
dasha_interval/=gcd;
masha_interval/=gcd;
if(std::abs(dasha_... | true |
77d4f1accf432bcffe7c7c329cc493d2e47a7183 | C++ | JamesCMLucas/GameMathDump | /cVector3.cpp | UTF-8 | 1,380 | 3.09375 | 3 | [] | no_license | #include "cVector3.h"
#include "nMath.h"
float cVector3::Normalize( float tol /*= nMath::EPSILON */ )
{
float mag2 = x*x + y*y + z*z;
if ( mag2 < tol )
{
return mag2;
}
float magInv = nMath::InverseSqrt( mag2 );
x *= magInv;
y *= magInv;
z *= magInv;
return mag2;
}
float cVector3::Length() const
{
retur... | true |
99a0bf3c1cd40087339b8a5fffff61603bb7029e | C++ | ksobtafo/Exam273 | /event.h | UTF-8 | 780 | 3.109375 | 3 | [] | no_license | #ifndef EVENT_H
#define EVENT_H
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include "invite.h"
class event: class invite
{
private:
std::list<std::string> name;
public:
invite *add(std::string name)
{
name.push_front(name1); // an invite is added to the fron ot the line
std::list... | true |
a027a0e4bc0dfb332d9b4defafb6d1b5d0bc9b46 | C++ | AmanajasLG/IDJ | /src/Collider.cpp | UTF-8 | 2,583 | 2.765625 | 3 | [] | no_license | #include "../include/Collider.h"
#include "../include/Collision.h"
#include "../include/Camera.h"
#include "../include/Game.h"
Collider::Collider(GameObject &associated, Vec2 scale, Vec2 offset) : Component(associated){
this->scale = scale;
this->offset = offset;
}
void Collider::Update(float dt){
box = a... | true |
344a157aca39efc0a50784fb0d1477d316868d74 | C++ | tolerance1/Example-Task | /include/HourlyWaged.h | UTF-8 | 354 | 2.875 | 3 | [] | no_license | #ifndef HOURLYWAGED_H
#define HOURLYWAGED_H
#include "Employee.h"
class HourlyWaged : public Employee
{
public:
HourlyWaged(const string name, const string surname, const double rate);
~HourlyWaged() {}
void CalculateSalary();
private:
double Hours {8};
double Days {2... | true |
468bed4452c44f41dc930bbd408b231a934a1ba1 | C++ | juso40/IPK_BlockSeminar | /Sheet7/FroggerTemplate/Frogger/Frog.h | UTF-8 | 596 | 2.5625 | 3 | [] | no_license | #ifndef FROG_H
#define FROG_H
#include "Vec2D.h"
#include "Terminal.h"
#include "Water.h"
#include <vector>
class Frog{
private:
std::vector<Vec2D> _body;
public:
Frog();
void draw_frog(Terminal& term);
void move(char pressed);
//retuns the hitbox of the frog
Vec2D position(int n);
//checks... | true |
b5d41d68fcf0659ffd3af29a8d05e2e82e46ae99 | C++ | JayPOS/ProtAIGame | /Pacman/includes/astar.hpp | UTF-8 | 758 | 2.59375 | 3 | [] | no_license | #ifndef ASTAR_HPP
#define ASTAR_HPP
#include "includes.hpp"
typedef struct nos No;
struct nos
{
int i, j, w;
ii pai;
};
bool equal(No um, No dois);
auto comp = [](No &um, No &dois) { return um.w > dois.w; };
No criaInicio(int i, int j, int i_final, int j_final);
No criaFim(int i, int j);
No iniciaNo(int i,... | true |
6af11d5e60d84e39c1e3783e7919b341b99a1f54 | C++ | kirvlasenkov/cpp_garbage_collector | /belts/white/week_1/euclid.cpp | UTF-8 | 939 | 3.421875 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
// пока оба числа положительны, будем их уменьшать, не меняя их НОД
while (a > 0 && b > 0) {
// возьмём большее из чисел и заменим его остатком от деления на второе
// действительно, если a и b делятся н... | true |
a6d46c8cfcc54e28c4e8a132b2accd683317cb7a | C++ | italankin/bezier | /main.cpp | UTF-8 | 12,369 | 2.6875 | 3 | [] | no_license | #include <windows.h> // for ms windows
#include <GL\freeglut.h> // glut
#include <vector>
#include "bezier.h" // bezier calculations and classes
#include "files.h" // tools for reading files and converting into object... | true |
e31a0f29d132453e3644cfe6adac55c428c09a04 | C++ | noelchalmers/occa | /include/occa/tools/properties.hpp | UTF-8 | 1,409 | 2.546875 | 3 | [
"MIT"
] | permissive | #ifndef OCCA_TOOLS_PROPERTIES_HEADER
#define OCCA_TOOLS_PROPERTIES_HEADER
#include <occa/tools/json.hpp>
namespace occa {
class properties: public json {
public:
// Note: Do not use directly since we're casting between
// occa::json& <--> occa::properties&
mutable bool initialized;
properti... | true |
d5755b9a6ea5293be94101cb01b2c7dc677067a3 | C++ | erythronelumbo/tesela | /include/cynodelic/tesela/image_types.hpp | UTF-8 | 17,747 | 2.921875 | 3 | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Copyright (c) 2019 Álvaro Ceballos
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt
/**
* @file image_types.hpp
*
* @brief Defines the `basic_image` container.
*/
#ifndef CYNODELIC_TESELA_IMAGE_TYPES_HPP
#define CYNOD... | true |
6417b6f5b1cd32f81845bef23724c1054abb0d89 | C++ | killian05000/IUT | /Algo/tp1/tp1.cpp | UTF-8 | 717 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map<string, size_t> mymap;
//unordered_map<string, size_t>::const_iterator got = mymap.find(_content);
void addWord(string _content)
{
// if (ca y est)
// j'itere le compteur de ce mot
// else
// j'ajoute le mot... | true |
6ba7eb159b000d46d8f05249a21f7b0967813db6 | C++ | yuchen0515/online-judge-practice | /summer_Week5/uva10034_2.cpp | UTF-8 | 1,853 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <vector>
#include <cmath>
using namespace std;
typedef struct Pair{
int32_t v;
int32_t u;
double w;
}s_pair;
struct cmp{
bool operator()(s_pair a, s_pair b){
return a.w > b.w;
}
};
double dist(pair<double, double> a, pair<double, double> b){... | true |
12d3f7f1495f627290593fba7906e600c94a7c0e | C++ | Vicondrus/DMPPRactice | /DMPPractice/2018R1EngProb3/2018R1EngProb3.ino | UTF-8 | 279 | 2.828125 | 3 | [] | no_license | #include <Wire.h>
void setup() {
Wire.begin();
}
void loop() {
for(int i=0;i<20;i++){
int y = (1.5 + 1.5*sin(i/20 * 2*PI))*10;
int toSend = map(y,0,33,0,255);
Wire.beginTransmission(0x65);
Wire.write(toSend);
Wire.endTransmission();
delay(1);
}
}
| true |
9f5686ec4197a81fc75b59b9ef5dac397e15ecc7 | C++ | iitalics/ml | /src/Expression.h | UTF-8 | 884 | 2.5625 | 3 | [] | no_license | #pragma once
#include "Lexer.h"
#include "Value.h"
#include <memory>
#include <vector>
#include <string>
#include <iostream>
namespace ml {
class Context;
class Expression
{
public:
virtual ~Expression () = 0;
virtual std::string type () const = 0;
virtual bool eval (Value*& out, Context* ctx, Error& err);
};
n... | true |
07ac46f856103c1b2900aaeb64a4391b40f24d26 | C++ | sheshanathkumar/coding | /Bit1.cpp | UTF-8 | 688 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
long powerOne (long long x){
long count = 0;
while (x){
x = x & (x-1);
count ++;
}
return count;
}
int main (){
int test;
cin >>test;
while (test--){
int size, k = 0;
long long arr[size], b[size]... | true |
f95c9e2cdfa63185e7678a38ea87e00cf81423ec | C++ | shikhak101/leetcode | /BattleshipsInABoard.cpp | UTF-8 | 477 | 2.765625 | 3 | [] | no_license | class Solution {
public:
int countBattleships(vector<vector<char>>& board) {
int count = 0;
for(int i=0; i<board.size(); i++) {
for(int j = 0; j<board[i].size(); j++) {
if(board[i][j] == 'X') {
if(i>0 && board[i-1][j] == 'X') continue;
... | true |
20b4a2e9868539aaecc864541c75d2a2bc32eb33 | C++ | rosoareslv/SED99 | /c++/ClickHouse/2017/8/CastTypeBlockInputStream.h | UTF-8 | 1,561 | 2.84375 | 3 | [
"BSL-1.0"
] | permissive | #pragma once
#include <DataStreams/IProfilingBlockInputStream.h>
namespace DB
{
class IFunction;
/// Implicitly converts string and numeric values to Enum, numeric types to other numeric types.
class CastTypeBlockInputStream : public IProfilingBlockInputStream
{
public:
CastTypeBlockInputStream(const Context &... | true |
3a77789e3b71b79557d5a2022e5d654d3451a736 | C++ | rozPierog/FuzzyProject | /FuzzyProject/SimplyFuzzy.h | UTF-8 | 758 | 2.703125 | 3 | [] | no_license | #ifndef SIMPLYFUZZY_H
#define SIMPLYFUZZY_H
#include<math.h>
#include<malloc.h>
#include "TermTrapez.h"
struct Node {
float value = 0;
Node* next = NULL;
};
class SimplyFuzzy
{
public:
SimplyFuzzy();
~SimplyFuzzy();
void init();
void setInputs(int left, int mid, int right);
float getOutput(bool isLeft);
... | true |
925aa6e353f06fffb683775c0f7acf49a5bab861 | C++ | UnpureRationalist/learnModernCpp | /24distingushReference.cpp | UTF-8 | 1,080 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <Windows.h>
using namespace std;
/*
区分万能引用和右值引用
T&& 有两种含义:右值引用 和 万能引用
*/
// 万能引用
template <typename T>
void f(T &¶m)
{
}
int getInt()
{
return 0;
}
template <typename T>
void f2(vector<T> &¶m) // 是右值引用,不是万能引用
{
}
void f3(int n)
{
for (int i = ... | true |
c0a18bed04562890adb042e29442766f521c4aca | C++ | timofimo/GameEngine | /GameEngine/Input.cpp | UTF-8 | 2,965 | 2.890625 | 3 | [] | no_license | #include "Input.h"
GLFWwindow* Input::m_parentWindow;
Input::KeyState Input::m_ks[];
Input::KeyState Input::m_mbs[];
glm::vec2 Input::m_mousePos;
glm::vec2 Input::m_mouseLastPos;
bool Input::m_cursorWithinBounds;
/*utility includes*/
#include <iostream>
Input::Input()
{
}
Input::~Input()
{
}
void Input::initiali... | true |
02420fd6bcd137548240ea87af5cf7e801acbeb2 | C++ | Roy19/advanced_cplusplus | /standard_template_library/maps.cpp | UTF-8 | 675 | 3.890625 | 4 | [] | no_license | #include <iostream>
#include <map>
#include <string>
using namespace std;
int main(){
map<string, int> ages; // create a key,value pair table
// key: string, value: int
ages["Mike"] = 40;
ages["Raj"] = 50;
ages["John"] = 60;
// print all elements in the map
for(map<string, int>::iterator it = ages.begin... | true |
319aebf843b36c732dbee693b81a2e063c6d29d1 | C++ | Akshayy99/3D-Game-Opengl | /plane.cpp | UTF-8 | 5,431 | 2.84375 | 3 | [] | no_license | #include "plane.h"
#include "main.h"
Plane::Plane(float x, float y, float z, color_t color) {
this->position = glm::vec3(x, y, z);
this->yaw = 0;
this->roll = 0;
this->pitch = 0;
float n = 300;
len = 10.0;
float len2 = 13.0;
float len_head = 2.0;
speed = 3;
rise = false;
fal... | true |
a4a8402b6faa9300ad7d446adabad62efb4c5325 | C++ | pauld4/Portfolio | /c++/clocks.cpp | UTF-8 | 2,853 | 4.25 | 4 | [] | no_license | /*
* Clocks.cpp
*
* Clock application that starts at 0:00:00 and can add an hour, minute, or second to the time.
* By Paul Dziedzic
*
*/
#include <iostream>
#include <iomanip>
using namespace std;
//adds an hour to the time
void addHour(int& cTime) {
cTime = cTime + 3600;
if(cTime >= 86... | true |
43e858d1be0c4a9700a6f407408773c22d17fd59 | C++ | d34th4ck3r/Random-Codes | /deepest_root.cpp | UTF-8 | 552 | 2.828125 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<string>
#include<map>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<limits>
#include<set>
using namespace std;
class Node{
public:
int val;
Node *next;
Node(int x): val(x), next(NULL){}
};
class BinaryTree{
public:
int val;
... | true |
1b4873735af784fa441f33c3f311a43b35768bfb | C++ | qq834719601/KeRuiNote | /周作业/base64/review/review.cpp | GB18030 | 3,803 | 2.5625 | 3 | [] | no_license | // review.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
using namespace std;
#pragma warning(disable:4996)
char base64[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxzy0123456789+/";
void base64_encode(const char* strI, int nLength, char* strO);
void dec(const char* strI, int nL... | true |
f8f9247ab782b6eb88df129ebdb5789b89eeb187 | C++ | Veirisa/TranslationMethods | /ManualBuilding/lexical_analyzer.cpp | UTF-8 | 2,707 | 3.359375 | 3 | [] | no_license | #include "lexical_analyzer.h"
lexical_analyzer::lexical_analyzer() : s(), cur_pos(0), cur_token(BEGIN), cur_token_length(0) {};
lexical_analyzer::lexical_analyzer(const string& in) : s(in), cur_pos(0), cur_token(BEGIN), cur_token_length(0) {};
bool lexical_analyzer::is_blank(size_t pos) {
return s[pos] == ' ' ||... | true |
4c23f648e98c55a9c03c43193a7733e3e188f7e7 | C++ | Firlej/SK2-hangman | /server/server.cpp | UTF-8 | 12,381 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/time.h> //FD_SET, FD_ISSET, FD_ZERO macros
#include <string>
#include <pthread.h>
#include <time.h> /* time ... | true |
ef27464846f89ab16d63625a3a4bc7b951aa9247 | C++ | kmc7468/BOJ | /P14487.cpp | UTF-8 | 228 | 2.96875 | 3 | [] | no_license | #include <iostream>
int main() {
int n;
std::cin >> n;
int sum = 0, max = 0;
for (int i = 0; i < n; ++i) {
int cost;
std::cin >> cost;
sum += cost;
if (cost > max) {
max = cost;
}
}
std::cout << sum - max;
} | true |
d8b1fe2496d6ffe8a240098f57f4fe9a794fdee8 | C++ | adamcavendish/HomeworkGitShare | /DataStructures/Homework/03/0305.cpp | UTF-8 | 806 | 3.015625 | 3 | [] | no_license | #include "../List/List"
#include <cstring>
#include <iostream>
using namespace adamcavendish::data_structure;
int main(int argc, char * argv[])
{
if(argc != 3)
return 1;
List<char> t1(&argv[1][0], &argv[1][strlen(argv[1])]);
List<char> t2(&argv[2][0], &argv[2][strlen(argv[2])]);
auto bgn1 = t1.begin();
auto b... | true |
9d193a182bffc7f0ad279f6bc746e1388cee9755 | C++ | IhorHandziuk/LagrangePolynomial | /LagrangePolynomial.h | UTF-8 | 798 | 2.921875 | 3 | [
"MIT"
] | permissive | #ifndef LAGRANGEPOLYNOMIAL_H
#define LAGRANGEPOLYNOMIAL_H
#include <vector>
using std::vector;
using std::pair;
class LagrangePolynomial {
public:
bool addPoint(float x, float y);
bool removePoint(float x, float y);
void removeAllPoints();
float getPolynomialAtPoint(float x);
vector<float>... | true |
a3b72d325a09c15a15720fa2fe9dabfe1a6204d4 | C++ | marthall/TDT4102 | /Oving 02/ex5.cpp | UTF-8 | 395 | 3.59375 | 4 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int callByValue(int);
void callByReference(int&);
int main() {
int a = 10;
int b = 10;
int c = callByValue(a);
callByReference(b);
cout << a << endl << b << endl << c << endl;
return 0;
}
int callByValue(int number) {
return (pow(number, 2) + 10)*2;
}... | true |
394bdfae0050a4debcd51e2df2821ac42757d56b | C++ | vitorecomp/PooProject | /Exemplo/trabalho 1/poo/testes/testestipos.h | UTF-8 | 7,578 | 2.546875 | 3 | [] | no_license | //---------------------------------------------------------------------------
#ifndef testestiposH
#define testestiposH
#include <iostream>
#include "..\header\Dominios.h"
#include "..\header\Entidades.h"
//---------------------------------------------------------------------------
/**
* \mainpage Testes do Sistema ... | true |
1075ffb6a100e57baa7a5e6baf9e571bea61b519 | C++ | nysanier/cf | /nc/huawei/test2.cpp | UTF-8 | 409 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
const int N = 1000;
int a[N];
int n;
int main() {
while (std::cin >> n) {
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
}
std::sort(a, a + n);
auto p = std::unique(a, a + n);
int n2 = p - a;
for (int i = 0; i <... | true |
3449ff7310a331c8e6247e98c966abfe5e3bfe8a | C++ | am11/ffcore | /src/core/util/String/String.h | UTF-8 | 8,307 | 3.21875 | 3 | [] | no_license | #pragma once
namespace ff
{
class String;
typedef const String &StringRef;
/// Sometimes a function needs to return a string reference, but needs
/// something to return for failure cases. Use this.
UTIL_API StringRef GetEmptyString();
/// Ref-counted string class that acts mostly like std::string (but with co... | true |
09003694b6782cc814bfbd11c1272165fd54125b | C++ | csimstu/OI | /bzoj/p2111.cpp | UTF-8 | 1,067 | 2.703125 | 3 | [] | no_license | #include <cstdio>
typedef long long ll;
int N, P;
int log2[1000011];
ll powMod(ll a, ll n, ll m){
ll res = n & 1 ? a : 1;
for(n >>= 1; n; n >>= 1){
a = a * a % m;
if(n & 1)
res = res * a % m;
}
return res % m;
}
ll bino(ll n, ll k){
ll res = 1;
for(ll x = 1; x <= n; x ++)
res = res * x % P;
ll inv = 1;... | true |
2f2cc086402902bb2399c90ea8914e5897893fd9 | C++ | kuuala/cs253 | /search_in_state_space/Solver.cpp | UTF-8 | 4,732 | 3.203125 | 3 | [] | no_license | #include "Solver.hpp"
const vector<function<int(int)>> functions {
[] (int num) { return num * 2; },
[] (int num) { return num + 3; },
[] (int num) { return num - 2; }
};
const vector<function<bool(int&)>> back_functions {
[] (int &num) {
if (num % 2)
return... | true |
c010e74a7a7ae047f61a43b6fb4b216523254e52 | C++ | brl2002/DODGameEngine | /Src/Render.cpp | UTF-8 | 2,019 | 2.875 | 3 | [] | no_license | #include "Render.h"
#include "ResourceManager.h"
#include "Common.h"
#include <stdio.h>
#include <string>
// Constructor.
RenderComponent::RenderComponent( char* renderBuffer, char* mapBuffer, int mapBufferWidth, int mapBufferHeight )
: m_RenderableBufferArray(renderBuffer),
m_MapBufferArray(mapBuffer),
m_MapBuff... | true |
a54804dab0ea1a1849d1b2263f71c628c146105d | C++ | sutuglon/Motor | /lib/Collide/font.cpp | UTF-8 | 4,576 | 3.171875 | 3 | [] | no_license | /*
* font.cpp
* Noise
*
* Created by Chema on 11/30/09.
* Copyright 2009 __MyCompanyName__. All rights reserved.
*
*/
#include "GLInclude.h"
#include <fstream>
#include <string>
#include <stdexcept>
#include "font.h"
// Helper function to read a piece of data from a stream.
template<class T, class S>
void ... | true |