<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Note to self and others</title>
	<atom:link href="http://www.lockergnome.com/awarberg/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lockergnome.com/awarberg</link>
	<description>Code snippets, experiences, guides &#38; suggestions - mostly IT :)</description>
	<pubDate>Mon, 13 Jul 2009 12:48:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Microsoft Jet Text Driver and Excel</title>
		<link>http://www.lockergnome.com/awarberg/2008/12/21/jet-text-driver-and-excel/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/12/21/jet-text-driver-and-excel/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 23:39:08 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[excel]]></category>

		<category><![CDATA[jet]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[sql]]></category>

		<category><![CDATA[text driver]]></category>

		<category><![CDATA[vba]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/?p=30</guid>
		<description><![CDATA[Using ADO and Jet Microsoft offers a way to view a folder, containing delimited text files, as a database where each file is a table.
The perspectives in this are great; you can perform joins, filtering, aggregation etc. without resorting to parsing techniques - you get to write sql queries instead!
In the example below I demonstrate [...]]]></description>
			<content:encoded><![CDATA[<p>Using ADO and Jet Microsoft offers a way to view a folder, containing delimited text files, as a database where each file is a table.</p>
<p>The perspectives in this are great; you can perform joins, filtering, aggregation etc. without resorting to parsing techniques - you get to write sql queries instead!</p>
<p>In the example below I demonstrate how to combine this power with Excel by showing you how to write a sheet to a delimited file and how to load a delimited file - using your own sql select statement - into an Excel sheet:</p>
<p><a href="http://warberg.net/files/MSJetTextDriverExample.zip">Zip archive containing example of Jet Text driver use through Excel / VBA</a></p>
<p>The function / routine for selecting records / executing an sql statement are kept minimal. In the rest of the example there is a great deal of VBA code to go through - including generic helper-routines, which might be of interest in themselves - so please let me know if anything needs to be elaborated.</p>
<p>I hope the Jet Text driver will prove as valuable to you as it has to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/12/21/jet-text-driver-and-excel/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Extract time part from VBA date</title>
		<link>http://www.lockergnome.com/awarberg/2008/12/20/extract-time-part-from-vba-date/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/12/20/extract-time-part-from-vba-date/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 13:54:49 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[cdate]]></category>

		<category><![CDATA[excel]]></category>

		<category><![CDATA[vba]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/?p=27</guid>
		<description><![CDATA[In a project at work I use Excel to perform analyses of some data records, which are timestamped by date and time.
I want to categorize the records by their time-of-day eg. &#8220;morning&#8221; and &#8220;afternoon&#8221;.
For this I define what is the beginning and end of each category eg. &#8220;morning&#8221;: from 07:00 to 09:00.
To find the category [...]]]></description>
			<content:encoded><![CDATA[<p>In a project at work I use Excel to perform analyses of some data records, which are timestamped by date and time.</p>
<p>I want to categorize the records by their time-of-day eg. &#8220;morning&#8221; and &#8220;afternoon&#8221;.</p>
<p>For this I define what is the beginning and end of each category eg. &#8220;morning&#8221;: from 07:00 to 09:00.</p>
<p>To find the category I simply need to extract the time component from the (date)timestamp of each record and compare to my time-of-day categories.</p>
<p>However I didn&#8217;t find a simple &#8220;built-in&#8221; way to extract the time component from the timestamp field.</p>
<p>I ended up using the following code:</p>
<blockquote><p>&#8216; assuming Timestamp is of type <em>date</em>,<br />
&#8216; perhaps the result of a CDate(TimestampAsString) conversion<br />
TimeComponent = CDate(Format(Timestamp, &#8220;HH:mm&#8221;))</p></blockquote>
<p style="text-align: left">The code formats the timestamp as a string, taking only the hour and minutes, then converts back into a date. The resulting TimeComponent can then be compared directly with eg. CDate(&#8221;07:00&#8243;).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/12/20/extract-time-part-from-vba-date/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Chrome And Symantec Endpoint Protection Fixed In MR3</title>
		<link>http://www.lockergnome.com/awarberg/2008/12/20/google-chrome-and-symantec-endpoint-protection-fixed-in-mr3-2/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/12/20/google-chrome-and-symantec-endpoint-protection-fixed-in-mr3-2/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 13:35:03 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[chrome]]></category>

		<category><![CDATA[sep]]></category>

		<category><![CDATA[symantec endpoint protection]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/?p=19</guid>
		<description><![CDATA[Google Chrome has until recently been clashing with Symantec Endpoint Protection (SEP), making it impossible to run Chrome in sandbox mode. It was possible to disable sandbox mode by running chrome with the argument –no-sandbox. Ironic, really, considering both SEP and sandbox mode attempts to protect the user from malware.
On behalf of a company, which [...]]]></description>
			<content:encoded><![CDATA[<p>Google Chrome has until recently been clashing with Symantec Endpoint Protection (SEP), making it impossible to run Chrome in sandbox mode. It was possible to disable sandbox mode by running chrome with the argument –no-sandbox. Ironic, really, considering both SEP and sandbox mode attempts to protect the user from malware.</p>
<p>On behalf of a company, which owns SEP licenses, I frequently check&nbsp;<a href="https://licensing.symantec.com/" title="https://licensing.symantec.com/" target="_blank">https://licensing.symantec.com/</a> for product updates. On September 17, 2008 Symantec published a new maintenance release, MR3.</p>
<p>After installing the MR3 release on top of my existing MR2 installation I found that Chrome would run in sandbox mode. The Chrome-compatible SEP software version 11.0.3001.2224.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/12/20/google-chrome-and-symantec-endpoint-protection-fixed-in-mr3-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Chrome And Symantec Endpoint Protection Fixed In MR3</title>
		<link>http://www.lockergnome.com/awarberg/2008/09/27/google-chrome-and-symantec-endpoint-protection-fixed-in-mr3/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/09/27/google-chrome-and-symantec-endpoint-protection-fixed-in-mr3/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 08:38:45 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[chrome]]></category>

		<category><![CDATA[sep]]></category>

		<category><![CDATA[symantec endpoint protection]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/?p=20</guid>
		<description><![CDATA[ 
Google Chrome has until recently been clashing with Symantec Endpoint Protection (SEP), making it impossible to run Chrome in sandbox mode. It was possible to disable sandbox mode by running chrome with the argument –no-sandbox. Ironic, really, considering both SEP and sandbox mode attempts to protect the user from malware. 
On behalf of a company, which [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>Google Chrome has until recently been clashing with Symantec Endpoint Protection (SEP), making it impossible to run Chrome in sandbox mode. It was possible to disable sandbox mode by running chrome with the argument –no-sandbox. Ironic, really, considering both SEP and sandbox mode attempts to protect the user from malware. </p>
<p>On behalf of a company, which owns SEP licenses, I frequently check&nbsp;<a href="https://licensing.symantec.com/" title="https://licensing.symantec.com/" target="_blank">https://licensing.symantec.com/</a> for product updates. On September 17, 2008 Symantec published a new maintenance release, MR3.</p>
<p>After installing the MR3 release on top of my existing MR2 installation I found that Chrome would run in sandbox mode. The Chrome-compatible SEP software version is 11.0.3001.2224.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/09/27/google-chrome-and-symantec-endpoint-protection-fixed-in-mr3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Language spaghetti - what&#8217;s your favorite?</title>
		<link>http://www.lockergnome.com/awarberg/2008/08/28/language-spaghetti-whats-you-favorite/</link>
		<comments>http://www.lockergnome.com/awarberg/2008/08/28/language-spaghetti-whats-you-favorite/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 17:30:19 +0000</pubDate>
		<dc:creator>awarberg</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[c#]]></category>

		<category><![CDATA[groovy]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[languages]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/08/28/language-spaghetti-whats-you-favorite/</guid>
		<description><![CDATA[The programming world has come a long way since Donald Knuth made his arguments for limited use of go-to statements.
People are starting to think less about execution speed and memory consumption and more about readability and conciseness. Scripting languages are being used more and more for the following reasons, among others:

We don&#8217;t want to compile [...]]]></description>
			<content:encoded><![CDATA[<p>The programming world has come a long way since Donald Knuth made his arguments for <em>limited </em>use of go-to statements.</p>
<p>People are starting to think less about execution speed and memory consumption and more about readability and conciseness. Scripting languages are being used more and more for the following reasons, among others:</p>
<ul>
<li>We don&#8217;t <em>want</em> to compile our code - it is a superfluous step when the code can just as well be interpreted</li>
<li>We know when to use a hammer and when to use a nail gun</li>
<li>Scripting languages are becoming as powerful as &#8220;real&#8221;<em> </em>programming languages</li>
<li>Compilers/interpreters are better at doing the&#8221;hard work&#8221; of transforming human readable code into efficient instructions for the machine</li>
</ul>
<p>I started learning c long ago but quickly moved up through the abstraction layers. This was in part due to the types of projects in which I was involved (not so much hardware programming) and by requirement from the programming courses I took at my school, Technical University of Denmark.</p>
<p>Over the years I&#8217;ve worked with languages such as VB, Java, C#, SML. When writing a compiler for the <em>while</em>-language (simple toy language) in Java I discovered the purpose of dynamic types and reflection and how much I&#8217;d missed them, really. Since then I&#8217;ve been looking seriously at a number of dynamic programming languages for the purpose of finding a generally adequate language for all - or at least most - of my projects. I have not yet succeeded.</p>
<p>Why would I want such a language? It certainly helps me as a programmer to try new languages. I get to see new aspects and approaches in my &#8220;previous&#8221; favorites. But one has to accept that every language brings a learning curve not only with respect to the kinks of the language but also the programming environment (IDE), the documentation as well as the community.</p>
<p>So what makes a good language for me? By now I have some pretty specific demands for a new language:</p>
<ul>
<li>Minimal syntax. For example, I believe semi-colons (;) should only be mandatory for multi-line statements.</li>
<li>Lots of syntactic sugar. Some people are not happy about this. For reasons of backwards compatibility I can see why - the language should stay be <em>stable</em> and syntactic sugar planned ahead. Sugar reduces line count and increases readability.</li>
<li>Large standard library. Logging, database connectivity, network interaction, etc. I detest having to pull libraries into my projects for functionality, which ought to be covered by the standard installation.</li>
<li>Multiprogramming support. Hardware makers are hitting some physical limits, which impair serial execution speed. The natural answer is to add multiple CPU cores. The language must be able to exercise them in a natural way.</li>
<li>Platform independence. Windows =&gt; users, Linux =&gt; developers. Bad mix, though I can understand why it is so! Both Linux and Windows <strong>suck</strong> in their respective ways.</li>
</ul>
<p><strong>Ruby:</strong> a great language not just for programming web sites! Ruby is purely object oriented. Ruby, however, is <strong>not</strong> a first class citizen on Windows. Releases for Windows severely lag behind the UNIX releases and some functionality eg. fork does not work on Windows. Furthermore, Ruby does not use OS threads but rather implements green threads. All &#8220;green threads&#8221; run in a single thread, as perceived by the OS, and thus cannot be scheduled in parallel on multiple processors. Netbeans has worked great as an IDE for ruby. Gems are awesome&#8230;</p>
<p><strong>Python: </strong>a <a href="http://googlefight.com/">google fight</a> between python and ruby leaves python far behind. I suspect in part because of the ruby-on-rails phenomenon. However, python has been adopted by google, which indicates some things&#8230; python eliminates many lines-of-code by using indention - which every coder uses anyway to structure his program - as a natural part of the syntax. Unlike Ruby, Python is not purely OO. In fact, python has an odd mix of OO and procedural syntax. Python also has some weird (seemingly superfluous) syntax in some places, eg colon after the condition of an <em>if</em>. The python FAQ explains that this is so for historical reasons/you should just accept it and left me with a bad taste in my mouth.</p>
<p><strong>Groovy:</strong> a fresh, new scripting environment ready to be assimilated in java environments. I really like groovy. For instance the <em>it</em> variable takes away many extra characters in simple mapping operations. Groovy is lacking ruby-like modules to import functionality on a global basis. It is slightly cumbersome that methods, which take no arguments, much be addressed ala <em>myobj.method() </em>rather than just <em>myobj.method</em>. I have yet to find a proper IDE for groovy! The plugin for Eclipse is horrible and cannot run certain examples, which run fine from the command line.</p>
<p>(<strong>Javascript: </strong>Beautiful. For writing web applications. )</p>
<p><strong>To be honest</strong> I prefer working in Ruby. But the poor support for Windows and lack of native threads is a show stopper. Groovy has a pretty appealing syntax but lowly IDE support. The procedural elements and unexplained syntactic elements of python are plain annoying.</p>
<p>Today I find myself coding projects in C#/.NET. Hardly cross-platform and Microsoft, along with my fellow countryman Anders Hejlsberg, has made sure C# is overly verbose and the combination requires lots of &#8220;boilerplate&#8221; code&#8230;</p>
<p>Why do I code in C#/.NET? This combination works. Visual Studio is pretty good, .NET has good support for parallel computation, Microsoft - unlike SUN with Java (which is more-or-less frozen since 1.5) - actually add syntactic sugar with new versions and also, I find the .NET library is actually pretty good!</p>
<p>Have you done some surveys of current dynamic languages? Maybe you disagree with my findings or just found the &#8220;perfect&#8221; language to suit your needs? If so, please tell me!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lockergnome.com/awarberg/2008/08/28/language-spaghetti-whats-you-favorite/feed/</wfw:commentRss>
		</item>
		<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><![CDATA[General]]></category>

		<category><![CDATA[file system]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/05/20/find-and-delete-empty-directories/</guid>
		<description><![CDATA[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).
I&#8217;ve used http://musicbrainz.org/ 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 [...]]]></description>
			<content:encoded><![CDATA[<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,'**','*')]). 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>
]]></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><![CDATA[General]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[microsoft vpn]]></category>

		<category><![CDATA[poptop]]></category>

		<category><![CDATA[pptp]]></category>

		<category><![CDATA[pptpd]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/05/09/pptpd-setup-for-home-networks/</guid>
		<description><![CDATA[I managed to get the poptop aka pptpd server running to my content today.
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.
First [...]]]></description>
			<content:encoded><![CDATA[<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>
]]></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><![CDATA[General]]></category>

		<category><![CDATA[pptpd]]></category>

		<category><![CDATA[windows error]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/05/09/windows-network-confusion/</guid>
		<description><![CDATA[Hi
I am playing around with a poptop box on an Ubuntu 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:
C:\&#62;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 [...]]]></description>
			<content:encoded><![CDATA[<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>
]]></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><![CDATA[General]]></category>

		<category><![CDATA[latex]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[table]]></category>

		<category><![CDATA[tex]]></category>

		<guid isPermaLink="false">http://www.lockergnome.com/awarberg/2008/05/08/transform-ruby-array-to-tex-table/</guid>
		<description><![CDATA[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:
def to_tex(table, user_opts = {})
  default_opts = {:center =&#62; true, :sep_cols =&#62; true, :col_align =&#62; 'l'}
  opts = default_opts.merge(user_opts)
  lines = [...]]]></description>
			<content:encoded><![CDATA[<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>
]]></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><![CDATA[General]]></category>

		<category><![CDATA[cmd.exe]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[jscript]]></category>

		<category><![CDATA[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[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 [...]]]></description>
			<content:encoded><![CDATA[<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://warberg.net/files/url-handlers.zip">here</a>.</p>
]]></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>How to Handle Remote Tech Support</title>
  <description>
  &lt;em&gt;Using &lt;a href=&quot;http://www.gotoassist.com/chris&quot;&gt;GoToAssist&lt;/a&gt; is the easiest way to view and control another person's computer online. Use it to provide instant technical support to family, friends and customers. Start a session with just one click, and instantly connect with the other party. &lt;/em&gt;
  </description>
  <author>chris@lockergnome.com (Chris Pirillo)</author>
  <category>Partner</category>
  <pubDate>Mon, 13 Jul 2009 06:30:00 GMT</pubDate>
  <link>http://gotoassist.com/chris/</link>
  <guid>http://gotoassist.com/chris/</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>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>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>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>
