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
#!/bin/bash | |
rm -rf CMake* | |
export NDK=/home/syoyo/local/android-ndk-r10e | |
export SYSROOT=$NDK/platforms/android-21/arch-arm64 | |
export CC="$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc" | |
export CXX="$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++" |
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 <string> | |
static int _ReadUTF8(char const *&cp, std::string *errMsg) | |
{ | |
// Return a byte with the high `n` bits set, rest clear. | |
auto highBits = [](int n) { | |
return static_cast<unsigned char>(((1 << n) - 1) << (8 - n)); | |
}; |
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
#!/bin/bash | |
VERSION="1.0.2" | |
# Interface connect to out lan | |
INTERFACE="eth0" | |
# Interface virtual for incomming traffic | |
VIRTUAL="ifb0" | |
# set the direction (1 = outgoing only, 2 = incoming only 3 = both) | |
DIRECTION=3 | |
# Speed |
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 <gmmintrin.h> | |
// x4 ~ x0 must have either value 0 or 1. | |
#define MM256_SHUFFLE(x3, x2, x1, x0) \ | |
((x3 << 3) | (x2 << 2) | (x1 << 1) | (x0)) | |
void | |
test() | |
{ |
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
// Issue | |
// * Allocate and provice insufficient data size(e.g. vertex data) fo GAS input. | |
// * Call `optixAccelBuild` with "correct" buffer size(e.g. `buildInput.triangleArray.numVertices`) | |
// * Build GAS against invalid data but no error report at this time | |
// * Some memory object causes 'illegal memory access' error when freeing(also happens in CUDA driver API) | |
// How to reprocible | |
// | |
// OptiX 7.1 optixHair SDK sample | |
// Uncomment following in Util.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 <arm_neon.h> | |
#include <cstdio> | |
#include <limits> | |
#include <cassert> | |
#include <cmath> | |
#include <cstdint> | |
bool check_snan(float f) | |
{ | |
bool is_nan = std::isnan(f); |
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 <arm_neon.h> | |
#include <cstdio> | |
#include <limits> | |
#include <cassert> | |
#include <cmath> | |
#include <cstdint> | |
bool check_snan(float f) | |
{ | |
bool is_nan = std::isnan(f); |
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
// | |
// C++ implementaion of "A simple method to construct isotropic quasirandom blue | |
// noise point sequences" | |
// | |
// http://extremelearning.com.au/a-simple-method-to-construct-isotropic-quasirandom-blue-noise-point-sequences/ | |
// | |
// Assume 0 <= x | |
static double myfmod(double x) { return x - std::floor(x); } |
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
socket.on("render_data", function(data) { | |
console.log("render_data"); | |
var canvas = document.getElementById('mycanvas'); | |
var ctx = canvas.getContext('2d'); | |
var canvasWidth = canvas.width; | |
var canvasHeight = canvas.height; | |
var img = new Image(); | |
img.onload = function() { ctx.drawImage(img, 0, 0, canvasWidth, canvasHeight); }; |
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
gcloud compute instances create ${GCE_MASTER_INSTANCE_NAME} ... | |
# wait instance boot up | |
# fixme: there should be much better way | |
sleep 30 | |
# shutdown after 60 min | |
# must add -f flag(background execution) | |
gcloud compute ssh ${GCE_MASTER_INSTANCE_NAME} --zone ${GCE_ZONE} --ssh-flag="-f" --command="sudo /sbin/shutdown -h -P +60" |
NewerOlder