Skip to content

Instantly share code, notes, and snippets.

View scaomath's full-sized avatar
🐢
is slow.

Shuhao Cao scaomath

🐢
is slow.
View GitHub Profile
@michaelmrose
michaelmrose / zathu
Created September 12, 2015 01:45
zathura config
# Zathura configuration file
# See man `man zathurarc'
# Open document in fit-width mode by default
set adjust-open "best-fit"
# One page per row by default
set pages-per-row 1
#stop at page boundries
@480
480 / gist:3b41f449686a089f34edb45d00672f28
Last active April 11, 2024 23:56
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active April 11, 2024 23:29
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
@peteflorence
peteflorence / pytorch_bilinear_interpolation.md
Last active January 16, 2024 14:18
Bilinear interpolation in PyTorch, and benchmarking vs. numpy

Here's a simple implementation of bilinear interpolation on tensors using PyTorch.

I wrote this up since I ended up learning a lot about options for interpolation in both the numpy and PyTorch ecosystems. More generally than just interpolation, too, it's also a nice case study in how PyTorch magically can put very numpy-like code on the GPU (and by the way, do autodiff for you too).

For interpolation in PyTorch, this open issue calls for more interpolation features. There is now a nn.functional.grid_sample() feature but at least at first this didn't look like what I needed (but we'll come back to this later).

In particular I wanted to take an image, W x H x C, and sample it many times at different random locations. Note also that this is different than upsampling which exhaustively samples and also doesn't give us fle

@joaoantoniocardoso
joaoantoniocardoso / compiling_OpenFOAM-4.x.md
Last active December 19, 2023 17:00
Compiling OpenFOAM-4.x at 2019 on Linux with ZSH, GCC 9.1

PROBLEM

I was trying to install Helix-OS on my Arch Linux at 2019 with ZSH and GCC 8.1 and because it is quite old it recommends OpenFOAM-4.1.

Naturally, there is no package for older OpenFOAM on AUR, so it need to be built from the sources and of course we have to solve some compatibility issues and here is a collection of fixes found on the internet :)

Get the sources

Note that using the folder names with sufix 4.1 for version 4.1 would help some of the scripts.

mkdir -p $HOME/OpenFOAM

@suda
suda / keybindings.json
Created December 16, 2018 11:44
VSCode Mac keybindings for Linux/Windows
// Overwrite key bindings by placing them into your key bindings file.
[
{
"key": "escape escape",
"command": "workbench.action.exitZenMode",
"when": "inZenMode"
},
{
"key": "shift+escape",
"command": "closeReferenceSearchEditor",
@MarkDana
MarkDana / m1-max-numpy-setup.md
Last active October 28, 2023 11:42
Install NumPy on M1 Max

How to install numpy on M1 Max, with the most accelerated performance (Apple's vecLib)? Here's the answer as of Dec 6 2021.


Steps

I. Install miniforge

So that your Python is run natively on arm64, not translated via Rosseta.

  1. Download Miniforge3-MacOSX-arm64.sh, then
  2. Run the script, then open another shell
$ bash Miniforge3-MacOSX-arm64.sh
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?