repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
Fossegrimen/advent-of-code
day05b.cpp
#include <algorithm> #include <iostream> #include <string> #include <vector> typedef std::vector<size_t> Vector; int main() { Vector seatIds; std::string line; while (std::cin >> line) { size_t row = 0; size_t column = 0; for (size_t i = 0; i < 7; i++) { ...
Fossegrimen/advent-of-code
day10a.cpp
#include <algorithm> #include <iostream> #include <vector> typedef std::vector<size_t> joltageRatingList; int main() { joltageRatingList joltageRatings; joltageRatings.push_back(0); size_t joltageRating; while (std::cin >> joltageRating) { joltageRatings.push_back(joltageRating); } ...
Fossegrimen/advent-of-code
day13a.cpp
#include <algorithm> #include <cmath> #include <iostream> #include <limits> #include <sstream> #include <string> #include <vector> typedef std::vector<size_t> Vector; int main() { Vector busIds; std::string line; std::getline(std::cin, line); const size_t timeToLeave(stol(line)); std::getline(...
Fossegrimen/advent-of-code
day22a.cpp
#include <algorithm> #include <cstdlib> #include <deque> #include <iostream> #include <vector> typedef std::deque<size_t> PlayerCards; void getPlayerCards(PlayerCards& playerCards); bool playGame(PlayerCards& player1Cards, PlayerCards& player2Cards); int main() { PlayerCards player1Cards; PlayerCards player...
Fossegrimen/advent-of-code
day14a.cpp
#include <iostream> #include <string> #include <unordered_map> typedef std::unordered_map<uint64_t, uint64_t> MemoryMap; int main() { MemoryMap memoryMap; std::string mask; std::string line; while (std::getline(std::cin, line)) { size_t pos = line.find('='); if (pos == std::str...
Fossegrimen/advent-of-code
day06a.cpp
<reponame>Fossegrimen/advent-of-code<gh_stars>0 #include <iostream> #include <string> #include <unordered_set> int main() { std::unordered_set<char> charSet; size_t sum = 0; std::string line; while (std::getline(std::cin, line)) { if (line.empty()) { sum += charSe...
Fossegrimen/advent-of-code
day20b.cpp
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> enum Side { Left = 0, Right = 1, Upper = 2, Lower = 3 }; class Tile; class TileHandler; typedef std::vector<Tile*> TileTranslations; typedef std::vector<std::vector<Tile*>> Tiles; typedef std::...
Fossegrimen/advent-of-code
day22b.cpp
<filename>day22b.cpp #include <algorithm> #include <cstdlib> #include <deque> #include <iostream> #include <vector> typedef std::deque<size_t> PlayerCards; void getPlayerCards(PlayerCards& playerCards); bool playGame(PlayerCards& player1Cards, PlayerCards& player2Cards); int main() { PlayerCards player1Cards; ...
Fossegrimen/advent-of-code
day05a.cpp
#include <algorithm> #include <iostream> #include <string> int main() { size_t highestSeatId = 0; std::string line; while (std::cin >> line) { size_t row = 0; size_t column = 0; for (size_t i = 0; i < 7; i++) { if (line[i] == 'B') { ...
Fossegrimen/advent-of-code
day02b.cpp
<gh_stars>0 #include <iostream> #include <string> int main() { size_t valid = 0; char tempChar; size_t posA; size_t posB; char character; std::string password; while (std::cin >> posA && std::cin >> tempChar && std::cin >> posB && ...
Fossegrimen/advent-of-code
day21b.cpp
#include <iostream> #include <map> #include <sstream> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> typedef std::map<std::string, std::string> AllergenFoodMap; typedef std::unordered_map<std::string, size_t> IndexMap; typedef std::vector<std::unordered_set<size_t>> AllergenFood...
Fossegrimen/advent-of-code
day16a.cpp
<reponame>Fossegrimen/advent-of-code<filename>day16a.cpp #include <iostream> #include <regex> #include <sstream> #include <string> #include <vector> typedef std::vector<std::vector<size_t>> Rules; void readRules(Rules& rules); bool isValid(const Rules& rules, const size_t value); int main() { Rules rules; r...
Fossegrimen/advent-of-code
day17a.cpp
#include <algorithm> #include <iostream> #include <string> #include <vector> #define MAX_ROUNDS 6 #define MAX_WIDTH 8 #define MAX_Z ((2 * MAX_ROUNDS) + 1) #define MAX_Y (MAX_WIDTH + (2 * MAX_ROUNDS) + 1) #define MAX_X MAX_Y #define ORIGO_Z MAX_ROUNDS #define ORIGO_Y ((MAX_WIDTH / 2) + MAX_ROUNDS) #define ORIGO_X OR...
Fossegrimen/advent-of-code
day15a.cpp
<gh_stars>0 #include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> struct Record { size_t record1; size_t record2; }; int main() { std::vector<Record> spokenNumberVector(30000001, {0, 0}); size_t lastSpokenNumber; size_t round = 1; std::string line; ...
Fossegrimen/advent-of-code
day24a.cpp
<gh_stars>0 #include <iostream> #include <numeric> #include <sstream> #include <vector> #define MAX_WIDTH 60 #define MAX_R MAX_WIDTH #define MAX_Q MAX_R #define ORIGO_R (MAX_WIDTH / 2) #define ORIGO_Q ORIGO_R typedef std::vector<std::vector<size_t>> HexagonGrid; int main() { HexagonGrid hexagonGrid; hexag...
Fossegrimen/advent-of-code
day03a.cpp
#include <iostream> #include <string> #include <vector> typedef std::vector<std::string> Matrix; int main() { Matrix map; std::string line; while (std::cin >> line) { map.push_back(line); } const size_t width = map[0].size(); const size_t height = map.size(); size_t x ...
Fossegrimen/advent-of-code
day23b.cpp
#include <iostream> #include <vector> int main() { std::vector<size_t> cupVector(1000000); for (size_t i = 0; i < 1000000; i++) { cupVector[i] = i + 1; } char tempChar; size_t amountOfChars = 0; ssize_t previousCup = 0; ssize_t startCup = -1; while (std::cin >> te...
Fossegrimen/advent-of-code
day11b.cpp
#include <algorithm> #include <iostream> #include <string> #include <vector> typedef std::vector<std::vector<char>> SeatMatrix; size_t getOccupiedAdjacentSeats(const SeatMatrix& seatMatrix, const size_t y, const size_t x); bool isOccupiedInLine(const SeatMatrix& currentRound, const ssize_t y, const ssize_t x, cons...
Fossegrimen/advent-of-code
day23a.cpp
<reponame>Fossegrimen/advent-of-code<filename>day23a.cpp #include <iostream> #include <vector> int main() { std::vector<size_t> cupVector(9); char tempChar; ssize_t previousCup = 0; ssize_t startCup = -1; while (std::cin >> tempChar) { size_t value = tempChar - '0' - 1; ...
Fossegrimen/advent-of-code
day19a.cpp
#include <iostream> #include <regex> #include <sstream> #include <string> #include <unordered_map> typedef std::vector<char> RegexVector; typedef std::unordered_map<size_t, std::vector<ssize_t>> RuleMap; typedef std::unordered_map<size_t, char> LetterMap; const RegexVector getRegex(RuleMap& ruleMap, LetterMap& lette...
Fossegrimen/advent-of-code
day04a.cpp
#include <iostream> #include <sstream> #include <string> #include <unordered_map> typedef std::unordered_map<std::string, std::string> Passport; bool isValidPassport(const Passport& passport); int main() { Passport passport; size_t valid = 0; std::string line; while (std::getline(std::cin, ...
Fossegrimen/advent-of-code
day18a.cpp
#include <iostream> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> typedef std::queue<char> OutputQueue; typedef std::stack<char> OperatorStack; typedef std::vector<char> TokenList; void shuntingYardAlgorithm(const TokenList& tokens, OutputQueue& outputQueue); uint64_t...
appplemac/envoy
test/common/config/delta_subscription_impl_test.cc
#include "test/common/config/delta_subscription_test_harness.h" using testing::AnyNumber; using testing::InSequence; using testing::UnorderedElementsAre; namespace Envoy { namespace Config { namespace { class DeltaSubscriptionImplTest : public DeltaSubscriptionTestHarness, public testing::Test { protected: void de...
appplemac/envoy
source/common/config/delta_subscription_state.cc
#include "common/config/delta_subscription_state.h" namespace Envoy { namespace Config { DeltaSubscriptionState::DeltaSubscriptionState(const std::string& type_url, const std::set<std::string>& resource_names, SubscriptionCa...
appplemac/envoy
source/extensions/filters/network/kafka/request_codec.cc
<reponame>appplemac/envoy #include "extensions/filters/network/kafka/request_codec.h" #include "common/buffer/buffer_impl.h" #include "common/common/stack_array.h" #include "absl/strings/string_view.h" namespace Envoy { namespace Extensions { namespace NetworkFilters { namespace Kafka { class RequestStartParserFact...
3imed-jaberi/mesh-computer-graphics-university-project
source/app/main.cpp
// // ************************************************************* // * <NAME> : https://github.com/3imed-jaberi * // * <NAME> : https://github.com/YassineOmrani * // ************************************************************* // #include<stdlib.h> #include<GL/glut.h> // OpenGL Graphics Utility Library #inc...
arturtelus/RGL
src/rgl_shader_program.cpp
#include "rgl_shader_program.h" #include<vector> #ifdef DEBUG #include<iostream> #endif #include "rgl_shader.h" namespace rgl { GLint ShaderProgram::GetProgramParam(const GLuint name, const GLenum pname) noexcept { GLint param{}; glGetProgramiv(name, pname, &param); return param; } GLuint ShaderProgram::Cr...
arturtelus/RGL
src/rgl_objects.cpp
<reponame>arturtelus/RGL #include "rgl_objects.h" #ifdef DEBUG #include<iostream> #endif namespace rgl { void GenerateGLObjects(const GLenum object_type, const GLsizei array_size, GLenum* array_ptr) noexcept { switch (object_type) { case GL_BUFFER: glGenBuffers(array_size, array_ptr); #ifdef DEBUG std::...
arturtelus/RGL
src/rgl_shader.cpp
<gh_stars>0 #include "rgl_shader.h" #include<vector> #include<string> #ifdef DEBUG #include<iostream> #endif namespace rgl { GLint Shader::GetShaderParam(const GLuint name, const GLenum pname) noexcept { GLint param{}; glGetShaderiv(name, pname, &param); return param; } GLuint Shader::CreateShader(const GL...
arturtelus/RGL
src/rgl_loader.cpp
#include "rgl_loader.h" #include<GL/glew.h> #ifdef DEBUG #include<iostream> #endif // GL_DEBUG namespace rgl { void LoadGLExtensions() { if (GLenum err{ glewInit() }; err != GLEW_OK) { throw std::runtime_error("GLEW failed to initialize!"); } #ifdef DEBUG if (GLEW_VERSION_4_3) { glEnable(GL_DEBUG_O...
arturtelus/RGL
src/rgl_name.cpp
<filename>src/rgl_name.cpp #include "rgl_name.h" namespace rgl { GLName::GLName(GLuint gl_name) : name_{ gl_name } { } GLName::~GLName() { name_ = GLuint{}; } GLName::GLName(GLName&& other) noexcept : name_{ other.name_ } { other.name_ = GLuint{}; } GLName& GLName::operator=(GLName&& other) noexce...
electricsohan/C-solution
Solutions/positiveOrNegative.cpp
<reponame>electricsohan/C-solution #include <stdio.h> void main() { int num; printf("Enter a number :"); scanf("%d", &num); if (num >= 0) printf("%d is a positive number \n", num); else printf("%d is a negative number \n", num); }
electricsohan/C-solution
Solutions/quickSort.cpp
#include<stdio.h> void quicksort(int number[25],int first,int last){ int i, j, pivot, temp; if(first<last){ pivot=first; i=first; j=last; while(i<j){ while(number[i]<=number[pivot]&&i<last) i++; while(number[j]>number[pivot]) j--; if(i<j...
bincrafters/conan-boost_spirit
test_package/test_package.cpp
<filename>test_package/test_package.cpp #include <boost/spirit/include/qi_rule.hpp> int main() { boost::spirit::qi::rule<char const*> test; }
Bl4d3666/InstallerFileTakeOver
InstallerFileTakeOver/InstallerDispatcher.cpp
<reponame>Bl4d3666/InstallerFileTakeOver<gh_stars>1000+ #include "InstallerDispatcher.h" #include <Windows.h> #include <strsafe.h> #include <Objbase.h> #include "resource.h" #include <string> #include <sddl.h> #include <vector> struct Internal { WCHAR* targetdir; WCHAR* msi_pkg; }; bool InternalRecursiv...
rctaudio/PAC193X
Microchip_PAC193x.cpp
<filename>Microchip_PAC193x.cpp<gh_stars>0 /*********************************************************** This is a library for Microchip PAC193x © 2020 Microchip Technology Inc. and its subsidiaries. Subject to your compliance with these terms, you may use Microchip software and any derivatives of thi...
lansty/mycode
testprogram/Untitled1.cpp
<filename>testprogram/Untitled1.cpp<gh_stars>0 #include<stdio.h> #include<assert.h> int main(void) { int i = 2; int *p = NULL; int select = 0; scanf("%d",&select); if(select == 1) p = &i; else p = NULL; assert(p); printf("this is test program!"); return 0; }
daodaoliang/QtAwesome-1
QtAwesomeSample/main.cpp
/** * MIT Licensed * * Copyright 2011-2015 - Reliable Bits Software by Blommers IT. All Rights Reserved. * Author <NAME> */ #include "QtAwesome.h" #include <QApplication> #include <QMainWindow> #include <QPushButton> int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow w; Qt...
konstantinosbaktalias/math-interpreter
main.cpp
<filename>main.cpp #include "interpreter.hpp" int main() { string input; while(true) { cout << "-> "; getline(cin, input); vector<Token> tokens = Tokenizer(input); Parser parser(tokens); Token *root = parser.parse(); cout << Interpreter(root) << endl; } ...
konstantinosbaktalias/math-interpreter
parser.hpp
<filename>parser.hpp #include "tokenizer.hpp" // PARSER class Parser { public: vector<Token> tokens{}; Token *root; Token *curr_token; int idx = 0; // Initializer Parser(vector<Token> _tokens) { tokens = _tokens; root = &tokens[0]; curr_token = ...
konstantinosbaktalias/math-interpreter
tokenizer.hpp
#include <iostream> #include <string> #include <vector> using namespace std; // TYPES int NUMBER = 1; int ADDITION = 2; int SUBTRACTION = 3; int MULTIPLICATION = 4; int DIVITION = 5; int OPEN_PAREN = 6; int CLOSE_PAREN = 7; // TOKEN STRUCT struct Token { int type = 0; float value = 0; Token *left = NULL;...
konstantinosbaktalias/math-interpreter
interpreter.hpp
<gh_stars>0 #include "parser.hpp" double Interpreter(Token *root) { // If leaf node is reached return value (All leaf nodes are numbers) if(root -> type == NUMBER) { return root -> value; } // Check for addition parent if(root -> type == ADDITION) { return Interpreter(root ...
ide0330/taskflow
taskflow/mytaskflow/sample3.cpp
<reponame>ide0330/taskflow<gh_stars>0 #include "../taskflow.hpp" // For Work B int mult(int x, int y){ return x * y; } // For Work C int add(int x, int y){ return x + y; } // For Work D int divs(int x, int y){ return x / y; } // For Work main() int sub(int x, int y){ return x - y; } int main(){ tf::Taskf...
ide0330/taskflow
taskflow/mytaskflow/test.cpp
<reponame>ide0330/taskflow #include "../taskflow.hpp" int main(){ tf::Taskflow tf; auto [A, B, C, D, E] = tf.emplace( [] () {}, [] () {}, [] () {}, [] () {}, [] () {} ); A.precede(B, C, E); C.precede(D); B.precede(D, E); A.name("A"); B.na...
ParadoxChains/uwu-cpp
src/uwutrans.cpp
<reponame>ParadoxChains/uwu-cpp #include <iostream> #include <string> #include "uwulib.h" int main(int argc, char** argv) { // Initiate a variable to store input std::string stringToTranslate; // Check if we have arguments to be translated. if( argc < 2 ) { // We greet the user std::cout << "Welcome to the ...
sumersingla/Algorithms
Sorting/Bubble Sort/C++/bubble_sort.cpp
<gh_stars>0 /* Bubble Sort implementation in C++ * Author : <NAME> * Input : array length and elements * Output : Sorted array elements */ #include <iostream> using namespace std; void bubble_Sort(int a[],int n) { for(int i=0; i<n-1; ++i) { for(int j=0; j<n-i-1; ++j) { if(a[j] > a[j+1]) { sw...
olivier-le-sage/avr-chiptune
chiptune.cpp
/* A brief program that plays a pre-written chiptune on an ATtiny10. * The music is played with a piezoelectric sensor (buzzer). * * Fits into 1024 bytes of program memory and 32 bytes of SRAM, so it should work on * virtually any AVR microprocesor with the same architecture. * * References: ATtiny4/5/9/10 Data...
olivier-le-sage/avr-chiptune
frequency_cycle.cpp
#include <inttypes.h> #include <avr/io.h> #include <util/delay.h> #include <util/atomic.h> #define CLKDIV1 0b001 /* clk prescaler setting for clk/1 */ #define CLKDIV8 0b010 /* clk prescaler setting for clk/8 */ #define CLKDIV64 0b011 /* clk prescaler setting for clk/64 */ #define CLKDIV256 0b100 /* clk presc...
5x/WinAPIApplicationExamples
WAPIA1/WAPIA1.cpp
#include <windows.h> DWORD StrLen(const WCHAR str[]); HANDLE hIn, hOut; SHORT CONST bufSize = 255; DWORD ConsoleIn(LPVOID str) { DWORD strLen; ReadConsole(hIn, str, bufSize, &strLen, nullptr); return strLen; } void ConsoleOut(LPVOID str, DWORD len) { WriteConsole(hOut, str, len, null...
5x/WinAPIApplicationExamples
WAPIA1.2/WAPIA1.2.cpp
#include <windows.h> #include <tchar.h> int main() { SetConsoleTitle(_T("WAPIA1.2")); STARTUPINFO SupIn; PROCESS_INFORMATION PrIn; ZeroMemory(&SupIn, sizeof(SupIn)); SupIn.cb = sizeof(SupIn); ZeroMemory(&PrIn, sizeof(PrIn)); WCHAR path[] = _T("WAPIA1.1"); SupIn.lpTitl...
5x/WinAPIApplicationExamples
WIAPIA4/WIAPIA4.cpp
<gh_stars>0 #include <windows.h> #include <tchar.h> struct WndAttr { LPCWSTR windowClassName; LPCWSTR windowTitleName; UINT style; SIZE size; POINT startPosition; }; //Forward declarations of functions LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); HWND ...
5x/WinAPIApplicationExamples
WAPIA2/WAPIA2.cpp
<reponame>5x/WinAPIApplicationExamples #include <windows.h> #include <tchar.h> #include <iostream> #include "strsafe.h" using namespace std; BOOL CreateTreeDirectory(const wchar_t* path) { TCHAR tPath[MAX_PATH]; _tcsncpy_s(tPath, path, sizeof(tPath)); for (TCHAR* p = tPath; *p; p++) { i...
5x/WinAPIApplicationExamples
WAPIA1.1/WAPIA1.1.cpp
#include <windows.h> #include <tchar.h> HANDLE hIn; HANDLE hOut; void print(LPCWSTR str) { WriteConsole(hOut, str, _tcslen(str), nullptr, nullptr); } int main() { FlushConsoleInputBuffer(hIn); hIn = GetStdHandle(STD_INPUT_HANDLE); hOut = GetStdHandle(STD_OUTPUT_HANDLE); print(_T("...
5x/WinAPIApplicationExamples
WAPIA3/WAPIA3.cpp
<reponame>5x/WinAPIApplicationExamples #include <windows.h> #include <conio.h> #include <iostream> #define N 4 #define notSelected 7 #define titleY 10 HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); void setCarret(int x, int y, int color) { COORD Coord = { x, y }; SetConsoleCursorPosition(hOut, Co...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/util/ExtractChannelFilter.cpp
#include "ExtractChannelFilter.h" template <typename inputImageT, typename outputImageT> ExtractChannelFilter<inputImageT, outputImageT>::ExtractChannelFilter() { } template <typename inputImageT, typename outputImageT> void ExtractChannelFilter<inputImageT, outputImageT>::setImputImage(inputImageP inputImage) { ...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/main.cpp
#include <iostream> #include <memory> #include <cinttypes> #include <cstring> //local includes #include "core/PreProcessor.h" #include "core/BoundariesExtractor.h" #include "core/FeatureExtractor.h" #include "core/Trainer.h" #include "core/Tester.h" #include "core/ShowPrediction.h" #include "core/Pipe.h" /* */ ...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/core/BoundariesExtractor.cpp
#include "BoundariesExtractor.h" BoundariesExtractor::BoundariesExtractor() { } void BoundariesExtractor::SetInputDatasetPath(const std::string& dataSetPath) { InputDatasetPath = (*dataSetPath.rbegin() == '/') ? dataSetPath.substr(0, dataSetPath.length()-1) : dataSetPath; } void BoundariesExtractor::SetOutputDa...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/core/FeatureExtractor.cpp
#include "FeatureExtractor.h" FeatureExtractor::FeatureExtractor() { } std::string FeatureExtractor::deleteSlash(std::string const& path) { return (*path.rbegin() == '/') ? path.substr(0, path.length()-1) : path; } /* Boundaries muts be binary images with background value equals to zero and foreground 255 */ v...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/ex/ex.cc
#include "itkSmoothingRecursiveGaussianImageFilter.h" #include "itkImage.h" #include "itkImageFileReader.h" #include "itkImageFileWriter.h" int main(int argc, char * argv[]){ if (argc != 3){ std::cerr << "Usage: " << std::endl; std::cerr << argv[0] << " <InputImageFile> <OutputImageFile> <sigma>" << std::end...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/core/PreProcessor.cpp
#include "PreProcessor.h" PreProcessor::PreProcessor() { } void PreProcessor::SetInputDatasetPath(const std::string& dataSetPath) { InputDatasetPath = (*dataSetPath.rbegin() == '/') ? dataSetPath.substr(0, dataSetPath.length()-1) : dataSetPath; } PreProcessor::GrayImageP PreProcessor::HistogramEqualization(Gra...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/core/Trainer.cpp
<filename>sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/core/Trainer.cpp #include "Trainer.h" Trainer::Trainer() { } void Trainer::ReadFeaturesCSV(const std::string& fileName, unsigned featuresBeginIndex, unsigned featuresEndIndex, ...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/core/Tester.cpp
#include "Tester.h" Tester::Tester() { } void Tester::ReadLearnedFunction(const std::string& fileName) { dlib::deserialize(fileName)>>LearnedFunction; } void Tester::ReadFeaturesCSV(const std::string& fileName, unsigned imageColumn, unsigned centerBegin,...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/core/ShowPrediction.cpp
#include "ShowPrediction.h" ShowPrediction::ShowPrediction() { } void ShowPrediction::ReadCSV(const std::string& fileName, unsigned imageNameIndex, unsigned centerColIndex, unsigned centerRowIndex, un...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/util/ColorConverterFilter.cpp
<gh_stars>0 #include "ColorConverterFilter.h" template <typename inputImageT, typename outputImageT> ColorConverterFilter<inputImageT, outputImageT>::ColorConverterFilter() { white = Illuminant::getWhitePoint(Illuminant::index::d65); } template <typename inputImageT, typename outputImageT> void ColorConverterF...
ivarvb/LPC
sourcecode/src/vx/radpleura/import/algorithms/cc/PleuraSegmentation/util/FractalDimensionCalculator.cpp
#include "FractalDimensionCalculator.h" template <typename ImageT> FractalDimensionCalculator<ImageT>::FractalDimensionCalculator() { } template <typename ImageT> void FractalDimensionCalculator<ImageT>::SetInputImage(const ImageP& InputImage) { this->InputImage = nullptr; this->InputImage = InputImage; } ...
JRY-Zheng/ligral
code/main.cc
/* Copyright (C) 2019-2021 <NAME>. Home page: https://junruoyu-zheng.gitee.io/ligral Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ #include <iostream> #include <Eigen/Dense> using Eigen::Matrix; #include "config.h" int main() { Matrix<double...
JRY-Zheng/ligral
code/config.cc
#include "config.h" Vector f(Vector x) { // Eigen::MatrixXd A(2, 2); // A << 0, 1, -0.2, -0.5; // return A*x; Vector xdot; constant_struct<2,1> constant1; constant1.value << 1, -2; integrator_struct<2,1,2> integrator1; integrator1.initial << 0, 0; integrator1.states = &x; inte...
wds15/stan
src/stan/analyze/mcmc/compute_effective_sample_size.hpp
<gh_stars>0 #ifndef STAN_ANALYZE_MCMC_COMPUTE_EFFECTIVE_SAMPLE_SIZE_HPP #define STAN_ANALYZE_MCMC_COMPUTE_EFFECTIVE_SAMPLE_SIZE_HPP #include <stan/math/prim/mat/fun/Eigen.hpp> #include <stan/analyze/mcmc/autocovariance.hpp> #include <stan/analyze/mcmc/split_chains.hpp> #include <algorithm> #include <cmath> #include <v...
wds15/stan
src/test/unit/lang/generator/generate_new_model_test.cpp
#include <stan/lang/ast_def.cpp> #include <stan/lang/generator.hpp> #include <test/unit/lang/utility.hpp> #include <gtest/gtest.h> #include <iostream> #include <sstream> TEST(langGenerator, generateNewModel) { stan::lang::program prog; std::string model_name = "m"; std::stringstream code_stream; stan::io::pro...
wds15/stan
src/test/unit/mcmc/hmc/nuts/base_nuts_test.cpp
<reponame>wds15/stan #include <test/unit/mcmc/hmc/mock_hmc.hpp> #include <stan/callbacks/stream_logger.hpp> #include <stan/mcmc/hmc/nuts/base_nuts.hpp> #include <stan/mcmc/hmc/integrators/expl_leapfrog.hpp> #include <vector> #include <boost/random/additive_combine.hpp> #include <gtest/gtest.h> typedef boost::ecuyer198...
wds15/stan
src/test/integration/mtu/model.cpp
#include <stan/model/model_header.hpp>
wds15/stan
src/stan/analyze/mcmc/split_chains.hpp
<filename>src/stan/analyze/mcmc/split_chains.hpp #ifndef STAN_ANALYZE_MCMC_SPLIT_CHAINS_HPP #define STAN_ANALYZE_MCMC_SPLIT_CHAINS_HPP #include <cmath> #include <vector> #include <algorithm> namespace stan { namespace analyze { /** * Splits each chain into two chains of equal length. When the * number of to...
wds15/stan
src/test/unit/lang/ast/node/idx_ast_test.cpp
#include <stan/lang/ast_def.cpp> #include <stan/lang/generator.hpp> #include <gtest/gtest.h> #include <cmath> #include <sstream> #include <string> #include <set> #include <vector> using stan::lang::idx; using stan::lang::uni_idx; using stan::lang::omni_idx; using stan::lang::expression; using stan::lang::int_literal; ...
wds15/stan
src/stan/lang/grammars/semantic_actions_def.cpp
#ifndef STAN_LANG_GRAMMARS_SEMANTIC_ACTIONS_DEF_CPP #define STAN_LANG_GRAMMARS_SEMANTIC_ACTIONS_DEF_CPP #include <stan/io/program_reader.hpp> #include <stan/lang/ast.hpp> #include <stan/lang/grammars/iterator_typedefs.hpp> #include <stan/lang/grammars/semantic_actions.hpp> #include <boost/algorithm/string.hpp> #inclu...
wds15/stan
src/stan/lang/generator/generate_model_name_method.hpp
<filename>src/stan/lang/generator/generate_model_name_method.hpp<gh_stars>0 #ifndef STAN_LANG_GENERATOR_GENERATE_MODEL_NAME_METHOD_HPP #define STAN_LANG_GENERATOR_GENERATE_MODEL_NAME_METHOD_HPP #include <stan/lang/ast.hpp> #include <stan/lang/generator/constants.hpp> #include <ostream> #include <string> namespace sta...
wds15/stan
src/stan/analyze/mcmc/autocovariance.hpp
<gh_stars>1-10 #ifndef STAN_ANALYZE_MCMC_AUTOCOVARIANCE_HPP #define STAN_ANALYZE_MCMC_AUTOCOVARIANCE_HPP #include <stan/math/prim/mat/fun/Eigen.hpp> #include <stan/math/prim/mat.hpp> #include <unsupported/Eigen/FFT> #include <complex> #include <vector> namespace stan { namespace analyze { /** * Write autocorrel...
wds15/stan
src/test/unit/analyze/mcmc/split_chains_test.cpp
#include <stan/mcmc/chains.hpp> #include <stan/analyze/mcmc/split_chains.hpp> #include <stan/io/stan_csv_reader.hpp> #include <gtest/gtest.h> #include <fstream> #include <sstream> class SplitChains : public testing::Test { public: void SetUp() { blocker1_stream.open("src/test/unit/mcmc/test_csv_files/blocker.1.c...
wds15/stan
src/test/unit/lang/parser/ode_test.cpp
#include <gtest/gtest.h> #include <test/unit/lang/utility.hpp> TEST(lang_parser, integrate_ode_good) { test_parsable("ode_good"); test_parsable("integrate_ode_rk45"); test_parsable("integrate_ode_bdf"); test_parsable("integrate_ode_adams"); } TEST(lang_parser, integrate_ode_bad) { test_throws("ode/bad_fun_ty...
wds15/stan
src/test/unit/model/model_base_test.cpp
<reponame>wds15/stan #include <gtest/gtest.h> #include <stan/model/model_base.hpp> #include <ostream> #include <stdexcept> #include <string> #include <utility> #include <vector> struct mock_model : public stan::model::model_base { mock_model(size_t n) : model_base(n) { } virtual ~mock_model() { } std::string m...
wds15/stan
src/test/unit/lang/generator/generate_quoted_test.cpp
#include <stan/lang/generator.hpp> #include <test/unit/lang/utility.hpp> #include <gtest/gtest.h> #include <sstream> void test_generate_quoted_string(const std::string& s, const std::string& quoted_s) { std::stringstream ss; stan::lang::generate_quoted_string(s, ss); EXPECT_EQ(qu...
WeHaveCookie/VacuumCleaner
Classes/Level/Level.cpp
#include "stdafx.h" #include "Level.h" #include "Entity/Entity.h" #include "Manager/Render/RenderMgr.h" #include "Manager/File/FileMgr.h" #include "../../External/rapidjson/document.h" #include "Utils/jsonUtils.h" #include "Manager/Entity/EntityMgr.h" #include "Utils/containerUtils.h" void Background::paint() { auto ...
WeHaveCookie/VacuumCleaner
Classes/Manager/Game/GameMgr.cpp
<filename>Classes/Manager/Game/GameMgr.cpp #include "stdafx.h" #include "GameMgr.h" #include "EtherealEngineManagers.h" #include "Manager/Input/InputMgr.h" #include "Manager/Entity/EntityMgr.h" #include "Manager/Sound/SoundMgr.h" #include "Thread/LoadingThread.h" #include "Manager/Persistent/PersistentMgr.h" #include "...
WeHaveCookie/VacuumCleaner
Classes/Manager/Input/InputMgr.cpp
<reponame>WeHaveCookie/VacuumCleaner #include "stdafx.h" #include "InputMgr.h" #include "EtherealEngineManagers.h" #include "Manager/Render/RenderMgr.h" #include "Manager/File/FileMgr.h" #include "Manager/Action/CommandMgr.h" #include "Manager/Game/GameMgr.h" #include "Actions/Command.h" #include "../../External/rapidj...
WeHaveCookie/VacuumCleaner
Classes/Manager/Entity/EntityMgr.cpp
<reponame>WeHaveCookie/VacuumCleaner #include "stdafx.h" #include "EntityMgr.h" #include "../../External/rapidjson/document.h" #include "Entity/EntityPool.h" #include "Manager/Loading/LoadingMgr.h" #include "Manager/File/FileMgr.h" #include "Manager/Physic/PhysicMgr.h" #include "Utils/wcharUtils.h" #include "Manager/I...
WeHaveCookie/VacuumCleaner
Classes/Manager/Level/LevelMgr.cpp
<filename>Classes/Manager/Level/LevelMgr.cpp #include "stdafx.h" #include "LevelMgr.h" #include "Level/Quadtree.h" #include "Manager/Game/GameMgr.h" #include "Manager/Render/RenderMgr.h" #include "Level/Level.h" #include "Manager/File/FileMgr.h" #include "Utils/wcharUtils.h" LevelMgr* LevelMgr::s_singleton = NULL; Le...
WeHaveCookie/VacuumCleaner
Classes/Manager/Loading/LoadingMgr.cpp
<reponame>WeHaveCookie/VacuumCleaner #include "stdafx.h" #include "LoadingMgr.h" #include "Entity/Entity.h" #include "Manager/Entity/EntityMgr.h" #include "Thread/LoadingThread.h" #define INVALID_SYNC_COUNTER_ID -1 LoadingMgr* LoadingMgr::s_singleton = NULL; uint32_t LoadingTask::newUID = 0; LoadingMgr::LoadingMgr()...
WeHaveCookie/VacuumCleaner
Classes/Actions/CommandMove.cpp
#include "stdafx.h" #include "CommandMove.h" #include "Entity/Entity.h" #include "Manager/Game/GameMgr.h" void CommandMove::init(Entity* ent, void* data) { Command::init(ent); m_motion = *static_cast<Vector2*>(data); free(data); } void CommandMove::execute() { Entity* entity = getEntity(); m_lastPosition = entit...
WeHaveCookie/VacuumCleaner
Classes/Entity/EntityPool.cpp
#include "stdafx.h" #include "EntityPool.h" #include "Manager/Physic/PhysicMgr.h" #include "Manager/Level/LevelMgr.h" #include "Manager/Input/InputMgr.h" #include "Thread/LoadingThread.h" #include "Utils/containerUtils.h" EntityPool::EntityPool(int size) :m_poolSize(size) { m_entitys.reserve(size); for (int i = 0; ...
stephanroslen/FTXUI
src/ftxui/component/dropdown.cpp
<filename>src/ftxui/component/dropdown.cpp<gh_stars>0 #include "ftxui/component/component.hpp" #include "ftxui/component/component_base.hpp" #include "ftxui/component/event.hpp" namespace ftxui { Component Dropdown(ConstStringListRef entries, int* selected) { class Impl : public ComponentBase { public: Impl(...
stephanroslen/FTXUI
src/ftxui/dom/box_helper.hpp
#ifndef FTXUI_DOM_BOX_HELPER_HPP #define FTXUI_DOM_BOX_HELPER_HPP #include <vector> namespace ftxui { namespace box_helper { struct Element { // Input: int min_size = 0; int flex_grow = 0; int flex_shrink = 0; // Output; int size = 0; }; void Compute(std::vector<Element>* elements, int target_size); }...
stephanroslen/FTXUI
src/ftxui/dom/gridbox_test.cpp
<reponame>stephanroslen/FTXUI #include <gtest/gtest-message.h> // for Message #include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult #include <algorithm> // for remove #include <string> // for allocator, basic_string, string #include <vector> ...
stephanroslen/FTXUI
src/ftxui/component/show.cpp
#include "ftxui/component/component_base.hpp" Component Maybe(Component child, bool* show) { class Impl : public ComponentBase { public: Impl(Component child, bool* show) : ComponentBase(child), show_(show) {} private: Element Render() override { if (*show_) return ComponentBase::Render(...
stephanroslen/FTXUI
src/ftxui/dom/separator.cpp
<gh_stars>0 #include <memory> // for make_shared #include <string> // for string #include "ftxui/dom/elements.hpp" // for Element, separator #include "ftxui/dom/node.hpp" // for Node #include "ftxui/dom/requirement.hpp" // for Requirement #include "ftxui/screen/box.hpp" // for Box #include "ftxui/...
stephanroslen/FTXUI
src/ftxui/component/maybe.cpp
<filename>src/ftxui/component/maybe.cpp #include "ftxui/component/component.hpp" #include "ftxui/component/component_base.hpp" #include "ftxui/component/event.hpp" namespace ftxui { Component Maybe(Component child, bool* show) { class Impl : public ComponentBase { public: Impl(bool* show): show_(show) {} ...
stephanroslen/FTXUI
examples/dom/border_style.cpp
<gh_stars>1000+ #include <ftxui/dom/elements.hpp> // for text, operator|, vbox, border, Element, Fit, hbox #include <ftxui/screen/screen.hpp> // for Full, Screen #include <iostream> #include <memory> // for allocator #include "ftxui/dom/node.hpp" // for Render #include "ftxui/screen/box.hpp" // for ftxui int m...
CSUF-CPSC120-2019F23-24/project01-TommyLe3825
main.cpp
<filename>main.cpp // Name: <NAME> // This program calculates and displays business expenses. #include <iostream> int main() { std::string business_location; int trip_days; //amount of days we use be on your trip double hotel_expenses, meal_expenses, total_all; std::cout << "Welcome to the Business Trip Tra...
fossabot/substrate-1
impl/console.cxx
<filename>impl/console.cxx // SPDX-License-Identifier: BSD-3-Clause #include <cerrno> #ifndef _WINDOWS # include <unistd.h> #else # define WIN32_LEAN_AND_MEAN # include <windows.h> # include <stringapiset.h> # include <fcntl.h> # include <io.h> # undef WIN32_LEAN_AND_MEAN # include <substrate/utility> #endif #include <...
fossabot/substrate-1
test/mmap.cxx
<reponame>fossabot/substrate-1 // SPDX-License-Identifier: BSD-3-Clause #include <substrate/mmap> #include <substrate/memfd> #include <substrate/fd> #include <catch.hpp> #include <cstring> using substrate::mmap_t; using substrate::memfd_t; using substrate::fd_t; TEST_CASE("Anonymous map test", "[mmap_t]") { memfd_t...
fossabot/substrate-1
test/units.cxx
<gh_stars>0 // SPDX-License-Identifier: BSD-3-Clause #include <cstdint> #include <substrate/units> #include <catch.hpp> using substrate::operator ""_KiB; using substrate::operator ""_MiB; using substrate::operator ""_GiB; using substrate::operator ""_TiB; using substrate::operator ""_PiB; using substrate::operator ""...
fossabot/substrate-1
test/socket.cxx
<gh_stars>0 // SPDX-License-Identifier: BSD-3-Clause #ifndef _MSC_VER #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h> #else #include <Winsock2.h> #endif #include <cstring> #include <substrate/socket> #include <catch.hpp> using substrate::socket_t; using substrate::socketType_t; using substrate::...