<?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>Dan Klassen &#187; web development</title>
	<atom:link href="http://danklassen.com/wordpress/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://danklassen.com/wordpress</link>
	<description>Apps, tech-news, and other interesting stuff.</description>
	<lastBuildDate>Wed, 06 May 2009 17:44:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>gitg, a prettier git UI</title>
		<link>http://danklassen.com/wordpress/2009/05/gitg-a-prettier-git-ui/</link>
		<comments>http://danklassen.com/wordpress/2009/05/gitg-a-prettier-git-ui/#comments</comments>
		<pubDate>Wed, 06 May 2009 16:00:24 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=109</guid>
		<description><![CDATA[A while back I posted about a number of graphical interfaces to the git version control system. In the last couple of days I happened across a new system named gitg. Astute readers may have guessed that the second &#8216;g&#8217; in the name stands for gnome and they would be correct.
Gitg has much the same [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I <a title="Graphical Git User Interfaces Reviewed" href="/wordpress/2008/12/git-version-control-graphical-tools/">posted</a> about a number of graphical interfaces to the git version control system. In the last couple of days I happened across a new system named gitg. Astute readers may have guessed that the second &#8216;g&#8217; in the name stands for gnome and they would be correct.</p>
<p><a title="Gitg, gnome graphical interface for git" href="http://trac.novowork.com/gitg/" target="_blank">Gitg</a> has much the same feel as gitk does, but feels much more polished and is well worth a look. I find it quite handy to view the history of projects to get a visual representation as to what has happened in the history. It also has the ability to stage and commit changes.</p>
<p>Definitely check it out if this sounds like something you would find useful and you are using the gnome desktop environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2009/05/gitg-a-prettier-git-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: my experiences thus far.</title>
		<link>http://danklassen.com/wordpress/2009/05/experiences-with-magento/</link>
		<comments>http://danklassen.com/wordpress/2009/05/experiences-with-magento/#comments</comments>
		<pubDate>Sun, 03 May 2009 23:31:38 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=105</guid>
		<description><![CDATA[If you have been looking around for an open source shopping cart / e-commerce system in recent times, you most likely have come across Magento at one point or another and wondered at how it works in real live.
There certainly are some good things to be said for it. It has an impressive feature set, [...]]]></description>
			<content:encoded><![CDATA[<p>If you have been looking around for an open source shopping cart / e-commerce system in recent times, you most likely have come across <a title="Magento Commerce" href="http://www.magentocommerce.com" target="_blank">Magento</a> at one point or another and wondered at how it works in real live.</p>
<p>There certainly are some good things to be said for it. It has an impressive feature set, and an intuitive interface which allows the store admins flexible control over discounts, pricing, taxes, etc. However there are some strong drawbacks to consider before taking the plunge and integrating it on a site.</p>
<p><span id="more-105"></span>First off, it is fairly resource hungry. If you are in a shared hosting environment, I would not consider it a viable option at all. Page load times will be significant, and adding an item to a cart will require the patience of Job. On a dedicated environment there are a number of tweaks that can be implemented to bring this down to a much more acceptable level however.</p>
<p>Secondly, nail down your requirements for the store first. If Magento doesn&#8217;t do what you need out of the box, or there aren&#8217;t any modules available in the community that meet your needs, anticipate a steep learning curve. Magento is developed using the EAV data structure, so don&#8217;t expect to be doing many direct SQL queries yourself to access data. Also, the object API is poorly documented, and in some cases broken.</p>
<p>Templating can be a bit of a bear until you learn which files to edit. Even then, a single page may be split across about a dozen files. Be sure to enable the theme developer hints in the configuration. This will help you out immensely in tracking down where content is coming from.</p>
<p>Lastly, I would recommend checking out the magento forums. There are so many threads that start with &#8220;Has anyone gotten magento to do x?&#8221; followed up with &#8220;I would like to know as well&#8230; anyone?&#8221;. The development team doesn&#8217;t seem to be able to keep up with the requests for features and isn&#8217;t the most communicative.</p>
<p>However, if you have your own server (or a good level of control over the environment and resources the project is being deployed in), and only need the features that are available through the interface, it can be a great solution to put in place.</p>
<p>Has anyone else had experience in Magento they wish to share? I&#8217;ve been told I should start a support group.</p>
]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2009/05/experiences-with-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>git &#8211; commiting a portion of your changes</title>
		<link>http://danklassen.com/wordpress/2009/01/git-commiting-a-portion-of-your-changes/</link>
		<comments>http://danklassen.com/wordpress/2009/01/git-commiting-a-portion-of-your-changes/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 06:15:07 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=81</guid>
		<description><![CDATA[While code the other day I ran into a familiar situation where I wanted to commit just a few of my changes in a file instead of all of them. Some of the code was needed for a quick fix, but the rest was more in the building / testing phase. I know the better [...]]]></description>
			<content:encoded><![CDATA[<p>While code the other day I ran into a familiar situation where I wanted to commit just a few of my changes in a file instead of all of them. Some of the code was needed for a quick fix, but the rest was more in the building / testing phase. I know the better setup would have been to have a branch for the bigger change, and merge back when it was all ready to go, but unfortunately that wasn&#8217;t the setup this time.</p>
<p>Doing a bit of researching, I found that using git it is possible to commit some of your changes instead of all of them. To do this I have found the interactive commit command the most straight forward to use.</p>
<p>To begin an interactive commit,  issue the command with the &#8211;interactive flag (note, that&#8217;s two dashes, not the one long one)</p>

<div class="wp_codebox"><table width="100%" ><tr id="p814"><td class="code" id="p81code4"><pre class="bash" style="font-family:monospace;">git commit <span style="color: #660033;">--interactive</span>
           staged     unstaged path
  1:    unchanged        +3<span style="color: #000000; font-weight: bold;">/</span>-0 index.php
&nbsp;
<span style="color: #000000; font-weight: bold;">***</span> Commands <span style="color: #000000; font-weight: bold;">***</span>
  1: <span style="color: #7a0874; font-weight: bold;">&#91;</span>s<span style="color: #7a0874; font-weight: bold;">&#93;</span>tatus	  2: <span style="color: #7a0874; font-weight: bold;">&#91;</span>u<span style="color: #7a0874; font-weight: bold;">&#93;</span>pdate	  3: <span style="color: #7a0874; font-weight: bold;">&#91;</span>r<span style="color: #7a0874; font-weight: bold;">&#93;</span>evert	  4: <span style="color: #7a0874; font-weight: bold;">&#91;</span>a<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #c20cb9; font-weight: bold;">dd</span> untracked
  <span style="color: #000000;">5</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>p<span style="color: #7a0874; font-weight: bold;">&#93;</span>atch	  <span style="color: #000000;">6</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>d<span style="color: #7a0874; font-weight: bold;">&#93;</span>iff	  <span style="color: #000000;">7</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>q<span style="color: #7a0874; font-weight: bold;">&#93;</span>uit	  <span style="color: #000000;">8</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>h<span style="color: #7a0874; font-weight: bold;">&#93;</span>elp
What now</pre></td></tr></table></div>

<p>As you can see it gives you a number of options. In this case we want to patch the file so we hit &#8216;5&#8242; and then hit enter.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p815"><td class="code" id="p81code5"><pre class="bash" style="font-family:monospace;">What now <span style="color: #000000;">5</span>
           staged     unstaged path
  <span style="color: #000000;">1</span>:    unchanged        +<span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span>-<span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>i<span style="color: #7a0874; font-weight: bold;">&#93;</span>ndex.php
Patch update</pre></td></tr></table></div>

<p>This is showing us a list of files that we can choose to patch from. Hitting 1 will select index.php for patching. You have to hit return again to begin the process after a file has been selected.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p816"><td class="code" id="p81code6"><pre class="bash" style="font-family:monospace;">Patch update 1
           staged     unstaged path
<span style="color: #000000; font-weight: bold;">*</span> 1:    unchanged        +3<span style="color: #000000; font-weight: bold;">/</span>-0 <span style="color: #7a0874; font-weight: bold;">&#91;</span>i<span style="color: #7a0874; font-weight: bold;">&#93;</span>ndex.php
Patch update
<span style="color: #c20cb9; font-weight: bold;">diff</span> <span style="color: #660033;">--git</span> a<span style="color: #000000; font-weight: bold;">/</span>index.php b<span style="color: #000000; font-weight: bold;">/</span>index.php
index 90ea18f..e2f84ef 100644
<span style="color: #660033;">---</span> a<span style="color: #000000; font-weight: bold;">/</span>index.php
+++ b<span style="color: #000000; font-weight: bold;">/</span>index.php
<span style="color: #000000; font-weight: bold;">@@</span> -1,7 +1,10 <span style="color: #000000; font-weight: bold;">@@</span>
 this is a <span style="color: #7a0874; font-weight: bold;">test</span> of how to commit partial files
+this is the first addition to the <span style="color: #c20cb9; font-weight: bold;">file</span>
 some <span style="color: #c20cb9; font-weight: bold;">more</span> changes
+and another line goes here
 testing
 and some <span style="color: #c20cb9; font-weight: bold;">more</span> testing here... this is fun<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
 adding some content to the bottom of the <span style="color: #c20cb9; font-weight: bold;">file</span>
+okay, <span style="color: #c20cb9; font-weight: bold;">last</span> one <span style="color: #000000; font-weight: bold;">for</span> now
 and a couple <span style="color: #c20cb9; font-weight: bold;">more</span>
&nbsp;
Stage this hunk <span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #000000; font-weight: bold;">/</span>a<span style="color: #000000; font-weight: bold;">/</span>d<span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #7a0874; font-weight: bold;">&#93;</span>?</pre></td></tr></table></div>

<p>Hitting &#8217;s&#8217; will split the current hunk and show you the changes to the file one hunk at a time giving you the option to stage the change or not.</p>
<p>After you are satisfied with how you have things set up, hit 7 to quit when given the option and git will bring you to the familiar comment adding screen.</p>
<p>Doing a git diff right after doing this will show you that only the staged changes got committed, the rest are still waiting there for whenever you&#8217;re ready to commit them as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2009/01/git-commiting-a-portion-of-your-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git: You have some suspicious patch lines&#8230;</title>
		<link>http://danklassen.com/wordpress/2008/12/git-you-have-some-suspicious-patch-lines/</link>
		<comments>http://danklassen.com/wordpress/2008/12/git-you-have-some-suspicious-patch-lines/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 02:46:16 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=76</guid>
		<description><![CDATA[So, I&#8217;ve run into this a few times now and it seems like bizarre behaviour to me. While committing, git complains about files which have trailing white space, or spaces followed by a tab. While this may not be the nicest formatting, enforcing this to be fixed before committing a file seems odd.
It turns out [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve run into this a few times now and it seems like bizarre behaviour to me. While committing, git complains about files which have trailing white space, or spaces followed by a tab. While this may not be the nicest formatting, enforcing this to be fixed before committing a file seems odd.</p>
<p>It turns out this is being caused by a pre-commit hook. There are two options you can go with to circumvent the issue.</p>

<div class="wp_codebox"><table width="100%" ><tr id="p769"><td class="code" id="p76code9"><pre class="bash" style="font-family:monospace;">git commit <span style="color: #660033;">--no-verify</span> .</pre></td></tr></table></div>

<p>The &#8211;no-verify will bypass the pre-commit hooks. This only works on the current commit thought, so you have to add the flag each time you want to commit.</p>
<p>I&#8217;ve found that if you</p>

<div class="wp_codebox"><table width="100%" ><tr id="p7610"><td class="code" id="p76code10"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> .git<span style="color: #000000; font-weight: bold;">/</span>hooks<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-x</span> pre-commit</pre></td></tr></table></div>

<p>will disable the pre-commit hooks permanently by removing the executable rights on the file.</p>
<p>Apparently they are disabled by default in newer releases.</p>
<p>Hope this helps someone else out as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/12/git-you-have-some-suspicious-patch-lines/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Git Version Contron Graphical Tools</title>
		<link>http://danklassen.com/wordpress/2008/12/git-version-control-graphical-tools/</link>
		<comments>http://danklassen.com/wordpress/2008/12/git-version-control-graphical-tools/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 06:21:07 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=37</guid>
		<description><![CDATA[*Update 2009-05-05* Also check out my quick post on gitg, a gnome based UI for git.
One thing that I have found while working with git is that there isn&#8217;t a wide selection of graphical tools to interact with the repository. There is gitk which comes with a default install of git. This program gives you [...]]]></description>
			<content:encoded><![CDATA[<p>*Update 2009-05-05* Also check out my <a title="Gitg, gnome graphical interface for git" href="/wordpress/2009/05/gitg-a-prettier-git-ui/">quick post on gitg</a>, a gnome based UI for git.</p>
<p>One thing that I have found while working with git is that there isn&#8217;t a wide selection of graphical tools to interact with the repository. There is gitk which comes with a default install of git. This program gives you a visual representation of the workflow of the repository that you&#8217;re currently working on. From your checkout folder typing gitk should bring up a window similar to this one.</p>
<p><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/gitk.png"><img class="aligncenter size-medium wp-image-68" title="gitk" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/gitk-300x174.png" alt="gitk" width="300" height="174" /></a></p>
<p><span id="more-37"></span>You&#8217;ll see a list of commits and a line tieing it to the parent commit. If you have a team of developers working on a single project, this can make for some interesting graphs to say the least. Tags are highlighted with a nice yellow flag which makes them stand out. Right clicking on a commit will let you view the differences between it and the currently select commit. Also, you can roll back the master branch to the selected version. In the bottom right pane there is a list of changed files on the currently select commit. Right clicking on one of these will let you bring it up in an external diff tool to view the changes that were made (I recommend meld for this).</p>
<p>If you were looking closely at the previous screen shot, you may have noticed that this was a clone of the Giggle repository. It&#8217;s also an sudo apt-get install giggle for simplicity&#8217;s sake. Giggle has a nicer interface that fits in with the gnome desktop environment better as you can see from the screen shot.</p>
<p><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/giggle.png"><img class="aligncenter size-medium wp-image-70" title="giggle" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/giggle-300x174.png" alt="giggle" width="300" height="174" /></a></p>
<p>Also, built in to the giggle interface is the ability to commit directly from there which seems to be lacking from the gitk app unless I&#8217;m completely missing something.</p>
<p><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/giggle-commit.png"><img class="aligncenter size-full wp-image-71" title="giggle-commit" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/giggle-commit.png" alt="giggle-commit" width="500" height="380" /></a></p>
<p>The last app I&#8217;ll look at for today is qgit4. This program is one that I cloned and compiled locally. You can make a clone of the repo by typing in</p>

<div class="wp_codebox"><table width="100%" ><tr id="p3713"><td class="code" id="p37code13"><pre class="bash" style="font-family:monospace;">git clone git:<span style="color: #000000; font-weight: bold;">//</span>git.kernel.org<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>scm<span style="color: #000000; font-weight: bold;">/</span>qgit<span style="color: #000000; font-weight: bold;">/</span>qgit4.git</pre></td></tr></table></div>

<p>Then cd qgit4 and type in</p>

<div class="wp_codebox"><table width="100%" ><tr id="p3714"><td class="code" id="p37code14"><pre class="bash" style="font-family:monospace;">qmake qgit.pro
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>You&#8217;ll need the Qt developer libraries installed for this to work, but if all went according to plan, you should have a bin directory with a qgit4 executable in it now. It should looks something kinda like this:</p>
<p><a href="http://danklassen.com/wordpress/wp-content/uploads/2008/12/qgit.png"><img class="aligncenter size-medium wp-image-72" title="qgit" src="http://danklassen.com/wordpress/wp-content/uploads/2008/12/qgit-300x174.png" alt="qgit" width="300" height="174" /></a></p>
<p>Qgit4 seems to be one of the more full-featured programs I&#8217;ve come across yet. It feels like it fits in more with the KDE desktop environment withsince it uses the Qt libraries. However, it lets you create multiple tabs if you want to take a closer look at each file and what changed. Clicking on a revision will show you the list of files that changed in the bottom right pane as well. Then right clicking on a file can open it in an external diff viewer as well.</p>
<p>I think each of these programs has their place. For quick &#8216;what change in this commit&#8217; gitk seems to fit the bill nicely (albeit rather ugly) and if you&#8217;re using gnome, I recommend giggle (if you can bring yourself to using a program named giggle&#8230; just don&#8217;t tell anyone else).</p>
<p>For typical day-to-day operations like committing, adding files to version control, and tagging I find that using the command line is pretty hard to beat though. However, having tools like these available will make git accessable to a wider audience, and easier to pitch to the team for your next development project.</p>
]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/12/git-version-control-graphical-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Testing Webpages in Multiple Versions of Internet Explorer</title>
		<link>http://danklassen.com/wordpress/2008/11/testing-webpages-in-multiple-versions-of-internet-explorer/</link>
		<comments>http://danklassen.com/wordpress/2008/11/testing-webpages-in-multiple-versions-of-internet-explorer/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 04:18:30 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[Internet Exploder]]></category>

		<guid isPermaLink="false">http://danklassen.com/wordpress/?p=40</guid>
		<description><![CDATA[If you have done any xhtml / css, I&#8217;m sure you have experienced the joy of making the site look the same in all browsers. Typically went implementing a site, I will first develop it in FireFox to get the general layout correct, then test in Safari, Chrome, and the dreaded multiple versions of Internet [...]]]></description>
			<content:encoded><![CDATA[<p>If you have done any xhtml / css, I&#8217;m sure you have experienced the joy of making the site look the same in all browsers. Typically went implementing a site, I will first develop it in FireFox to get the general layout correct, then test in Safari, Chrome, and the dreaded multiple versions of Internet Explorer. Recently, a colleague of mine pointed me in the direction of a tool called IETester.</p>
<p><span id="more-40"></span></p>
<p>What <a title="IE Tester" href="http://www.my-debugbar.com/wiki/IETester/HomePage" target="_blank">IETester</a> will do, is install Internet Explorer 5.5, 6, 7, and 8 beta 2 on your computer all in one nice interface without messing up your current browser settings. It also uses the correct javascript engines in addition to the rendering engine for each version, so you are able to experience your site just like your poor visitors who are using IE.</p>
<p>The only downside I have found, is that this is a Window XP / Vista only application. I spent a couple minutes with Wine trying to get it to run with limited success. If anyone figures that out, please leave a comment and let me know, as I would love to have this running on Ubuntu 8.10, but for time being I&#8217;ll use my wife&#8217;s laptop which has Windows on it.</p>
<p>The interface is based off of the ribbon design that MS Office 2007 introduced and incorporates tabs where you can have different versions of IE all open to the same url. A handy feature I noticed is the &#8216;refresh all tabs, no cache&#8217; which does exactly what it says. Typically, I&#8217;ll open the page I want to test in the 4 different version and then keep using the above mentioned button to load up the changes in all the tabs at once. All in all, I highly recommend grabbing this tool. It&#8217;s bound to save you many hours of frustrating work.</p>
]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/11/testing-webpages-in-multiple-versions-of-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Source Control with Git</title>
		<link>http://danklassen.com/wordpress/2008/10/source-control-with-git/</link>
		<comments>http://danklassen.com/wordpress/2008/10/source-control-with-git/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 06:36:56 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://danklassen.ca/wordpress/?p=28</guid>
		<description><![CDATA[I&#8217;ve been using version control for various projects for quite a while now. Basically, it lets you (and your co-developers) track your changes, who added what, merge conflicts, as well as going back in time and reverting your code base to its previous state.
Typically (in Subversion and CVS for example) you will have a central [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using version control for various projects for quite a while now. Basically, it lets you (and your co-developers) track your changes, who added what, merge conflicts, as well as going back in time and reverting your code base to its previous state.</p>
<p>Typically (in Subversion and CVS for example) you will have a central server which all the developers check their code in to. For a project not too long ago I was required to learn git, a distributed version control system. There were a number of reasons for doing so, but the most important (well, in my opinion) are:<span id="more-28"></span></p>
<ul>
<li>off-line repository access &#8211; we can work on our code changes and check in, even if we don&#8217;t have internet access.</li>
<li>local repository &#8211; I can make as many check-in&#8217;s and changes as I like without interrupting or checking in potential conflicts with other people&#8217;s code. Also, I feel more free to check-in experimental code without the concern it will disrupt anyone else.</li>
</ul>
<p>There are a few distributed version control systems (D-VCS&#8217;s) that are currently being actively developed and used. Bazaar, Mercurial (hg), and Git seem to be the most prominent at the time of writing with Git and Bazaar both gaining steam. Personally, I have chosen to migrate my personal projects over to git from svn due to my familiarity with the system now.</p>
<p>Quick start:</p>
<p>this will create an empty directory and initialize a git database</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2824"><td class="code" id="p28code24"><pre class="sh" style="font-family:monospace;">mkdir test
cd test
git init</pre></td></tr></table></div>

<p>now, create a text file and add some text</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2825"><td class="code" id="p28code25"><pre class="sh" style="font-family:monospace;">vi hello.txt
hi, I am file version 1.0</pre></td></tr></table></div>

<p>next we need to tell git to track this file and any changes that happen to it</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2826"><td class="code" id="p28code26"><pre class="sh" style="font-family:monospace;">git add hello.txt</pre></td></tr></table></div>

<p>at this point we can check the status of the repository by issuing a</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2827"><td class="code" id="p28code27"><pre class="sh" style="font-family:monospace;">git status</pre></td></tr></table></div>

<p>and you should see something like</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2828"><td class="code" id="p28code28"><pre class="sh" style="font-family:monospace;"># On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use &quot;git rm --cached &amp;lt;file&amp;gt;...&quot; to unstage)
#
#    new file: hello.txt
#</pre></td></tr></table></div>

<p>This tells you that you&#8217;re currently on the master branch (more on branches in another post) and that this will be the first commit to the repository. The next few lines will list the files that have either been added, changed, or removed since the last commit.</p>
<p>Now you can issue a</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2829"><td class="code" id="p28code29"><pre class="sh" style="font-family:monospace;">git commit .</pre></td></tr></table></div>

<p>to commit everything in the current working directory. Git will ask you for a comment to let other deveopers (or yourself if you&#8217;re forgetful like myself) know what changed since the last commit.</p>
<p>Now you can keep making changes, adding / removing files and committing as often as you would like. Running the comment</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2830"><td class="code" id="p28code30"><pre class="sh" style="font-family:monospace;">git log</pre></td></tr></table></div>

<p>will output a list of all the changes that have been made</p>
<p>Prior to committing a file, it is sometimes handy to compare the current file with the previous one. This is accomplished with</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2831"><td class="code" id="p28code31"><pre class="sh" style="font-family:monospace;">git diff hello.txt</pre></td></tr></table></div>

<p>The real power of git comes into play when you clone someone else&#8217;s working repository. To try this out, go to <a title="git hub - hosted git repositories" href="http://www.github.com" target="_blank">www.github.com</a> and find a random project and click on the clone URL and copy and paste the command (ie:                 <code>git clone git://github.com/rails/rails.git</code> to clone the ruby on rails source code). This will pull down not just the latest copy, but all the history and changes that have been made to the project to your local machine. You can now make your changes, and if you have permission do a</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2832"><td class="code" id="p28code32"><pre class="sh" style="font-family:monospace;">git push .</pre></td></tr></table></div>

<p>to push your changes back to the server you downloaded them from (hence the term distributed).</p>
<p>If there is interest, in the future I will do a series on tagging and branching and how to use them to keep an organized, stable set of code, while making major changes in a safe manor as well as some graphical tools which can make your life easier while trying to merge changes / fix conflicts.</p>
]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/10/source-control-with-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer and Ajax</title>
		<link>http://danklassen.com/wordpress/2008/06/internet-explorer-and-ajax/</link>
		<comments>http://danklassen.com/wordpress/2008/06/internet-explorer-and-ajax/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 21:25:44 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[Internet Exploder]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://danklassen.ca/wordpress/?p=26</guid>
		<description><![CDATA[Okay, I just wasted waaaay too much time trying to track down an apparently odd Internet Explorer redraw issue. The problem was an ajax call associated with the onchange of a checkbox form element. In Firefox this worked perfectly. Click the button, the div updates itself. However, in IE 6 and 7 it would just [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, I just wasted waaaay too much time trying to track down an apparently odd Internet Explorer redraw issue. The problem was an ajax call associated with the onchange of a checkbox form element. In Firefox this worked perfectly. Click the button, the div updates itself. However, in IE 6 and 7 it would just sit there and do nothing until you would force a redraw (ctrl +a seemed to do it), or scrolled the page up &#038; down a few times.</p>
<p>It turns out, this was because of the way IE handles the onchange javascript event. This only fires once the checkbox loses focus. To fix this, I just switched from the onchange event to the onclick event and everything works as expected. I&#8217;ll retract some (okay, just one) of my nasty comments about Internet Explorer now as this does make logical sense thinking about it now.</p>
<p>So the offending code looked like</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2635"><td class="code" id="p26code35"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;checkbox&quot; name=&quot;mycheckbox&quot; value=&quot;something&quot; onchange=&quot;update_div();&quot;&gt;click me</pre></td></tr></table></div>

<p>whereas it should be:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p2636"><td class="code" id="p26code36"><pre class="html" style="font-family:monospace;">&lt;input type=&quot;checkbox&quot; name=&quot;mycheckbox&quot; value=&quot;something&quot; onclick=&quot;update_div();&quot;&gt;click me</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://danklassen.com/wordpress/2008/06/internet-explorer-and-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
