This file contains hidden or 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 | |
from fxpmath import Fxp | |
N_FRAC = 8 | |
BITS = 32 | |
def twos_comp(val, bits): | |
# numpy/cupy/kernel friendly version of https://stackoverflow.com/a/9147327 | |
sign_bits = (val & (1 << (bits - 1))) >> (bits - 1) | |
return np.int32(np.subtract(val, np.multiply(sign_bits, (1 << bits)))) |
This file contains hidden or 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
# Adapted from recipes by Sean Eron Anderson and Fabian “ryg” Giesen | |
# all credits goes to the respective authors. | |
# http://graphics.stanford.edu/~seander/bithacks.html#InterleaveBMN | |
# http://fgiesen.wordpress.com/2009/12/13/decoding-morton-codes/ | |
# Encoding DEM using Morton coding: https://www.klokantech.com/labs/dem-color-encoding/ | |
# Mirror of code from: https://code.activestate.com/recipes/577558/ | |
def part1by1(n): | |
n&= 0x0000ffff |
This file contains hidden or 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
Configuration starting... | |
2021-05-26T02:44:31: $ git -C "/var/lib/docker/codespacemount/workspace" clone --depth 1 https://github.com/aniongithub/nativelibrary-dotnet-core "/var/lib/docker/codespacemount/workspace/nativelibrary-dotnet-core" | |
2021-05-26T02:44:31: Cloning into '/var/lib/docker/codespacemount/workspace/nativelibrary-dotnet-core'... | |
2021-05-26T02:44:31: git process exited with exit code 0 | |
2021-05-26T02:44:33: $ git -C "/var/lib/docker/codespacemount/workspace/nativelibrary-dotnet-core" config --local remote.origin.fetch +refs/heads/*:refs/remotes/origin/* | |
2021-05-26T02:44:33: git process exited with exit code 0 | |
2021-05-26T02:44:33: @microsoft/vscode-dev-containers-cli 0.0.32. | |
2021-05-26T02:44:33: $ docker build -f /var/lib/docker/codespacemount/workspace/nativelibrary-dotnet-core/Dockerfile -t vsc-nativelibrary-dotnet-core-cdd73e13f35b6b589436a7f80ab2a349 /var/lib/docker/codespacemount/workspace/nativelibrary-dotnet-core | |
2021-05-26T02:44:34: Sending build context to Docker daemon 101.4kB | |
2021-05- |
This file contains hidden or 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 | |
# Requires hostapd and dnsmasq packages installed | |
# Parse options using getopt | |
# https://www.codebyamir.com/blog/parse-command-line-arguments-using-getopt | |
opts=$(getopt \ | |
--longoptions "on,off" \ | |
--name "$(basename "$0")" \ | |
--options "" \ |
This file contains hidden or 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
2021-03-16T17:28:39: $ nvidia-smi | |
2021-03-16T17:28:40: @microsoft/vscode-dev-containers-cli 0.0.22. | |
2021-03-16T17:28:40: Start: Resolving Remote | |
2021-03-16T17:28:40: $ docker ps -q -a --filter label=Type=codespaces | |
2021-03-16T17:28:40: $ docker -v | |
2021-03-16T17:28:40: $ docker events --format {{json .}} --filter event=start | |
2021-03-16T17:28:40: Start: Starting container | |
2021-03-16T17:28:40: $[38;2;86;156;214m1.2.0 | |
2021-03-16T17:28:41: $ docker ps -q -a --filter label=Type=codespaces | |
2021-03-16T17:28:41: $ docker inspect --type container 162ec0f79b5e |
This file contains hidden or 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
# Install .NET Core and ensure system can find it | |
# Bug: https://github.com/dotnet/sdk/issues/9911 | |
RUN wget -P /tmp https://dot.net/v1/dotnet-install.sh &&\ | |
chmod +x /tmp/dotnet-install.sh &&\ | |
/tmp/dotnet-install.sh &&\ | |
ln -sfn ~/.dotnet/dotnet /usr/local/bin/dotnet |
This file contains hidden or 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
from libc.stddef cimport ( | |
ptrdiff_t, size_t, wchar_t | |
) | |
from libc.stdint cimport ( | |
int16_t, int32_t, int64_t, int8_t, int_fast16_t, int_fast32_t, | |
int_fast64_t, int_fast8_t, int_least16_t, int_least32_t, int_least64_t, | |
int_least8_t, intmax_t, intptr_t, uint16_t, uint32_t, uint64_t, uint8_t, | |
uint_fast16_t, uint_fast32_t, uint_fast64_t, uint_fast8_t, uint_least16_t, | |
uint_least32_t, uint_least64_t, uint_least8_t, uintmax_t, uintptr_t | |
) |
This file contains hidden or 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 | |
# To invoke with named arguments, use | |
# https://unix.stackexchange.com/a/129394/358706 | |
REMOTE_USER="user" | |
REMOTE_EMAIL="[email protected]" | |
REMOTE_HOSTNAME="hostname_here" | |
REMOTE_KEYNAME="${REMOTE_HOSTNAME}.id.rsa" | |
REMOTE_IPADDRESS=`dig +short $REMOTE_HOSTNAME` |
This file contains hidden or 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
FROM tensorflow/tensorflow:latest-py3 | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
wget \ | |
gzip | |
WORKDIR /usr/local/src/Color-Names/ | |
COPY . /usr/local/src/Color-Names/ |
This file contains hidden or 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.Reactive.Concurrency; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
using System.Threading; | |
namespace ObserveLatestOn | |
{ | |
public static class ObservableExtensions | |
{ |