Skip to content

Instantly share code, notes, and snippets.

View leannejdong's full-sized avatar
💭
I may be slow to respond.

Leanne Dong leannejdong

💭
I may be slow to respond.
View GitHub Profile
@belltailjp
belltailjp / cmdscale.py
Last active June 17, 2019 21:55
Multi-Dimensional Scaling (also as known as Principal Coordinate Analysis) by Python
import matplotlib.pyplot as plt
import numpy as np
from sklearn import manifold
cities = "Athens Barcelona Brussels Calais Cherbourg Cologne Copenhagen Geneva Gibraltar Hamburg HookOfHolland Lisbon Lyons Madrid Marseilles Milan Munich Paris Rome Stockholm Vienna".split(" ")
d = np.array([
# from eurodist dataset: https://rstudio-pubs-static.s3.amazonaws.com/221886_5c57ad0f5ff546e8af6386162f29fabc.html
[ 0, 3313, 2963, 3175, 3339, 2762, 3276, 2610, 4485, 2977, 3030, 4532, 2753, 3949, 2865, 2282, 2179, 3000, 817, 3927, 1991],
[3313, 0, 1318, 1326, 1294, 1498, 2218, 803, 1172, 2018, 1490, 1305, 645, 636, 521, 1014, 1365, 1033, 1460, 2868, 1802],
[2963, 1318, 0, 204, 583, 206, 966, 677, 2256, 597, 172, 2084, 690, 1558, 1011, 925, 747, 285, 1511, 1616, 1175],
@moorepants
moorepants / environment.yml
Last active September 11, 2024 02:25
Realtime Low and High Pass Butterworth Filters
name: filter
channels:
- conda-forge
- defaults
dependencies:
- numpy
- scipy
- matplotlib
- sympy
- dynamicisttoolkit
@S-M-Salaquzzaman
S-M-Salaquzzaman / Newton Raphson Load Flow solving 3 Bus using MATLAB
Created July 20, 2018 07:47
This code calculates the load flow based on newton raphson methd for three bus power system. The Jacobian is written in a very easy form to understabd.
%Find Ybus Admittance Matrix(any number of Bus)
%I am used 3 Bus and , 2 bus ans 3 bus are not connected
clc
clear
% |FromBus|ToBus|Impedance|LineCharging|
d = [ 1 2 .4j -20j ;
1 3 .25j -50j;
2 3 0j 0j ; ];
fb = d(:,1); tb = d(:,2);
y = 1./d(:,3);
@nadavrot
nadavrot / Matrix.md
Last active April 20, 2025 12:59
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@marc-fez
marc-fez / dell-XPS-15-arch-linux-install
Last active November 7, 2024 12:50 — forked from mattiaslundberg/arch-linux-install
Instructions for installing arch linux on a Dell XPS 15 with full system encryption using dm-crypt and luks
# Having problems with the nvidia drivers
# Arch wiki page on XPS 15
# https://wiki.archlinux.org/index.php/Dell_XPS_15_9560
# Install ARCH Linux with encrypted file-system and UEFI on Dell XPS 15
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
@TysonRayJones
TysonRayJones / gsl_on_osx_and_arcus_guide.md
Last active October 15, 2024 11:43
GSL on OSX, Ubuntu and ARCUS

this guide may be outdated for MacOS versions beyond 10.14 Mojave (and implied Xcode versions)

GSL

Table of Contents

@ilokhov
ilokhov / build
Created April 2, 2018 20:04
Build shell script for personal website
#!/bin/bash
# clean dist directory and copy all files from src
rm -rf dist && mkdir dist
cp -a src/. dist/
### images
# declare sizes
declare -a sizes=('710' '1000' '1420')
@Cartexius
Cartexius / install_gtest_ubuntu.md
Last active November 7, 2024 00:57
Install gtest in Ubuntu
@jnaecker
jnaecker / git+overleaf+github.md
Last active March 10, 2025 21:00
Using Overleaf as your TeX editor but getting your files to Github

git + overleaf + github

Setup

Connect Overleaf and your local repo

  1. Make a new project on Overleaf.
  2. In the share menu, copy the link from "Clone with git"
  3. On your computer:
    • use cd to navigate to where you want to put your project
@kmhofmann
kmhofmann / building_tensorflow.md
Last active December 16, 2024 20:45
Building TensorFlow from source

Building TensorFlow from source (TF 2.3.0, Ubuntu 20.04)

Why build from source?

The official instructions on installing TensorFlow are here: https://www.tensorflow.org/install. If you want to install TensorFlow just using pip, you are running a supported Ubuntu LTS distribution, and you're happy to install the respective tested CUDA versions (which often are outdated), by all means go ahead. A good alternative may be to run a Docker image.

I am usually unhappy with installing what in effect are pre-built binaries. These binaries are often not compatible with the Ubuntu version I am running, the CUDA version that I have installed, and so on. Furthermore, they may be slower than binaries optimized for the target architecture, since certain instructions are not being used (e.g. AVX2, FMA).

So installing TensorFlow from source becomes a necessity. The official instructions on building TensorFlow from source are here: ht