Skip to content

Instantly share code, notes, and snippets.

View stevenhao's full-sized avatar

Steven Hao stevenhao

View GitHub Profile
This file has been truncated, but you can view the full file.
// bad
module.exports = __NEXT_REGISTER_PAGE("/scalers/tasks", function() {
var e = webpackJsonp([6], {
100: function(e, t, n) {
"use strict";
Object.defineProperty(t, "__esModule", {
value: true
});
var r = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
@stevenhao
stevenhao / lasso_and_svm.ipynb
Last active December 13, 2017 04:54
6.867 final project code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stevenhao
stevenhao / distribution_sort.py
Created November 30, 2017 02:27
WIP Distribution sort
# 6.851 Coding Problem: Distribution Sort
""" Prompt:
Implement external-memory distribution sort and/or cache-oblivious distribution sort, possibly with a simpler pivot rule (e.g. random).
How do they compare to quicksort?
"""
class Array:
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
dbPath: /usr/local/var/mongodb
net:
bindIp: 0.0.0.0
replication:
replSetName: rs0
function printDBInfo() {
print('');
print('====================================================================');
print('DB Version: ' + db.version());
print('Storage Engine: ' + JSON.stringify(db.serverStatus().storageEngine));
print('Replication Info: ' + JSON.stringify(db.getReplicationInfo()));
print('');
}
printDBInfo();
@stevenhao
stevenhao / git-diff.diff
Last active June 27, 2017 00:21
Breaking Blaze HTML-escaping of <script> contents
diff --git a/packages/boilerplate-generator/boilerplate-generator.js b/packages/boilerplate-generator/boilerplate-generator.js
index 22e06e98f..9be1cc14c 100644
--- a/packages/boilerplate-generator/boilerplate-generator.js
+++ b/packages/boilerplate-generator/boilerplate-generator.js
@@ -88,6 +88,7 @@ Boilerplate.prototype._generateBoilerplateFromManifestAndSource =
readUtf8FileSync(pathMapper(item.path));
}
});
+ boilerplateBaseData.test = 'alert("Is one less that two? Click to find out!"); if (1 < 2) alert("YES!") else alert("NO!")';
var boilerplateRenderCode = SpacebarsCompiler.compile(

Problem 1 LTI Properties (26 pts)

[24 pts] Classify the following systems, with input $x(t)$ (or $x[n]$) and output $y(t)$ (or $y[n]$). In each column, write "yes", "no", or "?" if the property is not edcidable with the given information. (+1 for correct, 0 for blank, -0.5 for incorrect). (For 1d, you are given the system is known to be linear and time=invariant.) For 1b and 1d, 2 test input cases are given.

Let $\Pi(t) = u(t + \frac12) - u(t - \frac12)$.

System Causal Linear Time-invariant BIBO stable
a. $y(t) = 2x(t-1)-5$ yes no yes yes
b. \begin{cases} x & \text{if input }x(t)=0 \ tu(t) & \text{if input }x(t)=u(t-1)\end{cases} ? ? ? no
c. $y(t) = x(t)[\cos(2\pi t)u(t)]$ yes yes no yes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// ==UserScript==
// @name Generals.io
// @namespace http://tampermonkey.net/
// @version 0.1
// @description toolbox for generals.io
// @author Steven Hao
// @match http://generals.io/*
// @grant none
// ==/UserScript==