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

Avoiding the Python Stack

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

Date: Wed, 11 Feb 2009 09:17:38 -0300 (CLST)

The Python stack is notoriously restricted, and Python does not have tail
optimisation, so any code that uses recursion can quickly fail.

Enhanced generators (available since Python 2.5) provide a solution, but
one that has some limitations.

In short - generators can be used to implement trampolining.  The program
stack then becomes an array on the heap and is "unlimited" in size.

The simplest way to implement this is to rewrite a program by:

  1 - replace "return x" with "yield (True, x)"

  2 - replace "f(x)" with "yield (False, f, x)"

The program can then be run with code something like (untested):

  def run(f, args):
    stack = [f]
    while stack:
      result = stack[-1].send(args)
      if result[0]:
        stack.pop()
        args = result[1:]
      else:
        stack.push(result[1])
        args = result[2:]
    return args

That's not quite correct as it assumes that everything (ie all the "f"s
above) is already a generator.  And it doesn't handle exceptions.

There's more here - http://www.python.org/dev/peps/pep-0342/

And I'm still unclear on what happens when a function yields (in the
original form).  But I think this is the right track...

The main restriction is that *every* function needs to be aware of the new
protocol (unless they simply return values returned from sub-calls, I
think, since these will now be generators rather than "real" values).

I assume this is all "obvious" if you understand what coroutines are, but
the details seem pretty complex to me.

Andrew

Handling Yield

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

Date: Wed, 11 Feb 2009 14:56:17 -0300 (CLST)

I've been thinking about this some more over a (late) lunch.

Since a generator is returned "magically" you cannot require a return to
be formatted in a special way.

Another way of saying the same thing:

  def mygen():
    ...
    yield x

is always going to return a generator.  It cannot yield (False,
generator).  So we need a special marker to indicate something must be
evaluated.  For now I'll use The ToRun() constructor.

But then think how this would be used:

  for x in mygen():
    ...

would work, but doesn't trampoline.  If we instead had:

  for x in yield(ToRun(mygen)):
    ...

the yield would return to the top level, which would recognise the ToRun,
somehow extract the embedded mygen and call it.  That returns a generator
which is then sent back to the original caller.  So far, everything works
nicely.

The trouble is: what happens if the generator created by mygen wants to
call something else?

  def mygen():
    x = yield ToRun(foo, args)
    yield x

Unfortunately the yield here is going to appear as x in the loop above,
instead of going to the trampoline.

This might be fixable using a global function that all callers to
iterators must use.  But the same effect can be had more transparently by
adding the wrapper within the trampoline.

I suspect I will have to write some code to see if it actually works.  But
for now back to work...

Andrew

More on Co-Routines

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

Date: Wed, 11 Feb 2009 18:31:57 -0300 (CLST)

Nope, that's not right.  I need to first define how I start
things running.

So, assume the trampoline starts by invoking some function.
That will either return a value, in which case it wasn't
expecting to be started by the trampoline, or a generator.

If it returns a generator then either it wasn't expecting to
be called by the trampoline system and that's an actual
result, or the generator is something that should be managed
by the trampoline.

Assuming it should be managed by the trampoline, the
trampoline calls next().

If it receives a ToRun() value then it pushes the generator
on the stack and runs the "subroutine".

  If the subroutine returns a non-generator value then it
  wasn't expecting to be called by the trampoline, but no
  worries, we can send back the value anyway.

  If the subroutine returns a generator then we need to
  assume that it was expecting to be invoked by the
  trampoline.  We take next from the generator and look at
  the value.  If it's a ToRun then we can repeat as before.

  If it's not a ToRun then we must assume that it contains a
  value that is being "returned" by being yielded.  We have
  to assume this because a generator can't simply return.
  So if sometihng is going to call via the trampoline (it
  contains a yield ToRun) then it can only yield, not
  return.

  (Although another option would be to raise some special
  kind of exception to return values, I guess).

  Anywya, that assumption is OK - the generator is discarded
  and the value sent back to the previous caller from the
  stack.

  The problem is: how to return a generator?  I gues it just
  yields a generator.  That may not be a big issue - I'm
  just worried that

Next problem, then.  We can handle things that don't expect
to be called by the trampoline.  But other things cannot
handle things that expect to have been called by the
trampoline, because they will receive a generator instead of
a value.

So there has to be a strict division between functions that
are called normally and those that are trampolined.

How about if we say that matchers are the only things that
should be trampolined?  But that means they must yield
generators.  Because if they yield directly the trampoline
has broken the generator before it knows it's not a ToRun.

Unless the trampoline itself wraps generators.  Then it
could return that value.

Would that work?  We can wrap generators automatically.
This won't work for "normal" functions (if they return
normally they can't yield, so can't call out via the
trampoline).  But that's OK because they'll just work
normally.

So what I'm saying is that only generators can trampoline.
This isn't necessarily a strong constraint, I'm just
choosing it to simplify things.  Well, no it is a strong
constraint, because we're trampolining between coroutines.
I guess what I mean is that I am not going to look at
automatic handling on non-generators and I am going to avoid
issues with bootstrapping from the initial non-generator
call by isolating the generators themselves.

This has the side effect of starting the trampolinging at
the first found generator, rather than at the initial call.
I don't think that's an issue.

OK, so most of the above is incorrect (or at least
incomplete).  We only trampoline once generators are "up and
running" within normal code.  We then intercept the value
returned from a generator via a wrapper and detect flagged
call values.  These are handled by the normal trampoline
process.

That might sound like we're back in the same description as
above, but we no longer assume that the return value from
the called function is trampoline aware.  Instead, we call
it normally and get some function back.  Ah, crap - that
doesn't work because we're back where we started.  If we
simply send the returned value then we've not intercepted
any later calls.

OK, so backstep and try again.  The trampoline is at the top
level and is asked to evaluate a matcher.  The matcher is
guaranteed to return a generator.  The tampoline invokes the
matcher and receives the generator.  It calls next on the
generator and, if it's a normal value returns it as the
matcher's first result.  Otherwise, if it's tagged, it's a
call to a new matcher.  That matcher is invoked similarly
(from the top level).

That works.  What has changed?

There's a weird asymmetry required.  It only works if you
start with a function that returns a generator.  It's not
the generator that's wrapped, it's the entire matcher.

After-work beer is kicking in.  Time to let that soak for a
while.

Andrew

Clearer

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

Date: Wed, 11 Feb 2009 20:21:27 -0300 (CLST)

So, the "asymmetry" I mentioned above is basically because you have have
the trampoline above the coroutines (this is so obvious it may not be
clear what I mean).  Otherwise, you're not "going back" on the stack and
the trampolining is pointless.

Anyway, the implementation detail boils down to how to feed results back
to the caller so they appear from an iterator.

I will write some example code and post again...

Andrew

Trampolining Code

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

Date: Wed, 11 Feb 2009 21:38:14 -0300 (CLST)

So this is, I think, now pretty specific to LEPL, but it clearly works.

Typical output was

  1336,1335,1334,1333,1332,1331,1330,1329,13...
  2060,2059,2058,2057,2056,2055,2054,2053,20...
  221,220,219,218,217,216,215,214,213,212,21...
  742,741,740,739,738,737,736,735,734,733,73...
  308,307,306,305,304,303,302,301,300,299,29...
  1559,1558,1557,1556,1555,1554,1553,1552,15...
  678,677,676,675,674,673,672,671,670,669,66...
  4039,4038,4037,4036,4035,4034,4033,4032,40...
  107,106,105,104,103,102,101,100,99,98,97,9...
  418,417,416,415,414,413,412,411,410,409,40...
  921,920,919,918,917,916,915,914,913,912,91...
  2683,2682,2681,2680,2679,2678,2677,2676,26...
  947,946,945,944,943,942,941,940,939,938,93...
  2089,2088,2087,2086,2085,2084,2083,2082,20...
  304,303,302,301,300,299,298,297,296,295,29...
  3399,3398,3397,3396,3395,3394,3393,3392,33...
  421,420,419,418,417,416,415,414,413,412,41...
  3956,3955,3954,3953,3952,3951,3950,3949,39...
  1949,1948,1947,1946,1945,1944,1943,1942,19...
  3488,3487,3486,3485,3484,3483,3482,3481,34...
  0  100  200  300  400  500  600  700  800  900  Traceback ...

So the apparent stack depth of 1000 was easily exceeded.

  from random import uniform

  class Next(object):
    # This is the 'tag' class used to indicate that a value being
    # yielded is actually a coroutine that should be evaluated.
    def __init__(self, next):
      self.next = next


  def generator(level=0, p=0.001):
    # This returns it's own level with probability p.
    # Otherwise, it constructs a child at a lower level and calls
    # the child (twice, just to make sure children are persistent)
    while True:
      if uniform(0, 1) < p:
	yield str(level)
      else:
	child = generator(level+1, p)
	yield (yield Next(child)) + ',' + str(level)
	yield (yield Next(child)) + ',' + str(level)


  def trampoline(main):
    # A yield is either a 'real' yield to the parent coroutine,
    # or a new coroutine to generate.  The stack only tracks
    # the pending chain of coroutines - many others may exist,
    # but are managed via references internal to other coroutines.
    stack = [main]
    while stack:
      try:
	value = next(stack[-1])
	while not isinstance(value, Next) and len(stack) > 1:
	  stack.pop()
	  value = stack[-1].send(value)
	if isinstance(value, Next):
	  stack.append(value.next)
	else:
	  yield value
      except StopIteration:
	stack.pop()


  if __name__ == '__main__':
    t = trampoline(generator())
    for i in range(20):
      print(next(t))

    def stack_size(depth=0):
      if 0 == depth % 100:
	print(depth, ' ', end='')
      stack_size(depth+1)
    stack_size()


I'd like the main loop (in trampoline) to be neater.

Note in particular how object creation is now in-line.

Andrew

Correction on Python Stack

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

Date: Wed, 11 Feb 2009 21:45:26 -0300 (CLST)

The size of the stack, since 2.6, can be set via the _thread lib. 
Unfortunately it's still all rather platform-specific.

Andrew

Simplified Code

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

Date: Wed, 11 Feb 2009 23:19:16 -0300 (CLST)

Since we can only work with "dedicated" classes, we can exploit the fact
that we know the types to avoid tagging.


  from random import uniform
  from types import GeneratorType

  def node(level=0, p=0.0001):
    if uniform(0, 1) < p:
      yield str(level)
    else:
      child1 = node(level+1, p)
      child2 = node(level+1, p)
      yield (yield child1) + ',' + str(level)
      yield (yield child2) + ',' + str(level)
      yield (yield child1) + ',' + str(level)

  def trampoline(main):
    try:
      stack = [main]
      value = next(main)
      while True:
	if type(value) is GeneratorType:
	  stack.append(value)
	  value = next(stack[-1])
	else:
	  stack.pop()
	  if stack:
	    value = stack[-1].send(value)
	  else:
	    yield value
	    stack = [main]
	    value = next(main)
    except StopIteration:
      pass

  if __name__ == '__main__':
    t = trampoline(node())
    for i in t:
      print(i)

Finally, Clean Main Loop

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

Date: Thu, 12 Feb 2009 00:14:32 -0300 (CLST)

def trampoline(main):
    try:
        stack = []
        value = main
        while True:
            if type(value) is GeneratorType:
                stack.append(value)
                value = next(stack[-1])
            else:
                stack.pop()
                if stack:
                    value = stack[-1].send(value)
                else:
                    yield value
                    value = main
    except StopIteration:
        pass

LEPL Roadplan

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

Date: Thu, 12 Feb 2009 08:53:57 -0300 (CLST)

I suspect trampolining is less efficient.  At the same time, it would make
trace easier to implement.

Because yield is a statement, not a function, it is difficult (impossible)
to have code that works either way.  But I now have the ability to rewrite
the matcher tree, so can substitute implementations.

The question is: what to do for next release?

I think the answer is to leave optimisations aside for now.  Get things
working one way (with trampolining and simplified trace).  Release that
then look at speed.

Andrew

Comment on this post

C[omp]ute

Welcome to my blog, which was once a mailing list of the same name and is still generated by mail. Please reply via the "comment" links.

Always interested in offers/projects/new ideas. Eclectic experience in fields like: numerical computing; Python web; Java enterprise; functional languages; GPGPU; SQL databases; etc. Based in Santiago, Chile; telecommute worldwide. CV; email.

© 2006-2011 Andrew Cooke (site) / post authors (content).

Last 1000 entries: Parasites Affect Our Behaviour; Info on Anon P2P etc; Hardware Transactional Memory coming to Intel; Rome - 3 Dreams of Black; New Technologies; Reinstalling OSX via Linux; Shoddy Macs; Similar Profiler for C; Profiling Go Programs; Access to Bloomberg Data Feed; Automated JVM Leak Detection; Fashion (Men's); Left Drifts Centre; Right Becomes Vicious; Comparison of TeX Processors; Jolly Good Idea Chaps, Wot?; I Can Vote!; DHT, PEX and Magnet Files; ConTeXt - A Latex Replacement; for comparison; Reducing Energy Use; Scavenging 2.5" Disks; Running Caldera's Hadoop Demo in VirtualBox; Telecomix (Net Activism); Face Detection Algorithm; NFB 3.1 - Broken and Fixed; Category Theory for Java Programmers; piUML - A Language for UML; Distributed Hash Tables; Updating Mediawiki Database; The Coming War on General Computation; Hobby Shop in Apumanque; Overpaid Mediocrities Running Banks; Ghostbranders; Seeing red; evolution of color vision; Evolution of Colour; Accomodation in SF; An Idea a Day; In AGU's Defense (OpenSuse Kernel Bug); AGU 2011; Chile tops OECD Inequality; Glances - Curses System Monitor; Python libraries error on OpenSuse 12; Parrondo's Paradox; Notes on Installing OpenSuse; Quantum Mechanics - Explanation of PBR Result; And Politics?; Ideas for Projects; Return to Olivie; OpenSuse 12.1 Out; re: Command Line Sequencer; subjective maps; Brain's Division of Labour in Routefinding; StarTechConf; Audio-GD NFB 3.1 DAC; Deciphering DHL Status Reports; Imports to Chile with DHL (Hidden Charges + Tax); MVCC, Snapshot Isolation, Write Skew; Vote Against Alcala del Rio; Chilean Wine; The Most Awesome Music Video Ever; Re: too fast already; Second Guessing; too fast already; LMAX Architecture; Over 760 RSA Attack Victims; El Ancla - Seafood Restaurant in Santiago; Command Line Sequencer; Random Albums; Eurotel, Guardia Vieja; Nogales for the Win!; Guava - Useful Java Utilities; Average Angle; My Brain Makes Things Taste Funny; From the Haskell Perspective; Hotel Orly; Guria - Spanish Restaurant in Santiago; Mid-Price Hotels in Providencia; Richter Continues to be Awesome; C Sequence Points; Yeah I am getting to this feeling too; Swarm of Micro-Satellites (few dollars each); How to Lead Clever People; Software Foundations; Chilean Aircraft Crash from Lack of Fuel?; Quantum Graph Isomorphism; Radix Sorting; Efficient Entropy Estimates for Sequences of Large Values with OpenCL; Overtone: Clojure Music Synthesis (Synth, Sequencer, Higher Logic); Pisco tasting; Computer virus hits US Predator and Reaper drone fleet; Cow Clicking; Re: Banco popular; Banco popular; Access to Banco de Chile from Argentina; Trickier Alignment; Bytes in struct; Struct and packing; Using Array; Copying Bytes; Some simple pyopencl examples; Complexity, statistics; The First Law of Complexodynamics; Installing numpy and scipy in Python3.2 virtualenv; Is HN Being Overrun by Downvoting, Groupthinking Lemmings?; GUI Architectures (Fowler) - MVC etc.; Good Explanation of TLS 1.0 (CBC) Attack; Today in the USA...; Shorter variant, using Bash redirections...; Possibly Useful List of Books to Read; The Other September 11; Modern GPU - Articles on GPU Programming; Long Lambda Post on Multiple Topics; The Three Christs; 3QD Philosophy Prize Semi-Finalists; Qubes - Security by Isolation in VMs (Xen); DSLs in Python; Tottenham Riots; Baz Ratner - Howitzer Image; Getting Started with Pypy on OpenSuse; Gnuplot Tricks; Clojure Wrapper; More on (vector-of :double); Optimising Clojure; Using Constraint Programming to Identify Groups; lp_solve; Non-Comemrcial; Mixed Integer Programming in Python; Vegetative Patients Wakened by Sleeping Pill; Data-Driven Documents (D3) - svg library; Gravity is not Statistical; Free Computer Science Book Downloads (Drafts); Why Clojure doesn't need invokedynamic; The RSA Email; You Dumb Liberal Fuck; Lambdas (SAMbdas - Single Abstract Methods) in Java; Saving Stack Space with Generators; Compressed Sensing, Matching Pursuit, Radio Astronomy; Re: Have you tried Babel-17?; Example Clojure Code; Use vectors where they make sense; Have you tried Babel-17?; More from HN and Adrian Sinclair; Re: Why I tried clojure and then stopped; Why I tried clojure and then stopped; Initial Thoughts on Clojure; Correlated Random Variables; Re: Regarding Firefox Using Company Proxy Settings; Regarding Firefox Using Company Proxy Settings; The Site in Question; Small Correction and Script; Automating Access to AppEngine with Federated Logins; ASCII...; Unix tree Command; O(n) and O(n^2) in a Dynamic Programming Problem; Resuming scp With rsync Across an Unreliable Link; Improved Sharded Counter for Google AppEngine; FFT in scipy etc; Deadman timer for Google AppEngine; Lessons Learned from AppEngine's Data Store; Fixing KDE on OpenSuse; A Better, Fluid, CSS Grid; Tumbleweed Back Working Now; Madera y Carbon - Colombian Restaurant in Santiago; Broken OpenSuse Tumbleweed; Re: Avoiding For Loops; Avoiding For Loops; Uniformly Random, Correlated Numbers in Matlab/Octave; Designing no-SQL Schema; Using libxml (libxml2) with Namespaces; Salaam Bombay - Indian Restaurant in Santiago; Bit Depth?; Optimising PNG Generation in Python; libxml2: Creating XML and Validating with Schema; Bananina Split; No Go; SSA v CSP (Structuring Intermediate Languages); Playing with Go's Interfaces (images); Testing Go in Intellij Idea; Re: Goroutines; IntelliJ Doesn't Automate Licence Processing; Re: Go Rocks - How Can We Avoid Something This Bad In The Future?; Some Links, Clarifications and Corrections; Re: Micro Languages; Go Rocks - How Can We Avoid Something This Bad In The Future?; The Bug Count Also Rises; Article on Greece, Euro, etc; Quanterra Q330 Calibration - Control Conventions; Testing Python in PyCharm; Violet (Interactive Fiction); Yet More...; More on Lepl + RXPY; What is TCP hole punching?; Stability Issues; Listing Colours For Dark Backgrounds; ARM + AMD Sitting Up A Tree; Coding Guidelines for C; Linux USB Wifi With TP-Link TL-WN722N; Politics Behind Fukushima Mess; Block Network for a OpenSuse User; Or Below...; Secure ID Hack Confirmed; And Beyond...; Rain; PortalDisc.cl and Odisea Odiseo; Too Complicated!; ASCII Display of Trees; Designing Incentives for Crowdsourcing Workers; Next Step for RXPY/Lepl integration; RSA Attackers Got (and Used) SecureID Data; Intercepting Skype using Phonemes (without Decryption); enum from 1; Configuring PyCharm to use Per-Project Config Files; X11 Bitmapped Fonts in Java JDK 7?; SSH Connection using libexpect in C; Fred Goodwin (Mr Zam) now Suing own Family; How To Write Papers with Restructured Text; Pytyp - Extending Python Types for Declarative Code; Le Bistrot - a Santiago Restaurant; And Away...; Variable Names; More Readable "Types in Python"; Excellent Article on Human Aftermath in Japan; Dynamic Dispatch in Python; First Guess; The Justice of Assassination; Re: Pro Django Review; Pro Django Review; Pro-Django Review; Computer Model of Schizophrenia; Rai and Olivie - two Santiago Restaurants; Maybe not Multimethods; Updated Python Types Draft; I ROCK!; Multimethods for Python; Elderly Couple's Suicide Agreement; Algebraic ABCs - A DSL for Types in Python; Guantanamo Visualisation; Information Physics: The New Frontier; Leaked Guantanamo Files - Often Little Justifcation; DWIM cd; And Up...; Terrifying Detail Available from (Future) Phone Tracking; Giving Callbacks Control over Exceptions; (Dumb) Algoritmic Pricing of (3rd Party) Amazon Books; Reverse (Remote) SSH Tunnel With Free Amazon EC2; Levels of Infinity; Elif Batuman: Life after a bestseller; Call for the Release of Ai WeiWei; Video on Chernobyl Arch; New Approach to Python Typing; Brillian Generative Music Automaton; Japanese Govt Lied About Radiation Levels Because...; Example Python Code; em-dash and en-dash in Emacs; Systematic Harassment of Software Engineer; Speculative Contacts (Stable Collision Physics); A Little More Detail; Insomniac Typed Programming in Python; Garrison Keillor savages Berrnard-Henri Levy; Perlin and Simplex Noise; Stronger Types for Python; Fixing Strange Import Behaviour in Python; Details on the RSA Attack; Active Flattening; Better Config Support for Python (and More!); Pioneer Anomaly Sovled!; Flattening Graphs; More Info on Last.fm Tags; Using Last.fm tags to play my mp3s on SqueezeCenter; Being There by Andy Clark (Free Philosophy of Mind Book); Calling SqueezeCenter CLI from Python 3; Why doesn't Python have better config support?; SQL and noSQL are Duals of Each Other; Good Article on Explosions; Earthquake Magnitudes and Physical Damage; Good Article on Reactor Risk; Hydrogen Source; Re: your excellent blog; Some Points Related to the Fukushima No. 1 Reactor; Installing MusicBrainz Database; Improving Squeezebox (Duet) Sound with V-Dac; Green Mathematics; Final Code; Fix 2 - No need for explicit clip; Fix 1 - No need for NO_STATE; Evidence :o); Processing Large Volumes of Data in Lepl; Radio/mp3 on Freedom, Privcay etc; Hyperpublic's Challenge; HTSQL - Compact SQL as Rest; Scala still sucks?; Free Mix Tapes; Musica Chilena (y Sudamericana); GoogleSharing; More Renderscript Info; Non-Google Search + Updated Site; GoogleSharing - Anon search while logged-in to Google; Curious US Military Cargo in Argentina; Android Renderscript (CPU/GPU code); Compiling (translating) PyPy 1.4.1 on OpenSuse; Final Code; To check fonts on KDE; Clean bitmapped fonts on OpenSuse 11.3; Further Update to Link; What is TCP hole punching?; Email above was dropped!; EMail and URL Validation in Python; LCD Test Images; Spindromes; Oooops; Analytical Marxism; Against Capitalism; This will not change in Egypt now; Back!; Tesla C1060 with OpenSuse 11.3; Watching Wal-Mart at Midnight; Also, From The Book; New in Functional Data Structures; Testing Django with Selenium; Protovis - Javascript SVG Library; Django OpenID: Invalid openid.mode: u'i'; Good Intro to LVM; A Chilean Day; A Python Logging Service; Serving YUI 3 files locally (and incrementally); Firefox uses Proxy with Selenium; Fressia too; Windows etc; Selenium Tests of Multiple Browser and OS Combinations; Resizing Cryptmount File System; Selenium Web Testing; 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

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