<?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>My Learnings - Markish Personal Blog &#187; Internet Technology</title>
	<atom:link href="http://markish.in/category/technology/internet-technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://markish.in</link>
	<description>It&#039;s my Blog....!</description>
	<lastBuildDate>Thu, 10 Mar 2011 08:41:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Email Validation in PHP</title>
		<link>http://markish.in/2010/12/email-validation-in-php/</link>
		<comments>http://markish.in/2010/12/email-validation-in-php/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 05:10:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[PHP & Mysql]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Dominic Sayer]]></category>
		<category><![CDATA[Email Validation]]></category>
		<category><![CDATA[Email Validation in PHP]]></category>
		<category><![CDATA[isemail]]></category>
		<category><![CDATA[is_email]]></category>

		<guid isPermaLink="false">http://markish.in/?p=196</guid>
		<description><![CDATA[Many times, we need to validate an email, the end user enters in our web data forms. If you business operations depend heavily on email (atleast as mine does), verifying &#38; validating the customer data becomes a nightmare if you don&#8217;t validate the email input properly. Email validation can be done in many ways. One [...]]]></description>
			<content:encoded><![CDATA[<p>Many times, we need to validate an email, the end user enters in our web data forms. If you business operations depend heavily on email (atleast as mine does), verifying &amp; validating the customer data becomes a nightmare if you don&#8217;t validate the email input properly. <span id="more-196"></span>Email validation can be done in many ways. One of the most popular being the regexp method. Almost all languages support regexp directly or indirectly. But is it completely fool proof..? Or does it comply with all standard definitions of an email. To understand or answer this, we need to know what is a valid email.</p>
<p>As of today, a valid email by definition is defined by these below RFCs</p>
<ul>
<li><a href="http://tools.ietf.org/html/rfc5321#section-4.1.2" target="_blank">RFC 5321</a>,</li>
<li><a href="http://tools.ietf.org/html/rfc5322#section-3.4.1" target="_blank">RFC 5322</a>,</li>
<li><a href="http://tools.ietf.org/html/rfc4291#section-2.2" target="_blank">RFC 4291</a>,</li>
<li><a href="http://tools.ietf.org/html/rfc5952" target="_blank">RFC 5952</a> <em>new</em>,</li>
<li><a href="http://tools.ietf.org/html/rfc1123#section-2.1" target="_blank">RFC1123</a>,</li>
<li><a href="http://tools.ietf.org/html/rfc3696" target="_blank">RFC3696</a> (<em>especially the errata</em>).</li>
<li>Let me also point out some RFCs that are <em>less</em> relevant,  even thought they are frequently cited: RFC 822 (obsoleted by RFC 5322),  RFC 2822 (obsoleted by RFC 5322) and RFC1035 (updated by RFC1123).</li>
</ul>
<p><em><strong>Few things I&#8217;ve noticed and would be interesting to note.</strong></em></p>
<ul>
<li>A Plus sign is perfectly valid in a email. Thus markishh+blogging@gmail.com is a perfectly valid email. Moreover, email clients like gmail use the second portion i.e next to plus as &#8216;label&#8217; for the incoming messages from them. I really have not tested what happens if it has two plus signs.</li>
<li>The maximum length of a valid email is 254 characters. It comes from the maximum length of a SMTP transaction is 256 characters including the two angled brackets</li>
<li>Regexp can&#8217;t be used to validate email 100 %. It can test the basics to an extend.</li>
<li>Special characters can be used in a valid email, it they are enclosed in double quotes. Thus <strong>&#8220;markish#@test&#8221;@markish.in</strong> is a valid email. But remember they can&#8217;t be escaped by a backslash like what most of us believe.</li>
</ul>
<p>Ok Now, let&#8217;s see how email can validated to a much better extend. Email validation can be done at client end as well as server side. Client side you can implement any regexp that would satisfy. Something like below would help</p>
<ul>
<li>^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$</li>
<li>^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$</li>
</ul>
<p>In the server side, I&#8217;d suggest is_email.php a parser / validator developed by Dominic Sayers as a perfect fit. You can download this from <a title="Download Here" href="http://code.google.com/p/isemail/downloads/list" target="_blank">here</a></p>
<p>Once you download the PHP version from here, just include the same in your project. Some thing like below code snippet would do the trick of validation. It&#8217;s the best known validator for email as per the existing RFC standards.</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Simple Usage</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://markish.in/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw1">require_once</span> <span class="st_h">'is_email.php'</span><span class="sy0">;</span>
<span class="re0">$email</span><span class="sy0">=</span><span class="st0">&quot;markishh@gmail.com&quot;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span>is_email<span class="br0">&#40;</span><span class="re0">$email</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
	<span class="kw1">echo</span> <span class="st0">&quot;<span class="es4">$email</span> is a valid email address&quot;</span><span class="sy0">;</span>
 <span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span>
 	<span class="kw1">echo</span> <span class="st0">&quot;<span class="es4">$email</span> is invalid&quot;</span><span class="sy0">;</span>
 <span class="br0">&#125;</span></pre></div></div>
<p>The above is very simple and straight forward usage of the script. is_email function returns a Boolean which can be validated against. The class also supports an extended result for the email we supply.</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Extended Usage / Testing</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://markish.in/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw1">require_once</span> <span class="st_h">'is_email.php'</span><span class="sy0">;</span>
<span class="re0">$email</span> <span class="sy0">=</span> <span class="st_h">'markishh@gmail.co'</span><span class="sy0">;</span>
<span class="re0">$result</span> <span class="sy0">=</span> is_email<span class="br0">&#40;</span><span class="re0">$email</span><span class="sy0">,</span> <span class="kw4">true</span><span class="sy0">,</span> <span class="kw4">E_WARNING</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$result</span> <span class="sy0">===</span> ISEMAIL_VALID<span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="kw1">echo</span> <span class="st0">&quot;<span class="es4">$email</span> is a valid email address&quot;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$result</span> <span class="sy0">&lt;</span> ISEMAIL_ERROR<span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="kw1">echo</span> <span class="st0">&quot;Warning! <span class="es4">$email</span> may not be a real email address (result code <span class="es4">$result</span>)&quot;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
	<span class="kw1">echo</span> <span class="st0">&quot;<span class="es4">$email</span> is not a valid email address (result code <span class="es4">$result</span>)&quot;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>
<p>The extended results gives you the SMTP level results as well. This is a very handy as well as simple script that can be added to your existing projects as well.  I hope someone would find it useful and interesting.</p>
<h6>@ Credits to Dominic Sayers for developing such a complete validator.</h6>
<p>Download link again : <a href=http://code.google.com/p/isemail/downloads/list>http://code.google.com/p/isemail/downloads/list</a></p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2010/12/email-validation-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing Output Caching in PHP &#8211; Solve Perfomance Issues</title>
		<link>http://markish.in/2010/12/implementing-output-caching-in-php-solve-perfomance-issues/</link>
		<comments>http://markish.in/2010/12/implementing-output-caching-in-php-solve-perfomance-issues/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 09:26:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[PHP & Mysql]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Caching with PHP]]></category>
		<category><![CDATA[Data Caching]]></category>
		<category><![CDATA[Output caching]]></category>
		<category><![CDATA[Record set Caching]]></category>
		<category><![CDATA[Tutorial for Caching in PHP]]></category>

		<guid isPermaLink="false">http://markish.in/?p=162</guid>
		<description><![CDATA[Cache by definition is transparent storage where results can be stored, so that the future requests can be served faster. With the amount of data handled ever growing, and the necessity for caching has become unavoidable in any decent size web application. In this series, I&#8217;d try to bring out various alternatives available in PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Cache by definition is transparent storage where results can be stored, so that the future requests can be served faster. With the amount of data handled ever growing, and the necessity for caching has become unavoidable in any decent size web application. In this series, I&#8217;d try to bring out various alternatives available in PHP for efficient caching.<br />
<span id="more-162"></span><br />
Before going further, let me explain what is caching &amp; types of caching. Caching can be implemented in server-side as well as browser-side or the client-side. The server-side caching itself can be implemented using various techniques &#8211; viz. HTML caching, Data caching. Each method involves storing the whole or part of the resultant data generated at the web sever in some physical medium and accessing it again for the future requests.</p>
<p>The validity of the data present in the cache depends on the implementation logic and hugely depends on the nature of the application itself. For example, In an online store, the cache data containing the list of products available in the store can be valid for even 2 hours as there is very less chance of a product being added every 2 hours. But the cache data holding the availability (stock) of products can be valid for probably 2 minutes ( assuming , it&#8217;s a real online store where business happens) as the availability keeps changing.</p>
<p>Today we&#8217;d talk about one of the techniques in output caching &#8211; Record set caching. It&#8217;s one of the straight forward approach, that can be implemented. In layman terms, The record-set after a complicated query would be stored separately so that, the future requests can be served from the temporary storage instead of running the time consuming complicated query again every time.</p>
<p>To start with, Let us consider an example. A page delivering search results in JSON format from a product catalogue accepting a search query. Let us put down the algorithm to implement this</p>
<p>Step 1 : Check if a valid cache data exists in cache<br />
Step 2 : If Yes read, the cache data and serve it to the user / client<br />
Step 3 : If No, Read it from the DB and serve the user.<br />
Step 4 : Update / Create the valid cache data with the one got in step 3</p>
<p>Let&#8217;s get into coding rightaway..<br />
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://markish.in/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="re0">$mcdir</span> <span class="sy0">=</span> <span class="st0">&quot;cache/&quot;</span><span class="sy0">;</span>
<span class="re0">$mcache_validity</span><span class="sy0">=</span><span class="nu0">10</span><span class="sy0">;</span>
<span class="re0">$mfnam</span> <span class="sy0">=</span> <span class="re0">$mcdir</span> <span class="sy0">.</span> <span class="st0">&quot;ch_&quot;</span> <span class="sy0">.</span> <span class="re0">$search_data</span> <span class="sy0">.</span><span class="st0">&quot;_file.txt&quot;</span><span class="sy0">;</span>
<span class="re0">$mread_from_cache</span> <span class="sy0">=</span> <span class="kw4">false</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/file_exists"><span class="kw3">file_exists</span></a><span class="br0">&#40;</span><span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="re0">$mctime</span> <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://www.php.net/filectime"><span class="kw3">filectime</span></a><span class="br0">&#40;</span><span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="re0">$mtime_offset</span> <span class="sy0">=</span> <a href="http://www.php.net/time"><span class="kw3">time</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">-</span> <span class="re0">$mctime</span><span class="sy0">;</span>
	<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$mtime_offset</span> <span class="sy0">&lt;</span> <span class="re0">$mcache_validity</span> <span class="sy0">*</span> 60<span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="re0">$mread_from_cache</span> <span class="sy0">=</span> <span class="kw4">true</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div></p>
<p>In the above code snippet , we just check if there is a valid cache data available. The logic behind is to have a separate file to store the result-set for individual search strings. I&#8217;ve set the validity of the cache data to 10 minutes. The next step would be based on the decision made in <strong>step-1</strong></p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://markish.in/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$mread_from_cache</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="re0">$msql</span> <span class="sy0">=</span> <span class="st0">&quot;select product_id,product_name,product_img,product_desc,product_rate
            from product_master where product_name like '%<span class="es4">$search_data</span>%'
            where flag_dele=0&quot;</span><span class="sy0">;</span>
    <span class="re0">$mres</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$msql</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="re0">$mresult</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">while</span> <span class="br0">&#40;</span><span class="re0">$mdata</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_fetch_object"><span class="kw3">mysql_fetch_object</span></a><span class="br0">&#40;</span><span class="re0">$mres</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="re0">$mresult</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$mdata</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
    <span class="re0">$cacheData</span> <span class="sy0">=</span> readCache<span class="br0">&#40;</span><span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#40;</span><a href="http://www.php.net/md5"><span class="kw3">md5</span></a><span class="br0">&#40;</span><a href="http://www.php.net/serialize"><span class="kw3">serialize</span></a><span class="br0">&#40;</span><span class="re0">$cacheData</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <a href="http://www.php.net/md5"><span class="kw3">md5</span></a><span class="br0">&#40;</span><a href="http://www.php.net/serialize"><span class="kw3">serialize</span></a><span class="br0">&#40;</span><span class="re0">$data</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> ? <span class="re0">$data</span> <span class="sy0">=</span> <span class="re0">$cacheData</span> <span class="sy0">:</span> writeCache<span class="br0">&#40;</span><span class="re0">$data</span><span class="sy0">,</span> <span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span>
    <span class="re0">$mresult</span> <span class="sy0">=</span> readCache<span class="br0">&#40;</span><span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="kw1">echo</span> <a href="http://www.php.net/json_encode"><span class="kw3">json_encode</span></a><span class="br0">&#40;</span><span class="re0">$mresult</span><span class="br0">&#41;</span><span class="sy0">;</span>
<a href="http://www.php.net/flush"><span class="kw3">flush</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>In the above code, we based on the value of &#8216;<em>$mread_from_cache</em>&#8216; , either read from the database or from the cache data. I&#8217;ve got a simple query for illustration. It may not be the case in an application. Here we have used two user defined function, one to write and other to read from the cache. The below is the code for them.</p>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://markish.in/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">function</span> writeCache<span class="br0">&#40;</span><span class="re0">$data</span><span class="sy0">,</span> <span class="re0">$cacheFile</span><span class="sy0">=</span><span class="st_h">'default_cache.txt'</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$fp</span> <span class="sy0">=</span> <a href="http://www.php.net/fopen"><span class="kw3">fopen</span></a><span class="br0">&#40;</span><span class="re0">$cacheFile</span><span class="sy0">,</span> <span class="st_h">'w'</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/trigger_error"><span class="kw3">trigger_error</span></a><span class="br0">&#40;</span><span class="st_h">'Error opening cache file'</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/exit"><span class="kw3">exit</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">    <span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/flock"><span class="kw3">flock</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="sy0">,</span> LOCK_EX<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/trigger_error"><span class="kw3">trigger_error</span></a><span class="br0">&#40;</span><span class="st_h">'Unable to lock file'</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/exit"><span class="kw3">exit</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span></div></li><li class="li2"><div class="de2">    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/fwrite"><span class="kw3">fwrite</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="sy0">,</span> <a href="http://www.php.net/serialize"><span class="kw3">serialize</span></a><span class="br0">&#40;</span><span class="re0">$data</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/trigger_error"><span class="kw3">trigger_error</span></a><span class="br0">&#40;</span><span class="st_h">'Error writing to cache file'</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/exit"><span class="kw3">exit</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">    <a href="http://www.php.net/flock"><span class="kw3">flock</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="sy0">,</span> LOCK_UN<span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">    <a href="http://www.php.net/fclose"><span class="kw3">fclose</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw2">function</span> readCache<span class="br0">&#40;</span><span class="re0">$cacheFile</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/file_exists"><span class="kw3">file_exists</span></a><span class="br0">&#40;</span><span class="re0">$cacheFile</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li2"><div class="de2">        <span class="kw1">return</span> <span class="st_h">''</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">return</span> <a href="http://www.php.net/unserialize"><span class="kw3">unserialize</span></a><span class="br0">&#40;</span><a href="http://www.php.net/file_get_contents"><span class="kw3">file_get_contents</span></a><span class="br0">&#40;</span><span class="re0">$cacheFile</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div></div>
<p>This is a very basic implementation of record set caching. This can be improved based on the application demand and other load factors. We&#8217;ve taken a more procedural approach in this code. In the next article I&#8217;d talk about handling the same in a more object oriented approach.</p>
<p>Do share your comments and suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2010/12/implementing-output-caching-in-php-solve-perfomance-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter new UI – What is there..</title>
		<link>http://markish.in/2010/09/twitter-new-ui-what-is-there-and-not/</link>
		<comments>http://markish.in/2010/09/twitter-new-ui-what-is-there-and-not/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 04:15:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Twitter New UI]]></category>

		<guid isPermaLink="false">http://markish.in/?p=151</guid>
		<description><![CDATA[Finally It&#8217;s arrived, the new UI for twitter. It&#8217;s more than 2 years looking into the same UI with no life other than the ever moving tweets on the screen. On Tuesday, the CEO unveiled the new user interface. Twitter claims the new UI to be more advanced and improved in terms of usability. It [...]]]></description>
			<content:encoded><![CDATA[<p>Finally It&#8217;s arrived, the new UI for twitter. It&#8217;s more than 2 years looking into the same UI with no life other than the ever moving tweets on the screen. On Tuesday, the CEO unveiled the new user interface. Twitter claims the new UI to be more advanced and improved in terms of usability. It also believes, this move would bring in lot of traffic / visitors to twitter.com.<span id="more-151"></span></p>
<p>Today morning, I had a look at the new UI finally. It looks new and fresh. Below are the few notable features.<strong> </strong></p>
<p><strong>Two column layout</strong></p>
<p><strong> </strong></p>
<div id="attachment_142" class="wp-caption aligncenter" style="width: 310px"><strong><strong><a href="http://markish.in/wp-content/uploads/2010/09/twitter_home.png"><img class="size-medium wp-image-142" title="Twitter Home page" src="http://markish.in/wp-content/uploads/2010/09/twitter_home-300x168.png" alt="Twitter Home page" width="300" height="168" /></a></strong></strong><p class="wp-caption-text">Twitter Home page</p></div>
<p><strong> </strong>The home page now has the two column layout. The left pane has the usual stuff &#8211; the chain of tweets. The right pane / details pane is the new one. Twitter also recognizes the type of content your tweet has. It&#8217;s pretty intelligent now! Click on a tweet in the left column, and the detail pane has lot of options for the same and it allows  interaction with the content of that tweet as well. What is displayed in the detail pane depends on the nature of the tweet:</p>
<ul>
<li><strong>Videos:</strong> If the tweet contains a link to a video from sites such as YouTube, Vimeo and USTREAM, that video plays in the detail pane. This is cool feature but never know how much load twitter can handle on this. Already we&#8217;re used to &#8220;Twitter over capacity&#8221; screen&#8230;</li>
<li><strong>Maps:</strong> If the tweet is a check-in via services such as foursquare, the detail pane displays a map.</li>
<li>Pictures:  If the tweet includes a link to a picture posted using services such as Flickr, DailyBooth, Twitpic  and DeviantArt, that image appears in the detail pane.</li>
<li><strong>Hashtags:</strong> If you click on a hashtag within a tweet, the detail pane conveys up-to-the-moment search results.</li>
<li><strong>Products:</strong> A tweet containing a link to a product on Etsy or other select eCommerce sites will cause a product image to display in the detail pane. I feel twitter is going to build some revenue model around this.</li>
<li><strong>Replies:</strong> A small icon appears in tweets whenever one Twitterer responds to another.  Click the arrow and the prior conversation is presented within the detail pane.</li>
</ul>
<div id="attachment_143" class="wp-caption aligncenter" style="width: 310px"><a href="http://markish.in/wp-content/uploads/2010/09/twitter_rpane.png"><img class="size-medium wp-image-143" title="Twitter Detail Pane" src="http://markish.in/wp-content/uploads/2010/09/twitter_rpane-300x168.png" alt="Twitter Detail Pane" width="300" height="168" /></a><p class="wp-caption-text">Twitter Detail Pane</p></div>
<p><strong> Better Profile Overview</strong></p>
<p>With lot of space on the right pane, Twitter has made use of it by putting images of your &#8216;followers&#8217; and &#8216;following&#8217; ( 7 each) and Listed and favorites. Still lot of space is available. Hopefully, they may come out with google like &#8216;ads&#8217; on the right pane in the near future&#8230;</p>
<p><strong>What is Missing</strong> ?</p>
<p>All said and done, I&#8217;s expecting bit more from Twitter this time. The following are missing or I missed noticing them.</p>
<ul>
<li><strong>Revenue Model</strong>: This is the major topic of debate from the day one Twitter become popular. I&#8217;s expecting something would be rolled out with this atleaset. But still it&#8217;s missing big time. The right pane / detail pane is the place which may be used as placeholder for sponsored ads in near future.</li>
</ul>
<ul>
<li><strong>Performance: </strong>Again I don&#8217;t see any great improvement in loading time and performance of the site as a whole.</li>
</ul>
<ul>
<li><strong>Priority:</strong> With Google introducing Priority Inbox, and twitter identifying the content of the tweet, I&#8217;s expecting something like priority in the tweets.</li>
</ul>
<ul>
<li><strong>More than Text:</strong> I&#8217;s expecting Twitter to allow image / video uploads directly from Twitter web Interface like Google Buzz and Yahoo MeMe. May be Twitter still wants to keep them simple and smart..!</li>
</ul>
<p><strong>Glitches</strong></p>
<p>The new user interface is still having lot of issues and cross browser compatibility issues. The background images / themes the users have been using would become void and need to be changed immediately.</p>
<div id="attachment_144" class="wp-caption aligncenter" style="width: 310px"><a href="http://markish.in/wp-content/uploads/2010/09/twitter_issue_wat.png"><img class="size-medium wp-image-144" title="What is happening behind the Embedded Video" src="http://markish.in/wp-content/uploads/2010/09/twitter_issue_wat-300x168.png" alt="What is happening behind the Embedded Video" width="300" height="168" /></a><p class="wp-caption-text">Happening behind the Embedded Video</p></div>
<p>Twitter new user interface promises &#8216;Easier Interaction&#8217; and  &#8216;More Discovery&#8217;. While any change in interface can cause complaints from long-time users, I believe the new Twitter will meet with strong user acceptance.  As the new design is rolled out, users have the opportunity to accept it or return to the original design, but I think many will embrace the intuitive new functionality. Share your views and comments on Twitter new UI here.</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2010/09/twitter-new-ui-what-is-there-and-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Offline Blog Editor for Ubuntu</title>
		<link>http://markish.in/2010/06/offline-blog-editor-for-ubuntu/</link>
		<comments>http://markish.in/2010/06/offline-blog-editor-for-ubuntu/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 19:29:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Bleezer]]></category>
		<category><![CDATA[Offline Blog Editor for Ubuntu]]></category>
		<category><![CDATA[Ubuntu Blogging]]></category>

		<guid isPermaLink="false">http://markish.in/2010/06/offline-blog-editor-for-ubuntu/</guid>
		<description><![CDATA[I&#8217;s just struggling to get a good replacement for Word 2007 as my offline blog editor in Ubuntu. I googled and found several alternatives. Finally, I settled down with the Bleezer. I just thought let me write about the same here as the first post from Bleezer. Bleezer is developed in Java and hence is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;s just struggling to get a good replacement for Word 2007 as my offline blog editor in Ubuntu. I googled and found several alternatives. Finally, I settled down with the Bleezer. I just thought let me write about the same here as the first post from Bleezer. <span id="more-128"></span></p>
<p>Bleezer is developed in Java and hence is platform independent. It&#8217;s neat and pretty. Though not colourful like MS word xxx, It serves the purpose calmly. It&#8217;s available at <a title="Bleezer" href="http://alchemii.net/bleezer/" target="_blank">http://alchemii.net/bleezer/</a> It supports all the major blog engines &#8211; Blogger, WordPress (a special thanks from my side&#8230; <img src='http://markish.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ), typepad, drupal.</p>
<p>Once you download, you have to run the bleezer.jar in the archive. Make sure to change it&#8217;s permission to allow execution as a program. You should have Java already installed in your machine. Just launch it, you are in the new world of blogging in Ubuntu.</p>
<p>Just edit the preferences, add an account in the dialogue as shown below</p>
<p><img title="Preferences" src="http://markish.in/wp-content/uploads/2010/06/Screenshot-Preferences1.png" border="0" alt="Preferences" width="500" height="250" align="center" /></p>
<p>The features I like in this are</p>
<ul>
<li>Enabling me to save the Posts as drafts</li>
<li>Support for multiple accounts, so that it&#8217;s the one point of my blogging</li>
<li>Gives support for adding tags to the Posts</li>
<li>It provides a normal view along with the HTML view in tabs</li>
<li>It provides preview as well &#8211; quite easy to see what you post</li>
<li>Fairly decent WYSIWYG editor.</li>
<li>Supports editing of published Posts as well</li>
</ul>
<p>I&#8217;d say Bleezer worth a try. Comments welcome</p>
<div class="bleezer-tags:Offline Blog Editor, Blog in Ubuntu, Bleezer">
<p style="font-size: 10px; text-align: right;">Technorati: <a rel="tag" href="http://www.technorati.com/tag/Offline+Blog+Editor">Offline Blog Editor</a> <a rel="tag" href="http://www.technorati.com/tag/Blog+in+Ubuntu">Blog in Ubuntu</a> <a rel="tag" href="http://www.technorati.com/tag/Bleezer">Bleezer</a></p>
<p style="font-size: 10px; text-align: right;">Tags <a rel="tag" href="http://www.technorati.com/tag/Offline+Blog+Editor">Offline Blog Editor</a> <a rel="tag" href="http://www.technorati.com/tag/Blog+in+Ubuntu">Blog in Ubuntu</a> <a rel="tag" href="http://www.technorati.com/tag/Bleezer">Bleezer</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2010/06/offline-blog-editor-for-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It is my IP.com&#8230;.!</title>
		<link>http://markish.in/2009/02/it-is-my-ipcom/</link>
		<comments>http://markish.in/2009/02/it-is-my-ipcom/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 09:45:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Find your IP]]></category>
		<category><![CDATA[IP Lookup]]></category>
		<category><![CDATA[It is my IP]]></category>
		<category><![CDATA[Markish]]></category>
		<category><![CDATA[Own IP address]]></category>

		<guid isPermaLink="false">http://markishonline.com/?p=101</guid>
		<description><![CDATA[Again it&#8217;s been a long time&#8230;! Somehow I couldn&#8217;t manage to squeeze time to write&#8230; This weekend just surfing the net, I landed up in domain.com my favorite domain registrar. As usual I searched for all funny names. It&#8217;s been my practice or I&#8217;d say a way of killing time. Finally I searched for &#8216;itismyip&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Again it&#8217;s been a long time&#8230;! Somehow I couldn&#8217;t manage to squeeze time to write&#8230; This weekend just surfing the net, I landed up in domain.com my favorite domain registrar. As usual I searched for all funny names. It&#8217;s been my practice or I&#8217;d say a way of killing time. Finally I searched for &#8216;itismyip&#8217; I got it&#8230;! it again made me poorer by another 10 USD. I just wrote a small script to give the IP of the visitor to this site&#8230; <span id="more-101"></span></p>
<p>I wanted this site ( single page) to load faster without any complications. I&#8217;ve just put the IP of the visitor and a small JS to copy the IP to your clipboard.</p>
<div id="attachment_102" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-102" title="itismyip.com" src="http://markishonline.com/wp-content/uploads/2009/02/itismyip-300x225.gif" alt="Snapshot of ItismyIP.com" width="300" height="225" /><p class="wp-caption-text">Snapshot of ItismyIP.com</p></div>
<p>I think,  I&#8217;m far better this time in choosing my domain name..I&#8217;ve seen around 100 hits already in a day without much doing from my side. So I added my adsense today to it.. Hope it gives me back the 10 USD within this year.</p>
<p>I know there are &#8216;n&#8217; number of popular sites giving this service. But I&#8217;m thinking of something different that would help me have my share of traffic. Any suggestions welcome in this regard&#8230;!</p>
<p>Have a <a href="http://itismyip.com" target="_blank">look here</a> and do share your comments..</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2009/02/it-is-my-ipcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making my YouTube Downloader cooler…!</title>
		<link>http://markish.in/2008/09/making-my-youtube-downloader-cooler%e2%80%a6/</link>
		<comments>http://markish.in/2008/09/making-my-youtube-downloader-cooler%e2%80%a6/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 14:07:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code for Fun]]></category>
		<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[Download Videos]]></category>
		<category><![CDATA[Download Youtube Video]]></category>
		<category><![CDATA[Markish]]></category>
		<category><![CDATA[Search and download videos]]></category>
		<category><![CDATA[Vbscript]]></category>

		<guid isPermaLink="false">http://markishonline.com/2008/09/25/making-my-youtube-downloader-cooler%e2%80%a6/</guid>
		<description><![CDATA[    Yesterday, I posted how to download videos from YouTube using the VB script. Even I downloaded some videos by putting the video links to a text file and calling the script with &#8216;F&#8217; switch. But I&#8217;m a lazy guy to prepare the text file with URLs now. I thought I&#8217;ll leave this task to the [...]]]></description>
			<content:encoded><![CDATA[<p>    Yesterday, I posted how to download videos from YouTube using the <a href="http://markishonline.com/2008/09/24/download-youtube-videos-easily%e2%80%a6/">VB script</a>. Even I downloaded some videos by putting the video links to a text file and calling the script with &#8216;F&#8217; switch. But I&#8217;m a lazy guy to prepare the text file with URLs now. I thought I&#8217;ll leave this task to the script itself. I added some code to make the script bit more intelligent. It takes the keywords from you, searches the YouTube for the related videos and downloads them. Sounds cool… <span style="font-family:Wingdings">J</span>
	</p>
<p><span id="more-90"></span></p>
<p>I added one more switch to my script &#8216;S&#8217;. It accepts the keywords and searches the YouTube for related videos.  Now my scripts usage is like
</p>
<p style="text-align: center"><img src="http://markish.in/wp-content/uploads/2008/09/092508-1403-makingmyyou1.png" alt=""/>
	</p>
<p>This helps a lot for me now. Just I trigger something like
</p>
<p style="margin-left: 72pt"><span style="color:#00b050">C:\Videos&gt; Cscript  yt_dl.vbs S 10 Sachin Warne<br />
</span></p>
<p style="margin-left: 72pt"><span style="color:#00b050">It downloads 10 videos related to Sachin &amp; Warne from the YouTube.<br />
</span></p>
<p>Hope this improvement helps. The only limitation (atleast that I&#8217;ve noticed) is it can download the maximum number of 20 related videos. Please do share your comments.
</p>
<p>The modified version can be downloaded <a href="http://www.markishonline.com/downloads/yt_dl_1.1.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2008/09/making-my-youtube-downloader-cooler%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download YouTube Videos easily…</title>
		<link>http://markish.in/2008/09/download-youtube-videos-easily%e2%80%a6/</link>
		<comments>http://markish.in/2008/09/download-youtube-videos-easily%e2%80%a6/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 07:03:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code for Fun]]></category>
		<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[Download list of Youtube Videos]]></category>
		<category><![CDATA[Download Youtube Video]]></category>
		<category><![CDATA[Markish]]></category>
		<category><![CDATA[Script to download videos]]></category>
		<category><![CDATA[XMLHttp]]></category>

		<guid isPermaLink="false">http://markishonline.com/2008/09/24/download-youtube-videos-easily%e2%80%a6/</guid>
		<description><![CDATA[    YouTube, what I need to say more on this website? Anyhow for those who are unaware of it (if any!), this website provides streaming videos to the visitors. Anyone can upload and share their videos. Many number of times when watching a video, we love it to have offline as well. We search for the [...]]]></description>
			<content:encoded><![CDATA[<p>    YouTube, what I need to say more on this website? Anyhow for those who are unaware of it (if any!), this website provides streaming videos to the visitors. Anyone can upload and share their videos. Many number of times when watching a video, we love it to have offline as well. We search for the &#8216;download video&#8217; link in the page. Oops, you won&#8217;t find it. YouTube supports only streaming of videos.
</p>
<p><span id="more-85"></span></p>
<p>    You need to be online to watch a video from YouTube. It also supports buffering. That&#8217;s the video can be buffered when connected to the internet and watched offline. (This has helped me to watch so many videos when I&#8217;m not connected). But the pain part is if you close the browser, the buffered content is lost. You again have to connect to internet to watch the same video clip.
</p>
<p>    Why not we download it and have it offline? I googled and found some websites that provide this service. You tell them the video you need, they give you the download link after sometime. You can download it. But you get this service at the cost of advertisements and annoying popups. There is a plug-in available for Firefox users. Still IE users don&#8217;t have any options. All I wanted was to download many video clips in a single shot. The only option was to code myself!
</p>
<p>    I chose VBscript as I don&#8217;t need any more software installation necessary for this to run. Almost all the Windows comes with the scripting support. Hence I can run my VBscript anywhere even in the Cyber-cafes.  It supports two switches currently. Either I can directly supply the list of URLs of videos I want when I&#8217;m calling it or I can provide a text file with list of URLs. Something like
</p>
<p style="text-align: center"><img src="http://markish.in/wp-content/uploads/2008/09/092408-0700-downloadyou1.png" alt=""/>
	</p>
<p>When you call the script with &#8216;U&#8217; switch you can provide the URLs directly. Something like
</p>
<p><span style="color:#00b050"><em>YT_DL.VBS U http://www.youtube.com/watch?v=kMYw8SodMWQ, <a href="http://www.youtube.com/watch?v=hRMyR8BJ74A">http://www.youtube.com/watch?v=hRMyR8BJ74A</a><br />
			</em></span></p>
<p>When you call the script with &#8216;F&#8217; switch you can just provide a path to text file which contains the list of URLs<span style="color:#00b050"><br />
		</span></p>
<p><span style="color:#00b050"><em>    YT_DL.VBS F url_list.txt<br />
</em></span></p>
<p><em>    </em>The main advantage of the script is that you can just create a list of videos you want and put in a text file and pass it on to the script with &#8216;F&#8217; switch. It downloads and saves them in the same folder with the title of the videos as the file names. You are done with a single command. No waiting, No popup and it can run on your background. You need not even bother about it.
</p>
<p>    <span style="color:red">Please note</span>, when you running this script for the first time, you will (most probably) get an error message stating, &#8220;msxml3.dll: Access is denied&#8221;. Don&#8217;t worry, it&#8217;s a security catch. You need to add <a href="http://youtube.com">http://youtube.com</a> to your list of trusted sites. For this go to the &#8216;Internet options <span style="font-family:Wingdings">à</span>Security tab<span style="font-family:Wingdings">à</span> select Trusted and click the &#8216;Sites..&#8217; button. There you add <a href="http://youtube.com">http://youtube.com</a>. Now run your script. You won&#8217;t have any issues.
</p>
<p>    Once downloaded, you can play those .FLV files using FLV players available over the web for free. You can download one from <a href="http://www.applian.com/flvplayer/">here</a>. Hope you find this script useful. You can use it and modify it in the way you want. If you have any issues or suggestions, please let me know. Have fun and do share your comments here.
</p>
<p>The script can be downloaded <a href="http://www.markishonline.com/downloads/YT_dl.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2008/09/download-youtube-videos-easily%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Creating an Enterprise Mashup…!</title>
		<link>http://markish.in/2008/09/creating-an-enterprise-mashup%e2%80%a6/</link>
		<comments>http://markish.in/2008/09/creating-an-enterprise-mashup%e2%80%a6/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 08:52:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Creating Mashup]]></category>
		<category><![CDATA[Enterprise Mashup]]></category>
		<category><![CDATA[SQL to XML]]></category>

		<guid isPermaLink="false">http://markishonline.com/2008/09/03/creating-an-enterprise-mashup%e2%80%a6/</guid>
		<description><![CDATA[    I&#8217;s bit held up with other tasks, so was a bit long break in my writing. Now I&#8217;ll continue on what I showed in my previous post. Today we&#8217;ll see how a Mashup can be used to give powerful reporting feature. I&#8217;ll discuss about the charting of data from an enterprise source. Let&#8217;s say we&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>    I&#8217;s bit held up with other tasks, so was a bit long break in my writing. Now I&#8217;ll continue on what I showed in my <a href="http://markishonline.com/2008/08/14/creating-a-simple-mashup/">previous post</a>. Today we&#8217;ll see how a Mashup can be used to give powerful reporting feature. I&#8217;ll discuss about the charting of data from an enterprise source. Let&#8217;s say we&#8217;ve a data something like the following table<span id="more-68"></span> </p>
<p style="text-align: center"><img src="http://markish.in/wp-content/uploads/2008/09/090308-0851-creatingane1.png" alt="" /></p>
<p>    Here it depicts the total gross and net sales value of the organization for different category of product and services (ERP &amp; SERVICE here) for different quarters of the year. Let&#8217;s say the ERP system of this organization exposes and API that gives this data in some XML format. For example <a href="http://markishonline.com/downloads/sql_xml.php">check this XML</a>. Something like below</p>
<p style="text-align: center"><img src="http://markish.in/wp-content/uploads/2008/09/090308-0851-creatingane2.png" alt="" /></p>
<p>    Now we&#8217;ve the charting APIs from Google (what they don&#8217;t provide man….. <span style="font-family: Wingdings;">J</span> ). It provides a powerful set of APIs with lots of options that can produce different type of charts. Please check the <a href="http://code.google.com/apis/chart">Google Charts</a> for further details on the API. Now we have the different services available – viz Data provider and the Chart creator. It&#8217;s now time to Mashup them into a more useful UI. I&#8217;ve read the data from the xml using an xml parser and fed the same data to the chart API from Google. What we get is a beautiful graph plotted against our enterprise data.</p>
<p style="text-align: center"><img src="http://markish.in/wp-content/uploads/2008/09/090308-0851-creatingane3.png" alt="" /></p>
<p>    It&#8217;s quite simple with Mashup. Otherwise, we need to run our charting machine which is a overhead in many ways. The above chart depicts the sales in millions (y axis) and against the various quarters (x-axis). The same data can be plotted against a map to depict the geographical distribution of the sales as I showed in my last post. For creating a Mashup there is no limits. It completely depends on the creativity and the requirement of the situation.     There are N number of services and more number of service providers available over the web. Hence the theoretical limit of Mashups is infinite. Out of Infinite probabilities possible, lies the base and secret for the interactive and efficient UI which form the basics of Web 2.0.</p>
<p>The complete source code of the above example can be downloaded <a href="http://markishonline.com/downloads/emashup.zip">here</a>. For using this, just unzip the archive into your webserver and set the parameters in the conf.mysql.php and use the qsales_table_def.sql file to create the table. To see this in action check <a href="http://markishonline.com/downloads/qsales.php">this link</a>. Hope this gives a better idea of what a Mashup can do. Share with me your views on this.</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2008/09/creating-an-enterprise-mashup%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a simple Mashup..!</title>
		<link>http://markish.in/2008/08/creating-a-simple-mashup/</link>
		<comments>http://markish.in/2008/08/creating-a-simple-mashup/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 08:52:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adding Google map to Wordpress]]></category>
		<category><![CDATA[Markish]]></category>

		<guid isPermaLink="false">http://markishonline.com/2008/08/14/creating-a-simple-mashup/</guid>
		<description><![CDATA[    As said in my previous post, Mashups are very powerful user-interface when handled with little common sense and creativity. In this post I&#8217;ll try to give an overview of how an Mashup (pretty simple Mashup… J ) can be created. Though this is going to be simple, the logic behind this is same for all [...]]]></description>
			<content:encoded><![CDATA[<p>    As said in my <a href="http://markishonline.com/2008/08/12/what-is-a-mashup/">previous post</a>, Mashups are very powerful user-interface when handled with little common sense and creativity. In this post I&#8217;ll try to give an overview of how an Mashup (pretty simple Mashup… <span style="font-family:Wingdings">J</span> ) can be created. Though this is going to be simple, the logic behind this is same for all Mashups..!
</p>
<p><span id="more-59"></span></p>
<p>Writing any Mashup involves the following steps /actions
</p>
<ul>
<li>Deciding what to write (choose a topic)
</li>
<li>Deciding the data stores (service providers like Google, Amazon, Yahoo, Hostinfo  &#8230;etc)
</li>
<li>Look for necessary APIs exposed them
</li>
</ul>
<p>Once you are at this point, you can really &#8216;Mashup &#8216; you data to provide your end user a creative user-interface. Now, I&#8217;ll take an example and go through the above steps and finally come up with a Mashup widget. I&#8217;d try to create a &#8216;Geo-IP-Map&#8217;. It&#8217;d show the end-user position (place) on the map. It can be embedded on any web page. I&#8217;ve just embedded it in my own sidebar.
</p>
<p style="text-align: center"><img src="http://markish.in/wp-content/uploads/2008/08/081408-0852-creatingasi11.png" alt=""/>
	</p>
<p>For producing this I need the following data
</p>
<ul>
<li>The Map&#8217;s base data
</li>
<li>The latitude and longitude of users&#8217; present location
</li>
<li>The City / Country / Geographical location of the user
</li>
<li>The IP of the end-user
</li>
</ul>
<p>I&#8217;ve given the data in the top-down order. Now let&#8217;s decide the data store provider for each of the data required
</p>
<div style="text-align: center">
<table style="border-collapse:collapse" border="0">
<colgroup>
<col style="width:166px"/>
<col style="width:144px"/>
<col style="width:488px"/></colgroup>
<tbody valign="top">
<tr>
<td colspan=2 style="padding-left: 9px; padding-right: 9px; border-top:  solid yellow 1.5pt; border-left:  solid yellow 1.5pt; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p><strong>Data</strong> </p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  solid yellow 1.5pt; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p><strong>Data Provider</strong> </p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  solid yellow 1.5pt; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p><strong>Comments on APIs exposed</strong></p>
</td>
</tr>
<tr>
<td colspan="2" style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  solid yellow 1.5pt; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p>IP address </p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p>Web host </p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p style="text-align: justify">User&#8217;s IP address can be easily obtained from the server on which your site is hosted using small script. Something like $myip=$_SERVER['REMOTE_ADDR']; will do in PHP</p>
</td>
</tr>
<tr>
<td colspan="2" style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  solid yellow 1.5pt; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p>Geographic Location </p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p>HostIP </p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p style="text-align: justify">Once you have the IP address, you can get the geographic location of the user from HostIP. They provide more than one API for different formats</p>
</td>
</tr>
<tr>
<td colspan="2" style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  solid yellow 1.5pt; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p>Latitude &#038; Longitude </p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p>Google Maps</p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p style="text-align: justify">Once you have the Physical location from HostIP, you can resolve them into the actual geospatial data using the APIs provided by Google maps</p>
</td>
</tr>
<tr style="height: 16px">
<td colspan="2" style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  solid yellow 1.5pt; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p>Map base data </p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p>Google Maps</p>
</td>
<td style="padding-left: 9px; padding-right: 9px; border-top:  none; border-left:  none; border-bottom:  solid yellow 1.5pt; border-right:  solid yellow 1.5pt">
<p style="text-align: justify">Google Maps provide a wide range of APIs for producing the Maps and they do support, custom maps.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p><!--adsensestart--></p>
<p>
 </p>
<p>Now you have the API and the data store ready. Both of the above data stores I&#8217;ve used require you to register with them for receiving the API key. This requirement varies with the data providers. Now you have this ready, you can just put things in place and provide a creative UI to your users. I used PHP to code my GEO-IP-Map. I&#8217;ve added this Mashup maplet to my own blog. You can see it in action in the sidebar itself. After all it is simple and cool…!
</p>
<p>If you are interested in this code, you can download the sample from <a href="http://markishonline.com/downloads/gmaps.zip">here</a>. I&#8217;m not a PHP programmer, hence you may find this very crude. You can modify it to your taste and convenience. Do keep me posted.
</p>
<p>I&#8217;ll write more on Mashups in my next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2008/08/creating-a-simple-mashup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What is a Mashup..?</title>
		<link>http://markish.in/2008/08/what-is-a-mashup/</link>
		<comments>http://markish.in/2008/08/what-is-a-mashup/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 09:06:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Markish]]></category>
		<category><![CDATA[Mashup]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://markishonline.com/2008/08/12/what-is-a-mashup/</guid>
		<description><![CDATA[    Heard this buzz word, If yes, you can rate yourself &#8216;up-to-date geek&#8217;. If not, read on, still in the end of this post you can rate yourself so. Even this post is late by quite some time months since this word came into prominence. Before talking about Mashup, I&#8217;d take an analogy to explain.     Probably [...]]]></description>
			<content:encoded><![CDATA[<p>    Heard this buzz word, If yes, you can rate yourself &#8216;up-to-date geek&#8217;. If not, read on, still in the end of this post you can rate yourself so. Even this post is late by quite some time months since this word came into prominence. Before talking about Mashup, I&#8217;d take an analogy to explain.</p>
<p><span id="more-53"></span></p>
<p>    Probably most of us are aware what an Operating System (OS) is and what it mean to the overlying applications. Probably it exposes numerous APIs to interact with the underlying hardware resources. The overlying applications just call the APIs to access the Hardware resources. But for the OS in place there, programming would have been a nightmare even now. A simple explanation would be</p>
<p style="text-align: center"><img src="http://markish.in/wp-content/uploads/2008/08/081208-0906-whatisamash1.png" alt="" /></p>
<p>    In the above picture, it&#8217;s clear that, the user applications just make use of the APIs provided by the OS to get access to whatever resources it want to access. But for this infrastructure, it&#8217;s really tough to have even a small application program running and we&#8217;d not have the comfort of so many high-level programming languages.</p>
<p>    Now coming back to the original discussion, Mashup or Mashup application make use of the similar infrastructure available over the internet. They make use of the services from different websites / service providers and provide altogether completely different service which is more useful and powerful in the end-user perspective. Something like</p>
<p style="text-align: center"><img src="http://markish.in/wp-content/uploads/2008/08/081208-0906-whatisamash2.png" alt="" /></p>
<p>    A Mashup application or website may be defined as &#8220;<em>An application that consumes the output of more than one service and &#8216;mash&#8217; them up to provide a new service to the end user&#8221;</em>. Let&#8217;s discuss a typical example. When we impose the data from <a href="http://weather.com">http://weather.com</a> over the map data provided by Google maps, we get a altogether rich user interface displaying the weather of a particular region along with the forecasts. Something like<a href="http://www.weatherbonk.com">http://www.weatherbonk.com</a>.</p>
<p>Now Mashups have opened a new set of applications that can provide the end user the flexibility and the benefits of more than one service providers. There are hundreds of Mashups already in place. Mashups can also find a very big market in the Enterprise world as well. In my next post I&#8217;ll discuss something interesting Mashups and procedure to create a new Mashup.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2008/08/what-is-a-mashup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

