Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# active_set_for_convex_qp.py | |
# Yibo Yang | |
# 04/16/2019 | |
# Algorithm 16.3 (active-set method for convex QP) in Numerical Optimization | |
import numpy as np | |
from numpy.linalg import solve, lstsq | |
printing_count_from_1 = 1 # set to 1 to match textbook numbering; 0 to use python numbering |
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
; | |
; AutoHotkey Version: 1.1 | |
; Language: English | |
; Platform: Win9x/NT | |
; Author: Yibo | |
; | |
; Script Function: | |
; Define the shortcut Ctrl + Alt + T for launching Git bash in current folder in Windows Explorer | |
; |
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
; | |
; AutoHotkey Version: 1.1 | |
; Language: English | |
; Platform: Win9x/NT | |
; Author: Yibo, from Internet | |
; | |
; Script Function: | |
; Define the shortcut Win + T for launching cmd in current folder in Windows Explorer | |
; |
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
; | |
; AutoHotkey Version: 1.1 | |
; Language: English | |
; Platform: Win9x/NT | |
; Author: Yibo Yang | |
; | |
; Script Function: | |
; Remap Windows10's virtual desktop switcher keyboard shortcut from the default "Ctrl + Win + Left/Right" to Unity's "Ctrl + Alt + Left/Right" | |
; Put into the startup folder so that it will run every time your computer starts (http://superuser.com/questions/948616/windows-10-change-shortcut-keys-to-switch-between-desktops) |
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
import webapp2 | |
mainForm=""" | |
<form method='post' action='#'> | |
<label>What world do you come from? | |
<br> | |
<input name='world' value='%(world)s' placeholder='Minecraft World'> | |
</label> | |
<label>What's your name? |
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
// Construct a UnionFind object for integer elements 0... n-1 | |
function UnionFind(n) { | |
this.s = []; // Underlying array | |
this.numSets = n; | |
for (var i = 0; i < n; i++) // initial representatives are -1 | |
this.s[i] = -1 | |
}; | |
// Search for element y and return the index of the root of the tree containing y; | |
// does path compression on each find |
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
# to simplify life, install xclip and append the following lines to your .bashrc | |
alias "c=xclip" # copy to X clipboard (register *) | |
alias "cs=xclip -selection clipboard" # copy to system wide clipboard (register +) | |
alias "v=xclip -o" # output copied content (paste) | |
alias "vs=xclip -o -selection clipboard" # paste from system wide clipboard (equivalent to `v -selection clipboard`) | |
# examples: | |
# copy to X: | |
# go to the same directory in terminal 2 as in terminal 1 | |
# Terminal 1: |