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

<channel>
	<title>Jonathan Bernard</title>
	<atom:link href="http://blog.jdbernard.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jdbernard.com</link>
	<description>Life, Faith, and Code</description>
	<lastBuildDate>Thu, 04 Aug 2011 03:13:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Perfection, Practice, and Publication</title>
		<link>http://blog.jdbernard.com/2011/04/perfection-practice-and-publication/</link>
		<comments>http://blog.jdbernard.com/2011/04/perfection-practice-and-publication/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 22:52:21 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Life Musings]]></category>

		<guid isPermaLink="false">http://blog.jdbernard.com/?p=227</guid>
		<description><![CDATA[I am the type of person who does not like to release something until it is finished and perfect. In my area of expertise, where I am very efficient, this can be an advantage. I work fast enough and well enough to get things done and polished to a level that satisfies my perfectionism. In [...]]]></description>
			<content:encoded><![CDATA[<p>I am the type of person who does not like to release something until it is finished and perfect. In my area of expertise, where I am very efficient, this can be an advantage. I work fast enough and well enough to get things done and polished to a level that satisfies my perfectionism. In areas that I want to be proficient it is not necessarily bad, since there is rarely need to publish my practice. There is another category, however, in which this trait hinders me.</p>

<p><span id="more-227"></span>
There are many skills in life which everyone should possess in some degree. Writing, for example. As I get older and have more responsibilities I realize that I no longer have the luxury of time to spend honing my skill in private before exercising it in public. Things never get done and I need something done. This blog is a perfect example of that. I am not a bad writer, I hope, but I do not meet my own stringent standards for publication. I have many more drafts on this blog than finished pieces.</p>

<p>Music is another area that could fall prey to the same fault. In my case it has not hindered me and in it I find the solution. Music is more enjoyable for me when there are several musicians. I enjoy playing music too much to let my perceived inadequacies as a musician stop me from playing with people. Also, with music it is obvious that you learn faster when playing with others than by yourself. Letting people see you while you learn and grow is unavoidable.</p>

<p>The trick is to accept inferior work (in my estimation), understanding that it is <em>good enough</em>. I tell myself three things:</p>

<ol>
<li>Do not expect yourself to be able to crank out high-quality work yet, this is something you are learning.</li>
<li>This is not the best you <em>can</em> do, but it is the best you <em>will</em> do, given the time constraints.</li>
<li>This will make you better in the future.</li>
</ol>

<p>This is nothing new. Many people have explored this topic (some are listed below). This post is my first exercise. There is a good piece of advice from writing that is applicable in many fields, I think: Set a regular publication period and meet it, even if your results are not perfect. Perfection comes through practice. It is a common mistake to let the quest for perfection hinder practice. It is a mistake I will no longer allow myself. Expect biweekly entries on this blog.</p>

<p>If you are interested, here are some other people&#8217;s thoughts on the subject:</p>

<ul>
<li><a href="http://www.codinghorror.com/blog/2007/07/yes-but-what-have-you-done.html">Yes, But What Have You <em>Done</em>?</a> by Jeff Atwood</li>
<li><a href="http://www.structuredprocrastination.com/light/perfectionism.php">Procrastination and Perfectionism</a> by John Perry</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.jdbernard.com/2011/04/perfection-practice-and-publication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trigger Thumb</title>
		<link>http://blog.jdbernard.com/2010/06/trigger-thumb/</link>
		<comments>http://blog.jdbernard.com/2010/06/trigger-thumb/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 15:38:45 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.jdbernard.com/?p=209</guid>
		<description><![CDATA[For the last two to three weeks I have been experiencing occasional, mild pain in my left thumb. It felt like a pulled muscle of tendon, no tingling or numbness, so I mentally ruled out carpal tunnel syndrome. I initially hoped it would heal on it&#8217;s own and tried to go easy on the thumb [...]]]></description>
			<content:encoded><![CDATA[<p>For the last two to three weeks I have been experiencing occasional, mild pain in my left thumb. It felt like a pulled muscle of tendon, no tingling or numbness, so I mentally ruled out carpal tunnel syndrome. I initially hoped it would heal on it&#8217;s own and tried to go easy on the thumb for a bit. It was not getting worse, but it was not getting better either, so I booked an appointment today with the <a href="http://www.brownhandcenter.com">Brown Hand Center</a> to see if they could tell me what was going on.</p>

<p>The doctor there very quickly homed in on my thumb pain, knew just where to gently press to reproduce the pain, and quickly diagnosed me with mild <a href="http://en.wikipedia.org/wiki/Trigger_finger">Trigger Thumb</a>. He told me it was most likely caused by an inflammation of the tendon, and that the continued use of my thumb was preventing it from healing. Since my thumb was not locking up, and the pain was mild, he recommended wearing a splint on my hand to immobilize the thumb and let it heal. We went ahead and set a date for surgery a few weeks later in case the splint was ineffective and surgery was necessary.</p>

<p>The surgery itself is a minimally invasive outpatient procedure that takes roughly ten minutes. Recovery is minimal; I would be able to work the next day if I chose to. The doctor also mentioned a treatment option using steroids, but mentioned that steroids could weaken the tendons and he preferred not to use them.</p>

<p>So, for the next few weeks, I have no left thumb! Good times, good times. I am challenging myself to see how many things I can do without using that thumb.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jdbernard.com/2010/06/trigger-thumb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emulating Jaco</title>
		<link>http://blog.jdbernard.com/2010/04/emulating-jaco/</link>
		<comments>http://blog.jdbernard.com/2010/04/emulating-jaco/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 00:36:31 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.jdbernard.com/?p=204</guid>
		<description><![CDATA[Today I have decided to learn everything on Jaco&#8217;s self-titled solo debut CD. That is a pretty large goal, and I know I will not be able to go through it as fast as I would like. Jaco&#8217;s music is some of my favourite music, all genres and artists considered. His playing has always drawn [...]]]></description>
			<content:encoded><![CDATA[<p>Today I have decided to learn everything on Jaco&#8217;s <a href="http://www.jacopastorius.com/music/essential/solo_jacopastorius.asp">self-titled solo debut CD</a>. That is a pretty large goal, and I know I will not be able to go through it as fast as I would like. Jaco&#8217;s music is some of my favourite music, all genres and artists considered. His playing has always drawn me as a bass player. While there are many other great players I look up to,  Jaco is the one I want to emulate the most. I want to absorb his skill set, to whatever degree I can.</p>

<p>Musically I am bored right now. Most of the stuff I play is simple from a musical perspective. Even when learning new material, most of the time the technical skill required to play the patterns is all I am picking up. The reason why the player chose the those notes is within my understanding. A lot of what Jaco was doing is far beyond my knowledge, and very different from what I am playing right now. I do not expect to suddenly know the mind of Jaco after following through one CD, but I do hope that by playing his licks, his grooves, I will be pushed out of my comfort zone, theoretically as well as technically. To me, Jaco&#8217;s lines always created a thick groove, and yet they are some of the busiest bass lines I have heard. I want to be able to place notes like he did.</p>

<p>Maybe I will record and post stuff I have learned to <a href="http://www.youtube.com">YouTube</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jdbernard.com/2010/04/emulating-jaco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing ZenWalk 6.2</title>
		<link>http://blog.jdbernard.com/2010/04/installing-zenwalk-6-2/</link>
		<comments>http://blog.jdbernard.com/2010/04/installing-zenwalk-6-2/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 16:31:47 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.jdbernard.com/?p=181</guid>
		<description><![CDATA[I have run a GNU/Linux system as my main operating system for a little while now. I started on Red Hat 6 back in &#8217;99, but since then I&#8217;ve used Debian, Slackware, DSL, Knoppix, and others at various points. The latest has been Ubuntu. I picked up 7.04 and have been pretty satisfied since then. [...]]]></description>
			<content:encoded><![CDATA[<p>I have run a GNU/Linux system as my main operating system for a little while now. I started on <a href="http://en.wikipedia.org/wiki/Red_Hat_Linux">Red Hat 6</a> back in &#8217;99, but since then I&#8217;ve used <a href="http://www.debian.org/">Debian</a>, Slackware, <a href="http://www.damnsmalllinux.org/">DSL</a>, <a href="http://www.knoppix.net/">Knoppix</a>, and others at various points. The latest has been <a href="http://www.ubuntu.com/">Ubuntu</a>. I picked up 7.04 and have been pretty satisfied since then. After marriage and a kid, I appreciated how simple Ubuntu was to set up. The default settings were livable, with a little tweaking.</p>

<p>Recently, I have started getting the itch again to tinker, and Ubuntu&#8217;s default setup is no longer satisfying me (nothing wrong with it, just not what I want). So after some deliberation, I am going back to a Slack-based distro: <a href="http://zenwalk.org/">ZenWalk</a>.</p>

<p><span id="more-181"></span></p>

<h3>Installation</h3>

<p>I grabbed the <a href="http://www.zenwalk.org/modules/tinycontent/index.php?id=30">standard edition</a> ISO and put it on a USB drive using <a href="http://unetbootin.sourceforge.net/">UNetbootin</a>. Before I booted into ZenWalk&#8217;s installer, I used <a href="http://gparted.sourceforge.net/"><code>gparted</code></a> to shrink my existing Windows XP partition and create two new ext4 partitions, one for ZenWalk&#8217;s root (<code>/</code>) and one for my home directoy (<code>/home</code>).</p>

<p>ZenWalk&#8217;s installer is console-based rather than an X-based, and very simple. It gives you the option to change the keyboard layout, provides an opportunity to modify your partition table, and allows you to choose which partitions you want to install to, optionally spreading the system over several partitions. There is also an automatic option, where the installer makes the choices for you.</p>

<p>Since I was happy with the default keyboard layout (<code>us</code>), and had already partitioned my drive, I only needed to choose which partition was root and set up mount points for my other partitions. I started the installation and immediately hit a snag. Since I was installing from USB, I would need to mount the drive so ZenWalk could access the installation material. To mount the partition, I needed to be outside the installer. Usually you just use <em>Alt-F2</em> to change to the second <a href="http://en.wikipedia.org/wiki/Virtual_console">virtual terminal</a> (or <em>Ctrl-Alt-F2</em> if you are in an X session), but for some reason the ZenWalk installer was blocking that. I managed to get out of the installer and down to a command prompt. I was then able to mount the USB drive, but could not find a way to restart the installer (interestingly, I was able to access other virtual terminals after exiting the installer).</p>

<p>Rather than fight this longer, I burned the ISO to a CD and installed from the CD. The process up to that point was the same, and the installation proceeded without problems. Finally, after the system had been installed, there was the option to configure the <a href="http://en.wikipedia.org/wiki/LILO_%28boot_loader%29">LILO boot loader</a>. <a href="http://www.gnu.org/software/grub/">GRUB</a> had already been installed by Ubuntu so I chose to skip the LILO configuration and not to install LILO.</p>

<h3>Configuring GRUB</h3>

<p>Before I could boot into ZenWalk, I needed to add it to my GRUB configuration. GRUB was installed by Ubuntu and the configuration lived in the Ubuntu system, so I booted into Ubuntu. Ubuntu uses the newer GRUB 2, which allows the GRUB configuration process to be scripted. In GRUB Legacy, the boot menu configuration was usually found at <code>/boot/grub/menu.lst</code>. In GRUB 2, the actual configuration file is generated from several other files, located at <code>/etc/grub.d</code>. One of these scripts probes the machine for other installed operating systems. So in the end all I had to do was run</p>

<p><pre class="brush: plain">sudo update-grub</pre></p>

<p>and restart. The GRUB scripts automatically detected the ZenWalk installation and added it to the boot list.</p>

<p>All in all, fairly painless. Other than a false start with the USB installer, no problems. While the default installation is pleasant, I plan to move away from the defaults a bit, but that is for later.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jdbernard.com/2010/04/installing-zenwalk-6-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Full Day in Paris</title>
		<link>http://blog.jdbernard.com/2009/10/a-full-day-in-paris/</link>
		<comments>http://blog.jdbernard.com/2009/10/a-full-day-in-paris/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 23:20:16 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.jdbernard.com/?p=88</guid>
		<description><![CDATA[I am sitting here after a long day in Paris. If you will excuse my indulgence, I want to write down what happened today.  It was a fun, exhausting, rewarding day. I warn you, this is a bit long. A Stranger in a Strange Land Monday morning I flew out of Austin headed to Paris [...]]]></description>
			<content:encoded><![CDATA[<p>I am sitting here after a long day in Paris. If you will excuse my indulgence, I want to write down what happened today.  It was a fun, exhausting, rewarding day. I warn you, this is a bit long.
<span id="more-88"></span></p>

<h2>A Stranger in a Strange Land</h2>

<p>Monday morning I flew out of Austin headed to Paris by way of Charlotte, North Carolina. Thirteen hours later I arrived in Paris, for the first time alone in a foreign country where I did not speak the language at all. I had been to Germany, but I know German, rusty though it may be. I was also with my father and had a German missionary for a guide. This was different.</p>

<p>I found myself very quiet, subconsciously hoping that if I did not speak, people would not notice that I did not fit in. There is also that whole pride issue: I did not want to appear ignorant of my surroundings, but of course, I knew nothing of Paris, Charles de Gaulle Airport, or the subway system.</p>

<p>I think everyone should spend some time as the ignorant foreigner. It would do wonders for our humility and just maybe help us have more active compassion for others.</p>

<p>I had four tasks for myself before getting out of the airport:</p>

<ol>
    <li> change currencies,</li>
    <li> buy a power adapter to allow me to use my US appliances in France,</li>
    <li> buy a daily ticket for the metro system, and</li>
    <li> buy a pre-paid phone since Sprint&#8217;s CDMA network is completely unavailable in Europe (which is purely GSM).</li>
</ol>

<p>Changing currencies ended up being the easiest of the four, although I did roughly two laps of the airport lobby before finding the exchange office. Buying a power adapter ended up being simple as well, although I had a false start, almost walking out the store before realizing that what I had in my hand was 1) Europe to US, not US to Europe, and 2) unpaid for! Lesson one: focus. I always thought my Dad was a bit funny, he is like a machine when in an airport, especially in a foreign country. Now I understand why. You make your list, focus, and tackle the items one at a time.</p>

<p>Metro tickets were a little more difficult. There are many automated booths in the airport lobby, but they only sell one-way tickets (or least, that is all I could get them to sell me). I did not want a one-way ticket, or even a book of one way tickets. I wanted a day-pass. I did not want to waste all my tickets if I got lost, and I had been told a day-pass provides unlimited rides. Lesson two: the information people (indeed, most people in general) speak english. Swallow your pride, admit you have no clue how to get what you need, and politely ask the people paid to answer your questions. After a short wait in a line, I had not just a one-day pass, but a pass that covered my entire trip! The ticket clerk was able to direct me to a much better deal than I was about to buy.</p>

<p>Alas, my fourth goal remains unfulfilled. The information desk informed me that they did sell pre-paid SIM cards, but not pre-paid phones. Thank you again, Sprint, for using a dieing technology that no-one else in the world uses. At any rate, I was ready to journey out into Paris!</p>

<h2>The Journey to the Office</h2>

<p>The first challenge was the transportation system. Instead of taking a cab to our Meudon office (Meudon is basically a suburb of Paris), I elected to take the metro. I figured it would save the company a tidy sum and be a fun experience. I was not dissapointed. I have ridden on the New York subway system, and travelled the tri-state area by train, but the public transportation system in Paris dwarfs either of those, both in complexity and sheer size.</p>

<p>I had two exchanges from the airport to the office, changing from one subway train to another and finally to an above-ground tram. If you are transferring from one subway train to another you never have to leave the subway system. Just follow the signs that lead you through the underground labarynth to your connection. It really is very simple if you just follow the signs. I can not read French. It took me a little while to figure out what the signs were. So I did the stairmaster 2000: walking out of the subway, looking up, seeing the number for my connection pointing down the same stairs I just walked up, turning sheepishly around, and going back down! Ah what fun!</p>

<p>Ok, mastered the subway signs. Once you get them, you get them. Simple! Now to transfer to the tram. Until this point, I did not know there was a tram in addition to the subway system. I thought <em>T2</em> indicated a bus route (T for trolley?). Ten minutes later, no buses labeled <em>2</em>, but look! A sign very similar to the subway signs, saying <em>T2</em>. Hrmm&#8230;</p>

<p>Ok, I am on the tram platform, boarding the tram, inserting my ticket, declined! Wait, this is supposed to get me anywhere! Well, I do not want to be the rude, law-breaking American, so let&#8217;s hop off the tram.  I went to the ticket counter to buy tram tickets, and fortunately the ticket lady realized I had the day-pass.</p>

<p>Apparently, with the day-pass, you do not swipe, or insert your pass. You just get on the tram. If anyone asks, you show them your day pass. Great! Except now I feel like all the regular riders are  looking at me, the ignorant American that thinks the tram is free! &#8220;No! I have a day-pass, really!&#8221; They, of course, have more permanant passes that you just
badge against the door when you board.</p>

<p>Finally, I exited the tram, but I took the wrong exit off the platform and found myself across the street from where I wanted to be. Well, to be honest, I did not find myself until about ten minutes later, when the office failed to materialize! After a bit of backtracking, and more careful sign reading, I made it to the office! This brings me to 10AM, the start of my day.</p>

<h2>Notes and Learning and Stuff</h2>

<p>This part of my day was pretty straightforward. I received a presentation, the training I was there for. I now have ten pages of hand-written notes! Ten pages! From one day, not even the full day, just six hours! Good stuff.</p>

<p>Side note: for school, I usually type all my notes, but that is mostly to make sure I get everything the professor could possibly have on an exam, I usually already know the material. When I am trying to learn something really new, I always write it out by hand and transcribe it later. I find that my mind is more engaged in the subject when I am writing. I think when typing, I tend to focus on keeping up with the speaker, following the words, not the thoughts. I can not write fast enough to capture all of it; it forces me to distill the thoughts to what I can keep up with.</p>

<p>The day flew by pretty quickly. We stopped for lunch pretty early, as I had not been able to grab breakfast before coming in. The Meudon office has a dedicated cafeteria, like we did when we were still at the Schlumberger property. It was expensive! But I was hungry, and expensing costs.</p>

<p>After lunch, I had the best cup of coffee I have ever had. Seriously, it was a caffe machiato and it beat anything I have had at any Starbucks, hands down. Here is the kicker: it was made by a machine. Yeah, one of those automatic dispenser machines that drop a cup down, brews up some coffee, and adds cream and sugar. It knows how to make some twenty types of coffee: expresso, mocha lattes, cocoa lattes (yum!), americanos, etc. Oh, it was free. FREE. The best cup of coffee I have ever had was FREE from a machine in our developers&#8217; offices. The French may not be able to win wars, but they make a mean cup of coffee!</p>

<h2>The Hotel</h2>

<p>At about 7:30, we headed out of the office and on our seperate ways. I headed to the hotel, just two stops down on the tram. As I was standing in line in the hotel lobby, I could not help but notice overhear the concierge very patiently trying to help someone over the phone. While she maintained a very patient, helpful tone of voice, you could tell the person on the other end was being obnoxious. Inwardly I hoped that when she was done it would be my time to go forward. It would be the perfect contrast to her rude customer: I will be overly polite and kind, and my request is easy, no sweat.</p>

<p>Well, it seemed like a good plan. Do not worry, I was nice, very nice. But my situation was not easy. We reserved my room by credit card before I ever left. The plan was: go up, check in, charge the room to the card details already present. The hotel needed an imprint of the card as a guarantee before they would release any room keys to me. The card was back with my manager in
America, and no, I did not have another card I could use, just as a guarantee, none of my personal cards allow international transactions, so I did not even bring them. Ten minutes later, we had left a message for my manager, and I had paid in cash for the room (to be refunded when the credit card transaction clears). We thought this might happen, so I had enough money. It was not the easy request I thought, but the poor lady did seem more relaxed, so mission
still accomplished!</p>

<h2>Dinner</h2>

<h2>More Fun on the Subway</h2>
]]></content:encoded>
			<wfw:commentRss>http://blog.jdbernard.com/2009/10/a-full-day-in-paris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Guide to Mercurial</title>
		<link>http://blog.jdbernard.com/2009/09/quick-guide-to-mercurial/</link>
		<comments>http://blog.jdbernard.com/2009/09/quick-guide-to-mercurial/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 13:47:45 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[CS371P - OOP]]></category>
		<category><![CDATA[University of Texas]]></category>

		<guid isPermaLink="false">http://blog.jdbernard.com/?p=56</guid>
		<description><![CDATA[Per Prof. Downing&#8217;s suggestions, here is a quick overview of Mercurial: Installing Mercurial is easy to install on most platforms: Binary Packages are available from the Mercurial website for Windows, an array of Linuxes, and Mac. TortoiseHg: Mercurial integrated with the Windows Explorer (does not provide command-line access). If you prefer working from the Windows [...]]]></description>
			<content:encoded><![CDATA[<p>Per Prof. Downing&#8217;s suggestions, here is a quick overview of Mercurial:
<span id="more-56"></span></p>

<h1>Installing</h1>

<p>Mercurial is easy to install on most platforms:</p>

<p><a title="Mercurial Downloads" href="http://mercurial.berkwood.com/">Binary Packages</a> are available from the Mercurial website for Windows, an array of Linuxes, and Mac.</p>

<p><a title="TortoiseHg Downloads" href="http://bitbucket.org/tortoisehg/stable/wiki/download">TortoiseHg</a>: Mercurial integrated with the Windows Explorer (does not provide command-line access). If you prefer working from the Windows GUI, you may prefer this. If you have ever used TortoiseSVN, TortoiseHg is very similar.
As of the time of writing the latest version is <a title="TortoiseHg Installer" href="http://bitbucket.org/tortoisehg/stable/downloads/TortoiseHg-0.8.2-hg-1.3.1-1444a42f6052.exe">http://bitbucket.org/tortoisehg/stable/downloads/TortoiseHg-0.8.2-hg-1.3.1-1444a42f6052.exe</a></p>

<h3>Ubuntu</h3>

<p>Installing Mercurial is easy via apt-get:
<pre>sudo apt-get install mercurial</pre></p>

<h3>UTCS Machines</h3>

<p>The UTCS machines already have Mercurial 1.3.1 installed.</p>

<h1>Basic Usage</h1>

<p>Let&#8217;s walk through project 1: Collatz,  using Mercurial. All of the examples I will give are on the command line. All actions work the same from TortoiseHg. Quick note on formatting:
<pre>Commands will be monospace, flushed to the left.
  Output from a command will also be monospace, but indented</pre></p>

<ul>
    <li>First, lets create a new Mercurial repository for our project:
<pre>mkdir project1
cd project1
hg init</pre>
If we list the directory contents, we will see a newly created <strong>.hg</strong> folder.
<pre>ls -al
  drwxr-xr-x 3 jdbernard jdbernard 4096 2009-09-22 10:31 .
  drwxr-xr-x 4 jdbernard jdbernard 4096 2009-09-22 10:31 ..
  drwxr-xr-x 3 jdbernard jdbernard 4096 2009-09-22 10:31 .hg</pre>
If you looked at an SVN working copy, you would have noticed a similar <strong>.svn</strong> folder. There are a few important differences between what the <strong>.svn</strong> and <strong>.hg</strong> folders contain and mean:
<ul>
    <li> When you did a checkout from SVN, you were not getting the full repository. When you create a Mercurial repository, everything is present. The working copy of a Mercurial repository is the entire repository, including its full history.</li>
    <li> The <strong>.svn</strong> folder is the SVN administration area. You will see one <strong>.svn</strong> folder in every directory of your project. The <strong>.svn</strong> folder is used to track changes and properties of the files in the current folder relative to the central repository maintained somewhere else (Google Projects for example).</li>
    <li>The <strong>.hg</strong> folder is not just an admin area, it IS the repository. You will also notice that there is only one <strong>.hg</strong> folder in the root directory.</li>
</ul>
I feel it is worth pausing here to underscore an important distinction between using SVN and Mercurial. When you checkout some portion of a project from SVN, you are copying only the directory and revision you check out. This means you must have access to the SVN central repository to do most version control activities. With Mercurial, when you &#8216;checkout&#8217; a project, you actually make a full copy of the repository. So one valid way to &#8216;checkout&#8217; a project into a new directory is just to copy the project directory. The<strong> hg clone</strong> command is a fancy version of this simple copy, but we will get to that later.</li>
    <li>Now we&#8217;ll grab the initial sources from the links on the Collatz blog post. No <strong>hg</strong> new commands here, just <strong>wget</strong> to download stuff.
<pre>COLLATZ=http://www.cs.utexas.edu/users/downing/projects/c++/collatz
wget $COLLATZ/Collatz.txt
wget $COLLATZ/main.c++
wget $COLLATZ/TestCollatz.h
wget $COLLATZ/Collatz.in
wget $COLLATZ/Collatz.out
wget $COLLATZ/TestCollatz.out</pre>
</li>
    <li>Before we go any further, let&#8217;s look at two important commands: <strong>hg status</strong> and <strong>hg log</strong>.
<ul>
    <li><strong>hg status</strong> lists all the changes in the working directory which have not been committed.</li>
    <li><strong>hg log</strong> is similar to looking at the changelog from SVN. It lists the history of commits, the committer, and the commit message for that commit.</li>
</ul>
<pre>hg status
  ? Collatz.in
  ? Collatz.out
  ? Collatz.txt
  ? TestCollatz.h
  ? TestCollatz.out
  ? main.c++

hg log
  (nothing here yet)</pre>
This illustrates another important point regarding Mercurial. Think of the <strong>.hg</strong> directory as the repository and the current directory as the working copy. <strong>hg status</strong> tells us that there are files in the working copy that are not under version control. <strong>hg log</strong> tells us that the repository has no history at this point.</li>
    <li>So let&#8217;s add our initial files to the repository. We can either add them one at a time:
<pre>hg add Collatz.txt main.c++ TestCollatz.h Collatz.in Collatz.out TestCollatz.out</pre>
or we can add the current directory, which recursively adds its contents:
<pre>hg add .
  adding Collatz.in
  adding Collatz.out
  adding Collatz.txt
  adding TestCollatz.h
  adding TestCollatz.out
  adding main.c++</pre>
You can see that if we do not explicitly tell Mercurial which files to add, it will tell us which files it is adding. Let&#8217;s see what our working directory looks like now:
<pre>hg status
  A Collatz.in
  A Collatz.out
  A Collatz.txt
  A TestCollatz.h
  A TestCollatz.out
  A main.c++

hg log
  (still nothing here)</pre>
We see that the &#8216;?&#8217; changed to &#8216;A&#8217; for the files we added. In general, the first character from the hg status command indicates the status of the particular file.
<ul>
    <li>&#8216;A&#8217; means it is present in the working copy but not in the last revision and it will be added once we commit.</li>
    <li>&#8216;R&#8217; means it is present in the last revision but not in the working copy and it will be removed once we commit.</li>
    <li>&#8216;M&#8217; means that the file is modified in the working copy relative to the last revision and the modifications will be applied once we commit.</li>
    <li>&#8216;?&#8217; means that the file is unknown to Mercurial and will be ignored if we do a plain commit.</li>
</ul>
There is one other way to add files which is even easier than <strong>hg add .</strong> and that is if we wait until we commit and we tell Mercurial to automatically add all files that are different.We will look at this after looking at basic commit usage.</li>
    <li>So lets start committing:
<pre>hg commit -m "Initial commit"
hg status
  (nothing here)

hg log
  changeset:   0:2740894f4023
  tag:         tip
  user:        Jonathan Bernard
  date:        Tue Sep 22 11:05:57 2009 -0500
  summary:     Initial commit</pre>
Now we see an entry in the log.
<ul>
    <li><strong>changeset</strong>: each revision has two names in a Mercurial repository. It has a revision number, left of the colon (&#8217;0&#8242; in this case) and a digest value right of the colon. The digest is a hash computed over the changes committed for this revision. This is getting a little ahead of ourselves, but it is fairly common for revision numbers to change. If two people both have their own copy of this repository and they both do a commit before merging, then they will both have different revsions named &#8217;1&#8242;. So we cannot always use the revision number as a unique identifier for a revision. The hash, however, does uniquely identify the revision.</li>
    <li><strong>tag</strong>: tags in Mercurial operate differently than tags in SVN. I will not go into detail here, but Google provides answers easily.</li>
    <li><strong>user</strong>: is the username of the user performing the commit. This will default to your unix username.</li>
    <li><strong>date</strong>: time stamp of when the commit was performed.</li>
    <li><strong>summary</strong>: is the beginning of the commit message you provided. The example I gave provides a short commit message on the command line. If you do not provide a message Mercurial will open an editor (looks at either the EDITOR or HGEDITOR evironment variables) for you to write a commit message. The summary shows the commit message up to the first period. So a good practice when writing longer commit messages is to provide a summary of the commit in one sentence before writing out the details.</li>
</ul>
</li>
    <li>Let&#8217;s make some more changes and commit them. Edit <strong>main.c++</strong> and add the following just before the definition of <strong>eval</strong>:
<pre>/**
 * cycleLength
 * Computes the cycle length for the given number
 */
int cycleLength(unsigned long n) {

  assert(n &gt; 0 &amp;&amp; n &lt;= 1000000);   int temp = n;   int cl = 1;   while(n != 1){     if(n%2 == 0){ /* even */       cl++;       n = n &gt;&gt; 1;
    }
    else{           /* odd */
      n = n + (n &gt;&gt; 1) + 1;
      cl = cl + 2;
    }
  }

  assert(cl &gt; 0);

  return cl;
}</pre>
Before we commit, let&#8217;s check the status:
<pre>hg status
  M main.c++</pre>
As expected, main is modified. Let&#8217;s commit:
<pre>hg commit -m "Added cycleLength function."
hg log
  changeset:   1:95f4400ad38a
  tag:         tip
  user:        Jonathan Bernard
  date:        Wed Sep 23 08:06:01 2009 -0500
  summary:     Added cycleLength function.

  changeset:   0:2740894f4023
  user:        Jonathan Bernard
  date:        Tue Sep 22 11:05:57 2009 -0500
  summary:     Initial commit</pre>
Notice that the revision number for the latest commit is revision 1 and the &#8216;tip&#8217; tag automatically moved to the latest revision.

One other command I want to show you before moving on is the <strong>hg diff</strong> command.
<pre>hg diff
  (nothing here)

hg diff -r 0 -r 1
  diff -r 2740894f4023 -r 95f4400ad38a main.c++
  --- a/main.c++  Tue Sep 22 11:05:57 2009 -0500
  +++ b/main.c++  Wed Sep 23 08:06:01 2009 -0500
  @@ -68,6 +68,32 @@
       in &gt;&gt; j;
       return true;}

  +/**
  + * cycleLength
  + * Computes the cycle length for the given number
  + */
  +int cycleLength(unsigned long n) {
  +
  +  assert(n &gt; 0 &amp;&amp; n &lt;= 1000000);   +  int temp = n;   +  int cl = 1;   +   +  while(n != 1){   +    if(n%2 == 0){   /* even */   +      cl++;   +      n = n &gt;&gt; 1;
  +    }
  +    else{           /* odd */
  +      n = n + (n &gt;&gt; 1) + 1;
  +      cl = cl + 2;
  +    }
  +  }
  +
  +  assert(cl &gt; 0);
  +
  +  return cl;
  +}
  +
   // ----
   // eval
   // ----</pre>
Two things to note: the first call to <strong>hg diff</strong> printed nothing. By default, <strong>hg diff</strong> shows the differences between the working directory and the latest revision. Since we just committed, there are no differences. The second time I called it passing two revision numbers. Obviously, those two revisions are being compared. Instead of a revision number, I could have given it a tag (for rev. 1) or the unique name for the revision.

You can change the diff program used. That is outside the scope of this post, look into the <a title="ExtdiffExtension" href="http://mercurial.selenic.com/wiki/ExtdiffExtension">Extdiff extension</a> and the general Mercurial <a title="MergeProgram" href="http://mercurial.selenic.com/wiki/MergeProgram">merge program</a> options.</li>
    <li>Say we wanted to go back to the initial commit, before our latest modification. We want to &#8216;checkout&#8217; a previous revision.
<pre>hg update -r 0
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
hg status
  (nothing printed)
hg log
  changeset:   1:95f4400ad38a
  tag:         tip
  user:        Jonathan Bernard
  date:        Wed Sep 23 08:06:01 2009 -0500
  summary:     Added cycleLength function.

  changeset:   0:2740894f4023
  user:        Jonathan Bernard
  date:        Tue Sep 22 11:05:57 2009 -0500
  summary:     Initial commit

hg identify
  2740894f4023</pre>
hg update updates our working directory to reflect the revision we gave it. If we do not give it a revision, it defaults to the latest revision. hg status shows no modifications in the working directory relative to the repository, but hg log shows us that the repository is unchanged. If we look at mani.c++, we can clearly see that the cycleLength function we added is missing. So we see that hg status (and diff, etc) compare to the revision that is currently checked out. hg identify tells us which revision is currently in the working directory. Let&#8217;s go back to the latest revision.
<pre>hg up
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved</pre>
For fun, let&#8217;s change <strong>main.c++</strong> and then try to go back to revision 0.
<pre>echo "This is my nonsensical change." &gt; main.c++
hg status
  M main.c++
hg up -r 0
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
hg status
  M main.c++
hg identify
  2740894f4023+</pre>
The important thing to notice is that it did not revert our modified <strong>main.c++</strong> file. Mercurial does not want to wipe out changes that we have made if they have not been committed. Also,<strong> hg identify</strong> adds a &#8216;+&#8217; to indicate that there are modifications in the working directory. Of course, we can tell Mercurial that we don&#8217;t care about our current modifications, we just want revision 0.
<pre>hg up -r 0 -C
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
hg status
  (no output)</pre>
</li>
</ul>

<h1>More Information</h1>

<p>Mercurial has an excellent built-in help system. Running <strong>hg help</strong> gives you a list of available commands and <strong>hg help &lt;command&gt;</strong> will give you detailed information about a particular command.</p>

<p>Additionally, there are many excellent tutorials and much fine documentation available online. My recommendations for further reading are:</p>

<ul>
    <li><a href="http://mercurial.selenic.com/wiki/QuickStart">Quick Start</a></li>
    <li><a title="Tutorial" href="http://mercurial.selenic.com/wiki/Tutorial">Tutorial</a> on the Mercurial website: a more detailed version of what I&#8217;ve done here.</li>
    <li><a title="Understanding Mercurial" href="http://mercurial.selenic.com/wiki/UnderstandingMercurial">Understanding Mercurial</a>: a more detailed explanation of what is going on when you create revisions, etc.</li>
    <li><a title="Mercurial: The Definitive Guide" href="http://hgbook.red-bean.com/">Mercurial</a>: The Definitive Guide: an excellent book on Mercurial. Great detail.</li>
    <li><a title="HOWTOs" href="http://mercurial.selenic.com/wiki/HOWTOs">HOWTOs</a>: common uses of Mercurial</li>
    <li><a title="Branch" href="http://mercurial.selenic.com/wiki/Branch">Branches</a>: an explanation of branching in Mercurial</li>
</ul>

<p>Final Note: most of this discussion of Mercurial also applies to Git. The workflow and repository concepts are very similar. The commands themselves overlap more often than not. If you know Git, there is almost no learning curve moving to Mercurial and if you know Mercurial, there is almost no learning curve moving to Git.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jdbernard.com/2009/09/quick-guide-to-mercurial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>On Love: What is Love?</title>
		<link>http://blog.jdbernard.com/2009/07/on-love-what-is-love/</link>
		<comments>http://blog.jdbernard.com/2009/07/on-love-what-is-love/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 00:38:20 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Faith]]></category>
		<category><![CDATA[Life Musings]]></category>
		<category><![CDATA[cherish]]></category>
		<category><![CDATA[honor]]></category>
		<category><![CDATA[love]]></category>
		<category><![CDATA[protect]]></category>

		<guid isPermaLink="false">http://blog.jdbernard.com/?p=28</guid>
		<description><![CDATA[Love cannot be defined in one thought. I will attempt several, each of which I believe capture some of the essence of what true love is. First and foremost, however, true love is a commitment.]]></description>
			<content:encoded><![CDATA[<p>Love cannot be defined in one thought. I will attempt several, each of which I believe capture some of the essence of what true love is:</p>

<p>Love is a commitment first and foremost. A commitment to honor, cherish, and protect the object of your love. A commitment to the emotional, physical, and spiritual well-being of the one you love. A commitment to think of your loved one first and to provide for their needs first. True love says no-one and no-thing can dissuade my commitment to you. True love is very emotional, but true love is not an emotion. <strong>True love is a commitment.</strong><span id="more-28"></span></p>

<p>One second about divorce. Divorce does not happen when there is true love. True love is not an emotion and does not change day to day. True love can be lost, if it is not tended to. Divorce is only the legal and public display of a commitment that has faded of its own accord. Any relationship can be saved, if both parties are willing to work on it. True love says I am willing to change to accommodate you. Both the husband and the wife will be supremely happy when they both adopt this attitude. True love does not say, &#8220;This is how it must be for me to be happy.&#8221; True love asks, &#8220;How can I make you happy.&#8221; When both spouses think like this, they will find that they are both happy.</p>

<p>True love honors the other. This means that true love looks for ways to truthfully praise and to esteem the loved one. Empty praise is just that. Praise for the sake of praise alone is not genuine. But real praise and real appreciation, coming from the heart, lift and fill a person with life. Small things work just as well as large. Actions work better than words, though both are required. Love covers a multitude of sins, and this is not restricted to the love of our Savior. This expression of love through praise and affection creates a buffer against small annoyances and grievances. When this buffer of honor and esteem are lost, every little thing has the potential to escalate into a deadly argument. The key is not extravagance but consistency and honesty. Examples: &#8220;Thank you for working a hard day today. It is nice to not worry about bills,&#8221; and then, do not worry about the bills. &#8220;Thank you for taking care of the laundry! I appreciate having fresh, clean clothes to start the day,&#8221; and then, do not casually toss dirty clothes on the floor, bed, or chair (I am guilty here!).</p>

<p>True love cherishes the other. This means that they are valuable to you. This part is easy to miss in the day to day of life. Do not take your loved one for granted! Make their time valuable to you. I often find myself wanting in this regard. Are you always busy when you have time together? Is there always something you would rather be doing when you are spending time with your loved one? This is deadly for any relationship. It causes a distance and a gap. Your kids and your spouse will know how valuable they are to you by how you spend your time. That first crush and first dating experience sticks with you. You can almost fall in love with dating as much as the person, because there is someone who values you and thinks you are special. This is what leads to so much of the romance in a dating or courting relationship. That feeling of love (love is a commitment) comes from being cherished and cherishing the one you love. If you want to restore that feeling in your relationship, start showing your partner how much you value them. Gifts are only valuable if they are a real expression of how much you value your partner. You can give your kids the gift of confidence in all of their life by showing them that they are important to you. You teach them that they are valuable and that what they do is valuable. They will need this later in life to build healthy relationships of their own. I will talk more about this in another post.</p>

<p>True love causes you to protect the one you love. True love values the loved one, and true love seeks to protect that loved one. Beyond the obvious physical protection, this means you are protective of their self-worth and the things that they value. For example: you do not get glory, esteem, or pleasure at the expense of the one you love. Parents, never tell people about how you saved your kids from doing something stupid, or had to fix their mistake. You are raising your own ego at the expense of theirs. This tears them down, it does not protect them. Kids, and people in general, are going to make mistakes, sometimes when they have been told better. It is part of how people learn and grow (not just kids). Your reaction to their mistakes can have a stronger and longer-lasting impact on them than their mistake itself. For any relationship of love, the ones you love must know that they are safe with you. They are safe to be who they are and you will not attack them, or cut them down for it. They are safe knowing that if they make mistakes you will be there to help them overcome those mistakes, not to kick them while they are down. This is one of the most important attitudes of love a church family needs to have towards one another. The cherishing of love cannot happen if there is no safety in the relationship. It has often been said that those closest to you are those that hurt you the most. Let us look at this from the perspective of love, not I-based. Translated it is: those who are the closest to me are the ones I have the greatest power to hurt. So I must protect my loved ones from myself as much as from anything else. This is where self-control and purposeful actions come into play, more on that later.</p>

<p>I have been blessed in my life to be on the receiving end of such love. Now as a husband and a father, I endeavor to give love like this to my wife and kids. There is far more to be said about love and I will post more later. Also, as I discover new truths about love, I will revise my understanding here.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jdbernard.com/2009/07/on-love-what-is-love/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First Post! Or: Why Is This Here?</title>
		<link>http://blog.jdbernard.com/2009/05/first-post-or-why-is-this-here/</link>
		<comments>http://blog.jdbernard.com/2009/05/first-post-or-why-is-this-here/#comments</comments>
		<pubDate>Wed, 13 May 2009 11:41:19 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Life Musings]]></category>

		<guid isPermaLink="false">http://blog.jdbernard.com/?p=3</guid>
		<description><![CDATA[It seems fitting to me that the first entry in my blog is a justification of its existence. After all, the thought that my words deserve their own shrine on the Internet feels rather arrogant. However, I think there are many good reasons to blog on a semi-regular basis. Let me show you. I have [...]]]></description>
			<content:encoded><![CDATA[<p>It seems fitting to me that the first entry in my blog is a justification of its existence. After all, the thought that my words deserve their own shrine on the Internet feels rather arrogant. However, I think there are many good reasons to blog on a semi-regular basis. Let me show you.</p>

<p><span id="more-3"></span>I have been using <a title="jdbernard on Twitter" href="http://twitter.com/jdbernard">Twitter</a> for a little while now &#8212; I reached one-hundred tweets about a week ago. I have noticed that using twitter forces me to condense and crystallize my thoughts. I dislike the shorthand that has evolved for IM and texting, so that one-hundred-and-forty character limit is all the more restrictive. I tend to ramble when I write; Twitter is a good exercise in self-editing for me. Sometimes I want an area to discuss a thought in more detail than micro-blogging will allow. A blog allows me to do so.</p>

<p>I tend to be an introspective though absent-minded person. I almost always remember what I have thought in the past, but my memory of past events seems sparse to me. I remember big things, but even then a lot of details are left out. This is normal, but from conversation I gather I forget more than most. This makes me wonder how vulnerable I am to <a title="Wikipedia - Confabulation" href="http://en.wikipedia.org/wiki/Confabulation">confabulation</a>, or false memories. My earliest memory is being stung by a wasp, but I am the only one who remembers that. How do I know that actually happened, what if it is actually from a video I saw as a kid?</p>

<p>A little while ago I read <a title="Total Recall: The Woman Who Can't Forget" href="http://www.wired.com/medtech/health/magazine/17-04/ff_perfectmemory?currentPage=all">an article</a> about a woman who remembers every day of her entire life in detail. Initially researchers believed there was something special about her brain that granted her better memory, but this was disproved. She was able to remember her life in detail because she kept a detailed journal of every day of her life and she studied it compulsively. She was memorizing her life much like we would memorize a list of definitions or a verse of the Bible. One interesting aside, this suggests that our brain can hold far more information than we typically learn. Blogging can combat age and fallible memory in two ways. A fresh, first-hand account of interesting thoughts or events will be recorded for later reference and in the process of writing I increase the reliability of my own memory.</p>

<p>There are more reasons for this blog but I have covered enough ground for one entry. While I hope you enjoy and benefit from my blog, a primary goal of this blog is self-improvement. I will write about this later but character is built around habit. Expressing and verbalizing thoughts is a critical part of internalizing them and that is what this blog is about. My topics will follow my interests, so expect some technical subjects mixed in with the musings and the Biblical study. I welcome discussion; as iron sharpens iron, so one man sharpens another (Pr. 27:17).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jdbernard.com/2009/05/first-post-or-why-is-this-here/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

