I recently got curious about doing some stereoscopy, and I ran into this great tutorial on how to convert 2D images to 3D stereoscopic images. Below is my first experiment in two to three dimension conversion, using depth maps. It’s a process where you use 2D grayscale maps to designate the amount a displacement filter will move a point.

Cross your eyes until you see a third image appear in the middle.

I learned the trick of using displacement maps in the video below. He uses Photoshop in his example, but I used Gimp a free photo-editing tool similar to Photoshop. In Gimp, the displace function is under Filters -> Map -> Displace… It takes a lot of toying around, but you can eventually mimic some pretty good illusions of depth. I’m moving onto 3d animations next. We’ll see how that goes.


I canceled my Facebook account because it was lowering my capacity for independent action. I joined Facebook under certain conceptions that it was a somewhat private place. It used to have a clean interface, especially compared to MySpace. And now it seems that there is something every month where they have started to sell or give more of my stuff to some company without my knowledge.

Facebook, used to be fun and cool, but a large part of what I have to do on Facebook now is adapt to their changes on their terms. This is unacceptable to me, especially when I don’t see the website adding significant benefits.

Facebook Benefit Chart

A service serves someone, but it doesn't look like that someone is me anymore.

Now I wouldn’t have posted about this if a lot of people hadn’t asked me to, and if I had not been personally affected by Facebook’s actions. I was with my girlfriend and we were listening to Pandora. I look at my Pandora player, and there is my girlfriend’s face (supplied by Facebook) staring back at me with some information about her tastes. This would not have been a problem, except she opted out of that program.

We quickly learned you had to also ban each of the groups Facebook was sharing this data with, as well as hitting the opt-out checkbox.

This immediately congealed a sense of loathing for Facebook. It was a combination of their confusing interfaces, reneging on their former commitments, lack of privacy, and spammy newsfeeds. I decided that over the course of the next few days I would back-up my images and cancel my account. And now I have and it feels great.

What has amazed me about canceling my Facebook account is the amount of support people have given my decision. In the comments of a HackerNews post about how to cancel your Facebook account, I posted I was going to be canceling mine, and I thanked the person who posted the instructions. This simple comment generated a large amount of conversation and upvotes. I had expected my comment to fall to the bottom and be ignored, but there is a large group of people who are disgruntled and questioning whether they should use Facebook. I had no idea. I thought I was an outlier.

If you want to get rid of your Facebook account for whatever reason, here are some instructions on how to do it:


I was recently making a field that would contain a url that when you clicked on the field, it would auto select the contents. This way people could click in the field and copy the url there easily. I achieved this successfully using Barry Hess’ helper method.

However, I wanted to put a url for the current page in that field, and getting that out of Rails proved difficult on the first attempt. After an initial attempt at getting rails to give me the current page’s url, I figured out two ways to get the link that weren’t particularly Railsy, until finally I found a Rails way of doing things.

The first wrong way was to hardcode the url, adding various variables to pick up the initial resource and it’s nested child object. This wasn’t a very good way of doing things because what if I moved domains? I would have to recode it.

The second wrong way was to get the url from the request object, using “request.url”. This was fairly concise, but not preferable. Explicitly accessing the request object seemed silly. There had to be a way were I could get one of those magic paths out of Rails.

The solution was to use a nested route like this, concept_example_path (meaning: resource_nestedResource_path). And then to make sure I was getting a complete url, I needed to suppress the default behavior of url_for with :only_path => false.

My initial code looked like this:

url_for(concept_example_path, :only_path => false)

but this returns a “wrong number of arguments (2 for 1)” error.

After poking around I found the proper way to get around the error is to write it like so:

url_for(concept_example_path(:only_path => false))

That gave me a full url (like: http://localhost:3000/concepts/1/examples/1) and not just the path info (/concepts/1/examples/1) for the concept and example objects. You’ll now have an intelligent url for your resources that will change dynamically if you switch domains.

Also, you may find the urlHelper part of the Ruby on Rails API useful, if you haven’t already looked there.

When in Venice

February 22, 2010

When in Venice, by Adrian Perez

Charles was terrified he would get caught by the Venice Police for filming in the city. The risk was terrible, but worth it considering how much he was getting payed for guiding the trip. Somewhere in Kansas, a group of “tourists” were sitting on their couch, getting their kicks from going on an illegal telepresence vacation.

Telepresence vacations were now one of the dominant forms of getting away from it all. For a much cheaper fee than an actual vacation, one could go almost anywhere, your local guide showing you the sites and sounds. The experience still paled to the real thing, but fuel prices and a stormier world, both meteorologic and political, made telepresence vacations the fastest growing form of tourism.

Tourist destinations had various reactions to the change in tourist temperament. Places like Palestine were transformed over night. The religious could visit holy sites without the risk of being bombed or kidnapped. If something happened to your tour guide, well, they had insurance, so most tourists told themselves. Other cities tried to circumvent the problem of a cheaper, non-local tourist by promoting red-light districts and gambling. A small few cities, attempted to fight the tide, like Venice was doing.

Charles walked the streets of Venice with a gun in his pocket. If he was caught, he could be sentenced to life imprisonment. Or almost as bad, he could be held for a few years without being charged. He was probably one of a handful of people with a working video-feed in the whole of the city. Government deals with cell phone providers knocked out the majority of video cameras. And jammers and detectors of various sorts looked for high-volume encrypted traffic. The only thing keeping Charles undetected was a suite of software that decentralized and masked his transmission.

Charles had worked for a brief period as a programmer after dropping out of college. His skills were sharp enough to keep him alive. But the Slump meant there was no prosperity employment. Company websites were always advertising positions, but only a small trickle of people got those jobs. Charles would sometimes get depressed about this stuff, but most of the time he just got creative. His last round of creativity was a camera system strapped to his chest and observing the world through a fake button.

The streets of Venice were not as crowded as they were ten years ago. An inadvertent side-effect of a war on technology drove a lot of traditional business to the periphery, where net-access was unhindered.

The new clientele that visited the city were far more obnoxious in Charles’ view. Where there had been many Ugly Americans blabbing loudly, there were now Ugly Russians, sporting their oil-bought fur coats. A different type of ugly. It was a good place to be angry at the rich.

He followed after a group of Chinese that were about to head into a museum. If you stuck with people, there was less chance of being detected. Or so he read on the forums.

As he was entering the museum, a policeman turned the corner and put his arm on Charles’ shoulder. They smiled knowingly at each other. Charles took his gun out and shot the policeman in the leg. Suprisingly, only the museum ticketer noticed the muffled thump of the gun.

Charles ran to a nearby taxi. He got in, realized there was GPS all over the thing. But if he had only been accosted by one policeman then he might still be unobserved. He quietly handed the driver some money to hurry to a train station. He’d risk that over the airport.

Somewhere in Kansas a family sat unblinking.

I am a little offended by most of the twenty-ten predictions because most of them are just timid extrapolations of the recent past. There really is no reason that people should write such unimaginative predictions since time and again things prove weirder and more surprising than we might have guessed. In response, here is my list of fantastic predictions for twenty-ten, unhindered by modern technology.

  • Humans will be on Pluto by the end of 2010.
  • A human clone will be revealed.
  • Small portals capable of transmitting the energy density of a baseball will be discovered.
  • Cancer will be a thing of the past.
  • Humans will start replanting forests at a rate of ten to twenty times as much as we do now.
  • Population growth in India will cut in half.

Those are my predictions for this new year. There are no “computers will be faster” or “we will know more about the brain” bets here! Just good old-fashioned brash claims.

Using InstantRails and Heroku

December 22, 2009

If you’re using Instant Rails 2.0 and starting to use Heroku, you may have run into trouble installing the heroku gem.

You may need to update rubygems with this command

gem update --system

Once I did that, the normal heroku command line install…

gem install heroku

…worked successfully.

Before that I installed the files they specified in their support documentation locally with commands like

gem install json-1.1.1-mswin32.gem

After downloading the specific *.gem files. I probably wouldn’t have had to do local installs if I had updated rubygems with gem update –system

The Machete and The Caravan, by Adrian Perez

Nephali sauntered down the caravan of hover-ships. They had been flying in formation for most of the day, but their turbines had spun down for a brief rest. They prepared to camp on a black ridge of rock spotted amidst the blue jungle. Nephali’s caravan was exploring the wildlife-rich planet of Romit in the hopes of finding useful organisms for genetic research.

As far as planets went, Nephali was ecstatic to be on Romit. It was like Earth two hundred years ago, when the planet still had usable oil and the forests still existed in sufficient abundance. Only now was Earth returning to a state similar to Romit’s. In large part to due to genetic additives from other planets to replace irrecoverable species.

Nepahli walked to the edge of the tiny plateau their outriders had landed on. She looked into the jungle, hearing all sorts of hooting and hollering. It was something to chill the bones of people accustomed to the controled environments of earth. It offered Nephali a stream of dopamine fostered by never-ending biological and geographical novelty.

“We should climb down,” said Okwa, trotting up to Nephali’s side. “We have the time.”

“No,” commented Nephali, “I want to use our margin to weave across the jungle on the way back to camp. We can discover more investigation sites that way.”

“Baloney Nephali,” frowned Okwa, “When was the last time we did anything unplanned. For an explorer you keep searching for the things you know are there.”

“Meh Okwa,” smiled Nephali, “You just want to use the sword you synthesized from the archives.”

“And maybe I do. And it is called a Machete,” Okwa grimaced while holding the tree cutter that caused him so much delight.

Nephali stared with Okwa into the dark blue forest. The thick leaves of the trees of the equator gasped oxygen into the breeze. If Nephali had a giant thumb she would rub it against the forest that she might feel it all at once.

“Fine-fine, Okwarim. Let’s test your Machete.”

They climbed down on ropes made of spider silk from the planet Crox. The team brought a robotic pack mule with sample containers for any organisms they might find. Okwa rode the beast down an impossibly angled path that only a computer could navigate without catastrophe.

Each of them held electromagnetic disrupters tuned for the average nervous system on Romit.

[More to come as I continue to write the story]