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
def qr_gram_schmidt(A): | |
"""Compute the reduced QR decomposition of A via Modified Gram-Schmidt. | |
Parameters: | |
A ((m,n) ndarray): A matrix of rank n. | |
Returns: | |
Q ((m,n) ndarray): An orthonormal matrix. | |
R ((n,n) ndarray): An upper triangular matrix. | |
""" |
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
sudo du -hd 1 / >> totaldisk.txt | |
sudo du -hd 1 ~/ >> userdisk.txt |
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
[alias] | |
pmerge = "!f() { git fetch origin \"$1\":\"$1\" && git merge \"$1\"; }; f" | |
pbase = "!f() { git fetch origin \"$1\":\"$1\" && git rebase \"$1\"; }; f" |
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
const i18n = { | |
create: function () { | |
this.interpolate = (template, fillers) => { | |
let ret = template; | |
for (const key of Object.keys(fillers)) { | |
ret = ret.replace(`{${key}}`, fillers[key]) | |
} | |
return ret; | |
}; |
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
function ThumbnailGenerator() { | |
this.resizeCanvas = document.createElement('canvas'); | |
this.generate = function (imgSrc, thumbDims, compression) { | |
[this.resizeCanvas.width, this.resizeCanvas.height] = [thumbDims.x, thumbDims.y]; | |
const ctx = this.resizeCanvas.getContext("2d"); | |
const tmp = new Image(); | |
const ret = new Promise(resolve => { |
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
const HAND_IMAGE = `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wgARCAHdAd0DAREAAhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAAAAEDBAIFBgcI/8QAGgEBAQEBAQEBAAAAAAAAAAAAAAECAwQFBv/aAAwDAQACEAMQAAAB+ldGAAgA7CAAABtIJBNdz6+J/O/QX5btzQb1uemiS8znqYZ3P0zXzOe1yn59+lsz1qHU3DnWY9s9/wAG/vACgAKxwWgCCFTEOCilkgjLQCGJGhSGoAIoAaYIk43z+3zbwfYzV3UFVcues21mysq572evDTYtLXKhjr181a3VJeuKMz7J9D4W86cUNoAAsJFa0GkEFMRlCrGHSgh6AQDsEBiQaAQgBWKwjy3xfV5DzfShakM2aMulO21w22ZWnWp0zrrmjrny/Pv0c77XWZ5mxrGqzPZfo/C6DpxFLQACQsFFEAlQ6BQWpGCKHawkEVoMEaDQIIEYgFl4b877usnsxyk1nPLWZusk7zfK5iwzdHcgvKPtw0nPvuZ3l0kylspzHr30fh9D04CloIByKwABDGIAlxpqxWLMyBRFYlyVsjRIgViRgKG1FHzt8378075ElznhzN1LMdrMWs2C2lZXuJOvn5qd9tjvlq2gkqOXsv0fj9F084CoYgC5BigCkMFwVmQCCGyAqpoBK0YgEMBBA1qca8F+d9y07IymIs75DTrcY3hJNFzWiG4w78OKnfd463tNi6KTn3L3r6PxOi6cUACEZBcoYoAoAFxXIAEENkVK0aJWCMFQkBgEYry3Lv4p4PtbObkuB |
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
{ | |
"name": "Pokemon Evolution", | |
"version": "1.0", | |
"description": "Provides in-browser tools for Pokemon Go users.", | |
"permissions": [], | |
"browser_action": { | |
"default_popup": "popup.html", | |
"default_title": "Pokemon Evolution" | |
}, | |
"manifest_version": 2 |
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 { APIGatewayProxyHandler } from 'aws-lambda'; | |
import 'source-map-support/register'; | |
import axios from 'axios'; | |
import * as cheerio from 'cheerio'; | |
import LIBRARY_SEARCH_URL from './endpoint'; | |
const SELECTORS = { | |
RESULT_ENTRIES: '.results_cell', | |
TITLE_LINK: '.displayDetailLink', | |
THUMBNAIL: '.thumbnail img', |
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 { APIGatewayProxyHandler } from 'aws-lambda'; | |
import 'source-map-support/register'; | |
import * as cheerio from 'cheerio'; | |
import Axios from 'axios'; | |
const BASE_URL = 'https://www.cs.utah.edu'; | |
const SELECTORS = { | |
FACULTY_ENTRIES: 'table#people:nth-child(3) tr.professor', | |
NAME: '#info > tbody > tr:nth-child(1) > td > h8', |
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
const createObservable = () => { | |
let observers = []; | |
const subscribe = (observer) => { | |
observers.push(observer); | |
return () => { | |
observers = observers.filter(o => o !== observer); | |
}; | |
}; | |
OlderNewer