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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
const fs = require('fs'); | |
let population = JSON.parse(fs.readFileSync('population.json','utf8')); | |
population = population.filter(c => c.Year == "2016"); | |
population = population.map(c=> {return {code3:c['Country Code'],population:c.Value}}); | |
population = population.filter(c => c != null); | |
let country3to2 = JSON.parse(fs.readFileSync('3to2countrycode.json','utf8')); | |
population = population.filter(c => c != null); | |
population = population.map(c=> { |
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
const http = require("http"); | |
const express = require("express"); | |
const app = express(); | |
app.set('view engine', 'ejs'); | |
const port = 5000; ; | |
app.get("/",(req,res)=> { | |
res.end("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
let companies = [ | |
'AAPL', | |
'MSFT', | |
'AMZN', | |
'GOOGL', | |
'FB', | |
'BRK.A', | |
'BABA' | |
//'SEHK: 700' // wechat's tencent | |
'JPM', |
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
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"></script> | |
</head> | |
<body> | |
<div id="output_field"></div> | |
</body> | |
<script> | |
async function learnLinear() { | |
const model = tf.sequential(); |