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
// g++-8 -std=c++17 -Wall -Wextra -fsanitize=address c++17.cc | |
#include <array> | |
#include <cstddef> | |
#include <iostream> | |
#include <set> | |
#include <sstream> | |
#include <string> | |
#include <string_view> | |
#include <tuple> |
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 <iomanip> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <openssl/hmac.h> | |
int main() | |
{ | |
// https://tools.ietf.org/html/rfc2104#section-3 |
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
// Convert 4 unsigned big endian bytes to int | |
int x = java.nio.ByteBuffer.wrap(bytes).getInt(); |
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
defmodule Struct do | |
defstruct [:a, :b, :c, :d, :e, :f, :g, :h] | |
end | |
defmodule CreateStruct do | |
def create1() do | |
struct(Struct, create1_fields()) | |
end |
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
defmodule Algorithms do | |
@doc ~S""" | |
Insert `elt` into the already sorted `list`. | |
iex> Algorithms.insert_sort(1, []) | |
[1] | |
iex> Algorithms.insert_sort(1, [2,3]) | |
[1,2,3] |
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 <boost/msm/back/state_machine.hpp> | |
#include <boost/msm/front/state_machine_def.hpp> | |
#include <boost/msm/front/functor_row.hpp> | |
namespace msm = boost::msm; | |
namespace mpl = boost::mpl; | |
using namespace msm::front; |
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 s0 | |
{ | |
template <typename SM> | |
void | |
on_entry(SM&) | |
const | |
{} | |
template <typename SM> | |
void |
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 <cassert> | |
#include <map> | |
#include <memory> // shared_ptr, weak_ptr | |
#include <unordered_map> | |
#include <utility> // pair | |
/*----------------------------------------------------------------------------*/ | |
class Node | |
{ |
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 <CoreFoundation/CoreFoundation.h> | |
#include <IOKit/IOKitLib.h> | |
// clang++ -framework CoreFoundation -framework IOKIT display_sleep.cc | |
int | |
main() | |
{ | |
const io_registry_entry_t r = | |
IORegistryEntryFromPath( kIOMasterPortDefault |
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
cmake_minimum_required (VERSION 2.8.9) | |
project(paho) | |
find_package(OpenSSL) | |
find_package(Threads) | |
set(VERSION_MAJOR 1) | |
set(VERSION_MINOR 0) | |
set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}) |