Choose your Own Reader

This “choose your own mystery” format for selecting a Google Reader replacement is delightful.

reader-graph

There must be one of those column fodder charts for blog readers? If so then I can complain that it lacks columns for things I care about.

Quicklisp new packages, June 2013

Summary of the new packages in the new release of Quicklisp.

big-string -- BSD 3-clause (see LICENSE)
  Big strings, similar to Java's StringBuilder.
  author: Robert Smith
  mercurial: https://bitbucket.org/tarballs_are_good/big-string
  more: https://bitbucket.org/tarballs_are_good/big-string

cl-css -- MIT-style
  Simple inline CSS generator
  author: Leo Zovic
  git: git://github.com/Inaimathi/cl-css.git
  more: https://github.com/Inaimathi/cl-css#readme

cl-curlex -- GPL
  Leak *LEXENV* variable from compilation into runtime
  git: git://github.com/mabragor/cl-curlex.git
  more: https://github.com/mabragor/cl-curlex#readme

enchant -- Public Domain
  Bindings for Enchant spell-checker library

cl-geoip -- WTFPL 2.0
  Wrapper around libGeoIP
  git: git://github.com/dasuxullebt/cl-geoip.git
  more: https://github.com/dasuxullebt/cl-geoip#readme

cl-performance-tuning-helper -- MIT
  A simple performance tuning helper tool box for Common Lisp
  author: SUZUKI Shingo
  git: git://github.com/ichimal/cl-performance-tuning-helper.git
  more: https://github.com/ichimal/cl-performance-tuning-helper#readme

tcod -- No license specified?
  Common Lisp bindings for libtcod, a truecolour terminal-emulation
  library written in C.

cl-template -- MIT
  A simple output-agnostic templating system for Common Lisp.
  git: git://github.com/alpha123/cl-template.git
  more: https://github.com/alpha123/cl-template#readme

clache -- LLGPL
  A general caching facility for Common Lisp with an API is similar
  to a hash-table.
  author: Tomohiro Matsuyama
  git: git://github.com/html/clache.git
  more: https://github.com/html/clache#readme

clinch -- BSD
  Simple 3d graphics engine for Lisp.
  author: Brad Beer (WarWeasle)
  git: git://github.com/BradWBeer/CLinch.git
  more: https://github.com/BradWBeer/CLinch#readme

clite -- ISC
  Lite weight testing framework
  git: git://github.com/lispy-stuff/clite.git
  more: https://github.com/lispy-stuff/clite#readme

clobber -- No license specified?
  A alternate approach to persistance based on transaction logging.
  git: git://github.com/robert-strandh/Clobber.git
  more: https://github.com/robert-strandh/Clobber#readme

delorean -- No license specified?
  Delorean is a time machine for unit tests
  author: Andy Chambers
  git: git://github.com/cddr/delorean.git
  more: https://github.com/cddr/delorean#readme

generators -- BSD
  A common lisp package providing python style generators based
  on delimited continuations
  git: git://github.com/AccelerationNet/generators.git
  more: https://github.com/AccelerationNet/generators#readme

gettext -- GNU Lesser General Public Licence 3.0
  A port of gettext runtime to Common Lisp
  git: git://github.com/copyleft/gettext.git
  more: https://github.com/copyleft/gettext#readme

inner-conditional -- LLGPL
  Series of macros which optimizes out the inner conditional jumping
  author: Masataro Asai
  git: git://github.com/guicho271828/inner-conditional.git
  more: https://github.com/guicho271828/inner-conditional#readme

lowlight -- MIT
  A simple and flexible syntax highlighter
  git: git://github.com/chfin/lowlight.git
  more: https://github.com/chfin/lowlight#readme

new-op -- No license specified?
  Provides (new <type>) -> new instance of type, and more.
  git: git://common-lisp.net/projects/new-op/new-op.git
  more: http://common-lisp.net/project/new-op

petit.package-utils -- MIT
  petit tool box for packaging
  author: SUZUKI Shingo
  git: git://github.com/ichimal/petit.package-utils.git
  more: https://github.com/ichimal/petit.package-utils#readme

policy-cond -- Public Domain
  A macro to insert code based on compiler policy.
  author: Robert Smith
  mercurial: https://bitbucket.org/tarballs_are_good/policy-cond
  more: https://bitbucket.org/tarballs_are_good/policy-cond

pretty-function -- No license specified?
  Scheme to enable nicer printing of closures and other pure functions.
  git: git://github.com/nallen05/pretty-function.git
  more: https://github.com/nallen05/pretty-function#readme

rectangle-packing -- LLGPL (but he's flexible, so ask)
  Code to pack rectangles into a bigger rectangle.  Useful for
  texture packing for OpenGL.
  git: git://github.com/woudshoo/rectangle-packing.git
  more: https://github.com/woudshoo/rectangle-packing#readme

stmx -- LLGPL
  Composable Software Transactional Memory
  author: Massimiliano Ghilardi
  git: git://github.com/cosmos72/stmx.git

track-best -- Free
  Macros/functions for tracking the best items.
  git: http://git.nklein.com/lisp/libs/track-best.git/

treedb -- MIT
  A hierarchical key-value-database
  git: git://github.com/chfin/treedb.git
  more: https://github.com/chfin/treedb#readme

utilities.print-items -- LLGPLv3; see COPYING file for details.
  This system provides some generic condition classes in
  conjunction with support functions and macros.
  git: git://github.com/scymtym/utilities.print-items.git
  more: https://github.com/scymtym/utilities.print-items#readme

weblocks-stores -- LLGPL
  A base for weblocks stores
  author: Olexiy Zamkoviy
  git: git://github.com/html/weblocks-stores.git
  more: https://github.com/html/weblocks-stores#readme

weblocks-utils -- Public Domain
  Utils for weblocks framework
  author: Olexiy Zamkoviy
  git: git://github.com/html/weblocks-utils.git
  more: https://github.com/html/weblocks-utils#readme

Google Reader Remider: Save your subscriptions

I don’t use Google Reader, but I get a lot of traffic from it.  If you use Google Reader for your blog reading don’t forget the shutdown.  They are cruelly abandoning you in two days, i.e on Monday July 1st.

You can save the list of blogs you read by going to Google Takeout.  Takeout is a bit complex because it supports extracting your account data for assorted Google services and using it involves a number of steps.  Today you just want to extract the data for the Reader service.  So:

  1. Log into Google – for example visit Google Reader
  2. Go to the page that selects the Google Reader account data.
  3. This doesn’t create the archive, this prepares to create it.  So wait for the little array of squares to turn red.
  4. Click the Create Archive button at the bottom of the page .
  5. Wait for your archive to be created and then click the Download button
  6. You will be asked to login in one more time.

This will save a file to your computer. This is a zip file named something like name@example.com-takeout.zip. This is a compressed archive of the account information your account info. If you unpack it the folder will be called something like name@example.com-takeout. Inside one of a folder with the Reader data. Inside that is a file called Subscriptions.xml.

Subscriptions.xml is the list of blogs you subscribed to.   It is a format known as XML, add in a  variant of that format known as OMPL.  It is pretty unreadable, and worse if you try to open it in on most computers the computer will either refuse, or it will pick some tool to view it that you’ve never used before.

EOLSo the next step is to try another blog reader.  When you pick one you load Subscriptions.xml into it; and that will teach it what blogs you like to read.  There are lots of frustrating posts about Google Reader Alternatives.

Hope to see you on the otherside.

 

Voting Rights

The civil rights movement of the 1960s marked one of the very very few major shifts in the politics of this country.  I.e. the racist southern whites switched from the Democratic to the Republican party.  Those southern Democrats had some redeeming value, i.e. politically their loyalties lay with the little guy.  So at the time the Democrats were pro-little guy v.s. the Republicans tended to like big institutions (particularly commercial ones) more.  From today’s perspective it’s hard to see how civil rights and your preferences for large vs. small economic entities would be orthogonal.

kouns_63_selma1aBoth parties, at the time, were split internally on the issue of civil rights, and battles. The national battle civil rights resorted things.  Don’t gloss over how vicious these battles were.  We are talking riots, murders, etc.  Nothing in modern American politics comes close; even if it ought to.

Civil rights won.  But, the Republican party came infected with a severe case of racism.  An ugly hybrid emerged from this. The pro-little-guy attitudes was driven out of the new southern Republican party was driven  out of the party.  Later the entire party went in insane.

The insanity is principally about the big/little guy debate, but it’s always flavored with a large dose of spiteful prejudice.   That used to be focused on black people, but these days it’s has a broad spectrum.  In part because if as you become more committed to the big guys in the big/little debate you trend toward demonizing all the little guys.

Yesterday’s destruction of the Voting Rights Act by the supreme court is a direct decedent of those battles, and of the civl war before them.  It will disenfranchise a tremendous number of people.  It political consequences will be very ugly, we know because we ran voting with a large dose of voter suppression in the century following the civil war.   It is a tragic development.

cl-interpol and parenscript

Cl-interpol adds Perl style interpolated strings to Common Lisp. For example:


#?"The result is ${(let ((y 2)) (+ x y))}"
-->
"The result is 42"

Cl-interpol works by defining a reader macro, i.e. #?”…”. For personal reasons I don’t like reader macros so I wrote a quick macro to avoid them.


(defun interp% (str)
  "Avoid the need to use a unique read table."
  (assert (stringp str))
  (with-input-from-string (s str)
    (cl-interpol::interpol-reader s #\? nil)))

(defmacro interpolate (str)
  (interp% str))

Which lets you write:


 (interpolate "{This string appeared in package: ${(package-name *package*)}.}")

Like any self respecting Lisp code cl-interpol avoids interpreting the string at runtime, instead it converts the interpolated string into code. For example that last example expands into:


(with-output-to-string (#:g13131)
  (write-string "This string appeared in package: " #:g13131)
  (princ (progn (package-name *package*)) #:g13131)
  (write-string "." #:g13131))

I started using cl-interpol because somebody suggested it as yet another way to generate HTML. The Lisp community as a few templating languages for this kind of thing.  Who doesn’t?  The more popular of these have mimics in Parenscript.

Parenscript, you will recall, is a thin gloss over Javascript that enables you to write your Javascript using s-expressions which are then converted into Javascript before delivery to the browser.

So I wanted that for cl-interpol as well. So I wrote something that translates the expanded code into parenscript.

As in the example above the output of cl-interpol’s expansion is always a with-output-to-string form, so my hack consists of a parenscript macro for with-output-to-string which then walks the enclosing form converting it into parenscript and then into javascript. For example:

This parenscript:


(let ((x 40)) (interpolate "{How about ${(+ x 2)}.}")))

becomes this javascript:


(function () {
    var x = 40;
    return ['How about ', String(x + 2), '.'].join('');
})();

Cl-interpol has lots of features, and I certainly do not handle things it can do. I’ve only covered cases as I need them. But I’ve found it useful.

Tax the Rich

Why have the top few percent have taken over such a large part of the economy?

TaxTheRich

 

That chart (source) shows that lowering their taxes plays a very large part in the story.

Is this due to economic fundamentals (aka: globalization, computers, the rise of winner take all business models), or a simple political victory by agents of high income individuals?

Monocarpic

Monocarpic plants set seed only once and then die.  Bamboo is of this kind, but they have very long lives.  We have a lovely clumping bamboo (Fargesia), i.e. it’s not invasive.  It currently has has an abundant crop of seed.  So this is the end.   Or is it?  I think it’s over.

The cultivar we have is Fargesia nitida, which features a pretty dark purple cane.  It was brought out of China by a Russian collector in the 1880s, and presumably all the plants like ours have been cloned from that one.  They are all setting seed these days, that started a few years ago.   It would seem that the setting of seeds in the Bamboo is a somewhat synchronized event, worldwide.  You can already buy new plants grown from the seeds; though only time will tell exactly how those will behave.

That this only happens every 100+ years makes me curious if it would be possible to brew a craft beer from the abundant grain harvest.

Fargesia

Cicadas

EP-130509471 (1) (1)

See More

The New Yorker has a short essay about long reproductive cycle of the Cicadas.  Cicadas emerge every 13, or 17 years; this year’s appear every 17 part of the largest “brood.”  13 and 17 are prime numbers.  The theory for why that is is that this helps them remain out of synch with the reproductive cycles of their predators.

This all reminded me of the mast years.  You’ll recall that mast years are apparently random events were in a given species of tree across a region will produce a vast number of seeds.  Animals that eat those seeds are overwhelmed so some of the seeds survive.  But also the animals suffer a population bubble, and the the following year they starve.  There is an amazing story about the ripple effects of a mast year in Bamboo.  In that story the rat population exploded, and the next year the rats moved onto eating people’s grain stores; which lead to a revolution.

Which got me wondering what are the ripple effects around the Circada’s emergence.   This essay provides a bit of of that.   The Circada laval eat tree roots – trees have very long reproduction cycles – and you can see the signature of the prime number cycles in the tree rings. Moles thrive in the year before the emergence as they feast on the soon to emerge population.  Presumably next year will be a lousy time to be a mole.

That article also talks about wasps and bacteria.   Settling into a reproductive cycle based on a prime number is only gone to help you avoid predators who’s reproductive cycles are multiples of years.   Moles, rats, and wasps for example.  But it’s no help against the bacteria.  They can ramp up their population fast.   Which leads to a curiosity that older trees have a resident population of bacteria that loves to eat Circada; and the Circada tend to emerge around younger trees.

Meanwhile there is a cool example of crowd sourced science over at MagiCicada.org, where you can see where they are emerging.  See also www.cicadamania.com.  Sadly they aren’t common here in Boston.

More widgets in plot-window.

Here’s another video showing a bit more progress on my hack that allows you to use a browser as a place to display output from your Common Lisp REPL.  I’ve been playing with various javascript widgets.  Here the demo routine shows:

  1. Using JQuery to animate the color of a small rectangle.
  2. A rich WYSIWYG text editor.  This one’s called nicedit.   There are dozens of these.
  3. Mapping via mapstraction, which provides a provider independent mapping widget, in this case I’m using open street maps as a provider.
  4. A tool that does syntax highlighting, i.e. it displays source code with pretty colors.

The initial plot is unchanged from my earlier posting.  You might want to watch this full screen…

Getting these to work isn’t terribly hard, but it’s slightly harder than I’d expected since most of them don’t expect to be loaded dynamically as I’m doing here.

The code running in this demo is in the dev branch over at github, but there is an odd bug I haven’t tracked down yet. Pretty soon I’ll need to change the name 🙂