Month: June 2014
-
Simple template programming
C++ template meta-programming sounds harder than it is. So long as you can fight through some horrific syntax and understand recursive functions, you can write any algorithm you like and have it run at compile time in your C++ programs. Slides: Simpl…
-
Resolving strong references between Swift and Objective-C classes – Using unowned and weak references from Swift to Objective-C classes
My Swift and SpriteKit exploration continues. At the moment I’m writing the collision handling code. Rather than derive game objects from SKSpriteNode with each derived class containing the code for handling collisions with the other types of game obj…
-
Resolving strong references between Swift and Objective-C classes – Using unowned and weak references from Swift to Objective-C classes
My Swift and SpriteKit exploration continues. At the moment I’m writing the collision handling code. Rather than derive game objects from SKSpriteNode with each derived class containing the code for handling collisions with the other types of game obj…
-
Five Quines video
A quine is a program that prints out its own source code. I will describe five examples: Slides: Five Quines Arguably the greatest program ever written: Qlobe. More info on quines: http://www.madore.org/~david/computers/quine.html https://en.wikiped…
-
Beware: Despite the docs SKNode userData is optional
In the Swift documentation for SKNode the userData member (a dictionary) is defined as follows: userData A dictionary containing arbitrary data. Declaration SWIFT var userData: NSMutableDictionary! OBJECTIVE-C @property(nonatomic, reta…
-
Beware: Despite the docs SKNode userData is optional
In the Swift documentation for SKNode the userData member (a dictionary) is defined as follows: userData A dictionary containing arbitrary data. Declaration SWIFT var userData: NSMutableDictionary! OBJECTIVE-C @property(nonatomic, reta…
-
OpenID security in a REST API
Series: What is REST?, A Basic REST API, Paging, Search, Security, Token, OpenID. We are implementing a REST API. Today, using OpenID to do our authentication, instead of doing it ourselves: Slides: OpenID security in a REST API. Code: poemtube on gi…
-
Python’s super() explained
You probably already know how to use Python’s super() to call base-class implementations of methods. But do you really know what it’s doing? The details of super() are elegant, interesting, and powerful, and while super() is probably more complex than you expect, it’s also surprisingly easy to understand. In this …
-
Python’s super(): Not as Simple as You Thought
Python’s super() is one of those aspects of the language that many developers use without really understanding what it does or how it works. [1] To many people, super() is simply how you access your base-class’s implementation of a method. And while this is true, it’s far from the full …
-
Python’s super() explained
You probably already know how to use Python’s super() to call base-class implementations of methods. But do you really know what it’s doing? The details of super() are elegant, interesting, and powerful, and while super() is probably more complex than you expect, it’s also surprisingly easy to understand. In this …
-
Python’s super(): Not as Simple as You Thought
Python’s super() is one of those aspects of the language that many developers use without really understanding what it does or how it works. [1] To many people, super() is simply how you access your base-class’s implementation of a method. And while this is true, it’s far from the full …
-
Robust Geometric Computation in Python
In this series we look in detail at the behaviour of one of the simplest geometric functions, demonstrate its flawed behaviour when implemented with floating point numbers, and fix it using an exact number type provided in the Python Standard Library.
-
The Folly of Floating-Point for Robust Geometric Computation
Computational geometry – a world where lines have zero thickness, circles are perfectly round and points are dimensionless. Creating robust geometric algorithms using finite precision number types such as float is fiendishly difficult because it’s not possible to exactly represent numbers such as one-third, which rather gets in the way of …
-
Robust Geometric Computation in Python
In this series we look in detail at the behaviour of one of the simplest geometric functions, demonstrate its flawed behaviour when implemented with floating point numbers, and fix it using an exact number type provided in the Python Standard Library.
-
The Folly of Floating-Point for Robust Geometric Computation
Computational geometry – a world where lines have zero thickness, circles are perfectly round and points are dimensionless. Creating robust geometric algorithms using finite precision number types such as float is fiendishly difficult because it’s not possible to exactly represent numbers such as one-third, which rather gets in the way of …
-
XCode 5 versus XCode 6 default generated Game (Sprite Kit) project and scene sizes
As a way to learn about Swift I’ve been trying to write a simple game using Sprite Kit. My initial plan was to just allow a ball to be dragged around the screen and ensure it was constrained by the screen edges. This was a little harder than originally…
-
XCode 5 versus XCode 6 default generated Game (Sprite Kit) project and scene sizes
As a way to learn about Swift I’ve been trying to write a simple game using Sprite Kit. My initial plan was to just allow a ball to be dragged around the screen and ensure it was constrained by the screen edges. This was a little harder than originally…
-
Subclassing Objective-C classes in Swift and the perils of Initializers
— Begin update 1. The post below applies to Xcode 6 Beta 2. With Beta 3 & 4 the relationships between the Swift and Objective-C regarding the calling of super class initializers has been formalized. 1a. A Swift class can have multiple non-conve…
-
Subclassing Objective-C classes in Swift and the perils of Initializers
— Begin update 1. The post below applies to Xcode 6 Beta 2. With Beta 3 & 4 the relationships between the Swift and Objective-C regarding the calling of super class initializers has been formalized. 1a. A Swift class can have multiple non-conve…