This shows how to build a nontrivial program using Zig+Emscripten or C+Emscripten.
In both cases Emscripten is only used as a linker, that is the frontend is either zig
or clang
.
"Nontrivial" here means the program uses interesting Emscripten features:
- Asyncify
- Full GLES3 support
- GLFW3 support
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 | |
CONFIG_PATH=~/.config/Code | |
for i in $CONFIG_PATH/User/workspaceStorage/*; do | |
if [ -f $i/workspace.json ]; then | |
folder="$(python3 -c "import sys, json; print(json.load(open(sys.argv[1], 'r'))['folder'])" $i/workspace.json 2>/dev/null | sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;')" | |
if [ -n "$folder" ] && [ ! -d "$folder" ]; then | |
echo "Removing workspace $(basename $i) for deleted folder $folder of size $(du -sh $i|cut -f1)" |
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 numpy as np | |
import torch | |
def compute_similarity_transform(S1, S2): | |
''' | |
Computes a similarity transform (sR, t) that takes | |
a set of 3D points S1 (3 x N) closest to a set of 3D points S2, | |
where R is an 3x3 rotation matrix, t 3x1 translation, s scale. | |
i.e. solves the orthogonal Procrutes problem. | |
''' |
Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
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 <SDL.h> | |
#include <glad\glad.h> | |
#include <nanovg.h> | |
#define NANOVG_GL3_IMPLEMENTATION | |
#include <nanovg_gl.h> | |
#include <nanovg_gl_utils.h> // For framebuffer utilities not shown in this code | |
#include <string> | |
#include <iostream> | |
#include <iomanip> // for setw |
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
# Option 1: Use apt-get | |
# keys taken from https://software.intel.com/en-us/articles/installing-intel-free-libs-and-python-apt-repo | |
cd ~/GitHub/r-with-intel-mkl/ | |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | |
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | |
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' | |
sudo apt-get update && sudo apt-get install intel-mkl-64bit |
Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
NewerOlder