Trevis Rothwell's weblog

Almost, but not quite, entirely unlike tea

Fluffy Electronic Addictions

07 April 2014

In Selected Papers on Fun & Games, Don Knuth writes about his experiences playing an early computer game in the 1970s:

Clearly the game was potentially addictive, so I forced myself to stop playing — reasoning that it was great fun, sure, but that traditional computer science research is great fun too, possibly even more so.

Is this something we should keep in mind today, surrounded by countless opportunities to do something frivolous instead of something substantial?

Should Digital Photos Aspire to Look Like Film?

17 February 2014

I received an email from B&H Photo yesterday, advertising some new products and sales. After years of doing my minimal photo post-processing in Apple iPhoto, the reduced price on Adobe Lightroom 5 caught my attention. Reading the details more carefully, I was intrigued by the statement:

You can add … simulated film grain to images, great for breathing analog life into digital photos.

In the music production world, I’ve heard a lot of people talking about the virtues of running tracks through analog equipment to maintain or capture “analog warmth” in the face of sterile digital perfection. There are debates as to how needful an analog signal chain actually is, and some producers seem fine with totally digital production, but there are enough adherents to analog audio gear to suggest that there’s some legitimate basis to the claim. Several manufacturers sell analog summing mixers, to do a task in the analog realm that digital computers ought to be excellent at doing (adding things together).

While I’ve heard some photographers share a preference for working with film, I believe this is the first time I’ve seen a major vendor suggest that there might actually be something superior about film photography that digital photographers should consider simulating. So what exactly does this simulated film grain feature do?

I found an example from Mark at Digital Photo Buzz, showing the difference between an unaltered digital photo, the same photo processed in Adobe Photoshop to add “noise”, and the same photo processed in Adobe Lightroom (version 3) to add “film grain”. The processed photos appear at first glance to be blatantly inferior to the original, but then again, after looking at the processed photos for a bit, the original seems almost artificially perfect.

I’ve never done an explicit A/B test between my digital and film cameras, but I happen to have several similar shots taken on two separate trips to Cambridge, Massachusetts, one time with film and the other with digital:

Falafel Truck on Kodak 400 film

783841-R1-010-3A_003

Falafel Truck on Canon 5D digital

Falafel Vendor Truck

Harvard University Library on Kodak 400 film

783850-R1-050-23A_023

Harvard University Library on Canon 5D digital

IMG_7338

(All photos taken with a Canon 50mm/1.4 lens. The film photos were taken with standard off-the-shelf Kodak 400 print film.)

The film photos, as presented, are higher contrast. This could be adjusted in post-processing if desired. I don’t really see anything significant that I would attribute to “film grain” in the film photos; the grain certainly isn’t as obvious as in the simulated grain photo produced in Adobe Lightroom. The digital photos, when viewed full-size, are more detailed, and generally seem like closer representations of what the scene actually looked like (as I recall).

But is one flat-out better than the other? Aesthetically, I kind of like the look of the film photos better. The digital photos may be more perfect, but the film photos seem to have some imperfections that come across well, maybe similar to the color added to sound running through a tube preamp. It’s hard to beat the convenience of digital over film, but perhaps I’ll start pulling my ancient Canon EOS-3 out more often…

Government-Mandated Flame-Retardant Mattresses

23 January 2014

Two days ago we received delivery of a new mattress. Upon initially lying down to go to sleep on it, I detected a strange odor and reasoned that it must be emanating from either the new sheets, the new mattress cover, or the new mattress, but was too tired to think much about it. The odor became increasingly bothersome throughout the night, and in the morning I determined that it was most likely coming from the mattress itself.

Some web searching suggested that this was not unusual, and that common wisdom was to let the mattress air out for a day or two (or four) before sleeping on it. This was the second mattress we had purchased from the same shop, and nobody had mentioned anything about this to us. The first mattress, though, was left unused for several weeks before we moved into the house, so it likely had time to air out on its own.

My web searching also turned up some unexpected information on the potential toxicity of mattresses.

In 1972, the United States federal government decided to help prevent burning cigarettes set mattresses ablaze by issuing 16 CFR Part 1632, Requirements for Mattresses and Mattress Pads. Accompanied by a prescribed test procedure, this government mandate required mattress manufacturers to construct their mattresses to be able to endure limited exposure to burning cigarettes without catching on fire themselves. Since traditional mattress materials were not inherently flame-retardant, manufacturers complied by adding flame-retardant chemicals.

In 2006, the government decided that guarding against burning cigarettes was insufficient, and expanded their mattress construction criteria to include guarding against various open flames in 16 CFR Part 1633, Standard for the Flammability (Open Flame) of Mattress Sets. The new test criteria involves exposing the mattress to open flame generated by a burner device for a total of 30 minutes. (Details are listed within 16 CFR Part 1633 itself.) Manufacturers complied to this demand of enduring a half-hour of fire by adding yet more flame-retardant chemicals.

So our mattresses are very unlikely to engulf us in flames. But what about the chemicals being added to the mattresses? Are these safe for us to sleep on night after night? Since the government cares so much about us not setting our beds on fire, surely they would have interest in what chemicals are employed to fire-proof the mattresses?

They did conduct some thorough research on the extent to which the various chemicals used in mattress construction could be absorbed by its users, but when it comes to actually making a decision on what chemicals go into the bed, they leave that up to the mattress manufacturers. The 16 CFR Part 1633 Questions & Answers document explains:

Ultimately, it is the responsibility of the manufacturer to ensure that its products do not present an unreasonable risk to consumers. Thus, manufacturers should conduct the appropriate exposure testing and risk assessment to ensure that any new products that are placed on the market are not hazardous substances.

Some of the chemicals involved are blatantly harmful in large quantities. But are the quantities conveyed through a mattress large enough to be problematic? Should we be concerned? There have been reports of people experiencing a variety of unexpected symptoms after getting a new 16 CFR Part 1633-compliant mattress, but there seem to be plenty more people who have never noticed anything wrong at all. We ourselves slept on a Part 1633-compliant mattress for five years without even realizing it.

If you want to avoid these flame-retardant chemicals in your mattress, there are ways around it. Standard off-the-shelf mattresses are required by federal law to be flame-retardant, but with a prescription from your doctor you can have one special-made that does not use flame-retardant chemicals. (One of our family doctors opined that there are lots of other things more useful to do for the overall health of your body than to get a chemically untreated mattress.) You could also buy unassembled mattress components and make your own mattress. At least one retailer sells beds that keep the chemical treatment in a sealed and removable portion of the bed.

In the end, we can thank the federal government for creating potentially-questionable regulations that enable us to continue to sleep while smoking cigarettes and enjoying sundry other forms of open flame…

Empty Index Entries in Texinfo

07 November 2013

Working on a book formatted with GNU Texinfo, I ran into a mysterious error when processing the Texinfo source through TeX (via texi2pdf):

(Variable Index) [145] (Concept Index) [146] (./c.cps
./c.cps:1: Extra }, or forgotten \endgroup.
l.1 , 145}

I saw no related error or warning out of Makeinfo, and TeX was unhelpfully not saying anything about which Texinfo source line the error was coming from. Other clues suggested that the error has to do with indexing, and that it has to do with an index entry pointing to page 145 or maybe 146.

Looking at the PDF output, I backtracked to the relevant portion of the Texinfo source, and saw something like this:

@cindex function pointers
@cindex

A normal-looking index entry followed by an empty index entry! I removed the empty index entry and reran TeX; all was fine.

Evidently empty index entries are not handled well in Texinfo or texi2pdf or TeX or wherever the actual failing is coming from. A more helpful error message would be nice, but in the meantime, remember to avoid blank index entries!

Book Review: The Children’s Machine

21 September 2013

This past spring I read Seymour Papert’s Mindstorms as part of the MIT Media Lab Learning Creative Learning course. Having been delighted with that book, I just finished reading Papert’s follow-up book, The Children’s Machine (Rethinking School in the Age of the Computer).

Published in 1993, this book comes across as technologically more modern than 1980′s Mindstorms, though still obviously dated. For me, it is dated in an especially nostalgic way, as it was around the late 1980s / early 1990s that I was first learning about computer programming, and I can personally identify with some of the stories and concepts that Papert discusses here.

Broadly, this book might be viewed as a refinement of Mindstorms, whereby Papert had over a decade of additional experience and observations with which to form stronger, clearer opinions and gather more data and anecdotes. But while Mindstorms seemed to focus more on the specific idea of creating virtual educational worlds on the computer in which students could more easily learn abstract ideas, the present book steps back even further to look at understanding learning itself better.

Papert advances the term mathetics for describing the study of learning, as opposed to pedagogy, the study of teaching. Are there methods we can use ourselves, or encourage in students, to identify what needs to be done on the learner’s side in order to learn better? To rely on “being taught” without exerting enough effort on “learning” puts things out of balance.

This concept of mathetics is woven into accounts of using computers to improve how learning takes place, especially through creative learning techniques of building virtual things with computers, and through the notion of learning a concept better by teaching it to the computer via programming. For example, we read some stories about the development and usage of the Logo programming language and the Turtle programming system that was developed with it, and how this grew into a form of cybernetics controlling robotic Legos. Here’s a short example, in this instance about using Mitch Resnick’s multi-turtle Logo variant, *Logo:

Two high school students who had recently received their driver’s licenses decided to use *Logo to show cars moving on a highway. The students started by creating several dozen turtles, each representing a car. The program consisted of two simple rules. If a car sensed another car ahead of it, it slowed down. If it didn’t sense another car, it speeded up. With this simple program the students did not expect much to happen, but when they ran it, the cars bunched into a realistic-looking traffic jam. … It is worth noting that the students appreciated the self-organizing nature of the traffic jam only because they had written the programs themselves. Had they been using a packaged simulation, they would have had no way of knowing the elegant simplicity of the programs underlying the jam.

The front cover quotes School Library Journal as saying, “Educators with a vested interest in the status quo will hate this book. It is about their demise.” Indeed, there are numerous points brought up for consideration about how the educational system could be improved, including scathing criticism of attempts to nationally standardize education and judge student development based on standardized tests. Along these lines, Papert poses an interesting query for educational administrators:

[O]n my reckoning, the fraction of human knowledge that is in the [school] curriculum is well under a millionth and diminishing fast. I simply cannot escape from the question: Why that millionth in particular?

If you must limit yourself to reading only one Papert book, Mindstorms came across to me as more fresh and exciting, but the creative learning aficionado will get valuable insight from reading both. The paperback edition is available at Amazon. No electronic edition appears to be available.