<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jueseph.com &#187; Blog</title>
	<atom:link href="http://jueseph.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://jueseph.com</link>
	<description>home</description>
	<lastBuildDate>Mon, 23 Aug 2010 22:25:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The difference between undergrad and grad school</title>
		<link>http://jueseph.com/2010/08/the-difference-between-undergrad-and-grad-school/</link>
		<comments>http://jueseph.com/2010/08/the-difference-between-undergrad-and-grad-school/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 22:25:32 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[rambling]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[systems biology]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1432</guid>
		<description><![CDATA[Today was my first day of grad school (orientation). What was it like? Imagine a lanky, stubbled, Englishman declaiming the following: Here&#8217;s the difference between your undergrad studies and what you are about to embark on for your PhD. Undergrad is like being in a hurdles race. It&#8217;s 4 years, you know how many hurdles (<a href="http://jueseph.com/2010/08/the-difference-between-undergrad-and-grad-school/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p>Today was my first day of grad school (orientation). What was it like? Imagine a lanky, stubbled, Englishman declaiming the following:</p>
<blockquote><p>Here&#8217;s the difference between your undergrad studies and what you are about to embark on for your PhD. Undergrad is like being in a hurdles race. It&#8217;s 4 years, you know how many hurdles you have to jump over and how high they are, and the goal is to clear them as quickly and as well as you can, while knocking down as few as possible.</p>
<p>Grad school is more like a one-way plane ticket to a Transylvanian castle, and when you get inside the doors shut behind you and you&#8217;re left in total darkness holding onto nothing but a single matchbook. You light the first match and discover that you are in a room full of objects covered by white sheets. Before the light from your match goes out you have time to uncover only one object. If you&#8217;re lucky, before you run out of matches you&#8217;ll uncover a sheet that has another box of matches under it. If you&#8217;re really lucky eventually you&#8217;ll find the key to the door so you can get out of the damn place.</p></blockquote>
<p>&#8230;to which a fellow grad student responded, can&#8217;t we just set fire to all the sheets?</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/08/the-difference-between-undergrad-and-grad-school/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Music: A Cheap Trick for Nerds? Part 2.</title>
		<link>http://jueseph.com/2010/07/music-a-cheap-trick-for-nerds-part-2/</link>
		<comments>http://jueseph.com/2010/07/music-a-cheap-trick-for-nerds-part-2/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 15:11:32 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[classical music]]></category>
		<category><![CDATA[rambling]]></category>
		<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1425</guid>
		<description><![CDATA[In my previous post I showed you a piece of piano music based on a Shepard Scale&#8211;it seems to go up and up forever. Listen to it (it&#8217;s at the bottom on this link), and then ask yourself: 1. Was that interesting? 2. Was that aesthetically pleasing or beautiful? 3. Was that music? Most people (<a href="http://jueseph.com/2010/07/music-a-cheap-trick-for-nerds-part-2/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p>In my previous post I showed you a piece of piano music based on a Shepard Scale&#8211;it seems to go up and up forever. <a href="http://jueseph.com/2010/07/music-is-a-cheap-trick-for-nerds-part-1/">Listen to it (it&#8217;s at the bottom on this link)</a>, and then ask yourself: 1. Was that interesting? 2. Was that aesthetically pleasing or beautiful? 3. Was that music?</p>
<p>Most people would probably answer &#8220;no&#8221; to questions 2 and 3 after listening to that. It actually sounds stressful, even unpleasant. This, incidentally, is the general response of most people when they encounter contemporary classical music, especially the avant-garde stuff. However, if you are a modern composer, you are not most people.</p>
<p>Some people might ask, in response to question 1, what&#8217;s so interesting about a piece that sounds like it&#8217;s going up/down forever? It&#8217;s a cheap trick for nerds. To these people, if you are a modern composer, you should say &#8220;Uh, no!&#8221; after stammering a little. Then walk away, knowing in your heart that your tricks actually rather expensive, which is why you&#8217;re unemployed.</p>
<h3>Part 2: Overtone Series</h3>
<p><span id="more-1425"></span>Now listen to <a href="http://www.youtube.com/watch?v=4pzeXBuzl8Q">this</a>:<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/4pzeXBuzl8Q&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/4pzeXBuzl8Q&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>It&#8217;s a piece of &#8220;music&#8221; by composer Karlheinz Stockhausen, who loved useless concepts probably more than most smart people. His secret in this piece is the <a href="http://en.wikipedia.org/wiki/Overtone_series">overtone series</a>, a.k.a. harmonic series (or just &#8220;overtones&#8221;), combinations of pitches that fit a certain mathematical pattern. This pattern is what give natural sounds like a voice or an instrument their distinctive timbre (i.e. the &#8220;feel&#8221; or &#8220;texture&#8221; of a sound). In this piece, a chorus sings an overtone series dreamed up by the composer himself. What&#8217;s different about this, compared with, say, two country singers belting out a tune in parallel 3rds harmony, or a church choir singing a hymn, is that the pitch (and volume) of each voice is mathematically calculated to add up to something MORE than harmony. Stockhausen is basically using the choir to create a new &#8220;instrument&#8221; whose timbre comes from the precise combination of all the voices. </p>
<p>In this case the artificial &#8220;instrument&#8221; is a chorus that sounds weird. You can tell this is a significant achievement by imagining how long it took to convince a group of singers to sing random words from erotic poems that don&#8217;t sound like anything.</p>
<p>How about that Stockhausen? Interesting? Beautiful? Music? </p>
<p>No? A lot of other people would agree with you. They all went out to buy the Beatle&#8217;s &#8220;Sergeant Pepper&#8217;s Lonely Hearts Club Band&#8221; instead of going to hear this piece (both came out in the same year). But a small group of composers who call themselves &#8220;<a href="http://en.wikipedia.org/wiki/Spectralism">spectralists</a>&#8221; (some call them &#8220;insane&#8221;) love it. In fact, if they had money they would buy computers and learn <a href="http://en.wikipedia.org/wiki/Fourier_transform">fancy math</a>, so they can analyze the overtones of all sorts of sounds and write oodles of this kind of music. </p>
<p>If you think overtones are something that only nerds care about, you&#8217;re probably right, but just know that we&#8217;re talking about nerds from around the world here. There are folk music traditions based entirely on overtones. For example, check out this <a href="http://www.youtube.com/watch?v=NOsGvs1FZDs">video</a> of a Mongolian badass performing notes using the &#8220;throat singing&#8221; technique. Notice how, especially in the notes near the end of the video, you can hear very high pitched &#8220;buzzing&#8221; on top of the (mostly very low) bass notes he&#8217;s singing directly. These high pitches are overtones, and the Mongolian singer has developed his ability to control his vocal chords so that he can create melodies with those overtones. Note that every singer&#8211;and in fact, anything earthly that makes a sound&#8211;will create overtones. It&#8217;s just that usually overtones are very quiet and your ears focuses on the main pitch instead. Mongolian (and the related Tuvan) throat-singing flip that around, and draw your attention to the overtones by making the main pitch very very low.</p>
<p>Here&#8217;s a final, and much more familiar example of overtones used in music. This is a <a href="http://www.youtube.com/watch?v=SEAwl2jGxzc#t=1m58s">passage</a> of a guitar prelude that is played with &#8220;harmonics&#8221;&#8211;the overtones on a stringed instrument that players create by touching a string lightly, but not pressing it down. Notice how they&#8217;re much quieter and purer sounding than the typical notes that you would hear from guitar strings.</p>
<p>Next time I&#8217;ll show you examples of 12-tone music, a style of composition that is actually more pleasing to look at than it is to listen to. This is why it is respected and emulated by true artists around the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/07/music-a-cheap-trick-for-nerds-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Music is a Cheap Trick for Nerds, Part 1</title>
		<link>http://jueseph.com/2010/07/music-is-a-cheap-trick-for-nerds-part-1/</link>
		<comments>http://jueseph.com/2010/07/music-is-a-cheap-trick-for-nerds-part-1/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 05:32:33 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[classical music]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[rambling]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1422</guid>
		<description><![CDATA[Modern classical music, a.k.a. &#8220;art music,&#8221; often gets a bad rap for being impossible to listen to. In fact, this is completely true. Since you&#8217;re probably very busy at work, allow me to take you on a stroll through Youtube and Wikipedia to see why. Part 1: The Shepard Scale First you need to understand (<a href="http://jueseph.com/2010/07/music-is-a-cheap-trick-for-nerds-part-1/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p>Modern classical music, a.k.a. &#8220;art music,&#8221; often gets a bad rap for being impossible to listen to. In fact, this is completely true. Since you&#8217;re probably very busy at work, allow me to take you on a stroll through Youtube and Wikipedia to see why.</p>
<h3>Part 1: The Shepard Scale</h3>
<p>First you need to understand some abstract, completely useless concepts. Imagine playing an ascending scale or a note that slowly slides upward in pitch. When you get higher and higher, you slowly fade out&#8211;get softer and softer&#8211;but you fade in with the same scale several octaves below, which goes up a while but then also fades out. Keep repeating, and you end up with a scale, actually 2 or more overlapping scales, that seems to go up forever. This is called a <a href="http://en.wikipedia.org/wiki/Shepard_tone">Shepard scale</a>. Home exercise: try playing a Shepard scale. Home exercise: try doing that forever.</p>
<p>Let&#8217;s say you are a composer and instead of contributing something of tangible value to society, you want to write a piece of music using a Shepard Scale. If you have a good grad student stipend, or if that&#8217;s impossible, if you have a good faculty salary and have paid off your student loans but haven&#8217;t died of old age, you can buy an electronic &#8220;instrument&#8221; called a tone generator, and make this composition in 5 minutes&#8211;it sounds like <a href="http://en.wikipedia.org/wiki/File:DescenteInfinie.ogg">this</a>. It&#8217;s kind of lame, but you get the idea.</p>
<p>Fortunately, if you know how to click randomly on Youtube, the best kind of concept music is at your fingertips. For example, in the following video you&#8217;ll notice the hallmarks of a contemporary composition: lots of black ink, pages that don&#8217;t look like they have any notes on them and were drawn by babies, notes that require breaking appendages to play. <span id="more-1422"></span>This is known as &#8220;cryo-music,&#8221; music that needs to be frozen and revived 300 years from now when people have evolved 20 fingers on each hand:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/gddnK17sN6Y&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gddnK17sN6Y&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>Now listen to this&#8211;it&#8217;s written by Gyorgy Ligeti, who has two important qualities: he writes music for an anatomically plausible number of fingers, and he&#8217;s Hungarian:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/BUB83_F-SmE&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BUB83_F-SmE&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>The reason Gyorgy Ligeti wrote this piece is because the goal of all art is to sound like a person trying to get out of Hell by climbing a staircase, but not succeeding. Sublime.</p>
<p>Stay tuned for: <a href="http://jueseph.com/2010/07/music-a-cheap-trick-for-nerds-part-2/">Part 2</a>, where I explain what an overtone series is, and why you should listen to Karlheinz Stockhausen instead of the Beatles. (Hint: it&#8217;s not to make girls like you. Actually: it&#8217;s more the opposite.)</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/07/music-is-a-cheap-trick-for-nerds-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://en.wikipedia.org/wiki/File:DescenteInfinie.ogg" length="61807" type="audio/ogg" />
		</item>
		<item>
		<title>An American Dinner</title>
		<link>http://jueseph.com/2010/07/an-american-dinner/</link>
		<comments>http://jueseph.com/2010/07/an-american-dinner/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 03:43:55 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[Food]]></category>
		<category><![CDATA[rambling]]></category>
		<category><![CDATA[cooking]]></category>
		<category><![CDATA[recipe]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1416</guid>
		<description><![CDATA[from Dave&#8217;s Flickr I just discovered the joy of marinating meat. This first attempt is inspired by the motherland, although the real Chinese would never cook chicken this way. Same goes for the Thai-style stir-fry, which is Thai only in style. Be assured, though, that both came out tasty. Ginger-soy baked chicken Put a few (<a href="http://jueseph.com/2010/07/an-american-dinner/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/dklein/4790373429/" title="Dinner by Dave Kleinschmidt, on Flickr"><img src="http://farm5.static.flickr.com/4142/4790373429_4d261c1a16.jpg" width="500" height="374" alt="Dinner" /></a><br />
<span class="caption">from <a href="http://www.flickr.com/photos/dklein/4790373429/">Dave&#8217;s Flickr</a></span></p>
<p>I just discovered the joy of marinating meat. This first attempt is inspired by the motherland, although the real Chinese would never cook chicken this way. Same goes for the Thai-style stir-fry, which is Thai only in style.</p>
<p>Be assured, though, that both came out tasty.<span id="more-1416"></span></p>
<h3>Ginger-soy baked chicken</h3>
<p>Put a few <strong>chicken thighs</strong> in a ziplock bag or tupperware, with <strong>soy sauce</strong>, <strong>rice vinegar</strong> (black or white) finely chopped <strong>ginger</strong> and <strong>garlic</strong>. Optional ingredients include <strong>spiciness</strong> (cayenne powder or chili flakes), <strong>sesame-ness</strong> (sesame oil or toasted seeds), and <strong>sweetness</strong> (sugar, honey, or maple syrup). Leave in fridge for a day/overnight. If you start with frozen chicken, leave at room temperature for a day to combine thawing and marinating.</p>
<p>When you get home from work, take the chicken out of the marinade and pop into a 400°F oven on a baking pan. Baste every 10 minutes or so by putting some of the marinade on top of the chicken. The chicken is done after ~30min or if your meat thermometer / eyes tell you so.</p>
<h3>Thai-style stir-fry</h3>
<p>You can put any vegetables you want in here. I chose <strong>kale, carrots, water chestnuts</strong>, and <strong>fresh baby corn</strong>. Chop into cookable pieces&#8211;strips for kale, thin slices for carrots and chestnuts, break corn in half. Pre-cook vegetables by blanching* (carrots, corn) or sautéing with some water or <strong>stock</strong> (kale). Water chestnuts don&#8217;t need to be pre-cooked.</p>
<p>What makes this Thai is the sauce. Start this by cooking some diced <strong>onions</strong>, minced <strong>garlic+ginger</strong>, and coarsely chopped <strong>lemongrass</strong> in <strong>vegetable oil</strong>. When onions are soft, add a few dashes of <strong>sherry</strong> and let reduce briefly. Then add <strong>stock+coconut milk</strong>, <strong>spiciness</strong> (chili flakes or chopped fresh chilis), and <strong>sweetness</strong> (sugar or honey). Cook until thick, then take off heat.</p>
<p>Now combine vegetables and sauce in a big wok and stir-fry on high heat for a few minutes.</p>
<p class="footnote">*Blanching means quickly boiling in lightly salted water so the vegetables don&#8217;t get soggy. Bring water to boil, toss in vegetables, turn off heat, wait a minute, and pour into colander to stop cooking.</p>
<h3>Sauce (for chicken)</h3>
<p>When you take the chicken out of the baking pan, skim off most of the oil with a spoon, put the pan on a burner, and pour in some <strong>stock+sherry</strong>. Scrape up the gunk on the bottom, mix it up, and reduce. Spoon some of this over the chicken.</p>
<h3>Combined</h3>
<p>Serve chicken and stir-fry on steamed white rice. Keep a bit of the sauce on the side and add to the rice if you get bored of the plain rice flavor.</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/07/an-american-dinner/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Noodles with pork broth</title>
		<link>http://jueseph.com/2010/07/noodles-with-pork-broth/</link>
		<comments>http://jueseph.com/2010/07/noodles-with-pork-broth/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 03:46:39 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[Food]]></category>
		<category><![CDATA[cooking]]></category>
		<category><![CDATA[recipe]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1413</guid>
		<description><![CDATA[Another of my mom&#8217;s recipes. The noodles are quick to make, but the broth takes a while to simmer. Noodles: Mix some flour (~2 cups) and water (~0.5 cup) in a pot or mixing bowl. This isn&#8217;t exact, so start with the flour and add water in small amounts until you get a good dry (<a href="http://jueseph.com/2010/07/noodles-with-pork-broth/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cremeglace/4766742460/" title="Noodles with pork neck bone broth by cremeglace, on Flickr"><img src="http://farm5.static.flickr.com/4074/4766742460_f6e3684704.jpg" width="500" height="375" alt="Noodles with pork neck bone broth"></a></p>
<p>Another of my mom&#8217;s recipes. The noodles are quick to make, but the broth takes a while to simmer.<span id="more-1413"></span></p>
<h3>Noodles:</h3>
<p>Mix some <strong>flour</strong> (~2 cups) and <strong>water</strong> (~0.5 cup) in a pot or mixing bowl. This isn&#8217;t exact, so start with the flour and add water in small amounts until you get a good dry dough&#8211;this is less water than you might think, so make sure to really mix and knead the dough with your hands before adding the next batch of water. </p>
<p>Once you have a ball of dough barely sticking together, put it on a flat, floured surface and start kneading it, maybe about 10 minutes or until it gets too tough. Leave the dough in a ball, covered with a moist paper towel, to rest for 30 minutes.</p>
<p><a href="http://www.flickr.com/photos/cremeglace/4766742560/" title="Chopping noodles by cremeglace, on Flickr"><img src="http://farm5.static.flickr.com/4093/4766742560_a834159ca9_t.jpg" width="100" height="73" alt="Chopping noodles" class="alignright"></a> When the dough has rested and softened, roll it out into a thin (2-5mm thick) round sheet with a rolling pin. Fold this sheet onto itself 4-5 times, and cut into noodles. Either thin (2-3mm) or wide noodles (5-10mm) are good. </p>
<p>To store, sprinkle the noodles generously with flour and freeze in a bag. Frozen or fresh noodles can be cooked by boiling in water for 5-10 min, stirring occasionally to prevent sticking.</p>
<h3>Broth:</h3>
<p>Get some stewing cuts of meat. I used <strong>pork neck bone</strong> pieces, but beef bones, chuck steak, lamb leg, or any fatty pieces of robust red meat can traditionally be used for this. Quickly boil a few pieces of meat in a pot until the water gets foamy. </p>
<p>Strain the meat by pouring the water and meat into a colander, rinse the foam off, and return the pieces of meat to the empty pot. </p>
<p>Throw in <strong>a small carrot</strong>, a <strong>stalk of celery</strong>, <strong>1/4-1/2 of an onion</strong>, <strong>5-10 Szechuan peppercorns</strong>, <strong>a star anise seed</strong>, <strong>a bay leaf</strong>, and cover with water. Simmer for an hour or longer. At the end add <strong>salt</strong> and/or <strong>soy sauce</strong> to taste.</p>
<h3>Combined:</h3>
<p>Half-fill a bowl with freshly cooked noodles. Throw some chopped <strong>cilantro</strong> and <strong>scallions</strong> on, and a dash of <strong>chili oil</strong>, <strong>sesame oil</strong>, and/or sesame seeds. Ladle broth to cover noodles and herbs, throw on a piece of meat if you want. Eat.</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/07/noodles-with-pork-broth/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>On Google Buzz now&#8230;</title>
		<link>http://jueseph.com/2010/06/on-google-buzz-now/</link>
		<comments>http://jueseph.com/2010/06/on-google-buzz-now/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 04:11:53 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[rambling]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1411</guid>
		<description><![CDATA[In case you actually follow this blog, just a note that I&#8217;ve pretty much consolidated my entire online presence to Google Buzz. Posts on this blog will be fed into my Buzz, and anything I tweet will also hit Buzz first. Some thoughts and links, additionally, will only live on Buzz.]]></description>
			<content:encoded><![CDATA[<p>In case you actually follow this blog, just a note that I&#8217;ve pretty much consolidated my entire online presence to <a href="http://www.google.com/profiles/cremeglace#buzz">Google Buzz</a>. Posts on this blog will be fed into my Buzz, and anything I tweet will also hit Buzz first. Some thoughts and links, additionally, will only live on Buzz.</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/06/on-google-buzz-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opticrop: Content-aware Cropping with PHP and ImageMagick</title>
		<link>http://jueseph.com/2010/06/opticrop-content-aware-cropping-with-php-and-imagemagick/</link>
		<comments>http://jueseph.com/2010/06/opticrop-content-aware-cropping-with-php-and-imagemagick/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 22:06:37 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[image processing]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[imagick]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1306</guid>
		<description><![CDATA[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 &#8220;interesting&#8221; part of the image to crop, so you won&#8217;t get a useless thumbnail just because the top-left corner of your (<a href="http://jueseph.com/2010/06/opticrop-content-aware-cropping-with-php-and-imagemagick/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p>Opticrop is a PHP script I wrote to crop a thumbnail of a specific width and height from a full-sized image. </p>
<p>Unlike most cropping routines out there, Opticrop uses edge-detection to find the most &#8220;interesting&#8221; part of the image to crop, so you won&#8217;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 a big-picture discussion of my method. If you just want the script, see the post on <a href="http://jueseph.com/2010/06/opticrop-usage-and-implementation/">Opticrop&#8217;s usage and implementation</a>.<span id="more-1306"></span></p>
<h3>The Thumbnail-Cropping Problem</h3>
<p>You&#8217;ve probably dealt with the thumbnail problem if you run a blog or website that publishes images with articles. When you link to that article (say, on your front page), it&#8217;s nice to have a thumbnail of that article&#8217;s &#8220;feature&#8221; image for your readers to click on.</p>
<p>The simplest way to make a thumbnail is to proportionally resize the original image to fit a width or height. However, if both dimensions are constrained, you usually have to crop the image before resizing. </p>
<p>For example, say your home page design uses square thumbnails, but your source images come in an odd assortment of width/height combinations. You&#8217;ll need to open the source image up in Photoshop/GIMP, take your crop, and save the thumbnail for your website. If you&#8217;re doing this dozens of times a day (like our photo editor does), it would be much nicer if you could somehow use a script&#8211;you open up the URL to a script, give it the path to an image, and it serves back a cropped/resized thumbnail. Unfortunately, a good script to do this is hard to come by, which is why I wrote Opticrop.</p>
<p><img src="http://jueseph.com/wp-content/uploads/2010/06/fig-1-cropping.png" alt="" title="fig-1-cropping" width="388" height="323" class="alignright size-full wp-image-1374" /></p>
<p class="caption"><strong>Figure 1. The usefulness of cropping.</strong> Suppose you need a 120px-wide thumbnail from a 600&#215;400 source image. You can resize it proportionally to fit the width (left), but the height will be 80px in the thumbnail. If thumbnail height also needs to be 120px, then the original image should first be cropped to the 1:1 aspect ratio of the thumbnail (red box), and then resized (right).</p>
<h3>Existing Solutions</h3>
<p>A Google search will turn up simple explanations on how to resize/or crop images in PHP&#8211;see &#8220;examples&#8221; at the bottom of <a href="http://php.net/manual/en/function.imagecopyresampled.php">this page</a>, or <a href="http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/">these</a> <a href="http://www.talkphp.com/advanced-php-programming/1709-cropping-images-using-php.html">tutorials</a>. Many CMS&#8217;s also come bundled with thumbnail-generation utilities. For instance, Movable Type 5 (the CMS used by <a href="http://news.sciencemag.org">my employer</a>) has <a href="http://www.movabletype.org/documentation/appendices/tags/assetthumbnailurl.html">template tags</a> for on-the-fly generation of resized or square-cropped thumbnails.</p>
<p>These solutions have their limitations. MT5 can make square thumbnails, but won&#8217;t make them in arbitrary dimensions. What if you want a 200&#215;50 thumbnail for a &#8220;related articles&#8221; widget for your sidebar? More generally, I want a script that will take an image, a width, and a height, and give me a thumbnail back that is exactly what a photo editor would have made in Photoshop.</p>
<p>With this goal in mind, I tracked down a few &#8220;smart&#8221; image resizer/croppers out there to find a starting point. A script by <a href="http://www.theukwebdesigncompany.com/articles/php-imagemagick.php">Gijs van Tulder</a> ingeniously delegates all its work to the command-line ImageMagick utility, so you can run a <a href="http://www.imagemagick.org/Usage/">bewildering array</a> of commands through a simple URL string&#8211;he even wrote a custom command, <code>part</code>, to do a simple crop-and-resize. Another script by <a href="http://shiftingpixel.com/2008/03/03/smart-image-resizer/">Joe Lencioni</a> isn&#8217;t as powerful, but it does its own work using only functionality that comes with PHP&#8211;so you don&#8217;t have to have ImageMagick installed or set up additional modules. </p>
<p>Van Tulder&#8217;s <code>part</code> command and MT5&#8242;s square-thumbnail-generator crop as large of a region from the source image as possible without changing the aspect ratio, and center the crop along the dimension that needs cropping. This &#8220;largest centered crop&#8221; is generally a safe and simple strategy. However, if the source and target images have very different aspect ratios (i.e. you need to crop out more stuff), then a smarter strategy might be needed. Also, if the image contains a single small subject on an otherwise blank background, then you don&#8217;t want to take the biggest crop you can get, but rather just enough to capture the subject. Otherwise you run the risk of scaling that spot down into obscurity.</p>
<p><a href="http://jueseph.com/wp-content/uploads/2010/06/f2-centeredcrop.png"><img src="http://jueseph.com/wp-content/uploads/2010/06/f2-centeredcrop-300x130.png" alt="" title="f2-centeredcrop" width="300" height="130" class="alignright size-medium wp-image-1386" /></a></p>
<p class="caption"><strong>Figure 2. Pitfalls of the &#8220;largest centered crop&#8221;.</strong> It&#8217;s easiest to take the largest centered crop before scaling to the target dimensions (such as a small square thumbnail), but the strategy yields less-than-ideal results when the aspect ratio of the original or target image are severely elongated, or when there is a small single subject on an otherwise uniform background.</p>
<h3>Content-Aware Cropping</h3>
<p>In other words, the script needs to understand the content of an image. There are all sorts of fancy ways to do this, but I set out to write something that will be quick, simple, and require a minimum of external code. A key first step would be running the image to crop through an <a href="http://en.wikipedia.org/wiki/Edge_detection">edge-detection</a> filter. Like the name suggests, an edge-detection filter transforms an image based on changes in color and lightness&#8211;&#8221;interesting&#8221; areas with lots of detail get mapped to bright pixels, and uniform, boring areas like sky get mapped to dark pixels.</p>
<div style="width:310px;" class="alignright"><a href="http://jueseph.com/wp-content/uploads/2010/06/f3-edge-coe.png"><img src="http://jueseph.com/wp-content/uploads/2010/06/f3-edge-coe-300x281.png" alt="" title="f3-edge-coe" width="300" height="281" class="size-medium wp-image-1379" /></a></p>
<p class="caption"><strong>Figure 3. Several potential crops around the center of edginess (red dot).</strong> Images are shown after edge detection. At the bottom you can see the &#8220;best&#8221; crop in full color and after rescaling to target dimensions.</p>
</div>
<p>Armed with the edge-detection filter, a script can do all sorts of things to infer where to crop an image. For example, I decided to crop the image around a spot I calculate by averaging all the pixels&#8217; locations, weighted by the intensity of each pixel in the edge-detected image. This tell you the location of the &#8220;center-of-edginess&#8221; of the image , sort of like the center-of-gravity of a physical object. Just as the COG is a good place to put your finger if you want to balance something, the COE of an image a good point to use as the center of a crop (with important exceptions, noted below).</p>
<p>Once you know where to crop you still need to pick a crop size, since for any set of target dimensions you can make many crops with that aspect ratio from the source image. If you choose the crop by adding up the edginess of all the pixels in each possible crop and choosing the one with highest &#8220;total edginess&#8221; you&#8217;ll end up always choosing the largest crop, which is bad for the type of &#8220;small single subject&#8221; images mentioned above. If you choose the highest <em>average</em> edginess (total edginess divided by area of the crop) instead, you&#8217;ll favor small, cramped crops with a lot of detail but no visual context.</p>
<div class="alignright sidebox">
<p class="endnote">If <img src='http://s.wordpress.com/latex.php?latex=%5Ceta_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\eta_i' title='\eta_i' class='latex' /> is the edginess at pixel <img src='http://s.wordpress.com/latex.php?latex=%5Cboldsymbol%20r_i%20%3D%20%28x_i%2Cy_i%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\boldsymbol r_i = (x_i,y_i)' title='\boldsymbol r_i = (x_i,y_i)' class='latex' />, <img src='http://s.wordpress.com/latex.php?latex=A&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='A' title='A' class='latex' /> is the area of the image, and <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\gamma' title='\gamma' class='latex' /> is a tweaking parameter:</p>
<p class="eq">Center of edginess: <img src='http://s.wordpress.com/latex.php?latex=%5Cboldsymbol%20R%20%3D%20%5Csum_i%20%7B%5Ceta_i%20%5Cboldsymbol%20r_i%7D%2F%5Csum_i%20%5Ceta_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\boldsymbol R = \sum_i {\eta_i \boldsymbol r_i}/\sum_i \eta_i' title='\boldsymbol R = \sum_i {\eta_i \boldsymbol r_i}/\sum_i \eta_i' class='latex' /></p>
<p class="eq">Total edginess: <img src='http://s.wordpress.com/latex.php?latex=H%3D%5Csum_i%20%5Ceta_i&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='H=\sum_i \eta_i' title='H=\sum_i \eta_i' class='latex' /></p>
<p class="eq">Average edginess: <img src='http://s.wordpress.com/latex.php?latex=%5Cbar%20H%3DH%2FA&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\bar H=H/A' title='\bar H=H/A' class='latex' /></p>
<p class="eq">Adjusted average edginess: <img src='http://s.wordpress.com/latex.php?latex=%20%5Ctilde%20H%3D%20H%2FA%5E%5Cgamma&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt=' \tilde H= H/A^\gamma' title=' \tilde H= H/A^\gamma' class='latex' /></p>
</div>
<p>My solution is to maximize an &#8220;adjusted average edginess&#8221; metric that, instead of dividing total edginess by the area, divides it by <em>some power</em> <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\gamma' title='\gamma' class='latex' /> of the area. The parameter <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\gamma' title='\gamma' class='latex' /> can be tuned by trial and error to get the right amount of &#8220;breathing room&#8221; in a crop. If <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma%3D1&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\gamma=1' title='\gamma=1' class='latex' />, the adjusted average edginess simplifies to average edginess, and we favor small crops as we discussed above. If <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma%3D0&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\gamma=0' title='\gamma=0' class='latex' />, adjusted average edginess simplifies to total edginess and the biggest crop is selected. I liked the results from test crops with <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma%3D0.2&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\gamma=0.2' title='\gamma=0.2' class='latex' />, but for really small thumbnails (which require significant rescaling), the tighter crop given by a higher <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\gamma' title='\gamma' class='latex' /> (i.e. closer to 1) might be preferable.</p>
<p><a href="http://jueseph.com/wp-content/uploads/2010/06/f4-gamma.png"><img src="http://jueseph.com/wp-content/uploads/2010/06/f4-gamma-300x281.png" alt="" title="f4-gamma" width="300" height="281" class="alignright size-medium wp-image-1387" /></a></p>
<p class="caption"><strong>Figure 4. Cropping around the center-of-edginess yields &#8220;good&#8221; crops for most images.</strong> Compare to Fig. 2 above. Increasing <img src='http://s.wordpress.com/latex.php?latex=%5Cgamma&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\gamma' title='\gamma' class='latex' /> increases the tightness of the crop.</p>
<h3>Limitations</h3>
<p>Opticrop was written to be smarter than easily available alternatives, but because the strategy is relatively simple, it still makes the &#8220;wrong&#8221; crop on certain images. There are caveats to both the methods of choosing where to crop and how much to crop.</p>
<p>As to where to crop, choosing the center-of-edginess is best suited to single-subject images, and gives poor results on two-subject or multi-subject images. If a picture has 2 areas of interest, Opticrop will crop to the region between them, because the center-of-edginess is an average over the entire image and gives no information about local &#8220;pockets&#8221; of edginess. A solution, suggested by <a href="http://kleinschmidt.wordpress.com">Dave</a>, may be to find &#8220;local maxima of edginess&#8221;, or the modes of edginess, rather than a single average. I&#8217;m open to ideas on how to implement such an approach.</p>
<p>Another possibility is an &#8220;iterative search&#8221; that will start at the center-of-edginess and meander around, subject to certain constraints, until it settles on a region that is comparatively more &#8220;edgy&#8221; than where it started. This kind of algorithm tends to enlist some kind of recursion in refining the answer, which generally leads to a superior result without too much added computation. But the devil is in the details of implementation.</p>
<p>The decision of how large an area to crop (or how much &#8220;breathing room&#8221; to give the cropped subject, assuming there is one) could also be accomplished in a completely different way. The current version simply tries a number of different sizes and picks the best one. I&#8217;ve defined &#8220;best&#8221; as &#8220;highest <img src='http://s.wordpress.com/latex.php?latex=%5Ctilde%20H&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\tilde H' title='\tilde H' class='latex' />&#8220;, but using a different criterion may yield other desired crop properties. A refined search method might also yield better crops.</p>
<p>You can download the script, and see usage and implementation details, on <a href="http://jueseph.com/2010/06/opticrop-usage-and-implementation/">this post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/06/opticrop-content-aware-cropping-with-php-and-imagemagick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opticrop: Usage and Implementation</title>
		<link>http://jueseph.com/2010/06/opticrop-usage-and-implementation/</link>
		<comments>http://jueseph.com/2010/06/opticrop-usage-and-implementation/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 22:05:50 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[rambling]]></category>
		<category><![CDATA[cropping]]></category>
		<category><![CDATA[image processing]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1308</guid>
		<description><![CDATA[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 &#8220;interesting&#8221; part of the image to crop, so you won&#8217;t get a useless thumbnail just because the top-left corner of your (<a href="http://jueseph.com/2010/06/opticrop-usage-and-implementation/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p>Opticrop is a PHP script I wrote to crop a thumbnail of a specific width and height from a full-sized image. </p>
<p>Unlike most cropping routines out there, Opticrop uses edge-detection to find the most &#8220;interesting&#8221; part of the image to crop, so you won&#8217;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 <a href="http://jueseph.com/2010/06/opticrop-content-aware-cropping-with-php-and-imagemagick/">methods behind the script</a>. Also check out the <a href="/scripts/opticrop/interface.php">live demo of Opticrop</a>, with a slick jQuery interface.<span id="more-1308"></span></p>
<h3>Usage</h3>
<p>To use the Opticrop image-cropping script, download <a href="http://jueseph.com/scripts/source/opticrop/opticrop.php">opticrop.php</a> and save it into its own folder on your webserver. You&#8217;ll need ImageMagick and the Imagick PHP extension installed. If all goes well, calling the script by its URL with the following arguments should give you an image in response.</p>
<ul>
<li><strong>src</strong> &#8211; The path to the image to be cropped. This must be on the same machine as the script, but you can provide its path in URL form, as a relative path to the directory the script is in, or as an absolute path on the webserver&#8217;s document root (i.e. preceded by a /)</li>
<li><strong>w</strong> &#8211; The width of the thumbnail you want, in pixels.</li>
<li><strong>h</strong> &#8211; The height of the thumbnail you want, in pixels.</li>
<li><strong>gamma</strong> (optional) &#8211; A number between 0 and 1, for tuning the &#8220;tightness&#8221; of the crop. Default is 0.2. See <a href="http://jueseph.com/2010/06/opticrop-content-aware-cropping-with-php-and-imagemagick/">discussion</a>.</li>
<li><strong>format</strong> (optional) &#8211; Either <code>img</code> (default) or <code>json</code>. If set to <code>json</code>, script will return a JSON-encoded object containing the height, width, and x and y coordinates of the top-left corner of the optimal crop region in the full-sized image.</li>
<li><strong>cache</strong> (optional) &#8211; Either <code>yes</code> (default), <code>no</code>, or <code>refresh</code>. Set to <code>no</code> to disable caching temporarily for current request, and <code>refresh</code> to update the cached image for the given set of parameters.
<li><strong>debug</strong> (optional) &#8211; Either 0 (default) or 1. If set to 1, returns a page with debugging info rather than an image.</li>
</ul>
<p>For example, to run my copy of the script on a test image on my server, go to:</p>
<pre class="brush: plain;">http://jueseph.com/scripts/opticrop/opticrop.php?src=test3.jpg&amp;w=100&amp;h=100&amp;debug=1&amp;cache=no</pre>
<p>This will display some debug output, and the result image (a 100&#215;100 thumbnail) at the very end. Remove the <code>debug=1</code> from the URL to get just the result image.</p>
<h3>Implementation</h3>
<p>Explanation of script to come. Until then, you can see the <a href="http://jueseph.com/scripts/source/opticrop/opticrop.php">source here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/06/opticrop-usage-and-implementation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Steamed fish</title>
		<link>http://jueseph.com/2010/06/steamed-fish/</link>
		<comments>http://jueseph.com/2010/06/steamed-fish/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 23:10:43 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[Food]]></category>
		<category><![CDATA[cooking]]></category>
		<category><![CDATA[fish]]></category>
		<category><![CDATA[recipe]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1288</guid>
		<description><![CDATA[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 (<a href="http://jueseph.com/2010/06/steamed-fish/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cremeglace/4704766210/" title="Steamed fish by cremeglace, on Flickr"><img src="http://farm5.static.flickr.com/4069/4704766210_a1507f6898.jpg" width="500" height="375" alt="Steamed fish" class="alignnone"/></a></p>
<p>Get a whole fish, cleaned of guts and scales. A 1ft <strong>rainbow trout</strong> is good. Cut slits into it every inch or so along both sides, and place into a shallow bowl. Finely chop about 2 tbsp<strong> scallions</strong> and 1 tbsp <strong>ginger</strong>, and sprinkle this under, over, and inside the fish. Drizzle <strong>soy sauce</strong> 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.</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/06/steamed-fish/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Spicy Egg Drop Soup With Tomato and Tofu</title>
		<link>http://jueseph.com/2010/06/spicy-egg-drop-soup-with-tomato-and-tofu/</link>
		<comments>http://jueseph.com/2010/06/spicy-egg-drop-soup-with-tomato-and-tofu/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 03:32:47 +0000</pubDate>
		<dc:creator>Wang</dc:creator>
				<category><![CDATA[Food]]></category>
		<category><![CDATA[rambling]]></category>
		<category><![CDATA[chinese]]></category>
		<category><![CDATA[cooking]]></category>
		<category><![CDATA[recipes]]></category>
		<category><![CDATA[shaanxi]]></category>

		<guid isPermaLink="false">http://jueseph.com/?p=1248</guid>
		<description><![CDATA[After a bout of reminiscing about the homeland tonight, I decided to make a soup I recently learned from my mom. Here&#8217;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 (<a href="http://jueseph.com/2010/06/spicy-egg-drop-soup-with-tomato-and-tofu/">More...</a>)]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cremeglace/4683715333/" title="Spicy tomato egg drop soup by cremeglace, on Flickr"><img src="http://farm2.static.flickr.com/1285/4683715333_9b79321ab7.jpg" width="500" height="375" alt="Spicy tomato egg drop soup" class="alignnone" /></a></p>
<p>After a bout of <a href="http://jueseph.com/2010/06/eating-in-shaanxi/">reminiscing about the homeland</a> tonight, I decided to make a soup I recently learned from my mom. Here&#8217;s the recipe, along with a recipe for an accoutrement, garlic cucumber salad, and an important condiment, chili oil.</p>
<p>This recipe, which makes roughly 2 servings, is a variation on the classic Chinese <a href="http://en.wikipedia.org/wiki/Egg_drop_soup">egg drop soup</a>. 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.</p>
<p>The key to this recipe is the combination of traditional Chinese ingredients, so it&#8217;s to your benefit to get ahold of as many of these as you can. In a pinch, though, it&#8217;s possible to do this soup with a few Western substitutions. Some ingredients are more crucial than others, and I&#8217;ll point out the essential ones below.<span id="more-1248"></span></p>
<h3>Chili Oil</h3>
<p>This is an essential ingredient in a lot of Northern Chinese dishes, and is easy enough to approximate that you should never go without it. To make a batch that will last many servings, heat a 3-4 tablespoons of <strong>vegetable oil</strong> (canola, corn, or peanut) in a pan on high heat until it starts rippling and smoking a bit*. Then, pour the oil over a tablespoon of <strong>ground cayenne pepper</strong> in a heat-proof container&#8211;a ceramic bowl suffices, but a jar with a lid will store indefinitely. Let the oil cool, and you&#8217;re good to go.</p>
<p>The chili powder will settle to the bottom of the container, and you can serve the oil on top as a spicy condiment in stir-fries, soups, and other Asian dishes. You can also stir up the mixture before serving for an added kick and paste-like texture.</p>
<p>It might take more than one try to get the oil to the right temperature. You can tell when you&#8217;ve made a perfect chili oil when you smell a meaty, toasty-but-not-burned chili aroma the instant the oil hits the cayenne powder&#8211;it&#8217;s actually pretty amazing, and not at all what you expect a spicy sauce to smell like. </p>
<p>The flavor of the oil depends on the type and quantity of chili used&#8211;this can be made with chili flakes, which gives a slightly different texture and a little less kick than cayenne powder due to the decreased surface area. The authentic version, which boasts the most flavor, is made with coarsely ground chilies from China (see rambling account in <a href="http://jueseph.com/2010/06/eating-in-shaanxi/">previous post</a>), but in most cases store-bought chilies are good enough.</p>
<div class="footnote">*but NOT so much that the oil catches on fire. I almost burned down my house (and ruined part of my kitchen) once when this happened. Don&#8217;t worry&#8211;you really have to leave oil unattended on the burner for 10 or more minutes before there&#8217;s even the danger of fire. Usually 2-3 minutes is enough to get the oil hot enough for chili oil preparation.</div>
<h3>Egg Drop Soup With Tomatoes</h3>
<p>To make the actual soup, start by boiling half a medium-sized pot of lightly salted water. Drop in <strong>2 large tomatoes</strong>  when the water reaches boiling, and turn off the heat (on an electric stove, take the pot off the heat). Leave for 5 minutes, take out the tomatoes, and peel off the skin (this should be easy after the blanching). Cut into small wedges.</p>
<p>Over medium-high heat, add 2 tbsp of <strong>vegetable oil</strong> and 1 tsp of <strong>sesame oil</strong> to the same pot (after dumping out all the water), and drop in the tomato wedges when oil is hot. Stir and cook until tomatoes start to wither into a soupy mess, and pour in 2-3 cups water and reduce to low heat. Throw in a handful or two of 1/2-inch cubed <strong>tofu</strong> (firm or extra firm) and cook for 15-20 minutes. <strong>Salt and pepper</strong> to taste, and drizzle in some <strong>black rice vinegar</strong> to taste.</p>
<p>When the tofu is tender and the soup has taken on a uniform light-red color from the tomatoes, do the egg drop. This is a fun procedure where you crack an egg, slowly let the contents ooze out of the shell into the pot of hot soup with one hand, while stirring the soup with the other hand. The result should be wispy tendrils of egg in your soup and an added savory boost to the flavor. Practice a little to see what consistency of egg you can achieve&#8211;traditionally, you should drop the egg in very gradually while stirring quickly in a circular motion, but even if you just drop an entire egg in with minimal stirring, you&#8217;ll end up with a poached egg, which is delicious in its own right.</p>
<p>At the end, take the soup off the heat and drop in a handful of chopped <strong>scallions</strong>. Mix them in, and ladle into bowls. Drizzle on some chili oil before eating (but go easy&#8211;if you made it right, the stuff is strong!) </p>
<p><strong>Note on ingredients</strong>: The variations on this recipe, as with any traditional dish, are practically endless. You can throw in some <strong>dried shrimp bits</strong>, obtainable from an Asian grocer, for added zest. Add a pinch of <strong>MSG</strong> for even more zest (Asian circulatory systems seem to handle this better than Western ones&#8211;keep this in mind if you&#8217;re entertaining). Substitute a can of tomatoes for a more robust soup, but stick with fresh tomatoes for a lighter, more summery taste. Sesame oil is an important flavoring, but you can omit it if you don&#8217;t have any. The only ingredients I don&#8217;t recommend messing with are the black rice vinegar and chili oil, but since the vinegar might be hard to come by, you can substitute with <strong>balsamic vinegar</strong>. Be prepared for a much wimpier soup, though.</p>
<h3>Cucumber Garlic Salad</h3>
<p><a href="http://www.flickr.com/photos/cremeglace/4683715277/" title="Finely-chopped cucumber by cremeglace, on Flickr"><img src="http://farm5.static.flickr.com/4033/4683715277_9a246457cd_m.jpg" width="240" height="182" alt="Finely-chopped cucumber" class="alignright"/></a>Another classic Shaanxi dish is a simple salad made of cucumber and garlic. The key here, as in all Northern Chinese food, is in the vinegar (black rice, see discussion in <a href="http://jueseph.com/2010/06/eating-in-shaanxi/">previous post</a>), chili oil, and garlic. The salad is also surprisingly sensitive to how you chop the cucumber&#8211;ideally you want very thin strips, almost a julienne, to soak up the flavors in the dressing.</p>
<p>Start by pseudo-julienning some <strong>cucumber</strong> (as seen in the picture). Put into a bowl, and top with finely chopped <strong>garlic</strong> (2 medium cloves for each cucumber), <strong>salt</strong>, <strong>sesame seeds</strong>, <strong>black rice vinegar</strong> (or balsamic&#8211;again, only if you have to), and <strong>chili oil</strong>. Toss well, and let sit in fridge for 10-15 minutes to chill and incorporate flavors.</p>
<p>Serve straight, or mix in some cold, cooked <strong>Soba noodles</strong> or <strong>mung bean sprouts</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jueseph.com/2010/06/spicy-egg-drop-soup-with-tomato-and-tofu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
