Author: Andy Balaam

  • 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…

  • 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.

  • 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…

  • 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…

  • 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…

  • 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…

  • 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:

  • 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 + …

  • 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…

  • 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.

  • 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…

  • 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…

  • 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…

  • avconv performance slow in Ubuntu 14.04 trusty

    I noticed that my TV conversion scripts were suddenly running very slowly after upgrading to Lubuntu 14.04. After some investigation it turned out it had started defaulting to using libx264 encoding when the output file was named *.mp4. When I ask it t…

  • Does test-driven development harm clarity?

    In a recent keynote at RailsConf called Writing Software*, David Heinemeier Hansson argues that test-driven development (TDD) can harm the clarity of our code, and that clarity is the key thing we should be aiming for when writing software. (*contains …

  • Token-based 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, adding to the security we already have by making a security token that is stored in a cookie: Slides: Token-based security in a R…

  • Avoid mocks by refactoring to functional

    At this week’s ACCU Conference I went to an excellent talk by Sven Rosvall entitled “Unit Testing Beyond Mock Objects”. The talk covered the newer Java and C# unit testing frameworks that allow inserting mock objects even where legacy code is using som…

  • Using the final keyword in interface method parameters does nothing

    Consider the following Java code: class FinalInInterface { private static interface WithFinal { public void run( final int x ); } private static class WithoutFinal implements WithFinal { public void run( int x ) …

  • Using xscreensaver to lock the screen in Lubuntu

    Recent versions of Lubuntu seem to have broken screen locking. To get screen locking via xscreensaver do this: # Install xscreensaver sudo apt-get install xscreensaver # Start xscreensaver when you log in echo “xscreensaver -nosplash” >> ~/.conf…

  • 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, providing security using HTTP Basic Authorization: Slides: Security in a REST API. Code: poemtube on github.

  • Searching in a REST API

    Series: What is REST?, A Basic REST API, Paging, Search, Security, Token, OpenID. We are implementing a REST API. Today, we provide a basic search. Slides: Searching in a REST API. Code: poemtube on github.

  • Paging in a REST API

    Series: What is REST?, A Basic REST API, Paging, Search, Security, Token, OpenID. We consider some choices of how to provide paging through a list resource in a REST API. Slides: Paging in a REST API. Code: poemtube on github.

  • A Basic REST API

    Series: What is REST?, A Basic REST API, Paging, Search, Security, Token, OpenID. I’ll walk you through the code of a simple REST API I am writing to be a kind of YouTube for poetry. Slides: A Basic REST API. Code: poemtube on github.

  • Avoid backslashes anywhere in Java code (Java error “illegal unicode escape”)

    Did you know you can insert unicode-escaped characters, anywhere in a Java program? Most of us are familiar with using unicode escapes like this: String pound = “\u00A3”; but in fact constructs like \u00A3 can go anywhere, including in a comment. This …

  • What is REST?

    Series: What is REST?, A Basic REST API, Paging, Search, Security, Token, OpenID. The basic concepts of REST APIs: Slides: What is REST?. Code: poemtube on github.

  • Bash arrays

    Bash arrays are a lot like Bash Associative Arrays, but with numbers as keys. Here’s a quick reference. Basics $ declare -a MYARR # Create an array $ MYARR[3]=foo # Put a value into an array $ echo ${MYARR[3]} # Get a value out of an array foo $…

  • Using if:set, unless:set etc. with macrodefs in Ant

    In a previous post I outlined how to use if:set and unless:set to execute tasks conditionally in Ant 1.9.1. Unfortunately, this does not work with macrodefs. When I try to execute a macrodef conditionally like this: <project xmlns:if=”ant:if” …

  • Using if:set, unless:set etc. to execute a task conditionally in Ant

    I’m not sure anyone except me is still struggling on with using Ant, but just in case, here is a nice thing. In Ant 1.9.1 they added a useful feature: instead of needing to use the <if> tag and similar from ant-contrib, you can conditionally exec…

  • Vim for Fun

    I have recently got quite excited about Vim (the text editor), so here is a video showing you the basics. I use it because I enjoy learning it. Slides: Vim for Fun.

  • Working with others in git

    Series: Why git?, Basics, Branches, Merging, Remotes Now I’ve covered almost everything you need to understand the basics of how git works. In this video I discuss how to clone, pull from and fork remote git repositories, and how to send patches and ma…

  • Merging in git

    Series: Why git?, Basics, Branches, Merging, Remotes The last video covered how to make branches and simple merges. This time we look at what to do when you want just one change from another branch (cherry-picking) and how to merge two branches when th…

  • Behaviour of Java String.split() when some answers are the empty string

    Can you guess the output of this program? class SplitTest { static void split( String s ) { System.out.println( s.split( “;” ).length ); } public static void main( String[] args ) { split(“”); split(“;”); …

  • Checking the case of a filename on Windows

    Windows generally uses a case-insensitive but not case-preserving file system. When writing some code that is intended to be used on Linux as well as Windows, I wanted it to fail on Windows in the same cases that it would fail on Linux, and this meant …

  • Branches in git

    Series: Why git?, Basics, Branches, Merging, Remotes Last time we discussed starting a project and committing changes. Now we look at how to create branches, which are one of the main reasons for having source control. We’ll cover creating branches, sw…

  • Passing several values through a pipe in bash

    I have been fiddling with some git-related shell scripts, and decided to try and follow the same approach as git in their structure. This means using the Unix system where each piece of functionality is a separate script (or executable) that communicat…

  • Goodness in programming languages, part 4 – Ownership & Memory

    Posts in this series: Syntax, Deployment, Metaprogramming, Ownership There is often a trade-off between programming language features and how fast (and predictably) the programs run. From web sites that serve millions of visitors to programs running on…

  • How to use git (the basics)

    Series: Why git?, Basics, Branches, Merging, Remotes Git is a very powerful tool, but somewhat intimidating at first. I will be making some videos working through how to use it step by step. First, we look at how to track your own code on your own comp…

  • Using gnome-mplayer to play DVB radio without asking whether you want to resume

    When I launch gnome-mplayer to play back radio over my TV card (DVB), it asks me whether I want to resume from where I left off, which doesn’t make sense for this kind of stream. I couldn’t find a way to switch this off, but a little hacking with gnome…

  • C++14 “Terse” Templates – an argument against the proposed syntax

    Today I attended two excellent talks by Bjarne Stroustrup at the ACCU Conference 2013. The first was an inspiring explanation of the recent C++11 standard, and the second, “C++14 Early thoughts” was an exciting description of some of the features that …

  • setUp and tearDown considered harmful

    Some unit test frameworks provide methods (often called setUp and tearDown, or annotated with @Before and @After) that are called automatically before a unit test executes, and afterwards. This structure is presumably intended to avoid repetition of co…

  • Why use git for source control?

    Series: Why git?, Basics, Branches, Merging, Remotes Putting your code in git is fast, flexible and powerful. You can track versions on a single machine, or scale up to thousands of people working together, with sub-teams, reviews and cherry-picking of…

  • Set the volume in OpenBox/LXDE (or on the command line) with PulseAudio and Ubuntu

    I am switching to LXDE, and enjoying it, but a few things require some manual config before it’s just how I like it. To control the sound volume with the volume buttons, the default LXDE config in ~/openbox/lxde-rc.xml contains an entry like this: <…

  • Everybody loves build.xml (test-driven Ant)

    In the previous post we looked at how it is possible to write reasonable code in Ant, by writing small re-usable blocks of code. Of course, if you’re going to have any confidence in your build file you’re going to need to test it. Now we’ve learnt some…

  • Everybody hates build.xml (code reuse in Ant)

    If you’re starting a new Java project, I’d suggest suggest considering the many alternatives to Ant, including Gant, Gradle, SCons and, of course, Make. This post is about how to bend Ant to work like a programming language, so you can write good code …

  • Dry run mode for Ant (ant -n, ant –dry-run)

    I am working on the problem of writing Ant build files in a test-driven way. One thing I found myself needing was a “dry run” mode, like many Unix tools have. For example, make has the -n or –dry-run option, which shows what it would have done, but do…

  • My First Raspberry Pi Game ” Part 12 ” Scoring, done!

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. Today, we finish! Our game is almost done. All we need to do now is let you play several times, and give you a score at the end. First, becaus…

  • My First Raspberry Pi Game ” Part 11 ” Being less rude

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. We’ve nearly finished our game. Next on our list is to fix that bug where you can’t exit some of the time, and make our code a bit tidier in t…

  • My First Raspberry Pi Game ” Part 10 ” Red square

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. We’re writing a really simple game – you have to press a key when you see green, and not press a key when you see red. I’ve been promising for…

  • My First Raspberry Pi Game ” Part 09 ” Lots more words

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. We’re writing a really simple game – you have to press a key when you see green. This time we’re going to add lots of instructions on each pag…

  • My First Raspberry Pi Game ” Part 08 ” Success and failure

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. We’re writing a really simple game – you have to press a key when you see green. Today we’re going to wait for a key press. If we get one, we’…

  • My First Raspberry Pi Game ” Part 07 ” A green circle

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. We’re going to write a game that tests your reactions – press a key when you see green, but don’t when you see red. Today we see some of what …

  • Launching an OSGi app on the command line

    I am a total beginner on this topic, but here is what I have found so far. Please correct me, advise me etc. in the comments. A colleague has written a program based on OSGi, which is a framework for obfuscating everything “modular” software, which I t…

  • My First Raspberry Pi Game ” Part 06 ” A better class of waiting

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. Today we wait, but better, while we show the ready screen we made last time. In the process we cover two of the most important things you need…

  • My First Raspberry Pi Game ” Part 05 ” Say something

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. Today we will write some writing on that blank screen we made last time. But first, a couple of tricks (we are doing magic after all). We’re g…

  • My First Raspberry Pi Game ” Part 04 ” A small black screen

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. Today we will get an actual window to appear, with nothing on it! Last time we wrote a magic spell describing the bare outline of what how our…

  • Length of Open Source licenses

    I have been choosing a license for my ficticious programming language, Pepper. One consideration is the complexity of the (combination of) license(s) used. Complexity may be related to length, so for your enjoyment, here are the lengths of some popular…

  • My First Raspberry Pi Game ” Part 03 ” It’s like a magic spell

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. Today we will write the very basic outline of our game. When we’ve finished it won’t actually do anything. In fact, it won’t even run. Writing…

  • My First Raspberry Pi Game ” Part 02 ” Saying hello

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Writing your first ever computer program on the Raspberry Pi. See Part 1 for how to get and set up the Pi. Today we will find out how to write a computer program, and how to run it. We’re going to write…

  • My First Raspberry Pi Game – Part 01 – Before we start

    Parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. In this series I intend to guide you through writing your first ever computer program. We will write our own game on the Raspberry Pi, which is a cheap-as-chips computer designed for learning about comput…

  • Running Dojo DOH tests in a browser without a web server

    Dojo’s DOH requires a web server to run tests in a browser. But never fear: $ cd ~/code/dojo $ ls docs dojo util $ python -m SimpleHTTPServer & $ xdg-open http://localhost:8000/util/doh/runner.html Note that you will see some test failures, beca…

  • Bash associative array examples

    Quick reference of things I discovered about how to use associative arrays in bash. Note: bash version 4 only. (See also Bash Arrays.) Basics $ declare -A MYMAP # Create an associative array $ MYMAP[foo]=bar # Put a value into an associative …

  • Running Dojo 1.7+ DOH unit tests on the command line with Rhino

    To run your own DOH-based unit tests on the command line using Rhino: NOTE: this is Dojo 1.7 and above. For 1.6, there was a whole other cryptic incantation. Project layout Imagine your code is somewhere different from dojo, and another library you use…

  • Lambda functions timeline

    I did a talk at work about lambda functions (anonymous functions), and something possessed me to make a timeline of when they were introduced into various languages. Some languages were born with them, and some grew them later – in the latter case I gi…

  • Goodness in programming languages, part 3 ” not doing the same thing more than once

    Posts in this series: Syntax, Deployment, Metaprogramming, Ownership I’m going to use a word here – don’t stop reading: Metaprogramming. Does the language provide what you need to avoid repeating yourself? Repeating boilerplate code, algorithms and mos…

  • Tail Call Optimisation in C++ – lightning talk video

    You can watch the Tail Call Optimisation in C++ lightning talk video, which I gave at the ACCU 2012 conference in April. You can also read the (clearer and more correct) writeup I did later: Tail Call Optimisation in C++ or the subsequent article publi…

  • Cool Raspberry Pi Projects

    Someone claimed that everyone who has a Raspberry Pi has done what I did with it: try it out then file it in a drawer marked “must play with later”. To try and debunk this claim, here are some cool projects I have seen. Update: I made some videos on ho…

  • Scheme 7: Macros video

    Series: Feel the cool, Basics, Closures, Recursion, Quotation, Lambda, Macros. Continuing the series on Scheme, this video explains the ultimate alternative – when nothing else is flexible enough, we can create our own bits of lanugage using macros. …

  • Scheme 6: Lambda video

    Series: Feel the cool, Basics, Closures, Recursion, Quotation, Lambda, Macros. Continuing the series on Scheme, this video explains the lambda function, which allows you to define anonymous functions. It goes on to bend your mind with 2 examples of the…

  • Tail Call Optimisation in C++ published in Overload journal

    You read it here first, but now you can have a paper version of “Tail Call Optimisation in C++”, published almost as-is, in Overload 109 the journal of ACCU.

  • Scheme 5: Quotation video

    Series: Feel the cool, Basics, Closures, Recursion, Quotation, Lambda, Macros. Continuing the series on Scheme, this video explains on of the most powerful and unfamiliar features of Scheme: quotation. Quoting allows us to talk about and manipulate cod…

  • Scheme 4: Recursion – how to write functions in Scheme video

    Series: Feel the cool, Basics, Closures, Recursion, Quotation, Lambda, Macros. Continuing the series on Scheme, this video describes the way you write code in Scheme: recursion. Recursive functions can be pretty efficient in Scheme, if you structure th…

  • Scheme 3: Closures video

    Series: Feel the cool, Basics, Closures, Recursion, Quotation, Lambda, Macros. Continuing the series on Scheme, this video describes an important feature of functions in Scheme: closures. Closures allow functions to carry their “environment” around wit…

  • Scheme 2: Basics – pairs and lists video

    Series: Feel the cool, Basics, Closures, Recursion, Quotation, Lambda, Macros. Continuing the series on Scheme, this video describes some of the things you will need to understand to be able to write real programs. I introduce pairs, lists, and navigat…

  • Scheme 1: Feel the cool video

    Series: Feel the cool, Basics, Closures, Recursion, Quotation, Lambda, Macros. Here’s me trying to persuade you to be interested in a 40-year-old programming language, called Scheme, which is a type of Lisp: Slides for Scheme 1: Feel the cool

  • Generalising tail call optimised C++

    This series: Lightning talk, Explanation, Performance, Generalisation. In previous posts I discussed the construction of some C++ that does the same job that the tail call optimisation does in some other languages. The example code given showed the cas…

  • JavaScript WTFs Videos

    I recorded some videos of my JavaScript WTFs presentations: You can get the JavaScript WTFs slides. Update: all six episodes: JavaScript WTFs 1 – The Global Object JavaScript WTFs 2 – Equality and Inequality JavaScript WTFs 3 – Syntax JavaScript WTFs…

  • Closures in Scheme

    Update: watch the video In this series on Scheme: Intro, Basics, Closures. Here’s a presentation I did recently, on Closures in the Scheme programming language. Closures are the way the environment in which a function was created hangs around with it a…