Skip to content

Instantly share code, notes, and snippets.

View yuhangwang's full-sized avatar

StevenW yuhangwang

View GitHub Profile
@yuhangwang
yuhangwang / set_up_signed_commit_with_git_and_gpg.md
Created January 29, 2020 16:23
How to set up signed commit using Git and GPG on MacOS?
  1. install GPG Suite (https://gpgtools.org)
  2. follow the setup tutorial https://help.github.com/en/github/authenticating-to-github/generating-a-new-gpg-key
  3. Tell Git to use the GPG signing key I just created. https://help.github.com/en/github/authenticating-to-github/telling-git-about-your-signing-key
    git config --global user.signingkey 3AA5C34371567BD2
    git config --global gpg.program gpg
    git config --global commit.gpgsign true 
    
  4. run a test echo "test" | gpg --clearsign. There will be a popup window asking for passphrase for GPG. Enter it and
@yuhangwang
yuhangwang / bash_aliases.md
Last active October 9, 2018 01:47
Useful BASH aliases

alias isync="rsync --links --stats --progress -trpv"

@yuhangwang
yuhangwang / mylib.c
Created April 19, 2018 16:56 — forked from yangle/mylib.c
ctypes examples
// gcc -std=c99 -O3 -fPIC -shared -Wl,-soname,mylib -o mylib.so mylib.c
#include <stdio.h>
#include <complex.h>
int build_hamiltonian(int i, double d, complex double *m)
{
m[0]=2.*I;
return 0;
}
@yuhangwang
yuhangwang / mylib.c
Created April 19, 2018 16:56 — forked from yangle/mylib.c
ctypes examples
// gcc -std=c99 -O3 -fPIC -shared -Wl,-soname,mylib -o mylib.so mylib.c
#include <stdio.h>
#include <complex.h>
int build_hamiltonian(int i, double d, complex double *m)
{
m[0]=2.*I;
return 0;
}
@yuhangwang
yuhangwang / mylib.c
Created April 19, 2018 16:56 — forked from yangle/mylib.c
ctypes examples
// gcc -std=c99 -O3 -fPIC -shared -Wl,-soname,mylib -o mylib.so mylib.c
#include <stdio.h>
#include <complex.h>
int build_hamiltonian(int i, double d, complex double *m)
{
m[0]=2.*I;
return 0;
}
@yuhangwang
yuhangwang / ML.md
Created March 29, 2018 18:04
Machine Learning by Languages
@yuhangwang
yuhangwang / haskell-gems.md
Last active April 2, 2018 02:28
Haskell Gems

Machine Learning

  • hasktorch Tensors and neural networks in Haskell

Haskell-Rust

  • haskellrs a good example of calling a Rust library from Haskell
@yuhangwang
yuhangwang / Rust-pkgs.md
Last active March 24, 2018 20:45
Usefule Rust packages

Image Processing

  • image This crate provides native rust implementations of image encoders and decoders and basic image manipulation functions.

Functional Reactive Programming

  • carboxyl is a library for functional reactive programming in Rust, a functional and composable approach to handle events in interactive applications.
  • SodiumFRP A Functional Reactive Programming (FRP) library for Rust

Monad

  • mdo is a monadic do notation using macro and duck typing. It provides a syntax extention providing something looking like the Haskell do notation, and rewrite it using a bind function. Some functions are privided for some common monadic structures.
@yuhangwang
yuhangwang / gist:89e2f3ddec960fffc5ae3e5f826499fa
Created December 24, 2017 17:52
Haskell for Machine Learning
1. https://github.com/HuwCampbell/grenade
@yuhangwang
yuhangwang / LLVM-Clang_build.md
Last active July 8, 2017 15:04
How to compile LLVM/Clang 4.0

On Windows 8.1, only MinGW option worked for me. MSYS2 was fine for building LLVM alone but have problems when building Clang due to the CMakefile's confusion of MSYS2 with Linux system (esp. system/resource header files). Visual Studio build option has similar confusion problem. Note that the MinGW option requires "sh.exe" not present in the PATH enverionment variable. As long as the GCC compilers are available, the building process is okay. I have finished the LLVM/Clang+"Clang extra tools" build using PowerShell. Don't build compiler-rt project. It is not compatible with windows for now. Here is the shell script I used to build LLVM/Clang. Note that I disabled most of the tests for both LLVM and Clang because they don't compile well on windows. Note: building dynamic library libLLVM.dll works on windows with MinGW64.

Here is the bash file that includes the commands I used for building LLVM (I used Git bash).