January 4, 2006

Welcome to the GNUstep cookbook. This document provides a variety of different recipes for the GNUstep programmer. Recipes are explained and the source code is included. Recipes are code snippets that the programmer can quickly get a grasp on, without having to work through the complex logic of a complete application. The TGZ archive of this cookbook contains the LaTeX source as well as the source for each recipe, which may be more material than what we discuss in the text. The URL is http://www.gnustep.it/marko/. We hope that this cookbook can be of use to you in your everday GNUstep programming needs and encourage submissions that fit the recipe format. Enjoy! (With corrections by Wim Oudshoorn.)

Contents

1 Combinatorics

1.1 Counting I: Subset enumerator

1.2 Counting II: Permutation enumerator

1.3 Steganography

1.4 Working with GMP integers

1.5 Enumerating graphs with Pólya’s theorem and GMP

1.6 Backtracking I: The n-queens problem

2 Processing mouse events

2.1 Selecting a part of a static image

3 Working with tasks

3.1 User may interrupt read from task

3.2 Frontend to df

3.3 Code browser with find and grep

4 Distributed objects

4.1 Connect four

5 CGI programming

5.1 Web server

5.2 Read GET and POST variables from forms and URLs

5.3 Working with cookies

5.4 Webchat with MySQL

6 Puzzles

6.1 The Sixteen Puzzle

7 Miscellaneous

7.1 Color picker with X11

7.2 Screen grab with X11

1 Combinatorics

1.1 Counting I: Subset enumerator

1.2 Counting II: Permutation enumerator

1.3 Steganography

1.4 Working with GMP integers

1.5 Enumerating graphs with Pólya’s theorem and GMP

1.6 Backtracking I: The n-queens problem

2 Processing mouse events

2.1 Selecting a part of a static image

3 Working with tasks

3.1 User may interrupt read from task

3.2 Frontend to df

3.3 Code browser with find and grep

4 Distributed objects

4.1 Connect four

5 CGI programming

5.1 Web server

5.2 Read GET and POST variables from forms and URLs

5.3 Working with cookies

5.4 Webchat with MySQL

6 Puzzles

6.1 The Sixteen Puzzle

7 Miscellaneous

7.1 Color picker with X11

7.2 Screen grab with X11