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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1b569208384eb3df47a44bc5686924d0c56a232f | C++ | MikeGus/TP_alg | /mod2/3/heap_sort_local/main.cpp | UTF-8 | 5,505 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <assert.h>
//3_1. Реклама.
//В супермаркете решили оптимизировать показ рекламы. Известно расписание прихода и ухода
//покупателей (два целых числа). Каждому покупателю необходимо показать минимум 2 рекламы.
//Рекламу можно транслировать только в целочисленные моменты времени. Покупатель м... | true |
88862d0eda763cdb80784923e77c214442e7f879 | C++ | Wunder9l/algorithms | /annealing_simulation/cpp/annealing.h | UTF-8 | 2,159 | 3.140625 | 3 | [] | no_license | #pragma once
#include <functional>
#include <random>
#include <math.h>
template<class TState>
class IAnnealingSimulator {
public:
virtual double EnergyCallback(const TState &state) = 0;
virtual TState NextStateCallback(const TState &state) = 0;
virtual double TemperatureCallback(double curTemperature, ... | true |
163409d572c1872473f7150577337af4682aff10 | C++ | WPI-NASA-SRC-P2/capricorn_competition_round | /operations/src/clients/navigation_vision_client.cpp | UTF-8 | 2,488 | 2.6875 | 3 | [] | no_license | /*
Author BY: Mahimana Bhatt
Email: mbhatt@wpi.edu
TEAM CAPRICORN
NASA SPACE ROBOTICS CHALLENGE
This ros node calls an actionlib to take the specified robot near to the given target. This code does not wait for getting the actionlib
finished with the task, just sends the goal (waits if server is not available) to act... | true |
2d477bbc4bb192436b724e2516f154b097ca8fe7 | C++ | quedlin/DataFileStats | /main.cpp | UTF-8 | 2,985 | 3.390625 | 3 | [] | no_license | /**
DataFileStats
main.cpp
Purpose: Checks a flat data file, and writes out some statistics to make database import somewhat easier.
@author Quedlin
@version 1.0 2018.03.23.
*/
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <iterator>
using n... | true |
746b5a73010314016b3b1fc1894ac2c132b8cf3a | C++ | teemid/Capstan | /include/Capstan/Math/Vector2f.h | UTF-8 | 3,321 | 3.25 | 3 | [
"MIT"
] | permissive | #ifndef CAPSTAN_MATH_VECTOR2F_H
#define CAPSTAN_MATH_VECTOR2F_H
#include "Capstan/Platform/Intrinsics.h"
#include "Capstan/Types.h"
namespace Capstan
{
struct Vector2f
{
union {
Real32 data[2];
struct { Real32 x, y; };
struct { Real32 u, v; };
};
V... | true |
df25b41d8f3067c64cf08f1550eb34fc3d7733f8 | C++ | Hollbrok/Akinator | /Akinator/tree_func.cpp | WINDOWS-1251 | 10,146 | 3.015625 | 3 | [
"MIT"
] | permissive | #include "tree.h"
tree_element::tree_element(data_type data, tree_element* prev, tree_element* left, tree_element* right) :
data_(data),
prev_(prev),
left_(left),
right_(right)
{
assert(this && "You passed nullptr to list_elem construct");
}
tree_element::~tree_element()
{
assert(this && "You passed nullptr to ... | true |
53eb3ecca8f1ce1169cc0faa0ce275dd12d85c00 | C++ | zxycode007/Sapphire | /SapphireBase/SapphireSSkinMeshBuffer.h | GB18030 | 9,610 | 2.546875 | 3 | [] | no_license | #ifndef _SAPPHIRE_SSKIN_MESH_BUFFER_
#define _SAPPHIRE_SSKIN_MESH_BUFFER_
#include "SapphirePrerequisites.h"
#include "SapphireIMeshBuffer.h"
#include "SapphireSVertex.h"
namespace Sapphire
{
//! һʱ̶S3DVertex2TCoords, S3DVertex S3DVertexTangents֮ѡ
struct SSkinMeshBuffer : public IMeshBuffer
{
//! ĬϵĹ
SSki... | true |
d9cb2611a98a838bb826b0b00c1d241aaddb970d | C++ | lasthopestars/Code-file-uploads | /callByReference.cpp | UTF-8 | 508 | 3.453125 | 3 | [] | no_license | #include<iostream>
using namespace std;
void addOne(int &y)
{
cout << y << " " << &y << endl;
y = y + 1;
}
//call by value defines a new variable and copies the value in there,
//whilst call by reference sends the address itself, so the address is the same
//and there is no process of copying the value i... | true |
4fe1cc934117d50d7340e40ca580a38e5d1b651e | C++ | lgenet/Sofia | /Resources/UnitTests/lab_10_test.cpp | UTF-8 | 6,032 | 3.234375 | 3 | [] | no_license | #include "gtest/gtest.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include "lab_for_testing.cpp"
using namespace std;
class Lab10Test : public ::testing::Test{};
/****************************************
* Utility Functions
*/
string trim(string s) {
int first = 0;
int last = s.length();
string... | true |
608b53c4a49a7279fd31f83589217bee88873ee8 | C++ | alexeylive/C-CPP-Homework | /Bus(4homework)/Bus.cpp | UTF-8 | 3,439 | 3.375 | 3 | [] | no_license | using namespace std;
#include <iostream>
#include <cstring>
#include <fstream>
#include "Bus.hpp"
const int Bus::get_busNumber() const{
return this->bus_number;
}
const int Bus::get_year() const{
return this->year;
}
const int Bus::get_mileage() const{
return this->mileage;
}
const int Bus::get_route() const{
... | true |
4b89d0f292300f3425cf9e95e7cd8b61c2232657 | C++ | srirammarisetty19/VAD-Device | /arduino codes/velostat/velostat.ino | UTF-8 | 554 | 3.171875 | 3 | [] | no_license | // Analog input pin that the Velostat is connected to
const int analogInPin = A0;
// value read from the Velostat
int sensorValue = 0;
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
//init Analog Pin as PULLUP
//(meaning it sends out voltage)
digitalWrite(anal... | true |
ff3429c3ef85bcea69308cbae90b470880433749 | C++ | kunal-Khulbay/My-programming-practice-works | /c++ programs/Dynamic_Constructor.cpp | UTF-8 | 709 | 3.953125 | 4 | [] | no_license | /*Author: ALOK KHULBAY.
Date:08-09-2020.
Purpose:To self learn.
Program to read and display Roll No. to illustrate the concept of Dynmaic Constructor.
*/
#include <iostream>
using namespace std;
class abc
{
int rn;
float fees;
public:
abc(int a, float b)
{
rn = a;
fees = b;
}
ab... | true |
ff5d1be1d8ca03b594759e915e4cbee88859f071 | C++ | Zhao-Michael/CppUtil | /CppUtil/Cpp14.cpp | GB18030 | 3,492 | 3.203125 | 3 | [] | no_license | #include <tuple>
#include <map>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <memory>
using namespace std;
/*
*
C++ 14:
ķƵ
lambda
lambda ʼ
new/delete
constexpr Ϸɵ
λָ
ĬϳԱʼľۺࡣ
ģ
std::make_unique
std::shared_timed_mutex std::shared_lock
std::integer_sequence
std::exchange
... | true |
5f3db7e3be2dbe93afeaba9c897ff59619a7ba4f | C++ | kkpattern/practicing | /TopCoder/SRM/565DIV2/500.cc | UTF-8 | 1,062 | 2.984375 | 3 | [] | no_license | #include <stdio.h>
#include <algorithm>
#include <list>
#include <map>
#include <string>
#include <vector>
using std::list;
using std::map;
using std::string;
using std::vector;
class MonstersValley2 {
public:
int backTracing(int i) {
if (i >= monster_count_) return 0;
long long old_scar = scar_;
int... | true |
2d28b6892304bc468b7c4bf8763eb55db4a3bfe6 | C++ | leonardoAnjos16/Competitive-Programming | /CSES/rectangle_cutting.cpp | UTF-8 | 639 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define long long long int
vector<vector<int>> memo;
int moves(int a, int b) {
if (a == b) return 0;
int &ans = memo[a][b];
if (~ans) return ans;
ans = INT_MAX;
for (int i = 1; i < a; i++)
ans = min(ans, moves(i, b) + moves(a - i, b) + 1);
... | true |
45adaa9bd81e11675ec5dbc177ca092238dec322 | C++ | EldarGiniyatullin/University | /Semester_1/HW_4/Hometask_3/Hometask_3.cpp | UTF-8 | 2,845 | 3.3125 | 3 | [] | no_license | #include <stdio.h>
#include "polishstack.h"
using namespace std;
int main()
{
printf("Enter an infix-Polish-notation-reformed expression ");
Stack wareStack;
wareStack.first = NULL;
char consoleSymbol;
bool isZero = false;
bool isRight = false;
while ((consoleSymbol = getchar()) != '\n' &&... | true |
aa6180b8d7ae9ec0dd4a6de443e172f631fedaf0 | C++ | Stazer/beluga | /source/beluga/tls/tls_client.cpp | UTF-8 | 3,135 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <beluga/tls/tls_client.hpp>
#include <beluga/tls/tls_reader.hpp>
beluga::tls_client::record_event::record_event(const tls_record& record):
record(record)
{
}
void beluga::tls_client::record_event::set_record(const tls_record& record)
{
this->record = record;
}
beluga::tls_record& beluga::tls_client::... | true |
46856e0dadec732951f5390cc673efeadda88d8c | C++ | Drakula44/neural_network_cpp | /src/node.cpp | UTF-8 | 478 | 2.578125 | 3 | [] | no_license | #include "../headers/node.h"
#include<bits/stdc++.h>
#define e 2.7182818
using namespace std;
void node::init(double v1,int n1){
srand(time(NULL));
v=v1;
n=n1;
for(int i=0;i<=n;i++){
w[i]=rand()/pow(10,8);
//cout<<w[i]<<endl;
}
}
double node::activate(double x){
v=1/(1+pow(e,-x));//zasada je sigmoid
return v... | true |
ef4dbc3459340b7f80a71ca9f3dfc0ce985f3b0d | C++ | bityutskiyAO/Misis-C- | /bitytskiy_a_o/prj.labs/queue/queue.h | UTF-8 | 492 | 2.96875 | 3 | [] | no_license | #pragma once
#ifndef QUEUE
#define QUEUE
#include <iostream>
class Queue {
public:
Queue() = default;
Queue(const int size);
Queue(const Queue &rhs);
~Queue();
Queue &operator=(const Queue &rhs);
bool isEmpty();
bool isFull();
void push(const int val);
int top();
void... | true |
63d8a11f269cfb4a6153aa23a037e1579d149114 | C++ | RPChavan/USC-EE569---Introduction-to-Digital-Image-Processing | /HW2 - Edge, Boundary Detection/Edge detection-Sobel.cpp | UTF-8 | 7,356 | 2.9375 | 3 | [] | no_license |
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <random>
#include <math.h>
#include <fstream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
// Define file pointer and variables
FILE *file;
int BytesPerPixel;
int Row_Size = 321;
int Column_Size = 481... | true |
ef42fba9828db39ea450226b1972e51da8e86bd1 | C++ | nalzok/Cal61CforFun | /CBasics/peek2comp.cpp | UTF-8 | 851 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <bitset>
using namespace std;
int main() {
cout << "I can show you 2's complement representation of an integer ^__^ " << endl;
int num;
while (42) {
try {
cout << "Give me a number, or press Ctrl+c to exit: " << endl;
cin >> num;
// p... | true |
088006c960bed8b6dc63a6dafc88e6ee2d0f737e | C++ | nnresearcher/LeetCode_Optimal_Solution | /easy/141/C++/快慢指针/141.cpp | UTF-8 | 942 | 3.578125 | 4 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
// judge null pointer input parameter
if (head == NULL || head->next == NULL) {
... | true |
e74389b862c6a8d8f6a3b31bd87523fcef6c2381 | C++ | defkevin/s16_Independent_Study | /cs104/HW3/SetStr_Test.cpp | UTF-8 | 726 | 3.140625 | 3 | [] | no_license | #include "../../test/logging.h"
#include "setstr.h"
#include <iostream>
using namespace std;
void print(const SetStr& set) {
const string* s = set.first();
while (s != nullptr) {
cout << *s << " ";
s = set.next();
}
cout << endl;
}
int main() {
BEGIN_TESTS();
SetStr set;
CHECK_EQ(set.empty(), t... | true |
e7d97c74d7cdeca8acfde462554017c3973a2bee | C++ | PeterMerkert/symphony | /src/Engine/GameObject.cpp | UTF-8 | 3,983 | 2.6875 | 3 | [
"MIT"
] | permissive | #include "GameObject.h"
#include <glm/gtc/type_ptr.hpp>
#include <iostream>
#include <string>
#include "SymphonyEngine.h"
//TO-DO: <algorithm> is required for the correct use of std::remove used in RemoveChild;
// find a way to avoid using this.
//#include <algorithm>
namespace Symphony
{
GameOb... | true |
922793261d7b38308535d2281fb7ee83dea31ec1 | C++ | amb-lucas/Competitive-Programming | /Number-Theory/Mobius.cpp | UTF-8 | 488 | 3.078125 | 3 | [] | no_license |
/*
N = p1^k1 * p2^k2 * p3^k3 ... pm^km
if there's a ki>=2, then M(N) = 0
else if m%2 = 1, then M(N) = -1 // odd number of primes
else M(N) = 1 // even number of primes
*** M(1) = 1 ***
*/
for(int i=1; i<LIM; i++){
mobius[i] = 1;
primo[i] = 1;
}
for(int i=2; i<LIM; i++){
if(primo[i]){
... | true |
b10a8a93d813aa1ad25651ca08d0fb4d69b5e884 | C++ | haru067/AOJ | /Volume0/0027_What_day_is_today.cpp | UTF-8 | 409 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main(){
int mon, day, week;
string ans[7] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
int start_week[13] = {-1, 3, 6, 0, 3, 5, 1, 3, 6, 2, 4, 0, 2};
while(cin >> mon >> day){
if(mon==0 && day==0){
break;
}
... | true |
446982b9ddca4b56793cc2967579bc8039869dd3 | C++ | ohlionel/codebase | /13307130248/assignment4/B/src/B.cpp | UTF-8 | 897 | 2.84375 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
using namespace std;
int N;
void work()
{
vector<int> A, L(N), R(N);
stack<int> S;
for(int i = 0; i < N; i++)
{
int tmp;
scanf("%d", &tmp);
A.push_back(tmp);
}
long long ans... | true |
8ddb87599b6d4f56b41f5a6eda3781248c4a0c88 | C++ | r-zareba/Cpp-projects | /qt_arduino1/src/main.cpp | UTF-8 | 1,566 | 3.296875 | 3 | [] | no_license | #include <Arduino.h>
#include "Button.h"
static const uint8_t button1Pin = 51;
static const uint8_t button2Pin = 52;
static const uint8_t button3Pin = 53;
static const uint8_t greenLedPin = 8;
static const uint8_t yellowLedPin = 9;
static const uint8_t redLedPin = 10;
Button button1(button1Pin, LOW);
Button button2... | true |
5c0f0e29fb6db163f14401dad274d4b05b3a52ff | C++ | Israelroze/CatchTheFlag | /BoardFileHandler.h | UTF-8 | 1,031 | 2.734375 | 3 | [] | no_license | #pragma once
#include <list>
#include <string>
#include <iostream>
#include <fstream>
#include <ostream>
#include "Cell.h"
using namespace std;
class BoardFileHandler
{
private:
//string Directory;
string FileName;
string Violations = "";
char Board[13][13] = { ' ' };
int BoardCounters[8] = { 0 };
enum { s1, s... | true |
0eef3a3ce0d44e3b44f6c24822ad66928c8c99cc | C++ | nghianghesi/mum | /ParallelPrograming/NumericalIntegration/Source.cpp | UTF-8 | 2,482 | 2.984375 | 3 | [] | no_license | #include <stdio.h>
#include <omp.h>
#include <iostream>
#include <chrono>
#include <string>
#include <cstdlib>
#include <ctime>
#include <thread>
#include <windows.h>
using namespace std;
using namespace std::chrono;
double sum;
double t,ft;
double w;
int sequentialtime, paralleltime;
#define n 100000000
#define a... | true |
0c3832341aa22ddaf3a04585ed9f76654b218a44 | C++ | AloyseTech/TSE | /examples/TSE_SpaceSelector/planet.h | UTF-8 | 1,466 | 2.765625 | 3 | [] | no_license | class Planet
{
public:
const uint8_t *datamat;
uint8_t height, width;
int16_t xPos, yPos;
const char* name;
uint8_t nameSize;
uint16_t colorA;
uint16_t colorB;
uint16_t colorC;
uint16_t colorD;
bool vFlip = 0;
Planet() {}
Planet(int x, int y, int h, int w, Str... | true |
2bc7941ee53df9ce1a31826d9079befff8b58f24 | C++ | petarbratic/Aplikacija-za-prodaju-vozila | /projekat/Korisnik.hpp | UTF-8 | 2,527 | 3.1875 | 3 | [] | no_license | #ifndef KORISNIK_HPP_INCLUDED
#define KORISNIK_HPP_INCLUDED
#include <vector>
#include <fstream>
#include <string.h>
using namespace std;
class Korisnik{
private:
std::string ime;
std::string prezime;
bool kupacIliProd;
std::string brojTelefona;
std::string korisnickoIme;
... | true |
64722d6fb90c7a00fbdfec21bd3cd7a6a634d68d | C++ | jeeminhan/Coding-Practice | /tuple_satisfy.cpp | UTF-8 | 1,135 | 3.375 | 3 | [] | no_license | /*
2/2/21
FROM AGGIE COMPETITIVE PROGRAMMING CLUB
Given is a positive integer N, How many tuples (A,B,C) of positive integers satisfy
A×B+C=N?
3 = 3
100 = 473
3 There are 3 tuples of integers that satisfy
A × B + C = 3 : ( A , B , C ) = ( 1 , 1 , 2 ) , ( 1 , 2 , 1 ) , ( 2 , 1 , 1 ) .
1,000,000 = 13,969,985
*/
#... | true |
96ddf0b1b08da39743d6ab1742aacb78106bd4ad | C++ | JoshuaFlynn/TLLibrary | /Examples/ImageGen/FileProc.h | UTF-8 | 5,773 | 2.75 | 3 | [
"Unlicense"
] | permissive | #ifndef G_FILEPROC_H
#define G_FILEPROC_H
/*
Generated on: 2012-04-02-13.12.01
Version: 2.2
*/
/*
Notes:
Cross-compiler edition (Linux compatibility)
Added error check for fclose
*/
/*
Suggestions for improvements:
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <er... | true |
96eb714d04d7671ee5c2ebdc8398961d9ca71d54 | C++ | AverJing/LeetCode | /LeetCode/121 Best Time to Buy and Sell Stock/solution.h | UTF-8 | 1,845 | 3.671875 | 4 | [] | no_license | /*
*
*
*@author: Aver Jing
*@description:
*@date:
*
*
*/
/*
Say you have an array for which the ith element is the price of
a given stock on day i.
If you were only permitted to complete at most one transaction
(i.e., buy one and sell one share of the stock),
design an algorithm to find the maximum profit.
Note th... | true |
02b9055edd8e3f15fdd3398a3e71b582931bafb6 | C++ | atishayjain20/Graph | /graph/find_path.cpp | UTF-8 | 956 | 2.671875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
bool visited[1000][1000];
bool blocked[1000][1000];
int height,width;
int adj[1000][1000];
bool valid(int x,int y){
if(x<0||y<0||x>=height||y>=width||visited[x][y]||blocked[x][y]){
return false;
}
return true;
}
bool find_path(int x,int y,int ... | true |
680bbd491b28af1d870843b004f313c6e779163b | C++ | Yittik13/Text-Game | /Battle.hpp | UTF-8 | 670 | 2.59375 | 3 | [] | no_license | #ifndef BATTLE_H
#define BATTLE_H
#include "Gamestate.hpp"
#include "Party.hpp"
#include "Enemy.hpp"
#include "PriorityQueue.hpp"
class Battle: public Gamestate {
public:
Battle(const char* type, Party *playerParty, class enemyParty *enemyParty);
void runBattle();
int endBattle();
void getInfo() {
printf(... | true |
3e592474d6c47c105ea7b99766f8390f0a55fd3c | C++ | shunty-gh/AdventOfCode2015 | /src/day13.cpp | UTF-8 | 3,827 | 2.953125 | 3 | [] | no_license | #include <map>
#include <queue>
#include <regex>
#include <stdexcept>
#include <vector>
#include "aocutil.h"
// eg: Alice would lose 57 happiness units by sitting next to Bob.
const std::string Pattern{R"((\w+) would (lose|gain) (\d+) happiness units by sitting next to (\w+)\.)"};
const std::regex re{Pattern};
struc... | true |
4261179627245fe778dcf62f7fe1f4e0c4496a63 | C++ | jknight1985/photobot | /WebsocketServer/websocketserver.h | UTF-8 | 1,634 | 2.75 | 3 | [] | no_license | #ifndef WEBSOCKETSERVER_H
#define WEBSOCKETSERVER_H
#include <QObject>
#include <QtCore/QList>
#include <QtCore/QByteArray>
#include <QWebSocketServer>
//hier wird QWebSocket bereits deklariert,
//damit unten der Pointer verwendet werden kann
QT_FORWARD_DECLARE_CLASS(QWebSocket)
class WebSocketServer : public QObjec... | true |
6578a5b14e0126952b044c1977da225a25bc3045 | C++ | ljdongysu/C-_demo | /book_5/waiting.cpp | UTF-8 | 423 | 3.171875 | 3 | [] | no_license | #include<iostream>
#include<ctime>
int main()
{
using namespace std;
float secs;
cout<<"Enter the delay time, in seconds: ";
cin>>secs;
clock_t delay = secs*CLOCKS_PER_SEC;
cout<<"starting\a\n";
clock_t start = clock();
while(clock() - start<delay);
cout<<"done \a\n";
double pr... | true |
649b39844cfaea37bd7d7ea9a5eec7e15b358bf1 | C++ | ros-industrial/keyence_experimental | /keyence_library/src/impl/messages/get_setting.cpp | UTF-8 | 1,389 | 2.578125 | 3 | [] | permissive | #include <keyence/impl/messages/get_setting.h>
#include <keyence/impl/keyence_utils.h>
keyence::command::GetSetting::Request::Request(uint8_t level, uint8_t type,
uint8_t category, uint8_t item,
uint8_t target1, uint8_t... | true |
4109cef45bbab1c0fa3fce6e489f0c220060e545 | C++ | NekoSilverFox/CPP | /001.5 - if else 三目运算符【作业】/Упорядочить три числа/Упорядочить три числа/源.cpp | GB18030 | 512 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
using namespace std;
int main(void) {
int a, b, c;
cout << "a="; cin >> a;
cout << "b="; cin >> b;
cout << "c="; cin >> c;
// Сֵ嵽 min
int min = a < b ? a : b;
min = min < c ? min : c;
// ֵ嵽 max
int max = a > b ? a : b;
max = max > c ? max : c;
// Ȼֵ֪maxСֵminôԵõ
int mid = (a + b ... | true |
7d8d4400dc6cf01915670e5c204eda1b4a4f43f8 | C++ | mukoedo1993/cpp_primer_solutions | /C++_chap12/exercise12_26/exercise12_26.cpp | UTF-8 | 817 | 3.078125 | 3 | [] | no_license | #include<memory>
using std::allocator;
#include<iostream>
#include<fstream>
#include<string>
using std::string;
int main()
{
int n = 12;
std::ifstream input("ex12_26i.txt");
//std::istream_iterator<string>it(input), eof;
if (!input.is_open())exit(-1);
std::ofstream output("ex12_26o.txt");
alloc... | true |
862ec10afa55a2282de9fe17d95321a7a5294420 | C++ | jowie94/Zelda | /cEnemy.cpp | UTF-8 | 1,390 | 2.9375 | 3 | [] | no_license | #include "cEnemy.h"
#include "cScene.h"
cEnemy::cEnemy(int texture, float life, float damage) : cBicho(life)
{
SetDamage(damage);
this->texture = texture;
fmod_system->createSound("sounds/enemy-kill.wav", FMOD_DEFAULT | FMOD_LOOP_OFF, 0, &kill_sound);
fmod_system->createSound("sounds/enemy-hit.wav", FMOD_DEFAULT... | true |
adce94743114cd9a8277274da72385c181a16e65 | C++ | zooyer/cJSON | /JsonArray.cpp | UTF-8 | 1,062 | 3.046875 | 3 | [] | no_license | #include "JsonArray.h"
#include "JsonValue.h"
JsonArray::JsonArray()
{
m_root = cJSON_CreateArray();
}
JsonArray::JsonArray(const string & json)
{
m_root = cJSON_Parse(json.c_str());
}
JsonArray::JsonArray(const JsonArray & arr)
{
m_root = cJSON_Parse(arr.toJson().c_str());
}
JsonArray::~JsonArray()
{
if (m_... | true |
7dd44227da00c8c505fe5408f1a8ae06e43d9e9f | C++ | 42somoim/42somoim2 | /johan/8주차/1517.cpp | UTF-8 | 759 | 2.8125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int arr[500001], arr2[500001];
long long recursive(int start, int end)
{
if (start == end)
return (0);
int mid = (start + end) / 2;
long long result = recursive(start, mid) + recursive(mid + 1, end);
int i = start;
int j = mid + 1;
int idx = 0;
while (i <= mid || j <= ... | true |
5123118fa7c17fceb06413d9e7571e38b0a87fac | C++ | ghostrgk/mfs | /libs/fs++/src/block.cpp | UTF-8 | 1,241 | 2.8125 | 3 | [] | no_license | #include "fs++/internal/block.h"
#include <cassert>
#include <utility>
namespace fspp::internal {
[[maybe_unused]] Blocks::Blocks(const uint64_t* block_num_ptr, uint64_t* free_block_num_ptr, uint8_t* bit_set_bytes,
Block* block_bytes)
: blocks_ptr_(block_bytes), free_block_num_ptr... | true |
d9e9752e2d393c71c16aba84f014d57fe455cdf9 | C++ | vgromov/esfwx | /escore/EsVariant.h | UTF-8 | 72,165 | 3.125 | 3 | [] | no_license | #ifndef _es_variant_h_
#define _es_variant_h_
/// Variant data type, variable or constant which type is determined at runtime.
///
class ESCORE_CLASS EsVariant
{
public:
/// Possible types, sorted in the order of their promotional conversion
///
enum Type
{
VAR_EMPTY, ///< No value... | true |
e23457bb290a838d14f3d92af6e9ffab359689a3 | C++ | Departuers/acwing-cpp | /dp/线性dp/最低通行费.cpp | UTF-8 | 1,278 | 3.046875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
const int inf = 0x3f3f3f3f;
int n, m;
/**
* f[i,j]定义为从(1,1)到(i,j)最小花费
* 属性min
* 划分依据,上一步从上面过来,还是从左边过来
* 则f[i,j]=min(f[i-1][j],f[i][j-1])+w[i][j]
*
* 初始化问题
* 由于f数组默认初值是0,
* 所以求第一... | true |
764cae0258c0154ce423b2a345dcb1375bce74cb | C++ | kaseyhan/geometric-primitives | /include/core/pixel.h | UTF-8 | 824 | 3 | 3 | [] | no_license | #pragma once
#include "cinder/gl/gl.h"
namespace geometricprimitives {
class Pixel {
public:
Pixel();
Pixel(float red, float green, float blue);
Pixel(float red, float green, float blue, float alpha);
float GetRed() const;
float GetGreen() const;
float GetBlue() const;
float GetAlpha() const;
glm::v... | true |
a2211098f1aba5fa374cee64033ec7818bd973d1 | C++ | hdinh77/heat-text-editor | /test.cpp | UTF-8 | 238 | 2.671875 | 3 | [] | no_license | // test.cpp for Heat text editor
// Heather Dinh
#include <iostream>
#include <string>
int main(int argc, char* argv[]) {
if(argc != 2) {
return 0;
}
for(int i = 0; i < 10; i++) {
std::cout << "Hello world!" << endl;
}
return 8;
}
| true |
3e098c7b921cd24bb5143ec501cf6ddc3b65dcc9 | C++ | gangsaur/grafika-layer | /shape.h | UTF-8 | 666 | 3.140625 | 3 | [] | no_license | #ifndef shape_h
#define shape_h
#include "point.h"
#include <list>
class shape{
private:
int corners;
list<point*> points;
public:
shape(int n){
corners = n;
}
~shape(){
points.clear();
}
void add(point* p) {
points.push_back(p);
}
void add(int x, int y){
points.push_back(n... | true |
b7d040cad021b9f3f12f57d9956244234cde81ed | C++ | LuisEduardoR/SCC0250-CG | /src/Rendering/TextureObject.cpp | UTF-8 | 2,359 | 2.984375 | 3 | [
"MIT"
] | permissive | #include "TextureObject.hpp"
TextureObject::TextureObject(Type type) : type(type)
{
glGenTextures(1, &self);
}
TextureObject::~TextureObject()
{
glDeleteTextures(1, &self);
}
auto TextureObject::Bind() -> void
{
glBindTexture(static_cast<GLenum>(type), self);
}
auto TextureObject::Unbind() -> void
{
... | true |
fbd970617fa57a3a7561db96e495c55f5689e87e | C++ | bahlo-practices/pa | /semester2/practice4/exercise2/main.cpp | UTF-8 | 1,277 | 3.109375 | 3 | [
"WTFPL",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* File: main.cpp
*
* Created on 15. Mai 2013, 16:13
*/
#include <iostream>
#include "myVector.h"
#include "myVec.h"
int main(int argc, char** argv) {
try {
// myVector<double> h1( 5 );
myVector<int> i1;
i1.push_back(5);
i1.set(0, 1);
std::cout << i1.get(0) << ... | true |
a89082a56b2cf30e0e1dfc1fa9789b2d0e9604ff | C++ | lavandalia/work | /Codeforces/188 (Div. 1)/A/main.cpp | UTF-8 | 568 | 2.84375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int64_t X, Y, M; cin >> X >> Y >> M;
if (X > Y)
swap(X, Y);
if (Y >= M) {
cout << "0\n";
return 0;
}
if (X <= 0 and Y <= 0) {
cout << "-1\n";
return 0;
}
int64_t operations = 0;
if (X < 0... | true |
518dec6b30a848b21342db8da4dd1da46d1cc11f | C++ | aliosmanulusoy/Probabilistic-Volumetric-3D-Reconstruction | /contrib/brl/bseg/boxm/util/boxm_raytrace_operations.cxx | UTF-8 | 8,662 | 2.703125 | 3 | [] | no_license | #include "boxm_raytrace_operations.h"
bool boxm_alpha_seg_len(double *xverts_2d, double* yverts_2d, float* vert_distances, boct_face_idx visible_faces, float alpha, vil_image_view<float> &alpha_distance)
{
// multiply each vertex distance by alpha
float vert_alpha_distances[8];
float *vert_dist_ptr = vert_distan... | true |
5d4b8dd4efb5df9df926f1c221108763e2d35430 | C++ | Maulin-sjsu/DataStructuresPractise | /LeetCodeProblem/Graph/FloodFill.cpp | UTF-8 | 1,062 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
void printMatrix(vector<vector<int>> v1){
for(int i = 0; i < v1.size(); i++){
for(int j = 0; j < v1[i].size(); j++)
{
cout << v1[i][j] << " ";
}
}
}
void fill(vector<vector<int>> &image,int i, int j, int curr... | true |
353b57088185ffd76fc8ddd7666adaf594b50935 | C++ | psiden/BFAST3D | /eb/util/Qinv/Qinv.cpp | ISO-8859-1 | 8,689 | 2.828125 | 3 | [
"BSD-2-Clause"
] | permissive | //#define TIMING
//To compile on Linux:
//mex Qinv.cpp CFLAGS="\$CFLAGS -fopenmp" LDFLAGS="\$LDFLAGS -fopenmp"
#include "mex.h"
#include "matrix.h"
#include<cstdio>
#include<list>
#include<vector>
#ifdef _OPENMP
#include<omp.h>
#endif
#ifdef TIMING
#include<ctime>
#endif
typedef std::pair<size_t,doubl... | true |
004b985a49bcfabb2547ffcbe1a80399b9932b84 | C++ | thijshosman/learncpp-playground | /learncpp playground/constClass.h | UTF-8 | 279 | 2.734375 | 3 | [] | no_license | #pragma once
class constClass
{
private:
int m_pr_value;
public:
int m_value;
void print() const; // const after method name, before definition
// since this class is going to be instantiated as const, all method also have to be const
constClass();
~constClass();
};
| true |
29a10c62039ad89590ef882f7b62254cd66d9330 | C++ | fwhxyer/PAT | /1058.cpp | UTF-8 | 310 | 2.53125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,e,f,g,h,i;
char t;
while(cin>>a){
cin>>t>>b>>t>>c;
cin>>d>>t>>e>>t>>f;
i=c+f;
h=b+e+i/29;
i%=29;
g=a+d+h/17;
h%=17;
cout<<g<<"."<<h<<"."<<i<<endl;
}
return 0;
}
| true |
b3398ad13cfca675410700d84f78d14ea72ab633 | C++ | cvora23/CodingInterviewQ | /C-C++/Concepts/DeepVsShallowCopy.cpp | UTF-8 | 451 | 2.859375 | 3 | [] | no_license | /*
* DeepVsShallowCopy.cpp
*
* Created on: Sep 2, 2014
* Author: cvora
*/
// Cracking the Coding Interview - Sol 13.4
#include <string.h>
#include <stddef.h>
#include <cstdlib>
using namespace std;
struct Test{
char* ptr;
};
void shallow_copy(Test& src,Test& dest){
dest.ptr = src.ptr;
}
void deep_cop... | true |
b2c9995c4f6c2ef125c726a121bfff621873829d | C++ | CarolineFs/AlgoesAnalysis | /lab_01/source/main.cc | UTF-8 | 1,156 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include "EditDistanceTester.h"
#include "CharWordHandler.h"
using namespace std;
int main(int argc, char **argv) {
bool showTime = false;
std::string s1;
std::string s2;
auto tester = new EditDistanceTester<string>;
for (int idx = 1; idx < argc; idx++) {
switch (arg... | true |
df0089177a5e9cc25d22bdf9a39ebbce47969509 | C++ | leek018/Algo | /baekjoon/baekjoon/baekjoon_14891.cpp | UTF-8 | 1,768 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <string>
using namespace std;
string gear[4];
void rotate_cw(int target)
{
string copy = gear[target];
for (int i = 0; i < 7; i++)
gear[target][i + 1] = copy[i];
gear[target][0] = copy[7];
}
void rotate_ccw(int target)
{
string copy = gear[target];
for (int i ... | true |
b5e7ef54cd4b18e0274e5e93a9c810f47b96e866 | C++ | alexzhang13/rcj-code | /Software/navigate/navigateMap.cpp | UTF-8 | 2,647 | 2.71875 | 3 | [] | no_license | #include "navigateMap.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
// external API functions
void initMap(MapState *mapstate, const float cellsize, const unsigned int numcells_x, const unsigned int numcells_y)
{
unsigned int i, j;
if(!mapstate)
return;
mapstate->mMapProp.CellSize = cellsize;
... | true |
bbcf84854e03f1f04ca8b6ce768f1526bbbf0a16 | C++ | hohaidang/CPP_Basic2Advance | /Book_Source/Cpp-Primer-Plus-programming-exercises-master/Cpp-Primer-Plus-programming-exercises-master/code/Chapter18/18_3.cpp | UTF-8 | 539 | 3.359375 | 3 | [] | no_license | // By luckycallor
// Welcome to my site: www.luckycallor.com
#include<iostream>
using namespace std;
template<typename Tval,typename... Targs>
long double sum_value(Tval val,Targs... args)
{
long double sum;
sum = (long double)val + sum_value(args...);
return sum;
}
template<typename Tval>
long double s... | true |
414f049d355b5910958ecd2fd6f97ca972923b39 | C++ | casa9eu/arduino-camp | /src/07/_15.ino | UTF-8 | 348 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | #include <Servo.h>
Servo servo_0;
Servo servo_1;
void setup(){
pinMode(A0, INPUT);
servo_0.attach(0);
pinMode(A1, INPUT);
servo_1.attach(1);
}
void loop(){
servo_0.write(map(analogRead(A0), 0, 1023, 0, 180));
servo_1.write(map(analogRead(A1), 0, 1023, 0, 180));
delay(10); // Delay a little bit to impr... | true |
84ccc8a94d1f77d5013cf36aac21d67e83422b5b | C++ | MukulMadaan/GeeksMustDo | /LinkList/DeleteNnodesAfterMnodes.cpp | UTF-8 | 437 | 3.21875 | 3 | [] | no_license | void linkdelete(struct Node *head, int M, int N)
{
struct Node* current = head;
struct Node* prev;
int temp1,temp2;
temp1 = M; temp2 = N;
while(current){
while(M-- && current){
prev = current;
current = current->next;
}
while(N-- && current){
prev... | true |
bd2be3f6040abaa48f91514f1b49163a409db475 | C++ | akshaymishra5395/GeeksforGeeks | /Kadane's Algorithm.cpp | UTF-8 | 599 | 3.34375 | 3 | [] | no_license | class Solution{
public:
// arr: input array
// n: size of array
//Function to find the sum of contiguous subarray with maximum sum.
int maxSubarraySum(int arr[], int n){
int sum=INT_MIN;
int s=0;
for (int i=0;i<n;i++)
{
s+=arr[i];
... | true |
1e307a4ab51be6d75c190ad37459900503da3cc6 | C++ | GZHU-JourneyWest/West-Codebase | /Raw/数据结构/树状数组(二维).cpp | UTF-8 | 351 | 2.984375 | 3 | [] | no_license | // cell[x][y]增加v
void add(int x, int y, int v)
{
for (int i = x; i<maxN; i+=lowbit(i))
for (int j = y; j<maxN; j+=lowbit(j))
cell[i][j] += v;
}
// (1, 1)至(x, y)中所有单元格的数值和
int get(int x, int y)
{
int rslt = 0;
for (int i = x; i; i-=lowbit(i))
for (int j = y; j; j-=lowbit(j))
rslt += cell[i][j];
return rsl... | true |
34c9f7b7606f2e6be85f324272889fe490d8ecd0 | C++ | neilpradhan/Competitive_Programming | /Backtracking/rat_in_a_maze.cpp | UTF-8 | 1,131 | 2.8125 | 3 | [] | no_license |
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
void printfinal(int sol[20][20], int N){
for(int i=0;i<N;i++){
for(int j=0;j<N;j++){
cout<<sol[i][j]<<" ";
}
}
cout<<endl;
}
bool valid_index(int maze[20][20],int sol[20][20], int x, int y, int N){
if (x>=0 && x<N && y>=0 && y<... | true |
3baf99b242c0c743b6a9919844ec200e49a5946e | C++ | gbrlas/AVSP | /CodeJamCrawler/dataset/12_24324_53.cpp | UTF-8 | 1,324 | 2.53125 | 3 | [] | no_license | #include<algorithm>
#include<iterator>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<ctime>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn=2001;
struct node
{
int x,y;
};
node a[maxn];
int f[maxn];... | true |
194b4f04f305faaede0ce569aa8b8fc99eb67ace | C++ | GaryPlaysGames/C-ProgammingLanguageTextBookPrograms | /Chapter 3 - Shaper Class Hierarchy/Chapter 3 - Shaper Class Hierarchy/Square.h | UTF-8 | 813 | 3.046875 | 3 | [] | no_license | #ifndef SQUARE_H
#define SQUARE_H
#include <iostream>
#include <initializer_list>
#include "Shape.h"
class Square : public Shape {
public:
Square();
Square(double a, double b, double c, double d);
Square(std::initializer_list<double>& il);
Square(const Square& a);
Square& operator=(const Square& a);
Square(Squ... | true |
ce0b6aee2956db6153c1a454881f7c7362283153 | C++ | MiritHadar/Practice | /cpp/writer/writer.hpp | UTF-8 | 2,428 | 2.640625 | 3 | [] | no_license | /******************************************************************************/
/* author: Ori Michaeli */
/* Reviewer: */
/* version: Draft */
/* Last update: 24-09-2019 */
/********************... | true |
d41f578530e4aaa61b6e0a91c87ba152952f573c | C++ | dlswer23/cpp | /C++/접근제어지시자.cpp | UHC | 560 | 3.484375 | 3 | [] | no_license | #include<iostream>
using namespace std;
// : ü ϴ Լ(ڵ)
// Ҹ : ü Ҹ ȣǴ Լ(ڵ)
// Ŭ ̸ = Լ̸
// ȯ X , Ҹ ~ Լ̸
class CMyData {
int m_nData; //private
public:
int GetData() {}
void SetData(int nParam) { m_nData = nParam; }
};
int main (){
CMyData a; // ü << νϽ << ȣ
a.SetData(10);
cout << a.GetData(... | true |
eeb943395a49624d96a730411d70af262f047bda | C++ | letrend/yac-nc1 | /software/src/cnc_gui/src/test_joystick.cpp | UTF-8 | 3,155 | 3.296875 | 3 | [
"MIT"
] | permissive | /**
* Author: Jason White
*
* Description:
* Reads joystick/gamepad events and displays them.
*
* Compile:
* gcc joystick.c -o joystick
*
* Run:
* ./joystick [/dev/input/jsX]
*
* See also:
* https://www.kernel.org/doc/Documentation/input/joystick-api.txt
*/
#include <fcntl.h>
#include <stdio.h>
#include <... | true |
7d50fa0ede5ec0ee4b3b53d116f3b38004db3903 | C++ | Nabz786/CIS-263project1 | /include/AUDS.h | UTF-8 | 5,173 | 3.984375 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <cstdlib>
#include <stdlib.h>
/*****************************************************************
* Almost Useless Data Structure (AUDS). This data structure will
* hold any type of object, through the use of a class template.
*
* @author Runquan Ye, Nabeel Vali
* @... | true |
dee35ffd7809d20040661cb3ec48531236a5607f | C++ | haran2001/DSA | /dp/test3.cpp | UTF-8 | 733 | 3.140625 | 3 | [] | no_license | //template for dp
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<map>
#include<iterator>
#include<string.h>
#include<unordered_set>
using namespace std;
unordered_set<string> st;
void subsequence(string str){
for(int i=0; i<str.length(); i++){
for(int j=str.length(); j > i; j--){
... | true |
b02d911e171f566c863868b74436cede2b0eb48d | C++ | Tri125/GestionAbonnement | /Noeud.cpp | UTF-8 | 955 | 2.8125 | 3 | [
"BSD-3-Clause"
] | permissive |
#include "librairie.h"
Noeud::Noeud()
{
pInfo = nullptr;
pNext = nullptr;
}
Noeud::Noeud(Abonnement* ab)
{
pInfo = ab;
pNext = nullptr;
pBack = nullptr;
}
Noeud::Noeud(unsigned int i, string p, string n, string titre, string addr, DateEpoch date)
{
pInfo = new Abonnement(i, p, n, titre, addr, date);
pNext =... | true |
50e6d6a68178f58de80c0976fefc6cc26e8f8d48 | C++ | IITK-SUMMER-QUAD-2015-TEAM/QuadIITK | /code/secondOrderFilter.ino | UTF-8 | 1,162 | 2.53125 | 3 | [
"Unlicense"
] | permissive | #include<SPI.h>
#include<Wire.h>
#define CUTOFF 21// The cutoff frequency
#define SAMPLE_RATE 100
#define NUM_FILTERS 6
enum {ACCEL_X , ACCEL_Y, ACCEL_Z, GYRO_X, GYRO_Y, GYRO_Z};
int16_t Tmp;
class filter
{
public:
static float coeff[5];
float filterInput(float input);
private:
float output[3]={0,0,0};
... | true |
ea6ffa68427c116dede854bf52bbcfaef6d81050 | C++ | Sadanand14/FALCON_ENGINE | /Falcon/Falcon/Rendering/PipeLine/CanvasItems/Slider.h | UTF-8 | 1,873 | 2.765625 | 3 | [] | no_license | #ifndef SLIDER_H
#define SLIDER_H
#include <string>
#include "CanvasItem.h"
#include "System/Types.h"
namespace UI
{
/**
* A basic Slider
*/
class Slider : public CanvasItem
{
protected:
float m_minValue;
float m_maxValue;
float m_curValue;
float m_step;
nk_color m_sliderBarNormal;
nk_color m_sli... | true |
a69ecc75f8888ed811ba7eef8f2215eb7f1e760c | C++ | vrtex/tanks2 | /main.cpp | UTF-8 | 556 | 2.59375 | 3 | [] | no_license | #include "simulation.h"
#include "Tank.h"
int main()
{
sf::RenderWindow window;
window.setFramerateLimit(60);
Simulation test(&window, 2);
Tank hurr(&window, {100, 200}, 20, 0);
hurr.connect(&test);
sf::Event e;
while(window.isOpen())
{
while(window.pollEvent(e))
{
if(e.type == sf::Even... | true |
d5269d9a7eacb6695e8b1c6fc66334ec8643bfc3 | C++ | YiuWingTan/Algorithm | /LeetCode和一些杂题/Subsets II/源.cpp | WINDOWS-1252 | 1,040 | 3.359375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void getSubSets(vector<vector<int>> &result,vector<int> &arr,vector<int> &nums,int begin,int len)
{
if (arr.size() == len)
{
result.push_back(arr);
return;
}
int size = nums.size() - (len - arr.size()) + 1;
for (int i = begin; i <siz... | true |
351410fe0b0186f8b22d1e6c5b066e253616508c | C++ | Sumendra2906/DS-ALGO | /1-10/10 Searching and Sorting/string_sort.cpp | UTF-8 | 1,229 | 3.421875 | 3 | [] | no_license | #include <iostream>
using namespace std;
bool subst(string a, string b)
{
int counter = 0;
for (int i = 0; i < a.length(); i++)
{
if (counter == b.length())
{
return true;
}
if (a[i] == b[counter])
{
counter++;
}
else
{... | true |
a9401fa02342f2e80f20ffbfe98044e19ed12817 | C++ | hanchao/tangram-es | /core/src/scene/spotLight.cpp | UTF-8 | 2,413 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "spotLight.h"
#include "glm/gtx/string_cast.hpp"
std::string SpotLight::s_classBlock;
SpotLight::SpotLight(const std::string& _name, bool _dynamic):PointLight(_name,_dynamic),m_direction(1.0,0.0,0.0),m_spotExponent(0.0),m_spotCutoff(0.0),m_spotCosCutoff(0.0) {
m_typeName = "SpotLight";
m_type = Light... | true |
22eb936be80e9e04293f13715bb06a56bc7de229 | C++ | dominguezi10/p3Lab-6_IngridDominguez_Reposicion | /Normal.h | UTF-8 | 509 | 2.59375 | 3 | [] | no_license | #include <string>
#include <iostream>
#include "Bombas.h"
using namespace std;
#ifndef NORMAL_H
#define NORMAL_H
//Inicio clase
class Normal: public Bombas{
//Atributos
private:
int alcance;
//metodos publicos
public:
//prototipos de metodos
//constructor
Normal();... | true |
8429c68b8eefb2767a549aac38783f289841e928 | C++ | ap-hynninen/cv_search | /src/Coord.cpp | UTF-8 | 5,530 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include "../include/Coord.hpp"
//
// Class constructor
//
Coord::Coord(const char *coord_filename, const int ncoord, const int nshoot, const float rnn) {
this->ncoord = ncoord;
this->nshoot = nshoot;
coord = NULL;
resid = NULL;
m... | true |
0425925046475f9f0659b4718ed98e5fa89c62c1 | C++ | amecky/space | /src/queues/WorkQueue.h | UTF-8 | 1,754 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <vector>
#include "..\Common.h"
#include "..\registries\PriceRegistry.h"
class Serializer;
// ------------------------------------------------------
// Work item
// ------------------------------------------------------
struct WorkItem {
int tile_x;
int tile_y;
WorkType work_type;
int time... | true |
e6fd22c1cadb157234a15a68f9d2c77b6685a986 | C++ | alexandre-janniaux/UGEngine | /UGEngine/include/UGEngine/Core/DestructionTrigger.ipp | UTF-8 | 510 | 2.59375 | 3 | [] | no_license | #include <UGEngine/Core/DestructionTrigger.hpp>
#include <UGEngine/Core/DestructionListener.hpp>
namespace uge {
template <typename T>
DestructionTrigger<T>::DestructionTrigger(T& instance) : m_instance(instance) {}
template <typename T>
DestructionTrigger<T>::~DestructionTrigger() {
for (auto listener : m_listener... | true |
23aedbea8ecacbd9050720c673bf0012f8965a57 | C++ | 12330072/C-learning | /C++/Relax/Relax/counter1.h | UTF-8 | 269 | 2.53125 | 3 | [] | no_license | #ifndef counter1_h
#define counter1_h
class counter1 {
public:
static int counter;
counter1() {
}
static void count() {
counter++;
}
void operator()() {
counter++;
}
};
int counter1::counter = 0;
#endif /* counter1_h */
| true |
75cbe73bee3a0f71113e9198f0db310768ccac5f | C++ | ccpang96/SWORD | /SWORD/剑指offer/队列和栈/30.包含min函数的栈.cpp | GB18030 | 951 | 3.015625 | 3 | [] | no_license | /************************************************************************/
/*@File Name : 30.minջ.cpp
/*@Created Date : 2020/6/8 18:36
/*@Author : ccpang(ccpang96@163.com)
/*@blog : www.cnblogs.com/ccpang
/*@Description :
/******************************************************... | true |
52c9bfd709cc68036cc422132c54294fb2dbbfe7 | C++ | shubh720/Lauchpad-June | /Lecture-19/queuell.cpp | UTF-8 | 230 | 2.765625 | 3 | [] | no_license | #include<iostream>
using namespace std;
template <typename T>
struct node{
T data;
node * next;
node(T data){
this->data = data;
next = NULL;
}
};
struct queue{
node * head;
node * tail;
};
| true |
c5f13eff0b7e4758a8cdbfeaf30c516d636d50ee | C++ | acsearle/mania | /mania-test/delta_table-test.cpp | UTF-8 | 2,452 | 2.625 | 3 | [] | no_license | //
// delta_table-test.cpp
// mania-test
//
// Created by Antony Searle on 27/11/19.
// Copyright © 2019 Antony Searle. All rights reserved.
//
#include "delta_table.hpp"
#include "debug.hpp"
#include <catch2/catch.hpp>
#include "tattler.hpp"
namespace manic {
TEST_CASE("delta_table") {
... | true |
af94aa4c56ba6a466473ceb8a1878431c36b408b | C++ | Ranazh/Shakieva_ACM_Labs | /Lab1_ACM_2020/Strings/3.myAtoi/ConsoleApplication10/ConsoleApplication10.cpp | UTF-8 | 1,417 | 3.59375 | 4 | [] | no_license | // ConsoleApplication10.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
bool isNumericChar(char c) //function to checking is char a digit
{
if (c >= '0' && c <= '9')
return t... | true |
a673c5f34d8fbda2da90ff248ef1881f7ea7d004 | C++ | LaylaHirsh/Victor | /tools/ConfigTest.cc | UTF-8 | 1,633 | 2.96875 | 3 | [] | no_license | #include <config.h>
#include<stdio.h>
int main()
{
double db=0.0;
int it=0;
unsigned int uit=0;
string text;
float ft=0.0;
config tmp("../config/testconfig.cfg");
cout << "euro " << tmp.getParameter("euro",db) << endl;
cout << "eindrittel " << tmp.getParameter("eindrittel",ft) << endl;
... | true |
54864def67b3f4375dacceff59333bdbf78fb933 | C++ | edmilson-dk/academic-programming | /search-algorithms/binary-search/c++/recursive-binary-search.cpp | UTF-8 | 727 | 3.890625 | 4 | [
"MIT"
] | permissive | // O(log n)
#include <iostream>
using namespace std;
int recursiveBinarySearch(int vector[], int left, int right, int wanted) {
if (left <= right) {
int pivot = left + (right - left) / 2;
if (vector[pivot] == wanted) return pivot;
else if (vector[pivot] < wanted) {
return recursiveBinarySearch(v... | true |
f5dd3a037389565e04013d2bb3241bfed2217abc | C++ | hzqtc/zoj-solutions | /src/zoj1560.cpp | UTF-8 | 1,140 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <cmath>
#define PI 3.14159265358979323846
#define RAD(x) ((double)((x) / 180.0 * PI))
using namespace std;
int main()
{
int casecount;
int cx1,cy1,cd1;
int cx2,cy2,cd2;
double ox,oy;
cin >> casecount;
while(casecount--)
... | true |
b0f628abfacce7552b132ed981a2e29dd4cef4ae | C++ | yekesit/OA-or-Interview-Questions | /yelp/merge_intervals_resturant_2.cpp | UTF-8 | 1,254 | 3.21875 | 3 | [
"MIT"
] | permissive | //
// Created by Ke Ye on 2019-07-27.
//
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
pair<int, int> isSame(string& s1, string& s2){
int idx1 = s1.find_last_of(' ');
int idx2 = s2.find_first_of(' ');
return s1.substr(idx1 + 1) == s2.substr(0, idx2) ? make_pair(idx1,... | true |
579189e1ee6dbd2d940e0c4bab8fff7f3a67c990 | C++ | MindrescuAlbert/Tema_2_POO | /VinVarsat.h | UTF-8 | 785 | 2.65625 | 3 | [] | no_license | #ifndef VINVARSAT_H
#define VINVARSAT_H
#include <iostream>
#include <string>
#include <vector>
#include "produs.h"
using namespace std;
class VinVarsat: public produs
{
int volum;
string tip;
public:
VinVarsat() : produs()
{
volum=0;
tip.clear();
};
VinV... | true |
fefa2d014cbbc86746fd3bf582647bf83746d9fd | C++ | MrBlueBird2/cpp-for-beginners | /linear-search/main.cpp | UTF-8 | 354 | 3.671875 | 4 | [] | no_license | // Linear search is an algorithm to find an integer in an given array, It is slow, but, Fast when the length of the array is less.
#include <iostream>
using namespace std;
int main() {
int arr[] = { 10, 20, 30, 40, 50 };
int k = 30;
for (int i = 0; i < arr.length(); i ++) {
if (arr[i] == k) {
cout << i... | true |
a449df300b6adc938f2d360db06e642a91f8a064 | C++ | kyulee2/Algorithm | /CourseScheduleIII/t1.cpp | UTF-8 | 2,160 | 3.875 | 4 | [] | no_license | /*
There are n different online courses numbered from 1 to n. Each course has some duration(course length) t and closed on dth day. A course should be taken continuously for t days and must be finished before or on the dth day. You will start at the 1st day.
Given n online courses represented by pairs (t,d), your task... | true |