<?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>ITPindia &#187; homework</title>
	<atom:link href="http://itp.nyu.edu/~ia303/thunk/category/homework/feed/" rel="self" type="application/rss+xml" />
	<link>http://itp.nyu.edu/~ia303/thunk</link>
	<description>India’s ITP blog</description>
	<lastBuildDate>Fri, 10 Apr 2009 06:20:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pictures vs. words</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/04/10/pictures-vs-words/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/04/10/pictures-vs-words/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 06:10:25 +0000</pubDate>
		<dc:creator>India</dc:creator>
				<category><![CDATA[1', 2', 10']]></category>
		<category><![CDATA[homework]]></category>
		<category><![CDATA[midterm]]></category>
		<category><![CDATA[presentations]]></category>
		<category><![CDATA[stuffstash]]></category>
		<category><![CDATA[wearables]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=586</guid>
		<description><![CDATA[
Remember how on March 5th I was supposed to give a presentation in 1&#8242;, 2&#8242;, 10&#8242;, but it got bumped? And then the following week&#8217;s class was canceled, and then we had spring break. So it wasn&#8217;t until three weeks later, March 26, that I finally got to take my turn squirming at the front [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/gw1/2355855208/"><img src="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/word_picture-400x257.jpg" alt="A word is also a picture of a word" title="A word is also a picture of a word" width="400" height="257" class="alignnone size-medium wp-image-593" /></a></p>
<p>Remember how on March 5th I was supposed to <a href="http://itp.nyu.edu/~ia303/thunk/2009/03/05/stuffstash-slides/">give a presentation in 1&#8242;, 2&#8242;, 10&#8242;</a>, but it got bumped? And then the following week&#8217;s class was canceled, and then we had spring break. So it wasn&#8217;t until three weeks later, March 26, that I finally got to take my turn squirming at the front of the room. Three extra weeks! So, naturally, I used all that time working on my project, right?</p>
<p>Oh, no, that wouldn&#8217;t have been fair. I did revise my slides, but I left it until the last fucking minute, as usual, so as not to have an undue advantage over my classmates. Right. That&#8217;s totally why.</p>
<p>What I did do in the interim, however, was stumble across this fab <a href="http://www.oreillynet.com/pub/e/1095" title="You are a Natural Born (Visual) Storyteller">webcast by Nancy Duarte</a> about how to give better presentations:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/BF93HJsGhRQ&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/BF93HJsGhRQ&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>After hearing her talk, I bought and started reading her book, <cite><a rel="nofollow" href="http://www.amazon.com/gp/product/0596522347?ie=UTF8&#038;tag=indink-20&#038;link_code=as3&#038;camp=211189&#038;creative=373489&#038;creativeASIN=0596522347indink-20" >Slide:ology</a></cite>, which is a more detailed presentation of the same suggestions.</p>
<p>(Here&#8217;s another Nancy Duarte webcast, which I haven&#8217;t watched yet: <a href="http://vizthink.com/blog/2008/06/18/webinar-creating-powerful-presentations-with-nancy-duarte/">Creating Powerful Presentations</a>.)</p>
<p>So between that and taking copious notes on my classmates&#8217; midterm presentations, especially in Wearables, I got a lot of ideas about how I should redo my slides, as well as my overall presentation style. The result is <a href="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/stuffstash2sm.pdf">a deck that does not make any sense unless I&#8217;m standing there with a remote, explaining it to you</a> (PDF, 1.1 MB)&#8212;and using a remote is, I decided after watching a lot of in-class presentations, a good thing to do. I got my Mac remote to turn pages in Acrobat using a program called <a href="http://filewell.com/iRedLite/">iRed Lite</a>. I can&#8217;t really recommend it, since it stumped me for quite a while the first time I used it, and the next time I tried, a few weeks later, I positively could not figure out how I had ever made it work in the first place. There&#8217;s something about the UI that confuses the hell out of me. But it can, theoretically, do the job, and it&#8217;s free.</p>
<p>Some other things I learned from watching classmates&#8217; presentations:</p>
<ul>
<li>Proofread, proofread, proofread.</li>
<li>Stand while you present, even if you don&#8217;t have a remote. Think of someone you know who&#8217;s poised and relaxed speaking in front of a group, and then try to channel that person for five minutes. Breathe between sentences. Make eye contact.</li>
<li>I really don&#8217;t care about the technical side of your project. Don&#8217;t tell me what hardware and libraries and so forth are used in it; describe it to me as though I were a normal human being who doesn&#8217;t have four Arduini in her apartment right now. Just because I have them doesn&#8217;t mean I know how to use them.</li>
<li>Those very corporate-looking system diagrams showing how information will flow through your application? They&#8217;re completely unintelligible. Skip them.</li>
<li>You don&#8217;t have to make all your graphics all slick, in Illustrator or Photoshop. Hand-drawn diagrams or sketches can be much more engaging.</li>
<li>As early as possible in the presentation, show me some kind of image of what your project will be&#8212;or, better yet, the prototype you&#8217;re working on&#8212;so that I can hold that in my mind as you go into all the background and process and detail. If I don&#8217;t know what your project is yet, I probably won&#8217;t find the rest of that information interesting. This was true even though I knew perfectly well what my classmates&#8217; projects were. When I watched their presentations, if they didn&#8217;t show and describe what they were making early on, I was unable to hold my attention on whatever else they were saying instead. Context.</li>
<li>Don&#8217;t put a lot of text on the screen. If you&#8217;re talking and there&#8217;s a whole paragraph on the screen behind you, my attention&#8217;s going to be split. And if it turns out that you&#8217;re just repeating what that paragraph says, almost word for word, I&#8217;ll feel exasperated. People should be listening to <em>you</em> for the words in your presentation, not reading them off the <em>slides</em>.</li>
<li>If you don&#8217;t have anything sexy to put on a slide for a given portion of your talk, it&#8217;s fine to
<ol>
<li>repeat a previous slide, or</li>
<li>show a slide that contains just one word representing that moment&#8217;s topic&#8212;&#8221;research,&#8221; for instance, or &#8220;inspiration.&#8221; Treat that text as a graphic element&#8212;make it big, pay attention to how it looks.
</li>
</ol>
</li>
<li>Typography!</li>
<li>If you have a relevant quotation to share, don&#8217;t bury it in a whole long paragraph; give it a slide by itself.</li>
<li>Don&#8217;t try to cover too much. It&#8217;s better to give people a thoughtful, measured thumbnail-presentation of the project and stop talking early enough that there&#8217;s time for people to ask questions about the parts that actually interest them than it is to brain-dump every piece of information you have, leaving time for only a few dazed comments from your audience at the end.</li>
<li>Videos of a thing working are helpful, but you have to explain what&#8217;s going on while it&#8217;s playing. This may be a good time to unload some of those boring technical details, while there&#8217;s a moving image to spice them up.</li>
<li>Proofread, proofread, proofread. If I had a dime for every typo I saw during midterm presentations . . . I offered my services as a proofreader in the <a href="http://www.webgrrls.com/">Webgrrls</a>-style need/give session we had in 1&#8242; 2&#8242; 10&#8242;, but nobody seemed to think they needed such a thing. They are wrong.</li>
<li>If you&#8217;re going to read some text that appears on a slide, do it slowly, with feeling; don&#8217;t just rush through it breathlessly, making it impossible for people to either read the text for themselves or follow what you&#8217;re saying. Make it clear that you&#8217;re reading what&#8217;s on the screen so people don&#8217;t have to struggle to figure it out. If you&#8217;re not able to introduce the text with something like &#8220;I&#8217;d just like to read you this quote, which really inspired me . . .&#8221; you probably shouldn&#8217;t be giving it a slide.</li>
</ul>
<p>So, here again are <a href="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/stuffstash2sm.pdf">the slides I ended up using</a>  (PDF, 1.1 MB) for my midterm presentation. I suppose some day maybe I&#8217;ll write captions more or less like what I said in front of the class, but in the meantime you can read <a href="http://itp.nyu.edu/~ia303/thunk/2009/03/05/stuffstash-slides/">the old slides</a> if you want to know the gist.</p>
<p><span style="font-size:smaller;color:#666;">Photo: <a href="http://www.flickr.com/photos/gw1/2355855208/">A WORD IS ALSO A PICTURE OF A WORD</a> by gwalton1; <a href="http://creativecommons.org/licenses/by-nc/2.0/deed.en">some rights reserved</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/04/10/pictures-vs-words/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Markov bookshelf</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/03/31/markov-bookshelf/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/03/31/markov-bookshelf/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 12:59:12 +0000</pubDate>
		<dc:creator>India</dc:creator>
				<category><![CDATA[A2Z]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[homework]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=573</guid>
		<description><![CDATA[Oh, well. We&#8217;re back to kill-me-now territory.
This week&#8217;s assignment was
Get some XML from a web service. Extract some interesting information from the XML and use it as input to one of your homework assignments from previous weeks.
You could do this either by piping the output of your XML parsing program to the input of your [...]]]></description>
			<content:encoded><![CDATA[<p>Oh, well. We&#8217;re back to kill-me-now territory.</p>
<p>This week&#8217;s assignment was</p>
<blockquote><p>Get some XML from a web service. Extract some interesting information from the XML and use it as input to one of your homework assignments from previous weeks.</p>
<p>You could do this either by piping the output of your XML parsing program to the input of your previously implemented program, or by using a class (e.g., instantiate and use the MarkovChain class).</p></blockquote>
<p>So I thought, cool, I&#8217;ll scramble the <cite>New York Times</cite> Best Seller titles using their <a href="http://developer.nytimes.com/docs/best_sellers_api/">shiny new API</a>. Okay, so, I got an API key and managed to pull in lists of titles using&#8212;</p>
<pre class="brush: java">import org.dom4j.Document;
import org.dom4j.io.SAXReader;
import org.dom4j.Element;
import java.util.List;

public class BestSeller
{
  public static void main(String[] args) throws Exception
  {

/*  Input should be one of the NY Times Best Seller list categories.
    Available categories:
    hardcover-fiction
    hardcover-nonfiction
    hardcover-advice
    paperback-nonfiction
    paperback-advice
    trade-fiction-paperback
    picture-books
    chapter-books
    paperback-books
    series-books
    mass-market-paperback
*/
    String listName = args[0];

    SAXReader reader = new SAXReader();
    EasyHTTPGet getter = new EasyHTTPGet(
      &quot;http://api.nytimes.com/svc/books/v2/lists/&quot; + listName + &quot;.xml?api-key=f25de92cf1d2615621b68d2d31f81b63:4:1703697&quot;
    );

    Document document = reader.read(getter.responseAsInputStream());
    List bookTitle = document.selectNodes(&quot;//results/book/book_details/book_detail/title&quot;);

//  If I wanted to scramble the authors, . . .
//  List bookAuthor =
//  document.selectNodes(&quot;//results/book/book_details/book_detail/author&quot;);

    for (Object o: bookTitle)
    {
      Element elem = (Element)o;
      String text = elem.getText();
      System.out.println(text);
    } // end for
  } // end main
} // end class</pre>
<p>I had tried to make an array of category names and then loop through them, but I got lost after the first bit&#8212;</p>
<pre class="brush: java">import org.dom4j.Document;
import org.dom4j.io.SAXReader;
import org.dom4j.Element;
import java.util.List;

public class BestSellerAll
{
  public static void main(String[] args) throws Exception
  {

/*  There are 11 categories of NY Times Best Seller lists. I want to download all of them, but the Times makes you download them individually.
*/

    String [] book_cats = new String [] {
    &quot;hardcover-fiction&quot;, &quot;hardcover-nonfiction&quot;, &quot;hardcover-advice&quot;, &quot;paperback-nonfiction&quot;, &quot;paperback-advice&quot;, &quot;trade-fiction-paperback&quot;, &quot;picture-books&quot;, &quot;chapter-books&quot;, &quot;paperback-books&quot;, &quot;series-books&quot;, &quot;mass-market-paperback&quot;};

//    String listName = args[0];

    SAXReader [] reader = new SAXReader() [];
    EasyHTTPGet [] getter = new EasyHTTPGet [];
    for (int i = 0; i &lt; 11; i++)
    {
        getter[i] = &quot;http://api.nytimes.com/svc/books/v2/lists/&quot; + book_cats[n] + &quot;.xml?api-key=f25de92cf1d2615621b68d2d31f81b63:4:1703697&quot;;
    } // end for i

// I got sadly confused somewhere in this block:
    Document [] document = new Document [];
    for (int j = 0; j &lt; 11; j++)
    {
        document[j] = reader.read(getter[j].responseAsInputStream());
        List bookTitle = document.selectNodes(&quot;//results/book/book_details/book_detail/title&quot;);
    } // end for j

//  If I wanted to scramble the authors, . . .
//  List bookAuthor =
//  document.selectNodes(&quot;//results/book/book_details/book_detail/author&quot;);

    for (Object o: bookTitle)
    {
      Element elem = (Element)o;
      String text = elem.getText();
      System.out.println(text);
    } // end for bookTitle
  } // end main
} // end class</pre>
<p>So, semimanually, then, I ran this on one category list at a time and used cat to agglomerate them. So then I had my list of all the current best sellers&#8217; titles:</p>
<blockquote><p>HANDLE WITH CARE<br />
CORSAIR<br />
THE ASSOCIATE<br />
THE HOST<br />
RUN FOR YOUR LIFE<br />
PROMISES IN DEATH<br />
DEAD SILENCE<br />
HEART AND SOUL<br />
ONE DAY AT A TIME<br />
NIGHT AND DAY<br />
THE GUERNSEY LITERARY AND POTATO PEEL PIE SOCIETY<br />
WHITE WITCH, BLACK CURSE<br />
PATHS OF GLORY<br />
TERMINAL FREEZE<br />
FOOL<br />
THE HELP<br />
DON&#8217;T LOOK TWICE<br />
FAULT LINE<br />
TRUE COLORS<br />
STORM FROM THE SHADOWS<br />
OUTLIERS<br />
HOUSE OF CARDS<br />
THE YANKEE YEARS<br />
OUT OF CAPTIVITY<br />
DEWEY<br />
THE LOST CITY OF Z<br />
A LION CALLED CHRISTIAN<br />
A BOLD FRESH PIECE OF HUMANITY<br />
MY BOOKY WOOK<br />
THE UNFORGIVING MINUTE<br />
INSIDE THE REVOLUTION<br />
MELTDOWN<br />
ARE YOU THERE, VODKA? IT’S ME, CHELSEA<br />
JESUS, INTERRUPTED<br />
JOKER ONE<br />
NO ANGEL<br />
LORDS OF FINANCE<br />
THE NEXT 100 YEARS<br />
MULTIPLE BLESSINGS<br />
PICKING COTTON<br />
ACT LIKE A LADY, THINK LIKE A MAN<br />
THE LAST LECTURE<br />
THE POWER OF SOUL<br />
THE SECRET<br />
THE ULTRAMIND SOLUTION<br />
FLAT BELLY DIET!<br />
THE GREAT DEPRESSION AHEAD<br />
PEAKS AND VALLEYS<br />
UNCOMMON<br />
THE SURVIVORS CLUB<br />
MAGNIFICENT MIND AT ANY AGE<br />
THE TOTAL MONEY MAKEOVER<br />
EMOTIONAL FREEDOM<br />
THE 4 DAY DIET<br />
FIGHT FOR YOUR MONEY<br />
THREE CUPS OF TEA<br />
THE MIDDLE PLACE<br />
I HOPE THEY SERVE BEER IN HELL<br />
DREAMS FROM MY FATHER<br />
THE TIPPING POINT<br />
EAT, PRAY, LOVE<br />
THE AUDACITY OF HOPE<br />
MY HORIZONTAL LIFE<br />
90 MINUTES IN HEAVEN<br />
TEAM OF RIVALS<br />
SAME KIND OF DIFFERENT AS ME<br />
BLINK<br />
MARLEY &#038; ME<br />
THE FORGOTTEN MAN<br />
THE OMNIVORE’S DILEMMA<br />
THE ZOOKEEPER’S WIFE<br />
BEAUTIFUL BOY<br />
A WHOLE NEW MIND<br />
ANIMAL, VEGETABLE, MIRACLE<br />
INFIDEL<br />
THE LOVE DARE<br />
WHAT TO EXPECT WHEN YOU’RE EXPECTING<br />
EMERGENCY<br />
SUZE ORMAN’S 2009 ACTION PLAN<br />
NATURALLY THIN<br />
TWILIGHT<br />
SKINNY BITCH<br />
THE FIVE LOVE LANGUAGES<br />
THE POWER OF NOW<br />
HAPPY FOR NO REASON<br />
THE PURPOSE-DRIVEN LIFE<br />
A NEW EARTH<br />
THE BIGGEST LOSER 30-DAY JUMP START<br />
HE’S JUST NOT THAT INTO YOU<br />
THE BIGGEST LOSER FAMILY COOKBOOK<br />
THE SHACK<br />
THE READER<br />
FIREFLY LANE<br />
AMERICAN WIFE<br />
SUNDAYS AT TIFFANY’S<br />
PEOPLE OF THE BOOK<br />
A THOUSAND SPLENDID SUNS<br />
TAKE ONE<br />
THE ALCHEMIST<br />
SARAH’S KEY<br />
THE MIRACLE AT SPEEDY MOTORS<br />
THE BRIEF WONDROUS LIFE OF OSCAR WAO<br />
REVOLUTIONARY ROAD<br />
WATER FOR ELEPHANTS<br />
THE WHITE TIGER<br />
STILL ALICE<br />
THE ELEGANCE OF THE HEDGEHOG<br />
LOVING FRANK<br />
THE KITE RUNNER<br />
LUSH LIFE<br />
THE HOUSE IN THE NIGHT<br />
THE COMPOSER IS DEAD<br />
BLUEBERRY GIRL<br />
LISTEN TO THE WIND: THE STORY OF DR. GREG AND &#8220;THREE CUPS OF TEA&#8221;<br />
LADYBUG GIRL AND BUMBLEBEE BOY<br />
GALLOP!<br />
CAT<br />
SWING!<br />
NAKED MOLE RAT GETS DRESSED<br />
ALL IN A DAY<br />
MILES TO GO<br />
THE GRAVEYARD BOOK<br />
THIRTEEN REASONS WHY<br />
SCAT<br />
THE HUNGER GAMES<br />
FADE<br />
THREE CUPS OF TEA<br />
3 WILLOWS<br />
SEEKERS: GREAT BEAR LAKE<br />
THE MYSTERIOUS BENEDICT SOCIETY AND THE PERILOUS JOURNEY<br />
EVERMORE<br />
THE BOY IN THE STRIPED PAJAMAS<br />
THE BOOK THIEF<br />
THREE CUPS OF TEA: YOUNG READERS EDITION<br />
TWEAK<br />
WICKED: WITCH AND CURSE<br />
CORALINE<br />
THE MYSTERIOUS BENEDICT SOCIETY<br />
THE TALE OF DESPEREAUX<br />
SLAM<br />
THE TWILIGHT SAGA<br />
HOUSE OF NIGHT<br />
DIARY OF A WIMPY KID<br />
THE 39 CLUES<br />
THE CLIQUE<br />
PERCY JACKSON &#038; THE OLYMPIANS<br />
HARRY POTTER<br />
NIGHT WORLD<br />
KISSED BY AN ANGEL<br />
INKHEART<br />
THE WHOLE TRUTH<br />
HOLD TIGHT<br />
BONES<br />
THE GRAND FINALE<br />
PLAGUE SHIP<br />
LOST SOULS<br />
MONTANA CREEDS: DYLAN<br />
DANGER IN A RED DRESS<br />
THE APPEAL<br />
THE MACKADE BROTHERS: RAFE AND JARED<br />
MAVERICK<br />
SMALL FAVOR<br />
ANGELS AND DEMONS<br />
THE READER<br />
SECRETS<br />
FIRST COMES MARRIAGE<br />
CHASING DARKNESS<br />
SHADOW COMMAND<br />
TEMPTATION RIDGE<br />
CONFESSIONS OF A SHOPAHOLIC</p></blockquote>
<p>And then, all I wanted to fucking do was run the Markov code from week 5 and make some crazy new titles. I had it working earlier in this process, when I was working with just the hardcover fiction list, and came up with these completely uninteresting results:</p>
<blockquote><p>TERMINAL FREEZE<br />
TERMINAL FREEZE<br />
TERMINAL FREEZE<br />
THE ASSOCIETY<br />
ONE DAY AT A TIME<br />
NIGHT AND SOUL<br />
ONE DAY AT A TIME<br />
FOOL<br />
STORM FROM THE HELP<br />
FOOL<br />
TERMINAL FREEZE<br />
CORSAIR<br />
ONE DAY AT A TIME<br />
TRUE COLORS<br />
FOOL<br />
ONE DAY AT A TIME</p></blockquote>
<p>Clearly, the set of words was too small to do anything really interesting with, which is when I decided to make one file of all the lists, to get more words. But then . . . I couldn&#8217;t get the Markov code to work anymore. Kept getting this stupid error:</p>
<blockquote><p><code>java.lang.StringIndexOutOfBoundsException: String index out of range: 4<br />
	at java.lang.String.substring(String.java:1765)<br />
	at Markov.feedLine(Markov.java:21)<br />
	at MarkovFilter.eachLine(MarkovFilter.java:12)<br />
	at com.decontextualize.a2z.TextFilter.internalRun(TextFilter.java:326)<br />
	at com.decontextualize.a2z.TextFilter.run(TextFilter.java:208)<br />
	at MarkovFilter.main(MarkovFilter.java:6)</code></p></blockquote>
<p>And it took me one million years to determine that this was because the code was choking on the colon in</p>
<blockquote><p>LISTEN TO THE WIND: THE STORY OF DR. GREG AND &#8220;THREE CUPS OF TEA&#8221;</p></blockquote>
<p>and then the quotation marks, and then something else, and then I still don&#8217;t know what. It will not work if I include any lines after &#8220;GALLOP.&#8221; So, with that frustrating exception noted, here, finally, are the new titles:</p>
<blockquote><p>I HOPE THE STORM FROM MY FATHERE, VODKA? IT’S ME, CHELSEA<br />
THE FIVE LANE<br />
MY HORIZONTAL LIFE OF DIFFERENT MIND THE LOVE DARE<br />
THE BRIEF WONDROUS LIFE OF THERE, VODKA? IT’S WIFE<br />
INSIDE THE REVOLUTION AHEAD<br />
THE 4 DAY JUMP START<br />
MAGNIFICENT AS ME, CHELSEA<br />
THE ELEGANCE OF SOUL<br />
THE ELEPHANTS<br />
THE UNFORGOTTEN TO THE YANKEE YEARS<br />
THE HEDGEHOG<br />
THE COLORS<br />
THE BOY<br />
PROMISES IN HEAVEN<br />
I HOPE THE TOTAL LIFE OF Z<br />
HE’S DILEMMA<br />
PROMISES IN THE TIPPING MIND SPLENDID SUNS<br />
THE ZOOKEEPER’S JUST NOT THAT TO EXPECT WHEN YOUR LIFE OF NOW<br />
TWILIGHT ANY AGE<br />
A THOUSE OF DIFFERENT MINUTES IN HEAVEN<br />
A BOLD FRESH PIECE OF OSCAR WAO<br />
THE KIND OF HUMANITY<br />
OUT OF GLORY<br />
SAME KITE TIGER<br />
FIGHT ANY AGE<br />
MAGNIFICENT MIND SOUL<br />
SAME KIND OF HUMANITY<br />
THE FIVE LANGUAGES<br />
THE MIDDLE WITH CARDS<br />
TERMINAL FRESH PIE SOCIATE<br />
90 MINUTES IN DEAD SILENCE<br />
HE’S 2009 ACTIONARY AND SOLUTIONAL FRESH PIECE OF DIFFERENT MIND SOUL<br />
NIGHT FOR ELEGANCE OF THERE, VODKA? IT’S WIFE<br />
STORM FROM THERE, VODKA? IT’S JUST NOT THAT INTO YOUR LIFE OF THE LOVE DAY JUMP START<br />
THE NIGHT ANY AGE</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/03/31/markov-bookshelf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparalator</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/03/24/comparalator/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/03/24/comparalator/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 10:48:43 +0000</pubDate>
		<dc:creator>India</dc:creator>
				<category><![CDATA[A2Z]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Mainstreaming Information]]></category>
		<category><![CDATA[final project]]></category>
		<category><![CDATA[homework]]></category>
		<category><![CDATA[midterm]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=560</guid>
		<description><![CDATA[
As you may recall, for my midterm project, I got stumped on several seemingly simple tasks. One of those&#8212;the most important, since upon it depends my semester-long assignment for Mainstreaming Information&#8212;was figuring out a way to compare one list of words to another and pull out the words that were unique to one of those [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/nypl/3109979241/"><img src="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/date_merchant.jpg" alt="date merchant" title="date merchant" width="383" height="348" class="alignnone size-full wp-image-562" /></a></p>
<p>As you may recall, for my midterm project, I got <a href="/2009/03/10/a2z-midterm-vocabu-lame/">stumped</a> on several seemingly simple tasks. One of those&#8212;the most important, since upon it depends my semester-long assignment for Mainstreaming Information&#8212;was figuring out a way to compare one list of words to another and pull out the words that were unique to one of those lists. In my head, I can see very easily how this would be done. Given my special way of haphazardly flailing through code, however, I just couldn&#8217;t get it to work.</p>
<p>Until today!</p>
<p>In fiddling with the <a href="http://www.decontextualize.com/teaching/a2z/bayesed-and-confused/">Bayesian comparison code</a> for this week&#8217;s homework, I finally pulled out a list of unique words. Of course, this is a completely perverse misuse of that code&#8212;like using a steamroller to kill a pillbug&#8212;but as long as it works, I don&#8217;t fucking care.</p>
<p>So, here&#8217;s what I did. In BayesClassifier.java, I replaced the last two <code>for</code> loops with the following:</p>
<pre class="brush: java">for (String word: uniqueWords)
    {
      for (BayesCategory bcat: categories)
      {
        double wordProb = bcat.relevance(word, categories);
        if (wordProb &lt; 1)
        {
        println(word);
        }
        else {}
      } // end for bcat
    } // end for word

    for (BayesCategory bcat: categories)
    {
      double score = bcat.score(uniqueWords, categoryWordTotal);
      println(&quot;---The following words were not found in &quot; + bcat.getName());
    } // end for bcat</pre>
<p>And in BayesCategory.java I replaced the percentage and relevance blocks with</p>
<pre class="brush: java"> public double percentage(String word)
  {
    if (count.containsKey(word))
    {
      return count.get(word);
    } // end if
    else
    {
      return 0.001;
    } // end else
  } // end percentage

  public double relevance(String word, ArrayList&lt;BayesCategory&gt; categories)
  {
    double percentageSum = 0;
    for (BayesCategory bcat: categories)
    {
      percentageSum += bcat.percentage(word);
    } // end for bcat
    return percentage(word);
  } // end relevance</pre>
<p>So now, if I run the command </p>
<blockquote><p><code>$ java BayesClassifier A2_unique.txt < B1_unique.txt | sort >results.txt</code></p></blockquote>
<p>I get a list of words that are in B1_unique.txt (<cite><a rel="nofollow" href="http://www.amazon.com/gp/product/0765313383?ie=UTF8&amp;tag=indink-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0765313383indink-20" >The Masada Scroll</a></cite> by Paul Block and Robert Vaughan, 2007) but not in A2_unique.txt (<cite><a href="http://books.google.com/books?id=ko0NAAAAYAAJ">Zuleika Dobson or, An Oxford Love Story</a></cite> by Max Beerbohm, 1911). For example,</p>
<blockquote><p>Akbar, Allah, Allahu, Apostolic, Ariminum, Arkadiane, Asmodeus, Astaroth, Barabbas, Beelzebub, Bellarmino, Blavatsky, Brandeis, Breviary, Byzantine, Caiaphas, Calpurnius, Catacombs, Charlemagne, Clambering, DNA, Diavolo, Franciscan, Freemasons, GPS, Gymnasium, Haddad, Hades, IDs, IRA, Jettisoning, Kathleen, Lefkovitz, MD, MRI, Masada, Masonic, Muhammad, Muhammadan, Nazarene, Nazareth, Olympics, Orthodoxy, Palatine, Palazzi, Palestine, Palestinian, Palestinians, Petrovna, Pleasant, Plenty, Plunge, Pocketing, Pontiff, Pontifical, Pontius, Praetorian, Prissy, Professors, Protestants, Rasulullaah, Ratsach, Revving, Rosicrucians, Satan, Scrolls, Seder, Shakespeare, Syracuse, Tacitus, Theosophical, Torah, Trastevere, Turkish, USB, Uzi, VAIO, VCR, Yeah, Yechida, Yeetgadal, Yiddish, adrenalin, agita, airliner, airport, ankh, awesome, bitch, bomb, bookstores, braked, breastplate, briefcase, broadsword, broiler, brotherhood, bulrushes, cellular, checkpoint, chuckling, chutzpah, combatant, computer, dashboard, database, departmental, desktop, divorce, dysentery, electricity, enabling, entrepreneurs, firearms, firestorm, fishtailed, flagon, forensics, goatskin, groggily, gunfire, gunman, gunshots, handbag, handball, handbrake, handgun, helicopter, helmets, highwaymen, hijinks, homeland, homeless, homespun, hometown, innkeeper, internship, journalist, kebob, kidnappers, kilometers, lab, laptop, lyre, mawkish, monitor, muezzin, nickname, nightfall, nonbeliever, northeaster, notebook, notepad, notepaper, numerology, paganism, password, pastries, phone, photo, photocopies, photocopy, photograph, photos, pig, pigeons, pistol, playback, police, quintessentially, recycles, redialed, roadblock, roadway, sandwich, screensaver, site, sites, submachine, superheating, synagogue, taped, taxi, terrorism, terrorist, terrorists, thousandfold, thrashing, toga, tortured, trigonometry, universe, unto, vegetables, vehicles, video, videotape, vinegar, violence, warehouses, waterfall, welfare, wholeheartedly, whoosh, whore, windshield, worker, workstation, worldwide, yardstick, yarmulkes, yeetkadash, zooming</p></blockquote>
<p>And if I run the comparison in the opposite direction, I come up with words such as</p>
<blockquote><p>Abernethy, Abiding, Abimelech, Abyssinian, Academically, Academy, Accidents, Achillem, Adam, Adieu, Admirably, Age, Agency, Agents, Alas, Albert, Alighting, America, Atlantic, Australia, Balliol, Baron, Baronet, Britannia, Broadway, Brobdingnagian, Colonials, Cossacks, Crimea, Devon, Dewlap, Duchess, Duke, Dukedom, Earl, Edwardian, Egyptians, Elizabethan, Englishmen, Englishwoman, Europe, Holbein, Ireland, Iscariot, Isis, Japanese, Kaiser, Liberals, London, Madrid, Meistersinger, Messrs, Monsieur, Napoleon, Novalis, Papist, Parnassus, President, Prince, Professor, Prussians, Romanoff, Segregate, Slavery, Socrates, Switzerland, Tzar, Victoria, Wagnerian, Waterloo, Whithersoever, Zeus, absinthes, acolyte, adventures, affrights, affront, afire, afoot, aforesaid, aggravated, album, analogy, anarchy, ankle, ape, aright, aristocracy, ataraxy, automatically, avalanche, avow, balustrade, bandboxes, bank, beastliest, beau, beauteous, billiards, biography, bodyguard, bosky, boyish, broadcast, bruited, bulldog, businesslike, bustle, calorific, casuistry, catkins, chaperons, chidden, cigarettes, clergyman, cloven, comet, compeers, coquetry, cricket, crinolines, custard, dandiacal, dapperest, decanter, devil, dialogue, diet, dipsomaniacal, disemboldened, disinfatuate, drunken, ebullitions, equipage, exigent, eyelashes, eyelids, farthingales, female, femininity, fishwife, fob, forefather, forerunners, freemasonry, furbelows, gallimaufry, goodlier, gooseberry, gorgeous, gypsy, haberdasher, halfpence, handicapped, handicraft, handiwork, handwriting, hearthrug, helpless, hip, hireling, honeymoon, housemaid, housework, hoyden, hussy, idiotic, impertinent, impudence, inasmuch, incognisant, insipid, insolence, insouciance, item, keyboard, landau, legerdemain, loathsome, luck, maid, maidens, manhood, manumission, matador, maunderers, model, mushroom, nasty, newspaper, noodle, nosegay, novel, oarsmen, omnisubjugant, ostler, otiose, parasol, pinafore, poetry, poltroonery, postprandially, prank, prestidigitators, propinquity, queer, romance, sackcloth, salad, sardonic, saucy, schoolmaster, seraglio, sex, skimpy, skirt, snuff, socialistic, streetsters, surcease, surcoat, swooned, teens, telegram, telegraphs, thistledown, thither, thou, threepenny, tomboyish, toys, tradesmen, treacle, ugly, uncouthly, unvexed, vassalage, waylay, welter, wigwam, witchery, withal, woe, woebegone, womanly, womenfolk, wonderfully, wonderingly, wretchedness, wrought, yacht, yesternight, zounds</p></blockquote>
<p>Exciting!</p>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/03/24/comparalator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cookalator</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/03/24/cookalator/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/03/24/cookalator/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 08:05:24 +0000</pubDate>
		<dc:creator>India</dc:creator>
				<category><![CDATA[A2Z]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[homework]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=555</guid>
		<description><![CDATA[
For our Context Free assignment, I chose to make a recipe generator. Mmm, don&#8217;t you want to cook this up right now?

Toss 1/3 cup thinly sliced baking soda and 1 quart egg yolks with a whisk until just blended.
Knead 5 cups cubed light corn syrup with a wooden spoon until golden brown.
In a cast iron [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/iamos/2355222338/" title="Five eggs by iamos, on Flickr"><img src="http://farm4.static.flickr.com/3061/2355222338_01e2aacf55.jpg" width="450" height="337" alt="Five eggs" /></a></p>
<p>For our <a href="http://www.decontextualize.com/teaching/a2z/context-free-as-in-speech/">Context Free</a> assignment, I chose to make a recipe generator. Mmm, don&#8217;t you want to cook this up right now?</p>
<ol>
<li>Toss 1/3 cup thinly sliced baking soda and 1 quart egg yolks with a whisk until just blended.</li>
<li>Knead 5 cups cubed light corn syrup with a wooden spoon until golden brown.</li>
<li>In a cast iron Dutch oven, pour 1/4 pinch egg yolks, 1/4 cup whole milk, and 2 pounds sifted egg.</li>
<li>Simmer 3 pounds light corn syrup with 1 cup thinly sliced brown sugar and 2 teaspoons sifted heavy cream.</li>
<li>In a small saucepan, boil 3 ounces thinly sliced egg, 4 cups peeled water, and 3/4 tablespoon water until incorporated.</li>
<li>Whisk together 1 pound ginger and 2 cups candied egg whites until golden brown.</li>
<li>Beat 2 quarts marzipan with a wooden spoon until the pieces are pea-sized.</li>
<li>Grate 1/2 teaspoon sifted unsweetened cocoa powder with 2 quarts baking powder and 3/4 ounce ginger.</li>
<li>Beat 5 pounds thinly sliced buttermilk, 5 quarts sifted whole milk, and 4 tablespoons thinly sliced egg with a wooden spoon until slightly warm.</li>
<li>In a large bowl, boil 5 cups candied kosher salt, 2 cups diced lemon zest, and 1/2 cup sifted buttermilk until incorporated.</li>
<li>In a shallow pan, simmer 5 tablespoons thinly sliced ginger until golden brown.</li>
<li>Beat 2/3 teaspoon brown sugar, 2 ounces diced egg yolks, and 3 teaspoons unsalted butter with 3 teaspoons light corn syrup, 1/2 tablespoon thoroughly washed lemon zest, and 3/4 quart peeled whole milk.</li>
<li>Brush 2 tablespoons grated kosher salt, 2/3 tablespoon sugar, and 4 pounds diced baking powder until it forms a thick syrup.</li>
</ol>
<p>Here&#8217;s the grammar I used:</p>
<pre class="brush: java"># procedures
S -&gt; In a V Action IP with a Utensil until When
S -&gt; In a V Action IP until When
S -&gt; In a V Action IP .
S -&gt; Action IP with IP .
S -&gt; Action IP with a Utensil until When
S -&gt; Action IP until When
IP -&gt; IN
IP -&gt; IN and IN
IP -&gt; IN , IN , and IN
IN -&gt; SQuantity SUnit Prep Ingredient
IN -&gt; SQuantity SUnit Ingredient
IN -&gt; PQuantity PUnit Prep Ingredient
IN -&gt; PQuantity PUnit Ingredient
V -&gt; Size Quality Vessel
V -&gt; Size Vessel
V -&gt; Quality Vessel
V -&gt; Vessel

# components
SQuantity -&gt; 1/4 | 1/2 | 1/3 | 3/4 | 2/3 | 1
PQuantity -&gt; 2 | 3 | 4 | 5
SUnit -&gt; pinch | teaspoon | tablespoon | ounce | cup | pound | quart
PUnit -&gt; pinches | teaspoons | tablespoons | ounces | cups | pounds | quarts
Ingredient -&gt; all-purpose flour | water | egg whites | egg yolks | heavy cream | whole milk | almond paste | marzipan | sugar | baking powder | baking soda | kosher salt | ginger | unsalted butter | egg | buttermilk | lemon zest | light corn syrup | bittersweet chocolate | unsweetened cocoa powder | brown sugar
Prep -&gt; grated | cubed | chilled | sifted | diced | candied | thoroughly washed | peeled | thinly sliced | melted
Vessel -&gt; bowl, | saucepan, | pot, | Dutch oven, | pan, | ramekin, | skillet,
Quality -&gt; separate | airtight | cast iron | heatproof | nonstick | heavy-bottomed | shallow | buttered
Size -&gt; large | small | medium
Action -&gt; combine | whisk together | knead | brush | sprinkle | pour | stir | beat | boil | simmer | saute | brown | grate | mash | toss | blend
Utensil -&gt; wooden spoon | whisk
When -&gt; combined. | the pieces are pea-sized. | incorporated. | just blended. | it forms a thick syrup. | translucent. | golden brown. | slightly warm. | completely cooled.</pre>
<p>Yummers!</p>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/03/24/cookalator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Kill me now.</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/02/24/kill-me-now/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/02/24/kill-me-now/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 12:30:47 +0000</pubDate>
		<dc:creator>India</dc:creator>
				<category><![CDATA[A2Z]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[homework]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=534</guid>
		<description><![CDATA[
Oh, honestly.
For once I actually set out to be a slacker on the homework. The assignment began,
Modify, augment, or replace one of the in-class examples. A few ideas, in order of increasing complexity:

Make Unique.java insensitive to case (i.e., “Foo” and “foo” should not count as different words).
Modify WordCount.java to count something other than just words [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/blah_oh_well/1507400172/"><img src="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/stabby_mcknife.jpg" alt="Stabby McKnife" title="Stabby McKnife" width="460" height="251" class="alignnone size-full wp-image-535" /></a></p>
<p>Oh, honestly.</p>
<p>For once I actually set out to be a slacker on the homework. The assignment began,</p>
<blockquote><p>Modify, augment, or replace one of the in-class examples. A few ideas, in order of increasing complexity:</p>
<ul>
<li>Make Unique.java insensitive to case (i.e., “Foo” and “foo” should not count as different words).</li>
<li>Modify WordCount.java to count something other than just words (e.g., particular characters, bigrams, co-occurrences of words, etc.). . . .</li>
</ul>
</blockquote>
<p>So I thought, &#8220;Today I feel like doing the easy thing. I&#8217;ll just take that first option.&#8221;</p>
<p>Yeah, right. Many hours later, after trying several extremely complicated methods of doing this really fucking simple thing, I finally found the rat-simple method that I&#8217;d been looking for all along and had all but given up hope of. Goddamnit.</p>
<p>The original code was this:</p>
<pre class="brush: java">import java.util.HashSet;
import com.decontextualize.a2z.TextFilter;

public class Unique extends TextFilter {
  public static void main(String[] args) {
    new Unique().run();
  }

  private HashSet&lt;String&gt; uniqueWords = new HashSet&lt;String&gt;();

  public void eachLine(String line) {
    String[] tokens = line.split(&quot;\\W+&quot;);
    for (String t: tokens) {
      uniqueWords.add(t);
    }
  }

  public void end() {
    for (String word: uniqueWords) {
      println(word);
    }
  }
}</pre>
<p>and what I came up with after way too much beating my head against the desk is this:</p>
<pre class="brush: java">import java.util.HashSet;
import java.util.regex.*;
import com.decontextualize.a2z.TextFilter;

public class UniqueCI extends TextFilter
{
  public static void main(String[] args)
  {
    new UniqueCI().run();
  } // end main

  private HashSet&lt;String&gt; uniqueWords = new HashSet&lt;String&gt;();
  private HashSet&lt;String&gt; lowercaseWords = new HashSet&lt;String&gt;();

  public void eachLine(String line)
  {
    String[] tokens = line.split(&quot;\\W+&quot;);
    for (String t: tokens)
    {
    	// If hashset that&#039;s all lowercased contains t all lowercased, then don&#039;t add anything.

		String tLower = t.toLowerCase();

		if (lowercaseWords != null &amp;&amp; lowercaseWords.contains(tLower))
		{
		} // end if
		else if (lowercaseWords != null)
		{
			uniqueWords.add(t);
			lowercaseWords.add(tLower);
 		} // end else
    } // end for
  } // end eachLine

  public void end()
  {
    for (String word: uniqueWords) {
      println(word);
    } // end for
  } // end end
} // end class UniqueCI</pre>
<p>If you put this in,</p>
<blockquote><p>It is a truth universally acknowledged, that a single man in possession of a large fortune must be in want of a wife.<br />
It Is A Truth Universally Acknowledged, That A Single Man In Possession Of A Large Fortune Must Be In Want Of A Wife.</p></blockquote>
<p>you get this out:</p>
<blockquote><pre>of
possession
wife
truth
be
large
It
fortune
universally
single
that
acknowledged
man
a
must
want
is
in</pre>
</blockquote>
<p>Big whoop. I wish I could say I learned a lot from this, but I think all I learned is that I&#8217;m much more lost than I thought I was.</p>
<p><span style="color:gray; font-size:smaller">Photo: <a href="http://www.flickr.com/photos/blah_oh_well/1507400172/">The Downward Knife</a> by Jill Greenseth; <a href="http://creativecommons.org/licenses/by-nc/2.0/deed.en">some rights reserved</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/02/24/kill-me-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>“Have you seen my wig around?”</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/02/13/jane-says/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/02/13/jane-says/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 12:21:14 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[A2Z]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[homework]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=507</guid>
		<description><![CDATA[
This week&#8217;s A2Z assignment was as follows:
Make a program that creatively transforms or performs analysis on a text using regular expressions. The program should take its input from the keyboard and send its to the screen (or redirect to/from a file). Your program might (a) filter lines from the input, based on whether they match [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow" href="http://www.amazon.com/gp/product/B000002LEE?ie=UTF8&#038;tag=indink-20&#038;linkCode=as2&#038;camp=211189&#038;creative=374929&#038;creativeASIN=B000002LEEindink-20" ><img src="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/janesays.jpg" alt="Jane Says" title="Jane Says" width="460" height="163" class="alignnone size-full wp-image-512" /></a></p>
<p>This week&#8217;s A2Z assignment was as follows:</p>
<blockquote><p>Make a program that creatively transforms or performs analysis on a text using regular expressions. The program should take its input from the keyboard and send its to the screen (or redirect to/from a file). Your program might (a) filter lines from the input, based on whether they match a pattern; (b) match and display certain portions of each line; (c) replace certain portions of each line with new text; or (d) any combination of the above.</p>
<p>Sample ideas: Replace all words in a text of a certain length with a random word; find telephone numbers or e-mail addresses in a text; locate words within a word list that will have a certain score in Scrabble; etc.</p>
<p>Bonus challenge 1: Use one or more features of regular expression syntax that we didn’t discuss in class. Reference here.</p>
<p>Bonus challenge 2: Use one or more features of the Pattern or Matcher class that we didn’t discuss in class. Of particular interest: regex flags (CASE_INSENSITIVE, MULTILINE), “back references” in replaceAll. Matcher class reference here.
</p></blockquote>
<p>So, what I made is a program that tries to find the proper names in the input text (my preferred input being the first scene of <cite>Pride and Prejudice</cite>) and replace them with names of people in our class. For my purposes, a proper name is any capitalized word that (a) follows an honorific, such as Mr., Mrs., Sir, Lady, or Miss, <em>or</em> (b) does not immediately follow a carriage return or chunk of terminal punctuation (i.e., a period, exclamation point, or question mark, with or without a closing quotation mark thereafter), and (c) is neither a day of the week, a month of the year, nor the name of a holiday (though the only holiday it&#8217;s really looking for is Michaelmas, as that&#8217;s what appears in my P&#038;P extract).</p>
<p>I tried for hours to do this in a compact way, by looking for the <em>absence</em> of certain words or characters (terminal punctuation, honorifics, days of the week, holidays) combined with the <em>presence</em> of other patterns, but it just would not fly. So the result requires a lot of intermediate steps, to avoid changing words that have been identified as not likely to be names. In a vain attempt to make testing my regular expressions quicker, I worked them out in BBEdit first, using the grep option in the search and replace panel. Saved me from having to recompile the thing fifty thousand times. And the expressions <em>worked</em> in BBEdit, for the most part. They do <em>not</em> work so well translated into Java, unfortunately&#8212;the success rate at finding names is much lower, and after ten straight hours, I just didn&#8217;t have the patience to troubleshoot it any more. But these glitches just make the results more funny, which is, of course, the point.</p>
<p>So, here is the code:</p>
<pre class="brush: java">import java.util.regex.*;
import com.decontextualize.a2z.TextFilter;

public class RegexNames extends TextFilter
{
  public static void main(String[] args)
  {
    new RegexNames().run();
  } // end main(String[] args)

  private String search1  = &quot;(Mr\\.|Mrs\\.|Lord|Lady|Sir) ([A-Z]\\w+)&quot;;
  private String replace1 = &quot;##NAME##&quot;;

  private String search2  = &quot;(\\.” |\\?” |!” |\\. |\\? |! |\\r|\\r“)([A-Z]\\w+)&quot;;

  private String search3  = &quot;( |“|\\r)(Mr\\.|Mrs\\.|Lord|Lady|Sir|Miss|Monday|Tuesday|Wednesday|Friday|Saturday|Sunday|January|February|March|April|May|June|July|August|September|October|November|December|Michaelmas)&quot;;

  private String search4  = &quot;( |“)([A-Z][a-z]+)&quot;;

  private String [] class_names = new String [] {
    &quot;Adam&quot;, &quot;Alejandro&quot;, &quot;Andrew&quot;, &quot;Bryan&quot;, &quot;Caroline&quot;, &quot;Dimitris&quot;, &quot;Jonathan&quot;, &quot;Joseph&quot;, &quot;Martin&quot;, &quot;Michael&quot;, &quot;Ozge&quot;, &quot;Sanjay&quot;, &quot;Steven&quot;       };
  public void begin()
  {
    println(&quot;* * *&quot;);
  }

  public void eachLine(String line)
  {
    String line_new;

    Pattern p1 = Pattern.compile(search1);
    Matcher m1 = p1.matcher(line);
    if (m1.find())
    {
      line = line.replaceAll(m1.group(2), replace1);
    }

    line_new = line;

    Pattern p2 = Pattern.compile(search2);
    Matcher m2 = p2.matcher(line_new);
    if (m2.find())
    {
      line_new = line_new.replaceAll(m2.group(2), &quot;##&quot; + m2.group(2) + &quot;##&quot;);
    }

    Pattern p3 = Pattern.compile(search3);
    Matcher m3 = p3.matcher(line_new);
    if (m3.find())
    {
      line_new = line_new.replaceAll(m3.group(2), &quot;##&quot; + m3.group(2) + &quot;##&quot;);
    }

    Pattern p4 = Pattern.compile(search4);
    Matcher m4 = p4.matcher(line_new);
    if (m4.find())
    {
      line_new = line_new.replaceAll(m4.group(2), &quot;##NAME##&quot;);
    }

    line_new = line_new.replace( &quot;##NAME##&quot;, class_names[(int)(Math.random() * 13)] );

    line_new = line_new.replace( &quot;##&quot;, &quot;&quot; );

    println(&quot;\t&quot; + line_new);
  } // end eachLine(String line)

  public void end()
  {
    println(&quot;* * *&quot;);
  }

} // end RegexNames extends TextFilter</pre>
<p>And here is the output (you can find the original text at <a href="http://www.gutenberg.org/catalog/world/readfile?fk_files=907737">Project Gutenberg</a>):</p>
<blockquote><p>* * *<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It is a truth universally acknowledged, that a single man in possession of a large fortune must be in want of a wife.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;However little known the feelings or views of such a man may be on his first entering a neighbourhood, this truth is so well fixed in the minds of the surrounding families, that he is considered the rightful property of someone or other of their daughters.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Adam dear Mr. Adam,” said his lady to him one day, “have you heard that Netherfield Park is let at last?”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mr. Bryan replied that he had not.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Steven it is, returned she; ”for Mrs. Steven has just been here, and she told me all about it.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mr. Michael made no answer.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Dimitris you not want to know who has taken it?” cried his wife impatiently.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“YOU want to tell me, and I have no objection to hearing it.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This was invitation enough.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Steven, my dear, you must know, Mrs. Steven says that Netherfield is taken by a young man of large fortune from the north of England; that he came down on Monday in a chaise and four to see the place, and was so much delighted with it, that he agreed with Mr. Morris immediately; that he is to take possession before Michaelmas, and some of his servants are to be in the house by the end of next week.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Joseph is his name?”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Adam.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Dimitris he married or single?”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Bryan! Single, my dear, to be sure! A single man of large fortune; four or five thousand a year. What a fine thing for our girls!”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“How so? How can it affect them?”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Bryan dear Mr. Bryan,” replied his wife, “how can you be so tiresome! You must know that I am thinking of his marrying one of them.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Ozge that his design in settling here?”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Caroline! Nonsense, how can you talk so! But it is very likely that he MAY fall in love with one of them, and therefore you must visit him as soon as he comes.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“I see no occasion for that. You and the girls may go, or you may send them by themselves, which perhaps will be still better, for as you are as handsome as any of them, Mr. Michael may like you the best of the party.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Michael dear, you flatter me. I certainly HAVE had my share of beauty, but I do not pretend to be anything extraordinary now. When a woman has five grown-up daughters, she ought to give over thinking of her own beauty.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Jonathan such cases, a woman has not often much beauty to think of.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Michael, my dear, you must indeed go and see Mr. Michael when he comes into the neighbourhood.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Steven is more than I engage for, I assure you.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Jonathan consider your daughters. Only think what an establishment it would be for one of them. Sir Jonathan and Lady Lucas are determined to go, merely on that account, for in general, you know, they visit no newcomers. Indeed you must go, for it will be impossible for US to visit him if you do not.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Sanjay are over-scrupulous, surely. I dare say Mr. Sanjay will be very glad to see you; and I will send a few lines by you to assure him of my hearty consent to his marrying whichever he chooses of the girls; though I must throw in a good word for my little Lizzy.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“I desire you will do no such thing. Lizzy is not a bit better than the others; and I am sure she is not half so handsome as Michael, nor half so good-humoured as Lydia. But you are always giving HER the preference.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Andrew have none of them much to recommend them,” replied he; “they are all silly and ignorant like other girls; but Lizzy has something more of quickness than her sisters.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Mr. Bryan, how CAN you abuse your own children in such a way? You take delight in vexing me. You have no compassion for my poor nerves.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“Caroline mistake me, my dear. I have a high respect for your nerves. They are my old friends. I have heard you mention them with consideration these last twenty years at least.”<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mr. Dimitris was so odd a mixture of quick parts, sarcastic humour, reserve, and caprice, that the experience of three-and- twenty years had been insufficient to make his wife understand his character. HER mind was less difficult to develop. Dimitris was a woman of mean understanding, little information, and uncertain temper. When she was discontented, she fancied herself nervous. The business of her life was to get her daughters married; its solace was visiting and news.<br />
* * *</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/02/13/jane-says/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Studio interface ideas</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/02/12/studio-interface/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/02/12/studio-interface/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 17:31:05 +0000</pubDate>
		<dc:creator>India</dc:creator>
				<category><![CDATA[1', 2', 10']]></category>
		<category><![CDATA[homework]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=497</guid>
		<description><![CDATA[
This week&#8217;s assignment for 1&#8242;, 2&#8242;, 10&#8242; was a longie, and it stumped the hell out of me and, apparently, a couple of other people:
Like I&#8217;ve said in class before, the game changer for the computer industry was Apple&#8217;s innovation of WIMP (windows, icons, menus, and pointing devices) &#8211; Apple&#8217;s interface became popular because it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/indiamos/sets/72157604607706471/"><img src="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/materials.jpg" alt="materials" title="materials" width="460" height="304" class="alignnone size-full wp-image-500" /></a></p>
<p>This week&#8217;s assignment for 1&#8242;, 2&#8242;, 10&#8242; was a longie, and it stumped the hell out of me and, apparently, a couple of other people:</p>
<blockquote><p>Like I&#8217;ve said in class before, the game changer for the computer industry was Apple&#8217;s innovation of WIMP (windows, icons, menus, and pointing devices) &#8211; Apple&#8217;s interface became popular because it was immediately intuitive and simple to use. People recognized a &#8216;desktop&#8217; as a, well, a &#8216;desktop&#8217;. Folders as folders. A trash can as a trash can. etc. This hasn&#8217;t changed in 25 years and there are currently discussions to see if it should. So, our homework is to explore, research and document 5 new User Interface experiences that we could apply to a computer, from the real world. Examples that exist today and are changing this model are the multi touch &#8217;stretch&#8217; for enlarging images, a play button for video, a trash can for trash etc.</p>
<p>We should think about new ways to say things in an online environment. How do you tell someone they are near the end of an article, in a non-digital setting you would could glance to the end, but digitally you have numbers like PAGE 1 of 5 etc. Is there a better way to make the show this? What about rethinking the desktop? Could it be multi-dimential? Maybe it becomes 3D? Maybe it becomes like the iPhone and it&#8217;s just icons of apps and only one thing can be open at a time&#8230; maybe not. The folder concept worked for small pieces of data, but now it&#8217;s not a great interface, the more data we create, the more folders we need and sub folders etc. What about a music player UI? Or a book interface? IMPORTANT: There are two things to think about here, there is the design / interface, and then there is the modality. An example is. The trashcan represents the Interface, but dropping trash into it represents the action.</p>
<p>Start to think about ways that we can make the exprience better than exists today. Please come with 5 examples of these and a brief description of how they would work. And try to push the boundaries. You can write them out as a description, you can sketch them out on your computer. You can use crayolas, pencils, markers or candle wax, but make sure you put effort into showing how it will work. And bring your research to discuss in class. </p></blockquote>
<p>I scribbled down a bunch of lists of real-life contexts that might supply metaphors for a computer interface—kitchen, farmhouse, library, city—all of which seemed ridiculous. What&#8217;s wrong with the desktop metaphor that we have? Besides, you know, the fact that I&#8217;ve never been much of a desk-user, and why are those things called &#8220;windows,&#8221; and what&#8217;s with &#8220;icons,&#8221; and so forth. If you were to make a user interface based on where and how I actually work, it would have to include elements such as &#8220;couch,&#8221; &#8220;pile,&#8221; &#8220;bookalanche,&#8221; and &#8220;crumbs,&#8221; and the <acronym title="operating system">OS</acronym> would have to be called something like &#8220;putter&#8221; or &#8220;noodle.&#8221; Probably not so useful to other people.</p>
<p>So, instead, I was thinking about what kind of interface might make more sense to <a href="http://emmaamos.com/">my mom</a>, who has been using computers for about twenty-five years and Macs for almost ten, and who does not understand what or where her &#8220;desktop&#8221; is, nor the difference between an application, a window, and the operating system itself. She&#8217;s an artist, so I thought a studio metaphor might make more sense. But also, inverting the nesting metaphor of the whole OS might help. That is, why does she have to know which application to use, and then open a file within that? Why can&#8217;t she just have stuff that she&#8217;s working on, and then use tools to modify it? So the &#8220;applications&#8221; become &#8220;tools,&#8221; and the &#8220;document&#8221; becomes a &#8220;work&#8221; made of materials and a process.</p>
<p>When you want to make a new work, you go to the materials shelf and choose a basic substance to start with—2D (e.g., paper, canvas) or 3D (a blob)? You drag it onto the easel, of which you can have more than one. Then you can select some properties of that material. Size? Color? How rigid or stretchy do you want it to be? How translucent? How smooth? Many of these would probably best be controlled using slider, though for something like texture, you&#8217;d probably want a swatch. </p>
<p>Choose a tool, such as a brush or roller, or type from a <a href="http://www.briarpress.org/typecase/about">California job case</a>; assign a color; and and start doing stuff to your material. To pick a color, you would have a palette and a mixing area, so that you could mix or dilute colors. The resulting mixtures could be added to a global palette or discarded. Use your 3D mouse to shape it. Pick another material off the shelf and attach it. Choose an (optional) adhesive (which could include staples, sewing)  and the attachment point or surface. How hard are they pressed together&#8212;like, does one dent the other? You can type on any surface of an object. You can drag one material against another to transfer properties such as color or texture. You can fold the material by marking a scoring line and dragging one side over the other. You can flip a piece of 2D material over and work on the back.</p>
<p>When you&#8217;re done with a work, you can stick it in a drawer. Each work would be stored as a recording of its process of construction. At any time, you could select an existing work from a drawer and use a slider to move back along a timeline, if you want to undo something. To repeat an operation, you could select a segment of the timeline, copy, and paste it to the same work or to any other work.</p>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/02/12/studio-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lies, damn lies, and statistics</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/02/09/lies-damn-lies-and-statistics/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/02/09/lies-damn-lies-and-statistics/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:53:25 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[A2Z]]></category>
		<category><![CDATA[Mainstreaming Information]]></category>
		<category><![CDATA[homework]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=479</guid>
		<description><![CDATA[
Today we presented ideas for our semester-long projects in Mainstreaming Information. The assignment, which apparently I was not the only person to be confused by, is over at Christian&#8217;s site (PDF, 36 KB).

Last week we had to bring in some &#8220;jaw-dropping statistics&#8221; to start considering working with, and because I&#8217;ve decided that I&#8217;ll get more [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/poster.pdf'><img style="border:1pt solid gray;" src="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/poster-400x600.png" alt="Mainstreaming Information project proposal poster" title="Mainstreaming Information project proposal poster" width="200" height="300" class="alignnone size-medium wp-image-480" /></a></p>
<p>Today we presented ideas for our semester-long projects in <a href="http://www.christianmarcschmidt.com/NYU2009/docu.html">Mainstreaming Information</a>. The assignment, which apparently I was not the only person to be confused by, is over at <a href=" http://www.christianmarcschmidt.com/NYU2009/components/090202_semester_project.pdf">Christian&#8217;s site (PDF, 36 KB)</a>.<br />
<span id="more-479"></span><br />
Last week we had to bring in some &#8220;jaw-dropping statistics&#8221; to start considering working with, and because I&#8217;ve decided that I&#8217;ll get more out of the rest of my time at ITP if I keep my schoolwork linked to&#8212;duh&#8212;stuff I&#8217;m actually interested in, I selected a couple of tidbits from Dan Poynter&#8217;s mass of <a href="http://BookStatistics.com/">book industry statistics</a>—</p>
<blockquote><p>1993–2003: The number of titles published increased 58% while fiction readers declines 14%,<br />
—Malcolm Jones in <cite>Newsweek</cite>. Sources: NEA and RR Bowker.</p>
<p>2004. 56.6% of adult Americans said they read at least one book, fiction or non-fiction, between August 2001 and August 2002 compared to 60.9% ten years prior.</p>
<p>2002. 57% of the US population read a book. See report.<br />
<a href="http://www.nea.gov/pub/readingatrisk.pdf">http://www.nea.gov/pub/readingatrisk.pdf</a></p>
<p>Most readers do not get past page 18 in a book they have purchased.</p></blockquote>
<p>—and John Kremer&#8217;s <a href="http://bookmarket.com/statistics6.htm">Recent Statistics Related to<br />
Book Publishing and Marketing</a>—</p>
<blockquote><p>In a survey of 4,000 adults in the United Kingdom, 55% said “they buy books for decoration, and have no intention of actually reading them.” (Teletext) This is another important reason why your books should be well-designed. They should look good on a buyer&#8217;s coffee table, bookshelf, bedside stand, etc.</p></blockquote>
<p>These served the purpose at hand, but they&#8217;re all just isolated data points. So over the weekend I spent several hours digging around for more information, but for none of these could I find enough reliable numbers to support a semester-long project. I was also looking for any compelling information about e-book sales versus print or audio books, and this morning I spent a while rummaging around on <a href="http://www.teleread.org/">TeleRead</a>. They had all sorts of statistics, none of which quite fit my needs, though but did give me a few more ideas about stuff I&#8217;d <em>like</em> to have statistics about. So around 11 a.m., with 3.5 hours left until class, I <a href="http://twitter.com/indiamos/statuses/1192187395">lazytweeted it</a>, as a last resort. And I immediately got a bunch of responses from my nice, nice friends! Erin pointed me to the completely bitchen <a href="http://labs.timesonline.co.uk/bookscraper/">Book Scraper</a>, from the London <cite>Times</cite>&#8217;s R&#038;D labs, and reminded me that the <cite>New York Times</cite> has an <a href="http://developer.nytimes.com/docs"><acronym title="Application programming interface">API</acronym> for its best-seller lists</a>.</p>
<p>In the end, I decided I&#8217;d better scale down from the macro to the micro view, so that I could use data I might actually <em>get</em>: vocabulary statistics scraped (using my mad new <a href="/category/a2z/">Programming from A to Z</a> skillz) from <a href="http://www.gutenberg.org/">Project Gutenberg</a> e-books, compared with those from recent <em>Times</em> best sellers. And then I went and found a Jaw-Dropping Statistic (which, not coincidentally, <a href="http://www.straightdope.com/columns/read/2724/does-the-average-american-student-have-less-vocabulary-today-than-in-days-gone-by">is bullshit</a>; favorite line in the Straight Dope article: &#8220;At times it&#8217;s been attributed to Gallup polls or even entomologists.&#8221;) that went with the data I was planning to gather. Kind of bass-ackwards, but the result is the poster-style project proposal above, which was deemed Not Entirely Stupid during the classroom critique, despite its having been printed way too large, in fifteen 8.5 &times; 11-inch tiles, and glue-sticked-together in class using the second-worst glue stick in the universe (the worst being the one I had brought from home, which, it turned out, had dried&nbsp;up).</p>
<p>Now, of course, I&#8217;m not even sure I can get files of contemporary best sellers to scrape, because of stupid !@%# <acronym title="digital rights management">DRM</acronym>, so I&#8217;m kind of hoping that the Data Fairy will come to my aid. But my project is at least <em>theoretically</em> possible. Developing&nbsp;.&nbsp;.&nbsp;.</p>
<p><em>Bonus: Find the typo in the poster!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/02/09/lies-damn-lies-and-statistics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simplicity</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/02/05/simplicity/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/02/05/simplicity/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 13:34:36 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[final project]]></category>
		<category><![CDATA[homework]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[wearables]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=470</guid>
		<description><![CDATA[
I&#8217;ve decided to go with the less impossible, more amusing of my two Wearables project ideas: The Party Dress.
Assignment: Project description
Write a description of your project (one page minimum) – describe what your prototype will look like, what it will do, and how it will be used. List your influences, goals, intended users, and provide [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/indiamos/3255625334/in/photostream/"><img src="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/pattern-envelope.jpg" alt="pattern envelope" title="pattern envelope" width="460" height="305" class="alignnone size-full wp-image-472" /></a></p>
<p>I&#8217;ve decided to go with the less impossible, more amusing of my two Wearables project ideas: The Party Dress.</p>
<blockquote><p><b>Assignment: Project description</b></p>
<p>Write a description of your project (one page minimum) – describe what your prototype will look like, what it will do, and how it will be used. List your influences, goals, intended users, and provide a use scenario.<span id="more-470"></span> If you haven&#8217;t decided on one project, write a full description for each project you are considering.</p></blockquote>
<p>Here&#8217;s my silly write-up:</p>
<h3>Concept</h3>
<p>My proposed project for Wearables Studio is a Party Dress: a dress equipped with sensors and indicators that will encourage people to socialize with the wearer at parties, conferences, or other events where there may be a lot of people who don’t know each other but might wish to strike up a conversation. At its most basic, the dress will respond to proximity, encouraging people to approach the wearer and providing an easy ice-breaking topic. It will also, technology permitting, include a special cell phone pocket that visually indicates when the wearer has an incoming call, as this event is often impossible to detect in a room where music is playing. There could also be a panic button hidden on the dress that would directly trigger the lights on the phone pocket, so that the wearer could pretend to have a call, should she need a way to escape a conversation that is boring her or otherwise causing distress.</p>
<h3>Description</h3>
<p>The Party Dress will be sewn from Simplicity pattern 2491, a festive, cheerful style that was issued most likely in 1958. It has a plain bodice that will not be made too garish by the addition of lights; a full skirt that, especially with the help of a crinoline, will provide ample camouflage for a power supply; a wide box pleat down the front of the skirt that will provide a stable surface on which to mount a sensor; and a belt that can be used to hide switches or other controls.</p>
<p>The top of the bodice will bear a short-range infrared sensor (such as the Sharp GP2D12, which has a range of 4 to 30 inches) and two small clusters of RGB LEDs. When the wearer is engaged in close conversation, her interlocutor’s presence directly in front of her will cause the LEDs to light up. If the person steps too far away to be easily heard, the lights will dim or blink.</p>
<p>The bottom of the skirt will bear a longer-range infrared sensor (such as the Sharp GP2Y0A710YK0F, which has a range of 40 to 216 inches) and a ring of 20 to 30 more RGB LEDs. If no person or object is detected by either this or the short-range sensor, these lights will pulse or change color to attract attention from people across the room, encouraging them to come closer to see what on earth is going on.</p>
<p>By default, all the LEDs except those on the cell phone pocket will stay lit (though there will, of course, be an on/off switch for times when the wearer does <em>not</em> wish to attract attention, such as while riding the subway), and their color will contribute to the overall hue of the dress. If the fabric is light in color and reasonably sheer, they may be mounted on an underlining so that the fabric diffuses their light and takes on their colors more organically. All the lights may shift color depending on proximity or other factors, such as noise level, temperature, the ambient light level, or incline (in case the wearer is dipped by her dance partner, or—heaven forfend—faints). If the edge of the phone pocket is too far out of the wearer’s field of vision to be comfortably seen, its indicator lights may be mounted on the belt, instead.</p>
<h3>Inspiration</h3>
<p>The idea for this dress emerged from a conversation about wearable technology that I had in December 2008 with the mighty Erin McKean, proprietress of the website <a href="http://dressaday.com/dressaday.html">A Dress A Day</a> and founder of the massive <a href="http://vintagepatterns.wikia.com/">Vintage Sewing Patterns Wiki</a>. In addition to being a great proponent of dresses, Ms. McKean is a frequent traveler and conferencegoer, and a charming conversationalist.</p>
<h3>Intended Wearers</h3>
<p>The Party Dress is intended for women who wish to make new acquaintances and are amused by fancy dress. It could function as an aid to the moderately shy, or to the intimidatingly beautiful, or to those who simply enjoy let their freak flags fly.</p>
<h3>Use Scenario</h3>
<p>A woman walks into a party where she does not know many people—say, one of those awkward parties that occurs on the opening night of a typography conference. As she looks around, trying to decide whom to try striking up a chat with, her dress begins to coruscate. Curious typographers begin to edge closer in order to determine whether this effect is a result of too much liquor, or whether that woman’s dress really is glowing. When they determine that the latter is more likely, they step forward to ask her what the blinking means. By this time, they have drawn close enough that the dress glows steadily. . . . Hours later, in the middle of the dance floor, the woman sees that her phone pocket is blinking. She steps aside to answer the call and discovers that it is almost midnight, and her pumpkin is waiting at the curb. She exchanges cards with her newfound friends, bids them goodbye, and exits, her dress starting to twinkle again as she heads for the cloak room.</p>
<p>* * *</p>
<blockquote><p><b>Assignment: Paper prototype</b></p>
<p>Start thinking about and developing the physical form for your project. Using materials like cardboard, paper, muslin, and foamcore, experiment with size, shape, and placement of the different component parts of your design. The results won&#8217;t be functional, but they should represent as closely as possible the elements you plan to use.</p>
<p>Think through how the finished garment or piece will look and how it will be used. Use this time to develop your ideas about why and how the user will interact with the final prototype without the pressure of making it work &#8211; that comes soon enough. Come to class next week with your paper prototype and be prepared to talk about your design decisions. </p></blockquote>
<p><object width="400" height="300"><param name="flashvars" value="&#038;offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Findiamos%2Fsets%2F72157613385963748%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Findiamos%2Fsets%2F72157613385963748%2F&#038;set_id=72157613385963748&#038;jump_to="></param><param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=67089"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=67089" allowFullScreen="true" flashvars="&#038;offsite=true&#038;lang=en-us&#038;page_show_url=%2Fphotos%2Findiamos%2Fsets%2F72157613385963748%2Fshow%2F&#038;page_show_back_url=%2Fphotos%2Findiamos%2Fsets%2F72157613385963748%2F&#038;set_id=72157613385963748&#038;jump_to=" width="400" height="300"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/02/05/simplicity/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reinventing the wheel</title>
		<link>http://itp.nyu.edu/~ia303/thunk/2009/02/03/reinventing-the-wheel/</link>
		<comments>http://itp.nyu.edu/~ia303/thunk/2009/02/03/reinventing-the-wheel/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 12:38:18 +0000</pubDate>
		<dc:creator>India</dc:creator>
				<category><![CDATA[A2Z]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[homework]]></category>

		<guid isPermaLink="false">http://itp.nyu.edu/~ia303/thunk/?p=455</guid>
		<description><![CDATA[
This week&#8217;s A&#8211;Z assignment:
Create a program (using, e.g., the tools presented in class) that behaves like a UNIX text processing program (such as cat, grep, tr, etc.). Your program should take text as input (any text, or a particular text of your choosing) and output a version of the text that has been filtered and/or [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/powerhouse_museum/2821106432/"><img src="http://itp.nyu.edu/~ia303/thunk/wp-content/uploads/wheel.jpg" alt="wheel" title="wheel" width="460" height="311" class="alignnone size-full wp-image-463" /></a></p>
<p>This week&#8217;s A&#8211;Z assignment:</p>
<blockquote><p>Create a program (using, e.g., the tools presented in class) that behaves like a UNIX text processing program (such as cat, grep, tr, etc.). Your program should take text as input (any text, or a particular text of your choosing) and output a version of the text that has been filtered and/or munged. <span id="more-455"></span>Your program should use at least one method of Java’s String class that we didn’t discuss in class.</p>
<p>Be creative, insightful, or intentionally banal. Optional: Use the program that you created in tandem with another UNIX command line utility</p></blockquote>
<p>Sounds easy-peasy, except that despite our handy <a href="http://www.decontextualize.com/teaching/a2z/strung-out-on-java/">review session</a>, I&#8217;ve completely forgotten anything I ever knew about Java or Processing. Not good.</p>
<p>Finally, after hours of beating my head against the couch and various O&#8217;Reilly books, I came up with two Java versions of the vowel shift&#8211;inducing UNIX command <code>tr 'AEIOUaeiou' 'EIOUAeioua'</code>. The first loops through the input letter by letter, checking each to see if it belongs to an array of vowels:</p>
<pre class="brush: java">import com.decontextualize.a2z.TextFilter;

public class Tr extends TextFilter
{
    public static void main(String[] args)
    {
        Tr t = new Tr();
        t.run();
    } // end main(String[] args)
    public void eachLine(String line)
    {
        char [] vowels_in = new char [] { &#039;A&#039;, &#039;a&#039;, &#039;E&#039;, &#039;e&#039;, &#039;I&#039;, &#039;i&#039;, &#039;O&#039;, &#039;o&#039;, &#039;U&#039;, &#039;u&#039; };
        char [] vowels_out = new char [] { &#039;E&#039;, &#039;e&#039;, &#039;I&#039;, &#039;i&#039;, &#039;O&#039;, &#039;o&#039;, &#039;U&#039;, &#039;u&#039;, &#039;A&#039;, &#039;a&#039; };
        for (int i = 0; i &lt; line.length(); i++)
        {
            char currentletter;
            char currentvowel;
            char printletter;
            currentletter = line.charAt(i);
            printletter = currentletter;
            for (int v = 0; v &lt; 10; v++)
            {
                currentvowel = vowels_in[v];
                if (currentletter == currentvowel)
                {
                    printletter = vowels_out[v];
                } // end if
            } // end for v loop
            print(printletter);
        } // end for i loop
    } // end eachLine(String line)
} // end Tr extends TextFilter</pre>
<p>The second rather tediously searches for and replaces each vowel in turn:</p>
<pre class="brush: java">import com.decontextualize.a2z.TextFilter;

public class Tr2 extends TextFilter
{
    public static void main(String[] args)
    {
        Tr2 t = new Tr2();
        t.run();
    } // end main(String[] args)
    public void eachLine(String line)
    {
        String line_new;
        line_new = line.replace( &quot;a&quot;, &quot;[1]&quot; );
        line_new = line_new.replace( &quot;e&quot;, &quot;[2]&quot; );
        line_new = line_new.replace( &quot;i&quot;, &quot;[3]&quot; );
        line_new = line_new.replace( &quot;o&quot;, &quot;[4]&quot; );
        line_new = line_new.replace( &quot;u&quot;, &quot;[5]&quot; );
        line_new = line_new.replace( &quot;A&quot;, &quot;[6]&quot; );
        line_new = line_new.replace( &quot;E&quot;, &quot;[7]&quot; );
        line_new = line_new.replace( &quot;I&quot;, &quot;[8]&quot; );
        line_new = line_new.replace( &quot;O&quot;, &quot;[9]&quot; );
        line_new = line_new.replace( &quot;U&quot;, &quot;[10]&quot; );
        line_new = line_new.replace( &quot;[1]&quot;, &quot;e&quot; );
        line_new = line_new.replace( &quot;[2]&quot;, &quot;i&quot; );
        line_new = line_new.replace( &quot;[3]&quot;, &quot;o&quot; );
        line_new = line_new.replace( &quot;[4]&quot;, &quot;u&quot; );
        line_new = line_new.replace( &quot;[5]&quot;, &quot;a&quot; );
        line_new = line_new.replace( &quot;[6]&quot;, &quot;E&quot; );
        line_new = line_new.replace( &quot;[7]&quot;, &quot;I&quot; );
        line_new = line_new.replace( &quot;[8]&quot;, &quot;O&quot; );
        line_new = line_new.replace( &quot;[9]&quot;, &quot;U&quot; );
        line_new = line_new.replace( &quot;[10]&quot;, &quot;A&quot; );
        print(line_new + &quot;\n&quot;);
    } // end eachLine(String line)
} // end Tr2 extends TextFilter</pre>
<p>I tried to rewrite the latter using arrays and a loop, as well&#8212;</p>
<pre class="brush: java">import com.decontextualize.a2z.TextFilter;

public class TrB extends TextFilter
{
    public static void main(String[] args)
    {
        TrB t = new TrB();
        t.run();
    } // end main(String[] args)
    public void eachLine(String line)
    {
        String line_new;
        String find_string;
        String replace_string;

        char [] vowels_in = new char [] { &#039;A&#039;, &#039;a&#039;, &#039;E&#039;, &#039;e&#039;, &#039;I&#039;, &#039;i&#039;, &#039;O&#039;, &#039;o&#039;, &#039;U&#039;, &#039;u&#039; };
        char [] vowels_out = new char [] { &#039;E&#039;, &#039;e&#039;, &#039;I&#039;, &#039;i&#039;, &#039;O&#039;, &#039;o&#039;, &#039;U&#039;, &#039;u&#039;, &#039;A&#039;, &#039;a&#039; };

        line_new = line;

        for (int i = 0; i &lt; vowels_in.length; i++)
        {
            find_string = &quot;[&quot; + i + &quot;]&quot;;
            line_new = line_new.replace( vowels_in[i], find_string );
        }
        for (int j = 0; j &lt; vowels_in.length; j++)
        {
            replace_string = &quot;[&quot; + j + &quot;]&quot;;
            line_new = line_new.replace( replace_string, vowels_out[j] );
        }
        print(line_new + &quot;\n&quot;);
    } // end eachLine(String line)
} // end Tr2 extends TextFilter</pre>
<p>but I just couldn&#8217;t get past this error message:</p>
<pre>rB.java:28: cannot find symbol
symbol  : method replace(char,java.lang.String)
location: class java.lang.String
            line_new = line_new.replace( vowels_in[i], find_string );
                               ^
TrB.java:33: cannot find symbol
symbol  : method replace(java.lang.String,char)
location: class java.lang.String
            line_new = line_new.replace( replace_string, vowels_out[j] );
                               ^
2 errors</pre>
<p>What stupid, obvious thing am I doing wrong?</p>
<h3>Sample Input</h3>
<blockquote><p>Nelson was enjoying a little quiet at his house in the pretty village of Merton, in Surrey, when he learnt that the French and Spanish fleet, joined by the Ferrol squadron, had succeeded in entering Cadiz. His resolution was quickly taken. He went to the Admiralty and offered his services, which were joyfully accepted. Nelson was full of hope. “Depend on it,” he said to captain Blackwood, “I shall yet give M. Villeneuve a drubbing.” He formed his plans of attack during the short time of preparation, when the Victory had to be refitted, and other ships were to be got ready to accompany him. Lord Sidmouth told Mr. Eush, the American ambassador, that in the course of a visit he had received from Nelson, three weeks before the battle of Trafalgar, he described the plan of it, with bits of paper on a table, as it was afterwards fought. Yet he had a presentiment of his own fate. The coffin which was made out of the mast of l’Orient was deposited at an upholsterer’s. He desired its history to be engraved on its lid, saying that he should probably want it on his return. When he arrived at Portsmouth on the 14th of September, the enthusiasm of the people reached that height which sometimes gives a character of sublimity to the movements of multitudes acting with one heart. They wept; they blessed him; they even knelt as he passed along. The cheer which went up from thousands of voices as his barge pushed off to his flag-ship, -was the Godspeed of hia country. He waved his hat—a last farewell to England.<br />
—<a href="http://books.google.com/books?id=kWINAAAAIAAJ&#038;pg=PA445"><cite>The Popular History of England: An Illustrated History of Society and Government from the Earliest Period to Our Own Times</cite></a> by Charles Knight (Boston: Estes and Lauriat, 1874)</p></blockquote>
<h3>Sample Output</h3>
<blockquote><p>Nilsun wes injuyong e lottli qaoit et hos huasi on thi pritty vollegi uf Mirtun, on Sarriy, whin hi liernt thet thi Frinch end Spenosh fliit, juonid by thi Firrul sqaedrun, hed sacciidid on intirong Cedoz. Hos risulatoun wes qaockly tekin. Hi wint tu thi Edmorelty end uffirid hos sirvocis, whoch wiri juyfally ecciptid. Nilsun wes fall uf hupi. “Dipind un ot,” hi seod tu cepteon Bleckwuud, “O shell yit govi M. Volliniavi e drabbong.” Hi furmid hos plens uf etteck darong thi shurt tomi uf priperetoun, whin thi Voctury hed tu bi rifottid, end uthir shops wiri tu bi gut riedy tu eccumpeny hom. Lurd Sodmuath tuld Mr. Iash, thi Emirocen embessedur, thet on thi cuarsi uf e vosot hi hed riciovid frum Nilsun, thrii wiiks bifuri thi bettli uf Trefelger, hi discrobid thi plen uf ot, woth bots uf pepir un e tebli, es ot wes eftirwerds fuaght. Yit hi hed e prisintomint uf hos uwn feti. Thi cuffon whoch wes medi uat uf thi mest uf l’Uroint wes dipusotid et en aphulstirir’s. Hi disorid ots hostury tu bi ingrevid un ots lod, seyong thet hi shuald prubebly went ot un hos ritarn. Whin hi errovid et Purtsmuath un thi 14th uf Siptimbir, thi inthasoesm uf thi piupli riechid thet hioght whoch sumitomis govis e cherectir uf sablomoty tu thi muvimints uf maltotadis ectong woth uni hiert. Thiy wipt; thiy blissid hom; thiy ivin knilt es hi pessid elung. Thi chiir whoch wint ap frum thuasends uf vuocis es hos bergi pashid uff tu hos fleg-shop, -wes thi Gudspiid uf hoe cuantry. Hi wevid hos het—e lest feriwill tu Inglend.<br />
—<i>Thi Pupaler Hostury uf Inglend: En Ollastretid Hostury uf Sucoity end Guvirnmint frum thi Ierloist Piroud tu Uar Uwn Tomis</i> by Cherlis Knoght (Bustun: Istis end Learoet, 1874)
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itp.nyu.edu/~ia303/thunk/2009/02/03/reinventing-the-wheel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
