Tue, 17 Jan 2012

Sign of the Times

— SjG @ 2:58 pm

I think it’s a sad, sad sign of the times that most Linux distros not only omit figlet from their standard installations, but often don’t even offer it in their package managers.

       _           _                   _                      _ 
  __ _| | __ _ ___| |   __ _ _ __   __| | __      _____   ___| |
 / _` | |/ _` / __| |  / _` | '_ \ / _` | \ \ /\ / / _ \ / _ \ |
| (_| | | (_| \__ \_| | (_| | | | | (_| |  \ V  V / (_) |  __/_|
 \__,_|_|\__,_|___(_)  \__,_|_| |_|\__,_|   \_/\_/ \___/ \___(_)

Sun, 20 Nov 2011

The Magic of New Things

— SjG @ 9:26 am

We humans appear to be programmed for scarcity. We lust for high energy foods — sugars, fats, refined carbohydrates — even when we’re not hungry. Just thinking about donuts may be sufficient to trigger a rewarding brain chemistry reaction1. Similarly, we tend to gather possessions — often far more than we need. We don’t dispose of old, unused possessions because we’re sure we may need them some day. And we’ll often acquire things we don’t need because we anticipate they will be more difficult to obtain in the future. We don’t need them now, but there is the possibility that we will need them at some later time. As advertisers have learned, a quick way to make someone want something is to give the impression that the opportunity to have it is limited: buy now! So we do.

There is an obvious (and possibly even correct) evolution-based argument for the behaviors of scarcity. If a species spends 200,000 years struggling to survive in a minimal environment, those who hoard or are gluttonous may well have a survival advantage over those who don’t or aren’t. A few calories here or there could be the difference between life or death. An animal pelt could make the difference between freezing to death and surviving.

It turns out that there may be corollary programming that motivates us to seek out new and novel things. When we encounter new stimuli, we receive a short-duration boost of some of the same “reward” brain chemicals as we do from food or sex2. Again, a series of questionable evolutionary explanations can explain this: those who explore are more likely to discover untapped resources and thereby have a selective advantage, or perhaps those who try new things may discover new uses for already identified resources3.

So now we fast forward to our time of relative abundance. Modern society has exploited this set of unpatched vulnerabilities in our brain chemistry, and combined our programming for accumulation and our programming for novelty to create a consumer culture4. The fashion industry tells us we need new, novel shoes, while the computer industry tells us we need to upgrade to the latest versions of everything. We need to add new music to our collections every week, and try the latest McProcessedMeat sandwich, see new movies, learn the latest dance, and so on. Every Christmas, there’s the hot new toy that everyone needs to get, whether it was a Hula hoop, a Magic 8 Ball, a pet rock, Beanie Babies, Tickle-me Elmos, Cabbage Patch Kids, or a Furby.

Even outside of obsessive consumer culture, we’re fascinated by new things, especially if they fit into some familiar framework. There’s something tremendously exciting about receiving an unexpected letter or a package in the mail, often amplified if we can identify the sender. It can trigger the anticipation response, the accumulation response, and the novelty response all at once. What’s more, even virtual items evoke a similar emotional reaction: an email from a friend, or an incoming SMS or incoming instant message.

The Internet is rife with sources for these novelty and accumulation dopamine-hits. We subscribe addictively to news feeds. Countless companies like Facebook and Twitter capitalize on our desire for a stream of new-but-familiar snippets of information from and about our friends. Online games allow us to accumulate virtual goods (points, badges, titles, Linden Dollars, ISK) while we explore new environments. Our smart phones let us download new apps, and notify us daily of updates to our existing collection.

All of this finally brings me to my actual point, which involves the creative process. Why do people get such pleasure from creating new things? Perhaps the sense of satisfaction from making things is a combination of the reward-impulses discussed above. After all, when you make something, you end up with some increment over what you had before. This keys into the stockpiling instinct. What’s more, as you make things, you are provided with stream of exciting new things (especially as your skill level increases). Part of the act of creation is discovery5, which speaks directly to our desire for novelty.

Of course there are many additional reasons to create. There’s the need to express emotion. There’s the cultural status as an artist (or the absurd title “Maker”6). There is the struggle against boredom, or distraction from problems. There is simple necessity, in the case of inventions, followed by indolence (if necessity is the mother of invention, surely laziness is the father). Still, with the possible exception of inventions, I would argue that the desire to create in response to those reasons is rooted in the brain chemistry surrounding the magic of new things.

1 Well, in any case, anticipation of food (or other pleasures) are associated with release of “happy” brain chemicals like serotonin and dopamines.

2 I’m oversimplifying, as usual, but there is evidence that suggests that novel situations (and even the anticipation of novelty) both give us a lift.

3 It’s worth noting that these arguments have simple counter-arguments. Those who explore new places may be more likely to discover new resources, but they’re also more likely to be eaten by a hitherto unknown monster or contract a disease for which no prior immunity exists. The fun thing about evolution-based explanations is that they’re often simple, convincing, and wrong.

4 I’m sure someone will point out the US-centricity of these ideas, and I don’t deny it. While anecdotally, I’ve observed similar behaviors in people in places where I’ve traveled (including places which have significantly different cultures), I freely admit that I see things through the lens of my US culture. It’s also worth noting that in an environment of relative abundance, the tendencies encouraged by consumer culture can kill us, whether via obesity or being buried alive under our hoarded collections of National Geographic magazine and Royal Wedding commemorative plates.

5 As artist and teacher Penny Longpre once told me, “the difference between an artist and an amateur is that an artist knows which mistakes to keep.” Artists often refer to the paint or the clay having some kind of volition — a mind of its own. I think this is really the same thing. Whether it’s unintentional details or a result of the characteristics of the material, unexpected elements provide ideas during the creation process, which can then lead the work into new directions.

6 I’m overly sensitive to this self-congratulatory bit of culture. I’m not sure why every generation seems to think it has single-handedly invented music, sex, and everything else. The octogenarian down the street was no less creative in crafting his model railroad just because he didn’t call himself a “Maker,” and his wife was no less innovative when it came to improvising implements around the house even though she didn’t use the “DIY” acronym. People are resourceful and adaptive, and don’t need self-aggrandizing labels to legitimize their accomplishments.

Filed in:

Fri, 11 Nov 2011

Imaginary Tech Conversation

— SjG @ 3:14 pm

Coder #1: Man, revision control sucks.
Coder #2: What? Are you insane?
Coder #1: Insane? I don’t think so.
Coder #2: How can you say revision control sucks, then?
Coder #1: Well, I’m stuck using SVN.
Coder #2: Subversion isn’t so bad. Especially with the new merge tracking stuff from version 1.5. It’s pretty easy to use.
Coder #1: Yeah, well, I stand by my assertion. It sucks.
Coder #2: Can you be more specific?
Coder #1: Have you tried using SVN in a mixed environment? Say Windows, Linux, and Mac OS?
Coder #2: It’s not going to be line-ending issues. Oh, I see. You’re talking about case-sensitive versus case-insensitive filesystems.
Coder #1: I wish it was that easy. That’s crappy, but you can work around it.
Coder #2: Then?
Coder #1: A riddle for you. When is UTF-8 not UTF-8?
Coder #2: Huh?
Coder #1: When it’s in a filename.
Coder #2: [clicks, reads]
Coder #1: But I guess if you don’t have any Macs or ZFS around, you’re fine.
Coder #2: Holy Linus on a unicycle! Well, I guess it’s back to dated tar files…
Coder #3: Use GIT, you IDIOT!

Tue, 25 Oct 2011

Thoughts while reupholstering

— SjG @ 9:31 pm

It’s time to reupholster the kitchen chairs. They’re just (relatively) cheap Ikea chairs, but it seems like it’d be a waste to pitch them just because the non-replaceable cushions have become stained and/or faded. I figured I’d reupholster them myself. I’d never done this before, but how hard can it be?

So I found myself in the office, using a few homemade implements to loosen hundreds of staples, and then pincers to pull ’em out. Quacky (the cat; formally addressed as Daphne) kept interrupting. She evidently found the activity irksome, insofar as it did not involve petting her.

The new fabric color is an orangey, stripey color (not unlike Quacky), and as I worked my mind wandered about pumpkins and other symbols of the season.

Why is it, I wondered, that October brings not only a proliferation of Halloween decorations, but also the appearance of Christmas decor? After all, there’s another significant holiday betwixt. Is the reason thematic? Well, perhaps, I concluded, but not really. Halloween is superficially about spookiness and perhaps confronting mortality, but it’s really an excuse to break out of the humdrum, to escape normal standards of behavior, to don costumes, to go mad with decorations, and for adults to drink and children to overindulge in candy. Christmas as celebrated here is ostensibly a religious holiday (and again, a chance to confront concepts of mortality), but it’s really observed more as an orgy of gift-giving/gift-receiving, a chance to wear silly reindeer hats to the office, an excuse to go mad with decorating, and a justification for adults to drink and for children to overindulge in candy.

I had finished removing the staples, and using the old fabric as a template, I traced out the shape on the replacement fabric, and cut my new portion. Then, after giving Quaky a few minutes of petting, I got back to work, stretched the new fabric over the foam and tried to make sure it all lined up correctly.

OK, so both Halloween and Christmas provide a justification to behave differently. They are both holidays about consumption, whether in the “buy a whole lotta decorations” or the candy/alcohol sense. But that forgotten holiday centers around feasting as well: Thanksgiving is a well known opportunity to overindulge. So why are stores filled with Christmas stuff instead of the chronologically more appropriate Thanksgiving stuff? After all, you can decorate for Thanksgiving too — many of us have fond memories of making cut-out paper Pilgrims in their belted hats and turkeys in elementary school. Why not turkey and corn yard decorations?

By now, I was trying to secure the new fabric, and my staple-gun kept jamming. I had to disassemble it twice to remove mis-fed staples that had gotten twisted up inside the mechanism. And when it worked, each thwack of a staple going in would startle Quacky, and she gave me a doleful yellow-eyed glower.

So is Thanksgiving less of an event because of our discomfort about what likely befell the Native American hosts of the first Thanksgiving? Elementary school pictures always had happy “indians” partying with the Pilgrims — it wasn’t until later, that we wondered if those were the same “indians” who fought against the cowboys. And it wasn’t until much later when we ventured into A People’s History that we got anything like the actual story.

Or is Thanksgiving not a such a great marketing opportunity because it’s ostensibly about appreciating what we have? It may be hard to sell gratitude as a consumable product. I personally find gratefulness to be a powerful emotion, and a positive influence on my day to day mood. I keep a list with me, entitled “important things,” where I occasionally jot down small circumstances for which I’m grateful. At one point, Elizabeth and I had a bound book where we planned to write down daily gratitudes: unfortunately, that seems to have gotten lost in the shuffle. Perhaps a rigid schedule is not the right approach, but I think the idea still has merit. Still, bound books or no, it’s going to be a lot harder to sell gratitude gear at WalMart than it will be to sell realistic brain-dripping lawn zombies or battery-powered Santa Clauses.

I finally got the fabric stapled down, and one chair finished. It was an amateurish job, but not bad for a first try. Quacky looked more than a bit skeptical, but I’m optimistic that the next three will be better.

Filed in:

Sun, 25 Sep 2011

Photoshop scripting with Javascript

— SjG @ 6:41 pm

I’ve played with the Javascript interface to Photoshop for a couple of years. Conceptually, it’s great — a simple, powerful, interpreted language like Javascript, with an API to interface to one of the best image-processing packages available. In practice, it’s not as good as it is in concept, but it’s still pretty good. The API doesn’t include all of Photoshop’s functionality directly, and there are a lot of things you need to execute as fairly obscure event actions. These event actions aren’t documented, but can be determined by activating a plug-in which logs everything that you do using the Photoshop GUI — you can then read through these logs, and copy the actions you need.

Still, there are some real advantages to using this Javascript interface, as opposed to something designed for the purpose like, say, Processing. You can use the Photoshop UI for controlling inputs to your script (set foreground colors, select portions of the image, select specific layers, etc.), and output your manipulations directly into Photoshop layers.

I’ll be posting here shortly a library I’ve created for easily building dialog panels for setting script options. I find that most manipulations I want to do have a set of variables, and I’d rather not tweak the code each time I want to change them.

This library was originally written under Photoshop 10 (aka CS3). Under version 11 (aka CS4), it was less stable. Sometimes it would crash out at odd places complaining that I was referencing properties of undefined objects. Because there have been memory leaks and other issues with the Javascript interpreter, these seemingly random failures were annoying but not too surprising. When it came to version 12 (aka CS5), I was rarely able to run my scripts at all. What made it frustrating was the apparent randomness of the crashes. I could print a variable to the console, and the very next line would crash out with an “undefined object” error when referencing that variable.
To make a long story short, I was able to track down the issue. It turns out that in iterations, declaring variables matters. That is to say:
for (i in someCollection)

will cause random crashes, but
for (var i in someCollection)

runs beautifully. Now, I “knew” that the var keyword is optional and used for specifying scope, but I never had any idea that there could be an issue within the scope of a simple loop. Obviously, Javascript didn’t know that I intended i to be a variable on each iteration — perhaps it thinks I meant for i to be a 1957 Chevy Belair on some iterations.

In any case, having cracked the code as it were, I have proceeded to enhance and add to my library. After a little more testing, I’ll be posting it here or on GitHub.