Skip to content

Instantly share code, notes, and snippets.

View lidangzzz's full-sized avatar
😅

立党 Lidang lidangzzz

😅
View GitHub Profile
export const name = 'square';
export function draw(ctx, length, x, y, color) {
ctx.fillStyle = color;
ctx.fillRect(x, y, length, length);
return {
length: length,
x: x,
y: y,
@lidangzzz
lidangzzz / my_first_notebook.hss
Created July 19, 2020 07:13
my_first_notebook.hss
print("Hello World")
@lidangzzz
lidangzzz / linearRegression.hhs
Last active August 18, 2020 18:12
linearRegression.hhs
class LinearRegression {
w: Mat;
constructor() { }
//x: M-by-N matrix. M data with N dimensions. Each row is an N-dim vector
//y: M-by-1 matrix
fit(x_: Mat, y_: Mat) : LinearRegression{
let y = y_;
if (y_.rows != 1 && y_.cols == 1) {y = y_.T();} //check the dimension of y
var x = x_.resize(x_.rows, x_.cols + 1, 1); //expan x_ with one more column with 1
export function abc(x){return x*100;}
function myFunction1(A)
{
return A+A;
}
print("including library: test1");
let a = mat([[1]]);
print("a+a is " + myFunction1(a));
@lidangzzz
lidangzzz / demo_add.js
Created June 8, 2020 15:45
a fast svm script
function demo_add(a, b)
{
return a+b;
}