<?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>dxmio.com &#187; Personal</title>
	<atom:link href="http://www.dxmio.com/category/personal/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dxmio.com</link>
	<description>&#34;Brevity is the soul of wit.&#34; --William Shakespeare</description>
	<lastBuildDate>Mon, 07 Dec 2009 08:15:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Interview Code Snippets: Part 3</title>
		<link>http://www.dxmio.com/2009/12/07/interview-code-snippets-part-3/</link>
		<comments>http://www.dxmio.com/2009/12/07/interview-code-snippets-part-3/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 08:15:28 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[interview]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=608</guid>
		<description><![CDATA[The latest in this series makes a shift from C++ to Java since that&#8217;s what I&#8217;ve been mucking about with lately. I&#8217;m in a little bit of a time squeeze at the moment so explanations will have to come later (though this code should be fairly readable and obvious what its doing).

import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import [...]]]></description>
			<content:encoded><![CDATA[<p>The latest in this series makes a shift from C++ to Java since that&#8217;s what I&#8217;ve been mucking about with lately. I&#8217;m in a little bit of a time squeeze at the moment so explanations will have to come later (though this code should be fairly readable and obvious what its doing).</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Collection</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.HashMap</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Iterator</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Random</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Program
<span style="color: #009900;">&#123;</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> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		doMatrixSearch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		doMissingNumberSearch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		doFirstUnrepeated<span style="color: #009900;">&#40;</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: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> doFirstUnrepeated<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">String</span> testString <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;nnnnnnnnxxnnpnn&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> testStringChars <span style="color: #339933;">=</span> testString.<span style="color: #006633;">toCharArray</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;">class</span> EntryInfo
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">int</span> count<span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> firstPos<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		HashMap<span style="color: #339933;">&lt;</span>Character, EntryInfo<span style="color: #339933;">&gt;</span> stuff <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;</span>Character, EntryInfo<span style="color: #339933;">&gt;</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><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> testStringChars.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			EntryInfo thisInfo<span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>stuff.<span style="color: #006633;">containsKey</span><span style="color: #009900;">&#40;</span>testStringChars<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				thisInfo <span style="color: #339933;">=</span> stuff.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>testStringChars<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				thisInfo.<span style="color: #006633;">count</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>
				thisInfo <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> EntryInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				thisInfo.<span style="color: #006633;">count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
				thisInfo.<span style="color: #006633;">firstPos</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			stuff.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>testStringChars<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>, thisInfo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">int</span> minPosition <span style="color: #339933;">=</span> testStringChars.<span style="color: #006633;">length</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> 
&nbsp;
		Collection<span style="color: #339933;">&lt;</span>Character<span style="color: #339933;">&gt;</span> coll <span style="color: #339933;">=</span> stuff.<span style="color: #006633;">keySet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		Iterator<span style="color: #339933;">&lt;</span>Character<span style="color: #339933;">&gt;</span> iter <span style="color: #339933;">=</span> coll.<span style="color: #006633;">iterator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">while</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: #003399;">Character</span> thisChar <span style="color: #339933;">=</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>
			EntryInfo thisInfo <span style="color: #339933;">=</span> stuff.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>thisChar<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>thisInfo.<span style="color: #006633;">count</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> thisInfo.<span style="color: #006633;">firstPos</span> <span style="color: #339933;">&lt;</span> minPosition<span style="color: #009900;">&#41;</span>
				minPosition <span style="color: #339933;">=</span> thisInfo.<span style="color: #006633;">firstPos</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<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: #0000ff;">&quot;doFirstUnrepeated():<span style="color: #000099; font-weight: bold;">\t</span> First non-repeater: &quot;</span> <span style="color: #339933;">+</span> testStringChars<span style="color: #009900;">&#91;</span>minPosition<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<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> doMissingNumberSearch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">int</span> minInclusive <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> arr <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span>,<span style="color: #cc66cc;">5</span>,<span style="color: #cc66cc;">6</span>,<span style="color: #cc66cc;">7</span>,<span style="color: #cc66cc;">8</span>,<span style="color: #cc66cc;">9</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> missingNums <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> missingNumsPtr <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">int</span> shouldExist <span style="color: #339933;">=</span> minInclusive<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> arr.<span style="color: #006633;">length</span> <span style="color: #339933;">&amp;&amp;</span> missingNumsPtr <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>arr<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> shouldExist<span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				missingNums<span style="color: #009900;">&#91;</span>missingNumsPtr<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> shouldExist<span style="color: #339933;">;</span>
				missingNumsPtr<span style="color: #339933;">++;</span>
			<span style="color: #009900;">&#125;</span>
			shouldExist<span style="color: #339933;">++;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<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: #0000ff;">&quot;doMissingNumberSearch():<span style="color: #000099; font-weight: bold;">\t</span> Missing nums: &quot;</span> <span style="color: #339933;">+</span> missingNums<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; and &quot;</span> <span style="color: #339933;">+</span> missingNums<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>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<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> doMatrixSearch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">int</span> numRuns <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> numSteps <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> z <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> z <span style="color: #339933;">&lt;</span> numRuns<span style="color: #339933;">;</span> z<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #003399;">Random</span> rnd <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> arr <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">int</span> last <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> y <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> y<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> x <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> x <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> x<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
				<span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">int</span> newval <span style="color: #339933;">=</span> rnd.<span style="color: #006633;">nextInt</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> last<span style="color: #339933;">;</span>
					arr<span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>y<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> newval <span style="color: #339933;">+</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>				
					last <span style="color: #339933;">=</span> newval<span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">int</span> toFind <span style="color: #339933;">=</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>
&nbsp;
			numSteps <span style="color: #339933;">+=</span> matrixSearch<span style="color: #009900;">&#40;</span>arr, toFind<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">double</span> averageSteps <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span><span style="color: #009900;">&#41;</span>numSteps <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span><span style="color: #009900;">&#41;</span>numRuns<span style="color: #339933;">;</span>
&nbsp;
		<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: #0000ff;">&quot;doMatrixSearch():<span style="color: #000099; font-weight: bold;">\t</span> Average steps: &quot;</span> <span style="color: #339933;">+</span> averageSteps<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: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> matrixSearch<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> arr, <span style="color: #000066; font-weight: bold;">int</span> toFind<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">int</span> numSteps <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">int</span> x <span style="color: #339933;">=</span> arr<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">length</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">int</span> y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>x <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">&amp;&amp;</span> y <span style="color: #339933;">&lt;</span> arr.<span style="color: #006633;">length</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			numSteps<span style="color: #339933;">++;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>toFind <span style="color: #339933;">&lt;</span> arr<span style="color: #009900;">&#91;</span>y<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
				x<span style="color: #339933;">--;</span>
			<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>toFind <span style="color: #339933;">&gt;</span> arr<span style="color: #009900;">&#91;</span>y<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
				y<span style="color: #339933;">++;</span>
			<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>toFind <span style="color: #339933;">==</span> arr<span style="color: #009900;">&#91;</span>y<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>x<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
				<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">return</span> numSteps<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/12/07/interview-code-snippets-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coffee and See Plus Plus</title>
		<link>http://www.dxmio.com/2009/10/14/coffee-and-see-plus-plus/</link>
		<comments>http://www.dxmio.com/2009/10/14/coffee-and-see-plus-plus/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 05:45:02 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[C / C++]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[coffee]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[garbage collection]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[programming language]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=575</guid>
		<description><![CDATA[Do you remember the first time you had coffee? A lot of people relate their first experience as a bad one, and that coffee is an acquired taste. I can&#8217;t relate to that because I&#8217;ve always loved coffee, from my very first taste, but I understand the notion, and I want to relate that idea [...]]]></description>
			<content:encoded><![CDATA[<p>Do you remember the first time you had coffee? A lot of people relate their first experience as a bad one, and that coffee is an acquired taste. I can&#8217;t relate to that because I&#8217;ve always loved coffee, from my very first taste, but I understand the notion, and I want to relate that idea to C++ for a minute. C++ is a language that by all modern standards is an awful mess, but one that is arguably most important to learn and understand due to the manual management of the heap and stack. </p>
<p>Ok, so lets say you dive into C++ because you&#8217;re interested in knowing everything there is to know about programming. You discover it&#8217;s like your coffee experience; It&#8217;s bitter, it smells funny, and gives you jitters, but you keep on sipping it because you know it will give you benefits. Fast forward 6 months, and you&#8217;re practically hooking it up to your arm with an IV needle. Now you feel very comfortable with it, and you&#8217;ve learned a significant amount of other related knowledge as a result of your endeavours. You&#8217;re ready to move on to new things, satisfied that you used it as a learning tool, but are you really done with it? Ohh no. </p>
<p>And in that sense, it&#8217;s more like cocaine than coffee. </p>
<p>The gaming industry, or any industry that possesses an interest in high-performance computing applications, is addicted to C++. Regardless of how far garbage collection has come, or how good virtualization abstractions have gotten, they cling to it proclaiming &#8220;JUST ONE MORE HIT MAN, JUST ONE MORE HIT&#8221;. I sympathize on the one hand because C++ ought to be mandatory learning material for computer science students, but at the same time, haven&#8217;t we come far enough with the performance of other languages that we can just go ahead and take C++ out back of the shed?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/10/14/coffee-and-see-plus-plus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Networking</title>
		<link>http://www.dxmio.com/2009/10/11/networking/</link>
		<comments>http://www.dxmio.com/2009/10/11/networking/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 00:24:48 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[office politics]]></category>
		<category><![CDATA[programming language]]></category>
		<category><![CDATA[spolsky]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=571</guid>
		<description><![CDATA[Today I take another paragraph from one of Joel Spolsky&#8217;s posts and quote it here for emphasis on something I find very important:
&#8220;When a programmer complains about &#8220;politics&#8221;, they mean—very precisely—any situation in which personal considerations outweigh technical considerations. Nothing is more infuriating than when a developer is told to use a certain programming language, [...]]]></description>
			<content:encoded><![CDATA[<p>Today I take another paragraph from one of <a href="http://www.joelonsoftware.com/">Joel Spolsky</a>&#8217;s posts and quote it here for emphasis on something I find very important:</p>
<blockquote><p><em>&#8220;When a programmer complains about &#8220;politics&#8221;, they mean—very precisely—any situation in which personal considerations outweigh technical considerations. Nothing is more infuriating than when a developer is told to use a certain programming language, not the best one for the task at hand, because the boss likes it. Nothing is more maddening than when people are promoted because of their ability to network rather than being promoted strictly on merit. Nothing is more aggravating to a developer than being forced to do something that is technically inferior because someone higher than them in the organization, or someone better-connected, insists on it.&#8221;</em></p></blockquote>
<blockquote><p><em>&#8220;You do have to pay competitively, but all said, of all the things that programmers look at in deciding where to work, as long as the salaries are basically fair, they will be surprisingly low on their list of considerations, and offering high salaries is a surprisingly ineffective tool in overcoming problems like the fact that programmers get 15&#8243; monitors and salespeople yell at them all the time and the job involves making nuclear weapons out of baby seals.&#8221;</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/10/11/networking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vision</title>
		<link>http://www.dxmio.com/2009/10/06/vision/</link>
		<comments>http://www.dxmio.com/2009/10/06/vision/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 05:46:09 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[vision]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=566</guid>
		<description><![CDATA[&#8220;If somebody tells you that the job of a bricklayer is to lay bricks on bricks then you will probably not want to be a bricklayer. But what if somebody told you about building a cathedral? It is the same with programming. You need a vision to make it meaningful.&#8221;
]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>&#8220;If somebody tells you that the job of a bricklayer is to lay bricks on bricks then you will probably not want to be a bricklayer. But what if somebody told you about building a cathedral? It is the same with programming. You need a vision to make it meaningful.&#8221;</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/10/06/vision/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Abstractions</title>
		<link>http://www.dxmio.com/2009/10/02/abstractions/</link>
		<comments>http://www.dxmio.com/2009/10/02/abstractions/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 05:04:15 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[EWU]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=564</guid>
		<description><![CDATA[Today I went back and re-read Joel Spolsky&#8217;s advice The Law of Leaky Abstractions and it hits a nail on the head about what peers from EWU were missing: 
&#8220;Learn how to do it manually first, then use abstractions to save time. Code generation tools which pretend to abstract out something, like all abstractions, leak, [...]]]></description>
			<content:encoded><![CDATA[<p>Today I went back and re-read Joel Spolsky&#8217;s advice <strong>The Law of Leaky Abstractions</strong> and it hits a nail on the head about what peers from EWU were missing: </p>
<p><em>&#8220;Learn how to do it manually first, then use abstractions to save time. Code generation tools which pretend to abstract out something, like all abstractions, leak, and the only way to deal with the leaks competently is to learn about how the abstractions work and what they are abstracting. So the abstractions save us time working, but they don&#8217;t save us time learning. And all this means that paradoxically, even as we have higher and higher level programming tools with better and better abstractions, <strong>becoming a proficient programmer is getting harder and harder</strong>.&#8221; </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/10/02/abstractions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Computer</title>
		<link>http://www.dxmio.com/2009/09/13/new-computer/</link>
		<comments>http://www.dxmio.com/2009/09/13/new-computer/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 19:37:53 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[case]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[hard drive]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[motherboard]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[newegg]]></category>
		<category><![CDATA[power supply]]></category>
		<category><![CDATA[processor]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[video card]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=559</guid>
		<description><![CDATA[New gaming system on its way from Newegg:

Antec Nine Hundred Black Steel ATX Mid Tower Case
Dell 2408WFP 24&#8243; Monitor
GIGABYTE GA-P55-UD4P Intel P55 ATX Intel Motherboard
BFG Tech GeForce GTX295 1792MB 896-bit GDDR3 PCI-E2 x16 Video Card
CORSAIR CMPSU-850TX 850W Power Supply
Intel Core i5 750 Lynnfield 2.66GHz Quad-Core Processor
G.SKILL 4GB DDR3 SDRAM DDR3 1600 Dual Channel Memory
Western Digital [...]]]></description>
			<content:encoded><![CDATA[<p>New gaming system on its way from Newegg:</p>
<ul>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811129021">Antec Nine Hundred Black Steel ATX Mid Tower Case</a></li>
<li><a href="http://www.dell.com/us/en/dfo/peripherals/monitor_2408wfp/pd.aspx?refid=monitor_2408wfp&#038;s=dfo">Dell 2408WFP 24&#8243; Monitor</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813128400">GIGABYTE GA-P55-UD4P Intel P55 ATX Intel Motherboard</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16814143192">BFG Tech GeForce GTX295 1792MB 896-bit GDDR3 PCI-E2 x16 Video Card</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16817139009">CORSAIR CMPSU-850TX 850W Power Supply</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16819115215">Intel Core i5 750 Lynnfield 2.66GHz Quad-Core Processor</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820231193">G.SKILL 4GB DDR3 SDRAM DDR3 1600 Dual Channel Memory</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822136351">Western Digital Caviar WD15EADS 1.5TB SATA 3.0Gb/s Hard Drive</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16826104076">Logitech G5 7 Button USB Wired Laser Mouse</a></li>
<li><a href="http://www.microsoft.com/hardware/mouseandkeyboard/productdetails.aspx?pid=030">Microsoft Digital Multimedia Pro Keyboard</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/09/13/new-computer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fall 2009</title>
		<link>http://www.dxmio.com/2009/08/12/fall-2009/</link>
		<comments>http://www.dxmio.com/2009/08/12/fall-2009/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 01:37:37 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Call of Duty 4]]></category>
		<category><![CDATA[Demigod]]></category>
		<category><![CDATA[Food and Wine]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Team Fortress 2]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[apartment]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[dota]]></category>
		<category><![CDATA[economy]]></category>
		<category><![CDATA[family]]></category>
		<category><![CDATA[friends]]></category>
		<category><![CDATA[furtniture]]></category>
		<category><![CDATA[government]]></category>
		<category><![CDATA[lanparty]]></category>
		<category><![CDATA[moving]]></category>
		<category><![CDATA[seattle]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[team fortress 2]]></category>
		<category><![CDATA[tri-cities]]></category>
		<category><![CDATA[wine]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=553</guid>
		<description><![CDATA[I spent several months trying to locate a job in Seattle, but the economic situation displaced a lot of software developers who are now vying for the same positions as college graduates. I had many interviews and leads in Seattle, but in the end it proved too competitive to break into. Now that the ink [...]]]></description>
			<content:encoded><![CDATA[<p>I spent several months trying to locate a job in Seattle, but the economic situation displaced a lot of software developers who are now vying for the same positions as college graduates. I had many interviews and leads in Seattle, but in the end it proved too competitive to break into. Now that the ink has dried, I can reveal that instead I&#8217;ve been hired by a government research lab to do software maintenance in the Tri-Cities. This works out in the end since I have friends and family here. I know the area, the pay is good, and I&#8217;ll be doing what I like.</p>
<p>Since moving back, I&#8217;ve reconnected with friends from years past. There are two groups of friends, both of which who hold LANparties on a frequent basis, which is great. A lot of the problems that I&#8217;ve alluded to in the past about friends in this town have worked themselves out, so maybe karma exists after all. At any rate (I seem to be using the cliche &#8216;At any rate&#8217; often this week&#8230;), Susanna and I have a great new apartment, things to keep me entertained, friends to hang out with, and a stable job with great potential for advancement.</p>
<p>Seeing as how the Tri-Cities is wine country, I figured I&#8217;d ought to educate myself on wine and try all the different types around here. I&#8217;ll probably create a page on this website with wine reviews, and possibly open it to others to add to. So far, my favorites are a 2005 Hogue Late Harvest Reisling, and a 2006 Maryhill Cabernet Sauvignon. I have an iPhone app that gives me pointers on local wines that have won awards and where to find them, which is handy. Any advice on wine is greatly appreciated.</p>
<p>With all the LANparties I&#8217;ve gone to, I&#8217;ve started gaming more. So far I&#8217;ve been playing Team Fortress 2, Call of Duty 4, and a new game Demigod. Demigod is interesting because it&#8217;s the same idea as Warcraft 3: DOTA, but simplified and streamlined. Apparently the network code for the game was atrocious at release, but has since been greatly improved due to the popularity of the game.</p>
<p>Susanna and I haven&#8217;t moved all of our things from our old apartment yet, because my new employer is processing paperwork to pay for my relocation. Instead, we&#8217;ve moved the small stuff; Computers, food, hygiene, TV, couch, etc. It&#8217;s a very large apartment and without our furniture, it seems vacant at times.</p>
<p>Look for that wine review page soon. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/08/12/fall-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pink Floyd Again</title>
		<link>http://www.dxmio.com/2009/07/11/pink-floyd-again/</link>
		<comments>http://www.dxmio.com/2009/07/11/pink-floyd-again/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 06:59:23 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[pink floyd]]></category>
		<category><![CDATA[syd barrett]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=549</guid>
		<description><![CDATA[As a Pink Floyd song came across my iTunes playlist, I was prompted to look them up on wikipedia, youtube, and the like. I also watched a lot of the interviews from the band and others about Syd Barrett. I seem to do this every couple of months, and I always settle on two Pink [...]]]></description>
			<content:encoded><![CDATA[<p>As a Pink Floyd song came across my iTunes playlist, I was prompted to look them up on wikipedia, youtube, and the like. I also watched a lot of the interviews from the band and others about Syd Barrett. I seem to do this every couple of months, and I always settle on two Pink Floyd songs as standing out from the rest, both musically and lyrically. </p>
<p><a href="http://www.youtube.com/watch?v=tkJNyQfAprY">Comfortably Numb</a><br />
<a href="http://www.youtube.com/watch?v=BZSWAkJ3h8E">Shine On You Crazy Diamond</a></p>
<p>This set of lyrics from Comfortably Numb is particularly powerful in its imagery.</p>
<blockquote><p><em>There is no pain, you are receding.<br />
A distant ships smoke on the horizon.<br />
You are only coming through in waves.<br />
Your lips move but I cant hear what youre sayin.<br />
When I was a child I had a fever.<br />
My hands felt just like two balloons.<br />
Now I got that feeling once again.<br />
I cant explain, you would not understand.<br />
This is not how I am.<br />
I have become comfortably numb.</em></p></blockquote>
<p>It would have been really amazing to see Pink Floyd perform live, but sad to say I&#8217;ll have to settle for youtube. I hope there&#8217;s a band as powerful as that in my lifetime, and that I get to see them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/07/11/pink-floyd-again/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Learning page</title>
		<link>http://www.dxmio.com/2009/07/11/learning-page/</link>
		<comments>http://www.dxmio.com/2009/07/11/learning-page/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 02:08:27 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[improve]]></category>
		<category><![CDATA[learn]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=516</guid>
		<description><![CDATA[I kept updating my blog with a list of things I’d like to learn or improve upon, and it seemed redundant to continually copy/paste the information to a new post, just to update it. I would however like to keep the list online, so I’ve moved it to this single location.
]]></description>
			<content:encoded><![CDATA[<p>I kept updating my blog with a list of things I’d like to learn or improve upon, and it seemed redundant to continually copy/paste the information to a new post, just to update it. I would however like to keep the list online, so I’ve moved it to <a href="http://www.dxmio.com/to-learn/">this single location</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/07/11/learning-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Win Friends and Influence People</title>
		<link>http://www.dxmio.com/2009/07/10/how-to-win-friends-and-influence-people/</link>
		<comments>http://www.dxmio.com/2009/07/10/how-to-win-friends-and-influence-people/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 00:44:18 +0000</pubDate>
		<dc:creator>dxmio</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[friends]]></category>
		<category><![CDATA[influence]]></category>
		<category><![CDATA[isolation]]></category>
		<category><![CDATA[stackoverflow]]></category>
		<category><![CDATA[world of warcraft]]></category>

		<guid isPermaLink="false">http://www.dxmio.com/?p=494</guid>
		<description><![CDATA[Relating to the previously posted quote.
This is the first book review to hit this blog. I&#8217;m not sure that it will be a reoccurring theme, but it&#8217;s possible.
I&#8217;m a regular user of the site stackoverflow.com, and one of my favorite questions on the site is What non-programming books should programmer&#8217;s read?. In this thread, one [...]]]></description>
			<content:encoded><![CDATA[<p>Relating to the previously posted quote.</p>
<p>This is the first book review to hit this blog. I&#8217;m not sure that it will be a reoccurring theme, but it&#8217;s possible.</p>
<p>I&#8217;m a regular user of the site <a href="http://www.stackoverflow.com">stackoverflow.com</a>, and one of my favorite questions on the site is <a href="http://stackoverflow.com/questions/38210/what-non-programming-books-should-programmers-read">What non-programming books should programmer&#8217;s read?</a>. In this thread, one of the books caught my eye: <a href="http://en.wikipedia.org/wiki/How_to_Win_Friends_and_Influence_People">How to Win Friends and Influence People</a>, by Dale Carnegie.</p>
<p>Why did this book catch my eye? Frequently I&#8217;ve found myself being torn between two opposing factions of thought. One the one side I acknowledge that I&#8217;m an isolated creature (to a comfortable extent), and I really don&#8217;t mind the isolation. Isolation can be valuable, it lets you explore things in a deeper way that you might otherwise be able to with distractions. Isolation can also help you understand things on a deeper level, such as programming. The other side is a nagging acknowledgment that it&#8217;s pretty much impossible to advance in a given career without collaboration or building social ties within a company. So, in that vein, I picked up an audio edition of the book, and have been listening to it over the past week while I play <a href="http://www.worldofwarcraft.com">World of Warcraft</a>.</p>
<p>This book will not teach you revolutionary concepts. You&#8217;ll spend most of the time remarking at how obvious these ideas are, until you come to the realization that, &#8220;I don&#8217;t actually <strong>implement</strong> these obvious truths&#8221;. The bulk of the material is an expansion of each of the core principles by way of examples. Some of the examples might seem dated, and they are, but the book was written in the early half of the last century, so it&#8217;s understandable. Even with the examples being dated, the ideas from them are still true today, and the subject matter or settings are largely just for illustration.</p>
<p>A lot of what I&#8217;ve said here seems ambiguous as to the purpose of the book, but the title sums it up pretty well. It&#8217;ll teach you how to get people to your way of thinking, or how to manipulate (this word has such negative connotations&#8230;) peoples way of thinking with simple leverage. For simplicity sake, and to give you a taste of why you should read the book, here are the core principles in list form:</p>
<p><strong>Fundamental Techniques in Handling People</strong></p>
<ol>
<li>Don&#8217;t criticize, condemn, or complain.</li>
<li>Give honest and sincere appreciation.</li>
<li>Arouse in the other person an eager want.</li>
</ol>
<p><strong>Six Ways to Make People Like You</strong></p>
<ol>
<li> Become genuinely interested in other people.</li>
<li>Smile.</li>
<li>Remember that a man&#8217;s Name is to him the sweetest and most important sound in any language.</li>
<li>Be a good listener. Encourage others to talk about themselves.</li>
<li>Talk in the terms of the other man&#8217;s interest.</li>
<li>Make the other person feel important and do it sincerely.</li>
</ol>
<p><strong>Twelve Ways to Win People to Your Way of Thinking</strong></p>
<ol>
<li> Avoid arguments.</li>
<li>Show respect for the other person&#8217;s opinions. Never tell someone they are wrong.</li>
<li>If you&#8217;re wrong, admit it quickly and emphatically.</li>
<li>Begin in a friendly way.</li>
<li>Start with questions the other person will answer yes to.</li>
<li>Let the other person do the talking.</li>
<li>Let the other person feel the idea is his/hers.</li>
<li>Try honestly to see things from the other person&#8217;s point of view.</li>
<li>Sympathize with the other person.</li>
<li>Appeal to noble motives.</li>
<li>Dramatize your ideas.</li>
<li>Throw down a challenge.</li>
</ol>
<p><strong>Be a Leader: How to Change People Without Giving Offense or Arousing Resentment</strong></p>
<ol>
<li> Begin with praise and honest appreciation.</li>
<li>Call attention to other people&#8217;s mistakes indirectly.</li>
<li>Talk about your own mistakes first.</li>
<li>Ask questions instead of directly giving orders.</li>
<li>Let the other person save face.</li>
<li>Praise every improvement.</li>
<li>Give them a fine reputation to live up to.</li>
<li>Encourage them by making their faults seem easy to correct.</li>
<li>Make the other person happy about doing what you suggest.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.dxmio.com/2009/07/10/how-to-win-friends-and-influence-people/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
