This markdown was exported from Data-Forge Notebook
First define some test data:
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using UnityEngine; | |
/// <summary> | |
/// A simple free camera to be added to a Unity game object. | |
/// | |
/// Keys: |
// https://stackoverflow.com/a/15964759/25868 | |
export type BasicEventHandler = () => void; | |
export type SenderEventHandler<SenderT> = (sender: SenderT) => void; | |
// | |
// Simulate C# style events in JS. | |
// | |
export interface IEventSource<HandlerType extends Function> { | |
// |
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[]; |
This markdown was exported from Data-Forge Notebook
First define some test data:
// | |
// Original code here. | |
// | |
// https://stackoverflow.com/a/41674522/25868 | |
// | |
const m = require('module'); | |
const originalLoader = m._load; | |
m._load = function(request, parent, isMain) { |
[ | |
{ | |
"ORDERNUMBER": 10107, | |
"QUANTITYORDERED": 30, | |
"PRICEEACH": 95.7, | |
"ORDERLINENUMBER": 2, | |
"SALES": 2871, | |
"ORDERDATE": "2/24/2003 0:00", | |
"STATUS": "Shipped", | |
"QTR_ID": 1, |
{ | |
"$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": { |
{ | |
"$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": { |
/* | |
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. |