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
# jax officially support m1 mac. | |
pip install jax jaxlib | |
# if running into issues. | |
conda create --name jax python=3.9 | |
conda activate jax | |
pip install jax jaxlib |
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
body { | |
font-weight: 500; | |
font-style: normal; | |
text-align: left; | |
padding: 1rem 6rem 4rem 6rem; | |
max-width: min(100%, 1140px); | |
align-self: center; | |
margin: 0 auto; |
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
age | menopause | tumor-size | inv-nodes | node-caps | deg-malig | breast | breast-quad | irradiat | Class | |
---|---|---|---|---|---|---|---|---|---|---|
40-49 | premeno | 15-19 | 0-2 | yes | 3 | right | left_up | no | recurrence-events | |
50-59 | ge40 | 15-19 | 0-2 | no | 1 | right | central | no | no-recurrence-events | |
50-59 | ge40 | 35-39 | 0-2 | no | 2 | left | left_low | no | recurrence-events | |
40-49 | premeno | 35-39 | 0-2 | yes | 3 | right | left_low | yes | no-recurrence-events | |
40-49 | premeno | 30-34 | 3-5 | yes | 2 | left | right_up | no | recurrence-events | |
50-59 | premeno | 25-29 | 3-5 | no | 2 | right | left_up | yes | no-recurrence-events | |
50-59 | ge40 | 40-44 | 0-2 | no | 3 | left | left_up | no | no-recurrence-events | |
40-49 | premeno | 10-14 | 0-2 | no | 2 | left | left_up | no | no-recurrence-events | |
40-49 | premeno | 0-4 | 0-2 | no | 2 | right | right_low | no | no-recurrence-events |
We can't make this file beautiful and searchable because it's too large.
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
"age","workclass","fnlwgt","education","education-num","marital-status","occupation","relationship","race","sex","capitalgain","capitalloss","hoursperweek","native-country","class" | |
2,State-gov,77516,Bachelors,13,Never-married,Adm-clerical,Not-in-family,White,Male,1,0,2,United-States,<=50K | |
3,Self-emp-not-inc,83311,Bachelors,13,Married-civ-spouse,Exec-managerial,Husband,White,Male,0,0,0,United-States,<=50K | |
2,Private,215646,HS-grad,9,Divorced,Handlers-cleaners,Not-in-family,White,Male,0,0,2,United-States,<=50K | |
3,Private,234721,11th,7,Married-civ-spouse,Handlers-cleaners,Husband,Black,Male,0,0,2,United-States,<=50K | |
1,Private,338409,Bachelors,13,Married-civ-spouse,Prof-specialty,Wife,Black,Female,0,0,2,Cuba,<=50K | |
2,Private,284582,Masters,14,Married-civ-spouse,Exec-managerial,Wife,White,Female,0,0,2,United-States,<=50K | |
3,Private,160187,9th,5,Married-spouse-absent,Other-service,Not-in-family,Black,Female,0,0,0,Jamaica,<=50K | |
3,Self-emp-not-inc,209642,HS-grad,9,Married-civ-spouse,Exec-managerial,Husband,White,Male,0,0 |
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
// 0 and '' are evaluated to false in JS. | |
let x = 0; | |
if(x) { | |
... | |
} else { | |
// Will come here | |
} | |
let str = ''; |
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
// In ES5. | |
function createObjWithKey(key) { | |
let newObj = {}; | |
newObj.[key] = 1; | |
return newObj; | |
} | |
// In ES6 | |
function createObjWithKey(key) { |
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
import Router from 'next/router'; | |
const redirectLocation = '/error'; | |
// If server. | |
if (ctx.res) { | |
ctx.res.writeHead(303, { Location: redirectLocation }); | |
ctx.res.end(); | |
} else { | |
// If browser. | |
Router.push(redirectLocation); |
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
import Router from 'next/router'; | |
const redirectLocation = '/error'; | |
// If server. | |
if (ctx.res) { | |
ctx.res.writeHead(303, { Location: redirectLocation }); | |
ctx.res.end(); | |
} else { | |
// If browser. | |
Router.push(redirectLocation); |
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
import Router from 'next/router'; | |
const redirectLocation = '/error'; | |
// If server. | |
if (ctx.res) { | |
ctx.res.writeHead(303, { Location: redirectLocation }); | |
ctx.res.end(); | |
} else { | |
// If browser. | |
Router.push(redirectLocation); |
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
// Source: https://stackoverflow.com/questions/55074927/eval-vs-function-constructor | |
(() => { | |
let secret = 42; | |
eval("console.log(secret)"); // 42 | |
let fn = new Function("console.log(secret)"); | |
fn(); // secret is not defined | |
})(); |
NewerOlder