<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7745129748420905494</id><updated>2012-01-30T15:44:52.789-08:00</updated><category term='stdev stdevp'/><category term='permalink'/><category term='control toolkit'/><category term='flash'/><category term='url'/><category term='data transfer'/><category term='Wordpress'/><category term='team foundation server 2008'/><category term='javascript'/><category term='stdev formula'/><category term='news'/><category term='cache'/><category term='stumbleupon'/><category term='iframe'/><category term='duration length minutes seconds formatting'/><category term='quartile'/><category term='code samples'/><category term='xmldocument'/><category term='standard deviations'/><category term='tag'/><category term='parsing'/><category term='sumproduct'/><category term='open source'/><category term='http'/><category term='variance'/><category term='team foundation'/><category term='demo'/><category term='intuition'/><category term='how to unlock file'/><category term='relax'/><category term='array'/><category term='string'/><category term='loadvars'/><category term='emotions'/><category term='team foundation server 2005'/><category term='experts exchange'/><category term='pooled stdev'/><category term='standard deviation'/><category term='player'/><category term='browser'/><category term='normal distribution'/><category term='video'/><category term='anger'/><category term='download unlocker'/><category term='how to unlock a file'/><category term='ajax cache request response pragma'/><category term='actionscript'/><category term='Sidebar'/><category term='business objects'/><category term='cnn'/><category term='file to unlock'/><category term='debug'/><category term='xml'/><category term='query string'/><category term='vba stdev'/><category term='iis'/><category term='group by'/><category term='internet explorer'/><category term='ajax'/><category term='controls'/><category term='object'/><category term='access stdev'/><category term='dataset'/><category term='file unlocker'/><category term='development process'/><category term='bbc'/><category term='codeplex'/><category term='z score'/><category term='stdevp'/><category term='stdev'/><category term='page'/><category term='samples'/><category term='team foundation server'/><category term='visual studio'/><category term='news industry'/><category term='split'/><category term='meta'/><category term='tags'/><category term='web2.0'/><category term='digg'/><category term='browser ie internet explorer firefox request browsercapabilities'/><category term='sniffer'/><category term='html'/><category term='delicious'/><category term='server'/><category term='microsoft'/><category term='asp.net'/><category term='design'/><category term='http handler'/><category term='foundation server'/><category term='stdev sql'/><category term='UGC'/><category term='Custom fields'/><category term='json'/><category term='google'/><category term='sitemap'/><title type='text'>Blood Sweat and Bugs</title><subtitle type='html'>Programming tips, cool tools, code samples, tutorials, and just stuff I like.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-1269960419492061345</id><published>2010-01-13T02:06:00.000-08:00</published><updated>2010-01-13T04:09:14.177-08:00</updated><title type='text'>Images test for Wibiya Share app</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_u4nq3fR1ACc/S02cEBxz3eI/AAAAAAAAAL8/NkGwQIiJo1s/s1600-h/Heidi_Klum_079.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 488px; height: 366px;" src="http://3.bp.blogspot.com/_u4nq3fR1ACc/S02cEBxz3eI/AAAAAAAAAL8/NkGwQIiJo1s/s320/Heidi_Klum_079.jpg" alt="" id="BLOGGER_PHOTO_ID_5426164719062080994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Heidi Samuel&lt;/b&gt;&lt;sup id="cite_ref-People_Samuel_1-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-People_Samuel-1"&gt;&lt;span&gt;[&lt;/span&gt;2&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; (born June 1, 1973)&lt;sup id="cite_ref-2" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-2"&gt;&lt;span&gt;[&lt;/span&gt;3&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;, better known by her birth name &lt;b&gt;Heidi Klum&lt;/b&gt;, is a &lt;a href="http://en.wikipedia.org/wiki/German_American" title="German American"&gt;German American&lt;/a&gt;&lt;sup id="cite_ref-naturalized_3-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-naturalized-3"&gt;&lt;span&gt;[&lt;/span&gt;4&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; model, actress, television host, business woman, fashion designer, &lt;a href="http://en.wikipedia.org/wiki/Television_producer" title="Television producer"&gt;television producer&lt;/a&gt;, artist, and occasional singer. She is married to singer &lt;a href="http://en.wikipedia.org/wiki/Seal_%28musician%29" title="Seal (musician)"&gt;Seal&lt;/a&gt;.&lt;/p&gt; &lt;table id="toc" class="toc"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt; &lt;div id="toctitle"&gt; &lt;h2&gt;Contents&lt;/h2&gt;  &lt;span class="toctoggle"&gt;[&lt;a href="javascript:toggleToc()" class="internal" id="togglelink"&gt;hide&lt;/a&gt;]&lt;/span&gt;&lt;/div&gt; &lt;ul&gt;&lt;li class="toclevel-1 tocsection-1"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#Early_life_and_discovery"&gt;&lt;span class="tocnumber"&gt;1&lt;/span&gt; &lt;span class="toctext"&gt;Early life and discovery&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-2"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#Acting_and_modeling"&gt;&lt;span class="tocnumber"&gt;2&lt;/span&gt; &lt;span class="toctext"&gt;Acting and modeling&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-3"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#Project_Runway"&gt;&lt;span class="tocnumber"&gt;3&lt;/span&gt; &lt;span class="toctext"&gt;Project Runway&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-4"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#Designing_and_perfume"&gt;&lt;span class="tocnumber"&gt;4&lt;/span&gt; &lt;span class="toctext"&gt;Designing and perfume&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-5"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#Germany.27s_Next_Topmodel"&gt;&lt;span class="tocnumber"&gt;5&lt;/span&gt; &lt;span class="toctext"&gt;Germany's Next Topmodel&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-6"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#Other"&gt;&lt;span class="tocnumber"&gt;6&lt;/span&gt; &lt;span class="toctext"&gt;Other&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-7"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#Personal_life"&gt;&lt;span class="tocnumber"&gt;7&lt;/span&gt; &lt;span class="toctext"&gt;Personal life&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-8"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#Filmography"&gt;&lt;span class="tocnumber"&gt;8&lt;/span&gt; &lt;span class="toctext"&gt;Filmography&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-9"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#References"&gt;&lt;span class="tocnumber"&gt;9&lt;/span&gt; &lt;span class="toctext"&gt;References&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-10"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#External_links"&gt;&lt;span class="tocnumber"&gt;10&lt;/span&gt; &lt;span class="toctext"&gt;External links&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); }  //]]&gt; &lt;/script&gt; &lt;h2&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Heidi_Klum&amp;amp;action=edit&amp;amp;section=1" title="Edit section: Early life and discovery"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Early_life_and_discovery"&gt;Early life and discovery&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;Heidi was raised by her parents: Günther, a cosmetics-company executive; and Erna, a hairdresser; in &lt;a href="http://en.wikipedia.org/wiki/Bergisch_Gladbach" title="Bergisch Gladbach"&gt;Bergisch Gladbach&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/West_Germany" title="West Germany"&gt;West Germany&lt;/a&gt;, a small city outside &lt;a href="http://en.wikipedia.org/wiki/Cologne" title="Cologne"&gt;Cologne&lt;/a&gt;. A friend persuaded her to enroll in a national modeling contest called "Model 92".&lt;sup id="cite_ref-4" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-4"&gt;&lt;span&gt;[&lt;/span&gt;5&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Out of 25,000 contestants, Klum was voted the winner on April 29, 1992 and offered a modeling contract worth US$300,000 by Thomas Zeumer, CEO of Metropolitan Models New York.&lt;sup id="cite_ref-5" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-5"&gt;&lt;span&gt;[&lt;/span&gt;6&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; As the winner, she appeared on the &lt;i&gt;Gottschalk Late Night Show&lt;/i&gt;, a top German television show with host &lt;a href="http://en.wikipedia.org/wiki/Thomas_Gottschalk" title="Thomas Gottschalk"&gt;Thomas Gottschalk&lt;/a&gt;. She accepted the contract a few months later after graduating from school and decided not to try for an apprentice position at a fashion design school.&lt;sup id="cite_ref-6" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-6"&gt;&lt;span&gt;[&lt;/span&gt;7&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;h2&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Heidi_Klum&amp;amp;action=edit&amp;amp;section=2" title="Edit section: Acting and modeling"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Acting_and_modeling"&gt;Acting and modeling&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;Klum has been on the cover of fashion magazines, including &lt;a href="http://en.wikipedia.org/wiki/Vogue_%28magazine%29" title="Vogue (magazine)"&gt;&lt;i&gt;Vogue&lt;/i&gt;&lt;/a&gt;, &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Elle_Magazine" title="Elle Magazine" class="mw-redirect"&gt;ELLE&lt;/a&gt;&lt;/i&gt; and &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Marie_Claire" title="Marie Claire"&gt;Marie Claire&lt;/a&gt;&lt;/i&gt;. She became known after appearing on the cover of the &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Sports_Illustrated_Swimsuit_Issue" title="Sports Illustrated Swimsuit Issue"&gt;Sports Illustrated Swimsuit Issue&lt;/a&gt;&lt;/i&gt; and for her work with &lt;a href="http://en.wikipedia.org/wiki/Victoria%27s_Secret" title="Victoria's Secret"&gt;Victoria's Secret&lt;/a&gt; as an "Angel."&lt;sup id="cite_ref-7" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-7"&gt;&lt;span&gt;[&lt;/span&gt;8&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Klum hosted the Victoria's Secret Fashion Show in 2009.&lt;/p&gt; &lt;p&gt;In addition to working with world class photographers on her &lt;i&gt;Sports Illustrated&lt;/i&gt; shoots, she was the object and subject of &lt;a href="http://en.wikipedia.org/wiki/Joanne_Gair" title="Joanne Gair"&gt;Joanne Gair&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Body_painting" title="Body painting"&gt;body painting&lt;/a&gt; works in several editions from 1999 to 2006. She wrote the &lt;a href="http://en.wikipedia.org/wiki/Foreword" title="Foreword"&gt;foreword&lt;/a&gt; to Gair's book of body paint work. She was a spokesmodel for McDonald's, &lt;a href="http://en.wikipedia.org/wiki/Braun_%28company%29" title="Braun (company)"&gt;Braun&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/H_%26_M" title="H &amp;amp; M" class="mw-redirect"&gt;H &amp;amp; M&lt;/a&gt;, and &lt;a href="http://en.wikipedia.org/wiki/Liz_Claiborne" title="Liz Claiborne"&gt;Liz Claiborne&lt;/a&gt;, among others. She is currently a celebrity spokesmodel for &lt;a href="http://en.wikipedia.org/wiki/Jordache" title="Jordache"&gt;Jordache&lt;/a&gt;&lt;sup id="cite_ref-8" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-8"&gt;&lt;span&gt;[&lt;/span&gt;9&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; and &lt;a href="http://en.wikipedia.org/wiki/Volkswagen" title="Volkswagen"&gt;Volkswagen&lt;/a&gt;. In addition to modeling, she has appeared in several TV shows, including &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Spin_City" title="Spin City"&gt;Spin City&lt;/a&gt;&lt;/i&gt;, &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Sex_and_the_City" title="Sex and the City"&gt;Sex and the City&lt;/a&gt;&lt;/i&gt;, &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Jimmy_Saves_the_Day" title="Jimmy Saves the Day" class="mw-redirect"&gt;Yes, Dear&lt;/a&gt;&lt;/i&gt;, and &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/How_I_Met_Your_Mother" title="How I Met Your Mother"&gt;How I Met Your Mother&lt;/a&gt;&lt;/i&gt;. She had a role as an ill-tempered hair model in the movie &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Blow_Dry" title="Blow Dry"&gt;Blow Dry&lt;/a&gt;&lt;/i&gt;, played a giantess in the movie &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Ella_Enchanted_%28film%29" title="Ella Enchanted (film)"&gt;Ella Enchanted&lt;/a&gt;&lt;/i&gt; and was cast as &lt;a href="http://en.wikipedia.org/wiki/Ursula_Andress" title="Ursula Andress"&gt;Ursula Andress&lt;/a&gt; in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Life_and_Death_of_Peter_Sellers" title="The Life and Death of Peter Sellers"&gt;The Life and Death of Peter Sellers&lt;/a&gt;&lt;/i&gt;. She had cameo appearances in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Devil_Wears_Prada_%28film%29" title="The Devil Wears Prada (film)"&gt;The Devil Wears Prada&lt;/a&gt;&lt;/i&gt; and &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Perfect_Stranger_%28film%29" title="Perfect Stranger (film)"&gt;Perfect Stranger&lt;/a&gt;&lt;/i&gt;.&lt;/p&gt; &lt;p&gt;In July 2007, having earned $8 million in the previous 12 months, Klum was named by &lt;a href="http://en.wikipedia.org/wiki/Forbes" title="Forbes"&gt;Forbes&lt;/a&gt; as third on the list of the World's 15 Top-Earning Supermodels.&lt;sup id="cite_ref-9" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-9"&gt;&lt;span&gt;[&lt;/span&gt;10&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; In 2008, Forbes estimated her income at $14 million, putting Klum in second place. For 2009, Forbes estimated her income at $16 million.&lt;sup id="cite_ref-10" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Heidi_Klum#cite_note-10"&gt;&lt;span&gt;[&lt;/span&gt;11&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Klum is signed to &lt;a href="http://en.wikipedia.org/wiki/IMG_Models" title="IMG Models"&gt;IMG Models&lt;/a&gt; in New York City.&lt;/p&gt; &lt;h2&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Heidi_Klum&amp;amp;action=edit&amp;amp;section=3" title="Edit section: Project Runway"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Project_Runway"&gt;&lt;/span&gt;&lt;/h2&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_u4nq3fR1ACc/S02cD2j8g3I/AAAAAAAAAL0/qDUoPZAQLRk/s1600-h/claire_danes300a.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 240px; height: 320px;" src="http://3.bp.blogspot.com/_u4nq3fR1ACc/S02cD2j8g3I/AAAAAAAAAL0/qDUoPZAQLRk/s320/claire_danes300a.jpg" alt="" id="BLOGGER_PHOTO_ID_5426164716051137394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Claire Catherine Danes&lt;/b&gt; (born April 12, 1979) is an American &lt;a href="http://en.wikipedia.org/wiki/Actor" title="Actor"&gt;actress&lt;/a&gt;, perhaps best known for her role as Angela Chase in the &lt;a href="http://en.wikipedia.org/wiki/Television" title="Television"&gt;television&lt;/a&gt; series &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/My_So-Called_Life" title="My So-Called Life"&gt;My So-Called Life&lt;/a&gt;&lt;/i&gt;, and for starring in films such as &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Romeo_%2B_Juliet" title="Romeo + Juliet"&gt;Romeo + Juliet&lt;/a&gt;&lt;/i&gt; (as &lt;a href="http://en.wikipedia.org/wiki/Juliet_Capulet" title="Juliet Capulet"&gt;Juliet&lt;/a&gt;), &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Terminator_3:_Rise_of_the_Machines" title="Terminator 3: Rise of the Machines"&gt;Terminator 3: Rise of the Machines&lt;/a&gt;&lt;/i&gt; (as &lt;a href="http://en.wikipedia.org/wiki/Kate_Brewster" title="Kate Brewster" class="mw-redirect"&gt;Kate Brewster&lt;/a&gt;) and &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Stardust_%282007_film%29" title="Stardust (2007 film)"&gt;Stardust&lt;/a&gt;&lt;/i&gt; (as &lt;a href="http://en.wikipedia.org/wiki/Yvaine_%28Stardust%29" title="Yvaine (Stardust)" class="mw-redirect"&gt;Yvaine&lt;/a&gt;). She has received a &lt;a href="http://en.wikipedia.org/wiki/Golden_Globe_Award" title="Golden Globe Award"&gt;Golden Globe Award&lt;/a&gt; and an &lt;a href="http://en.wikipedia.org/wiki/Emmy_Award" title="Emmy Award"&gt;Emmy&lt;/a&gt; nomination for &lt;i&gt;My So-Called Life&lt;/i&gt;, and has also worked in &lt;a href="http://en.wikipedia.org/wiki/Theatre" title="Theatre"&gt;theatre&lt;/a&gt; and as a voice actor (&lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Princess_Mononoke" title="Princess Mononoke"&gt;Princess Mononoke&lt;/a&gt;&lt;/i&gt;).&lt;/p&gt; &lt;table id="toc" class="toc"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt; &lt;div id="toctitle"&gt; &lt;h2&gt;Contents&lt;/h2&gt;  &lt;span class="toctoggle"&gt;[&lt;a href="javascript:toggleToc()" class="internal" id="togglelink"&gt;hide&lt;/a&gt;]&lt;/span&gt;&lt;/div&gt; &lt;ul&gt;&lt;li class="toclevel-1 tocsection-1"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Early_life"&gt;&lt;span class="tocnumber"&gt;1&lt;/span&gt; &lt;span class="toctext"&gt;Early life&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-2"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Career"&gt;&lt;span class="tocnumber"&gt;2&lt;/span&gt; &lt;span class="toctext"&gt;Career&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-3"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Personal_life"&gt;&lt;span class="tocnumber"&gt;3&lt;/span&gt; &lt;span class="toctext"&gt;Personal life&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-4"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Controversy"&gt;&lt;span class="tocnumber"&gt;4&lt;/span&gt; &lt;span class="toctext"&gt;Controversy&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-5"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Filmography"&gt;&lt;span class="tocnumber"&gt;5&lt;/span&gt; &lt;span class="toctext"&gt;Filmography&lt;/span&gt;&lt;/a&gt; &lt;ul&gt;&lt;li class="toclevel-2 tocsection-6"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Television"&gt;&lt;span class="tocnumber"&gt;5.1&lt;/span&gt; &lt;span class="toctext"&gt;Television&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-2 tocsection-7"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Commercials"&gt;&lt;span class="tocnumber"&gt;5.2&lt;/span&gt; &lt;span class="toctext"&gt;Commercials&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-2 tocsection-8"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Music_videos"&gt;&lt;span class="tocnumber"&gt;5.3&lt;/span&gt; &lt;span class="toctext"&gt;Music videos&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-2 tocsection-9"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#Guest_appearances"&gt;&lt;span class="tocnumber"&gt;5.4&lt;/span&gt; &lt;span class="toctext"&gt;Guest appearances&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li class="toclevel-1 tocsection-10"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#References"&gt;&lt;span class="tocnumber"&gt;6&lt;/span&gt; &lt;span class="toctext"&gt;References&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-11"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#External_links"&gt;&lt;span class="tocnumber"&gt;7&lt;/span&gt; &lt;span class="toctext"&gt;External links&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); }  //]]&gt; &lt;/script&gt; &lt;h2&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Claire_Danes&amp;amp;action=edit&amp;amp;section=1" title="Edit section: Early life"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Early_life"&gt;Early life&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;Danes was born in Manhattan, New York City, New York.&lt;sup id="cite_ref-ref12_0-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-ref12-0"&gt;&lt;span&gt;[&lt;/span&gt;1&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Her mother, Carla, is a &lt;a href="http://en.wikipedia.org/wiki/Day-care" title="Day-care" class="mw-redirect"&gt;day-care&lt;/a&gt; provider, painter, and &lt;a href="http://en.wikipedia.org/wiki/Textile" title="Textile"&gt;textile&lt;/a&gt; designer who later served as her daughter's manager, and her father, Christopher Danes, is a computer consultant and former &lt;a href="http://en.wikipedia.org/wiki/Architecture" title="Architecture"&gt;architectural&lt;/a&gt; photographer. Danes has described her background as being "as &lt;a href="http://en.wikipedia.org/wiki/White_Anglo-Saxon_Protestant" title="White Anglo-Saxon Protestant"&gt;WASPy&lt;/a&gt; as you can get";&lt;sup id="cite_ref-1" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-1"&gt;&lt;span&gt;[&lt;/span&gt;2&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; her paternal grandfather, Gibson Andrew Danes, (&lt;a href="http://en.wikipedia.org/wiki/1910" title="1910"&gt;1910&lt;/a&gt;-&lt;a href="http://en.wikipedia.org/wiki/1992" title="1992"&gt;1992&lt;/a&gt; in &lt;a href="http://en.wikipedia.org/wiki/Litchfield,_Connecticut" title="Litchfield, Connecticut"&gt;Litchfield, Connecticut&lt;/a&gt;) was the &lt;a href="http://en.wikipedia.org/wiki/Dean_%28education%29" title="Dean (education)"&gt;dean&lt;/a&gt; of the art and architecture school at &lt;a href="http://en.wikipedia.org/wiki/Yale_University" title="Yale University"&gt;Yale University&lt;/a&gt;.&lt;sup id="cite_ref-2" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-2"&gt;&lt;span&gt;[&lt;/span&gt;3&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;sup id="cite_ref-3" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-3"&gt;&lt;span&gt;[&lt;/span&gt;4&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; She has an older brother, Asa, who graduated from &lt;a href="http://en.wikipedia.org/wiki/Oberlin_College" title="Oberlin College"&gt;Oberlin College&lt;/a&gt; and works as a litigation attorney for the law firm of &lt;a href="http://en.wikipedia.org/wiki/Paul_Hastings" title="Paul Hastings" class="mw-redirect"&gt;Paul Hastings&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Danes attended the &lt;a href="http://en.wikipedia.org/wiki/Dalton_School" title="Dalton School"&gt;Dalton School&lt;/a&gt; in New York City, the &lt;a href="http://en.wikipedia.org/wiki/New_York_City_Lab_School_for_Collaborative_Studies" title="New York City Lab School for Collaborative Studies"&gt;New York City Lab School for Collaborative Studies&lt;/a&gt;, the &lt;a href="http://en.wikipedia.org/wiki/Professional_Performing_Arts_School" title="Professional Performing Arts School"&gt;Professional Performing Arts School&lt;/a&gt;,&lt;sup id="cite_ref-superiorpics.com_4-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-superiorpics.com-4"&gt;&lt;span&gt;[&lt;/span&gt;5&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; and the &lt;a href="http://en.wikipedia.org/wiki/Lyc%C3%A9e_Fran%C3%A7ais_de_Los_Angeles" title="Lycée Français de Los Angeles"&gt;Lycée Français de Los Angeles&lt;/a&gt; in &lt;a href="http://en.wikipedia.org/wiki/Los_Angeles,_California" title="Los Angeles, California" class="mw-redirect"&gt;Los Angeles, California&lt;/a&gt;. In 1998, Danes went to &lt;a href="http://en.wikipedia.org/wiki/Yale_University" title="Yale University"&gt;Yale University&lt;/a&gt;, her father's alma mater. &lt;a href="http://en.wikipedia.org/wiki/Oliver_Stone" title="Oliver Stone"&gt;Oliver Stone&lt;/a&gt; wrote her letter of recommendation to &lt;a href="http://en.wikipedia.org/wiki/Yale" title="Yale" class="mw-redirect"&gt;Yale&lt;/a&gt;.&lt;sup id="cite_ref-superiorpics.com_4-1" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-superiorpics.com-4"&gt;&lt;span&gt;[&lt;/span&gt;5&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; After studying for two years as a &lt;a href="http://en.wikipedia.org/wiki/Psychology" title="Psychology"&gt;psychology&lt;/a&gt; major, she dropped out of Yale to focus on her film career.&lt;/p&gt; &lt;h2&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Claire_Danes&amp;amp;action=edit&amp;amp;section=2" title="Edit section: Career"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Career"&gt;Career&lt;/span&gt;&lt;/h2&gt; &lt;div class="thumb tright"&gt; &lt;div class="thumbinner" style="width: 182px;"&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Claire_Daines_at_Much_Music_by_Robin_Wong_3.jpg" class="image"&gt;&lt;img alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Claire_Daines_at_Much_Music_by_Robin_Wong_3.jpg/180px-Claire_Daines_at_Much_Music_by_Robin_Wong_3.jpg" class="thumbimage" width="180" height="270" /&gt;&lt;/a&gt; &lt;div class="thumbcaption"&gt; &lt;div class="magnify"&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Claire_Daines_at_Much_Music_by_Robin_Wong_3.jpg" class="internal" title="Enlarge"&gt;&lt;img src="http://bits.wikimedia.org/skins-1.5/common/images/magnify-clip.png" alt="" width="15" height="11" /&gt;&lt;/a&gt;&lt;/div&gt; Danes in Toronto for a &lt;a href="http://en.wikipedia.org/wiki/MuchOnDemand" title="MuchOnDemand"&gt;MuchOnDemand&lt;/a&gt; in promotion of &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Stardust_%282007_film%29" title="Stardust (2007 film)"&gt;Stardust&lt;/a&gt;&lt;/i&gt;, 2007.&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;In 1994, 15-year-old Danes starred as the 15-year-old Angela Chase in the &lt;a href="http://en.wikipedia.org/wiki/Television" title="Television"&gt;television&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Drama" title="Drama"&gt;drama&lt;/a&gt; series &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/My_So-Called_Life" title="My So-Called Life"&gt;My So-Called Life&lt;/a&gt;&lt;/i&gt;, for which she won a &lt;a href="http://en.wikipedia.org/wiki/Golden_Globe_Award" title="Golden Globe Award"&gt;Golden Globe Award&lt;/a&gt; and received an &lt;a href="http://en.wikipedia.org/wiki/Emmy_Award" title="Emmy Award"&gt;Emmy&lt;/a&gt; nomination. She played Elizabeth "Beth" March in the 1994 movie adaptation of &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Little_Women_%281994_film%29" title="Little Women (1994 film)"&gt;Little Women&lt;/a&gt;&lt;/i&gt;. She also appeared as &lt;a href="http://en.wikipedia.org/wiki/Holly_Hunter" title="Holly Hunter"&gt;Holly Hunter's&lt;/a&gt; daughter in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Home_for_the_Holidays_%28film%29" title="Home for the Holidays (film)"&gt;Home for the Holidays&lt;/a&gt;&lt;/i&gt;, which was directed by &lt;a href="http://en.wikipedia.org/wiki/Jodie_Foster" title="Jodie Foster"&gt;Jodie Foster&lt;/a&gt;. She portrayed &lt;a href="http://en.wikipedia.org/wiki/Juliet_Capulet" title="Juliet Capulet"&gt;Juliet Capulet&lt;/a&gt; in &lt;a href="http://en.wikipedia.org/wiki/Baz_Luhrmann" title="Baz Luhrmann"&gt;Baz Luhrmann&lt;/a&gt;'s 1996 film &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/William_Shakespeare%27s_Romeo_%2B_Juliet" title="William Shakespeare's Romeo + Juliet" class="mw-redirect"&gt;William Shakespeare's Romeo + Juliet&lt;/a&gt;&lt;/i&gt;, co-starring &lt;a href="http://en.wikipedia.org/wiki/Leonardo_DiCaprio" title="Leonardo DiCaprio"&gt;Leonardo DiCaprio&lt;/a&gt; as &lt;a href="http://en.wikipedia.org/wiki/Romeo_Montague" title="Romeo Montague"&gt;Romeo Montague&lt;/a&gt;. Later that year, she was credited to the popular belief that she'd turned down the lead role in Titantic but in a 2009 interview Danes claimed she doesn't know how the rumour started saying 'someone must have put it on wikipedia' and that she had been considered but she was never offered the role. In 1999, she made her first appearance in an animated feature with the English version of &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Princess_Mononoke" title="Princess Mononoke"&gt;Princess Mononoke&lt;/a&gt;&lt;/i&gt;, and took the lead role in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Brokedown_Palace" title="Brokedown Palace"&gt;Brokedown Palace&lt;/a&gt;&lt;/i&gt;, alongside &lt;a href="http://en.wikipedia.org/wiki/Kate_Beckinsale" title="Kate Beckinsale"&gt;Kate Beckinsale&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Bill_Pullman" title="Bill Pullman"&gt;Bill Pullman&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;In 2002, Danes starred alongside &lt;a href="http://en.wikipedia.org/wiki/Susan_Sarandon" title="Susan Sarandon"&gt;Susan Sarandon&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Kieran_Culkin" title="Kieran Culkin"&gt;Kieran Culkin&lt;/a&gt;, and &lt;a href="http://en.wikipedia.org/wiki/Bill_Pullman" title="Bill Pullman"&gt;Bill Pullman&lt;/a&gt; again, in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Igby_Goes_Down" title="Igby Goes Down"&gt;Igby Goes Down&lt;/a&gt;&lt;/i&gt;. She later co-starred as &lt;a href="http://en.wikipedia.org/wiki/Meryl_Streep" title="Meryl Streep"&gt;Meryl Streep&lt;/a&gt;'s daughter in the &lt;a href="http://en.wikipedia.org/wiki/Academy_Award" title="Academy Award"&gt;Oscar&lt;/a&gt;-nominated, &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Hours_%28film%29" title="The Hours (film)"&gt;The Hours&lt;/a&gt;&lt;/i&gt;, with &lt;a href="http://en.wikipedia.org/wiki/Nicole_Kidman" title="Nicole Kidman"&gt;Nicole Kidman&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Julianne_Moore" title="Julianne Moore"&gt;Julianne Moore&lt;/a&gt;, and &lt;a href="http://en.wikipedia.org/wiki/Ed_Harris" title="Ed Harris"&gt;Ed Harris&lt;/a&gt;. The following year, she was cast in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Terminator_3:_Rise_of_the_Machines" title="Terminator 3: Rise of the Machines"&gt;Terminator 3: Rise of the Machines&lt;/a&gt;&lt;/i&gt;, followed by &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Stage_Beauty" title="Stage Beauty"&gt;Stage Beauty&lt;/a&gt;&lt;/i&gt; in 2004. She earned critical acclaim in 2005 when she starred in &lt;a href="http://en.wikipedia.org/wiki/Steve_Martin" title="Steve Martin"&gt;Steve Martin's&lt;/a&gt; &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Shopgirl" title="Shopgirl"&gt;Shopgirl&lt;/a&gt;&lt;/i&gt; alongside Martin and &lt;a href="http://en.wikipedia.org/wiki/Jason_Schwartzman" title="Jason Schwartzman"&gt;Jason Schwartzman&lt;/a&gt;, and in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Family_Stone" title="The Family Stone"&gt;The Family Stone&lt;/a&gt;&lt;/i&gt; opposite &lt;a href="http://en.wikipedia.org/wiki/Sarah_Jessica_Parker" title="Sarah Jessica Parker"&gt;Sarah Jessica Parker&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Diane_Keaton" title="Diane Keaton"&gt;Diane Keaton&lt;/a&gt;. In 2007, Danes appeared in the &lt;a href="http://en.wikipedia.org/wiki/Fantasy" title="Fantasy"&gt;fantasy&lt;/a&gt; &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Stardust_%282007_film%29" title="Stardust (2007 film)"&gt;Stardust&lt;/a&gt;&lt;/i&gt;, which she described as a "classic model of &lt;a href="http://en.wikipedia.org/wiki/Romantic_comedy" title="Romantic comedy" class="mw-redirect"&gt;romantic comedy&lt;/a&gt;",&lt;sup id="cite_ref-azcentral_5-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-azcentral-5"&gt;&lt;span&gt;[&lt;/span&gt;6&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; with &lt;a href="http://en.wikipedia.org/wiki/Charlie_Cox" title="Charlie Cox"&gt;Charlie Cox&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Michelle_Pfeiffer" title="Michelle Pfeiffer"&gt;Michelle Pfeiffer&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Robert_De_Niro" title="Robert De Niro"&gt;Robert De Niro&lt;/a&gt;, and &lt;a href="http://en.wikipedia.org/wiki/Sienna_Miller" title="Sienna Miller"&gt;Sienna Miller&lt;/a&gt;, and appeared in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Flock_%28film%29" title="The Flock (film)"&gt;The Flock&lt;/a&gt;&lt;/i&gt;, opposite &lt;a href="http://en.wikipedia.org/wiki/Richard_Gere" title="Richard Gere"&gt;Richard Gere&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Danes appeared in &lt;a href="http://en.wikipedia.org/wiki/Off-Broadway" title="Off-Broadway" class="mw-redirect"&gt;Off-Broadway&lt;/a&gt; plays including &lt;i&gt;Happiness&lt;/i&gt;, &lt;i&gt;Punk Ballet&lt;/i&gt;, and &lt;i&gt;Kids On Stage&lt;/i&gt;, in which she choreographed her own solo dance. She also wrote the introduction to &lt;a href="http://en.wikipedia.org/wiki/Neil_Gaiman" title="Neil Gaiman"&gt;Neil Gaiman's&lt;/a&gt; &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Death:_The_Time_of_Your_Life" title="Death: The Time of Your Life"&gt;Death: The Time of Your Life&lt;/a&gt;&lt;/i&gt;. Danes auditioned for the role of &lt;a href="http://en.wikipedia.org/wiki/Lois_Lane" title="Lois Lane"&gt;Lois Lane&lt;/a&gt; in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Superman_Returns" title="Superman Returns"&gt;Superman Returns&lt;/a&gt;&lt;/i&gt; before the role went to &lt;a href="http://en.wikipedia.org/wiki/Kate_Bosworth" title="Kate Bosworth"&gt;Kate Bosworth&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;In March 2007, Danes appeared with &lt;a href="http://en.wikipedia.org/wiki/Patrick_Wilson_%28actor%29" title="Patrick Wilson (actor)"&gt;Patrick Wilson&lt;/a&gt; in a television commercial for &lt;a href="http://en.wikipedia.org/wiki/Gap_%28clothing_retailer%29" title="Gap (clothing retailer)"&gt;Gap&lt;/a&gt; in which the pair dances to the song " &lt;a href="http://en.wikipedia.org/wiki/Anything_You_Can_Do_%28song%29" title="Anything You Can Do (song)"&gt;Anything You Can Do&lt;/a&gt;" from the musical &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Annie_Get_Your_Gun_%28musical%29" title="Annie Get Your Gun (musical)"&gt;Annie Get Your Gun&lt;/a&gt;&lt;/i&gt;. Danes has recently appeared onstage at Manhattan's &lt;a href="http://en.wikipedia.org/wiki/Performance_Space_122" title="Performance Space 122"&gt;PS122&lt;/a&gt; an &lt;a href="http://en.wikipedia.org/wiki/Avant-garde" title="Avant-garde"&gt;avant-garde&lt;/a&gt; performance space, in a series of dance pieces by choreographer Tamar Rogoff. Danes made her stage debut at PS122 as a child.&lt;sup id="cite_ref-6" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-6"&gt;&lt;span&gt;[&lt;/span&gt;7&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;p&gt;On October 19, 2007, Danes made her &lt;a href="http://en.wikipedia.org/wiki/Broadway_theatre" title="Broadway theatre"&gt;Broadway&lt;/a&gt; debut in the revival of &lt;a href="http://en.wikipedia.org/wiki/George_Bernard_Shaw" title="George Bernard Shaw"&gt;George Bernard Shaw's&lt;/a&gt; &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Pygmalion_%28play%29" title="Pygmalion (play)"&gt;Pygmalion&lt;/a&gt;&lt;/i&gt;, starring as &lt;a href="http://en.wikipedia.org/wiki/Eliza_Doolittle" title="Eliza Doolittle"&gt;Eliza Doolittle&lt;/a&gt;.&lt;sup id="cite_ref-variety_7-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Claire_Danes#cite_note-variety-7"&gt;&lt;span&gt;[&lt;/span&gt;8&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_u4nq3fR1ACc/S02cDpSaxXI/AAAAAAAAALs/w9oZygpBTkA/s1600-h/AngelinaJolie.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_u4nq3fR1ACc/S02cDpSaxXI/AAAAAAAAALs/w9oZygpBTkA/s320/AngelinaJolie.jpg" alt="" id="BLOGGER_PHOTO_ID_5426164712487961970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Angelina Jolie&lt;/b&gt; (born &lt;b&gt;Angelina Jolie Voight&lt;/b&gt;; June 4, 1975) is an American actress. She has received three &lt;a href="http://en.wikipedia.org/wiki/Golden_Globes" title="Golden Globes" class="mw-redirect"&gt;Golden Globe Awards&lt;/a&gt;, two &lt;a href="http://en.wikipedia.org/wiki/Screen_Actors_Guild_Awards" title="Screen Actors Guild Awards"&gt;Screen Actors Guild Awards&lt;/a&gt;, and an &lt;a href="http://en.wikipedia.org/wiki/Academy_Awards" title="Academy Awards" class="mw-redirect"&gt;Academy Award&lt;/a&gt;. Jolie has promoted humanitarian causes throughout the world, and is noted for her work with refugees through as a &lt;a href="http://en.wikipedia.org/wiki/UNHCR_Goodwill_Ambassador" title="UNHCR Goodwill Ambassador" class="mw-redirect"&gt;Goodwill Ambassador&lt;/a&gt; for the &lt;a href="http://en.wikipedia.org/wiki/UNHCR" title="UNHCR" class="mw-redirect"&gt;United Nations High Commissioner for Refugees&lt;/a&gt; (UNHCR). She has been cited as one of the world's most beautiful women and her off-screen life is widely reported.&lt;sup id="cite_ref-Most_Beautiful_0-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Most_Beautiful-0"&gt;&lt;span&gt;[&lt;/span&gt;1&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;p&gt;Though she made her screen debut as a child alongside her father &lt;a href="http://en.wikipedia.org/wiki/Jon_Voight" title="Jon Voight"&gt;Jon Voight&lt;/a&gt; in the 1982 film &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Lookin%27_to_Get_Out" title="Lookin' to Get Out"&gt;Lookin' to Get Out&lt;/a&gt;&lt;/i&gt;, Jolie's acting career began in earnest a decade later with the low-budget production &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Cyborg_2" title="Cyborg 2"&gt;Cyborg 2&lt;/a&gt;&lt;/i&gt; (1993). Her first leading role in a major film was in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Hackers_%28film%29" title="Hackers (film)"&gt;Hackers&lt;/a&gt;&lt;/i&gt; (1995). She starred in the critically acclaimed biographical films &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/George_Wallace_%28film%29" title="George Wallace (film)"&gt;George Wallace&lt;/a&gt;&lt;/i&gt; (1997) and &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Gia" title="Gia"&gt;Gia&lt;/a&gt;&lt;/i&gt; (1998), and won an &lt;a href="http://en.wikipedia.org/wiki/Academy_Award_for_Best_Supporting_Actress" title="Academy Award for Best Supporting Actress"&gt;Academy Award for Best Supporting Actress&lt;/a&gt; for her performance in the drama &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Girl,_Interrupted_%28film%29" title="Girl, Interrupted (film)"&gt;Girl, Interrupted&lt;/a&gt;&lt;/i&gt; (1999). Jolie achieved wider fame after her portrayal of video game heroine &lt;a href="http://en.wikipedia.org/wiki/Lara_Croft" title="Lara Croft"&gt;Lara Croft&lt;/a&gt; in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Lara_Croft:_Tomb_Raider" title="Lara Croft: Tomb Raider"&gt;Lara Croft: Tomb Raider&lt;/a&gt;&lt;/i&gt; (2001), and since then has established herself as one of the best-known and highest-paid actresses in Hollywood.&lt;sup id="cite_ref-1" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-1"&gt;&lt;span&gt;[&lt;/span&gt;2&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; She has had her biggest commercial successes with the action-comedy &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Mr._%26_Mrs._Smith_%282005_film%29" title="Mr. &amp;amp; Mrs. Smith (2005 film)"&gt;Mr. &amp;amp; Mrs. Smith&lt;/a&gt;&lt;/i&gt; (2005) and the animated film &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Kung_Fu_Panda" title="Kung Fu Panda"&gt;Kung Fu Panda&lt;/a&gt;&lt;/i&gt; (2008).&lt;sup id="cite_ref-Angelina_Jolie_Movie_Box_Office_Results_2-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Angelina_Jolie_Movie_Box_Office_Results-2"&gt;&lt;span&gt;[&lt;/span&gt;3&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;p&gt;Divorced from actors &lt;a href="http://en.wikipedia.org/wiki/Jonny_Lee_Miller" title="Jonny Lee Miller"&gt;Jonny Lee Miller&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Billy_Bob_Thornton" title="Billy Bob Thornton"&gt;Billy Bob Thornton&lt;/a&gt;, Jolie currently lives with actor &lt;a href="http://en.wikipedia.org/wiki/Brad_Pitt" title="Brad Pitt"&gt;Brad Pitt&lt;/a&gt;, in a relationship that has attracted worldwide media attention. Jolie and Pitt have three adopted children, Maddox, Pax, and Zahara, as well as three biological children, Shiloh, Knox, and Vivienne.&lt;/p&gt; &lt;table id="toc" class="toc"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt; &lt;div id="toctitle"&gt; &lt;h2&gt;Contents&lt;/h2&gt;  &lt;span class="toctoggle"&gt;[&lt;a href="javascript:toggleToc()" class="internal" id="togglelink"&gt;hide&lt;/a&gt;]&lt;/span&gt;&lt;/div&gt; &lt;ul&gt;&lt;li class="toclevel-1 tocsection-1"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Early_life_and_family"&gt;&lt;span class="tocnumber"&gt;1&lt;/span&gt; &lt;span class="toctext"&gt;Early life and family&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-2"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Early_work.2C_1993.E2.80.931997"&gt;&lt;span class="tocnumber"&gt;2&lt;/span&gt; &lt;span class="toctext"&gt;Early work, 1993–1997&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-3"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Breakthrough.2C_1997.E2.80.932000"&gt;&lt;span class="tocnumber"&gt;3&lt;/span&gt; &lt;span class="toctext"&gt;Breakthrough, 1997–2000&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-4"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#International_success.2C_2001.E2.80.93present"&gt;&lt;span class="tocnumber"&gt;4&lt;/span&gt; &lt;span class="toctext"&gt;International success, 2001–present&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-5"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Humanitarian_work"&gt;&lt;span class="tocnumber"&gt;5&lt;/span&gt; &lt;span class="toctext"&gt;Humanitarian work&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-6"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Relationships"&gt;&lt;span class="tocnumber"&gt;6&lt;/span&gt; &lt;span class="toctext"&gt;Relationships&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-7"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Children"&gt;&lt;span class="tocnumber"&gt;7&lt;/span&gt; &lt;span class="toctext"&gt;Children&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-8"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#In_the_media"&gt;&lt;span class="tocnumber"&gt;8&lt;/span&gt; &lt;span class="toctext"&gt;In the media&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-9"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Tattoos"&gt;&lt;span class="tocnumber"&gt;9&lt;/span&gt; &lt;span class="toctext"&gt;Tattoos&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-10"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Filmography"&gt;&lt;span class="tocnumber"&gt;10&lt;/span&gt; &lt;span class="toctext"&gt;Filmography&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-11"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Awards"&gt;&lt;span class="tocnumber"&gt;11&lt;/span&gt; &lt;span class="toctext"&gt;Awards&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-12"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#References"&gt;&lt;span class="tocnumber"&gt;12&lt;/span&gt; &lt;span class="toctext"&gt;References&lt;/span&gt;&lt;/a&gt; &lt;ul&gt;&lt;li class="toclevel-2 tocsection-13"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Notes"&gt;&lt;span class="tocnumber"&gt;12.1&lt;/span&gt; &lt;span class="toctext"&gt;Notes&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-2 tocsection-14"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#Further_reading"&gt;&lt;span class="tocnumber"&gt;12.2&lt;/span&gt; &lt;span class="toctext"&gt;Further reading&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li class="toclevel-1 tocsection-15"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#External_links"&gt;&lt;span class="tocnumber"&gt;13&lt;/span&gt; &lt;span class="toctext"&gt;External links&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); }  //]]&gt; &lt;/script&gt; &lt;h2&gt;&lt;span class="mw-headline" id="Early_life_and_family"&gt;Early life and family&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;Born in Los Angeles, California, Jolie is the daughter of actors &lt;a href="http://en.wikipedia.org/wiki/Jon_Voight" title="Jon Voight"&gt;Jon Voight&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Marcheline_Bertrand" title="Marcheline Bertrand"&gt;Marcheline Bertrand&lt;/a&gt;. She is the niece of &lt;a href="http://en.wikipedia.org/wiki/Chip_Taylor" title="Chip Taylor"&gt;Chip Taylor&lt;/a&gt;, sister of &lt;a href="http://en.wikipedia.org/wiki/James_Haven" title="James Haven"&gt;James Haven&lt;/a&gt; and the god-daughter of &lt;a href="http://en.wikipedia.org/wiki/Jacqueline_Bisset" title="Jacqueline Bisset"&gt;Jacqueline Bisset&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Maximilian_Schell" title="Maximilian Schell"&gt;Maximilian Schell&lt;/a&gt;. On her father's side, Jolie is of &lt;a href="http://en.wikipedia.org/wiki/Czechoslovakia" title="Czechoslovakia"&gt;Czechoslovakian&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/German_people" title="German people" class="mw-redirect"&gt;German&lt;/a&gt; descent,&lt;sup id="cite_ref-3" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-3"&gt;&lt;span&gt;[&lt;/span&gt;4&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;sup id="cite_ref-4" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-4"&gt;&lt;span&gt;[&lt;/span&gt;5&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; and on her mother's side she is &lt;a href="http://en.wikipedia.org/wiki/French_Canadian" title="French Canadian"&gt;French Canadian&lt;/a&gt; and is said to be part &lt;a href="http://en.wikipedia.org/wiki/Iroquois" title="Iroquois"&gt;Iroquois&lt;/a&gt;.&lt;sup id="cite_ref-5" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-5"&gt;&lt;span&gt;[&lt;/span&gt;6&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;sup id="cite_ref-Wild_at_heart_6-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Wild_at_heart-6"&gt;&lt;span&gt;[&lt;/span&gt;7&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; However, Voight has claimed Bertrand was "not seriously Iroquois", and they merely said it to enhance his ex-wife's exotic background.&lt;sup id="cite_ref-7" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-7"&gt;&lt;span&gt;[&lt;/span&gt;8&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;p&gt;After her parents' separation in 1976, Jolie and her brother were raised by their mother, who abandoned her acting ambitions and moved with them to &lt;a href="http://en.wikipedia.org/wiki/Palisades,_New_York" title="Palisades, New York"&gt;Palisades, New York&lt;/a&gt;.&lt;sup id="cite_ref-Angelina_Jolie:_Body_Beautiful_8-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Angelina_Jolie:_Body_Beautiful-8"&gt;&lt;span&gt;[&lt;/span&gt;9&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; As a child, Jolie regularly saw movies with her mother and later explained that this had inspired her interest in acting; she had not been influenced by her father.&lt;sup id="cite_ref-Angelina_Jolie_Biography_9-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Angelina_Jolie_Biography-9"&gt;&lt;span&gt;[&lt;/span&gt;10&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; When she was eleven years old, the family moved back to Los Angeles and Jolie decided she wanted to act and enrolled at the &lt;a href="http://en.wikipedia.org/wiki/Lee_Strasberg_Theatre_Institute" title="Lee Strasberg Theatre Institute" class="mw-redirect"&gt;Lee Strasberg Theatre Institute&lt;/a&gt;, where she trained for two years and appeared in several stage productions.&lt;/p&gt; &lt;p&gt;At the age of 14, she dropped out of her acting classes and dreamed of becoming a &lt;a href="http://en.wikipedia.org/wiki/Funeral_director" title="Funeral director"&gt;funeral director&lt;/a&gt;.&lt;sup id="cite_ref-10" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-10"&gt;&lt;span&gt;[&lt;/span&gt;11&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; During this period, she wore black clothing, dyed her hair purple and went out &lt;a href="http://en.wikipedia.org/wiki/Moshing" title="Moshing"&gt;moshing&lt;/a&gt; with her live-in boyfriend.&lt;sup id="cite_ref-Angelina_Jolie_Biography_9-1" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Angelina_Jolie_Biography-9"&gt;&lt;span&gt;[&lt;/span&gt;10&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Two years later, after the relationship had ended, she rented an apartment above a garage a few blocks from her mother's home.&lt;sup id="cite_ref-Angelina_Jolie:_Body_Beautiful_8-1" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Angelina_Jolie:_Body_Beautiful-8"&gt;&lt;span&gt;[&lt;/span&gt;9&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; She returned to theatre studies and graduated from high school, though in recent times she has referred to this period with the observation, "I am still at heart—and always will be—just a punk kid with tattoos".&lt;sup id="cite_ref-11" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-11"&gt;&lt;span&gt;[&lt;/span&gt;12&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;p&gt;She later recalled her time as a student at &lt;a href="http://en.wikipedia.org/wiki/Beverly_Hills_High_School" title="Beverly Hills High School"&gt;Beverly Hills High School&lt;/a&gt; (later Moreno High School), and her feeling of isolation among the children of some of the area's more affluent families. Jolie's mother survived on a more modest income, and Jolie often wore second-hand clothes. She was teased by other students who also targeted her for her distinctive features, for being extremely thin, and for wearing glasses and &lt;a href="http://en.wikipedia.org/wiki/Dental_braces" title="Dental braces"&gt;braces&lt;/a&gt;.&lt;sup id="cite_ref-Angelina_Jolie_Biography_9-2" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Angelina_Jolie_Biography-9"&gt;&lt;span&gt;[&lt;/span&gt;10&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Her self-esteem was further diminished when her initial attempts at modeling proved unsuccessful. She started to &lt;a href="http://en.wikipedia.org/wiki/Self-injury" title="Self-injury" class="mw-redirect"&gt;cut herself&lt;/a&gt;; later commenting, "I collected knives and always had certain things around. For some reason, the ritual of having cut myself and feeling the pain, maybe feeling alive, feeling some kind of release, it was somehow therapeutic to me."&lt;sup id="cite_ref-12" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-12"&gt;&lt;span&gt;[&lt;/span&gt;13&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;p&gt;Jolie has been long estranged from her father. The two tried to reconcile and he appeared with her in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Lara_Croft:_Tomb_Raider" title="Lara Croft: Tomb Raider"&gt;Lara Croft: Tomb Raider&lt;/a&gt;&lt;/i&gt; (2001).&lt;sup id="cite_ref-Angelina_Jolie:_Body_Beautiful_8-2" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Angelina_Jolie:_Body_Beautiful-8"&gt;&lt;span&gt;[&lt;/span&gt;9&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; In July 2002, Jolie filed a request to legally change her name to "Angelina Jolie", dropping Voight as her surname; the name change was made official on September 12, 2002.&lt;sup id="cite_ref-Angelina_Jolie.27s_Name_Interrupted_13-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-Angelina_Jolie.27s_Name_Interrupted-13"&gt;&lt;span&gt;[&lt;/span&gt;14&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; In August of the same year, Voight claimed that his daughter had "serious mental problems" on &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Access_Hollywood" title="Access Hollywood"&gt;Access Hollywood&lt;/a&gt;&lt;/i&gt;. Jolie later indicated that she no longer wished to pursue a relationship with her father, and said, "My father and I don't speak. I don't hold any anger toward him. I don't believe that somebody's family becomes their blood. Because my son's adopted, and families are earned." She stated that she did not want to publicize her reasons for her estrangement from her father, but because she had adopted her son, she did not think it was healthy for her to associate with Voight.&lt;sup id="cite_ref-14" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Angelina_jolie#cite_note-14"&gt;&lt;span&gt;[&lt;/span&gt;15&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;h2&gt;&lt;span class="mw-headline" id="Early_work.2C_1993.E2.80.931997"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_u4nq3fR1ACc/S02cDdwrjHI/AAAAAAAAALk/nDbnK-7oD0U/s1600-h/amanda_peet.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 227px; height: 302px;" src="http://4.bp.blogspot.com/_u4nq3fR1ACc/S02cDdwrjHI/AAAAAAAAALk/nDbnK-7oD0U/s320/amanda_peet.jpg" alt="" id="BLOGGER_PHOTO_ID_5426164709393665138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Amanda Peet&lt;/b&gt; (born January 11, 1972) is an American actress.&lt;/p&gt; &lt;p&gt;After studying with &lt;a href="http://en.wikipedia.org/wiki/Uta_Hagen" title="Uta Hagen"&gt;Uta Hagen&lt;/a&gt;, Peet began her career in television commercials, and progressed to small roles in television and &lt;a href="http://en.wikipedia.org/wiki/Indie_movie" title="Indie movie" class="mw-redirect"&gt;indie movies&lt;/a&gt;. Featured roles in films such as &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Whole_Nine_Yards_%28film%29" title="The Whole Nine Yards (film)"&gt;The Whole Nine Yards&lt;/a&gt;&lt;/i&gt; (2000) brought her recognition and she was named one of &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/People_%28magazine%29" title="People (magazine)"&gt;People's&lt;/a&gt;&lt;/i&gt; "50 Most Beautiful People in the World". Her subsequent film roles have been more prominent, and include &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Something%27s_Gotta_Give_%28film%29" title="Something's Gotta Give (film)"&gt;Something's Gotta Give&lt;/a&gt;&lt;/i&gt; (2003), &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Syriana" title="Syriana"&gt;Syriana&lt;/a&gt;&lt;/i&gt; (2005), and &lt;a href="http://en.wikipedia.org/wiki/2012_%28film%29" title="2012 (film)"&gt;2012&lt;/a&gt; (2009).&lt;/p&gt; &lt;table id="toc" class="toc"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt; &lt;div id="toctitle"&gt; &lt;h2&gt;Contents&lt;/h2&gt;  &lt;span class="toctoggle"&gt;[&lt;a href="javascript:toggleToc()" class="internal" id="togglelink"&gt;hide&lt;/a&gt;]&lt;/span&gt;&lt;/div&gt; &lt;ul&gt;&lt;li class="toclevel-1 tocsection-1"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#Life_and_career"&gt;&lt;span class="tocnumber"&gt;1&lt;/span&gt; &lt;span class="toctext"&gt;Life and career&lt;/span&gt;&lt;/a&gt; &lt;ul&gt;&lt;li class="toclevel-2 tocsection-2"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#Early_life"&gt;&lt;span class="tocnumber"&gt;1.1&lt;/span&gt; &lt;span class="toctext"&gt;Early life&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-2 tocsection-3"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#Career"&gt;&lt;span class="tocnumber"&gt;1.2&lt;/span&gt; &lt;span class="toctext"&gt;Career&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-2 tocsection-4"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#Personal_life"&gt;&lt;span class="tocnumber"&gt;1.3&lt;/span&gt; &lt;span class="toctext"&gt;Personal life&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li class="toclevel-1 tocsection-5"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#Filmography"&gt;&lt;span class="tocnumber"&gt;2&lt;/span&gt; &lt;span class="toctext"&gt;Filmography&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-6"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#References"&gt;&lt;span class="tocnumber"&gt;3&lt;/span&gt; &lt;span class="toctext"&gt;References&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="toclevel-1 tocsection-7"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#External_links"&gt;&lt;span class="tocnumber"&gt;4&lt;/span&gt; &lt;span class="toctext"&gt;External links&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); }  //]]&gt; &lt;/script&gt; &lt;h2&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Amanda_Peet&amp;amp;action=edit&amp;amp;section=1" title="Edit section: Life and career"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Life_and_career"&gt;Life and career&lt;/span&gt;&lt;/h2&gt; &lt;h3&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Amanda_Peet&amp;amp;action=edit&amp;amp;section=2" title="Edit section: Early life"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Early_life"&gt;Early life&lt;/span&gt;&lt;/h3&gt; &lt;p&gt;Peet was born in &lt;a href="http://en.wikipedia.org/wiki/New_York_City" title="New York City"&gt;New York City&lt;/a&gt;, the daughter of Penny (&lt;a href="http://en.wikipedia.org/wiki/Married_and_maiden_names" title="Married and maiden names"&gt;née&lt;/a&gt; Levy), a social worker, and Charles Peet, a corporate &lt;a href="http://en.wikipedia.org/wiki/Lawyer" title="Lawyer"&gt;lawyer&lt;/a&gt;.&lt;sup id="cite_ref-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-0"&gt;&lt;span&gt;[&lt;/span&gt;1&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; The two are now divorced. Her father is a &lt;a href="http://en.wikipedia.org/wiki/Quaker" title="Quaker" class="mw-redirect"&gt;Quaker&lt;/a&gt; and her mother is &lt;a href="http://en.wikipedia.org/wiki/Jew" title="Jew"&gt;Jewish&lt;/a&gt;.&lt;sup id="cite_ref-1" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-1"&gt;&lt;span&gt;[&lt;/span&gt;2&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;sup id="cite_ref-2" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-2"&gt;&lt;span&gt;[&lt;/span&gt;3&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Peet attended &lt;a href="http://en.wikipedia.org/wiki/Friends_Seminary" title="Friends Seminary"&gt;Friends Seminary&lt;/a&gt;, then studied history at and graduated from &lt;a href="http://en.wikipedia.org/wiki/Columbia_University" title="Columbia University"&gt;Columbia University&lt;/a&gt;,&lt;sup id="cite_ref-Peet1_3-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-Peet1-3"&gt;&lt;span&gt;[&lt;/span&gt;4&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; where she auditioned for acting teacher &lt;a href="http://en.wikipedia.org/wiki/Uta_Hagen" title="Uta Hagen"&gt;Uta Hagen&lt;/a&gt; and decided to become an actress after taking Hagen's class.&lt;sup id="cite_ref-blinddate_4-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-blinddate-4"&gt;&lt;span&gt;[&lt;/span&gt;5&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; During her four-year period of study with Hagen, Peet appeared in the &lt;a href="http://en.wikipedia.org/wiki/Off-Broadway" title="Off-Broadway" class="mw-redirect"&gt;off-Broadway&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Revival_%28play%29" title="Revival (play)" class="mw-redirect"&gt;revival&lt;/a&gt; of &lt;a href="http://en.wikipedia.org/wiki/Clifford_Odets" title="Clifford Odets"&gt;Clifford Odets&lt;/a&gt;'s &lt;i&gt;Awake and Sing&lt;/i&gt;.&lt;/p&gt; &lt;h3&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Amanda_Peet&amp;amp;action=edit&amp;amp;section=3" title="Edit section: Career"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Career"&gt;Career&lt;/span&gt;&lt;/h3&gt; &lt;p&gt;Peet's first screen performance was a &lt;a href="http://en.wikipedia.org/wiki/Television_commercial" title="Television commercial" class="mw-redirect"&gt;television commercial&lt;/a&gt; for &lt;a href="http://en.wikipedia.org/wiki/Skittles_%28candy%29" title="Skittles (candy)" class="mw-redirect"&gt;Skittles&lt;/a&gt;. Her early roles included a guest role on the television series &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Law_%26_Order" title="Law &amp;amp; Order"&gt;Law &amp;amp; Order&lt;/a&gt;&lt;/i&gt;. She made her film debut in &lt;i&gt;&lt;a href="http://en.wikipedia.org/w/index.php?title=Animal_Room&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Animal Room (page does not exist)"&gt;Animal Room&lt;/a&gt;&lt;/i&gt; (1995). Peet maintained a steady acting career in relatively obscure &lt;a href="http://en.wikipedia.org/wiki/Indie_movie" title="Indie movie" class="mw-redirect"&gt;indie movies&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Her first major role was as "Jack" in the 1999 WB network series &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Jack_%26_Jill_%28TV_series%29" title="Jack &amp;amp; Jill (TV series)"&gt;Jack &amp;amp; Jill&lt;/a&gt;&lt;/i&gt; (which aired for two seasons). She also appeared in the eighth-season finale of &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Seinfeld" title="Seinfeld"&gt;Seinfeld&lt;/a&gt;&lt;/i&gt; ("&lt;a href="http://en.wikipedia.org/wiki/The_Summer_of_George" title="The Summer of George"&gt;The Summer of George&lt;/a&gt;") as a waitress whom &lt;a href="http://en.wikipedia.org/wiki/Jerry_Seinfeld_%28character%29" title="Jerry Seinfeld (character)"&gt;Jerry Seinfeld&lt;/a&gt; meets. Peet's first role in a widely-released feature film came in 2000, with &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Whole_Nine_Yards_%28film%29" title="The Whole Nine Yards (film)"&gt;The Whole Nine Yards&lt;/a&gt;&lt;/i&gt;, starring with &lt;a href="http://en.wikipedia.org/wiki/Bruce_Willis" title="Bruce Willis"&gt;Bruce Willis&lt;/a&gt;. That same year, she was voted one of the 50 Most Beautiful People in the World by &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/People_%28magazine%29" title="People (magazine)"&gt;People&lt;/a&gt;&lt;/i&gt; magazine. Peet was also in the movie &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Saving_Silverman" title="Saving Silverman"&gt;Saving Silverman&lt;/a&gt;&lt;/i&gt; with &lt;a href="http://en.wikipedia.org/wiki/Jason_Biggs" title="Jason Biggs"&gt;Jason Biggs&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Jack_Black" title="Jack Black"&gt;Jack Black&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Steve_Zahn" title="Steve Zahn"&gt;Steve Zahn&lt;/a&gt;, where she portrayed psychologist Judith. She also starred in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Something%27s_Gotta_Give_%28film%29" title="Something's Gotta Give (film)"&gt;Something's Gotta Give&lt;/a&gt;&lt;/i&gt; in 2003, playing &lt;a href="http://en.wikipedia.org/wiki/Diane_Keaton" title="Diane Keaton"&gt;Diane Keaton&lt;/a&gt;'s daughter, and, at one point, &lt;a href="http://en.wikipedia.org/wiki/Jack_Nicholson" title="Jack Nicholson"&gt;Jack Nicholson&lt;/a&gt;'s girlfriend.&lt;/p&gt; &lt;p&gt;In 2005, Peet appeared in the play &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/This_Is_How_It_Goes" title="This Is How It Goes"&gt;This Is How It Goes&lt;/a&gt;&lt;/i&gt;, filling in for &lt;a href="http://en.wikipedia.org/wiki/Marisa_Tomei" title="Marisa Tomei"&gt;Marisa Tomei&lt;/a&gt; at the last minute after six days of rehearsal. In the same year, she also co-starred in the films &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Syriana" title="Syriana"&gt;Syriana&lt;/a&gt;&lt;/i&gt; alongside &lt;a href="http://en.wikipedia.org/wiki/Matt_Damon" title="Matt Damon"&gt;Matt Damon&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/George_Clooney" title="George Clooney"&gt;George Clooney&lt;/a&gt;, and &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/A_Lot_Like_Love" title="A Lot Like Love"&gt;A Lot Like Love&lt;/a&gt;&lt;/i&gt;, with &lt;a href="http://en.wikipedia.org/wiki/Ashton_Kutcher" title="Ashton Kutcher"&gt;Ashton Kutcher&lt;/a&gt;. In February 2006, she was performing in &lt;a href="http://en.wikipedia.org/wiki/Neil_Simon" title="Neil Simon"&gt;Neil Simon&lt;/a&gt;'s &lt;a href="http://en.wikipedia.org/wiki/Broadway_theatre" title="Broadway theatre"&gt;Broadway&lt;/a&gt; production of &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Barefoot_in_the_Park" title="Barefoot in the Park"&gt;Barefoot in the Park&lt;/a&gt;&lt;/i&gt;.&lt;/p&gt; &lt;p&gt;Peet was a member of the cast of the television series &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Studio_60_on_the_Sunset_Strip" title="Studio 60 on the Sunset Strip"&gt;Studio 60 on the Sunset Strip&lt;/a&gt;&lt;/i&gt;, which premiered on &lt;a href="http://en.wikipedia.org/wiki/NBC" title="NBC"&gt;NBC&lt;/a&gt; on September 18, 2006. She starred with &lt;a href="http://en.wikipedia.org/wiki/Matthew_Perry_%28actor%29" title="Matthew Perry (actor)" class="mw-redirect"&gt;Matthew Perry&lt;/a&gt;, with whom she worked in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Whole_Nine_Yards_%28film%29" title="The Whole Nine Yards (film)"&gt;The Whole Nine Yards&lt;/a&gt;&lt;/i&gt; and &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Whole_Ten_Yards" title="The Whole Ten Yards"&gt;The Whole Ten Yards&lt;/a&gt;&lt;/i&gt;, and &lt;a href="http://en.wikipedia.org/wiki/Sarah_Paulson" title="Sarah Paulson"&gt;Sarah Paulson&lt;/a&gt;, with whom she co-starred in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Jack_%26_Jill_%28TV_series%29" title="Jack &amp;amp; Jill (TV series)"&gt;Jack &amp;amp; Jill&lt;/a&gt;&lt;/i&gt;. In &lt;i&gt;Studio 60&lt;/i&gt;, Peet's character &lt;a href="http://en.wikipedia.org/wiki/Jordan_McDeere" title="Jordan McDeere"&gt;Jordan McDeere&lt;/a&gt; was the newly-appointed president of the National Broadcasting System (NBS). In 2006, she also starred along with Dermot Mulroney in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Griffin_and_Phoenix" title="Griffin and Phoenix"&gt;Griffin and Phoenix&lt;/a&gt;&lt;/i&gt;, where she played a terminally-ill woman living life to the fullest.&lt;/p&gt; &lt;p&gt;In 2007's &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_Ex_%282007_film%29" title="The Ex (2007 film)"&gt;The Ex&lt;/a&gt;&lt;/i&gt;, a comedy co-starring &lt;a href="http://en.wikipedia.org/wiki/Zach_Braff" title="Zach Braff"&gt;Zach Braff&lt;/a&gt;, Peet played an attorney who stays home to raise a new baby. In 2008, Peet went on to play an FBI agent in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/The_X-Files:_I_Want_to_Believe" title="The X-Files: I Want to Believe"&gt;The X-Files: I Want to Believe&lt;/a&gt;&lt;/i&gt;.&lt;sup id="cite_ref-5" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-5"&gt;&lt;span&gt;[&lt;/span&gt;6&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;p&gt;Peet starred as Kate in &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/2012_%28film%29" title="2012 (film)"&gt;2012&lt;/a&gt;&lt;/i&gt;, a disaster film directed by &lt;a href="http://en.wikipedia.org/wiki/Roland_Emmerich" title="Roland Emmerich"&gt;Roland Emmerich&lt;/a&gt; and released on November 13, 2009.&lt;/p&gt; &lt;h3&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Amanda_Peet&amp;amp;action=edit&amp;amp;section=4" title="Edit section: Personal life"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Personal_life"&gt;Personal life&lt;/span&gt;&lt;/h3&gt; &lt;div class="thumb tright"&gt; &lt;div class="thumbinner" style="width: 142px;"&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Amanda_Peet_@_TIFF_01-2.jpg" class="image"&gt;&lt;img alt="" src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/63/Amanda_Peet_%40_TIFF_01-2.jpg/140px-Amanda_Peet_%40_TIFF_01-2.jpg" class="thumbimage" width="140" height="222" /&gt;&lt;/a&gt; &lt;div class="thumbcaption"&gt; &lt;div class="magnify"&gt;&lt;a href="http://en.wikipedia.org/wiki/File:Amanda_Peet_@_TIFF_01-2.jpg" class="internal" title="Enlarge"&gt;&lt;img src="http://bits.wikimedia.org/skins-1.5/common/images/magnify-clip.png" alt="" width="15" height="11" /&gt;&lt;/a&gt;&lt;/div&gt; Peet at the 2009 &lt;a href="http://en.wikipedia.org/wiki/Toronto_International_Film_Festival" title="Toronto International Film Festival"&gt;Toronto International Film Festival&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;Peet married screenwriter &lt;a href="http://en.wikipedia.org/wiki/David_Benioff" title="David Benioff"&gt;David Benioff&lt;/a&gt; on September 30, 2006, in &lt;a href="http://en.wikipedia.org/wiki/New_York_City" title="New York City"&gt;New York City&lt;/a&gt;&lt;sup id="cite_ref-6" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-6"&gt;&lt;span&gt;[&lt;/span&gt;7&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; and gave birth to a daughter, Frances Pen, on February 20, 2007.&lt;sup id="cite_ref-7" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-7"&gt;&lt;span&gt;[&lt;/span&gt;8&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; The three live in &lt;a href="http://en.wikipedia.org/wiki/Manhattan" title="Manhattan"&gt;Manhattan&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Beverly_Hills,_California" title="Beverly Hills, California"&gt;Beverly Hills&lt;/a&gt;. She was also maid of honor at &lt;a href="http://en.wikipedia.org/wiki/Lauren_Holly" title="Lauren Holly"&gt;Lauren Holly&lt;/a&gt;'s marriage in 2001 with Francis Greco.&lt;/p&gt; &lt;p&gt;On December 10, 2009 she announced that she and David would be expecting their second child. &lt;sup id="cite_ref-8" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-8"&gt;&lt;span&gt;[&lt;/span&gt;9&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;p&gt;In 2008 Peet volunteered to be a spokeswoman for &lt;a href="http://en.wikipedia.org/wiki/Every_Child_By_Two" title="Every Child By Two"&gt;Every Child By Two&lt;/a&gt; (ECBT), a &lt;a href="http://en.wikipedia.org/wiki/Non-profit_organization" title="Non-profit organization"&gt;non-profit organization&lt;/a&gt; which advocates &lt;a href="http://en.wikipedia.org/wiki/Vaccination" title="Vaccination"&gt;childhood vaccination&lt;/a&gt;. Peet began working with the group after becoming concerned by the "amount of misinformation floating around [about vaccines], particularly in Hollywood."&lt;sup id="cite_ref-cookie_9-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-cookie-9"&gt;&lt;span&gt;[&lt;/span&gt;10&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; In an interview with &lt;i&gt;&lt;a href="http://en.wikipedia.org/wiki/Cookie_%28magazine%29" title="Cookie (magazine)"&gt;Cookie&lt;/a&gt;&lt;/i&gt;, Peet stated: "Frankly, I feel that parents who don't vaccinate their children are parasites," referring to the benefit unvaccinated children derive from &lt;a href="http://en.wikipedia.org/wiki/Herd_immunity" title="Herd immunity"&gt;herd immunity&lt;/a&gt; and the concern that dropping vaccination rates may put all children at increased risk of preventable disease.&lt;sup id="cite_ref-cookie_9-1" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-cookie-9"&gt;&lt;span&gt;[&lt;/span&gt;10&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Peet's comments stirred controversy; in response, she apologized for using the term "parasites", but affirmed her position on the importance and safety of vaccination.&lt;sup id="cite_ref-cookie-response_10-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-cookie-response-10"&gt;&lt;span&gt;[&lt;/span&gt;11&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;sup id="cite_ref-11" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Amanda_Peet#cite_note-11"&gt;&lt;span&gt;[&lt;/span&gt;12&lt;span&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;h2&gt;&lt;span class="editsection"&gt;[&lt;a href="http://en.wikipedia.org/w/index.php?title=Amanda_Peet&amp;amp;action=edit&amp;amp;section=5" title="Edit section: Filmography"&gt;edit&lt;/a&gt;]&lt;/span&gt; &lt;span class="mw-headline" id="Filmography"&gt;Filmography&lt;/span&gt;&lt;/h2&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-1269960419492061345?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/1269960419492061345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=1269960419492061345' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/1269960419492061345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/1269960419492061345'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2010/01/images-test-for-wibiya-share-app.html' title='Images test for Wibiya Share app'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_u4nq3fR1ACc/S02cEBxz3eI/AAAAAAAAAL8/NkGwQIiJo1s/s72-c/Heidi_Klum_079.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-7831737859945982879</id><published>2009-01-29T06:18:00.000-08:00</published><updated>2009-01-29T06:18:00.200-08:00</updated><title type='text'>How to: Define Value Equality for a Type (C# Programming)</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;div class='introduction'&gt;&lt;p&gt; When you define a class or struct, you&lt;br /&gt;decide whether it makes sense to create a custom definition of value&lt;br /&gt;equality (or equivalence) for the type. Typically, you implement value&lt;br /&gt;equality when objects of the type are expected to be added to a&lt;br /&gt;collection of some sort, or when their primary purpose is to store a&lt;br /&gt;set of fields or properties. You can base your definition of value&lt;br /&gt;equality on a comparison of all the fields and properties in the type,&lt;br /&gt;or you can base the definition on a subset. But in either case, and in&lt;br /&gt;both classes and structs, your implementation should follow the five&lt;br /&gt;guarantees of equivalence: &lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    x.&lt;strong&gt;Equals&lt;/strong&gt;(x) returns &lt;span&gt;&lt;span class='input'&gt;true. &lt;/span&gt;&lt;/span&gt;This is called the reflexive property.&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    x.&lt;strong&gt;Equals&lt;/strong&gt;(y) returns the same value as y.&lt;strong&gt;Equals&lt;/strong&gt;(x). This is called the symmetric property.&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    if (x.&lt;strong&gt;Equals&lt;/strong&gt;(y) &amp;amp;&amp;amp; y.&lt;strong&gt;Equals&lt;/strong&gt;(z)) returns &lt;span&gt;&lt;span class='input'&gt;true&lt;/span&gt;&lt;/span&gt;, then x.&lt;strong&gt;Equals&lt;/strong&gt;(z) returns &lt;span&gt;&lt;span class='input'&gt;true&lt;/span&gt;&lt;/span&gt;. This is called the transitive property.&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    Successive invocations of x.&lt;strong&gt;Equals&lt;/strong&gt;(y) return the same value as long as the objects referenced by x and y are not modified.&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    x.&lt;strong&gt;Equals&lt;/strong&gt;(null) returns &lt;span&gt;&lt;span class='input'&gt;false&lt;/span&gt;&lt;/span&gt;. However, null.Equals(null) throws an exception; it does not obey rule number two above.&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br /&gt;                    Any struct that you define already has a default implementation of value equality that it inherits from the &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/system.valuetype.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl01&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl01'&gt;System&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;ValueType&lt;/a&gt;&lt;/span&gt; override of the &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl03&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl03'&gt;Object&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;Equals(Object)&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;method. This implementation uses reflection to examine all the public&lt;br /&gt;and non-public fields and properties in the type. Although this&lt;br /&gt;implementation produces correct results, it is relatively slow compared&lt;br /&gt;to a custom implementation that you write specifically for the type. &lt;/p&gt;&lt;p&gt; The implementation details for value equality&lt;br /&gt;are different for classes and structs. However, both classes and&lt;br /&gt;structs require the same basic steps for implementing equality: &lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    Override the &lt;a href='http://msdn.microsoft.com/en-us/library/9fkccyh4.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl05&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl05'&gt;virtual&lt;/a&gt; &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl06&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl06'&gt;Object&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;Equals(Object)&lt;/a&gt;&lt;/span&gt; method. In most cases, your implementation of &lt;span class='code'&gt;bool Equals( object obj )&lt;/span&gt; should just call into the type-specific &lt;span&gt;&lt;span class='input'&gt;Equals&lt;/span&gt;&lt;/span&gt; method that is the implementation of the &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/ms131187.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl08&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl08'&gt;System&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;IEquatable&lt;span class='cs'&gt;&amp;lt;&lt;/span&gt;&lt;span class='vb'&gt;(Of &lt;/span&gt;&lt;span class='cpp'&gt;&amp;lt;&lt;/span&gt;&lt;span class='nu'&gt;(&lt;/span&gt;T&lt;span class='cs'&gt;&amp;gt;&lt;/span&gt;&lt;span class='vb'&gt;)&lt;/span&gt;&lt;span class='cpp'&gt;&amp;gt;&lt;/span&gt;&lt;span class='nu'&gt;)&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; interface. (See step 2.)&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    Implement the &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/ms131187.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl12&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl12'&gt;System&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;IEquatable&lt;span class='cs'&gt;&amp;lt;&lt;/span&gt;&lt;span class='vb'&gt;(Of &lt;/span&gt;&lt;span class='cpp'&gt;&amp;lt;&lt;/span&gt;&lt;span class='nu'&gt;(&lt;/span&gt;T&lt;span class='cs'&gt;&amp;gt;&lt;/span&gt;&lt;span class='vb'&gt;)&lt;/span&gt;&lt;span class='cpp'&gt;&amp;gt;&lt;/span&gt;&lt;span class='nu'&gt;)&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; interface by providing a type-specific &lt;span&gt;&lt;span class='input'&gt;Equals&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;method. This is where the actual equivalence comparison is performed.&lt;br /&gt;For example, you might decide to define equality by comparing only one&lt;br /&gt;or two fields in your type. Do not throw exceptions from &lt;span&gt;&lt;span class='input'&gt;Equals&lt;/span&gt;&lt;/span&gt;. For classes only: This method should examine only fields that are declared in the class. It should call &lt;span&gt;&lt;span class='input'&gt;base.Equals&lt;/span&gt;&lt;/span&gt; to examine fields that are in the base class. (Do not do this if the type inherits directly from &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/system.object.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl16&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl16'&gt;Object&lt;/a&gt;&lt;/span&gt;, because the &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/system.object.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl17&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl17'&gt;Object&lt;/a&gt;&lt;/span&gt; implementation of &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl18&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl18'&gt;Object&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;Equals(Object)&lt;/a&gt;&lt;/span&gt; performs a reference equality check.) &lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    Optional but recommended: Overload the &lt;a href='http://msdn.microsoft.com/en-us/library/53k8ybth.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl20&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl20'&gt;==&lt;/a&gt; and &lt;a href='http://msdn.microsoft.com/en-us/library/3tz250sf.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl21&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl21'&gt;!=&lt;/a&gt; operators.&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    Override &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl22&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl22'&gt;Object&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;GetHashCode&lt;/a&gt;&lt;/span&gt; so that two objects that have value equality produce the same hash code.&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;br /&gt;                    Optional: To support definitions for "greater than" or "less than," implement the &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/4d7sx9hd.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl24&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl24'&gt;IComparable&lt;span class='cs'&gt;&amp;lt;&lt;/span&gt;&lt;span class='vb'&gt;(Of &lt;/span&gt;&lt;span class='cpp'&gt;&amp;lt;&lt;/span&gt;&lt;span class='nu'&gt;(&lt;/span&gt;T&lt;span class='cs'&gt;&amp;gt;&lt;/span&gt;&lt;span class='vb'&gt;)&lt;/span&gt;&lt;span class='cpp'&gt;&amp;gt;&lt;/span&gt;&lt;span class='nu'&gt;)&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; interface for your type, and also overload the &lt;a href='http://msdn.microsoft.com/en-us/library/hx063734.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl27&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl27'&gt;&amp;lt;=&lt;/a&gt; and &lt;a href='http://msdn.microsoft.com/en-us/library/a59bsyk4.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_ctl00|ctl00_rs1_mainContentContainer_ctl28&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl28'&gt;&amp;gt;=&lt;/a&gt; operators.&lt;br /&gt;                &lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br /&gt;The first example that follows shows a class implementation. The second&lt;br /&gt;example shows a struct implementation. &lt;/p&gt;&lt;/div&gt;&lt;div class='MTPS_CollapsibleRegion' id='ctl00_rs1_mainContentContainer_cpe198786'&gt;&lt;br /&gt;			&lt;div class='CollapseRegionLink' id='ctl00_rs1_mainContentContainer_cpe198786_h'&gt;&lt;br /&gt;				&lt;img style='border-width: 0px; vertical-align: middle;' src='http://i.msdn.microsoft.com/Global/Images/clear.gif' class='LibC_o' id='ctl00_rs1_mainContentContainer_cpe198786_i'/&gt; Example&lt;br /&gt;			&lt;/div&gt;&lt;div class='MTPS_CollapsibleSection' id='ctl00_rs1_mainContentContainer_cpe198786_c' style='overflow: visible; display: block; height: auto; width: 1393px;'&gt;&lt;div class='MTPS_CollapsibleSection' id='' style='display: block;'&gt;&lt;br /&gt;				&lt;a id='exampleToggle'/&gt;&lt;p&gt;&lt;br /&gt;                    The following example shows how to implement value equality in a class (reference type). &lt;br /&gt;                &lt;/p&gt;&lt;div id='snippetGroup'&gt;&lt;div id='ctl00_rs1_mainContentContainer_ctl41_CSharp' class='libCScode'&gt;&lt;div class='CodeSnippetTitleBar'&gt;&lt;div class='CodeDisplayLanguage'&gt;C#&lt;/div&gt;&lt;div class='CopyCodeButton'&gt;&lt;a href='javascript:CopyCode(&amp;apos;ctl00_rs1_mainContentContainer_ctl41CSharp&amp;apos;);' title='Copy Code' class='copyCode'&gt;&lt;img height='9' border='0' align='middle' src='http://i.msdn.microsoft.com/Global/Images/clear.gif' class='LibC_copy_off'/&gt; Copy Code&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir='ltr'&gt;&lt;pre space='preserve' id='ctl00_rs1_mainContentContainer_ctl41CSharp' style='white-space: pre-wrap;' class='libCScode'&gt;&amp;lt;span style="color: blue;"&amp;gt;namespace&amp;lt;/span&amp;gt; ValueEquality&amp;lt;br /&amp;gt;{&amp;lt;br /&amp;gt;    &amp;lt;span style="color: blue;"&amp;gt;using&amp;lt;/span&amp;gt; System;&amp;lt;br /&amp;gt;    &amp;lt;span style="color: blue;"&amp;gt;class&amp;lt;/span&amp;gt; TwoDPoint : IEquatable&amp;lt;TwoDPoint&amp;gt;&amp;lt;br /&amp;gt;    {&amp;lt;br /&amp;gt;        &amp;lt;span style="color: green;"&amp;gt;// Readonly auto-implemented properties.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; X { &amp;lt;span style="color: blue;"&amp;gt;get&amp;lt;/span&amp;gt;; &amp;lt;span style="color: blue;"&amp;gt;private&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;set&amp;lt;/span&amp;gt;; }&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; Y { &amp;lt;span style="color: blue;"&amp;gt;get&amp;lt;/span&amp;gt;; &amp;lt;span style="color: blue;"&amp;gt;private&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;set&amp;lt;/span&amp;gt;; }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: green;"&amp;gt;// Set the properties in the constructor.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; TwoDPoint(&amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; x, &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; y)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; ((x &amp;lt; 1) || (x &amp;gt; 2000) || (y &amp;lt; 1) || (y &amp;gt; 2000))&amp;lt;br /&amp;gt;                throw &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; System.ArgumentException(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"Point must be in range 1 - 2000"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;);&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;.X = x;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;.Y = y;&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; override &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; Equals(object obj)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;.Equals(obj as TwoDPoint);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; Equals(TwoDPoint p)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// If parameter is null, return false.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (Object.ReferenceEquals(p, &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;))&amp;lt;br /&amp;gt;            {&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;false&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Optimization for a common success case.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (Object.ReferenceEquals(&amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;, p))&amp;lt;br /&amp;gt;            {&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;true&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// If run-time types are not exactly the same, return false.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (&amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;.GetType() != p.GetType())&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;false&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Return true if the fields match.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Note that the base class is not invoked because it is&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// System.Object, which defines Equals as reference equality.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; (X == p.X) &amp;amp;&amp;amp; (Y == p.Y);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; override &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; GetHashCode()&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; X * 0x00010000 + Y;&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; operator ==(TwoDPoint lhs, TwoDPoint rhs)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Check for null on left side.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (Object.ReferenceEquals(lhs, &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;))&amp;lt;br /&amp;gt;            {&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (Object.ReferenceEquals(rhs, &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;))&amp;lt;br /&amp;gt;                {&amp;lt;br /&amp;gt;                    &amp;lt;span style="color: green;"&amp;gt;// null == null = true.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;                    &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;true&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;                }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;                &amp;lt;span style="color: green;"&amp;gt;// Only the left side is null.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;false&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            }&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Equals handles case of null on right side.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; lhs.Equals(rhs);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; operator !=(TwoDPoint lhs, TwoDPoint rhs)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; !(lhs == rhs);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;    }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;    &amp;lt;span style="color: green;"&amp;gt;// For the sake of simplicity, assume a ThreeDPoint IS a TwoDPoint.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;    &amp;lt;span style="color: blue;"&amp;gt;class&amp;lt;/span&amp;gt; ThreeDPoint : TwoDPoint, IEquatable&amp;lt;ThreeDPoint&amp;gt;&amp;lt;br /&amp;gt;    {&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; Z { &amp;lt;span style="color: blue;"&amp;gt;get&amp;lt;/span&amp;gt;; &amp;lt;span style="color: blue;"&amp;gt;private&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;set&amp;lt;/span&amp;gt;; }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; ThreeDPoint(&amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; x, &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; y, &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; z)&amp;lt;br /&amp;gt;            : &amp;lt;span style="color: blue;"&amp;gt;base&amp;lt;/span&amp;gt;(x, y)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; ((z &amp;lt; 1) || (z &amp;gt; 2000))&amp;lt;br /&amp;gt;                throw &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; System.ArgumentException(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"Point must be in range 1 - 2000"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;);&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;.Z = z;&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; override &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; Equals(object obj)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;.Equals(obj as ThreeDPoint);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; Equals(ThreeDPoint p)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// If parameter is null, return false.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (Object.ReferenceEquals(p, &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;))&amp;lt;br /&amp;gt;            {&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;false&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Optimization for a common success case.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt;(Object.ReferenceEquals(&amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;, p))&amp;lt;br /&amp;gt;            {&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;true&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Check properties that this class declares.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (Z == p.Z)&amp;lt;br /&amp;gt;            {&amp;lt;br /&amp;gt;                &amp;lt;span style="color: green;"&amp;gt;// Let base class check its own fields &amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;                &amp;lt;span style="color: green;"&amp;gt;// and do the run-time type comparison.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;base&amp;lt;/span&amp;gt;.Equals((TwoDPoint)p);&amp;lt;br /&amp;gt;            }&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;else&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;false&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; override &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; GetHashCode()&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; (X * 0x100000) + (Y * 0x1000) + Z;&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; operator ==(ThreeDPoint lhs, ThreeDPoint rhs)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Check for null.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (Object.ReferenceEquals(lhs, &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;))&amp;lt;br /&amp;gt;            {&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (Object.ReferenceEquals(lhs, &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;))&amp;lt;br /&amp;gt;                {&amp;lt;br /&amp;gt;                    &amp;lt;span style="color: green;"&amp;gt;// null == null = true.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;                    &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;true&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;                }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;                &amp;lt;span style="color: green;"&amp;gt;// Only the left side is null.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;false&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            }&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Equals handles the case of null on right side.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; lhs.Equals(rhs);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; operator !=(ThreeDPoint lhs, ThreeDPoint rhs)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; !(lhs == rhs);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;    }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;    &amp;lt;span style="color: blue;"&amp;gt;class&amp;lt;/span&amp;gt; Program&amp;lt;br /&amp;gt;    {&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;void&amp;lt;/span&amp;gt; Main(&amp;lt;span style="color: blue;"&amp;gt;string&amp;lt;/span&amp;gt;[] args)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            ThreeDPoint pointA = &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; ThreeDPoint(3, 4, 5);&amp;lt;br /&amp;gt;            ThreeDPoint pointB = &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; ThreeDPoint(3, 4, 5);&amp;lt;br /&amp;gt;            ThreeDPoint pointC = &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; i = 5;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointA.Equals(pointB) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA.Equals(pointB));&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointA == pointB = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA == pointB);&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"null comparison = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA.Equals(pointC));&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"Compare to some other type = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA.Equals(i));&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            TwoDPoint pointD = &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            TwoDPoint pointE = &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"Two null TwoDPoints are equal: {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointD == pointE);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            pointE = &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; TwoDPoint(3, 4);&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"(pointE == pointA) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointE == pointA);&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"(pointA == pointE) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA == pointE);&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"(pointA != pointE) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA != pointE);&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            System.Collections.ArrayList list = &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; System.Collections.ArrayList();&amp;lt;br /&amp;gt;            list.Add(&amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; ThreeDPoint(3, 4, 5));&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointE.Equals(list[0]): {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointE.Equals(list[0]));&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Keep the console window open in debug mode.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            System.Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"Press any key to exit."&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;);&amp;lt;br /&amp;gt;            System.Console.ReadKey();&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;    }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;    &amp;lt;span style="color: green;"&amp;gt;/* Output:&amp;lt;br /&amp;gt;        pointA.Equals(pointB) = True&amp;lt;br /&amp;gt;        pointA == pointB = True&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt; comparison = False&amp;lt;br /&amp;gt;        Compare to some other type = False&amp;lt;br /&amp;gt;        Two &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt; TwoDPoints are equal: True&amp;lt;br /&amp;gt;        (pointE == pointA) = False&amp;lt;br /&amp;gt;        (pointA == pointE) = False&amp;lt;br /&amp;gt;        (pointA != pointE) = True&amp;lt;br /&amp;gt;        pointE.Equals(list[0]): False&amp;lt;br /&amp;gt;    */&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;}&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;                    On classes (reference types), the default implementation of both &amp;lt;span&amp;gt;&amp;lt;a id="ctl00_rs1_mainContentContainer_ctl42" onclick="javascript:Track('ctl00_rs1_mainContentContainer_cpe198786_c|ctl00_rs1_mainContentContainer_ctl42',this);" href="http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx"&amp;gt;Object&amp;lt;span class="cs"&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class="vb"&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span class="cpp"&amp;gt;::&amp;lt;/span&amp;gt;&amp;lt;span class="nu"&amp;gt;.&amp;lt;/span&amp;gt;Equals(Object)&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;methods performs a reference equality comparison, not a value equality&lt;br /&gt;check. When an implementer overrides the virtual method, the purpose is&lt;br /&gt;to give it value equality semantics. &amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;                    The &amp;lt;span&amp;gt;&amp;lt;span class="input"&amp;gt;==&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span&amp;gt;&amp;lt;span class="input"&amp;gt;!=&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;operators can be used with classes even if the class does not overload&lt;br /&gt;them. However, the default behavior is to perform a reference equality&lt;br /&gt;check. In a class, if you overload the &amp;lt;span&amp;gt;&amp;lt;span class="input"&amp;gt;Equals&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; method, you should overload the &amp;lt;span&amp;gt;&amp;lt;span class="input"&amp;gt;==&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span&amp;gt;&amp;lt;span class="input"&amp;gt;!=&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; operators, but it is not required.&lt;br /&gt;                &amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;                    The following example shows how to implement value equality in a struct (value type):&lt;br /&gt;                &amp;lt;/p&amp;gt;&amp;lt;div id="snippetGroup1"&amp;gt;&amp;lt;div class="libCScode" id="ctl00_rs1_mainContentContainer_ctl44_CSharp"&amp;gt;&amp;lt;div class="CodeSnippetTitleBar"&amp;gt;&amp;lt;div class="CodeDisplayLanguage"&amp;gt;C#&amp;lt;/div&amp;gt;&amp;lt;div class="CopyCodeButton"&amp;gt;&amp;lt;a class="copyCode" title="Copy Code" href="javascript:CopyCode('ctl00_rs1_mainContentContainer_ctl44CSharp');"&amp;gt;&amp;lt;img class="LibC_copy_off" src="http://i.msdn.microsoft.com/Global/Images/clear.gif" align="middle" border="0" height="9" /&amp;gt; Copy Code&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;div dir="ltr"&amp;gt;&amp;lt;pre class="libCScode" style="white-space: pre-wrap;" id="ctl00_rs1_mainContentContainer_ctl44CSharp" space="preserve"&amp;gt;    struct TwoDPoint : IEquatable&amp;lt;TwoDPoint&amp;gt;&amp;lt;br /&amp;gt;    {&amp;lt;br /&amp;gt;        &amp;lt;span style="color: green;"&amp;gt;// Read/write auto-implemented properties.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; X { &amp;lt;span style="color: blue;"&amp;gt;get&amp;lt;/span&amp;gt;; &amp;lt;span style="color: blue;"&amp;gt;private&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;set&amp;lt;/span&amp;gt;; }&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; Y { &amp;lt;span style="color: blue;"&amp;gt;get&amp;lt;/span&amp;gt;; &amp;lt;span style="color: blue;"&amp;gt;private&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;set&amp;lt;/span&amp;gt;; }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; TwoDPoint(&amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; x, &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; y) : &amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;()&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            X = x;&amp;lt;br /&amp;gt;            Y = x;&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; override &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; Equals(object obj)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;if&amp;lt;/span&amp;gt; (obj is TwoDPoint)&amp;lt;br /&amp;gt;            {&amp;lt;br /&amp;gt;                &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;this&amp;lt;/span&amp;gt;.Equals((TwoDPoint)obj);&amp;lt;br /&amp;gt;            }&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;false&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; Equals(TwoDPoint p)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; (X == p.X) &amp;amp;&amp;amp; (Y == p.Y);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; override &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; GetHashCode()&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; X ^ Y;&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; operator ==(TwoDPoint lhs, TwoDPoint rhs)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; lhs.Equals(rhs);&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;public&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;bool&amp;lt;/span&amp;gt; operator !=(TwoDPoint lhs, TwoDPoint rhs)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;return&amp;lt;/span&amp;gt; !(lhs.Equals(rhs));&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;    }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;    &amp;lt;span style="color: blue;"&amp;gt;class&amp;lt;/span&amp;gt; Program&amp;lt;br /&amp;gt;    {&amp;lt;br /&amp;gt;        &amp;lt;span style="color: blue;"&amp;gt;static&amp;lt;/span&amp;gt; &amp;lt;span style="color: blue;"&amp;gt;void&amp;lt;/span&amp;gt; Main(&amp;lt;span style="color: blue;"&amp;gt;string&amp;lt;/span&amp;gt;[] args)&amp;lt;br /&amp;gt;        {&amp;lt;br /&amp;gt;            TwoDPoint pointA = &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; TwoDPoint(3,4);&amp;lt;br /&amp;gt;            TwoDPoint pointB = &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; TwoDPoint(3,4);&amp;lt;br /&amp;gt;            &amp;lt;span style="color: blue;"&amp;gt;int&amp;lt;/span&amp;gt; i = 5;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Compare using virtual Equals, static Equals, and == and != operators.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// True:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointA.Equals(pointB) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA.Equals(pointB));&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// True:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointA == pointB = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA == pointB);&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// True:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"Object.Equals(pointA, pointB) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, Object.Equals(pointA, pointB)); &amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// False:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointA.Equals(null) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA.Equals(&amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;));&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// False:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"(pointA == null) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA == &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;);&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// True:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"(pointA != null) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA != &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;);&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// False:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointA.Equals(i) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA.Equals(i)); &amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// CS0019:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Console.WriteLine("pointA == i = {0}", pointA == i); &amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Compare unboxed to boxed.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            System.Collections.ArrayList list = &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; System.Collections.ArrayList();&amp;lt;br /&amp;gt;            list.Add(&amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; TwoDPoint(3,4));&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// True:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointE.Equals(list[0]): {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA.Equals(list[0])); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Compare nullable to nullable and to non-nullable.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            TwoDPoint? pointC = &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            TwoDPoint? pointD = &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// False:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointA == (pointC = null) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA == pointC);&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// True:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointC == pointD = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointC == pointD); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            TwoDPoint temp = &amp;lt;span style="color: blue;"&amp;gt;new&amp;lt;/span&amp;gt; TwoDPoint(3,4);&amp;lt;br /&amp;gt;            pointC = temp;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// True:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointA == (pointC = 3,4) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointA == pointC); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            pointD = temp;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// True:&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"pointD == (pointC = 3,4) = {0}"&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;, pointD == pointC); &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;            &amp;lt;span style="color: green;"&amp;gt;// Keep the console window open in debug mode.&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;            System.Console.WriteLine(&amp;lt;span style="color: maroon;"&amp;gt;&amp;lt;span style="color: maroon;"&amp;gt;"Press any key to exit."&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;);&amp;lt;br /&amp;gt;            System.Console.ReadKey();&amp;lt;br /&amp;gt;        }&amp;lt;br /&amp;gt;    }&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;    &amp;lt;span style="color: green;"&amp;gt;/* Output:&amp;lt;br /&amp;gt;        pointA.Equals(pointB) = True&amp;lt;br /&amp;gt;        pointA == pointB = True&amp;lt;br /&amp;gt;        Object.Equals(pointA, pointB) = True&amp;lt;br /&amp;gt;        pointA.Equals(&amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;) = False&amp;lt;br /&amp;gt;        (pointA == &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;) = False&amp;lt;br /&amp;gt;        (pointA != &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;) = True&amp;lt;br /&amp;gt;        pointA.Equals(i) = False&amp;lt;br /&amp;gt;        pointE.Equals(list[0]): True&amp;lt;br /&amp;gt;        pointA == (pointC = &amp;lt;span style="color: blue;"&amp;gt;null&amp;lt;/span&amp;gt;) = False&amp;lt;br /&amp;gt;        pointC == pointD = True&amp;lt;br /&amp;gt;        pointA == (pointC = 3,4) = True&amp;lt;br /&amp;gt;        pointD == (pointC = 3,4) = True&amp;lt;br /&amp;gt;    */&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;}&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;                    For structs, the default implementation of &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_cpe198786_c|ctl00_rs1_mainContentContainer_ctl45&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl45'&gt;Object&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;Equals(Object)&lt;/a&gt;&lt;/span&gt; (which is the overridden version in &lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/system.valuetype.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_cpe198786_c|ctl00_rs1_mainContentContainer_ctl47&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl47'&gt;System&lt;span class='cs'&gt;.&lt;/span&gt;&lt;span class='vb'&gt;.&lt;/span&gt;&lt;span class='cpp'&gt;::&lt;/span&gt;&lt;span class='nu'&gt;.&lt;/span&gt;ValueType&lt;/a&gt;&lt;/span&gt;)&lt;br /&gt;performs a value equality check by using reflection to compare the&lt;br /&gt;values of every field in the type. When an implementer overrides the&lt;br /&gt;virtual &lt;span&gt;&lt;span class='input'&gt;Equals&lt;/span&gt;&lt;/span&gt; method in a&lt;br /&gt;stuct, the purpose is to provide a more efficient means of performing&lt;br /&gt;the value equality check and optionally to base the comparison on some&lt;br /&gt;subset of the struct's field or properties. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;                    The &lt;a href='http://msdn.microsoft.com/en-us/library/53k8ybth.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_cpe198786_c|ctl00_rs1_mainContentContainer_ctl49&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl49'&gt;==&lt;/a&gt; and &lt;a href='http://msdn.microsoft.com/en-us/library/3tz250sf.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_cpe198786_c|ctl00_rs1_mainContentContainer_ctl50&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl50'&gt;!=&lt;/a&gt; operators cannot operate on a struct unless the struct explicitly overloads them.&lt;br /&gt;                &lt;/p&gt;&lt;br /&gt;			&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;		&lt;/div&gt;&lt;div class='MTPS_CollapsibleRegion' id='ctl00_rs1_mainContentContainer_cpe198787'&gt;&lt;br /&gt;			&lt;div class='CollapseRegionLink' id='ctl00_rs1_mainContentContainer_cpe198787_h'&gt;&lt;br /&gt;				&lt;img style='border-width: 0px; vertical-align: middle;' src='http://i.msdn.microsoft.com/Global/Images/clear.gif' class='LibC_o' id='ctl00_rs1_mainContentContainer_cpe198787_i'/&gt; See Also&lt;br /&gt;			&lt;/div&gt;&lt;div class='MTPS_CollapsibleSection' id='ctl00_rs1_mainContentContainer_cpe198787_c' style='overflow: visible; display: block; height: auto; width: 1393px;'&gt;&lt;div class='MTPS_CollapsibleSection' id='' style='display: block;'&gt;&lt;br /&gt;				&lt;a id='seeAlsoToggle'/&gt;&lt;h4 class='subHeading'&gt;Concepts&lt;/h4&gt;&lt;div class='seeAlsoStyle'&gt;&lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/67ef8sbd.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_cpe198787_c|ctl00_rs1_mainContentContainer_ctl55&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl55'&gt;C# Programming Guide&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;h4 class='subHeading'&gt;Other Resources&lt;/h4&gt;&lt;div class='seeAlsoStyle'&gt;&lt;span&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/dd183752.aspx' onclick='javascript:Track(&amp;apos;ctl00_rs1_mainContentContainer_cpe198787_c|ctl00_rs1_mainContentContainer_ctl56&amp;apos;,this);' id='ctl00_rs1_mainContentContainer_ctl56'&gt;Equality Comparisons (C# Programming Guide)&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;			&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;		&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-7831737859945982879?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/7831737859945982879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=7831737859945982879' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7831737859945982879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7831737859945982879'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2009/01/how-to-define-value-equality-for-type-c.html' title='How to: Define Value Equality for a Type (C# Programming)'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-1369010916470059326</id><published>2009-01-21T11:52:00.000-08:00</published><updated>2009-01-21T11:54:10.593-08:00</updated><title type='text'>Restart Firefox - A Great extension to use while developing Firefox Extensions</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;While developing Firefox extensions you need to restart Firefox endlessly. Use this cool extension to do it from the File menu or Toolbar.&lt;br/&gt;&lt;br/&gt;Get &lt;a href='https://addons.mozilla.org/en-US/firefox/addon/3559' target='_blank'&gt;Quick Restart&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;h4&gt;Long Description&lt;/h4&gt;&lt;br /&gt;    This simple extension adds a "Restart&lt;br /&gt;Firefox" item to the "File" menu. You can also use the Ctrl+Alt+R&lt;br /&gt;keyboard shortcut, or the included toolbar button.&lt;br/&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;To use the toolbar button: right click on toolbar -&amp;gt; Customize... then drag the Restart button to the toolbar.&lt;br/&gt;&lt;br /&gt;&lt;p&gt;Yes, very long...&lt;/p&gt;&lt;h4 id='reviews'&gt;Reviews&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;    &lt;ul class='addon-reviews'&gt;&lt;li id='review-0'&gt;&lt;br /&gt;          &lt;blockquote&gt;&lt;br /&gt;                        &lt;h5&gt; &lt;/h5&gt;&lt;br /&gt;                        &lt;p&gt;A necessary tool for developers testing a bunch of pages that may draw infinite looping errors.&lt;/p&gt;&lt;br /&gt;          &lt;/blockquote&gt;&lt;br /&gt;          &lt;p class='cite'&gt;&lt;br /&gt;            &lt;br /&gt;&lt;img height='12' width='68' title='Rated 5 out of 5 stars' alt='' src='https://addons.mozilla.org/img//ratings/5stars.png'/&gt; &lt;br /&gt;&lt;br /&gt;            &lt;cite&gt;&lt;br /&gt;            by &lt;a class='profileLink' href='https://addons.mozilla.org/en-US/firefox/user/3737985'&gt;Angie Schottmuller&lt;/a&gt; on January 16, 2009            &lt;/cite&gt;&lt;br /&gt;          &lt;/p&gt;&lt;br /&gt;        &lt;/li&gt;&lt;li id='review-1'&gt;&lt;br /&gt;          &lt;blockquote&gt;&lt;br /&gt;                        &lt;h5&gt; &lt;/h5&gt;&lt;br /&gt;                        &lt;p&gt;It&lt;br /&gt;would've received 5 stars from me if not for the ugly icon that totally&lt;br /&gt;messes up the file menu. No other options on the file menu has icons,&lt;br /&gt;so it doesn't look right, especially with such an ugly icon.&lt;/p&gt;&lt;br /&gt;          &lt;/blockquote&gt;&lt;br /&gt;          &lt;p class='cite'&gt;&lt;br /&gt;            &lt;br /&gt;&lt;img height='12' width='68' title='Rated 1 out of 5 stars' alt='' src='https://addons.mozilla.org/img//ratings/1stars.png'/&gt; &lt;br /&gt;&lt;br /&gt;            &lt;cite&gt;&lt;br /&gt;            by &lt;a class='profileLink' href='https://addons.mozilla.org/en-US/firefox/user/652966'&gt;Oddish&lt;/a&gt; on January  2, 2009            &lt;/cite&gt;&lt;br /&gt;          &lt;/p&gt;&lt;br /&gt;        &lt;/li&gt;&lt;li id='review-2'&gt;&lt;br /&gt;          &lt;blockquote&gt;&lt;br /&gt;                        &lt;h5&gt; &lt;/h5&gt;&lt;br /&gt;                        &lt;p&gt;This&lt;br /&gt;is a great extension. FF has many options and settings, when&lt;br /&gt;configuring your setup, it is necessary to constantly restart the&lt;br /&gt;browser to test the changes. This extension performs the session&lt;br /&gt;restore and puts you right back where you were. Awesome!&lt;/p&gt;&lt;br /&gt;          &lt;/blockquote&gt;&lt;br /&gt;          &lt;p class='cite'&gt;&lt;br /&gt;            &lt;br /&gt;&lt;img height='12' width='68' title='Rated 5 out of 5 stars' alt='' src='https://addons.mozilla.org/img//ratings/5stars.png'/&gt; &lt;br /&gt;&lt;br /&gt;            &lt;cite&gt;&lt;br /&gt;            by &lt;a class='profileLink' href='https://addons.mozilla.org/en-US/firefox/user/1317061'&gt;wittmeba&lt;/a&gt; on December 18, 2008            &lt;/cite&gt;&lt;br /&gt;          &lt;/p&gt;&lt;br /&gt;        &lt;/li&gt;&lt;/ul&gt;Tell me if it works for you.&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-1369010916470059326?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/1369010916470059326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=1369010916470059326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/1369010916470059326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/1369010916470059326'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2009/01/restart-firefox-great-extension-to-use.html' title='Restart Firefox - A Great extension to use while developing Firefox Extensions'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-138844775567305728</id><published>2009-01-15T11:21:00.000-08:00</published><updated>2009-01-15T11:38:40.706-08:00</updated><title type='text'>Digg removed links to upcoming pages. Bug or Feature?</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;I believe it was the last version that rolled out on December that first had this bug/feature. The upcoming pages of the specific categories does not have the once-were-links to "Most dugg" and "Most comments" pages of the specific category. Instead, if you click those buttons you get the "most" and "commented" pages of the "All topics" category.&lt;br /&gt;&lt;br /&gt;I would consider that a (poor) feature, unless the URLs of those links look like there is something broken. They are as they were, except that the category name is missing from them.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_u4nq3fR1ACc/SW-QrFzzb4I/AAAAAAAAADw/W8lYU79SJb4/s1600-h/2009-01-15_2128.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 354px;" src="http://1.bp.blogspot.com/_u4nq3fR1ACc/SW-QrFzzb4I/AAAAAAAAADw/W8lYU79SJb4/s400/2009-01-15_2128.png" alt="" id="BLOGGER_PHOTO_ID_5291607157151854466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The "Programming" category link to upcoming stories with most diggs was once &lt;span style="font-family:Courier New;"&gt;http://digg.com/all/programming/upcoming/most&lt;/span&gt; and is now &lt;span style="font-family:Courier New;"&gt;http://digg.com/all//upcoming/most&lt;/span&gt; , like someone dropped the pen in the middle of the sentence. The first link still works, and shows the most dugg stories in programming, but it's not linked from the site anymore.&lt;br /&gt;&lt;br /&gt;Does anyone knows if this is a bug or a feature? Did you hear or read anything about it? Is this meant to reduce the power of power users? Is another programmer about to lose his job?&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-138844775567305728?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/138844775567305728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=138844775567305728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/138844775567305728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/138844775567305728'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2009/01/digg-removed-links-to-upcoming-pages.html' title='Digg removed links to upcoming pages. Bug or Feature?'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_u4nq3fR1ACc/SW-QrFzzb4I/AAAAAAAAADw/W8lYU79SJb4/s72-c/2009-01-15_2128.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-7724931125723174639</id><published>2009-01-15T03:20:00.000-08:00</published><updated>2009-01-15T03:20:00.761-08:00</updated><title type='text'>How to resize the Firefox window with a bookmarklet</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Many developers work on large screens, but want to Preview web design in a 1024×768 browser screen.&lt;br/&gt;To resize the Firefox browser window to 1024 x 768 create a resizing bookmarklet.&lt;br/&gt;&lt;h4&gt;Creating a Resizing Bookmarklet&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Right click on &lt;strong&gt;Bookmark Toolbar&lt;/strong&gt; -&amp;gt; &lt;strong&gt;New Bookmark&lt;/strong&gt; to launch the Bookmark dialog box.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Insert the following into the box:&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Name&lt;/strong&gt;: Give a descriptive name if you are planning to add several bookmarklet.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Location&lt;/strong&gt;: Place &lt;em&gt;&lt;strong&gt;javascript:window.resizeTo(1024,768)&lt;/strong&gt;&lt;/em&gt; into the textfield. Alter &lt;em&gt;&lt;strong&gt;1024&lt;/strong&gt;&lt;/em&gt; &amp;amp; &lt;em&gt;&lt;strong&gt;768&lt;/strong&gt;&lt;/em&gt; to create bookmarklet of another size.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Both &lt;em&gt;Keywords&lt;/em&gt; and &lt;em&gt;Description&lt;/em&gt; can be left blank.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Test your bookmarklet, click and it should resize to it’s specific size.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-7724931125723174639?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/7724931125723174639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=7724931125723174639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7724931125723174639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7724931125723174639'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2009/01/how-to-resize-firefox-window-with.html' title='How to resize the Firefox window with a bookmarklet'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-4725394286873829435</id><published>2009-01-10T12:34:00.000-08:00</published><updated>2009-01-12T13:36:58.399-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wordpress'/><category scheme='http://www.blogger.com/atom/ns#' term='samples'/><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='web2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Sidebar'/><category scheme='http://www.blogger.com/atom/ns#' term='Custom fields'/><category scheme='http://www.blogger.com/atom/ns#' term='UGC'/><title type='text'>Using Custom Fields to create a dynamic sidebar</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;WordPress has the ability to allow post authors to assign custom fields to a post. This arbitrary extra information is known as &lt;b&gt;meta-data&lt;/b&gt;. This &lt;b&gt;meta-data&lt;/b&gt; can include bits of information such as: &lt;/p&gt; &lt;ul&gt;&lt;li&gt; &lt;b&gt;Mood: Happy&lt;/b&gt; &lt;/li&gt;&lt;li&gt; &lt;b&gt;Currently Reading: Cinderella&lt;/b&gt; &lt;/li&gt;&lt;li&gt; &lt;b&gt;Listening To: Rock Around the Clock&lt;/b&gt; &lt;/li&gt;&lt;li&gt; &lt;b&gt;Weather: Hot and humid&lt;/b&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;With some extra coding, it is possible to achieve more complex actions, such as using the &lt;b&gt;metadata&lt;/b&gt; to store an expiration date for a post. &lt;/p&gt;&lt;p&gt;Meta-data is handled with &lt;b&gt;key/value&lt;/b&gt; pairs.  The &lt;b&gt;key&lt;/b&gt; is the name of the meta-data element.  The &lt;b&gt;value&lt;/b&gt; is the information that will appear in the meta-data list on each individual post that the information is associated with.&lt;br /&gt;&lt;/p&gt;&lt;h3&gt; &lt;span class="mw-headline"&gt;Getting Custom Fields&lt;/span&gt;&lt;/h3&gt; &lt;p&gt;To fetch meta values use the &lt;tt&gt;&lt;a title="Function Reference/get post meta" href="http://codex.wordpress.org/Function_Reference/get_post_meta"&gt;get_post_meta()&lt;/a&gt;&lt;/tt&gt; function: &lt;/p&gt; &lt;pre&gt; get_post_meta($post_id, $key, $single);&amp;lt;br /&amp;gt;&lt;/pre&gt; &lt;ul&gt;&lt;li&gt;&lt;tt&gt;$post_id&lt;/tt&gt; is the ID of the post you want the meta values for. Use &lt;tt&gt;$post-&amp;gt;ID&lt;/tt&gt; to get a post's ID. &lt;/li&gt;&lt;li&gt;&lt;tt&gt;$key&lt;/tt&gt; is a string containing the name of the meta value you want. &lt;/li&gt;&lt;li&gt;&lt;tt&gt;$single&lt;/tt&gt; can either be &lt;tt&gt;true&lt;/tt&gt; or &lt;tt&gt;false&lt;/tt&gt;. If set to true then the function will return a single result, as a &lt;b&gt;string&lt;/b&gt;. If false, or not set, then the function returns an &lt;b&gt;array&lt;/b&gt; of the custom fields. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;Highly Customized Sidebar using Custom Fields and Categories Per-Post&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I've used WordPress for a few years now, but currently I am in need of help of building custom sidebars on a per-post basis using information stored in custom fields and categories. I'm a web designer by trade, not a programmer, and have some experience with PHP but not enough to do what I need.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;&lt;br /&gt;I'm currently designing a website that uses WordPress as a CMS and will be used by location scouts for potential movie and commercial shooting locations. Posts act in two ways: 1. as News (much like a blog) and 2. as an individual location.&lt;/p&gt; &lt;p&gt;Each individual location is categorized using the WordPress category system, however there are over 75 categories including children. Some locations may have up to 3 different categories. On top of that, each location also has a series of custom fields.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Intention&lt;/strong&gt;&lt;br /&gt;When an individual location is being viewed, the purpose of the sidebar is to feature two sets of 3+ locations: 1. via a category based on the posts categories and 2. locations nearby using a custom field stored in the post.&lt;/p&gt; &lt;p&gt;Since some posts may have up to 3 categories in all, I don't know how to narrow down the category to just one. For instance, the post may have the main category of House with children of Historic &amp;amp; Period 1950s. All I would want is to pull the House category when someone is viewing a home location and list other locations categorized under Houses in the sidebar.&lt;/p&gt; &lt;p&gt;The same is for the Custom Fields application. Here the intention is to pull the zoning area for the location and list other locations in the same zone. &lt;/p&gt; &lt;p&gt;So if I'm looking at a post for a particular location that is categorized under Gas Station and is located in Zone 1, I should see in the sidebar at least 3 other gas stations and 3 different locations in the zone 1.&lt;/p&gt; &lt;p&gt;Since each post is unique concerning a location, the sidebar must spit out specific information. I've tried to figure out the code, but can't make anything work correctly.&lt;/p&gt;&lt;p&gt;Try something like:&lt;/p&gt; &lt;p&gt;&amp;lt;?php $thumb = get_post_meta($post-&amp;gt;ID, "post_thumb", true); if (!empty($thumb)) { ?&amp;gt;&amp;lt;img class="alignright size-thumbnail" src="&amp;lt;? echo $thumb;?&amp;gt;" width="120" alt="Thumbnail image for '&amp;lt;?php the_title();?&amp;gt;'" /&amp;gt;&amp;lt;? } ?&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;Another way to handle this issue&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I recently finished the redesign of my blog, &lt;a href="http://www.thehumanaught.com/blog"&gt;The Humanaught&lt;/a&gt;, and as these things tend to - it came with a few forehead slapping mind scratchers.&lt;/p&gt; &lt;p&gt;The key one being that the design utilized the post’s footer to store comments. On many posts you wouldn’t even know there was a problem, however when I - on occasion - veer from my usual rambling and only write a tiny little blurb, the issue is evident.&lt;/p&gt; Take, for example, a standard page layout. On one side (in my case, the left) you have your content, on the other you have your sidebar, and hanging out at the bottom you’ve your footer (&lt;strong&gt;fig. 1&lt;/strong&gt;). If your content and your sidebar have a roughly equal amount of doodats in them, you’re golden - but when you short change your comment box, your sidebar extends its full length and makes everything look goofy&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Digging into my WordPress template, I needed a dynamic way of determining the size of the content box. For this I threw the following code just above &lt;a href="http://codex.wordpress.org/The_Loop"&gt;The Loop&lt;/a&gt; of my single.php and page.php pages.&lt;/p&gt; &lt;div style="white-space: nowrap;" class="dean_ch"&gt;&lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;    &lt;span class="re0"&gt;$post&lt;/span&gt; = get_post&lt;span class="br0"&gt;(&lt;/span&gt;the_ID&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;, ARRAY_A&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;    &lt;span class="re0"&gt;$contlen&lt;/span&gt; = &lt;a href="http://www.php.net/strlen"&gt;&lt;span class="kw3"&gt;strlen&lt;/span&gt;&lt;/a&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="re0"&gt;$post&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="st0"&gt;‘post_content’&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;br /&gt;&lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;I come out of that with a variable ($contlen) that gives me the character count of my content. Now all I needed to do was pass that variable to my sidebar and use some conditionals (&lt;em&gt;IF bla bla bla&lt;/em&gt;) to decide what should be displayed and what should be cut.&lt;/p&gt; &lt;p&gt;The problem with the standard WordPress template is that the &lt;strong&gt;&amp;lt;?php get_sidebar(); ?&amp;gt;&lt;/strong&gt; that WordPress uses by default to load all the goodies in &lt;strong&gt;sidebar.php&lt;/strong&gt; doesn’t pass variables defined in other areas of the template.&lt;/p&gt; &lt;p&gt;To fix this we change:&lt;/p&gt; &lt;div style="white-space: nowrap;" class="dean_ch"&gt;&lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt; get_sidebar&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;; &lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;to&lt;/p&gt; &lt;div style="white-space: nowrap;" class="dean_ch"&gt;&lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="kw1"&gt;include&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt;TEMPLATEPATH . &lt;span class="st0"&gt;‘/sidebar.php’&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;; &lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;Now any variables you set in &lt;strong&gt;single.php&lt;/strong&gt;/&lt;strong&gt;page.php&lt;/strong&gt; will carry over to &lt;strong&gt;sidebar.php&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;Next up, we need to attribute some values to that prioritized list we made a bit earlier. We need to decide after what character count certain sidebar elements will be displayed. As this is all very much a “give or take” solution, figures will vary depending on things like font-size, the size of elements in the sidebar, etc. However, let’s use my numbers for the sake of … well… just because.&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;All&lt;/strong&gt; - Search Box, Recent Posts&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&amp;gt;1,000&lt;/strong&gt; - Badges&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&amp;gt;3,500&lt;/strong&gt; - Recent Comments&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&amp;gt;5,000&lt;/strong&gt; - Blogroll&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;To implement this, we just wrap the sidebar elements in IF statements:&lt;/p&gt; &lt;div style="white-space: nowrap;" class="dean_ch"&gt;&lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt;is_home&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt; || &lt;span class="re0"&gt;$contlen&lt;/span&gt; &amp;gt; &lt;span class="nu0"&gt;3500&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="br0"&gt;{&lt;/span&gt; &lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;    &amp;lt;h2&amp;gt;Recent Comments&amp;lt;/h2&amp;gt;&lt;br /&gt;    &amp;lt;ul&amp;gt;&lt;br /&gt;        &lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt; get_recent_comments&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;; &lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;    &amp;lt;/ul&amp;gt;&lt;br /&gt;&lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="br0"&gt;}&lt;/span&gt; &lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;The &lt;strong&gt;IF statement&lt;/strong&gt; simply says if it is the home/index.php (&lt;strong&gt;is_home()&lt;/strong&gt;) or (&lt;strong&gt;||&lt;/strong&gt;) our content’s length (&lt;strong&gt;$contlen&lt;/strong&gt;) is greater than 3500, display this crap - otherwise, move along.&lt;/p&gt; &lt;p&gt;That about does it, but for the sake of re-illustration, here’s the conditional to display the blogroll:&lt;/p&gt; &lt;div style="white-space: nowrap;" class="dean_ch"&gt;&lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt;is_home&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt; || &lt;span class="re0"&gt;$contlen&lt;/span&gt; &amp;gt; &lt;span class="nu0"&gt;5000&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt; &lt;span class="br0"&gt;{&lt;/span&gt; &lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;    &amp;lt;h2&amp;gt;Blogroll&amp;lt;/h2&amp;gt;&lt;br /&gt;    &amp;lt;ul&amp;gt;&lt;br /&gt;        &lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt; wp_list_bookmarks&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;; &lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;    &amp;lt;/ul&amp;gt;&lt;br /&gt;&lt;span class="kw2"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="br0"&gt;}&lt;/span&gt; &lt;span class="kw2"&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;What this doesn’t take into account are pages that display things like search results, particularly if those results are few to none. But with some simple modifications, I’m sure you can adjust this method to suit your blog’s particular needs.&lt;/p&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tag/wordpress%20how%20to" class="performancingtags"&gt;wordpress how to&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/web%202.0" class="performancingtags"&gt;web 2.0&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/wp%20theme" class="performancingtags"&gt;wp theme&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/wp%20themes" class="performancingtags"&gt;wp themes&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/blog%20setup" class="performancingtags"&gt;blog setup&lt;/a&gt;, &lt;a rel="tag" href="http://technorati.com/tag/php%20com" class="performancingtags"&gt;php com&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-4725394286873829435?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/4725394286873829435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=4725394286873829435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/4725394286873829435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/4725394286873829435'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2009/01/using-custom-fields-to-create-dynamic.html' title='Using Custom Fields to create a dynamic sidebar'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-8379413722624198180</id><published>2009-01-08T04:51:00.001-08:00</published><updated>2009-01-08T05:00:03.077-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='download unlocker'/><category scheme='http://www.blogger.com/atom/ns#' term='how to unlock a file'/><category scheme='http://www.blogger.com/atom/ns#' term='foundation server'/><category scheme='http://www.blogger.com/atom/ns#' term='file unlocker'/><category scheme='http://www.blogger.com/atom/ns#' term='team foundation server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='how to unlock file'/><category scheme='http://www.blogger.com/atom/ns#' term='team foundation server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='team foundation server'/><category scheme='http://www.blogger.com/atom/ns#' term='team foundation'/><category scheme='http://www.blogger.com/atom/ns#' term='file to unlock'/><title type='text'>How to Unlock a File in Team Foundation Server</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;"  &gt;We've all been in the&lt;br /&gt;situation before when a developer goes away for a long weekend (usually&lt;br /&gt;leaving on Thursday) and they forget to check in a file and ensure the&lt;br /&gt;solution builds.  Here is how to deal with that in TFS.  Unlock the&lt;br /&gt;file according to the instructions found here:&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/rimuri/archive/2006/03/06/544686.aspx"&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;"  &gt;http://blogs.msdn.com/rimuri/archive/2006/03/06/544686.aspx&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;"  &gt;The gist is that running this command will unlock the file:&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;"  &gt;tf undo /workspace:TheirWorkspace;DOMAIN\TheirUserAccount $/path/to/file&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;"  &gt;To get a list of workspaces run this:&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;"  &gt;tf workspaces /owner:DOMAIN\TheirUserAccount /computer:*&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Another way to do this:&lt;/p&gt;&lt;p&gt;One of the rare but critical tasks of Configuration Management is&lt;br /&gt;the unlocking of items locked or checked out by someone else, like an&lt;br /&gt;ex-employee or a developer in the Bahamas while an emergency patch&lt;br /&gt;needs to be pushed out.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Unfortunately, the unlock action is not available in the&lt;br /&gt;context-menu or a GUI but needs to be executed from a command line. I&lt;br /&gt;wonder why it’s not in the GUI, granted deleted files and pending&lt;br /&gt;changes will not necessarily be visible in the GUI but at least the&lt;br /&gt;Undo should be available for visible items while the command line still&lt;br /&gt;provides the all-encompassing functionality.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The help was not very clear, so I’ll simplify the command for you.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are 2 possible options for unlocking, viz. unlock or undo (if checked out for Edit).&lt;br /&gt;&lt;br /&gt;The respective command to use is &lt;strong&gt;tf lock /lock:none&lt;/strong&gt; or &lt;strong&gt;tf undo&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The parameters in both cases are the same:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;filename&lt;/span&gt; (in the help topic, this is the itemspec parameter)&lt;br /&gt;&lt;br /&gt;This is the file you want to unlock&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(255, 204, 0);"&gt;/workspace&lt;/span&gt;: [user's workspace]:[user name]&lt;br /&gt;&lt;br /&gt;The user’s workspace needs to be figured out…by right-clicking the locked item and selecting Properties… and then the Status tab&lt;br /&gt;&lt;br /&gt;The user name is the fully qualified user name, in the form: domain/user&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(153, 204, 0);"&gt;/s&lt;/span&gt;:[server path]&lt;br /&gt;&lt;br /&gt;This is the TFS server in question. Typically it’s &lt;a href="http://server:8080/"&gt;http://servername:8080/&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So, a sample command would be something like:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;tf undo &lt;span style="color: rgb(51, 102, 255);"&gt;$/Applications/Dev/Branch1/file1.aspx&lt;/span&gt; &lt;span style="color: rgb(255, 153, 0);"&gt;/workspace:”Ra Dev Notebook”;corp1\ra&lt;/span&gt; &lt;span style="color: rgb(153, 204, 0);"&gt;/s:http://altair:8080&lt;/span&gt; &lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;(You run this is on a VS client, at the Visual Studio command prompt)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;PS: Hope the color coding helped&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Another command I found useful during the process was &lt;strong&gt;tf status /user:Joe /s:server path&lt;/strong&gt;, which essentially lists all files locked by Joe. I piped it to a text file (with &amp;gt;&amp;gt; C:\joe.locked.txt) to get a report.&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-8379413722624198180?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/8379413722624198180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=8379413722624198180' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/8379413722624198180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/8379413722624198180'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2009/01/how-to-unlock-file-in-team-foundation.html' title='How to Unlock a File in Team Foundation Server'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-3160938339033591493</id><published>2009-01-08T01:58:00.000-08:00</published><updated>2009-01-08T02:14:21.728-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='access stdev'/><category scheme='http://www.blogger.com/atom/ns#' term='sumproduct'/><category scheme='http://www.blogger.com/atom/ns#' term='z score'/><category scheme='http://www.blogger.com/atom/ns#' term='variance'/><category scheme='http://www.blogger.com/atom/ns#' term='normal distribution'/><category scheme='http://www.blogger.com/atom/ns#' term='vba stdev'/><category scheme='http://www.blogger.com/atom/ns#' term='standard deviations'/><category scheme='http://www.blogger.com/atom/ns#' term='stdev formula'/><category scheme='http://www.blogger.com/atom/ns#' term='stdev'/><category scheme='http://www.blogger.com/atom/ns#' term='stdevp'/><category scheme='http://www.blogger.com/atom/ns#' term='pooled stdev'/><category scheme='http://www.blogger.com/atom/ns#' term='quartile'/><category scheme='http://www.blogger.com/atom/ns#' term='group by'/><category scheme='http://www.blogger.com/atom/ns#' term='stdev stdevp'/><category scheme='http://www.blogger.com/atom/ns#' term='standard deviation'/><category scheme='http://www.blogger.com/atom/ns#' term='stdev sql'/><title type='text'>A User-Friendly C# Descriptive Statistic Class</title><content type='html'>Today I found and used this class, I highly recommend it for simple statistics calculations required for many reporting systems.&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/recipes/DescriptiveStatisticClass.aspx"&gt;&lt;br /&gt;http://www.codeproject.com/KB/recipes/DescriptiveStatisticClass.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The author says:&lt;br /&gt;&lt;br /&gt;"The 80-20 rules applies: even with the advances of statistics, most of our work requires only univariate descriptive statistics – those involve the calculations of mean, standard deviation, range, skewness, kurtosis, percentile, quartiles, etc. This article describes a simple way to construct a set of classes to implement descriptive statistics in C#. The emphasis is on the ease of use at the users' end."&lt;br /&gt;&lt;br /&gt;It has great reviews and ratings.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-3160938339033591493?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/3160938339033591493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=3160938339033591493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/3160938339033591493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/3160938339033591493'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2009/01/user-friendly-c-descriptive-statistic.html' title='A User-Friendly C# Descriptive Statistic Class'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-4336304888754625442</id><published>2007-06-19T12:55:00.000-07:00</published><updated>2007-06-19T13:22:17.131-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='delicious'/><category scheme='http://www.blogger.com/atom/ns#' term='web2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='news'/><category scheme='http://www.blogger.com/atom/ns#' term='cnn'/><category scheme='http://www.blogger.com/atom/ns#' term='stumbleupon'/><category scheme='http://www.blogger.com/atom/ns#' term='news industry'/><category scheme='http://www.blogger.com/atom/ns#' term='digg'/><category scheme='http://www.blogger.com/atom/ns#' term='bbc'/><title type='text'>Digg wins news industry sites comparison</title><content type='html'>During the last 3 years there has been an enourmous shift in the news industry from classic news sites such as &lt;a href="http://www.cnn.com/"&gt;CNN.com&lt;/a&gt; and &lt;a href="http://www.BBC.co.uk/"&gt;BBC.co.uk&lt;/a&gt; to web2.0 news site made of User generated content, such as &lt;a href="http://www.digg.com"&gt;Digg&lt;/a&gt;, &lt;a href="http://del.icio.us"&gt;Delicious&lt;/a&gt; and &lt;a href="http://www.StumbleUpon.com/"&gt;StumbleUpon&lt;/a&gt;. I checked these 5 sites on &lt;a href="http://www.alexa.com"&gt;alexa&lt;/a&gt; to see how they do head to head.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_u4nq3fR1ACc/Rng3yNFmtuI/AAAAAAAAABU/D0vcLLUUfzM/s1600-h/DiggCompared_1y.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 414px; height: 309px;" src="http://bp0.blogger.com/_u4nq3fR1ACc/Rng3yNFmtuI/AAAAAAAAABU/D0vcLLUUfzM/s400/DiggCompared_1y.png" alt="" id="BLOGGER_PHOTO_ID_5077869915506390754" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;first I looked at the 1 year graph. Everyone seem very stable, with CNN and BBC leading, Digg takes the middle, followed by Delicious and StumbleUpon. The weekend effect is apparent at 3 of the sites.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_u4nq3fR1ACc/Rng49tFmtvI/AAAAAAAAABc/81DsytVeOAA/s1600-h/DiggCompared_3y.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_u4nq3fR1ACc/Rng49tFmtvI/AAAAAAAAABc/81DsytVeOAA/s400/DiggCompared_3y.png" alt="" id="BLOGGER_PHOTO_ID_5077871212586514162" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;when I looked at the 3 Year graph, i could easily see that CNN and BBC where at approximatly the same ranking, where as the web2.0 sites were nowhere in site 3 years ago. After 2 years of rising sharply Digg and Delicious (strangly matching all the way) leveled around 100, 150. Another thing is that CNN and BBC started declining 2 years ago, and they keep going slowly but steadily. It so happened that Digg and CNN has very similar rank, as one takes the others place.&lt;br /&gt;&lt;br /&gt;I expect great things for digg, and I think they will lead the revolution of web2.0 many years to come.&lt;br /&gt;&lt;br /&gt;CNN is dead, Long live Digg ;-)&lt;br /&gt;&lt;br /&gt;Benny.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-4336304888754625442?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/4336304888754625442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=4336304888754625442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/4336304888754625442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/4336304888754625442'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/06/digg-wins-news-industry-sites.html' title='Digg wins news industry sites comparison'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_u4nq3fR1ACc/Rng3yNFmtuI/AAAAAAAAABU/D0vcLLUUfzM/s72-c/DiggCompared_1y.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-3498234407501361816</id><published>2007-06-18T13:55:00.000-07:00</published><updated>2007-06-18T14:33:49.013-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='data transfer'/><category scheme='http://www.blogger.com/atom/ns#' term='web2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='dataset'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='design'/><category scheme='http://www.blogger.com/atom/ns#' term='business objects'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><title type='text'>Designing Business Objects for web2.0 Applications</title><content type='html'>When we sit down at the beginning of the process to design our brand new shiny web2.0 application (Please, not another social network...) we should consider several issues regarding Object Oriented design in general, as well as  web2.0 application specifically.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Find your objects&lt;/span&gt;&lt;br /&gt;This is true for every program. First thing to do is read the product specification (if working in medium or large company) or just describe the system in words. Notice the objects in your sentences as candidates for being objects in the system. For each one ask yourself: "Does it contain any information i should use?" This Information is the object properties. "What actions can this object perform?" leads to a list of methods. Objects on the list that have no properties or methods should not be objects in the system.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Remember the Channels&lt;br /&gt;&lt;/span&gt;When selecting parameters for the methods and types for the properties remember who is on the other side. Is that a web page calling? A web service? Some Embedded code from this blog?&lt;br /&gt;What are they asking for? What language do they speak?&lt;br /&gt;You may consider writing a Data Access Layer that speaks SQL with the database and sends DataSet objects to the Business Objects. The business objects receive requests from Server-Side code that runs inside a web server. Those requests use a certain textual format to pass data to the server. Simple applications may send single values over Query Strings, but any real application should use JSON or XML as a data protocol with the web client. On this web client you may like to have some cool AJAX controls to smooth the User Experience, So you will need a set of Client-Side objects, written usually in Javascript.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Design Serializable Objects&lt;/span&gt;&lt;br /&gt;If you are using JSON or XML you should design your objects to be serializeable. That means using only string, int, bool, object and array as the types of your properties. Any JSON Serializer can read such objects and this saves you iterating through all the object properties to read it's values. You just write something like MyJSONString = Serializer.Serialize(MyObject) and Bam! you got yourself a JSON string to send back to the browser.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Match Server and Client Objects&lt;/span&gt;&lt;br /&gt;Since we have two sets of objects, one on the server and one on the client, we should match their properties to allow for smooth data transfer. There are JSON and XML serializers in javascript too, of course. You can avoid this problem all together by using a Library planned for this purpose like the &lt;a href="http://ajax.asp.net/"&gt;Microsoft Ajax Extensions 1.0&lt;/a&gt;. Take a look but be careful, this package is only for professionals. It requires the best understanding of Internet technologies and much patience for Microsoft heavy object models.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Plan Great Utilities&lt;/span&gt;&lt;br /&gt;Well, What do we do with all this? We can start by writing a set of utilities that will simplify our coding and will make the application more robust. One function we should write is a generic DataSet2Object function, that reads a dataset and returns a collection of the desired objects. There may be some others, but you get the idea.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Remember to breath :)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Benny.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-3498234407501361816?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/3498234407501361816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=3498234407501361816' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/3498234407501361816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/3498234407501361816'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/06/designing-business-objects-for-web20.html' title='Designing Business Objects for web2.0 Applications'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-9004441171328457774</id><published>2007-06-13T12:10:00.000-07:00</published><updated>2007-06-13T12:38:52.480-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='video'/><category scheme='http://www.blogger.com/atom/ns#' term='url'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='player'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript'/><category scheme='http://www.blogger.com/atom/ns#' term='page'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Reporting Page Url from Flash video player = Monitization</title><content type='html'>&lt;span style="font-weight: bold;font-size:180%;" &gt;R&lt;/span&gt;ecently the web got at least one more layer in the spaghetti of sites we are used to. Since the rising of the &lt;a href="http://en.wikipedia.org/wiki/Social_network"&gt;social networks&lt;/a&gt; and the &lt;a href="http://www.jupiterresearch.com/bin/item.pl/research:vision/63/id=99251/"&gt;User Generated Content sites&lt;/a&gt; everyone is providing the users with tools to embed parts of their web site in the user's blog, profile or other personalized web space. Now instead of many sites operating in solitude we now have one web page that includes information from many web sources.&lt;br /&gt;&lt;br /&gt;A more recent development was the rich media, Images and &lt;a href="http://www.5min.com/"&gt;video&lt;/a&gt; mainly. Most video sites now allow their users to embed their videos everywhere (except of &lt;a href="http://www.myspace.com/"&gt;MySpace&lt;/a&gt;... but that is another story that will probably have it's own post.). How can the video site owner know when someone is playing his video on some blog or profile? Remember that most of the video sites business model are commercial-based, and the commercials should run along-side with the video content, So targeting your embedded audience even just for GeoLocation can be worth a lot.&lt;br /&gt;&lt;br /&gt;Most video players are written in flash, and the communication between Flash and web server never was that amazing. There are several things you need to do in order to have a Flash application report to a web server the Url of the page it is running inside.&lt;br /&gt;&lt;br /&gt;First you need to use an ActionScript command called ExecuteExternalCall to call a javascript that reports the Page Url with the property document.location.href.&lt;br /&gt;Set the AllowScripts attribute of the embed tag to "Always", and make sure that the hosting site allows those scripts to run. MySpace doesn't, so do try to execute any Javascript in any form on MySpace.&lt;br /&gt;&lt;br /&gt;this will take you to a point where everything works fine in FireFox but no information received from explorer browsers. To allow this info to run through IE you need to add the Flash ClassId attribute to the embed tag, and remove the Type attribute (should be there before, with Flash/Application or something like that in it's value). At this point we got the Url from IE as well but our application stoped working.&lt;br /&gt;&lt;br /&gt;We are still resolving this issue, and we might try sending Ajax request to the server straight from the "ExecuteExternalApplication" function, because we realized that the function call works fine, only getting the value back in ActionScript fails.&lt;br /&gt;&lt;br /&gt;I'll update on this when we have more info, also I will appreciate any comments on how to handle such a trick.&lt;br /&gt;&lt;br /&gt;benny.PublishPost();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-9004441171328457774?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/9004441171328457774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=9004441171328457774' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/9004441171328457774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/9004441171328457774'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/06/reporting-page-url-from-flash-video.html' title='Reporting Page Url from Flash video player = Monitization'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-7654638566063184698</id><published>2007-06-05T10:16:00.000-07:00</published><updated>2007-06-05T11:21:54.487-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emotions'/><category scheme='http://www.blogger.com/atom/ns#' term='development process'/><category scheme='http://www.blogger.com/atom/ns#' term='intuition'/><category scheme='http://www.blogger.com/atom/ns#' term='relax'/><category scheme='http://www.blogger.com/atom/ns#' term='anger'/><title type='text'>The place of Intuition in the Development process</title><content type='html'>I'm developing software for the last 10 years, and operating computers for 20. I have watched endless programmers, team leaders, project managers and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;CTOs&lt;/span&gt; bang their heads (or do other stupid things) with anger and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;frustration&lt;/span&gt; every time they observed the non-disputable fact of life that computers don't always do what we want them to. Hell, they sometimes don't even do what they were asked to do (Which is something &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;completely&lt;/span&gt; different from what we expect them to do.)&lt;br /&gt;&lt;br /&gt;This is a universal truth and software developers can benefit the most from integrating it into our systems: Things don't always work as we expect. The difference between us is what we do with this fact.&lt;br /&gt;&lt;br /&gt;As i see it there are mainly two ways to handle this. Some ignore reality and stick to their opinions. We can see these guys shouting and hitting their computers and some of them develop &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;habits&lt;/span&gt; of "saying YES and doing NO", always being late and other &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;behaviors&lt;/span&gt; that express &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;repressed&lt;/span&gt; anger. On a more professional level you may notice some programmers that insist on sticking to their bugs and can spend days with them, even if they could solve them quickly. By &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_6"&gt;struggling&lt;/span&gt; with their work they &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_7"&gt;achieve&lt;/span&gt; much self &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;feedback&lt;/span&gt; like "I'm working so hard" and "This job is so difficult, I must be so smart to be doing it".&lt;br /&gt;&lt;br /&gt;Others accept reality and recognize the emotions that this reality stir in them. Those people will usually act according to decisions and not emotions. They also can be stressed or relaxed in their work, but they will at least do a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_9"&gt;genuine&lt;/span&gt; effort to make things better both professionally and inter-personally. The amount of stress that we &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;acquire&lt;/span&gt; in work is directly connected to the way we recognize and process our feeling and emotions during the day of work. If we know how to harness these powerful emotions to our use we can &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;achieve&lt;/span&gt; so much more then if we are fighting the emotions, working hard to keep them inside.&lt;br /&gt;&lt;br /&gt;The development of software is a very complex task, constructed of many many little tasks that we perform and put together in order to create a complete product or feature. All this complexity it done using a very, very, very and some more complex hardware that includes billions of tiny electrical components. I wonder it actually works at all ! No wonder it has it's &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_12"&gt;glitches&lt;/span&gt;. To me it reminds a sentence from chaos theory that states that systems become more chaotic as they become more complex. I believe that computers are so complex that they conform to this rule.&lt;br /&gt;&lt;br /&gt;Those that accept reality looks at every bug as an &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_13"&gt;opportunity&lt;/span&gt; to improve, to learn new things, a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_14"&gt;challenge&lt;/span&gt; that needs to be met, not a problem that needs to be solved. Such state of mind creates a relaxed, interesting, fruitful working &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_15"&gt;environment&lt;/span&gt;. This is the right ground to promote creative thinking and creative solutions. With such inner position we can learn new things easily and enjoy the learning. After all, if there are no more bugs our work is done. The essence of our work is bug fixing. This is what we do. Everyone can create bugs. not all of them can solve them.&lt;br /&gt;&lt;br /&gt;After a while working in this state of mind one starts to write less, but more efficient code. One is found more time thinking then hitting on keys, but get more work done faster. When it comes to approaching new challenges, one starts to use it's intuition. Sometimes we "just know" things. It is stupid to ask a beginner to use Intuition. He should work by the rules for a while. But after a while, the solutions start &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_16"&gt;popping&lt;/span&gt; up like popcorn. There are many ways to do each task and choosing the right one is many times an intuitive decision. We usually don't have time to explore all the options well, and we have to choose. These decisions should be taken by an experienced person, and he will be stupid NOT to use intuition in his decisions.&lt;br /&gt;&lt;br /&gt;Our intuition is our highest inner voice (emotions-thoughts-intuition) and only by using it can we &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_17"&gt;achieve&lt;/span&gt; self-completion in our life and in our work.&lt;br /&gt;&lt;br /&gt;I know, there is no code sample with this post. I think developers can still benefit from it...&lt;br /&gt;&lt;br /&gt;yours,&lt;br /&gt;&lt;br /&gt;Benny.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-7654638566063184698?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/7654638566063184698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=7654638566063184698' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7654638566063184698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7654638566063184698'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/06/place-of-intuition-in-development.html' title='The place of Intuition in the Development process'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-5534717831945363744</id><published>2007-05-31T12:33:00.000-07:00</published><updated>2007-06-05T11:19:53.124-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='samples'/><category scheme='http://www.blogger.com/atom/ns#' term='open source'/><category scheme='http://www.blogger.com/atom/ns#' term='control toolkit'/><category scheme='http://www.blogger.com/atom/ns#' term='codeplex'/><category scheme='http://www.blogger.com/atom/ns#' term='demo'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='code samples'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='controls'/><title type='text'>ASP.NET AJAX Control Toolkit</title><content type='html'>Check out the new &lt;a href="http://ajax.asp.net/toolkit/default.aspx"&gt;Ajax controls&lt;/a&gt; from &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;Microsoft&lt;/span&gt;, featured on &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;CodePlex&lt;/span&gt;, their open source site. They have some neat solutions to tasks that we had some hard time doing before this toolkit came to be, and they are giving it away for free right now. On the site check out the live demo they have, it show samples to all the controls.&lt;br /&gt;&lt;br /&gt;I have not &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;started&lt;/span&gt; to use it yet, but my company &lt;a href="http://www.5min.com/"&gt;5min.com&lt;/a&gt; intends to use it from now on, so I will be reporting about progress and problems with this kit, and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;probably&lt;/span&gt; some code samples of my own.&lt;br /&gt;&lt;br /&gt;If any of you out there has any experience with this toolkit or with asp.net Ajax library I would like to hear how it is going for you.&lt;br /&gt;&lt;br /&gt;Benny.Publish();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-5534717831945363744?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/5534717831945363744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=5534717831945363744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/5534717831945363744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/5534717831945363744'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/05/aspnet-ajax-control-toolkit.html' title='ASP.NET AJAX Control Toolkit'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-2113208285745129786</id><published>2007-05-18T04:00:00.000-07:00</published><updated>2007-05-18T08:59:25.768-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='http'/><category scheme='http://www.blogger.com/atom/ns#' term='loadvars'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Using JSON to connect Flash with Asp.Net</title><content type='html'>Life of a programmer are becoming more and more simple when it comes to finding professional help online. Almost any question i have regarding my work, like how to do this, why that doesn't work, etc' I can always find the answer one google search away. Few clicks later i have an explenation, code sample or other solutions. This week i tried to do something that had no good samples or documentation. That made me feel like i have reached the limits of existing technology, and know i'm trying things that other never did before. It is quite exciting for me.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This week Alexey and I wrote a simple "Invite a friend" feature. There is nothing exciting about that in itself. The feature was written inside a Flash control and the business object that actually sends emails is part of our site's engine written in Asp.Net.&lt;br /&gt;Http communication between Flash and web pages is common, and can be done by using the LoadVars object in ActionScript code. You can see a good example &lt;a href="http://www.sephiroth.it/tutorials/flashPHP/loadVars/"&gt;here&lt;/a&gt;. There are practicaly 3 ways to transfer data over Http to Flash objects. One is sending the data "as is", which is good when you pass one parameter or two. Two is using XML to pack the data on one side and unpack it on the other side. Three is using JSON as the data structure standard. I chose JSON because the code required to Serialize and Deserialize JSON objects and strings is much simpler, shorter, more intuitive and more object oriented. You will see in the samples that one line of code is required in every side of the interaction to persist objects over http between Asp.Net and Flash ActionScript, or any other two sides for that matter.&lt;br /&gt;&lt;br /&gt;The c# code for creating Json object on the server is available &lt;a href="http://newtonsoft.com/products/json/"&gt;here&lt;/a&gt; and uses Newtonsoft Json.Net objects.&lt;br /&gt;The Actionscript code however, is not available on the internet yet, only here. this code recieves the Json object inside Flash and reads it's values like this: ( I got this code from &lt;a href="http://designvox.com/"&gt;Trannie&lt;/a&gt; who wrote the &lt;a href="http://json.org/JSON.as"&gt;Json ActionScript 2 object&lt;/a&gt;.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="q" id="q_1128c13c9f1a466b_0"&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="q" id="q_1128c13c9f1a466b_0"&gt;&lt;span style="font-family: courier new;"&gt;In my projects I used LoadVars to grab the JSON string, so my JSON file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;had a NAME=VALUE format with VALUE being the JSON string:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;client= {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        "name"    : "Client", &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        "crop"    : { "x1" : 3, "y1" : 3, "x2" : 623, "y2" : 472 },&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        "link"    : {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                "type" : "site",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                "url"  : " &lt;/span&gt;&lt;a style="font-family: courier new;" href="http://www.clientsite.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"&gt;http://www.clientsite.com&lt;/a&gt;&lt;span style="font-family: courier new;"&gt;"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        },&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        "title"   : "Job Name",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        "text"    : "This is a string describing the project", &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        "details" : [&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                        "full"&lt;/span&gt;&lt;wbr style="font-family: courier new;"&gt;&lt;span style="font-family: courier new;"&gt;  : "Browse.jpg",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                        "thumb" : "THB_Browse.jpg"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                }, &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                        "full"&lt;/span&gt;&lt;wbr style="font-family: courier new;"&gt;&lt;span style="font-family: courier new;"&gt;  : "HSWebShot2.jpg",&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                        "thumb" : "THB_HSWebShot2.jpg"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;} &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Hopefully that is still valid JSON.  It's an excerpt from a JSON file,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;so I may have introduced some typos..&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;In AS, I'd do something like:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;var client:Object;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;var json = new JSON();&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: courier new;"&gt;var lv:LoadVars = new LoadVars();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;lv.onLoad = function(success) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        if(success) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                client = json.parse(this.client);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                trace(&lt;/span&gt;&lt;a style="font-family: courier new;" href="http://client.name/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"&gt;client.name&lt;/a&gt;&lt;span style="font-family: courier new;"&gt; );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                trace(client.details[1]);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;                getURL(client.link.url);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We had some trouble on the ActionScript side because we confused the LoadVars Http object with the internal Json object, so let me elaborate on this. the LoadVars object is the one that use Load method to send Http request to the server, and the onLoad callback function that recieves the response from the server. In order to send Json string in such a request you should use ActionScript syntax to wrap your Json string. The response stream should include the "client =" part, which is NOT generated by the Json server-side class. This part is actually not part of Json, but is used by the Flash LoadVars object in order to read this Json string in ActionScript.&lt;br /&gt;&lt;br /&gt;Finally, i want to hear from you what kind of uses can you see for such technology that connects Flash applications with Asp.Net objects so smoothly and easily.&lt;br /&gt;&lt;br /&gt;Until next time,&lt;br /&gt;&lt;br /&gt;Benny.Serialize(this)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-2113208285745129786?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/2113208285745129786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=2113208285745129786' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/2113208285745129786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/2113208285745129786'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/05/using-json-to-connect-flash-with-aspnet.html' title='Using JSON to connect Flash with Asp.Net'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-7211024469016307865</id><published>2007-05-09T10:17:00.000-07:00</published><updated>2007-05-09T11:49:20.327-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='json'/><title type='text'>Using JSON in AJAX based applications</title><content type='html'>&lt;span style="font-weight: bold;font-size:130%;" &gt;Who the hell is Json ?&lt;/span&gt;&lt;br /&gt;Ajax is a very popular way to create dynamic web2.0 style web pages. It is a method of making asynchronous Javascript calls from web pages to web servers, allowing  web pages that refresh different parts of the page with server data without loading the whole page every time. Ajax is used for many different tasks from news reels to rating widgets and much more. The Ajax interface is simple and open. Send an Http request with parameters info, and receive a call-back with the Http response. You can send anything both ways, but when you need to move large chunks of complex data you are on your own. You have to define the data structures, take care of any errors that happen, and so on.&lt;br /&gt;&lt;br /&gt;Json stands for &lt;span style="font-weight: bold;"&gt;J&lt;/span&gt;ava&lt;span style="font-weight: bold;"&gt;S&lt;/span&gt;cript &lt;span style="font-weight: bold;"&gt;O&lt;/span&gt;bject &lt;span style="font-weight: bold;"&gt;N&lt;/span&gt;otation. Json is a protocol (like Xml is) for defining data passed through Ajax requests and responses. Json does not have to be used only with Ajax, it can be used to define javascript objects out of any data received to the browser. But Json is at it's best with Ajax, which demands some standard protocol for moving data through it.&lt;br /&gt;&lt;br /&gt;Json is supported on many platforms, like other open standards, and I will share my experience using it with Asp.Net and Visual Studio.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Who likes Json ?&lt;/span&gt;&lt;br /&gt;Json is good for any Ajax situation that uses more then one or two parameters. The sites that make the most out of it are those built Object Oriented. Json is a simple way to maintain in Javascript Client code the same Object structure that you use on the server for  getting the data and using your business-objects. If you keep to the same objects  structure even through your Xhtml code and Css files, you will get a very flexible and stable site.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Implementing Json&lt;/span&gt;&lt;br /&gt;Because Json is a client-server protocol there are two sides to the implementation :)&lt;br /&gt;For server side i use Newtonsoft Json.NET. It is a Dll file and Xml file that reside in your bin directory of the site, and allows you (after creating the proper reference) to write this kind of code in your server pages:&lt;br /&gt;&lt;br /&gt;&lt;center&gt;   &lt;div class="overflowpanel" style="width: 80%; text-align: left;"&gt;    &lt;div    style="background: white none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;font-family:Courier New;font-size:9pt;color:black;" class="code"&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:teal;"&gt;Product&lt;/span&gt; product = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:teal;"&gt;Product&lt;/span&gt;();&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;product.Name = &lt;span style="color:maroon;"&gt;"Apple"&lt;/span&gt;;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;product.Expiry = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:teal;"&gt;DateTime&lt;/span&gt;(2008, 12, 28);&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;product.Price = 3.99M;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;product.Sizes = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt;[] { &lt;span style="color:maroon;"&gt;"Small"&lt;/span&gt;, &lt;span style="color:maroon;"&gt;"Medium"&lt;/span&gt;, &lt;span style="color:maroon;"&gt;"Large"&lt;/span&gt; };&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; output = &lt;span style="color:teal;"&gt;JavaScriptConvert&lt;/span&gt;.SerializeObject(product);&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//{&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//  "Name": "Apple",&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//  "Expiry": new Date(1230422400000),&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//  "Price": 3.99,&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//  "Sizes": [&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//    "Small",&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//    "Medium",&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//    "Large"&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//  ]&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:green;"&gt;//}&lt;/span&gt;&lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt; &lt;/pre&gt;    &lt;pre style="margin: 0px;"&gt;&lt;span style="color:teal;"&gt;Product&lt;/span&gt; deserializedProduct =&lt;br /&gt; (&lt;span style="color:teal;"&gt;Product&lt;/span&gt;)&lt;span style="color:teal;"&gt;JavaScriptConvert&lt;/span&gt;.DeserializeObject(output, &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:teal;"&gt;Product&lt;/span&gt;));&lt;/pre&gt;    &lt;/div&gt;   &lt;/div&gt;  &lt;/center&gt;&lt;br /&gt;This code is a sample of how to convert any custom object that you use in your site to a string in Json format. This string is passed back to the client inside the Ajax response. The last line of code shows how to reverse the process, and convert Json strings that are received from the client into server objects.&lt;br /&gt;&lt;br /&gt;On the client side things look much the same, to the surprise of many Javascript programmers, me included.&lt;br /&gt;In order to parse the Json strings into Javascript objects on the client I use the json.js file from Json.org. It includes a Json parser. The client side code for reading a Json string will be:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;var myObject = myJSONtext.parseJSON(filter);&lt;/pre&gt;Then you can use myObject to access all his properties as they were on the server. Json supports any structure that includes objects with pairs of name-value properties inside them, and arrays of these objects, in any depth of nesting.&lt;br /&gt;When you are done juggling these objects on the client you can send them back to the server, maybe with updated data or even send totally different objects. anyway, the code will look like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;var myJSONText = myObject.toJSONString();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is pretty much the basics of json, but there is much more, so expect more on Json soon.&lt;br /&gt;&lt;br /&gt;If you are using Json in your work please reply and tell me how is it working for you, and what you are using it for.&lt;br /&gt;&lt;br /&gt;Benny is inlove with Json :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-7211024469016307865?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/7211024469016307865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=7211024469016307865' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7211024469016307865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7211024469016307865'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/05/using-json-in-ajax-based-applications.html' title='Using JSON in AJAX based applications'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-7181796679435054525</id><published>2007-05-04T15:52:00.000-07:00</published><updated>2007-05-04T16:24:41.246-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='permalink'/><category scheme='http://www.blogger.com/atom/ns#' term='sitemap'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='http handler'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='xmldocument'/><title type='text'>Creating and Submitting a Sitemap to Google</title><content type='html'>As many know, Google search results are based on a crawler software that surfs our sites like a regular user, more or less. If for some reason we have pages on our site that are not linked from any other page, they will not appear in search results. In order to improve google's crawling in our site we should send google a link to an Xml file that we create in our site, and in this file we can list all the site's pages that we want Google to show in his search results. This file is called a Sitemap.&lt;br /&gt;&lt;br /&gt;If a site is made of static pages, you just write them down in your file and you are done. All you need to do now (After submitting the Sitemap, of course) is to update the file with any new pages that you create. If, on the other hand, you are running a dynamic site that pulls it's pages out of a database, you have more work to do.&lt;br /&gt;&lt;br /&gt;First, you need to create a Permalink for every page. Permalink is a static Url, without ? and parameters in the Url. You can use any unique value for that, like product name or page title.&lt;br /&gt;A permalink can look like this: http://www.5min.com/Video/What-is-5min%20XH9DUGl7fO8%3d.&lt;br /&gt;Then you need to generate the sitemap from a server page. You can use the XmlDocument object model to build the correct &lt;a href="https://www.google.com/webmasters/tools/docs/en/protocol.html#sitemapXMLFormat"&gt;Xml file format&lt;/a&gt;. I suggest that you use an HttpHandler for this task, but any Asp page will do as well. All you need to do is to write the Xml file into the Http Response object.&lt;br /&gt;&lt;br /&gt;Now that you have the Sitemap ready, you have to submit it to google as your Sitemap. For this you have to register to the &lt;a href="www.google.com/webmasters/"&gt;Google Webmaster Tool&lt;/a&gt; service. If you already have a Google account then it's enough. There you have simple instructions how to submit your Sitemap. You can submit many sites and see how google reads them and more statistics.&lt;br /&gt;&lt;br /&gt;You can find good information on Sitemaps at &lt;a href="http://www.sitemaps.org/"&gt;http://www.sitemaps.org/.&lt;/a&gt;&lt;br /&gt;An already-made c# Sitemap class can be found &lt;a href="http://www.codeproject.com/cs/library/csharp_sitemap.asp"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Please comment with your opinion on this post.&lt;br /&gt;&lt;br /&gt;Benny.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-7181796679435054525?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/7181796679435054525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=7181796679435054525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7181796679435054525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/7181796679435054525'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/05/creating-and-submitting-sitemap-to.html' title='Creating and Submitting a Sitemap to Google'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-5911109044809422286</id><published>2007-04-22T07:11:00.000-07:00</published><updated>2007-04-22T07:42:14.678-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visual studio'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='internet explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><category scheme='http://www.blogger.com/atom/ns#' term='iis'/><title type='text'>Debugging Javascript in Visual Studio</title><content type='html'>Last week our server crashed, and had us roaming the internet with no purpose for a couple of days. Maybe one day I will write about that a separate post. The outcome of this is that all Internet Explorer definitions were reset when i connected to the new server and domain. &lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since then, i was unable to debug javascript in visual studio. It took me a while to verify that I'm trying to debug the correct script and that the calling procedure is working fine. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I made sure that IIS was configured to debug asp pages, as you can see in the following pictures.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Inside the IIS console open the web site properties.&lt;br /&gt;&lt;a href="http://bp3.blogger.com/_u4nq3fR1ACc/RityVHAWhdI/AAAAAAAAAAw/Oswksk1JtuI/s1600-h/IISScriptDebugging1.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5056260713636857298" style="CURSOR: hand" alt="" src="http://bp3.blogger.com/_u4nq3fR1ACc/RityVHAWhdI/AAAAAAAAAAw/Oswksk1JtuI/s400/IISScriptDebugging1.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On the "Virtual directory" tab click on "Configuration".&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_u4nq3fR1ACc/Rityg3AWheI/AAAAAAAAAA4/DiRUp65khfs/s1600-h/IISScriptDebugging2.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5056260915500320226" style="CURSOR: hand" alt="" src="http://bp2.blogger.com/_u4nq3fR1ACc/Rityg3AWheI/AAAAAAAAAA4/DiRUp65khfs/s400/IISScriptDebugging2.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the configuration dialog select the Debugging tab and check the two debugging flags.&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_u4nq3fR1ACc/Rityq3AWhfI/AAAAAAAAABA/T7Pw0paW97E/s1600-h/IISScriptDebugging3.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5056261087299012082" style="CURSOR: hand" alt="" src="http://bp2.blogger.com/_u4nq3fR1ACc/Rityq3AWhfI/AAAAAAAAABA/T7Pw0paW97E/s400/IISScriptDebugging3.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The last thing to check was Internet Explorer Options. In order to debug Javascript inside Visual Studio one must uncheck the (default) options that disable javascript debugging both on Internet Explorer and on other browsers. this is the checkbox to uncheck:&lt;/div&gt;&lt;div&gt;&lt;a href="http://bp3.blogger.com/_u4nq3fR1ACc/RitvdHAWhcI/AAAAAAAAAAo/Y0GMm_-m5bk/s1600-h/ScriptDebugging.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5056257552540927426" style="CURSOR: hand" alt="" src="http://bp3.blogger.com/_u4nq3fR1ACc/RitvdHAWhcI/AAAAAAAAAAo/Y0GMm_-m5bk/s400/ScriptDebugging.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, Now you can just break an any Javascript line, see all values inside the Visual Studio enviroment, and generally have fun while debugging your site :)&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;benny is freely debugging javascript...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-5911109044809422286?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/5911109044809422286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=5911109044809422286' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/5911109044809422286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/5911109044809422286'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/04/debugging-javascript-in-visual-studio.html' title='Debugging Javascript in Visual Studio'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_u4nq3fR1ACc/RityVHAWhdI/AAAAAAAAAAw/Oswksk1JtuI/s72-c/IISScriptDebugging1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-8616046869475208530</id><published>2007-04-22T01:20:00.000-07:00</published><updated>2007-04-22T01:27:22.762-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cache'/><category scheme='http://www.blogger.com/atom/ns#' term='iframe'/><category scheme='http://www.blogger.com/atom/ns#' term='query string'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>IFrame strikes back</title><content type='html'>Well, the IFrame bug from last post still exist, and we still don't know what to do about it.&lt;br /&gt;Some good news are that this bug now appears only seldom and we are less concerned about it. We created a random query string that we attached to this frame source url, to make sure that the browser really really really not caching the page. this way the browser thinks its a new page every time. This (at least we think so) lowered to frequency of appearance of the bug to reasonable levels. Yet, the mystery continues...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-8616046869475208530?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/8616046869475208530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=8616046869475208530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/8616046869475208530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/8616046869475208530'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/04/iframe-strikes-back.html' title='IFrame strikes back'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-5712998195680228302</id><published>2007-04-12T07:55:00.000-07:00</published><updated>2007-04-12T08:45:09.900-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='http'/><category scheme='http://www.blogger.com/atom/ns#' term='sniffer'/><category scheme='http://www.blogger.com/atom/ns#' term='cache'/><category scheme='http://www.blogger.com/atom/ns#' term='iframe'/><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><category scheme='http://www.blogger.com/atom/ns#' term='experts exchange'/><title type='text'>IFrame object loads wrong pages !?!?!</title><content type='html'>This is truly a bug from hell.&lt;br /&gt;&lt;br /&gt;For the last two days the upload page on our site behaves very strange. If it was not so creepy i would say the page is sick :-)&lt;br /&gt;this page includes an IFrame object that shows a second page inside, we will call them Outer page and Inner page.&lt;br /&gt;What happends is this: when entering the outer page we sometimes see the inner page correctly. Other times we see the inner page broken, and the source shows that not all page was loaded. Other times we see even stranger things: the inner page is partially loaded and a totally different page is appended to it's end, creating a total mess on the page.&lt;br /&gt;&lt;br /&gt;this bug appears only on our production server (dedicated, hosted) and not on our internal network. We tried to move the javascripts on the page around with no change. We tried putting a meta tag that prevents caching of the page - again nothing changed.&lt;br /&gt;&lt;br /&gt;We are going to try a sniffer on the response and compare it with the browser source, maybe something goes wrong while rendering this page.&lt;br /&gt;&lt;br /&gt;I have not fount any documentation of such a bug anywhere on the net. I still didn't get any answers from any newsgroup or from &lt;a href="http://www.experts-exchange.com/"&gt;Experts Exchange&lt;/a&gt; (a great technical solution site). I'm getting a little worried...&lt;br /&gt;&lt;br /&gt;If anyone ever encountered such a problem or has any suggestions i will be happy to hear it.&lt;br /&gt;I will keep rolling this story as it happends.&lt;br /&gt;&lt;br /&gt;Scratching my head :-)&lt;br /&gt;Benny.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-5712998195680228302?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/5712998195680228302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=5712998195680228302' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/5712998195680228302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/5712998195680228302'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/04/iframe-object-loads-wrong-pages.html' title='IFrame object loads wrong pages !?!?!'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-2541516740289050950</id><published>2007-04-12T01:23:00.000-07:00</published><updated>2007-04-12T01:46:06.749-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='server'/><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='tag'/><category scheme='http://www.blogger.com/atom/ns#' term='object'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>Flash object fails to call Javascript function</title><content type='html'>&lt;a href="http://www.gortonstudios.com/sites/default/files/u1/flash_logo.jpg"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 54px; CURSOR: hand; HEIGHT: 59px" height="54" alt="" src="http://www.gortonstudios.com/sites/default/files/u1/flash_logo.jpg" border="0" /&gt;&lt;/a&gt; The most popular way to show video in web pages today is to play the video files inside flash players that are embedded inside the html page. Like everyone else we did it too and it works just fine.&lt;br /&gt;&lt;p&gt;A new feature that we added to our site is the ability to embed our flash player into any blog or site page, and for this purpose we also added a feature that sends information from the flash player to our server each time someone plays one of our videos somewhere out there. That way we can count how many views our videos get even outside the site.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;When we added this view-counter feature we could not get it to work. The flash player did not reach the server page even though we wrote the calling code properly.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;After looking at some professional blogs and sites we found out the problem: we use the name "5minPlayer" as our player tag name, and the Object tag that holds the flash player should not begin with a number...&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There are other limitations to this object tag, and also many things you should know if you are going to use flash on your page, especially if you are implementing extensive interaction between flash and the html page. A great page on this issue can be found &lt;a href="http://www.permadi.com/tutorial/flashjscommand/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-2541516740289050950?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/2541516740289050950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=2541516740289050950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/2541516740289050950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/2541516740289050950'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/04/flash-object-fails-to-call-javascript.html' title='Flash object fails to call Javascript function'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-6900144547578472691</id><published>2007-03-21T05:15:00.000-07:00</published><updated>2007-03-21T06:17:30.025-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='browser ie internet explorer firefox request browsercapabilities'/><title type='text'>Browser Compatability</title><content type='html'>&lt;a href="http://static.flickr.com/9/15923400_bf9916f690.jpg"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 116px; CURSOR: hand; HEIGHT: 112px" height="86" alt="" src="http://static.flickr.com/9/15923400_bf9916f690.jpg" border="0" /&gt;&lt;/a&gt;&lt;a href="http://z.about.com/d/websearch/1/0/n/3/bluee.png"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 94px; CURSOR: hand; HEIGHT: 108px" height="108" alt="" src="http://z.about.com/d/websearch/1/0/n/3/bluee.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;As we all know (and don't like it...) different browsers display HTML pages differently. We always work hard to make the pages we write to look good and the same in all browsers, or at least in the more popular ones. Some browsers that we will not mention their name (but they are made by microsoft) show HTML differently even between version. some not-very-sophisticated code works in one version and not in the other, especially new code is not backward competible.&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Arial;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Arial;"&gt;There are two ways to tackle this situation. One is to write "lower denominator code", HTML code that all browsers and versions treat the same, and avoiding code that the browsers show differently. This leaves us with a pretty basic subset of HTML, but it can be done for simpler pages.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Arial;"&gt;The second way is to write browser-specific code. something in the area of "If IE then do this, else if Firefox do that". this should be done only in cases where there is no unified solution that include all browsers.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Arial;"&gt;In order to apply the second solution on the server side i suggest using these components and methods:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Arial;"&gt;Create an Enum for all different supported browsers and version, something like that:&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family:Arial;"&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public enum Browsers&lt;br /&gt;{&lt;br /&gt;IE6,&lt;br /&gt;IE7,&lt;br /&gt;Firefox2,&lt;br /&gt;Safari1&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Create a function that recieves the BrowserCapabilities object included inside every HTTP request, and returns the specific browser and version as one of the Enum members:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family:courier new;"&gt;public Enums.Browsers GetBrowser(HttpBrowserCapabilities browserCap)&lt;br /&gt;{&lt;br /&gt;string strBrowser = browserCap.Browser;&lt;br /&gt;int majorVer = browserCap.MajorVersion;&lt;br /&gt;return (Enums.Browsers)Enum.Parse(typeof(Enums.Browsers), strBrowser + majorVer.ToString());&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:arial;"&gt;Use this function to easily create switch cases to handle places that need different treatment for each browser: (In this case i use a negative margin to eliminate a blank area created in the original of a relatively-positioned Div element that includes an overlay image. This bug happends only in IE version 6)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="font-family:courier new;"&gt;switch (utils.GetBrowser(Request.Browser))&lt;br /&gt;{&lt;br /&gt;case Enums.Browsers.IE6:&lt;br /&gt;divPlayImage.Style.Add("margin-bottom", (0- imgPlay.Height - 3).ToString() + "px");&lt;br /&gt;break;&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Arial;"&gt;Happy coding,&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Arial;"&gt;Benny.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-6900144547578472691?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/6900144547578472691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=6900144547578472691' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/6900144547578472691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/6900144547578472691'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/03/browser-compatability.html' title='Browser Compatability'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-8884701903514962231</id><published>2007-03-16T02:43:00.000-07:00</published><updated>2007-03-16T02:53:05.384-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='duration length minutes seconds formatting'/><title type='text'>Formatting durations</title><content type='html'>As the internet gets filled with media files more and more sites need to display the duration of the audio/video file next to the file name and description. We store a file's play duration as a number of seconds in the database. In order to display the duration in a x:xx format we need to format it, using this small function:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;private string FormatDuration(short seconds)&lt;br /&gt;{&lt;br /&gt;string result = string.Empty;&lt;br /&gt;int minutes = seconds / 60;&lt;br /&gt;int secondsLeft = seconds % 60;&lt;br /&gt;result = minutes.ToString() + ":" + secondsLeft.ToString("00");&lt;br /&gt;return result;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-8884701903514962231?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/8884701903514962231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=8884701903514962231' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/8884701903514962231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/8884701903514962231'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/03/formatting-durations.html' title='Formatting durations'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-5742098682270606393</id><published>2007-03-15T01:44:00.000-07:00</published><updated>2007-03-15T01:59:38.280-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tags'/><category scheme='http://www.blogger.com/atom/ns#' term='split'/><category scheme='http://www.blogger.com/atom/ns#' term='array'/><category scheme='http://www.blogger.com/atom/ns#' term='tag'/><category scheme='http://www.blogger.com/atom/ns#' term='parsing'/><category scheme='http://www.blogger.com/atom/ns#' term='string'/><title type='text'>Parsing tags input using Split function</title><content type='html'>User input validation is one of the more complex issues in developing a solid data-entry form. Input validation is the basis of application security, database integrity, application stability and more.&lt;br /&gt;&lt;br /&gt;Today i encountered an input validation issue regarding the input that users enter as "tags", the popular new type of information used in many User Generated Content (UGC) sites.&lt;br /&gt;&lt;br /&gt;When i used the function Split from the String class to parse the tags into an array of strings i found out that if the user entered multiple space characters (eg. "tag1 tag2    tag3") each space from the second one will result in an empty cell in the tags array. Splitting these sample tags will result in this array:&lt;br /&gt;array[0]: "tag1"&lt;br /&gt;array[1]: "tag2"&lt;br /&gt;array[2]: ""&lt;br /&gt;array[3]: ""&lt;br /&gt;array[4]: ""&lt;br /&gt;array[5]: "tag3"&lt;br /&gt;&lt;br /&gt;In order to avoid entering blank tags in the database i wrote a simple function that prepares a clean array of tags from the raw tags string. Here it is:&lt;br /&gt;(Besides removing empty cells this function also convert commas to blanks and lowers the case for all tags. This avoids multiple-word tags and case differences, as our project demands)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;private string[] PrepareTags(string tags)&lt;br /&gt;{&lt;br /&gt;char[] delim = { ' ' };&lt;br /&gt;//Replace comma with blank&lt;br /&gt;tags = tags.Replace(",", " ");&lt;br /&gt;//Split to array with blank delimiter&lt;br /&gt;string[] tagsArray = tags.Split(delim);&lt;br /&gt;ArrayList tagsList = new ArrayList();&lt;br /&gt;//Eliminate empty cells&lt;br /&gt;string[] preparedTags;&lt;br /&gt;for (int i = 0; i &lt; tagsArray.Length; i++)&lt;br /&gt;{&lt;br /&gt;if (tagsArray[i].Trim().Length &gt; 0)&lt;br /&gt;//Make all tags lowercase&lt;br /&gt;tagsList.Add((string)tagsArray[i].ToLower());&lt;br /&gt;}&lt;br /&gt;preparedTags = new string[tagsList.Count];&lt;br /&gt;tagsList.CopyTo(preparedTags);&lt;br /&gt;return preparedTags;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;If you find this function useful please comment and tell me.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-5742098682270606393?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/5742098682270606393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=5742098682270606393' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/5742098682270606393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/5742098682270606393'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/03/parsing-tags-input-using-split-function.html' title='Parsing tags input using Split function'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7745129748420905494.post-1396429278112213744</id><published>2007-03-12T01:22:00.000-07:00</published><updated>2007-03-12T02:25:14.388-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ajax cache request response pragma'/><title type='text'>Cached Ajax Response</title><content type='html'>On my project i have a nice Upload wizard. It allows a user to write file information while the file is uploading. This page uses Ajax calls in order to communicate with the server while the file is still uploading.&lt;br /&gt;&lt;br /&gt;I had strange behaviour with this page...&lt;br /&gt;Sometimes it worked and sometimes not...&lt;br /&gt;While debugging i found out that if i upload the same file twice the second time fails.&lt;br /&gt;After placing breakpoints i found that the Ajax requests that fail never reach the server side.&lt;br /&gt;This fact gave me the idea that the response is being CACHED by the browser.&lt;br /&gt;&lt;br /&gt;In order to prevent Ajax requests from being cached by the browser i put these lines in my code before writing the response:&lt;br /&gt;&lt;br /&gt;Response.Clear();&lt;br /&gt;Response.CacheControl = "no-cache";&lt;br /&gt;Response.AddHeader("Pragma", "no-cache");&lt;br /&gt;Response.Expires = -1;&lt;br /&gt;Response.ContentType = "text/plain";&lt;br /&gt;&lt;br /&gt;This solved the problem entirly.&lt;br /&gt;&lt;br /&gt;P.S. If you are asking for static data using Ajax you may want it to be cached on the client to shorten response time. In that case don't use this code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7745129748420905494-1396429278112213744?l=bloodsweatandbugs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bloodsweatandbugs.blogspot.com/feeds/1396429278112213744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7745129748420905494&amp;postID=1396429278112213744' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/1396429278112213744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7745129748420905494/posts/default/1396429278112213744'/><link rel='alternate' type='text/html' href='http://bloodsweatandbugs.blogspot.com/2007/03/cached-ajax-response.html' title='Cached Ajax Response'/><author><name>Benyamin Shoham</name><uri>http://www.blogger.com/profile/06465751710166858952</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_u4nq3fR1ACc/SWu2m_kWvkI/AAAAAAAAADQ/_gqTtv6RZSg/S220/benny.shoham%40gmail.com_5ee820d3.jpg'/></author><thr:total>3</thr:total></entry></feed>
