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
# https://stackoverflow.com/a/51164950/148668 | |
# | |
# python3 -m pip install gtts playsound pyobjc | |
from gtts import gTTS | |
import sys | |
from io import BytesIO | |
import objc | |
import playsound | |
import tempfile | |
import argparse |
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
% Random L matrix | |
rng(1); | |
L = randn(3,3); | |
% Initial guess of S | |
S = diag(sqrt(diag(L*L'))); | |
for iter = 1:100 | |
[U,Z,V] = svd(S*L); | |
% UZUᵀ = √ SLLᵀS |
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
// via https://stackoverflow.com/a/22885856/148668 | |
#include <cereal/cereal.hpp> | |
#include <cereal/archives/binary.hpp> | |
#include <igl/writeDMAT.h> | |
#include <Eigen/Dense> | |
#include <fstream> | |
namespace cereal | |
{ | |
template <class Archive, class _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols> inline |
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
// On mac, first install eigen and glfw | |
// | |
// brew install glfw eigen | |
// | |
// Compile with something like: | |
// | |
// clang++ -O3 -DNDEBUG -o mini-glfw main.cpp -std=c++11 \ | |
// -I /opt/homebrew/include/eigen3 \ | |
// -I /opt/homebrew/include/ -L/opt/homebrew/lib -lglfw -framework OpenGL | |
// |
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
{ | |
"TGCs attended or watched": 0 | |
} |
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 | |
# arch -x86_64 ./build-x86_64-gmp-mpfr-libigl.sh | |
if [[ $(arch) == *arm64* ]]; then | |
#echo "int main(){}" | clang++ -x c++ - -o test.o | |
echo "Re-issue as `arch -x86_64 ./build-x86_64-gmp-mpfr-libigl.sh`" | |
exit 1 | |
fi |
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 | |
if [ "$#" -lt 2 ] ; then | |
echo "mine [username] [file/folder]" | |
echo "or" | |
echo "mine [username] [file/folder] [action]" | |
exit 1 | |
fi | |
if [ "$#" -ne 3 ] ; then | |
action="list,add_file,search,delete,add_subdirectory,delete_child,file_inherit,directory_inherit,read,write,delete,append,execute" | |
else |
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
#!/usr/bin/env ruby | |
# | |
# Convert ascii text from standard input into fixed-width unicode characters. | |
# | |
# http://xahlee.info/comp/unicode_full-width_chars.html | |
fixedWidth = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.:;!?"'`^~ ̄_&@#%+-*=<>()[]{}⦅⦆|¦/\¬$£¢₩¥ ' | |
ascii = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.:;!?"\'`^~‾_&@#%+-*=<>()[]{}«»|¦/\\¬$£¢₩¥ ' | |
input = STDIN.read | |
output = input.split('').map do |c| | |
i = ascii.index(c) |
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
// MIT License | |
// | |
// Copyright (c) 2020 Alec Jacobson | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |