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

<channel>
	<title>Information Technology Management &#38; Development</title>
	<atom:link href="http://blogs.yellowfish.biz/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.yellowfish.biz</link>
	<description>IT Consulting, Infrastructure, Software &#38; Voip Phone Systems</description>
	<lastBuildDate>Sun, 08 Nov 2009 19:04:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSV Parsing with Erlang</title>
		<link>http://blogs.yellowfish.biz/2009/csv-parsing-with-erlang/</link>
		<comments>http://blogs.yellowfish.biz/2009/csv-parsing-with-erlang/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 14:00:47 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=320</guid>
		<description><![CDATA[CVS Parsing code with Erlang using OTP gen_fsm]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://www.erlang.org/doc/">OTP</a> doesn&#39;t provide any CSV parsing capabilities, I decided to write my own based upon <a href="http://www.erlang.org/doc/man/gen_fsm.html">gen_fsm</a>. Following the short explanation given in Perl&#39;s <a href="http://search.cpan.org/~hmbrand/Text-CSV_XS-0.69/CSV_XS.pm#SPECIFICATION">Text::CSV_XS</a> module, I implemented a simple state machine. Erlang&#39;s excellent binary processing capabilities and built in gen_fsm behavior make the code compact, and surprisingly easy to implement. You can download the code from <a href="http://www.yellowfish.biz/code/parse_csv.erl">here</a>. A short explanation follows.</p>
<p>The state machine has only following handful of states:</p>
<h4>start_field</h4>
<p>Start reading a CSV field &#8211; it might be double quoted and might have special chars such as \r, \n, comma and double quote. Goto read_field or read_quoted_field, depending upon if a double quote started this field.</p>
<h4>read_field</h4>
<p>Once a field has started, we switch to this state and read binary bytes until and end of field condition is detected. End of Field is marked by either a comma or a newline.&nbsp;</p>
<h4>read_quoted_field</h4>
<p>We&#39;re inside a double quoted field; read everything until another double quote is encountered. A double quote might be end of this field or an embedded double quote marked with two consecutive double quotes. Switch to&nbsp;escaped_double_quote if a double quote is encountered.</p>
<h4>escaped_double_quote</h4>
<p>We come inside this field upon encountering a double quote inside read_quoted_field state. If another double quote is seen, it&#39;s an escaped double quote, else, it&#39;s nothing special. Both these cases go back to read_quoted_field.</p>
<h3>Usage</h3>
<p>Following public methods are exported:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">parse_csv<span style="color: #009900;">&#40;</span>File_path<span style="color: #009900;">&#41;</span>
parse_csv<span style="color: #009900;">&#40;</span>Binary_blob<span style="color: #009900;">&#41;</span>
parse_csv<span style="color: #009900;">&#40;</span>File_path<span style="color: #339933;">,</span> Options<span style="color: #009900;">&#41;</span>
parse_csv<span style="color: #009900;">&#40;</span>Binary_blob<span style="color: #339933;">,</span> Options<span style="color: #009900;">&#41;</span></pre></div></div>

<p>where Options is:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>callback_fn<span style="color: #339933;">,</span> Fun<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>callback_state<span style="color: #339933;">,</span> term<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span></pre></div></div>

<p>Fun is a function/2 and gets called with a List of Fields and callback state.</p>
<p>With no Options passed, the return is a list of list of Fields. With callback_fn passed, the Callback is called at the end of each line with a list of Fields.</p>
<h3>Examples:</h3>
<p><br/></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">parse_csv<span style="color: #339933;">:</span>parse_csv<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/tmp/data.csv&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></div></div>

<p>Returns:</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #ff0000;">&quot;Date&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;Source&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;Destination&quot;</span><span style="color: #339933;">&gt;&gt;,</span>
  <span style="color: #339933;">&lt;&lt;</span><span style="color: #ff0000;">&quot;Seconds&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;CallerID&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;Disposition&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;Cost&quot;</span><span style="color: #339933;">&gt;&gt;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
 <span style="color: #009900;">&#91;</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #ff0000;">&quot;2009-09-18 09:44:54&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;5097213333&quot;</span><span style="color: #339933;">&gt;&gt;,</span>
  <span style="color: #339933;">&lt;&lt;</span><span style="color: #ff0000;">&quot;18667778888&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;66&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;5098761323&quot;</span><span style="color: #339933;">&gt;&gt;,&lt;&lt;</span><span style="color: #ff0000;">&quot;ANSWERED&quot;</span><span style="color: #339933;">&gt;&gt;,</span>
  <span style="color: #339933;">&lt;&lt;</span><span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #339933;">&gt;&gt;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">F <span style="color: #339933;">=</span> fun<span style="color: #009900;">&#40;</span>Fields<span style="color: #339933;">,</span> State<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-&gt;</span> <span style="color: #006600;">io</span><span style="color: #339933;">:</span><span style="color: #000066;">format</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;~p~n&quot;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span>Fields<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> State <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span> end<span style="color: #339933;">.</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">parse_csv<span style="color: #339933;">:</span>parse_csv<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/tmp/data.csv&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>callback_fn<span style="color: #339933;">,</span> F<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>callback_state<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span></pre></div></div>

<div>It calls F repeatedly. First with second parameter set to 0, then 1, then2 and so on. Note that your fun must return a modified state which becomes second parameter to callback_fn for the next line.</div>
<div>&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/csv-parsing-with-erlang/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Send Emails without installing SMTP server</title>
		<link>http://blogs.yellowfish.biz/2009/send-emails-without-installing-smtp-server/</link>
		<comments>http://blogs.yellowfish.biz/2009/send-emails-without-installing-smtp-server/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 17:57:52 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[system-administration]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=298</guid>
		<description><![CDATA[&#160;Sending emails is easy. All you need is access to an SMTP server. Or local Sendmail daemon. Installing and configuring either of the two is a massive task. Even if you get it right, your ISP might not like you running SMTP server. If you are past ISP hurdle, chances are your emails will get [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;Sending emails is easy. All you need is access to an SMTP server. Or local Sendmail daemon. Installing and configuring either of the two is a massive task. Even if you get it right, your ISP might not like you running SMTP server. If you are past ISP hurdle, chances are your emails will get marked as SPAM for lack of Reverse DNS.</p>
<p>This is an easier way and we all know it &#8211; just use Google SMTP server. All you need is a gmail account or Google Apps account &#8211; and who doesn&#8217;t have a google account?</p>
<p>However, sometimes, the third party software you&#8217;re trying to configure to send emails doesn&#8217;t support anything other than localhost. Or it does but wants plain SMTP whereas Google does only TLS. Or simply, connecting to Google&#8217;s SMTP for each email takes few seconds and you want faster response.</p>
<p>Here&#8217;s a simple solution:</p>
<ul>
<li>Install the wonderful Email Relay program from <a href="http://emailrelay.sourceforge.net/">here</a></li>
<li>Create a file :

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">vi <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>google<span style="color: #339933;">.</span>email<span style="color: #339933;">.</span>auth</pre></div></div>

<p>    and add following line:&nbsp;</p>
<ul>
<li>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">login client yourgoogleemailid@gmail.<span style="color:#9900CC;">com</span> yourgooglepassword</pre></div></div>

</li>
</ul>
</li>
<li>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">chown daemon:root <span style="color:#006600; font-weight:bold;">/</span>etc<span style="color:#006600; font-weight:bold;">/</span>google.<span style="color:#9900CC;">email</span>.<span style="color:#9900CC;">auth</span>
chmod <span style="color:#006666;">400</span> <span style="color:#006600; font-weight:bold;">/</span>etc<span style="color:#006600; font-weight:bold;">/</span>google.<span style="color:#9900CC;">email</span>.<span style="color:#9900CC;">auth</span></pre></div></div>

</li>
<li>run emailrelay as: &nbsp;&nbsp;

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">emailrelay <span style="color:#006600; font-weight:bold;">--</span>as<span style="color:#006600; font-weight:bold;">-</span>proxy smtp.<span style="color:#9900CC;">gmail</span>.<span style="color:#9900CC;">com</span>:<span style="color:#006666;">587</span> <span style="color:#006600; font-weight:bold;">--</span>client<span style="color:#006600; font-weight:bold;">-</span>tls <span style="color:#006600; font-weight:bold;">--</span>client<span style="color:#006600; font-weight:bold;">-</span>auth <span style="color:#006600; font-weight:bold;">/</span>etc<span style="color:#006600; font-weight:bold;">/</span>google.<span style="color:#9900CC;">email</span>.<span style="color:#9900CC;">auth</span></pre></div></div>

</li>
<li>Configure your software to use localhost for SMTP server (Port defaulted to 25).</li>
</ul>
<p>Test your Local Emailer. If it doesn&#8217;t work, enable logging in <em>/</em><strong><em>etc/emailrelay.conf</em></strong> by uncommenting<strong> <em>verbose</em></strong> line and look into your syslog file (/var/log/syslog)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/send-emails-without-installing-smtp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving your wordpress blogs</title>
		<link>http://blogs.yellowfish.biz/2009/moving-your-wordpress-blogs/</link>
		<comments>http://blogs.yellowfish.biz/2009/moving-your-wordpress-blogs/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 21:58:16 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=283</guid>
		<description><![CDATA[Recently I had to create a clone of this blog site so we can apply upgrades and test these out without fear of breaking our actual blogs. Here&#8217;s a list of steps I followed. Hopefully, it&#8217;ll help others.
Assumptions:

&#160;&#160; existing blog URL: http://a.com.
&#160;&#160; New blog URL: http://b.com/wordpress
&#160;&#160; Existing blog is installed in /var/www
&#160;&#160; New blog will [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to create a clone of this blog site so we can apply upgrades and test these out without fear of breaking our actual blogs. Here&#8217;s a list of steps I followed. Hopefully, it&#8217;ll help others.</p>
<p>Assumptions:</p>
<ul>
<li>&nbsp;&nbsp; existing blog URL: http://a.com.</li>
<li>&nbsp;&nbsp; New blog URL: http://b.com/wordpress</li>
<li>&nbsp;&nbsp; Existing blog is installed in /var/www</li>
<li>&nbsp;&nbsp; New blog will be installed in /var/www/wordpress</li>
<li>&nbsp;&nbsp; The MySQL database for wordpress content is called &#8216;wordpress&#8217;. Username and passwords are also &#8216;wordpress&#8217;</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">ssh root<span style="color: #0000ff;">@a</span><span style="color: #339933;">.</span>com
 cd <span style="color: #009966; font-style: italic;">/var/</span>
 tar cf wordpress<span style="color: #339933;">.</span>tar www
 bzip2 wordpress<span style="color: #339933;">.</span>tar
 mysqldump <span style="color: #339933;">--</span>add<span style="color: #339933;">-</span>drop<span style="color: #339933;">-</span>table<span style="color: #339933;">-</span>uwordpress <span style="color: #339933;">-</span>pwordpress <span style="color: #339933;">-</span>Dwordpress <span style="color: #339933;">-</span>hlocalhost <span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> db<span style="color: #339933;">.</span>backup
 bzip2 db<span style="color: #339933;">.</span>backup
 scp wordpress<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>bz2 db<span style="color: #339933;">.</span>backup<span style="color: #339933;">.</span>bz2 root<span style="color: #0000ff;">@b</span><span style="color: #339933;">.</span>com<span style="color: #339933;">:/</span>var<span style="color: #339933;">/</span>www
ssh root<span style="color: #0000ff;">@b</span><span style="color: #339933;">.</span>com
 cd <span style="color: #339933;">/</span>var
 tar jxf wordpress<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>bz2
 mysql <span style="color: #339933;">-</span>uroot <span style="color: #339933;">-</span>p<span style="color: #339933;">&lt;</span>mysql root<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;&quot;</span> pw<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">&gt;</span>         
 create database wordpress<span style="color: #339933;">;</span>
 GRANT ALL PRIVILEGES ON wordpress<span style="color: #339933;">.*</span> to <span style="color: #ff0000;">'wordpress'</span><span style="color: #339933;">@</span><span style="color: #ff0000;">'localhost'</span> identified by <span style="color: #ff0000;">'wordpress*'</span><span style="color: #339933;">;</span> 
 <span style="color: #000066;">exit</span><span style="color: #339933;">;</span>  
 cd <span style="color: #339933;">/</span>var<span style="color: #339933;">/</span>www  bunzip2 db<span style="color: #339933;">.</span>backup<span style="color: #339933;">.</span>bz2 
 mysql <span style="color: #339933;">-</span>uwordpress <span style="color: #339933;">-</span>p<span style="color: #ff0000;">'wordpress'</span> <span style="color: #339933;">-</span>Dwordpress <span style="color: #339933;">-</span>hlocalhost <span style="color: #339933;">&lt;</span> db<span style="color: #339933;">.</span>backup  
 cd <span style="color: #339933;">/</span>var<span style="color: #339933;">/</span>www
 <span style="color: #000066;">mkdir</span> wordpress 
 cd wordpress 
 mv <span style="color: #339933;">../</span>wordpress<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>bz2 <span style="color: #339933;">.</span>   
 tar jxf wordpress<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>bz2  
 mv www<span style="color: #339933;">/*</span> <span style="color: #339933;">.</span>  
 rm <span style="color: #339933;">-</span>rfwordpress<span style="color: #339933;">.</span>tar<span style="color: #339933;">.</span>bz2 www     
 cd <span style="color: #339933;">/</span>var<span style="color: #339933;">/</span>www    
 mysql<span style="color: #339933;">-</span>uwordpress <span style="color: #339933;">-</span>p<span style="color: #ff0000;">'wordpress'</span> <span style="color: #339933;">-</span>Dwordpress <span style="color: #339933;">-</span>hlocalhost
    update wp_posts set guid<span style="color: #339933;">=</span>REPLACE<span style="color: #009900;">&#40;</span>guid<span style="color: #339933;">,</span><span style="color: #ff0000;">'http://a.com'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'http://b.com/wordpress'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>         
    update wp_options set option_value<span style="color: #339933;">=</span><span style="color: #ff0000;">'http://b.com/wordpress/'</span> where option_name<span style="color: #339933;">=</span><span style="color: #ff0000;">'siteurl'</span><span style="color: #339933;">;</span>   
    <span style="color: #000066;">exit</span><span style="color: #339933;">;</span></pre></div></div>

<p>You should be able to login as admin at http://b.com/wordpress/wp-admin</p>
<p>Goto Settings/General and change all instances of http://a.com to http://b.com/wordpress</p>
<p>You might also have to goto your currently selected theme and make sure URLs are changed. Some themes have URLs embedded in them.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/moving-your-wordpress-blogs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bing and chinese food</title>
		<link>http://blogs.yellowfish.biz/2009/bing-and-chinese-food/</link>
		<comments>http://blogs.yellowfish.biz/2009/bing-and-chinese-food/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 16:43:02 +0000</pubDate>
		<dc:creator>Lori Barkyoumb</dc:creator>
				<category><![CDATA[search engines]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[search results]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/2009/bing-and-chinese-food/</guid>
		<description><![CDATA[Bing. Since Bing has arrived on the scene, the engine has caused many opinions to be expressed on it&#8217;s future.
Will it continue to give great search results? Is it because webmasters haven&#8217;t learned how to make websites &#8216;Bing Friendly&#8217; yet? People who are true microsoft haters ( I&#8217;m occasionally one of them&#8230;) have been looking [...]]]></description>
			<content:encoded><![CDATA[<p>Bing. Since Bing has arrived on the scene, the engine has caused many opinions to be expressed on it&#8217;s future.</p>
<p>Will it continue to give great search results? Is it because webmasters haven&#8217;t learned how to make websites &#8216;Bing Friendly&#8217; yet? People who are true microsoft haters ( I&#8217;m occasionally one of them&#8230;) have been looking for reasons to hate Bing because it&#8217;s microsoft. I guess only time will tell if Bing is good because it&#8217;s authentic and websites haven&#8217;t been able to skew the results via knowledge of how the engine works or if it&#8217;s truly genius.</p>
<p>Oh yeah, you are probably wondering why I brought chinese food into the mix&#8230;</p>
<p>Following my research on Bing, I was hungry and got some chinese food. The backside of my fortune in my cookie teaches you a word in chinese. The word was &#8216;BING&#8217;. The definition was disease. Very coincidental&#8230;</p>
<p>Let&#8217;s see if Bing makes it or dies off.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/bing-and-chinese-food/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>google adsense or nonsense?</title>
		<link>http://blogs.yellowfish.biz/2009/google-adsense-or-nonsense/</link>
		<comments>http://blogs.yellowfish.biz/2009/google-adsense-or-nonsense/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 22:32:36 +0000</pubDate>
		<dc:creator>Lori Barkyoumb</dc:creator>
				<category><![CDATA[Web Presence]]></category>
		<category><![CDATA[Website Design]]></category>
		<category><![CDATA[website content]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[advertising]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/2009/google-adsense-or-nonsense/</guid>
		<description><![CDATA[I want to know who is clicking on the google ads that are placed in the middle of paragraphs, before the answer you need to find, and anywhere else they can be jammed on the web page? Okay, maybe I&#8217;m a touch intolerant of ad sense. But I have a good reason why. For example, [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: medium;"><span style="font-family: Arial;">I want to know who is clicking on the google ads that are placed in the middle of paragraphs, before the answer you need to find, and anywhere else they can be jammed on the web page? Okay, maybe I&#8217;m a touch intolerant of ad sense. But I have a good reason why. For example, I too fell prey to the lure of googles billions, thought I could make money and implemented google ad sense into the yellowfish website. </span></span></p>
<p><span style="font-size: medium;"><span style="font-family: Arial;">Hard as I would try, I could not get the ad sense placements to stop competing with the content. Now here&#8217;s where my tolerance started to go south. We are Yellowfish Technologies, an Information Technology firm. Ad sense decided to pick the word &#8216;yellowfish&#8217; and proceeded to list out crap ads about water, feeding, fish types, yellow belly fish flounder and you name it. It was ridiculous to see this type of information being offered on our technology home front. The competitors it also advertised was another story. I removed ad sense from the Yellowfish site. I guess now I&#8217;m not such a big fan, but the bad news is, it continues to haunt me. </span></span></p>
<p><span style="font-size: medium;"><span style="font-family: Arial;">I am a victim. I really am. Bad google advertising makes me lose track of what I was looking for. Usually the rest of something interesting&#8230; When I see these odd ad blocks hogging up valuable real estate on the web page where the content suppose to be, I can&#8217;t believe they are in such big use. The ads are just plain distracting and side-track you. Honestly, I do not know anyone who would stop to click further on them. The Yellow belly fish flounder incident comes back loud and clear. </span></span></p>
<p><span style="font-size: medium;"><span style="font-family: Arial;">I am now convinced most people who use and those who over-use ad sense do not pay attention to what actually shows up on their site under these ads. I was having a victim moment the other day and noticed the link options very strange. I think it was out of irritation and to prove it&#8217;s all irrelevant stuff displayed in those ad sense links, but I clicked on a couple as an experiment. All 5 of the links I chose brought me to a page without graphics and that was just a series of more random links, too many choices about the same thing, with an occasional link that made a small amount of sense. It&#8217;s just as I thought&#8230;useless. Oh, and by-the-way, I never went back to that site and found another that delivered information not ads. I book marked it. </span></span></p>
<p><span style="font-size: medium;"><span style="font-family: Arial;">I know people are just trying to make an extra buck off google hoping someone clicks on one of them and earns them extra money, but geeze, good sites are falling prey and putting all google ads above the fold and the important stuff below. I can barely read what&#8217;s I came there for. To all you over-users of google ad sense, please evaluate if it&#8217;s worth switching out your business content that should be easy to find and read for ads on things generally irrelevant and out of your control. Do you really want visitors leaving your site to go somewhere else anyways?</span></span></p>
<p class="MsoNormal"><span style="font-size: medium;"><span style="font-family: Arial;">&nbsp;</span></span></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/google-adsense-or-nonsense/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Video blast off</title>
		<link>http://blogs.yellowfish.biz/2009/video-blast-off/</link>
		<comments>http://blogs.yellowfish.biz/2009/video-blast-off/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 15:40:48 +0000</pubDate>
		<dc:creator>Lori Barkyoumb</dc:creator>
				<category><![CDATA[Website Design]]></category>
		<category><![CDATA[multi-media]]></category>
		<category><![CDATA[website content]]></category>
		<category><![CDATA[landing page]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[video use]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/2009/video-blast-off/</guid>
		<description><![CDATA[Ok, I am all for video on a website. It&#8217;s interesting, visually stimulating and its fun to watch. EXCEPT when you arrive at a website and the video blasts off and startles you half to death. How dare they scare me like that? A few choice words later, while I try to get my heart [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, I am all for video on a website. It&#8217;s interesting, visually stimulating and its fun to watch. EXCEPT when you arrive at a website and the video blasts off and startles you half to death. How dare they scare me like that? A few choice words later, while I try to get my heart rate under control from the sudden fright&#8230;   I can&#8217;t help but find myself irritated at the disturbance as well as wonder why my speakers were set so loud. I think the use of video on a website and on landing pages are great when used appropriately. But you must allow the user to control when it starts, ends and how loud it will be. Set the default volume to a non-invasive level. Let the user adjust it to their liking.   Asking how do you get the user to play the video and know it&#8217;s there if it doesn&#8217;t blast off? Make it interesting! Draw attention to the display, make the user want to push &#8216;play&#8217;. Use a giant &#8216;Play me button&#8217; if you need to, but just don&#8217;t set the video on &#8216;auto-play&#8217; with a volume level loud enough to wake moon men.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/video-blast-off/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple REST controller for Spring MVC</title>
		<link>http://blogs.yellowfish.biz/2009/a-simple-rest-controller-for-spring-mvc/</link>
		<comments>http://blogs.yellowfish.biz/2009/a-simple-rest-controller-for-spring-mvc/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 18:23:22 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Computer Languages]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=247</guid>
		<description><![CDATA[RESTful programming is all the rage these days &#8211; at least in Rails world. It&#39;s a simple way to perform request dispatching which is easy to understand and maps database CRUD operations into web requests elegantly. While Rails comes with REST routing built in, there is no such support in Spring MVC. However, Spring&#39;s decoupled [...]]]></description>
			<content:encoded><![CDATA[<p><span style="background-color: #ffffff;">RESTful programming is all the rage these days &#8211; at least in Rails world. It&#39;s a simple way to perform request dispatching which is easy to understand and maps database CRUD operations into web requests elegantly. While Rails comes with REST routing built in, there is no such support in Spring MVC. However, Spring&#39;s decoupled design makes it rather easy to implement. Here&#39;s code I wrote to implement RESTful dispatches using Spring MVC.(Also available as a download <a href="http://www.yellowfish.biz/code/RESTMethodResolver.java">here</a>)</span></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.yellowfish.servlets</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.servlet.http.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.log4j.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.web.servlet.mvc.multiaction.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> RESTMethodResolver <span style="color: #000000; font-weight: bold;">implements</span> MethodNameResolver <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getHandlerMethodName<span style="color: #009900;">&#40;</span>HttpServletRequest req<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> NoSuchRequestHandlingMethodException <span style="color: #009900;">&#123;</span>
&nbsp;
        Logger log <span style="color: #339933;">=</span> Logger.<span style="color: #006633;">getLogger</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;com.yellowfish.servlets&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Resolving method name for the Request&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> method <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;_method&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> id     <span style="color: #339933;">=</span> req.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> http_method <span style="color: #339933;">=</span> req.<span style="color: #006633;">getMethod</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toUpperCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> controller_method <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
        log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;method: &quot;</span><span style="color: #339933;">+</span>method<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; http_method: &quot;</span> <span style="color: #339933;">+</span> http_method <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; id: &quot;</span><span style="color: #339933;">+</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>http_method.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;GET&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #003399;">String</span> uri <span style="color: #339933;">=</span> req.<span style="color: #006633;">getRequestURI</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            controller_method <span style="color: #339933;">=</span>  <span style="color: #009900;">&#40;</span>uri.<span style="color: #006633;">endsWith</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/new&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #0000ff;">&quot;_new&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;show&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>controller_method <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;show&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                controller_method <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>id <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #0000ff;">&quot;index&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;show&quot;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>http_method.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;POST&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>method <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                method <span style="color: #339933;">=</span> method.<span style="color: #006633;">toUpperCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>id <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
&nbsp;
                    <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> com.<span style="color: #006633;">yellowfish</span>.<span style="color: #006633;">servlets</span>.<span style="color: #006633;">ServletException</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id cannot be NULL for PUT and DELETE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>method.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;PUT&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
&nbsp;
                    controller_method <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;update&quot;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>method.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DELETE&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
&nbsp;
                    controller_method <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;delete&quot;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                controller_method <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;create&quot;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>controller_method <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No Controller Method Found&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> NoSuchRequestHandlingMethodException<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        log.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Controller method resolved to :&quot;</span> <span style="color: #339933;">+</span> controller_method<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        req.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;controller_method_name&quot;</span>, controller_method<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>id <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                req.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;model-id&quot;</span>, <span style="color: #003399;">Long</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">NumberFormatException</span> exp<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                log.<span style="color: #006633;">warn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span> <span style="color: #339933;">+</span> id <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; is not a Number&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">return</span> controller_method<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><span style="background-color: #ffffff;">Then simply declare this bean in the spring config:</span> <span style="background-color: #ffffff;"> </span></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>bean class<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;com.yellowfish.servlets.RESTMethodResolver&quot;</span> id<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;rest-method-resolver&quot;</span><span style="color: #339933;">&gt;&lt;/</span>bean<span style="color: #339933;">&gt;</span></pre></div></div>

<p>It resolves incoming URL and Method as per following table:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table cellpadding="1" cellspacing="1" height="300" style="border:1px solid black;" width="550">
<caption>REST Resolver Rules</caption>
<tbody>
<tr>
<th align="center">URI</th>
<th align="center">GET/POST</th>
<th align="center">ID Parameter Present?</th>
<th align="center">_method Parameter Present?</th>
<th align="center">Method Name</th>
</tr>
<tr>
<td align="center">&nbsp;/server</td>
<td align="center">GET&nbsp;</td>
<td align="center">No&nbsp;</td>
<td align="center">N/A</td>
<td align="center">index</td>
</tr>
<tr>
<td align="center">/server/_new</td>
<td align="center">GET</td>
<td align="center">No</td>
<td align="center">N/A</td>
<td align="center">new</td>
</tr>
<tr>
<td align="center">/server?id=100</td>
<td align="center">GET</td>
<td align="center">Yes</td>
<td align="center">N/A</td>
<td align="center">show</td>
</tr>
<tr>
<td align="center">/server</td>
<td align="center">POST</td>
<td align="center">No&nbsp;</td>
<td align="center">No</td>
<td align="center">create&nbsp;</td>
</tr>
<tr>
<td align="center">&nbsp;/server</td>
<td align="center">POST&nbsp;</td>
<td align="center">Yes</td>
<td align="center">PUT</td>
<td align="center">update&nbsp;</td>
</tr>
<tr>
<td align="center">&nbsp;/server</td>
<td align="center">POST&nbsp;</td>
<td align="center">Yes&nbsp;</td>
<td align="center">DELETE</td>
<td align="center">delete&nbsp;</td>
</tr>
</tbody>
</table>
<p>&nbsp;To make life simple, the code above assumes all IDs to be numeric and if ID is present in incoming request, it creates a Request attribute called &#39;model-id&#39; .&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/a-simple-rest-controller-for-spring-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chicanery on Wall St</title>
		<link>http://blogs.yellowfish.biz/2009/chicanery-on-wall-st/</link>
		<comments>http://blogs.yellowfish.biz/2009/chicanery-on-wall-st/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 16:51:49 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Finance]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=244</guid>
		<description><![CDATA[How Traders invent derivatives and complex financial instruments in an effort to keep the money tree alive]]></description>
			<content:encoded><![CDATA[<p>Reading the book &#8216;<a href="http://www.amazon.com/Traders-Guns-Money-unknowns-derivatives/dp/0273704745/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1255365933&amp;sr=8-1" target="_blank">Traders Guns &amp; Money</a>&#8216;  by Satyajit Das. It&#8217;s an awesome account of greed and &#8216;anything goes&#8217; attitude on Wall St (and financial markets around the globe).  From ultra complex to borderline illegal instruments concocted by Dealers and Investment bankers around the world to make quick killings , everything that unraveled three years after the book was written, is detailed by the author. It&#8217;s interesting, he wrote about these years before the meltdown. But so did Warren Buffet who called these derivatives the financial WMDs!</p>
<p>Some of my favorite quotes from the book:</p>
<p><em>The most intriguing thing about convertible bonds is that everybody seems to be getting a great deal. It&#8217;s a win-win. Markets don&#8217;t work that way. Question is, who is fooling whom?</em></p>
<p><em>Robert Citron, treasurer of Orange County before it went bust, confident Interest rates wouldn&#8217;t rise.: &#8216;I am one of the largest investors in America, I know these things&#8217; </em></p>
<p><em>Same guy testifying during investigations, after Orange county lost 1.5B: &#8216;My brain was unable to audit&#8217; !</em></p>
<p><em>Traders work on the theory that what is mine is mine, and what is yours is also mine.</em></p>
<p><em>The irony of trying to model chaos, the finding of order in complete disorder, is lost on most quants.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/chicanery-on-wall-st/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Injecting Traits into Javascript Objects</title>
		<link>http://blogs.yellowfish.biz/2009/injecting-traits-into-javascript-objects/</link>
		<comments>http://blogs.yellowfish.biz/2009/injecting-traits-into-javascript-objects/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 17:01:24 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Web Applications / User Interface Design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=234</guid>
		<description><![CDATA[Duplication is the mother of all evil in programming. Remaining DRY at all costs should be your goal at all times. A pattern repeats itself one time and your code complexity goes up exponentially.
One great way to DRY up your code is via Traits. Traits are functional equivalent of base classes where you can collect [...]]]></description>
			<content:encoded><![CDATA[<p>Duplication is the mother of all evil in programming. Remaining DRY at all costs should be your goal at all times. A pattern repeats itself one time and your code complexity goes up exponentially.<br />
One great way to DRY up your code is via Traits. Traits are functional equivalent of base classes where you can collect most often used functions and inject these Traits into your objects. Here&#8217;s one simple way to do it in Javascript (using <a href="http://www.extjs.com">extjs</a> here):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">MyTrait <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
   xhr<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> Ext.<span style="color: #660066;">Ajax</span>.<span style="color: #660066;">request</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
   submit<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>basic_form<span style="color: #339933;">,</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">//perform some checks on config </span>
               <span style="color: #006600; font-style: italic;">// and call basic_form.submit </span>
   <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
   <span style="color: #006600; font-style: italic;">//...add more utility functions</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> MyGrid<span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>MyGrid.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">constructor</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>config<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span>
Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>MyGrid<span style="color: #339933;">,</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #339933;">,</span> MyTrait<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/injecting-traits-into-javascript-objects/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Clickable links within Extjs grid cells</title>
		<link>http://blogs.yellowfish.biz/2009/extjs-links-in-grid-cells/</link>
		<comments>http://blogs.yellowfish.biz/2009/extjs-links-in-grid-cells/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 13:57:05 +0000</pubDate>
		<dc:creator>Praveen Ray</dc:creator>
				<category><![CDATA[Computer Languages]]></category>
		<category><![CDATA[Web Applications / User Interface Design]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blogs.yellowfish.biz/?p=224</guid>
		<description><![CDATA[An easy way to add clickable links to Extjs grid Cells.]]></description>
			<content:encoded><![CDATA[<p>Although the extjs <a href="http://www.extjs.com/deploy/dev/examples/samples.html#sample-2">grid</a> is an awesome component, IMO, it suffers from one major drawback &#8211; it&#8217;s inability to place active components within data cells. At least it&#8217;s not straightforward. Here&#8217;s a simple solution to place clickable links within cells. The trick is to place <span>s which look like links and then intercept rowclick and determine which of many links was clicked on.</p>
<p>Here&#8217;s an example of a custom Grid Component:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> MyComponent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   MyComponent.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">constructor</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
Ext.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>MyComponent<span style="color: #339933;">,</span> Ext.<span style="color: #660066;">grid</span>.<span style="color: #660066;">GridPanel</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
MyComponent.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">initComponent</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> action_tmpl <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">XTemplate</span><span style="color: #009900;">&#40;</span>
     <span style="color: #3366CC;">&quot;&lt;span class='link' id='edit-{id}'&gt;Edit&lt;/span&gt;&quot;</span><span style="color: #339933;">,</span>
     <span style="color: #3366CC;">&quot;&lt;span class='link' id='delete-{id}'&gt;Delete&lt;/span&gt;&quot;</span>
   <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   action_tmpl.<span style="color: #660066;">compile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #006600; font-style: italic;">// grid related config</span>
     columns<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">'First Name'</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span><span style="color: #3366CC;">'fname'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span>header<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Action'</span><span style="color: #339933;">,</span> dataIndex<span style="color: #339933;">:</span><span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> 
          renderer<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
              <span style="color: #000066; font-weight: bold;">return</span> action_tmpl.<span style="color: #660066;">applyTemplate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>id<span style="color: #339933;">:</span> id<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>
     <span style="color: #009900;">&#93;</span>
   <span style="color: #009900;">&#125;</span>
   MyComponent.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">initComponent</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span>content<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
MyComponent.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">afterRender</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  MyComponent.<span style="color: #660066;">superclass</span>.<span style="color: #660066;">afterRender</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">on</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rowclick'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">row_click</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
MyComponent.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">row_click</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>grid<span style="color: #339933;">,</span> ri<span style="color: #339933;">,</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> rec <span style="color: #339933;">=</span> grid.<span style="color: #660066;">getStore</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getAt</span><span style="color: #009900;">&#40;</span>ri<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #006600; font-style: italic;">// See Below for within_el method</span>
   <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>evt.<span style="color: #660066;">within_el</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'edit-'</span><span style="color: #339933;">+</span>r.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Edit clicked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>evt.<span style="color: #660066;">within_el</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'delete-'</span><span style="color: #339933;">+</span>r.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Delete clicked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p> The within_el method on Ext.EventObject object looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ext.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span>Ext.<span style="color: #660066;">EventObject</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
    within_el<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        el <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>el<span style="color: #009900;">&#41;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> evt_xy <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getXY</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> evt_x <span style="color: #339933;">=</span> evt_xy<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> evt_y <span style="color: #339933;">=</span> evt_xy<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>evt_x <span style="color: #339933;">&gt;</span> el.<span style="color: #660066;">getLeft</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> evt_x <span style="color: #339933;">&lt;</span> el.<span style="color: #660066;">getRight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> evt_y <span style="color: #339933;">&gt;</span> el.<span style="color: #660066;">getTop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> evt_y <span style="color: #339933;">&lt;</span> el.<span style="color: #660066;">getBottom</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blogs.yellowfish.biz/2009/extjs-links-in-grid-cells/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
