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
Language: Cpp | |
Standard: Cpp11 | |
BasedOnStyle: Google | |
AllowAllParametersOfDeclarationOnNextLine: true | |
AllowShortBlocksOnASingleLine: false | |
AllowShortCaseLabelsOnASingleLine: true | |
AllowShortFunctionsOnASingleLine: false | |
AllowShortIfStatementsOnASingleLine: true | |
AllowShortLoopsOnASingleLine: true |
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
# Your keymap | |
# | |
# Atom keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# |
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
"*": | |
Repl: {} | |
"activate-power-mode": | |
autoToggle: false | |
"atom-beautify": | |
general: | |
_analyticsUserId: "cd30efc3-4a40-427b-a456-0fecb9c02f29" | |
"atom-clock": {} | |
"autoclose-html": {} | |
"autocomplete-clang": |
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
# Your snippets | |
# | |
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
# expand the prefix into a larger code block with templated values. | |
# | |
# You can create a new snippet in this file by typing snip and then hitting | |
# tab. | |
# | |
# An example CoffeeScript snippet to expand log to console.log: | |
# |
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 <algorithm> | |
#include <utility> | |
#ifndef GENERALIZED_POINTER_HPP | |
#define GENERALIZED_POINTER_HPP | |
template <typename T> | |
class GeneralizedPointer { | |
public: | |
GeneralizedPointer() noexcept : _is_owning(false), _pointer(nullptr) { |
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
#define Test(TestSuiteName, TestCaseName) void TestSuiteName##_##TestCaseName() | |
#define Benchmark_N(TestSuiteName, TestCaseName, numberOfIterations) \ | |
void Benchmark_##TestSuiteName##_##TestCaseName(); \ | |
Test(TestSuiteName, TestCaseName) {\ | |
typedef std::chrono::high_resolution_clock clock_t;\ | |
typedef std::chrono::duration<double, std::micro> duration_t;\ | |
double totalDuration = 0; \ | |
double squaredDuration = 0;\ | |
for (std::size_t i = 0; i < numberOfIterations; ++i) {\ | |
clock_t::time_point start = clock_t::now();\ |
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 re | |
OPERATIONS = { | |
'*': lambda a, b: a * b, | |
'/': lambda a, b: a / b, | |
'+': lambda a, b: a + b, | |
'-': lambda a, b: a - b, | |
} | |
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
template <typename Iterator> | |
class LastAccessed { | |
public: | |
using Pair = typename std::iterator_traits<Iterator>::value_type; | |
using Key = typename Pair::first_type; | |
using Value = typename Pair::second_type; | |
LastAccessed() : _is_valid(false) { | |
} |
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
package bitset | |
import ( | |
"fmt" | |
"math" | |
) | |
type Bitset struct { | |
data []byte | |
cardinality int |
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
package heap | |
type Heap struct { | |
data []int | |
compare func(int, int) bool | |
} | |
func New() *Heap { | |
return &Heap{ | |
data: []int{-1}, |