<?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>Packets of Knowledge</title>
	<atom:link href="http://packetsofknowledge.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://packetsofknowledge.wordpress.com</link>
	<description>Packets processed by a mapper</description>
	<lastBuildDate>Mon, 21 Jan 2008 14:43:30 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='packetsofknowledge.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/af1c9c4c33f14d687a7f8fc86faf63ea?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Packets of Knowledge</title>
		<link>http://packetsofknowledge.wordpress.com</link>
	</image>
			<item>
		<title>Enabling DMA for hard drives (Windows XP)</title>
		<link>http://packetsofknowledge.wordpress.com/2008/01/21/enabling-dma-for-hard-drives-windows-xp/</link>
		<comments>http://packetsofknowledge.wordpress.com/2008/01/21/enabling-dma-for-hard-drives-windows-xp/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 14:43:30 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[fix]]></category>

		<guid isPermaLink="false">http://packetsofknowledge.wordpress.com/2008/01/21/enabling-dma-for-hard-drives-windows-xp/</guid>
		<description><![CDATA[Your PC can be slow for a number o reasons, including spyware other kinds of malware. But one of the often overlooked reasons is that DMA may be disabled for your hard drive. Windows sometimes disables DMA support for unclear reasons. Here&#8217;s how you turn it on again.

Right click My Computer, either in your Start [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=20&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Your PC can be slow for a number o reasons, including spyware other kinds of malware. But one of the often overlooked reasons is that DMA may be disabled for your hard drive. Windows sometimes disables DMA support for unclear reasons. Here&#8217;s how you turn it on again.</p>
<p><img src='http://packetsofknowledge.files.wordpress.com/2008/01/dma_00_manage.png' alt='Right click My Computer and click Manage' /><br />
Right click My Computer, either in your Start menu or on your desktop, and click Manage.</p>
<p><img src='http://packetsofknowledge.files.wordpress.com/2008/01/dma_01_device-manager.png' alt='Click Device Manager, IDE ATA/ATAPI controllers, right click Primary IDE channel and choose Properties' /><br />
Click Device Manager, IDE ATA/ATAPI controllers, right click Primary IDE channel and choose Properties.</p>
<p><img src='http://packetsofknowledge.files.wordpress.com/2008/01/dma_02_primary-ide-properties.png' alt='dma_02_primary-ide-properties.png' /><br />
In Properties, click the Advanced Settings tab. If transfer Mode says PIO Only, DMA has been disabled. If so change it to &#8220;DMA if available&#8221;. Repeat for Device 1, and Secondary IDE Channel if needed. When prompted, reboot.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=20&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2008/01/21/enabling-dma-for-hard-drives-windows-xp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2008/01/dma_00_manage.png" medium="image">
			<media:title type="html">Right click My Computer and click Manage</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2008/01/dma_01_device-manager.png" medium="image">
			<media:title type="html">Click Device Manager, IDE ATA/ATAPI controllers, right click Primary IDE channel and choose Properties</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2008/01/dma_02_primary-ide-properties.png" medium="image">
			<media:title type="html">dma_02_primary-ide-properties.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows file explorer crashes when selecting video files</title>
		<link>http://packetsofknowledge.wordpress.com/2007/12/27/windows-file-explorer-crashes-when-selecting-video-files/</link>
		<comments>http://packetsofknowledge.wordpress.com/2007/12/27/windows-file-explorer-crashes-when-selecting-video-files/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 04:32:04 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[fix]]></category>

		<guid isPermaLink="false">http://packetsofknowledge.wordpress.com/2007/12/27/windows-file-explorer-crashes-when-selecting-video-files/</guid>
		<description><![CDATA[Problem: Windows’ explorer crashes when opening or selecting a video file, or even just opening a folder containing video files.
Solution: Start &#62; run &#62; regsvr32 /u shmedia.dll
Then restart explorer.exe
Simplest way: Log out/log in or reboot computer.
More complicated way: Press ctrl+alt+delete or ctrl+shift+escape to bring up the task manager. Kill the explorer.exe process. Click File &#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=19&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Problem: Windows’ explorer crashes when opening or selecting a video file, or even just opening a folder containing video files.<br />
Solution: Start &gt; run &gt; <strong>regsvr32 /u shmedia.dll</strong><br />
Then restart explorer.exe<br />
Simplest way: Log out/log in or reboot computer.<br />
More complicated way: Press <strong>ctrl+alt+delete</strong> or <strong>ctrl+shift+escape</strong> to bring up the task manager. Kill the explorer.exe process. Click File &gt; New Process (Run) and enter <strong>explorer</strong></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=19&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2007/12/27/windows-file-explorer-crashes-when-selecting-video-files/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>
	</item>
		<item>
		<title>String reverse prototype function in Javascript</title>
		<link>http://packetsofknowledge.wordpress.com/2007/12/27/string-reverse-prototype-function-in-javascript/</link>
		<comments>http://packetsofknowledge.wordpress.com/2007/12/27/string-reverse-prototype-function-in-javascript/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 04:28:41 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://packetsofknowledge.wordpress.com/2007/12/27/string-reverse-prototype-function-in-javascript/</guid>
		<description><![CDATA[Svendtofte.com has a list of useful Javascript prototype methods inspired by functional programming. (Lovely)
But there&#8217;s one of his prototype methods that I have an opinion on, his string reverse method:
String.prototype.reverse = function() {
    var s = "";
    var i = this.length;
    while (i&#62;0) {
   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=18&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Svendtofte.com has a list of <a href="http://www.svendtofte.com/code/usefull_prototypes/">useful Javascript prototype methods</a> inspired by functional programming. (Lovely)<br />
But there&#8217;s one of his prototype methods that I have an opinion on, his string reverse method:</p>
<pre>String.prototype.reverse = function() {
    var s = "";
    var i = this.length;
    while (i&gt;0) {
        s += this.substring(i-1,i);
        i--;
    }
    return s;
}</pre>
<p>It&#8217;s a classic C style string reverse method. My suggestion is instead this:
<pre>String.prototype.reverse=function(){
       return this.split("").reverse().join("");
}</pre>
<p>What does it do?<br />
<strong>x=&#8221;nitro2k01&#8243;.reverse()</strong> for example does this: <strong>this.split(&#8220;&#8221;)</strong> splits the string into an array, where every element is one character of the string. <strong>&#8220;nitro2k01&#8243;</strong> in the example becomes the array <strong>["n","i","t","r","o","2","k","0","1"]</strong>. <strong>.reverse()</strong> in turn reverses the array, so the new array becomes <strong>["1","0","k","2","o","r","t","i","n"]</strong>. Lastly <strong>.join(&#8220;&#8221;)</strong> turns the new array back into a string, <strong>&#8220;10k2ortin&#8221;</strong>, which is returned. </p>
<p>I like my function better because it has a more <a href="http://en.wikipedia.org/wiki/Functional_programming">functional</a> look, re-uses builtin JS functionality and possily is faster. (Although I&#8217;ll have to investigate the last claim more thoroughly.)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=18&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2007/12/27/string-reverse-prototype-function-in-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP: Using print_r for debugging</title>
		<link>http://packetsofknowledge.wordpress.com/2006/09/27/php-using-print_r-for-debugging/</link>
		<comments>http://packetsofknowledge.wordpress.com/2006/09/27/php-using-print_r-for-debugging/#comments</comments>
		<pubDate>Wed, 27 Sep 2006 00:15:35 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://packetsofknowledge.wordpress.com/2006/09/27/php-using-print_r-for-debugging/</guid>
		<description><![CDATA[When programming PHP you sometimes need to look at http post or get data (That is, a the data submitted in a form) The simplest way to do this is to to use php&#8217;s builtin function print_r, which will parse any array and print the indeces and array values.  For post and get data, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=17&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When programming PHP you sometimes need to look at http <strong>post </strong>or <strong>get </strong>data (That is, a the data submitted in a form) The simplest way to do this is to to use php&#8217;s builtin function <strong>print_r</strong>, which will parse any array and print the indeces and array values.  For <strong>post </strong>and <strong>get </strong>data, you should look at the corresponding array, <strong>$_POST</strong> and <strong>$_GET</strong>, respectively.</p>
<p>There are two things worth noting about <strong>print_r</strong>. First thing is that <strong>print_r</strong> is a regular function, and not a language construct like <strong>echo </strong>and <strong>print</strong>. Without going into detail, this means you need to put parentheses around the argument when calling it, unlike for <strong>print</strong>/<strong>echo</strong>. Second thing worth noting is that <strong>print_r</strong> outputs raw text. This includes line breaks, which will normally be parsed as spaces by by your browser, which will make the data almost unreadable. The easy solution to this is to put a pre block around the data. So we arrive at this code:</p>
<pre>&lt;?PHP
echo '&lt;pre&gt;';
print_r($_GET);
echo '&lt;/pre&gt;';
?&gt;</pre>
<p>Here&#8217;s a sample output:</p>
<pre>Array
(
    [userid] =&gt; 23
    [password] =&gt; qweasd
)</pre>
<p>However, as mentioned, <strong>print_r</strong> can print any array. Except for your own arrays, these might come in handy when debugging: <strong>$_GET</strong>/<strong>$_POST</strong> (As mentioned above) <strong>$_SERVER</strong> (A lot of information) <strong>$_SESSION</strong> (Session data, if your application uses sessions) <strong> getallheaders()</strong> (Shows all http headers. Call it like this: <strong>print_r(getallheaders());</strong> ). There are probably even more useful arrays than these, but they were the ones that I came to think of now. Happy debugging!</p>
<p>Btw, the blog <a href="http://idfw06.wordpress.com/">idfw06 </a>linked to me, so I&#8217;d better link back. (:</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=17&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2006/09/27/php-using-print_r-for-debugging/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>
	</item>
		<item>
		<title>Tip of the day: Use png instead of gif!</title>
		<link>http://packetsofknowledge.wordpress.com/2006/09/02/tip-of-the-day-use-png-instead-of-gif/</link>
		<comments>http://packetsofknowledge.wordpress.com/2006/09/02/tip-of-the-day-use-png-instead-of-gif/#comments</comments>
		<pubDate>Sat, 02 Sep 2006 23:26:22 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Welcome Message!]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[png]]></category>

		<guid isPermaLink="false">https://packetsofknowledge.wordpress.com/2006/09/02/tip-of-the-day-use-png-instead-of-gif/</guid>
		<description><![CDATA[Ok, I made a mistake. I started this blog right before I went on vacation, which was perhaps not the smartest thing I could do, since the little stream of readers I had thought I had given it up when I suddenly stopped posting. Next bad thing is that I had a laptop with me [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=16&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Ok, I made a mistake. I started this blog right before I went on vacation, which was perhaps not the smartest thing I could do, since the little stream of readers I had thought I had given it up when I suddenly stopped posting. Next bad thing is that I had a laptop with me on my vacation to, among other things do some blogging drafts. And right after I came home the hard drive crashed.</p>
<p>So here we are, two months after my latest post. As a new reader, this might be the first post you read, so here&#8217;s a little explanation what this blog is aout. Packets of Knowledge is, as the name might suggest, meant to be a blog with small tips and tricks to specific problems. Either problems I&#8217;ve faced myself, or answers to questions I&#8217;ve answered in forums. Particularly the latter, since some questions seem to appear over and over, so if that instead of writing a whole new answer, I can link back to this blog. It&#8217;s also meant to be a refernce for myself as I build it up.<br />
The topics you&#8217;ll see on this blog will mainly be web development, but also other sorts of development and fixes to annoyances in programs and operating systems.</p>
<p>So, back on-topic: All developers and most computer users knows what gif is. It&#8217;s a file format for storing image data. It&#8217;s the per se standard image format for the web, together with jpeg. Both gif and jpeg are destructive, but in different ways. Gif has a limited color depth. A gif image can store no more than 256 unique colors. Storing a photo in gif will give it a low quality where the 256 colors are used in patterns to give the illusion of the original colors. But other than that gif won&#8217;t destroy your image, so images which already has less than 256 unique colors will look ok. This may include graphs and sketches with few colors.<br />
Jpeg on the other hand will not decrease the color depth, but instead slice the image into small blocks and look for blocks that resemble each other and exploit that to be able to compress the file. This works good for photos which can be compressed with jpeg with a good ratio. Jpeg effectively does what it should for real color images, but tends to destroy images with blocks of solid colors, or images with text in them.<br />
So why replace gif with png? Png is probably most famous for its ability to store an alpha channel &#8211; a way of giving the image a semi-transparent look. But png can store store 256 color images as well, just like gif. Only with the difference that png will make the image file smaller than the corresponding gif file, but still look the same. Another argument to leave the gif format behind is that it used to be patented. Today, the patent has expired, but still I&#8217;d recommend a switch.</p>
<p>Png can also store full color images, optionally with an alpha channel as mentioned above, but the biggest advantage is that png , even for a full color image, is totally undestructive. That makes it the web&#8217;s only standardized, full color, non-destructive image format.<br />
While it is true that one major browser still doesn&#8217;t support png images with an alpha channel without extra effort. (IE6; this will be fixed in IE7) But every major browser has support for png without an alpha channel since years ago. So next time you&#8217;re about to save a gif file, save it as png and make the world a better place.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=16&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2006/09/02/tip-of-the-day-use-png-instead-of-gif/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting rid of borders around images in links</title>
		<link>http://packetsofknowledge.wordpress.com/2006/07/04/getting-rid-of-borders-around-images-in-links/</link>
		<comments>http://packetsofknowledge.wordpress.com/2006/07/04/getting-rid-of-borders-around-images-in-links/#comments</comments>
		<pubDate>Tue, 04 Jul 2006 19:48:45 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">https://packetsofknowledge.wordpress.com/2006/07/04/getting-rid-of-borders-around-images-in-links/</guid>
		<description><![CDATA[Some browsers put a border around images that happen to be inside a link. The standard solution to this has been to place a border=&#8221;0&#8243; attribute to every affected image. Myself, I usually solve that problem by adding this CSS code to my global css includes:
a img {border: none;}
What border: none; does should be pretty [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=14&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Some browsers put a border around images that happen to be inside a link. The standard solution to this has been to place a<b> border=&#8221;0&#8243;</b> attribute to every affected image. Myself, I usually solve that problem by adding this CSS code to my global css includes:</p>
<pre>a img {border: none;}</pre>
<p>What <b>border: none;</b> does should be pretty clear to most people, but <b>a img</b> might not. I remember I was pretty confused the first time I saw it. Back then I thought it applied the attributes both a and img tags. (You can do that by comma separating identifiers btw) <b>a img</b> is an identifier that applies the CSS attributes to all <b>img </b>tags that are children of (In other words situated inside) to <b>a </b>tags. This goes for children of all depths, ie even a child of a child of child of an a tag.</p>
<p>If you want the CSS properties to apply to only direct children, you can use &gt;</p>
<pre>p&gt;blockquote {font-size: 0.8em;}</pre>
<p>This CSS code will apply a smaller font size for every paragraph which is a direct child of a <b>blockquote </b>tag.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=14&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2006/07/04/getting-rid-of-borders-around-images-in-links/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>
	</item>
		<item>
		<title>Preventing search engine indexing</title>
		<link>http://packetsofknowledge.wordpress.com/2006/07/04/preventing-search-engine-indexing/</link>
		<comments>http://packetsofknowledge.wordpress.com/2006/07/04/preventing-search-engine-indexing/#comments</comments>
		<pubDate>Tue, 04 Jul 2006 17:58:36 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>

		<guid isPermaLink="false">https://packetsofknowledge.wordpress.com/2006/07/04/preventing-search-engine-indexing/</guid>
		<description><![CDATA[There&#8217;s a lot of talk today about search engine optimization, ie trying to rank a page higher in search engines by using special techniques. I believe much of the time doing this is wasted. But not all is about getting people to find stuff on your page, sometimes you want people not to find some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=13&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There&#8217;s a lot of talk today about search engine optimization, ie trying to rank a page higher in search engines by using special techniques. I believe much of the time doing this is wasted. But not all is about getting people to find stuff on your page, sometimes you want people not to find some things, and that is what this post is about.</p>
<p>There are three main ways of preventing search engines from indexing certain pages, robots.txt, meta robots tags and the rel=&#8221;nofollow&#8221;  attribute for links.</p>
<h3>robots.txt</h3>
<p>robots.txt is a small text file which you place in the server root, eg <b>http://www.testdomain.com/robots.txt</b>. Note that putting in another directory than the root won&#8217;t work. <strike><b>http://www.testdomain.com/folder/robots.txt</b></strike> will in other words not be detected by search engine spiders. robots.txt can contain a number of commands. The commands of interest for indexing prevention are <b>User-agent</b>, <b>Disallow </b>and <b>Allow</b>. Every robots.txt should start with a <b>User-agent</b> command which decides which Agent (In other words search engine spider) should be affected by the following commands. Generally you want to use the same rules for all engines, which is represented by the command  <b>User-agent: *</b></p>
<p>Next up is the <b>Allow </b>and <b>Disallow </b>commands. URL&#8217;s followed by the <b>Allow </b>command will be crawled and indexed, while those following <b>Disallow </b>will not. Here&#8217;s a simple example of a robots.txt file disallowing one directory.</p>
<pre>User-agent: *
Disallow: /secretdir/</pre>
<p>This will tell all robots to exclude <b>http://www.yourdomain.com/secretdir/</b> and any files and subdirectories in that folder.</p>
<p>What about the Allow command then? The Allow command can be combined with Disallow to create custom rules. Say you want to have <b>http://www.yourdomain.com/secretdir/publicpage.html </b>indexed, but nothing else in the directory <b>http://www.yourdomain.com/secretdir/</b>. Then you would first have an Allow command to allow the particular page to be indexed, and then a Disallow command to prevent the rest of the directory to be indexed.</p>
<pre>User-agent: *
Allow: /secretdir/publicpage.html
Disallow: /secretdir/</pre>
<p>Which touches the subject of precedence. In which order are the rules applied? The RFC standard says that the first applicable rule should be used. Consider this excample:</p>
<pre>User-agent: *
Allow: /
Disallow: /secretdir/</pre>
<p>According to the RFC standard this example would not do what the webmaster wanted, that is allow everything except <b>http://www.yourdomain.com/secretdir/</b>. Following the RFC rules, everything, including <b>http://www.yourdomain.com/secretdir/</b>, would be indexed. This is so because the first applicable rule would be applied, in this case <b>Allow: /</b>, since <b>secretdir </b>is situated under <b>/</b>. However, Google has chosen to misinterpret the rules so that the most specific rule is applied first, in this case <b>Disallow: /secretdir/</b> since it&#8217;s more specific than <b>Allow: /</b>.<br />
But if you want to play it safe and make sure all search engines interpret the rules correctly, you should place the <b>Disallow </b>rule in the example above the <b>Allow </b>rule.</p>
<p>But since, as shown above, <b>robots.txt</b> files cannot be stored in subdirectories, this solution cannot be used for some cheap/free web hosts where you do not have access to your own domain. Which leads us to:</p>
<h3>Meta tags</h3>
<p>Meta tags are tags containing meta data, that is data about the document in they are placed in. Meta tags can specify alot of different information, but the tag of interest for this post is the robots tag. It can take on four values, which can be combined. This an example on what the HTML code for the tag could look like:</p>
<pre>&lt;meta name="robots" value="noindex, nofollow" /&gt;</pre>
<p>This code will tell the robot to neither index the page nor follow links from it.<br />
The four values the value attribute can take on are {<i>noindex, nofollow, index, follow</i>}. The index attribute explicitly tells the robot to index the page it appears on. The follow attribute explicitly tells the robot to index any outgoing links from thepage it appears on. The no-prefixed attributes explicitly tells the robot <i>not </i>to do the respective thing.</p>
<p>Despite what some SEO freaks say, you typically never need to add the index attribute; the robot will index the page by default. The only exception might be if you have added noindex but want links to be followed. In that case you might want to add follow to make sure that links are followed, but even in that case that shouldn&#8217;t be necessary.</p>
<p>So, the meta robots method gives control over how each html page is treated by search engine robots, but the last methods offers even more fine grained control.</p>
<h3>rel=&#8221;nofollow&#8221;  attribute for links</h3>
<p>This last attribute lets you control individually for every link whether it should be followed by a search engine robot. You could use this attribute to prevent that a certain page on your site gets indexed, but that&#8217;s a bad way of doing it. As long as there&#8217;s another link pointing to that page it will be indexed anyway. Use one of the other methods instead to be certain.</p>
<p>The real beauty with attributing links with rel=&#8221;nofollow&#8221; is that robots pretend that the link doesn&#8217;t exist. Since Google and other search engines rank a page based on how many times it has been linked to, this is an effective way of linking to a page without supporting it by increasing its rank.</p>
<pre>&lt;a href="http://www.thatpageidontlike.com" rel="nofollow"&gt;link me beautiful&lt;/a&gt;</pre>
<p>If you have thoughts or questions about this post, don&#8217;t hesitate to leave a comment below.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=13&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2006/07/04/preventing-search-engine-indexing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>
	</item>
		<item>
		<title>Gmail and mailing lists</title>
		<link>http://packetsofknowledge.wordpress.com/2006/07/03/gmail-and-mailing-lists/</link>
		<comments>http://packetsofknowledge.wordpress.com/2006/07/03/gmail-and-mailing-lists/#comments</comments>
		<pubDate>Mon, 03 Jul 2006 18:03:08 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[gmail]]></category>

		<guid isPermaLink="false">https://packetsofknowledge.wordpress.com/2006/07/03/gmail-and-mailing-lists/</guid>
		<description><![CDATA[A great deal of my e-mail volume consists of traffic to and from mailing lists. I think mailing lists is a great way of communicating. This is so because all traffic will reach you, as opposed to eg forums where you&#8217;re likely to miss something. It is of course for the same reason some people [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=7&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A great deal of my e-mail volume consists of traffic to and from mailing lists. I think mailing lists is a great way of communicating. This is so because all traffic will reach you, as opposed to eg forums where you&#8217;re likely to miss something. It is of course for the same reason some people don&#8217;t like mailing lists, because all messages appear in an utter mess.</p>
<p>Unless you use <a href="http://mail.google.com/mail" target="_blank">gmail</a> of course! Some (non-tech) people seem to scared by the conversation views in gmail. They might just not get it (Where are my messages?) or they might not see the point in it. And true enough, if your average e-mail conversation consists of 2-3 messages, say 1 message, and one or two replies, there might not be much point in it.</p>
<p>But the conversation system has the advantage of keeping messages in a context. Even there&#8217;s a month between every reply, the messages are stuck together, so you can always have a quick look in the history. Which leads us to the search function, which makes the conversation view even more useful. Say you look for something and find messages from two years ago. Then it might be even more valuable to have the messages stacked in conversations.</p>
<p>I can without doubt say that the way gmail works has encouraged me to join  more mailing lists.</p>
<p>But enough talk. Now for some hands-on tips on how to make gmail more suitable for mailing lists use.</p>
<p><b>Personal level indicators</b></p>
<p><img src="http://packetsofknowledge.files.wordpress.com/2006/07/gmail_personal_level_indicators.png" alt="Gmail Personal Level Indicators" /></p>
<p>Go to settings and activate this function. As the text says, this function will show indicators to show when a mail is addressed to you personally.When this setting is activated, if an e-mail has a double arrow it&#8217;s either a private conversation, or a group conversation where someone has decided tosend you a private mail. A single arrow means that some mail in the conversation was sent semi-personal, such as if your address is CC&#8217;d.</p>
<p><img src="http://packetsofknowledge.files.wordpress.com/2006/07/personal_level_indicators_in_practise.png" alt="Personal Level Indicators in Practice" /><br />
In this example, the topmost mail is one that I sent and got a reply to. The second one is a mail that I got a CC copy of. And the last one is a regular list conversation.</p>
<p>Here&#8217;s a wish though: When new mail arrives to a list conversation that has been marked with a double arrow, the whole row becomes bold marked. However, I&#8217;d want the arrow to be bold <i>only</i> if a new private mail has arrived, so I don&#8217;t get false alarms.</p>
<p><b>Filters and labels</b></p>
<p>Most groups put a small &#8220;banner&#8221; before the mail title, ie an abbreviation for the group&#8217;s name in brackets, such as <b>[sxdm] Mail title</b>. But some don&#8217;t. In these cases you can create a filter which will put a tag on conversations from a certain group.</p>
<p>The first thing you must do is find something all mails from a certain list have in ommon. Usually a mailing lists either set to or from to the lists address. This is individual for every list, so you&#8217;ll have to look for yourself.</p>
<p>Start off by clicking Create a filter near the search button. Assume that you somehow have deduced that all messages from the list in question have the address <b>testlist@testdomain.com</b> as their to address. So you enter that  to the appropriate field. This might also be a good opportunity to test the filter.</p>
<p><img src="http://packetsofknowledge.files.wordpress.com/2006/07/filter-01.png" alt="Filter step 1" /></p>
<p>On the next page click Choose label and choose New label. Enter the name, preferably in brackets to it&#8217;ll fit in with other group names.<br />
<img src="http://packetsofknowledge.files.wordpress.com/2006/07/filter-02.png" alt="Filter step 2" /><br />
<img src="http://packetsofknowledge.files.wordpress.com/2006/07/filter-03.png" alt="Filter step 3" /></p>
<p>If everything went well, you will now have a working filter which will tag all incoming messages.</p>
<p><img src="http://packetsofknowledge.files.wordpress.com/2006/07/filter-04.png" alt="Filter step 4" /></p>
<p>Here&#8217;s a sample image of an e-mail with a tag, so you know when you got it right.</p>
<p><img src="http://packetsofknowledge.files.wordpress.com/2006/07/filter-05.png" alt="Filter step 5" /></p>
<p>That&#8217;s all for this time. If you know any more useful gmail techniques, please leave a comment!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=7&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2006/07/03/gmail-and-mailing-lists/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2006/07/gmail_personal_level_indicators.png" medium="image">
			<media:title type="html">Gmail Personal Level Indicators</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2006/07/personal_level_indicators_in_practise.png" medium="image">
			<media:title type="html">Personal Level Indicators in Practice</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2006/07/filter-01.png" medium="image">
			<media:title type="html">Filter step 1</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2006/07/filter-02.png" medium="image">
			<media:title type="html">Filter step 2</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2006/07/filter-03.png" medium="image">
			<media:title type="html">Filter step 3</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2006/07/filter-04.png" medium="image">
			<media:title type="html">Filter step 4</media:title>
		</media:content>

		<media:content url="http://packetsofknowledge.files.wordpress.com/2006/07/filter-05.png" medium="image">
			<media:title type="html">Filter step 5</media:title>
		</media:content>
	</item>
		<item>
		<title>Numeric array sort in Javascript</title>
		<link>http://packetsofknowledge.wordpress.com/2006/07/03/numeric-array-sort-in-javascript/</link>
		<comments>http://packetsofknowledge.wordpress.com/2006/07/03/numeric-array-sort-in-javascript/#comments</comments>
		<pubDate>Mon, 03 Jul 2006 13:18:12 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">https://packetsofknowledge.wordpress.com/2006/07/03/numeric-array-sort-in-javascript/</guid>
		<description><![CDATA[(This is a response to Hakan Bilgin&#8217;s post Javascript Array: Sorting on his blog challenger)
Hakan presents a function for sorting a javascript array numerically, as opposed to alphabetically ([1,2,3,21].sort() =&#62; [1,2,21,3]) Such functions have existed about as long as people have needed to sort javascript arrays. However hakan&#8217;s function introduces two new features, namely the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=4&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>(This is a response to Hakan Bilgin&#8217;s post <a href="http://www.challenger.se/?post=997" target="_blank">Javascript Array: Sorting</a> on his blog <a href="http://www.challenger.se/" target="_blank">challenger</a>)</p>
<p>Hakan presents a function for sorting a javascript array numerically, as opposed to alphabetically (<b>[1,2,3,21].sort() =&gt; [1,2,21,3]</b>) Such functions have existed about as long as people have needed to sort javascript arrays. However hakan&#8217;s function introduces two new features, namely the ability to choose sort order, (Which btw is defaulted to descending order in his function) and that it takes care of non-numerical objects, such as strings, in the array, and puts them in the higher end of the sorted array.</p>
<p>One thing I don&#8217;t like about his implementation is that it doesn&#8217;t work well with  decimal numbers. (<b>[1,2.4,2].sort_int(1) =&gt; [1,2.4,2]</b>) 2.4 is simply rounded to 2 by parseInt and will not be guaranteed to end up on the right side of 2. But of course, sort_int was not meant to be used this way.</p>
<p>Anyway, I propose this code to the job:</p>
<pre>Array.prototype.numsort=function(d){
    var d = d || -1;

    return this.sort(function(a,b){
        if (isNaN(a-b))
            return (isNaN(a)?1:-1)*d;

    return (a-b)*d;
    });
}

// Test the code
alert([1, 12, "a", 3, 29, 34, 4, 4.5, 4, 6, 46].
    numsort(-1));</pre>
<p>I guess that&#8217;s it. If there&#8217;s anything fundamentally wrong with this code, please let me know. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=4&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2006/07/03/numeric-array-sort-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome to Packets of Knowledge</title>
		<link>http://packetsofknowledge.wordpress.com/2006/06/16/hello-world/</link>
		<comments>http://packetsofknowledge.wordpress.com/2006/06/16/hello-world/#comments</comments>
		<pubDate>Fri, 16 Jun 2006 20:02:00 +0000</pubDate>
		<dc:creator>nitro2k01</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to Packets of Knowledge. This will be a blog with tips and tricks about different things, mainly related to web technology, both for developers and plain users.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=1&subd=packetsofknowledge&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Welcome to Packets of Knowledge. This will be a blog with tips and tricks about different things, mainly related to web technology, both for developers and plain users.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/packetsofknowledge.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/packetsofknowledge.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/packetsofknowledge.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/packetsofknowledge.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/packetsofknowledge.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/packetsofknowledge.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/packetsofknowledge.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/packetsofknowledge.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/packetsofknowledge.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/packetsofknowledge.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/packetsofknowledge.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/packetsofknowledge.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=packetsofknowledge.wordpress.com&blog=269451&post=1&subd=packetsofknowledge&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://packetsofknowledge.wordpress.com/2006/06/16/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/650c3d73ce007dc2c274aace0dd5ea97?s=96&#38;d=identicon" medium="image">
			<media:title type="html">soundandcomplete</media:title>
		</media:content>
	</item>
	</channel>
</rss>