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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
56f0f4f3438ac4c52d9144560467538652689af1 | C++ | Maxim658/lab01 | /maks_lab01c++.cpp | UTF-8 | 1,689 | 3.34375 | 3 | [] | no_license | #include "pch.h"
#include <iostream>
#include "Complex.h"
#include <fstream>
#include <math.h>
using namespace std;
void Task1()
{
Complex d1 = Input();
Complex d2 = Input();
Complex res;
char act;
bool flag = true;
while (flag)
{
cout << "Input action (+-*/): ";
cin >> act;
switc... | true |
1ea812333ed482acad2411a1f44e02110534c4c8 | C++ | O-Beya/Comp280Assignment1Solution | /main.cpp | UTF-8 | 2,890 | 3.640625 | 4 | [] | no_license | //
// main.cpp
// Comp280Assignment1Solution
//
// Created by Olivier on 5/27/16.
// Copyright © 2016 OlivierBeya(Beyasoft). All rights reserved.
//
#include <iostream>
#include "List.hpp"
using namespace std;
int main(int argc, const char * argv[]) {
//testing constructor, creating an empty List
L... | true |
479075ff7a88444199b835b1bfe30b9fca73e1f9 | C++ | XNerv/mlib | /include/mlib/wtimer.h | UTF-8 | 655 | 2.65625 | 3 | [
"MIT"
] | permissive | /*!
\file wtimer.h definition of waitable timer class
(c) Mircea Neacsu 1999
*/
#pragma once
#include "syncbase.h"
namespace mlib {
class wtimer : public syncbase
{
public:
///Timer mode
enum mode { manual, automatic };
wtimer (mode m=automatic, const char *name=NULL, bool use_apc=false);
void start (D... | true |
15ad52760666befac54e1c770939c121d86f0243 | C++ | PSCLab-ASU/multi-agent-accelerator-platform | /utils/include/pending_msg_reg.h | UTF-8 | 6,291 | 2.6875 | 3 | [] | no_license | #include <string>
#include <utility>
#include <variant>
#include <map>
#include <tuple>
#include <mutex>
#include <list>
#include <iostream>
#include "payloads.h"
#include <boost/range/algorithm.hpp>
#ifndef PENDMSGS_REG
#define PENDMSGS_REG
template <typename ... Ts>
class pending_msg_registry{
using pending_mes... | true |
e74e15970bf4eca07b35c73624b8c5b45d5c3297 | C++ | RageHyperNOVA/Project-Solar-Tracking-System-Tessolve-Training | /Tessolve_SolarTrackingSystem.ino | UTF-8 | 5,470 | 2.71875 | 3 | [] | no_license | #ifndef __CC3200R1M1RGC__
#include <SPI.h>
#endif
#include <WiFi.h>
#include <Wire.h>
#include "Adafruit_TMP006.h"
#include <stdlib.h>
char thingSpeakAddress[] = "api.thingspeak.com";
String writeAPIKey = "S5CEPJUL7KFTHSES";
const int updateThingSpeakInterval = 16 * 1000;
char buffer[25];
char ssi... | true |
cc54216137665077133bff539e8bfec5f6d3e63c | C++ | SteBry/competitive_programming | /IMPA/2020_Round_2/Week_1/wff_n_proof.cpp | UTF-8 | 1,671 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
std::string line;
while (cin >> line && line != "0")
{
string aString, lString, nString;
int tempPos;
sort(line.begin(), line.end());
/*
The string is split into 3 strings... | true |
0a46a622215d32d0a65dc1e34364387893fda92a | C++ | peperontino39/AirRide_Gameshoow | /src/Scene/SceneManager/CreateScene.h | UTF-8 | 284 | 2.75 | 3 | [] | no_license | #pragma once
#include "SceneBase.h"
#include <memory>
class Scene
{
public:
template<typename T>
static void createScene(T* _scene) {
scene = std::make_shared<T>(*_scene);
};
static SceneBase& get() {
return *scene;
}
private:
static std::shared_ptr<SceneBase> scene;
};
| true |
169af366887a30b19efca8f937557662dbd72c3b | C++ | Pecneb/CodingStudies | /8_het/min_rendez.cpp | UTF-8 | 693 | 3.203125 | 3 | [] | no_license | #include <iostream>
using namespace std;
void rendez(int* t, int size) {
int i,j,k;
for(i=0; i<size; i++) {
k = i;
for(j=i; j<size; j++) {
if(*(t+k) > *(t+j)) {
k = j;
}
}
if(k > i) {
int cs = *(t+k);
*(t+k) = *(t+i... | true |
18c9c6060a4755bc76532321322ba6b8965be1f9 | C++ | gtomasini/neuronal-network-3 | /generador.cpp | UTF-8 | 1,296 | 2.6875 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <ctime>
#include <math.h>
using namespace std;
const float radio_=20;
const float x0_(20), y0_(25);
const float pi=3.14159265358979323846433832;
int
main( int argc, char *argv[] ) {
if (argc <3 ){
cout<<"escriba "... | true |
2d7db7107c7266f6277afcd728ba27865b8f725c | C++ | Inero1999/Catalog-Song-lirics | /24.03_Catalog song lyrics.cpp | UTF-8 | 3,991 | 2.953125 | 3 | [] | no_license | // 24.03_Catalog song lyrics.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include<string.h>
#include<string>
#include<Windows.h>
#include <fstream>
using namespace std;
struct catalog_song //создание структуры Каталога
{
string name... | true |
86c04c7f785a5fef3f84d2afd1e52c8b0bde18eb | C++ | LJK150030/AntAI | /code/Math/MathUtils.cpp | UTF-8 | 25,272 | 3.21875 | 3 | [] | no_license | #include"Math/MathUtils.hpp"
#include <cmath>
#include "Math/Vec2.hpp"
#include <vector>
typedef union {float f; int i;} IntOrFloat;
//Angle utilities
//--------------------------------------------------------------------------------------------------
float ConvertRadiansToDegrees(const float radians)
{
return radia... | true |
d324f01ca15156fc320605e1453fd00ba307ecc8 | C++ | Soma247/ubuntu_projects | /cppprojects/concepts.cpp | UTF-8 | 294 | 3.203125 | 3 | [] | no_license | #include <concepts>
#include <iostream>
template<typename T>
concept my_integral=std::integral<T>;
template <my_integral I>
void fn(const I& data){
std::cout<<data<<" is integral"<<std::endl;
}
int main(int argc, char**argv){
int i{2};
fn(i);
//fn(std::string{});
return 0;
}
| true |
05e74e5449747d88c0a9bf46c3f6e526a752cfff | C++ | Sun-CX/reactor | /netc/EpollPoller.cpp | UTF-8 | 3,214 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | //
// Created by suncx on 2020/8/17.
//
#include "EpollPoller.h"
#include "Channel.h"
#include "Ext.h"
#include "ConsoleStream.h"
#include <sys/epoll.h>
#include <unistd.h>
#include <cassert>
#include <cstring>
using reactor::core::Timestamp;
using reactor::net::EpollPoller;
using std::chrono::system_clock;
const in... | true |
c9668183e0777cb3844b981aadc7fa61daeb22be | C++ | beefeather/clean-sources-cpp | /examples/GeneralNumberSystems/Graph/roger/MATH/Graphs/LinkedNode.cpp | UTF-8 | 4,103 | 2.90625 | 3 | [] | no_license | namespace MATH::Graphs;
/**
* @brief Node linked representaion
* @details Evry Node join to eachother by edges.
*
* @tparam Weight_t the weight type of the graph
* @tparam Label_t the Label type of the graph
* @tparam Tag_t the tag type of the graph
*
* @see MATH::Graphs::Node
* @see MATH::Graphs::Edge
*
* ... | true |
d0ad25e5d99ab333445b02fdef455311166b8bff | C++ | ls-cwi/heinz | /src/preprocessing/posedge.h | UTF-8 | 2,874 | 2.59375 | 3 | [
"MIT"
] | permissive | /*
* posedge.h
*
* Created on: 14-jan-2013
* Author: M. El-Kebir
*/
#ifndef POSEDGE_H
#define POSEDGE_H
#include <lemon/core.h>
#include <string>
#include <vector>
#include <set>
#include "rule.h"
namespace nina {
namespace mwcs {
template<typename GR,
typename WGHT = typename GR::template NodeM... | true |
e96c1ccca92001e4c25d8382f8a883a0b58aa638 | C++ | matarms/LibCDS4 | /DS4.cpp | UTF-8 | 2,857 | 2.625 | 3 | [] | no_license | #include "DS4.h"
DS4::DS4(){
rc.open("/dev/input/js0");
if(rc == NULL)
cerr << "Erro ao abrir evento do controle\n";
but = new Buttons [11]; //Cria os botões a serem usados
}
DS4::DS4(string local){
rc.open(local.c_str());
if(rc == NULL)
cerr << "Erro ao abrir evento do con... | true |
78ff002002baa6c18535e7dacd1605d668e306cb | C++ | Chao-Jiang/fiberCodes | /R/blocks.cpp | UTF-8 | 1,092 | 2.953125 | 3 | [] | no_license | /* Author: Ian Leifer <ianleifer93@gmail.com> */
#include "blocks.h"
#include <iostream>
#include <fstream>
bool BuildingBlock::addNode(int id, int color) {
for(int i = 0; i < nodes.size(); i++) {
if(nodes[i] == id) {return 0;}
}
nodes.push_back(id);
if(color != -1) {
if(color >= colors.size()) {
colors.re... | true |
c906cb92d68d00f24972ab97bb0586be99bf38f4 | C++ | sdycxx2279/myAlgorithm | /357.cpp | UTF-8 | 502 | 3.140625 | 3 | [] | no_license | //
//@author Xiao Xu
//@create 2018-12-05 21:10
//Count Numbers with Unique Digits
//
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int countNumbersWithUniqueDigits(int n) {
if(!n)
return 1;
int a = 1, b = 10, c = 9;
for(int i = 1; i < n; i++... | true |
96a8b962cdfcf24dd86e5cbb9eaefeabd8c50343 | C++ | aqing1987/s-lang-cpp | /beginning-c++-through-game-programming-4th/chapter1/game_over2.cpp | UTF-8 | 175 | 2.875 | 3 | [] | no_license | // Game over 2.0
// Demonstrates a using directive
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
cout << "Game Over!" << endl;
return 0;
}
| true |
3ae16cb430076c8d63cf2315506cd30050aae0d3 | C++ | jaybrecht/ros_collection_robot | /test/polygon_test.cpp | UTF-8 | 1,255 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <gtest/gtest.h>
#include "../include/polygon.h"
TEST(calculateCentroid,simpleCentroidTest) {
std::vector <geometry_msgs::Point> vertices;
geometry_msgs::Point point1;
point1.x = 0;
point1.y = 0;
geometry_msgs::Point point2;
point2.x = 2;
point2.y = 0;
geometry_msgs::Point point... | true |
d271858a739b00af8a878a5a7330b971fc312d24 | C++ | souchea/snippets | /cpp/multiple_template.cpp | UTF-8 | 205 | 2.75 | 3 | [] | no_license | template<typename T>
struct Pair1 {
Pair1(T aa, T bb)
: a(aa), b(bb) {}
T a;
T b;
};
template<typename T, typename U>
struct Pair2 {
Pair2(T aa, U bb)
: a(aa), b(bb) {}
T a;
U b;
};
| true |
b2522c0a71881602a1e529a0243773d76a37af61 | C++ | fofcn/vip | /common/Thread.h | UTF-8 | 731 | 2.578125 | 3 | [] | no_license | //
// Created by jiquanxi on 17-9-20.
//
#ifndef VIP_THREAD_H
#define VIP_THREAD_H
#include <iostream>
#include <pthread.h>
#include "Runnable.h"
class IThread
{
public:
virtual bool start() = 0;
virtual void stop() = 0;
virtual void stop(bool force) = 0;
virtual void join() = 0;
virtual void j... | true |
a705f1d9449d34578b2ac95bf9c24fbc8245df6c | C++ | spatel98/Project1 | /sectiontoken.cpp | UTF-8 | 379 | 2.765625 | 3 | [] | no_license | /*
* sectiontoken.cpp
*
* Created on: Sep 19, 2018
* Author: sawan
*/
#include "sectiontoken.h"
#include <string>
using namespace std;
SectionToken::SectionToken(string str, secType_t tempType){
section = str;
type = tempType;
}
secType_t SectionToken:: getType() const{
return type;
}... | true |
f82301283394fa4ff32124e170b80985c0a862d3 | C++ | HallWoodZhang/Compiler | /C-Compiler/compile.cpp | UTF-8 | 95,045 | 2.578125 | 3 | [] | no_license | #include "compile.h"
vector<string> check_list;//给出原来四元式的位置即可找到应该跳转的标记
vector<arr_list>Arr_list;
extern vector<ainfl> AINFL;
extern vector<rinfl> RINFL;
targe data;//汇编语言序列
targe code;
targe cout_code;
targe* data_pointer;
targe* data_end;//链表最后一个元素的指针
stack<targe*> backfilling;
int jump_label = 0;
int cout_label = ... | true |
3c585ac5a71bd87dc5c677bead5feea0982e38b6 | C++ | jpennington222/KU_EECS_Labs | /EECS_268/Lab02/WebBrowser.cpp | UTF-8 | 1,927 | 3.359375 | 3 | [] | no_license | /*
* @Author: Joseph Pennington
* @File Name: WebBrowser.cpp
* @Assignment: EECS 268 Lab 02
* @Date: 09/17/2018
* @Brief: This program is the cpp file for the WebBrowser Class. It contains the constructor, navigateTo, forward, back, cur... | true |
771f1609d454b286e45f8382282792a61838a3f8 | C++ | alexandraback/datacollection | /solutions_1485488_1/C++/MrRoach/main.cpp | UTF-8 | 2,299 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <list>
#include <deque>
#include <set>
#include <map>
#include <ctime>
#include <cmath>
#include <cstdlib>
#include <queue>
using namespace std;
const int MAXN = 120;
const int INFTY = 100000000;
const double EPS = 1e-6;
const int dx[] = ... | true |
b584cd52c9db7e4c8707a5d6dfecaf4ef92d7653 | C++ | jukemal/MARX-XIX-Arduino | /src/main.cpp | UTF-8 | 895 | 2.859375 | 3 | [] | no_license | #include <Arduino.h>
#include <Wire.h>
#define ADDRESS 8
bool isProcessing = false;
void receiveEvent(int howMany)
{
String str;
while (Wire.available())
{
char c = Wire.read();
str += c;
}
Serial.println(str);
isProcessing = true;
Serial.println("Progress Started.");
}
void sendEvent()
{
i... | true |
9842533de4894879daa331b00ce43f707583bac7 | C++ | rk946/cpp | /Recursion/power.cpp | UTF-8 | 211 | 2.953125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int sol(int a,int b)
{
if(b==1)
return a;
return a*sol(a,--b);
}
int main()
{
int a,b;
cin>>a>>b;
cout <<a<<endl;
cout <<b<<endl;
cout << sol(a,b) <<endl;
} | true |
04703f9de88430456113c9cc2b96ee3eba6663df | C++ | b0rista/cpp-karate | /WhiteBelt/Week2/Anagram/Anagram/main.cpp | UTF-8 | 636 | 3.421875 | 3 | [] | no_license | //
// main.cpp
// Anagram
//
// Created by Boris Tarovik on 20.06.2021.
//
#include <iostream>
#include <map>
using namespace std;
map<char, int> BuildCharCounters(const string& s) {
map<char, int> charCounters;
for (auto c : s) {
++charCounters[c];
}
return charCounters;
}
int main(int a... | true |
00fb560f89ccfbe25d18a2bba589a51df90299fc | C++ | MarcoGeraldi/Homework_2019 | /HomeworkAC_2019/HomeworkAC_2019/gate.h | UTF-8 | 972 | 2.78125 | 3 | [] | no_license | #pragma once
#include "signal.h"
//Generic Gate
class gate{
protected:
//Each Gate has many input signal and only 1 output signal
std::vector<signal_input> signal_in;
signal_output signal_out;
public:
gate();
bool Read();
};
//AND Gate
class AND : public gate {
public:
AND(const std::vector<signal_input> & ... | true |
9aad7893a5e4e51530c079b30439959a7dcf9b92 | C++ | jiteshsingla1999/Competitive_code | /stl/quick_sort.cpp | UTF-8 | 1,053 | 3.046875 | 3 | [] | no_license |
#include<iostream>
using namespace std;
void swap(int &a, int &b)
{
int temp = a;
a=b;
b=temp;
}
int partition(int input[], int start, int stop)
{
int pivot = input[start];
int i=start+1;
int j=i;
while(j<=stop)
{
if(input[j]<pivot)
{
j++;
}
else
{
... | true |
fc447613aa10dcf4c25b14905d9cb91427af4f81 | C++ | ducthangbui/Learning | /C++/BaiTap/baitaplan1/12.cpp | UTF-8 | 319 | 3.03125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int Amstrong(int n)
{
int tmp=n,a;
int s=0;
while(n!=0)
{
a=n%10;
s=s+a*a*a;
n=n/10;
}
if(s==tmp) return 1;
return 0;
}
main()
{
int dem=0;
for(int i=100;i<=999;i++)
if(Amstrong(i))
{
dem++;
cout<<i<<" ";
}
cout<<endl<<"Co tat ca "<<dem<<" so"<<endl;
}
| true |
d1e62df148a41af9d14be3d43315dcc71c369061 | C++ | CartoDB/mobile-sdk | /all/native/utils/GeneralUtils.h | UTF-8 | 1,395 | 2.703125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright (c) 2016 CartoDB. All rights reserved.
* Copying and using this code is allowed only according
* to license terms, as given in https://cartodb.com/terms/
*/
#ifndef _CARTO_GENERALUTILS_H_
#define _CARTO_GENERALUTILS_H_
#include <string>
#include <vector>
#include <map>
namespace carto {
class... | true |
20b00ea2926f0d4fbe1738e23801191e7b11b7aa | C++ | wesley-stone/leetcode | /hiho43/cnmhiho.h | UTF-8 | 1,817 | 2.71875 | 3 | [] | no_license | //
// Created by wesley shi on 2018/1/7.
//
#ifndef HIHO43_CNMHIHO_H
#define HIHO43_CNMHIHO_H
#include <vector>
using namespace std;
vector<vector<vector<int>>> dp(100, vector<vector<int>>(3, vector<int>(4, 0)));
void init(int max){
// h
dp[0][0][0] = 1;
// i
dp[0][1][1] = 1;
// o
dp[0][2]... | true |
1ea83088f89f29659425f47866da650fd673e93d | C++ | yjglab/cpp_programming_study | /B1_40/Source6.cpp | UHC | 629 | 3.453125 | 3 | [] | no_license | #include <iostream>
using namespace std;
// *** Ҹ ***
class Base1 {
public:
virtual ~Base1()
{
cout << "~Base1() " << endl;
}
};
class Derived1 : public Base1 {
private:
int* _arr;
public:
Derived1(int length)
{
_arr = new int[length];
}
virtual ~Derived1() override
{
cout << "~Derived1() " << endl;... | true |
e431d21055a36c4308fb8afa9e9700d803502c4b | C++ | seanande/hearing-aid | /main.cpp | UTF-8 | 2,255 | 2.5625 | 3 | [] | permissive | //#include "frost.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MAX_FILE_SIZE 1000000
#define BLOCK_SIZE 256
#define CHANNELS 4
int main(int argc, char const *argv[]) {
unsigned char buffer[MAX_FILE_SIZE];
int i, j, k, n, num_blocks;
char *fil... | true |
68383f7c18313e6e447f20a0160d43e291599bd1 | C++ | provo/dataStructures | /arrayStack/arrayStack.cpp | UTF-8 | 3,408 | 4.09375 | 4 | [] | no_license | /*
* July 8, 2017
* Stack implemented with an array. The stack holds string objects.
*/
// Included files
#include <iostream>
#include <string>
#include "arrayStack.hpp"
// Using declarations
using std::cout;
using std::endl;
using std::string;
// Check if the stack is empty
inline bool ArrayStack::isEmpty() c... | true |
00438d09c9403792930d2f3a1fda8ffca311619e | C++ | developersbk/Universal_Code_Snippets | /Codes/C++ Programs/Others/Convert a number into words.cpp | UTF-8 | 3,112 | 3.46875 | 3 | [] | no_license | Convert a number into words
#include <conio.h> // For getch() function only
#include <iostream>
using namespace std;
void numword1(int);
void numword2(int);
int main()
{
long unsigned int number,temp;
int mult,i,digit,digits,last_two,hundred,thousand,lakh,crore;
digits=last_two=hundred=thousand=lakh=crore=0;
co... | true |
2b1845e7ff09a0bbebedbc9d6edbd9b5f784f135 | C++ | dendisuhubdy/osfix | /FixEngine/source/common/message/BasicMessage.h | UTF-8 | 1,401 | 2.734375 | 3 | [
"BSL-1.0"
] | permissive | /*
* BasicMessage.h
*
* Created on: 1 Jan 2013
* Author: Wei Liew [wei.liew@outlook.com]
*
* Copyright Wei Liew 2012 - 2013.
* Distributed under the Boost Software License, Version 1.0.
* (See http://www.boost.org/LICENSE_1_0.txt)
*
*/
#ifndef BASICMESSAGE_H_
#define BASICMESSAGE_H_
namespace osf_... | true |
aee31f061c4b99d02e98ba103b78f620876ae83f | C++ | sysu-itl/FinalProject | /code/Classes/map.cpp | UTF-8 | 3,019 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include "map.h"
vector<string> MapClass::mapTexture = vector<string>();
MapClass::MapClass()
{
if (mapTexture.size() == 0) {
init();
}
}
Sprite* MapClass::createSprite(int texture)
{
//精灵
auto sprite = Sprite::create(mapTexture[texture].c_str());
Texture2D::TexParams t... | true |
7961b09523c7a9edfb02f3978dea690484cd9580 | C++ | GevArakelyan/OpenCv | /Source.cpp | UTF-8 | 776 | 2.546875 | 3 | [] | no_license | #include <boost/gil.hpp>
#include <boost/gil/extension/dynamic_image/any_image.hpp>
#include <boost/gil/extension/io/jpeg.hpp>
#include <boost/gil/extension/io/png.hpp>
#include <boost/mpl/vector.hpp>
#include <iostream>
#include <algorithm>
int main()
{
namespace bg = boost::gil;
using my_images_t = boost::mpl::ve... | true |
19882e71896395be43a1c0d065928829a777a876 | C++ | Chinkyu/CXXExercise | /MyAlgorithmPractice/MyAlgorithmPractice/43.MultiplyStrings1.cpp | UTF-8 | 1,828 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
class Solution {
public:
string add(string num1, string num2) {
int s1 = num1.size()-1;
int s2 = num2.size()-1;
int len = (s1 > s2) ? s1 : s2;
string ans;
int carry = 0;
int sum;
do {
if(s1 >= 0 && s2 >= 0) sum = num1[s1] + num2[s2] + c... | true |
70bc8771b230b1df93e24cb2f12253f6e3e50090 | C++ | ljmihalik/OPL-Kono | /Board.cpp | UTF-8 | 13,320 | 3.578125 | 4 | [] | no_license | #include "Board.h"
#include <iomanip>
#include <iostream>
#include <fstream>
using namespace std;
Board::Board(){
}
Board::~Board(){
}
void Board::setBoard(int row, int col, string newElement){
mBoard[row][col]=newElement;
}
/* *********************************************************************
Function... | true |
c1cc4de347bb6da6f94a03978bcfae96ff491f23 | C++ | professor9999/DSA | /Practice Problems/Array/01_Reverse_The_Array_STL.cpp | UTF-8 | 313 | 3.40625 | 3 | [] | no_license | // Reverse the array
// Time Complexity = O(n)
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a[] = {1, 21, 8, 9, 3, 1, 19, 55, 15, 45, 23};
int n = sizeof(a) / sizeof(int);
reverse(a, a + n);
for (int i = 0; i < n; i++)
{
cout << a[i] << " ";
}
return 0;
} | true |
d3dc44ebda68331297473f5c46e7d8db4e38e82e | C++ | BaeJongHo/Algorithm | /Guess_2/Guess_2.cpp | UTF-8 | 815 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
int n;
char a[10][10];
vector<int> v;
void dfs(int idx);
bool possible(int idx);
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = i; j < n; j++) {
cin >> a[i][j];
}
}
dfs(0);
return 0;
}
... | true |
db825fee7a94f30c6262a86dbf151af60df9af39 | C++ | mka-sieg/Domino | /func_game.cpp | UTF-8 | 6,770 | 2.6875 | 3 | [] | no_license | #include "libraries.h"
void koniec_ruchu(){
string next;
while(next!="n"){
cout<<"By zakonczyc ruch wpisz litere n"<<endl;
cin>>next;
if(next=="n"){
break;
}
}
system("cls");
}
int dokladanie_kostki(int kolejka[],int **gracz_kostki,int ostatnia,int **tab,... | true |
591b09ab838b6c0a55a34440e69ce144cab8fa4a | C++ | zahellcode/hydroponics_control | /hydroponics_control.ino | UTF-8 | 5,478 | 2.5625 | 3 | [] | no_license |
#include "vars.h"
// RTC_DS1307 rtc;
RTC_DS3231 rtc;
char t[32];
bool evento_inicio = true; //variable de control para inicio de evento con valor true
bool evento_fin = true; // variable de control para finalización de evento con valor true
# define RELE 7
// constante RELE con valor 12 que cor... | true |
8e574bbdb02bd23f9c16b1539a6e7feada7a07a7 | C++ | olegseledets/theTask17-4 | /main.cpp | UTF-8 | 1,682 | 3.859375 | 4 | [] | no_license | #include <iostream>
void arrFilling(int arr[][4]){
int newArr[4][4];
for(int i = 0; i < 4; ++i){
for(int j = 0; j < 4; ++j){
std::cout<< "[" << i << "][" << j << "] = ";
std::cin >> arr[i][j];
}
}
}
bool comparisonArr(int arrOne[][4], int arrTwo[][4]){
for(int i = 0; i < 4; ++i){
for(i... | true |
5edbd79409e9822b6df153e85b14839e5811ab0a | C++ | leon-anavi/eduArdu | /SOFTWARE/Challenges for kids who study the demo codes/ch_Makey_Servo/ch_Makey_Servo.ino | UTF-8 | 3,924 | 2.734375 | 3 | [
"Apache-2.0",
"CC-BY-SA-3.0",
"GPL-3.0-only"
] | permissive | /**********************************************************************
Demo example for Olimex board eduArdu
Tested with Arduino 1.8.12
Date: 2020/02/19
Description: Capacitive sense MakeyMakey implementation
Demo sketch using the default Arduino library "Keyboard"
***************************************************... | true |
09b28ff76d126f04074d9d8f656e44945f52e963 | C++ | avasyutkin/term_1 | /My labs/Lab_11explicit/Lab_11explicit.cpp | UTF-8 | 730 | 3.09375 | 3 | [] | no_license | // Lab_11explicit - неявное подключение динамической библиотеки
#include "pch.h"
#include <iostream>
#include <windows.h>
using namespace std;
//Инициализация функции
double(*fun)(double, double);
int main(int argc, char* argv[])
{
// Загрузка dll
HMODULE h = LoadLibrary(L"Lab_11dll.dll");
(FARPROC &)fun = Get... | true |
47064506eca2ab05a8740463fd563b59dc8c6707 | C++ | hamko/sample | /tbb/parallel_pipeline.cpp | UTF-8 | 5,837 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <tbb/tbb.h>
#include <utility>
#include "tbb/task_scheduler_init.h"
using namespace std;
using namespace tbb;
typedef tbb::mutex::scoped_lock lock_t;
typedef vector<string>::iterator iterator_t;
// 1st-stage : おサシミを引く
class osashimi : public tbb::filte... | true |
f1b379e437017b1edef3a3ed10cd0469452ecf69 | C++ | vsrikrishna/cplusplus | /Miscellaneous/checkRegexExp.cpp | UTF-8 | 1,655 | 3.703125 | 4 | [] | no_license | basic Regex engine implementing the "." (any character) and "*" (previous rule, 0 to many).
* The function receives a string (letters only, no need for escaping) and a string pattern.
* It returns a bool whether the string matches the pattern. For example, the pattern "AB.*E" should match both "ABCDE" and "ABEEE". ... | true |
bf585195be819ed0e1312367c1c9df9c6950e9c0 | C++ | SweetheartSquad/S-Tengine2 | /S-Tengine2/Source/S-Tengine2/src/CommandProcessor.cpp | UTF-8 | 3,058 | 3 | 3 | [] | no_license | #pragma once
#include <typeinfo>
#include "CommandProcessor.h"
#include "Command.h"
#include "CompressedCommand.h"
#include "Log.h"
CommandProcessor::CommandProcessor(void) :
currentCompressedCommand(nullptr)
{
}
bool CommandProcessor::executeCommand(Command * c){
if(currentCompressedCommand != nullptr){
if(!cu... | true |
7dafafe7d42cdac8c1af10d50958ab0ad116efc9 | C++ | clach/Realtime-Vulkan-Hair | /src/Camera.cpp | UTF-8 | 3,270 | 2.703125 | 3 | [] | no_license | #include <iostream>
#define GLM_FORCE_RADIANS
// Use Vulkan depth range of 0.0 to 1.0 instead of OpenGL
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include <glm/gtc/matrix_transform.hpp>
#include "Camera.h"
#include "BufferUtils.h"
Camera::Camera(Device* device, float aspectRatio) : device(device), eye(glm::vec3(0.0f, 1.f, 1... | true |
a0c5cdff6a09d3612fde857f3d907148c0b71aae | C++ | jackp1711/Basic_RayTracer | /camera.h | UTF-8 | 1,321 | 3.578125 | 4 | [] | no_license | /*
Class to store information about the camera in relation to the world coordinate system.
Includes implementation to set the lookAt point and the position of the camera, updating
the necessary vectors in the mean time.
*/
#pragma once
#include "vector.h"
#include "vertex.h"
class Camera{
public:
... | true |
27d1f5d4dacd198328af0950c12538126e483ce9 | C++ | Kousuke-N/kyopuro | /20200711/20200711.cpp | UTF-8 | 184 | 2.65625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int L;
int R;
int d;
cin >> L >> R >> d;
int h = R / d;
int i = L / d + 1;
cout << R / d - (L - 1) / d << '\n';
} | true |
4b5a984492eed4af69a98cc714277a7ec695a37f | C++ | artur-kink/game | /GameEngine/Tile.hpp | UTF-8 | 617 | 2.828125 | 3 | [] | no_license | #ifndef _TILE_HPP
#define _TILE_HPP
#include <cstdint>
#define TILE_SIZE 32
#define NUM_LAYERS 3
class Tile{
private:
uint32_t attributes;
public:
enum TileAttributes{
Blocked = 0x01,
Arable = 0x02,
Plowed = 0x04,
Water = 0x08
};
uint16_t layers[NUM_LAYERS];
v... | true |
66e9021742b83cf7078473ad8f3aa06fe6e7c0e6 | C++ | SideDivisionCommander/AlgCoding | /Question/SlidingWindow/no_159/solution.cpp | UTF-8 | 1,134 | 2.96875 | 3 | [] | no_license | class Solution {
public:
int lengthOfLongestSubstringTwoDistinct(string s) {
if (Init(s) == 0) {
return 0;
}
return Process(s);
}
private:
unordered_map<char, int> helpMap;
int maxDis;
int Init(string& s)
{
maxDis = 2;
return s.size();
... | true |
f5bd44d15870ee1aa696f5f2c194c7dea9fc2352 | C++ | ysk24ok/leetcode-submissions | /0152/dp_constant_space.cpp | UTF-8 | 1,049 | 3.21875 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <algorithm>
#include <vector>
using namespace std;
class Solution {
public:
int maxProduct(vector<int>& nums) {
if (nums.size() == 0) { return 0; }
int prev_max = 1, prev_min = 1, curr_max = 0, curr_min = 0;
int ret = numeric_limits<int>::min();
for (size_t i = 0;... | true |
3b4ba308221f763a39ee44cbbead3658ca8f6392 | C++ | eChadwick/Unguided_Search | /Project 1/main.cpp | UTF-8 | 3,216 | 3.6875 | 4 | [] | no_license | //
// main.cpp
// Project 1
//
// Created by Chadwick,Eric on 1/25/18.
// Copyright © 2018 Eric Chadwick. All rights reserved.
//
#include <iostream>
#include <iomanip>
#include <math.h>
#include <vector>
using namespace std;
// Calculates the probability of winning when presented with num_tokens on your turn and... | true |
22684a3f6af5ae52973c03fb7ec2952da6b67462 | C++ | haeunyoung/algorithmStudy | /algorithm/algorithm/day31_1647.cpp | UTF-8 | 1,237 | 3.171875 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int n, m;
int getParent(int set[], int x)
{
if (set[x] == x) return x;
return set[x] = getParent(set, set[x]);
}
void unionParent(int set[], int a, int b)
{
a = getParent(set, a);
b = getParent(set, b);
if (a < b) set... | true |
0bf5572f1780e2a5919c94e3f9bcec2c440adb61 | C++ | AnjolaTope/C_PLUS_PLUS_PRACTICE | /Resize_dynamic_array.cpp | UTF-8 | 1,546 | 3.734375 | 4 | [] | no_license | #include <iostream>
#include<fstream>
#include<string>
using namespace std;
// this is the morespace function that increases the size of the array
int morespace(string* &p,int &size) {
int s=0;
s=size+10;
string* pointer;
pointer = new string[s];
for (int i = 0; i < size; i++)
{
pointer[i] = p[i] ;
... | true |
1649c920efd5139f3b9239797c7675c9d4f24b54 | C++ | LichuHaung/Zero_Judge_CPP | /d186.cpp | UTF-8 | 288 | 2.6875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int a,b,c=0,d,i;
while(cin>>a>>b)
{
c=0;
for(;a<=b;a++)
{
for(i=0;i<=b;i++)
{
d=i*i;
if(a==d)
{
c++;
}
}
}
if(a==10&&b==0)
{
break;
}
cout<<c<<endl;
}
}
| true |
7ac7bafa800ed0e9d6061359776eb0f7127a70e2 | C++ | david4u/ACSYSLab | /First Task/ACSYSMatMul/singleThread.cpp | UTF-8 | 2,351 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <time.h>
using namespace std;
// 더 빠르게 하는 방법.
// 월요일 온라인 1시반
int** makeMAT(int n) {
int** mat = new int*[n];
for (int i = 0 ;i < n; i++) {
mat[i] = new int[n];
}
for (int r = 0; r < n; r++) {
for (int c = 0; c < n; c++) {
mat[r][c] = rand() % 10 - 4;
}
}
return mat;
}
int... | true |
c42e33594f5b21a531649a80bf8a4a749b549572 | C++ | tedsta/FissionPong | /src/PlayerControlSystem.cpp | UTF-8 | 2,020 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "PlayerControlSystem.h"
#include "Paddle.h"
#include "Velocity.h"
PlayerControlSystem::PlayerControlSystem(fsn::EntityManager& entityMgr) : fsn::ComponentSystem(entityMgr),
mKeyW(false), mKeyS(false), mKeyUp(false), mKeyDown(false)
{
all<Paddle, Velocity>();
}
PlayerControlSystem::~PlayerControlSyst... | true |
21cdf5b1a6f10e76e0348a4120c8fbc5158527fa | C++ | lilelr/LeecodeProblemsSolutionsByC- | /dp/PerfectSquares/Solution.h | UTF-8 | 2,698 | 3.015625 | 3 | [] | no_license | //
// Created by YuXiao on 7/19/16.
//
#ifndef LEECODEPROBLEMSSOLUTIONSBYC__SOLUTION_H
#define LEECODEPROBLEMSSOLUTIONSBYC__SOLUTION_H
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
//https://discuss.leetcode.com/topic/24255/summary-of-4-different-solutions-bfs-dp-static-dp-and-mathematics/2
... | true |
94798d3a90b7fec13c519ab694bb48068bfbfa14 | C++ | RafigRzayev/BasicCppCourseProjects | /HomeWork7/bubblesort.hpp | UTF-8 | 642 | 3.546875 | 4 | [] | no_license | // BUBBLE SORT FROM HW4
#pragma once
#include <functional>
#include <iostream>
using CompDouble = std::function<bool(double, double)>;
void bubble_sort(double *begin, const double *const end, CompDouble predicate) {
if (begin == nullptr || end == nullptr) {
std::cout << "bubble_sort() - Exception\n";
retur... | true |
4954a83f62dbb44b9c7e7b0351c3dbdf7352f28f | C++ | ethanjob98/solve-puzzle-8 | /main.cpp | UTF-8 | 1,180 | 3.125 | 3 | [] | no_license | #include"controller.hpp"
using namespace std;
void given();
void custom();
int main(){
int choice;
cout << "What type: \n" << "(1) CUSTOM\n(2) GIVEN\nANSWER: " ;
cin >> choice;
choice == 1 ? custom() : given();
return 0;
}
void custom(){
vector<int> row1;
vector<int> row2;
ve... | true |
7aa558b43833210b17661b3fd46d4302340e7ed0 | C++ | WM-CS544/NACHOS3 | /threads/resmanager.cc | UTF-8 | 969 | 3.203125 | 3 | [
"MIT-Modern-Variant"
] | permissive | // resmanager.cc
//
// Implemented in "monitor"-style -- surround each procedure with a
// lock acquire and release pair, using condition signal and wait for
// synchronization.
//
#include "resmanager.h"
#include <new>
ResManager::ResManager()
{
lock = new(std::nothrow) Lock("resmanager l... | true |
f3dc577a37a1799d796e9716d2e923538a62e229 | C++ | Aarth-Tandel/DataStructures | /competitive/Data Structure/Tree/insertingnode.cpp | UTF-8 | 1,006 | 3.6875 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct tnode {
int data;
struct tnode *left,*right;
};
struct tnode* newnode(int data)
{
struct tnode* new_node = new tnode();
new_node->data = data;
new_node->left = NULL;
new_node->right = NULL;
return new... | true |
3fa97672777a90ad677ab37f0475f97e85ae668d | C++ | letyletylety/ps2016 | /1035.cpp | UTF-8 | 2,511 | 2.59375 | 3 | [] | no_license | #include <cstdio>
#include <map>
#include <queue>
#include <memory.h>
using namespace std;
map<int, int> d;
map<int, int> b;
bool visited[25];
int cnt = 0;
int diff[4] = {-1,1,-5,5};
bool isCoordi(int oldpos, int pos)
{
if(pos < 0 || 25 <= pos) return false;
if(pos % 5 == 0)
{
if(oldpos == pos - 1)
return f... | true |
def3edd3fa56a340d526eba5963e4850c90a9f4b | C++ | ericniebler/coronet | /include/coronet/detail/noop_coroutine.hpp | UTF-8 | 2,281 | 2.546875 | 3 | [
"BSL-1.0"
] | permissive | // coronet - An experimental networking library that supports both the
// Universal Model of the Networking TS and the coroutines of
// the Coroutines TS.
//
// Copyright Eric Niebler 2017
// Copyright Lewis Baker 2017
//
// Use, modification and distribution is subject to the
// Boost Software ... | true |
a8fb3e936c2d432f98172eabbee532367a33cc97 | C++ | coderfamer/linuxstudy | /c++/c++primer_3/10/ex10_13.cpp | UTF-8 | 640 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool isfive(string str)
{
if (str.size() < 5)
{
return false;
}
return true;
}
auto print(vector<string> svec)
{
for (auto const &w : svec)
{
cout << w << " ";
}
cout << endl;
}
int main()... | true |
a4f988efaa20da177b4102df3ff57cf970d5250d | C++ | mbkhan721/C-Plus-Plus | /ExprHW04.cpp | UTF-8 | 689 | 3.5625 | 4 | [] | no_license | #include<iostream>
using namespace std;
int expHw() {
/*
// 1.
int x, digit;
cout << "Enter a 3-digit integer: ";
cin >> x;
int y = x;
digit = x % 10;
cout << "Is " << digit << " a factor of " << y << "? " << (y % digit == 0) << endl;
x /= 10;
digit = x % 10;
cout << "Is " << digit << " a factor of " << y... | true |
011709135cb6efbb99e35d4fdb4bbdadb49ee532 | C++ | DuongNguyenHai/C-Program | /C++/B-6.cpp | UTF-8 | 1,234 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h> // exit()
// n la so ky tu phair cat, m la tong so ky tu
char *trichphai(char s[], int n, int m){
int i=0;
char *str = (char *)malloc(128);
while( s[i]!='\0' ){
str[i] = s[m-n+i];
i++;
if(i>n) break;
}
str[i]='\0';
return str;
}
void doctep(char ... | true |
7eb436dbca3c9e786e533d8abb0d457eb4bfa28c | C++ | gregfeng08/linkedList | /main.cpp | UTF-8 | 2,015 | 4.15625 | 4 | [] | no_license | #include <iostream>
#include <cstring>
#include "Node.h"
#include "Student.h"
/*
Linked lists project
Written by: Gregory Feng
This program takes in the name and ID of a student and adds them to a linked list.
Problems: Working on fixing the segfault on the second node creation
*/
using namespace std;
Node* head = ... | true |
66923957b39dfde8f7aad5b8c0ac826b2993aff7 | C++ | tashbeeh25/MiniProject | /ReadWords.h | UTF-8 | 917 | 3.171875 | 3 | [] | no_license | /**
ReadWords.h file
**/
#ifndef _READWORDS_H_
#define _READWORDS_H_
using namespace std;
#include <iostream>
#include <string>
#include <fstream>
class ReadWords
{
public:
//Constructor. Opens the file with the given file name.
//Prints an error message then terminates the pro... | true |
88b3de0361391ce85ee8d888c718091b2d0c34a4 | C++ | JHegelund/EDAF50 | /Lab2/dictionary.h | UTF-8 | 638 | 2.78125 | 3 | [] | no_license | #ifndef DICTIONARY_H
#define DICTIONARY_H
#include <string>
#include <vector>
#include <map>
#include "word.h"
class Dictionary {
public:
Dictionary();
Word wordify(const std::string& str);
bool contains(const std::string& word) const;
std::vector<std::string> get_suggestions(const std::string& word) const;
priva... | true |
cbd405e172745c7c66e102abafdfadab4bf6acca | C++ | mayankDhiman/cp | /codeforces/contests/1324/B.cpp | UTF-8 | 521 | 2.5625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll t; cin >> t;
while (t --)
{
ll n; cin >> n;
vector <ll> pos[5001];
for (ll i = 0; i < n; i ++){
ll x; cin >> x;
pos[x].push_back(i);
}
bool ok = 0;
for (ll m = 1; m <= 5000; m ++)
{
if (pos[m].size() > 2){
... | true |
aa75205bb5ca9693a74797595ab20f1ebd33e5cd | C++ | Johndhawk2/PAM | /Main-Device-Code/BLEDataTransmission/BLEDataTransmission.ino | UTF-8 | 4,606 | 2.828125 | 3 | [] | no_license | #include <SoftwareSerial.h> // Include Libraries
#include <SPI.h>
#include <SD.h>
SoftwareSerial mySerial(7,8); // RX, TX // Setup BLE communication
#define SDChipSelect 6
#define datLengthMax 12
void setup() {
Serial.begin(57600); // Start Seria... | true |
14abb7cab65e022c112dccc33279571ff9f38677 | C++ | pycpp/stl-test | /memory/shared_ptr.cc | UTF-8 | 7,485 | 3.109375 | 3 | [
"MIT"
] | permissive | // :copyright: (c) 2017-2018 Alex Huszagh.
// :license: MIT, see LICENSE.md for more details.
/*
* \addtogroup Tests
* \brief shared_ptr unittests.
*/
#include <pycpp/stl/memory/allocator.h>
#include <pycpp/stl/memory/shared_ptr.h>
#include <gtest/gtest.h>
PYCPP_USING_NAMESPACE
// DATA
// ----
template <bool... | true |
88c79bce8a3c24572f1ab6e3090f93d0656fe75b | C++ | chipsu/opengl-demo | /Mesh.h | UTF-8 | 1,882 | 2.703125 | 3 | [] | no_license | #pragma once
#include "Main.h"
#include "Vertex.h"
#include "AABB.h"
struct Mesh {
std::vector<Vertex> mVertices;
std::vector<uint32_t> mIndices;
GLuint mVertexBuffer = 0;
GLuint mIndexBuffer = 0;
GLuint mVertexArray = 0;
bool mVertexBufferDirty = true;
bool mHidden = false;
AABB mAABB;
GLuint... | true |
2ce8686ef6f0e5992adecd71c369fe2994aa2b5d | C++ | ps-group/cg_course_examples | /chapter_2/lesson_08/Bodies.h | UTF-8 | 837 | 2.875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <glm/vec3.hpp>
#include <glm/fwd.hpp>
enum class CubeFace
{
Front = 0,
Back,
Top,
Bottom,
Left,
Right,
NumFaces
};
class CIdentityCube
{
public:
CIdentityCube();
void Update(float deltaTime);
void Draw()const;
void SetFaceColor(CubeFace face, const ... | true |
33b6512b3f0b63b5befe3e9098b91d6a7d3ac235 | C++ | rajswilochan1999/Hacktoberfest-2020 | /C++_Programs/BFS.cpp | UTF-8 | 1,194 | 2.734375 | 3 | [
"MIT",
"LicenseRef-scancode-free-unknown"
] | permissive | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
vector<int>dist;
void bfs(int s,vector<vector<int>>a,vector<bool>visited)
{
visited[s]=true;
queue<int>q;
q.push(s);
dist[s]=0;
while(!q.empty())
{
s=q.fro... | true |
d93f812591a9e99a5d265aa6ca1165008ccc6ce6 | C++ | Ashwin-Ragupathy/R3-SoftwareTask1-AshwinRagupathy | /r3_software_task_1_ashwin_ragupathy1.ino | UTF-8 | 8,431 | 3.546875 | 4 | [] | no_license | // C++ code
// Ashwin Ragupathy
// R3 - Training Task 1 - Software
// Due: OCtober 10, 2021
//
// Map the input of a potentiometer of 0 - 1023 to 0 - 99 and
// display the values on two Seven Segment displays using CD4511
// seven segment decoders
//
int potentiometerPin = 0; // Initialize the analog input of the po... | true |
1c3f9292c6251e5e5bf23fce3af35608a67b8981 | C++ | CodeRecode/Manticore | /Source/Texture.cpp | UTF-8 | 1,060 | 2.625 | 3 | [] | no_license | #include "Texture.h"
Texture::Texture(std::string fileName)
{
glGenTextures(1, &textureId);
// Load and convert the image with DevIL
ILuint imageID;
ilGenImages(1, &imageID);
ilBindImage(imageID);
ilLoadImage(fileName.c_str());
ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE);
//iluFlipImage();
textureWidth = ilGe... | true |
c924b6cc7879f60548d2c2cfb88ba390d6c101b3 | C++ | pig0726/LeetCode | /problemset/Container_With_Most_Water.cpp | UTF-8 | 340 | 2.71875 | 3 | [] | no_license | class Solution {
public:
int maxArea(vector<int>& height) {
int lidx = 0, ridx = height.size() - 1;
int ret = 0;
while (lidx < ridx) {
ret = max(ret, min(height[lidx], height[ridx]) * abs(lidx - ridx));
if (height[lidx] <= height[ridx]) ++lidx;
else --ridx;
}
re... | true |
b3e62c8f2560bfa7fb08d574f0ba418008c7264a | C++ | shenxn/minijava-compiler | /include/variable.cpp | UTF-8 | 1,241 | 2.5625 | 3 | [] | no_license | #include "variable.hpp"
#include "symboltable.hpp"
namespace AST {
Variable::Variable(Identifier *id) {
this->id = id;
}
Variable::~Variable() {
delete id;
delete type;
}
void Variable::execute() {}
void Variable::typecheck() {
// TODO: check if initialized
... | true |
f81508c567fcc42737080c03b8605a8950aa7b66 | C++ | jose-joaquim/Competitive-Programming | /URI/URI 1933 - Tri-du.cpp | UTF-8 | 308 | 2.515625 | 3 | [] | no_license | //Author/Autor: José Joaquim de Andrade Neto
//Link da questão: https://www.urionlinejudge.com.br/judge/pt/problems/view/1933
#include <iostream>
#include <cstdio>
using namespace std;
int main(int argc, char **argv)
{
int a, b;
cin >> a >> b;
if(a >= b){
printf("%d\n", a);
}else{
printf("%d\n", b);
}
retu... | true |
df06a141ba625fa02652becfa30047ba03572024 | C++ | SayaUrobuchi/uvachan | /Kattis/grandpabernie.cpp | UTF-8 | 787 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
using um = unordered_map<string, int>;
char s[32];
bool dirty[1048576];
vector<int> v[1048576];
int main()
{
int n, m, i, t, id;
um tbl;
while (scanf("%d", &n) == 1)
{
tbl.clear();
for (i=0; i<n; i++)
{
... | true |
e673ae3569d4605881bdfdbe6bdc192ed480447d | C++ | ng210/cpp | /js/managed/base/String.h | UTF-8 | 2,003 | 2.640625 | 3 | [] | no_license | #ifndef __STRING_H
#define __STRING_H
#include "base/Object.h"
NAMESPACE_FRMWRK_BEGIN
/*****************************************************************************
* Object_ (structure)
*****************************************************************************/
class String;
class Array_;
class String_ : public ... | true |
e530c3cd59a742739c30cd1e8cd2f81a80f72444 | C++ | Behrouz-Babaki/practice | /11953/11953.cpp | UTF-8 | 1,346 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using std::cin;
using std::endl;
using std::cout;
using std::vector;
using std::ws;
vector<vector<int> > grid;
vector<vector<int> > visited;
int N;
int num_ships;
void visit(int r, int c);
int main(void) {
int T;
cin >> T;
for (int case_cnt = 1; case_cnt <= T; case_cnt... | true |
4a114ef9c3d76fbc7db3103f98570d58ed26e035 | C++ | tianshihao/picop | /source/smoothmethod.cpp | UTF-8 | 15,651 | 2.875 | 3 | [
"BSD-3-Clause"
] | permissive | #include "smoothmethod.h"
SmoothMethod::SmoothMethod()
{
}
SmoothMethod::~SmoothMethod()
{
}
QImage SmoothMethod::averageFiltering(QImage *originImage)
{
bool ok;
int filterRadius = QInputDialog::getInt(nullptr, QObject::tr("均值滤波"), "输入滤波器大小(1~30)", 3, 1, 30, 1, &ok);
if (ok)
{
if (filterRadi... | true |
66860e43ed1a239e231fbac600e2ec1937c9ba5d | C++ | JoyPoint/CPP-Library-Headers | /CircleBin.hpp | UTF-8 | 2,123 | 2.921875 | 3 | [] | no_license | #ifndef ASU_CIRCLEBIN
#define ASU_CIRCLEBIN
#include<iostream>
#include<vector>
#include<GcpDistance.hpp>
/*********************************************************
* This C++ template compute circle geographic binning
* results. Update the bin center to the average position.
*
* input(s):
* const vector<pair<T... | true |
aa302bb98c8b3384a3e47ca4473a4a5f7e628ba8 | C++ | adityaramesh/ndmath | /include/ndmath/index/composite_index.hpp | UTF-8 | 2,654 | 2.65625 | 3 | [] | no_license | /*
** File Name: composite_index.hpp
** Author: Aditya Ramesh
** Date: 01/09/2015
** Contact: _@adityaramesh.com
*/
#ifndef Z8F87A6F3_74EA_4A09_A3CD_6DCFFB754A07
#define Z8F87A6F3_74EA_4A09_A3CD_6DCFFB754A07
#include <ndmath/index/index_wrapper.hpp>
namespace nd {
namespace detail {
template <unsigned N, ... | true |
4d3a87efd0e305bcd8419ba495ae7e25804129f1 | C++ | weslu1/cs24_Project1_final | /list.cpp | UTF-8 | 1,761 | 3.484375 | 3 | [] | no_license | #include "list.h"
#include <iostream>
#include <stdlib.h>
using namespace std;
List:: List(){
}
Node* List::getHead()
{
return head;
}
void List::expressionToList(string exp){
Node* parent;
Node* current = new Node;
Node* n;
head = current; //access list with this head
for(int i = 1; i<exp.length... | true |
54a03a4a40559c5594c521bd7dcf9cdc1e070bd3 | C++ | JaeminShim/NCUAdvancedCPP | /Day4/1_this_call_6.cpp | UHC | 1,855 | 3.25 | 3 | [] | no_license | // 1. this call_6 - 9page
#include <iostream>
#include "ioacademy.h"
using namespace std;
using namespace ioacademy;
// C GUI Լ ü ô.
#include <map>
// ̺귯 Ŭ
class CWnd
{
int hwnd; // ȣ
public:
int GetHandle() const { return hwnd; }
public:
void Create()
{
hwnd = IoMakeWindow(foo);
this_map[hwnd] = this;
... | true |
ec56886abdfd7ded579c6db6b6573f781624565a | C++ | Mentos15/PISP_1sem | /PiBSP(ШИМАН)/lab7/ServerMS/ServerMS/ServerMS.cpp | UTF-8 | 2,206 | 2.546875 | 3 | [] | no_license | // ServerMS.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <time.h>
#include <WS2tcpip.h>
#include <WS2tcpip.h>
#include "Winsock2.h"
#include "Wi... | true |
804def70a4c97910433ca81888abd83ab1944a82 | C++ | acimadamore/competitive-programming | /UVA Online Judge/iCanGuessThaDataStructure.cpp | UTF-8 | 1,351 | 3.15625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <stack>
#include <queue>
/*
* Author: Andrés Cimadamore(@acimadamore)
* Judge: Online Judge(Former UVA Online Judge)
* Problem: 11995 - I Can Guess the Data Structure!
* URL: https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3146
* Topi... | true |
5218c7d6c305697f42f1b9c97a24c5119152cb34 | C++ | rahul799/leetcode_problems | /Graphs/Bipartitie/Check if a graphs has a cycle of odd length.cpp | UTF-8 | 2,950 | 3.8125 | 4 | [] | no_license | https://www.geeksforgeeks.org/check-graphs-cycle-odd-length/
Check if a graphs has a cycle of odd length
Given a graph, the task is to find if it has a cycle of odd length or not.
It is obvious that if a graph has an odd length cycle then it cannot be Bipartite. In Bipartite graph there are two sets of vertices ... | true |