repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
fossabot/substrate-1
test/span.cxx
#include <substrate/span>
fossabot/substrate-1
test/fixed_vector.cxx
// SPDX-License-Identifier: BSD-3-Clause #include <cstring> #include <substrate/fixed_vector> #include <catch.hpp> using substrate::fixedVector_t; using substrate::vectorStateException_t; template<typename T, typename E> void testThrowsExcept(T &vec, const char *const errorText) { try { int value = vec[2]; (voi...
fossabot/substrate-1
test/memfd.cxx
// SPDX-License-Identifier: BSD-3-Clause #include <cstdint> #include <cstring> #include <memory> #include <array> #include <substrate/memfd> #include <substrate/utility> #include <catch.hpp> using substrate::memfd_t; using substrate::make_unique; constexpr static std::array<char, 4> testArray{'t', 'E', 'S', 't'}; con...
fossabot/substrate-1
impl/pty.cxx
<filename>impl/pty.cxx #include <cstdlib> #include <fcntl.h> #include <array> #include <substrate/pty> using substrate::pty_t; pty_t::pty_t() noexcept : ptyMaster{[]() noexcept -> fd_t { fd_t result = posix_openpt(O_RDWR | O_NOCTTY); if (result.valid() && (grantpt(result) || unlockpt(result))) return {}; r...
fossabot/substrate-1
test/string.cxx
<reponame>fossabot/substrate-1 // SPDX-License-Identifier: BSD-3-Clause #include <cstring> #include <substrate/string> #include <catch.hpp> using substrate::stringDup; using substrate::stringsLength; using substrate::stringConcat; static const std::string string = "This is only a test"; TEST_CASE("string raw dup", "...
fossabot/substrate-1
test/test.cxx
// SPDX-License-Identifier: BSD-3-Clause #ifdef _WINDOWS #include <cstdlib> #include <crtdbg.h> #endif #define CATCH_CONFIG_RUNNER #include <catch.hpp> #ifdef _WINDOWS void invalidHandler(const wchar_t *, const wchar_t *, const wchar_t *, const uint32_t, const uintptr_t) { } #endif int main(int argCount, char **argLi...
toniminh161200/Operation_System
LAB1/Linux/testforkbomb.cpp
<reponame>toniminh161200/Operation_System #include <unistd.h> #include <cstdlib> //#include <windows.h> int main(void){ while(1){ system("ps -e | wc -l >> result.txt"); fork(); } return 0; }
toniminh161200/Operation_System
LAB1/Windows/testforkbombwin.cpp
<reponame>toniminh161200/Operation_System #include <windows.h> #include <stdio.h> #include <tchar.h> #include <psapi.h> #include <iostream> int main(int argc, char **argv){ FILE* ptr; ptr = fopen("log_win.txt","w"); STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory(&si,sizeof(si)); si.cb = sizeof(si); while(1){...
kfechter/Yoga-Mode-Daemon
src/yoga-mode-switch.cpp
<reponame>kfechter/Yoga-Mode-Daemon #include <X11/extensions/XInput2.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xresource.h> #include <X11/Xatom.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <syslog.h> #include <signal.h> #include <string.h> #include <fcntl.h> #include <errno...
zzzzz1st/Calculator
model.cpp
#include "model.h" Model::Model(int c) : column(c){ dataset = new float[column]; for (int j = 0 ; j < column ; j++){ dataset[j]=0; } } Model::~Model(){ delete [] dataset; } float Model::getDataset(int i){ return dataset[i]; } void Model::setDataset(int i, float v) { dataset[i] = v; ...
zzzzz1st/Calculator
median.cpp
<gh_stars>0 #include "median.h" Median::Median(Model *m, QLabel *v){ model = m; model->addObserver(this); qlabel = v; } void Median::update(){ float tmp = calculate(); qlabel->setNum(tmp); } float Median::calculate(){ std::vector <float> vtmp; int column = model->getColumn(); fo...
zzzzz1st/Calculator
main.cpp
<gh_stars>0 #include "calculator.h" #include <QApplication> #include <QTableWidgetItem> #include <QInputDialog> #include <QMessageBox> #include <max.h> #include <min.h> #include <sum.h> #include <median.h> int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setWindowIcon(QIcon(":/images/calculator_...
zzzzz1st/Calculator
calculator.cpp
<filename>calculator.cpp #include "calculator.h" #include "ui_calculator.h" #include<QObject> Calculator::Calculator(Controller *c, QWidget *parent) : QMainWindow(parent) , ui(new Ui::Calculator) , controller(c) { ui->setupUi(this); qmax = (ui->maxValue); qmin = (ui->minValue); ...
zzzzz1st/Calculator
controller.cpp
<filename>controller.cpp<gh_stars>0 #include <controller.h> Controller::Controller(Model *modelmax, Model *modelmin, Model *modelsum, Model *modelmedian){ models.push_back(modelmax); models.push_back(modelmin); models.push_back(modelsum); models.push_back(modelmedian); } void Controller::itemChanged(Q...
zzzzz1st/Calculator
unit/tst_calculatortest.cpp
#include <QtTest/QtTest> #include <calculator.h> #include <QStatusBar> class CalculatorTest : public QObject { Q_OBJECT private slots: void test_case1(); void test_case2(); void test_case3(); void test_case4(); void test_case5(); void test_case6(); void test_case7(); void test_case8...
zzzzz1st/Calculator
min.cpp
#include "min.h" Min::Min(Model *m, QLabel *v){ model = m; model->addObserver(this); qlabel = v; } void Min::update() { float m = calculate(); qlabel->setNum(m); } float Min::calculate(){ int column = model->getColumn(); float m = model->getDataset(0); for (int j = 0; j < colum...
zzzzz1st/Calculator
sum.cpp
<gh_stars>0 #include "sum.h" Sum::Sum(Model *m, QLabel *v){ model = m; model->addObserver(this); qlabel = v; } void Sum::update(){ float sum = calculate(); qlabel->setNum(sum); } float Sum::calculate(){ float sum = 0; int column = model->getColumn(); for (int j = 0 ; j < colum...
zzzzz1st/Calculator
max.cpp
#include "max.h" Max::Max(Model *m, QLabel *v){ model = m; model->addObserver(this); qlabel = v; } void Max::update(){ float m = calculate(); qlabel->setNum(m); } float Max::calculate(){ float m = model->getDataset(0); int column = model->getColumn(); for (int j = 0; j < colum...
nanguantong/owt-server
source/agent/addons/quic/WebTransportFrameDestination.cc
<gh_stars>0 /* * Copyright (C) 2021 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include "WebTransportFrameDestination.h" using v8::Function; using v8::FunctionTemplate; using v8::Local; using v8::Object; using v8::ObjectTemplate; using v8::Value; DEFINE_LOGGER(WebTransportFrameDestination, "Web...
nanguantong/owt-server
source/core/owt_base/MediaFramePipeline.cpp
// Copyright (C) <2019> Intel Corporation // // SPDX-License-Identifier: Apache-2.0 #include "MediaFramePipeline.h" namespace owt_base { FrameSource::~FrameSource() { { boost::upgrade_lock<boost::shared_mutex> lock(m_audio_dests_mutex); for (auto it = m_audio_dests.begin(); it != m_audio_dests.en...
nanguantong/owt-server
source/agent/addons/quic/RtpFactory.cc
<gh_stars>0 /* * Copyright (C) 2021 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include "RtpFactory.h" #include "VideoRtpPacketizer.h" #include "test/FakeVideoRtpPacketizer.h" DEFINE_LOGGER(RtpFactoryBase, "RtpFactoryBase"); class RtpFactoryDefault : public RtpFactoryBase { public: RtpFacto...
nanguantong/owt-server
source/agent/addons/internalIO/InternalClientWrapper.cc
// Copyright (C) <2021> Intel Corporation // // SPDX-License-Identifier: Apache-2.0 #ifndef BUILDING_NODE_EXTENSION #define BUILDING_NODE_EXTENSION #endif #include "InternalClientWrapper.h" using namespace v8; DEFINE_LOGGER(InternalClient, "InternalClientWrapper"); Nan::Persistent<Function> InternalClient::constru...
nanguantong/owt-server
source/agent/addons/quic/VideoRtpPacketizer.cc
<reponame>nanguantong/owt-server<gh_stars>0 /* * Copyright (C) 2021 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include "VideoRtpPacketizer.h" DEFINE_LOGGER(VideoRtpPacketizer, "VideoRtpPacketizer"); VideoRtpPacketizer::VideoRtpPacketizer() : m_rtcAdapter(std::unique_ptr<rtc_adapter::RtcAda...
MrSquanchee/dev-embox
project/opencv/cmds/imagecapture.cpp
#include <vector> #include <unistd.h> #include <iostream> #include "opencv2/core/utility.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/video.hpp" #include "opencv2/videoio.hpp" #include <stdio.h> #include <vector> #include <drivers/video/fb.h>...
nishaque/lab-02-cache
sources/CacheInfo.cpp
// // Copyright [2020] <<NAME>> // #include "CacheInfo.hpp" const int intsize = 4; const int numIter = 1000; const int cacheLine = 16; CacheInfo::CacheInfo() { sizeOfBuf = std::vector<int>(); for (int i = 64; i <= 4096; i *= 2) { sizeOfBuf.push_back(i * intsize); } sizeOfBuf.push_back(2048 * 3 * intsize);...
nishaque/lab-02-cache
include/CacheInfo.hpp
// // Copyright [2020] <<NAME>> // #ifndef INCLUDE_CACHEINFO_HPP_ #define INCLUDE_CACHEINFO_HPP_ #include <algorithm> #include <chrono> #include <cstdlib> #include <iostream> #include <random> #include <string> #include <vector> class CacheInfo { private: std::vector<int> sizeOfBuf; int k; public: CacheInfo(...
andrmr/cpp_thread_pool
Test.cpp
#include "ThreadPool.h" #include <iostream> auto free_func(int a, int b, int c) { return a + b + c; } auto lambda_func = [](auto&&... args) -> typename std::common_type<decltype(args)...>::type { return (args + ...); }; struct Pod { auto mem_func(int a, int b, int c) { retu...
ska-telescope/ska-sdp-idg-bench
app/lib-cuda.hpp
<reponame>ska-telescope/ska-sdp-idg-bench #pragma once #include "lib-common.hpp" namespace cuda { extern void extern_print_device_info(); extern std::string extern_get_device_name(); void print_benchmark(); void p_run_vadd(); void c_run_vadd(std::vector<float> &a, std::vector<float> &b, std::vector<...
ska-telescope/ska-sdp-idg-bench
app/HIP/kernels/vadd.hip.cpp
<reponame>ska-telescope/ska-sdp-idg-bench #include "util.hip.hpp" namespace hip { __global__ void kernel_vadd(float *a, float *b, float *c, int size) { int i = blockDim.x * blockIdx.x + threadIdx.x; if (i < size) { c[i] = a[i] + b[i]; } } void p_run_vadd() { unsigned long size = get_env_var("VADD_SIZE",...
ska-telescope/ska-sdp-idg-bench
app/common/common.hpp
<reponame>ska-telescope/ska-sdp-idg-bench<filename>app/common/common.hpp #pragma once #include <algorithm> #include <cmath> #include <complex> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <numeric> #include <random> #include <string> #include <vector> #incl...
ska-telescope/ska-sdp-idg-bench
tests/test_util.hpp
<reponame>ska-telescope/ska-sdp-idg-bench void fill_vector_rand(std::vector<float> &v) { srand(time(0)); generate(v.begin(), v.end(), rand); } template <typename T> void print_vector(std::vector<T> v) { for (const auto e : v) { std::cout << e << std::endl; } } template <typename T> std::vector<T> copy_vec...
ska-telescope/ska-sdp-idg-bench
tests/c_degridder_reference.cpp
<reponame>ska-telescope/ska-sdp-idg-bench #include "lib-cpu.hpp" #if defined(BUILD_CUDA) #include "lib-cuda.hpp" #elif defined(BUILD_HIP) #include "lib-hip.hpp" #endif #include "test_util.hpp" int main() { std::cout << ">>> Correctness IDG-Degridder test" << std::endl; #if defined(BUILD_CUDA) cuda::extern_print_...
ska-telescope/ska-sdp-idg-bench
app/HIP/util.hip.hpp
#pragma once #include "lib-common.hpp" #include <hip/hip_runtime.h> #if defined(ENABLE_POWERSENSOR) && defined(__HIP_PLATFORM_NVIDIA__) #include <powersensor/NVMLPowerSensor.h> #elif defined(ENABLE_POWERSENSOR) && defined(__HIP_PLATFORM_AMD__) #include <powersensor/ROCMPowerSensor.h> #endif namespace hip { #define ...
ska-telescope/ska-sdp-idg-bench
app/common/types.hpp
#pragma once #include <complex> #include <cstring> #include <memory> #ifndef IDG_TYPES_H_ #define IDG_TYPES_H_ namespace idg { typedef struct { int x, y, z; } Coordinate; typedef struct { unsigned int station1, station2; } Baseline; typedef struct { int baseline_offset; int time_offset; int nr_timesteps;...
ska-telescope/ska-sdp-idg-bench
app/CPU/kernels/degridder_reference.cpp
#include "../common/math.hpp" #include "util.hpp" namespace cpu { void kernel_degridder_reference(int nr_subgrids, int grid_size, int subgrid_size, float image_size, float w_step_in_lambda, int nr_channels, int nr_stations, idg:...
ska-telescope/ska-sdp-idg-bench
app/HIP/util.hip.cpp
#include "util.hip.hpp" namespace hip { std::string extern_get_device_name() { return get_device_name(); } void extern_print_device_info() { print_device_info(); } void print_benchmark() { std::cout << ">>> HIP IDG BENCHMARK" << std::endl; } } // namespace hip
ska-telescope/ska-sdp-idg-bench
app/common/parameters.hpp
#pragma once #define NR_CORRELATIONS 4 #define IMAGE_SIZE 0.01f #define W_STEP 0
ska-telescope/ska-sdp-idg-bench
app/common/common.cpp
#include "common.hpp" unsigned roundToPowOf2(unsigned number) { double logd = log(number) / log(2); logd = floor(logd); return (unsigned)pow(2, (int)logd); } unsigned long get_env_var(const char *env_var, unsigned long default_value) { if (const char *env_p = std::getenv(env_var)) { return atoi(env_p); ...
ska-telescope/ska-sdp-idg-bench
app/common/init.hpp
<reponame>ska-telescope/ska-sdp-idg-bench<gh_stars>0 #pragma once #include <cassert> #include "parameters.hpp" #include "types.hpp" void initialize_uvw(unsigned int grid_size, idg::Array2D<idg::UVWCoordinate<float>> &uvw); void initialize_frequencies(idg::Array1D<float> &frequencies); void init...
ska-telescope/ska-sdp-idg-bench
app/common/math.hpp
#pragma once #include <cmath> #ifndef FUNCTION_ATTRIBUTES #define FUNCTION_ATTRIBUTES #endif inline float FUNCTION_ATTRIBUTES compute_l(int x, int subgrid_size, float image_size) { return (x + 0.5 - (subgrid_size / 2)) * image_size / subgrid_size; } inline float FUNCTION...
ska-telescope/ska-sdp-idg-bench
app/CPU/kernels/gridder_reference.cpp
#include "../common/math.hpp" #include "util.hpp" namespace cpu { void kernel_gridder_reference(int nr_subgrids, int grid_size, int subgrid_size, float image_size, float w_step_in_lambda, int nr_channels, int nr_stations, idg::U...
ska-telescope/ska-sdp-idg-bench
app/lib-common.hpp
<gh_stars>0 #pragma once #include "common/common.hpp"
ska-telescope/ska-sdp-idg-bench
app/common/print.cpp
#include "print.hpp" void print_parameters(int nr_stations, int nr_channels, int nr_timesteps, int nr_correlations, int nr_timeslots, float image_size, int grid_size, int subgrid_size, float w_step, int nr_baselines, int nr_subgrids, ...
ska-telescope/ska-sdp-idg-bench
tests/p_gridder_reference.cpp
#include "lib-cpu.hpp" #if defined(BUILD_CUDA) #include "lib-cuda.hpp" using namespace cuda; #elif defined(BUILD_HIP) #include "lib-hip.hpp" using namespace hip; #endif int main() { std::cout << ">>> Performance IDG-Gridder test" << std::endl; extern_print_device_info(); print_benchmark(); #if defined(BUILD_CU...
ska-telescope/ska-sdp-idg-bench
app/HIP/kernels/gridder_reference.hip.cpp
<gh_stars>0 #include "../common/math.hpp" #include "math.hip.hpp" #include "util.hip.hpp" namespace hip { __global__ void kernel_gridder_reference( const int grid_size, int subgrid_size, float image_size, float w_step_in_lambda, int nr_channels, // channel_offset? for the macro? int nr_stations, idg::UVWC...
ska-telescope/ska-sdp-idg-bench
app/CPU/kernels/vadd.cpp
<reponame>ska-telescope/ska-sdp-idg-bench<gh_stars>0 #include "util.hpp" namespace cpu { void kernel_vadd(float *a, float *b, float *c, int size) { for (int i = 0; i < size; i++) { c[i] = a[i] + b[i]; } } void c_run_vadd(std::vector<float> &a, std::vector<float> &b, std::vector<float> &c, int ...
ska-telescope/ska-sdp-idg-bench
app/common/print.hpp
<gh_stars>0 #pragma once #include <cassert> #include <iomanip> #include <iostream> #include "types.hpp" #ifndef PRINT_MAX_NR_CORRELATIONS #define PRINT_MAX_NR_CORRELATIONS 4 #endif #ifndef PRINT_MAX_HEIGHT #define PRINT_MAX_HEIGHT 3 #endif #ifndef PRINT_MAX_WIDTH #define PRINT_MAX_WIDTH 3 #endif #ifndef PRINT_MAX...
ska-telescope/ska-sdp-idg-bench
app/common/init.cpp
<filename>app/common/init.cpp<gh_stars>0 #include "init.hpp" #include "math.hpp" void initialize_uvw(unsigned int grid_size, idg::Array2D<idg::UVWCoordinate<float>> &uvw) { unsigned int nr_baselines = uvw.get_y_dim(); unsigned int nr_timesteps = uvw.get_x_dim(); float u_increment = grid_size...
ska-telescope/ska-sdp-idg-bench
app/CPU/util.hpp
#pragma once #include "lib-common.hpp"
ska-telescope/ska-sdp-idg-bench
app/HIP/math.hip.hpp
#pragma once #include <hip/hip_complex.h> inline __device__ float2 conj(float2 a) { return hipConjf(a); } inline __device__ float2 operator+(float2 a, float2 b) { return make_float2(a.x + b.x, a.y + b.y); } inline __device__ float2 operator-(float2 a, float2 b) { return make_float2(a.x - b.x, a.y - b.y); } inl...
ska-telescope/ska-sdp-idg-bench
tests/c_vadd.cpp
<gh_stars>0 #include "lib-cpu.hpp" #if defined(BUILD_CUDA) #include "lib-cuda.hpp" #elif defined(BUILD_HIP) #include "lib-hip.hpp" #endif #include "test_util.hpp" int main() { std::cout << ">>> Correctness Vector Addition test" << std::endl; #if defined(BUILD_CUDA) cuda::extern_print_device_info(); cuda::print...
wraybowling/glslViewer
include/thread_pool/thread_pool.hpp
<reponame>wraybowling/glslViewer // Copyright (c) 2020 <NAME> #ifndef THREAD_POOL_THREAD_POOL_HPP_ #define THREAD_POOL_THREAD_POOL_HPP_ #include <algorithm> #include <atomic> #include <cstdint> #include <functional> #include <future> // NOLINT #include <memory> #include <queue> #include <string> #include <thread> /...
Dongpeng-Ding/CarND-PID-Control
src/PID.cpp
#include <math.h> #include <algorithm> #include <iostream> #include <vector> #include "PID.h" #define PI 3.1415926 using namespace std; /** * TODO: Complete the PID class. You may add any additional desired functions. */ PID::PID() {} PID::~PID() {} void PID::Init(double spd_lim_, vector<double> k_) { /** ...
kazitown/visual_odom
src/main.cpp
<filename>src/main.cpp #include "opencv2/video/tracking.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/calib3d/calib3d.hpp" #include <iostream> #include <ctype.h> #include <algorithm> #include <iterator> #include <vecto...
kazitown/visual_odom
src/visualOdometry.cpp
#include "visualOdometry.h" cv::Mat euler2rot(cv::Mat& rotationMatrix, const cv::Mat & euler) { double x = euler.at<double>(0); double y = euler.at<double>(1); double z = euler.at<double>(2); // Assuming the angles are in radians. double ch = cos(z); double sh = sin(z); double ca = cos(y); double sa...
kazitown/visual_odom
src/MapPoint.cpp
#include "MapPoint.h" MapPoint::MapPoint(int id, cv::Mat worldPos) { mId = id; mWorldPos = worldPos; } MapPoint::~MapPoint() {} void MapPoint::addObservation(Observation observation) { mObservations.push_back(observation); }
hubenchang0515/Qt-FFmpeg-Demo
audiodata.cpp
<filename>audiodata.cpp #include "audiodata.h" #include <QDebug> AudioData::AudioData(QObject* parent) : QBuffer(parent) { } AudioData::AudioData(const QString& filename, QObject* parent) : QBuffer(parent) { this->filename = filename; } void AudioData::setFile(const QString& filename) { this->filena...
hubenchang0515/Qt-FFmpeg-Demo
main.cpp
<filename>main.cpp<gh_stars>1-10 #include <QCoreApplication> #include <QAudioOutput> #include <QDebug> #include "audiodata.h" int main(int argc, char *argv[]) { QCoreApplication a(argc,argv); /* Create AudioData */ AudioData data("xxxx.mp3"); if(!data.open()) { return 1; } /* Chec...
LeonineKing1199/best-buffer-resource
test/allocate_from_buf.cpp
<reponame>LeonineKing1199/best-buffer-resource #include <sleip/buffer_resource.hpp> #include <cstdint> #include <array> #include <boost/core/lightweight_test.hpp> void test_round_up_aligned() { BOOST_TEST_EQ(sleip::detail::round_up_aligned(9, 4), 12); BOOST_TEST_EQ(sleip::detail::round_up_aligned(13, 4), 16); ...
LeonineKing1199/best-buffer-resource
src/buffer_resource.cpp
<filename>src/buffer_resource.cpp #include <sleip/buffer_resource.hpp> namespace sleip { namespace detail { auto alloc_from_buf(void* buf, std::size_t const num_bytes, std::size_t const alignment, std::size_t& capacity) -> pointer { auto const origin = bu...
LeonineKing1199/best-buffer-resource
include/sleip/buffer_resource.hpp
<reponame>LeonineKing1199/best-buffer-resource<gh_stars>0 #ifndef SLEIP_BUFFER_RESOURCE_HPP_ #define SLEIP_BUFFER_RESOURCE_HPP_ #include <memory> #include <cstddef> namespace sleip { namespace detail { struct free_list_node { void* origin; std::size_t capacity; free_list_node* next; }; struct poi...
LeonineKing1199/best-buffer-resource
test/allocate_from_list_node.cpp
#include <sleip/buffer_resource.hpp> #include <boost/assert.hpp> #include <cstdint> #include <array> #include <boost/core/lightweight_test.hpp> auto to_uintptr(void* p) -> std::uintptr_t { return reinterpret_cast<std::uintptr_t>(p); } auto to_void(std::uintptr_t p) -> void* { return reinterpret_cast<void*>(p);...
aymanbagabas/C8emu
src/Emulator.cpp
// // Created by Ayman on 8/20/2018. // #include "Emulator.h" #include <vector> #include <fstream> #include <iostream> #include <thread> #define MAX_MEM 4096 Emulator::Emulator() { machine = new C8(); display = new Display(); input = new Input(); } Emulator::~Emulator() { delete i...
aymanbagabas/C8emu
main.cpp
<reponame>aymanbagabas/C8emu #include "src/Emulator.h" #include <iostream> #include <string> #include <fstream> int load(string file) { // read file ifstream f(file, ios::in|ios::binary|ios::ate); if (!f.good()) { cout << "Couldn't read '" << file << "'!" << endl; return 1; } retur...
aymanbagabas/C8emu
src/C8.cpp
#include <iostream> #include <vector> #include <string> #include "C8.h" #define WIDTH 64 #define HEIGHT 32 using namespace std; C8::C8() { fontset = { 0xF0, 0x90, 0x90, 0x90, 0xF0, // 0 0x20, 0x60, 0x20, 0x20, 0x70, // 1 0xF0, 0x10, 0xF0, 0x80, 0xF0, // 2 0xF0, 0x10, 0xF0, 0x10, 0xF0, // ...
aymanbagabas/C8emu
src/gui/Display.cpp
// // Created by ayman on 8/29/18. // #include "Display.h" #include <iostream> struct Color { Uint8 R; Uint8 G; Uint8 B; Uint8 A; }; Color colors[5] = { {0xFF, 0xFF, 0xFF, 0xFF}, // white {0xFF, 0x00, 0x00, 0xFF}, // red {0x00, 0xFF, 0x00, 0xFF}, // green {0x00, ...
aymanbagabas/C8emu
src/gui/Input.cpp
<filename>src/gui/Input.cpp<gh_stars>1-10 // // Created by ayman on 8/29/18. // #include "Input.h" #include <iostream> uint8_t KEYMAP[16] = { SDLK_x, SDLK_1, SDLK_2, SDLK_3, SDLK_q, SDLK_w, SDLK_e, SDLK_a, SDLK_s, SDLK_d, SDLK_z, ...
enthali/dcf77decoder
src/dcf77decoder.cpp
/* dcf77 decoder is a library providing functions to decode the dcf77 signal from an external dcf77 receiver the decoder features a counting clock that allows to progress the time in case the dcf77 signal cannot be received New BSD - License Copyright 2021 <NAME> (<EMAIL>) Redistribution and use in source and binary ...
huynguyen/CarND-Path-Planning-Project
src/main.cpp
#include <fstream> #include <math.h> #include <uWS/uWS.h> #include <chrono> #include <iostream> #include <thread> #include <vector> #include <algorithm> #include "Eigen-3.3/Eigen/Core" #include "Eigen-3.3/Eigen/QR" #include "json.hpp" #include "spline.h" #include "easylogging++.h" INITIALIZE_EASYLOGGINGPP using names...
DiamonDinoia/benchmark-elementary-functions
log.cpp
<filename>log.cpp<gh_stars>0 // // Created by mbarbone on 12/1/21. // #include "utils.h" #include "logarithms.h" #define CATCH_CONFIG_ENABLE_BENCHMARKING #define CATCH_CONFIG_RUNNER #include <catch2/catch.hpp> #include <random> using real_type = float; std::vector<real_type> inputs; std::vector<double> reference; s...
DiamonDinoia/benchmark-elementary-functions
sincos.cpp
#include "sincos.h" #define CATCH_CONFIG_ENABLE_BENCHMARKING #define CATCH_CONFIG_RUNNER #include <catch2/catch.hpp> #include <random> #include "utils.h" using real_type = double; std::vector<real_type> inputs; std::vector<real_type> sinResult; std::vector<real_type> cosResult; TEST_CASE("SINCOS") { sinResult...
NLaDuke/Old-Projects
CardGames/Card/test.cpp
#include "Card.cpp" #include <iostream> #include <cassert> int main(){ std::cout << "Testing Constructors:\n"; Card test1(1,4); Card test2(-1,0); Card test3(5,3); Card test4(13,3); Card test5 = test3; Card test6(test5); test6 = Card(1,1); std::cout << test1 << std::endl; std::cout << test2 << std::...
NLaDuke/Old-Projects
StackClass/Node.hpp
#ifndef LL_NODE_HPP #define LL_NODE_HPP //File: Node.hpp ////////////////////////////// // Node Class // // For Single Linked List // // By: <NAME> // // Last Edited: 12/7/2019 // ////////////////////////////// template<typename T> class Node{ public: //Constructors Node() : next(0) ...
NLaDuke/Old-Projects
ArrayClass/Array.hpp
<reponame>NLaDuke/Old-Projects<gh_stars>0 #ifndef DYNAMIC_ARRAY_HPP #define DYNAMIC_ARRAY_HPP #include<iostream> //File: Array.hpp ////////////////////////////////////////// // Header file for // // Dynamic Array class // // Written by: <NAME> // // Last Edited: 11/2/...
NLaDuke/Old-Projects
CardGames/Card/Card.cpp
<gh_stars>0 #include<iostream> #include<string> #include "Card.hpp" //File: card.cpp //////////////////////////////////////// // Implementation file for card class // // Written by: <NAME> // // Last Edited: 2/11/2020 // //////////////////////////////////////// //Constructors: //=============...
NLaDuke/Old-Projects
ArrayClass/TestFiles/_test_template.cpp
//File: _test_template.cpp //////////////////////////////////////// // Template test file for // // Dynamic Array class // // Written by: <NAME> // // Last Edited: 11/13/2019 // // For personal use only // //////////////////////////////////////// #include ...
NLaDuke/Old-Projects
CardGames/Card/Card.hpp
#ifndef CARD_HPP #define CARD_HPP #include<iostream> #include<string> //File: Card.hpp ////////////////////////////////// // Header file for Card class // // Written by: <NAME> // // Last Edited: 2/11/2020 // ////////////////////////////////////////// // Class Requirements: // //'value' rang...
NLaDuke/Old-Projects
StackClass/Stack.tpp
<filename>StackClass/Stack.tpp #ifndef BASIC_STACK_TPP #define BASIC_STACK_TPP #include<iostream> #include "Node.hpp" //File: Stack.tpp //////////////////////////////// // Implementation file for // // Basic Stack class // // Written By: <NAME> // // Last Edited: 12/7/2019 // // For Personal use onl...
NLaDuke/Old-Projects
StackClass/Stack.hpp
<filename>StackClass/Stack.hpp #ifndef BASIC_STACK_HPP #define BASIC_STACK_HPP #include<iostream> #include "Node.hpp" //File: Stack.hpp ////////////////////////////////////////// // Header file for // // Basic Stack class // // Written by: <NAME> // // Last Edited: ...
NLaDuke/Old-Projects
ArrayClass/Array.tpp
<reponame>NLaDuke/Old-Projects #ifndef DYNAMIC_ARRAY_TPP #define DYNAMIC_ARRAY_TPP #include<iostream> #include<cassert> //File: Array.tpp /////////////////////////////////// // Implementation file for // // Dynamic Array class // // Written by: <NAME> // // Last Edited: 11/2/2019 // // For...
NLaDuke/Old-Projects
ArrayClass/TestFiles/test_addition.cpp
#include "Array.hpp" #include <cassert> #include <iostream> //File: test_addition.cpp /////////////////////////////////////////// // Testing file for Dynamic Array class // // Written by: <NAME> // // Last Edited: 11/__/2019 // // For personal use only // ///////////////////...
NLaDuke/Old-Projects
CardGames/Deck.hpp
<filename>CardGames/Deck.hpp #ifndef DECK_HPP #define DECK_HPP #include "../StackClass/Stack.hpp" #include "Card.hpp" #include <iostream> #include <ifstream> #include <string> //File: Deck.hpp //////////////////////////////// // Header file for Deck class // // Written by: <NAME> // // Last Edited: 2/17/2020 //...
NLaDuke/Old-Projects
ArrayClass/TestFiles/test_comparison.cpp
#include "Array.hpp" #include <cassert> #include <iostream> //File: test_comparison.cpp /////////////////////////////////////////// // Testing file for Dynamic Array class // // Written by: <NAME> // // Last Edited: 11/__/2019 // // For personal use only // /////////////////...
NLaDuke/Old-Projects
StackClass/Tests.cpp
<filename>StackClass/Tests.cpp #include <iostream> #include "Stack.hpp" int main(){ std::cout << "Testing Stack Class (Poorly)" << std::endl; Stack<int> test; Stack<char> testSize; for(int i = 0; i < 10; i++){ test.push(i); } for(int i = 0; i < 1000; i++){ testSize.push('A'); } std::cout << tes...
NLaDuke/Old-Projects
ArrayClass/test.cpp
#include<iostream> #include<cassert> #include "Array.hpp" //File: test.cpp ////////////////////////////////////////// // Simple Test File for ArrayClass // // Written by: <NAME> // // Last Edited: 11/11/2019 // ////////////////////////////////////////// // Compiled by: ...
matt1tk/gamesneeze
src/core/hooks/createmove.cpp
#include "../../includes.hpp" #include "hooks.hpp" #include <algorithm> #include <cstdint> bool Hooks::CreateMove::hook(void* thisptr, float flInputSampleTime, CUserCmd* cmd) { original(thisptr, flInputSampleTime, cmd); if (cmd->tick_count != 0) { uintptr_t rbp; asm volatile("mov %%rbp, %0" :...
matt1tk/gamesneeze
src/core/features/playerlist.cpp
#include "features.hpp" #include "../../includes.hpp" void Features::PlayerList::draw() { if (CONFIGBOOL("Misc>Misc>Misc>Player List")) { ImGui::Begin("Player List", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | (Menu::open ? 0 : ImGuiWindowFlags_NoMouseInputs)); ImGui::Text(...
matt1tk/gamesneeze
src/core/features/ragdollGravity.cpp
<reponame>matt1tk/gamesneeze<gh_stars>1-10 #include "features.hpp" #include <cstring> void Features::RagdollGravity::frameStageNotify(FrameStage frame) { if (frame == FRAME_NET_UPDATE_POSTDATAUPDATE_END){ static ConVar* cl_ragdollGravity = Interfaces::convar->FindVar("cl_ragdoll_gravity"); if (CONF...
matt1tk/gamesneeze
src/core/features/usespam.cpp
<gh_stars>1-10 #include "features.hpp" void Features::UseSpam::createMove(CUserCmd* cmd) { if (CONFIGBOOL("Misc>Misc>Misc>Use Spam") && Menu::CustomWidgets::isKeyDown(CONFIGINT("Misc>Misc>Misc>Use Spam Key"))) { if (Globals::localPlayer) { if (Globals::localPlayer->health() > 0 && cmd->tick_cou...
matt1tk/gamesneeze
src/core/features/spectators.cpp
<filename>src/core/features/spectators.cpp<gh_stars>1-10 #include "features.hpp" #include "../../includes.hpp" void Features::Spectators::draw() { if (CONFIGBOOL("Misc>Misc>Misc>Spectators")) { ImGui::Begin("Spectator List", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWi...
matt1tk/gamesneeze
src/core/features/radar.cpp
#include "features.hpp" void Features::Radar::espPlayerLoop(Player* p) { if (CONFIGBOOL("Visuals>Players>Enemies>Radar")) { if ((Globals::localPlayer->health() == 0 && CONFIGBOOL("Visuals>Players>Enemies>Only When Dead")) || !CONFIGBOOL("Visuals>Players>Enemies>Only When Dead")) { if (!p->dorm...
matt1tk/gamesneeze
src/core/menu/tabs/devwindow.cpp
#include "../menu.hpp" void Menu::drawDevWindow() { ImGui::SetNextWindowSize(ImVec2{500, 700}); ImGui::Begin("devwindow", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse); ImGui::Text("developer"); ImGui::Separator(); ImGui::Checkbox("Demo window", &d...
matt1tk/gamesneeze
src/core/features/recoilCrosshair.cpp
#include "features.hpp" #include "../../includes.hpp" float spread; float innacuracy; void Features::RecoilCrosshair::draw() { if (CONFIGBOOL("Visuals>Players>LocalPlayer>Spread Crosshair") || CONFIGBOOL("Visuals>Players>LocalPlayer>Recoil Crosshair")) { if (Globals::localPlayer) { if ...
matt1tk/gamesneeze
src/core/features/worldcolormodulation.cpp
#include "features.hpp" void Features::WorldColorModulate::updateColorModulation() { for(auto i = Interfaces::materialSystem->FirstMaterial(); i != Interfaces::materialSystem->InvalidMaterial(); i = Interfaces::materialSystem->NextMaterial(i)) { IMaterial* material = Interfaces::materialSystem->GetMaterial...
matt1tk/gamesneeze
src/core/features/prediction.cpp
<reponame>matt1tk/gamesneeze<filename>src/core/features/prediction.cpp #include "features.hpp" // Credit: AimTux/Fuzion float m_flOldCurtime; float m_flOldFrametime; void Features::Prediction::start(CUserCmd* cmd) { if (Globals::localPlayer) { *Offsets::predictionSeed = rand() & 0x7FFFFFFF; m_flO...
matt1tk/gamesneeze
src/sdk/interfaces/ibaseclientdll.hpp
#pragma once #include <cstdint> #include "../definitions.hpp" struct RecvProp; struct DVariant { union { float m_Float; long m_Int; char *m_pString; void *m_pData; float m_Vector[3]; int64_t m_Int64; }; int m_Type; }; struct CRecvProxyData { const RecvProp* m_pRecvProp; DVariant m_Value; int m_iE...
matt1tk/gamesneeze
src/core/menu/tabs/legit.cpp
<gh_stars>1-10 #include "../menu.hpp" void Menu::drawLegitTab() { ImGui::BeginChild("LegitBot", ImVec2(ImGui::GetWindowContentRegionWidth() * 0.65f, 260), true); { ImGui::Text("LegitBot"); ImGui::Separator(); if (ImGui::BeginTabBar("Aim Weapons Tabbar")) { if (ImGui::BeginTabIte...
matt1tk/gamesneeze
src/core/hooks/clientcmd.cpp
<gh_stars>1-10 #include "../../includes.hpp" #include "hooks.hpp" #include <SDL2/SDL_scancode.h> #include <algorithm> #include <cstring> #include <streambuf> #include <string> #include <string_view> void Hooks::ClientCmd::hook(void* thisptr, char* szCmdString) { if (strstr(szCmdString, "say ")) { // https:...
matt1tk/gamesneeze
src/core/features/noflash.cpp
#include "features.hpp" void Features::NoFlash::frameStageNotify(FrameStage frame) { if(Interfaces::engine->IsInGame()) { if (Globals::localPlayer) { if(CONFIGBOOL("Visuals>World>World>No Flash")) { *Globals::localPlayer->maxFlashAlpha_ptr() = 0; } else {...
matusnovak/texture-compression
src/Compressor.cpp
#include "Compressor.hpp" #define STB_IMAGE_IMPLEMENTATION #include <iostream> #include <stb_image.h> #include <stdexcept> #include <vector> using namespace Example; static const std::string SHADER_FRAG = R"(#version 330 core in vec2 v_texCoords; out vec4 fragmentColor; uniform sampler2D tex; void ...