<?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>Orange Cabin &#187; Uncategorized</title>
	<atom:link href="http://blog.orangecabin.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.orangecabin.com</link>
	<description>Blog of a freelance programmer</description>
	<lastBuildDate>Thu, 27 May 2010 13:25:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Importing existing GWT source to Eclipse</title>
		<link>http://blog.orangecabin.com/2010/05/importing-existing-gwt-source-to-eclipse/</link>
		<comments>http://blog.orangecabin.com/2010/05/importing-existing-gwt-source-to-eclipse/#comments</comments>
		<pubDate>Thu, 27 May 2010 13:15:03 +0000</pubDate>
		<dc:creator>Pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[GWT]]></category>

		<guid isPermaLink="false">http://blog.orangecabin.com/?p=121</guid>
		<description><![CDATA[If the existing source is an Eclipse project, then you can import it to Eclipse as normal
But if it isn&#8217;t an eclipse project (like the GWT sample Showcase), you have to generate Eclipse project using Google&#8217;s tool:

Install ant if you didn&#8217;t
Change to directory of the project directory &#8220;gwt-2.0.3\samples\Showcase&#8221;
type &#8220;ant eclipse.generate&#8221;
Now you have the eclipse project, [...]]]></description>
			<content:encoded><![CDATA[<p>If the existing source is an Eclipse project, then you can import it to Eclipse as normal</p>
<p>But if it isn&#8217;t an eclipse project (like the GWT sample Showcase), you have to generate Eclipse project using Google&#8217;s tool:<span id="more-121"></span></p>
<ol>
<li>Install ant if you didn&#8217;t</li>
<li>Change to directory of the project directory &#8220;gwt-2.0.3\samples\Showcase&#8221;</li>
<li>type &#8220;ant eclipse.generate&#8221;</li>
<li>Now you have the eclipse project, you can import it to Eclipse</li>
<li>As of  GWT2.0, you have to tell eclipse this is an GWT project.</li>
<li>Right click your project and click Google, then click Web Toolkit</li>
<li>Choose the checkbox &#8220;Use Google Web Tookit&#8221;. If the project needs App Engine, you have to enable it too.<a href="http://blog.orangecabin.com/wp-content/uploads/2010/05/gwt.jpg"><img class="alignnone size-medium wp-image-122" title="gwt" src="http://blog.orangecabin.com/wp-content/uploads/2010/05/gwt-300x214.jpg" alt="" width="300" height="214" /></a></li>
<li>Done</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.orangecabin.com/2010/05/importing-existing-gwt-source-to-eclipse/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IOError &#8220;Access is denied&#8221; installing gem using netbeans</title>
		<link>http://blog.orangecabin.com/2009/10/ioerror-access-is-denied-installing-gem-using-netbeans/</link>
		<comments>http://blog.orangecabin.com/2009/10/ioerror-access-is-denied-installing-gem-using-netbeans/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:48:08 +0000</pubDate>
		<dc:creator>Pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.orangecabin.com/2009/10/ioerror-access-is-denied-installing-gem-using-netbeans/</guid>
		<description><![CDATA[Well I got this trying to install gem using Netbeans on Windows:
&#34;ERROR:&#160; While executing gem &#8230; (IOError) Access is denied&#34;
It cost me ours to figure out what was the problem.&#160; Netbeans was trying to write to local ruby gems directory which is likely to on the system disk and is protected by Windows. The solution [...]]]></description>
			<content:encoded><![CDATA[<p>Well I got this trying to install gem using Netbeans on Windows:</p>
<p>&quot;ERROR:&#160; While executing gem &#8230; (IOError) Access is denied&quot;</p>
<p>It cost me ours to figure out what was the problem.&#160; Netbeans was trying to write to local ruby gems directory which is likely to on the system disk and is protected by Windows. The solution is simple:</p>
<p>Just run Netbeans “As Administrator”. I suppose you know how to do this since many program would have similar problem. In the case you are not sure, please right click you Netbeans startup icon and choose “Run as administrator” on the dialog.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.orangecabin.com/2009/10/ioerror-access-is-denied-installing-gem-using-netbeans/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to tell if Linux is 32 or 64 bit</title>
		<link>http://blog.orangecabin.com/2009/07/how-to-tell-is-my-linux-32-or-64-bit/</link>
		<comments>http://blog.orangecabin.com/2009/07/how-to-tell-is-my-linux-32-or-64-bit/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 16:05:31 +0000</pubDate>
		<dc:creator>Pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[trivial]]></category>

		<guid isPermaLink="false">http://blog.orangecabin.com/2009/07/how-to-tell-is-my-linux-32-or-64-bit/</guid>
		<description><![CDATA[Sometimes you want to tell if your Linux installation is 32 bit or 64 bit.
Short story:
just type this:
getconf LONG_BIT
 
&#160;
Longer story:
You can also type
uname –m
if it is x86_64, then it is 64bit.
cat /proc/cpuinfo doesn’t work in this case, because what it shows is about CPU. 32bit linux can run on 64bit CPU.
They should make this [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to tell if your Linux installation is 32 bit or 64 bit.</p>
<p>Short story:</p>
<p>just type this:</p>
<p>getconf LONG_BIT</p>
<p> <span id="more-112"></span>
<p>&#160;</p>
<p>Longer story:</p>
<p>You can also type</p>
<p>uname –m</p>
<p>if it is x86_64, then it is 64bit.</p>
<p>cat /proc/cpuinfo doesn’t work in this case, because what it shows is about CPU. 32bit linux can run on 64bit CPU.</p>
<p>They should make this more obvious.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.orangecabin.com/2009/07/how-to-tell-is-my-linux-32-or-64-bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tacking multiple domains using Google Analytics</title>
		<link>http://blog.orangecabin.com/2009/07/tacking-multiple-domains-using-google-analytics/</link>
		<comments>http://blog.orangecabin.com/2009/07/tacking-multiple-domains-using-google-analytics/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 14:37:59 +0000</pubDate>
		<dc:creator>Pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.orangecabin.com/2009/07/tacking-multiple-domains-using-google-analytics/</guid>
		<description><![CDATA[If you have two or more domains / sites, it is a headache to track all of them using Google Analytics. Yes you can track 10 sites using 10 profiles, but you lost the whole picture. Here is how to track multiple domains using a single profile (so-called cross domains tracking).
 
Basically you have to [...]]]></description>
			<content:encoded><![CDATA[<p>If you have two or more domains / sites, it is a headache to track all of them using Google Analytics. Yes you can track 10 sites using 10 profiles, but you lost the whole picture. Here is how to track multiple domains using a single profile (so-called cross domains tracking).</p>
<p> <span id="more-80"></span>
<p>Basically you have to do two tricks: a) modifying the google tracking js b)creating a custom filter to make the results more readable.</p>
<p>Let’s suppose you own two sites, <a href="http://www.orangecabin.com">www.orangecabin.com</a> and <a href="http://www.google.com">www.google.com</a></p>
<h3><strong>Step 1 : Create profile</strong> </h3>
<p align="left">You have to decide which domain is the primary domain,&#160; and create a normal profile for it as usual. Since <a href="http://www.orangecabin.com">www.orangecabin.com</a> is more important (I hope so), you use it. It really doesn’t matter which one you use.</p>
<h3>Step 2 : Customize tracking js</h3>
<p>Now google show you the tracking javascript you are supposed to add to your site. Copy the js, save it to a file and edit it to something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">var</span> gaJsHost <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;https:&quot;</span> <span style="color: #339933;">==</span> document.<span style="color: #660066;">location</span>.<span style="color: #660066;">protocol</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;https://ssl.&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://www.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>unescape<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;%3Cscript src='&quot;</span> <span style="color: #339933;">+</span> gaJsHost <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> pageTracker <span style="color: #339933;">=</span> _gat._getTracker<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;UA-4966487-9&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// tracking multiple domains</span>
pageTracker._setDomainName<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;none&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pageTracker._setAllowLinker<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pageTracker._setAllowHash<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
pageTracker._trackPageview<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>These lines are added:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// tracking multiple domains</span>
pageTracker._setDomainName<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>none<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pageTracker._setAllowLinker<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pageTracker._setAllowHash<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You will use this js instead of the original one.</p>
<h3>Step 3 : Create a custom filter</h3>
<p>The customized js is enough for google to collect information for all domains, but it won’t handle domain names correctly, <a href="http://www.google.com/index.html">www.google.com/index.html</a> and <a href="http://www.orange.com/index.html">www.orange.com/index.html</a> will be reported as the same page. So you have to add a custom filter. If you don’t know what it is, don’t worry just follow me.</p>
<p>Return to the profile list,&#160; find the newly created profile and click edit</p>
<p><a href="http://blog.orangecabin.com/wp-content/uploads/2009/07/multiple_domains_in_google_analytics_step_3_1.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="multiple_domains_in_google_analytics_step_3_1" border="0" alt="multiple_domains_in_google_analytics_step_3_1" src="http://blog.orangecabin.com/wp-content/uploads/2009/07/multiple_domains_in_google_analytics_step_3_1_thumb.jpg" width="600" height="71" /></a> </p>
<p>Find “Add Filter” on the new page</p>
<p><a href="http://blog.orangecabin.com/wp-content/uploads/2009/07/multiple_domains_in_google_analytics_step_3_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="multiple_domains_in_google_analytics_step_3_2" border="0" alt="multiple_domains_in_google_analytics_step_3_2" src="http://blog.orangecabin.com/wp-content/uploads/2009/07/multiple_domains_in_google_analytics_step_3_2_thumb.jpg" width="594" height="250" /></a> </p>
</p>
<p>Click “Add Filter”, Create it using these parameters:</p>
<p><strong>Filter Name</strong>: MultipleDomains </p>
<p><b>Filter Type</b>: Custom filter &gt; Advanced </p>
<p><b>Field A</b>: Hostname </p>
<p><b>Extract A</b>: (.*) </p>
<p><b>Field B</b>: Request URI </p>
<p><b>Extract B</b>: (.*) </p>
<p><b>Output To</b>: Request URI </p>
<p><b>Constructor</b>: /$A1$B1</p>
<p>as shown on this image:</p>
<p><a href="http://blog.orangecabin.com/wp-content/uploads/2009/07/multiple_domains_in_google_analytics_step_3_3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="multiple_domains_in_google_analytics_step_3_3" border="0" alt="multiple_domains_in_google_analytics_step_3_3" src="http://blog.orangecabin.com/wp-content/uploads/2009/07/multiple_domains_in_google_analytics_step_3_3_thumb.png" width="542" height="390" /></a></p>
<p>Click save changes.</p>
<p><strong>The next time you create another multiple-domain profile, you can reuse this filter instead of creating one.</strong></p>
<h3>step 4 add your customized js to your sites</h3>
<p>&#160;</p>
<p>That is it. Once you have enough data, you can get some report like this:</p>
<p><a href="http://blog.orangecabin.com/wp-content/uploads/2009/07/multiple_domains_in_google_analytics_step_42.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="multiple_domains_in_google_analytics_step_4" border="0" alt="multiple_domains_in_google_analytics_step_4" src="http://blog.orangecabin.com/wp-content/uploads/2009/07/multiple_domains_in_google_analytics_step_4_thumb2.jpg" width="531" height="199" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.orangecabin.com/2009/07/tacking-multiple-domains-using-google-analytics/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
