<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>strings &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/strings/</link>
	<description>Feed of posts on WordPress.com tagged "strings"</description>
	<pubDate>Sat, 28 Nov 2009 09:57:39 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Lady Gaga Album Review]]></title>
<link>http://shortyc85.wordpress.com/2009/11/27/lady-gaga-album-review/</link>
<pubDate>Fri, 27 Nov 2009 23:23:13 +0000</pubDate>
<dc:creator>shortyc85</dc:creator>
<guid>http://shortyc85.wordpress.com/2009/11/27/lady-gaga-album-review/</guid>
<description><![CDATA[Well as I have said before Lady Gaga scares me a little bit.  But, I takes courage to go out and wea]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Well as I have said before Lady Gaga scares me a little bit.  But, I takes courage to go out and wear what you want to wear.  This is about the music not the physical appearance.  &#8221;The Fame Monster&#8221; is not really a new album it is more of an extension of last years release &#8220;The Fame.&#8221;  The latest installment is like Gaga&#8217;s previous work which is very pop and dance club related music.  It is  definitely more upbeat music for seven of the eight tracks.  But I do tend to have a soft spot for artists that include a string section in songs.  The song out of the seven that does include this is &#8220;Speechless.&#8221;  For some of you who watched the AMA&#8217;s, this song was the ending song in her performance.</p>
<p>So it really depends on who you are.  If you really like the dance club music you should buy all eight tracks.  But if you don&#8217;t really like the dance music then just get the &#8220;Speechless&#8221; track.   If you get the deluxe edition of this album &#8220;The Fame&#8221; album is the rest of the tracks on &#8220;The Fame Monster.&#8221;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Puppet Ruler]]></title>
<link>http://ahighfidelity.wordpress.com/2009/11/23/puppet-ruler/</link>
<pubDate>Tue, 24 Nov 2009 04:58:30 +0000</pubDate>
<dc:creator>A High Fidelity</dc:creator>
<guid>http://ahighfidelity.wordpress.com/2009/11/23/puppet-ruler/</guid>
<description><![CDATA[I keep on thinking how it would be to rule the world.  In my mind, I have it envisioned as if the wo]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I keep on thinking how it would be to rule the world.  In my mind, I have it envisioned as if the world was my puppet.  I&#8217;d be sitting indian style in the middle of space and just have all these strings on my fingers and I&#8217;d be controlling everything.</p>
<p>I would be a pretty bad ruler.  I never know what to do with my hands, so I can&#8217;t even imagine how I would handle it with strings attached to them.</p>
<p>That makes me think of that Nsync music video.  Yeah, you know.  You know.</p>
<p><a href="http://ahighfidelity.wordpress.com/files/2009/11/nsync8.jpg"><img class="alignnone size-full wp-image-52" title="nsync8" src="http://ahighfidelity.wordpress.com/files/2009/11/nsync8.jpg" alt="" width="476" height="236" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[American Music Awards Review]]></title>
<link>http://shortyc85.wordpress.com/2009/11/22/american-music-awards-review/</link>
<pubDate>Mon, 23 Nov 2009 04:19:40 +0000</pubDate>
<dc:creator>shortyc85</dc:creator>
<guid>http://shortyc85.wordpress.com/2009/11/22/american-music-awards-review/</guid>
<description><![CDATA[I enjoy watching awards that show a tribute to music.  Even if it is an awards show that is voted on]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I enjoy watching awards that show a tribute to music.  Even if it is an awards show that is voted on.  I would rather watch the performances on those because we all know it is the dumb ten year-olds that vote for those.  So, I just ignore the results.  I just got finished watching the American Music Awards.  There were many great moments and some head scratching moments.</p>
<p>I will start off with the fan voted awards.  The big winners were the late Michael Jackson and Taylor Swift.  Next I will go to the performance losers of the night.  First would be Rihanna.  I know she went through a bad year, but the performance was very messy.  The Second and last would be Adam Lambert.  I think it is good that there are artist out there that are open about their sexual preferences, but that was awkward.  It was a very screamy, pitchy performance.  I know a great songwriter Claude Kelly wrote this song, but I think he went a little skew with this one.</p>
<p>Now For the best performances of the night.  First would be Kelly Clarkson.  I an a big fan of songs that include orchestra strings.  They had changed this song because of the comparison to Beyonce, but this version is great.  I would like if Clarkson had done maybe a new song, but performing a different version is good.  Second would be Lady GaGa. Physically she scares me a little, but musically she is fantastic.  She proves that you should not judge by appearance and listen to the music.  It was great when she smashed her way in to the piano section.  Piano was a great choice to include.  Lastly was the great Whitney Houston.  The award of the night for her.  What is better that seeing a legend perform.  It is great to see her back again.  These three ladies also did what not many on the show did.  They performed on pitch and key.      I just wish the ending of the show was different.</p>
<p>Overall, It was an alright show.  The end went for too much shock value and could end up overshadowing the great performances in this show.  Congrats to all the winners and good night.  I hope&#8230;&#8230;.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Strings MySQL]]></title>
<link>http://c0d3rs.wordpress.com/2009/11/22/strings-mysql/</link>
<pubDate>Sun, 22 Nov 2009 21:26:51 +0000</pubDate>
<dc:creator>c0d3rs</dc:creator>
<guid>http://c0d3rs.wordpress.com/2009/11/22/strings-mysql/</guid>
<description><![CDATA[Respondendo a pergunta do f0ker a respeito de quando se usa unhex ou outras strings. http://dev.mysq]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Respondendo a pergunta do f0ker a respeito de quando se usa unhex ou outras strings.</p>
<p><!--more--></p>
<p>http://dev.mysql.com/doc/refman/5.0/en/string-functions.html</p>
<p><strong>ASCII()</strong> 	Return numeric value of left-most character</p>
<p><strong>BIN()</strong> 	Return a string representation of the argument</p>
<p><strong>BIT_LENGTH()</strong> 	Return length of argument in bits</p>
<p><strong>CHAR_LENGTH()</strong>	Return number of characters in argument</p>
<p><strong>CHAR()</strong> 	Return the character for each integer passed</p>
<p><strong>CHARACTER_LENGTH()</strong> 	A synonym for CHAR_LENGTH()</p>
<p><strong>CONCAT_WS()</strong> 	Return concatenate with separator</p>
<p><strong>CONCAT()</strong> 	Return concatenated string</p>
<p><strong>ELT()</strong> 	Return string at index number</p>
<p><strong>EXPORT_SET()</strong> 	Return a string such that for every bit set in the value bits, you get an on string<br />
and for every unset bit, you get an off string</p>
<p><strong>FIELD()</strong> 	Return the index (position) of the first argument in the subsequent arguments</p>
<p><strong>FIND_IN_SET()</strong> 	Return the index position of the first argument within the second argument</p>
<p><strong>FORMAT()</strong> 	Return a number formatted to specified number of decimal places</p>
<p><strong>HEX()</strong> 	Return a hexadecimal representation of a decimal or string value</p>
<p><strong>INSERT()</strong> 	Insert a substring at the specified position up to the specified number of characters</p>
<p><strong>INSTR()</strong> 	Return the index of the first occurrence of substring</p>
<p><strong>LCASE()</strong> 	Synonym for LOWER()</p>
<p><strong>LEFT()</strong> 	Return the leftmost number of characters as specified</p>
<p><strong>LENGTH()</strong> 	Return the length of a string in bytes<br />
LIKE 	Simple pattern matching</p>
<p><strong>LOAD_FILE()</strong> 	Load the named file</p>
<p><strong>LOCATE()</strong> 	Return the position of the first occurrence of substring</p>
<p><strong>LOWER()</strong> 	Return the argument in lowercase</p>
<p><strong>LPAD()</strong> 	Return the string argument, left-padded with the specified string</p>
<p><strong>LTRIM()</strong>	Remove leading spaces</p>
<p><strong>MAKE_SET()</strong> 	Return a set of comma-separated strings that have the corresponding bit in bits set</p>
<p><strong>MATCH</strong> 	Perform full-text search</p>
<p><strong>MID()</strong> 	Return a substring starting from the specified position</p>
<p><strong>NOT LIKE</strong> 	Negation of simple pattern matching</p>
<p><strong>NOT REGEXP</strong> 	Negation of REGEXP</p>
<p><strong>OCTET_LENGTH()</strong> 	A synonym for LENGTH()</p>
<p><strong>ORD()</strong> 	Return character code for leftmost<br />
character of the argument</p>
<p><strong>POSITION()</strong> 	A synonym for LOCATE()</p>
<p><strong>QUOTE()</strong> 	Escape the argument for use in an SQL statement</p>
<p><strong>REGEXP</strong> 	Pattern matching using regular expressions</p>
<p><strong>REPEAT()</strong> 	Repeat a string the specified number of times</p>
<p><strong>REPLACE()</strong> 	Replace occurrences of a specified string</p>
<p><strong>REVERSE()</strong> 	Reverse the characters in a string</p>
<p><strong>RIGHT()</strong> 	Return the specified rightmost number of characters</p>
<p><strong>RLIKE</strong> 	Synonym for REGEXP</p>
<p><strong>RPAD()</strong> 	Append string the specified number of times</p>
<p><strong>RTRIM()</strong> 	Remove trailing spaces</p>
<p><strong>SOUNDEX()</strong> 	Return a soundex string</p>
<p><strong>SOUNDS LIKE(v4.1.0)</strong> 	Compare sounds</p>
<p><strong>SPACE()</strong> 	Return a string of the specified number of spaces</p>
<p><strong>STRCMP()</strong> 	Compare two strings</p>
<p><strong>SUBSTR()</strong> 	Return the substring as specified</p>
<p><strong>SUBSTRING_INDEX()</strong> 	Return a substring from a string before the specified number of occurrences of the delimiter</p>
<p><strong>SUBSTRING()</strong> 	Return the substring as specified</p>
<p><strong>TRIM()</strong> 	Remove leading and trailing spaces</p>
<p><strong>UCASE()</strong> 	Synonym for UPPER()</p>
<p><strong>UNHEX()(v4.1.2)</strong> 	Convert each pair of hexadecimal digits to a character</p>
<p><strong>UPPER()</strong> 	Convert to uppercase</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Pakistani music -- Down Memory Lane]]></title>
<link>http://justmyself.wordpress.com/2009/11/22/218/</link>
<pubDate>Sun, 22 Nov 2009 13:41:22 +0000</pubDate>
<dc:creator>Mohsin</dc:creator>
<guid>http://justmyself.wordpress.com/2009/11/22/218/</guid>
<description><![CDATA[I spent  last Saturday evening listening to  some Pakistani songs. Most of these songs were from 90s]]></description>
<content:encoded><![CDATA[I spent  last Saturday evening listening to  some Pakistani songs. Most of these songs were from 90s]]></content:encoded>
</item>
<item>
<title><![CDATA[Know Your Guitar]]></title>
<link>http://music4355.wordpress.com/2009/11/21/know-your-guitar/</link>
<pubDate>Sat, 21 Nov 2009 03:18:09 +0000</pubDate>
<dc:creator>music4355</dc:creator>
<guid>http://music4355.wordpress.com/2009/11/21/know-your-guitar/</guid>
<description><![CDATA[Playing guitar is fun and can be fun to learn. This guide is help you in choosing your first guitar ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p> Playing guitar is fun and can be fun to learn. This guide is help you in choosing your first guitar that you will be learning on.</p>
<p>Go to a local music store and look around. You will see many guitars. Electric guitars, solid body, hollow body, acoustic guitars, acoustic/electric guitars, travel guitars, and bass guitars. These instruments can range anywhere from about $50 USD to $5,000 USD. That&#8217;s right, you can<br />
 easily pay in the range of $5,000 for a non-electric, acoustic guitar. Go ahead and look up a &#8220;Martin D-45 guitar&#8221; for an example.</p>
<p>First, is the instrument going to be for an adult or a child/teen? Is it going to be properly taken care of by who owns it? Is it ever going to be taken anywhere? (Camping, over to a friend&#8217;s house, to a hotel room on a weekend getaway.)</p>
<p>Some of the higher priced guitars such as &#8220;Gibson&#8221;, &#8220;Fender&#8221;, &#8220;Martin&#8221;, or &#8220;Taylor&#8221; will hold their value and may even increase in value later down the road if they are properly taken care of.</p>
<p>Now we all know that children have been known to take on many projects only to never finish them. And this rings true for learning to play a musical instrument as well. I&#8217;ve seen young teens take up guitar only to discover the opposite sex 2 months into it and never pick it up again. The last thing you want to do is spend $1500 USD on a &#8220;Jackson USA Soloist&#8221; electric guitar and another $2,000 USD for a &#8220;Marshall&#8221; all tube half stack and have your son or daughter ding and scratch up the guitar only to find they loose interest in it in a few months.</p>
<p>So it is my recommendation that a first guitar for a child or teen should be UNDER $200 for the guitar itself. Then if in a year or two, your child is still playing it and has progressed, then you can justify spending about $850 USD for a new &#8220;USA Fender Stratocaster&#8221; and $500 &#8211; $700 for a decent combo amp.   &#8211; <a href="http://kum-kum.com/bass-guitar-chords.html">Bass Guitar Chords</a> -<br />
<br /> <a href="http://kum-kum.com">Guitar Fretboard Notes</a><br /><a href="http://www.zimbio.com/music6173191545671/articles/U6ewT4fe_o8/Know+Your+Guitar">Guitar Fretboard Notes</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Breaking Guitar Strings]]></title>
<link>http://guitarrepositoryonline.wordpress.com/2009/11/21/breaking-guitar-strings/</link>
<pubDate>Sat, 21 Nov 2009 02:04:00 +0000</pubDate>
<dc:creator>-geo</dc:creator>
<guid>http://guitarrepositoryonline.wordpress.com/2009/11/21/breaking-guitar-strings/</guid>
<description><![CDATA[Top ten reasons for breaking guitar strings 1. How long have the strings been in use? The longer str]]></description>
<content:encoded><![CDATA[Top ten reasons for breaking guitar strings 1. How long have the strings been in use? The longer str]]></content:encoded>
</item>
<item>
<title><![CDATA[The 6 strings of a guitar]]></title>
<link>http://guitarrepositoryonline.wordpress.com/2009/11/21/the-6-strings-of-a-guitar/</link>
<pubDate>Sat, 21 Nov 2009 01:32:00 +0000</pubDate>
<dc:creator>-geo</dc:creator>
<guid>http://guitarrepositoryonline.wordpress.com/2009/11/21/the-6-strings-of-a-guitar/</guid>
<description><![CDATA[This information is for 6 string guitars only, not 4,5,6,7,8,12, etc. stringed instruments. How to f]]></description>
<content:encoded><![CDATA[This information is for 6 string guitars only, not 4,5,6,7,8,12, etc. stringed instruments. How to f]]></content:encoded>
</item>
<item>
<title><![CDATA[A Few Special Concerts in 2010]]></title>
<link>http://hollyhofmann.wordpress.com/2009/11/20/a-few-special-concerts-in-2010/</link>
<pubDate>Fri, 20 Nov 2009 21:19:22 +0000</pubDate>
<dc:creator>hollyhofmann</dc:creator>
<guid>http://hollyhofmann.wordpress.com/2009/11/20/a-few-special-concerts-in-2010/</guid>
<description><![CDATA[Ellington-Strayhorn with Strings, two performances in February! Monday, Feb. 8, at Jazz Salt Lake: T]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h3>Ellington-Strayhorn with Strings, two performances in February!</h3>
<p><span style="color:#000080;"><strong><span style="color:#333333;"><a href="http://hollyhofmann.wordpress.com/files/2009/11/260px-duke_ellington_hat-e1258748100284.jpg"><img class="alignleft size-full wp-image-75" title="Small Duke" src="http://hollyhofmann.wordpress.com/files/2009/11/260px-duke_ellington_hat-e1258748100284.jpg" alt="" hspace="10" width="100" height="112" /></a>Monday, Feb. 8, at Jazz Salt Lake: <span style="color:#000080;font-weight:normal;"><span style="color:#333333;">The Quartet, joined by members of the <strong>Salt Lake Symphony Strings</strong>, performs the music of </span><a href="http://en.wikipedia.org/wiki/Duke_Ellington"><span style="text-decoration:none;"><span style="color:#333333;">Duke Ellington </span></span></a><span style="color:#333333;">and </span><a href="http://en.wikipedia.org/wiki/Billy_Strayhorn"><span style="text-decoration:none;"><span style="color:#333333;">Billy Strayhorn</span></span></a><span style="color:#333333;">, arranged for flute and jazz trio by <strong>Christopher Hughes, </strong></span><a href="http://en.wikipedia.org/wiki/Bill_Cunliffe"><span style="text-decoration:none;"><span style="color:#333333;"><strong>Bill Cunliffe</strong></span></span></a><span style="color:#333333;"> and </span><a href="http://en.wikipedia.org/wiki/Mike_Wofford"><span style="text-decoration:none;"><span style="color:#333333;"><strong>Mike Wofford</strong></span></span></a><span style="color:#333333;">. <span style="color:#000080;"><span style="color:#333333;">Joining me in the Quartet will be <a href="http://www.mikewofford.com/">Mike Wofford</a>, piano; </span><span style="color:#333333;"><a href="http://www.hamiltonjazz.com/lutybio.html"><strong>Christoph Luty</strong></a>, bass and <a href="http://www.hamiltonjazz.com/"><strong>Jeff Hamilton</strong></a>, drums.  M<em>ore information at </em><em><a href="http://jazzslc.com/">www.jazzslc.com</a>.</em></span></span></span></span></span></strong></span></p>
<p><strong> Saturday, Feb. 13, at the Newport Beach Jazz Party:<span style="color:#000000;"> </span><span style="font-weight:normal;"><span style="color:#000000;">The Quartet will perform with <strong>Orange County String Orchestra</strong>, again with a program of Ellington arranged for flute and jazz trio. I will be joined  again by <strong>Christoph Luty </strong>on bass, <strong>Jeff Hamilton</strong> on drums and <strong>Mike Wofford</strong>, piano. <em>More information at <a href="http://newportbeachjazzparty.com/">www.newportbeachjazzparty.com</a></em><em>.</em></span></span></strong></p>
<p><span style="color:#000080;"><span style="color:#000000;"><br />
</span></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Tangas pilladas voyeur]]></title>
<link>http://wmjgzm.wordpress.com/2009/11/20/tangas-pilladas-voyeur/</link>
<pubDate>Fri, 20 Nov 2009 18:25:07 +0000</pubDate>
<dc:creator>wmjgzm</dc:creator>
<guid>http://wmjgzm.wordpress.com/2009/11/20/tangas-pilladas-voyeur/</guid>
<description><![CDATA[Nuestras camaras espias han captado infinidad de culos con tangas y nenas wapisimas&#8230; veanlas a]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><table width="90%" border="0" align="center">
<tr>
<td width="130" align="center" valign="top"><a href="http://blogsexo.eu/descarga-video/?video=Tangas pilladas voyeur&#38;id=_skT3ycYHvE" rel="nofollow" target="_blank"><img src="http://i2.ytimg.com/vi/_skT3ycYHvE/default.jpg" width="120" height="90" alt="Tangas pilladas voyeur" title="Tangas pilladas voyeur" border="0"></a></td>
<td width="170" align="center">
<div style="border:1px dotted #0E5C0A;background-color:#EBFDEA;color:#266C6C;padding:5px;">Nuestras camaras espias han captado infinidad de culos con tangas y nenas wapisimas&#8230; veanlas aqui todas!</div>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<h2><a href="http://blogsexo.eu/descarga-video/?video=Tangas pilladas voyeur&#38;id=_skT3ycYHvE" rel="nofollow">DESCARGAR VIDEO COMPLETO!!</a></h2>
<p>Fuente: <a href="http://blogsexo.eu">Blog de Sexo</a>
</td>
</tr>
</table>
<p><!--more--><br />
<br />
 <a href="http://blogsexo.eu/descarga-video/?video=Tangas pilladas voyeur&#38;id=_skT3ycYHvE" rel="nofollow" target="_blank"><img src="http://i1.ytimg.com/vi/_skT3ycYHvE/1.jpg" width="120" height="90" alt="Tangas pilladas voyeur" title="Tangas pilladas voyeur" border="0"></a>   <a href="http://blogsexo.eu/descarga-video/?video=Tangas pilladas voyeur&#38;id=_skT3ycYHvE" rel="nofollow" target="_blank"><img src="http://i1.ytimg.com/vi/_skT3ycYHvE/2.jpg" width="120" height="90" alt="Tangas pilladas voyeur" title="Tangas pilladas voyeur" border="0"></a>   <a href="http://blogsexo.eu/descarga-video/?video=Tangas pilladas voyeur&#38;id=_skT3ycYHvE" rel="nofollow" target="_blank"><img src="http://i1.ytimg.com/vi/_skT3ycYHvE/3.jpg" width="120" height="90" alt="Tangas pilladas voyeur" title="Tangas pilladas voyeur" border="0"></a><br />

<div align="center"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/_skT3ycYHvE&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/_skT3ycYHvE&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[String Fundamentals]]></title>
<link>http://guitarrepositoryonline.wordpress.com/2009/11/19/string-fundamentals/</link>
<pubDate>Thu, 19 Nov 2009 22:09:00 +0000</pubDate>
<dc:creator>-geo</dc:creator>
<guid>http://guitarrepositoryonline.wordpress.com/2009/11/19/string-fundamentals/</guid>
<description><![CDATA[There are some basics you just need to know about strings. They can help you keep from damaging your]]></description>
<content:encoded><![CDATA[There are some basics you just need to know about strings. They can help you keep from damaging your]]></content:encoded>
</item>
<item>
<title><![CDATA[Types of Guitar Strings]]></title>
<link>http://guitarrepositoryonline.wordpress.com/2009/11/19/types-of-guitar-strings/</link>
<pubDate>Thu, 19 Nov 2009 21:09:00 +0000</pubDate>
<dc:creator>-geo</dc:creator>
<guid>http://guitarrepositoryonline.wordpress.com/2009/11/19/types-of-guitar-strings/</guid>
<description><![CDATA[Guitar strings fall into either the coated or uncoated category. Coated strings are where the wound ]]></description>
<content:encoded><![CDATA[Guitar strings fall into either the coated or uncoated category. Coated strings are where the wound ]]></content:encoded>
</item>
<item>
<title><![CDATA[Thank you for making the Shopping Party a huge success!]]></title>
<link>http://hrnv.wordpress.com/2009/11/19/thank-you-for-making-the-shopping-party-a-huge-success/</link>
<pubDate>Thu, 19 Nov 2009 15:01:08 +0000</pubDate>
<dc:creator>hrnv</dc:creator>
<guid>http://hrnv.wordpress.com/2009/11/19/thank-you-for-making-the-shopping-party-a-huge-success/</guid>
<description><![CDATA[Good Morning! I woke up really early because I was so excited after an incredible day yesterday. I a]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Good Morning! I woke up really early because I was so excited after an incredible day yesterday. I am sitting here having a pumpkin bagel with our honey butter and some hot mulled cider. It really feels and tastes like fall! I&#8217;ll post the honey butter recipe on our website because it is so easy and so over the top.</p>
<p>Yesterday we had so much fun! We kicked off holiday shopping with a party at my house. I met wonderful women and was able to catch up briefly with old friends. I want to thank everyone who participated because it was a special day.</p>
<p>I tried out three new recipes. The first was fabulous &#8211; persimmons with prosciutto topped with balsamic and olive oil. The second was dried pears topped with pureed tomato, peppers and cream cheese and a dot of the balsamic. The third was goat cheese toasts topped with walnuts and rosemary drizzled with honey.  I&#8217;ll post all three on our website and we had some old favorites including; marinated flank steak, sweet potato fries and the baked brie with balsamic.</p>
<p>Sarah Oliver of <a href="http://www.saraholiverhandbags.com/">Sarah Oliver Handbags</a> had her sophisticated and whimsical handbags, knit by the ladies from the Redwoods Senior Community.</p>
<p>Joy Schiffmann of <a href="http://www.bunnytailblankets.com/">Bunnytail Blankets</a> will be selling her cozy, colorful and weather-resistant baby blankets with endless uses including picnic blankets and capes.</p>
<p>Paula Escher and Barbara Fritz of <a href="http://www.etsy.com/shop/stringsnecklaces">Strings, Unique Necklaces</a> will be displaying their collection of jewelry made of semi precious stones and pearls.</p>
<p>Donna Miller Casey of <a href="http://www.snap-to-it.com">Snap To It Photography</a> was showing her photo cards and her matted 5 x 7 and 8 x 10 photos, as well as Paola Casey&#8217;s smocked dresses from Chile.</p>
<p>Laurie Rohrbach of <a href="http://www.lobird.com/">Lobird</a> had beautiful printed paper with vintage inspired illustrations and custom stationary.</p>
<p>Suzanne Ingalsbe Interiors sold her hand-painted decorative items. 415-775-7078</p>
<p>Amy Kelly&#8217;s Pink Pineapple&#8217;s linens 415-812-2685 with Ann Gerard and Stella &#38; Dot fashionable jewelry. 415-286-3692</p>
<p>Cathy Bennett showed her <a href="http://www.howfasttimeflies.com/">How Fast Time Flies</a>, a &#8220;Scrapbooking 2.0&#8243; website which allows you to make 12&#215;12 pages for babies, weddings and other life milestones.</p>
<p>Usha Burns of UB Chic had her fabulous little purses, perfect for an evening out, plus handmade gift tags, bangles and shawls from NY. 415-653-8656</p>
<p>Sara Curran of <a href="http://www.polkadogs.com/">Polka Dogs</a> had her reversible handcrafted belts from exquisite ribbons&#8230;fabulous cosmetic bags and key chains.</p>
<p>Tina Schreiber of <a href="http://www.velvetandtweed.com/">Velvet &#38; Tweed</a> had her adorable children&#8217;s clothing line, because growing up is a special occasion!</p>
<p><a href="http://www.plumpjack.com/">Plumpjack</a> had cool wine accessories, wine club memberships, &#38; goodies for the men in your life.</p>
<p>Cindy Helfrich of C Treasures with her vintage jewelry-embellished memo clip boards. 415-435-3860</p>
<p>Kim Meek of <a href="http://sausalito-style.com/">Sausalito Style</a> had her preppy chic ribbon belts.</p>
<p>Alexandra Skillman of <a href="http://vivanista.com/">Vivanista</a> was here to show off the beautiful website.</p>
<p>Thank you to everyone who helped make it possible!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[String Distance and Refactoring in Scala]]></title>
<link>http://oldfashionedsoftware.com/2009/11/19/string-distance-and-refactoring-in-scala/</link>
<pubDate>Thu, 19 Nov 2009 05:19:04 +0000</pubDate>
<dc:creator>Matt</dc:creator>
<guid>http://oldfashionedsoftware.com/2009/11/19/string-distance-and-refactoring-in-scala/</guid>
<description><![CDATA[Here&#8217;s a three-for-one special for you: A post about implementing the Levenshtein string dista]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Here&#8217;s a three-for-one special for you: A post about implementing the Levenshtein string distance algorithm in Scala AND refactoring it from an imperative style to a functional style AND I even throw in a short lesson on memoization. To make sure that our refactoring is correct and preserves the expected behavior, I&#8217;ll unit test the code along the way using ScalaTest. ScalaCheck, JUnit, or TestNG would work just as well, but I used ScalaTest.</p>
<h2>First Things First</h2>
<p>&#8220;What, exactly,&#8221; some of you may be asking, &#8220;is Levenshtein string distance?  Some kind of Teutonic tailoring terminology?&#8221; Not at all.  It&#8217;s a way of measuring how alike or different two strings of symbols are.  For example, the string &#8220;sturgeon&#8221; is a lot more similar to &#8220;surgeon&#8221; than to &#8220;urgently&#8221;.  &#8220;Sturgeon&#8221; and &#8220;surgeon&#8221; are only a single letter (t) apart.  They have a string distance of 1.  &#8220;Sturgeon&#8221; and &#8220;urgently&#8221; share some letters, but each has some letters not present in the other.  So what&#8217;s their string distance?  It&#8217;s not so obvious now.</p>
<p>String distance is useful.  The use that most quickly springs to mind is spelling correction.  If I type &#8220;computwr&#8221; a string distance algoritm could tell us that &#8220;computwr&#8221; is very close to the dictionary word &#8220;computer&#8221;.  But there&#8217;s more to it than that.  There are a lot of fuzzy problems in which you want to find which two sets of complex data are most similar.  One way to solve a problem like that is to encode it into a string compare using string distance.  For example, you could write a program to find pen strokes in an image and encode their shapes (up, curve left, down, angle right, etc) as a string which could be compared to known encodings for handwritten letters.  By finding the closest matches you can create a handwriting recognition program.  String distance is useful in DNA analysis, of course, recognizing patterns in signals, and a host of other situations.</p>
<p>The Levenshtein string distance algorithm was developed by Vladimir Levenshtein in 1965.  It can easily tell us the distance from &#8220;sturgeon&#8221; to &#8220;urgently&#8221;.  This algorithm breaks down string transformation into three basic operations:  adding a character, deleting a character, and replacing a character.  Each of these operations is assigned a cost, usually a cost of 1 for each operation.  Leaving a character unchanged has a cost of 0.  So to go from &#8220;sturgeon&#8221; to &#8220;surgeon&#8221; you leave the &#8220;s&#8221; unchanged for a cost of 0.  Then you add a &#8220;t&#8221; for a cost of 1.  All the other letters also remained unchanged, so the total cost is 1, just as we expected.</p>
<p>To change &#8220;sturgeon&#8221; to &#8220;urgently&#8221; is harder.  They have the same number of letters, so we could just do a replacement on each one for a distance of 8.  But is that the shortest distance?  What if we try to re-use that &#8220;urge&#8221; from &#8220;sturgeon&#8221;?  Can we re-use the &#8220;n&#8221;?  Does that help?  What about the &#8220;t&#8221;?  We need an algorithm that we can follow.</p>
<h2>The Grid</h2>
<p>What we need is a way to find the cheapest combination of operations which changes the first string to the second.  That&#8217;s the Levenshtein algorithm.  It works like this.  Write the first string vertically from top to bottom.  To the right of each letter write 1, 2, 3, etc.  Write a 0 above the number 1.  Then write the second string horizontally and again add the numbers 1, 2, 3 etc. to the right of the 0.  It will look something like this:</p>
<pre class="brush: python;">
    u r g e n t l y
  0 1 2 3 4 5 6 7 8
s 1
t 2
u 3
r 4
g 5
e 6
o 7
n 8
</pre>
<p>That&#8217;s the first step.  The grid remains un-filled-in at this point.  Can you guess what the grid positions are going to hold?  They are going to hold the cost to convert the various prefixes of &#8220;sturgeon&#8221; to the various prefixes of &#8220;urgently&#8221;.  The position at the intersection of row r4, and the column a2, for example, will contain the cost to convert &#8220;stur&#8221; to &#8220;ur&#8221;.  We fill in these positions (left-to-right then top to bottom) with the smallest of the following three numbers:</p>
<ul>
<li>The number above the current position plus one.
<li>The number to the left of the current position plus one.
<li>The above-left number if row letter and column letter are the same, or the above-left number plus one otherwise.
</ul>
<p>When we finish, the bottom right corner contains the cost to convert the first string to the second.</p>
<h2>But Why?  (Understanding the Algorithm)</h2>
<p>Those are some shockingly simple rules!  Let&#8217;s examine how they translate into string distance.</p>
<p>First, what are those numbers 0 to n that we write along the top and left?  They&#8217;re not just indices.  The numbers along the top represent the cost to convert the empty string to the various prefixes of &#8220;urgently&#8221;.  The cost is 0 to convert &#8220;&#8221; to &#8220;&#8221;, 1 to convert &#8220;&#8221; to &#8220;u&#8221;, 2 to convert &#8220;&#8221; to &#8220;ur&#8221;, and so on.  The numbers on the left are the cost to convert the prefixes of &#8220;sturgeon&#8221; to the the empty string .  &#8220;&#8221; to &#8220;&#8221; is 0, &#8220;s&#8221; to &#8220;&#8221; is 1, and so forth.  These costs are obvious.  The only way to convert &#8220;&#8221; to &#8220;urgently&#8221; is to add eight letters.  There&#8217;s nothing to delete, nothing to replace.  The only way to convert &#8220;sturgeon&#8221; to &#8220;&#8221; is to delete all eight letters.</p>
<p>Each position, as we have established, represents the cost to convert the string of characters down the left side ending in the current row&#8217;s character into the the string of characters along the top ending at the current column&#8217;s character.  Put another way, for any given position let&#8217;s call the current row&#8217;s letter A, and the current column&#8217;s letter B.  If we use a colon (:) to indicate string concatenation then the beginning string, the one along the left of the grid, can be written Prefix1:A.  So for our example word &#8220;sturgeon&#8221; if we look at a position in row e6 then Prefix1 is &#8220;sturg&#8221; and the final letter, which we&#8217;re calling A, is &#8220;e&#8221;.</p>
<p>So, speaking in terms of Prefix1, Prefix2, A, and B, we use the following inputs:</p>
<ul>
<li>The cost to change Prefix1 to Prefix2:<b>B</b> (the number above the current position).
<li>The cost to change Prefix1:<b>A</b> to Prefix2 (the number to the left).
<li>The cost to change Prefix1 to Prefix2 (the above-left number).
</ul>
<p>If we know the costs of these three conversions we can find the cost to change Prefix1:A to Prefix2:B using this logic:</p>
<ul>
<li>We know that if converting Prefix1 to Prefix2:B has a cost of X, then Prefix1:A can be converted to Prefix2:B for the cost of X plus the cost of deleting A, or X + 1.
<li>We know that if converting Prefix1:A to Prefix2 has a cost of Y, then Prefix1:A can be converted to Prefix2:B for the cost of Y plus the cost of adding B, or Y + 1.
<li>We know that if converting Prefix1 to Prefix2 has a cost of Z, then Prefix1:A can be converted to Prefix2:B for the cost of Z plus the cost of replacing A with B, or Z + (0 or 1 depending on whether A = B).
</ul>
<p>If you understand the above logic, then you understand this really neat algorithm.  It&#8217;s a quintessential example of dynamic programming.  The solution is built up by solving simpler problems.  You start with the trivial case of converting to and from the empty string, and then you build up the solution for the prefixes until you have the complete solution.</p>
<p>In the grid&#8217;s initial configuration there is only one location for which we know all three costs and that is row s1, column u1.  That&#8217;s the only space for which all three neighboring values (above, left, and above-left) are populated.  After we fill in this one, there are two more spaces available to us.  Those are (t2, u1) and (s1, r2).  Ordinarily, though, the spaces are populated line by line.</p>
<h2>A Simple Example</h2>
<p>Let&#8217;s do a quick example by hand.  Then we&#8217;ll take a stab at implementing it in code.  What&#8217;s the string distance from &#8220;hat&#8221; to &#8220;tape&#8221;?  First, our empty grid:</p>
<pre class="brush: python;">
    t a p e
  0 1 2 3 4
h 1
a 2
t 3
</pre>
<p>The first space is row h, column t.  The letters are different so our choices are 1 + 1 (above), 1 + 1 (left), or 0 + 1 (above-left).  0 + 1 is the smallest value, so the first space gets populated with 1.  The next space has choices 2 + 1 (above), 1 + 1 (left), or 1 + 1 (above-left).  1 + 1 is the lowest, so we fill in the second space with 2.  Once we finish the row, we have this:</p>
<pre class="brush: python;">
    t a p e
  0 1 2 3 4
h 1 1 2 3 4
a 2
t 3
</pre>
<p>The next space is row a, column t.  Our choices are 1 + 1 (above), 2 + 1 (left), or 1 + 1 (above-left).  1 + 1 is the smallest value, so the space gets populated with 2.  The next space has choices 2 + 1 (above), 2 + 1 (left), or 1 + 0 (above-left).  Why 1 + 0?  Because the above-left value is 1 and both letters for this space are &#8220;a&#8221; so we can replace &#8220;a&#8221; with &#8220;a&#8221; for free.  Go ahead and finish the whole grid.  This is the result:</p>
<pre class="brush: python;">
    t a p e
  0 1 2 3 4
h 1 1 2 3 4
a 2 2 1 2 3
t 3 2 2 2 3
</pre>
<p>The strings &#8220;hat&#8221; and &#8220;tape&#8221; have a distance of 3.</p>
<h2>Some Code, Finally</h2>
<p>As fascinating as Levenshtein distance is, and as much more as there is to say on the topic, the time has come to write some code.  Here&#8217;s a Scala implementation that is very close to the pencil-and-paper approach that we just performed.</p>
<pre class="brush: python;">
import scala.Math.min
import scala.Math.max

object StringDistance {
  def stringDistance(s1: String, s2: String): Int = {
    def minimum(i1: Int, i2: Int, i3: Int) = min(min(i1, i2), i3)

    val dist = new Array[Array[Int]](s1.length + 1, s2.length + 1)

    for (idx &#60;- 0 to s1.length) dist(idx)(0) = idx
    for (jdx &#60;- 0 to s2.length) dist(0)(jdx) = jdx

    for (idx &#60;- 1 to s1.length; jdx &#60;- 1 to s2.length)
      dist(idx)(jdx) = minimum (
        dist(idx-1)(jdx  ) + 1,
        dist(idx  )(jdx-1) + 1,
        dist(idx-1)(jdx-1) + (if (s1(idx-1) == s2(jdx-1)) 0 else 1)
      )

    dist(s1.length)(s2.length)
  }
</pre>
<p>Do you see what I mean when I say it&#8217;s close to the pencil-and-paper approach?  We actually construct a two-dimensional Array to represent the grid we drew earlier.  It&#8217;s a very literal implementation.</p>
<p>To explain the code briefly, we declare a singleton StringDistance having a single method called stringDistance.  Within this method we declare a 3-argument minimum method. (I wonder why there&#8217;s no &#8220;def min(params: Int*): Int&#8221; defined in scala.Math.)  Then we create an array called &#8220;dist&#8221; and populate the top row and leftmost column in lines 8-11.  The for loop on line 13 cycles through each array position from left to right then top to bottom, and populates them according to the Levenshtein logic. Finally, once the grid is filled in we return the number in the bottom right position.</p>
<p>The job&#8217;s not done yet, of course.  We haven&#8217;t written our unit tests.  Here&#8217;s the test I wrote:</p>
<pre class="brush: python;">
import org.scalatest._

class StringDistanceSuite extends FunSuite with PrivateMethodTester {

  test(&#34;stringDistance should work on empty strings&#34;) {
    assert( StringDistance.stringDistance(   &#34;&#34;,    &#34;&#34;) == 0 )
    assert( StringDistance.stringDistance(  &#34;a&#34;,    &#34;&#34;) == 1 )
    assert( StringDistance.stringDistance(   &#34;&#34;,   &#34;a&#34;) == 1 )
    assert( StringDistance.stringDistance(&#34;abc&#34;,    &#34;&#34;) == 3 )
    assert( StringDistance.stringDistance(   &#34;&#34;, &#34;abc&#34;) == 3 )
  }

  test(&#34;stringDistance should work equal strings&#34;) {
    assert( StringDistance.stringDistance(   &#34;&#34;,    &#34;&#34;) == 0 )
    assert( StringDistance.stringDistance(  &#34;a&#34;,   &#34;a&#34;) == 0 )
    assert( StringDistance.stringDistance(&#34;abc&#34;, &#34;abc&#34;) == 0 )
  }

  test(&#34;stringDistance should work where only inserts are needed&#34;) {
    assert( StringDistance.stringDistance(   &#34;&#34;,   &#34;a&#34;) == 1 )
    assert( StringDistance.stringDistance(  &#34;a&#34;,  &#34;ab&#34;) == 1 )
    assert( StringDistance.stringDistance(  &#34;b&#34;,  &#34;ab&#34;) == 1 )
    assert( StringDistance.stringDistance( &#34;ac&#34;, &#34;abc&#34;) == 1 )
    assert( StringDistance.stringDistance(&#34;abcdefg&#34;, &#34;xabxcdxxefxgx&#34;) == 6 )
  }

  test(&#34;stringDistance should work where only deletes are needed&#34;) {
    assert( StringDistance.stringDistance(  &#34;a&#34;,    &#34;&#34;) == 1 )
    assert( StringDistance.stringDistance( &#34;ab&#34;,   &#34;a&#34;) == 1 )
    assert( StringDistance.stringDistance( &#34;ab&#34;,   &#34;b&#34;) == 1 )
    assert( StringDistance.stringDistance(&#34;abc&#34;,  &#34;ac&#34;) == 1 )
    assert( StringDistance.stringDistance(&#34;xabxcdxxefxgx&#34;, &#34;abcdefg&#34;) == 6 )
  }

  test(&#34;stringDistance should work where only substitutions are needed&#34;) {
    assert( StringDistance.stringDistance(  &#34;a&#34;,   &#34;b&#34;) == 1 )
    assert( StringDistance.stringDistance( &#34;ab&#34;,  &#34;ac&#34;) == 1 )
    assert( StringDistance.stringDistance( &#34;ac&#34;,  &#34;bc&#34;) == 1 )
    assert( StringDistance.stringDistance(&#34;abc&#34;, &#34;axc&#34;) == 1 )
    assert( StringDistance.stringDistance(&#34;xabxcdxxefxgx&#34;, &#34;1ab2cd34ef5g6&#34;) == 6 )
  }

  test(&#34;stringDistance should work many operations are needed&#34;) {
    assert( StringDistance.stringDistance(&#34;example&#34;, &#34;samples&#34;) == 3 )
    assert( StringDistance.stringDistance(&#34;sturgeon&#34;, &#34;urgently&#34;) == 6 )
    assert( StringDistance.stringDistance(&#34;levenshtein&#34;, &#34;frankenstein&#34;) == 6 )
    assert( StringDistance.stringDistance(&#34;distance&#34;, &#34;difference&#34;) == 5 )
    assert( StringDistance.stringDistance(&#34;java was neat&#34;, &#34;scala is great&#34;) == 7 )
  }

}
</pre>
<p>It tests several special cases as well as the general case.  All we have to do is compile our StringDistance object and the StringDistanceSuite unit test, fire up the scala interpreter and run the test:</p>
<pre class="brush: python;">
scala&#62; (new StringDistanceSuite).execute()
Test Starting - StringDistanceSuite: recursiveStringDistance should work on empty strings
Test Succeeded - StringDistanceSuite: recursiveStringDistance should work on empty strings
Test Starting - StringDistanceSuite: recursiveStringDistance should work on equal strings
Test Succeeded - StringDistanceSuite: recursiveStringDistance should work on equal strings
Test Starting - StringDistanceSuite: recursiveStringDistance should work where only inserts are needed
Test Succeeded - StringDistanceSuite: recursiveStringDistance should work where only inserts are needed
Test Starting - StringDistanceSuite: recursiveStringDistance should work where only deletes are needed
Test Succeeded - StringDistanceSuite: recursiveStringDistance should work where only deletes are needed
Test Starting - StringDistanceSuite: recursiveStringDistance should work where only substitutions are needed
Test Succeeded - StringDistanceSuite: recursiveStringDistance should work where only substitutions are needed
Test Starting - StringDistanceSuite: stringDistance should work many operations are needed
Test Succeeded - StringDistanceSuite: stringDistance should work many operations are needed

scala&#62;
</pre>
<h2>Refactoring: Reduced Memory Usage</h2>
<p>The code passes all the tests, so let&#8217;s take things a step further.  One shortcoming of our implementation is that it can require a lot of memory.  That array has to be of size (n+1)*(m+1) where n and m are the lengths of the two strings we&#8217;re comparing.  If you want to apply the method to strings that are a few hundred characters long (or longer) then you&#8217;re starting to talk about some serious memory requirements.  How can we reduce the amount of memory required?  Can you think of a way?</p>
<p>Once we complete one row of the grid, we use it again as an input when we compute the next row.  But after that we&#8217;re done with it.  Why leave it to clutter the heap?  Let&#8217;s tweak our implementation slightly.  Try rewriting the method using only two rows.  Fill the first row with the initial 0, 1, 2, etc.  Then use one to compute the other over and over.  Think about how you would implement this, then have a look at my solution below.</p>
<pre class="brush: python;">
  def stringDistance(s1: String, s2: String): Int = {
    def minimum(i1: Int, i2: Int, i3: Int) = min(min(i1, i2), i3)

    var dist = ( new Array[Int](s1.length + 1),
                 new Array[Int](s1.length + 1) )

    for (idx &#60;- 0 to s1.length) dist._2(idx) = idx

    for (jdx &#60;- 1 to s2.length) {
      val (newDist, oldDist) = dist
      newDist(0) = jdx
      for (idx &#60;- 1 to s1.length) {
        newDist(idx) = minimum (
          oldDist(idx) + 1,
          newDist(idx-1) + 1,
          oldDist(idx-1) + (if (s1(idx-1) == s2(jdx-1)) 0 else 1)
        )
      }
      dist = dist.swap
    }

    dist._2(s1.length)
  }
</pre>
<p>This one uses a Pair (also called a Tuple2) containing two one-dimensional arrays, instead of a 2*(n+1) array.  Pair happens to have the very handy &#8220;swap&#8221; method which we can use to trade out the rows when we&#8217;ve finished one and are ready to compute the next.</p>
<p>This is where our unit tests really show their worth. No need to wonder whether this new code really does work.  We just recompile, run the tests again, and we can see that the code still gives us the expected results.</p>
<h2>Refactoring: Recursion, Kind Of</h2>
<p>What are some other ways we could write this code?  Can it be improved?  I thought I would try to replace the iteration in the previous implementations with recursion.  Here&#8217;s what that code looks like:</p>
<pre class="brush: python;">
  def stringDistance(s1: String, s2: String): Int = {
    def newCost(ins: Int, del: Int, subst: Int, c1: Char, c2:Char) =
      Math.min( Math.min( ins+1, del+1 ), subst + (if (c1 == c2) 0 else 1) )

    def getNewCosts(s1: List[Char], c2: Char, delVal: Int, prev: List[Int] ): List[Int] = (s1, prev) match {
      case (c1 :: _ , substVal :: insVal :: _) =&#62;
        delVal :: getNewCosts(s1.tail, c2, newCost(insVal, delVal, substVal, c1, c2), prev.tail)
      case _ =&#62; List(delVal)
    }

    def sd(s1: List[Char], s2: List[Char], prev: List[Int]): Int = s2 match {
      case Nil =&#62; prev.last
      case _ =&#62; sd( s1, s2.tail, getNewCosts(s1, s2.head, prev.head+1, prev) )
    }

    (s1, s2) match {
      case (`s2`, `s1`) =&#62; 0
      case (_, &#34;&#34;) &#124; (&#34;&#34;, _) =&#62; max(s1.length, s2.length)
      case _ =&#62; sd(s1.toList, s2.toList, (0 to s1.length).toList)
    }
  }
</pre>
<p>It&#8217;s a pretty naïve implementation, actually.  It just replaces the the repetition of the two for loops with the repetition of the recursion of the two methods sd and getNewCosts.  The sd method is even tail-recursive, allowing scala to optimize it.  It does the same basic thing as the for loop version, though.  It recurses through the characters of a row in the getNewCosts method, and it recurses through the rows of the grid in the sd method.</p>
<p>It looks more complicated than the previous implementations.  It&#8217;s harder to read.  But it passes our unit tests, so we can be pretty sure it&#8217;s correct.</p>
<h2>Refactoring: List Methods</h2>
<p>After the last implementation, I thought it looked a little sloppy.  I wondered whether I could improve the situation by using some of the many useful methods built into scala&#8217;s List class.  Here is the comparatively brief code that resulted:</p>
<pre class="brush: python;">
  def stringDistance(s1: String, s2: String): Int = {
    def sd(s1: List[Char], s2: List[Char], costs: List[Int]): Int = s2 match {
      case Nil =&#62; costs.last
      case c2 :: tail =&#62; sd( s1, tail,
          (List(costs.head+1) /: costs.zip(costs.tail).zip(s1))((a,b) =&#62; b match {
            case ((rep,ins), chr) =&#62; Math.min( Math.min( ins+1, a.head+1 ), rep + (if (chr==c2) 0 else 1) ) :: a
          }).reverse
        )
    }
    sd(s1.toList, s2.toList, (0 to s1.length).toList)
  }
</pre>
<p>Like I say, it&#8217;s brief.  Those List methods give you a lot of mileage.  </p>
<h2>Refactoring: Real Recursion</h2>
<p>The more I looked at my previous attempt at a recursive solution, the more I realized how hare-brained it was.  It wasn&#8217;t <i>real</i> recursion.  It was just iteration using the stack.  So I went back to the drawing board.  If I want to know the final answer, the value in the bottom right position, how do I get it?  I apply my three rules to the above, left, and above-left positions.  How do I get those positions?  Apply the rules again.  That&#8217;s real recursion.  Here&#8217;s my first stab at it:</p>
<pre class="brush: python;">
  def stringDistance(s1: String, s2: String): Int = {
    def min(a:Int, b:Int, c:Int) = Math.min( Math.min( a, b ), c)
    def sd(s1: List[Char], s2: List[Char]): Int = (s1, s2) match {
      case (_, Nil) =&#62; s1.length
      case (Nil, _) =&#62; s2.length
      case (c1::t1, c2::t2)  =&#62; min( sd(t1,s2) + 1, sd(s1,t2) + 1,
                                     sd(t1,t2) + (if (c1==c2) 0 else 1) )
    }
    sd( s1.toList, s2.toList )
  }
</pre>
<p>Now, THAT is a nice looking recursive function.  That&#8217;s more like it.  See the pattern match block?  If we try to convert from any string to the empty string or from the empty to a non-empty string then we just use the string length.  You see?  That takes care of the positions along the top and left of the grid.  All the others are determined in the last case.  That last case just applies our three rules.  That is so short and simple.  It&#8217;s a thing of beauty.</p>
<p>The only problem?  It doesn&#8217;t work.</p>
<p>It&#8217;s technically correct.  It will return correct answers &#8230; eventually.  Or, rather, I think it will.  I can&#8217;t be sure because it&#8217;s too slow to complete my unit tests! For anything but very short inputs (4 or 5 characters), the function takes a long time to return.  Why?  Let&#8217;s look at how many recursive calls are made for some inputs.</p>
<p>If we pass use strings &#8220;a&#8221; and &#8220;b&#8221; we pass by the &#8220;(_, Nil)&#8221; and &#8220;(Nil, _)&#8221; cases in the first call to function sd, because both our strings (Lists, actually) are non-empty.  This results in three more calls to sd.  Each of these three calls includes an empty List of characters, so there is no more recursion.  That&#8217;s a total of four calls to sd for strings &#8220;a&#8221; and &#8220;b&#8221;.</p>
<p>What about &#8220;ab&#8221; and &#8220;xy&#8221;?  Think about it for a moment?  Step through the function in your head.  How many calls to sd will there be for &#8220;ab&#8221; and &#8220;xy&#8221;?</p>
<p>Have you done it?  I count 19.  What about &#8220;abc&#8221; and &#8220;xyz&#8221;?  I&#8217;ll save you the trouble.  It&#8217;s 94.  For length 4 strings it&#8217;s 481.  For length 5 it&#8217;s 2524.  Length 6 is 13,483.  Then 73 thousand, then 400 thousand, then 2 million and so forth.  Why so many calls?  Each position in the grid is computed using all the positions to the left and all the positions above the current position.  So a position in the top left will be computed and recomputed many times.</p>
<p>There is a way to get around this, of course.  You probably already have some ideas.  We&#8217;re going to do something called memoization.  When you memoize a function, you make it remember results that it computed previously without having to actually recompute them.  I&#8217;ll do that by caching results in a map.  The map&#8217;s key is a Pair of List[Char]s, the inputs to my inner function sd, and its data is an Int, the return type of sd.  I will modify sd to first check the map to see if the result for the current parameters has already been cached.  If so, we simply return it.  If not, we compute the value, cache it, and return it.</p>
<pre class="brush: python;">
  def stringDistance(s1: String, s2: String): Int = {
    val memo = scala.collection.mutable.Map[(List[Char],List[Char]),Int]()
    def min(a:Int, b:Int, c:Int) = Math.min( Math.min( a, b ), c)
    def sd(s1: List[Char], s2: List[Char]): Int = {
      if (memo.contains((s1,s2)) == false)
        memo((s1,s2)) = (s1, s2) match {
          case (_, Nil) =&#62; s1.length
          case (Nil, _) =&#62; s2.length
          case (c1::t1, c2::t2)  =&#62; min( sd(t1,s2) + 1, sd(s1,t2) + 1,
                                         sd(t1,t2) + (if (c1==c2) 0 else 1) )
        }
      memo((s1,s2))
    }

    sd( s1.toList, s2.toList )
  }
}
</pre>
<p>There.  That uglies up my function somewhat, but at least it&#8217;s usable now.  And it passes my unit tests, so I&#8217;m reasonably assured that it&#8217;s right.</p>
<p>Memoization only works if you expect the same result for each identical function call.  If your function takes input from stdin, for example, you can&#8217;t memoize that.  Or if it has a random component.  Or if, for any other reason, its return value is not always the same for the same inputs.  You can memoize functions in different ways.  There&#8217;s a post on <a href="http://michid.wordpress.com/2009/02/23/function_mem/">Michid&#8217;s Weblog</a> about a more general solution, a memoizing class which wraps existing functions to give you a memoized version.  </p>
<h2>PHEW!</h2>
<p>Ok, I&#8217;ve tried to keep my rambling to a minimum in this post but it&#8217;s still a doozy.  The things I wanted to get across are:</p>
<ul>
<li>The usefulness of Levenshtein distance in solving a variety of problems.
<li>How to understand the Levenshtein distance algorithm and why it works.
<li>How to use unit tests to improve your code while maintaining some assurance that the new code still has the correct behavior.
<li>Some of the different ways of implementing Levenshtein.
</ul>
<p>In the end, I think I like the second implementation (the one that switches out the two rows) and the last implementation the best.  The second one seems to have good performance.  I did some informal performance tests and it has a good mix of performance and simplicity.  The last one, the memoized recursive one, appeals to me because it is in a more functional style and still has respectable performance.</p>
<p>
<p style="text-align:right;font-family:Times;">Don&#8217;t forget to <a href="http://oldfashionedsoftware.com/feed/rss"><img src="http://oldfashionedsoftware.com/files/2008/08/rssbutton.png"> subscribe to my RSS feed</a>, or <a href="http://twitter.com/mmofsoftware"><img src="http://oldfashionedsoftware.com/files/2009/08/twitter.png"> follow this blog on Twitter</a>.<br />Copyright © 2009 Matthew Jason Malone</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Powerauras Setup Strings!]]></title>
<link>http://outdps.com/2009/11/18/powerauras-setup-strings/</link>
<pubDate>Wed, 18 Nov 2009 21:12:29 +0000</pubDate>
<dc:creator>euripidesoutdps</dc:creator>
<guid>http://outdps.com/2009/11/18/powerauras-setup-strings/</guid>
<description><![CDATA[Garwulf at the Huntsman&#8217;s Lodge did a way better write up on a hunter powerauras setup than I ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Garwulf at the <a href="http://huntsmanslodge.com/" target="_blank">Huntsman&#8217;s Lodge</a> did a <a href="http://huntsmanslodge.com/4353/hunter-power-auras.htm" target="_blank">way better write up</a> on a hunter <a href="http://wow.curse.com/downloads/wow-addons/details/powerauras-classic.aspx" target="_blank">powerauras</a> setup than I ever could. In fact, I intend to switch over to his settings when I get home tonight, they&#8217;re so much prettier than mine.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[הקולנוע שלא מגיע לקולנוע בארץ]]></title>
<link>http://galilina.wordpress.com/2009/11/17/%d7%94%d7%a7%d7%95%d7%9c%d7%a0%d7%95%d7%a2-%d7%a9%d7%9c%d7%90-%d7%9e%d7%92%d7%99%d7%a2-%d7%9c%d7%a7%d7%95%d7%9c%d7%a0%d7%95%d7%a2-%d7%91%d7%90%d7%a8%d7%a5/</link>
<pubDate>Tue, 17 Nov 2009 13:15:57 +0000</pubDate>
<dc:creator>galilina</dc:creator>
<guid>http://galilina.wordpress.com/2009/11/17/%d7%94%d7%a7%d7%95%d7%9c%d7%a0%d7%95%d7%a2-%d7%a9%d7%9c%d7%90-%d7%9e%d7%92%d7%99%d7%a2-%d7%9c%d7%a7%d7%95%d7%9c%d7%a0%d7%95%d7%a2-%d7%91%d7%90%d7%a8%d7%a5/</guid>
<description><![CDATA[קצת נעלמתי, אני מרגישה שחולפת אותי סופת הוריקן. ישנם דברים כה רבים שאני רוצה לכתוב עליהם, אך הם נמצא]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>קצת נעלמתי, אני מרגישה שחולפת אותי סופת הוריקן. ישנם דברים כה רבים שאני רוצה לכתוב עליהם, אך הם נמצאים בחלל הסערה ואני לא מצליחה לתפוס אותם.  התוצאה היתה דממה ורבאלית. וכעת למרות הסערה המוחית אנסה לתפוס את המעופפים ולהוריד אותם אל עולם המילים והאימג&#8217;ים.</p>
<p>מספר שני ם אחורה  הזדמן לי לדלות מקופסה עמוסת קלטות (כן, כן קלטות) סרט שנשלח לחברה שהיתה חברה בועדת שיפוט זו או אחרת. הסרט נחקק בזכרוני ומאז אני מחפשת ומחפשת אותו כדי להראות אותו לסטודנטים שאני מלמדת, לחברים שקולנוע מעיניינם ובכלל להכיר לעולם סביבי סרט עם איכויות אחרות. הסרט הינו סרט אנימציה ויחודו בעיני בכך שכל הדמויות המשוחקות בו הן מריונטות. כמו כן הסרט הינו הרפתקאה ודרמה, אך מה שנחקק בזכרוני מהסרט הוא התרגום הנפלא לאופן בו דמויות המריונטה נולדות ומתות. הסיפור מסופר מתוך דמות בובות המריונטה, שהיא בובה על חוט. למשל בסרט הזה אין גגות , כיוון שאחרת איך ינועו ה&#8221;שחקנים&#8221;. כאשר דמות מתה, המוות מתבטא בחיתוך החוט המתחבר לקודקודה של הדמות. (אני לא אמשיך על מנת לא להרוס את הצפיה בסרט).</p>
<p>לדעתי זהו סרט עם דוגמא מעניינת לבחון בניית דמות , זהותה, חייה ומותה מתוך ה&#8221;שחקנים&#8221;  והאופיים המיוחד של השחקים.</p>
<p>שמו של הסרט STRINGS</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/oHa1BqcNYQc&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/oHa1BqcNYQc&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>&#160;</p>
<p>סרט נוסף שחזר לתודעתי בעקבות צפיה בסרט, 500 הימים של סאמר. הינו הסרט Brick</p>
<p>ישבתי בקולנוע וניסיתי להזכר מנין זכורות לי הפנים החיוורות של השחקן הראשי והמבט הילדותי והעמידה הגמלונית. בסוף נפל האסימון והזכרון עלה באוב.</p>
<p>אחד הדברים שנחרטו בזכרוני בהקשר של הסרט היו זויות הצילום החדות והלא מקובלות והריקוד המרתק בין ויזואל לסאונד. הסרט נעשה בסגנון הפילם נואר, אשר אחד ממאפייניו הוא הסגנון הויזואלי הדרמטי הבא להדגיש את המתח בעלילה.</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/3cVzHeJ0Z3I&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/3cVzHeJ0Z3I&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>הסרט האחרון שאני רוצה לכתוב עליו דווקא כן הגיע לקולנוע בארץ. את הסרט העלילתי ראיתי בסינמטק תל אביב לפני מספר שנים, אני זוכרת שיצאתי מהסרט נפעמת, בגלל האבחנות הקטנות והמדויקות שלו לרגעים הקטנים של החיים, איך מעבירים זמן מת?תרגום של פרסונות שונות באופיין לשאלה מה עושים כאשר צריך להרוג זמן? מעל כל האבחנות המרתקות הללו שנובעות מהתבוננות מעמיקה על אנשים ודפוסי התנהגות שלהם. אנחנו מכירים את גיבור העלילה ואת דרכו שלו להרוג את הזמן, הצילומים היפייפים של הקפאת הזמן והאטתו מרגשים כל פעם מחדש כאשר הם קורים במהלך הסרט.</p>
<p>אני יצאתי מההקרנה מחויכת ובדרכי החוצה מהסינמטק קלטתי באוזני שאינן חדות בדר&#8221;כ מבקר אחד המציין שזוהי ורסיה של סרט סטודנטים קצר שעבר עיבוד לסרט עלילתי, ולדעתו הסרט הקצר הרבה יותר חזק ומדויק ברושם שהוא משאיר. עם ההערה הזו מיהרתי לביתי לחפש אחר אותה גרסה ראשונה של הסרט. לאחר שצפיתי בגרסה הקצרה, הבנתי למה התכוון אותו הבחור, בעבר נטיתי להסכים עם אבחנותיו ויחד עם זאת הזמן שעבר מאז שצפיתי בשניהם ועד עתה גרם לי לחשוב על כך, שהסרט העלילתי הופך את האבחנות לגבי זמן נגישות יותר לקהל הצופים הרחב ובצורה כזו יותר אנשים יוכלו להנות מהסרט הקטן והרענן הזה. והרי מטרת היוצרים לקרב את יצירתם תוך התפשרות מועטה ככל האפשר אל העולם שם בחוץ, זה שלא יושב בין כרי עננים ורודים וחולם את חלומותיו.</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/xTG7u1R6cUQ&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/xTG7u1R6cUQ&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>cashback</p>
<p><a href="http://www.youtube.com/watch?v=xTG7u1R6cUQ&#38;feature=related" target="_blank">http://www.youtube.com/watch?v=xTG7u1R6cUQ&#38;feature=related</a></p>
<p>brick</p>
<p><a href="http://www.youtube.com/watch?v=3cVzHeJ0Z3I" target="_blank">http://www.youtube.com/watch?v=3cVzHeJ0Z3I</a></p>
<p>ומשחק טריוויה ממש ממש שווה של הבי.בי.סי</p>
<p><a href="http://www.bbc.co.uk/schools/ks2bitesize/games/questionaut/pop.shtml" target="_blank">http://www.bbc.co.uk/schools/ks2bitesize/games/questionaut/pop.shtml</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Oh How I Miss You...]]></title>
<link>http://ladyleader.wordpress.com/2009/11/14/oh-how-i-miss-you/</link>
<pubDate>Sun, 15 Nov 2009 03:28:12 +0000</pubDate>
<dc:creator>ladyleader</dc:creator>
<guid>http://ladyleader.wordpress.com/2009/11/14/oh-how-i-miss-you/</guid>
<description><![CDATA[When I was in the 3rd grade I took violin lessons.  I absolutely loved it!!! I had recitals made my ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignleft size-full wp-image-332" title="Violin" src="http://ladyleader.wordpress.com/files/2009/11/img_0842.jpg" alt="Violin" width="320" height="480" /></p>
<p>When I was in the 3rd grade I took violin lessons.  I absolutely loved it!!! I had recitals made my mom nervous as heck before them because I was a nervous wreck.  Then calmly stand before the audience and play my piece as if I was never scared.  HAHA those were good times!!!</p>
<p>2 years later my instructor got ill and could not return and being in a very small town there was not anymore options for an instructor so my time as a violinist ceased.</p>
<p>Today I was hanging out with a friend and she remarked how no one plays the violin anymore and how she liked the sound of the instrument.  It reminded me of my short lived time playing the violin.</p>
<p>This instrument along with all strings are my fav.  I recently started playing at the guitar thanks to some great friends buying me a great Christmas present and the piano I received as a result of the passing of my dad.  These instruments are soothing to the soul.</p>
<p>I just miss my violin but I am not sure I can remember how to play it but I would try.  It would add to my collection of instruments I play at.  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Oh how i miss you&#8230; Violin!!!</p>
<p>&#160;</p>
<p><span style='text-align:left;display:block;'><p><object type='application/x-shockwave-flash' data='http://wordpress.com/wp-content/plugins/audio-player/player.swf' width='290' height='24' id='audioplayer1'><param name='movie' value='http://wordpress.com/wp-content/plugins/audio-player/player.swf' /><param name='FlashVars' value='&amp;bg=0xf8f8f8&amp;leftbg=0xeeeeee&amp;lefticon=0x666666&amp;rightbg=0xcccccc&amp;rightbghover=0x999999&amp;righticon=0x666666&amp;righticonhover=0xffffff&amp;text=0x666666&amp;slider=0x666666&amp;track=0xFFFFFF&amp;border=0x666666&amp;loader=0x9FFFB8&amp;soundFile=http%3A%2F%2Fladyleader.wordpress.com%2Ffiles%2F2009%2F11%2Fsmooth-jazz-david-sanborn-stormy-jazz-instrumental.mp3' /><param name='quality' value='high' /><param name='menu' value='false' /><param name='bgcolor' value='#FFFFFF' /></object></p></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Samuel Barber: Agnus Dei]]></title>
<link>http://asatomasatgamayo.wordpress.com/2009/11/14/samuel-barber-agnus-dei/</link>
<pubDate>Sun, 15 Nov 2009 00:20:09 +0000</pubDate>
<dc:creator>claraq</dc:creator>
<guid>http://asatomasatgamayo.wordpress.com/2009/11/14/samuel-barber-agnus-dei/</guid>
<description><![CDATA[Versión coral &nbsp; &nbsp;]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/KkObnNQCMtM&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/KkObnNQCMtM&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>Versión coral</p>
<p>&#160;</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/lV3SHBFyDZM&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/lV3SHBFyDZM&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Safe Costumes, Trick-or-Treating and Halloween Decorations]]></title>
<link>http://veemd.wordpress.com/2009/11/14/safe-costumes-trick-or-treating-and-halloween-decorations/</link>
<pubDate>Sat, 14 Nov 2009 19:43:44 +0000</pubDate>
<dc:creator>Dr.Vee</dc:creator>
<guid>http://veemd.wordpress.com/2009/11/14/safe-costumes-trick-or-treating-and-halloween-decorations/</guid>
<description><![CDATA[&nbsp; Here is the link for my talk on Halloween safety for kids  (decorations, costumes) and Safe T]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="aligncenter size-full wp-image-614" title="Jack O Lantern" src="http://veemd.wordpress.com/files/2009/11/jack-o-lantern.jpg" alt="Jack O Lantern" width="500" height="400" /></p>
<p>&#160;</p>
<p>Here is the link for my talk on <a href="http://www.healthradio.net/show/Health-Radio-Shows/Kid%27s-Health-%252D-The-Talk-Show-for-Parents/Halloween-Costumes-and-Decorations-3A-Safety-Precautions-40976/details">Halloween safety for kids </a> (decorations, costumes) and <a href="http://www.healthradio.net/show/Health-Radio-Shows/Kid%27s-Health-%252D-The-Talk-Show-for-Parents/Keeping-the-Tricks-and-Treats-Safe-this-Halloween-40968/details">Safe Trick-or-Treating </a>on Healthradio.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Rihanna - Rated R. (album review)]]></title>
<link>http://iamchase.wordpress.com/2009/11/14/rihanna-rated-r-album-review/</link>
<pubDate>Sat, 14 Nov 2009 14:13:44 +0000</pubDate>
<dc:creator>onyxparadise</dc:creator>
<guid>http://iamchase.wordpress.com/2009/11/14/rihanna-rated-r-album-review/</guid>
<description><![CDATA[Here is the album review I promised on my twitter yesterday!  Before I start, once again I want to t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Here is the album review I promised on my <a href="http://twitter.com/onyxparadise">twitter</a> yesterday!  Before I start, once again I want to thank you all for supporting my blog, both my music reviews and my personal entries.  I really appreciate all the views and I hope that you&#8217;ll keep it locked here because I ain&#8217;t stoppin&#8217;! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thankyou.</p>
<p><img class="aligncenter" title="Rihanna - Rated R album cover" src="http://static.thehollywoodgossip.com/images/gallery/rihanna-rated-r-album-cover_410x406.jpg" alt="" width="410" height="406" /></p>
<p>You already know what I think of <a href="http://iamchase.wordpress.com/2009/10/20/russian-roulette-rihanna-single-review/">Russian Roulette</a>, and <a href="http://iamchase.wordpress.com/2009/11/04/rihanna-wait-your-turn-te-amo-hard-reviews-from-rated-r/">the other 3 songs</a> we&#8217;ve heard already from Rated R.  Generally, they portray a darker, edgier side to Rihanna, both in the production (deeper, more menacing beats) and lyrical content that includes a bit of cursing, a lot of swagger and references to pain, trials and tribulations.  &#8221;Russian Roulette&#8221;, &#8220;Wait Your Turn&#8221; and &#8220;Hard&#8221; are more or less indicative of the album as a whole.  In contrast to her previous smash <em>Good Girl Gone Bad</em>, it&#8217;s a lot less uptempo.  The songs are mainly midtempos and ballads, which may alienate a lot of fans who want her faster, danceable material (though &#8220;Hard&#8221; and &#8220;Rude Boy&#8221; cater to these needs, and do so well with swagger lyrics &#8211; the latter seeing Rihanna come on to a &#8216;rude boy&#8217; as if <em>she</em> were the guy who is gonna &#8220;put it on you&#8221;).  However, the slower material allows for two major things: one, to prove that Rihanna <em>can</em> actually sing.  Okay, she&#8217;s no Beyoncé, but she holds her own a lot better than many people might expect.  &#8221;Russian Roulette&#8221; and closing standout &#8220;The Last Song&#8221; don&#8217;t employ lots of vocal runs, but they emphasise strong, clear vocals that prove Rihanna&#8217;s got a voice as well as a body &#8211; btw. the artwork for this era is <strong>immense!</strong> &#8211; and also go well with the more emotionally searching and vulnerable material.  Two, it allows for Rihanna to delve into her pain, and although it&#8217;s never made explicit that she&#8217;s referencing her love, abuse and love lost with Chris Brown, songs such as &#8220;Stupid In Love&#8221; and the epic &#8220;Cold Case Love&#8221; immediately bring that whole affair to mind.</p>
<p>Not every song is concerned with love lost.  &#8221;Te Amo&#8221; is about a girl who&#8217;s infatuated with Rihanna, and its undulating beats have been beefed up slightly on the album version to make it more hypnotic and possibly (along with &#8220;Rude Boy&#8221;) the song that would have slotted in nicely on <em>Good Girl Gone Bad</em>.  &#8221;Rockstar 101&#8243; is backed up by Slash&#8217;s guitar work and like &#8220;Hard&#8221; and &#8220;Wait Your Turn&#8221;, it demonstrates Rihanna&#8217;s confidence in herself &#8211; something she perhaps wants to emphasise.  She is fierce!  However, compared to some of the other tracks, &#8220;Rockstar 101&#8243; falls somewhat flat, as it doesn&#8217;t have as much depth as the emotionally-charged midtempos, nor does it ring as true as the harder-knocking songs.  It does demonstrate that Rihanna is <strong>not</strong> an urban artist &#8211; she&#8217;s a pop singer who encompasses a range of music. On this album, she combines elements of rock, pop, R&#38;B and melds them together to create a dark album that works for the most part.  And credit goes to her for trying to improve on each album &#8211; like <em>Good Girl Gone Bad</em>, the amount of filler on the disc is fairly minimal (in contrast to her first two records) and she&#8217;s tried to do something different that has evolved as she has as a person.  So I must applaud that.</p>
<p>A couple of the ballads such as &#8220;Stupid In Love&#8221; and &#8220;Photographs&#8221; (which benefits from will.i.am&#8217;s synthed beats that kick in midway) are perfectly solid, but pale in comparison to the best tracks.  These are, in a nutshell, first single &#8220;Russian Roulette&#8221;, &#8220;Fire Bomb&#8221;, &#8220;G4L&#8221;, &#8220;Cold Case Love&#8221; and &#8220;The Last Song&#8221;.  These all work because Rihanna is putting herself out there vocally and emotionally.  The producers do a fantastic job (praise must go in particular to Justin Timberlake and The Ys&#8217; work on &#8220;Cold Case Love&#8221;, which shows a gradual building of beatboxing, standard beats, guitars and strings to an epic climax that fades out by itself and underline Rihanna&#8217;s pain at a love misfired &#8211; &#8220;Release me now &#8217;cause I did my time&#8221;) more or less throughout, but Rihanna herself carries the songs.  &#8221;Fire Bomb&#8221; has been compared to something by Kelly Clarkson, but in my opinion it knocks much harder and is a compelling contrast to expectations &#8211; most people would expect a club banger from the title, when in fact it&#8217;s a slow pop/rock ballad which essentially says &#8220;if I&#8217;m going down in flames, you&#8217;re coming with me&#8221;.  &#8221;G4L&#8221; is one of the darkest songs which shows Rihanna pledging to be &#8220;down 4 life&#8221;, ride or die until the end.  The off-key tweaks at the beginning signal something mysterious, and the lyric &#8220;I lick the gun when I&#8217;m done &#8217;cause I know that revenge is sweet&#8221; is one of the best opening salvos I can remember.  The track brings to mind the tiny gun tattoos on the sides of Rihanna&#8217;s breasts, demonstrating that even if she may be a sweet person on the surface, she&#8217;s also a strong and determined one &#8211; her attitude is reflected in her music as much as her body art.</p>
<p>&#8220;The Last Song&#8221; was the track that stood out to me most from listening to the 30-second snippets, and it doesn&#8217;t disappoint &#8211; it&#8217;s a perfect closer to the album, not only in name but in texture also.  It employs a soaring guitar and heartwrenching lyrics, chronicling the realisation of a breakup.  &#8221;The sad song ends up being the last song you&#8217;ll ever hear.&#8221;  Rihanna&#8217;s spare vocals almost seem to cry the lyrics throughout the track, and the buildup throughout the song until near the end where all the instruments fade out is done perfectly.  Rihanna said that she wanted Lil&#8217; Wayne and Kings Of Leon to like her album, demonstrating her desired blend of urban and rock. The album is definitely a mélange of styles, but apart from &#8220;Hard&#8221;, I don&#8217;t see enough hip-hop for Weezy to connect with, and the rock elements are nowhere near as indie-pop as Kings Of Leon.  However, the soaring guitars provide something edgier and deeper within the context of a pop album, and the hard-hitting beats and synths knock plenty &#8211; the combination of which provide something quite extraordinary and special within itself.  Rihanna should be proud of this record.</p>
<p><em>Rated R</em> has a focused aggression to it that rings truer than it did on <em>Good Girl Gone Bad.</em> Despite the lack of uptempo smashes, it&#8217;s a fantastic record that hopefully will have as much repeat-play value as her previous record.  Whether it&#8217;s because of her personal struggles, maturity as a young woman or desire to experiment musically (probably a combination of all three), <em>Rated R</em> shows growth.  I pray that her label doesn&#8217;t re-release the album, since it&#8217;s perfect as it is and comes across as something sincere, rather than designed to make money as a light pop confection.  Why I&#8217;m impressed with <em>Rated R</em>, beyond the simple fact that most of the songs are solid or better, is because it&#8217;s cohesive.  All the songs work together to make the album more than the sum of its parts.  It has a big emotional impact, and it sets a musical mood (dark, edgy and yet heartfelt) that doesn&#8217;t let up throughout &#8211; in her own words, from &#8220;Hard&#8221;, &#8220;that Rihanna rain/reign&#8221;.  I didn&#8217;t know if she had it in her to best <em>Good Girl Gone Bad</em>, but even if it doesn&#8217;t have as many number 1 smashes and addictive beats, <em>Rated R</em> is a musical step forward that I personally value that little bit more.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Changing Strings on Electric Guitars]]></title>
<link>http://audiofanzine.wordpress.com/2009/11/13/changing-strings-on-electric-guitars/</link>
<pubDate>Fri, 13 Nov 2009 06:52:08 +0000</pubDate>
<dc:creator>audiofanzine</dc:creator>
<guid>http://audiofanzine.wordpress.com/2009/11/13/changing-strings-on-electric-guitars/</guid>
<description><![CDATA[Short Guide to Changing Strings on an Electric Guitar Everybody knows how to change strings on an el]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h2><strong>Short Guide to Changing Strings on an Electric Guitar</strong></h2>
<p>Everybody knows how to change strings on an electric guitar.   Elementary, no?  Still, it&#8217;s an entirely different task when it comes to changing strings properly and on different types of bridges.</p>
<p>Most guitar players tend to overlook it, but one of the most important contributors to having a good guitar sound has to do with how the guitar is set up and adjusted. A good set up will result in maximum playing comfort and tuning precision, i.e. it will allow you to bring the best out of the instrument. When it comes to the set up of a guitar, we usually think about the neck bow, the action (strings height) and the harmonics (tuning), while neglecting the actual stringing. I&#8217;ve met too many guitarists who complained about their instrument&#8217;s tuning and failed to see the mess of strings their tuners were–making it a feat for the guitar to stay in tune.</p>
<p>The goal of this article is to explain to you (again!) the most important thing a guitarist ought to know: how to change the strings of his/her instrument.</p>
<h3><strong>Basic Principles</strong></h3>
<p>Basically, changing a guitar string means fastening one end to the tremolo system and the other end to the tuner (a.k.a. machine head or tuning key) so you can wind it until you get the desired note. In order to have maximum tuning stability, the basic principle is to limit chafing at both points as much as possible, i.e. at the machine heads on the headstock and at the bridge (be it with a tailpiece or a tremolo system). Once the guitar has been tuned, the main goal is for it to stay in tune while you play, in other words, that the strings return to their original position after using the tremolo arm.</p>
<h3><strong>Required Materials</strong></h3>
<ul>
<li>New strings.</li>
<li>Cutting pliers.</li>
<li>String winder.</li>
<li>Optional: Depending on the tremolo system you might need an Allen wrench.</li>
</ul>
<p>You&#8217;ll need the cutting pliers to snip off the the excess string protruding from the tuning peg once the strings have been installed. Apart from the fact that it looks awful, leaving long string ends bulging from the headstock can be dangerous to yourself and the other musicians you play with. A steel string could easily pierce through the flesh or under a fingernail or even poke someone&#8217;s eye out&#8230;</p>
<p>The string winder is an optional but strongly recommended tool. It allows you to wind the strings steadily around the tuning pegs and makes string setup much easier. You can get one for a couple of bucks in any music store.</p>
<h3><strong>Before Reaching for your Beloved Guitar</strong></h3>
<p>We recommend that you change strings one by one, unless you need to remove all strings at once to adjust the neck, service the fingerboard, etc. This allows you to avoid nasty situations, like the one depicted here.</p>
<div><a href="http://fr.audiofanzine.com/outils/a.provider,m.7460,mod.media,th.normal,s.pictures.jpg"><img src="http://fr.audiofanzine.com/outils/a.provider,m.7460,mod.media,th.thumbs2,s.pictures.jpg" alt="" /></a>In this specific example, a false move could result in the need to adjust the tune-o-matic bridge all over again.</div>
<p>Moreover, for guitars with floating tremolo systems (Floyd Rose and similar), this is the only one way you&#8217;ll be able to spare yourself several hours dedicated to tuning the guitar after having changed the strings.</p>
<p>Try to use strings with the same gauge (= thickness) as the string set you are replacing and, where possible, use the same brand. That&#8217;s the best way to go if your guitar is properly set up. Obviously, if you plan to change the string gauge, it&#8217;s a good idea to set up the guitar accordingly.</p>
<p>Ready? Let&#8217;s go!</p>
<h3><strong>Step by Step (in general)</strong></h3>
<p>1. Bridge: on most tremolo and tailpiece systems, you simply have to feed the string through the tailpiece or through the body of the instrument.</p>
<div><a href="http://fr.audiofanzine.com/outils/a.provider,m.7458,mod.media,th.normal,s.pictures.jpg"><img src="http://fr.audiofanzine.com/outils/a.provider,m.7458,mod.media,th.thumbs2,s.pictures.jpg" alt="" /></a><em><br />
Feed the string through the holes&#8230;</em></div>
<p><a href="http://fr.audiofanzine.com/outils/a.provider,m.7476,mod.media,th.normal,s.pictures.jpg"><img src="http://fr.audiofanzine.com/outils/a.provider,m.7476,mod.media,th.thumbs2,s.pictures.jpg" alt="" /></a><em><br />
</em></p>
<p><em>&#8230; the string comes out through the saddles.</em></p>
<div>
</div>
<div><a href="http://fr.audiofanzine.com/outils/a.provider,m.7461,mod.media,th.normal,s.pictures.jpg"><img src="http://fr.audiofanzine.com/outils/a.provider,m.7461,mod.media,th.thumbs2,s.pictures.jpg" alt="" /></a><br />
2. Pull the new string&#8230;</div>
<p>3. &#8230; and feed it through the tuning peg hole.</p>
<div>
<p><a href="http://fr.audiofanzine.com/outils/a.provider,m.7465,mod.media,th.normal,s.pictures.jpg"><img src="http://fr.audiofanzine.com/outils/a.provider,m.7465,mod.media,th.thumbs2,s.pictures.jpg" alt="" /></a><br />
4. Now we have to wind the string around the tuners. First, pull the string to its full length until it is fairly tight. Leave some extra string length (about 1.5 or 2 times the distance between two tuning pegs of a six-in-line tuner configuration, like on Strats or Telecasters; or the same distance between two tuning pegs of a three-on-a-side tuner configuration, like on Les Paul or SG models) and crimp the string with your fingers so the end of the string points out at a right-angle.</div>
<p>5. Use this kink to fasten the string around the tuning peg and turn the string winder with one hand while you tighten the string with the other, so that the string starts to wind around the tuning peg. Be sure to turn the tuner in the right direction: guitar headstocks are built so that the string goes straight from the nut to the tuner axis; on three-on-a-side tuner configurations, the headstock is built so that the strings are wound on the inner side.</p>
<p>&#160;</p>
<div><a href="http://fr.audiofanzine.com/outils/a.provider,m.7471,mod.media,th.normal,s.pictures.jpg"><img src="http://fr.audiofanzine.com/outils/a.provider,m.7471,mod.media,th.thumbs2,s.pictures.jpg" alt="" /></a><br />
6. Continue winding the string around the tuning peg so that the first turn is made above the string end coming out of the peg hole.</div>
<p>&#160;</p>
<div><a href="http://fr.audiofanzine.com/outils/a.provider,m.7466,mod.media,th.normal,s.pictures.jpg"><img src="http://fr.audiofanzine.com/outils/a.provider,m.7466,mod.media,th.thumbs2,s.pictures.jpg" alt="" /></a><br />
7. Continue tightening the string and turning the string tighter so that the string winds underneath the string end coming out of the peg hole.</div>
<p>8. Continue turning the string winder until the string is tight enough. Turn the tuner with your hand to tune the guitar.</p>
<div><a href="http://fr.audiofanzine.com/outils/a.provider,m.7463,mod.media,th.normal,s.pictures.jpg"><img src="http://fr.audiofanzine.com/outils/a.provider,m.7463,mod.media,th.thumbs2,s.pictures.jpg" alt="" /></a><br />
9. Check the result: you should see the string end coming out of the tuning peg with the first coil above it and all following coils properly and neatly wrapped below it around the peg.</div>
<p>There must be at least three full coils around the tuning peg. It is very important for the winding to be as neat as possible, that way you avoid the string from moving around the tuner axis, the string finds its position naturally and the guitar stays better in tune.</p>
<p>10. Last step: in order for the coils to find their right position, gently pull on the string. The tuning ought to change a bit (the string will sound lower). Repeat (tune the string and pull on it) until it has no effect on the tuning.</p>
<p>11. Finally, cut the excess string protruding from the tuner.</p>
<p>12. Now, repeat all steps for each string!</p>
<p>Now let&#8217;s take a look at how this is done on other more complicated tremolo systems&#8230;</p>
<p>&#8230;</p>
<h3><strong>Conclusion&#8230; and some tips!</strong></h3>
<p>As you can see, restringing a guitar is not very difficult if you know how to do it. So take your time to do it calmly at home instead of doing it in a rush right before your gig or recording session is about to start.</p>
<p>Last but not least, some extra tips:</p>
<p>I personally fell in love with locking tuners because they are very easy to use, allow me to change strings in no time and play right away without the fear that my guitar won&#8217;t stay in tune.</p>
<p>The tuning stability can be improved by lubricating the nut with graphite (rub a very fat pencil where the strings make contact with it) or specialized products (Nut Sauce, etc.) that allow the strings to slide freely through the nut. If you feel the tuners don&#8217;t &#8220;respond properly&#8221; try this solution first instead of running to your nearest guitar tech.</p>
<p>That&#8217;s it for today! You have no excuses now, so I don&#8217;t want to see spaghetti-like-strings anymore! Don&#8217;t hesitate to send me your comments and questions.</p>
<p>To read the full detailed article see:  <a href="http://en.audiofanzine.com/electric-guitar/articles/Changing-Strings-on-Electric-Guitars.html">Changing Strings on Electric Guitars</a></p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Surprised!]]></title>
<link>http://sariwawek.wordpress.com/2009/11/13/surprised/</link>
<pubDate>Fri, 13 Nov 2009 04:59:19 +0000</pubDate>
<dc:creator>balazubaz69</dc:creator>
<guid>http://sariwawek.wordpress.com/2009/11/13/surprised/</guid>
<description><![CDATA[I Am Surprised! Yes people.. Our Choir Conductor at the Deer Park United Church, Loise gave me an ea]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I Am Surprised! </p>
<p>Yes people.. Our Choir Conductor at the Deer Park United Church, Loise gave me an early birthday/Christmas present.. </p>
<p>Guess what? It&#8217;s a 1989 Saturn guitar.. </p>
<p><a href="http://sariwawek.files.wordpress.com/2009/11/p_1600_1200_685da1f2-dc47-4dba-8f0a-9750e26a883c.jpeg"><img src="http://sariwawek.files.wordpress.com/2009/11/p_1600_1200_685da1f2-dc47-4dba-8f0a-9750e26a883c.jpeg?w=225&#038;h=300" alt="" width="225" height="300" class="alignnone size-full wp-image-364" /></a></p>
<p>It was well taken cared off, well polished, and what else could best describe it rather than saying it&#8217;s a &#8220;vintage collector&#8217;s item&#8221;.. Oh well, not that vintage though coz 1989 is just like 21 years ago, but considering it survived that long and still looked very much like a brand new one makes it valueable..</p>
<p><a href="http://sariwawek.files.wordpress.com/2009/11/p_1600_1200_02c1fb1b-0068-4539-8583-4af0bf72c6d3.jpeg"><img src="http://sariwawek.files.wordpress.com/2009/11/p_1600_1200_02c1fb1b-0068-4539-8583-4af0bf72c6d3.jpeg?w=225&#038;h=300" alt="" width="225" height="300" class="alignnone size-full wp-image-364" /></a></p>
<p>Just the thought that the guitar was made when (or even before) I turned 8 years old and was handed down to me now, barely a month before I turn 28, is like having an old rockstar giving me his precious possession.. Astig!! Astig!!</p>
<p>So, to Loise, thanks a lot and don&#8217;t worry, I&#8217;ll keep your gift safe and well taken cared off, the way you kept and took care of it in the last 21 years..</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ListBox - Scripts]]></title>
<link>http://c0d3rs.wordpress.com/2009/11/12/listbox-scripts/</link>
<pubDate>Thu, 12 Nov 2009 19:23:06 +0000</pubDate>
<dc:creator>c0d3rs</dc:creator>
<guid>http://c0d3rs.wordpress.com/2009/11/12/listbox-scripts/</guid>
<description><![CDATA[Comandos Basicos : { Limpar Lista } Código: ListBox1.DeleteSelected; //Deleta algo selecionado ou se]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><em>Comandos Basicos :</em></p>
<p><strong>{ Limpar Lista }</strong></p>
<p>Código:<br />
<code>ListBox1.DeleteSelected; //Deleta algo selecionado ou seja marcado na Lista</code></p>
<p><strong>ou</strong></p>
<p><code>ListBox1.Items.Delete(ListBox1.ItemIndex); //Deleta algo selecionado ou seja marcado na Lista</code></p>
<p><code>ListBox1.Items.Clear(); //Limpar tudo que contiver na Lista</code></p>
<p><strong>ou</strong></p>
<p><code>ListBox1.Clear; // Limpar tudo que contiver na Lista</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><!--more--></p>
<p><strong>{ Abrir Item }</strong></p>
<p>Código:<br />
<code>if OpenDialog1.Execute then              //Executa o OpenDialog<br />
ListBox1.Items.LoadFromFile(OpenDialog1.FileName); //Abre texto para Lista do destino selecionado</code></p>
<p><strong>ou</strong></p>
<p><code>ListBox1.Items.LoadFromFile('Lista de Texto'); //Caso houver alguma lista na pasta do prjeto com nome Lista de Texto abre o item para a Lista</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Salvar Item }</strong></p>
<p>Código:<br />
<code>if SaveDialog1.Execute then             //Executa o SaveDialog<br />
ListBox1.Items.SaveToFile(SaveDialog1.FileName); //Salva texto da Lista com escolha de destino</code></p>
<p><strong>ou</strong></p>
<p><code>ListBox1.Items.SaveToFile('Lista de Texto'); //Salva item na mesma pasta do projeto sem a necessidade de escolher destino</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Adicionar }</strong></p>
<p>Código:<br />
<code>ListBox1.Items.Add(Edit1.Text); //Adiciona o que estiver no Text do Edit para a Lista</code></p>
<p><code>Edit1.Text := ListBox1.Items.Strings[ListBox1.itemIndex]; //Adiciona no Edit o item slecionado na Lista ou marcado</code></p>
<p><code>Label1.Caption := ListBox1.Items.Strings[ListBox1.itemIndex]; //Adiciona na Label o item slecionado na Lista ou marcado</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Ir para o ultimo item da Lista }</strong></p>
<p>Código:<br />
<code>ListBox1.TopIndex: = -1 + ListBox1.Items.Count;</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Mover items de posição no ListBox }</strong></p>
<p>Antes de mais nada coloque como formulário de nível :</p>
<p>Código:<br />
<code>var<br />
  Form1: TForm1;<br />
  StartingPoint : TPoint;</code></p>
<p>Coloque no OnCreat do Form :</p>
<p>Código:<br />
<code>procedure TForm1.FormCreate(Sender: TObject);<br />
begin<br />
ListBox1.DragMode:= dmAutomatic;<br />
end;</code></p>
<p>Coloque no OnDragDrop do ListBox :</p>
<p>Código:<br />
<code>procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);<br />
var<br />
DropPosition, StartPosition: Integer;<br />
DropPoint: TPoint;<br />
begin<br />
DropPoint.X := X;<br />
DropPoint.Y := Y;<br />
with Source as TListBox do<br />
begin<br />
StartPosition := ItemAtPos(StartingPoint,True) ;<br />
DropPosition := ItemAtPos(DropPoint,True) ;</p>
<p>Items.Move(StartPosition, DropPosition) ;<br />
end ;<br />
end;</code></p>
<p>Coloque no OnDragOver do Listbox :</p>
<p>Código:<br />
<code>procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;<br />
  State: TDragState; var Accept: Boolean);<br />
begin<br />
Accept:= Source = ListBox1;<br />
end;</code></p>
<p>E por fim coloque no OnMouseMove do ListBox :</p>
<p>Código:<br />
<code>procedure TForm1.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X,<br />
  Y: Integer);<br />
begin<br />
StartingPoint.X:= X;<br />
StartingPoint.Y := Y;<br />
end;</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Mostrar Hint de items do ListBox }</strong></p>
<p>Coloque <code>Listbox.ShowHint := true ;</code></p>
<p>Depois em OnMouseMove :</p>
<p>Código:<br />
<code>procedure TForm1.ListBox1MouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer) ;<br />
var lstIndex : Integer ;<br />
begin<br />
  with ListBox1 do<br />
  begin<br />
   lstIndex:=SendMessage(Handle, LB_ITEMFROMPOINT, 0, MakeLParam(x,y)) ;<br />
   if (lstIndex &#62;= 0) and (lstIndex &#60;= Items.Count) then<br />
     Hint := Items[lstIndex]<br />
   else<br />
     Hint := &#039;&#039;<br />
   end;<br />
  end;</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Pesquisa de texto no Listbox pelo Edit }</strong></p>
<p>Coloque no OnChange do Edit :</p>
<p>Código:<br />
<code>procedure TForm1.Edit1Change(Sender: TObject);<br />
const<br />
  indexStart = -1;<br />
var<br />
  search : array[0..128] of Char;<br />
begin<br />
  //make sure Length(Edit1.Text) &#60;= 128<br />
  StrPCopy(search, Edit1.Text) ;<br />
  ListBox1.ItemIndex := ListBox1.Perform(LB_SELECTSTRING, indexStart, LongInt(@search)) ;<br />
end;</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Remover multiplos Items selecionados de um ListBox }</strong></p>
<p>Coloque <code>ListBox1.MultiSelect = true ;</code></p>
<p>Depois coloque num button sei la :</p>
<p>Código:<br />
<code>var<br />
  ii : integer;<br />
begin<br />
  with ListBox1 do<br />
  begin<br />
    for ii := -1 + Items.Count downto 0 do<br />
    if Selected[ii] then Items.Delete(ii) ;<br />
  end;<br />
  end;</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Ordenação da Listbox }</strong></p>
<p>-&#62; Descer um item selecionado :</p>
<p>Código:<br />
<code>var<br />
  NovoIndex : Integer;<br />
begin<br />
  if not (lbx1.ItemIndex = lbx1.Items.Count-1) then<br />
  begin<br />
    NovoIndex := lbx1.ItemIndex + 1;<br />
    lbx1.Items.Move(lbx1.ItemIndex, NovoIndex);<br />
    lbx1.ItemIndex := NovoIndex;<br />
    lbx1.SetFocus;<br />
  end;<br />
end;</code></p>
<p>-&#62; Subir um item selecionado :</p>
<p>Código:<br />
<code>var<br />
  NovoIndex : Integer;<br />
begin<br />
  if not (lbx1.ItemIndex - 1 &#60; 0) then<br />
  begin<br />
    NovoIndex := lbx1.ItemIndex - 1;<br />
    lbx1.Items.Move(lbx1.ItemIndex, NovoIndex);<br />
    lbx1.ItemIndex := NovoIndex;<br />
    lbx1.SetFocus;<br />
  end;<br />
  end;</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>{ Manipulação Simples}</strong></p>
<p>Exemplo de como utilizar uma string para formatação&#8230;</p>
<p>Eu tenho como string &#8220;botecounix&#8221; e pretendo formatar até boteco,então faço o seguinte :</p>
<p>Código:<br />
<code>procedure TForm1.Button1Click(Sender: TObject);<br />
var<br />
X : Integer;<br />
S1 : String;<br />
S2 : String;<br />
begin<br />
 for X := 0 to ListBox1.Items.Count-1 do<br />
begin<br />
 S1 := Form1.ListBox1.Items[X];<br />
 S2 := 'unix'; //Edit1.Text<br />
 Delete(S1, Pos(S2, S1) , length( S2 ) );<br />
 Form1.ListBox1.Items[X] :=S1;<br />
end;<br />
end;</code></p>
<blockquote><p>
Obs: Caso estiver somente com a string sendo referencia inicial de linha o codigo não ira remove-la.</p></blockquote>
</div>]]></content:encoded>
</item>

</channel>
</rss>
