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 <sstream> | |
#include <string> | |
std::vector<std::string> split(const std::string& s, char delimiter) | |
{ | |
std::vector<std::string> tokens; | |
std::string token; | |
std::istringstream tokenStream(s); | |
while (std::getline(tokenStream, token, delimiter)) |
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
https://www.fluentcpp.com/2017/04/21/how-to-split-a-string-in-c/ | |
How to split a string in C++ | |
Published April 21, 2017 | |
- 44 Comments | |
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
https://software.intel.com/sites/landingpage/IntrinsicsGuide/# |
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
#ifdef _WIN32 | |
#include <chrono> | |
uint64_t milliseconds(void) | |
{ | |
return std::chrono::duration_cast<std::chrono::milliseconds> | |
(std::chrono::steady_clock::now().time_since_epoch()).count(); | |
} | |
#else | |
#include <sys/time.h> | |
uint64_t milliseconds(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
template<typename T> | |
byte * toByteArray(T& t) | |
{ | |
return (byte*)&t; | |
}; | |
template<typename T> | |
void fromByteArray(T& t, byte *bytes) | |
{ | |
t = *(T*)bytes; |
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
// Safe C Library | |
// | |
// Copyright (C) 2012, 2013 Cisco Systems | |
// Copyright (C) 2017 Reini Urban | |
// All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation | |
// files (the "Software"), to deal in the Software without | |
// restriction, including without limitation the rights to use, |
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
https://www.brianstorti.com/process-registry-in-elixir/ |
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
https://stackoverflow.com/questions/7213839/equivalent-in-c-of-yield-in-c | |
https://ideone.com/SQZ1qZ | |
#include <iostream> | |
int main() | |
{ | |
auto&& function = []() | |
{ | |
int i = 0; return [=]() mutable { int arr[] = {1,2,4,8,16,16777216}; if ( i < 6 ) return arr[i++]; return 0; }; | |
}(); |
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
FSetExceptMask(Cardinal(-1)); |
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
using System.Diagnostics; | |
namespace Server | |
{ | |
static class Program | |
{ | |
/// <summary> | |
/// The main entry point for the application. | |
/// </summary> | |
[STAThread] |