<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0IESH87eip7ImA9WhRQGU4.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346</id><updated>2011-12-15T12:45:09.102+06:00</updated><category term="UNIX" /><category term="Mobile Phone Application Development" /><category term="Python" /><category term="jQuery" /><category term="MySQL" /><category term="javascript" /><category term="PHP Operators" /><category term="SQL" /><category term="firebug" /><category term="facebook api" /><category term="C# Timer Control" /><category term="XML" /><category term="Perl" /><category term="Rubyful Soup" /><category term="Windows" /><category term="alexa api is not free" /><category term="Web Technology" /><category term="C#" /><category term="PHP" /><category term="Beautiful Soup" /><category term="welcome" /><category term="Ruby" /><category term="Linux" /><category term="Objective-C" /><category term="UnxUtil" /><category term="CGI" /><category term="facebook application" /><category term="freelance" /><category term="strtok" /><category term=".NET" /><title>High Speed Software Development</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.subeen.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.subeen.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>30</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/HighSpeedSoftwareDevelopment" /><feedburner:info uri="highspeedsoftwaredevelopment" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D0ENQXg4cSp7ImA9WhdQGUo.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-8206524833560027625</id><published>2011-08-22T07:12:00.001+06:00</published><updated>2011-08-22T07:14:50.639+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-22T07:14:50.639+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook application" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery" /><title>AJAX Call Problem in Facebook application http / https issue</title><content type="html">Today I got report from one of my client (for whom I have developed a facebook app recently) that in some browsers the app is not working. Nothing happens when a button is clicked (a facebook share dialog should appear)! So, I investigated the problem. I found that when the button is clicked, the URL used for AJAX call starts with https and in some browsers (example: Chrome) it was giving a javascript error. This is because the application started with http there where in some other facebook account, it start with https. So I handled the issue with the following code in my jQuery function that is called when the button is clicked:&lt;br /&gt;
&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; var protocol = $(location).attr("protocol");  
 var loadUrl = 'http://secure.example.com/server/serve.php';  
 if (protocol == 'https:') {  
     loadUrl = 'https://secure.example.com/server/serve.php';  
 }  
&lt;/code&gt;&lt;/pre&gt;And it solved the problem!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-8206524833560027625?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1pS4WlYFdBWSTzjfyfHz-dM6i1A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1pS4WlYFdBWSTzjfyfHz-dM6i1A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1pS4WlYFdBWSTzjfyfHz-dM6i1A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1pS4WlYFdBWSTzjfyfHz-dM6i1A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/l03SUdN-qxY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/8206524833560027625/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=8206524833560027625" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/8206524833560027625?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/8206524833560027625?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/l03SUdN-qxY/ajax-call-problem-in-facebook.html" title="AJAX Call Problem in Facebook application http / https issue" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2011/08/ajax-call-problem-in-facebook.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8AQXo8eip7ImA9WhdSF0Q.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-4330750298179534845</id><published>2011-07-28T00:20:00.000+06:00</published><updated>2011-07-28T00:20:40.472+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-28T00:20:40.472+06:00</app:edited><title>I am back</title><content type="html">It's been a while I am not writing in this blog. But I frequently get into problems and find solutions searching Google, so I think I should write down my problems and solutions, at least the link. Sometimes I also read interesting blog posts about programming or software development or something else that is not worth sharing in facebook, so I shall share those links also with my comments.&lt;br /&gt;
&lt;br /&gt;
Stay tuned. :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-4330750298179534845?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/V_exqD7PLSPc5LnIzC0u8WBX4M4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/V_exqD7PLSPc5LnIzC0u8WBX4M4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/V_exqD7PLSPc5LnIzC0u8WBX4M4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/V_exqD7PLSPc5LnIzC0u8WBX4M4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/Aw1B99nGWIo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/4330750298179534845/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=4330750298179534845" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/4330750298179534845?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/4330750298179534845?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/Aw1B99nGWIo/i-am-back.html" title="I am back" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2011/07/i-am-back.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUFSH49fSp7ImA9Wx5XGE8.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-3723674843139822685</id><published>2010-09-18T21:50:00.000+06:00</published><updated>2010-09-18T22:10:19.065+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-18T22:10:19.065+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="alexa api is not free" /><title>PHP Script to get Alexa rank using Alexa API</title><content type="html">Here is an example PHP code that uses Alexa API to get Alexa rank. Note that for Alexa API, you need to purchase keys, as it's not free. Though it's not free cost is very low.&lt;br /&gt;&lt;br /&gt;define("ACCESS_KEY_ID", "put key here"); &lt;br /&gt;define("SECRET_ACCESS_KEY", "put key here");&lt;br /&gt;define("SERVICE_ENDPOINT", "http://awis.amazonaws.com?");&lt;br /&gt;&lt;br /&gt;define("ACTION", "UrlInfo");&lt;br /&gt;define("RESPONSE_GROUP", "Rank, LinksInCount");&lt;br /&gt;&lt;br /&gt;$results = array();&lt;br /&gt;&lt;br /&gt;function get_alexa_rank($site_url)&lt;br /&gt;{&lt;br /&gt;    global $results;&lt;br /&gt;    $results = array();&lt;br /&gt;        &lt;br /&gt;    $awis_url = generate_url($site_url);&lt;br /&gt;&lt;br /&gt;    $result = make_http_request($awis_url);&lt;br /&gt;&lt;br /&gt;    // Parse XML and display results&lt;br /&gt;&lt;br /&gt;    $current_tag = "";&lt;br /&gt;&lt;br /&gt;    $xml_parser  =  xml_parser_create("");&lt;br /&gt;    xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);&lt;br /&gt;    xml_set_element_handler($xml_parser, "start_tag", "end_tag");&lt;br /&gt;    xml_set_character_data_handler($xml_parser, "contents");&lt;br /&gt;    xml_parse($xml_parser, $result, true);&lt;br /&gt;    xml_parser_free($xml_parser);&lt;br /&gt;&lt;br /&gt;    return $results['rank']."|".$results['linksincount'];&lt;br /&gt;}   &lt;br /&gt;&lt;br /&gt;function contents($parser, $data) {&lt;br /&gt;    global $current_tag, $results;&lt;br /&gt;    switch ($current_tag) {        &lt;br /&gt;        case "aws:LinksInCount":&lt;br /&gt;                        $results['linksincount'] .=  $data;&lt;br /&gt;                break;&lt;br /&gt;        case "aws:Rank":&lt;br /&gt;                        $results['rank'] .=  $data;&lt;br /&gt;                break;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function start_tag($parser, $name) {&lt;br /&gt;    global $current_tag, $results;&lt;br /&gt;    $current_tag = $name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function end_tag() {&lt;br /&gt;    global $current_tag;&lt;br /&gt;    $current_tag = '';&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Returns the AWS url to get AWIS information for the given site&lt;br /&gt;&lt;br /&gt;function generate_url($site_url) {&lt;br /&gt;        $timestamp =  generate_timestamp();&lt;br /&gt;        $site_enc = urlencode($site_url);&lt;br /&gt;        $timestamp_enc = urlencode($timestamp);&lt;br /&gt;        $signature_enc = urlencode(calculate_RFC2104HMAC(ACTION . $timestamp, SECRET_ACCESS_KEY));&lt;br /&gt;&lt;br /&gt;       return SERVICE_ENDPOINT&lt;br /&gt;        . "AWSAccessKeyId=".ACCESS_KEY_ID&lt;br /&gt;        . "&amp;Action=".ACTION&lt;br /&gt;        . "&amp;ResponseGroup=".RESPONSE_GROUP&lt;br /&gt;        . "&amp;Timestamp=$timestamp_enc"&lt;br /&gt;        . "&amp;Signature=$signature_enc"&lt;br /&gt;        . "&amp;Url=$site_enc";&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Calculate signature using HMAC: http://www.faqs.org/rfcs/rfc2104.html&lt;br /&gt;&lt;br /&gt;function calculate_RFC2104HMAC ($data, $key) {&lt;br /&gt;    return base64_encode (&lt;br /&gt;        pack("H*", sha1((str_pad($key, 64, chr(0x00))&lt;br /&gt;        ^(str_repeat(chr(0x5c), 64))) .&lt;br /&gt;        pack("H*", sha1((str_pad($key, 64, chr(0x00))&lt;br /&gt;        ^(str_repeat(chr(0x36), 64))) . $data))))&lt;br /&gt;     );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Timestamp format: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'&lt;br /&gt;&lt;br /&gt;function generate_timestamp () {&lt;br /&gt;    return gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Make an http request to the specified URL and return the result&lt;br /&gt;&lt;br /&gt;function make_http_request($url){&lt;br /&gt;       $ch = curl_init($url);&lt;br /&gt;       curl_setopt($ch, CURLOPT_TIMEOUT, 4);&lt;br /&gt;       curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);&lt;br /&gt;       $result = curl_exec($ch);&lt;br /&gt;       curl_close($ch);&lt;br /&gt;       return $result;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-3723674843139822685?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ke94nfe6XL_vGMDpujSa_Uzqlyw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ke94nfe6XL_vGMDpujSa_Uzqlyw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ke94nfe6XL_vGMDpujSa_Uzqlyw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ke94nfe6XL_vGMDpujSa_Uzqlyw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/N5xvxrOppxc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/3723674843139822685/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=3723674843139822685" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/3723674843139822685?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/3723674843139822685?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/N5xvxrOppxc/php-script-to-get-alexa-rank-using.html" title="PHP Script to get Alexa rank using Alexa API" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2010/09/php-script-to-get-alexa-rank-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UNQnY-cSp7ImA9WxJaFEU.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-804041834101280442</id><published>2009-08-05T23:13:00.000+07:00</published><updated>2009-08-05T23:21:33.859+07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-05T23:21:33.859+07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="strtok" /><category scheme="http://www.blogger.com/atom/ns#" term="PHP Operators" /><title>strtok in PHP - a common mistake</title><content type="html">&lt;a href="http://php.net/strtok"&gt;strtok&lt;/a&gt;, that splits a string into tokens is a very useful function for the programmers. Here is an example code that shows the use of strtok function to extract integers from a comma separated string.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$list = "1,2,4,10,8,0,20,30,9";&lt;br /&gt;&lt;br /&gt;$token = strtok($list, ",");&lt;br /&gt;while($token)&lt;br /&gt;{&lt;br /&gt;    print $token."\n";&lt;br /&gt;    $token = strtok(",");&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Using the code we get this output:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;4&lt;br /&gt;10&lt;br /&gt;8&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Where are the other four integers? Actually when the value of $token is zero (0) - the sixth integer in the list, while ($token) evaluates to False and the loop is broken there. Lets use while($token != FALSE) instead.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$token = strtok($list, ",");&lt;br /&gt;while($token != FALSE)&lt;br /&gt;{&lt;br /&gt;    print $token."\n";&lt;br /&gt;    $token = strtok(",");&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Still the same output. Oh, the mistake is we used the '!=' operator which tests the equality between $token and FALSE. Here zero (0) is equal to FALSE. A stupid way to avoid the problem is to calculate the length - while(strlen($token)) and it will work definitely! as the length of the string '0' is 1. But best solution (to me) is to use the '!==' operator which means not identical. So the following code works fine:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;$list = "1,2,4,10,8,0,20,30,9";&lt;br /&gt;&lt;br /&gt;$token = strtok($list, ",");&lt;br /&gt;while($token !== FALSE)&lt;br /&gt;{&lt;br /&gt;    print $token."\n";&lt;br /&gt;    $token = strtok(",");&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Output:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;4&lt;br /&gt;10&lt;br /&gt;8&lt;br /&gt;0&lt;br /&gt;20&lt;br /&gt;30&lt;br /&gt;9&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;It's always useful to know details about &lt;a href="http://www.php.net/manual/en/language.operators.comparison.php"&gt;operators in PHP&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-804041834101280442?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nJAXzeSiKAZsg7vX1bjd4HZA7Ec/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nJAXzeSiKAZsg7vX1bjd4HZA7Ec/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nJAXzeSiKAZsg7vX1bjd4HZA7Ec/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nJAXzeSiKAZsg7vX1bjd4HZA7Ec/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/z6WXY32NA98" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/804041834101280442/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=804041834101280442" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/804041834101280442?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/804041834101280442?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/z6WXY32NA98/strtok-in-php-common-mistake.html" title="strtok in PHP - a common mistake" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.subeen.com/2009/08/strtok-in-php-common-mistake.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkAHQn4zcSp7ImA9WxJREUg.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-2370887432486586300</id><published>2009-05-13T00:48:00.000+06:00</published><updated>2009-05-13T00:58:53.089+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-13T00:58:53.089+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PHP" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook api" /><title>Trouble with Facebook Client API</title><content type="html">I have working on facebook application development (it's a game named Fighter Jets), and facing some weired problem. I have decided to share my experience here.&lt;br /&gt;&lt;br /&gt;Today I tried the post link feature of the facebook API. First I tried the following code:&lt;br /&gt;&lt;code&gt;$facebook-&gt;api_client-&gt;links_post($user_id, 'http://khaaan.com/','Best. Website. Ever.');&lt;/code&gt;&lt;br /&gt;I got it from their &lt;a href="http://wiki.developers.facebook.com/index.php/Links.post"&gt;API documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I got error using it. It says that 'The url you supplied is invalid'. May be it's invalid. Then I changed the URL to http://www.google.com, which is valid definitely! Still getting the same problem!! WTF!&lt;br /&gt;&lt;br /&gt;Then I searched their forum and found that I am not the only victim, some people already faced this problem and one of them solved the problem in the following way:&lt;br /&gt;&lt;code&gt;$facebook-&gt;api_client-&gt;links_post('http://khaaan.com/','Best. Website. Ever.', $user_id);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Which works! Needed to use the user id as the third parameter, but from the example in the API documentation we see that it's the first parameter. &lt;br /&gt;&lt;br /&gt;I really don't understand why the documentation is wrong.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-2370887432486586300?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ckDrgFpL5DXyPsotHxB5n840GUo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ckDrgFpL5DXyPsotHxB5n840GUo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ckDrgFpL5DXyPsotHxB5n840GUo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ckDrgFpL5DXyPsotHxB5n840GUo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/-p5XIGSnjOo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/2370887432486586300/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=2370887432486586300" title="12 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/2370887432486586300?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/2370887432486586300?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/-p5XIGSnjOo/trouble-with-facebook-client-api.html" title="Trouble with Facebook Client API" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>12</thr:total><feedburner:origLink>http://blog.subeen.com/2009/05/trouble-with-facebook-client-api.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEENRHc-fSp7ImA9WxRVFU0.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-5623655656740002935</id><published>2008-11-12T22:15:00.000+06:00</published><updated>2008-11-12T22:18:15.955+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-12T22:18:15.955+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="freelance" /><title>Forum for freelance software developers</title><content type="html">I got a new forum for freelancers. They call it &lt;a href="http://www.freelancefest.com"&gt;FreelanceFest&lt;/a&gt;. You can go and post your problems there. Hopefully someone will answer soon. There are language specific categories and also freelance site based categories available.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-5623655656740002935?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/l3Sh9KtE0I-cX1Ot9SL7WbRIYGY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l3Sh9KtE0I-cX1Ot9SL7WbRIYGY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/l3Sh9KtE0I-cX1Ot9SL7WbRIYGY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l3Sh9KtE0I-cX1Ot9SL7WbRIYGY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/iGwSs4lDrNA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/5623655656740002935/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=5623655656740002935" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/5623655656740002935?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/5623655656740002935?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/iGwSs4lDrNA/forum-for-freelance-software-developers.html" title="Forum for freelance software developers" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/11/forum-for-freelance-software-developers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAMQnozeCp7ImA9WxdbFUw.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-5288317932266024491</id><published>2008-08-12T09:39:00.000+06:00</published><updated>2008-08-12T09:46:23.480+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-12T09:46:23.480+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><title>Convert FLV to MP3 using Perl</title><content type="html">Few days back, I found an interesting Perl module that converts FLV file to MP3. Here is the code:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;use FLV::ToMP3;&lt;br /&gt;&lt;br /&gt;$flv_filename = "/home/video/music.flv";&lt;br /&gt;$mp3_filename = "test.mp3";&lt;br /&gt;&lt;br /&gt;my $converter = FLV::ToMP3-&gt;new();&lt;br /&gt;$converter-&gt;parse_flv($flv_filename);&lt;br /&gt;$converter-&gt;save($mp3_filename);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Visit the following links for details:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://search.cpan.org/~cdolan/FLV-Info-0.19/lib/FLV/ToMP3.pm"&gt;FLV::ToMP3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://search.cpan.org/~cdolan/FLV-Info/bin/flv2mp3"&gt;flv2mp3&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-5288317932266024491?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qB7jNb2Sv_N37fF--kZnHCjjlKU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qB7jNb2Sv_N37fF--kZnHCjjlKU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qB7jNb2Sv_N37fF--kZnHCjjlKU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qB7jNb2Sv_N37fF--kZnHCjjlKU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/xZEDyYA2pjI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/5288317932266024491/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=5288317932266024491" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/5288317932266024491?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/5288317932266024491?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/xZEDyYA2pjI/convert-flv-to-mp3-using-perl.html" title="Convert FLV to MP3 using Perl" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/08/convert-flv-to-mp3-using-perl.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cBRX8_eCp7ImA9WxdbFEU.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-9123130682516691988</id><published>2008-08-12T01:58:00.000+06:00</published><updated>2008-08-12T02:04:14.140+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-12T02:04:14.140+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PHP" /><title>Send email using PHP</title><content type="html">Sending emails using a PHP script / program is very easy. Just use the mail function: &lt;code&gt;mail($to, $subject, $body);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Check &lt;a href="http://www.php.net/function.mail"&gt;mail function&lt;/a&gt; for details.&lt;br /&gt;&lt;br /&gt;There can be some problems if it's not configured properly. Check the &lt;a href="http://www.php.net/manual/en/mail.setup.php"&gt;installation / configuration page&lt;/a&gt; for details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-9123130682516691988?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xmhwYMDioZ_8N_vFJVCt7Tb0HEs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xmhwYMDioZ_8N_vFJVCt7Tb0HEs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xmhwYMDioZ_8N_vFJVCt7Tb0HEs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xmhwYMDioZ_8N_vFJVCt7Tb0HEs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/MyAqrKm91Us" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/9123130682516691988/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=9123130682516691988" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/9123130682516691988?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/9123130682516691988?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/MyAqrKm91Us/send-email-using-php.html" title="Send email using PHP" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/08/send-email-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkEHR3s4fyp7ImA9WxdbFEU.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-3033908196340096665</id><published>2008-08-12T01:52:00.000+06:00</published><updated>2008-08-12T01:57:16.537+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-12T01:57:16.537+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><title>Install Perl modules using cpan</title><content type="html">Installation of Perl modules is very simple. Just use the command in the terminal:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;code&gt;cpan -install ModuleName&lt;/code&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;For example, to install LWP module, use the command:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;code&gt;cpan -install LWP&lt;/code&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To install Mail::Sendmail module, use the command:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;&lt;code&gt;cpan -install Mail::Sendmail&lt;/code&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-3033908196340096665?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ROUVPMcqEyBuBXUYzgujPBu_O6M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ROUVPMcqEyBuBXUYzgujPBu_O6M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ROUVPMcqEyBuBXUYzgujPBu_O6M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ROUVPMcqEyBuBXUYzgujPBu_O6M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/yqBvhDP7lpk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/3033908196340096665/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=3033908196340096665" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/3033908196340096665?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/3033908196340096665?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/yqBvhDP7lpk/install-perl-modules-using-cpan.html" title="Install Perl modules using cpan" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/08/install-perl-modules-using-cpan.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EEQnszeSp7ImA9WxdbE0w.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-5360359735407364659</id><published>2008-08-10T01:42:00.000+06:00</published><updated>2008-08-10T01:53:23.581+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-10T01:53:23.581+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><title>Perl - return value of a function</title><content type="html">Can you guess the output of the following Perl code?&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$sum = add(3, 5);&lt;br /&gt;print $sum."\n";&lt;br /&gt;&lt;br /&gt;sub add&lt;br /&gt;{&lt;br /&gt;    $a = shift;&lt;br /&gt;    $b = shift;&lt;br /&gt;    &lt;br /&gt;    return ($a + $b);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Yes, it prints 8.&lt;br /&gt;&lt;br /&gt;Now what about the following code?&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$sum = add(3, 5);&lt;br /&gt;print $sum."\n";&lt;br /&gt;&lt;br /&gt;sub add&lt;br /&gt;{&lt;br /&gt;    $a = shift;&lt;br /&gt;    $b = shift;    &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;hmm... what should it print? It prints 5 ! A garbage value?&lt;br /&gt;Not actually. I have found that in Perl if you don't return anything, it returns the value of the last variable in the function.&lt;br /&gt;&lt;br /&gt;Now you can tell the output of the following code :-)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$sum = add(3, 5);&lt;br /&gt;print $sum."\n";&lt;br /&gt;&lt;br /&gt;sub add&lt;br /&gt;{&lt;br /&gt;    $a = shift;&lt;br /&gt;    $b = shift;&lt;br /&gt;    &lt;br /&gt;    $c = 10;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;yes, it's 10 !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-5360359735407364659?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/595gh2CIu4B8BlF6YWKIrRPvLDk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/595gh2CIu4B8BlF6YWKIrRPvLDk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/595gh2CIu4B8BlF6YWKIrRPvLDk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/595gh2CIu4B8BlF6YWKIrRPvLDk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/8T7PEWDW-Gc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/5360359735407364659/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=5360359735407364659" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/5360359735407364659?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/5360359735407364659?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/8T7PEWDW-Gc/perl-return-value-of-function.html" title="Perl - return value of a function" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.subeen.com/2008/08/perl-return-value-of-function.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcFQH8zfyp7ImA9WxdbEU4.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-8190205524525801860</id><published>2008-08-08T00:19:00.000+06:00</published><updated>2008-08-08T00:33:31.187+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-08T00:33:31.187+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PHP" /><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><category scheme="http://www.blogger.com/atom/ns#" term="Python" /><title>Count number of elements in array - PHP, Perl, Python</title><content type="html">We often need to count the number of elements in an array (or get the size of an array). Here is how to do it in PHP, Perl &amp; Python:&lt;br /&gt;&lt;br /&gt;PHP: &lt;code&gt;$items = count($ara);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Perl: &lt;code&gt;my $items = scalar(@ara);&lt;/code&gt;, you can also try: &lt;code&gt;my $items = @ara;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Python: &lt;code&gt;items = ara.__len__()&lt;/code&gt;. Note that in Python it's called list. List can be used as array.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-8190205524525801860?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/G3gyFlh5dVLky04wckeFB_tX1gE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G3gyFlh5dVLky04wckeFB_tX1gE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/G3gyFlh5dVLky04wckeFB_tX1gE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G3gyFlh5dVLky04wckeFB_tX1gE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/EFuNZ5X5_Pg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/8190205524525801860/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=8190205524525801860" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/8190205524525801860?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/8190205524525801860?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/EFuNZ5X5_Pg/count-number-of-elements-in-array-php.html" title="Count number of elements in array - PHP, Perl, Python" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.subeen.com/2008/08/count-number-of-elements-in-array-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMCRHwzfyp7ImA9WxdUF00.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-3382091018864286628</id><published>2008-08-03T00:44:00.000+06:00</published><updated>2008-08-03T00:57:45.287+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-03T00:57:45.287+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><title>CGItemp**** issue in file upload</title><content type="html">Sometimes your file upload script produces temp files named CGItemp**** in the server (this happed to one of my Perl file upload script (cgi) running in a windows server). &lt;br /&gt;&lt;br /&gt;So I did some search in the Internet about the problem. Many people faced the same problem and most of them choose a simple solution. That is to delete those files using a program or manually. After spending some more time, I found that those temp files are filehandles that are being recorded in the server. Though the CGI.pm file should have taken care of it (i.e. delete those files automatically).&lt;br /&gt;&lt;br /&gt;I found that in my code I have opened a file handle which must be closed in order to get rid of this problem.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;b&gt;my $upload_file_handle = $q-&gt;upload("file_name");&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;when this variable (file handle) is not required any more, it should be closed.&lt;br /&gt;&lt;br /&gt;So I added the line at the end of upload function: &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;b&gt;close $upload_file_handle;&lt;/b&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;It solved the problem!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-3382091018864286628?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FFnaTko2jOghChrvfDU2uHETKbE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FFnaTko2jOghChrvfDU2uHETKbE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FFnaTko2jOghChrvfDU2uHETKbE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FFnaTko2jOghChrvfDU2uHETKbE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/J7kucQzd2gM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/3382091018864286628/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=3382091018864286628" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/3382091018864286628?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/3382091018864286628?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/J7kucQzd2gM/cgitemp-issue-in-file-upload.html" title="CGItemp**** issue in file upload" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.subeen.com/2008/08/cgitemp-issue-in-file-upload.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMFQngyfip7ImA9WxdVF0k.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-8103587942301559904</id><published>2008-07-22T23:16:00.000+06:00</published><updated>2008-07-22T23:40:13.696+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-22T23:40:13.696+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mobile Phone Application Development" /><category scheme="http://www.blogger.com/atom/ns#" term="Objective-C" /><title>Objective-C for iPhone application development</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_A2NamGQmyCc/SIYW57-PGyI/AAAAAAAAAZA/Qe5jA7aU9FI/s1600-h/170px-IPhoneSeattle.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_A2NamGQmyCc/SIYW57-PGyI/AAAAAAAAAZA/Qe5jA7aU9FI/s200/170px-IPhoneSeattle.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5225889602217122594" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.apple.com/iphone/"&gt;iPhone&lt;/a&gt; is getting popular day-by-day. Naturally the demand for iPhone applications is increasing. So if you are ready to take the next big step, you can start learning how to develop software for iPhone.&lt;br /&gt; &lt;br /&gt;The operating system used in iPhone is called iPhone OS (which is also the operating system for iPod). Unfortunately iPhone doesn't support Java like most of the smart phones. The programming language that can be used to write programs for iPhone is &lt;span style="font-weight:bold;"&gt;Objective-C&lt;/span&gt;. If you already know it, then you are one step ahead. Else you can start learning it. You can read this tutorial: &lt;a href="http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/"&gt;http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/&lt;/a&gt; which is recommended by many.&lt;br /&gt;&lt;br /&gt;For resources, you must visit iPhone Developer's Center: &lt;a href="http://developer.apple.com/iphone/"&gt;http://developer.apple.com/iphone/&lt;/a&gt; and download the iPhone SDK.&lt;br /&gt;&lt;br /&gt;Please share your experience with iPhone application development.&lt;br /&gt;&lt;br /&gt;Wikipedia links: &lt;a href="http://en.wikipedia.org/wiki/IPhone"&gt;iPhone&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Objective-C"&gt;Objective-C&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/IPhone_OS"&gt;iPhone OS&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-8103587942301559904?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QM9DDcGqT98lqUSbipXb6GR_5N8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QM9DDcGqT98lqUSbipXb6GR_5N8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QM9DDcGqT98lqUSbipXb6GR_5N8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QM9DDcGqT98lqUSbipXb6GR_5N8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/ygF_fvSrRS4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/8103587942301559904/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=8103587942301559904" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/8103587942301559904?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/8103587942301559904?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/ygF_fvSrRS4/objective-c-for-iphone-application.html" title="Objective-C for iPhone application development" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_A2NamGQmyCc/SIYW57-PGyI/AAAAAAAAAZA/Qe5jA7aU9FI/s72-c/170px-IPhoneSeattle.jpg" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://blog.subeen.com/2008/07/objective-c-for-iphone-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMNR3wzcSp7ImA9WxdWFk8.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-1998480747221182312</id><published>2008-07-09T23:40:00.000+06:00</published><updated>2008-07-10T00:01:36.289+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-10T00:01:36.289+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><title>Create PDF file in Perl</title><content type="html">Today I tried to create a PDF file using a program. I choose the language Perl to do this task, because there should be one or more useful module for pdf creation in Perl (I shall try to do the same task using PHP and Python later).&lt;br /&gt;&lt;br /&gt;For PDF creation I found the module &lt;a href="http://search.cpan.org/%7Eftassin/PDF-Create-0.01/lib/PDF/Create.pm"&gt;PDF::Create&lt;/a&gt; very useful. If you want to create and/or modify a pdf file, then you can try &lt;a href="http://search.cpan.org/%7Eareibens/PDF-API2-0.69/lib/PDF/API2.pm"&gt;PDF::API2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here is an article on pdf creation from the book PDF Hack, that uses PDF::API2 to create a pdf file: &lt;a href="http://oreilly.com/pub/h/2429"&gt;Use Perl to create PDF&lt;/a&gt;. Note that I had to change the sample code (line 11) &lt;span style="font-size:120%;"&gt;&lt;code&gt;my $txt = $page-&gt;hybrid;&lt;/code&gt;&lt;/span&gt; to &lt;span style="font-size:120%;"&gt;&lt;code&gt;my $txt = $page-&gt;text;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope you can create PDFs smoothly. Please share your experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-1998480747221182312?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YP1kcIezTSlEqWFzlhjKmKGZLmY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YP1kcIezTSlEqWFzlhjKmKGZLmY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YP1kcIezTSlEqWFzlhjKmKGZLmY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YP1kcIezTSlEqWFzlhjKmKGZLmY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/JfgYagx8bFs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/1998480747221182312/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=1998480747221182312" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/1998480747221182312?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/1998480747221182312?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/JfgYagx8bFs/create-pdf-file-in-perl.html" title="Create PDF file in Perl" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/07/create-pdf-file-in-perl.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MGRXkyfSp7ImA9WxdQGUU.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-6438973205191215885</id><published>2008-06-21T00:04:00.001+06:00</published><updated>2008-06-21T00:10:24.795+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-21T00:10:24.795+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Non-interactive SSH in Linux</title><content type="html">There are two machines, A and B in a network. Let the IP of A be 192.168.1.2, and IP of B be 192.168.1.8. You can access remotely from A to B using the command: &lt;span style="font-size:110%;"&gt;&lt;code style="font-weight: bold;"&gt;ssh guest@192.168.1.8&lt;/code&gt;&lt;/span&gt;. It will ask you the password of the user guest in machine B. Now let me tell you a simple trick so that you don't need to enter the password any more. It's called non-interactive ssh.&lt;br /&gt;&lt;br /&gt;Suppose your username in machine A is pypy. Open the terminal. Go to the directory /home/pypy/.ssh (cd /home/pypy/.ssh). Now enter the follwoing command:&lt;br /&gt;&lt;span style="font-size:110%;"&gt;&lt;code&gt;&lt;b&gt;ssh-keygen -t dsa&lt;/b&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;First it will ask you for a filename. Just press enter to keep it default (id_dsa) or you can enter any other name. Then it will ask you for a passphrase. Enter empty there (just press enter twice). Now you will see two files there named id_dsa (that has the private key) and id_dsa.pub (that contains the public key).&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size:110%;"&gt;pypy@pypy-laptop:~/.ssh$ &lt;span style="font-weight: bold;"&gt;ssh-keygen -t dsa&lt;/span&gt;&lt;br /&gt;Generating public/private dsa key pair.&lt;br /&gt;Enter file in which to save the key (/home/pypy/.ssh/id_dsa):&lt;br /&gt;Enter passphrase (empty for no passphrase):&lt;br /&gt;Enter same passphrase again:&lt;br /&gt;Your identification has been saved in /home/pypy/.ssh/id_dsa.&lt;br /&gt;Your public key has been saved in /home/pypy/.ssh/id_dsa.pub.&lt;br /&gt;The key fingerprint is:&lt;br /&gt;fc:37:69:9e:bb:15:e7:55:cd:b9:52:12:e6:49:b1:6c pypy@pypy-laptop&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;Key generation complete. Check the directory&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size:110%;"&gt;pypy@pypy-laptop:~/.ssh$ ls -lt&lt;br /&gt;total 12&lt;br /&gt;-rw------- 1 pypy pypy  668 2008-06-20 23:54 &lt;span style="font-weight: bold;"&gt;id_dsa&lt;/span&gt;&lt;br /&gt;-rw-r--r-- 1 pypy pypy  610 2008-06-20 23:54 &lt;span style="font-weight: bold;"&gt;id_dsa.pub&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;Now append the content of id_dsa.pub file to the file named authorized_keys2 in /home/guest/.ssh directory (if the file doesn't exist first create it) of machine B. You can do this using this command also:&lt;br /&gt;&lt;span style="font-size:110%;"&gt;&lt;code style="font-weight: bold;"&gt;cat /home/pypy/.ssh/id_dsa.pub | ssh guest@192.168.1.8 'cat - &gt;&gt; ~/.ssh/authorized_keys2'&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(it will ask you for the password of user guest of machine B).&lt;br /&gt;&lt;br /&gt;Now done. Try to access machine B from machine A&lt;br /&gt;&lt;span style="font-size:110%;"&gt;&lt;code&gt;pypy@pypy-laptop:~/.ssh$ ssh guest@192.168.1.8&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hopefully it won't ask you for a password :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-6438973205191215885?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jKn89zRbEpiPKCIBuQXMli-MMBU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jKn89zRbEpiPKCIBuQXMli-MMBU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jKn89zRbEpiPKCIBuQXMli-MMBU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jKn89zRbEpiPKCIBuQXMli-MMBU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/DgMMYjJ0HQ8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/6438973205191215885/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=6438973205191215885" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/6438973205191215885?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/6438973205191215885?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/DgMMYjJ0HQ8/non-interactive-ssh-in-linux.html" title="Non-interactive SSH in Linux" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/06/non-interactive-ssh-in-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYBQX85fyp7ImA9WxdQGEw.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-9118551586236241461</id><published>2008-06-19T00:14:00.000+06:00</published><updated>2008-06-19T00:19:10.127+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-19T00:19:10.127+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><title>Perl script to display the content of a zip file</title><content type="html">Here is a little script that shows the number of files in a zip file and the names of the files. Interesting thing is that, we don't need to unzip the file.&lt;br /&gt;&lt;br /&gt;Here is the code&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-size:110%;"&gt;use Archive::Zip qw( :ERROR_CODES :CONSTANTS );&lt;br /&gt;&lt;br /&gt;my $zip = Archive::Zip-&gt;new();&lt;br /&gt;&lt;br /&gt;my $zip_file_name = 'scraper.zip';&lt;br /&gt;&lt;br /&gt;$zip-&gt;read( $zip_file_name );&lt;br /&gt;&lt;br /&gt;print "Number of files in the zip file: ".$zip-&gt;numberOfMembers()."\n";&lt;br /&gt;print "List of files:\n";&lt;br /&gt;&lt;br /&gt;my @members = $zip-&gt;memberNames();&lt;br /&gt;&lt;br /&gt;#now print the name of the files&lt;br /&gt;foreach (@members)&lt;br /&gt;{&lt;br /&gt;   print $_, "\n";&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For details, please check &lt;a href="http://search.cpan.org/%7Eadamk/Archive-Zip-1.23/lib/Archive/Zip.pm"&gt;http://search.cpan.org/~adamk/Archive-Zip-1.23/lib/Archive/Zip.pm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-9118551586236241461?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ai4W1wbIIly_pVXFGx4VFCzY2u8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ai4W1wbIIly_pVXFGx4VFCzY2u8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ai4W1wbIIly_pVXFGx4VFCzY2u8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ai4W1wbIIly_pVXFGx4VFCzY2u8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/Hn3MReNv4l0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/9118551586236241461/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=9118551586236241461" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/9118551586236241461?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/9118551586236241461?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/Hn3MReNv4l0/perl-script-to-display-content-of-zip.html" title="Perl script to display the content of a zip file" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/06/perl-script-to-display-content-of-zip.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MAQ3Y5eSp7ImA9WxdQFUg.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-7473731530537496992</id><published>2008-06-15T23:21:00.000+06:00</published><updated>2008-06-15T23:37:22.821+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-15T23:37:22.821+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><title>Your crawler freezes? Use BackgroundWorker in C#</title><content type="html">When I wrote my first crawler with GUI in C#.NET (I used .NET so that I can create the GUI easily using Visual Studio) I got into a major problem. The GUI got frozen when I ran the crawler... I shared my problem with one of my friend who then told me about BackgroundWorker Thread. Then I got back home, explored BackgroundWorker, learned how to use it, and used it in my crawler and WOW! It worked fine then. So if you get into similar problem then you can also use BackgroundWorker.&lt;br /&gt;&lt;br /&gt;You will find it in Toolbox &gt; Component &gt; BackgroundWorker. Just drag it and drop on your form. Right click on it (it's backgroundWorker1 until you change the name) to change it's properties and add events. Now just code the events...&lt;br /&gt;&lt;br /&gt;You can go through this example in msdn &lt;a href="http://msdn.microsoft.com/en-us/library/b2zk6580.aspx"&gt;http://msdn.microsoft.com/en-us/library/b2zk6580.aspx&lt;/a&gt;. It's a useful one I think.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-7473731530537496992?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Q69tckiCBOimysmifGQ_9cKSqbA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q69tckiCBOimysmifGQ_9cKSqbA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Q69tckiCBOimysmifGQ_9cKSqbA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Q69tckiCBOimysmifGQ_9cKSqbA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/F4hQmj586Po" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/7473731530537496992/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=7473731530537496992" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/7473731530537496992?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/7473731530537496992?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/F4hQmj586Po/your-crawler-freezes-use.html" title="Your crawler freezes? Use BackgroundWorker in C#" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.subeen.com/2008/06/your-crawler-freezes-use.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YGR3o_eSp7ImA9WxdQEk0.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-7146699136076876452</id><published>2008-06-12T00:17:00.000+06:00</published><updated>2008-06-12T00:32:06.441+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-12T00:32:06.441+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><category scheme="http://www.blogger.com/atom/ns#" term="CGI" /><title>Problem uploading large file in CGI script</title><content type="html">Today I had a problem uploading large file using the CGI upload script I have written using Perl couple of day back. I was getting the response: "413 Request entity too large". I searched Google and found out that this problem can occur for mainly two reasons: if size of the file being uploaded  is greater than the value of $CGI::POST_MAX in the upload script, and if the value of the apache (web server) directive &lt;strong&gt;LimitRequestBody&lt;/strong&gt; is lower than the file size. But both cases were handled. But I was still getting the 413 error. Then I found that it was my local server which prevented me to upload large file size. the 413 was coming from that machine instead of the server where the script is hosted :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-7146699136076876452?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xG3PLnI-M5ttOA57Q79Y0aQqRqw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xG3PLnI-M5ttOA57Q79Y0aQqRqw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xG3PLnI-M5ttOA57Q79Y0aQqRqw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xG3PLnI-M5ttOA57Q79Y0aQqRqw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/XTSVx4sSaNQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/7146699136076876452/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=7146699136076876452" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/7146699136076876452?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/7146699136076876452?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/XTSVx4sSaNQ/problem-uploading-large-file-in-cgi.html" title="Problem uploading large file in CGI script" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/06/problem-uploading-large-file-in-cgi.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcGRHw-eyp7ImA9WxdQEk0.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-6804612921474377647</id><published>2008-06-12T00:01:00.000+06:00</published><updated>2008-06-12T00:13:45.253+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-12T00:13:45.253+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><category scheme="http://www.blogger.com/atom/ns#" term="CGI" /><title>How to send custom error message in http header from cgi script</title><content type="html">Couple of days ago, while I was writing a CGI script in Perl, it was needed to send custom error message in http response header. I would like to share with you how I have done this.&lt;br /&gt;&lt;br /&gt;First I have decided that for any kind of error in the code (for example, file not found, insecure path etc.) I shall return status 500 with the error message. Before this decision my code looked like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;...&lt;br /&gt;my $query = new CGI;&lt;br /&gt;print $query-&gt;header(-type=&gt;'text/plain');&lt;br /&gt;...&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;So for any error in the script, I added the line:&lt;br /&gt;&lt;code&gt;print $query-&gt;header(-type=&gt;'text/plain', -status=&gt;"500 $err_str");&lt;/code&gt;&lt;br /&gt;But it wasn't working. The return value (status line in the response) still '200 OK'. Then I found that query header can't be set twice (once you set it, you can't change it). Then I removed the first line &lt;code&gt;print $query-&gt;header(-type=&gt;'text/plain');&lt;/code&gt; and modified the code in such a way that the header is printed once. In order to return error, I wrote a function and just called it in case of any error occurs (but I made sure the header is not printed before I call it). Here is the function:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sub catch_n_die&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    my $err_str = shift;&lt;br /&gt;&lt;br /&gt;    print $query-&gt;header(-type=&gt;'text/plain', -status=&gt;"500 $err_str");&lt;br /&gt;&lt;br /&gt;    exit;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-6804612921474377647?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7RUZDFdosCcyIPBWSV4d4mxPBlI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7RUZDFdosCcyIPBWSV4d4mxPBlI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7RUZDFdosCcyIPBWSV4d4mxPBlI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7RUZDFdosCcyIPBWSV4d4mxPBlI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/H_uWNUIOuuk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/6804612921474377647/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=6804612921474377647" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/6804612921474377647?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/6804612921474377647?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/H_uWNUIOuuk/how-to-send-custom-error-message-in.html" title="How to send custom error message in http header from cgi script" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/06/how-to-send-custom-error-message-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcNR3Y_fSp7ImA9WxdRFkQ.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-2360998742242697677</id><published>2008-06-06T01:05:00.000+06:00</published><updated>2008-06-06T01:11:36.845+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-06T01:11:36.845+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><title>Perl script to check the number of instances of a program</title><content type="html">To get the number of instances of a program running in your machine you can use the following Perl code:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size:120%;"&gt;my $program_name = 'abc.pl';&lt;br /&gt;my $data = `ps ax | grep perl`;&lt;br /&gt;my @ara = $data =~ /perl\s+$program_name/g;&lt;br /&gt;my $count = @ara;&lt;br /&gt;print "$count\n";&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Sometime it might be useful for you to know at the start of a program whether it's already running. You can get the name of your current Perl script/program from $0. If the name of your Perl script is  program.pl, then $0 will contain program.pl. You can try &lt;b&gt;&lt;code&gt;print $0;&lt;code&gt;&lt;/b&gt;&lt;br /&gt;Hope this tiny piece of code will be useful for you. :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-2360998742242697677?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AKGXU1umDzYBi22a2srR8MonAbM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AKGXU1umDzYBi22a2srR8MonAbM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AKGXU1umDzYBi22a2srR8MonAbM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AKGXU1umDzYBi22a2srR8MonAbM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/-jG9UllIai4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/2360998742242697677/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=2360998742242697677" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/2360998742242697677?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/2360998742242697677?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/-jG9UllIai4/perl-script-to-check-number-of.html" title="Perl script to check the number of instances of a program" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/06/perl-script-to-check-number-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08CSX8-fCp7ImA9WxdRFUQ.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-3937993891986101182</id><published>2008-06-04T20:46:00.000+06:00</published><updated>2008-06-04T21:04:28.154+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-04T21:04:28.154+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PHP" /><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Python" /><title>execute linux command using Perl, Python, PHP</title><content type="html">Those who program in Linux often need to execute/run linux commands from programs/scripts.&lt;br /&gt;&lt;br /&gt;Using python you can execute linux command is the following way:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;import os&lt;br /&gt;os.system('ls -lt')&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If you use Perl, you can do it in the following ways:&lt;br /&gt;1. &lt;span style="font-size:130%;"&gt;&lt;code&gt;system(mkdir $folder);&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;2. &lt;span style="font-size:130%;"&gt;&lt;code&gt;qw(mkdir $folder);&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;3. &lt;span style="font-size:130%;"&gt;&lt;code&gt;$temp = `mkdir $folder`; #back ticks &lt;/code&gt;&lt;/span&gt;&lt;br /&gt;4. &lt;span style="font-size:130%;"&gt;&lt;code&gt;exec($command);&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you use back ticks or qw, $? will be set if any error occurs. So you can use it like this:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;qw(rm $filename);&lt;br /&gt;if($?) {&lt;br /&gt;    print STDERR "error deleting file\n";&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;There are also several options available to run linux commands using PHP. Take a look at here for detals: &lt;a href="http://us2.php.net/manual/en/ref.exec.php"&gt;http://us2.php.net/manual/en/ref.exec.php&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-3937993891986101182?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gS-RhVlCb3HIdf_ZLVXaKDN4wU0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gS-RhVlCb3HIdf_ZLVXaKDN4wU0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gS-RhVlCb3HIdf_ZLVXaKDN4wU0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gS-RhVlCb3HIdf_ZLVXaKDN4wU0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/N2enN6iJN98" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/3937993891986101182/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=3937993891986101182" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/3937993891986101182?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/3937993891986101182?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/N2enN6iJN98/execute-linux-command-using-perl-python.html" title="execute linux command using Perl, Python, PHP" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/06/execute-linux-command-using-perl-python.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEFQn4_eSp7ImA9WxdRFUw.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-7272575562241473712</id><published>2008-06-03T23:09:00.000+06:00</published><updated>2008-06-03T23:20:13.041+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-03T23:20:13.041+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MySQL" /><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>SQL command to dump data into file and load data from file</title><content type="html">In order to migrate data, it is useful to dump data from database table to a file, and load data from file to a table.&lt;br /&gt;&lt;br /&gt;To dump data for a specific range in a file, you can use the following SQL command:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;SELECT $fields INTO OUTFILE '$dump_file_name' FIELDS TERMINATED BY "\t"&lt;br /&gt;ENCLOSED BY '"' ESCAPED BY "\\" LINES TERMINATED BY '\n' FROM $table_name WHERE&lt;br /&gt;id &gt;= $start AND id &lt; $end;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;You can then load the file by using the following SQL command:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;LOAD DATA INFILE '$dump_file_name' INTO TABLE $table_name FIELDS TERMINATED BY "\t"&lt;br /&gt;ENCLOSED BY '"' ESCAPED BY "\\" LINES TERMINATED BY '\n' ($fields);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These two commands work fine with MySQL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-7272575562241473712?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MnONMlnGubvbqVpruhD3dpZnAco/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MnONMlnGubvbqVpruhD3dpZnAco/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MnONMlnGubvbqVpruhD3dpZnAco/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MnONMlnGubvbqVpruhD3dpZnAco/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/oaLFBF4K0yg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/7272575562241473712/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=7272575562241473712" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/7272575562241473712?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/7272575562241473712?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/oaLFBF4K0yg/sql-command-to-dump-data-into-file-and.html" title="SQL command to dump data into file and load data from file" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/06/sql-command-to-dump-data-into-file-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYGR3c5eSp7ImA9WxdSEUo.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-5551815497327265794</id><published>2008-05-19T11:04:00.000+06:00</published><updated>2008-05-19T11:15:26.921+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-19T11:15:26.921+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="firebug" /><title>Use Firebug for High Speed Development</title><content type="html">&lt;blockquote&gt;The Firebug extension for Mozilla Firefox allows the debugging, editing, and modifying of any website's CSS, HTML, DOM, and JavaScript, and provides other web development tools.&lt;/blockquote&gt;(from wikipedia)&lt;br /&gt;&lt;br /&gt;Firebug is really useful to me in web spider/crawler development. It makes writing regular expression easier &amp; faster as I can put the mouse on specific portion of the web page and get it's code using inspect. Another useful feature for me is I can see all the http requests and responses, which also helps me a lot in writing web spiders.&lt;br /&gt;&lt;br /&gt;You can get Firebug from &lt;a href="http://www.getfirebug.com/"&gt;getfirebug.com&lt;/a&gt; or download from &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/1843"&gt;addons.mozilla.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Speed up your web development using Firebug!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-5551815497327265794?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qmp6qNwqY-2jtiRNYtcE1lnc30Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qmp6qNwqY-2jtiRNYtcE1lnc30Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qmp6qNwqY-2jtiRNYtcE1lnc30Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qmp6qNwqY-2jtiRNYtcE1lnc30Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/SEI5uHC1TCs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/5551815497327265794/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=5551815497327265794" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/5551815497327265794?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/5551815497327265794?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/SEI5uHC1TCs/use-firebug-for-high-speed-development.html" title="Use Firebug for High Speed Development" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://blog.subeen.com/2008/05/use-firebug-for-high-speed-development.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMNQXkzfip7ImA9WxZaF0Q.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-6458441451754778433</id><published>2008-05-03T11:25:00.000+06:00</published><updated>2008-05-03T11:44:50.786+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-03T11:44:50.786+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PHP" /><category scheme="http://www.blogger.com/atom/ns#" term="XML" /><title>SimpleXML - simple way to parse XML in PHP</title><content type="html">This morning I needed to write a PHP script that parses an XML file. I could do it easily with regular expressions - as I can play very well with regexp :). But I was looking for an easier &amp;amp; simpler way to parse XML using PHP, as I thought there must be a very simple way. And I was right, I found SimpleXML. SimpleXML makes XML processing really simple. Here I give links of some excellent (and simple!) resources of SimpleXML:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://devzone.zend.com/node/view/id/688"&gt;SimpleXML&lt;/a&gt;: A very well written and comprehensive article/tutorial.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.php.net/simplexml"&gt;SimpleXML Functions&lt;/a&gt;: SimpleXML functions list with good examples from php.net&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3schools.com/php/php_xml_simplexml.asp"&gt;PHP XML SimpleXML&lt;/a&gt;: w3schools tutorial.&lt;/li&gt;&lt;/ul&gt;SimpleXML will definitely speed up your XML processing speed!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-6458441451754778433?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ac69iV8nJrnRSNFcc8h7AEPqGRE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ac69iV8nJrnRSNFcc8h7AEPqGRE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ac69iV8nJrnRSNFcc8h7AEPqGRE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ac69iV8nJrnRSNFcc8h7AEPqGRE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/IRkNWNLO3gw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/6458441451754778433/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=6458441451754778433" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/6458441451754778433?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/6458441451754778433?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/IRkNWNLO3gw/simplexml-simple-way-to-parse-xml-in.html" title="SimpleXML - simple way to parse XML in PHP" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/05/simplexml-simple-way-to-parse-xml-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkENRX4-eip7ImA9WxZaFk4.&quot;"><id>tag:blogger.com,1999:blog-3735025482116810346.post-154058780074090671</id><published>2008-05-01T15:16:00.000+06:00</published><updated>2008-05-01T15:38:14.052+06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-01T15:38:14.052+06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C# Timer Control" /><title>C# Timer Control</title><content type="html">In C#.NET, in order to do a certain task repeatedly after specific time interval you have to use the Timer control. Today I had to use it for a small project (to repeatedly send request to a web service). I just used Google and found some nice and easy articles. I think it's worth sharing couple of them to save your google time :)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.csharphelp.com/archives/archive90.html"&gt;C# Timer Demo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingwithTimerControlinCSharp11302005054911AM/WorkingwithTimerControlinCSharp.aspx"&gt;&lt;span class="ArticleMainHeading"&gt;&lt;span id="ctl00_ContentPlaceHolder1_ArticleHeader1_LabelHeading" style="width: 100%;"&gt;Working with Timer Control in C#&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;And of course you can look at MSDN (though sometimes I find it time consuming to learn something from MSDN).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3735025482116810346-154058780074090671?l=blog.subeen.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KwrMBtNA7ju2Eb0XnCvP-T1eecU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KwrMBtNA7ju2Eb0XnCvP-T1eecU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KwrMBtNA7ju2Eb0XnCvP-T1eecU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KwrMBtNA7ju2Eb0XnCvP-T1eecU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/HighSpeedSoftwareDevelopment/~4/qT_uGUuFfvQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.subeen.com/feeds/154058780074090671/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3735025482116810346&amp;postID=154058780074090671" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/154058780074090671?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3735025482116810346/posts/default/154058780074090671?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/HighSpeedSoftwareDevelopment/~3/qT_uGUuFfvQ/c-timer-control.html" title="C# Timer Control" /><author><name>Tamim Shahriar (Subeen)</name><uri>http://www.blogger.com/profile/03476580865735017742</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="31" height="26" src="http://2.bp.blogspot.com/-FIT_lTIEXCA/TkjB0O6_XEI/AAAAAAAAAqs/6PQZ2D1Gkl4/s220/sbn_pic_book.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.subeen.com/2008/05/c-timer-control.html</feedburner:origLink></entry></feed>

