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
| /* This method gets called with the absolute root object for the whole scene. I then | |
| add a few container objects to it. | |
| _freeSceneRoot is a bog standard sprite that I just add child sprites to; I just move | |
| it around in relation to where the current viewpoint is. Anything that's placed in the | |
| game world is added to this (including the _sortedContainer below) | |
| _sortedContainer is a customized sprite that sorts its children by their y-coordinate, | |
| so things draw in the right order. (Things lower on the screen draw over things higher on | |
| the screen) |
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
| /* My character class handles switching animation frames based on time, whether it's | |
| walking, and what direction it's facing. When the time comes to render, it returns | |
| an SPImage set up like this. | |
| */ | |
| @interface Character : NSObject | |
| { | |
| SPImage *_image; // Generic image sprite | |
| NSMutableArray *_frames; // array of texture frames | |
| int _facing; // North, south, east or west |
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
| CL-USER> (test-steinhart-hart) | |
| Steinhart-hart coefficients for the ACI/10K-CP curve are: | |
| A: 0.0011212672 | |
| B: 2.3534849E-4 | |
| C: 8.3802405E-8 | |
| Resistance: 336450.0 Expected: -40.0 Calculated: -39.999985 | |
| Resistance: 242660.0 Expected: -35.0 Calculated: -35.009888 | |
| Resistance: 176960.0 Expected: -30.0 Calculated: -30.018707 | |
| Resistance: 130410.0 Expected: -25.0 Calculated: -25.02591 |
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
| ;; iphone-template.lisp | |
| ;; Quicky code to generate an iPhone template for sketching out ideas. | |
| ;; | |
| ;; To use it, make sure you have cl-pdf available, e.g. (ql:quickload "cl-pdf"), | |
| ;; then just run (iphone-template:write-template "/path/to/output.pdf") | |
| (require 'cl-pdf) | |
| (defpackage :iphone-template | |
| (:use :cl) |
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
| // | |
| // main.m | |
| // dupe-detector | |
| // | |
| // Created by Jonathan Fischer on 1/1/14. | |
| // Copyright (c) 2014 Jonathan Fischer. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| #import <CommonCrypto/CommonDigest.h> |
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
| (require 'st-json) | |
| (defun squish-json-file (filename) | |
| (let ((parsed-json (with-open-file (stream filename) | |
| (st-json:read-json stream)))) | |
| (with-open-file (stream (concatenate 'string filename ".squished") | |
| :direction :output | |
| :if-exists :supersede) | |
| (st-json:write-json parsed-json stream)))) |
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
| solace:~ jfischer$ curl http://127.0.0.1:4000 | |
| Hi there. | |
| solace:~ jfischer$ curl -v http://localhost:4000 | |
| * Rebuilt URL to: http://localhost:4000/ | |
| * Hostname was NOT found in DNS cache | |
| * Trying ::1... | |
| * connect to ::1 port 4000 failed: Connection refused | |
| * Trying fe80::1... | |
| * connect to fe80::1 port 4000 failed: Connection refused |
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
| //: Playground - noun: a place where people can play | |
| import Cocoa | |
| class State { | |
| weak var stateMachine: StateMachine? | |
| func isValidNextState(stateClass: AnyClass) -> Bool { | |
| return 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
| import XCTest | |
| /******************************************** | |
| * The state graph used in these tests | |
| * | |
| * StateOne -----> StateTwo -----> State Three | |
| * ^ | ^ | | |
| * | | | | | |
| * -------------| |----------------| | |
| * |
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 static com.google.common.base.Preconditions.checkNotNull; | |
| public class ImmutableModel { | |
| private final int id; | |
| private final String label; | |
| public ImmutableModel(int id, String label) { | |
| this.id = id; | |
| this.label = checkNotNull(label); | |
| } |