Skip to content

Instantly share code, notes, and snippets.

View bhaskar253's full-sized avatar
🎯
Focusing

Bhaskar bhaskar253

🎯
Focusing
View GitHub Profile
@bhaskar253
bhaskar253 / boost-windows.md
Last active July 10, 2020 01:47 — forked from sim642/boost-windows.md
Installing boost libraries for GCC (MinGW) on Windows

Installing boost libraries for GCC (MinGW) on Windows

Folder setup

  1. Extract downloaded boost source, e.g. F:\boost_1_67_0.
  2. Create a folder for Boost.Build installation, e.g. F:\boost-build.
  3. Create a folder within for building, i.e. F:\boost_1_67_0\build.
  4. Create a folder for installation, e.g. F:\boost.

GCC setup

  1. Open Command Prompt.
/* Node is defined as :
typedef struct node
{
int val;
struct node* left;
struct node* right;
int ht;
} node; */
node * new_node (int val)
cmake_minimum_required(VERSION 2.8.12)
project(YOUR_PROJECT)
# Enable multithreaded compilation in MSVC
if (MSVC)
add_definitions(/MP)
endif()
# Rewrite to a nicer output directory. Can be removed
set(ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/output)
@bhaskar253
bhaskar253 / CMAKE_RESOURCES.txt
Created April 18, 2020 18:43
Some good cmake learning stuffs
@Credit for this goes to Matt D.(U23R9AN4U) from cpplang.slack.com
Hi! Here's a few (note: there's also #cmake where you can ask more specific CMake questions):
• An Introduction to Modern CMake - https://cliutils.gitlab.io/modern-cmake/
• Awesome CMake - https://github.com/onqtam/awesome-cmake
• CMake - Introduction and best practices - http://www.slideshare.net/DanielPfeifer1/cmake-48475415
• C++Now 2017: Daniel Pfeifer "Effective CMake"
- https://www.youtube.com/watch?v=bsXLMQ6WgIk
- https://github.com/boostcon/cppnow_presentations_2017/raw/master/05-19-2017_friday/effective_cmake__daniel_pfeifer__cppnow_05-19-2017.pdf

What you need to do to install SDL is:

#install sdl2
sudo apt install libsdl2-dev libsdl2-2.0-0 -y;

#install sdl image
sudo apt install libjpeg9-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 -y;

#install sdl mixer
@bhaskar253
bhaskar253 / install virtualenv ubuntu 16.04.md
Created May 31, 2020 17:41 — forked from Geoyi/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@bhaskar253
bhaskar253 / updating_excel.py
Created May 31, 2020 18:50
Updating the existing cell of the excel file using Python (# Delete it once its use is over)
import openpyxl
excel_file = openpyxl.load_workbook('records.xlsx')
#print(excel_file.sheetnames)
tc_sheet = excel_file['Testcases']
#currently_active_sheet = excel_file.active
@bhaskar253
bhaskar253 / dummy.txt
Created August 6, 2020 15:10
How to insert, commit and fetch data using PyMySQL
import pymysql.cursors
connection = pymysql.connect(host='localhost',
user='dummy',
password='pass',
db='demo',
cursorclass=pymysql.cursors.DictCursor)
try:
with connection.cursor() as cursor:
sql = "INSERT INTO student ( roll, name ) VALUES (%s, %s)"
@bhaskar253
bhaskar253 / Change Keyboard Layout on Raspberry Pi
Created November 19, 2020 04:41
Changing Keyboard Layout on Raspberry Pi
By default, the keyboard layout is set for UK on Raspbian OS, to set it to US following are the steps:
1. Launch Terminal
2. Open “/etc/default/keyboard” with nano (or any other editor).
sudo nano /etc/default/keyboard
The file should be like this: