Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@BobStrogg
BobStrogg / AvlNode.h
Last active January 3, 2016 10:29
Immutable AVL Tree in Objective-C
//
// AvlNode.h
// AVL tree / Node
//
// Created by Chris Cavanagh on 1/14/14.
//
#import <Foundation/Foundation.h>
typedef int (^EqualityComparer)( id v1, id v2 );
@BobStrogg
BobStrogg / ImmutableArray.h
Created January 18, 2014 06:46
ImmutableArray in Objective-C; Uses AviNode, found here: https://gist.github.com/BobStrogg/8449933
//
// ImmutableArray.h
// AVLTree
//
// Created by Chris Cavanagh on 1/17/14.
//
#import <Foundation/Foundation.h>
@interface ImmutableArray : NSObject
void Main()
{
var writeChanges = false;
var basePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath), @"..\.."));
UpdateVersions(basePath, writeChanges);
}
void UpdateVersions(string basePath, bool writeChanges = false)
{
// LINQPad script showing a "use" for out parameters on iterators.
// It's a mockup of a discrete event simulator process (similar to SimPy - http://simpy.readthedocs.io).
// Since it's not possible to use 'out' with iterators, this uses an Action<T> instead.
// I'm not suggesting it's valid or in good taste :)
void Main()
{
foreach (var ie in Simulate().Take(100)) ie.Dump();
}
//
// CJCAnonymousFacesFilter.h
// CJC.FaceMaskingDemo
//
// Created by Chris Cavanagh on 11/9/13.
// Copyright (c) 2013 Chris Cavanagh. All rights reserved.
//
#import <CoreImage/CoreImage.h>