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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8d562627ea7bf3c8ac752cee63d625dba61a6880 | C++ | nvtienanh/Hitechlab_humanoid | /nimbro/cv/classificator/colorlut.h | UTF-8 | 737 | 3.203125 | 3 | [] | no_license | // Color classification LUT
// Author: Max Schwarz <max.schwarz@uni-bonn.de>
#ifndef COLORLUT_H
#define COLORLUT_H
#include <stdint.h>
#include <vector>
class ColorLUT
{
public:
ColorLUT()
{
m_lut.resize(256*256);
}
inline uint8_t color(int y, int u, int v) const
{
return m_lut[256*u + v];
}
inline uint... | true |
0f43d376d1ae6d2bf5879c911a9cbbabaf800855 | C++ | Ballester/RMM | /Huffman/huffman.cpp | UTF-8 | 7,936 | 3.109375 | 3 | [] | no_license | #include "huffman.h"
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iostream>
#include <string>
#include <fstream>
#include <bitset>
std::map<char, float> Coder::calcProbabilities(std::string str) {
std::map<char, int> count;
std::cout << "Calculating probabilities for " << st... | true |
37aabb764c3b6833c0f97c9805d319f095e29235 | C++ | megortel/2D-Graphics-Library | /ZachMatrix.cpp | UTF-8 | 2,309 | 3.140625 | 3 | [] | no_license | #include <math.h>
#include "GMatrix.h"
//Note, we are not subclassing, but simply implementing methods
void GMatrix::setIdentity() {
this->set6(1, 0, 0, 0, 1, 0);
}
void GMatrix::setTranslate(float tx, float ty) {
this->set6(1, 0, tx, 0, 1, ty);
}
void GMatrix::setScale(float sx, float sy) {
this->set6(s... | true |
1c143f84fa880dd048605f74a0979ff1f4c67cf8 | C++ | MohitBhola/CPP | /Utilities/ThreadSafePointer/thread_safe_ptr.cpp | UTF-8 | 22,148 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <memory>
#include <mutex>
#include <map>
#include <string>
#include <thread>
// a manual replacement for std::void_t (available since C++17)
template<
typename...>
using VoidT = void;
template<
typename T, typename = VoidT<>>
struct DisableIfIndirection : std::false_type
{};
temp... | true |
f4381481c1e93e857bf2419cfcd5bbe099f51774 | C++ | Vichugov/Labs | /GrafLab/graf.cpp | UTF-8 | 2,569 | 2.59375 | 3 | [] | no_license | #include "graf.h"
#include "ui_graf.h"
struct Uzel{
int *way;
bool take=0;
int from=1000;
};
Uzel uzel[6];
Graf::Graf(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::Graf)
{
ui->setupUi(this);
ui->button->setShortcut(Qt::Key_Return);
uzel[0].way= new int[6]{0,2,0,0,0,... | true |
827c969692c53131d13df130d5b775bdf7c96176 | C++ | naturalleo/game_login | /src/AuthServer/IOBuffer.cpp | UTF-8 | 1,620 | 2.703125 | 3 | [] | no_license | // IOBuffer.cpp: implementation of the CIOBuffer class.
//
//////////////////////////////////////////////////////////////////////
#include "IOBuffer.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
///////////////////////////////////////////////////////////////////... | true |
f2218cbba344591e9a3dac121634fca137d68d95 | C++ | verngutz/Aura-Mismo | /magnitude_point.cpp | UTF-8 | 373 | 3.234375 | 3 | [] | no_license | class magnitude_point {
public:
int index;
double magnitude;
magnitude_point(int index, double magnitude) {
this->index = index;
this->magnitude = magnitude;
}
bool operator <(const magnitude_point &other) const {
return magnitude < other.magnitude;
}
};
bool index_sort(const magnitude_point &i, cons... | true |
0734bd9a1482590d1655c10bb5f7b511594fd556 | C++ | newbazz/legend-of-zeida | /src/island.cpp | UTF-8 | 2,792 | 3.0625 | 3 | [
"MIT"
] | permissive | #include "island.h"
#include "main.h"
Island::Island(float x, float y, color_t color) {
this->position = glm::vec3(x, y, -5);
this->rotation = 0;
// Our vertices. Three consecutive floats give a 3D vertex; Three consecutive vertices give a triangle.
// A cube has 6 faces with 2 triangles each, so this ... | true |
47c385c463e28019064967f0af5fbed86164b6da | C++ | Derydoca/derydocaengine | /DerydocaEngine/src/Rendering/Renderer.h | UTF-8 | 843 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include "Rendering\Display.h"
#include "Timing\Clock.h"
#include "Scenes\Scene.h"
namespace DerydocaEngine::Rendering
{
class RendererImplementation
{
public:
RendererImplementation(std::string title, int width, int height);
virtual void init() = 0;
virtual void renderFrame(const float deltaTi... | true |
ea6cbf5b1c3b74ad0b0a34fc48238c75285061df | C++ | benedicka/Competitive-Programming | /Gym/100030C/27078812_AC_92ms_3784kB.cpp | UTF-8 | 1,092 | 2.90625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define lld long long int
const lld MOD = 1e9 + 7;
int nCrModp(lld n, lld r, lld p)
{
// Optimization for the cases when r is large
if (r > n - r)
r = n - r;
// The array C is going to store last row of
// pascal triangle at the end. And ... | true |
01b0ac948f31d8d0a2cfca1690aeb9b714433ec4 | C++ | TheMarlboroMan/navigator | /class/app/interfaces/movil.h | UTF-8 | 1,448 | 3.015625 | 3 | [] | no_license | #ifndef MOVIL_H
#define MOVIL_H
/*Modelo de cosa que se mueve en el espacio... En todo caso, esta es la base
para el cálculo de movimiento y tiene algunas cosas de gravedad también.
*/
#include <herramientas/vector_2d/vector_2d.h>
namespace App_Interfaces
{
class Movil
{
//////////////////////
// Definiciones..... | true |
9dc005c17483bdbed1e205c14316f3fa1fc4d9f3 | C++ | rajeevranjancom/Leetcode_Cpp | /047. Permutations II.cpp | UTF-8 | 589 | 3.015625 | 3 | [
"MIT"
] | permissive | class Solution {
public:
vector<vector<int>> permuteUnique(vector<int>& nums) {
sort(nums.begin(), nums.end());
vector<vector<int>>res;
DFS(res, nums, 0);
return res;
}
void DFS(vector<vector<int>>& res, vector<int> nums, int pos){
if(pos == nums.size() -... | true |
614b0aa4583dcfb892a05ba24b83567854386bcf | C++ | ninjalp/gtu-elec-433-631 | /src/codes/w_05/boost_bind_examples_cpp/cpp/initial_boost_bind_test.cc | UTF-8 | 527 | 3.203125 | 3 | [] | no_license | // Onder Suvak (C) 2020
#include <boost/config.hpp>
#include <boost/bind.hpp>
#include <iostream>
#include <iomanip>
void
increment
(int val, int & number)
{
number += val;
}
int
main(void)
{
using namespace std;
const int val = 5;
int number = 10;
auto fh =
boost::bind( increment, val, _1 );
... | true |
75563acbb3286e19bc954aae0a2d6f46af82e4df | C++ | ives560/EmbroiderApp | /widget.cpp | UTF-8 | 5,029 | 2.65625 | 3 | [] | no_license | #include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
// this->showFullScreen();
CurSel=0;
InitSelectArray();
InitWidgetsText();
SelPlugin(0);
m_devThread=new DevicesThread();
ui->widget_7->m_devThrea... | true |
1964d47e8ad8101152103e4dca3cd098dfde19db | C++ | RtsAiResearch/IStrategizer | /src/IStrategizer/EntityClassExist.h | UTF-8 | 867 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | ///> [Serializable]
#ifndef ENTITYCLASSEXIST_H
#define ENTITYCLASSEXIST_H
#include "ConditionEx.h"
#include <vector>
#include <map>
namespace IStrategizer
{
///> class=EntityClassExist
///> parent=ConditionEx
class EntityClassExist : public ConditionEx
{
OBJECT_SERIALIZABLE_P(EntityClassExist, Cond... | true |
037e19f96a219f8dcdd534420e8cb0a090514325 | C++ | KrGolovin/SortsTypes | /BasicSorts.cpp | UTF-8 | 2,663 | 3.390625 | 3 | [] | no_license | //
// Created by Macbook Pro on 12.04.2020.
//
#include "BasicSorts.h"
#include "List.h"
#include <cmath>
int countOfBitwise(int number) {
if (number == 0) {
return 1;
}
int count = 0;
while (number > 0) {
count++;
number /= 10;
}
return count;
}
int getBitwise(int number, int k) {
return ((... | true |
70f41aab4f4e7082a453f363a1a3e739ff8b6dd3 | C++ | AvivDavid23/Interpreter_FlightGear | /Interpreter/Commands/CommandExpression.cpp | UTF-8 | 444 | 2.78125 | 3 | [] | no_license |
#include "CommandExpression.h"
/**
*
* @return the command execution value.
*/
double CommandExpression::calculate() {
command->execute(words);
return 0;
}
CommandExpression::~CommandExpression() {
delete this->command;
}
/**
* @param command the command
* @param words the array of orders.
*/
Comman... | true |
9bb58301b49141f7722de51afc65206c0aa78e56 | C++ | rockdonald2/studying | /schoolWork/AlgsAndDataStructures/Laborhazik/Projektek/hazi_3/feladat_9.cpp | UTF-8 | 2,515 | 3.265625 | 3 | [] | no_license | //
// 9. Feladat forráskódja
//
/*
Hallgató neve: Lukács Zsolt
Csoport: 1. csoport
Feladat sorszáma: 9.
*/
using ll = long long;
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
ll orosz_szorzas(const ll &szam1, const ll &szam2);
int main() {
/* ALGORITMUS LEÍRÁSA
* Be szam1, s... | true |
cc01d33da48e8a3f6fd29f59405b32ebc6fb6262 | C++ | smarrog/smr-library-cpp | /src/commands/commandErrors.hpp | UTF-8 | 712 | 2.65625 | 3 | [] | no_license | #pragma once
#include "commandError.hpp"
#include <vector>
#include <functional>
namespace smr {
class CommandErrors {
public:
using Handler = std::function<void(const CommandError&)>;
void addError(std::string message);
void addError(std::string message, Handler handler);
void addErrors(const CommandErro... | true |
9c03936fd013ca6d17241e08928303c9822e2546 | C++ | 0x00-pl/lispl | /lispl/parse.h | GB18030 | 4,294 | 2.6875 | 3 | [] | no_license | #pragma once
#include<iostream>
#include<sstream>
#include<limits>
#include"base.h"
using namespace std;
std::string trim(std::string& str)
{
str.erase(0, str.find_first_not_of(' ')); //prefixing spaces
str.erase(str.find_last_not_of(' ')+1); //surfixing spaces
return str;
}
void pick_space(... | true |
901eae728ca78dd711515bf33822e09b1f989f24 | C++ | TanyaZheleva/Uni-CPP | /Database/ColumnTest/unittest1.cpp | UTF-8 | 743 | 2.953125 | 3 | [] | no_license | #include "stdafx.h"
#include "CppUnitTest.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
#include "../Project3/Column.h"
namespace ColumnTest
{
TEST_CLASS(UnitTest1)
{
public:
TEST_METHOD(AddCell)
{
Column a(0, "cost", Double, 0);
std::string pi = "3.14";
a.AddCell(pi);
As... | true |
e1d26ae5dd818a7cb31c6491fc01ec0f2647ec3b | C++ | tom3097/EiTI-Projects | /PROI/Zbiory/zbior.cpp | UTF-8 | 5,913 | 3.359375 | 3 | [] | no_license | //Projekt nr 2: klasa reprezentujaca zbior macierzy 3x3 typu float
//Przygotowal: Tomasz Bochenski
#include "zbior.h"
#define POKAZ_KOMUNIKATY_ZBIORY false
//ustawienie poczatkowej liczby obiektow na 0
int zbior::ilosc_obiektow = 0;
//konstruktor domyslny
zbior::zbior()
{
if(POKAZ_KOMUNIKATY_ZBIORY == true)
cout<... | true |
dbad76c841f6ef13253c22f974ce607ff7b38b68 | C++ | A01351361/Proyecto-Simulacion-Beisbol | /simulacion.h | UTF-8 | 5,670 | 3.421875 | 3 | [] | no_license | #ifndef SIMULACION_H //Definir clase
#define SIMULACION_H
#ifdef _WIN32
#include <Windows.h> //Para PAUSAS
#else
#include <unistd.h>
#endif
#include <cstdlib>
#include <string>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <time.h>
#include "jugadores.h" //Biblioteca con mis objetos a usar que en ... | true |
66dcf7147f7b103430694dd8be84b353a2cfe9a2 | C++ | SYSUcarey/Survivor_Island | /code/Classes/Monster.h | GB18030 | 2,187 | 2.625 | 3 | [] | no_license | #pragma once
#include "cocos2d.h"
#include "GlobalVar.h"
using namespace cocos2d;
class MonsterFactory :public cocos2d::Ref {
public:
//ȡ
static MonsterFactory* getInstance();
//һС洢й
Sprite* createSmallMonster();
//һ洢й
Sprite* createBigMonster();
//ɴֵӵ
Sprite* createMonsterBullet();
//жijܷijƶ
bool CanMove(Sp... | true |
d332647b1f3e58f60826542d32d10ebd4ee3f8b9 | C++ | niteshcse14/geeksforgeeks | /Find_all_distinct_palindromic_sub_strings_of_a_given_string.cpp | UTF-8 | 412 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int arr[26];
int main(){
int t;
char str[100000];
scanf("%d", &t);
while(t--){
scanf("%s", str);
memset(arr, 0, sizeof(arr));
int n = strlen(str);
for(int i = 0; i < n; ++i){
arr[str[i] - 'a']++;
}
int sum = 0;
for(int i = 0; i < 26; ++i){
sum += (ar... | true |
b4187fd77dd197be479588c7c67e2e705e8ed163 | C++ | RajeshChilagani/CPPVS2019 | /CPPVS2019/Main.h | UTF-8 | 6,466 | 3.09375 | 3 | [] | no_license | #pragma once
#include "C++/Inheritance.h"
#include "Helpers.h"
#include "C++/InterestingLearnings.h"
#include "C++/String.h"
#include "C++/Templates.h"
#include "C++/DataStructures.h"
void Templates_Main();
void Inheritance_Main();
/*Test Class for Implicit calls*/
class Float
{
int m_Data;
float m_Data1;
p... | true |
932b9639815e61e6155927562ea6d7a9db2df4f6 | C++ | Flakebi/tox4j | /projects/tox4j/src/main/cpp/tox4j/ToxInstances.h | UTF-8 | 6,270 | 2.71875 | 3 | [
"BSD-2-Clause"
] | permissive | #pragma once
#include "util/instance_manager.h"
#include "util/pp_cat.h"
/*****************************************************************************
* Identity and unused-value function.
*/
static auto const identity = [](auto v) { return v; };
template<typename T> static inline void unused (T const &) { }
/... | true |
0bfa13e6d4e3828c5b2dc6793e487866a7d897bc | C++ | foreverlms/solutions | /cpp/src/yitu/first.cpp | UTF-8 | 1,503 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
int m,n;
while (cin>>n>>m)
{
int a[n],c[n];
string b[n];
string judge;
bool d[n];
for (int i = 0; i < n; i++)
{
cin>>a[i]>>b[i]>>c[i];
cin... | true |
e2456f1dea05d16582d9beeca3b2662810f35001 | C++ | aditya0genius/Learn-C- | /Day01/pattern1.cpp | UTF-8 | 326 | 3.03125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int row,column;
cout<<"Enter number of Rows";
cin>>row;
cout<<"Enter number of Columns";
cin>>column;
for(int i=0;i<row;i++) {
for(int j=0;j<column;j++)
{
cout<<"*";
}
cout<<"\n";
}
retur... | true |
71f1073fd986865885865ed4c85173df567ca215 | C++ | pdalaya/arkanoid | /Arkanoid/PlayerRectangle.h | UTF-8 | 951 | 2.953125 | 3 | [] | no_license | #pragma once
#include "Rectangle.h"
namespace Game
{
class PlayerRectangle: public Rectangle
{
private:
sf::Sprite m_sprite;
sf::Vector2f m_velocity;
float m_speed;
//keeps track of which size we are so we don't go overboard. I had first 4 different sizes...but now I only have two so this is probably not n... | true |
6c2bdc059374560ca9d1e5fc681950be8fc20d2e | C++ | MarcusCasey/MultiDemArrays | /CustomList/listN.h | UTF-8 | 904 | 2.921875 | 3 | [] | no_license | /**
* Marcus Casey
* CS202
* Section 1103
*/
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
class ListN;
class Node
{
private:
Node(int, Node*);
int data;
Node* next;
friend class ListN;
friend ostream& operator<<(ostream&, const ListN&);
};
class ListN
{... | true |
48de69aaa6037990489042241fe7d928f0c7dca5 | C++ | Boyzmsc/cpp | /week_3/crossVerHor.cpp | UTF-8 | 1,869 | 2.84375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int sortHigh(int x1, int x2)
{
int max;
if (x1 > x2)
{
max = x1;
}
else
{
max = x2;
}
return max;
}
int sortLow(int x1, int x2)
{
int min;
if (x1 > x2)
{
min = x2;
}
else
{
min = x1;
}
... | true |
f40a8b0c7b12c2c2f00b11a4dfef6edbc9bdc30f | C++ | apervushin/leetcode-cpp | /find_the_city_with_the_smallest_number_of_neighbors_at_a_threshold_distance.cpp | UTF-8 | 1,544 | 3.078125 | 3 | [] | no_license | #include <vector>
#include <climits>
#include <iostream>
using namespace std;
class FindTheCityWithTheSmallestNumberOfNeighborsAtAThresholdDistance {
public:
int findTheCity(int n, vector<vector<int>>& edges, int distanceThreshold) {
vector<vector<long>> distances(n, vector<long>(n, INT_MAX));
fo... | true |
70323eedfb1c7bf3bc4f6c727bfff32e2e3ce179 | C++ | DoumanAsh/c--test-exe | /what_a_nice_day/main.cpp | UTF-8 | 3,552 | 3.796875 | 4 | [
"Apache-2.0"
] | permissive | #include <cassert>
#include <string>
#include <vector>
/**
* Returns whether text is present in dictionary
*
* We could do better with std::string_view
*
* @note assumes no duplicate words are present in dictionary.
*/
static inline size_t look_up_dict(const std::vector<std::string>& dictionary, const std::stri... | true |
bf6fdc14766cb76180fe84dd2c79652316d6d597 | C++ | selonsy/leetcode | /LeetcodeCplusplus/temp/设计模式/策略模式.cpp | UTF-8 | 1,141 | 3.40625 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define free_ptr(p) \
if (p) \
delete p; \
p = NULL;
class IWind
{
public:
virtual ~IWind(){};
virtual void blowWind() = 0;
};
class ColdWind : public IWind
{
public:
void blowWind()
{
cout << "Blowing cold wind!" << endl;
... | true |
5cc5601259e9b47e8ce662ace8ae430f14f58754 | C++ | gabrielgregh1/Algoritmo_Arvore_Binaria | /Algoritmo de Inserção em Arvore.cpp | UTF-8 | 1,838 | 3.546875 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
typedef struct tree{
int info;
struct tree* right;
struct tree* left;
}no;
//RAIZ
no*root = NULL;
void menu();
struct tree *insere(struct tree* raiz,struct tree* aux,int v);
void preOrdem(struct tree *aux);
void inOrdem(struct tree *aux);
void posOrdem(struct tree *aux);
in... | true |
2af8d69f5e4ee671b6101329861e9975909480f1 | C++ | zhyuzhya/oop_labs | /oop_lab_1/Octagon.cpp | UTF-8 | 597 | 3.734375 | 4 | [] | no_license | #include "Octagon.h"
#include <iostream>
#include <cmath>
Octagon::Octagon() : Octagon(0) {
}
Octagon::Octagon(size_t a) : side(a) {
std::cout << "Octagon created with side = " << side << std::endl;
}
Octagon::Octagon(std::istream &is) {
is >> side;
}
Octagon::Octagon(const Octagon& orig) {
std::cout << "Octagon... | true |
958f57e123339245060998be28f2ae7d4b59af38 | C++ | vagnerlands/GameAvatar | /GameAvatar/Application/Utilities/CPngLoader.cpp | UTF-8 | 2,310 | 2.625 | 3 | [] | no_license | #include "CPngLoader.h"
#include "png.h"
CPngLoader::CPngLoader()
{
m_fileContent.status = false;
m_fileContent.width = -1;
m_fileContent.height = -1;
m_fileContent.pPixels = nullptr;
}
CPngLoader::~CPngLoader()
{
if (m_fileContent.status)
{
// frees dynamic allocated memory
for (Int32 __i = 0; __i < m_fi... | true |
5b171db75dd6c2717432408bc7913360d729dda5 | C++ | MonsterLock/MonsterLock | /Unit Test/ML_ArrayList_Test.cpp | UTF-8 | 3,698 | 3.0625 | 3 | [] | no_license | /*
R.A. Bickell [https://github.com/MonsterLock]
ML_ArrayList_Test.cpp Last Updated: 2019-09-19 07::09::07 AM
*/
#include "CppUnitTest.h"
#include "../CoreLibrary/ML_ArrayList.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace UnitTest
{
using namespace ML::DSA;
TEST_CLASS( ArrayListTest )... | true |
de7cc92bc2a8d0db1b8a7edd83644d62639d3af7 | C++ | hyrise/hyrise | /src/lib/operators/import.hpp | UTF-8 | 2,150 | 2.609375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <optional>
#include <string>
#include "abstract_read_only_operator.hpp"
#include "import_export/csv/csv_meta.hpp"
#include "import_export/file_type.hpp"
#include "types.hpp"
#include "SQLParser.h"
namespace hyrise {
/*
* This operator reads a file, creates a table from that input and adds it... | true |
f6a98309eceb4498a3f93b49db4f474904c4f9bf | C++ | jameslarrue/enzo-e | /src/Enzo/enzo_EnzoInitialInclinedWave.cpp | UTF-8 | 31,069 | 2.8125 | 3 | [
"BSD-3-Clause",
"NCSA",
"BSD-2-Clause"
] | permissive | // See LICENSE_CELLO file for license and copyright information
/// @file enzo_EnzoInitialInclinedWave.cpp
/// @author Matthew Abruzzo (matthewabruzzo@gmail.com)
/// @date 2019-04-27
/// @brief Implementation of EnzoInitialInclinedWave for initializing
/// inclined linear MHD waves and inclined ... | true |
6b4daad22da665ad8ea96b8d03e7c427ae6e745d | C++ | robinlzw/Lemon-OS | /Applications/LemonPaint/paint.h | UTF-8 | 1,124 | 2.53125 | 3 | [
"BSD-2-Clause"
] | permissive | #pragma once
#include <lemon/gfx/surface.h>
#include <lemon/gui/widgets.h>
#include <stdint.h>
class Brush{
public:
surface_t data;
void Paint(int x, int y, uint8_t r, uint8_t g, uint8_t b, double scale, class Canvas* canvas);
};
class Canvas : public Lemon::GUI::Widget {
protected:
vector2i_t lastMouse... | true |
c9516b671fd020d58b115b7766bb8e5ed787046a | C++ | willwhitney/kinova-raw | /c++ docs/Examples/Example_MonitoreTemp/src/Example_MonitorTemp.cpp | UTF-8 | 2,948 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <dlfcn.h>
#include <vector>
#include "../../../API/USBCommLayerUbuntu/Projects/Eclipse/Kinova.API.CommLayerUbuntu.h"
#include "../../../API/USBCommandLayerUbuntu/Projects/Eclipse/Kinova.API.UsbCommandLayerUbuntu.h"
#include "../../../API/USBCommandLayerUbuntu/Projects/Eclipse/KinovaTypes.h"... | true |
8c4e651cc4bf20285d81c594567e14701f3c2570 | C++ | viniciusbandeira/Dauphine | /src/Enemy.cpp | UTF-8 | 8,800 | 3 | 3 | [] | no_license | /* Dauphine
* Universidade de Brasília - FGA
* Técnicas de Programação, 2/2017
* @Enemy.cpp
* File responsible for implementing the enemies of the game (except the boss).
* They define the basic image and characteristics of the enemy, upgrade, destruction, collision among others.
* License: Copyright (C) 2014 Alk... | true |
a6c5571036119f714edd7a4683c3677ef4c87aff | C++ | iskislamov/metaprogramming | /task2/Source.cpp | UTF-8 | 1,395 | 2.546875 | 3 | [] | no_license | #include "typelist.h"
#include "hierarchy.h"
#include "fibonacci.h"
#include <typeinfo>
class A {
};
class B : A {
};
using TL1 = TypeList<int>;
using TL2 = TypeList<char, short, std::string>;
using TL3 = TypeList<double, float, float, double, int, char, int, NullType>;
using TL4 = TypeList<long int, std::string,... | true |
64a374a10794394f9663e086ebec7730d17fd46a | C++ | SuHe36/Algorithm | /C++/code/常量/main2.cpp | UTF-8 | 959 | 4.03125 | 4 | [] | no_license | /*
使用const关键字进行修饰
const修饰指针时,有三种情况:
--1, const修饰指针指向的内容,即内容不可变量; 如: const int *p=8;【此时const位于*号的左边】
--2, const修饰指针,即指针为不可变量,但是指针修饰的内容可以改变;如:
int a=8;
int* const p = &a;
*p = 9;//正确
int b=7;
p = &b;//错误
对于const修饰指针,即指针的内存地址不可以改变,但是它修饰的内容可以改变,此时const位于*号的右边;
--3, const修饰指针和指针指向的内容,也就是指针和指针指向的内容都为不... | true |
6433117ea048f2806e7de39258b28280d34b8b9c | C++ | ryanignatius/CPLibrary | /src/dmst.cpp | UTF-8 | 2,613 | 2.9375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long weightType;
const weightType INF = 1e18;
const int MAXN = 1010;
class DMST {
private:
int n, m;
int back[MAXN], label[MAXN], bio[MAXN];
weightType cost[MAXN];
vector<int> x, y;
vector<weightType> w;
public:
DMST(int N, int M) {... | true |
be4449a0c0c8dcc37ee144fa8c62ddc272fb61a7 | C++ | HSchmale16/NumberHunterGame | /src/UI.cpp | UTF-8 | 4,727 | 3.03125 | 3 | [
"CC-BY-3.0"
] | permissive | /** UI Class Implementation
* @author Henry Schmale
* @date October 5, 2014
* @file src/UI.cpp
*/
#include "../include/UI.h"
#include "../FilePaths.h"
#include "../config.h"
#include <stdio.h> // for sprintf
#include <math.h> // for sqrt
UI::UI()
{
//ctor
// load font and bind it to sf::Text Objec... | true |
e9b56e9146bee76ef348c0fb80a796d65ffe17fe | C++ | robinsinghpatiyal/CppCodes | /Array/pair_with_given_diff.cpp | UTF-8 | 682 | 3.03125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void sol(int arr[], int n, int diff)
{
int start = 0;
int end = 1;
sort(arr, arr + n);
int flag = 0;
while (n > 0)
{
if (arr[end] - arr[start] == diff)
{
cout << arr[start] << " " << arr[end] << " " << endl;
f... | true |
a2405451a2a8cb8d6b725940b75d71110c04926f | C++ | scottgw/quicksilver | /runtime/tests/sched_layer/sched_layer.cpp | UTF-8 | 2,195 | 2.671875 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <libqs/sync_ops.h>
#include <libqs/sched_task.h>
#include <internal/executor.h>
#include <internal/task.h>
#define SCHEDULE_MULTIPLE_NUM 1000
int32_t finished;
void
exec_tester(int num_tasks, int num_execs, void (*f)(void*))
{
// volatile means we can ask gdb about it later
volat... | true |
06654f476bda0ab0fa1d3eb82a8ce76cdd650510 | C++ | Wanghailin2019/dataStructureUsingCpp | /chapter7_linked_list/237_circular_linked_list.cpp | UTF-8 | 2,545 | 3.671875 | 4 | [] | no_license | /********************************************************
Filename:237_circular_linked_list.c
Author name: Timothy
Time:2021/08/10
Version:v1
Description:
Creating Circular Header Linked List.
注:代码逻辑有一些问题!
*********************************************************/
# include <s... | true |
86cd972f06f21987ca87edd10951c608551e1eac | C++ | rushioda/PIXELVALID_athena | /athena/ForwardDetectors/FPTracker/src/SimpleLogger.cxx | UTF-8 | 2,958 | 2.515625 | 3 | [] | no_license | /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "FPTracker/SimpleLogger.h"
#include <algorithm>
namespace FPTracker
{
struct Consolidator
{
void operator()( const std::pair< unsigned int, std::string >& element)
{
m_msg += element.second;
}
std::strin... | true |
2ea25da83c47c6912d8747cd22e54ae285e6f348 | C++ | lauralex/Cpp-Experiments | /Experiments/SmartPointer-example/SmartPointer-example.cpp | UTF-8 | 1,238 | 3.6875 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <memory>
#include <string>
#include <utility>
/**
* \brief This is a class using a std::string to allocate memory
*/
class std_string
{
public:
explicit std_string(std::string my_string);
void print() const;
std_string() = delete;
private:
std::string my_string_;
};
std_string::st... | true |
36a7ca567dd58815db013b5a12a607deca11fa2c | C++ | chromium/chromium | /ui/gfx/animation/slide_animation.h | UTF-8 | 4,201 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GFX_ANIMATION_SLIDE_ANIMATION_H_
#define UI_GFX_ANIMATION_SLIDE_ANIMATION_H_
#include "base/memory/raw_ptr.h"
#include "third_party/abseil-cpp/absl/types/optional.h... | true |
4ed1d0444992941e414382f08b18f21eab538569 | C++ | lavalake/myLeetcode | /bitm/reversebit.cpp | UTF-8 | 403 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <stdlib.h>
unsigned int reverseBits(unsigned int num){
int i=0;
int num_bits = sizeof(num) * 8;
int reversed = 0;
for(i=0; i<num_bits; ++i){
if(num & (1<<i))
reversed |= 1<<(num_bits-1-i);
}
return reversed;
}
int main(){
unsigned int input = 121;
int reversed=0;
reversed = re... | true |
76a22200d4b888586916e016556d782f6973960e | C++ | Nemolicious15/Lab10-OOP | /Lab10Matrice/Lab10Matrice/pixelgri.cpp | UTF-8 | 512 | 2.84375 | 3 | [] | no_license | #include "pixelgri.h"
Gri :: Gri() {
gri=0;
}
Gri :: Gri(int g) {
gri=g;
}
Gri :: Gri(Gri& g) {
gri=g.gri;
}
Gri ::~Gri() {
}
void Gri:: setgri(int g){
gri=g;
}
int Gri :: getgri(){
return gri;
}
Gri& Gri :: operator= (const Gri& g){
gri=g.gri;
return* this;
}
bool Gri:: operator== (const Gr... | true |
cc5918affeeefe55e92e7da9f0af410e265544a3 | C++ | danzmoses/cs100-project | /header/prototypes/armor/LeatherArmorPrototype.h | UTF-8 | 769 | 2.90625 | 3 | [] | no_license | #ifndef __LEATHERARMOR_PROTOTYPE__
#define __LEATHERARMOR_PROTOTYPE__
#include "ArmorPrototype.h"
class LeatherArmorPrototype : public ArmorPrototype
{
public:
LeatherArmorPrototype() : ArmorPrototype() {
this->setName("Leather Armor");
this->setCost(50);
baseStats-... | true |
682589c0b9c5e2472f5a8cdc46249d7d04300adc | C++ | Fumikage8/gen7-source | /gflib2/debug/source/DynamicHeader/gfl2_DebugCppEnumHeaderParser.cpp | UTF-8 | 7,427 | 2.703125 | 3 | [] | no_license | //=============================================================================
/**
* @brief ヘッダファイルを解析しEnumの定義を取得するクラスの実装
* @file gfl2_DebugCppEnumHeaderParser.cpp
* @author Kanamaru Masanori
* @date 2015.2.20
*/
//=============================================================================
#include <... | true |
f4ef829a7b8035b25892f763f23f1e9a9f6cb086 | C++ | youoj/Algorithm | /Baekjoon/[10844]쉬운계단수.cpp | UTF-8 | 707 | 3.09375 | 3 | [] | no_license | /* 10844번 쉬운계단수(Dynamic Programming)
* https://www.acmicpc.net/problem/10844
*/
#include <iostream>
#include <vector>
using namespace std;
int main() {
int inputN = 0;
cin >> inputN;
vector<vector<long long> > dp(inputN, vector<long long>(10, 0));
for (int i = 1; i <= 9; i++)
dp[0][i] = 1;
for (int i = 1; ... | true |
c29accfe8aa0f2322faedf8c96bfdb9a0f419169 | C++ | davenguyen19/Data-Structures | /AggregationClasses/drinkItems.cpp | UTF-8 | 947 | 3.359375 | 3 | [] | no_license | #include "drinkItems.h"
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
drinkItems::drinkItems() {
name = " ";
price = 0.0;
quantity = 0;
}
drinkItems::drinkItems(string n, double p, int q) {
name = n;
price = p;
quantity = q;
}
void drinkItems::getItem(string n, double p, ... | true |
06bfa61d711b52b3b1ca2e199212d119721afb5b | C++ | yeireiChen/posd | /105598075_HW6/src/Cmd.cpp | UTF-8 | 37,003 | 2.546875 | 3 | [] | no_license | #include "Cmd.h"
#include <iostream>
#include <cstring>
#include <sstream>
#include <map>
#include <typeinfo>
#include <cxxabi.h>
#include <fstream>
#include "MediaDirector.h"
#include "combMediaBuilder.h"
#include "ShapeMediaBuilder.h"
<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>> origin/master
#include "AreaVisitor.h"
#i... | true |
263b75fb9a241f6883ca64fd3226efd377edf52e | C++ | Uiopio/technicalVision | /ПаньковИС/assignment_2/src/main/morphological_filter.cpp | UTF-8 | 6,860 | 3.125 | 3 | [] | no_license | #include "morphological_filter.h"
using namespace std;
using namespace cv;
void MorphologicalFilter::setStructuringElement(Mat structuringElement)
{
m_structuringElement = binarize(structuringElement);
auto anchor = Point2i(structuringElement.cols / 2, structuringElement.rows / 2);
setAnchor(anchor);
}
M... | true |
3d34f4d17ed7561fdd0826ff537ba91645e9c87d | C++ | Malenczuk/inertia-oplosser | /src/board/Move.h | UTF-8 | 637 | 2.953125 | 3 | [] | no_license | #ifndef DIAMONDSANDMINES_MOVE_H
#define DIAMONDSANDMINES_MOVE_H
struct Position {
int y, x;
};
namespace Movement
{
enum Type {
N = 0,
NE = 1,
E = 2,
SE = 3,
S = 4,
SW = 5,
W = 6,
NW = 7,
};
static const Movement::Type All[] = { N, NE, E... | true |
a15f630da7c9334c0c989aadae54e18d99c2bd18 | C++ | erisonliang/GDIPlusC | /GDI+ C/gdipluspixelformats.cpp | UTF-8 | 530 | 2.703125 | 3 | [] | no_license | #include "stdafx.h"
UINT WINAPI
GetPixelFormatSize(PixelFormat pixfmt)
{
return (pixfmt >> 8) & 0xff;
}
BOOL WINAPI
IsIndexedPixelFormat(PixelFormat pixfmt)
{
return (pixfmt & PixelFormatIndexed) != 0;
}
BOOL WINAPI
IsAlphaPixelFormat(PixelFormat pixfmt)
{
return (pixfmt & PixelFormatAlpha) != 0;
}
BOOL... | true |
b49891029d82200877a4d6056903a578d38f7dde | C++ | JunchenZ/SpaceshipGame | /main.cpp | UTF-8 | 1,370 | 2.8125 | 3 | [] | no_license | //
// main.cpp
// asteroids
//
// Created by Gregory Colledge on 9/19/17.
// Copyright © 2017 Gregory Colledge. All rights reserved.
//
//References:
// for sort algorithm - https://stackoverflow.com/questions/4892680/sorting-a-vector-of-structs
//for input/output - http://www.cplusplus.com/doc/tutorial/files/
//fo... | true |
146aa07b470c634cfa3bd5be8db323708e81ca5b | C++ | slowriot/voro-- | /branches/dynamic/examples/dynamic/square_test.cc | UTF-8 | 1,712 | 3.03125 | 3 | [
"BSD-3-Clause-LBNL",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Voronoi calculation example code
//
// Author : Chris H. Rycroft (LBL / UC Berkeley)
// Email : chr@alum.mit.edu
// Date : July 1st 2008
#include "voro++.cc"
#include "dynamic.cc"
// Set up constants for the container geometry
const fpoint x_min=-5,x_max=5;
const fpoint y_min=-5,y_max=5;
const fpoint z_mi... | true |
ce16a08aac1333bd9d2868c74adb8d66e714f3e8 | C++ | GunnDawg/Gunngine3D | /G3D/src/Engine/G3D_Mouse.cpp | UTF-8 | 999 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | #include "G3D_Mouse.h"
namespace G3D
{
bool Mouse::Initialize()
{
RAWINPUTDEVICE rid;
ZeroMemory(&rid, sizeof(RAWINPUTDEVICE));
rid.usUsagePage = 0x01;
rid.usUsage = 0x02;
rid.dwFlags = 0u;
rid.hwndTarget = 0u;
if (!RegisterRawInputDevices(&rid, 1, sizeof(rid)))
{
MessageBox(nullptr, "Error regis... | true |
a5c03391ef075d19c8c1a7f378bc140d6e4b880a | C++ | barchinsky/2d-world | /dev/Moon.cpp | UTF-8 | 657 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include "Moon.hpp"
#include "math.h"
Moon::Moon() // init moon
{
moonT.loadFromFile("moon.png");
moonT.setSmooth(1);
moon = sf::Sprite(moonT);
currX = -200.;
currY = 50;
h = 0.8;
}
sf::Sprite Moon::getMoon() // return moon-object
{
return moon; // return Moon sprite
}... | true |
d20321ef23ba4107ce8c3488d21a17d03864f13c | C++ | siddharthtejas/HackerRankCodes | /Diagonal Difference.cpp | UTF-8 | 593 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n][n];
int i,j;
int sum=0,sum2=0;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
cin>>arr[i][j];
}
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
... | true |
0b4acd47d7b06c1fb7f2f38622c38a743bb38505 | C++ | DrBit/Seed-Counter | /XYfuntcions.ino | UTF-8 | 10,493 | 2.828125 | 3 | [] | no_license | // ************************************************************
// ** INIT FUNCTIONS
// ************************************************************
// ***********************
// ** Physical limits of the motors
// ***********************
// Init the both axes at the same time to save time.
#define max_insensor_steps... | true |
8f589d3ac70c28320e3f1d3a525d459c700a3f7a | C++ | sunilkrg/TheCPSquad | /Sahil Rana/Arrays/Valid_Sudoko.cpp | UTF-8 | 1,049 | 2.796875 | 3 | [] | no_license | class Solution {
public:
bool isValidSudoku(vector<vector<char>>& board) {
unordered_set<string> StringSet;
for(int i=0;i<9;i++){
for(int j=0;j<9;j++){
if(board[i][j]!='.'){
string s(1,board[i][j]);
string s1=s+"found in row"+to... | true |
1e91a1aaa2782cd009820efc0e96874e6978a24d | C++ | panm111/oF_S16 | /Week_2_Homework/src/ofApp.cpp | UTF-8 | 3,413 | 2.640625 | 3 | [] | no_license | #include "ofApp.h"
void ofApp::pentogon(int px1, int py1, int px2, int py2, int px3, int py4, int px5, int py5){
//Line 1
ofLine(px1, py1, px2, py2);
//Line 2
ofLine(px2, py2, px3, py3);
//Line 3
ofLine(px3, py3, px4, py4);
//Line 4
ofLine(px4, py4, px5, py5);
//Line 5
ofLine(p... | true |
2980c02c9f9da111e4a90324fb814ec646a8458b | C++ | hossainmurad/mycppcgi | /base/utility/General.cpp | UTF-8 | 163 | 2.546875 | 3 | [] | no_license | #include "General.h"
void parse_path_info(string& s){
for (int i = 0; i< s.size() ; ++i)
switch(s[i]){
case '/':
s[i] = ' ';
break;
}
}
| true |
6ac993aa34aaa945430b834e557fae0f9ee69b04 | C++ | Connor-F/ncurses_snake | /Snake.cpp | UTF-8 | 2,875 | 3.515625 | 4 | [] | no_license | #include "Snake.h"
#include "Window.h"
Snake_Segment& Snake::get_segment(std::vector<Snake_Segment>::size_type index) // todo: remove?
{
return snake.at(index);
}
/*
* allows user to get the front (head)
* of the snake
* return: the Snake_Segment at the front of the snake
*/
Snake_Segment& Snake::get_front()... | true |
0a90534677ded0c87ba8107f4b686a182d1df9cc | C++ | sgondala/Compilers | /Part3/classes.hpp | UTF-8 | 11,593 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <stdio.h>
using namespace std;
class abstract_astnode
{
public:
virtual void print () = 0;
};
class ExpAst : public abstract_astnode {
public:
void print ();
};
class StmtAst : public abstract_astnode {
public:
void print ();
};
class ForAst: public StmtAs... | true |
97c32654bc85872d3dbce079c0c0009ca047e8f6 | C++ | bcumming/tracey | /src/id.hpp | UTF-8 | 599 | 2.515625 | 3 | [] | no_license | #pragma once
#include <atomic>
#include <mutex>
#include <string_view>
#include <unordered_map>
#include <vector>
#include <tracey/tracey.hpp>
namespace tracey {
class id_dictionary {
public:
trace_id lookup(std::string_view name);
std::string name(trace_id id) const;
std::size_t size() const;
std::... | true |
25125577ac9f2ee0778cc12d58930555427e62c4 | C++ | oaleshina/pscx_emulator | /pscx_emulator/pscx_disc.h | UTF-8 | 3,866 | 2.796875 | 3 | [] | no_license | #pragma once
#include <fstream>
#include "pscx_minutesecondframe.h"
// Size of a CD sector in bytes.
const size_t SECTOR_SIZE = 2352;
// CD-ROM sector sync pattern: 10 0xff surrounded by two 0x00. Not
// used in CD-DA audio tracks.
const uint8_t SECTOR_SYNC_PATTERN[] = {
0x00,
0xff, 0xff, 0xff, 0xff, 0xff,
0xff,... | true |
d3dc1727b68364ac878a52b4642b202916abe43c | C++ | pwnlogs/EasyNetIITM | /mainwindow.cpp | UTF-8 | 4,926 | 2.578125 | 3 | [] | no_license | /*
* Project name hardcoded in function "on_approve_b_clicked"
*/
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QSettings>
#include <QTime>
#include "python2.7/Python.h"
#include <stdlib.h>
// Testing pupose libs
#include <QtDebug>
#include <QDir>
int vaildate(QString password,... | true |
100ec1eeb73b06612cff4032e5c65ce4c869b443 | C++ | Yapami/playground | /template-specialization/TemplateSpecialization.cpp | UTF-8 | 879 | 3.59375 | 4 | [] | no_license | #include <gmock/gmock.h>
#include <gtest/gtest.h>
class TemplateSpecialization : public testing::Test
{
public:
enum class Digits
{
ONE,
TWO,
THREE,
};
template<Digits>
uint32_t digit()
{
throw std::runtime_error("Wrong enum value");
return 0;
}
};
... | true |
f2da08a5217c3fda55212e3a90ac7f57decde542 | C++ | weininglee/CPP_HW | /CS1010301HW04/TS0404/BankAccount.h | UTF-8 | 628 | 3.3125 | 3 | [] | no_license | static int total = 0;
class BankAccount {
private:
int balance;
public:
BankAccount();
BankAccount(int input);
void withdraw(int output);
void save(int input);
int getBalance();
static int getAllMoneyInBank();
};
BankAccount::BankAccount() {
balance = 0;
total += balance;
}
BankAccount::BankAccount(int input... | true |
f166fad2d52e956f524281771dad79b32dccb521 | C++ | edgar2020/colaborative_labs_and_assignments_CS10C | /Assignments/simpleDataCompression/HashTable.cpp | UTF-8 | 2,743 | 3.640625 | 4 | [] | no_license | #include "HashTable.h"
#include "WordEntry.h"
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
/* HashTable constructor
* input s is the size of the array
* set s to be size
* initialize array of lists of WordEntry
*/
HashTable::HashTable (int s) {
// 1) Create an array of Word E... | true |
838c5e6d60f018099f4fa3f1979f1894f5fbf4fb | C++ | davjd/fantasy_ball | /src/team_fetcher.h | UTF-8 | 1,712 | 2.609375 | 3 | [] | no_license | #ifndef TEAM_FETCHER_H_
#define TEAM_FETCHER_H_
#include "curl_fetch.h"
#include "util.h"
#include <nlohmann/json.hpp>
#include <string>
#include <vector>
namespace fantasy_ball {
class TeamFetcher {
public:
struct GameMatchup {
GameMatchup() = default;
std::string home_team;
int home_team_id;
std:... | true |
9104f647caebb0de2608d3ca5b0a777ef858b15a | C++ | sprinfall/opengl-study | /tutorials/07_rotation/07_rotation.cpp | UTF-8 | 3,038 | 2.6875 | 3 | [
"MIT"
] | permissive | #include <cmath>
#include <cstdio>
#include <string>
#include <GL/glew.h>
#include <GL/freeglut.h>
#include "ogldev_math_3d.h"
#include "utility.h"
// 这个例子与 06_translation 几乎一样,除了矩阵不同。
GLuint g_vbo;
GLuint g_world_location;
static void RenderSceneCB() {
glClear(GL_COLOR_BUFFER_BIT);
static float scale = 0.0f;... | true |
b7a883c427928069af7be6eb46a493bf3fb39b1b | C++ | Phantsure/algo-rythm-urf-algorithm | /graph/c++/dijkstra.cpp | UTF-8 | 2,225 | 3.796875 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class DirectedGraph
{
typedef vector< vector < pair<int, long long> > > AdjList;
int V; // Number of vertices
AdjList adjList;
public:
DirectedGraph(int V);
void addEdge(int u, int v, long long w);
// Finds the shortest path from source to... | true |
53d0bfce0d6c0670a06271e9238b03b693c9e959 | C++ | Lee-Seungwook/Cetc | /vs/C++/projects/PersonEx0408/pointerex0415/pointerex0415.cpp | UTF-8 | 1,886 | 2.75 | 3 | [] | no_license | // pointerex0415.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
int a = 7, b = 8;
int* pa = 0; //포인터 변수의 크기는 무조건 4바이트
pa = &a;
int* pb = &b;
char str[4] = "box";
char* pt = str;
for (int i = 0; i <= 3; i++)
cout << "pt[" << i... | true |
2ada223d66477d58706c95c57223e1cc8378b569 | C++ | lxdfigo/Leetcode | /Maximum Depth of Binary Tree.h | UTF-8 | 762 | 3.25 | 3 | [] | no_license | #include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
void depth_iteration(TreeNode *node,int depth, int &maxdepth)
{
if (depth > maxdepth) maxdepth = depth;
... | true |
9bc001bc757afb17185934e68c52e2c0607a36ff | C++ | C-Smith-UALR/C.Smith.2376.Class.Practice | /CS.Class.Practice/Source.cpp | UTF-8 | 1,389 | 2.859375 | 3 | [] | no_license | /*
Clark Smith
CPSC 2376
July 25, 2018
A program that creates a "ward" of patients and obtains and displays objective data.
*/
#include <iostream>
#include "WardPatient.h"
enum VITALS {
HEART_RATE,
RESP_RATE,
SYS_BP,
DIA_BP,
SATS,
VITAL_COUNT
};
int main() {
std::string fileName = "vitals.txt";
enum CHOI... | true |
fa93c3d35418daff9d100e2d0e5a464c9eb1ceb9 | C++ | RickSteman/EPO-4-A05 | /Module-3/carmodel/rir_generator_x.cpp | UTF-8 | 17,866 | 2.5625 | 3 | [] | no_license | /*
Program : Room Impulse Response Generator
Description : Function for simulating the impulse response of a specified
room using the image method [1,2].
[1] J.B. Allen and D.A. Berkley,
Image method for efficiently simulating small-room Acoustics,
Journal... | true |
6029915bf36164ce0a8ba5df0bfeeaf7e89724b6 | C++ | cxvisa/Wave | /C++/source/Framework/Types/WorldWideName.h | UTF-8 | 2,223 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /***************************************************************************
* Copyright (C) 2005-2010 Vidyasagara Guntaka *
* All rights reserved. *
* Author : Vidyasagara Reddy Guntaka *
***********... | true |
f8d82d01898c5539591434fe64f074e64f856110 | C++ | Roboticsotago/robotics_repo | /Projects/2016/MIDIBots/arduino/midi_keyboard/midi_keyboard.ino | UTF-8 | 3,691 | 3.125 | 3 | [] | no_license | // A simple MIDI keyboard for Arduino
// CME 2016-03
// This polls for input switch states and outputs MIDI note on/off messages when they change, i.e. when a switch is pressed/released.
// We reserve a block of contiguous input pins to keep the code simple and scalable.
// To monitor MIDI messages:
// aseqdump -p 20... | true |
93a8c2062b0d47440a61103ca94b98279abdcdce | C++ | SergeyStrukov/CCore-3-xx | /Applied/CCore/test/test3019.IntegerSlowMul.cpp | UTF-8 | 3,085 | 2.859375 | 3 | [
"FTL",
"BSL-1.0"
] | permissive | /* test3019.IntegerSlowMul.cpp */
//----------------------------------------------------------------------------------------
//
// Project: CCore 2.00
//
// Tag: Applied
//
// License: Boost Software License - Version 1.0 - August 17th, 2003
//
// see http://www.boost.org/LICENSE_1_0.txt or the local copy... | true |
552cb747ef35ff046c8270789ace7c167815b43e | C++ | alucchi/al-raytracer | /ase.h | UTF-8 | 8,359 | 2.640625 | 3 | [] | no_license | /**
* File : ase.cpp
* Description : Import of 3ds models.
*
* Author(s) : This file has been downloaded from www.GameTutorials.com
* Date of creation : 21/02/2008
* Modification(s) :
*/
#ifndef _ASE_H
#define _ASE_H
#include "Maths/Vector2.h"
#include "Maths/Vector3.h"
#include <GL/gl.h> ... | true |
7fd29049adc5e9821840c143dfc6eadd65ffe818 | C++ | nsudhanva/competetive | /HackerRank/Algorithms/Implementation/array.cpp | UTF-8 | 282 | 3.09375 | 3 | [
"Unlicense"
] | permissive | #include<iostream>
using namespace std;
int main()
{
int a[] = {1, 7, 2, 4};
for(int i = 0; i < 4; i ++){
for(int j = i + 1; j < 4; j++){
cout << a[i] << " + " << a[j] << " = " << a[i] + a[j] << endl;
}
//cout << a[i] << endl;
}
}
| true |
46ae6eac4110f9b1468ebb3e5c91629423de722e | C++ | Omnibusangie/notes.1 | /A3/tryout 3.10.cpp | UTF-8 | 330 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
cout << "Please enter an integer: ";
int number;
cin >> number;
srand(number);
int randnum_1 = (rand() % 200 + 1), randnum_2 = (rand() % 200 + 1);
cout << "randnum_1: " << randnum_1 << ", randnum_2: " << randnum_2 << "." << endl;
retu... | true |
8bd5c543080ab2049d3f5cd44253a1bbc65bd907 | C++ | infotraining/cpp-17-2020-12-14 | /string-view/tests.cpp | UTF-8 | 2,351 | 3.71875 | 4 | [] | no_license | #include <algorithm>
#include <numeric>
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <string_view>
#include "catch.hpp"
using namespace std;
TEST_CASE("string_view")
{
SECTION("creation")
{
const char* cstr = "text";
std::string_view sv1 = cstr;
R... | true |
65514660f8a1fb32cb99869fa72d1fc2d787316f | C++ | E-gy/parc24 | /src/test/grammar/quotexpando.cpp | UTF-8 | 2,162 | 3.0625 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | #include <catch2ext.hpp>
using Catch::Matchers::Equals;
extern "C" {
#include <grammar/quotexpando.h>
#include <util/null.h>
}
SCENARIO("word capture", "[word][lexer]"){
GIVEN("empty string") THEN("no capture") REQUIRE(capture_word("") == nullstr);
GIVEN("plain simple word followed by weird things"){
auto word = ... | true |
9fd389ce341ac656960181bbe9be429aee3c16f4 | C++ | duckhee/opencv_study | /chapter4/ex4-3/ex4_3.cpp | UTF-8 | 791 | 2.546875 | 3 | [] | no_license | #include "opencv2/opencv.hpp"
using namespace cv;
using namespace std;
int main()
{
Mat srcImage = imread("../lena.jpg", IMREAD_GRAYSCALE);
if(srcImage.empty())
{
printf("not image.\r\n");
return -1;
}
Mat dstImage = Mat::zeros(srcImage.rows, srcImage.cols, srcImage.type());
... | true |
0cb3ccc3971f302a9cd5d91ed6649f9aa5a6a856 | C++ | BelongAl/RSA-encryption-algorithm | /bigint.h | GB18030 | 804 | 2.9375 | 3 | [] | no_license | #pragma once
#include<string>
#include<utility>//pairͷļ
#include<iostream>
class BigInt
{
std::string m_number;
public:
BigInt(const std::string&num) :
m_number(num)
{}
BigInt(const int num)
{}
BigInt() = default;
BigInt operator+(BigInt &bi);
BigInt operator-(BigInt &bi);
BigInt operator*(BigInt &bi);
... | true |
628e3b4786b05a44e3a969bdc43998ec49d96e16 | C++ | Brandon-Ashworth/Physics-Simulation | /A star working demo/aStar/aStar/aStar/NavMesh.h | UTF-8 | 1,586 | 2.671875 | 3 | [] | no_license | #pragma once
#include "as_node.h"
#include <iostream>
#include <vector>
#include <stack>
class NavMesh
{
public:
NavMesh(void);
~NavMesh(void);
//precalls, must be called before init call
void setNavSize(int size);
//the world position stuff will be included later
//setFisrtPos
//setNodeGap
//precall gets
... | true |
1942361401266372d6df966cd22d3ac2abad5da2 | C++ | AlanGarduno/Estructuras-de-datos | /Estructuras y varios/b-busquedasec.cpp | UTF-8 | 6,982 | 2.875 | 3 | [] | no_license | #include <stdlib.h>
#include<stdio.h>
using namespace std;
struct lista{
int dato;
int busqueda=0;
struct lista *apunt;
};
typedef struct lista *Tlista;
void lista_opciones();
void insertarFinal(Tlista &lista, int datoa);
int insertarAntesDespues(int a);
void insertarInicio(Tlista &lista, int dat... | true |