<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>Note to self and others</title>
	<link>http://www.lockergnome.com/awarberg</link>
	<description>Code snippets, experiences, guides &#38; suggestions - mostly IT :)</description>
	<pubDate>Wed, 21 May 2008 08:32:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Find and delete empty directories</title>
		<link>http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/#comments</comments>
		<pubDate>Tue, 20 May 2008 13:03:51 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<category>file system</category>

		<category>ruby</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div><p>I had iTunes &#8220;help&#8221; me organize my musik for a while. Now I&#8217;ve abandoned it for this reason, among others (e.g. it&#8217;s terribly slow and playback stutters).</p>
<p>I&#8217;ve used <a href="http://musicbrainz.org/">http://musicbrainz.org/</a> products to clean up the mess, but only to be left with a bunch of empty directories (thanks again, iTunes). I wrote up this ruby script to take care of them for me:</p>
<pre>class String
  # Sets the proper singular or plural suffix of a word.
  # Self should be the singular form of the word.
  def suffix(n)
    return self if n == 1
    case self
    when /n$/
      "#{self}s"
    when /y$/
      "#{self[0...-1]}ies"
    else
      self # don't know what to do about this ending
    end
  end
end

def delete_empty_directories(root_directory)
  iterations = deleted_total = 0
  loop do # a directory containing an directory will become empty when the subdir is removed
    iterations += 1
    deleted = 0
    Dir[File.join(root_directory,'**','*')].each do |e|
      next unless File.directory?(e)
      next unless (Dir.entries(e)-['.','..']).empty?
      Dir.delete(e) # will fail if e is not, in fact, an empty dir
      deleted += 1
    end
    break if deleted.zero?
    deleted_total += deleted
    puts "Iteration #{iterations}: deleted #{deleted} empty #{'directory'.suffix(deleted)}"
  end
  puts "Deleted #{deleted_total} empty #{'directory'.suffix(deleted_total)} "+
    "under #{root_directory} in #{iterations} #{'iteration'.suffix(iterations)}"
end

delete_empty_directories(File.join('d:','Media','Musik'))</pre>
<p>The code will enter my music directory and find all entries recursively (Dir[File.join(root_directory,&#8217;**&#8217;,'*&#8217;)]). Among those it finds empty directories i.e. directories which contain only the self- and parent-references (. and .. resp.) and deletes them.</p>
<p>This process is repeated until there are no more directories that can be deleted. The reason for repeating is that an empty sub directory may be the only thing keeping its parent from being empty, but the child must be removed before this becomes evident.</p>
<p>The code also contains a simple mechanism for properly suffixing words in singular and plural form. I got really tired of all those programs just writing something like <em>Finished processing %n element(s)</em> when you can easily find the correct suffix of <em>element(s)</em> so that it corresponds to <em>%n</em>. Maybe this can serve as inspiration!</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/08/transform-ruby-array-to-tex-table/" title="Transform ruby array to tex table">Transform ruby array to tex table</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/" title="Firefox file links">Firefox file links</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/windows/2007/02/20/empty-folder-nuker-v120/" title="Empty Folder Nuker v1.2.0">Empty Folder Nuker v1.2.0</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2007/03/15/empty-the-temporary-internet-files-folder-in-internet-explorer-7/" title="Empty The Temporary Internet Files Folder In Internet Explorer 7">Empty The Temporary Internet Files Folder In Internet Explorer 7</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2007/10/10/disable-the-recycle-bin-in-vista/" title="Disable The Recycle Bin In Vista">Disable The Recycle Bin In Vista</a></li>
																							<li><a href="http://www.lockergnome.com/linux/2001/11/01/file-system-structure/" title="File System Structure">File System Structure</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /><p>I had iTunes &#8220;help&#8221; me organize my musik for a while. Now I&#8217;ve abandoned it for this reason, among others (e.g. it&#8217;s terribly slow and playback stutters).</p>
<p>I&#8217;ve used <a href="http://musicbrainz.org/">http://musicbrainz.org/</a> products to clean up the mess, but only to be left with a bunch of empty directories (thanks again, iTunes). I wrote up this ruby script to take care of them for me:</p>
<pre>class String
  # Sets the proper singular or plural suffix of a word.
  # Self should be the singular form of the word.
  def suffix(n)
    return self if n == 1
    case self
    when /n$/
      "#{self}s"
    when /y$/
      "#{self[0...-1]}ies"
    else
      self # don't know what to do about this ending
    end
  end
end

def delete_empty_directories(root_directory)
  iterations = deleted_total = 0
  loop do # a directory containing an directory will become empty when the subdir is removed
    iterations += 1
    deleted = 0
    Dir[File.join(root_directory,'**','*')].each do |e|
      next unless File.directory?(e)
      next unless (Dir.entries(e)-['.','..']).empty?
      Dir.delete(e) # will fail if e is not, in fact, an empty dir
      deleted += 1
    end
    break if deleted.zero?
    deleted_total += deleted
    puts "Iteration #{iterations}: deleted #{deleted} empty #{'directory'.suffix(deleted)}"
  end
  puts "Deleted #{deleted_total} empty #{'directory'.suffix(deleted_total)} "+
    "under #{root_directory} in #{iterations} #{'iteration'.suffix(iterations)}"
end

delete_empty_directories(File.join('d:','Media','Musik'))</pre>
<p>The code will enter my music directory and find all entries recursively (Dir[File.join(root_directory,&#8217;**&#8217;,'*&#8217;)]). Among those it finds empty directories i.e. directories which contain only the self- and parent-references (. and .. resp.) and deletes them.</p>
<p>This process is repeated until there are no more directories that can be deleted. The reason for repeating is that an empty sub directory may be the only thing keeping its parent from being empty, but the child must be removed before this becomes evident.</p>
<p>The code also contains a simple mechanism for properly suffixing words in singular and plural form. I got really tired of all those programs just writing something like <em>Finished processing %n element(s)</em> when you can easily find the correct suffix of <em>element(s)</em> so that it corresponds to <em>%n</em>. Maybe this can serve as inspiration!</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/08/transform-ruby-array-to-tex-table/" title="Transform ruby array to tex table">Transform ruby array to tex table</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/" title="Firefox file links">Firefox file links</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/windows/2007/02/20/empty-folder-nuker-v120/" title="Empty Folder Nuker v1.2.0">Empty Folder Nuker v1.2.0</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2007/03/15/empty-the-temporary-internet-files-folder-in-internet-explorer-7/" title="Empty The Temporary Internet Files Folder In Internet Explorer 7">Empty The Temporary Internet Files Folder In Internet Explorer 7</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2007/10/10/disable-the-recycle-bin-in-vista/" title="Disable The Recycle Bin In Vista">Disable The Recycle Bin In Vista</a></li>
																							<li><a href="http://www.lockergnome.com/linux/2001/11/01/file-system-structure/" title="File System Structure">File System Structure</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PPTPD setup for home networks</title>
		<link>http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/#comments</comments>
		<pubDate>Fri, 09 May 2008 15:58:39 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<category>linux</category>

		<category>microsoft vpn</category>

		<category>poptop</category>

		<category>pptp</category>

		<category>pptpd</category>

		<category>ubuntu</category>

		<category>vpn</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div><p>I managed to get the poptop aka pptpd server running to my content today.</p>
<p>I have an Ubuntu server at home, which I would like to access from the internet side. I mostly use Windows machines, which natively support pptp connections so the choice of poptop was obvious. A good alternative would be OpenVPN, of course.</p>
<p>First I installed pptpd:</p>
<pre>$ sudo apt-get install pptpd</pre>
<p>This will install the pptp daemon and cause it to start on boot. Next I added users:</p>
<pre>$ sudo pico /etc/ppp/chap-secrets</pre>
<p>The lines of chap-secrets has the format:</p>
<pre>my_username pptpd my_password *</pre>
<p>It is possible to authenticate against other sources, but for my small network (a couple of users) it seemed a bit overkill.</p>
<p>Next I opened:</p>
<pre>$ sudo pico /etc/pptpd.conf</pre>
<p>Where I defined the ip addresses to be used by inserting the lines:</p>
<pre>localip 192.168.1.200
remoteip 192.168.1.201-250</pre>
<p>Note here that local ip becomes the address of VPN server and should be different from the ip address of the servers physical network interface (which is 192.168.1.100 in my case). The remoteip line defines an address range from which VPN clients receive their addresses.</p>
<p>I believe it is important that these addresses are in the same range as the rest of your LAN, otherwise you will only be able to access resources on the VPN server.</p>
<p>I want to access not only the VPN server but also resources on the LAN and for this I enabled ip forwarding:</p>
<pre>$ sudo pico /etc/sysctl.conf</pre>
<p>In this file I inserted the lines:</p>
<pre>net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1</pre>
<p>This will take effect on each next boot, to enable ip forwarding right away run:</p>
<pre>$ sudo sysctl -p</pre>
<p>You should now be able to access other hosts on the LAN as the VPN server can now forward your requests.</p>
<p>Last we define a DNS server to be assigned to VPN clients, so that they may use the gateway of the VPN as default gateway and thus obtain a full tunneling experience. This is useful if you are on an insecure network (eg. unsecured wireless) and want to, for instance, browse plain http websites without the risk of leaking information.</p>
<pre>$ sudo pico /etc/ppp/pptpd-options</pre>
<p>Insert this line:</p>
<pre>ms-dns 192.168.1.1</pre>
<p>Exchanging 192.168.1.1 with your DNS server. In my case 192.168.1.1 is the ISP-supplied NAT router, which serves as both gateway and DNS relay.</p>
<p>Finally restart the pptpd by issuing the command:</p>
<pre>$ sudo /etc/init.d/pptpd restart</pre>
<p>Using these instructions you should now be able to create a new VPN connection in Windows using credentials you inserted into chap-secrets. A trick here is to select a username and password which is the same as your Windows username and password. In the properties of the VPN connection you can then go to the Security tab and check <em>Automatically use my Windows logon name and password</em> and in the future you don&#8217;t need to enter your credentials.</p>
<p>If you don&#8217;t want to route all traffic over the tunnel open to properties of the connection, go to the Networking tab, choose Properties and then Advanced for TCP/IP and un-check the <em>Use default gateway on remote network</em> checkbox.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/09/windows-network-confusion/" title="Windows network confusion">Windows network confusion</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/computrout/2007/11/06/ok-folks-secure-your-wireless-networks/" title="OK Folks - Secure Your Wireless Networks">OK Folks - Secure Your Wireless Networks</a></li>
																							<li><a href="http://www.lockergnome.com/news/2003/10/14/microsoft-automates-wi-fi-network-setup/" title="Microsoft automates Wi-Fi network setup">Microsoft automates Wi-Fi network setup</a></li>
																							<li><a href="http://www.lockergnome.com/hardware/2006/03/17/homegrown-networks/" title="Homegrown Networks">Homegrown Networks</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2004/09/27/troubleshooting-network-connections/" title="Troubleshooting Network Connections">Troubleshooting Network Connections</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /><p>I managed to get the poptop aka pptpd server running to my content today.</p>
<p>I have an Ubuntu server at home, which I would like to access from the internet side. I mostly use Windows machines, which natively support pptp connections so the choice of poptop was obvious. A good alternative would be OpenVPN, of course.</p>
<p>First I installed pptpd:</p>
<pre>$ sudo apt-get install pptpd</pre>
<p>This will install the pptp daemon and cause it to start on boot. Next I added users:</p>
<pre>$ sudo pico /etc/ppp/chap-secrets</pre>
<p>The lines of chap-secrets has the format:</p>
<pre>my_username pptpd my_password *</pre>
<p>It is possible to authenticate against other sources, but for my small network (a couple of users) it seemed a bit overkill.</p>
<p>Next I opened:</p>
<pre>$ sudo pico /etc/pptpd.conf</pre>
<p>Where I defined the ip addresses to be used by inserting the lines:</p>
<pre>localip 192.168.1.200
remoteip 192.168.1.201-250</pre>
<p>Note here that local ip becomes the address of VPN server and should be different from the ip address of the servers physical network interface (which is 192.168.1.100 in my case). The remoteip line defines an address range from which VPN clients receive their addresses.</p>
<p>I believe it is important that these addresses are in the same range as the rest of your LAN, otherwise you will only be able to access resources on the VPN server.</p>
<p>I want to access not only the VPN server but also resources on the LAN and for this I enabled ip forwarding:</p>
<pre>$ sudo pico /etc/sysctl.conf</pre>
<p>In this file I inserted the lines:</p>
<pre>net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1</pre>
<p>This will take effect on each next boot, to enable ip forwarding right away run:</p>
<pre>$ sudo sysctl -p</pre>
<p>You should now be able to access other hosts on the LAN as the VPN server can now forward your requests.</p>
<p>Last we define a DNS server to be assigned to VPN clients, so that they may use the gateway of the VPN as default gateway and thus obtain a full tunneling experience. This is useful if you are on an insecure network (eg. unsecured wireless) and want to, for instance, browse plain http websites without the risk of leaking information.</p>
<pre>$ sudo pico /etc/ppp/pptpd-options</pre>
<p>Insert this line:</p>
<pre>ms-dns 192.168.1.1</pre>
<p>Exchanging 192.168.1.1 with your DNS server. In my case 192.168.1.1 is the ISP-supplied NAT router, which serves as both gateway and DNS relay.</p>
<p>Finally restart the pptpd by issuing the command:</p>
<pre>$ sudo /etc/init.d/pptpd restart</pre>
<p>Using these instructions you should now be able to create a new VPN connection in Windows using credentials you inserted into chap-secrets. A trick here is to select a username and password which is the same as your Windows username and password. In the properties of the VPN connection you can then go to the Security tab and check <em>Automatically use my Windows logon name and password</em> and in the future you don&#8217;t need to enter your credentials.</p>
<p>If you don&#8217;t want to route all traffic over the tunnel open to properties of the connection, go to the Networking tab, choose Properties and then Advanced for TCP/IP and un-check the <em>Use default gateway on remote network</em> checkbox.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/09/windows-network-confusion/" title="Windows network confusion">Windows network confusion</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/computrout/2007/11/06/ok-folks-secure-your-wireless-networks/" title="OK Folks - Secure Your Wireless Networks">OK Folks - Secure Your Wireless Networks</a></li>
																							<li><a href="http://www.lockergnome.com/news/2003/10/14/microsoft-automates-wi-fi-network-setup/" title="Microsoft automates Wi-Fi network setup">Microsoft automates Wi-Fi network setup</a></li>
																							<li><a href="http://www.lockergnome.com/hardware/2006/03/17/homegrown-networks/" title="Homegrown Networks">Homegrown Networks</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2004/09/27/troubleshooting-network-connections/" title="Troubleshooting Network Connections">Troubleshooting Network Connections</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows network confusion</title>
		<link>http://www.lockergnome.com/awarberg/2008/05/09/windows-network-confusion/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/05/09/windows-network-confusion/#comments</comments>
		<pubDate>Fri, 09 May 2008 11:39:19 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<category>pptpd</category>

		<category>windows error</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/05/09/windows-network-confusion/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div><p>Hi</p>
<p>I am playing around with a <a href="http://poptop.sourceforge.net/">poptop </a>box on an <a href="http://www.ubuntu.com/">Ubuntu</a> server at home. While testing the connection to the VPN server I got this very interesting result when pinging the IP, which was assigned to me by pptpd:</p>
<pre>C:\&gt;ping 192.168.0.210

Pinging 192.168.0.210 with 32 bytes of data:

Reply from 192.168.0.210: bytes=32 time=4ms TTL=128
Reply from 192.168.0.210: bytes=32 time=-4ms TTL=128
Reply from 192.168.0.210: bytes=32 time&lt;1ms TTL=128
Reply from 192.168.0.210: bytes=32 time=-4ms TTL=128

Ping statistics for 192.168.0.210:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = -4ms, Average = 1073741823ms</pre>
<p>Some weird quantum physics going on? :)</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/" title="PPTPD setup for home networks">PPTPD setup for home networks</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/" title="Firefox file links">Firefox file links</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/" title="No more Vista">No more Vista</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/" title="Firefox File Links Take 2 - URL Protocol Handler">Firefox File Links Take 2 - URL Protocol Handler</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/news/2004/01/27/amd-athlon-64-processors/" title="AMD Athlon 64 Processors">AMD Athlon 64 Processors</a></li>
																							<li><a href="http://www.lockergnome.com/mobile/2005/01/05/korean-wireless-broadband-confusion/" title="Korean Wireless Broadband Confusion">Korean Wireless Broadband Confusion</a></li>
																							<li><a href="http://www.lockergnome.com/it/2004/07/14/kerberos-gone-wild/" title="Kerberos Gone Wild">Kerberos Gone Wild</a></li>
																							<li><a href="http://www.lockergnome.com/shausha/2007/08/02/whats-in-a-name/" title="What's In A Name?">What's In A Name?</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /><p>Hi</p>
<p>I am playing around with a <a href="http://poptop.sourceforge.net/">poptop </a>box on an <a href="http://www.ubuntu.com/">Ubuntu</a> server at home. While testing the connection to the VPN server I got this very interesting result when pinging the IP, which was assigned to me by pptpd:</p>
<pre>C:\&gt;ping 192.168.0.210

Pinging 192.168.0.210 with 32 bytes of data:

Reply from 192.168.0.210: bytes=32 time=4ms TTL=128
Reply from 192.168.0.210: bytes=32 time=-4ms TTL=128
Reply from 192.168.0.210: bytes=32 time&lt;1ms TTL=128
Reply from 192.168.0.210: bytes=32 time=-4ms TTL=128

Ping statistics for 192.168.0.210:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = -4ms, Average = 1073741823ms</pre>
<p>Some weird quantum physics going on? :)</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/" title="PPTPD setup for home networks">PPTPD setup for home networks</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/" title="Firefox file links">Firefox file links</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/" title="No more Vista">No more Vista</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/" title="Firefox File Links Take 2 - URL Protocol Handler">Firefox File Links Take 2 - URL Protocol Handler</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/news/2004/01/27/amd-athlon-64-processors/" title="AMD Athlon 64 Processors">AMD Athlon 64 Processors</a></li>
																							<li><a href="http://www.lockergnome.com/mobile/2005/01/05/korean-wireless-broadband-confusion/" title="Korean Wireless Broadband Confusion">Korean Wireless Broadband Confusion</a></li>
																							<li><a href="http://www.lockergnome.com/it/2004/07/14/kerberos-gone-wild/" title="Kerberos Gone Wild">Kerberos Gone Wild</a></li>
																							<li><a href="http://www.lockergnome.com/shausha/2007/08/02/whats-in-a-name/" title="What's In A Name?">What's In A Name?</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/05/09/windows-network-confusion/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Transform ruby array to tex table</title>
		<link>http://www.lockergnome.com/awarberg/2008/05/08/transform-ruby-array-to-tex-table/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/05/08/transform-ruby-array-to-tex-table/#comments</comments>
		<pubDate>Thu, 08 May 2008 10:46:30 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<category>latex</category>

		<category>ruby</category>

		<category>table</category>

		<category>tex</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/05/08/transform-ruby-array-to-tex-table/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div><p>This has probably been written in many projects, anyways here is the code I wrote up to convert a ruby table / 2-dimensional array / array of arrays to a tex table:</p>
<pre>def to_tex(table, user_opts = {})
  default_opts = {:center =&gt; true, :sep_cols =&gt; true, :col_align =&gt; 'l'}
  opts = default_opts.merge(user_opts)
  lines = ['\begin{table}[!ht]']
  lines &lt;&lt; '\begin{center}' if opts[:center]
  headers = table.first
  lines &lt;&lt; "\\begin{tabular}{#{headers.map{opts[:col_align]}.join(opts[:sep_cols] ? '|' : '')}}"
  headers_in_bold = headers.map{|header| (header.nil? or header.empty?) ? '' : "\\textbf{#{header}}"}
  lines &lt;&lt; headers_in_bold.join(' &amp; ') + '\\\\ \\hline'
  table[1..-1].each{|row| lines &lt;&lt; row.join(' &amp; ') + '\\\\'}
  lines &lt;&lt; '\end{tabular}'
  lines &lt;&lt; '\end{center}' if opts[:center]
  lines &lt;&lt; "\\caption{#{opts[:caption]}}" if opts[:caption]
  lines &lt;&lt; "\\label{#{opts[:label]}}" if opts[:label]
  lines &lt;&lt; '\end{table}'
  lines.join("\n")
end</pre>
<p>The code assumes the first row is the header row and will put the column titles in bold. A horizontal line is put below the headers and then your rows are printed.</p>
<p>There are a some user definable options: the use of centering, caption, label, column alignment and the use of column separation. Some of them have a default value in the default_opts hash.</p>
<p>Usage example:</p>
<pre>table = [[nil, 'Even?', 'Square']]
10.times{|i| table &lt;&lt; [i, (i % 2 == 0) ? 'Y' : 'N', i**2]}
puts to_tex(table, :col_align =&gt; 'c', :caption =&gt; 'Table of numbers and basic properties')</pre>
<p>This gives:</p>
<pre>\begin{table}[!ht]
\begin{center}
\begin{tabular}{c|c|c}
 &amp; \textbf{Even?} &amp; \textbf{Square}\\ \hline
0 &amp; Y &amp; 0\\
1 &amp; N &amp; 1\\
2 &amp; Y &amp; 4\\
3 &amp; N &amp; 9\\
4 &amp; Y &amp; 16\\
5 &amp; N &amp; 25\\
6 &amp; Y &amp; 36\\
7 &amp; N &amp; 49\\
8 &amp; Y &amp; 64\\
9 &amp; N &amp; 81\\
\end{tabular}
\end{center}
\caption{Table of numbers and basic properties}
\end{table}</pre>
<p>I hope this helps.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/" title="Find and delete empty directories">Find and delete empty directories</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/11/11/fast-test-for-consecutive-integer-set-using-gauss-summation-rule/" title="Fast test for consecutive integer set using Gauss summation rule">Fast test for consecutive integer set using Gauss summation rule</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/04/22/random-iterator-in-java/" title="Random Iterator in Java">Random Iterator in Java</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/web/2005/10/18/ruby-on-rails/" title="Ruby On Rails">Ruby On Rails</a></li>
																							<li><a href="http://www.lockergnome.com/web/2005/09/19/web-services-made-easy-with-ruby/" title="Web Services Made Easy with Ruby">Web Services Made Easy with Ruby</a></li>
																							<li><a href="http://www.lockergnome.com/web/2005/10/24/how-do-i-get-started-with-ruby-on-rails/" title="How Do I Get Started With Ruby On Rails?">How Do I Get Started With Ruby On Rails?</a></li>
																							<li><a href="http://www.lockergnome.com/linux/2006/05/26/rubygems/" title="RubyGems">RubyGems</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /><p>This has probably been written in many projects, anyways here is the code I wrote up to convert a ruby table / 2-dimensional array / array of arrays to a tex table:</p>
<pre>def to_tex(table, user_opts = {})
  default_opts = {:center =&gt; true, :sep_cols =&gt; true, :col_align =&gt; 'l'}
  opts = default_opts.merge(user_opts)
  lines = ['\begin{table}[!ht]']
  lines &lt;&lt; '\begin{center}' if opts[:center]
  headers = table.first
  lines &lt;&lt; "\\begin{tabular}{#{headers.map{opts[:col_align]}.join(opts[:sep_cols] ? '|' : '')}}"
  headers_in_bold = headers.map{|header| (header.nil? or header.empty?) ? '' : "\\textbf{#{header}}"}
  lines &lt;&lt; headers_in_bold.join(' &amp; ') + '\\\\ \\hline'
  table[1..-1].each{|row| lines &lt;&lt; row.join(' &amp; ') + '\\\\'}
  lines &lt;&lt; '\end{tabular}'
  lines &lt;&lt; '\end{center}' if opts[:center]
  lines &lt;&lt; "\\caption{#{opts[:caption]}}" if opts[:caption]
  lines &lt;&lt; "\\label{#{opts[:label]}}" if opts[:label]
  lines &lt;&lt; '\end{table}'
  lines.join("\n")
end</pre>
<p>The code assumes the first row is the header row and will put the column titles in bold. A horizontal line is put below the headers and then your rows are printed.</p>
<p>There are a some user definable options: the use of centering, caption, label, column alignment and the use of column separation. Some of them have a default value in the default_opts hash.</p>
<p>Usage example:</p>
<pre>table = [[nil, 'Even?', 'Square']]
10.times{|i| table &lt;&lt; [i, (i % 2 == 0) ? 'Y' : 'N', i**2]}
puts to_tex(table, :col_align =&gt; 'c', :caption =&gt; 'Table of numbers and basic properties')</pre>
<p>This gives:</p>
<pre>\begin{table}[!ht]
\begin{center}
\begin{tabular}{c|c|c}
 &amp; \textbf{Even?} &amp; \textbf{Square}\\ \hline
0 &amp; Y &amp; 0\\
1 &amp; N &amp; 1\\
2 &amp; Y &amp; 4\\
3 &amp; N &amp; 9\\
4 &amp; Y &amp; 16\\
5 &amp; N &amp; 25\\
6 &amp; Y &amp; 36\\
7 &amp; N &amp; 49\\
8 &amp; Y &amp; 64\\
9 &amp; N &amp; 81\\
\end{tabular}
\end{center}
\caption{Table of numbers and basic properties}
\end{table}</pre>
<p>I hope this helps.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/" title="Find and delete empty directories">Find and delete empty directories</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/11/11/fast-test-for-consecutive-integer-set-using-gauss-summation-rule/" title="Fast test for consecutive integer set using Gauss summation rule">Fast test for consecutive integer set using Gauss summation rule</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/04/22/random-iterator-in-java/" title="Random Iterator in Java">Random Iterator in Java</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/web/2005/10/18/ruby-on-rails/" title="Ruby On Rails">Ruby On Rails</a></li>
																							<li><a href="http://www.lockergnome.com/web/2005/09/19/web-services-made-easy-with-ruby/" title="Web Services Made Easy with Ruby">Web Services Made Easy with Ruby</a></li>
																							<li><a href="http://www.lockergnome.com/web/2005/10/24/how-do-i-get-started-with-ruby-on-rails/" title="How Do I Get Started With Ruby On Rails?">How Do I Get Started With Ruby On Rails?</a></li>
																							<li><a href="http://www.lockergnome.com/linux/2006/05/26/rubygems/" title="RubyGems">RubyGems</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/05/08/transform-ruby-array-to-tex-table/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Firefox File Links Take 2 - URL Protocol Handler</title>
		<link>http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/</link>
		<comments>http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 15:51:25 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<category>cmd.exe</category>

		<category>firefox</category>

		<category>jscript</category>

		<category>url protocol handler</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div><p>Update 15-12-2007: for smb links, I noticed that the handler would throw an error message when a login to the server hosting a resource had not yet been done regardless of the existence of the resource. I changed the handler so that it will try to open the resource in explorer if it is not a file. (It may still be a file - but we can&#8217;t see due to the missing login - so we open the resource in explorer to login.)</p>
<p>In a previous blog entry I presented my solution in .net for adding <a href="http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/">opening file links functionality to Firefox</a>.</p>
<p>A nuisance of the solution is the black cmd.exe box that appears every time a link is clicked. In addition the .net framework must be installed, which it is not in spite of Microsoft&#8217;s efforts.</p>
<p>Recently I saw an example of some jscript, which started an external program. When interpreted by wscript.exe (Windows Scripting Host) there are no popups. So I wrote a new script to replace the functionality of smb.exe.</p>
<p>In the mean time I had found a need for opening Remote Desktop Protocol (rdp) links from the browser. I decided to extend the jscript to become a general and extensible protocol handler. So, at present, the url_protocol_handler.js script will open smb and rdp links.</p>
<p>The program with instructions for installation and extensions can be downloaded <a href="http://www.student.dtu.dk/~s030447/url-handlers.zip">here</a>.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/" title="Firefox file links">Firefox file links</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/" title="Find and delete empty directories">Find and delete empty directories</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/" title="No more Vista">No more Vista</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/" title="PPTPD setup for home networks">PPTPD setup for home networks</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/usrbingeek/2007/07/10/internet-explorer-0day-exploit-requires-firefox-huh/" title=" Internet Explorer 0day Exploit Requires Firefox. Huh?"> Internet Explorer 0day Exploit Requires Firefox. Huh?</a></li>
																							<li><a href="http://www.lockergnome.com/web/2006/01/17/amazing-media-browser/" title="Amazing Media Browser">Amazing Media Browser</a></li>
																							<li><a href="http://www.lockergnome.com/web/2005/10/13/control-your-firefox-links/" title="Control Your Firefox Links">Control Your Firefox Links</a></li>
																							<li><a href="http://www.lockergnome.com/forsythe/2007/07/18/firefox-update-2005/" title="Firefox Update:  2.0.0.5">Firefox Update:  2.0.0.5</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /><p>Update 15-12-2007: for smb links, I noticed that the handler would throw an error message when a login to the server hosting a resource had not yet been done regardless of the existence of the resource. I changed the handler so that it will try to open the resource in explorer if it is not a file. (It may still be a file - but we can&#8217;t see due to the missing login - so we open the resource in explorer to login.)</p>
<p>In a previous blog entry I presented my solution in .net for adding <a href="http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/">opening file links functionality to Firefox</a>.</p>
<p>A nuisance of the solution is the black cmd.exe box that appears every time a link is clicked. In addition the .net framework must be installed, which it is not in spite of Microsoft&#8217;s efforts.</p>
<p>Recently I saw an example of some jscript, which started an external program. When interpreted by wscript.exe (Windows Scripting Host) there are no popups. So I wrote a new script to replace the functionality of smb.exe.</p>
<p>In the mean time I had found a need for opening Remote Desktop Protocol (rdp) links from the browser. I decided to extend the jscript to become a general and extensible protocol handler. So, at present, the url_protocol_handler.js script will open smb and rdp links.</p>
<p>The program with instructions for installation and extensions can be downloaded <a href="http://www.student.dtu.dk/~s030447/url-handlers.zip">here</a>.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/" title="Firefox file links">Firefox file links</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/" title="Find and delete empty directories">Find and delete empty directories</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/" title="No more Vista">No more Vista</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/" title="PPTPD setup for home networks">PPTPD setup for home networks</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/usrbingeek/2007/07/10/internet-explorer-0day-exploit-requires-firefox-huh/" title=" Internet Explorer 0day Exploit Requires Firefox. Huh?"> Internet Explorer 0day Exploit Requires Firefox. Huh?</a></li>
																							<li><a href="http://www.lockergnome.com/web/2006/01/17/amazing-media-browser/" title="Amazing Media Browser">Amazing Media Browser</a></li>
																							<li><a href="http://www.lockergnome.com/web/2005/10/13/control-your-firefox-links/" title="Control Your Firefox Links">Control Your Firefox Links</a></li>
																							<li><a href="http://www.lockergnome.com/forsythe/2007/07/18/firefox-update-2005/" title="Firefox Update:  2.0.0.5">Firefox Update:  2.0.0.5</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fast test for consecutive integer set using Gauss summation rule</title>
		<link>http://www.lockergnome.com/awarberg/2007/11/11/fast-test-for-consecutive-integer-set-using-gauss-summation-rule/</link>
		<comments>http://www.lockergnome.com/awarberg/2007/11/11/fast-test-for-consecutive-integer-set-using-gauss-summation-rule/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 22:24:42 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<category>consecutive integers</category>

		<category>gauss</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2007/11/11/fast-test-for-consecutive-integer-set-using-gauss-summation-rule/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div><p>I needed to test whether a set of integers, T, formed a consecutive series including all integers from min(T) to max(T).</p>
<p>This can be achieved by sorting T into ascending order and, for each index i, checking whether T[i] is one larger than its predecessor, T[i-1]:</p>
<blockquote><p>public static boolean cons_sort(List&lt;Integer&gt; T) {<br />
Collections.sort(T);</p>
<p>for (int i = 1; i &lt; T.size(); i++)<br />
if (T.get(i - 1) + 1 != T.get(i))<br />
return false;</p>
<p>return true;<br />
}</p></blockquote>
<p>Sorting costs O(n log n). However it is not necessary to sort the numbers. Using the result of <a href="http://en.wikipedia.org/wiki/Carl_Friedrich_Gauss" title="Gauss">Gauss</a> that the sum of a consecutive series of integers, T, must equal (max(T) + min(T)) * (max(T) - min(T) + 1) / 2 a speed up can be achieved.</p>
<blockquote><p>public static boolean cons_gauss(List&lt;Integer&gt; T) {</p>
<p>Set&lt;Integer&gt; Tset = new HashSet&lt;Integer&gt;(T);</p>
<p>if(Tset.size() &lt; T.size())<br />
return false; // duplicate found; was eliminated in set conversion</p>
<p>long sum = 0, min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;</p>
<p>for (int t : Tset) {</p>
<p>sum = sum + t;</p>
<p>if (t &lt; min)<br />
min = t;<br />
if (t &gt; max)<br />
max = t;<br />
}</p>
<p>return (max + min) * (max - min + 1) / 2 == sum;<br />
}</p></blockquote>
<p>I performed some tests on Java 1.6 update 3 using this testbench:</p>
<blockquote><p>public static void main(String[] args) {</p>
<p>List&lt;Long&gt; SortResults = new ArrayList&lt;Long&gt;(), GaussResults = new ArrayList&lt;Long&gt;();</p>
<p>for (int i = 0; i &lt; runs; i++) {<br />
List&lt;Integer&gt; T = getConsecutiveIntArray();</p>
<p>if (i % 2 == 0) {<br />
SortResults.add(timeMethod(Method.sort, T));<br />
GaussResults.add(timeMethod(Method.gauss, T));<br />
} else {<br />
GaussResults.add(timeMethod(Method.gauss, T));<br />
SortResults.add(timeMethod(Method.sort, T));<br />
}<br />
}</p>
<p>System.out.printf(&#8221;Gauss: \t %f (%f)\nSort: \t %f (%f)\nRatio:\t%f&#8221;,<br />
mean(GaussResults), std(GaussResults), mean(SortResults),<br />
std(SortResults), mean(SortResults) / mean(GaussResults));<br />
}</p></blockquote>
<p>Where the getConsecutiveIntArray is defined as:</p>
<blockquote><p>public static List&lt;Integer&gt; getConsecutiveIntArray() {<br />
List&lt;Integer&gt; T = new ArrayList&lt;Integer&gt;(N);</p>
<p>for (int i = 0; i &lt; N; i++)<br />
T.add(i);</p>
<p>Collections.shuffle(T);</p>
<p>return T;<br />
}</p></blockquote>
<p>With runs = 100 and N = 500000, Gauss is about 1,8 times faster than sorting. With runs = 10 and N = 1000000 Gauss leads by a factor of 2,4 and seems more stable wrt running time. Setting runs = 100000 and N = 100 gives a ratio of 1,6 and decreasing N will bring gauss and sorting closer and closer.</p>
<p>The sorting approach has an advantage because it may return early in case it finds a hole in the number series. But it is still necessary for it to sort the list entirely - in O(n log n) - whereas Gauss always scans the entire list but this costs only O(n).</p>
<p>Feel free to browse the entire <a href="http://warberg.net/Files/ConsecutiveSpeedTest.zip" title="java source">java source</a>.</p>
<p>Update 04-12-2007: in a comment by Alonso Ulloa the need to check the integer array for duplicates became evident. I have re-written the code and reflected the changes in this article. Performance wise the new approach reduces the gap between sorting and gauss significantly, but gauss still performs better.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/" title="No more Vista">No more Vista</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/news/2003/07/20/build-your-own-gauss-pistol/" title="Build Your Own Gauss Pistol">Build Your Own Gauss Pistol</a></li>
																							<li><a href="http://www.lockergnome.com/it/2005/06/27/why-limit-it-to-integers/" title="Why Limit It To Integers?">Why Limit It To Integers?</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2008/02/25/delete-a-rule-in-outlook-2007/" title="Delete A Rule In Outlook 2007">Delete A Rule In Outlook 2007</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2008/05/16/turn-off-a-rule-in-outlook-2007/" title="Turn Off A Rule In Outlook 2007">Turn Off A Rule In Outlook 2007</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /><p>I needed to test whether a set of integers, T, formed a consecutive series including all integers from min(T) to max(T).</p>
<p>This can be achieved by sorting T into ascending order and, for each index i, checking whether T[i] is one larger than its predecessor, T[i-1]:</p>
<blockquote><p>public static boolean cons_sort(List&lt;Integer&gt; T) {<br />
Collections.sort(T);</p>
<p>for (int i = 1; i &lt; T.size(); i++)<br />
if (T.get(i - 1) + 1 != T.get(i))<br />
return false;</p>
<p>return true;<br />
}</p></blockquote>
<p>Sorting costs O(n log n). However it is not necessary to sort the numbers. Using the result of <a href="http://en.wikipedia.org/wiki/Carl_Friedrich_Gauss" title="Gauss">Gauss</a> that the sum of a consecutive series of integers, T, must equal (max(T) + min(T)) * (max(T) - min(T) + 1) / 2 a speed up can be achieved.</p>
<blockquote><p>public static boolean cons_gauss(List&lt;Integer&gt; T) {</p>
<p>Set&lt;Integer&gt; Tset = new HashSet&lt;Integer&gt;(T);</p>
<p>if(Tset.size() &lt; T.size())<br />
return false; // duplicate found; was eliminated in set conversion</p>
<p>long sum = 0, min = Integer.MAX_VALUE, max = Integer.MIN_VALUE;</p>
<p>for (int t : Tset) {</p>
<p>sum = sum + t;</p>
<p>if (t &lt; min)<br />
min = t;<br />
if (t &gt; max)<br />
max = t;<br />
}</p>
<p>return (max + min) * (max - min + 1) / 2 == sum;<br />
}</p></blockquote>
<p>I performed some tests on Java 1.6 update 3 using this testbench:</p>
<blockquote><p>public static void main(String[] args) {</p>
<p>List&lt;Long&gt; SortResults = new ArrayList&lt;Long&gt;(), GaussResults = new ArrayList&lt;Long&gt;();</p>
<p>for (int i = 0; i &lt; runs; i++) {<br />
List&lt;Integer&gt; T = getConsecutiveIntArray();</p>
<p>if (i % 2 == 0) {<br />
SortResults.add(timeMethod(Method.sort, T));<br />
GaussResults.add(timeMethod(Method.gauss, T));<br />
} else {<br />
GaussResults.add(timeMethod(Method.gauss, T));<br />
SortResults.add(timeMethod(Method.sort, T));<br />
}<br />
}</p>
<p>System.out.printf(&#8221;Gauss: \t %f (%f)\nSort: \t %f (%f)\nRatio:\t%f&#8221;,<br />
mean(GaussResults), std(GaussResults), mean(SortResults),<br />
std(SortResults), mean(SortResults) / mean(GaussResults));<br />
}</p></blockquote>
<p>Where the getConsecutiveIntArray is defined as:</p>
<blockquote><p>public static List&lt;Integer&gt; getConsecutiveIntArray() {<br />
List&lt;Integer&gt; T = new ArrayList&lt;Integer&gt;(N);</p>
<p>for (int i = 0; i &lt; N; i++)<br />
T.add(i);</p>
<p>Collections.shuffle(T);</p>
<p>return T;<br />
}</p></blockquote>
<p>With runs = 100 and N = 500000, Gauss is about 1,8 times faster than sorting. With runs = 10 and N = 1000000 Gauss leads by a factor of 2,4 and seems more stable wrt running time. Setting runs = 100000 and N = 100 gives a ratio of 1,6 and decreasing N will bring gauss and sorting closer and closer.</p>
<p>The sorting approach has an advantage because it may return early in case it finds a hole in the number series. But it is still necessary for it to sort the list entirely - in O(n log n) - whereas Gauss always scans the entire list but this costs only O(n).</p>
<p>Feel free to browse the entire <a href="http://warberg.net/Files/ConsecutiveSpeedTest.zip" title="java source">java source</a>.</p>
<p>Update 04-12-2007: in a comment by Alonso Ulloa the need to check the integer array for duplicates became evident. I have re-written the code and reflected the changes in this article. Performance wise the new approach reduces the gap between sorting and gauss significantly, but gauss still performs better.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" />]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/" title="No more Vista">No more Vista</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/news/2003/07/20/build-your-own-gauss-pistol/" title="Build Your Own Gauss Pistol">Build Your Own Gauss Pistol</a></li>
																							<li><a href="http://www.lockergnome.com/it/2005/06/27/why-limit-it-to-integers/" title="Why Limit It To Integers?">Why Limit It To Integers?</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2008/02/25/delete-a-rule-in-outlook-2007/" title="Delete A Rule In Outlook 2007">Delete A Rule In Outlook 2007</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2008/05/16/turn-off-a-rule-in-outlook-2007/" title="Turn Off A Rule In Outlook 2007">Turn Off A Rule In Outlook 2007</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2007/11/11/fast-test-for-consecutive-integer-set-using-gauss-summation-rule/feed/</wfw:commentRss>
		</item>
		<item>
		<title>No more Vista</title>
		<link>http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/</link>
		<comments>http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/#comments</comments>
		<pubDate>Tue, 08 May 2007 16:34:09 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div><p>My university has an agreement with Microsoft so that students, following courses from the computer science department, may download from a selection of Microsoft software for free. This includes Windows Vista, which is available in the Business version.</p>
<p>I am interested in the current operating systems so I got my copy and have been using it for a couple of months now on my Dell Inspiron 6400 - a core duo 2 (T5600) with 1024 mb ram and ATI X1400 video. I tried both the 32 and 64 bit versions but I couldn&#8217;t really distinguish between them.</p>
<p>However, I&#8217;ve decided to go back to Windows XP. Here are my experiences with Vista.</p>
<p><b>Pros</b></p>
<ul>
<li>Installation is fast due to the new image format</li>
<li>Microsoft has improved the general security by adding User Account Control</li>
<li>The visual layout of the Business version, even, is much better than Windows XP</li>
<li>Windows Explorer is great. In particular I like the new grouping features.</li>
<li>The resource monitor is awesome.</li>
<li>More informative dialog on file copy operations.</li>
<li>There are multiple under-the-hood improvements: IO and memory priorities, and delayed startup for services&#8230;</li>
</ul>
<p><b>Cons</b></p>
<ul>
<li>Cleartype is highly embedded into Vista and, it seems, cannot be turned off completely. Furthermore, due to the fonts which are used, it seems that partially turning off cleartype give font renderings which are <i>worse</i> than for e.g. Windows XP</li>
<li>Although installation is fast, per default a performance check is scheduled just before Vista is started for the first time. This effectively kills all the time you have saved, comparing to an XP installation. I honestly don&#8217;t see why it is necessary to perform a five-minute benchmarking of the PC.</li>
<li>User Account Control is ANNOYING. I consider myself a power user and so I know which prompts to accept and which not to accept. It is possible to turn the feature off, but the Windows security center will continue to nag you if you do so.</li>
<li>The picture gallery application is VERY slow compared to its Windows XP counterpart. I&#8217;m talking about 10-15 seconds wait time just to start a dias show. In XP it was instantaneous.</li>
<li>It is slow. In spite of the new kernel features, delayed startup services, monitoring of usage patterns I found myself waiting <i>more</i> with Vista than I did with XP. I use the same programs, solve the same tasks but still it is slower than XP.</li>
</ul>
<p>These are just <i>some </i>of the pros and cons.</p>
<p>Many of the drawbacks have made me consider just moving back to XP but I&#8217;d decided to stick with Vista since it actually worked quite well for my needs, although it did not contain anything new, which I really could not do without.<br />
That was until today when I read <a href="http://en.wikipedia.org/wiki/Criticism_of_Windows_Vista">some of the criticisms</a> on Windows Vista.</p>
<p>The entry on CD and DVD burning made me worry, in particular.</p>
<p>We recently finished a report on a piece of software we developed in a course at school. I was asked to burn a copy of the source code for our professor so, obviously, I used Vista&#8217;s build-in burn tool (which integrates very nicely by the way).</p>
<p>The criticism on CD and DVD burning is that Vista use a special MS format for unformatted CDs, which ours was. So in effect we have handed in a CD which cannot be used by our professor. They are all on UNIX (SunOS). We have send him a zip archive containing the code and are hoping for the best.</p>
<p>In the meantime I will be installing Windows XP yet again.</p>

<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" /><p>Tags: <a href="http://tagjag.com/discovery/windows-vista" rel="tag">windows vista</a>, <a href="http://tagjag.com/discovery/slow" rel="tag">slow</a>, <a href="http://tagjag.com/discovery/problems" rel="tag">problems</a>, <a href="http://tagjag.com/discovery/windows-live-file-system" rel="tag">windows live file system</a>, <a href="http://tagjag.com/discovery/msdnaa" rel="tag">msdnaa</a></p>]]><div class="">			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/digged/2007/09/25/vista-sp1-out-today-but-not-really/" title="Vista SP1 Out Today! But Not Really">Vista SP1 Out Today! But Not Really</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2006/08/22/windows-vista-versions/" title="Windows Vista Versions">Windows Vista Versions</a></li>
																							<li><a href="http://www.lockergnome.com/everythingcomputer/2008/04/01/windows-vista-sp1/" title="Windows Vista SP1">Windows Vista SP1</a></li>
																							<li><a href="http://www.lockergnome.com/digged/2008/01/21/vista-sp1-thoughts-do-you-have-any/" title="Do You Have Any Vista SP1 Thoughts?">Do You Have Any Vista SP1 Thoughts?</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /><p>My university has an agreement with Microsoft so that students, following courses from the computer science department, may download from a selection of Microsoft software for free. This includes Windows Vista, which is available in the Business version.</p>
<p>I am interested in the current operating systems so I got my copy and have been using it for a couple of months now on my Dell Inspiron 6400 - a core duo 2 (T5600) with 1024 mb ram and ATI X1400 video. I tried both the 32 and 64 bit versions but I couldn&#8217;t really distinguish between them.</p>
<p>However, I&#8217;ve decided to go back to Windows XP. Here are my experiences with Vista.</p>
<p><b>Pros</b></p>
<ul>
<li>Installation is fast due to the new image format</li>
<li>Microsoft has improved the general security by adding User Account Control</li>
<li>The visual layout of the Business version, even, is much better than Windows XP</li>
<li>Windows Explorer is great. In particular I like the new grouping features.</li>
<li>The resource monitor is awesome.</li>
<li>More informative dialog on file copy operations.</li>
<li>There are multiple under-the-hood improvements: IO and memory priorities, and delayed startup for services&#8230;</li>
</ul>
<p><b>Cons</b></p>
<ul>
<li>Cleartype is highly embedded into Vista and, it seems, cannot be turned off completely. Furthermore, due to the fonts which are used, it seems that partially turning off cleartype give font renderings which are <i>worse</i> than for e.g. Windows XP</li>
<li>Although installation is fast, per default a performance check is scheduled just before Vista is started for the first time. This effectively kills all the time you have saved, comparing to an XP installation. I honestly don&#8217;t see why it is necessary to perform a five-minute benchmarking of the PC.</li>
<li>User Account Control is ANNOYING. I consider myself a power user and so I know which prompts to accept and which not to accept. It is possible to turn the feature off, but the Windows security center will continue to nag you if you do so.</li>
<li>The picture gallery application is VERY slow compared to its Windows XP counterpart. I&#8217;m talking about 10-15 seconds wait time just to start a dias show. In XP it was instantaneous.</li>
<li>It is slow. In spite of the new kernel features, delayed startup services, monitoring of usage patterns I found myself waiting <i>more</i> with Vista than I did with XP. I use the same programs, solve the same tasks but still it is slower than XP.</li>
</ul>
<p>These are just <i>some </i>of the pros and cons.</p>
<p>Many of the drawbacks have made me consider just moving back to XP but I&#8217;d decided to stick with Vista since it actually worked quite well for my needs, although it did not contain anything new, which I really could not do without.<br />
That was until today when I read <a href="http://en.wikipedia.org/wiki/Criticism_of_Windows_Vista">some of the criticisms</a> on Windows Vista.</p>
<p>The entry on CD and DVD burning made me worry, in particular.</p>
<p>We recently finished a report on a piece of software we developed in a course at school. I was asked to burn a copy of the source code for our professor so, obviously, I used Vista&#8217;s build-in burn tool (which integrates very nicely by the way).</p>
<p>The criticism on CD and DVD burning is that Vista use a special MS format for unformatted CDs, which ours was. So in effect we have handed in a CD which cannot be used by our professor. They are all on UNIX (SunOS). We have send him a zip archive containing the code and are hoping for the best.</p>
<p>In the meantime I will be installing Windows XP yet again.</p>

<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" /><p>Tags: <a href="http://tagjag.com/discovery/windows-vista" rel="tag">windows vista</a>, <a href="http://tagjag.com/discovery/slow" rel="tag">slow</a>, <a href="http://tagjag.com/discovery/problems" rel="tag">problems</a>, <a href="http://tagjag.com/discovery/windows-live-file-system" rel="tag">windows live file system</a>, <a href="http://tagjag.com/discovery/msdnaa" rel="tag">msdnaa</a></p>]]><div class="">			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/digged/2007/09/25/vista-sp1-out-today-but-not-really/" title="Vista SP1 Out Today! But Not Really">Vista SP1 Out Today! But Not Really</a></li>
																							<li><a href="http://www.lockergnome.com/windows/2006/08/22/windows-vista-versions/" title="Windows Vista Versions">Windows Vista Versions</a></li>
																							<li><a href="http://www.lockergnome.com/everythingcomputer/2008/04/01/windows-vista-sp1/" title="Windows Vista SP1">Windows Vista SP1</a></li>
																							<li><a href="http://www.lockergnome.com/digged/2008/01/21/vista-sp1-thoughts-do-you-have-any/" title="Do You Have Any Vista SP1 Thoughts?">Do You Have Any Vista SP1 Thoughts?</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Random Iterator in Java</title>
		<link>http://www.lockergnome.com/awarberg/2007/04/22/random-iterator-in-java/</link>
		<comments>http://www.lockergnome.com/awarberg/2007/04/22/random-iterator-in-java/#comments</comments>
		<pubDate>Sun, 22 Apr 2007 13:17:03 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2007/04/22/random-iterator-in-java/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div><p>This is some Java code I wrote for a school project to save some time when iterating in random order over a part of list (until some condition becomes true):</p>
<blockquote><p>import java.util.List;</p>
<p>import java.util.Iterator;<br />
/**<br />
* Provides a random iteration over the given list.<br />
*<br />
* This effect can be achieved by using Collections.shuffle,<br />
* which shuffles the entire collection in linear time.<br />
*<br />
* If the iteration process may end before all items<br />
* are processed, this class may give a speed increase<br />
* because the shuffling process is performed as items are requested<br />
* rather than in the beginning.<br />
*/<br />
public class RandomIterator&lt;E&gt; implements Iterator&lt;E&gt;{</p>
<p>/**<br />
* Mapping indicating which items were served (by index).<br />
* if served[i] then the item with index i in the list<br />
* has already been served.<br />
*<br />
* Note it is possible to save memory here by using<br />
* BitSet rather than a boolean array, however it will<br />
* increase the running time slightly.<br />
*/<br />
private final boolean[] served;</p>
<p>/** The amount of items served so far */<br />
private int servedCount = 0;</p>
<p>private final List&lt;E&gt; list;<br />
private final int LIST_SIZE;</p>
<p>/**<br />
* The random number generator has a great influence<br />
* on the running time of this iterator.<br />
*<br />
* See, for instance,<br />
* http://www.qbrundage.com/michaelb/pubs/essays/random_number_generation<br />
* for some implementations, which are faster than java.util.Random.<br />
*/<br />
private final Random rand;</p>
<p>/** Used to nar-row the range to take random indexes from */<br />
private int lower,upper;</p>
<p>public RandomIterator(List&lt;E&gt; list, Random rand){<br />
this.list = list;<br />
this.rand = rand;<br />
LIST_SIZE = list.size();<br />
served = new boolean[LIST_SIZE];<br />
lower = 0;<br />
upper = LIST_SIZE-1;<br />
}</p>
<p>@Override<br />
public boolean hasNext() {<br />
return servedCount &lt; LIST_SIZE;<br />
}</p>
<p>private int index,range;</p>
<p>@Override<br />
public E next() {</p>
<p>range =  upper - lower + 1;</p>
<p>do{<br />
index = lower + rand.nextInt(range);<br />
} while(served[index]);</p>
<p>// check if the range from which random values<br />
// are taken can be reduced<br />
if(index == lower)<br />
lower++;<br />
else if(index == upper)<br />
upper&#8211;;</p>
<p>served[index] = true;<br />
servedCount++;</p>
<p>return list.get(index);<br />
}</p>
<p>@Override<br />
public void remove() {<br />
throw new UnsupportedOperationException();<br />
}<br />
}</p></blockquote>
<p>Here is a sample on how to use the code:</p>
<blockquote><p>for(Iterator&lt;Object&gt; iter = new RandomIterator&lt;Object&gt;(myObjList); iter.hasNext();){</p>
<p>Object o = iter.next();</p>
<p>if(someCondition(o) )</p>
<p>return o; // iteration stopped early<br />
}</p></blockquote>
<p>I wrote it to replace a Collection.shuffle call and this code gave us an overall increase in program execution speed of about 25%.</p>
<p>As the javadoc description says, you are better off calling Collection.shuffle if you need to iterate over the entire list. But if you may stop early this class can save you some time, as it did in our case.</p>

<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" /><p>Tags: <a href="http://tagjag.com/discovery/java" rel="tag">java</a>, <a href="http://tagjag.com/discovery/iteration" rel="tag">iteration</a>, <a href="http://tagjag.com/discovery/random" rel="tag">random</a></p>]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/11/11/fast-test-for-consecutive-integer-set-using-gauss-summation-rule/" title="Fast test for consecutive integer set using Gauss summation rule">Fast test for consecutive integer set using Gauss summation rule</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/web/2004/08/24/is-java-un-cool/" title="Is Java Un-Cool?">Is Java Un-Cool?</a></li>
																							<li><a href="http://www.lockergnome.com/hardware/2005/11/11/via-puts-padlock-on-java-applications/" title="Via puts PadLock on Java applications">Via puts PadLock on Java applications</a></li>
																							<li><a href="http://www.lockergnome.com/web/2004/07/23/a-gnomie-in-a-java-crisis/" title="A Gnomie In A Java Crisis">A Gnomie In A Java Crisis</a></li>
																							<li><a href="http://www.lockergnome.com/osx/2007/12/18/apple-releases-java-6-for-leopard/" title="Apple Releases Java 6 for Leopard">Apple Releases Java 6 for Leopard</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /><p>This is some Java code I wrote for a school project to save some time when iterating in random order over a part of list (until some condition becomes true):</p>
<blockquote><p>import java.util.List;</p>
<p>import java.util.Iterator;<br />
/**<br />
* Provides a random iteration over the given list.<br />
*<br />
* This effect can be achieved by using Collections.shuffle,<br />
* which shuffles the entire collection in linear time.<br />
*<br />
* If the iteration process may end before all items<br />
* are processed, this class may give a speed increase<br />
* because the shuffling process is performed as items are requested<br />
* rather than in the beginning.<br />
*/<br />
public class RandomIterator&lt;E&gt; implements Iterator&lt;E&gt;{</p>
<p>/**<br />
* Mapping indicating which items were served (by index).<br />
* if served[i] then the item with index i in the list<br />
* has already been served.<br />
*<br />
* Note it is possible to save memory here by using<br />
* BitSet rather than a boolean array, however it will<br />
* increase the running time slightly.<br />
*/<br />
private final boolean[] served;</p>
<p>/** The amount of items served so far */<br />
private int servedCount = 0;</p>
<p>private final List&lt;E&gt; list;<br />
private final int LIST_SIZE;</p>
<p>/**<br />
* The random number generator has a great influence<br />
* on the running time of this iterator.<br />
*<br />
* See, for instance,<br />
* http://www.qbrundage.com/michaelb/pubs/essays/random_number_generation<br />
* for some implementations, which are faster than java.util.Random.<br />
*/<br />
private final Random rand;</p>
<p>/** Used to nar-row the range to take random indexes from */<br />
private int lower,upper;</p>
<p>public RandomIterator(List&lt;E&gt; list, Random rand){<br />
this.list = list;<br />
this.rand = rand;<br />
LIST_SIZE = list.size();<br />
served = new boolean[LIST_SIZE];<br />
lower = 0;<br />
upper = LIST_SIZE-1;<br />
}</p>
<p>@Override<br />
public boolean hasNext() {<br />
return servedCount &lt; LIST_SIZE;<br />
}</p>
<p>private int index,range;</p>
<p>@Override<br />
public E next() {</p>
<p>range =  upper - lower + 1;</p>
<p>do{<br />
index = lower + rand.nextInt(range);<br />
} while(served[index]);</p>
<p>// check if the range from which random values<br />
// are taken can be reduced<br />
if(index == lower)<br />
lower++;<br />
else if(index == upper)<br />
upper&#8211;;</p>
<p>served[index] = true;<br />
servedCount++;</p>
<p>return list.get(index);<br />
}</p>
<p>@Override<br />
public void remove() {<br />
throw new UnsupportedOperationException();<br />
}<br />
}</p></blockquote>
<p>Here is a sample on how to use the code:</p>
<blockquote><p>for(Iterator&lt;Object&gt; iter = new RandomIterator&lt;Object&gt;(myObjList); iter.hasNext();){</p>
<p>Object o = iter.next();</p>
<p>if(someCondition(o) )</p>
<p>return o; // iteration stopped early<br />
}</p></blockquote>
<p>I wrote it to replace a Collection.shuffle call and this code gave us an overall increase in program execution speed of about 25%.</p>
<p>As the javadoc description says, you are better off calling Collection.shuffle if you need to iterate over the entire list. But if you may stop early this class can save you some time, as it did in our case.</p>

<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" /><p>Tags: <a href="http://tagjag.com/discovery/java" rel="tag">java</a>, <a href="http://tagjag.com/discovery/iteration" rel="tag">iteration</a>, <a href="http://tagjag.com/discovery/random" rel="tag">random</a></p>]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/11/11/fast-test-for-consecutive-integer-set-using-gauss-summation-rule/" title="Fast test for consecutive integer set using Gauss summation rule">Fast test for consecutive integer set using Gauss summation rule</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/web/2004/08/24/is-java-un-cool/" title="Is Java Un-Cool?">Is Java Un-Cool?</a></li>
																							<li><a href="http://www.lockergnome.com/hardware/2005/11/11/via-puts-padlock-on-java-applications/" title="Via puts PadLock on Java applications">Via puts PadLock on Java applications</a></li>
																							<li><a href="http://www.lockergnome.com/web/2004/07/23/a-gnomie-in-a-java-crisis/" title="A Gnomie In A Java Crisis">A Gnomie In A Java Crisis</a></li>
																							<li><a href="http://www.lockergnome.com/osx/2007/12/18/apple-releases-java-6-for-leopard/" title="Apple Releases Java 6 for Leopard">Apple Releases Java 6 for Leopard</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2007/04/22/random-iterator-in-java/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Firefox file links</title>
		<link>http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/</link>
		<comments>http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/#comments</comments>
		<pubDate>Thu, 22 Feb 2007 19:57:48 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category>General</category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/</guid>
		<description><![CDATA[<div style="float: right; padding: 15px"><img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" /></div>
<p>Update 04-12-2007: please see my latest blog entry on handling of file links in Firefox (and other protocols) <a href="http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/">here</a>.</p>
<p>In Internet Explorer you can link to a file or folder on your own harddrive (local pages) or network share using anchor html code like &#8230; href=&#8221;\\server\share\folder&#8221; &#8230;</p>
<p>Due to security restrictions in Firefox and (as far as I know) all other browsers except IE, such a link <a href="http://kb.mozillazine.org/Links_to_local_pages_don%27t_work">will not work</a>.</p>
<p>The best solution I found was to add a handler for smb links in the Windows registry, which invokes a small program that opens the correct link in Windows Explorer.</p>
<p>The fix consist of two files:</p>
<ol>
<li>smb.reg contains registry settings so that the system, including all browsers ie. Firefox, IE and others, recognize smb links such as smb://\\server\share\folder</li>
<li>smb.cs is the source code for smb.exe. When called it will start Windows Explorer on the requested file. When you click a link in your browser the href will be url encoded. The code handles links containing url-encoded characters such as the danish æ,ø and å. Failure to decode such characters will prevent Windows Explorer in finding the requested folder.</li>
</ol>
<p>smb.reg:</p>
<blockquote><p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_CLASSES_ROOT\smb]<br />
@=&#8221;URL:smb Protocol&#8221;<br />
&#8220;URL Protocol&#8221;=&#8221;"</p>
<p>[HKEY_CLASSES_ROOT\smb\shell\open\command]<br />
@=&#8221;\&#8221;smb.exe\&#8221; \&#8221;%1\&#8221;"</p></blockquote>
<p>smb.cs:</p>
<blockquote><p>using System;</p>
<p>/// &lt;summary&gt;<br />
/// Takes a smb:// link and starts Windows Explorer in the folder<br />
/// which the link points to.<br />
/// &lt;/summary&gt;<br />
public class smb<br />
{<br />
public static void Main(string[] args)<br />
{<br />
if (args.Length == 0)<br />
{<br />
Console.Write(&#8221;No destination given&#8221;);<br />
return;<br />
}</p>
<p>string dest = args[0].Replace(&#8221;smb://&#8221;,string.Empty);<br />
if (dest.EndsWith(&#8221;/&#8221;)) // explorer prefer if paths to folders end with \ or nothing<br />
dest = dest.Substring(0, dest.Length - 1);</p>
<p>// allow smb://server/share style links<br />
dest = dest.Replace(&#8217;/', &#8216;\\&#8217;);</p>
<p>// rescue some non-conformant URL&#8217;s<br />
if(!dest.StartsWith(&#8221;\\\\&#8221;))<br />
dest = &#8220;\\\\&#8221; + dest;</p>
<p>// since the link probably came from a browser we need to restore<br />
// non-english characters such as æ,ø and å from their html-encoded version</p>
<p>dest = System.Web.HttpUtility.UrlDecode(dest);</p>
<p>if(System.IO.Directory.Exists(dest)){<br />
// use explorer to start folders,<br />
System.Diagnostics.Process.Start(&#8221;explorer.exe&#8221;, dest);<br />
}<br />
else<br />
{<br />
// files are launched without a program. this assumes proper handlers are set up<br />
System.Diagnostics.Process.Start(dest);<br />
}<br />
}<br />
}</p></blockquote>
<blockquote></blockquote>
<p>The registry code can be put into a .reg file and imported by double-clicking it or silently using regedit /s smb.reg.</p>
<p>You can compile smb.cs to obtain smb.exe by putting the above code into a file called smb.cs and then invoke the csharp compiler,csc, on it (my compiler lies here %windir%\Microsoft.NET\Framework\v2.0.50727\).</p>
<p>To complete the fix you must copy smb.exe to a folder, which is in your path eg %windir%.</p>
<p>If you really trust me you can skip the compilation part and <a href="http://warberg.net/Files/Firefox_smb_protocol_handler.zip">download both files</a>.</p>
<p>Update 09-11-2007: smb.exe will now launch files by executing them directly. Folders are still launched with Windows Explorer.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" /><p>Tags: <a href="http://tagjag.com/discovery/firefox" rel="tag">firefox</a>, <a href="http://tagjag.com/discovery/file-link" rel="tag">file link</a>, <a href="http://tagjag.com/discovery/share" rel="tag">share</a>, <a href="http://tagjag.com/discovery/local-link" rel="tag">local link</a></p>]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/" title="Firefox File Links Take 2 - URL Protocol Handler">Firefox File Links Take 2 - URL Protocol Handler</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/" title="Find and delete empty directories">Find and delete empty directories</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/" title="No more Vista">No more Vista</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/" title="PPTPD setup for home networks">PPTPD setup for home networks</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/web/2006/01/17/amazing-media-browser/" title="Amazing Media Browser">Amazing Media Browser</a></li>
																							<li><a href="http://www.lockergnome.com/web/2005/10/13/control-your-firefox-links/" title="Control Your Firefox Links">Control Your Firefox Links</a></li>
																							<li><a href="http://www.lockergnome.com/seaeagle/2007/12/01/firefox-add-on-of-the-day-linkification/" title="Firefox Add-On Of The Day - Linkification">Firefox Add-On Of The Day - Linkification</a></li>
																							<li><a href="http://www.lockergnome.com/linux/2004/08/08/firefox-improvements/" title="Firefox improvements">Firefox improvements</a></li>
						</ul>
			</div></description>
			<content:encoded><![CDATA[<img src="http://static.lockergnome.com/avatars/gnomedaily.gif? " alt="Author Avatar" />
<p>Update 04-12-2007: please see my latest blog entry on handling of file links in Firefox (and other protocols) <a href="http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/">here</a>.</p>
<p>In Internet Explorer you can link to a file or folder on your own harddrive (local pages) or network share using anchor html code like &#8230; href=&#8221;\\server\share\folder&#8221; &#8230;</p>
<p>Due to security restrictions in Firefox and (as far as I know) all other browsers except IE, such a link <a href="http://kb.mozillazine.org/Links_to_local_pages_don%27t_work">will not work</a>.</p>
<p>The best solution I found was to add a handler for smb links in the Windows registry, which invokes a small program that opens the correct link in Windows Explorer.</p>
<p>The fix consist of two files:</p>
<ol>
<li>smb.reg contains registry settings so that the system, including all browsers ie. Firefox, IE and others, recognize smb links such as smb://\\server\share\folder</li>
<li>smb.cs is the source code for smb.exe. When called it will start Windows Explorer on the requested file. When you click a link in your browser the href will be url encoded. The code handles links containing url-encoded characters such as the danish æ,ø and å. Failure to decode such characters will prevent Windows Explorer in finding the requested folder.</li>
</ol>
<p>smb.reg:</p>
<blockquote><p>Windows Registry Editor Version 5.00</p>
<p>[HKEY_CLASSES_ROOT\smb]<br />
@=&#8221;URL:smb Protocol&#8221;<br />
&#8220;URL Protocol&#8221;=&#8221;"</p>
<p>[HKEY_CLASSES_ROOT\smb\shell\open\command]<br />
@=&#8221;\&#8221;smb.exe\&#8221; \&#8221;%1\&#8221;"</p></blockquote>
<p>smb.cs:</p>
<blockquote><p>using System;</p>
<p>/// &lt;summary&gt;<br />
/// Takes a smb:// link and starts Windows Explorer in the folder<br />
/// which the link points to.<br />
/// &lt;/summary&gt;<br />
public class smb<br />
{<br />
public static void Main(string[] args)<br />
{<br />
if (args.Length == 0)<br />
{<br />
Console.Write(&#8221;No destination given&#8221;);<br />
return;<br />
}</p>
<p>string dest = args[0].Replace(&#8221;smb://&#8221;,string.Empty);<br />
if (dest.EndsWith(&#8221;/&#8221;)) // explorer prefer if paths to folders end with \ or nothing<br />
dest = dest.Substring(0, dest.Length - 1);</p>
<p>// allow smb://server/share style links<br />
dest = dest.Replace(&#8217;/', &#8216;\\&#8217;);</p>
<p>// rescue some non-conformant URL&#8217;s<br />
if(!dest.StartsWith(&#8221;\\\\&#8221;))<br />
dest = &#8220;\\\\&#8221; + dest;</p>
<p>// since the link probably came from a browser we need to restore<br />
// non-english characters such as æ,ø and å from their html-encoded version</p>
<p>dest = System.Web.HttpUtility.UrlDecode(dest);</p>
<p>if(System.IO.Directory.Exists(dest)){<br />
// use explorer to start folders,<br />
System.Diagnostics.Process.Start(&#8221;explorer.exe&#8221;, dest);<br />
}<br />
else<br />
{<br />
// files are launched without a program. this assumes proper handlers are set up<br />
System.Diagnostics.Process.Start(dest);<br />
}<br />
}<br />
}</p></blockquote>
<blockquote></blockquote>
<p>The registry code can be put into a .reg file and imported by double-clicking it or silently using regedit /s smb.reg.</p>
<p>You can compile smb.cs to obtain smb.exe by putting the above code into a file called smb.cs and then invoke the csharp compiler,csc, on it (my compiler lies here %windir%\Microsoft.NET\Framework\v2.0.50727\).</p>
<p>To complete the fix you must copy smb.exe to a folder, which is in your path eg %windir%.</p>
<p>If you really trust me you can skip the compilation part and <a href="http://warberg.net/Files/Firefox_smb_protocol_handler.zip">download both files</a>.</p>
<p>Update 09-11-2007: smb.exe will now launch files by executing them directly. Folders are still launched with Windows Explorer.</p>
<img src="http://www.lockergnome.com/awarberg/b6a2173e/26673f10/CCBot/1.0 (+http://www.commoncrawl.org/bot.html).gif" /><p>Tags: <a href="http://tagjag.com/discovery/firefox" rel="tag">firefox</a>, <a href="http://tagjag.com/discovery/file-link" rel="tag">file link</a>, <a href="http://tagjag.com/discovery/share" rel="tag">share</a>, <a href="http://tagjag.com/discovery/local-link" rel="tag">local link</a></p>]]><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/12/04/firefox-file-links-take-2-url-protocol-handler/" title="Firefox File Links Take 2 - URL Protocol Handler">Firefox File Links Take 2 - URL Protocol Handler</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/" title="Find and delete empty directories">Find and delete empty directories</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2007/05/08/no-more-vista/" title="No more Vista">No more Vista</a></li>
																							<li><a href="http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/" title="PPTPD setup for home networks">PPTPD setup for home networks</a></li>
						</ul>
			</div><div class="">			<ul>
																							<li><a href="http://www.lockergnome.com/web/2006/01/17/amazing-media-browser/" title="Amazing Media Browser">Amazing Media Browser</a></li>
																							<li><a href="http://www.lockergnome.com/web/2005/10/13/control-your-firefox-links/" title="Control Your Firefox Links">Control Your Firefox Links</a></li>
																							<li><a href="http://www.lockergnome.com/seaeagle/2007/12/01/firefox-add-on-of-the-day-linkification/" title="Firefox Add-On Of The Day - Linkification">Firefox Add-On Of The Day - Linkification</a></li>
																							<li><a href="http://www.lockergnome.com/linux/2004/08/08/firefox-improvements/" title="Firefox improvements">Firefox improvements</a></li>
						</ul>
			</div></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2007/02/22/firefox-file-links/feed/</wfw:commentRss>
		</item>
	       <item> 
  <title>Online Web Conferencing for Meetings</title>
  <description>Tired of business travel? Conduct meetings online with &lt;a href=&quot;http://www.GoToMeeting.com/ChrisPirillo&quot;&gt;GoToMeeting&lt;/a&gt; instead. We've been using it for quite some time for both personal and professional projects - it's worked like a charm! If you're an independent consultant, you owe it to your clients to start using &lt;a href=&quot;http://www.GoToMeeting.com/ChrisPirillo&quot;&gt;collaboration software&lt;/a&gt; for Web-based interaction.
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Mon, 25 Feb 2008 06:30:00 GMT</pubDate>
  <link>http://www.GoToMeeting.com/ChrisPirillo</link>
  <guid>http://www.GoToMeeting.com/ChrisPirillo</guid>
  </item>

  <item>
  <title>Network Tools for Windows</title>
  <description>You need these network tools, no matter which operating systems and networks you have to support. &lt;a href=&quot;http://support.solarwinds.com/updates/New-Customer.cfm?ProdID=568&amp;campaign=ipmon_DL_lockergnome&amp;CMP=BAC-ipmonDL_lockergnome&quot;&gt;SolarWinds ipMonitor&lt;/a&gt;: Affordable Network Monitoring for SMBs. Get turnkey network, server and application availability monitoring with SolarWinds ipMonitor v9.0. This easy-to-use, reliable solution for SMBs delivers out-of-the-box availability monitoring so you always know exactly what's up with Active Directory, DNS, Exchange, FTP, Web, IMAP, MS SQL Server, and SMTP. &lt;a href=&quot;http://support.solarwinds.com/updates/New-Customer.cfm?ProdID=568&amp;campaign=ipmon_DL_lockergnome&amp;CMP=BAC-ipmonDL_lockergnome&quot;&gt;Download your free trial today&lt;/a&gt;. Or, try their &lt;a href=&quot;http://www.solarwinds.com/products/freetools/&quot;&gt;totally free tools&lt;/a&gt;! And, through 2/29, save 20% when you purchase &lt;a href=&quot;http://store.solarwinds.com/s.nl/sc.16/.f&quot;&gt;ipMonitor 9.0&lt;/a&gt;.
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Mon, 25 Feb 2008 06:30:00 GMT</pubDate>
  <link>http://support.solarwinds.com/updates/New-Customer.cfm?ProdID=568&amp;campaign=ipmon_DL_lockergnome&amp;CMP=BAC-ipmonDL_lockergnome</link>
  <guid>http://support.solarwinds.com/updates/New-Customer.cfm?ProdID=568&amp;campaign=ipmon_DL_lockergnome&amp;CMP=BAC-ipmonDL_lockergnome</guid>
  </item>

  <item>
  <title>Trade in Your Cell Phones for Money</title>
  <description>Do you have a ton of old cell phones and mobile devices lying around in drawers, taking up space? Trade them in for cold hard cash! Chris has done it so many times that &lt;a href=&quot;http://www.cellforcash.com/chris-pirillo/&quot;&gt;Cell for Cash&lt;/a&gt; made him a partner. If you're not using that hardware anymore, you may as well liquidate it with ease - at no cost to you. What are you waiting for? You can go through our link, or visit the site and tell them that Chris sent you. It's real, and it's certainly real money. &lt;a href=http://www.cellforcash.com/chris-pirillo/&quot;&gt;Sell back your cell phones&lt;/a&gt;!
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Mon, 25 Feb 2008 06:30:00 GMT</pubDate>
  <link>http://www.cellforcash.com/chris-pirillo/</link>
  <guid>http://www.cellforcash.com/chris-pirillo/</guid>
  </item>

  <item>
  <title>Get Your Own Web Site</title>
  <description>Starting at just $3.99/month, web hosting from &lt;a href=&quot;http://www.godaddy.com/gdshop/default.asp?isc=cp2&quot;&gt;GoDaddy&lt;/a&gt; includes 99.9% uptime, 24/7 support and free access to GoDaddy Hosting Connection, THE place to install over 30 FREE applications sure to help you get the most from your hosting plan and Web site. Enter &lt;a href=&quot;http://www.godaddy.com/gdshop/default.asp?isc=cp2&quot;&gt;code CP2&lt;/a&gt; at checkout, and save an additional 10% on any order.
  &lt;p&gt;Plus, as a friend of Chris Pirillo, enter code &lt;a href=&quot;http://www.godaddy.com/gdshop/default.asp?isc=chris7&quot;&gt;CHRIS7&lt;/a&gt;, that's C-H-R-I-S and the number 7, when you check out, and save an additional 10% on any order. Get your piece of the internet at &lt;a href=&quot;http://www.godaddy.com/gdshop/default.asp?isc=chris7&quot;&gt;GoDaddy.com&lt;/a&gt;.&lt;/p&gt;
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Mon, 25 Feb 2008 06:30:00 GMT</pubDate>
  <link>http://www.godaddy.com/gdshop/default.asp?isc=cp1</link>
  <guid>http://www.godaddy.com/gdshop/default.asp?isc=cp1</guid>
  </item>

  <item>
  <title>Get a Free Audio Book</title>
  <description>Are you tired of reading books? Me too. Over the years, I developed pulpuslaceratapohobia  - and the only known cure for that is &lt;a href=&quot;http://audiblepodcast.com/chris&quot;&gt;Audible&lt;/a&gt;. Finally, a way to digest words without actually having to read them. Professional voices are wonderful choices if you love literary works in audio format. Are you ready to read some &lt;a href=&quot;http://audiblepodcast.com/chris&quot;&gt;audio books&lt;/a&gt;? Maybe you should just listen to them instead.
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Mon, 25 Feb 2008 06:30:00 GMT</pubDate>
  <link>http://audiblepodcast.com/chris</link>
  <guid>http://audiblepodcast.com/chris</guid>
  </item>

  <item>
  <title>VMware and Parallels for Virtual Machines</title>
  <description>
  It doesn't matter if you're running on Windows or Mac OS X - every power user needs either &lt;a href=&quot;http://send.onenetworkdirect.net/z/13766/rn_a32755/&quot;&gt;Parallels&lt;/a&gt; or &lt;a href=&quot;http://send.onenetworkdirect.net/z/17081/rn_a32755/&quot;&gt;VMware&lt;/a&gt; (or both). There's never been an easier way to test software without destroying your primary operating system's stability. Think of how many times you wish you could press a 'reverse' button on your computer. Plus, there's no easier way to try new Linux distributions - see what all the fuss is about. Run Windows in OS X, run Linux in Windows, but the best way to do either is with &lt;a href=&quot;http://send.onenetworkdirect.net/z/17081/rn_a32755/&quot;&gt;VMware&lt;/a&gt; and/or &lt;a href=&quot;http://send.onenetworkdirect.net/z/13766/rn_a32755/&quot;&gt;Parallels&lt;/a&gt;.
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Mon, 25 Feb 2008 06:30:00 GMT</pubDate>
  <link>http://chris.pirillo.com/2008/02/19/parallels-or-vmware/</link>
  <guid>http://chris.pirillo.com/2008/02/19/parallels-or-vmware/</guid>
  </item>

  <item>
  <title>Screen Capture for Multi-taskers</title>
  <description>
  &lt;a href=&quot;http://www.techsmith.com/featured/2008/snagit/v9launch/?cmp=LockS01&quot;&gt;SnagIt&lt;/a&gt; 9 works like you work! Capture, edit and share images from your PC screen without breaking stride: stores captures automatically whether you saved them or not; new visual search panel lets you find captures easily whenever you need them.
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Tue, 10 Jun 2008 06:30:00 GMT</pubDate>
  <link>http://www.techsmith.com/featured/2008/snagit/v9launch/?cmp=LockS01</link>
  <guid>http://www.techsmith.com/featured/2008/snagit/v9launch/?cmp=LockS01</guid>
  </item>

  <item>
  <title>Screencast Software</title>
  <description>
  &lt;a href=&quot;http://www.techsmith.com/camtasia.asp?cmp=LkrgCS1&quot;&gt;Camtasia Studio&lt;/a&gt; is the smart, friendly screen recorder (and more). With it, you can create stunning videos with a great degree of ease. Download the &lt;a href=&quot;http://www.techsmith.com/camtasia.asp?cmp=LkrgCS1&quot;&gt;free trial&lt;/a&gt; now and in no time you'll be sharing buzz-worthy screencasts, persuasive presentations, training that ROCKS, and demos that sell. Show exactly what's on your screen to anyone, anywhere. Record your screen, audio, and/or webcam! Make them wonder how you did it.
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Sat, 12 Jul 2008 06:30:00 GMT</pubDate>
  <link>http://www.techsmith.com/camtasia.asp?cmp=LkrgCS1</link>
  <guid>http://www.techsmith.com/camtasia.asp?cmp=LkrgCS1</guid>
  </item>
  
  <item>
  <title>Coupons for Online Shopping</title>
  <description>&lt;p style=&quot;color: red&quot;&gt;This feed is fueled by Lockergnome &lt;a href=&quot;http://www.lockergnome.com/buy/&quot;&gt;Online Shopping and Coupon Codes&lt;/a&gt;&lt;/p&gt; 
&lt;p&gt;
 Before you shop next time, see if we have &lt;a href=&quot;http://coupons.lockergnome.com/&quot;&gt;a coupon&lt;/a&gt; first.
&lt;/p&gt;
  </description> 
  <author>chris@lockergnome.com (Chris Pirillo)</author> 
  <category>Partner</category> 
  <pubDate>Sat, 12 Jul 2008 07:56:13 GMT</pubDate>
  <link>http://coupons.lockergnome.com/</link> 
  <guid>http://coupons.lockergnome.com/</guid>
  </item>

</channel>
</rss>
