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 ProcessFile { | |
| param( | |
| [string]$inputFilename, | |
| [string]$outputFilename | |
| ) | |
| $csv = @() | |
| $sr = New-Object System.IO.StreamReader($inputFilename) | |
| try { | |
| while ($true) { |
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
| Add-Type -ReferencedAssemblies ("Microsoft.Office.Interop.Excel") -TypeDefinition @" | |
| using System; | |
| using System.Collections.Generic; | |
| using Excel = Microsoft.Office.Interop.Excel; | |
| public static class Program { | |
| public static void Main(string[] args) { | |
| if (args.Length != 2) { | |
| Console.WriteLine("Please pass input file name and output file name as arguments."); | |
| return; |
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
| import { Vec2 } from "../math/Vec2"; | |
| import { Result, err, ok } from "./Result"; | |
| export type PropertiesSchema<A> = PropertiesSchemaInvMap<unknown,A> | PropertiesSchema2<A>; | |
| type PropertiesSchemaInvMap<A,B> = { | |
| type: "InvMap", | |
| propertiesSchema: PropertiesSchema<A>, | |
| fn1: (a: A) => B, | |
| fn2: (b: B) => A, |
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
| use std::cell::{Cell, RefCell}; | |
| use std::rc::{Rc, Weak}; | |
| use std::ops::{Deref, DerefMut}; | |
| pub struct FgrCtx { | |
| observer: Rc<Node>, | |
| dirty_nodes: Vec<Rc<Node>>, | |
| transaction_depth: usize, | |
| } |
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
| #[derive(Debug, PartialEq, Eq)] | |
| pub enum ChunkNextResult { | |
| Empty, | |
| Char(char), | |
| Eof, | |
| } | |
| pub struct Chunk<'a> { | |
| next: Box<dyn FnMut()->ChunkNextResult+'a>, | |
| unnext_stack: Vec<char>, |
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 class Plugin { | |
| private src: String; | |
| private callbacks: any; | |
| private iframe?: HTMLIFrameElement; | |
| private messageHandler: (e: MessageEvent) => void; | |
| private recvMsgHandler: (msg: string) => void; | |
| private nextCallId: number = 0; | |
| private resolveMap: any; | |
| onLoad: () => void = () => {}; |
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
| use std::cell::RefCell; | |
| use std::collections::HashSet; | |
| use std::hash::{Hash, Hasher}; | |
| use std::rc::Rc; | |
| thread_local! { | |
| static STRING_FACTORY: RefCell<StringFactory> = RefCell::new(StringFactory::new()); | |
| } | |
| struct MyRc<A>(Rc<A>); |
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
| import { batch, Component, createEffect, createMemo, onCleanup, onMount } from 'solid-js'; | |
| import { createStore } from 'solid-js/store'; | |
| const Window: Component<{ | |
| title?: string, | |
| width?: number, | |
| height?: number, | |
| initX?: number, | |
| initY?: number, | |
| }> = (props) => { |
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 cellArrayKeyed2<K,A,B>(keyEq: (a:K,b:K)=>boolean, keyExtractor: (a:A)=>K, transform: (a:A) => B, cas: sodium.Cell<A[]>): sodium.Cell<B[]> { | |
| return sodium.Operational | |
| .updates(cas) | |
| .accumLazy( | |
| cas.sampleLazy().map(as => as.map(a => T2.of(keyExtractor(a), transform(a)))), | |
| (nextAs: A[], lastResult: T2<K,B>[]) => { | |
| let nextResult: T2<K,B>[] = []; | |
| for (let i = 0; i < nextAs.length; ++i) { | |
| let a = nextAs[i]; | |
| let key = keyExtractor(a); |
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 class Cell<A> { | |
| . | |
| . | |
| . | |
| static switchC<A>(cca : Cell<Cell<A>>) : Cell<A> { | |
| return Transaction.run(() => { | |
| const za = cca.sampleLazy().map((ba : Cell<A>) => ba.sample()), | |
| out = new StreamWithSend<A>(); | |
| let outValue: A = null; |