<?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>Luke&#039;s notes</title>
	<atom:link href="http://www.terheyden.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.terheyden.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 03 May 2012 17:16:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>x2go client &#8211; getting Alt+Tab to work</title>
		<link>http://www.terheyden.com/blog/?p=202</link>
		<comments>http://www.terheyden.com/blog/?p=202#comments</comments>
		<pubDate>Thu, 03 May 2012 17:14:28 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=202</guid>
		<description><![CDATA[x2go is an awesome remote desktop solution for windows->linux. However, by default, Alt-Tab doesn&#8217;t work! Luckily it&#8217;s easy to fix. Go into your x2go client settings and set thusly: I&#8217;ve replaced -multiwindow with -rootless, and added -keyhook. You can read about the x-server / xwin options here.]]></description>
			<content:encoded><![CDATA[<p>x2go is an awesome remote desktop solution for windows->linux. However, by default, Alt-Tab doesn&#8217;t work! Luckily it&#8217;s easy to fix. Go into your x2go client settings and set thusly:</p>
<p><a href="http://www.terheyden.com/blog/wp-content/uploads/2012/05/x2go1.png"><img src="http://www.terheyden.com/blog/wp-content/uploads/2012/05/x2go1.png" alt="" title="x2go client settings" width="541" height="504" class="alignnone size-full wp-image-203" /></a></p>
<p>I&#8217;ve replaced -multiwindow with -rootless, and added -keyhook. You can read about the x-server / xwin options <a href="http://x.cygwin.com/docs/man1/XWin.1.html" title="xwin settings">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=202</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Link: Solve For X &#8211; tech / thinking forum from Google</title>
		<link>http://www.terheyden.com/blog/?p=198</link>
		<comments>http://www.terheyden.com/blog/?p=198#comments</comments>
		<pubDate>Tue, 07 Feb 2012 22:51:06 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=198</guid>
		<description><![CDATA[Solve For X &#8211; kinda like TED talks but from Google: http://www.wesolveforx.com/ Looks neat.]]></description>
			<content:encoded><![CDATA[<p>Solve For X &#8211; kinda like TED talks but from Google:<br />
<a href="http://www.wesolveforx.com/" title="http://www.wesolveforx.com/" target="_blank">http://www.wesolveforx.com/</a></p>
<p>Looks neat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=198</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use XPath in your java applications</title>
		<link>http://www.terheyden.com/blog/?p=187</link>
		<comments>http://www.terheyden.com/blog/?p=187#comments</comments>
		<pubDate>Mon, 06 Feb 2012 21:10:43 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=187</guid>
		<description><![CDATA[It seems like such a simple task &#8211; my java application uses XML/XHTML; how do I perform an XPath query? After doing a few days of research, the easiest way I&#8217;ve found is by using the open source Saxon-HE XPath / XQuery library. I was even able to use it purely as a maven dependency. [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like such a simple task &#8211; my java application uses XML/XHTML; how do I perform an <a href="http://www.w3schools.com/xpath/xpath_intro.asp" title="XPath" target="_blank">XPath</a> query?</p>
<p>After doing a few days of research, the easiest way I&#8217;ve found is by using the open source Saxon-HE XPath / XQuery library. I was even able to use it purely as a maven dependency.</p>
<p>Here are the maven dependencies you need:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>net.sourceforge.saxon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>saxon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>9.1.0.8<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>net.sourceforge.saxon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>saxon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>9.1.0.8<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classifier<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>s9api<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/classifier<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And here&#8217;s a very simple example of how to use it:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">String</span> exampleXML <span style="color: #339933;">=</span>
        <span style="color: #0000ff;">&quot;&lt;?xml version=<span style="color: #000099; font-weight: bold;">\&quot;</span>1.0<span style="color: #000099; font-weight: bold;">\&quot;</span> encoding=<span style="color: #000099; font-weight: bold;">\&quot;</span>ISO-8859-1<span style="color: #000099; font-weight: bold;">\&quot;</span>?&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;&lt;bookstore&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;&lt;book&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;  &lt;title lang=<span style="color: #000099; font-weight: bold;">\&quot;</span>eng<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Harry Potter&lt;/title&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;  &lt;price&gt;29.99&lt;/price&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;&lt;/book&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;&lt;book&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;  &lt;title lang=<span style="color: #000099; font-weight: bold;">\&quot;</span>eng<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;Learning XML&lt;/title&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;  &lt;price&gt;39.95&lt;/price&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;&lt;/book&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span>
        <span style="color: #0000ff;">&quot;&lt;/bookstore&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * A simple example upon which the utils are built.
     * Docs: http://www.saxonica.com/documentation/xpath-api/s9api-xpath.xml
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> simple<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// XPath objs:</span>
            Processor proc <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Processor<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            XPathCompiler xpath <span style="color: #339933;">=</span> proc.<span style="color: #006633;">newXPathCompiler</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            DocumentBuilder builder <span style="color: #339933;">=</span> proc.<span style="color: #006633;">newDocumentBuilder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// Load the XML document.</span>
            <span style="color: #666666; font-style: italic;">// Note that builder.build() can also take a File arg.</span>
            <span style="color: #003399;">StringReader</span> reader <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">StringReader</span><span style="color: #009900;">&#40;</span>exampleXML<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            XdmNode doc <span style="color: #339933;">=</span> builder.<span style="color: #006633;">build</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> StreamSource<span style="color: #009900;">&#40;</span>reader<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// Select all &lt;book&gt; nodes.</span>
            <span style="color: #666666; font-style: italic;">// XPath syntax: http://www.w3schools.com/xpath/xpath_syntax.asp</span>
            XPathSelector selector <span style="color: #339933;">=</span> xpath.<span style="color: #006633;">compile</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;//book&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">load</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            selector.<span style="color: #006633;">setContextItem</span><span style="color: #009900;">&#40;</span>doc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// Evaluate the expression.</span>
            XdmValue children <span style="color: #339933;">=</span> selector.<span style="color: #006633;">evaluate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>XdmItem item <span style="color: #339933;">:</span> children<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">// Each book node has a title and price.</span>
                <span style="color: #666666; font-style: italic;">// Get the title and show it.</span>
                XdmNode bookNode <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>XdmNode<span style="color: #009900;">&#41;</span> item<span style="color: #339933;">;</span>
                XdmNode titleNode <span style="color: #339933;">=</span> getChild<span style="color: #009900;">&#40;</span>bookNode, <span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003399;">String</span> title <span style="color: #339933;">=</span> titleNode.<span style="color: #006633;">getStringValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003399;">String</span> lang <span style="color: #339933;">=</span> titleNode.<span style="color: #006633;">getAttributeValue</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> QName<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;lang&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;%s (%s)&quot;</span>, title, lang<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getLocalizedMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Helper method to get the first child of an element having a given name.
     * If there is no child with the given name it returns null.
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> XdmNode getChild<span style="color: #009900;">&#40;</span>XdmNode parent, <span style="color: #003399;">String</span> childName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        XdmSequenceIterator iter <span style="color: #339933;">=</span> parent.<span style="color: #006633;">axisIterator</span><span style="color: #009900;">&#40;</span>Axis.<span style="color: #006633;">CHILD</span>, <span style="color: #000000; font-weight: bold;">new</span> QName<span style="color: #009900;">&#40;</span>childName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>iter.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>XdmNode<span style="color: #009900;">&#41;</span>iter.<span style="color: #006633;">next</span><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: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Here is the resulting output:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">    Harry Potter (eng)
    Learning XML (eng)</pre></div></div>

<p>Want more? I&#8217;ve put up an eclipse project on GitHub called <a href="https://github.com/terheyden/XPathDemos" title="XPathDemos" target="_blank">XPathDemos</a>. It includes a useful utils class you can copy and paste into your own projects.</p>
<p>I&#8217;ve also made a little app that lets your experiment with XPath syntax on-the-fly called <a href="http://www.terheyden.com/w/Projects/XPathUI" title="XPath UI" target="_blank">XPath UI</a>. It&#8217;s a great way to get familiar with XPath syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=187</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Link: tools developers use</title>
		<link>http://www.terheyden.com/blog/?p=179</link>
		<comments>http://www.terheyden.com/blog/?p=179#comments</comments>
		<pubDate>Mon, 06 Feb 2012 19:29:02 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=179</guid>
		<description><![CDATA[Probably not terribly accurate, but a cool infographic nonetheless: The Tools that Software Developers Use [Infographic] &#8211; How-To Geek http://www.howtogeek.com/104549/the-tools-that-software-developers-use-infographic]]></description>
			<content:encoded><![CDATA[<p>Probably not terribly accurate, but a cool infographic nonetheless:</p>
<p style="padding-left: 30px;">The Tools that Software Developers Use [Infographic] &#8211; How-To Geek<br />
<a title="http://www.howtogeek.com/104549/the-tools-that-software-developers-use-infographic" href="http://www.howtogeek.com/104549/the-tools-that-software-developers-use-infographic"> http://www.howtogeek.com/104549/the-tools-that-software-developers-use-infographic</a></p>
<p style="padding-left: 30px;">
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=179</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android &#8211; List with a custom layout and complex ArrayAdapter</title>
		<link>http://www.terheyden.com/blog/?p=162</link>
		<comments>http://www.terheyden.com/blog/?p=162#comments</comments>
		<pubDate>Mon, 30 Jan 2012 07:46:30 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[android dev]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=162</guid>
		<description><![CDATA[Here&#8217;s a simple example of a ListActivity with a complex layout and ArrayAdapter, allowing us to display items with descriptions. public class CustomTwoLineListActivity extends ListActivity &#123; &#160; @Override protected void onCreate&#40;Bundle savedInstanceState&#41; &#123; super.onCreate&#40;savedInstanceState&#41;; &#160; final List&#60;String&#91;&#93;&#62; colorList = new LinkedList&#60;String&#91;&#93;&#62;&#40;&#41;; colorList.add&#40;new String&#91;&#93; &#123; &#34;Red&#34;, &#34;the color red&#34; &#125;&#41;; colorList.add&#40;new String&#91;&#93; &#123; &#34;Green&#34;, &#34;the color [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple example of a ListActivity with a complex layout and ArrayAdapter, allowing us to display items with descriptions.</p>
<p><img src="http://www.terheyden.com/blog/wp-content/uploads/2012/01/1-19-2012-4-03-36-PM.gif" alt="" title="two-line list example" width="244" height="403"/></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CustomTwoLineListActivity <span style="color: #000000; font-weight: bold;">extends</span> ListActivity <span style="color: #009900;">&#123;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">final</span> List<span style="color: #339933;">&lt;</span>String<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> colorList <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> LinkedList<span style="color: #339933;">&lt;</span>String<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        colorList.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;Red&quot;</span>, <span style="color: #0000ff;">&quot;the color red&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        colorList.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;Green&quot;</span>, <span style="color: #0000ff;">&quot;the color green&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        colorList.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;Blue&quot;</span>, <span style="color: #0000ff;">&quot;the color blue&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// Note - we're specifying android.R.id.text1 as a param, but it's ignored</span>
        <span style="color: #666666; font-style: italic;">// because we override getView(). That param usually tells ArrayAdapter</span>
        <span style="color: #666666; font-style: italic;">// where to find the one TextView entity in a complex layout.</span>
        <span style="color: #666666; font-style: italic;">// If our layout was a simple TextView (like android.R.layout.simple_list_item_1),</span>
        <span style="color: #666666; font-style: italic;">// we wouldn't need that param.</span>
        setListAdapter<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ArrayAdapter<span style="color: #339933;">&lt;</span>String<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>
            <span style="color: #000000; font-weight: bold;">this</span>,
            android.<span style="color: #006633;">R</span>.<span style="color: #006633;">layout</span>.<span style="color: #006633;">simple_list_item_2</span>,
            android.<span style="color: #006633;">R</span>.<span style="color: #006633;">id</span>.<span style="color: #006633;">text1</span>,
            colorList<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            @Override
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">View</span> getView<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> position, <span style="color: #003399;">View</span> convertView, ViewGroup parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">// Must always return just a View.</span>
                <span style="color: #003399;">View</span> view <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getView</span><span style="color: #009900;">&#40;</span>position, convertView, parent<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">// If you look at the android.R.layout.simple_list_item_2 source, you'll see</span>
                <span style="color: #666666; font-style: italic;">// it's a TwoLineListItem with 2 TextViews - text1 and text2.</span>
                <span style="color: #666666; font-style: italic;">//TwoLineListItem listItem = (TwoLineListItem) view;</span>
                <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> entry <span style="color: #339933;">=</span> colorList.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>position<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                TextView text1 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>TextView<span style="color: #009900;">&#41;</span> view.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">R</span>.<span style="color: #006633;">id</span>.<span style="color: #006633;">text1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                TextView text2 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>TextView<span style="color: #009900;">&#41;</span> view.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>android.<span style="color: #006633;">R</span>.<span style="color: #006633;">id</span>.<span style="color: #006633;">text2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                text1.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>entry<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                text2.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>entry<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">return</span> view<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=162</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android: Creating an AlertDialog with an EditText box</title>
		<link>http://www.terheyden.com/blog/?p=157</link>
		<comments>http://www.terheyden.com/blog/?p=157#comments</comments>
		<pubDate>Thu, 19 Jan 2012 01:14:38 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[android dev]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=157</guid>
		<description><![CDATA[Here is a simple example of an Activity that displays a dialog (AlertDialog) with a text input field (EditText) box. &#160; &#160; public class DialogActivity extends Activity &#123; &#160; private static final String TAG = &#34;DialogActivity&#34;; private static final int DLG_EXAMPLE1 = 0; private static final int TEXT_ID = 0; &#160; @Override public void onCreate&#40;Bundle [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple example of an Activity that displays a dialog (AlertDialog) with a text input field (EditText) box.</p>
<p><img title="Example AlertDialog with an EditText widget" src="http://www.terheyden.com/blog/wp-content/uploads/2012/01/1-18-2012-4-58-06-PM.gif" alt="" width="241" height="398" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DialogActivity <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> TAG <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;DialogActivity&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> DLG_EXAMPLE1 <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> TEXT_ID <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        setContentView<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">dialog_activity</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onButtonClick<span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span> button<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Creates the dialog if necessary, then shows it.</span>
        <span style="color: #666666; font-style: italic;">// Will show the same dialog if called multiple times.</span>
        showDialog<span style="color: #009900;">&#40;</span>DLG_EXAMPLE1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Called to create a dialog to be shown.
     */</span>
    @Override
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #003399;">Dialog</span> onCreateDialog<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">case</span> DLG_EXAMPLE1<span style="color: #339933;">:</span>
                <span style="color: #000000; font-weight: bold;">return</span> createExampleDialog<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span>
                <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * If a dialog has already been created,
     * this is called to reset the dialog
     * before showing it a 2nd time. Optional.
     */</span>
    @Override
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> onPrepareDialog<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> id, <span style="color: #003399;">Dialog</span> dialog<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">case</span> DLG_EXAMPLE1<span style="color: #339933;">:</span>
                <span style="color: #666666; font-style: italic;">// Clear the input box.</span>
                EditText text <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>EditText<span style="color: #009900;">&#41;</span> dialog.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>TEXT_ID<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                text.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Create and return an example alert dialog with an edit text box.
     */</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Dialog</span> createExampleDialog<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        AlertDialog.<span style="color: #006633;">Builder</span> builder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AlertDialog.<span style="color: #006633;">Builder</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        builder.<span style="color: #006633;">setTitle</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hello User&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        builder.<span style="color: #006633;">setMessage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;What is your name:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
         <span style="color: #666666; font-style: italic;">// Use an EditText view to get user input.</span>
         <span style="color: #000000; font-weight: bold;">final</span> EditText input <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> EditText<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         input.<span style="color: #006633;">setId</span><span style="color: #009900;">&#40;</span>TEXT_ID<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         builder.<span style="color: #006633;">setView</span><span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        builder.<span style="color: #006633;">setPositiveButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Ok&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> DialogInterface.<span style="color: #006633;">OnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            @Override
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>DialogInterface dialog, <span style="color: #000066; font-weight: bold;">int</span> whichButton<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span> value <span style="color: #339933;">=</span> input.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                Log.<span style="color: #006633;">d</span><span style="color: #009900;">&#40;</span>TAG, <span style="color: #0000ff;">&quot;User name: &quot;</span> <span style="color: #339933;">+</span> value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        builder.<span style="color: #006633;">setNegativeButton</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cancel&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> DialogInterface.<span style="color: #006633;">OnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            @Override
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span>DialogInterface dialog, <span style="color: #000066; font-weight: bold;">int</span> which<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">return</span> builder.<span style="color: #006633;">create</span><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: #009900;">&#125;</span></pre></div></div>

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=157</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to REALLY export, import, or otherwise copy your eclipse settings</title>
		<link>http://www.terheyden.com/blog/?p=141</link>
		<comments>http://www.terheyden.com/blog/?p=141#comments</comments>
		<pubDate>Fri, 13 Jan 2012 22:52:31 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=141</guid>
		<description><![CDATA[Eclipse is a great Java IDE, but exporting your meticulously-configured settings is a huge pain. (As of Eclipse 3.7, anyway!) Of course, there&#8217;s the &#8220;export preferences&#8221; command, which can be found via: File &#62; Export &#62; General &#62; Preferences, which will export code styles, compiler settings, and key bindings. But what about the all-important syntax highlighting and the huge [...]]]></description>
			<content:encoded><![CDATA[<p>Eclipse is a great Java IDE, but exporting your meticulously-configured settings is a huge pain. (As of Eclipse 3.7, anyway!)</p>
<p>Of course, there&#8217;s the &#8220;export preferences&#8221; command, which can be found via: <strong>File &gt; Export &gt; General &gt; Preferences</strong>, which<em> will</em> export code styles, compiler settings, and key bindings. But what about the all-important <em>syntax highlighting</em> and the huge number of other settings tucked away under the <strong>Preferences</strong> menu?</p>
<p>It turns out there are a lot of other important settings that don&#8217;t get carried over via the <strong>Export</strong> command. However, there are text files you can copy from one workspace to another to truly copy your old settings. They are:</p>
<ul>
<li>*.prefs files</li>
<ul>
<li>Syntax highlighting, templates, all sorts of settings</li>
</ul>
<li>dialog_settings.xml files</li>
<ul>
<li>Settings for many IDE dialogs</li>
</ul>
<li>workbench.xml files</li>
<ul>
<li>IDE settings, such as &#8220;show heap space&#8221;</li>
</ul>
</ul>
<p>I&#8217;ve written two Windows batch file scripts to automate the process of exporting and importing <strong><em>all</em></strong> of your Eclipse settings. The process is simple.</p>
<ol>
<li>Run <a title="export_eclipse.bat" href="http://www.terheyden.com/blog/wp-content/uploads/2012/01/export_eclipse.bat" target="_blank">export_eclipse.bat</a> &#8211; this will export your workspace settings to a local dir named <strong><em>eclipse-settings</em></strong></li>
<li>(If you are importing to a different computer, copy the <strong><em>eclipse-settings</em></strong> dir to the target computer)</li>
<li>Run <a title="import_eclipse.bat" href="http://www.terheyden.com/blog/wp-content/uploads/2012/01/import_eclipse.bat" target="_blank">import_eclipse.bat</a> &#8211; this will backup your old settings, then copy over your exported settings</li>
</ol>
<p>That&#8217;s pretty much it &#8211; run the scripts, they&#8217;ll do the rest. Let me know how it goes for you. Tested on Eclipse 3.7 and SpringSource Tool Suite 2.8.1. Windows 7.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=141</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone iOS 5 vs. Android OS 4</title>
		<link>http://www.terheyden.com/blog/?p=134</link>
		<comments>http://www.terheyden.com/blog/?p=134#comments</comments>
		<pubDate>Fri, 06 Jan 2012 18:48:13 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=134</guid>
		<description><![CDATA[Background: I&#8217;ve been an avid iPhone user since the first iPhone came out. I&#8217;ve been upgrading every 2 years, in alignment with my phone contract expiring. So I&#8217;ve had the iPhone 1, and the iPhone 3GS. I was looking forward to upgrading to the iPhone 4S this year, but the lackluster hardware specs finally turned [...]]]></description>
			<content:encoded><![CDATA[<p>Background: I&#8217;ve been an avid iPhone user since the first iPhone came out. I&#8217;ve been upgrading every 2 years, in alignment with my phone contract expiring. So I&#8217;ve had the iPhone 1, and the iPhone 3GS. I was looking forward to upgrading to the iPhone 4S this year, but the lackluster hardware specs finally turned me off to the iOS platform; instead I got the Galaxy Nexus &#8211; my first Android phone.</p>
<p>It&#8217;s been about a month since I purchased the Nexus, so I wanted to post my comparison of the two platforms while it was fresh in my mind.</p>
<p><strong>Pros and cons of Android / Galaxy Nexus:</strong></p>
<p>Pros:</p>
<ul>
<li>HUGE gorgeous screen</li>
<li>camera is very fast fast, pics are gorgeous</li>
<li>apps auto-update OTA!</li>
<li>Verizon 4G FTW over AT&amp;T (in San Jose, anyway)</li>
<li>integrated voice recognition is great &#8211; much more integrated than iOS</li>
<li>keyboard is huge and smart &#8211; autocomplete is great</li>
<li>touch vibrate feedback is a simply outstanding feature</li>
<li>notification light is great</li>
<li>open platform! I set a 3rd-party SMS as default!</li>
<li>universal back button is a fantastic OS feature</li>
<li>don&#8217;t have to constantly enter my password to use Android market</li>
<li>can install apps from the market website on my desktop, OTA right to my phone &#8211; no iTunes needed!!</li>
<li>tight 3rd-party OS integration: take a pic with camera, google goggles analyzes it!</li>
<li>programming is easy and fun with Java &#8211; no more &#8220;Objective-C&#8221; crap, or paying $99/year just to write private apps</li>
<li>home screen widgets are neat and responsive</li>
</ul>
<p>Cons:</p>
<ul>
<li>moving icons on the home screen is a pain &#8211; icons don&#8217;t automatically reshuffle</li>
<li>face unlock is useless</li>
<li>volume + power button placement is really annoying</li>
<li>calendar blows &#8211; the UI sucks, adding events sucks</li>
<li>time picker sucks</li>
<li>market apps have viruses</li>
</ul>
<p>Overall I am thrilled by the Galaxy Nexus phone and the Android platform. I was hesitant at first about switching sides, but after experiencing how flexible and intuitive the OS is, and using the massive 4.65&#8243; super AMOLED screen, I can&#8217;t imagine going back to iOS.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=134</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FIXED: JScrollPane scrollbars not appearing</title>
		<link>http://www.terheyden.com/blog/?p=127</link>
		<comments>http://www.terheyden.com/blog/?p=127#comments</comments>
		<pubDate>Thu, 23 Jun 2011 18:18:56 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=127</guid>
		<description><![CDATA[In my CloudCleaner app I have a JSplitPane that contains two JTrees wrapped by JScrollPanes. A user noticed that the JScrollPane scrollbars were not automatically appearing as the trees filled with data. It turns out I had set the &#8216;minimum size&#8217; and &#8216;preferred size&#8217; fields on the JTrees at some point, and this was confusing [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://labs.vmware.com/flings/cloudcleaner">CloudCleaner</a> app I have a JSplitPane that contains two JTrees wrapped by JScrollPanes. A user noticed that the JScrollPane scrollbars were not automatically appearing as the trees filled with data.</p>
<p>It turns out I had set the &#8216;minimum size&#8217; and &#8216;preferred size&#8217; fields on the JTrees at some point, and this was confusing the scroll panes. Using the IntelliJ GUI editor I restored these settings to their default values, and <em>voila</em>, the scrollbars worked again. <img src='http://www.terheyden.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=127</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IntelliJ IDEA &#8211; how to import / export your default layout</title>
		<link>http://www.terheyden.com/blog/?p=110</link>
		<comments>http://www.terheyden.com/blog/?p=110#comments</comments>
		<pubDate>Mon, 25 Apr 2011 23:35:58 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[intellij]]></category>

		<guid isPermaLink="false">http://www.terheyden.com/blog/?p=110</guid>
		<description><![CDATA[In IntelliJ IDEA (best java IDE), for whatever reason, your default UI layout isn&#8217;t preserved when you export / import your settings to another computer. It&#8217;s kind of annoying if you like to keep your IDE&#8217;s in sync across machines. However &#8211; I figured out a workaround. IDEA&#8217;s UI layout is stored with each project. [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.jetbrains.com/idea/">IntelliJ IDEA</a> (best java IDE), for whatever reason, your default UI layout isn&#8217;t preserved when you export / import your settings to another computer. It&#8217;s kind of annoying if you like to keep your IDE&#8217;s in sync across machines.</p>
<p>However &#8211; I figured out a workaround. IDEA&#8217;s UI layout is stored with each project. So you can follow these steps to easily sync your layout:</p>
<ol>
<li>In IntelliJ, create a new, empty java project &#8211; call the project &#8220;intellij-layout&#8221;</li>
<li>Add a <code>main.java</code> class, and put some placeholder code in it&#8230; a <code>void main()</code> method perhaps</li>
<li>Apply your default layout</li>
<li>Save and close the project</li>
<li>Open this project on another machine &#8211; your default layout will be preserved</li>
<li>Save the project&#8217;s layout as the default layout</li>
</ol>
<p>As for how to get the &#8220;intellij-layout&#8221; project onto another machine &#8211; simply copy the entire folder, or just save the project in a <a href="https://www.dropbox.com/">dropbox</a> folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.terheyden.com/blog/?feed=rss2&#038;p=110</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

