Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
public class SafeByte | |
{ | |
ReaderWriterLockSlim locker = new ReaderWriterLockSlim(); | |
byte val; | |
public byte Value { | |
get { | |
using (ReadLock read = new ReadLock(locker)) { | |
return val; |
class ConcurrentCounter { | |
unsigned int* counters_; | |
int length_; | |
public: | |
ConcurrentCounter() { | |
length_ = boost::thread::hardware_concurrency() * 0x100; | |
counters_ = new unsigned int[length_]; | |
std::fill(counters_, counters_ + length_, 0); | |
} | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <numeric> | |
#include <windows.h> | |
#include <boost/thread.hpp> | |
class ConcurrentCounter { | |
unsigned int* counters_; | |
int length_; |
#define _SECURE_SCL 0 | |
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <deque> | |
#include <algorithm> | |
#include <numeric> | |
#include <windows.h> | |
namespace details { |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
#include <immintrin.h> | |
#include <iostream> | |
#include <thread> | |
template <class fun> | |
inline void atomic(fun const& block) { | |
while(_xbegin() != _XBEGIN_STARTED) | |
printf("Txn retry\n"); | |
block(); |
trait Foo { | |
fn foo(&self); | |
} | |
trait Bar : Foo {} // trait is empty | |
impl MyStruct : Foo { | |
fn foo(&self) { | |
// implementation goes here | |
} |
trait Drawable { fn draw(&self); } | |
trait Printable { fn print(&self); } | |
impl Circle: Drawable { fn draw(&self) { ... } } | |
impl Circle: Printable { fn print(&self) { ... } } | |
// both traits - Printable and Drawable is | |
// implemented for `Circle` | |
fn draw_all(shapes: &[@(Drawable+Printable)]) { // invalid syntax in Rust | |
// suppose we need to accept array of object that both |
class Item: | |
def __init__(self, **kvargs): | |
self.__dict__.update(**kvargs) |
apr_pool_t* mem_pool_; //< local memory pool | |
apr_mmap_t *mmap_; | |
apr_file_t *fp_; | |
apr_finfo_t finfo_; | |
static log4cxx::LoggerPtr s_logger_; | |
PersistentPageManager(const char* file_name) { | |
AprStatusChecker status; // status.count increments on each assign | |
try { | |
status = apr_pool_create(&mem_pool_, NULL); |