- Expert C Programming: Deep C secrets (van der Linden)
- Effective Modern C++ (Meyers)
- The Algorithm Design Manual (Skiena)
- Algorithms (Sedgewick, Wayne)
- The Pragmatic Programmer: From Journeyman to Master (Hunt, Thomas)
- [Code Complete: A Practical Handbook of Software Construction (McConnel)](https://w
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 <future> | |
using namespace std; | |
template <typename Fn, typename... Args> | |
auto do_async_with_log(ostream& os, Fn&& fn, Args&&... args) -> | |
future<decltype(fn(args...))> | |
{ | |
os << "[TID=" << this_thread::get_id() |
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 <chrono> | |
#include <cstring> | |
#include <string> | |
#include <fstream> | |
#include <istream> | |
#include <iostream> | |
#include <sstream> | |
#include <boost/tokenizer.hpp> |
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 <vector> | |
// Basic vocabulary first: | |
// A function | |
template<typename Result> | |
struct Function |
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
struct Connection { | |
void disconnected() | |
{ | |
m_connection = Disconnected(); | |
} | |
void interrupted() | |
{ | |
m_connection = std::visit(InterruptedEvent(*this), m_connection); | |
} |
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
import hashlib | |
def register(request): | |
if request.method == 'POST': | |
request_post = request.POST | |
registration_form = RegistrationFormUniqueEmail(request_post) | |
hashstring=hashlib.sha1(str(request.POST.get('csrf_token'))) ## This is going to be unique ! A unique has | |
if request.session.get('sesionform')!=hashstring: | |
if registration_form.is_valid(): | |
username = registration_form.cleaned_data['username'] | |
email = registration_form.cleaned_data['email'] |
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
#!/bin/bash | |
# When you upgrade Python using Homebrew and then run brew cleanup, the symlinks | |
# in the virtualenv point to paths that no longer exist (because Homebrew deleted them). | |
env="my-virtual-env" | |
# The solution is to remove the symlinks in the virtualenv and then recreate them | |
find ~/.virtualenvs/${env}/ -type l -delete | |
# Recreating link | |
virtualenv ~/.virtualenvs/${env} |
If you are getting this in gdb on OSX while trying to run a program:
Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
- Open Keychain Access
- In menu, open Keychain Access > Certificate Assistant > Create a certificate
- Give it a name (e.g.
cert-gdb
)
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
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
// Usage: std::cout << " "_join("Hello", "World") << std::endl; | |
#include <string_view> | |
#include <string> | |
#include <tuple> | |
#include <iostream> | |
class Joinit | |
{ | |
public: | |
Joinit(std::string_view sv): join(sv) | |
{} |
OlderNewer