Skip to content

Instantly share code, notes, and snippets.

@SeanConnelly
SeanConnelly / csvreader.md
Last active November 5, 2018 17:18
CSV file reader for Cache and IRIR

CSV File Reader for Cache and IRIS

Loads RFC 4180 compliant CSV into a data reader object.

How to use:

Create an instance of the Cogs.Lib.Csv.Reader class and load the raw CSV using either LoadFile(), LoadStream() or LoadString(), see Test methods for examples.

Use the .Next() method to load each record.

// Day 3 Part 1
console.log((function (input) {
let [x,y]=[0,0];
let [inc,dir,mem]=[1,1,1];
for (;;) {
for (let i=1;i<inc+1;i++) {
mem++;
x = (dir===1) ? x+1 : (dir===3) ? x-1 : x;
y = (dir===2) ? y+1 : (dir===4) ? y-1 : y;
if (mem===input) return Math.abs(x) + Math.abs(y)
Class AOC.Y2017 Extends %RegisteredObject
{
/*
ADVENT OF CODE 2017
Built With...
_
@SeanConnelly
SeanConnelly / coercion.js
Created September 14, 2017 12:23
Functions for testing JavaScript coercion
module.export = [
function() { return 0 == 0 },
function() { return 0 == '0' },
function() { return 0 == [0] },
function() { return 0 == [] },
function() { return 0 == {} },
function() { return 0 == '' },
function() { return 0 == null },
function() { return 0 == [null] },
function() { return 0 == undefined },
@SeanConnelly
SeanConnelly / dualack.xml
Created July 6, 2017 09:06
Ensemble Dual ACK Example
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2014.1.1 (Build 702U)" ts="2017-07-06 10:00:27">
<Class name="Examples.DeferredHL7.CustomProcess">
<ClassType>persistent</ClassType>
<Super>Ens.BusinessProcess</Super>
<TimeChanged>64470,35796.396505</TimeChanged>
<TimeCreated>64470,32347.921948</TimeCreated>
<Method name="OnRequest">
<FormalSpec>pRequest:Ens.Request,*pResponse:Ens.Response</FormalSpec>
Class ITPlanet.Task2 [ Abstract ]
{
ClassMethod Main() As %String
{
q $lg("ê°L")
}
}