This file contains hidden or 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
// generate 2D points as vectors of x and y | |
x = range(-10,10,0.1); | |
y = sin(x) + random(1,x.cols); | |
// plot x and y as scatter | |
plot2D(x,y); | |
// ploy x and y as line | |
plot2DLine(x,y); |
This file contains hidden or 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 matrix_add(matrixA, matrixB): | |
return matrixA + matrixB | |
This file contains hidden or 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
// generate 2D points as vectors of x and y | |
let x = range(-10,10,0.1); | |
let y = sin(x) + random(1,x.cols); | |
// plot x and y as scatter | |
plot2D(x,y); | |
// ploy x and y as line | |
plot2DLine(x,y); |
This file contains hidden or 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 EmccWASI() { | |
var Module=typeof Module!=="undefined"?Module:{};var __wasmLib={};function __wasmLibInstantiateWasm(imports,successCallback){__wasmLib.imports=imports;__wasmLib.successCallback=successCallback}function __wasmLibStart(wasmInstance){__wasmLib.successCallback(wasmInstance)}__wasmLib.start=__wasmLibStart;var Module={"instantiateWasm":__wasmLibInstantiateWasm,"wasmLibraryProvider":__wasmLib};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRON |
This file contains hidden or 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 fibonacci | |
Author: lidangzzz | |
Input: x: number | |
Output: fibonacci of x | |
*/ | |
function fibonacci(x){ | |
if (x<0) return 0; |
This file contains hidden or 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 fibonacci(x){ | |
if (x<0) return 0; | |
if (x==1 || x==0) return 1; | |
//elst x>=2 | |
let dp = [1,1] | |
for (let i=2;i<=x;i++){ let val = dp[dp.length-1] + dp[dp.length-2]; dp.push(val)} | |
return dp[x]; | |
} |
This file contains hidden or 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; | |
} |
This file contains hidden or 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 hidden or 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 hidden or 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){ |