Andrew Cooke | Contents | Latest | RSS | Twitter | Previous | Next

Lessons Learned with Erlang

From: "andrew cooke" <andrew@...>

Date: Mon, 4 Jun 2007 06:35:15 -0400 (CLT)

I have implemented various versions of a "Parallel Sudoku Solver" in
Erlang.  These notes try to capture some of the lessons I have
learned.

They are written with an eye on Jonathan Sillito's recent work adding
similar (message sending) functionality to Ruby - I think there are
some interesting issues about "transplanting" ideas from one language
to another (one that includes mutable state but excludes efficient
tail calls) and, at a more practical level, implementing state
machines in an OO language (something I have worried about,
intermittently, for years).


Implementation Details

A quick reading of the latest code at
http://www.acooke.org/cute/ReducedRan0.html shows that it is an
almost-declarative description of a state machine.  Each state
(starting, searching, asserting, swapping, sleeping) is embodied as a
function.

Messages are received in a particular state.  The logic in that state
(compactly described with pattern matching) selects a transition.
Transitions are helper functions that may send a response message
before calling a new state.

Tail calls are used throughout.  Since Erlang "optimises" such calls
no stack is consumed in the transition and the implementation does not
have to be concerned with "returning" (an alien concept for state
machines).

Some messages are common to more than one transition.  These are
handled by a single function which takes the following state as an
argument (first class functions simulating continuation passing).


Traditional Functional Strengths

The code illustrates how Erlang plays to functional programming's
traditional strengths:

- Pattern matching (extended in Erlang with conditions using a
  restricted range of predicates) allows program logic to be expressed
  in a clear, concise manner.

- Explicit state and tail call optimisation simplify transitions
  between states.

- First class functions allow easy generalisation of transitions.

Together these make it easy to directly embed a state machine in the
source code.

Erlang also provides, in the OTP platform, "behaviour" support for
state machines.  I have not yet investigated this.


No Magic Bullet

Erlang's message passing approach does not "magically" fix the
problems inherent in concurrent software.  During development I
stumbled across deadlocks and inconsistent state more than once.  What
it does, however, is allow the code to be structured so that the
assumptions, state and logic are easy to read.  This helps ad-hoc
reasoning while debugging and allows issues to be resolved relatively
quickly (this is a relatively subjective view and I have no more
objective evidence).


Lessons Learned

The following approaches (patterns?) were helpful:

- Match for unexpected messages (and fail with a message when you
  receive them).  This is analogous to the default case in case
  statements.

- Use a fixed format for mutable state (ie the arguments to the
  functions that represent states in the FSM).  This allows general
  transitions which take the "next" state/function as an argument.

- Use tagged tuples for messages (ie first tuple value is an atom that
  "names" the message).  This is a recognised custom in Erlang and
  gives ad-hoc typing.

- Use {name, {payload...}} pairs for messages (ie the payload is a
  separate tuple).  This allows matching on the name (eg {type,
  _Payload}) without hard-coding the payload structure in each
  pattern.

- Fail deeply.  When failure occurs, fall back to as basic a state as
  possible.  Avoid states that loop on failure, immediately repeating
  the action, since this encourages deadlock (an example directly from
  the code: in the swapping state, failure to swap was initially
  handled by a second attempt at swapping.  This eventually lead to
  deadlock with all cells requesting swaps from other cells.)

- Avoid invariants.  This is a hard one, because invariants are so
  useful, but maintaining an invariant across several threads requires
  detailed negotiation that cannot always "fail deeply" (in the
  "community invariant" described below a cell that attempts to swap
  its value with another cell cannot process further requests that
  modify its state - assertions or swaps - until it has a reply from
  the swap partner).

- Use explicit, restricted protocols.  "Fail deeply" and "avoid
  invariants" drive the system towards a "permissive" protocol.  This
  should be resisted as much as possible, since it becomes difficult
  to detect errors (ie "Match for unexpected messages" becomes less
  useful).


Ruby Library

My main concern for the Ruby library is that a lack of efficient tail
calls means that complex state machines cannot be easily separated
into distinct functions (one per state).

There seem to be two solutions: either use trampolining or represent
state as a variable rather than a function.  It would be interesting
to explore these two avenues - it may be that they suggest an
alternative syntax better suited to Ruby.


States as Objects

The natural approach to state machines in an OO language without
support for unlimited tail calls seems to be:

- Each state is an object

- Each state implements a standard interface ("run" or similar) that
  returns the *next* state

- Have a outer object (the state "machine") that manages the process
  of calling the standard interface on the successive states.

- As I noted 8 years ago - http://www.acooke.org/andrew/smachine.html
  - machines can themselves be states.

Reflecting a little on the comments above it becomes clear that this
combines both approaches described in the previous section - the state
is a variable whose value is the current state and the outer machine
object is the "trampoline".

So I guess I have answered my own question - it should be possible to
adapt the code to use an approach like this.  The remaining issues (eg
does each state create the "next" state on every call, or is there a
pool?) seem to be mainly book-keeping.


Translating to Ruby

If the above is correct then most comments here also apply to code in
Ruby.  The main changes are:

- Tail calls are replaced by the trampolining approach described
  above.

- "Generic" transitions would be methods in a shared superclass rather
  than functions that take a "next state" function.


Algorithm Discussion

The algorithm used is, obviously, a poor choice for solving Sudoku
puzzles.  Peter Norvig has already given a textbook-perfect solution
at http://norvig.com/sudoku.html

However, the parallel approach it is still useful as an example for
learning Erlang/message passing:

- It addresses a fashionable issue, which is motivating (received
  attention from Reddit, for example).

- The initial approach is manageable for a newbie.

- Progressively more complex solutions to be introduced (eg
  maintaining the "community invariant" so that one of each digit is
  used in each "block of 9").

- Finally, it is also possible that in some situations (although, in
  my experience, less often than one believes when faced with an
  apparently difficult problem) "guided random" exploration of the
  solution space is the only tool left.

Motivated by the last point, and because I find the issues
interesting, I will use the remaining sections of this note to comment
on the various strategies used (the history is somewhat simplified to
present the main points - in practice there were many more dead-ends
and mistakes).


Algorithm: Random Exploration

The original implementation modelled each cell as an independent
entity aware only of those cells with which it must not (in the final
solution) conflict.  At random it would send a message to one of these
"competitors" asserting a value.  If the two cells conflicted, one of
the cells had to change to a new (random) value.

While this is pretty much brain-dead as a practical optimisation
scheme it has one critical property that we rely on and must preserve:
its fixed point is the solution required.  In other words, if it ever
reaches a consistent solution it will not change values further
(because there are no conflicting cells).  This allows us to detect a
successful solution by monitoring the (lack of) activity in the
system.


Algorithm: Community Invariant

The solution space explored initially is huge (9^81 = 2e77 candidate
solutions).  This can be drastically reduced by guaranteeing that each
digit from 1 to 9 is used just once in each "block" on the sudoku
grid.  This reduces the number of candidate solutions to 9!^9 = 1e50
(an improvement factor of 2e27).

Implementing this invariant took some care - see the "Lessons Learned"
for more details.


Algorithm: Reduced Range

Cells maintain a list of "legal values" which is modified when they
interact with a "given" value.  In this way Cells "learn" to avoid
values that are guaranteed to conflict.  This is "first order"
constraint propagation.  I have not measured the effect of this change
but we can make a rough estimate: if each digit can conflict with two
given values, on average, then any particular arrangement of a block
has a probability of (7/9)^9 = 0.1 of being correct (wildly assuming
independence).  That reduces the number of candidate solutions by a
further nine (number of blocks) orders of magnitude.


Algorithm: Weighting

Each cell maintains a "weight" that reflects the "confidence" in the
current value.  New values have zero weight, and weight increases when
an assertion from a neighbouring does *not* conflict.

Weighting can be used to guide behaviour when two cells interact,
comparing and exchanging values.  When comparing values the cell with
lower weight is the one that changes; swapping is only successful with
a lower weighted value in the same block.

In this way weighting increases the persistence of more likely values
and so "guides" the system to a self-consistent solution.


Algorithm: Greediness

The simple weighting described above is too strong.  It encourages the
growth of self-consistent "structures" of cells, but does not allow
these structures to be discarded when they block the correct solution.

The "greediness factor" introduces some noise into the weighting
decisions.  A greediness of 0.9 means, roughly, that weighting is
followed only 90% of the time.  In this way even strongly weighted
cells can be forced to change value.

Watching the program run (if configured to print a snapshot every
second or so) it is easy to see how varying the greediness parameter
affects the solution search.  A value of 0.9 gives a system that
oscillates between fairly long periods of detailed refinement, when
only a few "uncertain" values are changed, and shorter intermittent
sessions of more violent change, when nearly all values value.  With a
value of 0.5 the detailed searches are shorter; "wide-scale" changes
are more common.

While useful, an adjustable parameter requires tuning, which is
difficult when the test case takes several hours to run.  Also, there
is no guarantee that a single "good" value of greediness exists for
all puzzles.

Andrew

Parallel Sudoku solver in Stage

From: "andrew cooke" <andrew@...>

Date: Tue, 5 Jun 2007 07:01:39 -0400 (CLT)

Jonathan Sillito's work, which I mentioned above, is now online at
http://sillito.ca/stage/sudoku.html

Andrew

Comment on this post

This is my blog. It used to be a mailing list called C[omp]ute. It is still generated by email. You can reply to comments via the appropriate link. Edit the mail address to remove the anti-spam measure. However, given the very low volume of replies, and the high rate of spam, it can be months before I moderate a post. Sorry. © 2006-2009 Andrew Cooke (site) / post authors (content).

I am always interested in offers/projects/new ideas. Eclectic experience in fields like: numerical computing; Java web/enterprise; functional languages; Python client GUI/web/database; etc. Based in Santiago, Chile; telecommute worldwide. CV; email.

Last 1000 entries: Auto-Scaling Date Axes in Python; Setting File Permissions in Subversion; Easy Slide-in Menus using YUI 3; More Benchmarks; Generating SVG in Python 2.4; Future Work; RXPY Benchmarks; RXPY Update - Beam Engine; Forensics Using Frequency Variation of Mains Supply; UK Torture; More on CAP; Cloud Computing; GPU in the Cloud; How To Choose NoSQL; Empty Loops in Regular Expressions; Theano Experience; Compiling Python Numerics to GPU wuth Theano; Anybots - Physical Presence for Telecommuting; Fame! (Bonneville Power); Efficient List Slices in Python; Useful Jazz Lists; Is Deepwater Failing?; Fuck Yeah; Closures and Anon Functions in Java 7; Supercomputing Superpowers; Debugging A Hung (Spinning) Python Process; Interpreter for Python Regexps; The Nature and Future of Philosophy; Plus Memoisation; LEPL Optimisation with URL Validation; Erik Moeller - Defamation; Free Map-Reduce Book; Blocking MAC addresses with OpenSuse Firewall; Random Matrix Theory; Small Town Romance; Gravity from Information; Forcing Visual Processing into Boolean Logic; SXSW Economics; Museo Allende; SSL MIM Paper; Avoiding SSL Man In The Middle Attacks; OpenCL Examples; Re: A Practical Introduction to OpenCL; Battery Life; Visiting Rancagua; Visiting Santiago; Fully Homomorphic Encryption; Essays Questioning Market-Based Solutions; Not Monads!; A Practical Introduction to OpenCL; Triple Canopy (Magazine); RequestPolicy URL; RequestPolicy; Undead Links; Un-greyed Text; Hiding HN Karma; C Object System; Spam Filtering Details; Efficient Spam Filtering With Mutt and SpamAssassin; Lepl 4 Preview - Simpler, Faster, Easier; Prolog, LEPL, Phone Numbers; Mutt Working Well; Leaving GMail...; Quora Challenge; Good Haskell Example; Do not go gentle into that good night; OProfile - An Alternative for Profiling Java (and C); The Movies of Clint Eastwood; Automate my Ire; Proud to be (Almost) Chilean; Pan Fresco en Providencia, Santiago, Chile; Earthquake in Chile; Why More Equal Societies Almost Always Do Better; More Names + Books (Economics); Stommel Diagrams - Time v Space log log plots; Fermi Dying?; Windows Don't Minimize in KDE 4.3, OpenSuse 11.2; Compressed Sensing; The Complexity Era in Economics; Extra Notes on Repeating Install; Fossil - DVCS + Wiki + Bug tracking; Kingston SD Cards, Economics, Hardware Hacking; Here we go...; HLVM - High Level VM on LLVM via OCaml; Information Retrieval, Transmission + Quantum Computing; Corralillo Winemaker's Blend; Matetic Vineyards; South Butt's Reply; Metacompilers; Critterding, Polyworld (Evolutionary AI Sims); Visiting Bariloche (Balcones al Nahuel); UYKFD Description; Formal AI (Solve all Problems); Updated instructions; tomcat default servlet patten matching -- thank you!; Google Social Search; Books On Suburbia; Generating Syntax Errors from Examples; Thought Crime - The Heretical Two; Video of Pro-Pinera/Pinochet Protesters; Pinera, Chile, Economist; NNMF - An Alternative to SVD; Unladen Swallow Is Dead Duck?; Norvig on Non-Parametric Analysis (+ Other AI Videos); Retrospective on the Guantanamo "Suicides"; Developing OpenCL Code with an Intel x86 CPU; Redmine Project Management; Enable PCIE Too; Logitech MX Anywhere Mouse with Linux (Review); Relationship between EM and MP?; M3U to PLA (PLP?) Playlist Format Conversion; iRiver E30 MP3 Player (A Review); Models of Human Sociality; More Notes on GPGPU Programming; Traditional Telephony is Dead; Persisting Knowledge Across A Changing Workforce; And He's In This Too (Cynical - So Correct? - State Of World); Excellent Doctorow Column; Confirmed?; Detailed x86 Profiling; Unladen Swallow to Merge with Python 3?; Further Optimisation with OpenCL; Blocks Villa San Luis; How To Be Happy; Matlab/OpenCL Cross Reference; Calling OpenCL Directly; Pinera's Campaign Graphics Have Improved; Perceptual and Fuzzy Hashing; Encyclopedia of Symbols; Create You Own Programming Language; Can It Get Any Worse?; Logically Laid-Out Musical Keyboard; Chilean Presidential Elections; Lessons Learned (Not Mine!) with Crowdsourcing at the Guardian; Couple More Network Links; The Future of Telephony; Codenode - Python Take on Mathematica Notebook; More On OpenCL and Matlab Here; Experience Optimising Matlab Code with OpenCL (NVidia GPGPU); Or Simply Don't Use The Libs; Workflows; VisTrails; Good Local Santiago Tours; More Details on Java Extensions; Tribute to Jim Gray - Free Book on Data Processing Future; Voynich Manuscript Decoded?; Mogile FS; Correct Exponents; Trafigura Now Attacking BBC; Detailed Example of Climate Change Sceptic Debunking; Lemonade Recipe; XTRMNTR; Regular Expression Matching: the Virtual Machine Approach; BSGP: Bulk-Synchronous GPU Programming; Cassandra; Analytics - Jobs for the Future; NoSQL Papers; Extern C; Calling OpenCL from Octave / Matlab; Notes on Array Layout; My Day With The Mental Health Professionals; How To Write Good Cron Jobs; Dark Matter Found?!; Reflections on Playlist Generation (UYKFD); Lazy Parsing; Bad Memory; Intel Drops Larrabee; Python Code to Compile Regexps; Heart Monitor Watch + Hackable Hardware; Live Map of Shipping; Synergy Updated; Good Ideas for Dates; Radioactive Boy Scout; UK's "Terrorism" Laws Used Against Innocent Schizophrenic; Generating Uniform, Correlated Random Numbers; Etherial Electronic Art; Fool Me Once; Squeezebox Duet Not Connecting to Server; WTF - Closures in Java 7 After All?; American Airlines fires AA.com designer for reaching out to customer; Visualizing Empires Decline; Electronic Fratricide; Another Go v Python Comparison; Wrong Attribution; Google's Go Slower than Stackless; Significant Objects; Offensive US "Cyber" Operations; Scala Style Guide; NVidia's own Demos; Simpler, but "Micro"; MITM Attack Against SSL; SimHashing - Detecting Similar objects with Hashes; Wire Music Lists; (Not So) Random Walks on Graphs; What We Actually Know About Software Development; The UK did it first!; UYKFD Progress - Playlist Generation from LastFM Tags; Diagrams Through Ascii Art - Coolest Software this Millennium?; Scala for Generic Programers; Carl Jung's Red Book; Interesting Comment (+ Pointers) on Architecture; Frei Campaign Posters; Free Will, Determinism, Compatibilism; Exotic Chocolates in Santiago, Chile; Matlab on NVidia GPUs; Installing OpenCL on OpenSuse 11.1; Where Would a Do-Gooder Do the Most Good?; TXR - Pattern Matching / Template Language; The Sirens of Titan by Kurt Vonnegut, Jr; Follow-up in Guardian; Larrabee Dirt + Background; Guardian Censored over Trafigura Questions; Good Background on OpenCL etc from Anandtech; Using Java Collections in Scala 2.8 (and 2.7); Software Quality Mythology; NVidia Just Released OpenCL Support; And If You Still Don't Get It; Outer Join and Sub-Select Example for Empire DB and Scala; Calling REST Web Services from Java (the Java WS Ecosystem); Auto-Delegation in Scala using Implicit Conversion; Using Scala with Empire DB; Why Does Democracy Need Education?; Setuptools for Python 3 (is called Distribute); Switched to Emacs; TxtSushi - SQL for ASCII Files; Something That Shows How Google Wave Might Be Cool; BitBucket Outage Details - Cloud v DDOS; Congratulations Mule - Europe-Wide Win!; Single Line; Lagged Cafe - Kashiwa Mystery Cafe; DSLs (implemented with Haskell) Help Build Microsoft's new Multicore OS; Implement Phonetic Name Searches with Double Metaphone etc; BOUML - A UML Tool with Reverse Engineering; Fixing IntelliJ Idea 9 EAP on 64 bit Linux (Could not find agent library); Empire DB Example with Scala; Free Scala Book (Programming Scala); Attack on MD5 Based Authentication for Popular Sites; Text of AP "Writethru" on Polanski; Revised Instructions for Adding Dependencies; Interview; More on Scala; Scala in More Detail; Trying Again (New Instructions); Scala Bug Report; Starting a Scala Project; Testing Pollsters - 538 v Strategic Vision; Measuring Complexity; Books to Read (Best of Decade, Millennium); GRRF - The Last Lecture; Java / Scala Bindings to OpenCL; John Abercrombie Organ Trio, Santiago, 24 September 2009; As Rigid as Possible Shape Interpolation; The Poor (well, Over-Extended) Middle Class; Quantum Computer Factors 15; Diesel Asynchronous Network Apps in Python (uses Coroutines); Django Template Tips; Starting a Linux Computer Remotely (WOL / PME); Causality - Inferring Causal Networks; Algorithmic Game Theory (Free Book); Running "find" in Parallel; Network Protocol Description Language; PyOpenCL - Python Layer to OpenCL GPU Programming; Would You Work With These People?; New Johnston Sans Typeface (the Underground); Delayed due to State; How Stupid is eBay?; String Theory is Just a Technique for Summing Terms in QCD; One More Reference; Iranian Gold and Cash (nearly $20bn) in Turkey?; Noop (no-op) - New JVM Language from Google; More Offside Documentation; Rethinking The Firm; Renault Told Piquet's Son to Crash; Hardware Hacking - Pictures from Space; Replies Work Too?; Moving to WebFaction; La Nana (Chilean Film); What's so Neat...; Offside Parsing Works in LEPL; How a Construction Crane is Made (Builds Itself); More Al-Qaida Details; And the X1; Leica M9 (Full Frame); Dark Stalking on Facebook - Tracking Invisible Identities; Al-Qaida Faces Recruitment Crisis; NSA Intercepted Emails used in UK Liquid Bomb Trial; A Review; Extended Bash Shell (Including ASCII Plots); RSS Cloud - Putting the Push in RSS?; Mercury Prize Nominees; Raphael - Javascript Library for Graphics; Domain Specific Language Conference (Papers etc); Rhonda 3D Drawing Program (+ Video); PyDev 1.5.0 now All-Free; Page Rank Gives Critical Nodes - Extinctions; Designing Crypto is Hard (Schneier - Don't Use AC); Yike Electric, Foldable Bike (Exists?!); Faster with Overvoltage; Negative Interest Rates in Sweden; Overclocking Q9550 with Asus P5Q; H1N1 Virus DNA and DIY BioTerrorism; GF1 Preview; Panasonic GF1 - Grown up LX3; Tweeting from the Linux Command Line; Cheap, Simple, Massive Storage; Thanks for this; Coders at Work (Book); Netflix Culture; More Indentation; Representing Indentations for Parsing; More Quads; Hidden Cost of Coroutines?; Interview with Amartya Sen; Article on Coroutines, Python, State Machines; Amazon, Clouds, etc; Pylint and Python 2.6; P / NP Summary; Depression's Evolutionary Roots; Economist Review; Intel Quad Core Prices; Scotland needs no lessons in matters of fairness from a country that has been routinely waterboarding suspects in Guantanamo Bay; Free Book on MetaHeuristics; Scheme to split in two; Hopelessly Naive; Stalin Had Similar Ideas; Sean Smith; Life is Good; Afghanistan - Reportage / Photos in Guardian; Pictures for Sad Children - Airshow; Also, Lombok; Mixins For Java; Rules For Use; Automatic Banknote Detection; Using Computers to Help Scheme Against Paying for Bhopal; Distributed Teams Build More Modular Products; Schumacher > Anonymous Pro; Anonymous Pro - Better than Schumacher?!; Amplifiers + Computing Theory Blog; Proven OS Kernel; Mail Based Blog + Gmail; Generating Pie Charts in SQL; More Analysis on the VMWare/Spring Deal; CPU/GPU Unification; VMWare buy SpringSource!; Hardware Entropy Source (USB!); Better Wave Analysis; Older, Happier, Wiser; Analysis (Negative) of Google's Wave; More Info On Concepts; Panasoni'c Micro 4/3 (MFT); Drug Company Ghost-Writes Papers; Linux Disk Config; Blue LEDs on PeeCee07A (PC2500e); Gregory Thielker; Language Workbenches?; Random Art + Cryptography; Initial Impressions - Via C7-D Barebones with Opensuse; Amitai Etzioni; Why are people with "tone-deafness" bad dancers?; DLink DUB-E100, Opensuse; Named Tuples in Python (and some Cairo contexts); Stroustrup's Take; C++ Concepts Dropped; Moved to GMail; Mail-based Blog; System Re-factoring; Enabling speaker beep as KDE notification; UK Police Arrange for Suspect (in UK) to be Tortured (Abroad); Extended to 3D; The Soft Heap: An Approximate Priority Queue with Optimal Error Rate; Godel Prize; Original paper; Facebook / MySpace Social Divide; Only Early Kernels; Cygwin SSH Server on Windows 7 RC; Using a Directory (Package) for Django's Model; Compiling pgplot on opensuse 11.1; Comparison of Dual Core E4700 and E6400; Erik Naggum Dead; Oracle on OpenSuse/Linux; Yup; Olympus Pen EP-1 (Micro 4/3) Details; More Iranian Analysis; Improving Nicotine's Response; Neo4j - a Graph Database; MISC - Lazy Lisp with Maps; Nortec Collective - New Album; The Sorry State of UK Politics; Two Contrary Views on Iran; Some Rape Stats Background; More Overvoltage Results; New Mobo; Caring About Programming Languages; Reflections on First Consultancy Gig; Google Squared; Windows 7 on VirtualBox; Smart File Visualisation; Boomerang - Lenses for Text; Datalog Jobs; RT61 Notes; Remote X for Single Programs; Sorting Morphisms; Computers and Intractability; Although Rather Drinkable; Bugger Carmen and their Grande Vidure; A Bomb Won't Go Off Here; 50 Ways to Change Minds; Sector/Sphere - Distributed Computing on Widespread, Heterogenous Networks; Linux-based Cracker Tools; Dear Esther (Half Life 2 Mod); MySQL Forks; Factor of 2 (Northbridge Explanation v2); A Beginners Guide to Forcing; Tiny STM; Erlang Influence?; CUDA Course; Protocol Support; Axum - New Concurrent Language from MS; Not Quite; 92% Faster; 92% Faster; Overclocking E6400 by 60%; Eight stories on Obama [...] censored from the Guardian, Observer, Telegraph and New Statesman; Trying to Explain why Mercurial is Good; Mandriva; With Eclipse; Add wwwrun to hg group; Writing to Mercurial; Renewing Chilean Visa; Interactive Mode in PEvolve; Using Mercurial on OpenSuse 11.1; Logitech Duet Love; Clarification from Anandtech; Initial Tokenizer Results for LEPL; Dead from beating?; New Edition of Parsing Techniques; The police: Unaccountable, secretive and out of control; Same Guy; 2.3 Released; Another Thought; Caveats; Compiling Recursive Descent to Regular Expressions; Compiling Recursive Descent to Regular Expressions; Much Better via Co-Routines; Much Better via Co-Routines; Much Better via Co-Routines; Much Better via Co-Routines; Peyton Jones - Implementation of Functional Programming Languages; Great Moments in Logic; The Quiet Coup; Logging Slow Queries in MySQL; Dabo - Desktop Application Framework (Python); Epsilon!; Original NFA; Initial DFA Results; Squeezenter on OpenSuse / Linux - Couldn't create command line for ogg playback; Legalising Polygamy in Utah. Ha ha ha.; Implementing a Regular Expression Engine; New Server Configuration; Converting NFA to DFA; Converting NFA to DFA; Converting NFA to DFA; And...; Browser Ball; Auto-layout of Graph Components; Good Article on Poverty in the UK; Does Make Sense; Possibly Complete; Incomplete; PyPy Getting Somewhere?; Corrected Test; I Just Wrote a Regular Exression Engine!; Freaking Awesome YouTube Mixes; Charles Freeman (National Intelligence Council nominee) Statement; 40-fold Speedup in LEPL Parsing; Cities of Bronze and Glass; Cities of Bronze and Glass; Modify Audio with Python; LEPL 2.0 Released; Protocol for copying updated files; Simple LLVM Example - Lisp; MCL - Relatively New Clustering Algorithm?; Fascism now back in Italy?; Declarative (Auckland) GUI Layout; Cybersyn; History of Twentieth-Century Philosophy of Science; Nice Short Summary of Ant v Maven; Yes but no; Sensible Statistics for LHC Risk (Bad News); Simpler Version of Above; Current Economy in Perspective; SSDs Suffer from Fragmentation Issues; LEPL Roadplan; Finally, Clean Main Loop; Simplified Code; Correction on Python Stack; Trampolining Code; Clearer; More on Co-Routines; Transparency Key; Handling Yield; Join The Discussion (Really!); Join the Discussion!; Avoiding the Python Stack; Positive Report on Venezuelan Economy; Papers on Handling Left Recursion in Top-Down Parsers; Works now; Transparent Python Proxy Object for Circular References; Python 3 Instance Attributes as Methods; Alternative Representation; Simple Tree Rewriting; Python Code for ASCII Trees; Natural Language Processing in Python; More Madoff; Recursive Descent Parser; Bria Di Novi; Update; Google Alerts (and LEPL, and setuptools for Python 3); Low Latency(?) Kernel for OpenSuse 11.1; Later; Strange Moderation at BB; Max Richter, Prefix, OpenSuse 11.1; Overview of Python Packaging Tools; Error Handling in Recursive Descent Parsers with Backtracking; A Thought On Obama's Inauguration; The Book; So, the King Of Thailand...; "in" as Operator; Happiness...; Python's Operators; Python 3 in OpenSuse 11.1 and Eclipse; Information on Universe's Event Horizon...; Re: OFF; OFF; TiddlyWiki on Tahoe; Tahoe Least Authority Filesystem / AllMyData.org; More wxPython and OGL; With Bactracking; Syntax; Parsing Credits; New Parser in Python; Food in San Francisco; Updated PPOE Script, Extra Tricks for WebMail; Some Notes on OGL with wxPython; Suspend Broken; Bomb, bomb, bomb...; OpenSuse 11.1 on Lenovo/IBM Thinkpad X60; More Ideas; Gaza; Slice Mechanics; Stupid; Since when did Last.fm start to suck so much?; Rethinking Parsing; Radio David Byrne; Pick of the picks (Guardian photographers) + Internet; Problems with OSX (Apple Mac); Script to convert WMA to MP3 on Linux; Command line player for listening to SqueezeCentre on Linux; Basic HTTP Authentication with XMLRPC in Python; Gaza; Tweaking Beagle and KDE; More on Marcela Moncada; Marcela Moncada at the CCU, Santiago; Schrodinger Book Review; Natanz, not Naratz; Snobol Like Matching in Python; Woman Living in Jeddah; Simple Physics Using Verlet Integration; Updated Raid Data Scrubbing Link; Predictably Irrational; Nuclear Enrichment Technology; Recent DnB; Script to Fix MP3 Directories; Young people and territoriality in British cities; Projections; Cube - Series of Images for Laser Printer; This project died soon after...; And even if you won, you lose :o); Madoff as a Jew; Beagle, Computing in Science and Engineering; Fundacion Rodelillo; Use Logitech Squeeze (Slim Devices); Separate DAC for Headphones; SqueezeCenter/SqueezeNetwork; SqueezeCenter gets better!; Logitech Squeezebox Boom on OpenSuse; Krugman - Absolutely Right; Early Investigation into Madoff; Script to Check for dsl0; Another Positive Assessment of Chile's Position; Slowly making more sense; PPOE on OpenSuse; Quantum Bees; EmpireDB - SQLAlchemy for Java?; Bowery Electric; Zimbra (Messaging and Collaboration); Bolano + Sebald; Santander Security; BCI Customer Service (Chilean Bank); Good Intro to PyParsing; Two Essays on Bolano; Financial Regulation; Chilean Liquidity Crisis, November 2008; Batter Control via SMAPI; Not So Fast; Font Size; Extending Battery Life on X60 (OpenSuse, powertop); Dario Urzua 1780, Providencia, Santiago; When Agile Projects go Bad; Practical Comments about DSLs; Books I Should Read; Monster Truck Video; MicroFinance in Chile; Chilean Companies to Avoid; On the Other Hand; Background on Hedge Funds; Paper in Compression; Quantitative Easing for Dummies; Balada del Elefante Azul; Mass and Renormalization; Why CitiGroup is About to Be Bailed Out and Not General Motors; Joost in Decline?; Excellent; Thinking About Databases, Efficiency and Technology; Decent Summary of Citibank; Looking Good, Chile; BNP Membership List; Etherpad; NOAO DPP Changes; Correlations; Fast Is Not Necesarily Bad; about the article; Triggerfish Cellphone Locating; Actually, no...; CDSs a Good Thing?; Chavez airs wiretaps of political rivals; iBATIS Caching; Are Chilean Bus Stations Safe?; Microsoft OSLO (DSL Framework); Decline + Fall of Agile; Plop / MOSES; Food; Declarative Validation of XMLRPC Responses in Python; More on Moodys etc; Social Terrorists; Declarative Mini-Languages in Python; Learn Prolog Now; How Palin was Picked; Newer Bus Info; More Bus Notes; Bus Travel from Santiago, Chile; Some decent Chilean (and Mexican) Music; More Info on IBatis-Based Project; Nice Plot from FT showing Spreads; SAX XMLFilter Example; Hitchens on McCain + Palin; Short Position on BBVA and Santander; Relatively Positive Article from Economist; It Works!; Not Even with Latest Version; Nope; Fixing Java Profiling in Eclipse (TPTP) on Linux (opensuse); Perhaps Not; New, Good Book by Le Carre?; Possible Future Financial Scenario; No Idea!; Session Limitation with Acegi blog post; Patriotic Taxes; Using Packrat Parsing for Ruby; Still Not Simple; Article on Robert Preston; China Intercepts and Stores Skype Messages; World of Goo - Interesting Looking Puzzle Game; Another Article on Models and Finance; Simplified Caching; Problem with iBatis, Spring and OSCache; Totally Worth It; More iBatis Comments; iBatis ORM and Caching Strategy - a Use Case; Liberal Intellectuals, Foreigners and Fascism; Good Article on (Current) Economics; Update; Same Results; Perfect Hash; Core Routine; Matching DNA Update - Faster Java Code; Carpark North (Videos); Medeski, Martin and Wood - LIve in Santiago; The Revolution Will Not Be Televised; Good Clear Analysis of AIG, HBOS; Band of Heathens (Blues); Choco (Constraint Programming in Java); Choco?; GecodeJ Not for "Real Use"; Not to be popular...; Commented GecodeJ Example; Programming Constraint Services; Installing Gecode/J (Opensuse); Trentemoller - Electronica; Spelling Errors; Mesed Up KDE4.1 Libraries w OpenSuse 11; Panasonic's Page; First Micro 4/3 Camera; And Sun Too; New Info on Nixon, Kissinger, Chile etc; Confirmation - Type Erasure, not Recursion; SequenceL (Auto-Parallelisation); Scrubbing RAID; Using a New Scope to Avoid Type Capture with Java Generics; Probably due to Erasure; Bombed; Fast Updatable Median; MySQL and Graphs; More Efficient Search Parameters: 30min; Updated Timing; Identifying Related DNA Sequences; Re: Tom Cruise, Holoprosencephaly; Relatively,,,; Loma Largo Quinteto - Fruity, Light and Chilean!; Try VirtualBox; Trivially Easy!; Sun's VirtualBox v2; Good Summary of Recent Spring Config Options; Launchpad - Open Source Projects Support/Hosting; Secure Remote Password Protocol (+ Python TLS); Good Analysis of Georgia Issues; iBatis Error with Recursive Generics; Google's Web Browser - Chrome; With Separator; Plotting Data from Postgres; Emotionally Vague; YouTube - rannndom improv jams - some hip hop & some funk/techno; Amazing Toy; Lua on LLVM; Mujava / Township Funk; Overclocking Again; Concha y Toro; Stream to Tree; Latest BIOS - No Memroy Remap for P5LD2 SE; New Version (+ Book) of Qi; Updated Photography Gallery; Good Walkthrough on WEP Cracking; Free Science, Computing, Maths books; Open JDK Works; Interesting Review of Maths; Spring's Command Controller; Java Annotations to Construct POJOs from HTTP Requests; REST Summary; JavaScript / ActionScript Politics; Olympus Interview Translation; Related Discussion; Themable (Tileable) Tk; Good Post on Micro 4/3 (Four Thirds); I Have to Agree; BulliEpu has Moved; Recursive Generators and Backtracking Search (Python); Not the Best Solution in General; Another, Simpler Python Meta-Programming Example; Breaking News - God Continues to Not Exist; Evidence of God?; Image Processing with CUDA / Python (Dynamic Pipelines); Cookies; Listening to BBC Radio over Internet with Linux; Re: How about post-install; How about post-install; Cookies; Better Code + Numbers; Some Initial Results for Overlapping Tiles with CUDA; Python Closures with Lambda; Java plugin for Firefox 3 on OpenSuse 11 (64 bit); Large Systems Need to Detect and Correct Internal Corruption of Data; Wine Labels; Headphone Socket Failed; Wine Prices and Quality; List of Good Recent Books; Details of the DNS Attack; Panasonic LX3; Re-using CUDA's Makefile; Resume/CV Designs; Newspapers Quoting Internet - How?; Good Paper Against Heuristics; Hueristics and Ethics; Non-CPU Cooling Helps; Diff and Patched CUDA SDK for OpenSuse 11, 64 bit; Have You Nothing Better To Do?; More Evidence; Traffic Shaping by VTR; Maybe too Negative?; Using gcc-4.3; GPGPU / NVidia Cuda / OpenSuse 11; Semantic Version Control; Xen and Solaris on OpenSuse 11; Assorted Links Now Free...; Updating Wikipedia (Mediawiki) to use Postgres 8.3; And a Test Reply; C[omp]ute is back!; Python CGI to Display Flickr Images; Good Papers for Dyanmic Interpreter Implementation; Python ABCs; Handling Version Changes that Break APIs; Sweet Security Hack; New Music - TheSixtyOne; It's Parabolic; Interesting (Science-ish) Mailing Lists / Blogs; Bug in Moody's Credit Rating Models; Numerical Computation w Python - Sage; Conclusion; Correction; Clarification; Yet More (Entropy?!); Extra Thoughts; Undo, Redo, Transactions, ORM, Monads, Python; Undo Example; Monads in Python; Algebrization: A New Barrier in Complexity Theory; Details of (Iranian) Enrichment Tech; Cool Physics Blog; Cool Result on Birds; Python Context Management; DataFlow in Python; Internationalization for Python; Logging in Python; Useful Responses to Python Metaprogramming; Python Metaprogramming; Robot Weapons Withdrawn; Synergy - Cross Platform Software KVM; Google App Engine; Easier Online Procedure; Python Parsing Framework; Wittgenstein - On Certainty; Ernst Haas - Photographer; Physics, Computing, Maths; Scientific libs etc for Python; Replacement Battery APC Smart-UPS 420; Tamaya Merlot 2005 (Reserve); New Photography Site; Rubik's Cube solved by Lego; Pedro de Valdivia 2257, Providencia, Santiago; Argh. XSLT not XPath; Comparison of XPath and XQuery; More on Gravity Anomaly; Algorithms for programmers; New Job; New ISP Location; Wiki; Shove Module (Python); Bolano Stories; Do Use Raw; Critica.cl, Bolano, Arriaga, Animita Cartonera; Ernst Bettler, Disruptive Design (or not); Late Victorian Holocausts; Book of Memorials, Photos, Chile; Sweet Fucking Christ; Depth of Field; QM is Statistics with a 2 Norm; Panasonic LX2; Expert Data Reduction; Font Rendering; Encrypted Email Not So Safe; Test - New Server; Excellent Review of the Current State of High Energy Physics; Fascinating Background on Pakistan, Atomic Weapons, etc; In Retrospect; Good Food in Valparaiso, but Social Art Crisis; Licence Plate Recognition; Interesting Work on Data Provenance; More on French War; Roberto =?iso-8859-1?Q?Bola=F1o_-_At_Last=2C_a_Great_Chilean_Writer?=; OLPC (XO) in the Developing World; Termite v Erlang; Little Steven's Underground Garage; Chilean Food (Pebre); Amazon Improved Reccomendations?; Explanation of Picture; Rigid Rod Dynamics in 2D; Subtle, but Correct (I Hope); Axiom of Choice; Efficient Collision Detection with Pessimistic Measures; Beautiful Description of Forth Implementation; Interesting Poll - Worldwide Muslim Attitudes; American Schools Banned From Calling 911; OCaml on the JVM; Computing in (Haskell) Types; And Another on the NSA; Article on Bolano (Chilean Writer) in LRB; Collision Detection Working; First napito Results; Within 10min 2 People Had Marked As Favourite; Safe, IDE-Friendly, Extensible, XML Schema; Funny Foreigners; Credit Card Security; ...history, and laughing; No Officers Guilty - Abu Ghraib; Yellow; Cheap....; Significantly Faster; Not Efficient!; Hygienic Macros Failing in Gambit?; More Specific Operations; Basic 2D Geometry Routines; [Fwd: Andrew On Libertarianism]; In Defense of Purple Prose; Libertarianism; National Identity; Improved Permutation Function (Start of List Library); Good Article on SQL, Graphs, Trees; Permute Fucntion (Scheme); Initial Scheme code for Napito; 1 in a Million; Getting Started with Gambit and Snow (or any other Scheme); Running Gambit (Scheme) From Emacs; Space Travel and Astronomy; Amazon Does On Demand; Neat Idea - Extra Steam Stroke; Error in Regex; Good Paper on Migration, Social Costs, etc; Makin' Money!; Dropping Less Spam at ISP; Brother HL-2070N on Linux; High Windows as Limerick; Power 101; Alas...; LEDs in GUIs; To Be Completely Clear - I Agree With Loquax; Compiling Suse 10.2 Kernel with Nvidia; Full review in IEEE Spectrum; Long Rant on Physics, Free Energy, Steorn, etc; Too Easy; It's all about the Me; jjjuste V 1.0 Released; jjjuste V 1.0 Released; Woot - Jack to Airport; More of a Wobble; I Am A Foooool..; On Aging; The Worst of Metafilter; Protecting Traditional Knowlegde; Chilean Frustrations; Sine!; Slower, but doing the distance; It's Official - I Rock; Post-Hoc Wine Tasting and General Good Day; Albert Schweitzer; Using IntelliJ Idea v 7 (Selena) with mvn idea Plugin; Awesome Article on Reiser; Review of Cockburn's "Agile Software Development"; Streaming Audio and Jack; How Many Spammers? A Statistical Approach; Jack to Airport; Alsa, but no Flash, Jack; Amarok with Jack; Getting Jack Working; AES Weak?; Related LRB Article; Backtracking; Lessons from Icon; Iteration 2; And Another; More Politics, I'm Afraid; Need for Immigrants; De Soto Report; Happy to be fined!; Update; Post on Reddit; Culture Jam; One More Step; I just bailed on Parrot; Parallel Sudoku solver in Stage; Lessons Learned with Erlang; Timing Data; More Jabberings on Syntax; More on OO/FP/Asynch; Unifying OO, FP, Asynch Messages; Neat Noise Based Crypto; Convergence with Greediness 0.95; Greediness 0.75; Core 2 Duo Never 100% Both Cores?; Aborted Output with Greediness=0.5; Taste Test: Coke Light (Diet) v Zero; Hot Damn Fuck Me Backwards Woot!; Typical Report; Reduced Range Sudoku Solver; Still doesn't work...; The Vietnam of Computer Science - ORM / RDMS / OO; Interesting intro to Coq w Haskell; More Thoughts on Chapter 1; Notes on Agile Software Development; Gravity Probe B; Not Even Wrong; The Fabric of the Cosmos - Brian Greene; Yet More Discussion; More Discussion; Computational Economics; Machine Dreams - Economics Becomes a Cyborg Science; No Emergence; Community Sudoku - A Cooperative Algorithm; Coming Soon - Community Sudoku; New Version; Bug!; Can't Sleep; Latest Before Bed...; I Don't Even Know How To Play Sudoku...; Markets and Individuals

Andrew Cooke | Contents | Latest | RSS | Twitter | Previous | Next