Skip to content

Instantly share code, notes, and snippets.

View sailfish009's full-sized avatar

sailfish009

  • freelancer
  • South Korea
View GitHub Profile
#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))
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
https://software.intel.com/sites/landingpage/IntrinsicsGuide/#
#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)
template<typename T>
byte * toByteArray(T& t)
{
return (byte*)&t;
};
template<typename T>
void fromByteArray(T& t, byte *bytes)
{
t = *(T*)bytes;
// 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,
https://www.brianstorti.com/process-registry-in-elixir/
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; };
}();
FSetExceptMask(Cardinal(-1));
using System.Diagnostics;
namespace Server
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]