Skip to content

Instantly share code, notes, and snippets.

View nhoriguchi's full-sized avatar
💭
working

Naoya Horiguchi nhoriguchi

💭
working
View GitHub Profile
@diegopacheco
diegopacheco / latest-protobuf-ubuntu-18-04.md
Created June 7, 2018 20:13
How to Install Latest Protobuf on Ubuntu 18.04
sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
make
make check
sudo make install
sudo ldconfig
@ap0llo
ap0llo / Export-Presentation.ps1
Last active February 8, 2024 12:37
Powershell script to export Powerpoint Presentations to pdf using the Powerpoint COM API
# Powershell script to export Powerpoint Presentations to pdf using the Powerpoint COM API
# Based on a VB script with the same purpose
# http://superuser.com/questions/641471/how-can-i-automatically-convert-powerpoint-to-pdf
function Export-Presentation($inputFile)
{
# Load Powerpoint Interop Assembly
[Reflection.Assembly]::LoadWithPartialname("Microsoft.Office.Interop.Powerpoint") > $null
[Reflection.Assembly]::LoadWithPartialname("Office") > $null
@eshelman
eshelman / latency.txt
Last active July 26, 2024 13:16 — forked from jboner/latency.txt
HPC-oriented Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference/hit 1.5 ns 4 cycles
Floating-point add/mult/FMA operation 1.5 ns 4 cycles
L2 cache reference/hit 5 ns 12 ~ 17 cycles
Branch mispredict 6 ns 15 ~ 20 cycles
L3 cache hit (unshared cache line) 16 ns 42 cycles
L3 cache hit (shared line in another core) 25 ns 65 cycles
Mutex lock/unlock 25 ns
L3 cache hit (modified in another core) 29 ns 75 cycles
@ayeks
ayeks / cpuid_sgx.c
Last active November 9, 2020 15:16
CPUID - Intel SGX Capabilities Detection
/*
* For more information about the availability of SGX for your system check: https://github.com/ayeks/SGX-hardware
* Example output from a SGX enabled CPU is provided at the end of the Readme in that repo.
* This GIST won't be updated, however it will stay because it is linked in Stackoverflow.
*/
#include <stdio.h>
static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{