ACCU World of Code
-
How to make your own levels for Rabbit Escape
A little video showing you how to make levels for my new game Rabbit Escape. There are more instructions on the Creating levels for Rabbit Escape page.
-
Rabbit Escape v0.1 out now for Linux, Windows and Mac video
A little video to announce my new game, Rabbit Escape. Download it, play it, enjoy it, and let me know how I can improve it!
-
Rabbit Escape (a bit like Lemmings) v0.1 released for Linux, Windows and Mac
Today I am releasing the first version of my new game, Rabbit Escape. It’s an arcade puzzle game inspired by Lemmings and Pingus, but intended to be simpler and easier to control on a mobile device. Your task is to guide a party of rabbits from the ent…
-
Snake in Groovy
Series: Groovy, Ruby, BASIC, Dart, Elm, Python3+Qt5 I’m starting a series where I write the game Snake in lots of programming languages. I almost always use writing Snake as my way in to understand a new language, so I’ll share my thoughts about each l…
-
Programmatic equivalents of web.xml sections for Tomcat
Most documentation for J2EE configuration is based on having a web.xml file, but I want to configure my Tomcat programmatically. Here are some of the things I have found out. Please use the comments below to correct what I got wrong, and mention equiva…
-
Optional chaining with dictionaries (in Swift)
Whilst learning Swift and SpriteKit I came across an issue with the documentation for SKNode.userData. In an early XCode beta it was specified as an implicitly unwrapped optional whereas now it is clearly an optional. Therefore the code I origina…
-
Optional chaining with dictionaries (in Swift)
Whilst learning Swift and SpriteKit I came across an issue with the documentation for SKNode.userData. In an early XCode beta it was specified as an implicitly unwrapped optional whereas now it is clearly an optional. Therefore the code I origina…
-
Lazy Transducer Evaluation
In the previous article in this series on transducers we looked at transducers which push more items downstream through the reducer chain than they receive from upstream. We promised that this would make lazy evaluation of transducer chains quite interesting.
When used with our transduce() function, our mapping and filtering …
-
Lazy Transducer Evaluation
In the previous article in this series on transducers we looked at transducers which push more items downstream through the reducer chain than they receive from upstream. We promised that this would make lazy evaluation of transducer chains quite interesting.
When used with our transduce() function, our mapping and filtering …
-
Item Injecting Transducers
In the previous article in our series on understanding transducers through Python we showed how to support early termination of a reduction operation. This time, we’ll demonstrate how transducers can produce more items than they consume. Although this may seem obvious, it leads to some important consequences for implementing lazy …
-
Item Injecting Transducers
In the previous article in our series on understanding transducers through Python we showed how to support early termination of a reduction operation. This time, we’ll demonstrate how transducers can produce more items than they consume. Although this may seem obvious, it leads to some important consequences for implementing lazy …
-
Terminating Transducers
In the previous article in this series on transducers, we showed how to implement stateful transducers, and how to deal with any left-over state or other clean-up operations when the reduction operation is complete. Sometimes, however, there is no need to process a whole series of items in order to …
-
Terminating Transducers
In the previous article in this series on transducers, we showed how to implement stateful transducers, and how to deal with any left-over state or other clean-up operations when the reduction operation is complete. Sometimes, however, there is no need to process a whole series of items in order to …
-
Stateful Transducers
In the previous article in this series on transducers we saw how we can develop the notion of the transducer from a single function which literally transforms reducers to a more capable protocol which supports two further capabilities: First of all, the association of initial ‘seed’ values with a reduction …
-
Stateful Transducers
In the previous article in this series on transducers we saw how we can develop the notion of the transducer from a single function which literally transforms reducers to a more capable protocol which supports two further capabilities: First of all, the association of initial ‘seed’ values with a reduction …
-
Enriching the Transducer Protocol
In the previous article in the series we looked at improving the experience of composing transducers together in Python, by introducing a compose() function. We finished by showing this snippet, which composes a filtering transducer with a mapping transducer to produce a prime-squaring transducer. Recalling that transducers are used to …
-
Enriching the Transducer Protocol
In the previous article in the series we looked at improving the experience of composing transducers together in Python, by introducing a compose() function. We finished by showing this snippet, which composes a filtering transducer with a mapping transducer to produce a prime-squaring transducer. Recalling that transducers are used to …
-
Improving Transducer Composition
In the previous article in this series we derived a Python implementation of transducers from first principles. We finished by showing how transducers can be composed together using regular function call application to give us a single composite reducer which can perform many operations with a single pass of reduce …
-
Improving Transducer Composition
In the previous article in this series we derived a Python implementation of transducers from first principles. We finished by showing how transducers can be composed together using regular function call application to give us a single composite reducer which can perform many operations with a single pass of reduce …
-
Deriving Transducers from First Principles
What is a transducer?
Transducers – a portmanteau of ‘transform reducers’ – are a new functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you’re not already a competent Clojureist, can be challenging. In this series …
-
Understanding Transducers through Python
In this series we take an in-depth look at transducers. Transducers – a portmanteau of “transform reducers” – are a new functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you’re not already a competent Clojureist, can …
-
Deriving Transducers from First Principles
What is a transducer?
Transducers – a portmanteau of ‘transform reducers’ – are a new functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you’re not already a competent Clojureist, can be challenging. In this series …
-
Understanding Transducers through Python
In this series we take an in-depth look at transducers. Transducers – a portmanteau of “transform reducers” – are a new functional programming concept introduced into the Clojure programming language. Although transducers are actually pretty straightforward in retrospect, wrapping your brain around them, especially if you’re not already a competent Clojureist, can …
-
JAX-RS (using Apache CXF) in embedded Tomcat example
I had serious trouble today firing up an embedded Tomcat server that serves up REST resources using JAX-RS via Apache CXF. Here’s minimal example, hopefully saving you the same trouble: src/HelloJaxRs.java: import org.apache.catalina.startup.Tomcat; im…
-
Vim persistent buffer list combined with saved sessions
I like to use several saved Vim sessions to remember what files I was working on in a particular project. I also like to have a list of buffers I have open on the left-hand side of the screen that is always visible and up-to-date. Sometimes, the existe…
-
Snowflake Christmas card web page on the Raspberry Pi
In this video I will show you how to make an electronic Christmas card for your friends or family using HTML and JavaScript, which means it will be a little web site that anyone can see by going to it in their Internet browser. I’m doing this on the Ra…
-
Snowflake Christmas card in Scratch on the Raspberry Pi
In this video I will show you how to make an electronic Christmas card for your friends or family using Scratch. Scratch can work on most computers – you can download it from http://scratch.mit.edu/. Scratch is already installed on your Raspberry Pi if…
-
Encoding URLs in Java
To encode a URL in Java, create a new instance of java.net.URI and then call toString() or toASCIIString() on it. DO NOT use java.net.URLEncoder. It is for HTML form encoding, not encoding URLs, despite its name. Each part of a URL must be escaped diff…
-
Books that changed my life
Further Programming for the ZX Spectrum by Ian Stewart, Robin Jones Foundation by Isaac Asimov Crime and Punishment by Fyodor Dostoyevsky Structure and Interpretation of Computer Programs by Harold Abelson, Gerald Jay Sussman, Julie Sussman S…
-
Why I use Linux
I have used Linux at home for quite a few years, and a couple of years ago I changed my work machine from Windows to Ubuntu Linux. It’s made life at work better for me. Better for me This move has made me much more productive, saving valuable time and …
-
LibreOffice spell check not working in Lubuntu
I installed LibreOffice into Lubuntu, but the spell checking didn’t work. It turns out I need to install a dictionary for my locale: sudo apt-get install myspell-en-gb I needed to restart LibreOffice, and then I got spell checking as I typed.
-
Writing: Becoming a Better Programmer
It’s finally here! My new book, Becoming a Better Programmer, is fully edited, laid out, and is now available as a final product for your reading pleasure, published by O’Reilly. You can purchase it in printed form or as a digital version for your e…
-
Writing: Becoming a Better Programmer
It’s finally here! My new book, Becoming a Better Programmer, is fully edited, laid out, and is now available as a final product for your reading pleasure, published by O’Reilly. You can purchase it in printed form or as a digital version for your e…
-
Is it ok to represent dates as Unix time (seconds since the epoch) in JSON?
Yes. If your JSON contains integer numbers that represent Unix time (seconds since the “epoch”), and you parse your JSON to JavaScript, the range of integers that can accurately be represented is -9007199254740992 to 9007199254740992 (ref: EcmaScript s…
-
How Visual Lint parses projects and makefiles
Code analysis tools can require a lot of configuration to be useful. Whilst some (e.g. Vera++ or cpplint) need very little configuration to make use of effectively, others such as PC-lint (and even, to a lesser extent, CppCheck) may need to be fed pret…
-
How Visual Lint parses projects and makefiles
Code analysis tools can require a lot of configuration to be useful. Whilst some (e.g. Vera++ or cpplint) need very little configuration to make use of effectively, others such as PC-lint (and even, to a lesser extent, CppCheck) may need to be fed pret…
-
Using hexdump to represent a binary file in Java source code
To embed a binary file (e.g. a png image) into Java source code: $ hexdump -v -e ‘/1 “%3i, “‘ myfile.png -119, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, … Copy and paste the output into Java code like this: private s…
-
A More Full-Featured Emacs company-mode Backend
In the first article in this series we looked at how to define the simplest company-mode backend. [1] This backend drew completion candidates from a predefined list of options, and allowed you to do completion in buffers in fundamental mode. The main purpose of that article was to introduce the …
-
A More Full-Featured Emacs company-mode Backend
In the first article in this series we looked at how to define the simplest company-mode backend. [1] This backend drew completion candidates from a predefined list of options, and allowed you to do completion in buffers in fundamental mode. The main purpose of that article was to introduce the …
-
Disabling screensaver on LXDE
Caffeine wasn’t working for me. I got an error like this: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files Bug 1280449 contained the solution for me. …
-
Android development – saving state
Series: Setup, Menu, Drawing, non-Android, Working, Saving state. Android apps like Rabbit Escape need to save their state when asked, and restore themselves later. This happens when you rotate the screen, and could happen at various other times. Here’…
-
Android development – Rabbit Escape really working on Android
Series: Setup, Menu, Drawing, non-Android, Working, Saving state. Up until now, you weren’t sure to believe my promises that Rabbit Escape really was going to be an Android game, since I hadn’t actually got it running on Android. Well, the wait is over…
-
Showing urgent (flashing) windows on all desktop in LXDE’s taskbar (window list) in Lubuntu
As it stands, lxpanel’s taskbar plugin (part of the LXDE desktop you get with Lubuntu) does not show urgent (flashing) windows if they are on a different virtual desktop from the one you are looking at. This seems wrong to me (I logged Bug 682), and th…
-
Launch an urgent window using Python and Xlib with the UrgencyHint flag
I am trying to fix a bug in lxpanel’s taskbar plugin, and needed to launch an urgent window. Here’s how I did it in a little python. #!/usr/bin/python # urgent.py — launch an urgent window (Copyright messages are at the bottom) # To use: # sudo apt-…
-
Android programming – a non-Android, Android Game
Series: Setup, Menu, Drawing, non-Android, Working, Saving state We’re planning to write an Android game. So why would we deliberately avoid Android while we’re writing it? To make sure we’re not overly-dependent on the Android ways of doing things, an…
-
Android programming – drawing bitmaps in a game loop
Series: Setup, Menu, Drawing, non-Android, Working, Saving state I will be talking about how to write Android programs that share code with non-Android programs. The program I will be writing is a simple game. This time we’re writing a game loop and dr…
-
Writing: Testing Times
My latest Becoming a Better Programmer column is published in the September issue of C Vu magazine (26.4). It called Testing Times and surveys the world of developer testing, covering the what, why, and how of programmer-driven testing. We look …
-
Writing: Testing Times
My latest Becoming a Better Programmer column is published in the September issue of C Vu magazine (26.4). It called Testing Times and surveys the world of developer testing, covering the what, why, and how of programmer-driven testing. We look …
-
Don’t use email auto-forwarding (emails will go missing)
I’ve been trying to chase down a mysterious problem with emails going missing. The problem with things being missing is that you can’t see them, so it has been difficult to track down exactly what’s going on, but it became clear that we were receiving …
-
Fetchmail “mda” option makes emails bypass the spamassassin filter in postfix
I have spent several months with no spam filtering in my postfix+dovecote+spamassassin+fetchmail+procmail setup, and no idea why. I had spamassassin enabled and working when I piped emails into it manually, and I had lines like this in my postfix maste…
-
Android programming – a menu using Activities and Intents
Series: Setup, Menu, Drawing, non-Android, Working, Saving state I will be talking about how to write Android programs that share code with non-Android programs. The program I will be writing is a simple game. This time we’re making a simple menu struc…
-
Raspberry Pi Minecraft Python summer project screenshots
[Screenshots of Minecraft on the Raspberry Pi can’t be made with VNC or screenshot tool like scrot, but they can be made with the excellent raspi2png.] We did some Python programming in Minecraft on the Raspberry Pi for our summer projects. Child 2 m…
-
Predictive Models of Development Teams and the Systems They Build
In 1968 Melvin Conway pointed out a seemingly inevitable symmetry between organisations and the software systems they construct. Organisations today are more fluid than 40 years ago, with short developer tenure, and frequent migration of individuals between projects and employers. In this article we’ll examine data on the tenure …
-
Predictive Models of Development Teams and the Systems They Build
In 1968 Melvin Conway pointed out a seemingly inevitable symmetry between organisations and the software systems they construct. Organisations today are more fluid than 40 years ago, with short developer tenure, and frequent migration of individuals between projects and employers. In this article we’ll examine data on the tenure …
-
Android programming – setting up Android Studio
Series: Setup, Menu, Drawing, non-Android, Working, Saving state I will be talking about how to write Android programs that share code with non-Android programs. The program I will be writing is a simple game. First, how to set up Android Studio:
-
How to write a company-mode backends
In Emacs, company-mode (short for “complete anything”) is a framework for performing completion in buffers. It’s an alternative to the popular auto-complete-mode. company-mode supports extension via backends which provide the framework with lists of possible completions in various contexts. So, for example, there’s a backend that provides completion support for …
-
Writing the Simplest Emacs company-mode Backend
In Emacs, company-mode (short for “complete anything”) is a framework for performing completion in buffers. [1] It’s an alternative to the popular auto-complete-mode. company-mode supports extension via backends which provide the framework with lists of possible completions in various contexts. So, for example, there’s a backend th(at provides completion …
-
How to write a company-mode backends
In Emacs, company-mode (short for “complete anything”) is a framework for performing completion in buffers. It’s an alternative to the popular auto-complete-mode. company-mode supports extension via backends which provide the framework with lists of possible completions in various contexts. So, for example, there’s a backend that provides completion support for …
-
Writing the Simplest Emacs company-mode Backend
In Emacs, company-mode (short for “complete anything”) is a framework for performing completion in buffers. [1] It’s an alternative to the popular auto-complete-mode. company-mode supports extension via backends which provide the framework with lists of possible completions in various contexts. So, for example, there’s a backend th(at provides completion …
-
Really useful Xcode plugins
I’m a happy Xcode user, mainly using it for C++ programming. It’s a relatively nice IDE (except for when I need to break out the big guns and fire up Vim for heavy lifting). There are a few plugins that make it an even nicer IDE. This is as much a …
-
Really useful Xcode plugins
I’m a happy Xcode user, mainly using it for C++ programming. It’s a relatively nice IDE (except for when I need to break out the big guns and fire up Vim for heavy lifting). There are a few plugins that make it an even nicer IDE. This is as much a …
-
What is a string?
Most programming languages have some wrinkles around unicode and strings*. In my ficticious language Pepper, there are no wrinkles of any kind, and everything is perfect. *E.g. JavaScript, Java, Haskell, Ruby, Python. There are several key concepts. …
-
Absolute Truth in programming languages
Is enforcing truthfulness the opposite of beauty? Can 2 + 2 = 5? Improvements, corrections, further contributions are welcome. $ cat five.cpp #include <iostream> int operator+( int x, int y ) { return 5; } int main() { std::cout << 2 + …
-
The super() Mystery Resolved
In the previous articles in this series [1] we uncovered a small mystery regarding how Python’s super() works, and we looked at some of the underlying mechanics of how super() really works. In this article we’ll see how those details work together to resolve the mystery.
The mystery revisited
As …
-
The super() Mystery Resolved
In the previous articles in this series [1] we uncovered a small mystery regarding how Python’s super() works, and we looked at some of the underlying mechanics of how super() really works. In this article we’ll see how those details work together to resolve the mystery.
The mystery revisited
As …
-
Options for code reviews with Git
We’re thinking about switching to Git for my work, and I want to be confident we can still support good code reviews if we make the switch. I am a big fan of in-person reviews, and for that, git difftool is enough but sometimes you need to do it asynch…
-
Desktop sharing not working in Lubuntu 14.04
On my recently-upgraded to 14.04 Lubuntu machine, desktop sharing didn’t work. Here’s how I made it work: Once (to allow some Windows clients to connect without encryption): gsettings set org.gnome.Vino require-encryption false Then every time I want t…
-
Method Resolution Order, C3, and Super Proxies
In the previous article in this series we looked at a seemingly simple class graph with some surprising behavior. The central mystery was how a class with two bases can seem to invoke two different method implementations with just a single invocation of super(). In order to understand how that …
-
Method Resolution Order, C3, and Super Proxies
In the previous article in this series we looked at a seemingly simple class graph with some surprising behavior. The central mystery was how a class with two bases can seem to invoke two different method implementations with just a single invocation of super(). In order to understand how that …
-
Writing: Nothing is Set in Stone
My latest Becoming a Better Programmer column is published in the July issue of CVu magazine (26.3). It called Nothing is Set in Stone. It talks about the soft nature of software, and how to make fearless changes.
-
Writing: Nothing is Set in Stone
My latest Becoming a Better Programmer column is published in the July issue of CVu magazine (26.3). It called Nothing is Set in Stone. It talks about the soft nature of software, and how to make fearless changes.
-
Writing: Becoming a Better Programmer
I am delighted to announce that I have signed a contract to publish my latest book, Becoming a Better Programmer with the excellent folks at O’Reilly. You can find out more about the book from it’s catalogue page at http://shop.oreilly.com/p…
-
Writing: Becoming a Better Programmer
I am delighted to announce that I have signed a contract to publish my latest book, Becoming a Better Programmer with the excellent folks at O’Reilly. You can find out more about the book from it’s catalogue page at http://shop.oreilly.com/p…
-
Best GCC warning flags for compiling C++
A recent discussion on ACCU-general gave people an opportunity to share the warning flags they like to use with g++. I thought I’d write down the consensus as I understood it, mainly for my own reference: -Wredundant-decls -Wcast-align -Wmissing-declar…
-
What git server should I use?
At work we are considering whether we can use Git for our source control. I am a big fan of Git, so I’d like to see this happen. We only need to work against a central repository most of the time, so I’m looking at what servers might work for us. Updat…
-
Renewing self-signed certificate for ejabberd
I run an ejabberd server on an Ubuntu 12.10 box and this week I started getting notified by my IM client that the server’s certificate had expired. Here’s how I managed to generate a new certificate. WARNING: this process backs up, deletes and then res…
-
Letter to my MP on DRIP
Sent via WriteToThem.com. More Info Dear Mr Hammond, I am writing to express my concern about the Data Retention and Investigatory Powers Bill (DRIP). I feel that forcing companies to store data on their customers is an unacceptable breach of the right…
-
What is node.js?
Node.js is a way of writing your web applications wholly in JavaScript, which sounds like a terrible idea. However, it is also an asynchronous programming environment that has been proven to scale really well, and it’s a collection of libraries many of…
-
A mini mocking framework
Ever wondered how a mocking framework like JMock or GoogleMock works? We’ll look at how to write a very basic example, and find out that Java is more flexible than you may have thought. Slides: A mini mocking framework.
-
Rational Computational Geometry in Python
In the previous article, we looked at how a standard technique for determining the collinearity of points, based on computing the sign of the area of the triangle formed by two points on the line and a third query point. We discovered, that when used with Python’s float type [1 …
-
Rational Computational Geometry in Python
In the previous article, we looked at how a standard technique for determining the collinearity of points, based on computing the sign of the area of the triangle formed by two points on the line and a third query point. We discovered, that when used with Python’s float type [1 …
-
Business of Software Conference Europe
Kathy Sierra on ‘Motivation Matters’ at Business of Software Europe. Last week our founder Anna attended the Business of Software Europe conference in Cambridge, and it was quite something indeed. Although the Business of Software Conference has been …
-
Business of Software Conference Europe
Kathy Sierra on ‘Motivation Matters’ at Business of Software Europe. Last week our founder Anna attended the Business of Software Europe conference in Cambridge, and it was quite something indeed. Although the Business of Software Conference has been …
-
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…