Wednesday, August 10, 2016

Alexey Shipilev's work on the Java Memory Model is AMAZING!

There are certain documents that you ought to make it a habit to read, and re-read, every so often.

At least, if you aspire to be, or to remain, an expert Java programmer.

Alexey Shipilev's epic and exhaustive explanations of the Java Memory Model are surely on that list.

  • Java Memory Model Pragmatics (transcript)
    This post is a transcript of the "Java Memory Model Pragmatics" talk I gave during this year at different conferences, mostly in Russian. There seems to be a limited supply of conferences in the world which can accommodate such a long talk, and being in need for exposing some background reading for my JMM Workshop at JVMLS this year, I decided to transcribe it.
  • Close Encounters of The Java Memory Model Kind
    In this post, we will try to follow up on particular misunderstandings about Java Memory Model, hopefully on the practical examples. The examples use the APIs from the jcstress suite, which are concise enough for a reader, and are runnable.

At one time I thought I knew this stuff, and perhaps I did, but I find that if I re-read it about once every six months or so, each time I do so I get smarter.

I suppose that this is sort-of the software engineering equivalent of "continuing education". They don't really teach you this sort of thing in school (though I learned about computers before there was such a thing as Computer Science in schools), and you won't (easily) pick this sort of thing up during your day-to-day work.

You just have to find a few, quiet hours every so often, pour yourself a strong cup of coffee, and dig in.

Tuesday, August 9, 2016

Day of the Dead: a very short review

The National's Day of the Dead falls into several categories:

  • It's a tribute album, and as such it falls into a LONG list of such tributes, going at least back to 1991's Deadicated

  • It's a fund-raising effort for an organization called Red Hot:
    Red Hot is a not-for-profit dedicated to fighting AIDS through pop culture.

Any project with a mixed mission like that is going to have to bravely take some swings, knowing that there will be some hits, and some misses.

And Day of the Dead indeed has a few of both.

But, overall, it is a fabulous result, in a number of respects.

The musical choices cover the entire multi-decade history of the band, going back to songs from the mid-1960's such as Cream Puff War, Clementine Jam and New Speedway Boogie, making extensive selections from the period of (roughly) 1970-1985, which was surely the Dead's most productive and brilliant time, and including a nice handful of late-period songs, such as Shakedown Street, Touch of Grey, Althea, and even The Jerry Garcia Band's rarely-played Reuben and Cherise

And the contributors, too, are a wide and varied lot, including a number of well-known acts (Mumford and Sons, Vijay Iyer, Bruce Hornsby, Wilco, Courtney Barnett) as well as a lot of folks I bet you've never heard of.

Finally, the production values are high. The recordings are clear and nicely mastered, the packaging and artwork are elegant and well-mannered (no cheap plastic), and the CDs each are nicely marked and contained in nicely-labelled sleeves.

But all these are details. In the end, does it all hold together?

I think: yes. Yes, it does.

There are a few clunkers, places where the result is much more swing-and-miss than base-hit, but overall this is a fine collection of music, MUCH more listenable than your typical tribute album.

Songs in a tribute album fall, I think, into several basic classes:

  • Labors of love and homages, in which the musicians bring energy and enthusiasm to well-known classics, but are reluctant to stray too far from tradition
  • Fresh looks, in which the musicians keep the overall piece within recognizable boundaries, but try to take it in a new direction.
  • Experiments, in which there is a fundamental alteration of the core elements of the piece, in search of something altogether new

Sometimes, experiments bring dramatic breakthroughs; in the Grateful Dead context, the best known such breakthrough is probably the so-called "slow version" of Friend Of The Devil. For a wonderful re-telling of the history of this particular experimental breakthrough, and how it involved Kenny Loggins, Betty Cantor, and the New Riders of The Purple Sage, see Corry Arnold's June 30, 1972: Memorial Auditorium, Kansas City, KS: NRPS/Kenny Loggins (Friend Of The Devil-slow)

Anyway, the point is that experiments are important, and brave, but they also fail much more than they succeed. There are several experiments on Day of the Dead, and I must admit that, were I the compiler, I don't think I would have included them on the final release.

However, I was NOT the compiler, and I must at least salute the intellectual curiosity and musical inventiveness of the choices that did get made.

So, to wrap it all up, let me offer my list of the Thirteen Best Songs on Day of the Dead, together with my list of the Four Worst Songs on Day of the Dead

First, the clunkers:

  1. Lucius, Uncle John's Band. Screaming banshees wail and turn the Dead's friendliest, most approachable song into a howling assault. The funny thing is, I've seen Lucius live and loved them, so I had very high hopes. I think this is the perfect example of an experiment that just didn't work for me.

  2. Tal National, Eyes of the World. Where the original was an effusion of wonder and joy, this attempt to evoke some sort of tribal chant instead becomes a monotony of noise.

  3. Courtney Barnett, New Speedway Boogie. Barnett has a wealth of talent, but I feel like she just wasn't inspired this time. A song which calls for her to find her inner Janis Joplin instead finds her with a whiny screech. What tried to be a fresh look falls quite short, I'm afraid.

  4. Marijuana Death Squads, Truckin'. One of the Dead's signature songs, Truckin's tale of the stresses of touring life requires an approach that delivers energy and excitement, but this version instead becomes rushed, frenzied, and cluttered. They aimed high, but they fell short.

OK, enough of being a drag. What are my absolute favorites (so far at least)?

  1. Orchestra Baobab, Franklin's Tower. These Senegalese (I think) musicians bring an Afro-Jazz approach to one of the Dead's jazziest numbers. It is delightful! It is magnificent!

  2. Ira Kaplan & Friends, Wharf Rat. The best-known version of the original Wharf Rat is the epic nine minute version on 1971's Grateful Dead; it starts slow, filled with pain and horror, then builds through renewal and redemption to a thunderous climax. Kaplan, who is the front man for the wonderful, if not well-known, band Yo La Tengo, choses to focus solely on the quiet resolve and fierce determination of the narrator, and the effect is gorgeous.

  3. Vijay Iyer, King Solomon's Marbles. The spectacularly talented Iyer could play "Chopsticks" and it would probably be a Special Event. But King Solomon's Marbles is certainly not "Chopsticks", and there is no way that you've ever heard the Grateful Dead like this before. It somehow simultaneously brings to mind the best of the Dead, and the best of Keith Jarrett, all at once.

  4. Bryce Dressner, Garcia Counterpoint. This is really unusual. It is, I think, the only original composition in the entire collection. The album notes say:
    'Garcia Counterpoint' was composed using fragments of Jerry Garcia's live guitar solo on "Althea" recorded at Capital Centre, Landover, Maryland on March 15, 1990. Live solo originally transcribed by Stephen Feigenbaum.
    All I know is, when you listen to it, it's like Jerry is back, and he's sitting across the room from you on a comfortable chair, just playing his guitar.

  5. Bela Fleck, Help On The Way. Yes, I know: Bela Fleck is a banjo player, and there wasn't a banjo to be found anywhere close to that most jazziest of Grateful Dead records, Blues for Allah. And I know that this selection is going to be controversial, for I'm sure there are those who hear Bela Fleck's croaking voice and cringe. But Jerry was a banjo player too, and, well, I'm not going to try to explain this to you. Banjo and tabla: it is somehow a more perfect Help On The Way than the original could ever have hoped to have been.

  6. The National, Morning Dew. This song is supposed to be an anthem, but when the Dead played it themselves, it all too often was a soggy slog. The National wake it up and give it the backbone it deserves.

  7. Bonnie 'Prince' Billy & Friends, Rubin & Cherise. This is really a Jerry Garcia Band song, and not all that well-known, but Bonnie Billy dresses it up with a delicious guitar hook and a lively presentation that should make this wall flower the new belle of the ball.

  8. Jim James & Friends, Candyman. James, leader of the well-known My Morning Jacket, clearly knew just what song he wanted. Candyman, from the Dead's most approachable album, American Beauty, is an odd-ball of a song about a pusher and a pimp who worms his way into your heart with promises and gifts, only to deliver you into sorrow. One of the first Dead recordings to feature that fascinating combination of pedal steel and organ that would become one of their signature sounds, Candyman is surely not a song for an amateur to perform, but James channels his inner Jerry and delivers a beautiful rendition.

  9. Orchestra Baobab, Clementine Jam. OK, this is an EXTREME rarity. You have to be a very, very faithful Dead Head to know Clementine
    According to setlists.net studio dates, the Dead worked on Clementine several times in the Aoxomoxoa sessions in fall '68. Sadly, none of these outtakes have surfaced, but the Matrix shows make clear that they must have been working on the song around that time, and it appears in the two earlier studio rehearsals we have. Unfortunately, there are no Clementines in the Dead shows that survive from late '68, and they decided not to put it on Aoxomoxoa. Perhaps they felt it was too derivative a song, or Garcia wasn't comfortable with the lyrics, or the arrangement never satisfied them? It seems the song was left unfinished, never finalized...
    Well, Les musiciens de L'Orchestra Baobab can't be said to have finished the unfinished, nor finalized the never finalized, but they certainly bring back thoughts of what it was like, all those 50 years ago, before they were even known as The Grateful Dead.

  10. Hiss Golden Messenger, Brown-Eyed Women. M.C. Taylor, who performs as Hiss Golden Messenger, brings a tight, controlled, perfect-to-the-last-note rendition of one of the best songs that Robert Hunter and Jerry Garcia ever composed. The only complaint you could have about this version is that it's just over too soon, too soon.

  11. Kurt Vile and Violators, Box of Rain. The sweetest and warmest Dead song of all has long been a fan favorite, but it can tremble on the edge of sugar and treacle. Vile, a talented young musician (yay for the new generation!) wakes it up and puts just enough pepper and spice in. A fine treatment, and a great example of a labor of love.

  12. The National, Peggy-O. The general consensus is that the Dead took an ancient Scottish folk song named The Bonnie Lass o' Fyvie and re-cast it into their own unique style. Well, The National take it one step further, and it is a strong and well-directed step forward, indeed.

  13. Mumford and Sons, Friend of the Devil. This is the "slow version" (see above), but where the original brought a sort-of devil-may-care lightness to the story, and the True Slow Version turned it into more of a love song, Mumford and Sons find an elegant space in between.

There are nearly 60 songs in this box set, and I've barely touched on most of them.

I'm going to be listening to these songs for years, making my own play-lists of them, revisiting them in different ways and in different moods, just as one does with the original Grateful Dead recordings.

Since it's a fund-raiser, for a worthy cause, I hope many many people find this music, so that the fund-raiser may be as successful as possible.

And since it's a lot of very interesting re-examinations of one of the most fascinating and challenging bands of my time, I hope many people find this music, for the music's sake, too.

Saturday, August 6, 2016

A little of this, a little of that

It's August. Things are slow in these lazy days of summer, but there's stuff to read in those brief breaks when I'm not playing The Witcher 3: Wild Hunt; Blood and Wine

  • Notes on concurrency bugs
    Let’s see what the academic literature has to say on non-deterministic bugs. There’s a lot of literature out there, so let’s narrow things down by looking at one relatively well studied area: concurrency bugs. We’ll start with the literature on single-machine concurrency bugs and then look at distributed concurrency bugs.
  • noms init
    It seemed like a database that combined the decentralization, versioning, and synchronization of Git with strong typing and the feel of functional programming would make it much easier to store, move, and track all kinds of changing data.

    One day after work, I shared what I was up to with my long-time friend and co-conspirator, Rafael Weinstein. Rafael had a lot of experience with synchronization from a previous life, and like me was deeply inspired by Git’s solution to this historically thorny corner of software design.

    ...

    Git took over the software world virtually overnight because its decentralized nature enabled source code to move fluidly between computers, organizations, and people; and because this in turn directly enabled much richer collaboration.

  • Synchronizing Containers
    the problem is that if we run our tests using
    docker-compose -f docker-compose.ui-tests.yml up
    that the Robot container immediately starts to execute tests although the application and the databases are not yet ready. This will lead to failing tests. We have to avoid that.

    But how can we make sure that everything is ready before the first test is executed? Docker cannot help us here since Docker doesn’t really know what’s happening inside a container. The fact that a container is ready from the perspective of Docker doesn’t mean that the application running inside the container is also ready. Specifically databases need some time to initialize. On slower machines that can take several seconds or more. On our CI agent Mongo DB for example takes about 30 seconds to start up and MySQL is no better.

  • Slow Down On Lawful Hacking Frameworks and Fixes
    Applying laws and policy to new technical contexts requires making some broad categorizations. In order to construct a regime that is workable for non-technologists, generalizations become necessary: This is an exploit, this other thing is a vulnerability or a trojan or “network investigatory technique.” The problem is that these are terribly inaccurate metaphors. They seem to be useful in individual cases to understand the basic issues without needed to think about how technical experts would grapple with the implications and subtleties of the code and situations at hand. But the trap is that it allows lawyers and judges and policymakers to say “Great! A vulnerability is this thing, a NIT is that thing; let’s go make some rules!”

    The inevitable result is that helpful, imprecise analogies are converted into pretend scientific terms, with fixed meanings. And the proposed general frameworks end up being based on fictions—further confusing the already complex debate.

  • When Tenure Never Comes
    I asked if she could substantiate rumors that the position would eventually translate into tenure-track position. This answer was more troubling. “Universities aren’t really looking to make thirty-year commitments anymore,” says the beneficiary of such a sinecure. In the space of five minutes this Dean had summarized my plight: because I’ve never held a tenure-track position, my decade of productivity put me in no greater standing for a job than someone fresh out of grad school; and those tenure-track positions—the only means to vindicate that work—aren’t in the interests of higher-education administrators.
  • Why It Sucks to Play 'Pokemon Go' If You're Poor
    McClatchy’s Christopher Huffaker outlined the problems with the distribution of resources in the game back in July, noting how the network effects of early adopters (white players) and people with more spare time (affluent players) led to concentrated portals in affluent white neighborhoods. My colleague Laura Bliss saw the same pattern in the new Google Maps “areas of interest” markers—areas of interest to whom?

    Some players refer to the disparity as “Pokémon redlining,” which, whoa there. We’re still talking about Jigglypuffs, right? “Pokémon privilege” might be the better term of art—at least it refers directly to an aspect of placemaking underlying the location-based aspect of gameplay.

  • Oakland police scandal: New revelations in death of officer and wife
    Oakland police briefly investigated Huerta Lopez's death as suspicious. Despite her family's doubts, the Alameda County District Attorney's Office last month confirmed the police department's ruling of suicide in an investigation requested by Oakland Mayor Libby Schaaf. The newly released documents reveal more details of what happened on June 16, 2014.
  • In Drinking, as in Life, End With Bad Wordplay
    There couldn’t be a more suitable location to have a seminar on Auchentoshan and bitters. Bitters were originally developed medicinally as a digestive aid, and to this day are a common (especially among bartenders) treatment for an assortment of maladies. Today’s workshop is run by Robin Nance, national Auchentoshan brand ambassador, and Tobin Ludwig of Hella Bitters. We start with a sparkling, slightly bitter single-malt cocktail. Tobin presents the history and methods surrounding the development of bitters, explaining how some bitters are created using a mixture of dry spices and aromatics steeped in a strong spirit, as one would make tea, but others are made using tinctures (a single ingredient extracted into an alcohol base) that are then blended into a final product.

Wednesday, August 3, 2016

Living on the bleeding edge

Well, I am nothing if not impatient.

So yesterday I wondered off to Windows Update, and gave it a little nudge ("Check for Updates"), and there was

Feature update to Windows 10, version 1607

Doesn't look like much, does it? But that's the Windows Update description of what's known more commonly as the Windows 10 Anniversary Update (It's not the tenth anniversary, silly! It's the first anniversary of Windows 10. Well, anyway...)

So that is a pretty big update, and takes a while to download and install, but all of that went fine.

Then, today, I decided to take a deep breath and follow the instructions on this Installation Guide:

  1. Turn on Developer Mode
  2. Enable the Windows Subsystem for Linux feature (gui)
  3. Enable the Windows Subsystem for Linux feature (command line)
  4. Reboot
  5. Install bash and Ubuntu on Windows

And, there it is! Bash!

The first thing I tried was to go to my copy of the Derby source code, checked out with Subversion from the Apache website.

I typed 'svn stat', and bash politely told me that I needed to run

sudo apt-get install subversion

So I did that, and it Just Worked, and et voila! I am running Ubuntu.

And Windows.

Together.

Wow!

Betraying my ignorance of public key cryptography

Here's something I don't understand.

Git uses ssh public/private key pairs for its wire-level network security.

Git uses gpg public/private key pairs for its commit-signing and tag-signing operations.

Why does git use two different keys for these two purposes?

Is that considered to be improved security?

Or is there a technical reason that git couldn't have simply used the same public/private key pair for both purposes?

And yes, I understand that in the wire-level network security case, it typically isn't git itself that is authenticating you using the SSH public key; it is actually the operating system that is doing that.

So I guess my question is: OK, but then why can't I use that same SSH key pair to sign my git commits and git tags? Why did git decide that I should use a different key pair for signing my git commits and tags?

Sorry for the naive question, but, as I admitted, I'm still rather ignorant about this cryptography stuff.

And, I see that other people are puzzled by this, too.

Tuesday, August 2, 2016

Reading my way to Quebec

We're hoping to make a trip to Eastern Canada this summer, if all goes well.

So, as is my wont, I've been hunting around, reading my way to Quebec.

In addition to the usual guidebooks and online sources, I've come across a couple of very enjoyable items:

  • Firstly, in the absolutely amazing History of Cartography, published by the University of Chicago Press, and now happily online for the world to enjoy, there is a very interesting chapter: The Mapping of Samuel de Champlain, 1603–1635 by Conrad E. Heidenreich.
    The importance of Champlain to the early seventeenth century mapping of North America is that his were the first accurate maps of the Atlantic coast north of Cape Cod, the first accurate maps of the St. Lawrence River to the eastern Great Lakes, and the first maps to combine English Arctic exploration with that of the French to the south. His maps also show an appreciation for native geographic information, which was so important to French exploration of the interior of the continent. It is clear, however, that Champlain was not primarily a cartographer. His original tasks were resource evaluation and exploration; after 1616 he became an administrator responsible for the smooth functioning of the fur trade and the settlement and governance of New France. Although today he is known among academics for the quality of his maps and writings, to the general public, in Canada at least, he is best known for having established the French presence in their country as a permanent feature that gives it some of its distinctive character.
    What I found most endearing about the cartographical story of Champlain was how eminently pragmatic and practical he was:
    Champlain’s writings suggest that he had a practical rather than classical education. He recorded what he saw without making classical allusions or indulging in speculation. His treatise on navigation, the Traitté de la marine, also points to a practical background—learning through observation and doing rather than schooling.
    Having learned my own (software development) trade mostly by "observation and doing rather than schooling," I felt an instant kinship. And I loved how truly practical he was:
    Within days after he arrived in New France for the first time, Champlain questioned the natives through an interpreter about the geography of the interior. By the time he got to the Lachine rapids, he requested that they draw maps for him. Champlain’s inland mapping began with a rough outline based on native verbal accounts and maps, initiating a practice followed by every French explorer after him.
  • Secondly, although it's not the most current of works, I am certainly enjoying Taras Grescoe's delightful Sacre Blues: An Unsentimental Journey Through Quebec

    Grescoe's interests are far-ranging, and he happily wanders all over the place, from language to government to "cowboy culture" to the press to native relations to weather, and much, much more.

    And he is a witty fellow, making Sacre Blues a much more entertaining read than your typical dry history:

    Quebecois television admen who make the transition from Montreal to Paris report that they have to leave behind a freight car's worth of cultural baggage if they want to sell to the French. The openness, sincerity, and warmth that are featured values in Quebec's television commercials tend to be held in low esteem in France (an oft-repeated aphorism, usually delivered in rapid-fire Parisian, sums up the attitude: "Trop bon, trop con." In other words, if you're too nice, you're also too stupid.) In France, the emphasis must be put on sensual seduction (full, red lips suck on a Gervais ice cream bar), a nostalgia for lost glory (a Citroen flashes past castles on the Loire), and caustic verbal humour, where a mot juste puts a pretentieux in his place (an employee cunningly embarrasses his boss into giving him his France Telecom cellphone at the office Christmas party). The ideal French consumer is the sure-footed wit blessed with an ostentatious and somewhat cruel intelligence. What appeals in Quebec, by contrast, is the generous, warm-hearted boy-next-door whose common sense prevents him from becoming a dupe.
  • Lastly, at least partly for my wife, I've picked up and spent a fair amount of time with Julian Armstrong's Taste of Quebec

    Several aspects of Armstrong's cookbook are notable:

    • It's nicely illustrated, with simple yet beautiful pictures of the dishes-as-prepared
    • The recipes are simple and easy to read. Moreover, Armstrong often, though not always, includes both the French name of the dish and its ingredients as well as the English names
    • Armstrong collected most of these recipes from various well-known Canadian restaurants and chefs, and usually, though not always, includes some additional capsule information about the recipe's source that brings it to life

    The likelihood that we will actually prepare many of these recipes is quite low; I just can't see us fixing Casserole de Lievre et de Perdrix Parfumee a l'Erable (Maple-flavoured hare and partridge casserole).

    However, just reading through the ingredients and preparation techniques is quite interesting, and every so often as you're reading through the book you come across a section like this one, on Jarrets noirs:

    The moist and muddy banks of the Chaudiere River helped give the Beaucerons the nickname jarrets noirs, which is used to this day. It's not that residents had black legs, oldtimers explain. The term refers to the black feet, or hocks, of the horses that pulled their owners' carts, or charettes, along the river to market in Quebec City, where their owners sold their wares and bought such essentials as salt, spices and molasses.

I'm sure there are other sources I should be reading, but for now, these are quite enjoyable.

Have others to suggest? Let me know!

Monday, August 1, 2016

Rolling Stone copy editors: Boo! Hiss!

25 Worst Original Names of Famous Bands

17. The Pendeltons

Final name: Beach Boys

When Brian Wilson began writing songs about surfing in 1961 he'd hardly ever even touched a surfboard, so to get some credibility he called his new group the Pendeltons after the plaid, wool shirts favored by the surf community. Just three months later, Los Angeles–based independent label Candix Records agreed to release their debut single "Surfin'." But they hated the stuffy-sounding name and changed it to Beach Boys (after almost going with the Surfers) without even telling the band. It's as generic as it comes, but the group had no choice but to go with it. In the early 1970s, tired of being known as a Beach Boy, Wilson suggested they change their name to Beach. The others didn't go for it. They knew they were destined to be Beach Boys for life.

At least they spelled Brian Wilson correctly...

But ...

"stuffy-sounding"???