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
import java.util.Iterator; | |
public class InfiniteIterable<T> implements Iterable { | |
private final T marker; | |
public InfiniteIterable(T marker) { | |
this.marker = marker; | |
} |
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
# arm | |
export PATH=$PATH:$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin | |
export CC=armv7a-linux-androideabi19-clang | |
export CXX=armv7a-linux-androideabi19-clang++ | |
~/.cargo/bin/cargo build --target armv7-linux-androideabi | |
# aarch64 | |
export PATH=$PATH:$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin | |
export CC=aarch64-linux-android21-clang | |
export CXX=aarch64-linux-android21-clang++ |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 28 | |
buildToolsVersion "28.0.0" | |
defaultConfig { | |
applicationId "com.example.ndkbuildexample" | |
minSdkVersion 19 | |
targetSdkVersion 28 | |
versionCode 1 | |
versionName "1.0" |
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 <cstdio> | |
#include <string> | |
#include <cstring> | |
#include <cstdint> | |
#include <arpa/inet.h> | |
#include <sys/socket.h> | |
#include <ifaddrs.h> | |
#include <netinet/in.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
get_cmake_property(_variableNames VARIABLES) | |
list (SORT _variableNames) | |
foreach (_variableName ${_variableNames}) | |
message(STATUS "${_variableName}=${${_variableName}}") | |
endforeach() |
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
import subprocess | |
sudoPassword = b'mySudoPassword\n' | |
cmd = 'sudo -S touch /dev/shm/1.txt'.split(' ') | |
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) | |
p.communicate(sudoPassword) |
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
#ifndef __RH_PROGRESS_HOOK__ | |
#define __RH_PROGRESS_HOOK__ | |
#include "unifiedlogging.h" | |
#ifdef _WIN32 | |
#include <shobjidl.h> | |
#endif | |
class ProgressHook { | |
public: |
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
:<<BATCH | |
@echo off | |
rem Web source: https://stackoverflow.com/questions/17510688/single-script-to-run-in-both-windows-batch-and-linux-bash | |
echo %PATH% | |
exit /b | |
BATCH | |
#!/bin/bash # CAUTION: SHEBANG WON'T WORK HERE (NOT FIRST LINE) | |
echo $PATH |
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 <iostream> | |
#include <vector> | |
#include <cstdlib> | |
#include <cstdint> | |
#include <cstring> | |
/** | |
* g++ -O3 qsortExample.cpp | |
* | |
* # MinGW |
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
import sys | |
import re | |
class bcolors: | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' | |
ENDC = '\033[0m' |
OlderNewer