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
% 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 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 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 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 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 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 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 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: |
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
function dark_mode(use_dark_mode) | |
% DARK_MODE Switch command and figures windows to dark background with light | |
% text. | |
% | |
% dark_mode | |
% dark_mode(flag) | |
% | |
% Optional input: | |
% flag whether to switch to dark mode {false} or back to default (true) | |
% |