This file contains 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 <stddef.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
static void | |
usage(const char* argv0) | |
{ | |
fprintf(stderr, | |
"Usage: %s\n" | |
" Passes spans of non-ASCII characters from stdin to stdout, " |
This file contains 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/sh | |
SERVER=stevens-mac-mini.local | |
SYNERGY_DIR="$HOME/.config/synergy" | |
function getpass { | |
cat "$SYNERGY_DIR/pass" | tr -d '\n' | md5sum | cut -d' ' -f1 | |
} |
This file contains 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 <iomanip> | |
#include <iostream> | |
#include <utility> | |
#include "registry.h" | |
using std::cerr; | |
using std::cin; | |
using std::endl; | |
using std::ios_base; |
This file contains 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 <inttypes.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
uint64_t* fibs; | |
size_t fib_len; | |
int | |
expand_fibs(uint64_t x) |
This file contains 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 <hammer/glue.h> | |
#include <hammer/hammer.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
HParser* parser; | |
HBenchmarkResults* results; |
This file contains 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 <utility> | |
template <typename T, typename U = T> | |
class ScopedRestore { | |
public: | |
explicit ScopedRestore(T* it): | |
ref_(*it), old_val_(*it) {} | |
~ScopedRestore() noexcept(noexcept(this->ref_ = std::move(this->old_val_))) { | |
using std::move; | |
ref_ = move(old_val_); |
This file contains 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 <cstdlib> | |
#include <atomic> | |
#include <exception> | |
#include <iostream> | |
#include <memory> | |
#include <mutex> | |
#include <utility> | |
class JrpException : public ::std::exception {}; |
This file contains 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 <cstdio> | |
#include <future> | |
#include <map> | |
#include <memory> | |
#include <string> | |
void do_thing(std::string a); // forces a copy | |
void do_thing_ref(std::string& a); // no copy, can mutate a | |
void do_thing_ptr(std::string* a); // no copy, can obviously mutate a |
This file contains 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 <cassert> | |
#include <future> | |
#include <list> | |
#include <queue> | |
#include <thread> | |
#include <vector> | |
class State { | |
public: | |
State(): started(false), pending_get_values(false), exiting(false) {} |
This file contains 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
#pragma once | |
#include <mutex> | |
#include <type_traits> | |
template <typename Mutex, typename... Args> | |
auto make_unique_lock(Mutex&& m, Args&&... args) | |
-> std::unique_lock<typename std::remove_reference<Mutex>::type> { | |
return std::unique_lock<typename std::remove_reference<Mutex>::type>( | |
std::forward<Mutex>(m), std::forward<Args>(args)...); |
OlderNewer