Skip to content

Instantly share code, notes, and snippets.

View JasonQSY's full-sized avatar

Shengyi Qian JasonQSY

View GitHub Profile
@JasonQSY
JasonQSY / ve280-final.md
Last active December 22, 2016 14:13
ve280-final-review

#Ve280 Final Review

Subtype and Inherit

Subtype (abstract)

the children S inherits the base type T (supertype), written as S<:T.

  • Add one or more operations. For MaxIntSet <: IntSet, we add a new method MaxIntSet::max().
  • Strengthen the postcondition of one or more operations. We can just print something (do something more than origin).
@JasonQSY
JasonQSY / fix-ubuntu-gui.md
Created August 12, 2016 13:53
For my ubuntu desktop GUI

Fix GUI for Ubuntu

My computer often fails to update the GUI. To fix the problem, enter recovery mode and enter root model. Then

mount -o rw,remount /
login

After entering the admin account, find the *.run file offered by NVIDIA.

On mac, make sure you have homebrew.

brew --version

Install php (use php56 instead of php71 if you want PHP 5.6 instead of PHP 7.1.)

brew tap homebrew/php

GH60-Layout

This is my gh60-revchn layout.

Raw data

[{a:0},"Esc\n\n\n\n~\n`",{a:4},"!\n1\n\n\nF1","@\n2\n\n\nF2","#\n3\n\n\nF3","$\n4\n\n\nF4","%\n5\n\n\nF5","^\n6\n\n\nF6","&\n7\n\n\nF7","*\n8\n\n\nF8","(\n9\n\n\nF9",")\n0\n\n\nF10","_\n-\n\n\nF11","+\n=\n\n\nF12",{w:2},"Backspace\n\n\n\nDelete"],
[{w:1.5},"Tab","Q","W\n\n\n\n↑","E","R","T","Y\n\n\n\nCalc","U","I\n\n\n\nIns","O","P\n\n\n\nPSc","{\n[\n\n\nScrLk",{a:0},"}\n]\n\n\nPus\nBrk",{a:4,w:1.5},"|\n\\"],
[{w:1.75},"Ctrl","A\n\n\n\n←","S\n\n\n\n↓","D\n\n\n\n→","F","G","H","J","K","L",":\n;\n\n\nHome","\"\n'\n\n\nPgUp",{w:2.25},"Enter"],
/**
* xm program. written by go.
*
* @build go build xm.go
* @example ./xm --> Output: xm
* @example ./xm gg --> Output: xmgg
* @example ./xm [all|-all|--all]
*/
package main
// open http://coursesel.umji.sjtu.edu.cn/tpm/findAll_LessonTaskStudent.action
// and paste the code on DeveloperTools - Console
let data = JSON.parse(document.documentElement.innerText)['data'];
let elected = {};
for (let datum of data) {
let course = datum['courseName']+datum['courseShortName'];
let student = datum['studentName'];
let section = datum['lessonTaskId'];

Keybase proof

I hereby claim:

  • I am JasonQSY on github.
  • I am jasonqsy (https://keybase.io/jasonqsy) on keybase.
  • I have a public key whose fingerprint is 58C0 6F2B 5536 9DD8 220C 7AB2 8A61 CD8A 9F13 2B28

To claim this, I am signing this object:

sudo apt install libgmp-dev libmpfr-dev libmpc-dev
sudo -H pip3 install gmpy2

Set up gperftools

Installation

OS X

Make sure you have Xcode command line tools (e.g. clang++), brew and go.

# optional

Resign Old Commits for Git

To resign old commits for git, just

git rebase --exec 'git commit --amend --no-edit -n -S' -i development

To make it easier,