<?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>Muthusrinivasan's Blog</title>
	<atom:link href="http://muthusrinivasan.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://muthusrinivasan.wordpress.com</link>
	<description>Think Different Think Me</description>
	<lastBuildDate>Sat, 11 Aug 2007 19:47:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='muthusrinivasan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Muthusrinivasan's Blog</title>
		<link>http://muthusrinivasan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://muthusrinivasan.wordpress.com/osd.xml" title="Muthusrinivasan&#039;s Blog" />
	<atom:link rel='hub' href='http://muthusrinivasan.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Fix Corrupted files in Win XP</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/11/fix-corrupted-files-in-win-xp/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/11/fix-corrupted-files-in-win-xp/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 17:48:29 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[Windows Tips]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/11/fix-corrupted-files-in-win-xp/</guid>
		<description><![CDATA[Required : Windows XP operating system Windows XP cd Place the xp cd in your cd/dvd drive Go to start run type in &#8216;sfc /scannow&#8217; (without the &#8216;) Now it should all load, and fix all your corrupted file on windows XP<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=83&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Required :<br />
Windows XP operating system<br />
Windows XP cd</p>
<p>Place the xp cd in your cd/dvd drive<br />
Go to start<br />
run<br />
type in &#8216;sfc /scannow&#8217; (without the &#8216;)</p>
<p>Now it should all load, and fix all your corrupted file on windows XP <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/83/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/83/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=83&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/11/fix-corrupted-files-in-win-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>Open command prompt from here</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/11/open-command-prompt-from-here/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/11/open-command-prompt-from-here/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 17:42:33 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[Windows Tips]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/11/open-command-prompt-from-here/</guid>
		<description><![CDATA[add the open cmd prompt to folder context menus also drives and My Computer copy what&#8217;s in the code area to notepad and save as cmd here.reg CODE Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Drive\shell\cmd] @=&#8221;Command Prompt&#8221; [HKEY_CLASSES_ROOT\Drive\shell\cmd\command] @=&#8221;cmd.exe /k \&#8221;cd %L\&#8221;" [HKEY_CLASSES_ROOT\Directory\shell\cmd] @=&#8221;Command Prompt&#8221; [HKEY_CLASSES_ROOT\Directory\shell\cmd\command] @=&#8221;cmd.exe /k \&#8221;cd %L\&#8221;" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\cmd] @=&#8221;Command Prompt&#8221; [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\cmd\command] @=&#8221;cmd.exe /k [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=82&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>add the open cmd prompt to folder context menus<br />
also drives and My Computer</p>
<p>copy what&#8217;s in the code area to notepad and save as cmd here.reg</p>
<p>CODE</p>
<p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_CLASSES_ROOT\Drive\shell\cmd]<br />
@=&#8221;Command Prompt&#8221;</p>
<p>[HKEY_CLASSES_ROOT\Drive\shell\cmd\command]<br />
@=&#8221;cmd.exe /k \&#8221;cd %L\&#8221;"</p>
<p>[HKEY_CLASSES_ROOT\Directory\shell\cmd]<br />
@=&#8221;Command Prompt&#8221;</p>
<p>[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]<br />
@=&#8221;cmd.exe /k \&#8221;cd %L\&#8221;"</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\cmd]<br />
@=&#8221;Command Prompt&#8221;</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\cmd\command]<br />
@=&#8221;cmd.exe /k \&#8221;cd %L\&#8221;"</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/82/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/82/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=82&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/11/open-command-prompt-from-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>COMMON FTP ERROR CODES</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/11/common-ftp-error-codes/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/11/common-ftp-error-codes/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 17:41:45 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[Windows Tips]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/11/common-ftp-error-codes/</guid>
		<description><![CDATA[~~~~~~~~~COMMON FTP ERROR CODES~~~~~~~~~~ # Description 110 Restart marker reply. In this case, the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm where yyyy is User-process data stream marker, and mmmm server&#8217;s equivalent marker (note the spaces between markers and &#8220;=&#8221;). 120 Service ready in nnn [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=81&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>~~~~~~~~~COMMON FTP ERROR CODES~~~~~~~~~~</p>
<p># Description</p>
<p>110 Restart marker reply. In this case, the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm where yyyy is User-process data stream marker, and mmmm server&#8217;s equivalent marker (note the spaces between markers and &#8220;=&#8221;).</p>
<p>120 Service ready in nnn minutes.</p>
<p>125 Data connection already open; transfer starting.</p>
<p>150 File status okay; about to open data connection.</p>
<p>200 Command okay.</p>
<p>202 Command not implemented, superfluous at this site.</p>
<p>211 System status, or system help reply.</p>
<p>212 Directory status.</p>
<p>213 File status.</p>
<p>214 Help message.On how to use the server or the meaning of a particular non-standard command. This reply is useful only to the human user.</p>
<p>215 NAME system type. Where NAME is an official system name from the list in the Assigned Numbers document.</p>
<p>220 Service ready for new user.</p>
<p>221 Service closing control connection.</p>
<p>225 Data connection open; no transfer in progress.</p>
<p>226 Closing data connection. Requested file action successful (for example, file transfer or file abort).</p>
<p>227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).</p>
<p>230 User logged in, proceed. Logged out if appropriate.</p>
<p>250 Requested file action okay, completed.</p>
<p>257 &#8220;PATHNAME&#8221; created.</p>
<p>331 User name okay, need password.</p>
<p>332 Need account for login.</p>
<p>350 Requested file action pending further information</p>
<p>421 Service not available, closing control connection.This may be a reply to any command if the service knows it must shut down.</p>
<p>425 Can&#8217;t open data connection.</p>
<p>426 Connection closed; transfer aborted.</p>
<p>450 Requested file action not taken.</p>
<p>451 Requested action aborted. Local error in processing.</p>
<p>452 Requested action not taken. Insufficient storage space in system.File unavailable (e.g., file busy).</p>
<p>500 Syntax error, command unrecognized. This may include errors such as command line too long.</p>
<p>501 Syntax error in parameters or arguments.</p>
<p>502 Command not implemented.</p>
<p>503 Bad sequence of commands.</p>
<p>504 Command not implemented for that parameter.</p>
<p>530 Not logged in.</p>
<p>532 Need account for storing files.</p>
<p>550 Requested action not taken. File unavailable (e.g., file not found, no access).</p>
<p>551 Requested action aborted. Page type unknown.</p>
<p>552 Requested file action aborted. Exceeded storage allocation (for current directory or dataset).</p>
<p>553 Requested action not taken. File name not allowed.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/81/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/81/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=81&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/11/common-ftp-error-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>Computer Acronyms</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/11/computer-acronyms/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/11/computer-acronyms/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 17:21:04 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[Windows Tips]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/11/computer-acronyms/</guid>
		<description><![CDATA[ADSL &#8211; Asymmetric Digital Subscriber Line AGP &#8211; Accelerated Graphics Port ALI &#8211; Acer Labs, Incorporated ALU &#8211; Arithmetic Logic Unit AMD &#8211; Advanced Micro Devices APC &#8211; American Power Conversion ASCII &#8211; American Standard Code for Information Interchange ASIC &#8211; Application Specific Integrated Circuit ASPI &#8211; Advanced SCSI Programming Interface AT &#8211; Advanced Technology [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=80&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ADSL &#8211; Asymmetric Digital Subscriber Line<br />
AGP &#8211; Accelerated Graphics Port<br />
ALI &#8211; Acer Labs, Incorporated<br />
ALU &#8211; Arithmetic Logic Unit<br />
AMD &#8211; Advanced Micro Devices<br />
APC &#8211; American Power Conversion<br />
ASCII &#8211; American Standard Code for Information Interchange<br />
ASIC &#8211; Application Specific Integrated Circuit<br />
ASPI &#8211; Advanced SCSI Programming Interface<br />
AT &#8211; Advanced Technology<br />
ATI &#8211; ATI Technologies Inc.<br />
ATX &#8211; Advanced Technology Extended</p>
<p>&#8212; B &#8212;<br />
BFG &#8211; BFG Technologies<br />
BIOS &#8211; Basic Input Output System<br />
BNC &#8211; Barrel Nut Connector</p>
<p>&#8212; C &#8212;<br />
CAS &#8211; Column Address Signal<br />
CD &#8211; Compact Disk<br />
CDR &#8211; Compact Disk Recorder<br />
CDRW &#8211; Compact Disk Re-Writer<br />
CD-ROM &#8211; Compact Disk &#8211; Read Only Memory<br />
CFM &#8211; Cubic Feet per Minute (ft /min)<br />
CMOS &#8211; Complementary Metal Oxide Semiconductor<br />
CPU &#8211; Central Processing Unit<br />
CTX &#8211; CTX Technology Corporation (Commited to Excellence)</p>
<p>&#8212; D &#8212;</p>
<p>DDR &#8211; Double Data Rate<br />
DDR-SDRAM &#8211; Double Data Rate &#8211; Synchronous Dynamic Random Access Memory<br />
DFI &#8211; DFI Inc. (Design for Innovation)<br />
DIMM &#8211; Dual Inline Memory Module<br />
DRAM &#8211; Dynamic Random Access Memory<br />
DPI &#8211; Dots Per Inch<br />
DSL &#8211; See ASDL<br />
DVD &#8211; Digital Versatile Disc<br />
DVD-RAM &#8211; Digital Versatile Disk &#8211; Random Access Memory</p>
<p>&#8212; E &#8212;<br />
ECC &#8211; Error Correction Code<br />
ECS &#8211; Elitegroup Computer Systems<br />
EDO &#8211; Extended Data Out<br />
EEPROM &#8211; Electrically Erasable Programmable Read-Only Memory<br />
EPROM &#8211; Erasable Programmable Read-Only Memory<br />
EVGA &#8211; EVGA Corporation</p>
<p>&#8212; F &#8212;<br />
FC-PGA &#8211; Flip Chip Pin Grid Array<br />
FDC &#8211; Floppy Disk Controller<br />
FDD &#8211; Floppy Disk Drive<br />
FPS &#8211; Frame Per Second<br />
FPU &#8211; Floating Point Unit<br />
FSAA &#8211; Full Screen Anti-Aliasing<br />
FS &#8211; For Sale<br />
FSB &#8211; Front Side Bus</p>
<p>&#8212; G &#8212;<br />
GB &#8211; Gigabytes<br />
GBps &#8211; Gigabytes per second or Gigabits per second<br />
GDI &#8211; Graphical Device Interface<br />
GHz &#8211; GigaHertz</p>
<p>&#8212; H &#8212;<br />
HDD &#8211; Hard Disk Drive<br />
HIS &#8211; Hightech Information System Limited<br />
HP &#8211; Hewlett-Packard Development Company<br />
HSF &#8211; Heatsink-Fan</p>
<p>&#8212; I &#8212;<br />
IBM &#8211; International Business Machines Corporation<br />
IC &#8211; Integrated Circuit<br />
IDE &#8211; Integrated Drive Electronics<br />
IFS- Item for Sale<br />
IRQ &#8211; Interrupt Request<br />
ISA &#8211; Industry Standard Architecture<br />
ISO &#8211; International Standards Organization</p>
<p>&#8212; J &#8212;<br />
JBL &#8211; JBL (Jame B. Lansing) Speakers<br />
JVC &#8211; JVC Company of America</p>
<p>- K &#8212;<br />
Kbps &#8211; Kilobits Per Second<br />
KBps &#8211; KiloBytes per second</p>
<p>&#8212; L &#8212;<br />
LG &#8211; LG Electronics<br />
LAN &#8211; Local Are Network<br />
LCD &#8211; Liquid Crystal Display<br />
LDT &#8211; Lightning Data Transport<br />
LED &#8211; Light Emitting Diode</p>
<p>&#8212; M &#8212;<br />
MAC &#8211; Media Access Control<br />
MB   MotherBoard or Megabyte<br />
MBps &#8211; Megabytes Per Second<br />
Mbps &#8211; Megabits Per Second or Megabits Per Second<br />
MHz &#8211; MegaHertz<br />
MIPS &#8211; Million Instructions Per Second<br />
MMX &#8211; Multi-Media Extensions<br />
MSI &#8211; Micro Star International</p>
<p>&#8212; N &#8212;<br />
NAS &#8211; Network Attached Storage<br />
NAT &#8211; Network Address Translation<br />
NEC &#8211; NEC Corporation<br />
NIC &#8211; Network Interface Card</p>
<p>&#8212; O &#8212;<br />
OC &#8211; Overclock (Over Clock)<br />
OCZ &#8211; OCZ Technology<br />
OEM &#8211; Original Equipment Manufacturer</p>
<p>&#8212; P &#8212;<br />
PC &#8211; Personal Computer<br />
PCB &#8211; Printed Circuit Board<br />
PCI &#8211; Peripheral Component Interconnect<br />
PDA &#8211; Personal Digital Assistant<br />
PCMCIA &#8211; Peripheral Component Microchannel Interconnect Architecture<br />
PGA &#8211; Professional Graphics Array<br />
PLD &#8211; Programmable Logic Device<br />
PM &#8211; Private Message / Private Messaging<br />
PnP &#8211; Plug &#8216;n Play<br />
PNY &#8211; PNY Technology<br />
POST &#8211; Power On Self Test<br />
PPPoA &#8211; Point-to-Point Protocol over ATM<br />
PPPoE &#8211; Point-to-Point Protocol over Ethernet<br />
PQI &#8211; PQI Corporation<br />
PSU &#8211; Power Supply Unit</p>
<p>&#8212; R &#8212;<br />
RAID &#8211; Redundant Array of Inexpensive Disks<br />
RAM &#8211; Random Access Memory<br />
RAMDAC &#8211; Random Access Memory Digital Analog Convertor<br />
RDRAM &#8211; Rambus Dynamic Random Access Memory<br />
ROM &#8211; Read Only Memory<br />
RPM &#8211; Revolutions Per Minute</p>
<p>&#8212; S &#8212;<br />
SASID &#8211; Self-scanned Amorphous Silicon Integrated Display<br />
SCA &#8211; SCSI Configured Automatically<br />
SCSI &#8211; Small Computer System Interface<br />
SDRAM &#8211; Synchronous Dynamic Random Access Memory<br />
SECC &#8211; Single Edge Contact Connector<br />
SODIMM &#8211; Small Outline Dual Inline Memory Module<br />
SPARC &#8211; Scalable Processor ArChitecture<br />
SOHO &#8211; Small Office Home Office<br />
SRAM &#8211; Static Random Access Memory<br />
SSE &#8211; Streaming SIMD Extensions<br />
SVGA &#8211; Super Video Graphics Array<br />
S/PDIF &#8211; Sony/Philips Digital Interface</p>
<p>&#8212; T &#8212;<br />
TB &#8211; Terabytes<br />
TBps &#8211; Terabytes per second<br />
Tbps &#8211; Terabits per second<br />
TDK &#8211; TDK Electronics<br />
TEC &#8211; Thermoelectric Cooler<br />
TPC &#8211; TipidPC<br />
TWAIN &#8211; Technology Without An Important Name</p>
<p>&#8212; U &#8212;<br />
UART &#8211; Universal Asynchronous Receiver/Transmitter<br />
USB &#8211; Universal Serial Bus<br />
UTP &#8211; Unshieled Twisted Pair</p>
<p>&#8212; V &#8212;<br />
VCD &#8211; Video CD<br />
VPN &#8211; Virtual Private Network</p>
<p>&#8212; W &#8212;<br />
WAN &#8211; Wide Area Network<br />
WTB &#8211; Want to Buy<br />
WYSIWYG &#8211; What You See Is What You Get</p>
<p>&#8212; X &#8212;<br />
XGA &#8211; Extended Graphics Array<br />
XFX &#8211; XFX Graphics, a Division of Pine<br />
XMS &#8211; Extended Memory Specification<br />
XT &#8211; Extended Technology</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/80/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/80/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=80&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/11/computer-acronyms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>how torrent works</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/11/how-torrent-works/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/11/how-torrent-works/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 17:19:09 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[Windows Tips]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/11/how-torrent-works/</guid>
		<description><![CDATA[BitTorrent is a protocol designed for transferring files. It is peer-to-peer in nature, as users connect to each other directly to send and receive portions of the file. However, there is a central server (called a tracker) which coordinates the action of all such peers. The tracker only manages connections, it does not have any [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=79&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>BitTorrent is a protocol designed for transferring files. It is peer-to-peer in nature, as users connect to each other directly to send and receive portions of the file. However, there is a central server (called a tracker) which coordinates the action of all such peers. The tracker only manages connections, it does not have any knowledge of the contents of the files being distributed, and therefore a large number of users can be supported with relatively limited tracker bandwidth. The key philosophy of BitTorrent is that users should upload (transmit outbound) at the same time they are downloading (receiving inbound.) In this manner, network bandwidth is utilized as efficiently as possible. BitTorrent is designed to work better as the number of people interested in a certain file increases, in contrast to other file transfer protocols.</p>
<p>One analogy to describe this process might be to visualize a group of people sitting at a table. Each person at the table can both talk and listen to any other person at the table. These people are each trying to get a complete copy of a book. Person A announces that he has pages 1-10, 23, 42-50, and 75. Persons C, D, and E are each missing some of those pages that A has, and so they coordinate such that A gives them each copies of the pages he has that they are missing. Person B then announces that she has pages 11-22, 31-37, and 63-70. Persons A, D, and E tell B they would like some of her pages, so she gives them copies of the pages that she has. The process continues around the table until everyone has announced what they have (and hence what they are missing.) The people at the table coordinate to swap parts of this book until everyone has everything. There is also another person at the table, who we&#8217;ll call &#8216;S&#8217;. This person has a complete copy of the book, and so doesn&#8217;t need anything sent to him. He responds with pages that no one else in the group has. At first, when everyone has just arrived, they all must talk to him to get their first set of pages. However, the people are smart enough to not all get the same pages from him. After a short while they all have most of the book amongst themselves, even if no one person has the whole thing. In this manner, this one person can share a book that he has with many other people, without having to give a full copy to everyone that&#8217;s interested. He can instead give out different parts to different people, and they will be able to share it amongst themselves. This person who we&#8217;ve referred to as &#8216;S&#8217; is called a seed in the terminology of BitTorrent.</p>
<p>How does BitTorrent compare to other forms of file transfer?<br />
The most common method by which files are transferred on the Internet is the client-server model. A central server sends the entire file to each client that requests it &#8212; this is how both http and ftp work. The clients only speak to the server, and never to each other. The main advantages of this method are that it&#8217;s simple to set up, and the files are usually always available since the servers tend to be dedicated to the task of serving, and are always on and connected to the Internet. However, this model has a significant problem with files that are large or very popular, or both. Namely, it takes a great deal of bandwidth and server resources to distribute such a file, since the server must transmit the entire file to each client. Perhaps you may have tried to download a demo of a new game just released, or CD images of a new Linux distribution, and found that all the servers report &#8220;too many users,&#8221; or there is a long queue that you have to wait through. The concept of mirrors partially addresses this shortcoming by distributing the load across multiple servers. But it requires a lot of coordination and effort to set up an efficient network of mirrors, and it&#8217;s usually only feasible for the busiest of sites.</p>
<p>Another method of transferring files has become popular recently: the peer-to-peer network, systems such as Kazaa, eDonkey, Gnutella, Direct Connect, etc. In most of these networks, ordinary Internet users trade files by directly connecting one-to-one. The advantage here is that files can be shared without having access to a proper server, and because of this there is little accountability for the contents of the files. Hence, these networks tend to be very popular for illicit files such as music, movies, pirated software, etc. Typically, a downloader receives a file from a single source, however the newest version of some clients allow downloading a single file from multiple sources for higher speeds. The problem discussed above of popular downloads is somewhat mitigated, because there&#8217;s a greater chance that a popular file will be offered by a number of peers. The breadth of files available tends to be fairly good, though download speeds for obscure files tend to be low. Another common problem sometimes associated with these systems is the significant protocol overhead for passing search queries amongst the peers, and the number of peers that one can reach is often limited as a result. Partially downloaded files are usually not available to other peers, although some newer clients may offer this functionality. Availability is generally dependent on the goodwill of the users, to the extent that some of these networks have tried to enforce rules or restrictions regarding send/receive ratios.</p>
<p>Use of the Usenet binary newsgroups is yet another method of file distribution, one that is substantially different from the other methods. Files transferred over Usenet are often subject to miniscule windows of opportunity. Typical retention time of binary news servers are often as low as 24 hours, and having a posted file available for a week is considered a long time. However, the Usenet model is relatively efficient, in that the messages are passed around a large web of peers from one news server to another, and finally fanned out to the end user from there. Often the end user connects to a server provided by his or her ISP, resulting in further bandwidth savings. Usenet is also one of the more anonymous forms of file sharing, and it too is often used for illicit files of almost any nature. Due to the nature of NNTP, a file&#8217;s popularity has little to do with its availability and hence downloads from Usenet tend to be quite fast regardless of content. The downsides of this method include a baroque set of rules and procedures, and requires a certain amount of effort and understanding from the user. Patience is often required to get a complete file due to the nature of splitting big files into a huge number of smaller posts. Finally, access to Usenet often must be purchased due to the extremely high volume of messages in the binary groups.</p>
<p>BitTorrent is closest to Usenet, in my opinion. It is best suited to newer files, of which a number of people have interest in. Obscure or older files tend to not be available. Perhaps as the software matures a more suitable means of keeping torrents seeded will emerge, but currently the client is quite resource-intensive, making it cumbersome to share a number of files. BitTorrent also deals well with files that are in high demand, especially compared to the other methods.</p>
<p>Where can I download the BitTorrent program?<br />
There are several choices here, because unlike some peer to peer applications (such as Kazaa), the BitTorrent implementation is open source. This means that programmers are free to take the source code to the program and modify it, if they feel there is something they&#8217;d like to change. Here are the various clients of which I am aware:</p>
<p>azureus: ( my no 1 )</p>
<p>http://azureus.sourceforge.net/</p>
<p>bittorrent++:</p>
<p>http://sourceforge.net/projects/btplusplus/</p>
<p>simplebit:</p>
<p>http://sourceforge.net/projects/simplebt/</p>
<p>bittorrent:</p>
<p>http://www.bittorrent.com/</p>
<p>What do all these words mean? (seeding, uploading, share rating, etc.)</p>
<p>Here is a brief list of words associated with BitTorrent and their meanings.</p>
<p>torrent:</p>
<p>Usually this refers to the small metadata file you receive from the web server (the one that ends in .torrent.) Metadata here means that the file contains information about the data you want to download, not the data itself. This is what is sent to your computer when you click on a download link on a website. You can also save the torrent file to your local system, and then click on it to open the BitTorrent download. This is useful if you want to be able to re-open the torrent later on without having to find the link again.<br />
In some uses, it can also refer to everything associated with a certain file available with BitTorrent. For example, someone might say &#8220;I downloaded that torrent&#8221; or &#8220;that server has a lot of good torrents&#8221;, meaning there are lots of good files available via BitTorrent on that server.</p>
<p>peer:</p>
<p>A peer is another computer on the internet that you connect to and transfer data. Generally a peer does not have the complete file, otherwise it would be called a seed. Some people also refer to peers as leeches, to distinguish them from those generous folks who have completed their download and continue to leave the client running and act as a seed.</p>
<p>seed:</p>
<p>A computer that has a complete copy of a certain torrent. Once your client finishes downloading, it will remain open until you click the Finish button (or otherwise close it.) This is known as being a seed or seeding. You can also start a BT client with a complete file, and once BT has checked the file it will connect and seed the file to others. Generally, it&#8217;s considered good manners to continue seeding a file after you have finished downloading, to help out others. Also, when a new torrent is posted to a tracker, someone must seed it in order for it to be available to others. Remember, the tracker doesn&#8217;t know anything of the actual contents of a file, so it&#8217;s important to follow through and seed a file if you upload the torrent to a tracker.</p>
<p>reseed:</p>
<p>When there are zero seeds for a given torrent (and not enough peers to have a distributed copy), then eventually all the peers will get stuck with an incomplete file, since no one in the swarm has the missing pieces. When this happens, someone with a complete file (a seed) must connect to the swarm so that those missing pieces can be transferred. This is called reseeding. Usually a request for a reseed comes with an implicit promise that the requester will leave his or her client open for some time period after finishing (to add longevity to the torrent) in return for the kind soul reseeding the file.</p>
<p>swarm:</p>
<p>The group of machines that are collectively connected for a particular file. For example, if you start a BitTorrent client and it tells you that you&#8217;re connected to 10 peers and 3 seeds, then the swarm consists of you and those 13 other people.<br />
tracker<br />
A server on the Internet that acts to coordinate the action of BitTorrent clients. When you open a torrent, your machine contacts the tracker and asks for a list of peers to contact. Periodically throughout the transfer, your machine will check in with the tracker, telling it how much you&#8217;ve downloaded and uploaded, how much you have left before finishing, and the state you&#8217;re in (starting, finished download, stopping.) If a tracker is down and you try to open a torrent, you will be unable to connect. If a tracker goes down during a torrent (i.e., you have already connected at some point and are already talking to peers), you will be able to continue transferring with those peers, but no new peers will be able to contact you. Often tracker errors are temporary, so the best thing to do is just wait and leave the client open to continue trying.</p>
<p>downloading:</p>
<p>Receiving data FROM another computer.</p>
<p>uploading:</p>
<p>Sending data TO another computer.</p>
<p>share rating:</p>
<p>If you are using the experimental client with the stats-patch, you will see a share rating displayed on the GUI panel. This is simply the ratio of your amount uploaded divided by your amount downloaded. The amounts used are for the current session only, not over the history of the file. If you achieve a share ratio of 1.0, that would mean you&#8217;ve uploaded as much as you&#8217;ve downloaded. The higher the number, the more you have contributed. If you see a share ratio of &#8220;oo&#8221;, this means infinity, which will happen if you open a BT client with a complete file (i.e., you seed the file.) In this case you download nothing since you have the full file, and so anything you send will cause the ratio to reach infinity. Note: The share rating is just a number that is displayed for your convenience. It does not directly affect any aspect of the client at all. In general, out of courtesy to others you should strive to keep this ratio as high as possible, of course.</p>
<p>distributed copies:</p>
<p>In some versions of the client, you will see the text &#8220;Connected to n seeds; also seeing n.nnn distributed copies.&#8221; A seed is a machine with the complete file. However, the swarm can collectively have a complete copy (or copies) of the file, and that is what this is telling you. Referring again to the &#8220;people at a table&#8221; analogy, consider the case where the book has 10 pages, and person A has pp.1-5 and B has pp.6-10. Collectively, A and B have a complete copy of the book, even though no one person has the whole thing. In other words, even if there are no seeds, as long as there is at least one distributed copy of the file everyone can eventually get a complete file. Meditate on this, the Zen of BitTorrent, grasshopper.</p>
<p>choked:</p>
<p>This is a term used in the description of the BitTorrent protocol. It refers to the state of an uploader, i.e. the thread that sends data to another peer. When a connection is choked, it means that the transmitter doesn&#8217;t currently want to send anything on that link. A BT client signals that it&#8217;s choked to other clients for a number of reasons, but the most common is that by default a client will only maintain &#8211;max_uploads active simultaneous uploads, the rest will be marked choked. (The default value is 4 and this is the same setting that experimental client GUI lets you adjust.) A connection can also be choked for other reasons, for example a peer downloading from a seed will mark his connection as choked since the seed is not interested in receiving anything. Note that since each connection is bidirectional and symmetrical, there are two choked flags for each connection, one for each Tx endpoint.</p>
<p>interested:</p>
<p>Another term used in the protocol specification. This is the corollary to the choked flag, in that interested refers to the state of a downloader with respect to a connection. A downloader is marked as interested if the other end of the link has any pieces that the client wants, otherwise the connection is marked as not interested.</p>
<p>snubbed:</p>
<p>If the client has not received anything after a certain period (default: 60 seconds), it marks a connection as snubbed, in that the peer on the other end has chosen not to send in a while. See the definition of choked for reasons why an uploader might mark a connection as choked. The real function of keeping track of this variable is to improve download speeds. Occasionally the client will find itself in a state where even though it is connected to many peers, it is choked by all of them. The client uses the snubbed flag in an attempt to prevent this situation. It notes that a peer with whom it would like to trade pieces with has not sent anything in a while, and rather than leaving it up to the optimistic choking to eventuall select that peer, it instead reserves one of its upload slots for sending to that peer. (Reference)</p>
<p>optimistic unchoking:</p>
<p>Periodically, the client shakes up the list of uploaders and tries sending on different connections that were previously choked, and choking the connections it was just using. You can observe this action every 10 or 20 seconds or so, by watching the &#8220;Advanced&#8221; panel of one of the experimental clients.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/79/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/79/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=79&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/11/how-torrent-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>Change The Default Location For Installing Apps</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/11/change-the-default-location-for-installing-apps/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/11/change-the-default-location-for-installing-apps/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 06:52:41 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[Windows Tips]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/11/change-the-default-location-for-installing-apps/</guid>
		<description><![CDATA[As the size of hardrives increase, more people are using partitions to seperate and store groups of files. XP uses the C:\Program Files directory as the default base directory into which new programs are installed. However, you can change the default installation drive and/ or directory by using a Registry hack. Run the Registry Editor [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=78&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As the size of hardrives increase, more people are using partitions to seperate and store groups of files.</p>
<p>XP uses the C:\Program Files directory as the default base directory into which new programs are installed. However, you can change the default installation drive and/ or directory by using a Registry hack.</p>
<p>Run the Registry Editor (regedit)and go to</p>
<p>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion</p>
<p>Look for the value named ProgramFilesDir. by default,this value will be C:\Program Files. Edit the value to any valid drive or folder and XP will use that new location as the default installation directory for new programs.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/78/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/78/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=78&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/11/change-the-default-location-for-installing-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>Firefox Tips</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/07/firefox-tips/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/07/firefox-tips/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 15:12:56 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Windows Tips]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/07/firefox-tips/</guid>
		<description><![CDATA[Tip: Double Clicking empty space on the Tab Bar will open a &#8216;New Tab&#8217; Tip: Middleclick/MouseWheelClick on a Bookmark on your Personal Toolbar will open it up in a New Tab Tip: MiddleClick/MouseWheel Click on a folder will open all the bookmarks in the folder in a new Tab(s) Tip: holding down the Shift or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=73&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Tip: Double Clicking empty space on the Tab Bar will open a &#8216;New Tab&#8217;</p>
<p>Tip: Middleclick/MouseWheelClick on a Bookmark on your Personal Toolbar will open it up in a New Tab</p>
<p>Tip: MiddleClick/MouseWheel Click on a folder will open all the bookmarks in the folder in a new Tab(s)</p>
<p>Tip: holding down the Shift or Ctrl key when you RightClick to &#8220;View Image&#8221; or &#8220;View Backround Image&#8221;will open the image in a New Tab or New Window.</p>
<p>Tip: Unused menus or menu Items can be hidden by using the customizing your userChrome.css stylesheet</p>
<p>Tip: MiddleClick/MouseWheel Click on a Tab will close that Tab.</p>
<p>Tip: MiddleClick/MouseWheel Click on a History item will open the page in a new Tab</p>
<p>Tip: MiddleClick/MouseWheel Click on the Back and Forward buttons will open the last/next page in a new Tab</p>
<p>Tip: MiddleClick/MouseWheel Click on the Home button will open your homepage in a new Tab(s)</p>
<p>Tip: MiddleClick/MouseWheel Click on the Throbber (the &#8216;busy&#8217; icon at the top-right) will open the Firefox homepage in a new Tab</p>
<p>Tip: For those without middle mouse buttons or mousewheels, ctrl-click will also open new tabs for links, bookmarks, bookmark folders, history items, and toolbar buttons</p>
<p>Tip: Ctrl+TAB you can navigate in the tabs to the right</p>
<p>Tip: Ctrl+Shift+Tab you can navigate in the tabs to the left</p>
<p>Tip: Many Laptops mimic the MiddleClick/MouseWheelClick function if you click both right/left pads at the same time.</p>
<p>Tip: Set mutliple Home pages : Tools&#8212;-&gt;Options&#8212;&gt;General and seperate each page with the pipe | symbol<br />
(eg) h**p://forums.mozillazine.org/|h**p://www.google.com</p>
<p>Tip: Clear your Download history to make the download manager more responsive : Tools&#8212;-&gt;Options&#8212;&gt;Privacy</p>
<p>Tip: Rearrange add/remove Icons on Toolbars: View&#8212;&gt;ToolBars&#8212;&gt;Customize&#8230;.</p>
<p>Tip: Drag any link to the Download Manager Window to add &amp; download the link</p>
<p>Tip: Pressing ctrl+enter will add h**p://www. before and .com after the text in the toolbar and load the resulting url. Similarly, shift+enter will add h**p://www. and .net, and ctrl+shift+enter will add h**p://www. and .org</p>
<p>Tip: You can work offline like in IE by clicking File&gt;Work Offline. This means that you can browse your previously visited pages even when you&#8217;re offline.</p>
<p>Tip: If you wish to remove an item from your Address Bar Drop down menu, Highlight it WITHOUT CLICKING and use Shift+Delete</p>
<p>Tip: A bookmarks&#8217;s position Dragged &amp; Dropped (ie. change position in a Folder or move from one folder to another or move to another position on the toolbar) by highlighting it &amp; clicking on it (WITHOUT LETTING GO) and Dragging it to your desired position</p>
<p>Tip: A Folder can be move the same way as above tip but u MUST hold down the SHIFT key while Dragging</p>
<p>Tip: Former/current users of IE who are accustomed to copying items from &#8220;Temporary Internet Files&#8221; folder (FireFox calls it &#8220;Cache&#8221; ) can achieve the same results by Tools&#8212;&gt;Page Info and then select the &#8220;Media&#8221; Tab, then Highlight the item u want to download and clicking &#8220;Save As&#8230;&#8221;</p>
<p>Tip: If u accidentally delete a bookmark and want to recover it, if it is not already open then, open the &#8220;Bookmarks Manager&#8221; (Bookmarks&#8212;&gt;Manage Bookmarks) and either use Ctrl+Z or Edit&#8212;&gt;Undo (in The Bookmarks Manager)</p>
<p>Tip: DoubleClicking a file entry in the Downloads Manager will open/launch the file (provided u haven&#8217;t moved it yet)</p>
<p>Tip: You can also directly download anything from a page by drag and dropping it onto the &#8216;download&#8217; icon in your toolbar (provided you put it there in &#8216;right-click &gt; customize&#8217;)</p>
<p>Tip: You can bookmark the current page by dragging the icon from the location bar to your Bookmarks folder. You can also drag it to the desktop to make an icon for that page</p>
<p>Tip: Of course, you can also do what the last tip said in the other direction: drag a text file, a link, a picture, etcetera&#8230; from your folders or your desktop to Firefox and it will open in Firefox</p>
<p>Tip: You can save all open tabs in a bookmark folder. Ctl-D, select the &#8220;bookmark all tabs in a folder&#8221; select or create a folder.</p>
<p>Tip: To stop animated gifs from moving, press the ESC key.</p>
<p>Tip: Instead of clicking the Back or Forward buttons, hold down the Shift key and turn the scroll wheel to back or forward</p>
<p>Tip: you can give &#8220;keywords&#8221; to your bookmarks by right-clicking the bookmark and then Properties. If you put a string in the keyword field now you can type that keyword in the address bar and it will go to that bookmark. For example, if I have a bookmark for the firefox website, I might give it the keyword &#8220;ff&#8221;. Now, when I type &#8220;ff&#8221; in the address bar, it goes to the firefox site. I find it is often faster than going through your bookmarks to find it</p>
<p>Tip: Ctrl and a number key will go to the tab indicated by the number. (e.g. Ctrl+3 will go to the third tab from the left)</p>
<p>Tip: CTRL+F5 refreshes the page without accessign the file cache</p>
<p><span style="font-weight:bold;"><span style="color:blue;">Firefox Mouse Tips</span></span></p>
<p>Middle Click<br />
Note: Two-button mouse</p>
<p>For those without middle mouse buttons or mousewheels, ctrl-click will also open new tabs for links, bookmarks, bookmark folders, history items, and toolbar buttons.</p>
<p>Many Laptops mimic the MiddleClick/MouseWheelClick function if you click both right/left pads at the same time.</p>
<p>Clicking both mouse buttons at the same time also mimics the MiddleClick/MouseWheelClick function.</p>
<p>Tabs</p>
<p>MiddleClick/MouseWheel Click on a Tab will close that Tab.</p>
<p>Personal Toolbar</p>
<p>Middleclick/MouseWheelClick on a Bookmark on your Personal Toolbar will open it up in a New Tab</p>
<p>Folders</p>
<p>MiddleClick/MouseWheel Click on a folder will open all the bookmarks in the folder in a new Tab(s)</p>
<p>History</p>
<p>MiddleClick/MouseWheel Click on a History item will open the page in a new Tab.</p>
<p>Back and Forward buttons</p>
<p>MiddleClick/MouseWheel Click on the Back and Forward buttons will open the last/next page in a new Tab.</p>
<p>Home button</p>
<p>MiddleClick/MouseWheel Click on the Home button will open your homepage in a new Tab(s).</p>
<p>Links</p>
<p>MiddleClick/MouseWheel Click on a link will open that link in a new tab.</p>
<p>Throbber</p>
<p>MiddleClick/MouseWheel Click on the Throbber (the &#8216;busy&#8217; icon at the top-right) will open the Firefox homepage in a new Tab.</p>
<p>Images</p>
<p>Middleclick/MouseWheelClick on &#8220;View Image&#8221; or &#8220;View Background Image&#8221; will open the image in a New Tab.</p>
<p>Double Click<br />
Download Manager</p>
<p>DoubleClicking a file entry in the Downloads Manager will open/launch the file (provided you haven&#8217;t moved it yet)</p>
<p>Tab Bar</p>
<p>Double Clicking empty space on the Tab Bar will open a &#8216;New Tab&#8217;</p>
<p>Right Click<br />
Customize Toolbar</p>
<p>You can adjust your toolbars to your liking. Right click on any toolbar, and select &#8216;Customize&#8217;. While this dialogue is up, you can move buttons around on your toolbars by click-and-drag to the new location. The window that pops up when you do this is a holding area for unused icons. You can drag any item from it onto your toolbars to have it made available, and you can drag any icon from your toolbars onto this box to hide that icon completely.</p>
<p>Tip: Some toolbar items, such as the Location bar, will expand to take up all available space.</p>
<p>Keyword Bookmark</p>
<p>Right clicking in a search box (such as the &#8216;search mozillazine, powered by google&#8217;, on the left of this page) and selecting &#8216;add a keyword for this search&#8217; lets you make an interactive keyword bookmark.</p>
<p>Here is how it works:</p>
<p>Give it a name, such as &#8216;Mozillazine search&#8217;<br />
now, assign a keyword to it, such as &#8216;moz&#8217;<br />
click &#8216;ok&#8217;</p>
<p>From now on, you can search mozillazine (or any other search box you used for this) from your address bar like this:</p>
<p>Enter &#8216;moz search topic&#8217; in your address bar and click Go!</p>
<p>Drag&#8217;n Drop<br />
Moving bookmarks and folders</p>
<p>You can change a bookmark&#8217;s position in a folder or move it from one folder to another or move it to another position on the toolbar by highlighting it &amp; clicking on it (WITHOUT LETTING GO) and dragging it to your desired position.</p>
<p>A folder can be moved the same way as above tip but u MUST hold down the SHIFT key while dragging.</p>
<p>Icons</p>
<p>You can bookmark the current page by dragging the icon from the location bar to your Bookmarks folder. You can also drag it to the desktop to make an icon for that page.</p>
<p>Drag a text file, a link, a picture, etcetera&#8230; from your folders or your desktop to Firefox and it will open in Firefox!</p>
<p>Links</p>
<p>&#8220;Click-and-drag&#8221; a bookmark to the main content windown (which is the biggest on the firefox userinterface),so you can open it in a new tab !</p>
<p>Dragging a link onto a new tab will open the link in the new tab.</p>
<p>Downloading links</p>
<p>Drag any link to the Download Manager Window to add &amp; download the link.</p>
<p>You can also directly download anything from a page by drag and dropping it onto the &#8216;download&#8217; icon in your toolbar (provided you put it there in &#8216;right-click &gt; customize&#8217;)</p>
<p>Mouse and Keyboard<br />
Images</p>
<p>Holding down the Shift or Ctrl key when you RightClick to &#8220;View Image&#8221; or &#8220;View Background Image&#8221; will open the image in a New Tab or New Window.</p>
<p>Selecting text</p>
<p>If you hold down the CTRL key and left click on part of a web page, that section of the page will be highlighted. If you right click on the selection and choose &#8216;View selection source&#8217;, the source code for that part of the page will be displayed.</p>
<p>To quickly highlight text, especially long text fields. Left-click once in the window where you want the selection to start; and then shift-click in the spot where you want the selection to end (selection range). *this is a lot easier than click-selection-dragging, especially where there is a lot of text to highlight.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/73/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/73/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=73&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/07/firefox-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>Top 20 C++ tips</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/07/top-20-c-tips/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/07/top-20-c-tips/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 14:24:13 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/07/top-20-c-tips/</guid>
		<description><![CDATA[The following tips are a collection of general hands-on techniques and recondite pieces of knowledge not associated with a specific platform, programming domain, or compiler. As such, they can be of use to all C++ programmers. I grouped the tips into five major categories: general guidelines for coding style, memory management, performance enhancement, object-oriented design, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=72&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following tips are a collection of general hands-on techniques and recondite pieces of knowledge not associated with a specific platform, programming domain, or compiler. As such, they can be of use to all C++ programmers. I grouped the tips into five major categories: general guidelines for coding style, memory management, performance enhancement, object-oriented design, and the Standard Template Library (STL).</p>
<p>What makes these tips special is that the information they provide usually cannot be found in C++ books or Web sites. For example, pointers to members are one of the most evasive, tricky, and bug-prone issues for even advanced users. Yet, they are a widely used C++ feature. Likewise, the discussion on STL terminology and iterator categories is another example of useful yet evasive information that isn&#8217;t readily available, unless you&#8217;re an STL expert.</p>
<p>The tips herein do not only explain how to write better code, but rather, they present the rationale behind the new language rules. Obviously, there are many other perennial good tips that C++ programmers can benefit from. However, I&#8217;m sure that this collection will provide you with many insights and guidelines for professional, efficient, and bug-free C++while teaching you some new coding and design techniques.</p>
<p><strong>First Four: Guidelines for Better Coding Style </strong></p>
<p>Under this category, I grouped tips that address frequently asked questions from C++ programmers of all levels of expertise. It&#8217;s surprising to discover how many experienced programmers are still unaware of the deprecation of the .h notation of standard header files, the proper usage of namespaces, and the rules regarding binding of references to temporary objects, for example. These issues and others will be discussed here. First, we start by explaining the difference between the deprecated &lt;xxx.h&gt; header names and the modern, standard-compliant &lt;xxx&gt; header-naming notation. Next, we explore a few dark corners of C++ whichdue to compilers&#8217; limitations and the somewhat recondite nature of the associated language rulestend to confuse many programmers, e.g., the notion of comma-separated expressions and the rules of binding references to rvalues. Finally, we will learn how to invoke a function prior to a program&#8217;s startup.</p>
<p><strong>Tip 1: &lt;iostream.h&gt; or &lt;iostream&gt;?</strong></p>
<p>Many C++ programmers still use &lt;iostream.h&gt; instead of the newer, standard compliant &lt;iostream&gt; library. What are the differences between the two? First, the .h notation of standard header files was deprecated more than five years ago. Using deprecated features in new code is never a good idea. In terms of functionality, &lt;iostream&gt; contains a set of templatized I/O classes which support both narrow and wide characters, as opposed to &lt;iostream.h&gt; which only supports char-oriented streams. Third, the C++ standard specification of iostream&#8217;s interface was changed in many subtle aspects. Consequently, the interfaces and implementation of &lt;iostream&gt; differ from those of &lt;iostream.h&gt;. Finally, &lt;iostream&gt; components are declared in namespace std whereas &lt;iostream.h&gt; components are global.</p>
<p>Because of these substantial differences, you cannot mix the two libraries in one program. As a rule, use &lt;iostream&gt; unless you&#8217;re dealing with legacy code that is only compatible with &lt;iostream.h&gt;.</p>
<p><strong>Tip 2: Binding a Reference to an Rvalue</strong></p>
<p>Rvalues and lvalues are a fundamental concept of C++ programming. In essence, an rvalue is an expression that cannot appear on the left-hand side of an assignment expression. By contrast, an lvalue refers to an object (in its wider sense), or a chunk of memory, to which you can write a value. References can be bound to both rvalues and lvalues. However, due to the language&#8217;s restrictions regarding rvalues, you have to be aware of the restrictions on binding references to rvalues, too.</p>
<p>Binding a reference to an rvalue is allowed as long as the reference is bound to a const type. The rationale behind this rule is straightforward: you can&#8217;t change an rvalue, and only a reference to const ensures that the program doesn&#8217;t modify an rvalue through its reference. In the following example, the function f() takes a reference to const int:</p>
<p>void f(const int &amp; i);<br />
int main()<br />
{<br />
f(2); /* OK */<br />
}</p>
<p>The program passes the rvalue 2 as an argument to f(). At runtime, C++ creates a temporary object of type int with the value 2 and binds it to the reference i. The temporary and its reference exist from the moment f() is invoked until it returns; they are destroyed immediately afterwards. Note that had we declared the reference i without the const qualifier, the function f() could have modified its argument, thereby causing undefined behavior. For this reason, you may only bind references to const objects.</p>
<p>The same rule applies to user-defined objects. You may bind a reference to a temporary object only if it&#8217;s const:</p>
<p>struct A{};<br />
void f(const A&amp; a);<br />
int main()<br />
{<br />
f(A()); /* OK, binding a temporary A to a const reference*/<br />
}</p>
<p><strong>Tip 3: Comma-Separated Expressions</strong></p>
<p>Comma-separated expressions were inherited from C. It&#8217;s likely that you use such expressions in for- and while-loops rather often. Yet, the language rules in this regard are far from being intuitive. First, let&#8217;s see what a comma separated expression is.</p>
<p>An expression may consist of one or more sub-expressions separated by commas. For example:</p>
<p>if(++x, &#8211;y, cin.good()) /*three expressions*/</p>
<p>The if condition contains three expressions separated by commas. C++ ensures that each of the expressions is evaluated and its side effects take place. However, the value of an entire comma-separated expression is only the result of the rightmost expression. Therefore, the if condition above evaluates as true only if cin.good() returns true. Here&#8217;s another example of a comma expression:</p>
<p>int j=10;<br />
int i=0;<br />
while( ++i, &#8211;j)<br />
{<br />
/*..repeat as long as j is not 0*/<br />
}</p>
<p><strong>Tip 4: Calling a Function Before Program&#8217;s Startup</strong></p>
<p>Certain applications need to invoke startup functions that run before the main program starts. For example, polling, billing, and logger functions must be invoked before the actual program begins. The easiest way to achieve this is by calling these functions from a constructor of a global object. Because global objects are conceptually constructed before the program&#8217;s outset, these functions will run before main() starts. For example:</p>
<p>class Logger<br />
{<br />
public:<br />
Logger()<br />
{<br />
activate_log();<br />
}<br />
};<br />
Logger log; /*global instance*/</p>
<p>int main()<br />
{<br />
record * prec=read_log();<br />
//.. application code<br />
}</p>
<p>The global object log is constructed before main() starts. During its construction, log invokes the function activate_log(). Thus, when main() starts, it can read data from the log file.</p>
<p>Five to Eight: Memory Management<br />
Undoubtedly, memory management is one of the most intricate and bug-prone issues in C++ programming. The power of accessing raw memory directly, the ability to allocate storage dynamically, and the utmost efficiency of C++ dictate very strict rules that you must follow in order to avoid memory-related bugs and runtime crashes.<br />
devx/cplus/815/16328: 336&#215;280</p>
<p>Pointers are the primary means of accessing memory. C++ has two major categories of them: pointers to data and pointers to function. The second category is further divided into two subcategories: ordinary function pointers and pointers to members. In the following tips, we will explore these issues in depth and learn some technique to streamline the use of pointers while hiding their unwieldy syntax.</p>
<p>Pointers to functions are probably one of the least readable syntactic constructs of C++. The only less readable construct seems to be pointers to members. The first tip will teach you how to improve the readability of ordinary pointers to functions. This serves as the prerequisite for dealing with C++ pointers to members.</p>
<p>Next, we learn how to avoid memory fragmentation and its woeful consequences. Finally, we discuss the proper use of delete and delete[] operatorsstill, a fertile source of bugs and misconceptions.</p>
<p><strong><br />
Tip 5: Hiding the Cumbersome Syntax of Pointers to Functions</strong></p>
<p>Can you tell what the following declaration means?</p>
<p>void (*p[10]) (void (*)());</p>
<p>p is an &#8220;array of 10 pointers to a function returning void and taking a pointer to another function that returns void and takes no arguments.&#8221; The cumbersome syntax is nearly indecipherable, isn&#8217;t it? You can simplify this declaration considerably by using typedefs. First, declare a typedef for &#8220;pointer to a function returning void and taking no arguments&#8221; as follows:</p>
<p>typedef void (*pfv)();</p>
<p>Next, declare another typedef for &#8220;pointer to a function returning void and taking a pfv&#8221;:</p>
<p>typedef void (*pf_taking_pfv) (pfv);</p>
<p>Now declaring an array of 10 such pointers is a breeze:</p>
<p>pf_taking_pfv p[10]; /*equivalent to<br />
void (*p[10]) (void (*)()); but much more readable*/</p>
<p><strong>Tip 6: All About Pointers to Members</strong></p>
<p>A class can have two general categories of members: function members and data members. Likewise, there are two categories of pointers to members: pointers to member functions and pointers to data members. The latter are less common because in general, classes do not have public data members. However, when using legacy C code that contains structs or classes that happen to have public data members, pointers to data members are useful.</p>
<p>Pointers to members are one of the most intricate syntactic constructs in C++, and yet, they are a very powerful feature too. They enable you to invoke a member function of an object without having to know the name of that function. This is very handy implementing callbacks. Similarly, you can use a pointer to data member to examine and alter the value of a data member without knowing its name.<br />
<strong><br />
Pointers to Data Members </strong></p>
<p>Although the syntax of pointers to members may seem a bit confusing at first, it&#8217;s consistent and resembles the form of ordinary pointers, with the addition of the class name followed by the operator :: before the asterisk. For example, if an ordinary pointer to int looks as follows:</p>
<p>int * pi;</p>
<p>You define a pointer to an int member of class A as follows:</p>
<p>int A::*pmi; /* pmi is a pointer to an int  member of A*/</p>
<p>You initialize a pointer to member like this:</p>
<p>class A<br />
{<br />
public:<br />
int num;<br />
int x;<br />
};<br />
int A::*pmi = &amp; A::num; /* 1 */</p>
<p>The statement numbered 1 declares a pointer to an int member of class A and initializes it with the address of the member num. Using pmi and the built-in operator .* you can examine and modify the value of num in any object of class A:</p>
<p>A a1, a2;<br />
int n=a1.*pmi; /* copy a1.num to n */<br />
a1.*pmi=5; /* assign the value 5 to a1.num */<br />
a2.*pmi=6; /* assign the value 6 to a2.num */</p>
<p>If you have a pointer to A, you need to use the built-in operator -&gt;* instead:</p>
<p>A * pa=new A;<br />
int n=pa-&gt;*pmi;<br />
pa-&gt;*pmi=5;</p>
<p><strong>Pointers To Member Functions</strong></p>
<p>These consist of the member function&#8217;s return type, the class name followed by ::, the pointer&#8217;s name, and the function&#8217;s parameter list. For example, a pointer to a member function of class A that returns an int and takes no arguments is defined as follows (note that both pairs of parentheses are mandatory):</p>
<p>class A<br />
{<br />
public:<br />
int func ();<br />
};</p>
<p>int (A::*pmf) ();</p>
<p>In other words, pmf is a pointer to a member function of class A that returns int and takes no arguments. In fact, a pointer to a member functions looks as an ordinary pointer to function, except that it also contains the class&#8217;s name immediately followed by the :: operator. You can invoke the member function to which pmf points using operator .*:</p>
<p>pmf=&amp;A::func;<br />
A a;<br />
(a.*pmf)();  /* invoke a.func() */</p>
<p>If you have a pointer to an object, you use the operator -&gt;* instead:</p>
<p>A *pa=&amp;a;<br />
(pa-&gt;*pmf)();  /*calls pa-&gt;func() */</p>
<p>Pointers to member functions respect polymorphism. Thus, if you call a virtual member function through such a pointer, the call will be resolved dynamically. Note, however, that you can&#8217;t take the address of a class&#8217;s constructor and destructor.</p>
<p><strong>Tip 7: Avoiding Memory Fragmentation</strong></p>
<p>Often, applications that are free from memory leaks but frequently allocate and deallocate dynamic memory show gradual performance degradation if they are kept running for long periods. Finally, they crash. Why is this? Recurrent allocation and deallocation of dynamic memory causes heap fragmentation, especially if the application allocates small memory chunks. A fragmented heap might have many free blocks, but these blocks are small and non-contiguous. To demonstrate this, look at the following scheme that represents the system&#8217;s heap. Zeros indicate free memory blocks and ones indicate memory blocks that are in use:</p>
<p>100101010000101010110</p>
<p>The above heap is highly fragmented. Allocating a memory block that contains five units (i.e., five zeros) will fail, although the systems has 12 free units in total. This is because the free memory isn&#8217;t contiguous. On the other hand, the following heap has less free memory but it&#8217;s not fragmented:</p>
<p>1111111111000000</p>
<p>What can you do to avoid heap fragmentation? First, use dynamic memory as little as possible. In most cases, you can use static or automatic storage or use STL containers. Secondly, try to allocate and de-allocate large chunks rather than small ones. For example, instead of allocating a single object, allocate an array of objects at once. As a last resort, use a custom memory pool.</p>
<p><strong>Tip 8: Don&#8217;t Confuse Delete with Delete []</strong></p>
<p>There&#8217;s a common myth among programmers that it&#8217;s OK to use delete instead of delete [] to release arrays built-in types. For example,</p>
<p>int *p=new int[10];<br />
delete p; /*bad; should be: delete[] p*/</p>
<p>This is totally wrong. The C++ standard specifically says that using delete to release dynamically allocated arrays of any type yields undefined behavior. The fact that on some platforms, applications that use delete instead of delete [] don&#8217;t crash can be attributed to sheer luck: Visual C++, for example, implements both delete[] and delete for built-in types by calling free(). However, there is no guarantee that future releases of Visual C++ will adhere to this convention. Furthermore, there&#8217;s no guarantees that this code will work on other compilers. To conclude, using delete instead of delete[] and vice versa is hazardous and should be avoided.</p>
<p>Nine to 11: Performance Enhancements</p>
<p>The following tips list three simple&#8212;yet rather unfamiliar&#8212;techniques to improve your program&#8217;s performance, without sacrificing its readability or entailing design modifications. For example, programmers often don&#8217;t know that simply by reordering data members in a class, they can significantly reduce its size. This optimization can boost performance especially if your application uses arrays of such objects. We will also learn the difference between postfix and prefix operatorsan issue of special importance when dealing with overloaded operators. Finally, we will learn a few techniques to eliminate the creation of temporary objects.<br />
Featured Resources for<br />
Developing Intelligent Connections from the<br />
Avaya DeveloperConnection Center<br />
ARTICLE<br />
Pushing the Limits: Avaya IP Telephones Equip Developers with Web and Push APIs<br />
Learn how the Avaya APIs work and get started.</p>
<p>DOWNLOAD<br />
Avaya Dialog Designer Software<br />
Open-standards based IDE for voice self-service applications.</p>
<p>WHITEPAPER<br />
Next Generation Business Communications Applications<br />
Learn how communications will be molded, injected, and programmed into business processes, thanks to Web Services/SOA and SIP.</p>
<p>Tip 9: Optimizing Class Member Alignment</p>
<p>The size of a class can be changed simply by playing with the order of its members&#8217; declaration:</p>
<p>struct A<br />
{<br />
 bool a;<br />
 int b;<br />
 bool c;<br />
}; /*sizeof (A) == 12*/</p>
<p>On my machine, sizeof (A) equals 12. This result might seem surprising because the total size of A&#8217;s members is only 6 bytes: 1+4+1 bytes. Where did the remaining 6 bytes come from? The compiler inserted 3 padding bytes after each bool member to make it align on a four-byte boundary. You can reduce A&#8217;s size by reorganizing its data members as follows:</p>
<p>struct B<br />
{<br />
 bool a;<br />
 bool c;<br />
 int b;<br />
}; // sizeof (B) == 8</p>
<p>This time, the compiler inserted only 2 padding bytes after the member c. Because b occupies four bytes, it naturally aligns on a word boundary without necessitating additional padding bytes.</p>
<p>Tip 10: Differences between Postfix and Prefix Operators</p>
<p>The built-in ++ and operators can appear on both sides of their operand:</p>
<p>int n=0;<br />
++n; /*prefix*/<br />
n++; /*postfix*/</p>
<p>You probably know that a prefix operator first changes its operand before taking its value. For example:</p>
<p>int n=0, m=0;<br />
n = ++m; /*first increment m, then assign its value to n*/<br />
cout &lt;&lt; n &lt;&lt; m; /* display 1 1*/</p>
<p>In this example, n equals 1 after the assignment because the increment operation took place before m&#8217;s value was taken and assigned to n. By contrast,</p>
<p>int n=0, m=0;<br />
n = m++; /*first assign m&#8217;s value to n, then increment m*/<br />
cout &lt;&lt; n &lt;&lt; m; /*display 0 1*/</p>
<p>In this example, n equals 0 after the assignment because the increment operation took place after m&#8217;s original value was taken and assigned to n.</p>
<p>To understand the difference between postfix and prefix operators better, examine the disassembly code generated for these operations. Even if you&#8217;re not familiar with assembly languages, you can immediately see the difference between the two; simply notice where the inc (increment) assembly directive appears:</p>
<p>/*disassembly of the expression: m=n++;*/<br />
mov ecx, [ebp-0x04] /*store n&#8217;s value in ecx register*/<br />
mov [ebp-0x08], ecx /*assign value in ecx to m*/<br />
inc dword ptr [ebp-0x04] /*increment n*/</p>
<p>/*disassembly of the expression: m=++n;*/<br />
inc dword ptr [ebp-0x04] /*increment n;*/<br />
mov eax, [ebp-0x04] /*store n&#8217;s value in eax register*/<br />
mov [ebp-0x08], eax /*assign value in eax to m*/</p>
<p>Tip 11: Eliminating Temporary Objects</p>
<p>C++ creates temporary objects &#8220;behind your back&#8221; in several contexts. The overhead of a temporary can be significant because both its constructor and destructor are invoked. You can prevent the creation of a temporary object in most cases, though. In the following example, a temporary is created:</p>
<p>Complex x, y, z;<br />
x=y+z; /* temporary created */</p>
<p>The expression y+z; results in a temporary object of type Complex that stores the result of the addition. The temporary is then assigned to x and destroyed subsequently. The generation of the temporary object can be avoided in two ways:</p>
<p>Complex y,z;<br />
Complex x=y+z; /* initialization instead of assignment */</p>
<p>In the example above, the result of adding x and z is constructed directly into the object x, thereby eliminating the intermediary temporary. Alternatively, you can use += instead of + to get the same effect:</p>
<p>/* instead of x = y+z; */<br />
x=y;<br />
x+=z;</p>
<p>Although the += version is less elegant, it costs only two member function calls: assignment operator and operator +=. In contrast, the use of + results in three member function calls: a constructor call for the temporary, a copy constructor call for x, and a destructor call for the temporary.</p>
<p>12 and 13: Object-oriented Design</p>
<p>Although C++ supports several useful programming paradigms such as procedural programming, functional programming, and generic programming, object-oriented programming is unquestionably the most widely used and important paradigm. The following two tips provide guidelines for better object-oriented design and implementation. First, I will explain the importance of virtual destructors in class hierarchies. The next tip in this category shows how to deal with nested classes that are declared as friends of the enclosing class.</p>
<p>Tip 12: Why Inheriting from a Class That Has No Virtual Destructor is Dangerous<br />
Classes with a non-virtual destructor aren&#8217;t meant to serve as base classes (such classes are usually known as &#8220;concrete classes&#8221;). std::string, std::complex, and std::vector are concrete classes. Why is inheriting from such classes not recommended? When you use public inheritance, you create an is-a relationship between the base class and its derived classes. Consequently, pointers and references to base can actually point to a derived object. Because the destructor isn&#8217;t virtual, C++ will not call the entire destructor chain when you delete such an object. For example:</p>
<p>class A<br />
{<br />
public:<br />
  ~A() // non virtual<br />
  {<br />
  // &#8230;<br />
  }<br />
};</p>
<p>class B: public A /* bad; A has a non virtual dtor*/<br />
{<br />
public:<br />
  ~B()<br />
  {<br />
  // &#8230;<br />
  }<br />
};</p>
<p>int main()<br />
{<br />
 A * p = new B; /*seemingly OK*/<br />
 delete p; /*trouble, B&#8217;s dtor not called*/<br />
}</p>
<p>The result of failing to invoke an object&#8217;s destructor is undefined. Therefore, you shouldn&#8217;t use publicly inherit from such classes. In particular, don&#8217;t derive from STL containers and std::string, as tempting as it may seem.</p>
<p>Tip 13: Declaring Nested Classes as Friends of Their Enclosing Class</p>
<p>When you declare a nested class as a friend of its containing class, place the friend declaration after the declaration of the nested class, not before it:</p>
<p>class A<br />
{<br />
private:<br />
 int i;<br />
public:<br />
 class B /*nested class declared first*/<br />
 {<br />
  public:<br />
  B(A &amp; a) { a.i=0;}; /*access A&#8217;s private member*/<br />
 };<br />
 friend class B;/*friend declaration at the right place*/<br />
};</p>
<p>If you place the friend declaration before the nested class&#8217;s declaration, the compiler will discard the declaration since the friend class hasn&#8217;t been seen yet.</p>
<p>14 to 20: STL and Generic Programming<br />
The Standard Template Library (STL) has revolutionized the way C++ programmers write code. It brings code reuse to new levels of productivity and it saves huge amounts of time that would have otherwise been spent on reinventing wheels. Yet, it&#8217;s a full-blown framework, with a peculiar jargon and intricate rules that you have to master in order to learn how to use it effectively. To shed some light on certain aspects of STL, I decided to include no less than six tips under this category.</p>
<p>Naturally, the first tip describes the basic constituents of STL and some of its key terms.</p>
<p>The next tip deals with template definitions. As you probably know, templates are the building bricks of STL containers and algorithms. The following three tips describe techniques of using the std::vector container—the most widely-used STL container. We will learn how to properly store pointers to objects in a vector and how to avoid common pitfalls; we will see how to treat a vector object as if it were a built-in array. The fifth tip in this category will show you how to use vectors to imitate a multidimensional array. Finally, the closing tip in this category teaches a very important lesson about the interaction of std::auto_ptr and STL.</p>
<p>Tip 14: Useful STL Terminology<br />
Here are some key terms that you may find useful when reading Standard Template Library (STL) literature and documentation.</p>
<p>Container<br />
A container is an object that stores objects as its elements. Normally, it&#8217;s implemented as a class template that has member functions for traversing, storing and removing elements. Examples of container classes are std::list and std::vector.</p>
<p>Genericity<br />
The quality of being generic, or type-independent. The above definition of the term container is too loose because it may apply to strings, arrays and structs, which also store objects. However, a real container isn&#8217;t limited to a specific data type or a set of types. Rather, it can store any built-in and user-defined type. Such a container is said to be generic. Note that a string can only contain characters. Genericity is perhaps the most important characteristic of STL. The third tip presents the standard base classes for function objects. Since function objects are one of the constituents of generic programming, adhering to standard conventions in their design and implementation will save you a lot of difficulties.</p>
<p>Algorithm<br />
A set of operations applied to a sequence of objects. Examples of algorithms are std::sort(), std::copy(), and std::remove(). STL algorithms are implemented as function templates taking iterators.</p>
<p>Adaptor<br />
An adaptor is a special object that can be plugged to an exiting class or function to change its behavior. For example, by plugging a special adaptor to the std::sort() algorithm, you can control whether the sorting order is descending or ascending. STL defines several kinds of sequence adaptors, which transform a container to a different container with a more restricted interface. A stack, for instance, is often formed from queue and an adaptor that provides the necessary push() and pop() operations.</p>
<p>Big Oh Notation<br />
A special notation used in performance measurements of algorithms. The STL specification imposes minimum performance limits on the operations of its algorithms and container operations. An implementation may offer better performance but not worse. The Big Oh notation enables you to evaluate the efficiency of algorithms and containers for a given operation and data structure. An algorithm such as std::find(), which traverses every element is a sequence (in the worst case scenario) has the following notation:</p>
<p>T(n) = O(n). /* linear complexity */</p>
<p>Iterator<br />
An iterator is an object that functions as a generic pointer. Iterators are used for traversing, adding and removing container elements. STL defines five major categories of iterators:</p>
<p>input iterators and output iterators<br />
forward iterators<br />
bidirectional iterators<br />
random access iterators</p>
<p>Note that this list doesn&#8217;t represent inheritance relationships; it merely describes the iterator categories and their interfaces. Each lower category is a superset of the category above it. For instance, a bidirectional iterator provides all the functionality of a forward iterators plus additional functionality. Here is a brief summary of the functionality and interfaces for these categories:</p>
<p>Input iterators allow an algorithm to advance the iterator and offer read-only access to an element.</p>
<p>Output iterators allow an algorithm to advance the iterator and offer write-only access to an element.</p>
<p>Forward iterators support both read and write access, but traversal is permitted only in one direction.</p>
<p>Bidirectional iterators allow the user to traverse the sequence in both directions.</p>
<p>Random access iterators support random jumps and &#8220;pointer arithmetic&#8221; operations, for example:</p>
<p>string::iterator it = s.begin();<br />
char c = *(it+5); /* assign sixth char to c*/</p>
<p>Tip 15: The Location of Template Definitions<br />
Normally, you declare functions and classes in a .h file and place their definition in a separate .cpp file. With templates, this practice isn&#8217;t really useful because the compiler must see the actual definition (i.e., the body) of a template, not just its declaration, when it instantiates a template. Therefore, it&#8217;s best to place both the template&#8217;s declaration and definition in the same .h file. This is why all STL header files contain template definitions.</p>
<p>In the future, when compilers support the &#8220;export&#8221; keyword, it will be possible to use only the template&#8217;s declaration and leave the definition in a separate source file.</p>
<p>Tip 16: Standard Base Classes for Function Object<br />
To simplify the process of writing function objects, the Standard Library provides two class templates that serve as base classes of user-defined function objects: std::unary_function and std::binary_function. Both are declared in the header . As the names suggest, unary_function serves as a base class of function objects taking one argument and binary_function serves as a base class of function objects taking two arguments. The definitions of these base classes are as follows:</p>
<p>template  struct<br />
unary_function<br />
{<br />
 typedef Arg argument_type;<br />
 typedef Res result_type;<br />
};<br />
template<br />
struct binary_function<br />
{<br />
 typedef Arg first_argument_type;<br />
 typedef Arg2 second_argument_type;<br />
 typedef Res result_type;<br />
};</p>
<p>These templates don&#8217;t provide any useful functionality. They merely ensure that arguments and return values of their derived function objects have uniform names. In the following example, the predicate is_vowel, which takes one argument, inherits from unary_function:</p>
<p>template<br />
class is_vowel: public unary_function<br />
{<br />
public:<br />
 bool operator ()(T t) const<br />
 {<br />
  if ((t==&#8217;a')||(t==&#8217;e')||(t==&#8217;i')||(t==&#8217;o')||(t==&#8217;u'))<br />
   return true;<br />
  return false;<br />
 }<br />
};</p>
<p>Tip 17: Storing Dynamically Allocated Objects in STL Containers<br />
Suppose you need to store objects of different types in the same container. Usually, you do this by storing pointers to dynamically allocated objects. However, instead of using named pointers, insert the elements to the container as follows:</p>
<p>class Base {};<br />
class Derived : public Base{};</p>
<p>std::vector  v;<br />
v.push_back(new Derived);<br />
v.push_back(new Base);</p>
<p>This way you ensure that the stored objects can only be accessed through their container. Remember to delete the allocated objects as follows:</p>
<p>delete v[0];<br />
delete v[1];</p>
<p>Tip 18: Treating a Vector as an Array<br />
Suppose you have a vector of int and function that takes int *. To obtain the address of the internal array of the vector v and pass it to the function, use the expressions &amp;v[0] or &amp;*v.front(). For example:</p>
<p>void func(const int arr[], size_t length );<br />
int main()<br />
{<br />
 vector  vi;<br />
 //.. fill vi<br />
 func(&amp;vi[0], vi.size());<br />
}</p>
<p>It&#8217;s safe to use &amp;vi[0] and &amp;*v.front() as the internal array&#8217;s address as long as you adhere to the following rules: First, func() shouldn&#8217;t access out-of-range array elements. Second, the elements inside the vector must be contiguous. Although the C++ Standard doesn&#8217;t guarantee that yet, I&#8217;m not aware of any implementation that doesn&#8217;t use contiguous memory for vectors. Furthermore, this loophole in the C++ Standard will be fixed soon.</p>
<p>Tip 19: Dynamic Multidimensional Arrays and Vectors<br />
You can allocate multidimensional arrays manually, as in:</p>
<p>int (*ppi) [5]=new int[4][5]; /*parentheses required*/<br />
/*fill array..*/<br />
ppi[0][0] = 65;<br />
ppi[0][1] = 66;<br />
ppi[0][2] = 67;<br />
//..<br />
delete [] ppi;</p>
<p>However, this style is tedious and error prone. You must parenthesize ppi to ensure that the compiler parses the declaration correctly, and you must delete the allocated memory. Worse yet, you can easily bump into buffer overflows. Using a vector of vectors to simulate a multidimensional array is a significantly superior alternative:</p>
<p>#include<br />
#include<br />
using namespace std;<br />
int main()<br />
{<br />
 vector &lt;vector  &gt; v; /*two dimensions*/<br />
 v.push_back(vector ()); /*create v[0]*/<br />
 v.push_back(vector ()); /*create v[1]*/<br />
 v[0].push_back(15); /*assign v[0][0]*/<br />
 v[1].push_back(16); /*assign v[1][0]*/<br />
}</p>
<p>Because vector overloads operator [], you can use the [][] notation as if you were using a built-in two-dimensional array:</p>
<p>cout &lt;&lt; v[0][0];<br />
cout &lt;&lt; v[1][0];</p>
<p>The main advantages of using a vector of vectors are two: vector automatically allocates memory as needed. Secondly, it takes care of deallocating memory so you don&#8217;t have to worry about potential memory leaks.</p>
<p>Tip 20: Why You Shouldn&#8217;t Store auto_ptr Objects in STL Containers<br />
The C++ Standard says that an STL element must be &#8220;copy-constructible&#8221; and &#8220;assignable.&#8221; These fancy terms basically mean that for a given class, assigning and copying one object to another are well-behaved operations. In particular, the state of the original object isn&#8217;t changed when you copy it to the target object.</p>
<p>This is not the case with auto_ptr, though: copying or assigning one auto_ptr to another makes changes to the original in addition to the expected changes in the copy. To be more specific, the original object transfers ownership of the pointer to the target, thus making the pointer in the original null. Imagine what would happen if you did something like this:</p>
<p>std::vector &lt;auto_ptr  &gt; vf;/*a vector of auto_ptr&#8217;s*/<br />
// ..fill vf<br />
int g()<br />
{<br />
  std::auto_ptr  temp=vf[0]; /*vf[0] becomes null*/<br />
}</p>
<p>When temp is initialized, the pointer of vf[0] becomes null. Any attempt to use that element will cause a runtime crash. This situation is likely to occur whenever you copy an element from the container. Remember that even if your code doesn&#8217;t perform any explicit copy or assignment operations, many algorithms (std::swap(), std::random_shuffle() etc.) create a temporary copy of one or more container elements. Furthermore, certain member functions of the container create a temporary copy of one or more elements, thereby nullifying them. Any subsequent attempt to the container elements is therefore undefined.</p>
<p>Visual C++ users often say that they have never encountered any problems with using auto_ptr in STL containers. This is because the auto_ptr implementation of Visual C++ (all versions thereof) is outdated and relies on an obsolete specification. When the vendor decides to catch up with the current ANSI/ISO C++ Standard and change its Standard Library accordingly, code that uses auto_ptr in STL containers will manifest serious malfunctions.</p>
<p>To conclude, you shouldn&#8217;t use auto_ptr in STL containers. Use either bare pointers or other smart pointer classes instead of auto_ptr (such classes are available at www.Boost.org).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/72/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/72/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=72&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/07/top-20-c-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ Code Optimization</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/07/c-code-optimization/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/07/c-code-optimization/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 14:17:23 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/07/c-code-optimization/</guid>
		<description><![CDATA[C++ Optimizations These optimizations are fairly easy to apply to existing code and in some cases can result in big speedups. Remember the all-important maxim though, the fastest code is code that isn&#8217;t called. Use Initialization Lists Always use initialization lists in constructors. For example, use TMyClass::TMyClass(const TData &#38;data) : m_Data(data) { } rather than [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=71&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>C++ Optimizations</p>
<p>These optimizations are fairly easy to apply to existing code and in some cases can result in big speedups. Remember the all-important maxim though, the fastest code is code that isn&#8217;t called.<br />
Use Initialization Lists</p>
<p>Always use initialization lists in constructors. For example, use</p>
<p>TMyClass::TMyClass(const TData &amp;data) : m_Data(data)<br />
{<br />
}</p>
<p>rather than</p>
<p>TMyClass::TMyClass(const TData &amp;data)<br />
{<br />
    m_Data = data;<br />
}</p>
<p>Without initialization lists, the variable&#8217;s default constructor is invoked behind-the-scenes prior to the class&#8217;s constructor, then its assignment operator is invoked. With initialization lists, only the copy constructor is invoked.<br />
Optimize For Loops</p>
<p>Whereever possible, count down to zero rather than up to n. For example, use</p>
<p>for (i = n-1; i &gt;= 0; &#8211;i)</p>
<p>rather than</p>
<p>for (i = 0; i &lt; n; ++i)</p>
<p>The test is done every iteration and it&#8217;s faster to test against zero than anything else. Note also that</p>
<p>++i</p>
<p>is faster than</p>
<p>i++</p>
<p>when it appears in the third part of the for loop statement.<br />
Use &#8216;int&#8217;</p>
<p>Always use the int data type instead of char or short wherever possible. int is always the native type for the machine.<br />
Make Local Functions Static</p>
<p>Always declare local functions as static, e.g.,</p>
<p>static void foo()</p>
<p>This means they will not be visible to functions outside the .cpp file, and some C++ compilers can take advantage of this in their optimizations.<br />
Optimize If Statements</p>
<p>Factor out jumps. For example, use</p>
<p>bar();<br />
if (condition)<br />
{<br />
    undoBar();<br />
    foo();<br />
}</p>
<p>rather than</p>
<p>if (condition)<br />
{<br />
    foo();<br />
}<br />
else<br />
{<br />
    bar();<br />
}</p>
<p>Use a profiler and good judgement to decide if undoing the bar() operation is faster than jumping.<br />
Optimize Switch Statements</p>
<p>Put the most common cases first.<br />
Avoid Expensive Operations</p>
<p>Addition is faster than multiplication and multiplication is faster than division. Factor out expensive operations whereever possible.<br />
Initialize on Declaration</p>
<p>Whereever possible, initialize variables at the time they&#8217;re declared. For example,</p>
<p>TMyClass myClass = data;</p>
<p>is faster than</p>
<p>TMyClass myClass;<br />
myClass = data;</p>
<p>Declaration then initialization invokes the object&#8217;s default constructor then its assignment operator. Initializing in the declaration invokes only its copy constructor.<br />
Pass By Reference</p>
<p>Always try to pass classes by reference rather than by value. For example, use</p>
<p>void foo(TMyClass &amp;myClass)</p>
<p>rather than</p>
<p>void foo(TMyClass myClass)</p>
<p>Delay Variable Declarations</p>
<p>Leave variable declarations right until the point when they&#8217;re needed. Remember that when a variable is declared its constructor is called. This is wasteful if the variable is not used in the current scope.<br />
Use &#8216;op=&#8217;</p>
<p>Wherever possible, use &#8216;op=&#8217; in favour of &#8216;op&#8217;. For example, use</p>
<p>myClass += value;</p>
<p>rather than</p>
<p>myClass = myClass + value;</p>
<p>The first version is better than the second because it avoids creating a temporary object.<br />
Inline Small Functions</p>
<p>Small, performance critical functions should be inlined using the inline keyword, e.g.,</p>
<p>inline void foo()</p>
<p>This causes the compiler to duplicate the body of the function in the place it was called from. Inlining large functions can cause cache misses resulting in slower execution times.<br />
Use Nameless Classes</p>
<p>Whereever possible, use nameless classes. For example,</p>
<p>foo(TMyClass(&#8220;abc&#8221;));</p>
<p>is faster than</p>
<p>TMyClass myClass(&#8220;abc&#8221;);<br />
foo(myClass);</p>
<p>because, in the first case, the parameter and the class share memory.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/71/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/71/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=71&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/07/c-code-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
		<item>
		<title>Attributes ( Hidden )</title>
		<link>http://muthusrinivasan.wordpress.com/2007/08/06/attributes-hidden/</link>
		<comments>http://muthusrinivasan.wordpress.com/2007/08/06/attributes-hidden/#comments</comments>
		<pubDate>Mon, 06 Aug 2007 16:22:00 +0000</pubDate>
		<dc:creator>muthusrinivasan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Windows Tips]]></category>

		<guid isPermaLink="false">http://muthusrinivasan.wordpress.com/2007/08/06/attributes-hidden/</guid>
		<description><![CDATA[Create Super / System Hidden file By combining attributes S and H here s the way to create : in cmd promt enter : attrib +s +h path of the filename to get back the original file use : attrib -s -h path of the filename enable super hidden files and folders by making some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=70&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Create Super / System Hidden file By combining attributes S and H</p>
<p>here s the way to create : in cmd promt enter : attrib +s +h path of the filename</p>
<p>to get back the original file use : attrib -s -h path of the filename</p>
<p>enable super hidden files and folders by making some modifications in regkey</p>
<blockquote><p>enter regedit in run and locate : Hkey_current_user-&gt;Software-&gt;Microsoft-&gt;Windows-&gt;Current Version-&gt;explorer-&gt;advanced<br />
and change the value of ShowSuperHidden to 1 to enable and 0 to disable</p></blockquote>
<p>======================================================================</p>
<p>Display or change file attributes. Find Filenames.</p>
<p>Syntax<br />
ATTRIB [ + attribute | - attribute ] [pathname] [/S]</p>
<p>Key<br />
+    : Turn an attribute ON<br />
-    : Clear an attribute OFF</p>
<p>pathname : Drive and/or filename e.g. C:\*.txt<br />
/S    : Search the pathname including all subfolders.</p>
<p>attributes:<br />
H  Hidden<br />
S  System<br />
R  Read-only<br />
A  Archive</p>
<p>If no attributes are specified attrib will return the current attribute settings. Used with just the /S option ATTRIB will quickly search for a particular filename.</p>
<p>Combining the Hidden and System attributes.</p>
<p>If a file has both the Hidden and System attributes set, you can clear both attributes only with a single ATTRIB command.</p>
<p>For example, to clear the Hidden and System attributes for the RECORD.TXT file, you would type:<br />
ATTRIB -S -H RECORD.TXT</p>
<p>Using ATTRIB with groups of files</p>
<p>You can use wildcards (? and *) with the filename parameter to display or change the attributes for a group of files.</p>
<p>Remember that, if a file has the System or Hidden attribute set, you must clear that attribute before you can change any other attributes.</p>
<p>Changing the attributes for a directory</p>
<p>You can display or change the attributes for a directory. To use ATTRIB with a directory, you must explicitly specify the directory name; you cannot use wildcards to work with directories.</p>
<p>For example, to hide the directory C:\SECRET, you would type the following:</p>
<p>ATTRIB +H C:\SECRET</p>
<p>The following command would affect only files, not directories: ATTRIB +H C:*.*</p>
<p>Viewing archive attributes</p>
<p>The Archive attribute (A) is used to mark files that have changed since they were previously backed up. The (A) flag is automatically updated by Windows as the file is saved.</p>
<p>If the (A) flag is present &#8211; the file is new or has been changed since the last backup.</p>
<p>The MSBACKUP, RESTORE, and XCOPY commands use these Archive attributes, as do many (but not all) 3rd party backup solutions.</p>
<p>New attributes in Windows XP</p>
<p>In addition to A,H,R,S, the latest version of NTFS includes the following new attributes</p>
<p>E = Encrypted, C = Compressed, T = Temporary, O = Offline</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/muthusrinivasan.wordpress.com/70/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/muthusrinivasan.wordpress.com/70/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/muthusrinivasan.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/muthusrinivasan.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/muthusrinivasan.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/muthusrinivasan.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/muthusrinivasan.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/muthusrinivasan.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/muthusrinivasan.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/muthusrinivasan.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/muthusrinivasan.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/muthusrinivasan.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/muthusrinivasan.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/muthusrinivasan.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/muthusrinivasan.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/muthusrinivasan.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=muthusrinivasan.wordpress.com&amp;blog=1207100&amp;post=70&amp;subd=muthusrinivasan&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://muthusrinivasan.wordpress.com/2007/08/06/attributes-hidden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a4f4ab817e70e7d6a08ad63140109a65?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">muthusrinivasan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
