Category Archives: Books

Books Recently Read

Read recently (i.e. last couple of months)

  • The Silent Woman: Sylvia Plath and Ted Hughes by Janet Malcolm. (Feb 2014). Brilliant, thought-provking and insightful. A fascinating narrative, raising interesting and complex questions and all delivering in lapidary prose.
  • The Unwinding by George Packer (May 2014). I picked this up by accident in bookstore in DC Union Station. It hit me like a bolt between the eyes. The personal stories read like novels, the vignettes on famous personalities are rapiers that cut open the follies and predilictions of the age, and the overall sweep is poignant, powerful and profound. An extraordinary, special achievement. Read this book.
  • This Time is Different – Eight Centuries of Financial Folly by Reinhardt and Rogoff. (May 2014?) Quite interesting. Felt rather like an extended series of papers rather than a book. Quite a lot of good data.
    • 3 types of crises: External debt, domestic debt and banking.
    • Financial crises (default episodes) recur repeatedly but are often spaced substantially apart leading to “this time is different”
    • Takes a long time for a country to graduate to having a good borrowing rating and this counts for a lot.
    • Countries with a high rating don’t default (that much).
    • 2008 crisis was most severe since 30s in terms of amount of debt in default.
    • Generally see substantial increase in debt through a crisis and this is paid down via inflation
  • Lords of Finance. The Bankers who Broke the World by Liaquat Ahamed. (June 2014) Much more enjoyable than I had imagined. More of a narrative history of the period with lots of great anecdotes and excellent analysis of what went wrong. Much better (in many ways) than “This Time is Different”.
  • The Assassins’ Gate – America in Iraq by George Packer. (July 2014) Brilliant – almost as good as “The Unwinding.
  • The Master Switch – The Rise and Fall of Information Empires by Tim Wu. (July 2014). Pretty good though ultimately felt a bit disappointed – the earlier sections felt a lot more detailed and solid than the latter.
  • Under the Skin by Michael Faber. (July 2014) Disturbing allegory that is surprisingly powerful. Very well executed and more powerful for its (in)humanity.
  • The Crimson Petal and the White by Michael Faber. (July 2014). Engrossing but not that substantive. His misanthropy which infects the start gradually mellows. The ending is quite disatisfying as if he simply ran out of steam rather than reached a necessary conclusion.

Lombard Street: A Description of the Money Market by Walter Bagehot

A few weeks ago I had the pleasure to read Lombard Street: A Description of the Money Market by Walter Bagehot (1873, my edition a reprint of the 1910 Dutton Edition). Insightful, incisive and straightforwardly written in the kind of limpid but expressive prose that seems to have gone out with the 19th century. It also includes some very useful data points, some of which are included in the excerpts below.

Excerpts from the [Gutenberg version]( (not clear what edition but checked against my copy). All emphasis added.

Dividends of Banks (p.39)

This is the natural desire of all directors to make a good dividend for their shareholders. The more money lying idle the less, caeteris paribus, is the dividend; the less money lying idle the greater is the dividend. And at almost every meeting of the proprietors of the Bank of England, there is a conversation on this subject. Some proprietor says that he does not see why so much money is kept idle, and hints that the dividend ought to be more.

Indeed, it cannot be wondered at that the Bank proprietors do not quite like their position. Theirs is the oldest bank in the City, but their profits do not increase, while those of other banks most rapidly increase. In 1844, the dividend on the stock of the Bank of England was 7 per cent, and the price of the stock itself 212; the dividend now is 9 per cent, and the price of the stock 232. But in the same time the shares of the London and Westminster Bank, in spite of an addition of 100 per cent to the capital, have risen from 27 to 66, and the dividend from 6 per cent to 20 per cent.[^1] That the Bank proprietors should not like to see other companies getting richer than their company is only natural.

[^1]: In 1905 the Bank of England paid a dividend of 9 per cent, and the London and Westminster Bank a dividend of 13 per cent. At the end of 1905 the sshares ofthe Bank of England were quoted at 293.5 and the those of the London and Westminster Bank at 58.

Some part of the lowness of the Bank dividend, and of the consequent small value of Bank stock, is undoubtedly caused by the magnitude of the Bank capital; but much of it is also due to the great amount of unproductive cash—of cash which yields no interest—that the Banking Department of the Bank of England keeps lying idle. If we compare the London and Westminster Bank—which is the first of the joint-stock banks in the public estimation and known to be very cautiously and carefully managed—with the Bank of England, we shall see the difference at once. The London and Westminster has only 13 per cent of its liabilities lying idle. The Banking Department of the Bank of England has over 40 per cent. So great a difference in the management must cause, and does cause, a great difference in the profits. Inevitably the shareholders of the Bank of England will dislike this great difference; more or less, they will always urge their directors to diminish (as far as possible) the unproductive reserve, and to augment as far as possible their own dividend.

Origin of Banking in Ensuring Currency Quality (pp. 80-82)

The real history is very different. New wants are mostly supplied by adaptation, not by creation or foundation. Something having been created to satisfy an extreme want, it is used to satisfy less pressing wants, or to supply additional conveniences. On this account, political Government—the oldest institution in the world—has been the hardest worked. At the beginning of history, we find it doing everything which society wants done, and forbidding everything which society does not wish done. In trade, at present, the first commerce in a new place is a general shop, which, beginning with articles of real necessity, comes shortly to supply the oddest accumulation of petty comforts. And the history of banking has been the same. The first banks were not founded for our system of deposit banking, or for anything like it. They were founded for much more pressing reasons, and having been founded, they, or copies from them, were applied to our modern uses.

The earliest banks of Italy, where the name began, were finance companies. The Bank of St. George, at Genoa, and other banks founded in imitation of it, were at first only companies to make loans to, and float loans for, the Governments of the cities in which they were formed. The want of money is an urgent want of Governments at most periods, and seldom more urgent than it was in the tumultuous Italian Republics of the Middle Ages. After these banks had been long established, they began to do what we call banking business; but at first they never thought of it. The great banks of the North of Europe had their origin in a want still more curious. The notion of its being a prime business of a bank to give good coin has passed out of men’s memories; but wherever it is felt, there is no want of business more keen and urgent. Adam Smith describes it so admirably that it would be stupid not to quote his words:—’The currency of a great state, such as France or England, generally consists almost entirely of its own coin. Should this currency, therefore, be at any time worn, clipt, or otherwise degraded below its standard value, the state by a reformation of its coin can effectually re-establish its currency. But the currency of a small state, such as Genoa or Hamburgh, can seldom consist altogether in its own coin, but must be made up, in a great measure, of the coins of all the neighbouring states with which its inhabitants have a continual intercourse. Such a state, therefore, by reforming its coin, will not always be able to reform its currency. If foreign bills of exchange are paid in this currency, the uncertain value of any sum, of what is in its own nature so uncertain, must render the exchange always very much against such a state, its currency being, in all foreign states, necessarily valued even below what it is worth.

‘In order to remedy the inconvenience to which this disadvantageous exchange must have subjected their merchants, such small states, when they began to attend to the interest of trade, have frequently enacted, that foreign bills of exchange of a certain value should be paid, not in common currency, but by an order upon, or by a transfer in, the books of a certain bank, established upon the credit, and under the protection of the state, this bank being always obliged to pay, in good and true money, exactly according to the standard of the state. The banks of Venice, Genoa, Amsterdam, Hamburgh and Nuremburg, seem to have been all originally established with this view, though some of them may have afterwards been made subservient to other purposes. The money of such banks, being better than the common currency of the country, necessarily bore an agio, which was greater or smaller, according as the currency was supposed to be more or less degraded below the standard of the state. The agio of the bank of Hamburgh, for example, which is said to be commonly about fourteen per cent, is the supposed difference between the good standard money of the state, and the clipt, worn, and diminished currency poured into it from all the neighbouring states.

‘Before 1609 the great quantity of clipt and worn foreign coin, which the extensive trade of Amsterdam brought from all parts of Europe, reduced the value of its currency about 9 per cent below that of good money fresh from the mint. Such money no sooner appeared than it was melted down or carried away, as it always is in such circumstances. The merchants, with plenty of currency, could not always find a sufficient quantity of good money to pay their bills of exchange; and the value of those bills, in spite of several regulations which were made to prevent it, became in a great measure uncertain.

‘In order to remedy these inconveniences, a bank was established in 1609 under the guarantee of the City. This bank received both foreign coin, and the light and worn coin of the country at its real intrinsic value in the good standard money of the country, deducting only so much as was necessary for defraying the expense of coinage, and the other necessary expense of management. For the value which remained, after this small deduction was made, it gave a credit in its books. This credit was called bank money, which, as it represented money exactly according to the standard of the mint, was always of the same real value, and intrinsically worth more than current money. It was at the same time enacted, that all bills drawn upon or negotiated at Amsterdam of the value of six hundred guilders and upwards should be paid in bank money, which at once took away all uncertainty in the value of those bills. Every merchant, in consequence of this regulation, was obliged to keep an account with the bank in order to pay his foreign bills of exchange, which necessarily occasioned a certain demand for bank money.’

Appointment of the Governor (& comments on the French Manner of Doing Things) (pp. 231)

… In France the difficulty of finding a good body to choose the Governor of the Bank has been met characteristically. The Bank of France keeps the money of the State, and the State appoints its governor. The French have generally a logical reason to give for all they do, though perhaps the results of their actions are not always so good as the reasons for them. The Governor of the Bank of France has not always, I am told, been a very competent person; the Sub-Governor, whom the State also appoints, is, as we might expect, usually better. But for our English purposes it would be useless to inquire minutely into this. No English statesman would consent to be responsible for the choice of the Governor of the Bank of England. After every panic, the Opposition would say in Parliament that the calamity had been ‘grievously aggravated,’ if not wholly caused, by the ‘gross misconduct’ of the Governor appointed by the ministry. Or, possibly, offices may have changed occupants and the ministry in power at the panic would be the opponents of the ministry which at a former time appointed the Governor. In that case they would be apt to feel, and to intimate, a ‘grave regret’ at the course which the nominee of their adversaries had ‘thought it desirable to pursue.’ They would not much mind hurting his feelings, and if he resigned they would have themselves a valuable piece of patronage to confer on one of their own friends. No result could be worse than that the conduct of the Bank and the management should be made a matter of party politics, and men of all parties would agree in this, even if they agreed in almost nothing else.

I am therefore afraid that we must abandon the plan of improving the government of the Bank of England by the appointment of a permanent Governor, because we should not be sure of choosing a good governor, and should indeed run a great risk, for the most part, of choosing a bad one.

Echoes of Today’s Extensive Attention to Deliberations of the “Fed” of the MPC (p. 243)

It has been said, with exaggeration, but not without a basis of truth, that if the Bank directors were to sit for four hours, there would be ‘a panic solely from that.’ ‘The court,’ says Mr. Tooke, ‘meets at half-past eleven or twelve; and, if the sitting be prolonged beyond half-past one, the Stock Exchange and the money market become excited, under the idea that a change of importance is under discussion; and persons congregate about the doors of the Bank parlour to obtain the earliest intimation of the decision.’ And he proceeds to conjecture that the knowledge of the impatience without must cause haste, if not impatience, within. That the decisions of such a court should be of incalculable importance is plainly very strange.

Profitability of Banks and its Cause (pp. 247-248)

‘But the main source of the profitableness of established banking is the smallness of the requisite capital. Being only wanted as a “moral influence,” it need not be more than is necessary to secure that influence. Although, therefore, a banker deals only with the most sure securities, and with those which yield the least interest, he can nevertheless gain and divide a very large profit upon his own capital, because the money in his hands is so much larger than that capital.

‘Experience, as shown by plain figures, confirms these conclusions. We print at the end of this article the respective profits of 110 banks in England, and Scotland, and Ireland, being all in those countries of which we have sufficient information—the Bank of England excepted. There are no doubt others, but they are not quoted even on local Stock Exchange lists, and in most cases publish no reports. The result of these banks, as regards the dividends they pay, is—

                               No. of Companies    Capital (L)
    Above 20 per cent             15                5,302,767
    Between 15 and 20 per cent    20                5,439,439
       " 10 and 15 per cent       36               14,056,950
       " 5 and 10 per cent        36               14,182,379
    Under 5 per cent               3                1,350,000
                                 110               40,331,535

that is to say, above 25 per cent of the capital employed in these banks pays over 15 per cent, and 62 1/2 per cent of the capital pays more than 10 per cent. So striking a result is not to be shown in any other joint stock trade.

Management and Supervision of Banks (pp. 262-263)

And an effectual supervision by the whole board being impossible, there is a great risk that the whole business may fall to the general manager. Many unhappy cases have proved this to be very dangerous. Even when the business of joint stock banks was far less, and when the deposits entrusted to them were very much smaller, a manager sometimes committed frauds which were dangerous, and still oftener made mistakes that were ruinous. Actual crime will always be rare; but, as an uninspected manager of a great bank has the control of untold millions, sometimes we must expect to see it: the magnitude of the temptation will occasionally prevail over the feebleness of human nature. But error is far more formidable than fraud: the mistakes of a sanguine manager are, far more to be dreaded than the theft of a dishonest manager. Easy misconception is far more common than long-sighted deceit. And the losses to which an adventurous and plausible manager, in complete good faith, would readily commit a bank, are beyond comparison greater than any which a fraudulent manager would be able to conceal, even with the utmost ingenuity. If the losses by mistake in banking and the losses by fraud were put side by side, those by mistake would be incomparably the greater. There is no more unsafe government for a bank than that of an eager and active manager, subject only to the supervision of a numerous board of directors, even though that board be excellent, for the manager may easily glide into dangerous and insecure transactions, nor can the board effectually check him.

Bill-broker commissions and operations (pp. 287-288)

As is usually the case, this kind of business has grown up only gradually. In the year 1810 there was no such business precisely answering to what we now call bill-broking in London. Mr. Richardson, the principal ‘bill-broker’ of the time, as the term was then understood, thus described his business to the ‘Bullion Committee:’

Mr. Richardson was only a broker who found money for bills and bills for money. He is further asked:

‘Do you guarantee the bills you discount, and what is your charge per cent?—No, we do not guarantee them; our charge is one-eighth per cent brokerage upon the bill discounted, but we make no charge to the lender of the money.

‘Do you consider that brokerage as a compensation for the skill which you exercise in selecting the bills which you thus get discounted?—Yes, for selecting of the bills, writing letters, and other trouble.

‘Does the party who furnishes the money give you any kind of compensation?—None at all.

‘Does he not consider you as his agent, and in some degree responsible for the safety of the bills which you give him?—Not at all.

‘Does he not prefer you on the score of his judging that you will give him good intelligence upon that subject?—Yes, he relies upon us.

‘Do you then exercise a discretion as to the probable safety of the bills?—Yes; if a bill comes to us which we conceive not to be safe, we return it.

‘Do you not then conceive yourselves to depend in a great measure for the quantity of business which you can perform on the favour of the party lending the money?—Yes, very much so. If we manage our business well, we retain our friends; if we do not, we lose them.’

Slouching Towards Bethelehem by Joan Didion

Read some time ago Joan Didion’s extraordinary set of essays Slouching Towards Bethlemem1, a book filled with the sense of dislocation and anomie that seems so essential to the experience, at least in literature, of America itself.

The most penetrating of the set was that which lends its title to the book2 and I marked one particular section out of that essay, and out of the book as a whole:

[in discussion of Haight-Ashbury in summer 1967] But the peculiar beauty of this political potential, as far as the activists were concerned, was that it remained not clear at all to most of the inhabitants of the District, perhaps because of the few seventeen-year-olds who are political realists tend not to adopt romantic idealism as a life style. Nor was it clear to the press, which at varying levels of the competence continued to report “the hippie phenomemon” as an extended panty raid; an artistic avant-garde led by such comfortable YMHA regulars as Allen Ginsberg; or a thoughtful protest, not unlike joining the Peace Corps, against the culture which had produced Saran-Wrap and the Vietnam War. This last, or they’re-trying-to-tell-us-something approach, reached its apogee in a Time cover story which revealed that hippies “scorn money — they call it ‘bread'” and remains the most remarkable, if unwitting, extant evidence that the signals between the generations are irrevocably jammed.

Because the signals the press were getting were immaculate of political possibilities, the tensions of the District went unremarked upon, even during the period when there were so many observers on Haight Street from Life and Look and CBS that they were largely observing one another. …

Of course the activists — not those whose thinking had become rigid, but those whose approach to revolution was imaginatively anarchic — had long ago grasped the reality which still eluded the press: we were seeing something important. We were seeing the desperate attempt of a handful of pathetically unequipped children to create a community in a social vacuum. Once we had seen these children, we could no longer overlook the vacuum, no longer pretend that the society’s atomization could be reversed. This was not a traditional generational rebellion. At some point between 1945 and 1967 we had somehow neglected to tell these children that the rules of the game we happened to be playing. Maybe we had stopped believing in the rules ourselves, maybe we were having a failure of nerve about the game. Maybe there was were just too few people around to do the telling. These were children who grew up cut loose from the web of cousins and great-aunts and family doctors and lifelong neighbors who had traditionally suggested and enforced the society’s values. They are children who have moved around a lot, San Jose, Cula Vista, here. They are less in rebellion against the society than ignorant of it, able only to feed back certain of its most publicized self-doubts, Vietnam, Saran-Wrap, diet pills, the Bomb. [bold emphasis added]

They feed back exactly what is given them. … [pp. 121-123]


From the closing paragraph of the preface:

My only advantage as a reporter is that I am so physically small, so temperamentally unobtrusive, and so neurotically inarticulate that people tend to forget that my presence runs counter to their best interests. And it always does. That is one last thing to remember: writes are always selling somebody out.

  1. Flamingo 1993, first published Farrar, Strauss and Giroux 1968. 

  2. An entirely intentional choice. As Didion states in the preface:

    “[Slouching Towards Bethlemem] is also the title of one piece of the book, and that piece, which derived from some time spent in the Haight-Ashbury district of San Francisco, was the for me both the most imperative of all these pieces to write and the only one that made me despondent after it was printed. It was the first time I had dealt directly and flatly with evidence of atomization, the proof that things fall apart: I went to San Francisco because I had not been able to work in some months, had been paralyzed by the conviction that writing was an irrelevant act, that the world as I had understood it no longer existed. If I was to work again at all, it would be necessary for me to come to terms with disorder. That was why the piece was important to me. And after it was printed I was that, however directly and flatly I thought I had said it, I had failed to get through to many of the people who read and even liked the piece, failed to suggest that I was talking about something more general that a handful of children wearing mandalas on their foreheads. Disc jockeys telephoned my house and wanted to discuss (on the air) the incidence of the “filth” in the Haight-Ashbury, and acquaintances congratulated me on having finished the piece “Just in time”, because “the whole fad’s dad now, fini, kaput.” I suppose almost everyone who writes is afflicted some of the time by the suspicion that nobody out there is listening, but it seemed to me then (perhaps because the piece was important to me) that I had never gotten a feedback so universally beside the point. 

Howto Install 4store

My experiences (with the assistance of Will Waites) of installing 4store On Ubuntu Jaunty.

No packaged versions of code (there is one in fact from Yves Raimond from mid 2009 but now out of date …), so need to get from github.

Recommend using will waites fork which adds useful features like:

  • multiple connections
  • triple deletion

Note I had to make various fixes to get this to compile on my ubuntu machine. See diff below.

Install standard ubuntu/debian dependencies:

  • See 4store wiki
  • rasqal needs to be latest version
    • Get it
    • ./configure –prefix=/usr –sysconfdir=/etc –localstatedir=/var
    • make, make install
  • Now install

Now to start a DB:

  • 4s-backend-setup {db-name}
  • 4s-backend {db-name}

Now for the python bindings also created by will waites and which can be found here

  • On my Jaunty needed to convert size_t to int everywhere
  • Needed to run with latest cython (v0.12) installed via pip/easy_install
  • To run tests need backend db called py4s_test (harcoded)

To run multiple backends at once you will probably need to have avahi dev libraries (not sure which!).

Diff for wwaites 4store fork (updated diff as of 2010-04-28)

diff --git a/src/backend/Makefile b/src/backend/Makefile
index 51a957c..e64eb13 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -2,7 +2,7 @@ include ../
 include ../
 include ../

-CFLAGS = -Wall -Wstrict-prototypes -Werror -g -std=gnu99 -O2 -I.. -DGIT_REV=\"$(gitrev)\" pkg-config --cflags raptor glib-2.0 +CFLAGS = -Wall -Wstrict-prototypes -g -std=gnu99 -O2 -I.. -DGIT_REV=\"$(gitrev)\" pkg-config --cflags raptor glib-2.0 LDFLAGS = $(ldfdarwin) $(ldflinux) -lz pkg-config --libs raptor glib-2.0 $(avahi)

LIB_OBJS = chain.o bucket.o list.o tlist.o rhash.o mhash.o sort.o \ diff --git a/src/common/Makefile b/src/common/Makefile index 9b33e94..60cd04f 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -21,7 +21,7 @@ ifdef dnssd mdns_flags = -DUSE_DNS_SD endif

-CFLAGS = -std=gnu99 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -g -O2 -I../ -DGIT_REV=\"$(gitrev)\" $(mdns_flags) pkg-config --cflags $(pkgs) +CFLAGS = -std=gnu99 -fno-strict-aliasing -Wall -Wstrict-prototypes -g -O2 -I../ -DGIT_REV=\"$(gitrev)\" $(mdns_flags) pkg-config --cflags $(pkgs) LDFLAGS = $(ldfdarwin) $(lfdlinux) LIBS = pkg-config --libs $(pkgs)

diff --git a/src/frontend/results.c b/src/frontend/results.c index 485ac31..162aa3d 100644 --- a/src/frontend/results.c +++ b/src/frontend/results.c @@ -381,12 +381,12 @@ fs_value fs_expression_eval(fs_query *q, int row, int block, rasqal_expression * return v; }

  • return fs_value_error(FS_ERROR_INVALID_TYPE, "unsupported aggregate operation");
  • //case RASQAL_EXPR_SUM:
  • //case RASQAL_EXPR_AVG:
  • //case RASQAL_EXPR_MIN:
  • //case RASQAL_EXPR_MAX:
  • //case RASQAL_EXPR_LAST:
  •  //    return fs_value_error(FS_ERROR_INVALID_TYPE, "unsupported aggregate operation");


Diff to wwaites py4s (updated diff as of 2010-04-28)

diff --git a/_py4s.pxd b/_py4s.pxd
index 5251289..0e26250 100644
--- a/_py4s.pxd
+++ b/_py4s.pxd
@@ -110,7 +110,7 @@ cdef extern from "frontend/results.h":

cdef extern from "frontend/import.h": int fs_import_stream_start(fsp_link *link, char *model_uri, char *mimety - int fs_import_stream_data(fsp_link *link, unsigned char *data, size_t co + int fs_import_stream_data(fsp_link *link, unsigned char *data, int count int fs_import_stream_finish(fsp_link *link, int *count, int *errors)

cdef extern from "frontend/update.h":

Flexible Dates in Python (including BC)

I’ve had occasion recently to frequently work with “dates” that come in a lot of shapes and sizes including:

  • Dates in distant past and future including BC/BCE dates
  • Dates in a wild variety of formats: Jan 1890, January 1890, 1st Dec 1890, Spring 1890 etc
  • Dates of varying precision: e.g. 1890, 1890-01 (i.e. Jan 1890), 1890-01-02
  • Imprecise dates: c1890, 1890?, fl 1890 etc

Unfortunately existing support for these in python is fairly weak. I therefore authored a python FlexiDate module (now part of datautil part of a new swiss (army knife) package) which is focused on supporting:

  1. Dates outside of Python (or DB) supported period (esp. dates < 0 AD)
  2. Imprecise dates (c.1860, 18??, fl. 1534, etc)
  3. Normalization of these dates to machine processable versions especially:
    • ISO 8601
    • Dates sortable in the database (in correct date order)


Things we would like:

  1. Dates outside of Python (or DB) supported period (esp. dates < 0 AD)
  2. Imprecise dates (c.1860, 18??, fl. 1534, etc)
  3. Normalization of dates to machine processable versions
  4. Sortable in the database (in correct date order)
  5. Human readability as dates will be re-edited/viewed by people

Not all of these requirements are satisfiable at once in a simple way.

Be clear about what we want:

  1. Storage (and preservation) of “user” dates (both normal and non-normal)
  2. Normalization of dates (e.g. to ~ ISO 8601)
  3. Integration with database (sortability and serializability)

Solution for 1: Represent dates as strings.

Solution for 2: Have a parser (via an intermediate FlexiDate object).

Solution for 3: convert to a float.

Remark: no string based date format will sort dates correctly based on std string ordering (PF: let x,y be +ve dates and X,Y their string representations then if X < Y => -X < -Y (wrong!))

Thus we need to add some other field if we wish dates to be correctly sorted (or not worry about sorting of -ve dates …)

  1. For any given date attribute have 2 actual fields:
  • user version — the version edited by users
  • normalized/parsed version — a version that is usable by machines
  1. Store both versions in a single field but with some form of serialization.

  2. Convert dates to long ints (unlimited in precision) and put this in a separate field and use that for sorting.


Initially thought that we should parse before saving into a FlexiDate format but: a) why bother b) when parsing always hard not to be lossy (in particular when converting to iso8601 using e.g. dateutil very difficult to not add info e.g. parsing 1860 can easily give us 1860-01-01 …).

References and Existing Libraries

Accordion Crimes by Annie Proulx

7/10. Extensive in its imagination but losing some of its power by this very fact as the stories start to blur and something of its early intensity is lost as we head into the closing sections. Overall a very dark (and probably correct) vision of the immigrant experience in the US: all prejudice, death and broken families — at least as I can remember, there was not one happy relationship or family recorded in these 380 odd pages.