This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Example of a singleton design pattern. | |
* Copyright (C) 2011 Radek Pazdera | |
* 2018, uzername. No memory leak; assignment and copy operators are hidden from public access. | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add ~/.bash_profile if needed for executing ~/.bashrc | |
if [ -e ~/.bashrc -a ! -e ~/.bash_profile -a ! -e ~/.bash_login -a ! -e ~/.profile ]; then | |
printf "\n\033[31mWARNING: Found ~/.bashrc but no ~/.bash_profile, ~/.bash_login or ~/.profile.\033[m\n\n" | |
echo "This looks like an incorrect setup." | |
echo "A ~/.bash_profile that loads ~/.bashrc will be created for you." | |
cat >~/.bash_profile <<-\EOF | |
# generated by Git for Windows | |
test -f ~/.profile && . ~/.profile | |
test -f ~/.bashrc && . ~/.bashrc | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <bitset> | |
#include <sstream> | |
#include <array> | |
using byte = unsigned char; //Char is the smallest possible datatype. hence the reason for using it | |
std::bitset<8> charToBits(byte b); | |
template<typename T> std::bitset<sizeof(T)*8> toBinary(const T& object); |
NewerOlder