This markdown was exported from Data-Forge Notebook
First define some test data:
| { | |
| "$schema": "https://vega.github.io/schema/vega-lite/v2.json", | |
| "data": { | |
| "url": "https://vega.github.io/vega-lite/data/seattle-weather.csv" | |
| }, | |
| "layer": [ | |
| { | |
| "mark": "line", | |
| "encoding": { | |
| "x": { |
| /* | |
| This module creates an HTTPS web server and serves static content | |
| from a specified directory on a specified port. | |
| To generate a new cert: | |
| openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 | |
| To remove the passphrase requirement: |
| /* | |
| This a prototype / pseudo-code in TypeScript for a new multi-core task scheduler that I'm planning to open source. | |
| This is based on my earlier private code that I've used to munge masses of stock market data and also talked about in my | |
| book Data Wrangling with JavaScript. | |
| To give me private feedback on this please email me on ashley@codecapers.com.au. | |
| The basic premise of this is that we can split up a complex data processing job into mulitple 'tasks' each of | |
| which can potentially run in parallel on a multi-core machine. |
| { | |
| "$schema": "https://vega.github.io/schema/vega-lite/v2.json", | |
| "layer": [ | |
| { | |
| "data": { | |
| "url": "https://vega.github.io/vega-lite/data/seattle-weather.csv" | |
| }, | |
| "mark": "line", | |
| "encoding": { | |
| "x": { |
| { | |
| "$schema": "https://vega.github.io/schema/vega-lite/v2.json", | |
| "layer": [ | |
| { | |
| "data": { | |
| "url": "https://vega.github.io/vega-lite/data/seattle-weather.csv" | |
| }, | |
| "mark": "line", | |
| "encoding": { | |
| "x": { |
| { | |
| "$schema": "https://vega.github.io/schema/vega-lite/v2.json", | |
| "data": { | |
| "url": "https://vega.github.io/vega-lite/data/seattle-weather.csv" | |
| }, | |
| "layer": [ | |
| { | |
| "mark": "line", | |
| "encoding": { | |
| "x": { |
| [ | |
| { | |
| "ORDERNUMBER": 10107, | |
| "QUANTITYORDERED": 30, | |
| "PRICEEACH": 95.7, | |
| "ORDERLINENUMBER": 2, | |
| "SALES": 2871, | |
| "ORDERDATE": "2/24/2003 0:00", | |
| "STATUS": "Shipped", | |
| "QTR_ID": 1, |
| // | |
| // Original code here. | |
| // | |
| // https://stackoverflow.com/a/41674522/25868 | |
| // | |
| const m = require('module'); | |
| const originalLoader = m._load; | |
| m._load = function(request, parent, isMain) { |
This markdown was exported from Data-Forge Notebook
First define some test data:
| import * as path from "path"; | |
| import { IDiagnostic } from "./language-code-generator"; | |
| import { readJsonFile } from "../common/file"; | |
| // | |
| // Result of compiling TypeScript code. | |
| // | |
| export interface ICompilationResult { | |
| code?: string; | |
| diagnostics: IDiagnostic[]; |