Skip to content

Instantly share code, notes, and snippets.

View brightprogrammer's full-sized avatar

Siddharth Mishra brightprogrammer

View GitHub Profile
#include <iostream>
#include <vector>
#include <cmath>
#include <fstream>
#include <sstream>
#include <string>
class Regressor{
public:
Regressor(std::string filename);
@brightprogrammer
brightprogrammer / wxWidgets CMakeLists.txt
Last active August 15, 2021 17:59
CMakeLists.txt for wxWidgets Applications.
#take a look at https://cmake.org/cmake/help/latest/module/FindwxWidgets.html for reference
cmake_minimum_required(VERSION 3.5)
project(MY_PROJECT)
#include wxWidgets in your application
find_package(wxWidgets REQUIRED base core gl OPTIONAL_COMPONENTS net)
include(${wxWidgets_USE_FILE})
@brightprogrammer
brightprogrammer / ExecutionQueue.cpp
Created February 27, 2021 07:29
Execution Queue Struct
#include <functional>
#include <vector>
#include <memory>
//execution queue will store functions and execute when Execute is called...
struct ExecQueue{
void Execute(){
for(auto& fn : exec_queue) (*fn.get())();
}
@brightprogrammer
brightprogrammer / ExecutionQueueWithFunctionPointer.cpp
Created February 27, 2021 11:11
Execution Queue Using Function Pointers
#include <memory>
#include <vector>
#include <iostream>
// execution queue struct
struct ExecQueue{
// execute the queue
void Execute(){
for(uint i=0; i<exec_queue.size(); i++) (*exec_queue[i])();
}
#!/bin/zsh
# set project root directory
PROJECT_ROOT_DIRECTORY=$PWD
# project submodule directory
PROJECT_SUBMODULE_DIRECTORY=$PROJECT_ROOT_DIRECTORY/external
# number of threads that make command will use
THREADS_PER_BUILD=4
# change to project submodule directory
/**
* @file SurfaceExtensions.cpp
* @author Siddharth Mishra (bshock665@gmail.com)
* @brief Provides a way to get surface extensions without
* using SDL directly
* @version 0.1
* @date 2021-05-28
*
* @copyright Copyright (c) 2021
*
@brightprogrammer
brightprogrammer / delete_git_submodule.md
Created June 18, 2021 14:15 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
;; the basic offset is necessary
(setq default-tab-width 4)
(setq c-basic-offset 4)
;; show line numbers
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
@brightprogrammer
brightprogrammer / debian-mips64el-on-qemu.md
Created July 1, 2023 12:06 — forked from sergev/debian-mips64el-on-qemu.md
Installing Debian MIPS64 on QEMU

Let's install Debian 9.0 "Stretch" on QEMU MIPS64 under Ubuntu.

Step 1: Install QEMU

sudo apt install qemu-system-mips

Step 2: Download Linux kernel and installation image

wget http://ftp.debian.org/debian/dists/stretch/main/installer-mips64el/current/images/malta/netboot/vmlinux-4.9.0-8-5kc-malta