Ryan's Bloghttp://ryanballantyne.name
A blog! We're saved!Tue, 02 Jun 2015 05:36:48 +0000en-UShourly1http://wordpress.org/?v=3.4.1The Mac and Cheese Methodhttp://ryanballantyne.name/2015/06/the-mac-and-cheese-method/
http://ryanballantyne.name/2015/06/the-mac-and-cheese-method/#commentsTue, 02 Jun 2015 05:36:48 +0000Ryanhttp://ryanballantyne.name/?p=207More→]]>Growing up, I ate a lot of Kraft Mac and Cheese. It was easy to make, and it was delicious. I’m not ashamed to admit that I haven’t grown out of it. I see no reason why a refined palette should have to exclude the simple nostalgic pleasure of childhood comfort food.

In episode 119 of the Accidental Tech Podcast, Casey Liss called Kraft Mac and Cheese bland. Upon reflection, I agree…but only if you follow the directions on the box, which are terrible. I’ve made it enough times that I have a better way.

First, salt the water. Put in a teaspoon or two of salt. This is very important. Cook the pasta slightly al dente so it doesn’t get mushy and lose all texture, then drain and set aside.

Second, melt the butter in the pot.

Third, double the milk. 1/2 cup, not 1/4. Add it to the melted butter and stir.

Fourth, Add the cheese sauce packet. Toss in a handful of grated cheddar and sprinkle with grated parmesan.

Fifth, stir over medium heat until the sauce is smooth. The goal is to have no stringiness or chunkiness. (In the sauce. Some chunkiness in the eater is to be expected.)

Sixth, add the macaroni and mix well.

Eat it hot. Let your soul delight in fatness.

]]>http://ryanballantyne.name/2015/06/the-mac-and-cheese-method/feed/0“¡Oy, chele!” or Why I Changed My Twitter Description or Racism is Stupidhttp://ryanballantyne.name/2014/09/oy-chele-or-why-i-changed-my-twitter-description-or-racism-is-stupid/
http://ryanballantyne.name/2014/09/oy-chele-or-why-i-changed-my-twitter-description-or-racism-is-stupid/#commentsFri, 19 Sep 2014 05:45:41 +0000Ryanhttp://ryanballantyne.name/?p=205More→]]>I joined Twitter in 2009. For the past five years, my description has read:

Chele, adj. In colloquial Nicaraguan, a light-skinned person.

This bears some explanation.

From 2002 to 2004, I served a mission for my church in Nicaragua. When most Americans think of Latin America, they think everyone is the same color, and that simply isn’t true. I met Nicaraguans who were nearly as white as I am, and some who were as dark as an African, and some whose ancestors actually were African.

In Nicaragua, people often refer to other people by their physical attributes. A woman might say “la bajita” when talking about her daughter if she happened to be short, for example. Skin tone is also used: people are “negro” (dark), “moreno” (middling), or “chele” (light). This is considered perfectly normal, and nobody is offended by it.

Most importantly, nobody cares what color your skin is. It’s as important to them as your hair or eye color is to the average American.

I’m white, so as you might imagine, everyone called me chele. People would shout it at me as I walked down the street in order to catch my attention. Again, this was perfectly fine.

At one point during my two years in Nicaragua, I had to create an email account and pick a username. I refuse to use numbers as a differentiator, so I had to find something unique. I settled on “cheleball”, a portmanteau of “chele” and the first part of my last name. I’ve used that username everywhere online ever since, and it’s never ever taken.

But of course, nobody in America knows what “chele” means, so I used my Twitter description as an opportunity to explain my handle. But I forgot something: I live in the US of A. True, I have lived my entire life trying to pretend that racism isn’t a thing anymore, that we’ve all put on our big kid pants and have stopped caring. The Ferguson shooting and subsequent cluster fluffle shocked me out of that illusion.

Imagine a white guy walking down the street in America. A black guy shouts at him, “Hey whitey!” to get his attention. What is the subtext of that shout? In Nicaragua, the subtext is that the black guy wants the white guy’s attention. In America…

I don’t want to give the impression that I care about the color of my skin, so I’m changing the description. And I’m making a public stink about it. No, I don’t think changing my Twitter description is a big deal, but I’m just so very tired of racism in this country that I had to get this off my chest. Thanks, as ever, for your indulgence.

]]>http://ryanballantyne.name/2014/09/oy-chele-or-why-i-changed-my-twitter-description-or-racism-is-stupid/feed/1Monkeys in Low Earth Orbithttp://ryanballantyne.name/2013/12/monkeys-in-low-earth-orbit/
http://ryanballantyne.name/2013/12/monkeys-in-low-earth-orbit/#commentsSun, 22 Dec 2013 02:54:55 +0000Ryanhttp://ryanballantyne.name/?p=199More→]]>Backing up is a bit like flossing: everyone who wants to keep their teeth should do it, and a great many do not. No, that’s a bad analogy. Backing up is like planning fire escape routes: the more you have, the safer you are. Wait, no…hang on. I’ve got it. Backing up is like strapping a monkey into a rocket and blasting it into space.

It totally is. Trust me on this.

I backed Space Monkey on Kickstarter because it sounded exactly like a thing that everyone needs: a local backup, an offsite backup, a Dropbox account, and an iOS photo backup service, all rolled up in a single device. Well, a few days ago I received mine. So unfold that chair, focus those binoculars, and get ready to watch the launch, because it’s blog post time.

The Device

The Space Monkey is an attractively designed, pod-shaped data storage device. On the back are three ports: power, ethernet, and USB. The USB is intended for diagnostic purposes only, and does not work for data transfer. The only way to communicate with the device is by plugging it into your router. There is no wifi, which is fine. Wired is faster, and I wouldn’t want a device like the Space Monkey, which is pretty much always using the network, clogging up my wireless.

There is no fan, and the hard drive inside is very quiet. In a quiet room, I could only hear it by listening closely from 3 feet away. After 40 hours of continuous data transfer, the Space Monkey is only slightly warm to the touch.

I had to put it in a place that’s out of my field of vision while working at my computer. If I hadn’t, the blinking would have driven me insane.

That’s my least favorite thing about the design. My favorite thing? The ventilation holes in the sides are drilled in a pattern that’s highly suggestive of a rocket ship.

A Local Backup

Everyone already has a local backup. Right? (right?) Of course they do. (ahem) So, the local backup aspect of the Space Monkey is not terribly exciting. And actually, the Space Monkey, in its current form, is catastrophically bad at providing a local backup. To explain why, I must first explain how the client software works.

The Client Software

As a Mac user, I can speak only about the Mac client. There is also a Windows client, and, as of this writing, the Linux client is still in development.

The Space Monkey client mounts the device in the Finder using a user-space filesystem called spacefusefs. Its mount point is your home folder, not the system-wide standard /Volumes, so that’s where it shows up, complete with an eject icon next to its name. As it is a mounted volume, it also shows up in all the other places mounted volumes can inhabit.

When you drag a file into the spacefusefs mount, the client software copies the file into its cache under ~/Library/Application Support. It then makes its leisurely way onto the device. This approach has a lot of advantages, but it’s not so great when you want to copy over a huge amount of data, especially if that data is larger than the amount of free space on your boot drive.

So, there is another way to move data onto the Space Monkey: you can right-click on any item in the Finder and select “Copy to Space Monkey”. This approach shoots the data straight over, bypassing the cache.

The cache is used in other ways as well. As you browse through your files on the device, the client preemptively copies any files (but not folders) you highlight into the local cache. It appears as though it keeps copying even if you close the Finder window without opening the file.

(As an aside, I can’t imagine a normal person wrapping their head around all this. Even a tech nerd, being ignorant of this caching behavior, might accidentally fill up her hard drive in the course of using the Space Monkey. You can limit the cache size, but the default setting is unlimited.)

All this caching is necessary for two main reasons: first, the device is a black box. It is not mounted in the traditional sense. In order to manipulate files on the device, the client must pull them into the cache, then push them back out as they change. (If you want a file to stay in the cache, you can pin it.)

Second, the device is slow. But I’ll come back to that, because it deserves its own section.

So, how are you supposed to use the Space Monkey as a local backup? Most backup utilities would run afoul of the cache. SuperDuper, for example, doesn’t recognize the spacefusefs mount as a backup destination. Time Machine support is planned, but not currently present.

The best solution I could think of is to copy my home folder using the direct copy functionality, then keep it up to date with rsync, as an incremental update is more cache-friendly. There may be tools to help with that. If you’re reading this and know of one, I’d love to hear about it.

This is the Vehicle’s Maximum Speed

As I write this, my MacBook Pro has been copying my home folder to the Space Monkey for ~42 hours. In that time, its managed to copy 109 GB of data. That’s an average rate of 5.8 Mbps. I’ve seen peak rates at 25.6 Mbps, but they never last long.

There’s no way around this: copying my 500GB home folder is going to take the better part of a week. Ouch.

What’s the holdup? At first, I thought it was my crappy CenturyLink-provided DSL modem/router combo, which after all only provides 100 megabit ethernet and may not be capable of saturating that link speed. However, looking at the support page, I see that others are seeing similar speeds. On that page, “Jessica”, a Space Monkey employee, provides some insight:

…you cannot compare to a simple NAS transfer; we hope to reach that one day, but uploading to the SM device is not as simple as a straight upload. Your NAS does not need to encrypt your files, break them up into pieces, and push them out to random users on a network and be able to get them back at a moment’s notice.

In addition to the encryption and chunking she mentioned, the Space Monkey also does internal compression and deduplication. I presume these features are implemented in software rather than with custom silicone, so the transfer speed of the device is limited by the efficiency of that software and by the speed of the processor that runs it.

This is never more apparent than when the client is uploading a large number of small files. During such times, it doesn’t look like much of anything is happening at all.

Space Monkey is spinning this in comparison to throttled online backup solutions. All well and good, but I was promised local copy speeds, and honey, this ain’t it.

That being said, I am cognizant of the fact that I am a very early adopter of this device. Space Monkey has said that it’s working on the problem, and I’m reasonably confident they can manage it. The problems this small startup has solved to put this device together are massive, and I have high hopes that they will be able to sort out the performance issues in time.

An Offsite Backup

The main attraction of the Space Monkey is that it is part of a “storage network”. The hard drive inside of the pod, of which you are allowed to use 1TB, is actually 3TB in size. The extra space is used to store other people’s chunked and encrypted data. In return, your data gets chunked, encrypted, and redundantly stored on other people’s devices.

The promise is that, should your device fail, or your house burns down, or floods, or gets hit by a drunk driver (which can happen), your data is still out there, still recoverable. Space Monkey says that they monitor the health of your data in order to ensure that, even if some devices that had been storing your stuff drop off the grid, your data remains safe, redundant, and recoverable.

This means that you can expect your Space Monkey to utilize your Internet connection, up and down, pretty much continuously. Users of bandwidth-capped connections beware. The client allows you to cap the transfer rates, and the defaults (100 Mbps down / 0.668 Mbps up) seem sensible. The upload may be a little low. We are talking about a lot of data here, and while the Space Monkey is autonomous, I’d still rather not wait months for my data to hit the network.

Is this distributed approach better than a dedicated cloud backup service? Yes and no. On the plus side, it’s greener. Data centers need a lot of electricity, both to run and for cooling. It’s also fault tolerant, in that there is no data center to, for example, get hit by a hurricane (which happened to the company I work for. Thanks, Irene).

On the downside, getting your data back out, you are subject to the upload caps of your peers. Maybe they’ll be able to get a bit torrent-like swarm going and give you great performance. I don’t know, and I hope I never need to find out.

A Dropbox Account

Space Monkey gives you access to your files, Dropbox-style, through a web interface and iOS/Android apps. I don’t know if the desktop client works if your computer is not on the same subnet as your device, since I haven’t tested it, but both web and iOS work from anywhere.

Using either of these interfaces, you can upload, download, and delete files and folders. You can also generate download links to any file you wish, which you can use to share files with others.

The Dropbox inspiration for these features is plain. If you have a Dropbox, you will know how nice this is.

I don’t have much more to say about this, except that it works, almost miraculously so. As soon as your files are on your Space Monkey, you can get at them from anywhere, though performance isn’t great (due, I am sure, largely to the upload cap).

An iOS Photo Backup Service

Because I listen to the Accidental Tech Podcast, I learned about Everpix just in time for it to go out of business. The crew spent quite a lot of time lamenting that loss, and wondering if anyone would ever be able to back up all of their photos from their phones.

Well, Space Monkey does. The Space Monkey iOS app can automatically upload every photo and video you take with your iPhone to your Space Monkey. It even works while the app is running in the background. It does not, however, use the iOS 7 periodic wakeup functionality, so it does have to be running for the uploads to take place.

Again, there is little more to say about this, except that it works. After I enabled the feature, the app went to work, and soon all my photos and videos were on my Space Monkey. When I took more photos, the app noticed, and promptly uploaded them. Performance is pretty good, too; after all, the Space Monkey’s download cap is quite high by default.

This was a surprise killer feature that I didn’t know about until I fired up the iOS app, and I think it will end up being the one that I use the most.

Pricing and Availability

There have been several changes to the pricing structure, so you may find conflicting information out there. As of this writing, it’s pretty simple: Pay $200 for the Space Monkey device, and you get a year of service free. Thereafter, you’ll have to pay $50/year to keep using your Space Monkey.

As for availability, they are currently rolling out to their kickstarter backers, who get first dibs. But, right now they have some extra units that were supposed to go to international backers but did not meet international CE regulations. So, right at this moment, if you go to spacemonkey.com, you can buy a device, but there’s no telling how long that stock will last.

Spaceward Bound

In its current state, there is a lot to love about the Space Monkey – and a lot that has disappointed me, too. This is a device produced by a startup (investor-funded, but still on a tight budget), and it’s a very early version, so of course it’s not all honey and roses.

Furthermore, there’s a nagging doubt in the back of my mind that Space Monkey may never reach mainstream acceptance. Nerds like me immediately recognize the value, and potential, of this device, but it’s hard to explain to ordinary people. Have you ever tried to explain to a non-computer nerd how Dropbox works, much less convince them that they need it? Yeah. Explaining the Space Monkey is much the same.

Warts and doubts aside, I am nevertheless astonished that this device exists. They’ve strapped their monkey into a rocket and shot him into space – low earth orbit, but still space. They won’t stop there. They’re aiming for the moon, and I think they can make it. If they don’t run out of money, and enough people believe in them enough to buy in, they will surely make it.

Alcohol kills nearly as many people in America each year as guns. Where are the cries for us to ban alcohol? How can we allow this fatal substance into the hands of the criminally irresponsible, who then use it to kill?

The answer to that is obvious to anyone who went to high school. We tried it once, and it didn’t work. People kept right on drinking, and in the end it caused a lot more harm than good. The better solution – the only solution available to us – is to teach people not to be criminally irresponsible. And the best way to do that is for two well-adjusted and loving parents to teach it to their kids.

I’m not passionate about guns. I don’t really want to own one. But I tell you this: were the law to ban the sale and possession of guns tomorrow, I would not feel any safer. I would feel a lot less safe, because now not only would good people be less able to defend themselves (and everyone around them), but we would have a repeat of prohibition on our hands. I can see nothing but bad in it.

You can’t fix society with laws. Laws need virtuous citizens in order to work. You can’t fix mental illness with laws. Mentally unstable people, and the people who love them, need help, not laws.

Straight C

Objective-C/Cocoa

C++

Shell Script

Ruby

JavaScript

CoffeeScript

PHP

Java

VBA

AppleScript

Scheme (err, Racket)

]]>http://ryanballantyne.name/2012/07/how-i-feel-when-coding-in-various-programming-languages-depicted-pictographically/feed/6The Seventh Guest Queens Puzzle As Solved By A Nerdhttp://ryanballantyne.name/2012/03/the-seventh-guest-queens-puzzle-as-solved-by-a-nerd/
http://ryanballantyne.name/2012/03/the-seventh-guest-queens-puzzle-as-solved-by-a-nerd/#commentsTue, 20 Mar 2012 22:22:23 +0000Ryanhttp://ryanballantyne.name/?p=167More→]]>I played the heck out of The 7th Guest when I was a kid. I was using a Power Mac 6100/60. Ah, those were the days. I do not miss them.

For those that don’t know, The 7th Guest is an entirely pre-rendered game. In other words, you click in a direction to move, and then a pre-rendered movie plays to move you in that direction. Every single frame of the game is a movie. I don’t know if I was limited by my CPU or my 4x CD drive, but the movies did not play smoothly. Sometimes the audio would stutter. The game would pause between receiving a command and playing the movie.

Now I can play the game on my iPhone, and the experience is ridiculously better. I had no idea how horrible the game really played until the first time I moved somewhere and the phone literally flew through the movie, quickly and smoothly. I’d estimate that just moving around takes half the time as it did on my old Power Mac. I suppose this shouldn’t astound me, but it does. Modern cell phones have an astounding amount of processing power and storage space.

I still remember the solutions to the three word puzzles I have encountered so far, which I find amusing. Some puzzles, though…some have solutions I could never have recalled.

Take the queens puzzle. The point is to place 8 queens on a chess board such that no queen could take another. Thus every row, every column, and every diagonal contains exactly one queen. How would you go about solving this problem?

Most people would do a greedy search with a local home-in to the answer. In other words, they’d just start putting queens on the board any which way that works, until they get down to 3, 2, or even 1 queen left and discover that no legal moves remain. Then they start shuffling queens around until they arrive at a solution.

This is what I did the first time(s) I played the game, but this time around I got bored with it pretty quickly. It seemed to me that a computer would do a better job of solving this puzzle than I would. What’s more, it should be able to do so quickly because the problem lends itself to aggressive search space pruning. Every queen placed eliminates a row, column, and two diagonals from the search space, and as soon as we reach an unwinnable board configuration, we can back up and try something else.

Now, I know what you’re thinking. Yes, programming a computer to solve the problem takes a lot longer than the futz-with-it-by-hand method. And yes, I could just look up the solution in the guide book. Shaddup. My way is more fun.

The Code

Before I show you the code, I’d ask you to keep in mind that this is a quick and dirty PHP script. I may be having fun with this, but that doesn’t mean I’m going to spend a lot of time elegantly designing a great solution. It only needs to work once, and never will it be modified again.

The script recursively searches for a solution by trying to place a queen on the board, checking to see if the result is valid, and if not, moving on to the next untried spot. If an unwinnable state is reached, the recursion lets us back up and try a different configuration. This approach is, in this case, quite fast—it produces a correct solution as close to instantaneously as makes no difference on my 4-year-old MacBook Pro.

]]>http://ryanballantyne.name/2012/03/the-seventh-guest-queens-puzzle-as-solved-by-a-nerd/feed/8Mice run faster under Lionshttp://ryanballantyne.name/2011/07/mice-run-faster-under-lions/
http://ryanballantyne.name/2011/07/mice-run-faster-under-lions/#commentsTue, 26 Jul 2011 03:10:16 +0000Ryanhttp://ryanballantyne.name/?p=163More→]]>I’ve been running Mac OS X 10.7 Lion for about two hours now, but it didn’t take me that long to notice that something was seriously off with the mouse acceleration. I found myself overshooting pretty much every small target I tried to hit with my mouse. In fact, I felt like I do when I’m forced to use…Windows!

Now, Apple has been making concessions to switchers from Windows for years. I’m happy to say that they outnumber the longtime faithful (means the platform is getting successful), and mouse acceleration has been a sticking point for switchers, so changing to a more Windows-like curve is probably the right thing to do. This is small consolation to me, since it doesn’t change the fact that right now, I can barely use my mouse.

Confirming the shift

How do I know that mouse acceleration has been a sticking point for switchers? Arguments on the Internet, how else? Because of my participation in said arguments, I happened to have a picture of my old preferred acceleration curve:

This screenshot, by the way, comes from the excellent ControllerMate, which you can use to configure any arbitrary acceleration curve you want (among many, many other things.)

Here’s how things look under Lion:

Ouch! No wonder I’m overshooting things. That curve is way steeper than what I’m used to.

Fixing the curve

Fortunately for me, I didn’t even have to draw a custom curve, since the old curve is still there. Did you know that every notch in the “Tracking Speed” slider of the “Mouse” preference pane in System Preferences is actually a different acceleration curve? My old curve, which used to reside one notch left of center, is now the second notch from the left. I discovered this, again, because ControllerMate lets you see all the OS standard curves.

So, don’t worry; you’re not crazy; your mouse is actually running faster under Lion. Thank goodness the fix is as simple as turning the speed down.

]]>http://ryanballantyne.name/2011/07/mice-run-faster-under-lions/feed/11Made with 100% Pure Heighthttp://ryanballantyne.name/2010/06/made-with-100-pure-height/
http://ryanballantyne.name/2010/06/made-with-100-pure-height/#commentsWed, 23 Jun 2010 18:10:05 +0000Ryanhttp://ryanballantyne.name/?p=159More→]]>It happens to every budding web designer eventually: you need something, usually a div, to stretch to the entire height of its container. So, you quite reasonably use CSS to set the height to 100%. This ought to work—there’s no reason why it shouldn’t—but it doesn’t. Every single web browser in existence will point and laugh at your pathetic attempt at a simple solution to a simple problem, and then they will ignore it.

After a couple hours banging their head against the problem, most nascent web designers give up and change their design. That’s because there is no simple, reasonable way to do this. Oh, you can muck about with absolute positioning, which will work if the element’s container can also be positioned absolutely. Sadly, this isn’t often the case.

I’ve also found claims that simply setting the body’s height to 100% will make the setting work for all other elements as well. However, I’ve found that this is just plain wrong; I can’t make it work. It does work if you give the body a height using a fixed unit, such as pixels, which you will almost never be able to do.

The rationale given for why this works is that, in order to calculate a height that is specified as a percentage, the browser needs an element somewhere higher up the containment hierarchy with a defined height. I am entirely too lazy to verify whether or not this explanation is derived from the CSS spec.

(As an aside, this rationale also explains why width does not suffer from the same percentage dysfunction as height. The height of a page is determined by its content, but its width is specified by the width of the browser window unless overridden by CSS.)

Of course, whether or not the rationale is derived from the spec, it’s still a heaping load of crap. Obviously, the browser must calculate the height of every element before it can render anything. It even exposes these calculated heights to the user through Javascript.

Wait…OH!

Doing the Browser’s Work For It

I said there is no simple, reasonable way to do this, and I meant it. The solution I am about to describe is simple (thanks to the magic of JQuery), but it is in no way reasonable. Using Javascript to fix up your layouts is an obscenely stupid hack that should only be used when all saner options have been exhausted. If you can use the absolute positioning trick, do it. If you can alter your layout to avoid the need for height:100%, then do that. Don’t sully your work with this ridiculousness unless you have no other alternative.

Still reading? Ok, deep breath. Here’s the code; it’s just a few lines:

For those not familiar with JQuery, let me go through this line-by-line.

When the document is loaded and ready for manipulation, run the height100percent function.

Find every element having the CSS class “container” and apply the given function to each of them.

Get the height of the current container element.

Find all objects having the CSS class “100percentHeightPlz” that are children of the current container element. Set their heights to that of their container.

Now, W3C, was that so hard?

]]>http://ryanballantyne.name/2010/06/made-with-100-pure-height/feed/2Less Stop and More Gohttp://ryanballantyne.name/2010/06/less-stop-and-more-go/
http://ryanballantyne.name/2010/06/less-stop-and-more-go/#commentsSat, 19 Jun 2010 21:56:49 +0000Ryanhttp://ryanballantyne.name/?p=155More→]]>This is a post about driving. Yes, one of those.

Last night I got caught in a traffic jam on I-15 southbound somewhere between South Jordan and Thanksgiving Point. At 11:30 PM. That’s Utah for you.

(Okay, it was a Friday night, and, due to construction, the four-lane highway was reduced to a single lane. Still, there were a ton of cars on the road for that hour of night.)

Regardless of how ludicrous it may be to get caught in a traffic jam at 11:30 PM, I am certain that you have been there before. You, a single driver caught in the jam, are currently completely stopped. This is not a pleasant state of affairs for one who is trying to get somewhere. Irritation mounts inside you. Suddenly, a ray of hope! The car in front of you starts to move! You take off after it like a shot.

Because you have the reaction time of a normal human being, a space of pavement opens up between you and the car ahead of you before you are able to punch the accelerator. This space enables you to accelerate to a higher speed than the clogged road can sustain. All too soon you have to slam on your brakes. Oh, and by the way, the person in front of you is doing the same thing. This behavioral pattern creates waves that propagate through the traffic, causing everyone to stop and go.

Stop. Go. Stop. Go. This is giving me a headache.

Beyond driver fatigue, stop and go driving is bad for your car and bad for your wallet. All that accelerating and braking puts wear and tear on your engine and brakes, and sinks your MPG into the crapper. Fortunately, you can beat this cycle (with a stick, if need be).

The first step is to recognize that, because the road is over capacity, everyone is going to have to slow down. You can’t change that so you might as well accept it.

The second step is to try to find the speed that the road can accommodate. If you can find and travel at this speed, you won’t have to be constantly stopping and going—you’ll just go, like you normally would on the freeway (only slower). The trick is to open up a large gap between you and the car in front of you. When they get too far away, you can go a little faster; if you find yourself gaining on them, ease off the accelerator.

You should see the distance between yourself and the car in front of you fluctuate regularly. This is because they are caught in the waves and are constantly stopping and going. If the distance between you is large enough, it will eat the wave, enabling you to travel at a more-or-less constant speed. Your traffic jam experience will have a lot less stop and a lot more go.

Last night, I had a great opportunity to practice this technique, and I was treated to a sight that, because I am a nerd, I found delightful. The flashing taillights of the cars in front of me created a very visible wave pattern that propagated up and down the line. But behind me, as far as I could see, everyone was traveling at a constant speed. I had erased the waves.

Then I realized that I wasn’t irritated anymore. I was having fun! By making a very simple change to my behavior, I was able to change the behavior of those behind me, saving all of us some gas and reducing our irritation. I, possessed of the power of nerdiness, used that power for tangible good! And now, you have that same power. Go forth, nerd heros, and use your power for good.

These ideas come from William Beaty, electrical engineer and nerd hero. His site, trafficwaves.org, elucidates them in meticulous and eloquent detail. If you don’t have time to read it, at least watch the video that’s linked from the front page.

]]>http://ryanballantyne.name/2010/06/less-stop-and-more-go/feed/0The Search for Semantic Writinghttp://ryanballantyne.name/2010/05/the-search-for-semantic-writing/
http://ryanballantyne.name/2010/05/the-search-for-semantic-writing/#commentsSat, 29 May 2010 07:58:03 +0000Ryanhttp://ryanballantyne.name/?p=148More→]]>I grew up using word processors. By all rights, we should be old friends.

My first word processor was Final Writer on the Amiga. I used it to type all my school assignments all throughout grade school. It was a great tool, and easy enough that even a grade schooler could figure it out. Back then, I was happy just to be able to type instead of hand writing everything. I’d print my documents out on our Epson dot matrix printer, and, later, on our HP inkjet. What I saw on-screen was, more or less, what I got from the printer; I never thought much of this because it seemed like the obvious way things ought to work. Without the web, I likely never would have realized that it’s a fundamentally broken way to work.

From Final Writer to Claris Works to Microsoft Word, somehow the same little frustrations carried over. Make a word bold, clear the bold setting before entering the next word, make a typo, erase, find that the text is bold again. Repetitiously change formatting for headers and other elements, then change it back for regular text. Never, ever figure out the logic behind the little fiddly bits in the ruler that control indentation according to some incomprehensible arcane formula.

Writing for the web is different. On the web, you author pages in plain text, and what you see is most certainly not what you get. Printers have nothing to do with it; content is paged according to its needs instead of the limited physical space of a piece of paper. Most importantly, web designers who know their stuff create semantically structured documents that separate their content from its presentation.

Arguing Semantics

When you want to create a header in a traditional word processor, what do you do? Font size 16, bold, maybe use a different font? What you’ve done is make the text look like a header without actually calling it a header. Your WYSIWYG document has no structure; it’s just styled text. (Named styles kinda-sorta structure WYSIWYG documents, but they only go halfway. They have the form of semantic structuring, but they deny the power thereof.)

Semantic structuring takes the opposite approach. Instead of applying a style to create a header, you apply a bit of markup that names it a header. Each bit of text is given a name that describes what it is: headers are marked as headers, emphasized text is marked as emphasized, and so on. Writing this way frees you from having to deal with the vagaries of formatting while writing. It’s incredibly liberating.

It’s also deceptively powerful. Write your documents with semantic structure, and you’ll have a source that can be automatically transformed into any sort of output format you desire. Web designers exploit this property to make web sites easier to maintain, but the concept need not be limited to web pages. After drinking the sweet semantic kool-aid, I found myself wanting to write everything using semantic structure.

So, that’s that. We had a good run, WYSIWYG and I, but now I fear we’re breaking up, and I’ll be happy if I never have to use another word processor ever again.

Tools for Semantic Writing

When I went shopping for a semantic writing toolchain, I had a few basic requirements in mind. Whatever I settled on had to have the following four characteristics:

Simple to author, clear to read in source form. As I would mostly be creating simple documents, I didn’t need a lot of advanced features and the complexity they bring.

Works well with Git. I recognize that this is not a common requirement for a writer to have, but I’m also a programmer and am thus addicted to version control.

Has tools to transform into a number of output formats, including pretty PDF and RTF in standard manuscript format.

Elegant to use. Not too much effort to set up if I could help it.

I evaluated HTML, Markdown, LaTeX, and dedicated applications such as Ulysses against these four criteria, and this is what I found.

My First Markup Language: HTML

I’ll be honest: I didn’t spend long thinking I might use HTML for regular writing. While it is a powerful markup language that I know very well, it’s not really designed for writing things other than web pages. It would be unnecessarily cumbersome to write (for example) fiction using HTML, and the tools that convert from HTML to RTF are, from what little I’ve seen, not very good at it.

HTML is still a part of my life. It was my first love in semantic writing, but it couldn’t be my last.

The Mother of All Markup Languages: LaTeX

As far as I know, LaTeX was the first system to separate presentation from content. It consists of a markup language and a toolchain that converts said language into a number of pretty output formats. It’s frequently used in the publishing industry as a basis for typesetting books, and is the standard for writing academic papers and books. These attributes made LaTeX look very promising to me.

That is, until I started to learn it. I quickly discovered that, while I’m sure it’s a great tool for a lot of people, it didn’t fit well with my needs.

LaTeX is old. It’s crufty. It has a lot of features that are obsoleted by modern character encodings, for example.

LaTeX is complex. It has a lot of features and does a lot of things I didn’t need it to. As a result of this, it was often hard to know which markup construct to use for my specific use case.

LaTeX is kind of hard to style. Its style tags are obtuse and complicated.

Even after all this time, the toolchain still has that “duct tape and bailing wire” feel common to all too many open source products.

Ultimately, I found LaTeX to be overkill, and not really suited to my needs.

Mark Down, Not Up

Markdown is a simple markup language created by John Gruber of Daring Fireball. It was designed to be natural to read and write, and is typically compiled down to HTML. I love Markdown; it’s great for taking notes and writing simple documents, not to mention its original purpose (blogging). In fact, I’m writing this blog post in Markdown right now.

I’ve been doing most of my (non-coding) schoolwork in Markdown for the past year and a half, and when I take notes, I use Markdown. I’ve even written three short stories using the format. It is very clean, and has a small, focused feature set (if you need more, you can simply drop into HTML). But, it doesn’t scale well to large documents, like novels.

MultiMarkdown is an extension to Markdown created by Fletcher Penny. It was designed to address the large document issue, and also to broaden the range of Markdown’s output formats. I think MultiMarkdown is a great concept, and can recommend it to anyone looking to get into semantic writing. I almost settled on it myself.

What stopped me were the tools. They felt immature and cobbled together. Yes, they are usable, but they simply can’t compete with the elegance and ease of use provided by a dedicated application. If said applications didn’t exist, this is where this post would end, but since they do, we soldier on.

Ulysses the Epic

Yes, there is more than one dedicated semantic writing app for the Mac, but since Ulysses is the one I settled on and most heartily recommend, I will omit mention of the others.

Ulysses brings semantic writing, powerful exporting, and project management together in a capable, more-or-less elegant package. Its simple markup is designed specifically for the needs of fiction writers, and is customizable. It outputs a large number of formats, including RTF, LaTeX, PDF, and (soon) HTML. It provides fine-grained control over styling of output. It is a focused, purpose-built tool, and it is very good at what it does.

Within a project, the actual writing is saved in any number of documents, which can be tagged, reordered, annotated with notes, and otherwise managed. This setup is great for writing really big projects, like novels. (Yes, I’m crazy enough to have started writing a novel. Yes, this fact is what prompted me to really nail down my semantic writing toolchain. And yes, I know my novel is going to suck. Shut up. It’s a first try, and I’m writing it for fun.)

That said, Ulysses is not perfect. Its interface is not the best-designed in the world. In particular, I find its implementation of document groups and filters unusually removed from the documents that they group and filter. There may be a good reason for this that I’ve yet to discover. And do we really need three different types of notes?

Also, of all the tools I’ve explored, Ulysses is the only one that costs money. In fact, it’s a bit on the pricy side, though the educational discount helps. Still, at 35EUR (around 45USD at time of purchase) for an educational license, I had to think long and hard about whether it was worth the money, or if I should just stick with MultiMarkdown. That I opted to spend the money shows that I’m a sucker for good tools.

Lastly, some notes about version control. Those not interested in using a programmer’s tools for writing can skip this.

Ulysses projects are standard Mac OS bundles. Inside, they contain a few plists that manage mundane stuff like UI state and preferences, and a series of folders that contain each individual document in the project. Each document has an Info.plist, a folder for notes, a text file that stores an excerpt (not sure what I’d use that feature for), and triply-redundant storage for the document text itself. There is a plain text file, an RTF file, and a binary .textarchive, each of which contains the full text of the document. I have absolutely no idea why they chose to store documents this way.

The bad news is that the binary textarchive is the “canonical” file. It’s the one that gets loaded when a document is opened, and if the text/rtf files don’t agree with the textarchive, they are simply replaced. The good news is that the only information about the documents that is managed in the central plist is a list of all documents in the project. Furthermore, this list uses folder names (a monotonically increasing numerical index), and not the names you assign the documents through Ulysses’ UI.

This means that you can use version control to manage Ulysses projects, but you do have to step carefully. First, if you always add all new files and commit all changes, even to the plists, you should be able to switch between versions of the entire project with impunity. Second, you can revert individual documents to previous revisions as long as you, again, make sure your commits include the entire contents of the document’s subfolder.

Lastly, absolutely no merging of any kind. I’m not too concerned about that, anyway; I don’t anticipate needing it for my fiction.

Oh, and Ulysses keeps a redundant copy of each open document within the project. These open document folders are prefixed with an “o”, and persist even when the project is closed. From the perspective of version control, these are transient noise that need not be versioned. However, if you remove them without also editing the plist, Ulysses will make you save your project to a different file when you open it again, which could get annoying. At the moment, I think the best way to deal with this is simply to close all open documents before making a commit.

Conclusion

Semantic writing has made my writing life easier in a multitude of ways. If you like me find yourself dissatisfied with your word processor, you should give semantic writing a try. It might just sour you on WYSIWYG forever.