This file contains 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
sudo ip netns add client_ns | |
sudo ip link add veth0 type veth peer name veth1 | |
sudo ip link set veth1 netns client_ns | |
sudo ip link set dev veth0 up | |
sudo ip addr add 192.168.250.10/24 dev veth0 | |
sudo tc qdisc add dev veth0 root netem delay 1000ms | |
sudo ip -n client_ns link set dev veth1 up | |
sudo ip -n client_ns addr add 192.168.250.11/24 dev veth1 |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <assert.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> |
This file contains 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 <stdio.h> | |
#include <vector> | |
struct Thing { | |
int v1; | |
int v2; | |
}; | |
int main () { | |
This file contains 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 <wmmintrin.h> | |
int main() { | |
__m128i v = {}; | |
static const int r0 = 0x00; | |
static const int r[] = {0x00}; | |
static const int r1 = r[0]; | |
_mm_aeskeygenassist_si128(v, r0); // compiles | |
_mm_aeskeygenassist_si128(v, r1); // fails with error: argument to '__builtin_ia32_aeskeygenassist128' must be a constant integer | |
} |
This file contains 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 <stdio.h> | |
#include <math.h> | |
#define PI 3.14159265 | |
/* | |
* a1 \ a1 \ | |
* |\ |\ s3 ______ a22 | |
* | \ s3 s21 | \ | / | |
* | \ | \ s22 | / s1 |
This file contains 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 <stdio.h> | |
typedef float (*op_t)(float, float); | |
float op_add (float l, float r) { return l + r; } | |
float op_sub (float l, float r) { return l - r; } | |
float op_subr(float l, float r) { return r - l; } | |
float op_mul (float l, float r) { return l * r; } | |
float op_div (float l, float r) { return l / r; } |
This file contains 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 <assert.h> | |
#include <OpenGL/gl3.h> | |
#include <SDL2/SDL.h> | |
int main () { | |
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0); | |
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, | |
SDL_GL_CONTEXT_DEBUG_FLAG | | |
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); | |
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3 ); |
This file contains 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
// cro_build:release,noasan,raw, -static-libstdc++ | |
#define _XOPEN_SOURCE 700 | |
#define _POSIX_C_SOURCE 200809L | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <dirent.h> |
This file contains 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 <stdio.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <assert.h> |
This file contains 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; | |
using System.ServiceProcess; | |
using System.Net.Sockets; | |
using System.Net; | |
using System.Text; | |
public partial class MyService : ServiceBase | |
{ |