Skip to content

Instantly share code, notes, and snippets.

View lidangzzz's full-sized avatar
😅

立党 Lidang lidangzzz

😅
View GitHub Profile
@lidangzzz
lidangzzz / demo_add.js
Created June 8, 2020 15:45
a fast svm script
function demo_add(a, b)
{
return a+b;
}
function myFunction1(A)
{
return A+A;
}
print("including library: test1");
let a = mat([[1]]);
print("a+a is " + myFunction1(a));
export function abc(x){return x*100;}
@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
@lidangzzz
lidangzzz / my_first_notebook.hss
Created July 19, 2020 07:13
my_first_notebook.hss
print("Hello World")
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 / func1.hs
Last active November 13, 2020 08:45
func1.hs
/*
Function Libray: func1
Author: lidangzzz
Parameter: number
Return: number
*/
function func1(val){
@lidangzzz
lidangzzz / test.js
Created November 13, 2020 08:50
test.js
export function func1(val){
return val*val + 4;
}
function function_1(x){
return x*x;
}
function function_2(y){
local_function_1 = *import https://gist.githubusercontent.com/lidangzzz/e68700efd00bbc2151ad8184576f47d0/raw/02fb3c562b860f9d9ae0656592dda7ed4c947e4f/function_1.hs
return local_function_1(y) + 100;
}