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 demo_add(a, b) | |
{ | |
return a+b; | |
} |
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 myFunction1(A) | |
{ | |
return A+A; | |
} | |
print("including library: test1"); | |
let a = mat([[1]]); | |
print("a+a is " + myFunction1(a)); |
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
export function abc(x){return x*100;} |
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
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 |
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
print("Hello World") |
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
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, |
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 Libray: func1 | |
Author: lidangzzz | |
Parameter: number | |
Return: number | |
*/ | |
function func1(val){ |
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
export function func1(val){ | |
return val*val + 4; | |
} |
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 function_1(x){ | |
return x*x; | |
} |
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 function_2(y){ | |
local_function_1 = *import https://gist.githubusercontent.com/lidangzzz/e68700efd00bbc2151ad8184576f47d0/raw/02fb3c562b860f9d9ae0656592dda7ed4c947e4f/function_1.hs | |
return local_function_1(y) + 100; | |
} |
OlderNewer