<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Deep Tech Fusion</title>
	<atom:link href="http://starcoder.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://starcoder.wordpress.com</link>
	<description>tech related weblog</description>
	<lastBuildDate>Mon, 18 Jun 2007 12:37:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='starcoder.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Deep Tech Fusion</title>
		<link>http://starcoder.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://starcoder.wordpress.com/osd.xml" title="Deep Tech Fusion" />
	<atom:link rel='hub' href='http://starcoder.wordpress.com/?pushpress=hub'/>
		<item>
		<title>7 Magics</title>
		<link>http://starcoder.wordpress.com/2007/05/22/7-magics/</link>
		<comments>http://starcoder.wordpress.com/2007/05/22/7-magics/#comments</comments>
		<pubDate>Tue, 22 May 2007 12:43:00 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://starcoder.wordpress.com/2007/05/22/7-magics/</guid>
		<description><![CDATA[Successful Negotiations &#8211; 7 Easy Steps First and foremost, be prepared to walk away. Know when to forego all together. Deal at the right level. Due diligence to come prepared. Don’t take anything personally. Anticipate objections. Don’t underestimate Karma. For more info click here 7 Levels Of Delegation Wait and be told, or do exactly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=14&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Successful Negotiations &#8211; 7 Easy Steps</h2>
<ol>
<li><font size="2" face="Georgia">First and foremost, be prepared to walk away.</font></li>
<li><font size="2" face="Georgia">Know when to forego all together.</font></li>
<li><font size="2" face="Georgia">Deal at the right level. </font></li>
<li><font size="2" face="Georgia">Due diligence to come prepared.</font></li>
<li><font size="2" face="Georgia">Don’t take anything personally.</font></li>
<li><font size="2" face="Georgia">Anticipate objections.</font></li>
<li><font size="2" face="Georgia">Don’t underestimate Karma.</font></li>
</ol>
<p><font size="2" face="Arial">For more info click <a href="http://blogs.techrepublic.com.com/career/?p=126">here</a></font></p>
<hr />
<h2>7 Levels Of Delegation</h2>
<ol>
<li><font size="2" face="Georgia">Wait and be told, or do exactly what I say.</font></li>
<li><font size="2" face="Georgia">Look into this and tell me what you come up with.</font></li>
<li><font size="2" face="Georgia">Give me your recommendation, and other options with the pro&#8217;s and con&#8217;s of each. I&#8217;ll let you know if you can go ahead.</font></li>
<li><font size="2" face="Georgia">Decide and let me know your decision. But wait for my go ahead.</font></li>
<li><font size="2" face="Georgia">Decide and let me know your decision. Go ahead unless I say stop.</font></li>
<li><font size="2" face="Georgia">Decide and take action, but let me know what you did.</font></li>
<li><font size="2" face="Georgia">Decide and take action. You don&#8217;t need to check with me.</font></li>
</ol>
<p><font size="2" face="Arial">For more info click <a href="http://blogs.techrepublic.com.com/career/?p=117">here</a></font></p>
<hr />
<h2>Top 7 Things System Administrators Forget To Do</h2>
<ol>
<li><font size="2" face="Georgia">Forgetting to Delete a Former User&#8217;s Account.</font></li>
<li><font size="2" face="Georgia">Forgetting to Regularly Search for Rootkits.</font></li>
<li><font size="2" face="Georgia">Forgetting to Use a Trouble Ticket Tracking System. </font></li>
<li><font size="2" face="Georgia">Forgetting to Set Up Technical Documentation and Creating a Knowledge Base.</font></li>
<li><font size="2" face="Georgia">Forgetting the Risks of Flash Memory Drives.</font></li>
<li><font size="2" face="Georgia">Forgetting to Manage Partial Root Access.</font></li>
<li><font size="2" face="Georgia">Decide and take action. You don&#8217;t need to check with me.</font></li>
</ol>
<p><font size="2" face="Arial">For more info click <a href="http://www.oreillynet.com/pub/a/sysadmin/2007/05/03/the-top-7-things-sysadmins-forget-to-do.html">here</a></font></p>
<hr />
<h2>7 Things To Expect From Your IT Partner</h2>
<ol>
<li><font size="2" face="Georgia">Technical expertise — and strong communication skills.</font></li>
<li><font size="2" face="Georgia">An awareness of your budget — and resources.</font></li>
<li><font size="2" face="Georgia">An advocate who cuts through product hype. </font></li>
<li><font size="2" face="Georgia">A long-term planner, implementer, and strategist.</font></li>
<li><font size="2" face="Georgia">An industry watcher who maps technology advances and developments to your needs.</font></li>
<li><font size="2" face="Georgia">A keen ability to troubleshoot and solve problems.</font></li>
<li><font size="2" face="Georgia">An interest in handling all of your technology needs.</font></li>
</ol>
<p><font size="2" face="Arial">For more info click <a href="http://www.microsoft.com/smallbusiness/resources/technology/networking/7_things_to_expect_from_your_it_partner.mspx">here</a></font></p>
<hr />
<h2>7 Things You Dont See In Web 2.0 From Web 1.0</h2>
<ol>
<li><font size="2" face="Georgia">Best Viewed In.</font></li>
<li><font size="2" face="Georgia">Get Flash Player.</font></li>
<li><font size="2" face="Georgia">Tables.</font></li>
<li><font size="2" face="Georgia">Click here to Enter/Launch.</font></li>
<li><font size="2" face="Georgia">Flash Intros.</font></li>
<li><font size="2" face="Georgia">Loading please wait….</font></li>
<li><font size="2" face="Georgia">Resizing Browsers.</font></li>
</ol>
<p><font size="2" face="Arial">For more info click <a href="http://www.everybodygoto.com/2007/04/09/7-things-you-dont-see-in-web-20-from-web-10/">here</a></font></p>
<hr />
<h2>7 Things Never To Tell Your Customers</h2>
<ol>
<li><font size="2" face="Georgia">Why are you doing that for him?</font></li>
<li><font size="2" face="Georgia">Are you sure you can afford this?</font></li>
<li><font size="2" face="Georgia">What an idiot that last guy was!</font></li>
<li><font size="2" face="Georgia">We don&#8217;t have it.</font></li>
<li><font size="2" face="Georgia">What a different/funny/unusual/bizarre/etc. name.</font></li>
<li><font size="2" face="Georgia">I haven&#8217;t a clue about what I&#8217;m talking about, but I&#8217;ll ramble on regardless.</font></li>
<li><font size="2" face="Georgia">I only work here.</font></li>
</ol>
<p><font size="2" face="Arial">For more info click <a href="http://www.microsoft.com/smallbusiness/resources/management/customer_relations/7_things_never_to_tell_your_customers.mspx">here</a></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=14&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2007/05/22/7-magics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Mssql 200 vs 2005</title>
		<link>http://starcoder.wordpress.com/2007/02/07/mssql-200-vs-2005/</link>
		<comments>http://starcoder.wordpress.com/2007/02/07/mssql-200-vs-2005/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 13:47:25 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://starcoder.wordpress.com/2007/02/07/mssql-200-vs-2005/</guid>
		<description><![CDATA[Comparison between SQL Server 2005 &#38; 2000 . Feature 2005 2000 Show all identity columns SELECT object_name(object_id),name FROM sys.identity_columns; last value of the identity column SELECT name,last_value FROM sys.identity_columns; SELECT object_name(id) AS table_name, name AS column_name FROM syscolumns WHERE columnproperty(id,name,&#8217;IsIdentity&#8217;)=1; Show all database names SELECT name FROM sys.databases SELECT name FROM master..sysdatabases Show all tables [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=13&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><!--content_start--><font size="-1" color="#008000" face="Verdana, Arial, Helvetica, sans-serif">Comparison between SQL Server 2005 &amp; 2000 .</font></p>
<table border="1">
<tr>
<td align="center"><font size="+1" color="#0000ff">Feature</font></td>
<td align="center"><font size="+1" color="#0000ff">2005</font></td>
<td align="center"><font size="+1" color="#0000ff">2000</font></td>
</tr>
<tr>
<td><strong>Show all identity columns</strong></td>
<td>SELECT object_name(object_id),name<br />
FROM sys.identity_columns;</p>
<hr />last value of the identity column<br />
<hr />
SELECT name,last_value<br />
FROM sys.identity_columns;</td>
<td>SELECT object_name(id) AS table_name, name AS column_name<br />
FROM syscolumns<br />
WHERE columnproperty(id,name,&#8217;IsIdentity&#8217;)=1;</td>
</tr>
<tr>
<td><strong>Show all database names</strong></td>
<td>SELECT name<br />
FROM sys.databases</td>
<td>SELECT name<br />
FROM master..sysdatabases</td>
</tr>
<tr>
<td><strong>Show all tables names</strong></td>
<td>SELECT name<br />
FROM sys.tables;</p>
<hr />replicated table<br />
<hr />
SELECT *<br />
FROM sys.tables<br />
WHERE is_replicated =1;</td>
<td>SELECT name<br />
FROM sysobjects<br />
WHERE type=&#8217;U';</td>
</tr>
<tr>
<td><strong>Show all Procedures names</strong></td>
<td>SELECT name<br />
FROM sys.procedures;</p>
<hr />startup procedure<br />
<hr />
<strong>startup procedure or used in replication</strong>SELECT name<br />
FROM sys.procedures<br />
WHERE is_auto_executed=0;<strong>used in replication</strong>SELECT name<br />
FROM sys.procedures<br />
WHERE execution_replicated=1;</td>
<td>SELECT name<br />
FROM sysobjects WHERE type=&#8217;P&#8217;</td>
</tr>
<tr>
<td><strong>Show all views </strong></td>
<td>SELECT name<br />
FROM sys.views;</p>
<hr />replicated view<br />
<hr />
SELECT *<br />
FROM sys.views<br />
WHERE is_replicated =1;</td>
<td>SELECT name<br />
FROM sysobjects<br />
WHERE type=&#8217;V';</td>
</tr>
<tr>
<td><strong>Show all Triggers names</strong></td>
<td>SELECT name<br />
FROM sys.triggers<br />
WHERE parent_class=1;</p>
<hr />AFTER trigger or INSTEAD of trigger<br />
<hr />
SELECT name<br />
FROM sys.triggers<br />
WHERE type=&#8217;TR&#8217;;SELECT name<br />
FROM sys.triggers<br />
WHERE is_instead_of_trigger=1;</td>
<td>SELECT name<br />
FROM sysobjects<br />
WHERE type=&#8217;TR&#8217;;</td>
</tr>
<tr>
<td><strong>Show all data types</strong></td>
<td>SELECT *<br />
FROM sys.systypes;</td>
<td>SELECT *<br />
FROM systypes;</td>
</tr>
<tr>
<td><strong>Show all logins</strong></td>
<td>SELECT *<br />
FROM sys.sql_logins;</td>
<td>SELECT *<br />
FROM master..syslogins<br />
WHERE isntgroup=0 and isntname=0;</td>
</tr>
<tr>
<td><strong>Show all dependencies of the Objects</strong></td>
<td>SELECT *<br />
FROM sys.sql_dependencies;</td>
<td>SELECT *<br />
FROM sysdepends;</td>
</tr>
<tr>
<td><strong>Show all error messages</strong></td>
<td>SELECT *<br />
FROM sys.messages;</td>
<td>SELECT *<br />
FROM master..sysmessages;</td>
</tr>
<tr>
<td><strong>Show all database files</strong></td>
<td>SELECT name, physical_name<br />
FROM sys.database_files;</td>
<td>SELECT name, filename<br />
FROM sysfiles;</td>
</tr>
<tr>
<td><strong>Show all computed columns</strong></td>
<td>SELECT name <br />FROM sys.computed_columns <br />WHERE object_id =object_id(&#8216;table_name&#8217;);
</td>
<td>SELECT name <br />FROM syscolumns <br />WHERE id =object_id(&#8216;TableName&#8217;) <br /> AND iscomputed=1;</td>
</tr>
<tr>
<td><strong>Show all type of index</strong></td>
<td>SELECT object_name(object_id),name, type_desc<br />
FROM sys.indexes<br />
WHERE type_desc =&#8217;CLUSTERED&#8217;;</p>
<hr />&amp;&amp;<br />
<hr />
SELECT object_name(object_id),name, type_desc<br />
FROM sys.indexes<br />
WHERE type_desc =&#8217;HEAP&#8217;;</p>
<hr />&amp;&amp;<br />
<hr />
SELECT object_name(object_id),name, type_desc<br />
FROM sys.indexes<br />
WHERE type_desc =&#8217;NONCLUSTERED&#8217;;</p>
<hr />&amp;&amp;<br />
<hr />
SELECT object_name(object_id),name, type_desc<br />
FROM sys.indexes<br />
WHERE type_desc =&#8217;XML&#8217;;</td>
<td>&nbsp;</td>
</tr>
</table>
<pre></pre>
<pre></pre>
<pre><a href="http://www.databasejournal.com/features/mssql/print.php/3587906"></a></pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=13&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2007/02/07/mssql-200-vs-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Transact-SQL &#8211; Operators</title>
		<link>http://starcoder.wordpress.com/2006/12/28/transact-sql-operators/</link>
		<comments>http://starcoder.wordpress.com/2006/12/28/transact-sql-operators/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 14:01:21 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://starcoder.wordpress.com/2006/12/28/transact-sql-operators/</guid>
		<description><![CDATA[+ (Add): Adds two numbers. This addition arithmetic operator can also add a number, in days, to a date. SELECT c.FirstName, c.LastName, VacationHours, SickLeaveHours, VacationHours + SickLeaveHours AS 'Total Hours Away' FROM HumanResources.Employee AS e JOIN Person.Contact AS c ON e.ContactID = c.ContactID<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=11&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<ol>
<li><strong>+ (Add):<br />
</strong>Adds two numbers. This addition arithmetic operator can also add a number, in days, to a date.</p>
<pre>SELECT c.FirstName, c.LastName, VacationHours, SickLeaveHours,
    VacationHours + SickLeaveHours AS 'Total Hours Away'
FROM HumanResources.Employee AS e
    JOIN Person.Contact AS c ON e.ContactID = c.ContactID</pre>
</li>
<li><strong><br />
</strong></li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=11&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2006/12/28/transact-sql-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Update Word document through PHP</title>
		<link>http://starcoder.wordpress.com/2006/12/28/update-word-document-through-php/</link>
		<comments>http://starcoder.wordpress.com/2006/12/28/update-word-document-through-php/#comments</comments>
		<pubDate>Thu, 28 Dec 2006 10:00:25 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://starcoder.wordpress.com/2006/12/28/update-word-document-through-php/</guid>
		<description><![CDATA[$filename = &#8220;C:\\document_&#8221;.date(&#8220;YmdHis&#8221;).&#8221;.doc&#8221;; $template = &#8220;C:\\template.htm&#8221;; $fp_temp = fopen($template, &#8220;rb&#8221;); $fp = fopen($filename, &#8220;wb&#8221;); $old_contents = fread ( $fp_temp, filesize ($template)); fclose ( $fp_temp); $new_constants = str_replace(&#8220;var_username&#8221;, &#8220;Deepak&#8221;, $old_contents); $rset = &#8220;&#60;table width=&#8217;100%&#8217; &#62;&#60;tr&#62;&#60;td&#62;#&#60;/td&#62;&#60;td &#62;Name&#60;/td&#62;&#60;td &#62;Date of Join&#60;/td&#62;&#60;td &#62;Title&#60;/td&#62;&#60;td &#62;Dept&#60;/td&#62;&#60;/tr&#62;&#8221;; $rset .= &#8220;&#60;tr&#62;&#60;td&#62;123&#60;/td&#62;&#60;td&#62;Deepak&#60;/td&#62;&#60;td&#62;Oct 10, 2003&#60;/td&#62;&#60;td&#62;Programmer&#60;/td&#62;&#60;td&#62;IT&#60;/td&#62;&#60;/tr&#62;&#8221;; $rset .= &#8220;&#60;tr&#62;&#60;td&#62;123&#60;/td&#62;&#60;td&#62;Sachin&#60;/td&#62;&#60;td&#62;Oct 10, 2005&#60;/td&#62;&#60;td&#62;Developer&#60;/td&#62;&#60;td&#62;IT&#60;/td&#62;&#60;/tr&#62;&#8221;; $rset .= &#8220;&#60;tr&#62;&#60;td&#62;123&#60;/td&#62;&#60;td&#62;Amita&#60;/td&#62;&#60;td&#62;Oct 10, 2006&#60;/td&#62;&#60;td&#62;System [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=10&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>$filename    = &#8220;C:\\document_&#8221;.date(&#8220;YmdHis&#8221;).&#8221;.doc&#8221;;</p>
<p>$template = &#8220;C:\\template.htm&#8221;;</p>
<p>$fp_temp = fopen($template, &#8220;rb&#8221;);<br />
$fp = fopen($filename, &#8220;wb&#8221;);</p>
<p>$old_contents = fread ( $fp_temp, filesize ($template));<br />
fclose ( $fp_temp);<br />
$new_constants = str_replace(&#8220;var_username&#8221;, &#8220;Deepak&#8221;, $old_contents);</p>
<p>$rset     = &#8220;&lt;table width=&#8217;100%&#8217; &gt;&lt;tr&gt;&lt;td&gt;#&lt;/td&gt;&lt;td &gt;Name&lt;/td&gt;&lt;td &gt;Date of Join&lt;/td&gt;&lt;td &gt;Title&lt;/td&gt;&lt;td &gt;Dept&lt;/td&gt;&lt;/tr&gt;&#8221;;<br />
$rset    .= &#8220;&lt;tr&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt;Deepak&lt;/td&gt;&lt;td&gt;Oct 10, 2003&lt;/td&gt;&lt;td&gt;Programmer&lt;/td&gt;&lt;td&gt;IT&lt;/td&gt;&lt;/tr&gt;&#8221;;<br />
$rset   .= &#8220;&lt;tr&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt;Sachin&lt;/td&gt;&lt;td&gt;Oct 10, 2005&lt;/td&gt;&lt;td&gt;Developer&lt;/td&gt;&lt;td&gt;IT&lt;/td&gt;&lt;/tr&gt;&#8221;;<br />
$rset    .= &#8220;&lt;tr&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt;Amita&lt;/td&gt;&lt;td&gt;Oct 10, 2006&lt;/td&gt;&lt;td&gt;System Admin&lt;/td&gt;&lt;td&gt;HR &amp; Admin&lt;/td&gt;&lt;/tr&gt;&#8221;;<br />
$rset    .= &#8220;&lt;tr&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt;Deepa&lt;/td&gt;&lt;td&gt;Oct 10, 2002&lt;/td&gt;&lt;td&gt;Hr Head&lt;/td&gt;&lt;td&gt;HR &amp; Admin&lt;/td&gt;&lt;/tr&gt;&#8221;;<br />
$rset    .= &#8220;&lt;tr&gt;&lt;td&gt;123&lt;/td&gt;&lt;td&gt;Poja&lt;/td&gt;&lt;td&gt;Oct 10, 2003&lt;/td&gt;&lt;td&gt;Developer&lt;/td&gt;&lt;td&gt;IT&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#8221;;<br />
$constants = str_replace(&#8220;Var_record_sets&#8221;, $rset, $new_constants);</p>
<p>fwrite($fp, $constants) ;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=10&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2006/12/28/update-word-document-through-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Functions</title>
		<link>http://starcoder.wordpress.com/2006/12/18/9/</link>
		<comments>http://starcoder.wordpress.com/2006/12/18/9/#comments</comments>
		<pubDate>Mon, 18 Dec 2006 08:30:41 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>

		<guid isPermaLink="false">http://starcoder.wordpress.com/2006/12/18/9/</guid>
		<description><![CDATA[A function is a reusable code-block that will be executed by an event, or when the function is called. Defining Functions In JavaScript a function is defined as follows: function functionName(arguments) { statements; return; } The definition starts with the keyword function. This is followed by the name of the function. After that comes a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=9&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span><strong>A function</strong> is a reusable code-block that will be executed by an event, or when the function is called.</span></p>
<h3><strong><span>Defining Functions</span> </strong></h3>
<p class="MsoNormal"><span> </span></p>
<p><span>In JavaScript a function is defined as follows: </span></p>
<pre><span>function <var><span>functionName</span></var>(<var><span>arguments</span></var>) {</span></pre>
<pre><span><span>  </span>statements;</span></pre>
<pre><span><span>  </span>return;</span></pre>
<pre><span><span>  </span>}</span></pre>
<ul>
<li class="MsoNormal"><span>The definition starts with the keyword <code><span>function</span></code>.</span></li>
<li class="MsoNormal"><span>This is followed by the name of the function.</span></li>
<li class="MsoNormal"><span>After that comes a set of parentheses containing the      arguments the function is expecting to receive. Each argument must be a      variable name. These variables are created by declaring them as arguments      and are local to the function.</span></li>
<li class="MsoNormal"><span>After this comes the curly braces that delimit the      statement block that makes up the body of the function.</span></li>
<li class="MsoNormal"><span>The last statement in the statement block should be a      return statement, which returns control back to whatever called the      function. The keyword <code><span>return</span></code> can      stand alone or it can be followed (with no intervening line break) by a      value to be returned. If no value is specified, then the function returns <code><span>undefined</span></code>.</span></li>
</ul>
<pre><span>function testVal(x) {</span></pre>
<pre><span><span>  </span>if (isNaN(x)) {</span></pre>
<pre><span><span>    </span>window.alert ('x is not a number!');</span></pre>
<pre><span><span>    </span>}</span></pre>
<pre><span><span>  </span>return;</span></pre>
<pre><span><span>  </span>}</span></pre>
<pre><span> </span></pre>
<pre><span>function strangeEquation(x, y, q) {</span></pre>
<pre><span><span>  </span>var z = x * y;</span></pre>
<pre><span><span>  </span>var p = q - 7;</span></pre>
<pre><span><span>  </span>return (z * x % (y + 1)) / p;</span></pre>
<pre><span><span>  </span>}</span></pre>
<h3><strong><span>Invoking Functions</span></strong></h3>
<p><span>You invoke, or call, a function by name. The name needs to be followed by a set of parentheses that contain zero or more values to be passed to the function. The number of values being passed should be equal to the number of arguments the function has. The values are assigned to the arguments in the order in which they appear in the list. </span></p>
<p><span>Invoking a function: </span></p>
<pre><span class="old"><span>x = 'bob';</span></span><span></span></pre>
<pre><span>testVal(x);</span></pre>
<pre><span> </span></pre>
<pre><span class="old"><span>x = 1;</span></span></pre>
<pre><span class="old"><span>y = 2;</span></span></pre>
<pre><span class="old"><span>q = 3;</span></span><span></span></pre>
<pre><span>strangeEquation(x, y, q);</span></pre>
<p><span>If you want to pass values of a certain type, you need to test for this yourself since JavaScript, being an untyped language, does not check. </span></p>
<p><span>If you pass too many values, then the additional values do not get assigned to named arguments. They can still be accessed within the function, just not as named variables. </span></p>
<p><span>If you pass too few values then the remaining arguments will be undefined. JavaScript will not error out on this, but your code most probably will not run correctly. </span></p>
<h3><strong><span>Nesting</span></strong></h3>
<p><span>In JavaScript, function definitions can be nested. This is a reasonably unique feature. It exists because JavaScript uses functions to define objects (which are discussed elsewhere) and sometimes objects have functions defined internally, thus requiring a function within a function. </span></p>
<p><span>There are strict limits on where nested functions can be defined. A function can only be defined at the top level of the wherever it is defined. What this means is that it can be defined at the global level, or inside functions, but they cannot be defined within any other type of statement block. So, for instance, you cannot define a function inside an <code><span>if</span></code> statement. </span></p>
<p><span>Some browsers consider a function defined within another function to be local to that function. Therefore nesting functions is not a good idea unless you have a reason for local sub-functions defined within functions (such as the object instance noted above). </span></p>
<h2><span>Advanced Function Features</span></h2>
<p><span>This section can be confusing, so don&#8217;t panic. </span></p>
<p><span>This material covers advanced features of functions. Since functions are also intimately related to objects, we also look at some other aspects of functions when we look at objects. </span></p>
<h3><span>The Function constructor</span></h3>
<p><span>JavaScript has a <code><span>Function</span></code> constructor which allows you create a variable and assign it a function as a value. </span></p>
<pre><span>var q = new Function('a', 'b', 'return a / b;');</span></pre>
<p><span>The <code><span>Function</span></code> constructor takes any number of arguments, each of which must be defined as a string, and the last of which must be the body of the code for the function. </span></p>
<p><span>A function defined this way can still be invoked by the variable named,<br />
<code><span>res = q(20, 5)</span></code>, but technically it has no name. Instead the function name is a variable that contains a reference to that function as a value. </span></p>
<p><span>Such function are referred to as <span>anonymous</span> functions, since there is no way to refer to them by name. The benefit of declaring a function this way is that it is reparsed each time it is run, meaning, you could replace the strings that define the arguments and function body with variables, dynamically assign values to these variables, and thus rewrite the function each time it ran. </span></p>
<p><span>Sound confusing? Here is an example: </span></p>
<pre><span>// declare our function</span></pre>
<pre><span>// use a variable for the body</span></pre>
<pre><span><span>  </span>var c;</span></pre>
<pre><span><span>  </span>var q = new Function('a', 'b', c);</span></pre>
<pre><span> </span></pre>
<pre><span>// set our body variable and invoke</span></pre>
<pre><span><span>  </span>c = 'a / b';</span></pre>
<pre><span><span>  </span>y = q(20, 10);</span></pre>
<pre><span>// y is now equal to 2</span></pre>
<pre><span> </span></pre>
<pre><span>// reset our body variable and invoke</span></pre>
<pre><span><span>  </span>c = 'a * b';</span></pre>
<pre><span><span>  </span>y = q(20, 10);</span></pre>
<pre><span>// y is now equal to 200</span></pre>
<pre><span>// changing the variable also</span></pre>
<pre><span>// changed the function</span></pre>
<p><span>Since the function is reparsed each time, it can really slow down processing if it is run repeatedly. </span></p>
<h3><span>Function Literals</span></h3>
<p><span>Function literals are similar to the <code><span>Function</span></code> constructor, except they allow you to use normal syntax to assign an anonymous function a variable. Although function literal were introduced in JavaScript 1.2, they had some quirks that were not resolved until 1.5, so test your code carefully. </span></p>
<p><span>The syntax is as follows: </span></p>
<pre><span>var q = function(a, b) { return a / b; }</span></pre>
<p><span>Function literals are only parsed once and then remain static. This means they don&#8217;t change until you reload the document they are in. </span></p>
<p><span>The function literal allows a name to be given to the function, but that name is only usable within the function. This allows for recursive functions. Even if you do name it, you can&#8217;t reference outside the function except by the variable it was assigned to. </span></p>
<pre><span>// the self reference here will work</span></pre>
<pre><span>var q = function summation(b) {</span></pre>
<pre><span><span>  </span>if (b &lt; 2) return 1;</span></pre>
<pre><span><span>  </span>else return b + summation(b-1);</span></pre>
<pre><span><span>  </span>}</span></pre>
<pre><span> </span></pre>
<pre><span>// this call will work</span></pre>
<pre><span>z = q(20);</span></pre>
<pre><span> </span></pre>
<pre><span>// this call will nott</span></pre>
<pre><span>z = summation(20);</span></pre>
<p><span>The practical upshot of these two function features is that functions can be treated like any other type of data and assigned as values to variables. This means they can be passed to other variables. Since they are treated as an object, they are passed by reference, not by value. </span></p>
<h3><span>The Arguments Object</span></h3>
<p><span>All functions have a property called the <code><span>arguments</span></code> object. It is an array that contains a list of values of all arguments passed to the function. </span></p>
<p><span>If you pass five arguments to a function only expecting three, only the first three will be assigned to the argument names defined with the function, but the other two are still addressable through the <code><span>arguments</span></code> object. </span></p>
<p><span>The simplest thing you can do with it is test to make sure the right number of arguments were passed. It&#8217;s <code><span>length</span></code> is property is equal to the number of arguments passed. If it is not equal to the number expected you have the option of actively generating an error to prevent the code from running on bad data. </span></p>
<pre><span>function strangeEquation(x, y, q) {</span></pre>
<pre><span><span>  </span>if (arguments.length != 3) {</span></pre>
<pre><span><span>    </span>return 'invalid number of arguments';</span></pre>
<pre><span><span>    </span>}</span></pre>
<pre><span><span>  </span>var z = x * y;</span></pre>
<pre><span><span>  </span>var p = q - 7;</span></pre>
<pre><span><span>  </span>return (z * x % (y + 1)) / p;</span></pre>
<pre><span><span>  </span>}</span></pre>
<p><span>One benefit of this object is that it allows function to be created that accept an arbitrary number of arguments. For instance, you could have a function where the first argument is named and contains what to do with the data being passed, and all the rest of the arguments could be a random number of unnamed arguments that contain the data to be processed. </span></p>
<pre><span>function whichWay(x) {</span></pre>
<pre><span><span>  </span>for(var iter = 1; iter &lt; arguments.length; iter++) {</span></pre>
<pre><span><span>    </span>thisWay(x, arguments[iter]);</span></pre>
<pre><span><span>    </span>}</span></pre>
<pre><span><span>  </span>}</span></pre>
<h3><span>Function Properties</span></h3>
<p><span>As an object, a function has other properties as well. </span></p>
<p><span>One is the <code><span>length</span></code> property, which specifies how many arguments the function is expecting. </span></p>
<p><span>Another is the <code><span>prototype</span></code> property, which we will discuss when we discuss objects. </span></p>
<p><span>As with objects, you can also define properties for functions. This allows you to create values that persist across repeated calls to the function. To create a new property, you can just assign it a value. </span></p>
<p><span>Since the function declaration is parsed before the code in the script is executed, we can put the initialization statement outside of the function. </span></p>
<pre><span>q.counter = 0;</span></pre>
<pre><span>function q(x) {</span></pre>
<pre><span><span>  </span>q.counter++;</span></pre>
<pre><span><span>  </span>statements;</span></pre>
<pre><span><span>  </span>}</span></pre>
<p><span>Each time function <code><span>q</span></code> runs, it will increment the property <code><span>q.counter</span></code> by one. </span></p>
<p><span>Now wait, you may ask, didn&#8217;t I say elsewhere that things have to be defined at some prior point in the code for JavaScript to find them and yet here is the function after the command to add a property to it. </span></p>
<p><span>Yes to both cases. The statement of things needing to be defined previously in the code has to do with the fact that JavaScript can have multiple code blocks in the same HTML document. </span></p>
<p><span>The property declaration is before the function it changes, but it is part of the same code block. What JavaScript does when it encounters a piece of script is it loads the entire script, from <code><span>&lt;script&gt;</span></code> to <code><span>&lt;/script&gt;</span></code> tag, parses it, and then immediately runs any code that is not inside functions. </span></p>
<p><span>This means that things further down in the document will not yet be defined, including things in other sets of script tags, but everything in this set of script tags will be defined at execution time. </span></p>
<p><span>It is still, however, good practice to not use anything before it is defined in the code. </span></p>
<p class="intro"><span>The top-level properties and functions can be used on all of the built-in JavaScript objects.</span></p>
<p class="MsoNormal" style="text-align:center;" align="center"><span><br />
<hr align="center" size="2" width="100%" />  </span></p>
<h2><span>Top-level Functions</span></h2>
<p><strong><span>FF</span></strong><span>: Firefox, <strong>N</strong>: Netscape, <strong>IE</strong>: Internet Explorer</span></p>
<table class="MsoNormalTable" style="width:100%;" border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width:32%;padding:0.75pt;" valign="top" width="32%">
<p class="MsoNormal"><strong><span>Function</span></strong></p>
</td>
<td style="width:56%;padding:0.75pt;" valign="top" width="56%">
<p class="MsoNormal"><strong><span>Description</span></strong></p>
</td>
<td style="width:4%;padding:0.75pt;" valign="top" width="4%">
<p class="MsoNormal"><strong><span>FF</span></strong></p>
</td>
<td style="width:4%;padding:0.75pt;" valign="top" width="4%">
<p class="MsoNormal"><strong><span>N</span></strong></p>
</td>
<td style="width:4%;padding:0.75pt;" valign="top" width="4%">
<p class="MsoNormal"><strong><span>IE</span></strong></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_decodeURI.asp">decodeURI()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Decodes   an encoded URI</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>5.5</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_decodeURIComponent.asp">decodeURIComponent()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Decodes   an encoded URI component</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>5.5</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_encodeURI.asp">encodeURI()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Encodes   a string as a URI</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>5.5</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp">encodeURIComponent()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Encodes   a string as a URI component</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>5.5</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_escape.asp" target="_top">escape()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Encodes   a string</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>-</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>3</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_eval.asp" target="_top">eval()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Evaluates   a string and executes it as if it was script code</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>2</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>3</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_isFinite.asp" target="_top">isFinite()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Checks   if a value is a finite number</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_isNaN.asp" target="_top">isNaN()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Checks   if a value is not a number</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>2</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>3</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_Number.asp" target="_top">Number()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Converts   an object&#8217;s value to a number</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span> </span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span> </span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_parseFloat.asp" target="_top">parseFloat()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Parses   a string and returns a floating point number</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>2</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>3</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_parseInt.asp" target="_top">parseInt()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Parses   a string and returns an integer</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>2</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>3</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_String.asp" target="_top">String()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Converts   an object&#8217;s value to a string</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span> </span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span> </span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_unescape.asp" target="_top">unescape()</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Decodes   a string encoded by escape()                                             </span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>-</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>3</span></p>
</td>
</tr>
</table>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal" style="text-align:center;" align="center">For more information <a href="http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/reference/toplev.html" title="Check details" target="_blank">click</a> here.</p>
<p class="MsoNormal" style="text-align:center;" align="center"><span><br />
<hr align="center" size="2" width="100%" />  </span></p>
<h2><span>Top-level Properties</span></h2>
<table class="MsoNormalTable" style="width:100%;" border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width:32%;padding:0.75pt;" width="32%">
<p class="MsoNormal"><strong><span>Property</span></strong></p>
</td>
<td style="width:56%;padding:0.75pt;" width="56%">
<p class="MsoNormal"><strong><span>Description</span></strong></p>
</td>
<td style="width:4%;padding:0.75pt;" width="4%">
<p class="MsoNormal"><strong><span>FF</span></strong></p>
</td>
<td style="width:4%;padding:0.75pt;" width="4%">
<p class="MsoNormal"><strong><span>N</span></strong></p>
</td>
<td style="width:4%;padding:0.75pt;" width="4%">
<p class="MsoNormal"><strong><span>IE </span></strong></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_infinity.asp">Infinity</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>A   numeric value that represents positive or negative infinity</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_NaN.asp" target="_top">NaN</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Indicates   that a value is &#8220;Not a Number&#8221;</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
</tr>
<tr>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span><a href="http://www.w3schools.com/jsref/jsref_undefined.asp">undefined</a></span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>Indicates   that a variable has not been assigned a value</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>1</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>4</span></p>
</td>
<td style="padding:0.75pt;" valign="top">
<p class="MsoNormal"><span>5.5</span></p>
</td>
</tr>
</table>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal" style="text-align:center;" align="center"><span><br />
<hr align="center" size="2" width="100%" /></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=9&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2006/12/18/9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom JavaScript functions</title>
		<link>http://starcoder.wordpress.com/2006/12/18/8/</link>
		<comments>http://starcoder.wordpress.com/2006/12/18/8/#comments</comments>
		<pubDate>Mon, 18 Dec 2006 06:27:40 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[JAVASCRIPT]]></category>

		<guid isPermaLink="false">http://starcoder.wordpress.com/2006/12/18/8/</guid>
		<description><![CDATA[10) addEvent() Surely a staple to event attachment! Regardless to what version you use written by whatever developer, it does what it says it does. And of course as you might of known, I’ve put together quite a handy version myself recently of addEvent() with some help from the contest winner and Mark Wubben along [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=8&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>10) addEvent()</strong></p>
<p>Surely a staple to event attachment! Regardless to what version you use written by whatever developer, it does what it says it does. And of course as you might of known, I’ve put together quite a handy version myself recently of addEvent() with some help from the contest winner and Mark Wubben along with a few minor syntax adjustments. But just to be fair to Scott Andrew, here is the original that started it all.<br />
Scott Andrew’s original addEvent() function</p>
<p>function addEvent(elm, evType, fn, useCapture) {<br />
if (elm.addEventListener) {<br />
elm.addEventListener(evType, fn, useCapture);<br />
return true;<br />
}<br />
else if (elm.attachEvent) {<br />
var r = elm.attachEvent(&#8216;on&#8217; + evType, fn);<br />
return r;<br />
}<br />
else {<br />
elm['on' + evType] = fn;<br />
}<br />
}</p>
<p><strong>9) addLoadEvent()</strong></p>
<p>Originally written by Simon Willison and highly adopted by many others as a simple way to add events to trigger after the page has loaded. This of course attaches all your events to the onload event handler which some still see as necessary, nevertheless it does exactly what it’s supposed to, and does it well.<br />
addLoadEvent() by Simon Willison</p>
<p>function addLoadEvent(func) {<br />
var oldonload = window.onload;<br />
if (typeof window.onload != &#8216;function&#8217;) {<br />
window.onload = func;<br />
}<br />
else {<br />
window.onload = function() {<br />
oldonload();<br />
func();<br />
}<br />
}<br />
}</p>
<p>Of course another method is to simply assign multiple event listeners to the window by using addEvent() as described in number 10 as follows:<br />
assigning multiple load events to window</p>
<p>addEvent(window,&#8217;load&#8217;,func1,false);<br />
addEvent(window,&#8217;load&#8217;,func2,false);<br />
addEvent(window,&#8217;load&#8217;,func3,false);</p>
<p><strong> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> getElementsByClass()</strong><br />
Originially written by nobody in particular. Several developers have implemented their own version and no one single version has proven to be better than another. As you might expect, my humble self has even had a <a href="http://www.developertutorials.com/getelementsbyclass/">crack at it</a>. This function was spawned from developers needing a quick and elegant way of grabbing elements by a className and to a developer’s surprise, it’s not an original DOM method as one might think…afterall, we have <code>getElementById</code>, <code>getElementsByName()</code>, <code>getElementsByTagName</code>, what the hell happened to <code>getElementsByClass</code>??? Here it is in all its glory:</p>
<h3 class="code">getElementsByClass by Dustin Diaz</h3>
<pre><code>function getElementsByClass(searchClass,node,tag) {

	var classElements = new Array();

	if ( node == null )

		node = document;

	if ( tag == null )

		tag = '*';

	var els = node.getElementsByTagName(tag);

	var elsLen = els.length;

	var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');

	for (i = 0, j = 0; i &lt; elsLen; i++) {

		if ( pattern.test(els[i].className) ) {

			classElements[j] = els[i];

			j++;

		}

	}

	return classElements;

}</code></pre>
<p>Simply add a class name to the beginning of the funciton and the 2nd and 3rd arguments are optional and the magic is done for you!</p>
<h2>7) cssQuery()</h2>
<p class="version">version 2.0.2</p>
<p>getElementsByTagName? Pah!</p>
<h3>Introduction</h3>
<p class="section"><strong>cssQuery()</strong> is a powerful <em>cross-browser</em> JavaScript function that    enables <a href="http://dean.edwards.name/my/cssQuery/test.html">querying</a> of a <abbr title="Document Object Model">DOM</abbr> document    using <abbr title="Cascading Style Sheets">CSS</abbr> selectors.    All <abbr>CSS1</abbr> and <abbr>CSS2</abbr> selectors are allowed plus    quite a few <abbr>CSS3</abbr> selectors.</p>
<h3>Usage</h3>
<h4>Syntax</h4>
<pre><em>elements</em> = <strong>cssQuery</strong>(selector [, from]);</pre>
<p>where <code>selector</code> (<em>required</em>) is a valid <abbr>CSS</abbr> selector    and <code>from</code> (<em>optional</em>) is a document, element or array    of elements which is filtered by <code>selector</code>.</p>
<p>The function returns a JavaScript array of elements. If there is no match, an    empty array is returned.</p>
<p>Some examples:</p>
<pre><span style="color:green;">// find all paragraphs that are direct descendants </span><span style="color:green;">//  of the document body </span><span style="color:blue;">var</span> tags = cssQuery(<span style="color:maroon;">"body &gt; p"</span>);  <span style="color:green;">// find all elements with the "href" attribute </span><span style="color:blue;">var</span> tags = cssQuery(<span style="color:maroon;">"[href]"</span>);  <span style="color:green;">// find all anchor elements with "href" equal to "#" </span><span style="color:blue;">var</span> tags = cssQuery(<span style="color:maroon;">"a[href='#']"</span>); <span style="color:green;">// find all images contained by the above anchors </span><span style="color:blue;">var</span> images = cssQuery(<span style="color:maroon;">"img"</span>, tags);  <span style="color:green;">// find all lists </span><span style="color:blue;">var</span> tags = cssQuery(<span style="color:maroon;">"dl,ol,ul"</span>);  <span style="color:green;">// query an external xml document </span><span style="color:blue;">var</span> tags = cssQuery(<span style="color:maroon;">"my|:root&gt;my|link"</span>, myXMLDoc);  <span style="color:green;">// just plain complicated </span><span style="color:blue;">var</span> complex = <span style="color:maroon;">"p&gt;a:first-child+input[type=text]~span"</span>; <span style="color:blue;">var</span> tags = cssQuery(complex);</pre>
<p><strong>6) toggle()<br />
</strong></p>
<table align="right">
<tr>
<td>  <!--    if (!document.phpAds_used) document.phpAds_used = ',';    phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);        document.write (""); //--> &lt;a href=&#8217;http://ads.developertutorials.com/adclick.php?n=af051ed1&#8242; target=&#8217;_parent&#8217;&gt;&lt;img src=&#8217;http://ads.developertutorials.com/adview.php?what=zone:6&amp;amp;n=af051ed1&#8242; border=&#8217;0&#8242; alt=&#8221;&gt;&lt;/a&gt;</td>
</tr>
</table>
<p>To be totally honest, there are probably more variations of this function than there needs to be. The history of ‘toggling’ basically comes down to showing/hiding an element upon an event being fired. To make matters much simpler, I too have put one together. But by no means is it considered the ultimate toggle function, but it does do the basic functionality of showing and hiding.</p>
<h3 class="code">toggle() by the masses</h3>
<pre><code>function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}</code></pre>
<p><strong>5) insertAfter()</strong></p>
<p>As far as I know, <a href="http://adactio.com/">Jeremy Keith</a> sort of came up with this idea even though one would have thought this too would be a DOM core method. But just like getElementsByClass, it isn’t. So rather than pulling the function straight out of the book, I’ll leave that up to <strong>you</strong> to <a href="http://www.amazon.com/gp/product/webstandardsw-20/1590595335/104-6729182-1300737">buy it</a> yourself. Instead I’ve pulled this simple method from <a href="http://www.developertutorials.com/tutorials/javascript/custom-javascript-functions-060822/page7.html#" id="KonaLink0" target="_top" class="kLink"><font color="#006600"><span class="kLink" style="color:#006600 !important;font-family:Verdana,Arial,Helvetica,sans-serif;font-weight:400;font-size:12px;position:static;">public </span><span class="kLink" style="color:#006600 !important;font-family:Verdana,Arial,Helvetica,sans-serif;font-weight:400;font-size:12px;position:static;">domain</span></font></a>:</p>
<h3 class="code">insertAfter() on public domain</h3>
<pre><code>function insertAfter(parent, node, referenceNode) {
	parent.insertBefore(node, referenceNode.nextSibling);
}</code></pre>
<p><strong>4) inArray()</strong></p>
<p>This too is very sad that this isn’t part of the DOM core functionality. But hey, it makes for fun references like this! This function however isn’t quite a function; it’s a prototype that extends the DOM Array object. I remember one day thinking to myself “surely I can do this in PHP, it’s gotta be in JavaScript.” Well, this extension makes it work just like you’d expect if you’re a PHP developer. Here is a version from <a href="http://www.embimedia.com/resources/labs/js-inarray.html">EmbiMEDIA</a></p>
<h3 class="code">inArray Prototype Array object by EmbiMedia</h3>
<pre><code>
Array.prototype.inArray = function (value) {
	var i;
	for (i=0; i &lt; this.length; i++) {
		if (this[i] === value) {
			return true;
		}
	}
	return false;
};</code></pre>
<pre></pre>
<pre><strong>3, 2, &amp; 1) getCookie(), setCookie(), deleteCookie()
             </strong></pre>
<table align="right">
<tr>
<td>  <!--    if (!document.phpAds_used) document.phpAds_used = ',';    phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);        document.write (""); //--> &lt;a href=&#8217;http://ads.developertutorials.com/adclick.php?n=af051ed1&#8242; target=&#8217;_parent&#8217;&gt;&lt;img src=&#8217;http://ads.developertutorials.com/adview.php?what=zone:6&amp;amp;n=af051ed1&#8242; border=&#8217;0&#8242; alt=&#8221;&gt;&lt;/a&gt;</td>
</tr>
</table>
<p>I honestly don’t know what I would do without these guys. I hate the DOM implementations of setting cookies in JavaScript. In PHP <a href="http://www.php.net/setcookie">it’s so easy</a>, and it’s easy for one main reason, they work just like the functions below. All three of these functions were found to be public domain and free to use.</p>
<h3 class="code">getCookie(), setCookie(), deleteCookie() open domain</h3>
<p><code>function getCookie( name ) {<br />
var start = document.cookie.indexOf( name + "=" );<br />
var len = start + name.length + 1;<br />
if ( ( !start ) &amp;&amp; ( name != document.cookie.substring( 0, name.length ) ) ) {<br />
return null;<br />
}<br />
if ( start == -1 ) return null;<br />
var end = document.cookie.indexOf( ';', len );<br />
if ( end == -1 ) end = document.cookie.length;<br />
return unescape( document.cookie.substring( len, end ) );<br />
}</p>
<p>function setCookie( name, value, expires, path, domain, secure ) {<br />
var today = new Date();<br />
today.setTime( today.getTime() );<br />
if ( expires ) {<br />
expires = expires * 1000 * 60 * 60 * 24;<br />
}<br />
var expires_date = new Date( today.getTime() + (expires) );<br />
document.cookie = name+'='+escape( value ) +<br />
( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()<br />
( ( path ) ? ';path=' + path : '' ) +<br />
( ( domain ) ? ';domain=' + domain : '' ) +<br />
( ( secure ) ? ';secure' : '' );<br />
}</p>
<p>function deleteCookie( name, path, domain ) {<br />
if ( getCookie( name ) ) document.cookie = name + '=' +<br />
( ( path ) ? ';path=' + path : '') +<br />
( ( domain ) ? ';domain=' + domain : '' ) +<br />
';expires=Thu, 01-Jan-1970 00:00:01 GMT';<br />
}</code></p>
<pre></pre>
<h3 class="code">Prototype function $</h3>
<p><code>function $() {<br />
var elements = new Array();<br />
for (var i = 0; i &lt; arguments.length; i++) {<br />
var element = arguments[i];<br />
if (typeof element == 'string')<br />
element = document.getElementById(element);<br />
if (arguments.length == 1)<br />
return element;<br />
elements.push(element);<br />
}<br />
return elements;<br />
} </code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=8&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2006/12/18/8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>deep Web , surface Web &amp; deep link.</title>
		<link>http://starcoder.wordpress.com/2006/12/16/lexibot/</link>
		<comments>http://starcoder.wordpress.com/2006/12/16/lexibot/#comments</comments>
		<pubDate>Sat, 16 Dec 2006 14:46:32 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[WEB]]></category>

		<guid isPermaLink="false">http://starcoder.wordpress.com/2006/12/16/lexibot/</guid>
		<description><![CDATA[deep Web Content on the Web that is not found in most search engine results, because it is stored in a database rather than on HTML pages. Viewing such content is accomplished by going to the Web site&#8217;s search page and typing in specific queries. LexiBot was the first search engine to actually make individual [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=4&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>deep Web </strong><br />
Content on the Web that is not found in most search engine results, because it is stored in a database rather than on HTML pages. Viewing such content is accomplished by going to the Web site&#8217;s search page and typing in specific queries. LexiBot was the first search engine to actually make individual queries to each searchable database that it finds (see LexiBot). Also known as the &#8220;invisible Web&#8221;.<br />
Password-protected content on the Web available only to members and subscribers.</p>
<blockquote><p>LexiBot</p></blockquote>
<p>A search engine from BrightPlanet Corporation, Sioux Falls, SD (www.brightplanet.com) that was the first to provide results from the deep Web. Designed as PC software for the individual searcher, it locates Web sites with content databases and sets up individual queries that would normally have to be manually entered one at a time.</p>
<p>Introduced in 2000, LexiBot evolved from the Mata Hari search engine from Visual Metrics Corp., which merged with Paulsen Marketing Communications Inc., to form BrightPlanet. LexiBot&#8217;s successor is Deep Query Manager (DQM), built with similar technology but accessed through one&#8217;s browser and behaving more like an ASP enterprise tool.</p>
<p>Check out <a target='_blank' href="http://www.pcmag.com/encyclopedia_term/0,2542,t=LexiBot&amp;i=46047,00.asp"> here </a></p>
<p><strong>surface Web</strong><br />
Content on the Web that is found in search engine results. Descriptive data and metatags on the Web pages themselves reveal the page&#8217;s contents and can be identified by the various search engine technologies.<br />
The unsecured part of the Web that is available to the general public without a password.</p>
<p><strong>deep link</strong><br />
A hyperlink to a page on a Web site that is not the home page. Although Web sites and blogs routinely provide countless deep links to other Web sites, the subject is somewhat controversial. Owners of some sites have complained that deep links bypass the ads on their home pages and cause them financial harm. Nevertheless, search engines index any and all pages found on the Web and offer billions of deep links on their results pages every day.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=4&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2006/12/16/lexibot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Deep Blue</title>
		<link>http://starcoder.wordpress.com/2006/12/16/deep-blue/</link>
		<comments>http://starcoder.wordpress.com/2006/12/16/deep-blue/#comments</comments>
		<pubDate>Sat, 16 Dec 2006 14:43:17 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[PROGRAMMING]]></category>

		<guid isPermaLink="false">http://starcoder.wordpress.com/2006/12/16/deep-blue/</guid>
		<description><![CDATA[A super computer developed by researchers at {IBM} to explore the use of {parallel processing} to solve complex computing problems. It is known as the first computer to beat the current chess World Grand Master. Deep Blue started it&#8217;s life as a PhD project at {Carnegie Mellon University} by PhD students Feng-hsiung Hsu and Murray [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=3&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A super computer developed by researchers at {IBM} to explore the use of {parallel processing} to solve complex computing problems.  It is known as the first computer to beat the current chess World Grand Master. Deep Blue started it&#8217;s life as a PhD project at {Carnegie Mellon University} by PhD students Feng-hsiung Hsu and Murray Campbell.  Chiptest, as it was known then, consisted of a custom designed chip hosted in a {Sun} 3/160 computer. The project moved over to IBM in 1989 when Hsu and Campbell joined IBM.  {Deep Thought}, as it was known by then, played for the first time against Garry Kasparov in the same year. The game of two matches was easily won by Kasparov.<br />
The next match against Kasparov took place in February 1996. By then the machine was again renamed, at that time it was known as Deep Blue.  It was also heavily re-engineered: it was by then running on a 32-node {RS/6000} cluster, each containing 8 custom designed chips.  Alas, Kasparov won again. The breakthrough finally happened in February 1997: with both the algorithm and the raw speed significantly improved, Deep Blue beat Kasparov 3.5:2.5. {HOME (http://www.chess.ibm.com)}. (1997-06-16)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=3&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2006/12/16/deep-blue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
		<item>
		<title>Ajax Cache-Control</title>
		<link>http://starcoder.wordpress.com/2006/12/05/deep-tech-fusion/</link>
		<comments>http://starcoder.wordpress.com/2006/12/05/deep-tech-fusion/#comments</comments>
		<pubDate>Tue, 05 Dec 2006 19:06:13 +0000</pubDate>
		<dc:creator>starcoder</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[APACHE]]></category>
		<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[PERL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Introduction A &#8221;&#8217;Web cache&#8221;&#8217; sits between one or more Web servers (also known as origin servers) and a client or many clients, and watches requests come by, saving copies of the responses — like HTML pages, images and files (collectively known as representations) — for itself. Then, if there is another request for the same [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=1&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong><br />
A &#8221;&#8217;Web cache&#8221;&#8217; sits between one or more Web servers (also known as origin servers) and a client or many clients, and watches requests come by, saving copies of the responses — like HTML pages, images and files (collectively known as representations) — for itself.<br />
Then, if there is another request for the same URL, it can use the response that it has, instead of asking the origin server for it again.</p>
<p>When developing with Ajax-based application we need to disable Cache.</p>
<p>This can be done by various different way&#8230;.</p>
<p>Some of them are discussed here&#8230;..</p>
<p><strong>Without Using Headers</strong> </p>
<blockquote><p>* Ajax &#8211; Cache Busting with Javascript &#8212; [fool the browser]</p></blockquote>
<p>Browsers are notorious at hanging on tenaciously to cached pages.  Even when you use all manner of fancy headers like &#8221;&#8221;Pragma: no-cache&#8221; or &#8220;Cache-Control: must-revalidate&#8221;&#8221; you&#8217;ll often find that you receive a cached page rather than a &#8216;live&#8217; one. Here&#8217;s something else you can try:</p>
<p>To the URL which requests the page, &#8221;&#8217;add a random (and meaningless) variable and value pair&#8221;&#8217;.  The value should be different each time, and although it will have no effect on the called page, it helps to fool the browser into thinking it has to return a page from a URL it&#8217;s never visited before, rather than realising it has it in cache.<br />
A good way to do this in Javascript is to add a random number:<br />
 var myDate = new Date();<br />
 var myTime = myDate.getTime();<br />
 var url=&#8217;http://localhost/call_to_ajax.php?rand=&#8217;+myTime;<br />
 http.open(&#8216;GET&#8217;, url);</p>
<p>Now, each time we call the page whose address is stored in url, we append a meaningless variable rand with a random value,</p>
<p>eg: http://localhost/call_to_ajax.php?rand=321;</p>
<blockquote><p>* Http: A Caching XmlHttpRequest Wrapper </p></blockquote>
<p>A wrapper for XmlHttpRequest that supports forced caching on FireFox and forced non-caching on IE.<br />
XmlHttpRequest is a class available in client-side JavaScript for making new HTTP requests from within a page. It is implemented as a built-in object in Safari and FireFox, and as an ActiveX object on Internet Explorer.<br />
 More about wrapper class is at http://www.adamv.com/dev/javascript/http_request&#8217;</p>
<p> Download this wrapper from http://www.adamv.com/dev/javascript/files/request.js</p>
<p><strong>Using Headers</strong></p>
<blockquote><p>* PHP &#8211; Files</p></blockquote>
<p>we need to add the following line into the files which will call by open method of object createRequestObject class.</p>
<p>e.g.<br />
http.open(&#8216;GET&#8217;, &#8216;call_to_ajax.php&#8217;);<br />
so we need to add following line into the &#8221;&#8217;call_to_ajax.php&#8221;&#8217; file.</p>
<p> header(&#8216;Expires: Fri, 09 Jan 1981 05:00:00 GMT&#8217;);<br />
 header(&#8216;Cache-Control: no-store, no-cache, must-revalidate&#8217;);<br />
 header(&#8216;Cache-Control: post-check=0, pre-check=0&#8242;, FALSE);<br />
 header(&#8216;Pragma: no-cache&#8217;);</p>
<blockquote><p>* .htaccess &#8211; Files</p></blockquote>
<p> First enables expires and headers module of apache [httpd.conf]<br />
 LoadModule expires_module modules/mod_expires.so<br />
 LoadModule headers_module modules/mod_headers.so </p>
<p> Then add the following lines into .htaccess file<br />
 ### activate mod_expires<br />
 ExpiresActive On<br />
 ### Expire everything else 1 day before<br />
 ExpiresDefault &#8220;modification M-3600&#8243;<br />
 ### Apply a Cache-Control header to call_to_ajax.php</p>
<p> Header append Cache-Control &#8220;public, must-revalidate&#8221;</p>
<blockquote><p>* PERL &#8211; Files</p></blockquote>
<p> Add the following lines of call_to_ajax.cgi or call_to_ajax.pl file<br />
 #!/usr/bin/perl<br />
 print &#8220;Content-type: text/html\n&#8221;;<br />
 print &#8220;Expires: Thu, 29 Oct 1998 17:04:19 GMT\n&#8221;;<br />
 print &#8220;\n&#8221;;</p>
<p><strong>References and Further Information </strong><br />
 Caching Tutorial</p>
<p>http://www.mnot.net/cache_docs/</p>
<p> Brian D. Davison&#8217;s Web Caching and Content Delivery Resources </p>
<p>http://www.web-caching.com/</p>
<p> Hypertext Transfer Protocol &#8212; HTTP/1.1 </p>
<p>http://www.ietf.org/rfc/rfc2616.txt</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/starcoder.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/starcoder.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/starcoder.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/starcoder.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/starcoder.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/starcoder.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/starcoder.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/starcoder.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/starcoder.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/starcoder.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/starcoder.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/starcoder.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/starcoder.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/starcoder.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/starcoder.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/starcoder.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=starcoder.wordpress.com&amp;blog=593353&amp;post=1&amp;subd=starcoder&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://starcoder.wordpress.com/2006/12/05/deep-tech-fusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14de6cc9bb671142bcacce62c7f2f837?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">starcoder</media:title>
		</media:content>
	</item>
	</channel>
</rss>
