Jue's Blog

Jun 21, 2010

Opticrop: Usage and Implementation

Opticrop is a PHP script I wrote to crop a thumbnail of a specific width and height from a full-sized image.

Unlike most cropping routines out there, Opticrop uses edge-detection to find the most “interesting” part of the image to crop, so you won’t get a useless thumbnail just because the top-left corner of your image happened to be a big patch of featureless sky. This post is an overview of usage and implementation. For a more general discussion, see my post on the methods behind the script. Also check out the live demo of Opticrop, with a slick jQuery interface. You can also get the Opticrop code on Github. (more…)

Jun 15, 2010

Steamed fish

Steamed fish

Get a whole fish, cleaned of guts and scales. A 1ft rainbow trout is good. Cut slits into it every inch or so along both sides, and place into a shallow bowl. Finely chop about 2 tbsp scallions and 1 tbsp ginger, and sprinkle this under, over, and inside the fish. Drizzle soy sauce over fish (about 1 tbsp). Place entire bowl with fish in it in a wok 1/3 filled with water. Cover with a lid, and place on high heat. Steam for 15 min. Remove bowl, wipe the bottom dry, and eat.

Jun 8, 2010

Spicy Egg Drop Soup With Tomato and Tofu

Spicy tomato egg drop soup

After a bout of reminiscing about the homeland tonight, I decided to make a soup I recently learned from my mom. Here’s the recipe, along with a recipe for an accoutrement, garlic cucumber salad, and an important condiment, chili oil.

This recipe, which makes roughly 2 servings, is a variation on the classic Chinese egg drop soup. Adding tomatoes, black rice vinegar, and chili oil augments the savory, light taste with a tangy spicy kick, a flavor profile typical in Northern Chinese cooking.

The key to this recipe is the combination of traditional Chinese ingredients, so it’s to your benefit to get ahold of as many of these as you can. In a pinch, though, it’s possible to do this soup with a few Western substitutions. Some ingredients are more crucial than others, and I’ll point out the essential ones below. (more…)

Eating in Shaanxi

Alley

Summer has announced itself in DC. Last week saw a string of muggy 90°F days, giving way this week to dry, cool breezes, plentiful sun, and clear skies. This took the edge off my nostalgia for Maine.

But I have another kind of homesickness. It’s been five years since I last saw China, and of everything there I miss the food the most.

Map of ShaanxiMy family is from Shaanxi, a province on the Yellow River plateau whose arid, hot summers and freezing dry winters seem to take their cue from the Mongolian steppes to the north. The river’s color is from loess–a mixture of silt and sand that makes up much of the arable land in the region. Loess is fertile, but erodes instantly off of farms and into waterways when it rains. Before hydroelectric dams put a stop to seasonal floods, the river would overflow with churning, opaque yellow water on a regular basis, an eerie sight that has inspired centuries’ worth of paintings and poems. There is even a “Yellow River” piano concerto.

Shaanxi’s largest city is Xi’an, the Qin imperial capital, known best to foreigners for the tomb of the Qin emperor. Powerful, paranoid, and not lacking for slave labor, he buried himself with an imposing–and impotent–entourage of 8,000 soldiers, 130 chariots, 520 horses, and 150 cavalry horses, all made of terracotta clay. (more…)

Jun 3, 2010

Two Recent Web Projects

Life is busy for a web developer! The last 2 weeks I’ve been working away on the following:

Science of the Oil Spill Portal Page. As is usual in a newsroom, we start by writing a few articles on a current event, then we realize we should create a collections page with all our coverage in one place, then we think that the collections page should be a full-blown portal with various bells and whistles. Somewhere in this progression I was recruited to do the wireframing, mocking up, and coding of this page, which all took the place over the course of 2-3 days and several frenzied, confused meetings.

Here’s a word of advice for any webdevs working in a constant production environment — avoid design by committee! You are the designer and coder (unless you’re not), so feel free to say “No” to suggestions from content people. Of course, say “no” politely–usually people mean well, but it makes your life much, much easier when you keep your feature set small and user experience simple and focused on a few key features. Note that this doesn’t mean “don’t listen to suggestions”–quite the opposite: you have to listen even more intently, so you can understand the goal of the suggestion even if the actual content of the suggestion isn’t a good idea. That goal is what you need to come up with a way of implementing.

Anyway, we’ve got some pretty interesting articles, all focused on the scientific aspects of the oil spill, so you’ll get some tidbits you don’t see in the rest of the news coverage. For example, check out this nice description of the (now failed) “top kill” maneuver: “How to kill a well with gravity.

Dance Your PhD Contest 2010. This is the 3rd year of a quirky event run by science writer John Bohannon (a.k.a. “The Gonzo Scientist”), where Ph.D. students videotape themselves in an interpretive dance inspired by their dissertation. I think the idea speaks for itself, so I kept the design of the page very simple (and followed a lab bench visual metaphor I had previously constructed for the more general “Gonzolabs” website). Take a look, and if you’re a scientist, consider joining the contest yourself!