Skip to content

Instantly share code, notes, and snippets.

@jart
jart / fone.go
Last active May 16, 2024 04:05
Linux CLI Telephone in 300 lines of Go. This is a NAT traversing SIP user agent. It can hook into the PSTN via gateways like Flowroute. The keyboard can be used to send DTMF tones.
// To the extent possible under law, Justine Tunney has waived
// all copyright and related or neighboring rights to this file,
// as it is written in the following disclaimers:
// - http://unlicense.org/
// - http://creativecommons.org/publicdomain/zero/1.0/
package main
// #cgo pkg-config: ncurses libpulse-simple
// #include <stdlib.h>
--- /tmp/NonBlockingThreadPool.h 2018-05-25 12:50:34.146863121 -0700
+++ NonBlockingThreadPool.h 2018-05-25 12:48:54.000000000 -0700
@@ -10,6 +10,7 @@
#ifndef EIGEN_CXX11_THREADPOOL_NONBLOCKING_THREAD_POOL_H
#define EIGEN_CXX11_THREADPOOL_NONBLOCKING_THREAD_POOL_H
+#include <iostream>
namespace Eigen {
#!/bin/sh
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# Noteworthy CPU Features
SSE 128-bit vector instructions (e.g. addps http://www.felixcloutier.com/x86/ADDPS.html)
SSE4.1 Makes SSE good
SSE4.2 Makes SSE do strings and CRC32
AVX Makes SSE 256-bit (e.g. vaddps)
AVX2 Adds features to AVX
AVX-512 Makes SSE 512-bit
SHA Makes SSE do SHA1 and SHA256
FMA Fused multiply–add
CLMUL Carry-less multiplication https://goo.gl/ritKJX
@jart
jart / .bashrc.tensorboard
Last active April 16, 2018 10:21
Bash Python Profiling for TensorBoard
# -*-sh-*-
# pip install yappi
# tensorboard-profile-wall-time --logdir=/tmp/mnist
tb-profile-wall-time() {
-tensorboard-profile wall "$@"
}
tb-profile-cpu-time() {
-tensorboard-profile cpu "$@"
@jart
jart / sip.rl
Created March 12, 2018 08:18
gossip sip parser definition
%%{# -*-ragel-*-
#
## SIP Message Parser Definition
#
# The parser should be a linearly complex FSM. It should be able to parse a
# real-world SIP INVITE in less than 30μs. This parser only trades speed in
# favor of friendly data structures, which are big structs linked together.
#
## Implementation Notes
#
@jart
jart / blakefiler.py
Last active September 18, 2023 16:22
Turns bazel query --output=build //tensorflow:libtensorflow_framework.so into isomorphic Makefile
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@jart
jart / .nanorc
Last active January 17, 2018 03:50
set autoindent
set cut
set tabsize 2
set tabstospaces
set nohelp
set morespace
bind ^S whereis main
bind M-F nextword main
bind M-B prevword main
bind M-{ beginpara main
@jart
jart / build-tf-nightly.sh
Last active January 13, 2018 21:47
TensorFlow Nightly Ubuntu 14 Workaround Ops
#!/bin/bash
# TensorFlow Nightly Python 2.7 Slow CPU Package Builder on Ubuntu 14
#
# This script is a temporary hackish workaround until the TensorFlow team can
# setup a heterogeneous tooling environment that builds Python<=3.4 CPU pip
# packages using Ubuntu 14, due to challenging constraints imposed by vendors.
#
# It uploads poor quality builds of TensorFlow to GCS for testing environments:
#
# pip install --no-cache-dir -I https://tensorboard-builds.storage.googleapis.com/tf_nightly_cpu_slow_ubuntu14-123-cp27-cp27mu-linux_x86_64.whl
/********************************************************\
* *
* Ultra-hot screen management package *
* *
\********************************************************/
/***********************************************************-*****