<?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>I-Am-Bot &#187; code</title>
	<atom:link href="http://iambot.net/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://iambot.net</link>
	<description>Code, technology and life</description>
	<lastBuildDate>Sat, 28 Aug 2010 16:00:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Introducing TinyPop</title>
		<link>http://iambot.net/2010/08/introducing-tinypop/</link>
		<comments>http://iambot.net/2010/08/introducing-tinypop/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 11:34:58 +0000</pubDate>
		<dc:creator>Srinath</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://iambot.net/?p=434</guid>
		<description><![CDATA[&#160; TinyPop is a lightweight (1.5 KB minified) JavaScript for Growl like notifications. It can be used as an alternative to jGrowl when you don't want to use jQuery for a simple task. Details Download Demo]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>TinyPop is a lightweight (1.5 KB minified) JavaScript for <a href="http://en.wikipedia.org/wiki/Growl_%28software%29">Growl</a> like notifications. It can be used as an alternative to <a href="http://www.stanlemon.net/projects/jgrowl.html">jGrowl</a> when you don't want to use jQuery for a simple task. </p>
<p><strong><a href="http://iambot.net/projects/tinypop/">Details</a></strong></p>
<p><strong><a href="http://iambot.net/dScript/download.php?fname=./tinypop.zip">Download</a></strong></p>
<p><strong><a href="http://iambot.net/demo/tinypop/">Demo</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://iambot.net/2010/08/introducing-tinypop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpUserAuth Released!</title>
		<link>http://iambot.net/2010/07/phpuserauth-released/</link>
		<comments>http://iambot.net/2010/07/phpuserauth-released/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 02:04:13 +0000</pubDate>
		<dc:creator>Srinath</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://iambot.net/?p=426</guid>
		<description><![CDATA[It's finally done! The package is up for grabs, with a quick starter guide. Details Download Demo Please go through the project page for more details! The Readme.txt file inside folder "readme" contains instructions for installation and usage Leave your comments/questions/suggestions on the project page. Out.]]></description>
			<content:encoded><![CDATA[<p>It's finally done! The package is up for grabs, with a quick starter guide.</p>
<p><strong><a href="http://iambot.net/projects/phpuserauth/">Details</a></strong></p>
<p><strong><a href="http://iambot.net/dScript/download.php?fname=./phpuserauth.zip">Download</a></strong></p>
<p><strong><a href="http://iambot.net/demo/phpuserauth/">Demo</a></strong></p>
<p>Please go through the project page for more details!</p>
<p>The Readme.txt file inside folder "readme" contains instructions for installation and usage</p>
<p>Leave your comments/questions/suggestions on the project page.</p>
<p>Out.</p>
]]></content:encoded>
			<wfw:commentRss>http://iambot.net/2010/07/phpuserauth-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing phpUserAuth</title>
		<link>http://iambot.net/projects/phpuserauth/</link>
		<comments>http://iambot.net/projects/phpuserauth/#comments</comments>
		<pubDate>Sun, 23 May 2010 03:23:44 +0000</pubDate>
		<dc:creator>Srinath</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://iambot.net/?p=383</guid>
		<description><![CDATA[Update: Please visit the project page for more details After weeks of fighting with myself, I finally got down to work on something that has been on my mind for sometime now. Yes, it is yet another user authentication/management system in PHP. There are already some great ones out there, and some not so good [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: Please visit the <a href="http://iambot.net/projects/phpuserauth/">project page</a> for more details</strong></p>
<p>After weeks of fighting with myself, I finally got down to work on something that has been <a href="http://iambot.net/2010/03/status-update/">on my mind</a> for sometime now. Yes, it is <em>yet</em> another user authentication/management system in PHP. There are already some great ones out there, and some not so good ones. I wanted a system that was secure, flexible, and easy to work with. What took me an entire week of effort is presented below. Without further delay, presenting <strong>phpUserAuth</strong></p>
<p><strong>Features</strong></p>
<ul>
<li> Secure with support for sessions based and/or cookie based authentication</li>
<li> Tons of configuration option for those who know what they are doing. For others, its easy as a cake!</li>
<li> Passwords are *always* hashed before they are sent over the network, with fallback to plain text if JavaScript is not supported in the browser</li>
<li> Only salted, hashed passwords are saved in the database. Even if the DB is stolen, it is almost impossible to get the original password</li>
<li> Support for multiple simultaneous sessions or a single active session </li>
<li> Administrator can choose how users are activated after they signup. It can be automatic activation, manual activation by the admin, or an activation mail can be sent to the user </li>
<li> Password is <strong>NEVER</strong> sent over the email. If the user forgets his password, he can request a password reset mail. </li>
<li> User defined access control levels</li>
<li> Flexible. If the administrator wants to add another field, simply updated the configuration file, and put the field in the signup form! The rest is taken care of by the script!</li>
<li> Prevention from XSS attacks - all data sent to the server is cleaned using the excellent <a href="http://www.phpclasses.org/package/2189-PHP-Filter-out-unwanted-PHP-Javascript-HTML-tags-.html">InputFilter</a> class</li>
<li> Support for template based HTML email notifications with changeable templates</li>
<li> Emailing done through the excellent <a href="http://sourceforge.net/projects/phpmailer/">PHPMailer</a> with support for SMTP+SSL</li>
<li> Custom redirection after login/logout </li>
<li> Pre-designed forms </li>
<li> Snap in install - Simply drop the folder into your existing application, configure a few site options and database settings, and you are done! </li>
</ul>
<p><strong>Requirements</strong></p>
<ul>
<li> PHP 5+ as the core classes are OO </li>
<li> MySQLi support </li>
<li> MySQL 5+ database server </li>
</ul>
<p>Is that too much to ask? That being said, if you run a fairly recent server, all these should be there by default. For testing, you can check out <a href="http://apachefriends.org">XAMPP</a> which is available for Windows, Mac and Linux!</p>
<p><strong> License </strong><br />
I'm planning to release it under some open source license. If that doesn't work out, it will still be <strong>FREE</strong></p>
<p><strong> Download </strong><br />
It is not <em>completely</em> done yet. The admin area needs some work. So it will be released, when its done</p>
<p><strong> Notes</strong><br />
1) As always, it isn't perfect! If you find any bugs, errors, or know a way where things can be done better, please leave a comment!<br />
2) The application hasn't been profiled yet. There WILL be places where I might have  complicated things. Will be taken care of after its been released</p>
]]></content:encoded>
			<wfw:commentRss>http://iambot.net/projects/phpuserauth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lightweight Javascript inline editing</title>
		<link>http://iambot.net/projects/editablejs</link>
		<comments>http://iambot.net/projects/editablejs#comments</comments>
		<pubDate>Sat, 27 Mar 2010 16:48:19 +0000</pubDate>
		<dc:creator>Srinath</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://iambot.net/?p=329</guid>
		<description><![CDATA[Update 2: Core methods rewritten for compatibility with browsers. Check change log for details Update 1: Script updated considerably There are many excellent scripts to edit something inline using javascript (like jeditable), but not many that work standalone. If you hate wanting to include a 50 KB library just for this simple functionality, you are [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 2: Core methods rewritten for compatibility with browsers. Check change log for details</strong></p>
<p><strong>Update 1: Script updated considerably </strong></p>
<p>There are many excellent scripts to edit something inline using javascript (like <a href="http://www.appelsiini.net/projects/jeditable" target="_blank">jeditable</a>), but not many that work standalone. If you hate wanting to include a 50 KB library just for this simple functionality, you are in the right page. This script is tiny (1.7 kB minified) and works on most modern browsers</p>
<p><a href="http://iambot.net/demo/editable/"><strong>Demo</strong></a></p>
<p><a href="../dScript/download.php?fname=./editable.zip" target="_blank"><strong>Download</strong></a></p>
<p><strong>Steps:</strong></p>
<p>1) Include the editable.js file in your page</p>
<p>2) Add the attribute class="editable" to a division, paragraph or table cell &lt;td&gt;</p>
<p>3) Click on the element for it to turn into a text box. Update the value, and press enter to save. Press tab or click anywhere on the page to discard updates and revert to the old value</p>
<p><strong>Changelog</strong></p>
<p><u><em>Version 0.2</em></u></p>
<ul>
<li>Support for all major browsers</li>
<li>Table cell editing more robust</li>
<li>Added support for IE 7 and 8. Uses ie.js for support for getElementsByClassName</li>
</ul>
<p><u><em>Initial Release</em></u></p>
<ul>
<li>The editable box now fits to the size of the original element. You can see that in the <a href="http://iambot.net/demo/editable/">demo</a></li>
<li>Support for inline table cell editing is now included (Proper layout/orientation only work in FF for now. Horribly out of place in other browsers and will be fixed later)</li>
<li>Editing of an element with other HTML tags now works better</li>
</ul>
<p><strong>Gotchas:</strong></p>
<p><del datetime="2010-05-10T04:22:53+00:00">1) Only one element is editable at any instant (I wanted this specific feature for a project I'm working on)</del></p>
<p><del datetime="2010-05-08T09:00:31+00:00">2) The text box doesn't fit to the size of the original element (will be fixed)</del></p>
<p><strong>Tested On:</strong></p>
<p>Windows - Firefox 3.6, IE 7 &amp; 8, Chrome</p>
<p>Mac - Firefox 3.6, Safari 4, Chrome</p>
<p><strong>Terms:</strong></p>
<p>Free to use for personal or commercial purposes, but please give credits</p>
<p><strong>Notes:</strong></p>
<p>I know it can always be better, and I'm just a beginner. So comments, suggestions always welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://iambot.net/projects/editablejs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Of application rewrites</title>
		<link>http://iambot.net/2010/01/of-application-rewrites/</link>
		<comments>http://iambot.net/2010/01/of-application-rewrites/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 07:36:24 +0000</pubDate>
		<dc:creator>Srinath</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://iambot.net/?p=304</guid>
		<description><![CDATA[What will you do if you write a shitty application? And what will you do when you find that you have written a shitty application? I've been haunted by these questions for the past two days, and yes, I'm guilty as charged. Before someone thinks I sound like someone who knows programming, let me clarify [...]]]></description>
			<content:encoded><![CDATA[<p>What will you do if you write a shitty application? And what will you do when you <em>find</em> that you have written a shitty application? I've been haunted by these questions for the past two days, and yes, I'm guilty as charged. Before someone thinks I sound like someone who knows programming, let me clarify - NO I DON'T. And that is exactly the reason for this post.</p>
<p>The application that I worked on wasn't something big and impossible. It was a simple school management system, written in PHP/MySQL with a liberal dose of javascript thrown in. Unfortunately, it just didn't make it to the servers, and I abandoned it about 6 months ago. Much has changed in that time, and thankfully. I now <em>really understand</em> the need to follow Software Engineering processes, the most important being <strong>Design</strong>. So why did my team, and I choose to ignore something we've actually studied in college? Were we dumb enough to think that we wouldn't be needing it? Probably. Were we not actually able to understand why we will need it? Possibly. The only reason that readily comes to my mind was because we never knew that we will actually need it.</p>
<p>Software Engineering courses in Indian colleges are often the most boring, monotonous and brain-dead courses among the lot. Throw in a thick rimmed, thick skulled man in his 40's who has never worked on a real application all his life, to <em>teach</em> it and you have a 2012 waiting to happen. And it often does. We students cram the Pressman's book a day before the exam, answer standard questions about SDLC, Testing, importance of SE, and get away with it. And that is that. We are never taught first hand on why we need it, how we should use it, how badly it will affect the software if you don't follow certain principles, or why learn SE at all! Those are left to the student to discover after a few years, just like I have.</p>
<p>So what exactly was my application? It was</p>
<ul>
<li>Very simple and modular</li>
<li>Web based for universal access</li>
<li>Not that huge or complex (Our team of 4 completed it in 3 working months)</li>
<li>Architecturally simple</li>
</ul>
<p>Then why did we screw it up? We did everything that we could think of. We first gathered requirements, refined them, thought we did some design, then went on with the coding. Too bad we thought we designed it! We did not. Looking back, I feel really stupid about some of the decisions we took based on our understanding of the system. We knew we had to design it properly, but we didn't take it seriously as we didn't really know its consequences. I am no programmer, and if I feel my app is shitty, it really has to be!</p>
<p>Where did I go wrong?</p>
<ul>
<li>No framework</li>
<li>No separating of logic from presentation. It was all embedded in a single file in true PHP fashion</li>
<li>No proper design of the entire system. No HLD/DLD</li>
<li>No glue. The code looks like disjoint pieces of a puzzle</li>
</ul>
<p>What I did right?</p>
<ul>
<li>Probably the architecture</li>
<li>With PHP/MySQL</li>
<li>Revision Control which was never used seriously</li>
</ul>
<p>So the question beacons - When does one decide to rewrite/redesign an application? I need not have decided on redoing the whole thing. I could have as well patched it up, and sold it as many still do. It would still work, can be understood by almost any developer, and I wouldn't have to waste time and money on a rewrite. Decorate shit and it will still be shit. If one doesn't learn from mistakes at the first instance, he/she probably never will. So I finally did what I should have done in the first place:</p>
<ul>
<li>Designed a breakdown of the entire system into modules and the coupling between them</li>
<li>Decided against going for a fully blown framework like <a href="http://iambot.net/2009/07/symfony-framework/" target="_blank">Symfony</a> as that will add unnecessary complication to a simple application, but rather write my own simple framework to separate code from design</li>
<li>Chose mysqli as the database driver and developed a simple wrapper around it</li>
<li>Added a logging system which was entirely missing</li>
<li>Work on a custom design from scratch, which will also work on portable devices</li>
<li>Write a generic framework for the reporting module with custom graphs and charts rather redo the entire code</li>
<li>And many many more...</li>
</ul>
<p>The point I'm trying to make is, no one is perfect to start with. As a programmer, I was happy with my code 6 months back. Now I despise it. It is not something I can work on anymore. So rather than choosing to ignore the mistakes, swallow your ego, acknowledge the mistakes and redo it. Yes it is hard, painful, time consuming and costly. But software is a continuous process and the continuity is there for us to learn, undo and redo things the right way. I bet I will find blunders again after 6 months, but they will not be as bad as those I've found now. Maybe then, I can afford to patch things up, and be on my way.</p>
<p>For now, back to <em>Software engineering : a practitioner's approach by Pressman</em></p>
<p><em>P.S: This post is more of a reminder to myself than to others.<br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://iambot.net/2010/01/of-application-rewrites/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
